nofax 0.2.45 → 0.2.47

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/CHANGELOG.md CHANGED
@@ -42,6 +42,26 @@ Local Nofax `0.2.x` behavior is unchanged by these removals.
42
42
  - The capability-path form is normalized to `/mcp` before MCP protocol handling.
43
43
  - Remote read operations perform no external messaging/provider calls; only explicit `nofax_notify` invokes ntfy.
44
44
 
45
+ ## 0.2.47 - 2026-10-30
46
+
47
+ ### Security
48
+
49
+ - Redact credential-bearing URL query parameters in agent approval summaries, including dotted API keys and AWS/Google signed URL signature values. Synthetic regression covers the leak; explicit human consent remains mandatory.
50
+
51
+ ## 0.2.46 - 2026-10-29
52
+
53
+ ### Fixed
54
+
55
+ - Bound ntfy notification bodies to the 4,096-byte UTF-8 inline-message limit while preserving Unicode-safe truncation, the existing character cap, and the explicit truncation marker.
56
+ - Reject custom ntfy topics longer than the provider's 64-character maximum during configuration validation.
57
+
58
+ ### Documentation
59
+
60
+ - Clarified iOS notification dismissal and web-browser HTTP action limitations: neither substitutes for explicit NoFax approval.
61
+ - Documented native Pi MCP setup and fail-closed polling behavior without promising automatic idle-session wake-up.
62
+
63
+ Pending, timeout, disconnect, notification delivery, and absent human response never approve any operation. The remote Worker's limited authority is unchanged.
64
+
45
65
  ## 0.2.45 - 2026-10-25
46
66
 
47
67
  ### Fixed
package/README.md CHANGED
@@ -89,6 +89,8 @@ or:
89
89
 
90
90
  If the request is still pending, times out, disconnects, or hits a transport error, Nofax never converts that condition into approval.
91
91
 
92
+ **ntfy client compatibility:** On iOS, the ntfy app may leave an HTTP action notification visible after you tap Allow or Deny, even when the action requests `clear: true` ([upstream ntfy issue #1728](https://github.com/binwiederhier/ntfy/issues/1728)). A still-visible notification does not prove whether Nofax recorded a decision: rely on Nofax's terminal `allow`/`deny` response or pending/timeout state, not on whether the notification disappears. If you use the ntfy web app instead of the mobile app, HTTP action buttons in notifications are supported in Chrome, Edge, and Opera but not Firefox or Safari; cross-origin callbacks also need the target server to allow CORS ([ntfy web-app support](https://docs.ntfy.sh/subscribe/web/)).
93
+
92
94
  ## MCP
93
95
 
94
96
  Start the local stdio MCP server:
@@ -242,6 +244,33 @@ Current Gemini CLI builds expose a synchronous `BeforeTool` hook that can allow
242
244
 
243
245
  Adjust the matcher to the tools you want Nofax to gate. Keep the hook timeout longer than Nofax's configured approval timeout (`timeoutSeconds`, 300 seconds by default).
244
246
 
247
+ ### Pi (native MCP support)
248
+
249
+ Pi 1.x has built-in MCP support for local stdio servers; see [Pi's official MCP documentation](https://pi.dev/docs/latest/mcp). After `nofax init`, register and check the Nofax server:
250
+
251
+ ```bash
252
+ pi mcp add nofax -- npx -y nofax mcp
253
+ pi mcp list
254
+ ```
255
+
256
+ Pi's default MCP request timeout is 60 seconds. If you use `nofax_wait_for_response` with waits longer than that (up to Nofax's 240-second maximum), add `"timeout": 300` to the existing `nofax` entry in `~/.pi/agent/mcp.json`. Do not replace unrelated server entries or settings:
257
+
258
+ ```json
259
+ {
260
+ "mcpServers": {
261
+ "nofax": {
262
+ "command": "npx",
263
+ "args": ["-y", "nofax", "mcp"],
264
+ "timeout": 300
265
+ }
266
+ }
267
+ }
268
+ ```
269
+
270
+ Pi's built-in MCP configuration lives in `~/.pi/agent/mcp.json`. Third-party extensions that replace `/mcp` (such as `pi-mcp-adapter`) take over the interactive MCP integration and may not load that built-in configuration. Verify which MCP implementation your Pi session is using before adding or changing a server; do not disable Pi's permission gates or install a second MCP runtime just for Nofax.
271
+
272
+ This registers MCP tools, **not an automatic permission hook or idle-session wake-up**. While a request is pending, the agent must call `nofax_wait_for_response` again; a missing reply, timeout, or disconnect is never approval. Use Pi's normal trust/permission workflow and verify your installed Pi build exposes `pi mcp` before applying these instructions.
273
+
245
274
  ## Optional remote Cloudflare Worker
246
275
 
247
276
  The `worker/` package provides a private, self-deployed MCP endpoint:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nofax",
3
- "version": "0.2.45",
3
+ "version": "0.2.47",
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",
package/src/config.mjs CHANGED
@@ -30,7 +30,7 @@ export function normalizeServer(input) {
30
30
  }
31
31
 
32
32
  function validateTopic(topic) {
33
- if (typeof topic !== 'string' || topic.length < 24 || topic.length > 128 || !/^[A-Za-z0-9_-]+$/.test(topic)) {
33
+ if (typeof topic !== 'string' || topic.length < 24 || topic.length > 64 || !/^[A-Za-z0-9_-]+$/.test(topic)) {
34
34
  throw new Error('NOFAX_TOPIC_INVALID');
35
35
  }
36
36
  return topic;
@@ -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.45' },
77
+ { name: 'nofax', version: '0.2.46' },
78
78
  { instructions: SERVER_INSTRUCTIONS }
79
79
  );
80
80
 
package/src/ntfy.mjs CHANGED
@@ -2,6 +2,7 @@ import { createRequestId, createResponseTopic, parseResponseMessage } from './pr
2
2
 
3
3
  const MAX_TITLE = 120;
4
4
  const MAX_MESSAGE = 2200;
5
+ const MAX_NTFY_MESSAGE_BYTES = 4096;
5
6
  const DEFAULT_REFINE_SHORTCUT = 'Nofax Refine';
6
7
  const POLL_TIMEOUT = Symbol('NOFAX_POLL_TIMEOUT');
7
8
  const PUBLISH_TIMEOUT = Symbol('NOFAX_PUBLISH_TIMEOUT');
@@ -26,6 +27,23 @@ function boundText(value, max, name) {
26
27
  return `${text.slice(0, end)}…[truncated]`;
27
28
  }
28
29
 
30
+ function boundMessageText(value) {
31
+ const text = boundText(value, MAX_MESSAGE, 'MESSAGE');
32
+ if (Buffer.byteLength(text, 'utf8') <= MAX_NTFY_MESSAGE_BYTES) return text;
33
+
34
+ const marker = '…[truncated]';
35
+ const maxContentBytes = MAX_NTFY_MESSAGE_BYTES - Buffer.byteLength(marker, 'utf8');
36
+ let bytes = 0;
37
+ let end = 0;
38
+ for (const character of text) {
39
+ const characterBytes = Buffer.byteLength(character, 'utf8');
40
+ if (bytes + characterBytes > maxContentBytes) break;
41
+ bytes += characterBytes;
42
+ end += character.length;
43
+ }
44
+ return `${text.slice(0, end)}${marker}`;
45
+ }
46
+
29
47
  function sleep(ms) {
30
48
  return new Promise((resolve) => setTimeout(resolve, ms));
31
49
  }
@@ -78,7 +96,7 @@ export async function sendNotification({ config, title, message, actions, priori
78
96
  const payload = {
79
97
  topic: config.topic,
80
98
  title: boundText(title, MAX_TITLE, 'TITLE'),
81
- message: boundText(message, MAX_MESSAGE, 'MESSAGE'),
99
+ message: boundMessageText(message),
82
100
  priority,
83
101
  tags
84
102
  };
package/src/protocol.mjs CHANGED
@@ -58,7 +58,8 @@ function isSecretKey(key) {
58
58
  || lower === 'pass_phrase'
59
59
  || lower.endsWith('_passphrase')
60
60
  || lower.endsWith('_pass_phrase');
61
- return lower === 'auth' || isAuthHeader || isAuthHeaderValue || isPassphrase || SECRET_KEY.test(normalized);
61
+ const isSignedUrlSignature = lower === 'x_amz_signature' || lower === 'x_goog_signature';
62
+ return lower === 'auth' || isSignedUrlSignature || isAuthHeader || isAuthHeaderValue || isPassphrase || SECRET_KEY.test(normalized);
62
63
  }
63
64
 
64
65
  function redactSecretText(value) {
@@ -110,7 +111,7 @@ function redactSecretText(value) {
110
111
  );
111
112
 
112
113
  redacted = redacted.replace(
113
- /([?&#])([A-Za-z][A-Za-z0-9_-]{0,63})=([^&\s"'`,;]+)/g,
114
+ /([?&#])([A-Za-z][A-Za-z0-9._-]{0,63})=([^&\s"'`,;]+)/g,
114
115
  (match, prefix, key) => isSecretKey(key)
115
116
  ? `${prefix}${key}=[REDACTED]`
116
117
  : match