nofax 0.2.37 → 0.2.38

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 ADDED
@@ -0,0 +1,425 @@
1
+ # Changelog
2
+
3
+ All notable changes to Nofax will be documented here.
4
+
5
+ ## 0.3.0 - Unreleased
6
+
7
+ ### Added
8
+
9
+ - Optional self-deployed Cloudflare Workers remote MCP transport using stateless Streamable HTTP.
10
+ - SQLite-backed Durable Object compatibility for reading request state created by earlier remote-development builds.
11
+ - Private remote MCP authentication through a bearer header, plus capability-URL compatibility mode for clients that cannot attach a static header.
12
+ - Remote MCP tools:
13
+ - `nofax_notify` for one-way ntfy phone notifications;
14
+ - `nofax_get_request`
15
+ - `nofax_list_pending`
16
+ - Public deployment, security, and qualification documentation for bounded remote notification + inspection mode.
17
+
18
+ ### Changed
19
+
20
+ - Gemini CLI integration can now use the current synchronous `BeforeTool` hook for explicit Nofax Allow/Deny decisions while retaining the advisory `Notification` path; timeout or transport failure leaves Gemini's native policy flow in control.
21
+ - Remote v0.3 is deliberately limited to **one-way notification plus inspection** rather than a remote human-approval transport.
22
+ - The remote MCP handler exposes one notification method plus two read methods.
23
+ - `nofax_list_pending` filters expired rows without performing lazy cleanup writes.
24
+ - The two remote inspection tools are annotated `readOnlyHint: true`, `destructiveHint: false`, `idempotentHint: true`, and `openWorldHint: false`; `nofax_notify` is explicitly side-effecting and non-idempotent.
25
+ - ntfy publish failures now preserve bounded provider diagnostics such as ntfy error codes and `Retry-After` values when available.
26
+ - Root CI continues to qualify both the local Node package and the Cloudflare Worker, including a Wrangler deployment dry-run.
27
+
28
+ ### Removed
29
+
30
+ - Remote approval, choice, refinement, and wait tools.
31
+ - Telegram remote transport and webhook.
32
+ - Browser phone-callback/Refine routes.
33
+
34
+ Local Nofax `0.2.x` behavior is unchanged by these removals.
35
+
36
+ ### Security
37
+
38
+ - Remote side effects are structurally limited to authenticated one-way ntfy publication; approval/callback/state mutation remains unreachable.
39
+ - Former `/telegram/webhook` and `/r/*` routes are absent and return 404.
40
+ - Remote result projections omit callback hashes/capabilities, original request title/message content, and allowed-decision internals.
41
+ - MCP bearer/capability authentication uses equal-length constant-time comparison.
42
+ - The capability-path form is normalized to `/mcp` before MCP protocol handling.
43
+ - Remote read operations perform no external messaging/provider calls; only explicit `nofax_notify` invokes ntfy.
44
+
45
+ ## 0.2.38 - 2026-09-24
46
+
47
+ ### Changed
48
+
49
+ - The npm package now includes the local changelog, contribution guide, architecture guide, and remote-MCP guide linked from its README, so installed/offline package documentation no longer points to missing files.
50
+ - Redacted strings now show the existing truncation marker when secret replacement expands an originally short value beyond the per-string bound, preventing bounded human/agent context from looking complete after it was shortened.
51
+
52
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Secret redaction, Unicode-safe slicing, explicit Allow/Deny behavior, response-topic secrecy, first-terminal-wins semantics, notification authority, and the narrower remote Worker boundary are unchanged.
53
+
54
+ ## 0.2.37 - 2026-09-24
55
+
56
+ ### Changed
57
+
58
+ - Durable local MCP approval, choice, and refinement requests now retain the exact ntfy server/topic used at publication, so later waits and confirmations remain bound to the original transport even if local configuration changes while a request is pending. Legacy pending records without transport affinity remain compatible.
59
+ - Choice requests now reject option sets whose normalized 32-character human-facing labels collide, preventing indistinguishable phone actions from mapping to different terminal decision values before transport or persistence.
60
+
61
+ Pending, timeout, disconnect, setup/config failure, transport failure, 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
+ ## 0.2.36 - 2026-09-24
63
+
64
+ ### Changed
65
+
66
+ - Local approval titles, messages, and refinement responses now preserve valid UTF-16 at truncation boundaries, so astral Unicode characters are never split into unpaired surrogate code units before human review or agent consumption.
67
+ - Redacted string values, serialized tool-input summaries, and final agent/hook summaries now use the same surrogate-safe truncation rule, preventing malformed Unicode in bounded approval context while preserving existing size ceilings and truncation markers.
68
+
69
+ Pending, timeout, disconnect, setup/config failure, transport failure, 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.
70
+
71
+ ## 0.2.35 - 2026-09-24
72
+
73
+ ### Changed
74
+
75
+ - Overlong MCP/direct-library approval titles and messages remain within their existing bounds but now end with an explicit truncation marker, so human reviewers can distinguish clipped request context from complete context.
76
+ - Overlong local human refinement responses remain within the existing 2,000-character ceiling but now end with the same explicit truncation marker before the agent consumes or persists them.
77
+
78
+ Pending, timeout, disconnect, setup/config failure, transport failure, 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.
79
+ ## 0.2.34 - 2026-09-24
80
+
81
+ ### Changed
82
+
83
+ - Parsed terminal response decisions now normalize surrounding whitespace before exact allowed-value matching, aligning the exported parser with durable/direct resolution while still rejecting empty or unallowed decisions.
84
+ - Choice decision sets now reject duplicate values after normalization before custom transport or durable persistence, preventing ambiguous human choices such as `ship` and ` ship ` from representing the same terminal decision.
85
+
86
+ Pending, timeout, disconnect, setup/config failure, transport failure, 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.
87
+
88
+ ## 0.2.33 - 2026-09-24
89
+
90
+ ### Changed
91
+
92
+ - Durable allowed decision values and already-resolved terminal decisions now normalize surrounding whitespace before persistence and membership validation, keeping semantically equivalent choices canonical.
93
+ - Exported direct-library terminal resolution now applies the same normalization to incoming response decisions before allowed-value matching, so padded-but-valid decisions resolve to their canonical value instead of failing early.
94
+
95
+ Pending, timeout, disconnect, setup/config failure, transport failure, 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.
96
+
97
+ ## 0.2.32 - 2026-09-24
98
+
99
+ ### Changed
100
+
101
+ - Durable request-state validation now rejects whitespace-only allowed decision values instead of persisting semantically empty choices.
102
+ - Direct-library MCP choice handlers now reject decision values longer than 80 characters instead of silently truncating and changing the caller's intended choice value.
103
+
104
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Explicit Allow/Deny behavior, response-topic secrecy, notification authority, and the narrower remote Worker boundary are unchanged.
105
+
106
+ ## 0.2.31 - 2026-09-23
107
+
108
+ ### Changed
109
+
110
+ - Durable non-choice `refine` terminal decisions now require non-empty refinement text, preventing semantically incomplete resolved requests while preserving `refine` as an ordinary explicit choice value.
111
+ - Direct-library string choice options are now trimmed and validated like object-form choices: empty/whitespace-only and over-80-character values are rejected, and generated phone labels are bounded consistently to 32 characters.
112
+
113
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Explicit Allow/Deny behavior, response-topic secrecy, notification authority, and the narrower remote Worker boundary are unchanged.
114
+ ## 0.2.30 - 2026-09-23
115
+
116
+ ### Security
117
+
118
+ - Agent-hook summary redaction now removes passwords from curl `-u`, `--user`, and `--proxy-user` `user:password` command arguments before outbound summaries are produced, while preserving usernames and ordinary username-only forms.
119
+
120
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Explicit Allow/Deny behavior, response-topic secrecy, notification authority, and the narrower remote Worker boundary are unchanged.
121
+
122
+ ## 0.2.29 - 2026-09-23
123
+
124
+ ### Security
125
+
126
+ - Agent-hook summary redaction now applies the existing secret-key classifier to URL fragment parameters as well as query parameters, preventing OAuth-style `#access_token=` and `#id_token=` values from escaping through outbound summaries while preserving benign fragment metadata.
127
+
128
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Explicit Allow/Deny behavior, response-topic secrecy, notification authority, and the narrower remote Worker boundary are unchanged.
129
+
130
+ ## 0.2.28 - 2026-09-23
131
+
132
+ ### Security
133
+
134
+ - Agent-hook summary redaction now treats `authHeaderValue`, prefixed `*AuthHeaderValue`, and their plural `*AuthHeaderValues` object-field forms as credential-bearing secrets, preventing bearer/basic credentials from escaping through common header-value aliases while preserving non-secret metadata such as `authHeaderName`, `authMode`, and `authentication`.
135
+
136
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Explicit Allow/Deny behavior, response-topic secrecy, notification authority, and the narrower remote Worker boundary are unchanged.
137
+
138
+ ## 0.2.27 - 2026-09-23
139
+
140
+ ### Security
141
+
142
+ - Agent-hook summary redaction now removes folded or multiline `Authorization` and `Proxy-Authorization` continuation values as one credential-bearing header, preventing Digest-, AWS-, Bearer-, Basic-, or similar continuation parameters from surviving after only the first line was redacted.
143
+
144
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Explicit Allow/Deny behavior, response-topic secrecy, notification authority, and the narrower remote Worker boundary are unchanged.
145
+
146
+ ## 0.2.26 - 2026-09-23
147
+
148
+ ### Security
149
+
150
+ - Agent-hook summary redaction now fully removes `Authorization` and `Proxy-Authorization` credential values when parameterized headers appear after structural punctuation or use quoted header keys with unquoted Digest-, AWS-, Bearer-, or Basic-style values, preventing secret credential parameters from surviving in outbound agent summaries.
151
+
152
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Explicit Allow/Deny behavior, response-topic secrecy, notification authority, and the narrower remote Worker boundary are unchanged.
153
+
154
+ ## 0.2.25 - 2026-09-23
155
+
156
+ ### Security
157
+
158
+ - Agent-hook summary redaction now fully removes unquoted inline parameterized `Authorization` and `Proxy-Authorization` credential values, including Digest- and AWS-style forms, instead of allowing later credential parameters on the same line to survive a partial redaction.
159
+
160
+ ### Fixed
161
+
162
+ - Canonical npm `bin.nofax` metadata now matches the normalized path npm publishes, avoiding publish-time metadata self-correction without changing the executable entry point.
163
+
164
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Explicit Allow/Deny behavior, response-topic secrecy, notification authority, and the narrower remote Worker boundary are unchanged.
165
+
166
+ ## 0.2.24 - 2026-09-23
167
+
168
+ ### Security
169
+
170
+ - Agent-hook summary redaction now treats credential-bearing `authHeader` and prefixed `*AuthHeader` object fields as secrets, preventing bearer/basic credentials from escaping through common aliases while preserving non-secret metadata such as `authHeaderName`, `authMode`, and `authentication`.
171
+
172
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Explicit Allow/Deny behavior, response-topic secrecy, notification authority, and the narrower remote Worker boundary are unchanged.
173
+
174
+ ## 0.2.23 - 2026-09-23
175
+
176
+ ### Security
177
+
178
+ - Agent-hook summary redaction now treats structured secret-bearing HTTP header entries case-insensitively across `name`/`key`/`header` label fields and sibling `value`/`values` payload fields, preventing credentials from escaping through case variants such as `{name: "Authorization", Value: secret}` or `{Header: "X-Api-Key", Values: [secret]}` while preserving benign header values.
179
+
180
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Explicit Allow/Deny behavior, response-topic secrecy, notification authority, and the narrower remote Worker boundary are unchanged.
181
+
182
+ ## 0.2.22 - 2026-09-23
183
+
184
+ ### Fixed
185
+
186
+ - Claude Code and Codex `PermissionRequest` hook setup/configuration failures now decline cleanly to the host's native approval flow with exit 0, empty stdout, and diagnostics on stderr instead of surfacing a hook error boundary when Nofax cannot establish a remote decision.
187
+ - Gemini CLI `Notification` setup/configuration and ntfy transport failures now remain advisory with valid empty JSON plus diagnostics, while synchronous `BeforeTool` failures continue to return strict `{\"decision\":\"ask\"}` native-confirmation fallback JSON.
188
+
189
+ Pending, timeout, disconnect, setup/config failure, transport failure, and notification delivery still never mean approval. Explicit remote Allow/Deny decisions, response-topic secrecy, and the narrower remote Worker authority boundary are unchanged.
190
+
191
+ ## 0.2.21 - 2026-09-23
192
+
193
+ ### Fixed
194
+
195
+ - Gemini CLI hook setup, input-parse, configuration, or unexpected adapter failures now return strict `{"decision":"ask"}` hook JSON with a diagnostic on stderr instead of escaping the CLI boundary with empty stdout, preserving native confirmation when Nofax cannot produce a remote decision.
196
+ - Asynchronous failures from other hook adapters are now contained by the normal CLI error boundary instead of escaping as rejected promises.
197
+
198
+ Pending, timeout, disconnect, setup/config failure, and transport failure still never mean approval. Remote Worker authority, response-topic secrecy, and notification scope are unchanged.
199
+
200
+ ## 0.2.20 - 2026-09-23
201
+
202
+ ### Fixed
203
+
204
+ - Phone confirmations for an ordinary `nofax_request_choice` option whose value is `refine` now keep choice semantics in the message body (`Nofax recorded: refine`) instead of claiming that free-text refinement was sent back to the agent.
205
+
206
+ ### Security
207
+
208
+ - Agent-hook summary redaction now recognizes structured HTTP header entries shaped as `{ header, value }`, redacting credential values for `Authorization`, `Cookie`, `X-Api-Key`, and other recognized secret-bearing header names while preserving ordinary header values such as `Accept`.
209
+
210
+ Pending, timeout, disconnect, and transport failure still never mean approval. Remote Worker authority, response-topic secrecy, and notification scope are unchanged.
211
+
212
+ ## 0.2.19 - 2026-09-23
213
+
214
+ ### Fixed
215
+
216
+ - Ordinary `nofax_request_choice` results and ntfy confirmations now honor the durable request kind even when a selected option value is named `allow`, `deny`, or `refine`, avoiding approval/denial/refinement wording for ordinary explicit choices.
217
+ - The ntfy response parser now accepts `refine` as a normal selected value for `choice` requests without requiring refinement text, while true approval-with-refine and dedicated refinement requests still require a non-empty human refinement.
218
+
219
+ Pending, timeout, disconnect, and transport failure still never mean approval. Remote Worker authority, response-topic secrecy, and notification scope are unchanged.
220
+
221
+ ## 0.2.18 - 2026-09-23
222
+
223
+ ### Security
224
+
225
+ - Agent-hook summary redaction now treats standalone `auth` fields as credential-bearing while preserving non-secret auth metadata such as `authMode` and `authentication`.
226
+ - Passphrase credential fields, including standalone and suffix-style forms such as `passphrase`, `keyPassphrase`, and `signingPassphrase`, are now redacted before notification text leaves the local process while benign metadata such as `passphraseHint` remains visible.
227
+
228
+ Approval decisions, pending-never-means-approval semantics, response-topic secrecy, notification authority, and the deliberately narrower remote Worker surface are unchanged.
229
+
230
+ ## 0.2.17 - 2026-09-23
231
+
232
+ ### Security
233
+
234
+ - Flat alternating secret key/value arrays now redact valid secret pairs even when the array has an odd trailing element or another key slot is malformed/non-string, preventing one malformed sibling from disabling redaction for otherwise recognizable Authorization, Cookie, API-key, and similar secret-bearing pairs.
235
+ - Ordinary non-secret pairs and malformed sibling values remain visible/processed normally so approval context stays useful.
236
+
237
+ Approval decisions, pending-never-means-approval semantics, response-topic secrecy, notification authority, and the deliberately narrower remote Worker surface are unchanged.
238
+
239
+ ## 0.2.16 - 2026-09-22
240
+
241
+ ### Security
242
+
243
+ - Agent-hook summary redaction now recognizes flat alternating secret key/value arrays such as Node-style `rawHeaders`, redacting paired Authorization, Cookie, API-key, and other secret-like values before notification text leaves the local process.
244
+ - Ordinary non-secret pairs remain visible so approval context stays useful.
245
+
246
+ Approval decisions, pending-never-means-approval semantics, response-topic secrecy, notification authority, and the deliberately narrower remote Worker surface are unchanged.
247
+
248
+ ## 0.2.15 - 2026-09-22
249
+
250
+ ### Security
251
+
252
+ - Agent-hook summary redaction now covers structured secret-header entries that store one or more values under a plural `values` field, including Authorization, Cookie, and API-key entry objects.
253
+ - Ordinary non-secret multi-value header entries remain visible so approval context stays useful.
254
+
255
+ Approval decisions, pending-never-means-approval semantics, response-topic secrecy, notification authority, and the deliberately narrower remote Worker surface are unchanged.
256
+
257
+ ## 0.2.14 - 2026-09-22
258
+
259
+ ### Security
260
+
261
+ - Agent-hook summary redaction now recognizes common structured header-entry objects such as `{ name: 'Authorization', value: '…' }` and `{ key: 'X-Api-Key', value: '…' }`, redacting only the secret-bearing value while preserving benign header context.
262
+ - Secret-key normalization now uses deterministic linear-time ASCII scanning instead of the previously flagged polynomial regular-expression path, closing GitHub CodeQL `js/polynomial-redos` alert #1 on uncontrolled tool-input keys.
263
+
264
+ Approval decisions, pending-never-means-approval semantics, response-topic secrecy, notification authority, and the deliberately narrower remote Worker surface are unchanged.
265
+
266
+ ## 0.2.13 - 2026-09-22
267
+
268
+ ### Security
269
+
270
+ - Agent-hook summary redaction now treats exact two-element secret-key entry tuples such as `['Authorization', 'Bearer …']`, `['Cookie', '…']`, and `['X-Api-Key', '…']` as secret-bearing structured fields and redacts their value side before notification text leaves the local process.
271
+ - Ordinary non-secret tuples remain visible so human approval context stays useful.
272
+
273
+ Approval decisions, pending-never-means-approval semantics, response-topic secrecy, notification authority, and the deliberately narrower remote Worker surface are unchanged.
274
+
275
+ ## 0.2.12 - 2026-09-22
276
+
277
+ ### Security
278
+
279
+ - Agent-hook summary redaction now removes complete inline quoted parameterized `Authorization` / `Proxy-Authorization` values, including Digest and AWS-style credentials embedded in shell commands, instead of leaving trailing credential parameters visible.
280
+ - Line-start assignment forms such as `Authorization = Digest ...` are now fully redacted as well. Existing Bearer/Basic formatting remains intact.
281
+
282
+ Approval decisions, pending-never-means-approval semantics, response-topic secrecy, notification authority, and the deliberately narrower remote Worker surface are unchanged.
283
+
284
+ ## 0.2.11 - 2026-09-22
285
+
286
+ ### Security
287
+
288
+ - Agent-hook summary redaction now covers URI userinfo passwords, including password-only forms such as Redis-style URLs, before notification text leaves the local process.
289
+ - Secret detection now runs before the per-string summary bound, so credentials whose closing delimiter falls beyond the truncation boundary cannot leak a visible prefix.
290
+ - Complete and unterminated PEM/OpenSSH/PGP private-key blocks are redacted while public certificates and unrelated `BEGIN`/`END` blocks remain visible.
291
+ - Complete `Cookie:` and `Set-Cookie:` header values are redacted so credentials in later semicolon-delimited cookie pairs cannot survive after an earlier pair is removed.
292
+ - Complete line-start and multiline `Authorization:` / `Proxy-Authorization:` header values are redacted so parameterized Digest/AWS-style nonce, response, credential, and signature material cannot survive partial scheme redaction.
293
+
294
+ Approval decisions, pending-never-means-approval semantics, response-topic secrecy, notification authority, and the deliberately narrower remote Worker surface are unchanged.
295
+
296
+ ## 0.2.10 - 2026-09-22
297
+
298
+ ### Security
299
+
300
+ - Agent-hook summaries now redact high-confidence secret values embedded inside ordinary strings, including Authorization bearer/basic credentials, secret-bearing URL query parameters, environment-style key assignments, quoted JSON-like fields, and CLI secret flags before notification text leaves the local process.
301
+ - Benign lookalikes such as `safeTokenizedValue`, `apiKeynote`, and non-secret CLI flags remain visible so approval context stays useful.
302
+
303
+ This remains best-effort redaction rather than a credential scanner; sensitive notification content should still use a trusted authenticated/self-hosted ntfy server as documented in `SECURITY.md`. Approval semantics, pending-never-means-approval behavior, response-topic secrecy, notification authority, and the deliberately narrower remote Worker surface are unchanged.
304
+
305
+ ## 0.2.9 - 2026-09-22
306
+
307
+ ### Fixed
308
+
309
+ - Free-text refinement responses now preserve the full trimmed human response through the documented 2,000-character ceiling instead of passing through the generic 500-character notification-summary bound.
310
+ - Gemini CLI `BeforeTool` timeout or transport failure now returns `decision: "ask"`, forcing Gemini's native interactive confirmation instead of allowing host auto-approval policy to interpret a missing Nofax decision as permission.
311
+
312
+ Explicit Nofax Allow/Deny behavior, pending-never-means-approval semantics, response-topic secrecy, notification transport authority, and the deliberately narrower remote Worker surface are unchanged.
313
+
314
+ ## 0.2.8 - 2026-09-22
315
+
316
+ ### Security
317
+
318
+ - Agent-hook summaries now redact camelCase, PascalCase, acronym-style, snake_case, and kebab-case variants of the existing secret-key vocabulary consistently, preventing values under keys such as `accessToken`, `clientSecret`, and `dbPassword` from being serialized into outbound Nofax notification text.
319
+
320
+ Approval semantics, response-topic secrecy, notification transport authority, and the deliberately narrower remote Worker surface are unchanged.
321
+
322
+ ## 0.2.7 - 2026-09-22
323
+
324
+ ### Fixed
325
+
326
+ - Concurrent local MCP waiters that observe the same accepted terminal response now emit only one best-effort phone confirmation while every waiter still converges on the same durable first-terminal winner.
327
+ - Bounded pending-request recovery now returns the newest unresolved requests first by durable creation time, so a recent request is not omitted merely because random requestId ordering filled the limit first.
328
+
329
+ Fail-closed pending/timeout/transport-failure semantics, response-topic secrecy, tool authority, agent hooks, and the deliberately narrower remote Worker surface are unchanged.
330
+
331
+ ## 0.2.6 - 2026-09-22
332
+
333
+ ### Fixed
334
+
335
+ - Concurrent local MCP waiters now send a phone confirmation only for the authoritative first terminal response; a contradictory response that loses the durable terminal claim can no longer produce a misleading confirmation.
336
+ - `nofax_wait_for_response` now advertises `readOnlyHint: false`, accurately reflecting that a terminal wait can persist resolved state and send a best-effort external confirmation while retaining non-destructive, idempotent, open-world hints.
337
+
338
+ First-terminal-response-wins behavior, pending/timeout/transport-failure-never-approval semantics, response-topic secrecy, tool authority, and the deliberately narrower remote Worker surface are unchanged.
339
+
340
+ ## 0.2.5 - 2026-09-22
341
+
342
+ ### Fixed
343
+
344
+ - Durable local MCP requests now replay the full cached one-time ntfy response topic instead of only the last ten minutes, so a terminal human response can still be recovered after a longer client or conversation interruption while the provider retains it.
345
+ - Local MCP approval, choice, and refinement requests now persist their generated request handle and response capability before publishing the phone notification, preventing a delivered response action from being orphaned if local persistence fails afterward.
346
+
347
+ Exact request/decision validation, response-topic secrecy, first-terminal-response-wins behavior, fail-closed approval semantics, and the deliberately narrower remote Worker surface are unchanged.
348
+
349
+ ## 0.2.4 - 2026-09-22
350
+
351
+ ### Added
352
+
353
+ - Semantic JSON Schema descriptions for every local MCP input parameter, including nested choice fields, so clients and agents can understand parameter intent directly from `tools/list`.
354
+ - Object-root MCP `outputSchema` contracts for all seven local tools, covering notification results, durable pending handles, terminal wait results, safe request projections, and bounded pending lists.
355
+ - Regression coverage that validates representative structured results through the MCP SDK's production output validator and rejects malformed output contracts.
356
+
357
+ ### Changed
358
+
359
+ - `nofax_notify` now states explicitly that successful notification transport never counts as human approval.
360
+ - Package README release status now uses the stable `0.2.x` line instead of an obsolete exact patch reference.
361
+
362
+ Local approval, choice, refinement, waiting, persistence, and fail-closed semantics are unchanged.
363
+
364
+ ## 0.2.3 - 2026-09-21
365
+
366
+ ### Fixed
367
+
368
+ - Terminal sidecar claims are now the authoritative resolved record and are read before the original pending projection, eliminating the remaining Windows read/replace race between concurrent waiters.
369
+ - Resolving a request no longer rewrites the original projection after claiming terminal state, while historical main-only resolved records remain readable.
370
+
371
+ ## 0.2.2 - 2026-09-21
372
+
373
+ ### Added
374
+
375
+ - Side-effect-free `nofax --version` and `nofax -v` reporting from installed package metadata.
376
+
377
+ ### Fixed
378
+
379
+ - Concurrent contradictory responses to the same durable local request now converge on one exclusive terminal claim, preserving the first-terminal-response-wins invariant across competing waiters.
380
+ - A terminal claim remains authoritative if a process stops before the ordinary request projection is refreshed, so recovery does not regress a resolved request back to pending.
381
+
382
+ ## 0.2.1 - 2026-09-21
383
+
384
+ ### Changed
385
+
386
+ - Public package onboarding now uses `npm install -g nofax` instead of the obsolete pre-registry GitHub install path.
387
+ - Release and MCP metadata now report local package version `0.2.1` consistently.
388
+
389
+ Local runtime behavior and the fail-closed human-approval boundary are unchanged from `0.2.0`.
390
+
391
+ ## 0.2.0 - 2026-09-09
392
+
393
+ ### Added
394
+
395
+ - Provider-neutral stdio MCP server using the stable MCP TypeScript server SDK v2.
396
+ - Durable local human-response requests that survive MCP/client disconnects.
397
+ - Bounded `nofax_wait_for_response` long-poll with an explicit repeat-until-terminal model contract.
398
+ - MCP recovery tools for reading one request and listing unresolved requests without exposing secret response topics.
399
+ - Free-text refinement through the `Nofax Refine` iOS Shortcut and one-time ntfy callback topics.
400
+ - Best-effort phone confirmation after accepted approvals, denials, choices, and refinements.
401
+ - Generic `nofax refine` CLI command.
402
+ - Codexify stdio MCP configuration and live-test documentation.
403
+
404
+ ### Changed
405
+
406
+ - Package now depends on the official `@modelcontextprotocol/server` v2 runtime and Zod v4.
407
+ - The interaction protocol can return structured refinement text while preserving the v0.1 decision parser for hook compatibility.
408
+
409
+ ### Security
410
+
411
+ - Pending MCP requests never imply approval.
412
+ - One-time response topics remain local and are omitted from MCP tool results.
413
+ - Durable request files use user-only permissions where supported.
414
+
415
+ ## 0.1.0 - 2026-09-09
416
+
417
+ ### Added
418
+
419
+ - Provider-neutral ntfy notification and approval transport.
420
+ - Generic `notify` and `approve` CLI commands.
421
+ - Bidirectional Claude Code `PermissionRequest` adapter.
422
+ - Bidirectional Codex `PermissionRequest` adapter.
423
+ - Notification-only Gemini CLI adapter.
424
+ - Bounded secret-key redaction and high-entropy one-time response topics.
425
+ - Public security, architecture, contribution, and CI documentation.
@@ -0,0 +1,47 @@
1
+ # Contributing to Nofax
2
+
3
+ Thanks for improving Nofax.
4
+
5
+ ## Principles
6
+
7
+ Changes should preserve five invariants:
8
+
9
+ 1. A transport failure never becomes approval.
10
+ 2. Agent-specific schemas stay in adapters.
11
+ 3. Runtime dependencies are added only when they provide a clear, reviewed benefit.
12
+ 4. Compatibility claims require a documented upstream contract and tests.
13
+ 5. Remote capabilities stay narrower than local capabilities unless their trust boundary is explicitly designed and tested.
14
+
15
+ ## Development setup
16
+
17
+ Nofax requires Node.js 20 or newer. Install the pinned dependencies before running checks:
18
+
19
+ ```bash
20
+ npm ci
21
+ npm test
22
+ npm run check
23
+ npm pack --dry-run
24
+ ```
25
+
26
+ Worker development uses its own lockfile under `worker/` and requires Node.js 22 or newer.
27
+
28
+ ## Tests
29
+
30
+ Use Node's built-in `node:test` runner. Network boundaries should be injected and mocked; ordinary tests must not send live ntfy messages.
31
+
32
+ For a new bidirectional agent adapter, include fixtures for:
33
+
34
+ - allow;
35
+ - deny;
36
+ - timeout/native fallback;
37
+ - malformed input;
38
+ - transport failure;
39
+ - absence of unsupported/reserved native fields.
40
+
41
+ ## Pull requests
42
+
43
+ Keep pull requests focused. Explain the upstream agent contract you are integrating and link to its official documentation or canonical schema when possible.
44
+
45
+ Do not add an adapter that claims remote approval when the upstream interface is notification-only.
46
+
47
+ For Worker changes, also run `npm run check` from `worker/`; this includes TypeScript, Vitest, and a Wrangler deployment dry-run.
@@ -0,0 +1,183 @@
1
+ # Nofax Architecture
2
+
3
+ ## Purpose
4
+
5
+ Nofax has two deliberately different surfaces:
6
+
7
+ - **Local Nofax 0.2:** a provider-neutral human-interaction bridge for coding agents and automations. It can notify a phone and return explicit human decisions through ntfy.
8
+ - **Remote Worker 0.3:** an optional self-deployed Cloudflare MCP endpoint for one-way phone notifications plus read-only inspection of existing durable request state.
9
+
10
+ The remote Worker is intentionally not a remote approval transport. It can publish one-way ntfy notifications, but it has no human-response callback route.
11
+
12
+ ## Design principles
13
+
14
+ 1. **Keep local interaction local.** The existing CLI/hooks/stdio MCP retain their human-response semantics without forcing a hosted backend.
15
+ 2. **Remote mutation is narrow.** The only remote side effect is an explicitly requested one-way ntfy notification; request-state operations remain read-only.
16
+ 3. **Enforce by reachability, not hints.** MCP annotations describe the tools, but the hard boundary is the absence of remote approval/callback/state-mutation handlers and routes.
17
+ 4. **Minimize returned data.** Remote request projections omit callback capabilities, callback hashes, original request title/message content, and allowed-decision internals.
18
+ 5. **No hidden writes in reads.** Listing pending requests filters expired rows in SQL without cleanup mutation.
19
+ 6. **Private deployment.** `NOFAX_REMOTE_KEY` protects the remote MCP endpoint; the Worker is intended for one private user/deployment.
20
+ 7. **Preserve upgrade compatibility.** The existing SQLite Durable Object schema remains available so prior experimental rows can still be inspected without destructive migration.
21
+
22
+ ## High-level topology
23
+
24
+ ```text
25
+ Local interactive path
26
+
27
+ agent / local MCP host
28
+ |
29
+ v
30
+ Nofax 0.2
31
+ |
32
+ v
33
+ ntfy
34
+ |
35
+ v
36
+ phone
37
+ |
38
+ +---- explicit response ----> local durable request state
39
+
40
+
41
+ Remote notification + inspection path
42
+
43
+ remote MCP client
44
+ |
45
+ | authenticated Streamable HTTP
46
+ v
47
+ Cloudflare Worker 0.3
48
+ |
49
+ +---- nofax_notify ----------> ntfy ----------> phone
50
+ |
51
+ +---- nofax_get_request ----+
52
+ | |
53
+ +---- nofax_list_pending ---+
54
+ v
55
+ SQLite Durable Object
56
+ ```
57
+
58
+ The only remote messaging path is one-way publication to the configured ntfy topic. There is no remote Telegram, WhatsApp, SMS, approval callback, or human-response path.
59
+
60
+ ## Local implementation
61
+
62
+ The root `src/` package remains the interactive implementation.
63
+
64
+ ### Interaction kinds
65
+
66
+ - `notify`: one-way information.
67
+ - `approval`: Allow/Deny; generic local MCP flows can optionally support refinement.
68
+ - `choice`: one to three explicit choices.
69
+ - `refinement`: free-text human input.
70
+
71
+ Native Claude Code and Codex permission hooks remain Allow/Deny only. Gemini CLI `BeforeTool` is also synchronous Allow/Deny, while its `Notification` hook remains advisory.
72
+
73
+ ### Local durable flow
74
+
75
+ 1. Generate a request ID and one-time response topic.
76
+ 2. Persist bounded request metadata under `~/.nofax/requests/`.
77
+ 3. Publish through the configured ntfy server/topic.
78
+ 4. Poll the one-time response topic for a matching terminal response.
79
+ 5. Persist the first valid terminal result.
80
+ 6. Return the result to the caller.
81
+
82
+ A pending request never implies approval. Timeout, malformed data, network errors, and client disconnects never synthesize Allow.
83
+
84
+ `nofax_wait_for_response` uses bounded waits and requires the caller to wait again while state remains pending.
85
+
86
+ ## Remote Worker
87
+
88
+ The optional `worker/` package uses stateless Streamable HTTP for MCP and a SQLite-backed Durable Object for existing request data.
89
+
90
+ ### Public HTTP surface
91
+
92
+ The router intentionally exposes only:
93
+
94
+ ```text
95
+ GET|HEAD /healthz
96
+ /mcp
97
+ /mcp/<NOFAX_REMOTE_KEY>
98
+ ```
99
+
100
+ `/mcp` requires an exact bearer credential. The path form is a compatibility capability for clients that cannot attach a static Authorization header.
101
+
102
+ Former development callback/webhook paths are not routed and return 404.
103
+
104
+ ### Remote MCP surface
105
+
106
+ Exactly three tools are registered:
107
+
108
+ - `nofax_notify` — one-way external notification side effect;
109
+ - `nofax_get_request` — read-only request inspection;
110
+ - `nofax_list_pending` — read-only request inspection.
111
+
112
+ The two inspection tools carry:
113
+
114
+ ```text
115
+ readOnlyHint: true
116
+ destructiveHint: false
117
+ idempotentHint: true
118
+ openWorldHint: false
119
+ ```
120
+
121
+ The annotations are not treated as enforcement. `nofax_notify` is explicitly marked side-effecting/non-idempotent/open-world, while `createRemoteToolHandlers()` exposes only that bounded notification operation plus the two inspection functions.
122
+
123
+ ### Request projections
124
+
125
+ `nofax_get_request` may return:
126
+
127
+ - request ID;
128
+ - kind;
129
+ - status;
130
+ - creation timestamp;
131
+ - terminal decision/timestamp when historical state is already resolved;
132
+ - stored historical refinement text when present.
133
+
134
+ It does not return the original title/message, callback hash/capability, or internal allowed-decision list.
135
+
136
+ `nofax_list_pending` returns bounded public projections for unresolved, unexpired rows only.
137
+
138
+ ### Observational list semantics
139
+
140
+ The list query uses an expiry predicate rather than deleting stale rows. This is intentional: a read-only MCP call must not cause state mutation as a cleanup side effect.
141
+
142
+ ### Durable Object compatibility
143
+
144
+ The request table/schema and legacy internal methods are retained so deployments created during pre-release experimentation do not require destructive migration. Those mutation methods are not reachable through the Worker router or MCP handler surface.
145
+
146
+ ## Authentication
147
+
148
+ `NOFAX_REMOTE_KEY` is a deployment-wide bearer credential intended for private single-user operation.
149
+
150
+ Preferred form:
151
+
152
+ ```text
153
+ Authorization: Bearer <NOFAX_REMOTE_KEY>
154
+ ```
155
+
156
+ Compatibility form:
157
+
158
+ ```text
159
+ /mcp/<NOFAX_REMOTE_KEY>
160
+ ```
161
+
162
+ Credential comparison is equal-length constant-time. Capability-path requests are normalized to `/mcp` before protocol handling.
163
+
164
+ A future shared/public service would need delegated per-user authentication/authorization rather than one deployment key.
165
+
166
+ ## Security boundaries
167
+
168
+ ### Local
169
+
170
+ - ntfy topics and one-time response URLs are capabilities.
171
+ - public ntfy is not application-level end-to-end encryption from the provider.
172
+ - secret-key redaction is best-effort; arbitrary free-form text may still contain secrets.
173
+ - the originating agent remains responsible for deciding which actions require approval.
174
+
175
+ ### Remote
176
+
177
+ - Cloudflare receives authenticated MCP requests and returned request metadata.
178
+ - only explicit `nofax_notify` calls forward their bounded title/message to ntfy; request-inspection data is not forwarded automatically.
179
+ - the remote MCP key and full capability URL are secrets.
180
+ - MCP annotations improve client UX but are not considered a security control.
181
+ - hard capability boundaries come from the three-tool handler/router structure: one bounded notification side effect plus two read-only inspection tools, with no remote approval/callback/state-mutation route.
182
+
183
+ See [`../SECURITY.md`](../SECURITY.md) and [`remote-mcp.md`](remote-mcp.md) for operational guidance.
@@ -0,0 +1,226 @@
1
+ # Remote Notification + Inspection MCP on Cloudflare Workers
2
+
3
+ Nofax v0.3 adds an optional, self-deployed remote MCP endpoint for **one-way phone notifications plus request inspection**.
4
+
5
+ It does not replace the local Nofax CLI/stdio server and it does not expose local phone-approval or callback capabilities remotely.
6
+
7
+ ## Architecture
8
+
9
+ ```text
10
+ MCP client
11
+ |
12
+ | private Streamable HTTP
13
+ v
14
+ Cloudflare Worker
15
+ |
16
+ +--> authenticated MCP router
17
+ |
18
+ +--> nofax_notify --> ntfy --> phone
19
+ |
20
+ +--> nofax_get_request
21
+ |
22
+ +--> nofax_list_pending
23
+ |
24
+ v
25
+ SQLite Durable Object
26
+ ```
27
+
28
+ The Worker can publish one-way notifications to ntfy. It has no human-response callback route.
29
+
30
+ ## Public routes
31
+
32
+ Only these paths are intentional:
33
+
34
+ ```text
35
+ GET|HEAD /healthz
36
+ /mcp
37
+ /mcp/<NOFAX_REMOTE_KEY>
38
+ ```
39
+
40
+ The `/mcp` routes still enforce the deployment key. The capability-path form exists only for MCP clients that cannot attach a static Authorization header.
41
+
42
+ Former experimental routes such as `/telegram/webhook` and `/r/<token>` are not registered and return 404.
43
+
44
+ ## MCP tools
45
+
46
+ The remote server exposes exactly three tools.
47
+
48
+ ### `nofax_notify`
49
+
50
+ Input:
51
+
52
+ ```json
53
+ {
54
+ "title": "Optional title",
55
+ "message": "Required message"
56
+ }
57
+ ```
58
+
59
+ It publishes a one-way notification to the configured `NTFY_TOPIC`. It does not create durable request state and does not imply or wait for human approval.
60
+
61
+ ### `nofax_get_request`
62
+
63
+ Input:
64
+
65
+ ```json
66
+ {
67
+ "requestId": "nfx_..."
68
+ }
69
+ ```
70
+
71
+ It retrieves the safe public projection for one existing durable request.
72
+
73
+ The response may include:
74
+
75
+ - request ID;
76
+ - interaction kind;
77
+ - status;
78
+ - creation timestamp;
79
+ - terminal timestamp/decision when already resolved;
80
+ - terminal refinement text when it exists in historical state.
81
+
82
+ It does not return the original title/message, callback hash, callback capability, or allowed-decision list.
83
+
84
+ ### `nofax_list_pending`
85
+
86
+ Optional input:
87
+
88
+ ```json
89
+ {
90
+ "limit": 20
91
+ }
92
+ ```
93
+
94
+ It lists a bounded set of unresolved, unexpired request projections. The limit is 1-100.
95
+
96
+ The query is observational only. It filters expired rows but does not delete them or perform lazy cleanup as a side effect of the read.
97
+
98
+ ## Remote side-effect boundary
99
+
100
+ The two inspection tools declare MCP annotations equivalent to:
101
+
102
+ ```json
103
+ {
104
+ "readOnlyHint": true,
105
+ "destructiveHint": false,
106
+ "idempotentHint": true,
107
+ "openWorldHint": false
108
+ }
109
+ ```
110
+
111
+ Those annotations improve client risk/confirmation UX, but Nofax does not treat them as enforcement.
112
+
113
+ The actual boundary is structural:
114
+
115
+ - only `nofax_notify` plus the two read tools are registered with MCP;
116
+ - the handler object exposes only one-way notify plus two read methods;
117
+ - the Worker router has no approval, choice, refinement, wait, callback, or webhook route;
118
+ - ntfy publication is the only remote messaging transport;
119
+ - list operations do not perform hidden state cleanup.
120
+
121
+ The existing Durable Object schema is preserved to avoid destructive migration of deployments that previously created request rows during development. Legacy storage methods are not reachable from the public Worker route or MCP tool surface.
122
+
123
+ ## MCP authentication
124
+
125
+ The v0.3 Worker is intended for a private single-user deployment.
126
+
127
+ ### Preferred: Authorization header
128
+
129
+ ```text
130
+ https://<worker>.workers.dev/mcp
131
+ Authorization: Bearer <NOFAX_REMOTE_KEY>
132
+ ```
133
+
134
+ ### Compatibility: capability URL
135
+
136
+ ```text
137
+ https://<worker>.workers.dev/mcp/<NOFAX_REMOTE_KEY>
138
+ ```
139
+
140
+ The complete capability URL is equivalent to a password. Do not publish it, paste it into issues, expose it to analytics, or include it in screenshots.
141
+
142
+ After successful authentication, Nofax normalizes the request internally to `/mcp` before protocol handling.
143
+
144
+ For a future shared/multi-user service, a single deployment-wide bearer key is not sufficient; use delegated authentication/authorization instead.
145
+
146
+ ## Deployment
147
+
148
+ ### 1. Generate a remote key
149
+
150
+ Generate a high-entropy secret outside the repository. For example:
151
+
152
+ ```bash
153
+ node -e "console.log(require('node:crypto').randomBytes(32).toString('base64url'))"
154
+ ```
155
+
156
+ ### 2. Store the secret and deploy
157
+
158
+ From `worker/`:
159
+
160
+ ```bash
161
+ npm ci
162
+ npx wrangler login
163
+ npx wrangler secret put NOFAX_REMOTE_KEY
164
+ npx wrangler secret put NTFY_TOPIC
165
+ npm run check
166
+ npm run deploy
167
+ ```
168
+
169
+ `NTFY_TOPIC` is a bearer-like capability and should be stored as a Worker secret. The publisher defaults to `https://ntfy.sh` unless `NTFY_SERVER` is configured.
170
+
171
+ Do not place the remote key in `wrangler.jsonc`, source files, `.env`, `.dev.vars`, screenshots, or issue text.
172
+
173
+ ### Public ntfy quota caveat
174
+
175
+ The hosted `ntfy.sh` service enforces its own publish quotas independently of Cloudflare. Cloudflare Workers may share outbound IP space with unrelated workloads, so ntfy can return `42908` (`daily message quota reached`) even when one Worker has sent very little traffic.
176
+
177
+ This is an upstream ntfy availability/quota boundary, not exhaustion of the Cloudflare Worker request allowance. For reliability-sensitive remote notifications, prefer an authenticated provider with account-scoped quota or a trusted self-hosted transport.
178
+
179
+ ## Qualification checklist
180
+
181
+ A release-quality remote deployment should verify all of the following:
182
+
183
+ 1. `/healthz` returns only `{ "status": "ok" }`.
184
+ 2. `/mcp` rejects missing/wrong credentials.
185
+ 3. An authenticated MCP client discovers exactly:
186
+ - `nofax_notify`
187
+ - `nofax_get_request`
188
+ - `nofax_list_pending`
189
+ 4. `nofax_notify` is non-destructive but side-effecting/open-world; the two inspection tools carry accurate read-only/non-destructive/idempotent/closed-world annotations.
190
+ 5. `/telegram/webhook` returns 404.
191
+ 6. `/r/anything` returns 404.
192
+ 7. `nofax_list_pending` does not delete expired state while serving a read.
193
+ 8. MCP results do not expose callback hashes, callback capabilities, original prompt/message text, or allowed-decision internals.
194
+ 9. Worker TypeScript/tests/Wrangler dry-run pass.
195
+ 10. Production dependency audit has no findings.
196
+
197
+ MCP Inspector or another protocol-level MCP client should be used for the final deployed tool scan. A ChatGPT custom-app scan is useful compatibility evidence but is not a substitute for protocol qualification.
198
+
199
+ ## Local versus remote
200
+
201
+ | Capability | Local Nofax 0.2 | Remote Worker 0.3 |
202
+ | --- | --- | --- |
203
+ | MCP transport | stdio | Streamable HTTP |
204
+ | Phone notifications | ntfy | ntfy |
205
+ | Create approval/choice/refinement | yes | no |
206
+ | Wait for human response | yes | no |
207
+ | Read one request | yes | yes |
208
+ | List unresolved requests | yes | yes |
209
+ | Human-response state | local files | existing SQLite Durable Object rows |
210
+ | Inbound port on PC | none | none |
211
+ | Nofax-operated backend | none | none; self-deployed Worker |
212
+ | Authentication | local process boundary | private bearer key |
213
+
214
+ ## Threat boundaries
215
+
216
+ Remote mode adds Cloudflare and ntfy trust boundaries for notification calls: Cloudflare receives authenticated MCP requests and ntfy receives the bounded title/message published to the configured topic. Request-inspection calls remain within Cloudflare/Durable Object state.
217
+
218
+ The Worker sends only explicit `nofax_notify` title/message content to ntfy. Request-inspection results are not forwarded to the phone provider automatically.
219
+
220
+ Treat these as sensitive:
221
+
222
+ - `NOFAX_REMOTE_KEY`;
223
+ - the complete `/mcp/<key>` capability URL;
224
+ - request metadata returned by read tools.
225
+
226
+ Read [`../SECURITY.md`](../SECURITY.md) before using the remote endpoint with sensitive metadata.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nofax",
3
- "version": "0.2.37",
3
+ "version": "0.2.38",
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",
@@ -16,7 +16,11 @@
16
16
  "src/",
17
17
  "README.md",
18
18
  "LICENSE",
19
- "SECURITY.md"
19
+ "SECURITY.md",
20
+ "CHANGELOG.md",
21
+ "CONTRIBUTING.md",
22
+ "docs/architecture.md",
23
+ "docs/remote-mcp.md"
20
24
  ],
21
25
  "scripts": {
22
26
  "test": "node --test test/*.test.mjs",
@@ -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.37' },
77
+ { name: 'nofax', version: '0.2.38' },
78
78
  { instructions: SERVER_INSTRUCTIONS }
79
79
  );
80
80
 
package/src/protocol.mjs CHANGED
@@ -201,10 +201,11 @@ export function createPhoneTopic() {
201
201
 
202
202
  function boundString(value) {
203
203
  const redacted = redactSecretText(value);
204
+ const truncated = value.length > MAX_STRING || redacted.length > MAX_STRING;
204
205
  const bounded = redacted.length <= MAX_STRING
205
206
  ? redacted
206
207
  : redacted.slice(0, safeSliceEnd(redacted, MAX_STRING));
207
- return value.length <= MAX_STRING ? bounded : `${bounded}${TRUNCATION_MARKER}`;
208
+ return truncated ? `${bounded}${TRUNCATION_MARKER}` : bounded;
208
209
  }
209
210
 
210
211
  export function redactAndBound(value, options = {}) {