shroud-privacy 2.0.8 → 2.0.9
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/index.js +12 -20
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* and deobfuscates responses before they reach the user.
|
|
6
6
|
*/
|
|
7
7
|
import { existsSync, readFileSync, writeFileSync, copyFileSync, readdirSync, rmSync } from "node:fs";
|
|
8
|
-
import { join
|
|
8
|
+
import { join } from "node:path";
|
|
9
9
|
import { createRequire } from "node:module";
|
|
10
|
-
import { execSync } from "node:child_process";
|
|
11
10
|
import { resolveConfig } from "./config.js";
|
|
12
11
|
import { Obfuscator } from "./obfuscator.js";
|
|
13
12
|
import { registerHooks } from "./hooks.js";
|
|
@@ -42,22 +41,6 @@ function findEventStreamPath(logger) {
|
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
catch { }
|
|
45
|
-
// Fallback: resolve from the openclaw binary
|
|
46
|
-
try {
|
|
47
|
-
const bin = execSync("command -v openclaw", { encoding: "utf8" }).trim();
|
|
48
|
-
if (bin) {
|
|
49
|
-
const binDir = dirname(bin);
|
|
50
|
-
const candidates = [
|
|
51
|
-
join(binDir, "../lib/node_modules/openclaw/node_modules/@mariozechner/pi-ai/dist/utils/event-stream.js"),
|
|
52
|
-
join(binDir, "../node_modules/@mariozechner/pi-ai/dist/utils/event-stream.js"),
|
|
53
|
-
];
|
|
54
|
-
for (const c of candidates) {
|
|
55
|
-
if (existsSync(c))
|
|
56
|
-
return c;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
catch { }
|
|
61
44
|
return null;
|
|
62
45
|
}
|
|
63
46
|
function ensureEventStreamPatched(logger) {
|
|
@@ -98,8 +81,17 @@ function ensureEventStreamPatched(logger) {
|
|
|
98
81
|
}
|
|
99
82
|
catch { }
|
|
100
83
|
}
|
|
101
|
-
logger?.warn("[shroud] Patched pi-ai EventStream for streaming deobfuscation. "
|
|
102
|
-
|
|
84
|
+
logger?.warn("[shroud] Patched pi-ai EventStream for streaming deobfuscation. Restarting gateway...");
|
|
85
|
+
// Auto-restart: send SIGUSR1 to self after a short delay.
|
|
86
|
+
// OpenClaw handles SIGUSR1 as a graceful restart signal.
|
|
87
|
+
setTimeout(() => {
|
|
88
|
+
try {
|
|
89
|
+
process.kill(process.pid, "SIGUSR1");
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
logger?.warn("[shroud] Auto-restart failed. Run: openclaw gateway restart");
|
|
93
|
+
}
|
|
94
|
+
}, 3000);
|
|
103
95
|
}
|
|
104
96
|
catch (err) {
|
|
105
97
|
logger?.warn(`[shroud] Failed to patch event-stream.js: ${String(err)}`);
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "shroud-privacy",
|
|
3
3
|
"name": "Shroud",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.9",
|
|
5
5
|
"description": "Privacy obfuscation with deterministic fake values and deobfuscation — PII never reaches the LLM, tool calls still work",
|
|
6
6
|
"configSchema": {
|
|
7
7
|
"type": "object",
|
package/package.json
CHANGED