@memtensor/memos-local-openclaw-plugin 0.3.9 → 0.3.11
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 +13 -27
- package/dist/viewer/html.d.ts +1 -1
- package/dist/viewer/html.d.ts.map +1 -1
- package/dist/viewer/html.js +2 -1
- package/dist/viewer/html.js.map +1 -1
- package/index.ts +67 -23
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.cjs +64 -9
- package/src/viewer/html.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/viewer/html.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/viewer/html.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,qtmOAkrHf,CAAC"}
|
package/dist/viewer/html.js
CHANGED
|
@@ -82,7 +82,8 @@ input,textarea,select{font-family:inherit;font-size:inherit}
|
|
|
82
82
|
.auth-screen{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:20px;background:linear-gradient(135deg,rgb(36,0,255) 0%,rgb(0,135,255) 35%,rgb(108,39,157) 70%,rgb(105,30,255) 100%);position:relative;overflow:hidden}
|
|
83
83
|
.auth-card{background:hsl(0 0% 100%);border:none;border-radius:8px;padding:48px 40px;width:100%;max-width:420px;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);text-align:center;position:relative;z-index:1}
|
|
84
84
|
.auth-card .logo{margin:0 auto 20px;text-align:center;line-height:0;background:none;border-radius:0}
|
|
85
|
-
.auth-card .logo svg{filter:drop-shadow(0 0 16px rgba(255,77,77,.35))}
|
|
85
|
+
.auth-card .logo svg{filter:drop-shadow(0 0 16px rgba(255,77,77,.35));animation:logoFloat 3s ease-in-out infinite}
|
|
86
|
+
@keyframes logoFloat{0%,100%{transform:translateY(0);filter:drop-shadow(0 0 16px rgba(255,77,77,.35))}50%{transform:translateY(-6px);filter:drop-shadow(0 0 24px rgba(255,77,77,.55))}}
|
|
86
87
|
.auth-card h1{font-size:22px;font-weight:700;margin-bottom:4px;color:hsl(0 0% 3.9%);letter-spacing:-.02em}
|
|
87
88
|
.auth-card p{color:hsl(0 0% 45.1%);margin-bottom:24px;font-size:14px}
|
|
88
89
|
.auth-card input{width:100%;padding:12px 16px;border:1px solid hsl(0 0% 89.8%);border-radius:8px;font-size:14px;transition:all .2s;margin-bottom:10px;outline:none;background:#fff;color:hsl(0 0% 3.9%)}
|
package/dist/viewer/html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/viewer/html.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG
|
|
1
|
+
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/viewer/html.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAkrHlB,CAAC"}
|
package/index.ts
CHANGED
|
@@ -75,33 +75,77 @@ const memosLocalPlugin = {
|
|
|
75
75
|
configSchema: pluginConfigSchema,
|
|
76
76
|
|
|
77
77
|
register(api: OpenClawPluginApi) {
|
|
78
|
+
// ─── Ensure better-sqlite3 native module is available ───
|
|
79
|
+
let sqliteReady = false;
|
|
78
80
|
try {
|
|
79
81
|
require("better-sqlite3");
|
|
82
|
+
sqliteReady = true;
|
|
80
83
|
} catch (_e) {
|
|
84
|
+
// Not ready — attempt auto-rebuild
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!sqliteReady) {
|
|
81
88
|
const pluginDir = path.dirname(new URL(import.meta.url).pathname);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
89
|
+
api.logger.warn(`memos-local: better-sqlite3 not found, attempting auto-rebuild in ${pluginDir} ...`);
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
const { spawnSync } = require("child_process");
|
|
93
|
+
const rebuildResult = spawnSync("npm", ["rebuild", "better-sqlite3"], {
|
|
94
|
+
cwd: pluginDir,
|
|
95
|
+
stdio: "pipe",
|
|
96
|
+
shell: true,
|
|
97
|
+
timeout: 120_000,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const stdout = rebuildResult.stdout?.toString() || "";
|
|
101
|
+
const stderr = rebuildResult.stderr?.toString() || "";
|
|
102
|
+
if (stdout) api.logger.info(`memos-local: rebuild stdout: ${stdout.slice(0, 500)}`);
|
|
103
|
+
if (stderr) api.logger.warn(`memos-local: rebuild stderr: ${stderr.slice(0, 500)}`);
|
|
104
|
+
|
|
105
|
+
if (rebuildResult.status === 0) {
|
|
106
|
+
// Clear require cache and retry
|
|
107
|
+
try {
|
|
108
|
+
delete require.cache[require.resolve("better-sqlite3")];
|
|
109
|
+
} catch { /* ignore */ }
|
|
110
|
+
try {
|
|
111
|
+
require("better-sqlite3");
|
|
112
|
+
sqliteReady = true;
|
|
113
|
+
api.logger.info("memos-local: better-sqlite3 auto-rebuild succeeded!");
|
|
114
|
+
} catch (retryErr) {
|
|
115
|
+
api.logger.warn(`memos-local: rebuild exited 0 but module still fails: ${retryErr}`);
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
api.logger.warn(`memos-local: rebuild exited with code ${rebuildResult.status}`);
|
|
119
|
+
}
|
|
120
|
+
} catch (rebuildErr) {
|
|
121
|
+
api.logger.warn(`memos-local: auto-rebuild error: ${rebuildErr}`);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (!sqliteReady) {
|
|
125
|
+
const msg = [
|
|
126
|
+
"",
|
|
127
|
+
"╔══════════════════════════════════════════════════════════════╗",
|
|
128
|
+
"║ MemOS Local Memory — better-sqlite3 native module missing ║",
|
|
129
|
+
"╠══════════════════════════════════════════════════════════════╣",
|
|
130
|
+
"║ ║",
|
|
131
|
+
"║ Auto-rebuild failed. Run these commands manually: ║",
|
|
132
|
+
"║ ║",
|
|
133
|
+
`║ cd ${pluginDir}`,
|
|
134
|
+
"║ npm rebuild better-sqlite3 ║",
|
|
135
|
+
"║ openclaw gateway stop && openclaw gateway start ║",
|
|
136
|
+
"║ ║",
|
|
137
|
+
"║ If rebuild fails, install build tools first: ║",
|
|
138
|
+
"║ macOS: xcode-select --install ║",
|
|
139
|
+
"║ Linux: sudo apt install build-essential python3 ║",
|
|
140
|
+
"║ ║",
|
|
141
|
+
"╚══════════════════════════════════════════════════════════════╝",
|
|
142
|
+
"",
|
|
143
|
+
].join("\n");
|
|
144
|
+
api.logger.warn(msg);
|
|
145
|
+
throw new Error(
|
|
146
|
+
`better-sqlite3 native module not found. Auto-rebuild failed. Fix: cd ${pluginDir} && npm rebuild better-sqlite3`
|
|
147
|
+
);
|
|
148
|
+
}
|
|
105
149
|
}
|
|
106
150
|
|
|
107
151
|
const pluginCfg = (api.pluginConfig ?? {}) as Record<string, unknown>;
|
package/openclaw.plugin.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"openclaw": ">=2026.2.0"
|
|
22
22
|
},
|
|
23
23
|
"setup": {
|
|
24
|
-
"postInstall": "
|
|
24
|
+
"postInstall": "node scripts/postinstall.cjs",
|
|
25
25
|
"notes": [
|
|
26
26
|
"After install, add to ~/.openclaw/openclaw.json: plugins.slots.memory = \"memos-local-openclaw-plugin\"",
|
|
27
27
|
"Set agents.defaults.memorySearch.enabled = false to disable OpenClaw's built-in memory",
|
package/package.json
CHANGED
package/scripts/postinstall.cjs
CHANGED
|
@@ -18,6 +18,64 @@ function warn(msg) { console.log(`${YELLOW}[memos-local]${RESET} ${msg}`); }
|
|
|
18
18
|
function ok(msg) { console.log(`${GREEN}[memos-local]${RESET} ${msg}`); }
|
|
19
19
|
function fail(msg) { console.log(`${RED}[memos-local]${RESET} ${msg}`); }
|
|
20
20
|
|
|
21
|
+
const pluginDir = path.resolve(__dirname, "..");
|
|
22
|
+
|
|
23
|
+
console.log(`
|
|
24
|
+
${CYAN}${BOLD}┌──────────────────────────────────────────────────┐
|
|
25
|
+
│ MemOS Local Memory — postinstall │
|
|
26
|
+
└──────────────────────────────────────────────────┘${RESET}
|
|
27
|
+
`);
|
|
28
|
+
|
|
29
|
+
log(`Plugin dir: ${DIM}${pluginDir}${RESET}`);
|
|
30
|
+
log(`Node: ${process.version} Platform: ${process.platform}-${process.arch}`);
|
|
31
|
+
|
|
32
|
+
/* ═══════════════════════════════════════════════════════════
|
|
33
|
+
* Phase 0: Ensure all dependencies are installed
|
|
34
|
+
* ═══════════════════════════════════════════════════════════ */
|
|
35
|
+
|
|
36
|
+
function ensureDependencies() {
|
|
37
|
+
const coreDeps = ["@sinclair/typebox", "uuid", "posthog-node", "@huggingface/transformers"];
|
|
38
|
+
const missing = [];
|
|
39
|
+
for (const dep of coreDeps) {
|
|
40
|
+
try {
|
|
41
|
+
require.resolve(dep, { paths: [pluginDir] });
|
|
42
|
+
} catch {
|
|
43
|
+
missing.push(dep);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (missing.length === 0) {
|
|
48
|
+
ok("All dependencies present.");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
warn(`Missing dependencies: ${missing.join(", ")}`);
|
|
53
|
+
log("Running: npm install --omit=dev (this may take a moment)...");
|
|
54
|
+
|
|
55
|
+
const startMs = Date.now();
|
|
56
|
+
const result = spawnSync("npm", ["install", "--omit=dev"], {
|
|
57
|
+
cwd: pluginDir,
|
|
58
|
+
stdio: "inherit",
|
|
59
|
+
shell: true,
|
|
60
|
+
timeout: 120_000,
|
|
61
|
+
});
|
|
62
|
+
const elapsed = ((Date.now() - startMs) / 1000).toFixed(1);
|
|
63
|
+
|
|
64
|
+
if (result.status === 0) {
|
|
65
|
+
ok(`Dependencies installed (${elapsed}s).`);
|
|
66
|
+
} else {
|
|
67
|
+
fail(`npm install exited with code ${result.status} (${elapsed}s).`);
|
|
68
|
+
warn("Some features may not work. Try running manually:");
|
|
69
|
+
warn(` cd ${pluginDir} && npm install --omit=dev`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
ensureDependencies();
|
|
75
|
+
} catch (e) {
|
|
76
|
+
warn(`Dependency check skipped: ${e.message}`);
|
|
77
|
+
}
|
|
78
|
+
|
|
21
79
|
/* ═══════════════════════════════════════════════════════════
|
|
22
80
|
* Phase 1: Clean up legacy plugin versions
|
|
23
81
|
* ═══════════════════════════════════════════════════════════ */
|
|
@@ -52,7 +110,6 @@ function cleanupLegacy() {
|
|
|
52
110
|
}
|
|
53
111
|
}
|
|
54
112
|
|
|
55
|
-
// Clean up openclaw.json config — migrate old plugin entries
|
|
56
113
|
const cfgPath = path.join(ocHome, "openclaw.json");
|
|
57
114
|
if (fs.existsSync(cfgPath)) {
|
|
58
115
|
try {
|
|
@@ -67,9 +124,8 @@ function cleanupLegacy() {
|
|
|
67
124
|
if (entries[oldKey]) {
|
|
68
125
|
const oldEntry = entries[oldKey];
|
|
69
126
|
if (!entries["memos-local-openclaw-plugin"]) {
|
|
70
|
-
// Migrate: copy old config to new key
|
|
71
127
|
entries["memos-local-openclaw-plugin"] = oldEntry;
|
|
72
|
-
log(`Migrated config: ${DIM}${oldKey}${RESET}
|
|
128
|
+
log(`Migrated config: ${DIM}${oldKey}${RESET} -> ${GREEN}memos-local-openclaw-plugin${RESET}`);
|
|
73
129
|
}
|
|
74
130
|
delete entries[oldKey];
|
|
75
131
|
cfgChanged = true;
|
|
@@ -77,7 +133,6 @@ function cleanupLegacy() {
|
|
|
77
133
|
}
|
|
78
134
|
}
|
|
79
135
|
|
|
80
|
-
// Fix source path if it points to old directory names
|
|
81
136
|
const newEntry = entries["memos-local-openclaw-plugin"];
|
|
82
137
|
if (newEntry && typeof newEntry.source === "string") {
|
|
83
138
|
const oldSource = newEntry.source;
|
|
@@ -86,14 +141,13 @@ function cleanupLegacy() {
|
|
|
86
141
|
.replace(/memos-lite-openclaw-plugin/g, "memos-local-openclaw-plugin")
|
|
87
142
|
.replace(/memos-lite/g, "memos-local");
|
|
88
143
|
if (newEntry.source !== oldSource) {
|
|
89
|
-
log(`Updated source path: ${DIM}${oldSource}${RESET}
|
|
144
|
+
log(`Updated source path: ${DIM}${oldSource}${RESET} -> ${GREEN}${newEntry.source}${RESET}`);
|
|
90
145
|
cfgChanged = true;
|
|
91
146
|
}
|
|
92
147
|
}
|
|
93
148
|
}
|
|
94
149
|
|
|
95
150
|
if (cfgChanged) {
|
|
96
|
-
// Write back with backup
|
|
97
151
|
const backup = cfgPath + ".bak-" + Date.now();
|
|
98
152
|
fs.copyFileSync(cfgPath, backup);
|
|
99
153
|
fs.writeFileSync(cfgPath, JSON.stringify(cfg, null, 2) + "\n", "utf-8");
|
|
@@ -127,18 +181,18 @@ log("Checking better-sqlite3 native module...");
|
|
|
127
181
|
try {
|
|
128
182
|
require("better-sqlite3");
|
|
129
183
|
ok("better-sqlite3 is ready.");
|
|
184
|
+
console.log(`\n${GREEN}${BOLD}[memos-local] Setup complete!${RESET} Restart the gateway: ${CYAN}openclaw gateway stop && openclaw gateway start${RESET}\n`);
|
|
130
185
|
process.exit(0);
|
|
131
186
|
} catch (_) {
|
|
132
187
|
warn("better-sqlite3 native bindings not found, attempting rebuild...");
|
|
133
188
|
}
|
|
134
189
|
|
|
135
|
-
log(`Node: ${process.version} Platform: ${process.platform}-${process.arch}`);
|
|
136
190
|
log("Running: npm rebuild better-sqlite3 (this may take 30-60 seconds)...");
|
|
137
191
|
|
|
138
192
|
const startMs = Date.now();
|
|
139
193
|
|
|
140
194
|
const result = spawnSync("npm", ["rebuild", "better-sqlite3"], {
|
|
141
|
-
cwd:
|
|
195
|
+
cwd: pluginDir,
|
|
142
196
|
stdio: "inherit",
|
|
143
197
|
shell: true,
|
|
144
198
|
timeout: 180_000,
|
|
@@ -151,6 +205,7 @@ if (result.status === 0) {
|
|
|
151
205
|
delete require.cache[require.resolve("better-sqlite3")];
|
|
152
206
|
require("better-sqlite3");
|
|
153
207
|
ok(`better-sqlite3 rebuilt successfully (${elapsed}s).`);
|
|
208
|
+
console.log(`\n${GREEN}${BOLD}[memos-local] Setup complete!${RESET} Restart the gateway: ${CYAN}openclaw gateway stop && openclaw gateway start${RESET}\n`);
|
|
154
209
|
process.exit(0);
|
|
155
210
|
} catch (_) {
|
|
156
211
|
fail(`Rebuild completed but module still cannot load (${elapsed}s).`);
|
|
@@ -159,7 +214,6 @@ if (result.status === 0) {
|
|
|
159
214
|
fail(`Rebuild failed with exit code ${result.status} (${elapsed}s).`);
|
|
160
215
|
}
|
|
161
216
|
|
|
162
|
-
const pluginDir = path.resolve(__dirname, "..");
|
|
163
217
|
console.log(`
|
|
164
218
|
${YELLOW}${BOLD}╔══════════════════════════════════════════════════════════════╗
|
|
165
219
|
║ better-sqlite3 native module build failed ║
|
|
@@ -176,6 +230,7 @@ ${YELLOW}║${RESET}
|
|
|
176
230
|
${YELLOW}║${RESET} Then retry: ${YELLOW}║${RESET}
|
|
177
231
|
${YELLOW}║${RESET} ${GREEN}cd ${pluginDir}${RESET}
|
|
178
232
|
${YELLOW}║${RESET} ${GREEN}npm rebuild better-sqlite3${RESET} ${YELLOW}║${RESET}
|
|
233
|
+
${YELLOW}║${RESET} ${GREEN}openclaw gateway stop && openclaw gateway start${RESET} ${YELLOW}║${RESET}
|
|
179
234
|
${YELLOW}${BOLD}╚══════════════════════════════════════════════════════════════╝${RESET}
|
|
180
235
|
`);
|
|
181
236
|
|
package/src/viewer/html.ts
CHANGED
|
@@ -79,7 +79,8 @@ input,textarea,select{font-family:inherit;font-size:inherit}
|
|
|
79
79
|
.auth-screen{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:20px;background:linear-gradient(135deg,rgb(36,0,255) 0%,rgb(0,135,255) 35%,rgb(108,39,157) 70%,rgb(105,30,255) 100%);position:relative;overflow:hidden}
|
|
80
80
|
.auth-card{background:hsl(0 0% 100%);border:none;border-radius:8px;padding:48px 40px;width:100%;max-width:420px;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);text-align:center;position:relative;z-index:1}
|
|
81
81
|
.auth-card .logo{margin:0 auto 20px;text-align:center;line-height:0;background:none;border-radius:0}
|
|
82
|
-
.auth-card .logo svg{filter:drop-shadow(0 0 16px rgba(255,77,77,.35))}
|
|
82
|
+
.auth-card .logo svg{filter:drop-shadow(0 0 16px rgba(255,77,77,.35));animation:logoFloat 3s ease-in-out infinite}
|
|
83
|
+
@keyframes logoFloat{0%,100%{transform:translateY(0);filter:drop-shadow(0 0 16px rgba(255,77,77,.35))}50%{transform:translateY(-6px);filter:drop-shadow(0 0 24px rgba(255,77,77,.55))}}
|
|
83
84
|
.auth-card h1{font-size:22px;font-weight:700;margin-bottom:4px;color:hsl(0 0% 3.9%);letter-spacing:-.02em}
|
|
84
85
|
.auth-card p{color:hsl(0 0% 45.1%);margin-bottom:24px;font-size:14px}
|
|
85
86
|
.auth-card input{width:100%;padding:12px 16px;border:1px solid hsl(0 0% 89.8%);border-radius:8px;font-size:14px;transition:all .2s;margin-bottom:10px;outline:none;background:#fff;color:hsl(0 0% 3.9%)}
|