nofax 0.2.10 → 0.2.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nofax",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "mcpName": "io.github.AKzar1el/nofax",
5
5
  "description": "Human-in-the-loop approvals and notifications for AI coding agents via CLI, MCP, and agent hooks.",
6
6
  "type": "module",
@@ -74,7 +74,7 @@ const LIST_PENDING_OUTPUT_SCHEMA = z.object({
74
74
 
75
75
  export function buildMcpServer({ handlers = createMcpToolHandlers() } = {}) {
76
76
  const server = new McpServer(
77
- { name: 'nofax', version: '0.2.10' },
77
+ { name: 'nofax', version: '0.2.12' },
78
78
  { instructions: SERVER_INSTRUCTIONS }
79
79
  );
80
80
 
package/src/protocol.mjs CHANGED
@@ -22,11 +22,36 @@ function isSecretKey(key) {
22
22
  function redactSecretText(value) {
23
23
  let redacted = value;
24
24
 
25
+ redacted = redacted.replace(
26
+ /-----BEGIN ([A-Z0-9 ]*PRIVATE KEY(?: BLOCK)?)-----[\s\S]*?(?:-----END \1-----|$)/g,
27
+ (_match, label) => `-----BEGIN ${label}-----\n[REDACTED]\n-----END ${label}-----`
28
+ );
29
+
30
+ redacted = redacted.replace(
31
+ /\b([A-Za-z][A-Za-z0-9+.-]{1,31}:\/\/)([^\s\/@:]*):([^\s\/@]+)@/g,
32
+ '$1$2:[REDACTED]@'
33
+ );
34
+
35
+ redacted = redacted.replace(
36
+ /(["'])((?:proxy[-_])?authorization)(?!\s*[:=]\s*(?:bearer|basic)\b)(\s*[:=]\s*)((?:\\.|(?!\1).)*)\1/gi,
37
+ '$1$2$3[REDACTED]$1'
38
+ );
39
+
40
+ redacted = redacted.replace(
41
+ /(^|[\r\n])([ \t]*)((?:proxy[-_])?authorization)(\s*[:=]\s*)[^\r\n]*/gim,
42
+ '$1$2$3$4[REDACTED]'
43
+ );
44
+
25
45
  redacted = redacted.replace(
26
46
  /\b((?:proxy[-_])?authorization)(\s*[:=]\s*)(bearer|basic)(\s+)([^\s"'`,;&]+)/gi,
27
47
  '$1$2$3$4[REDACTED]'
28
48
  );
29
49
 
50
+ redacted = redacted.replace(
51
+ /\b(set-cookie|cookie)(\s*:\s*)[^\r\n]*/gi,
52
+ '$1$2[REDACTED]'
53
+ );
54
+
30
55
  redacted = redacted.replace(
31
56
  /([?&])([A-Za-z][A-Za-z0-9_-]{0,63})=([^&\s"'`,;]+)/g,
32
57
  (match, prefix, key) => isSecretKey(key)
@@ -84,9 +109,9 @@ export function createPhoneTopic() {
84
109
  }
85
110
 
86
111
  function boundString(value) {
87
- const bounded = value.length <= MAX_STRING ? value : value.slice(0, MAX_STRING);
88
- const redacted = redactSecretText(bounded);
89
- return value.length <= MAX_STRING ? redacted : `${redacted}…[truncated]`;
112
+ const redacted = redactSecretText(value);
113
+ const bounded = redacted.length <= MAX_STRING ? redacted : redacted.slice(0, MAX_STRING);
114
+ return value.length <= MAX_STRING ? bounded : `${bounded}…[truncated]`;
90
115
  }
91
116
 
92
117
  export function redactAndBound(value, options = {}) {