nofax 0.2.41 → 0.2.43

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,24 @@ 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.43 - 2026-09-24
46
+
47
+ ### Changed
48
+
49
+ - CLI value-taking flags now reject a following `--flag` token as a missing value instead of consuming that flag as data and potentially reaching a notification side effect under malformed arguments.
50
+ - `nofax_wait_for_response` now performs a final authoritative durable-state check before reporting pending, so a terminal first-wins response already persisted by another waiter/process is returned instead of stale pending.
51
+
52
+ Pending, timeout, disconnect, setup/config failure, ambiguous transport failure, and notification delivery still never mean approval. Explicit Allow/Deny behavior, durable first-terminal-wins semantics, response-topic secrecy, notification authority, and the narrower remote Worker boundary are unchanged.
53
+
54
+ ## 0.2.42 - 2026-09-24
55
+
56
+ ### Changed
57
+
58
+ - Local MCP choice-label normalization now preserves valid UTF-16 at the existing 32-code-unit human-facing boundary before ntfy transport, so an astral Unicode character cannot be split before durable request creation while duplicate-visible-label rejection and full decision values remain unchanged.
59
+ - Pending-request recovery now fails closed when a valid durable request file is malformed or otherwise unreadable instead of silently omitting it from `nofax_list_pending`; requests that genuinely disappear during enumeration remain safely skippable.
60
+
61
+ Pending, timeout, disconnect, setup/config failure, ambiguous transport failure, corrupt durable state, and notification delivery still never mean approval. Explicit Allow/Deny behavior, response-topic secrecy, first-terminal-wins semantics, notification authority, and the narrower remote Worker boundary are unchanged.
62
+
45
63
  ## 0.2.41 - 2026-09-24
46
64
 
47
65
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nofax",
3
- "version": "0.2.41",
3
+ "version": "0.2.43",
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/cli.mjs CHANGED
@@ -30,7 +30,7 @@ function parseArgs(args, allowedFlags = []) {
30
30
  if (['--title', '--server', '--topic', '--timeout'].includes(value)) {
31
31
  if (!allowedFlags.includes(value)) throw new Error(`NOFAX_UNKNOWN_FLAG:${value}`);
32
32
  const next = args[index + 1];
33
- if (next === undefined) throw new Error(`NOFAX_FLAG_VALUE:${value}`);
33
+ if (next === undefined || next.startsWith('--')) throw new Error(`NOFAX_FLAG_VALUE:${value}`);
34
34
  flags[value.slice(2)] = next;
35
35
  index += 1;
36
36
  continue;
@@ -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.41' },
77
+ { name: 'nofax', version: '0.2.43' },
78
78
  { instructions: SERVER_INSTRUCTIONS }
79
79
  );
80
80
 
package/src/mcp-tools.mjs CHANGED
@@ -115,19 +115,24 @@ function validateWaitSeconds(value) {
115
115
  return seconds;
116
116
  }
117
117
 
118
+ function boundChoiceLabel(label) {
119
+ const end = safeSliceEnd(label, Math.min(label.length, 32));
120
+ return label.slice(0, end);
121
+ }
122
+
118
123
  function validateChoiceOptions(options) {
119
124
  if (!Array.isArray(options) || options.length < 1 || options.length > 3) throw new Error('NOFAX_CHOICE_LIMIT');
120
125
  const normalized = options.map((option) => {
121
126
  if (typeof option === 'string') {
122
127
  const value = option.trim();
123
128
  if (!value || value.length > 80) throw new Error('NOFAX_CHOICE_INVALID');
124
- return { value, label: value.slice(0, 32) };
129
+ return { value, label: boundChoiceLabel(value) };
125
130
  }
126
131
  if (!option || typeof option.value !== 'string' || typeof option.label !== 'string') throw new Error('NOFAX_CHOICE_INVALID');
127
132
  const value = option.value.trim();
128
133
  const label = option.label.trim();
129
134
  if (!value || !label || value.length > 80) throw new Error('NOFAX_CHOICE_INVALID');
130
- return { value, label: label.slice(0, 32) };
135
+ return { value, label: boundChoiceLabel(label) };
131
136
  });
132
137
  if (new Set(normalized.map((option) => option.value)).size !== normalized.length) {
133
138
  throw new Error('NOFAX_CHOICE_DUPLICATE');
@@ -289,6 +294,8 @@ export function createMcpToolHandlers(overrides = {}) {
289
294
  if (remaining <= 0) break;
290
295
  await deps.sleepImpl(Math.min(1000, remaining));
291
296
  }
297
+ request = await deps.loadRequestImpl({ home: deps.home, env: deps.env, requestId });
298
+ if (request.status === 'resolved') return terminalResult(request);
292
299
  return pendingResult(request.requestId);
293
300
  },
294
301
 
package/src/requests.mjs CHANGED
@@ -206,7 +206,10 @@ export async function listPendingRequests({ home, env, limit = 20 } = {}) {
206
206
  try {
207
207
  const request = await loadRequest({ home: root, requestId });
208
208
  if (request.status === 'pending') results.push(request);
209
- } catch {}
209
+ } catch (error) {
210
+ if (error?.message === 'NOFAX_REQUEST_NOT_FOUND') continue;
211
+ throw error;
212
+ }
210
213
  }
211
214
  return results
212
215
  .sort((left, right) => Date.parse(right.createdAt) - Date.parse(left.createdAt) || right.requestId.localeCompare(left.requestId))