shroud-privacy 2.2.1 → 2.2.2

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/hooks.js CHANGED
@@ -182,6 +182,7 @@ export function registerHooks(api, obfuscator) {
182
182
  text = text.replace(/<(https?:\/\/[^>]+)>/g, "$1");
183
183
  return text;
184
184
  }
185
+ const isFirstLoad = !globalThis.__shroudObfuscator;
185
186
  if (!IS_TEST) {
186
187
  const g = globalThis;
187
188
  if (g.__shroudObfuscator) {
@@ -618,7 +619,6 @@ export function registerHooks(api, obfuscator) {
618
619
  }
619
620
  return event;
620
621
  };
621
- api.logger?.info("[shroud] Installed global streaming deobfuscation hook");
622
622
  // -----------------------------------------------------------------------
623
623
  // 7. Global deobfuscation hook for channel delivery (defense-in-depth).
624
624
  // Primary deobfuscation happens in the fetch response interceptor (8).
@@ -630,7 +630,6 @@ export function registerHooks(api, obfuscator) {
630
630
  return text;
631
631
  return ob().deobfuscate(text);
632
632
  };
633
- api.logger?.info("[shroud] Registered globalThis.__shroudDeobfuscate for channel delivery");
634
633
  // -----------------------------------------------------------------------
635
634
  // 8. Fetch intercept — the universal privacy boundary.
636
635
  //
@@ -658,7 +657,6 @@ export function registerHooks(api, obfuscator) {
658
657
  "/v1/models/", // Google Vertex AI
659
658
  ];
660
659
  const originalFetch = globalThis.fetch;
661
- api.logger?.info(`[shroud][fetch-guard] hasFetch=${!!originalFetch} patched=${!!globalThis.__shroudFetchPatched}`);
662
660
  if (originalFetch && !(globalThis.__shroudFetchPatched)) {
663
661
  globalThis.__shroudFetchPatched = true;
664
662
  globalThis.fetch = async function shroudFetchInterceptor(input, init) {
@@ -1124,6 +1122,5 @@ export function registerHooks(api, obfuscator) {
1124
1122
  }
1125
1123
  return response;
1126
1124
  }
1127
- api.logger?.info("[shroud] Installed outbound fetch intercept — PII obfuscated before ALL LLM API calls");
1128
1125
  }
1129
1126
  }
package/dist/index.js CHANGED
@@ -87,18 +87,14 @@ function patchEventStreamPrototype(logger) {
87
87
  // Try requiring from the file's own directory (no exports restriction from parent)
88
88
  const mod = localRequire("./event-stream.js");
89
89
  EventStream = mod?.EventStream ?? mod?.default?.EventStream;
90
- if (EventStream) {
91
- logger?.info(`[shroud] Found EventStream via direct file path: ${candidate}`);
90
+ if (EventStream)
92
91
  break;
93
- }
94
92
  }
95
93
  catch { /* try next */ }
96
94
  }
97
95
  }
98
- if (!EventStream?.prototype?.push) {
99
- logger?.info("[shroud] Could not locate EventStream class — streaming deobfuscation unavailable");
96
+ if (!EventStream?.prototype?.push)
100
97
  return;
101
- }
102
98
  // Wrap prototype.push with the deobfuscation hook
103
99
  const originalPush = EventStream.prototype.push;
104
100
  EventStream.prototype.push = function shroudPatchedPush(event) {
@@ -110,7 +106,6 @@ function patchEventStreamPrototype(logger) {
110
106
  };
111
107
  // Mark as patched to prevent double-wrapping
112
108
  globalThis[PATCH_MARKER] = true;
113
- logger?.info("[shroud] Patched EventStream.prototype.push — zero-file streaming deobfuscation active");
114
109
  }
115
110
  export default {
116
111
  id: "shroud-privacy",
@@ -160,6 +155,11 @@ export default {
160
155
  };
161
156
  },
162
157
  });
163
- api.logger?.info("[shroud] Plugin loadednative TypeScript, no proxy required.");
158
+ // Single load confirmation used by test harness to verify plugin loaded.
159
+ // Only logs once per process (suppressed on subsequent agent loads).
160
+ if (!globalThis.__shroudLoadLogged) {
161
+ globalThis.__shroudLoadLogged = true;
162
+ api.logger?.info("[shroud] Plugin loaded.");
163
+ }
164
164
  },
165
165
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "shroud-privacy",
3
3
  "name": "Shroud",
4
- "version": "2.2.1",
4
+ "version": "2.2.2",
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.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Privacy obfuscation for AI agents — detects PII and replaces with deterministic fake values before anything reaches the LLM. Works with OpenClaw (plugin) or any agent (APP protocol).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",