@memtensor/memos-cloud-openclaw-plugin 0.1.8-beta.6 → 0.1.8-beta.8
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/clawdbot.plugin.json +1 -1
- package/lib/check-update.js +34 -10
- package/moltbot.plugin.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/clawdbot.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "memos-cloud-openclaw-plugin",
|
|
3
3
|
"name": "MemOS Cloud OpenClaw Plugin",
|
|
4
4
|
"description": "MemOS Cloud recall + add memory via lifecycle hooks",
|
|
5
|
-
"version": "0.1.8-beta.
|
|
5
|
+
"version": "0.1.8-beta.8",
|
|
6
6
|
"kind": "lifecycle",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"configSchema": {
|
package/lib/check-update.js
CHANGED
|
@@ -2,14 +2,31 @@ import https from "https";
|
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { fileURLToPath } from "url";
|
|
5
|
-
import { spawn } from "child_process";
|
|
5
|
+
import { spawn, exec } from "child_process";
|
|
6
6
|
import os from "os";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Kill a spawned child process and its entire process tree.
|
|
10
|
+
*/
|
|
11
|
+
function killProcessTree(child) {
|
|
12
|
+
try {
|
|
13
|
+
if (process.platform === "win32") {
|
|
14
|
+
exec(`taskkill /pid ${child.pid} /T /F`, () => {});
|
|
15
|
+
} else {
|
|
16
|
+
// On Unix, kill the process group
|
|
17
|
+
process.kill(-child.pid, "SIGKILL");
|
|
18
|
+
}
|
|
19
|
+
} catch (e) {
|
|
20
|
+
// Fallback: try the basic kill
|
|
21
|
+
try { child.kill("SIGKILL"); } catch (_) {}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
8
25
|
let isUpdating = false;
|
|
9
26
|
|
|
10
27
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
28
|
|
|
12
|
-
const CHECK_INTERVAL = 60 * 1000; // 12 hours check interval
|
|
29
|
+
const CHECK_INTERVAL = 5 * 60 * 1000; // 12 hours check interval
|
|
13
30
|
const UPDATE_TIMEOUT = 3 * 60 * 1000; // 3 minutes timeout for the CLI update command to finish
|
|
14
31
|
const PLUGIN_NAME = "@memtensor/memos-cloud-openclaw-plugin";
|
|
15
32
|
const CHECK_FILE = path.join(os.tmpdir(), "memos_openclaw_update_check.json");
|
|
@@ -161,18 +178,25 @@ export function startUpdateChecker(log) {
|
|
|
161
178
|
})();
|
|
162
179
|
|
|
163
180
|
isUpdating = true;
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
181
|
+
const spawnOpts = { shell: true };
|
|
182
|
+
// On Unix, detach the process so we can kill the entire process group on timeout
|
|
183
|
+
if (process.platform !== "win32") {
|
|
184
|
+
spawnOpts.detached = true;
|
|
185
|
+
}
|
|
186
|
+
const child = spawn(cliName, ["plugins", "update", "memos-cloud-openclaw-plugin"], spawnOpts);
|
|
167
187
|
|
|
168
188
|
// Timeout mechanism: forcefully kill the update process if it hangs for more than the configured timeout
|
|
169
189
|
const updateTimeout = setTimeout(() => {
|
|
170
190
|
log.warn?.(`${ANSI.RED}[memos-cloud] Update process timed out. Please try manually running: ${cliName} plugins update memos-cloud-openclaw-plugin${ANSI.RESET}`);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
191
|
+
killProcessTree(child);
|
|
192
|
+
|
|
193
|
+
// Fallback: if kill failed and the close event never fires, forcefully release the lock after 5 seconds
|
|
194
|
+
setTimeout(() => {
|
|
195
|
+
if (isUpdating) {
|
|
196
|
+
clearInterval(progressInterval);
|
|
197
|
+
isUpdating = false;
|
|
198
|
+
}
|
|
199
|
+
}, 5000);
|
|
176
200
|
}, UPDATE_TIMEOUT);
|
|
177
201
|
|
|
178
202
|
child.stdout.on("data", (data) => {
|
package/moltbot.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "memos-cloud-openclaw-plugin",
|
|
3
3
|
"name": "MemOS Cloud OpenClaw Plugin",
|
|
4
4
|
"description": "MemOS Cloud recall + add memory via lifecycle hooks",
|
|
5
|
-
"version": "0.1.8-beta.
|
|
5
|
+
"version": "0.1.8-beta.8",
|
|
6
6
|
"kind": "lifecycle",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"configSchema": {
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "memos-cloud-openclaw-plugin",
|
|
3
3
|
"name": "MemOS Cloud OpenClaw Plugin",
|
|
4
4
|
"description": "MemOS Cloud recall + add memory via lifecycle hooks",
|
|
5
|
-
"version": "0.1.8-beta.
|
|
5
|
+
"version": "0.1.8-beta.8",
|
|
6
6
|
"kind": "lifecycle",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"configSchema": {
|
package/package.json
CHANGED