nofax 0.2.10 → 0.2.11

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.11",
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.11' },
78
78
  { instructions: SERVER_INSTRUCTIONS }
79
79
  );
80
80
 
package/src/protocol.mjs CHANGED
@@ -22,11 +22,31 @@ 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
+ /(^|[\r\n])([ \t]*)((?:proxy[-_])?authorization)(\s*:\s*)[^\r\n]*/gim,
37
+ '$1$2$3$4[REDACTED]'
38
+ );
39
+
25
40
  redacted = redacted.replace(
26
41
  /\b((?:proxy[-_])?authorization)(\s*[:=]\s*)(bearer|basic)(\s+)([^\s"'`,;&]+)/gi,
27
42
  '$1$2$3$4[REDACTED]'
28
43
  );
29
44
 
45
+ redacted = redacted.replace(
46
+ /\b(set-cookie|cookie)(\s*:\s*)[^\r\n]*/gi,
47
+ '$1$2[REDACTED]'
48
+ );
49
+
30
50
  redacted = redacted.replace(
31
51
  /([?&])([A-Za-z][A-Za-z0-9_-]{0,63})=([^&\s"'`,;]+)/g,
32
52
  (match, prefix, key) => isSecretKey(key)
@@ -84,9 +104,9 @@ export function createPhoneTopic() {
84
104
  }
85
105
 
86
106
  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]`;
107
+ const redacted = redactSecretText(value);
108
+ const bounded = redacted.length <= MAX_STRING ? redacted : redacted.slice(0, MAX_STRING);
109
+ return value.length <= MAX_STRING ? bounded : `${bounded}…[truncated]`;
90
110
  }
91
111
 
92
112
  export function redactAndBound(value, options = {}) {