openclaw-hybrid-memory-install 2026.2.240 → 2026.2.271
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/install.js +29 -6
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Run: npx -y openclaw-hybrid-memory-install
|
|
6
6
|
* Fix broken credentials config (without loading plugin): npx -y openclaw-hybrid-memory-install fix-config
|
|
7
7
|
*/
|
|
8
|
-
const {
|
|
8
|
+
const { execFileSync } = require("child_process");
|
|
9
9
|
const fs = require("fs");
|
|
10
10
|
const path = require("path");
|
|
11
11
|
|
|
@@ -25,8 +25,31 @@ const tmpDir = path.join(
|
|
|
25
25
|
`openclaw-plugin-install-${process.pid}`
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
function run(cmd, opts = {}) {
|
|
29
|
-
|
|
28
|
+
function run(cmd, args = [], opts = {}) {
|
|
29
|
+
const isWindows = process.platform === "win32";
|
|
30
|
+
|
|
31
|
+
// On Windows, avoid running npm via a shell (cmd.exe) to prevent shell interpretation
|
|
32
|
+
// of arguments that may contain user-controlled data (e.g., version from process.argv).
|
|
33
|
+
if (isWindows && cmd === "npm") {
|
|
34
|
+
let npmExecPath = process.env.npm_execpath;
|
|
35
|
+
if (!npmExecPath) {
|
|
36
|
+
throw new Error(
|
|
37
|
+
"Unable to locate npm safely on Windows (npm_execpath is not set). " +
|
|
38
|
+
"Please run this installer via npm or npx so npm_execpath is available."
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
// When invoked via npx, npm_execpath may point to npx-cli.js instead of npm-cli.js
|
|
42
|
+
// (npm issue #6662). Derive the correct npm-cli.js path.
|
|
43
|
+
if (npmExecPath.endsWith("npx-cli.js")) {
|
|
44
|
+
npmExecPath = npmExecPath.replace("npx-cli.js", "npm-cli.js");
|
|
45
|
+
}
|
|
46
|
+
return execFileSync(process.execPath, [npmExecPath, ...args], {
|
|
47
|
+
stdio: "inherit",
|
|
48
|
+
...opts,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return execFileSync(cmd, args, { stdio: "inherit", ...opts });
|
|
30
53
|
}
|
|
31
54
|
|
|
32
55
|
try {
|
|
@@ -39,7 +62,7 @@ try {
|
|
|
39
62
|
|
|
40
63
|
console.log("Fetching via npm pack...");
|
|
41
64
|
fs.mkdirSync(tmpDir, { recursive: true });
|
|
42
|
-
run(
|
|
65
|
+
run("npm", ["pack", `openclaw-hybrid-memory@${version}`], { cwd: tmpDir });
|
|
43
66
|
|
|
44
67
|
const tgz = fs.readdirSync(tmpDir).find((f) => f.endsWith(".tgz"));
|
|
45
68
|
if (!tgz) throw new Error("npm pack did not produce a .tgz file");
|
|
@@ -47,10 +70,10 @@ try {
|
|
|
47
70
|
console.log("Extracting...");
|
|
48
71
|
fs.mkdirSync(pluginDir, { recursive: true });
|
|
49
72
|
const tgzPath = path.join(tmpDir, tgz);
|
|
50
|
-
run(
|
|
73
|
+
run("tar", ["-xzf", tgzPath, "-C", pluginDir, "--strip-components=1"]);
|
|
51
74
|
|
|
52
75
|
console.log("Installing deps and rebuilding native modules...");
|
|
53
|
-
run("npm install --omit=dev", { cwd: pluginDir });
|
|
76
|
+
run("npm", ["install", "--omit=dev"], { cwd: pluginDir });
|
|
54
77
|
|
|
55
78
|
console.log("Cleaning up...");
|
|
56
79
|
fs.rmSync(tmpDir, { recursive: true, force: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-hybrid-memory-install",
|
|
3
|
-
"version": "2026.02.
|
|
3
|
+
"version": "2026.02.271",
|
|
4
4
|
"description": "Standalone installer for openclaw-hybrid-memory. Use when OpenClaw config validation fails.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"openclaw-hybrid-memory-install": "./install.js"
|