nofax 0.2.14 → 0.2.16

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.14",
3
+ "version": "0.2.16",
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.14' },
77
+ { name: 'nofax', version: '0.2.16' },
78
78
  { instructions: SERVER_INSTRUCTIONS }
79
79
  );
80
80
 
package/src/protocol.mjs CHANGED
@@ -163,7 +163,19 @@ export function redactAndBound(value, options = {}) {
163
163
  if (value.length === 2 && typeof value[0] === 'string' && isSecretKey(value[0])) {
164
164
  return [boundString(value[0]), '[REDACTED]'];
165
165
  }
166
- return value.slice(0, MAX_ARRAY).map((item) => redactAndBound(item, { seen, depth: depth + 1 }));
166
+ 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 }));
167
179
  }
168
180
 
169
181
  const entryName = typeof value.name === 'string'
@@ -171,13 +183,11 @@ export function redactAndBound(value, options = {}) {
171
183
  : typeof value.key === 'string'
172
184
  ? value.key
173
185
  : null;
174
- const redactEntryValue = entryName !== null
175
- && Object.prototype.hasOwnProperty.call(value, 'value')
176
- && isSecretKey(entryName);
186
+ const redactEntryValue = entryName !== null && isSecretKey(entryName);
177
187
 
178
188
  const out = {};
179
189
  for (const [key, child] of Object.entries(value).slice(0, MAX_OBJECT_KEYS)) {
180
- out[key] = isSecretKey(key) || (redactEntryValue && key === 'value')
190
+ out[key] = isSecretKey(key) || (redactEntryValue && (key === 'value' || key === 'values'))
181
191
  ? '[REDACTED]'
182
192
  : redactAndBound(child, { seen, depth: depth + 1 });
183
193
  }