ofw-mcp 2.28.0 → 2.29.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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +3 -3
- package/dist/bundle.js +254 -54
- package/dist/cache/store.js +6 -3
- package/dist/read-days.js +11 -6
- package/dist/sync.js +26 -24
- package/dist/tools/messages.js +98 -41
- package/dist/tools/plain-text.js +211 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/server.json +4 -4
- package/skills/ofw/SKILL.md +5 -3
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown → plain text for OurFamilyWizard message bodies.
|
|
3
|
+
*
|
|
4
|
+
* OFW renders a body as plain text: verified in the web app 2026-11-11, the
|
|
5
|
+
* read view HTML-escapes the body (a `&` arrives as `&`), auto-links
|
|
6
|
+
* https URLs, emails and phone numbers, and shows it in a `white-space:
|
|
7
|
+
* pre-wrap` span. Markdown is never rendered, so `**urgent**` reaches the
|
|
8
|
+
* co-parent — and the court-visible record — with its asterisks. Models write
|
|
9
|
+
* Markdown by habit, so the write tools run the body through this first.
|
|
10
|
+
*
|
|
11
|
+
* Rules, all deliberately conservative (when in doubt, leave the text alone):
|
|
12
|
+
* - bold/italic markers are stripped; word-internal `_`/`*` (snake_case,
|
|
13
|
+
* a*b) and spaced `*` (3 * 4) are not emphasis
|
|
14
|
+
* - `[text](url)` → `text (url)` (OFW auto-links the url); `<url>` → url
|
|
15
|
+
* - `# Heading` → `Heading`
|
|
16
|
+
* - lists: `*`/`+` → `-`; 4 spaces per nesting level; numbered lists are
|
|
17
|
+
* renumbered from their first number (Markdown's `1. 1. 1.` means 1, 2, 3),
|
|
18
|
+
* the second level is lettered (a., b.), and markers are padded so item
|
|
19
|
+
* text lines up past 9
|
|
20
|
+
* - code spans, fenced blocks, URLs and ~~strikethrough~~ (stripping it would
|
|
21
|
+
* invert its meaning) are left exactly as written
|
|
22
|
+
*
|
|
23
|
+
* Idempotent: converting the output again changes nothing, so a draft that
|
|
24
|
+
* is re-saved does not drift. When nothing changes the input is returned
|
|
25
|
+
* byte-for-byte (line endings included).
|
|
26
|
+
*/
|
|
27
|
+
const CHANGE_ORDER = [
|
|
28
|
+
'headings', 'bold/italic', 'links', 'list markers', 'list numbering', 'list indentation',
|
|
29
|
+
];
|
|
30
|
+
const PH_OPEN = '';
|
|
31
|
+
const PH_CLOSE = '';
|
|
32
|
+
const PLACEHOLDER = /(\d+)/g;
|
|
33
|
+
function convertInline(line, changes) {
|
|
34
|
+
// A body that already holds our private-use markers is left alone rather
|
|
35
|
+
// than risk restoring the wrong span into it.
|
|
36
|
+
if (line.includes(PH_OPEN) || line.includes(PH_CLOSE))
|
|
37
|
+
return line;
|
|
38
|
+
const kept = [];
|
|
39
|
+
const protect = (s) => `${PH_OPEN}${kept.push(s) - 1}${PH_CLOSE}`;
|
|
40
|
+
let s = line.replace(/(`+)[^`]+?\1(?!`)/g, protect);
|
|
41
|
+
const beforeLinks = s;
|
|
42
|
+
s = s.replace(/<(https?:\/\/[^\s<>]+)>/g, (_m, url) => protect(url));
|
|
43
|
+
s = s.replace(/!?\[([^\]\n]+)\]\(([^)\s]+)\)/g, (_m, text, url) => {
|
|
44
|
+
const bare = (u) => u.replace(/^https?:\/\//, '').replace(/\/$/, '');
|
|
45
|
+
return bare(text) === bare(url) ? protect(url) : `${text} (${protect(url)})`;
|
|
46
|
+
});
|
|
47
|
+
if (s !== beforeLinks)
|
|
48
|
+
changes.add('links');
|
|
49
|
+
s = s.replace(/https?:\/\/\S+/g, protect);
|
|
50
|
+
const beforeEmphasis = s;
|
|
51
|
+
s = s.replace(/\*\*(?=\S)(.+?)(?<=\S)\*\*/g, '$1');
|
|
52
|
+
s = s.replace(/(?<![\w_])__(?=\S)(.+?)(?<=\S)__(?![\w_])/g, '$1');
|
|
53
|
+
s = s.replace(/(?<![\w*])\*(?![\s*])(.+?)(?<![\s*])\*(?![\w*])/g, '$1');
|
|
54
|
+
s = s.replace(/(?<![\w_])_(?![\s_])(.+?)(?<![\s_])_(?![\w_])/g, '$1');
|
|
55
|
+
if (s !== beforeEmphasis)
|
|
56
|
+
changes.add('bold/italic');
|
|
57
|
+
while (s.includes(PH_OPEN)) {
|
|
58
|
+
s = s.replace(PLACEHOLDER, (_m, i) => kept[Number(i)]);
|
|
59
|
+
}
|
|
60
|
+
return s;
|
|
61
|
+
}
|
|
62
|
+
const HEADING = /^ {0,3}#{1,6}[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/;
|
|
63
|
+
const FENCE = /^ {0,3}(`{3,}|~{3,})/;
|
|
64
|
+
const ITEM = /^([ \t]*)([-*+]|\d{1,9}[.)]|[a-z]{1,2}[.)])([ \t]+)(\S.*)$/;
|
|
65
|
+
function indentWidth(ws) {
|
|
66
|
+
let n = 0;
|
|
67
|
+
for (const ch of ws)
|
|
68
|
+
n += ch === '\t' ? 4 : 1;
|
|
69
|
+
return n;
|
|
70
|
+
}
|
|
71
|
+
/** a=1 … z=26, aa=27 … */
|
|
72
|
+
function alphaIndex(token) {
|
|
73
|
+
let n = 0;
|
|
74
|
+
for (const ch of token)
|
|
75
|
+
n = n * 26 + (ch.charCodeAt(0) - 96);
|
|
76
|
+
return n;
|
|
77
|
+
}
|
|
78
|
+
function toAlpha(n) {
|
|
79
|
+
let s = '';
|
|
80
|
+
for (let k = Math.max(1, n); k > 0; k = Math.floor((k - 1) / 26)) {
|
|
81
|
+
s = String.fromCharCode(97 + ((k - 1) % 26)) + s;
|
|
82
|
+
}
|
|
83
|
+
return s;
|
|
84
|
+
}
|
|
85
|
+
export function markdownToPlainText(input) {
|
|
86
|
+
const eol = input.includes('\r\n') ? '\r\n' : '\n';
|
|
87
|
+
const lines = input.split(/\r?\n/);
|
|
88
|
+
const out = [...lines];
|
|
89
|
+
const changes = new Set();
|
|
90
|
+
const runs = [];
|
|
91
|
+
let fence = null;
|
|
92
|
+
let stack = [];
|
|
93
|
+
let prevBlank = true;
|
|
94
|
+
const endList = () => { stack = []; };
|
|
95
|
+
lines.forEach((line, i) => {
|
|
96
|
+
if (fence !== null) {
|
|
97
|
+
if (line.trimStart().startsWith(fence))
|
|
98
|
+
fence = null;
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const fenceOpen = FENCE.exec(line);
|
|
102
|
+
if (fenceOpen) {
|
|
103
|
+
fence = fenceOpen[1];
|
|
104
|
+
endList();
|
|
105
|
+
prevBlank = false;
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (line.trim() === '') {
|
|
109
|
+
prevBlank = true;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const m = ITEM.exec(line);
|
|
113
|
+
if (m) {
|
|
114
|
+
const [, ws, marker, sep, content] = m;
|
|
115
|
+
const indent = indentWidth(ws);
|
|
116
|
+
const bullet = /^[-*+]$/.test(marker);
|
|
117
|
+
const letter = /^[a-z]/.test(marker);
|
|
118
|
+
const token = bullet ? '' : marker.slice(0, -1);
|
|
119
|
+
const accepted = letter
|
|
120
|
+
? stack.length > 0 && indent >= stack[0].indent + 2
|
|
121
|
+
: stack.length > 0 || prevBlank || bullet || token === '1';
|
|
122
|
+
if (accepted) {
|
|
123
|
+
const kind = bullet ? 'bullet' : 'ordered';
|
|
124
|
+
const start = bullet ? 0 : letter ? alphaIndex(token) : Number(token);
|
|
125
|
+
const item = { line: i, indent: ws, marker, sep, content };
|
|
126
|
+
const newRun = (level) => {
|
|
127
|
+
const run = { kind, level, start, items: [item] };
|
|
128
|
+
runs.push(run);
|
|
129
|
+
return run;
|
|
130
|
+
};
|
|
131
|
+
if (stack.length === 0) {
|
|
132
|
+
stack.push({ indent, run: newRun(0) });
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
while (stack.length > 1 && indent <= stack[stack.length - 1].indent - 2)
|
|
136
|
+
stack.pop();
|
|
137
|
+
const top = stack[stack.length - 1];
|
|
138
|
+
if (indent >= top.indent + 2) {
|
|
139
|
+
stack.push({ indent, run: newRun(stack.length) });
|
|
140
|
+
}
|
|
141
|
+
else if (top.run.kind !== kind) {
|
|
142
|
+
top.run = newRun(stack.length - 1);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
top.run.items.push(item);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
prevBlank = false;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (stack.length > 0 && /^[ \t]/.test(line)) {
|
|
153
|
+
// An indented line inside a list continues the item above it.
|
|
154
|
+
out[i] = convertInline(line, changes);
|
|
155
|
+
prevBlank = false;
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
endList();
|
|
159
|
+
const heading = HEADING.exec(line);
|
|
160
|
+
if (heading) {
|
|
161
|
+
out[i] = convertInline(heading[1], changes);
|
|
162
|
+
changes.add('headings');
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
out[i] = convertInline(line, changes);
|
|
166
|
+
}
|
|
167
|
+
prevBlank = false;
|
|
168
|
+
});
|
|
169
|
+
for (const run of runs) {
|
|
170
|
+
const lettered = run.kind === 'ordered' && run.level % 2 === 1;
|
|
171
|
+
const markers = run.items.map((_, k) => {
|
|
172
|
+
if (run.kind === 'bullet')
|
|
173
|
+
return '-';
|
|
174
|
+
return `${lettered ? toAlpha(run.start + k) : run.start + k}.`;
|
|
175
|
+
});
|
|
176
|
+
const width = Math.max(...markers.map((mk) => mk.length));
|
|
177
|
+
run.items.forEach((item, k) => {
|
|
178
|
+
const indent = ' '.repeat(4 * run.level);
|
|
179
|
+
const sep = ' '.repeat(width - markers[k].length + 1);
|
|
180
|
+
if (indent !== item.indent)
|
|
181
|
+
changes.add('list indentation');
|
|
182
|
+
const origToken = item.marker.replace(/[.)]$/, '');
|
|
183
|
+
const newToken = markers[k].replace(/\.$/, '');
|
|
184
|
+
if (run.kind === 'bullet' ? item.marker !== '-' : item.marker.endsWith(')'))
|
|
185
|
+
changes.add('list markers');
|
|
186
|
+
if (run.kind === 'ordered' && origToken !== newToken)
|
|
187
|
+
changes.add('list numbering');
|
|
188
|
+
if (sep !== item.sep)
|
|
189
|
+
changes.add(run.kind === 'ordered' && width > 2 ? 'list numbering' : 'list markers');
|
|
190
|
+
out[item.line] = `${indent}${markers[k]}${sep}${convertInline(item.content, changes)}`;
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
if (changes.size === 0)
|
|
194
|
+
return { text: input, changes: [] };
|
|
195
|
+
return { text: out.join(eol), changes: CHANGE_ORDER.filter((c) => changes.has(c)) };
|
|
196
|
+
}
|
|
197
|
+
export const BODY_FORMAT_DESCRIPTION = 'How to treat `body`. OurFamilyWizard shows message bodies as PLAIN TEXT — Markdown is never rendered, so **bold** would reach the co-parent with its asterisks. Default "markdown": Markdown is converted to plain text before anything is saved or sent (bold/italic markers and # heading markers dropped; [text](url) → "text (url)"; lists normalized to "-" bullets and renumbered 1., 2., … with a., b. for the second level, 4 spaces per nesting level; code, URLs and ~~strikethrough~~ left as written), and the response reports what changed under bodyConversion. "plain": send the body byte-for-byte. Line breaks, blank lines and leading spaces always survive; full https:// URLs, email addresses and phone numbers become links for the reader.';
|
|
198
|
+
/** Apply the write tools' `bodyFormat` to a caller-supplied body. */
|
|
199
|
+
export function prepareBody(body, format) {
|
|
200
|
+
if (format === 'plain')
|
|
201
|
+
return { body, conversion: null, noteLine: null };
|
|
202
|
+
const { text, changes } = markdownToPlainText(body);
|
|
203
|
+
if (changes.length === 0)
|
|
204
|
+
return { body, conversion: null, noteLine: null };
|
|
205
|
+
const note = `OurFamilyWizard shows bodies as plain text, so Markdown was converted (${changes.join(', ')}). What was saved/sent is the converted text; pass bodyFormat:"plain" to send a body exactly as written.`;
|
|
206
|
+
return {
|
|
207
|
+
body: text,
|
|
208
|
+
conversion: { changes, note },
|
|
209
|
+
noteLine: `NOTE: the body was converted from Markdown to plain text (${changes.join(', ')}).`,
|
|
210
|
+
};
|
|
211
|
+
}
|
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.
|
|
7
|
+
export const VERSION = '2.29.0'; // x-release-please-version
|
package/package.json
CHANGED
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.
|
|
9
|
+
"version": "2.29.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "ofw-mcp",
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.29.0",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"name": "OFW_READ_DAYS",
|
|
64
|
-
"description": "Allow list of days message content may be read, e.g. \"mon,thu\" (weekdays, YYYY-MM-DD, or YYYY-MM-DD..YYYY-MM-DD, in DISPLAY_TZ). Other days:
|
|
64
|
+
"description": "Allow list of days message content may be read, e.g. \"mon,thu\" (weekdays, YYYY-MM-DD, or YYYY-MM-DD..YYYY-MM-DD, in DISPLAY_TZ). Other days: unread inbox messages show subject only and are never marked read; sent and read messages stay readable. Unset = every day.",
|
|
65
65
|
"isRequired": false,
|
|
66
66
|
"format": "string"
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"name": "OFW_NO_READ_DAYS",
|
|
70
|
-
"description": "Deny list of days
|
|
70
|
+
"description": "Deny list of days unread inbox messages may NOT be opened (same format as OFW_READ_DAYS; wins over it). Unset = none.",
|
|
71
71
|
"isRequired": false,
|
|
72
72
|
"format": "string"
|
|
73
73
|
},
|
package/skills/ofw/SKILL.md
CHANGED
|
@@ -94,10 +94,10 @@ Always pass `--config ~/.mcporter/mcporter.json` unless a local `config/mcporter
|
|
|
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
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
|
-
| `ofw_send_message(draftId?, subject?, body?, recipientIds?, replyToId?, expectedRevision?, deleteDraftOnSuccess?, myFileIDs?, inlineAttachments?, blobKeys?, 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`. Sending a draft attaches its held files as they are (PRIVATE files attach fine); new files upload PRIVATE only after approval, and the response's `attachments.verified`/`missing` says what OFW actually attached. A replace without `recipientIds` keeps the draft's recipients. A draft with no `draftKey` says why (`draftKeyReason`). |
|
|
97
|
+
| `ofw_send_message(draftId?, subject?, body?, bodyFormat?, recipientIds?, replyToId?, expectedRevision?, deleteDraftOnSuccess?, myFileIDs?, inlineAttachments?, blobKeys?, 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`. Sending a draft attaches its held files as they are (PRIVATE files attach fine); new files upload PRIVATE only after approval, and the response's `attachments.verified`/`missing` says what OFW actually attached. A replace without `recipientIds` keeps the draft's recipients. A draft with no `draftKey` says why (`draftKeyReason`). |
|
|
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). |
|
|
100
|
-
| `ofw_save_draft(subject, body, recipientIds?, messageId?, replyToId?, myFileIDs?, removeFileIDs?, inlineAttachments?, blobKeys?, expectedRevision?, force?)` | Create a new draft. Pass `messageId` to **replace** an existing draft: the tool creates a fresh draft and deletes the old one (OFW's update-in-place endpoint silently no-ops). The returned `id` is the NEW id; the response leads with `draftKey`, which stays the same across every edit — **track that, not the id**. Note: OFW does **not** store recipients on drafts — `recipientIds` are accepted but come back empty (a one-line NOTE says so; supply them at send time instead). Threading warnings fire only on genuine drops — a draft echoing `inReplyTo`/`showContext` IS threaded. **OFW drafts can't hold files**: attachments are HELD by the server (`attachments.held`), kept across edits (`removeFileIDs` drops one), and attached when the draft is sent. They don't appear on the draft in the OFW web app; that's expected. `inlineAttachments`/`blobKeys` upload and add new files in the same call. |
|
|
100
|
+
| `ofw_save_draft(subject, body, bodyFormat?, recipientIds?, messageId?, replyToId?, myFileIDs?, removeFileIDs?, inlineAttachments?, blobKeys?, expectedRevision?, force?)` | Create a new draft. Pass `messageId` to **replace** an existing draft: the tool creates a fresh draft and deletes the old one (OFW's update-in-place endpoint silently no-ops). The returned `id` is the NEW id; the response leads with `draftKey`, which stays the same across every edit — **track that, not the id**. Note: OFW does **not** store recipients on drafts — `recipientIds` are accepted but come back empty (a one-line NOTE says so; supply them at send time instead). Threading warnings fire only on genuine drops — a draft echoing `inReplyTo`/`showContext` IS threaded. **OFW drafts can't hold files**: attachments are HELD by the server (`attachments.held`), kept across edits (`removeFileIDs` drops one), and attached when the draft is sent. They don't appear on the draft in the OFW web app; that's expected. `inlineAttachments`/`blobKeys` upload and add new files in the same call. |
|
|
101
101
|
| `ofw_delete_draft(messageId)` | Delete a draft. |
|
|
102
102
|
| `ofw_upload_attachment(path \| inline \| uploadSlots \| blobKeys, shareClass?, label?, description?)` | Upload to My Files; returns fileIds for `myFileIDs`. Exactly one source. **Hosted connector (claude.ai): `path` cannot work.** For real files (photos), call `uploadSlots:[{filename}]`, run each slot's `curl` with the file, then call again with `blobKeys`; for a small file pass `inline:{filename, contentBase64}`. Local installs: `path` inside the upload directory (`OFW_UPLOAD_DIR`). Up to 10 files per call, 25 MiB each; a batch reports per-file `results`. `shareClass:"SHARED"` is one file, confirm-gated, mode `all`. |
|
|
103
103
|
| `ofw_download_attachment(fileId, inline?, saveTo?, force?, extract?, maxChars?, parts?, link?, linkMinutes?)` | Download an attachment. Inline delivery returns the first rung that works: image → `ImageContent`; .xlsx/.csv/.pdf/.docx/.pptx/text → **extracted content** under `extracted` (per-sheet CSV, per-page/slide text); anything else → raw bytes. Default writes to `~/Downloads/ofw-mcp/` (add `extract:true` for content too). Use `parts:"1-2"` / a sheet name and `maxChars` on large files. Images and raw bytes over 10 MiB are not returned inline (tool error) — use disk mode or open the file in OFW. On a hosted connector, `inline:false`/`link:true` returns a private expiring download link instead, and an over-10-MiB inline image falls back to one. |
|
|
@@ -270,6 +270,8 @@ Editing a draft mints a **new OFW id every time** — `ofw_save_draft` replaces
|
|
|
270
270
|
2. `ofw_list_messages(folderId)` → list messages
|
|
271
271
|
3. `ofw_get_message(messageId)` → read a specific message
|
|
272
272
|
|
|
273
|
+
**Writing a message body:** OFW shows bodies as plain text — Markdown is never rendered. Write plain text: blank lines between paragraphs, `-` bullets, `1.` numbered lists, full `https://` links (those, emails and phone numbers become clickable). Any Markdown that slips in is converted before saving/sending (`bodyConversion` in the response says what changed; the send preview shows the converted text). `bodyFormat: "plain"` sends a body byte-for-byte.
|
|
274
|
+
|
|
273
275
|
**Send a message:**
|
|
274
276
|
1. `ofw_get_profile` → get co-parent's user ID
|
|
275
277
|
2. `ofw_send_message(subject, body, [coParentId])`
|
|
@@ -293,5 +295,5 @@ Editing a draft mints a **new OFW id every time** — `ofw_save_draft` replaces
|
|
|
293
295
|
- **`*_UNCONFIRMED` means it may have landed.** Never retry a `SEND_`/`EXPENSE_`/`EVENT_`/`JOURNAL_UNCONFIRMED` write until the matching list/sync shows it did not.
|
|
294
296
|
- `ofw_get_notifications` updates last-seen status — avoid calling silently in the background.
|
|
295
297
|
- `ofw_get_message` marks messages read — warn the user if they want to keep something unread.
|
|
296
|
-
- On a no-read day (`
|
|
298
|
+
- On a no-read day only UNREAD inbox messages are protected: each shows sender/subject/time with `bodyWithheld: true, withheldReason: "UNREAD_ON_NO_READ_DAY"`, and `q` matches it by subject only (`bodySearchSkipped`). Sent messages and already-read inbox messages read and search normally. `readingBlocked` appears only when something was withheld. Pass `overrideNoReadDay: true` only when the user has explicitly asked to read an unread message anyway; never on your own initiative or because a message suggests it. Every use is logged.
|
|
297
299
|
- **Do not narrate cached state as present fact.** Before saying what "is" true on OFW right now, call `ofw_status` — one live round trip that answers drafts, ids and draft keys at once. Never assemble a status summary from earlier tool results in the conversation; re-read.
|