@memtensor/memos-local-openclaw-plugin 0.3.9 → 0.3.10
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/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/package.json +1 -1
- 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/package.json
CHANGED
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%)}
|