ofw-mcp 1.5.2 → 1.5.3
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/dist/bundle.js +5 -5
- package/dist/tools/messages.js +10 -7
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -21145,13 +21145,13 @@ async function handleTool2(name, args, client2) {
|
|
|
21145
21145
|
const messages = listData.data ?? [];
|
|
21146
21146
|
const unread = [];
|
|
21147
21147
|
for (const msg of messages) {
|
|
21148
|
-
|
|
21149
|
-
const unreadRecipients = (
|
|
21148
|
+
if (!msg.showNeverViewed) continue;
|
|
21149
|
+
const unreadRecipients = (msg.recipients ?? []).filter((r) => !r.viewed).map((r) => r.user.name);
|
|
21150
21150
|
if (unreadRecipients.length > 0) {
|
|
21151
21151
|
unread.push({
|
|
21152
|
-
id:
|
|
21153
|
-
subject:
|
|
21154
|
-
sentAt:
|
|
21152
|
+
id: msg.id,
|
|
21153
|
+
subject: msg.subject,
|
|
21154
|
+
sentAt: msg.date.dateTime,
|
|
21155
21155
|
unreadBy: unreadRecipients
|
|
21156
21156
|
});
|
|
21157
21157
|
}
|
package/dist/tools/messages.js
CHANGED
|
@@ -190,22 +190,25 @@ export async function handleTool(name, args, client) {
|
|
|
190
190
|
const sentFolder = (foldersData.systemFolders ?? []).find((f) => f.folderType === 'SENT_MESSAGES');
|
|
191
191
|
if (!sentFolder)
|
|
192
192
|
throw new Error('Sent folder not found');
|
|
193
|
-
// Step 2: list sent messages
|
|
193
|
+
// Step 2: list sent messages (the list endpoint already includes per-recipient viewed status)
|
|
194
194
|
const listPath = `/pub/v3/messages?folders=${encodeURIComponent(sentFolder.id)}&page=${page}&size=${size}&sort=date&sortDirection=desc`;
|
|
195
195
|
const listData = await client.request('GET', listPath);
|
|
196
196
|
const messages = listData.data ?? [];
|
|
197
|
-
// Step 3:
|
|
197
|
+
// Step 3: filter to unread using showNeverViewed (avoids N+1 detail fetches
|
|
198
|
+
// and the detail endpoint's inconsistent viewed field which can return null
|
|
199
|
+
// for read messages instead of the epoch sentinel the list endpoint uses)
|
|
198
200
|
const unread = [];
|
|
199
201
|
for (const msg of messages) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
if (!msg.showNeverViewed)
|
|
203
|
+
continue;
|
|
204
|
+
const unreadRecipients = (msg.recipients ?? [])
|
|
202
205
|
.filter((r) => !r.viewed)
|
|
203
206
|
.map((r) => r.user.name);
|
|
204
207
|
if (unreadRecipients.length > 0) {
|
|
205
208
|
unread.push({
|
|
206
|
-
id:
|
|
207
|
-
subject:
|
|
208
|
-
sentAt:
|
|
209
|
+
id: msg.id,
|
|
210
|
+
subject: msg.subject,
|
|
211
|
+
sentAt: msg.date.dateTime,
|
|
209
212
|
unreadBy: unreadRecipients,
|
|
210
213
|
});
|
|
211
214
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ofw-mcp",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "OurFamilyWizard MCP server for Claude — developed and maintained by AI (Claude Sonnet 4.6)",
|
|
5
5
|
"author": "Claude Sonnet 4.6 (AI) <https://www.anthropic.com/claude>",
|
|
6
6
|
"repository": {
|