shroud-privacy 2.0.8 → 2.0.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/README.md CHANGED
@@ -16,13 +16,12 @@ Privacy obfuscation plugin for [OpenClaw](https://openclaw.ai). Detects sensitiv
16
16
  | Hook | Direction | What happens |
17
17
  |------|-----------|-------------|
18
18
  | `before_prompt_build` | User → LLM | Obfuscate user prompt, prepend privacy context |
19
- | `before_message_write` | Any → History | Obfuscate every message written to the session transcript |
20
- | `before_llm_send` | Context → LLM | Obfuscate LLM messages + install `transformResponse` for deobfuscation (>=2026.3.14) |
19
+ | `before_message_write` | Any → History | Obfuscate non-assistant messages; deobfuscate assistant messages |
21
20
  | `before_tool_call` | LLM → Tool | Deobfuscate tool parameters + track tool chain depth |
22
21
  | `tool_result_persist` | Tool → History | Obfuscate tool results before storing |
23
- | `message_sending` | Agent → User | Deobfuscate outbound messages (WhatsApp, auto-reply, etc.) |
22
+ | `message_sending` | Agent → User | Deobfuscate outbound messages (fallback) |
24
23
 
25
- > **Streaming deobfuscation:** On first load, Shroud automatically patches pi-ai's EventStream to deobfuscate LLM responses. A restart is required to activate the patch.
24
+ > **Streaming deobfuscation:** On first load, Shroud patches pi-ai's EventStream to deobfuscate ALL LLM responses at the stream level — every provider (Anthropic, OpenAI, Google), every channel (Slack, WhatsApp, Telegram, etc.). A single gateway restart activates the patch.
26
25
 
27
26
  ## Install
28
27
 
@@ -423,7 +423,7 @@ export const BUILTIN_PATTERNS = [
423
423
  confidence: 0.75,
424
424
  },
425
425
  // ==========================================================================
426
- // Wave 1: Enterprise / Regulated / Critical Infrastructure
426
+ // Wave 1: Regulated / Critical Infrastructure
427
427
  // ==========================================================================
428
428
  // --- Austrian / EU identifiers ---
429
429
  {
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, dirname } from "node:path";
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
- "Restart OpenClaw to activate: openclaw gateway restart");
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/dist/types.js CHANGED
@@ -24,7 +24,7 @@ export var Category;
24
24
  Category["ROUTE_MAP"] = "route_map";
25
25
  Category["OSPF_ID"] = "ospf_id";
26
26
  Category["ACL_NAME"] = "acl_name";
27
- // Regulated / enterprise categories
27
+ // Regulated / extended categories
28
28
  Category["IBAN"] = "iban";
29
29
  Category["NATIONAL_ID"] = "national_id";
30
30
  Category["JWT"] = "jwt";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "shroud-privacy",
3
3
  "name": "Shroud",
4
- "version": "2.0.8",
4
+ "version": "2.0.10",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shroud-privacy",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "Privacy obfuscation plugin for OpenClaw — detects sensitive data and replaces with deterministic fake values",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",