nofax 0.2.16 → 0.2.18

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.16",
3
+ "version": "0.2.18",
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.16' },
77
+ { name: 'nofax', version: '0.2.18' },
78
78
  { instructions: SERVER_INSTRUCTIONS }
79
79
  );
80
80
 
package/src/protocol.mjs CHANGED
@@ -46,7 +46,13 @@ function normalizeSecretKeyName(key) {
46
46
  }
47
47
 
48
48
  function isSecretKey(key) {
49
- return SECRET_KEY.test(normalizeSecretKeyName(key));
49
+ const normalized = normalizeSecretKeyName(key);
50
+ const lower = normalized.toLowerCase();
51
+ const isPassphrase = lower === 'passphrase'
52
+ || lower === 'pass_phrase'
53
+ || lower.endsWith('_passphrase')
54
+ || lower.endsWith('_pass_phrase');
55
+ return lower === 'auth' || isPassphrase || SECRET_KEY.test(normalized);
50
56
  }
51
57
 
52
58
  function redactSecretText(value) {
@@ -164,18 +170,15 @@ export function redactAndBound(value, options = {}) {
164
170
  return [boundString(value[0]), '[REDACTED]'];
165
171
  }
166
172
  const bounded = value.slice(0, MAX_ARRAY);
167
- if (
168
- value.length >= 4
169
- && value.length % 2 === 0
170
- && bounded.every((item, index) => index % 2 === 1 || typeof item === 'string')
171
- ) {
172
- return bounded.map((item, index) => (
173
- index % 2 === 1 && isSecretKey(bounded[index - 1])
174
- ? '[REDACTED]'
175
- : redactAndBound(item, { seen, depth: depth + 1 })
176
- ));
177
- }
178
- return bounded.map((item) => redactAndBound(item, { seen, depth: depth + 1 }));
173
+ const pairedLength = bounded.length - (bounded.length % 2);
174
+ return bounded.map((item, index) => (
175
+ index < pairedLength
176
+ && index % 2 === 1
177
+ && typeof bounded[index - 1] === 'string'
178
+ && isSecretKey(bounded[index - 1])
179
+ ? '[REDACTED]'
180
+ : redactAndBound(item, { seen, depth: depth + 1 })
181
+ ));
179
182
  }
180
183
 
181
184
  const entryName = typeof value.name === 'string'