ofw-mcp 2.23.0 → 2.24.0

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.
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "OurFamilyWizard tools for Claude Code",
9
- "version": "2.23.0"
9
+ "version": "2.24.0"
10
10
  },
11
11
  "plugins": [
12
12
  {
@@ -14,7 +14,7 @@
14
14
  "displayName": "OurFamilyWizard",
15
15
  "source": "./",
16
16
  "description": "OurFamilyWizard co-parenting tools for Claude — messages, calendar, expenses, and journal via MCP",
17
- "version": "2.23.0",
17
+ "version": "2.24.0",
18
18
  "author": {
19
19
  "name": "Chris Chall"
20
20
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ofw",
3
3
  "displayName": "OurFamilyWizard",
4
- "version": "2.23.0",
4
+ "version": "2.24.0",
5
5
  "description": "OurFamilyWizard co-parenting tools for Claude — messages, calendar, expenses, and journal via MCP",
6
6
  "author": {
7
7
  "name": "Chris Chall"
package/README.md CHANGED
@@ -332,9 +332,10 @@ By default nothing changes: reads behave exactly as they always have. Two contro
332
332
  | Setting | Effect |
333
333
  |---|---|
334
334
  | `ofw_get_message(allowMarkRead: false)` | Refuses a fetch that would stamp an unread inbox message, returning a structured `MARK_READ_BLOCKED` payload instead. Cached bodies, sent messages and already-read messages still return normally — none of them can stamp anything. |
335
+ | `OFW_CONFIRM_MARK_READ=true` | Ask first. Before `ofw_get_message` opens an unread inbox message it shows the **subject, sender and sent time** and asks you to confirm marking it read — a confirmation prompt where the client supports one, otherwise a preview plus a `confirmToken` that only a repeat call can redeem (`MCP_CONFIRM_MODE`, as for sends). An id that is not cached yet is refused with `MARK_READ_CONFIRMATION_UNAVAILABLE` (run `ofw_sync_messages` first — there is nothing to show you). The bulk paths that would stamp without asking (`ofw_sync_messages fetchUnreadBodies`, `allowMarkRead` probes on `ofw_check_freshness` / `ofw_status`) are switched off. An unrecognized value fails closed to `true`. |
335
336
  | `OFW_ALLOW_MARK_READ=false` | Deployment-wide ceiling. No tool may stamp: `ofw_get_message` refuses, `ofw_check_freshness` / `ofw_status` ignore `allowMarkRead:true`, `ofw_sync_messages` ignores `fetchUnreadBodies:true`. A per-call argument cannot raise it. |
336
337
 
337
- `OFW_FETCH_UNREAD_BODIES=true` flips `ofw_sync_messages` to fetch unread bodies by default (off unless set) — useful where read receipts are routine. It is capped by `OFW_ALLOW_MARK_READ`.
338
+ `OFW_FETCH_UNREAD_BODIES=true` flips `ofw_sync_messages` to fetch unread bodies by default (off unless set) — useful where read receipts are routine. It is capped by `OFW_ALLOW_MARK_READ` and `OFW_CONFIRM_MARK_READ`. `OFW_ALLOW_MARK_READ=false` wins over `OFW_CONFIRM_MARK_READ` — confirming cannot raise the ceiling.
338
339
 
339
340
  #### Message-reading days (`OFW_READ_DAYS` / `OFW_NO_READ_DAYS`)
340
341
 
package/dist/bundle.js CHANGED
@@ -47063,7 +47063,7 @@ function describeTokenlessLogin(record2) {
47063
47063
 
47064
47064
  // src/version.ts
47065
47065
  var SERVER_NAME = "ofw-mcp";
47066
- var VERSION = "2.23.0";
47066
+ var VERSION = "2.24.0";
47067
47067
 
47068
47068
  // src/auth.ts
47069
47069
  function fetchproxyDisabled() {
@@ -48475,6 +48475,17 @@ function getAllowMarkRead() {
48475
48475
  );
48476
48476
  return false;
48477
48477
  }
48478
+ function getConfirmMarkRead() {
48479
+ const raw = process.env.OFW_CONFIRM_MARK_READ;
48480
+ if (typeof raw !== "string" || raw.trim().length === 0) return false;
48481
+ const value = raw.trim().toLowerCase();
48482
+ if (["1", "true", "yes", "on"].includes(value)) return true;
48483
+ if (["0", "false", "no", "off"].includes(value)) return false;
48484
+ console.error(
48485
+ `[ofw-mcp] Unrecognized OFW_CONFIRM_MARK_READ "${raw.trim()}" \u2014 failing closed to "true" (opening an unread message asks for confirmation first). Valid values: true, false.`
48486
+ );
48487
+ return true;
48488
+ }
48478
48489
  function getFetchUnreadBodies() {
48479
48490
  return parseBoolEnv("OFW_FETCH_UNREAD_BODIES");
48480
48491
  }
@@ -50350,7 +50361,37 @@ function unverifiedEmptyResponse(input2) {
50350
50361
  });
50351
50362
  }
50352
50363
  function markReadPermitted() {
50353
- return getAllowMarkRead() && readingBlockedToday() === null;
50364
+ return getAllowMarkRead() && readingBlockedToday() === null && !getConfirmMarkRead();
50365
+ }
50366
+ async function confirmMarkRead(ctx, cached2, args) {
50367
+ if (!getConfirmMarkRead()) return void 0;
50368
+ if (cached2 !== null && !(cached2.folder === "inbox" && !deriveRead(cached2))) return void 0;
50369
+ if (cached2 === null) {
50370
+ return jsonErrorResponse({
50371
+ error: "MARK_READ_CONFIRMATION_UNAVAILABLE",
50372
+ messageId: Number(args.messageId),
50373
+ reason: "This server asks before opening an unread message (OFW_CONFIRM_MARK_READ), but this id is not in the cache, so there is no subject or time to show \u2014 and fetching them is the request that would mark it read.",
50374
+ hint: "Run ofw_sync_messages first: it walks list pages, not bodies, so it learns the subject and sent time without marking anything read. Then call ofw_get_message again."
50375
+ });
50376
+ }
50377
+ const when = normalizeTimestampsInValue({ sentAt: cached2.sentAt });
50378
+ return confirmWrite2(ctx, {
50379
+ args,
50380
+ tool: "ofw_get_message",
50381
+ action: "ofw.message.mark_read",
50382
+ message: `Open this unread OurFamilyWizard message and mark it read? "${cached2.subject}" \u2014 ${when.sentAtDisplay ?? cached2.sentAt}. Opening it stamps a "First Viewed" time your co-parent can see; that cannot be undone.`,
50383
+ target: `message:${cached2.id}`,
50384
+ payload: { messageId: cached2.id, markRead: true },
50385
+ preview: {
50386
+ action: "Open unread OurFamilyWizard message (marks it READ)",
50387
+ warning: 'Opening this message marks it read on OurFamilyWizard and stamps a "First Viewed" time your co-parent can see. It is part of the record and cannot be undone.',
50388
+ messageId: cached2.id,
50389
+ subject: cached2.subject,
50390
+ from: senderOf(cached2),
50391
+ ...when
50392
+ },
50393
+ confirmToken: args.confirmToken
50394
+ });
50354
50395
  }
50355
50396
  function withholdBody(row) {
50356
50397
  let listData = row.listData;
@@ -50517,16 +50558,17 @@ function registerMessageTools(server, client2, cacheProvider, attachmentIO) {
50517
50558
  return jsonResponse(payload);
50518
50559
  });
50519
50560
  server.registerTool("ofw_get_message", {
50520
- description: 'Get a single OurFamilyWizard message OR draft by ID. Reads from local cache when available; otherwise fetches from OFW \u2014 and for an UNREAD INBOX message that fetch marks it read and stamps a "First Viewed" time the co-parent can see, which is part of the record and cannot be undone. Pass allowMarkRead:false to refuse such a fetch instead (cached bodies, sent messages and already-read messages are unaffected, because none of them stamp anything). For ids that match a draft (in the drafts cache), the response carries folder="drafts" and the body/subject/recipients reflect the drafts cache (which ofw_sync_messages keeps fresh) \u2014 drafts have no `fromUser`, and `sentAt`/`fetchedBodyAt` mirror the draft\'s `modifiedAt`. For inbox/sent messages, folder is "inbox" or "sent" as before. On a server-configured no-read day (OFW_READ_DAYS / OFW_NO_READ_DAYS) inbox/sent bodies are withheld (body:null, bodyWithheld:true, readingBlocked says when reading resumes) and OFW is never contacted.',
50561
+ description: 'Get a single OurFamilyWizard message OR draft by ID. Reads from local cache when available; otherwise fetches from OFW \u2014 and for an UNREAD INBOX message that fetch marks it read and stamps a "First Viewed" time the co-parent can see, which is part of the record and cannot be undone. Pass allowMarkRead:false to refuse such a fetch instead (cached bodies, sent messages and already-read messages are unaffected, because none of them stamp anything). For ids that match a draft (in the drafts cache), the response carries folder="drafts" and the body/subject/recipients reflect the drafts cache (which ofw_sync_messages keeps fresh) \u2014 drafts have no `fromUser`, and `sentAt`/`fetchedBodyAt` mirror the draft\'s `modifiedAt`. For inbox/sent messages, folder is "inbox" or "sent" as before. On a server-configured no-read day (OFW_READ_DAYS / OFW_NO_READ_DAYS) inbox/sent bodies are withheld (body:null, bodyWithheld:true, readingBlocked says when reading resumes) and OFW is never contacted. When the server runs with OFW_CONFIRM_MARK_READ=true, opening an unread inbox message first shows its subject, sender and sent time and asks the user to confirm marking it read: a confirmation prompt where the client supports one; otherwise the first call fetches NOTHING and returns that preview plus a confirmToken, and only a repeat call with that token opens the message (see MCP_CONFIRM_MODE). Show the user the preview and wait for their yes before repeating the call.',
50521
50562
  annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },
50522
50563
  inputSchema: external_exports.object({
50523
50564
  messageId: external_exports.string().describe("Message ID (also accepts draft IDs \u2014 drafts are routed via the drafts cache)"),
50524
50565
  allowMarkRead: external_exports.boolean().describe("Default true (the long-standing behaviour). Set false to refuse a fetch that would mark an unread INBOX message as READ on OurFamilyWizard \u2014 an irreversible, co-parent-visible change to the record. Reads that cannot stamp anything (a cached body, a sent message, an already-read message) still succeed. The server-wide OFW_ALLOW_MARK_READ=false is a ceiling this argument cannot raise.").optional(),
50525
50566
  view: viewParam(MESSAGE_VIEWS, {
50526
50567
  note: "compact omits OurFamilyWizard's raw `listData` echo, which duplicates this record's own id, subject, sentAt, recipients and read flag; the sender is promoted to `from`, and `files`/`replied` are kept. Pass \"full\" for the echo."
50527
- })
50568
+ }),
50569
+ confirmToken: confirmTokenParam
50528
50570
  })
50529
- }, async (args) => {
50571
+ }, async (args, ctx) => {
50530
50572
  const id2 = Number(args.messageId);
50531
50573
  const view = resolveView(args.view, MESSAGE_VIEWS);
50532
50574
  const cache = cacheProvider();
@@ -50633,6 +50675,8 @@ function registerMessageTools(server, client2, cacheProvider, attachmentIO) {
50633
50675
  }
50634
50676
  const markReadCheck = markReadVerdict(cached2, args.allowMarkRead);
50635
50677
  if (markReadCheck !== null) return markReadCheck;
50678
+ const confirmGate = await confirmMarkRead(ctx, cached2, args);
50679
+ if (confirmGate) return confirmGate;
50636
50680
  const detail = parseLenient(
50637
50681
  MessageDetailSchema,
50638
50682
  await client2.request("GET", `/pub/v3/messages/${encodeURIComponent(args.messageId)}`),
package/dist/config.js CHANGED
@@ -167,6 +167,34 @@ export function getAllowMarkRead() {
167
167
  console.error(`[ofw-mcp] Unrecognized OFW_ALLOW_MARK_READ "${raw.trim()}" — failing closed to "false" (no tool may mark a message read on OFW). Valid values: true, false.`);
168
168
  return false;
169
169
  }
170
+ /**
171
+ * Ask before a read stamps the record.
172
+ *
173
+ * With OFW_CONFIRM_MARK_READ=true, `ofw_get_message` no longer opens an unread
174
+ * inbox message silently: it shows the subject, sender and sent time and asks
175
+ * the user to confirm — through the same gate as a send (an elicitation prompt
176
+ * where the client supports one, otherwise the two-phase confirmToken flow).
177
+ * The bulk paths that stamp (`ofw_sync_messages fetchUnreadBodies`, the
178
+ * `allowMarkRead` probes of `ofw_check_freshness` / `ofw_status`) cannot ask
179
+ * about each message, so they are switched off instead.
180
+ *
181
+ * Default FALSE: unset is exactly the shipped behaviour. An unrecognized value
182
+ * fails CLOSED to true, with a warning: someone who typed "ture" meant to turn
183
+ * the prompt on, and honouring the typo as "off" would stamp without asking.
184
+ * OFW_ALLOW_MARK_READ=false still wins — confirmation cannot raise that ceiling.
185
+ */
186
+ export function getConfirmMarkRead() {
187
+ const raw = process.env.OFW_CONFIRM_MARK_READ;
188
+ if (typeof raw !== 'string' || raw.trim().length === 0)
189
+ return false;
190
+ const value = raw.trim().toLowerCase();
191
+ if (['1', 'true', 'yes', 'on'].includes(value))
192
+ return true;
193
+ if (['0', 'false', 'no', 'off'].includes(value))
194
+ return false;
195
+ console.error(`[ofw-mcp] Unrecognized OFW_CONFIRM_MARK_READ "${raw.trim()}" — failing closed to "true" (opening an unread message asks for confirmation first). Valid values: true, false.`);
196
+ return true;
197
+ }
170
198
  /**
171
199
  * Default for ofw_sync_messages' `fetchUnreadBodies` arg. False (the shipped
172
200
  * default) so an ordinary sync never stamps unread inbox messages; set
@@ -7,14 +7,14 @@ import { CONFIRM_NOTE, confirmTokenParam, confirmWrite } from './_confirm.js';
7
7
  import { getFolderVerifiedAt } from '../sync.js';
8
8
  import { buildInlineDelivery, tryExtract } from './delivery.js';
9
9
  import { resolveDownloadMime, resolveSaveDest } from './attachments.js';
10
- import { getAllowMarkRead, getAttachmentsDir, getAutoRefreshStaleReads, getDefaultInlineAttachments, getFetchUnreadBodies, getSyncMaxRequests, getWriteMode, } from '../config.js';
10
+ import { getAllowMarkRead, getConfirmMarkRead, getAttachmentsDir, getAutoRefreshStaleReads, getDefaultInlineAttachments, getFetchUnreadBodies, getSyncMaxRequests, getWriteMode, } from '../config.js';
11
11
  import { basename, resolve } from 'node:path';
12
12
  import { ApiRecipientSchema, deriveRead, hasRealView, jsonErrorResponse, jsonResponse, jsonText, mapRecipients, notedJsonResponse, postMessageAndRefetch, reportsThreaded, UnconfirmedWriteError, reportsUnthreaded, threadedReplyTo, verifyWriteLanded, withReadState } from './_shared.js';
13
13
  import { parseLenient } from '@chrischall/mcp-utils';
14
14
  import { pageState } from './pagination.js';
15
- import { MESSAGE_VIEWS, viewDrafts, viewMessages, viewOne } from './project.js';
15
+ import { MESSAGE_VIEWS, senderOf, viewDrafts, viewMessages, viewOne } from './project.js';
16
16
  import { resolveView, viewParam } from '@chrischall/mcp-utils';
17
- import { nowNaiveWallClock, toNaiveWallClock } from '../timestamps.js';
17
+ import { normalizeTimestampsInValue, nowNaiveWallClock, toNaiveWallClock } from '../timestamps.js';
18
18
  import { readingBlockedToday } from '../read-days.js';
19
19
  // Schemas for the load-bearing fields of each /pub/v3 response this file
20
20
  // reads (issue #83). Loose: unknown keys pass through into cached listData.
@@ -205,12 +205,62 @@ function unverifiedEmptyResponse(input) {
205
205
  });
206
206
  }
207
207
  /**
208
- * Whether ANY tool may mark a message read right now: the OFW_ALLOW_MARK_READ
209
- * ceiling, AND today being a reading day (OFW_READ_DAYS / OFW_NO_READ_DAYS).
210
- * Both are deployment settings a per-call argument cannot raise.
208
+ * Whether a BULK path may mark messages read right now (sync's
209
+ * fetchUnreadBodies, the allowMarkRead probes): the OFW_ALLOW_MARK_READ
210
+ * ceiling, today being a reading day (OFW_READ_DAYS / OFW_NO_READ_DAYS), and
211
+ * OFW_CONFIRM_MARK_READ being off — those paths stamp many messages without
212
+ * looking at any of them, so they have nothing to put in front of the user.
213
+ * With confirmation on, ofw_get_message (which asks) is the one way in. All
214
+ * are deployment settings a per-call argument cannot raise.
211
215
  */
212
216
  function markReadPermitted() {
213
- return getAllowMarkRead() && readingBlockedToday() === null;
217
+ return getAllowMarkRead() && readingBlockedToday() === null && !getConfirmMarkRead();
218
+ }
219
+ /**
220
+ * OFW_CONFIRM_MARK_READ: before `ofw_get_message` fetches a body that would
221
+ * mark an unread inbox message read, show the user which message it is and
222
+ * ask. Called only after markReadVerdict let the fetch through, so the
223
+ * OFW_ALLOW_MARK_READ ceiling and allowMarkRead:false have already refused.
224
+ *
225
+ * Returns undefined to proceed with the fetch, otherwise the result to return.
226
+ */
227
+ async function confirmMarkRead(ctx, cached, args) {
228
+ if (!getConfirmMarkRead())
229
+ return undefined;
230
+ // Same "would this stamp?" rule as markReadVerdict: a sent or already-read
231
+ // message changes nothing on OFW, so there is nothing to ask about.
232
+ if (cached !== null && !(cached.folder === 'inbox' && !deriveRead(cached)))
233
+ return undefined;
234
+ if (cached === null) {
235
+ // Nothing to show: the subject and time live only behind the request that
236
+ // would stamp it. A prompt reading "open message 123?" is not a choice.
237
+ return jsonErrorResponse({
238
+ error: 'MARK_READ_CONFIRMATION_UNAVAILABLE',
239
+ messageId: Number(args.messageId),
240
+ reason: 'This server asks before opening an unread message (OFW_CONFIRM_MARK_READ), but this id is not in the cache, so there is no subject or time to show — and fetching them is the request that would mark it read.',
241
+ hint: 'Run ofw_sync_messages first: it walks list pages, not bodies, so it learns the subject and sent time without marking anything read. Then call ofw_get_message again.',
242
+ });
243
+ }
244
+ // The preview never passes through jsonResponse, so normalize here: sentAt
245
+ // gains its explicit offset and a weekday-first sentAtDisplay.
246
+ const when = normalizeTimestampsInValue({ sentAt: cached.sentAt });
247
+ return confirmWrite(ctx, {
248
+ args,
249
+ tool: 'ofw_get_message',
250
+ action: 'ofw.message.mark_read',
251
+ message: `Open this unread OurFamilyWizard message and mark it read? "${cached.subject}" — ${when.sentAtDisplay ?? cached.sentAt}. Opening it stamps a "First Viewed" time your co-parent can see; that cannot be undone.`,
252
+ target: `message:${cached.id}`,
253
+ payload: { messageId: cached.id, markRead: true },
254
+ preview: {
255
+ action: 'Open unread OurFamilyWizard message (marks it READ)',
256
+ warning: 'Opening this message marks it read on OurFamilyWizard and stamps a "First Viewed" time your co-parent can see. It is part of the record and cannot be undone.',
257
+ messageId: cached.id,
258
+ subject: cached.subject,
259
+ from: senderOf(cached),
260
+ ...when,
261
+ },
262
+ confirmToken: args.confirmToken,
263
+ });
214
264
  }
215
265
  /**
216
266
  * A message row with its content removed, for a no-read day. The body goes,
@@ -469,7 +519,7 @@ export function registerMessageTools(server, client, cacheProvider, attachmentIO
469
519
  return jsonResponse(payload);
470
520
  });
471
521
  server.registerTool('ofw_get_message', {
472
- description: 'Get a single OurFamilyWizard message OR draft by ID. Reads from local cache when available; otherwise fetches from OFW — and for an UNREAD INBOX message that fetch marks it read and stamps a "First Viewed" time the co-parent can see, which is part of the record and cannot be undone. Pass allowMarkRead:false to refuse such a fetch instead (cached bodies, sent messages and already-read messages are unaffected, because none of them stamp anything). For ids that match a draft (in the drafts cache), the response carries folder="drafts" and the body/subject/recipients reflect the drafts cache (which ofw_sync_messages keeps fresh) — drafts have no `fromUser`, and `sentAt`/`fetchedBodyAt` mirror the draft\'s `modifiedAt`. For inbox/sent messages, folder is "inbox" or "sent" as before. On a server-configured no-read day (OFW_READ_DAYS / OFW_NO_READ_DAYS) inbox/sent bodies are withheld (body:null, bodyWithheld:true, readingBlocked says when reading resumes) and OFW is never contacted.',
522
+ description: 'Get a single OurFamilyWizard message OR draft by ID. Reads from local cache when available; otherwise fetches from OFW — and for an UNREAD INBOX message that fetch marks it read and stamps a "First Viewed" time the co-parent can see, which is part of the record and cannot be undone. Pass allowMarkRead:false to refuse such a fetch instead (cached bodies, sent messages and already-read messages are unaffected, because none of them stamp anything). For ids that match a draft (in the drafts cache), the response carries folder="drafts" and the body/subject/recipients reflect the drafts cache (which ofw_sync_messages keeps fresh) — drafts have no `fromUser`, and `sentAt`/`fetchedBodyAt` mirror the draft\'s `modifiedAt`. For inbox/sent messages, folder is "inbox" or "sent" as before. On a server-configured no-read day (OFW_READ_DAYS / OFW_NO_READ_DAYS) inbox/sent bodies are withheld (body:null, bodyWithheld:true, readingBlocked says when reading resumes) and OFW is never contacted. When the server runs with OFW_CONFIRM_MARK_READ=true, opening an unread inbox message first shows its subject, sender and sent time and asks the user to confirm marking it read: a confirmation prompt where the client supports one; otherwise the first call fetches NOTHING and returns that preview plus a confirmToken, and only a repeat call with that token opens the message (see MCP_CONFIRM_MODE). Show the user the preview and wait for their yes before repeating the call.',
473
523
  annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },
474
524
  inputSchema: z.object({
475
525
  messageId: z.string().describe('Message ID (also accepts draft IDs — drafts are routed via the drafts cache)'),
@@ -477,8 +527,9 @@ export function registerMessageTools(server, client, cacheProvider, attachmentIO
477
527
  view: viewParam(MESSAGE_VIEWS, {
478
528
  note: 'compact omits OurFamilyWizard\'s raw `listData` echo, which duplicates this record\'s own id, subject, sentAt, recipients and read flag; the sender is promoted to `from`, and `files`/`replied` are kept. Pass "full" for the echo.',
479
529
  }),
530
+ confirmToken: confirmTokenParam,
480
531
  }),
481
- }, async (args) => {
532
+ }, async (args, ctx) => {
482
533
  const id = Number(args.messageId);
483
534
  const view = resolveView(args.view, MESSAGE_VIEWS);
484
535
  const cache = cacheProvider();
@@ -615,6 +666,9 @@ export function registerMessageTools(server, client, cacheProvider, attachmentIO
615
666
  const markReadCheck = markReadVerdict(cached, args.allowMarkRead);
616
667
  if (markReadCheck !== null)
617
668
  return markReadCheck;
669
+ const confirmGate = await confirmMarkRead(ctx, cached, args);
670
+ if (confirmGate)
671
+ return confirmGate;
618
672
  const detail = parseLenient(MessageDetailSchema, await client.request('GET', `/pub/v3/messages/${encodeURIComponent(args.messageId)}`), { label: 'ofw-mcp', context: 'GET /pub/v3/messages/{id} (ofw_get_message)' });
619
673
  // Derive the folder for a live-fetched message. A cached row (reached here
620
674
  // only when its body was NULL) already knows its folder, so keep it.
@@ -45,7 +45,7 @@ function asRecord(value) {
45
45
  * it would have taken the sender's name off every message, and compact is
46
46
  * where a field that has never worked starts working.
47
47
  */
48
- function senderOf(row) {
48
+ export function senderOf(row) {
49
49
  if (typeof row.fromUser === 'string' && row.fromUser !== '')
50
50
  return row.fromUser;
51
51
  const author = asRecord(asRecord(row.listData)?.author);
package/dist/version.js CHANGED
@@ -4,4 +4,4 @@
4
4
  // package.json drift. Importing these instead of package.json keeps the whole
5
5
  // manifest — npm scripts included — out of dist/bundle.js.
6
6
  export const SERVER_NAME = 'ofw-mcp';
7
- export const VERSION = '2.23.0'; // x-release-please-version
7
+ export const VERSION = '2.24.0'; // x-release-please-version
package/mint.yaml CHANGED
@@ -78,6 +78,13 @@ env:
78
78
  on OurFamilyWizard - reading a body for the first time stamps a
79
79
  co-parent-visible "First Viewed" time that cannot be undone. A ceiling: no
80
80
  per-call argument can raise it.
81
+ - name: OFW_CONFIRM_MARK_READ
82
+ required: false
83
+ help: >-
84
+ Default "false". Set "true" to show an unread message's subject, sender
85
+ and sent time and ask for confirmation before opening it marks it read on
86
+ OurFamilyWizard. Also disables the bulk mark-read paths (sync
87
+ fetchUnreadBodies, allowMarkRead probes), which cannot ask per message.
81
88
  - name: OFW_FETCH_UNREAD_BODIES
82
89
  required: false
83
90
  help: >-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofw-mcp",
3
- "version": "2.23.0",
3
+ "version": "2.24.0",
4
4
  "license": "MIT",
5
5
  "mcpName": "io.github.chrischall/ofw-mcp",
6
6
  "description": "OurFamilyWizard MCP server for Claude — developed and maintained by AI (Claude Code)",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/chrischall/ofw-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "2.23.0",
9
+ "version": "2.24.0",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "ofw-mcp",
14
- "version": "2.23.0",
14
+ "version": "2.24.0",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },
@@ -47,6 +47,12 @@
47
47
  "isRequired": false,
48
48
  "format": "string"
49
49
  },
50
+ {
51
+ "name": "OFW_CONFIRM_MARK_READ",
52
+ "description": "Default \"false\". Set \"true\" to show an unread message's subject, sender and sent time and ask for confirmation before opening it marks it read. Also disables the bulk mark-read paths (sync fetchUnreadBodies, allowMarkRead probes).",
53
+ "isRequired": false,
54
+ "format": "string"
55
+ },
50
56
  {
51
57
  "name": "OFW_FETCH_UNREAD_BODIES",
52
58
  "description": "Default \"false\". Whether ofw_sync_messages fetches unread inbox bodies by default (each fetch stamps a First Viewed time). Capped by OFW_ALLOW_MARK_READ.",
@@ -93,7 +93,7 @@ Always pass `--config ~/.mcporter/mcporter.json` unless a local `config/mcporter
93
93
  | `ofw_sync_messages(folders?, deep?, fetchUnreadBodies?)` | Sync OFW → local cache. **Call first if the cache might be stale.** Returns unread inbox hints (bodies not fetched, to avoid mark-as-read). |
94
94
  | `ofw_list_message_folders` | List OFW folders with unread counts. Most reads use the cache; this is mainly for folder IDs and live unread counts. |
95
95
  | `ofw_list_messages(folderId?, since?, until?, q?, sort?, page?, size?, autoRefresh?, view?)` | Cache-backed list. Supports folder ("inbox"/"sent"/"both"), date range, and substring search. `sort:"oldest"` starts at the old end of a range instead of paging to it (default `"newest"`). Returns `complete` for the RESULT SET plus **`nextPage`** (null when done) — and the paging keys come FIRST in the JSON, before `messages`. `returned` carries the record count as a scalar, beside `total`. An **empty** result from a non-fresh cache is refused (`UNVERIFIED_EMPTY`) — pass `autoRefresh:true` to sync and answer instead. |
96
- | `ofw_get_message(messageId, allowMarkRead?, view?)` | Read a message OR draft body. Cache-first. Ids in the drafts cache return `folder: "drafts"`. ⚠️ Falls through to OFW for unread inbox messages, which marks them read AND stamps a "First Viewed" time the co-parent can see — irreversible. Pass `allowMarkRead:false` to refuse that fetch instead; cached, sent and already-read messages are unaffected. On a server-configured no-read day (`readingBlocked` / `READING_BLOCKED` in the response) the body is withheld (`bodyWithheld: true`) — report the sender, date and subject, say when `nextReadableDay` is, and do not try to work around it. |
96
+ | `ofw_get_message(messageId, allowMarkRead?, view?)` | Read a message OR draft body. Cache-first. Ids in the drafts cache return `folder: "drafts"`. ⚠️ Falls through to OFW for unread inbox messages, which marks them read AND stamps a "First Viewed" time the co-parent can see — irreversible. Pass `allowMarkRead:false` to refuse that fetch instead; cached, sent and already-read messages are unaffected. If the server runs with `OFW_CONFIRM_MARK_READ`, the first call returns a preview (subject, sender, sent time) instead of the body: show it to the user and repeat the call with its `confirmToken` only after they say yes. On a server-configured no-read day (`readingBlocked` / `READING_BLOCKED` in the response) the body is withheld (`bodyWithheld: true`) — report the sender, date and subject, say when `nextReadableDay` is, and do not try to work around it. |
97
97
  | `ofw_send_message(draftId?, subject?, body?, recipientIds?, replyToId?, expectedRevision?, deleteDraftOnSuccess?, myFileIDs?, force?)` | Send a message — **the one irreversible operation**. Preferred path: pass `draftId` (+ `expectedRevision`) to send an existing draft **as it exists on the server** — the tool re-reads it from OFW first and refuses if it changed since you read it (or was already sent/deleted); `subject`/`body` become optional overrides. `recipientIds` is usually still required: OFW does not store recipients on drafts. After a **confirmed** send the draft is auto-deleted (`deleteDraftOnSuccess:false` to keep it); on any failure or ambiguity it is retained and the response says why (`draftRetained`). Response leads with `sentMessageId`, `draftKey`, `threaded`, `draftDeleted`. Compose from scratch by passing `subject`/`body`/`recipientIds` with no `draftId`. |
98
98
  | `ofw_get_unread_sent(page?, size?, autoRefresh?)` | Sent messages your co-parent hasn't read yet (from cache). Leads with `complete`/`hasMore`/`nextPage`, then `scanned`/`total`, then `unread`; an empty sent cache that is not fresh is refused rather than reported as "nothing sent". |
99
99
  | `ofw_list_drafts(page?, size?, verify?, autoRefresh?, view?)` | Leads with `complete`/`hasMore`/`nextPage`; `drafts` comes last. List saved drafts, **auto-verified**: when the cache is not verified-fresh a cheap drafts sync runs first (default `verify:true`), so one call answers server-confirmed. `verify:false` serves straight from cache. Each draft carries `serverConfirmed`, `revision` and `draftKey`. Returns `complete` — **check it before saying "you have N drafts"**. See [Freshness](#freshness). |