entroly-openclaw 1.0.81 → 1.0.82

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
@@ -22,7 +22,7 @@ Install the Python engine, then install the publicly verifiable OpenClaw plugin
22
22
  package from npm:
23
23
 
24
24
  ```bash
25
- pip install "entroly>=1.0.81"
25
+ pip install "entroly>=1.0.82"
26
26
  openclaw plugins install npm:entroly-openclaw
27
27
  openclaw plugins enable entroly
28
28
  openclaw gateway restart
@@ -57,7 +57,7 @@ installable release.
57
57
  From an Entroly source checkout:
58
58
 
59
59
  ```bash
60
- pip install "entroly>=1.0.81"
60
+ pip install "entroly>=1.0.82"
61
61
  openclaw plugins install ./integrations/openclaw
62
62
  openclaw plugins enable entroly
63
63
  openclaw gateway restart
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "entroly-openclaw",
3
- "version": "1.0.81",
3
+ "version": "1.0.82",
4
4
  "description": "Provider-independent, auditable context engineering for every OpenClaw model route",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/proof-hooks.js CHANGED
@@ -6,15 +6,50 @@ function sha256(value) {
6
6
  return createHash("sha256").update(String(value), "utf8").digest("hex");
7
7
  }
8
8
 
9
- function safeDiagnostic(value, limit = 400) {
10
- return String(value?.message ?? value ?? "unknown error")
9
+ // Diagnostics can contain provider text, tool names, bridge errors, or recovered
10
+ // material. Treat them as untrusted display data. Canonicalize before redaction
11
+ // so format/control characters cannot be inserted into credential markers to
12
+ // evade secret detection, then escape display syntax and truncate by code point.
13
+ const DISPLAY_WHITESPACE = /[\t\n\r\f\v\u0085\u2028\u2029]+/gu;
14
+ const UNSAFE_FOR_DISPLAY = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu;
15
+ const MARKDOWN_DELIMITERS = /([\\`*_[\]{}()<>#+.!|~-])/g;
16
+ const AUTH_SCHEME = /\b(Basic|Bearer)\s+[^\s,;]+/gi;
17
+ const SECRET_FIELD =
18
+ /["']?\b(api[_-]?key|authorization|password|secret|token)\b["']?\s*[:=]\s*(?:"[^"]*(?:"|$)|'[^']*(?:'|$)|(?:Basic|Bearer)\s+[^\s,;]+|[^\s,;"']+)/gi;
19
+
20
+ function diagnosticSource(value) {
21
+ try {
22
+ const candidate = value?.message ?? value ?? "unknown error";
23
+ return typeof candidate === "string" ? candidate : String(candidate);
24
+ } catch {
25
+ return "unknown error";
26
+ }
27
+ }
28
+
29
+ function normalizeDiagnosticText(value) {
30
+ return diagnosticSource(value)
31
+ .toWellFormed()
32
+ .normalize("NFKC")
33
+ .replace(DISPLAY_WHITESPACE, " ")
34
+ .replace(UNSAFE_FOR_DISPLAY, "")
11
35
  .replace(/\s+/g, " ")
12
- .replace(/\bBearer\s+[A-Za-z0-9._~+/=-]+/gi, "Bearer [REDACTED]")
13
- .replace(
14
- /\b(api[_-]?key|authorization|password|secret|token)\b\s*[:=]\s*["']?[^\s,;"']+/gi,
15
- "$1=[REDACTED]",
16
- )
17
- .slice(0, limit);
36
+ .trim();
37
+ }
38
+
39
+ function sanitizeDisplayText(value, limit = 400) {
40
+ if (typeof value !== "string" || limit <= 0) return "";
41
+ const escaped = value.replace(MARKDOWN_DELIMITERS, "\\$1");
42
+ const codePoints = [...escaped];
43
+ if (codePoints.length <= limit) return escaped;
44
+ if (limit === 1) return "…";
45
+ return `${codePoints.slice(0, limit - 1).join("")}…`;
46
+ }
47
+
48
+ function safeDiagnostic(value, limit = 400) {
49
+ const redacted = normalizeDiagnosticText(value)
50
+ .replace(AUTH_SCHEME, "$1 [REDACTED]")
51
+ .replace(SECRET_FIELD, "$1=[REDACTED]");
52
+ return sanitizeDisplayText(redacted, limit);
18
53
  }
19
54
 
20
55
  function positiveInteger(value, fallback, maximum) {