@mosadd/mcp 3.0.0-alpha.32 → 3.0.0-alpha.34
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 +74 -0
- package/README.md +11 -11
- package/dist/bin/mcp.js +1 -1
- package/dist/{chunk-KX34DDJB.js → chunk-IWLN5EO5.js} +614 -134
- package/dist/index.d.ts +16 -6
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/src/__tests__/golden-path.test.ts +137 -137
- package/src/__tests__/integration.test.ts +179 -179
- package/src/__tests__/knowledge-ingest.test.ts +114 -0
- package/src/__tests__/mdm-e2ee.test.ts +212 -212
- package/src/__tests__/mtalk.test.ts +122 -122
- package/src/__tests__/presence.test.ts +141 -0
- package/src/__tests__/server.test.ts +71 -71
- package/src/__tests__/tool-count-consistency.test.ts +121 -1
- package/src/bin/login.ts +138 -138
- package/src/bin/mcp.ts +145 -145
- package/src/config.ts +66 -66
- package/src/crypto/mdm-session.ts +502 -502
- package/src/index.ts +19 -19
- package/src/observability/sentry.ts +79 -79
- package/src/providers/blob-upload.ts +116 -116
- package/src/providers/memory-voice.ts +79 -79
- package/src/providers/supabase-dm.ts +122 -122
- package/src/providers/supabase-voice.ts +91 -91
- package/src/providers/supabase.ts +148 -148
- package/src/tools/actions.ts +162 -162
- package/src/tools/attachments.ts +268 -268
- package/src/tools/capabilities.ts +68 -68
- package/src/tools/embed.ts +108 -108
- package/src/tools/index.ts +173 -104
- package/src/tools/knowledge-graph.ts +178 -0
- package/src/tools/knowledge.ts +319 -191
- package/src/tools/mail-agentbox.ts +147 -0
- package/src/tools/mail-aliases.ts +25 -25
- package/src/tools/mail-provenance.ts +135 -135
- package/src/tools/mail.ts +381 -381
- package/src/tools/mdm.ts +476 -479
- package/src/tools/mirc-edge.ts +190 -190
- package/src/tools/mirc-members.ts +2 -2
- package/src/tools/mirc-messages.ts +155 -155
- package/src/tools/mirc.ts +2 -2
- package/src/tools/mroom-messages.ts +142 -142
- package/src/tools/mroom.ts +221 -221
- package/src/tools/mtalk.ts +121 -121
- package/src/tools/murl.ts +4 -2
- package/src/tools/presence.ts +208 -0
- package/src/types.ts +94 -94
- package/src/voice/floor.ts +132 -132
package/src/tools/mail.ts
CHANGED
|
@@ -1,381 +1,381 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mp0st — Email.
|
|
3
|
-
*
|
|
4
|
-
* Every mosadd user gets `<userId>@mosadd.com` for free — incoming mail lands
|
|
5
|
-
* in their app, outgoing mail flows through the mosadd mp0st pipeline.
|
|
6
|
-
*
|
|
7
|
-
* Phase 1 alpha: wired to the mosadd backend's `mp0st-send` + `mp0st-view` Edge Functions.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { z } from "zod";
|
|
11
|
-
import type { MosaddTool, MosaddToolContext } from "../types.js";
|
|
12
|
-
import { invokeFunction, readSupabaseEnv } from "../providers/supabase.js";
|
|
13
|
-
|
|
14
|
-
// ---- Schemas ----
|
|
15
|
-
|
|
16
|
-
const EmailAddress = z
|
|
17
|
-
.string()
|
|
18
|
-
.email()
|
|
19
|
-
.max(254)
|
|
20
|
-
.describe("RFC 5321 email address.");
|
|
21
|
-
|
|
22
|
-
const MessageId = z.string().min(1).describe("Message id (UUID) from mAYL_send or inbox.");
|
|
23
|
-
|
|
24
|
-
const mp0st_send_input = z.object({
|
|
25
|
-
to: z.union([EmailAddress, z.array(EmailAddress).min(1).max(50)]).describe(
|
|
26
|
-
"Recipient(s). Single address or array of up to 50.",
|
|
27
|
-
),
|
|
28
|
-
subject: z.string().min(1).max(998).describe("Email subject line. Max 998 chars (RFC 5322)."),
|
|
29
|
-
body_text: z.string().max(1_048_576).optional().describe("Plain text body. Max 1 MB."),
|
|
30
|
-
body_html: z.string().max(1_048_576).optional().describe("HTML body. Max 1 MB."),
|
|
31
|
-
cc: z.array(EmailAddress).max(50).optional(),
|
|
32
|
-
bcc: z.array(EmailAddress).max(50).optional(),
|
|
33
|
-
reply_to: EmailAddress.optional(),
|
|
34
|
-
tracking: z
|
|
35
|
-
.boolean()
|
|
36
|
-
.optional()
|
|
37
|
-
.describe("Open-pixel + link-click tracking. Default true. Set false to send with NO tracking (privacy / GDPR-friendly)."),
|
|
38
|
-
force_reader: z
|
|
39
|
-
.boolean()
|
|
40
|
-
.optional()
|
|
41
|
-
.describe("Default false. If true, the email body is a stub only and the recipient must open it in mosadd's secure reader — maximizes tracking (print/copy/time-on-read become observable). Best for confidential / legal mail."),
|
|
42
|
-
disclose_tracking: z
|
|
43
|
-
.boolean()
|
|
44
|
-
.optional()
|
|
45
|
-
.describe("Default false. If true (and tracking on), append a tracking-disclosure footer to the email — recommended for GDPR/ePrivacy compliance."),
|
|
46
|
-
watermark: z
|
|
47
|
-
.union([z.boolean(), z.string().max(120)])
|
|
48
|
-
.optional()
|
|
49
|
-
.describe("Inject a faint recipient watermark into the secure reader (shows in screenshots/prints). Pass true to watermark with the recipient address, or a custom string."),
|
|
50
|
-
auto_destruct: z
|
|
51
|
-
.enum(["1h", "24h", "7d"])
|
|
52
|
-
.optional()
|
|
53
|
-
.describe("Self-destruct timer: the secure-reader link expires after this window."),
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
const mp0st_view_input = z.object({
|
|
57
|
-
message_id: MessageId,
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
const mp0st_delete_input = z.object({
|
|
61
|
-
message_id: MessageId,
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const mp0st_list_input = z.object({
|
|
65
|
-
direction: z
|
|
66
|
-
.enum(["inbound", "outbound"])
|
|
67
|
-
.optional()
|
|
68
|
-
.describe("Filter to received (inbound) or sent (outbound) mail. Omit for both."),
|
|
69
|
-
limit: z.number().int().min(1).max(200).optional().describe("Max emails to return. Default 50."),
|
|
70
|
-
before: z
|
|
71
|
-
.string()
|
|
72
|
-
.optional()
|
|
73
|
-
.describe("Pagination cursor: pass the previous response's next_cursor to get the next (older) page."),
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
const mp0st_stats_input = z.object({
|
|
77
|
-
message_id: MessageId,
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
const mp0st_events_input = z.object({
|
|
81
|
-
message_id: MessageId,
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
const mp0st_metrics_input = z.object({});
|
|
85
|
-
|
|
86
|
-
const mp0st_revoke_input = z.object({
|
|
87
|
-
message_id: MessageId,
|
|
88
|
-
restore: z
|
|
89
|
-
.boolean()
|
|
90
|
-
.optional()
|
|
91
|
-
.describe("Set true to UN-revoke (restore access). Default false = revoke."),
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const mp0st_audit_export_input = z.object({
|
|
95
|
-
message_id: MessageId,
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
const mp0st_consent_input = z.object({
|
|
99
|
-
action: z
|
|
100
|
-
.enum(["list", "check", "optin"])
|
|
101
|
-
.describe("'list' = recipients who opted out of your tracking; 'check' = is one recipient opted out; 'optin' = re-enable tracking for a recipient."),
|
|
102
|
-
recipient: EmailAddress.optional().describe("Required for 'check' and 'optin'."),
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
const mp0st_notify_input = z.object({
|
|
106
|
-
since: z
|
|
107
|
-
.string()
|
|
108
|
-
.optional()
|
|
109
|
-
.describe("ISO-8601 cursor — return only events newer than this. Pass the previous response's `cursor` to poll for new activity."),
|
|
110
|
-
limit: z.number().int().min(1).max(200).optional().describe("Max events. Default 50."),
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
interface MailListItem {
|
|
114
|
-
message_id: string;
|
|
115
|
-
direction: "inbound" | "outbound";
|
|
116
|
-
from: string;
|
|
117
|
-
to: string;
|
|
118
|
-
subject: string;
|
|
119
|
-
priority: string;
|
|
120
|
-
status: string;
|
|
121
|
-
sent_at: string;
|
|
122
|
-
snippet: string;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// ---- Handlers ----
|
|
126
|
-
|
|
127
|
-
async function mp0st_send(
|
|
128
|
-
input: z.infer<typeof mp0st_send_input>,
|
|
129
|
-
ctx: MosaddToolContext,
|
|
130
|
-
): Promise<{ message_id: string; status: string; is_internal: boolean }> {
|
|
131
|
-
readSupabaseEnv();
|
|
132
|
-
if (!input.body_text && !input.body_html) {
|
|
133
|
-
throw new Error("mp0st_send requires at least one of body_text or body_html.");
|
|
134
|
-
}
|
|
135
|
-
ctx.log("debug", "mp0st_send invoking mp0st-send", { to: input.to });
|
|
136
|
-
// mp0st-send returns { ok, email_id, status, is_internal } — remap email_id to the
|
|
137
|
-
// tool's message_id contract (email_id IS the message id). Surface backend errors.
|
|
138
|
-
const res = await invokeFunction<{ ok?: boolean; email_id?: string; status?: string; is_internal?: boolean; error?: string }>("mp0st-send", input);
|
|
139
|
-
if (res.error) throw new Error(res.error);
|
|
140
|
-
return { message_id: res.email_id ?? "", status: res.status ?? "sent", is_internal: res.is_internal ?? false };
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
async function mp0st_view(
|
|
144
|
-
input: z.infer<typeof mp0st_view_input>,
|
|
145
|
-
ctx: MosaddToolContext,
|
|
146
|
-
): Promise<{
|
|
147
|
-
message_id: string;
|
|
148
|
-
from: string;
|
|
149
|
-
to: string[];
|
|
150
|
-
subject: string;
|
|
151
|
-
body_text: string | null;
|
|
152
|
-
body_html: string | null;
|
|
153
|
-
sent_at: string;
|
|
154
|
-
}> {
|
|
155
|
-
readSupabaseEnv();
|
|
156
|
-
// mp0st-get (NOT mp0st-view): mp0st-view is the open-tracking pixel endpoint
|
|
157
|
-
// keyed on ?t=<trackingId> and always 400s "Missing tracking ID" on a JSON POST.
|
|
158
|
-
// mp0st-get reads the owner-scoped email by id and returns the full body.
|
|
159
|
-
ctx.log("debug", "mp0st_view invoking mp0st-get", { message_id: input.message_id });
|
|
160
|
-
return await invokeFunction("mp0st-get", { message_id: input.message_id });
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
async function mp0st_list(
|
|
164
|
-
input: z.infer<typeof mp0st_list_input>,
|
|
165
|
-
ctx: MosaddToolContext,
|
|
166
|
-
): Promise<{ emails: MailListItem[]; next_cursor: string | null }> {
|
|
167
|
-
readSupabaseEnv();
|
|
168
|
-
ctx.log("debug", "mp0st_list invoking mp0st-list", { direction: input.direction });
|
|
169
|
-
return await invokeFunction<{ emails: MailListItem[]; next_cursor: string | null }>("mp0st-list", {
|
|
170
|
-
direction: input.direction ?? null,
|
|
171
|
-
limit: input.limit ?? 50,
|
|
172
|
-
before: input.before ?? null,
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
async function mp0st_delete(
|
|
177
|
-
input: z.infer<typeof mp0st_delete_input>,
|
|
178
|
-
ctx: MosaddToolContext,
|
|
179
|
-
): Promise<{ ok: true; message_id: string; deleted: true }> {
|
|
180
|
-
readSupabaseEnv();
|
|
181
|
-
ctx.log("debug", "mp0st_delete invoking mp0st-delete", { message_id: input.message_id });
|
|
182
|
-
return await invokeFunction<{ ok: true; message_id: string; deleted: true }>("mp0st-delete", {
|
|
183
|
-
message_id: input.message_id,
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
interface MailEngagement {
|
|
188
|
-
message_id: string;
|
|
189
|
-
subject: string;
|
|
190
|
-
to: string;
|
|
191
|
-
direction: string;
|
|
192
|
-
status: string;
|
|
193
|
-
sent_at: string;
|
|
194
|
-
open_count: number;
|
|
195
|
-
unique_opens: number;
|
|
196
|
-
click_count: number;
|
|
197
|
-
forwarded: boolean;
|
|
198
|
-
first_opened_at: string | null;
|
|
199
|
-
last_opened_at: string | null;
|
|
200
|
-
events_by_type: Record<string, number>;
|
|
201
|
-
total_events: number;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
async function mp0st_stats(
|
|
205
|
-
input: z.infer<typeof mp0st_stats_input>,
|
|
206
|
-
ctx: MosaddToolContext,
|
|
207
|
-
): Promise<{ summary: MailEngagement }> {
|
|
208
|
-
readSupabaseEnv();
|
|
209
|
-
ctx.log("debug", "mp0st_stats invoking mp0st-stats", { message_id: input.message_id });
|
|
210
|
-
return await invokeFunction<{ summary: MailEngagement }>("mp0st-stats", {
|
|
211
|
-
message_id: input.message_id,
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
async function mp0st_events(
|
|
216
|
-
input: z.infer<typeof mp0st_events_input>,
|
|
217
|
-
ctx: MosaddToolContext,
|
|
218
|
-
): Promise<{
|
|
219
|
-
summary: MailEngagement;
|
|
220
|
-
events: Array<{ event_type: string; at: string; device: string | null; ip_hash: string | null; link_url: string | null }>;
|
|
221
|
-
}> {
|
|
222
|
-
readSupabaseEnv();
|
|
223
|
-
ctx.log("debug", "mp0st_events invoking mp0st-stats", { message_id: input.message_id });
|
|
224
|
-
return await invokeFunction("mp0st-stats", { message_id: input.message_id, events: true });
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
async function mp0st_metrics(
|
|
228
|
-
_input: z.infer<typeof mp0st_metrics_input>,
|
|
229
|
-
ctx: MosaddToolContext,
|
|
230
|
-
): Promise<{
|
|
231
|
-
mailbox: {
|
|
232
|
-
total_sent: number;
|
|
233
|
-
opened_emails: number;
|
|
234
|
-
open_rate_pct: number;
|
|
235
|
-
total_opens: number;
|
|
236
|
-
total_clicks: number;
|
|
237
|
-
forwarded_emails: number;
|
|
238
|
-
};
|
|
239
|
-
}> {
|
|
240
|
-
readSupabaseEnv();
|
|
241
|
-
ctx.log("debug", "mp0st_metrics invoking mp0st-stats");
|
|
242
|
-
return await invokeFunction("mp0st-stats", {});
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
async function mp0st_revoke(
|
|
246
|
-
input: z.infer<typeof mp0st_revoke_input>,
|
|
247
|
-
ctx: MosaddToolContext,
|
|
248
|
-
): Promise<{ ok: true; message_id: string; revoked: boolean; expires_at: string | null }> {
|
|
249
|
-
readSupabaseEnv();
|
|
250
|
-
ctx.log("debug", "mp0st_revoke invoking mp0st-revoke", { message_id: input.message_id, restore: !!input.restore });
|
|
251
|
-
return await invokeFunction("mp0st-revoke", {
|
|
252
|
-
message_id: input.message_id,
|
|
253
|
-
restore: input.restore ?? false,
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
async function mp0st_audit_export(
|
|
258
|
-
input: z.infer<typeof mp0st_audit_export_input>,
|
|
259
|
-
ctx: MosaddToolContext,
|
|
260
|
-
): Promise<{ audit: Record<string, unknown>; signature: string; algo: string; note: string }> {
|
|
261
|
-
readSupabaseEnv();
|
|
262
|
-
ctx.log("debug", "mp0st_audit_export invoking mp0st-audit", { message_id: input.message_id });
|
|
263
|
-
return await invokeFunction("mp0st-audit", { message_id: input.message_id });
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
async function mp0st_consent(
|
|
267
|
-
input: z.infer<typeof mp0st_consent_input>,
|
|
268
|
-
ctx: MosaddToolContext,
|
|
269
|
-
): Promise<Record<string, unknown>> {
|
|
270
|
-
readSupabaseEnv();
|
|
271
|
-
if ((input.action === "check" || input.action === "optin") && !input.recipient) {
|
|
272
|
-
throw new Error(`mp0st_consent action '${input.action}' requires a 'recipient' email address.`);
|
|
273
|
-
}
|
|
274
|
-
ctx.log("debug", "mp0st_consent invoking mp0st-consent", { action: input.action });
|
|
275
|
-
return await invokeFunction("mp0st-consent", { action: input.action, recipient: input.recipient ?? null });
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
async function mp0st_notify(
|
|
279
|
-
input: z.infer<typeof mp0st_notify_input>,
|
|
280
|
-
ctx: MosaddToolContext,
|
|
281
|
-
): Promise<{
|
|
282
|
-
events: Array<{ message_id: string; subject: string | null; to: string | null; event_type: string; device: string | null; link_url: string | null; at: string }>;
|
|
283
|
-
cursor: string | null;
|
|
284
|
-
count: number;
|
|
285
|
-
}> {
|
|
286
|
-
readSupabaseEnv();
|
|
287
|
-
ctx.log("debug", "mp0st_notify invoking mp0st-notify", { since: input.since });
|
|
288
|
-
return await invokeFunction("mp0st-notify", { action: "feed", since: input.since ?? null, limit: input.limit ?? 50 });
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// ---- Registration ----
|
|
292
|
-
|
|
293
|
-
export const mailTools: MosaddTool[] = [
|
|
294
|
-
{
|
|
295
|
-
name: "mAYL_list",
|
|
296
|
-
requires: "network",
|
|
297
|
-
description:
|
|
298
|
-
"List the user's mailbox (their <userId>@mosadd.com inbox/outbox) newest-first, with sender, subject, status and a short snippet. Filter by direction ('inbound' = received, 'outbound' = sent). Use the returned next_cursor with `before` to page through older mail. Call mAYL_view to read a full message body.",
|
|
299
|
-
inputSchema: mp0st_list_input,
|
|
300
|
-
handler: mp0st_list as MosaddTool["handler"],
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
name: "mAYL_send",
|
|
304
|
-
requires: "network",
|
|
305
|
-
description:
|
|
306
|
-
"Send an email from the user's mosadd address (<userId>@mosadd.com). Pass body_text or body_html (or both). Supports cc, bcc, reply_to. Monitoring/legal options: tracking (open+click, default on; set false for no tracking), force_reader (stub email → recipient opens in mosadd's secure reader, unlocking print/copy/time-on-read tracking + revoke), watermark (recipient watermark visible in screenshots/prints), disclose_tracking (GDPR footer), auto_destruct ('1h'|'24h'|'7d').",
|
|
307
|
-
inputSchema: mp0st_send_input,
|
|
308
|
-
handler: mp0st_send as MosaddTool["handler"],
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
name: "mAYL_view",
|
|
312
|
-
requires: "network",
|
|
313
|
-
description: "Read the full body and metadata of an email by message_id.",
|
|
314
|
-
inputSchema: mp0st_view_input,
|
|
315
|
-
handler: mp0st_view as MosaddTool["handler"],
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
name: "mAYL_delete",
|
|
319
|
-
requires: "network",
|
|
320
|
-
description:
|
|
321
|
-
"Delete one of the user's emails by message_id (from mAYL_list). Soft-delete — it stops showing in mAYL_list. Owner-scoped: only your own mail.",
|
|
322
|
-
inputSchema: mp0st_delete_input,
|
|
323
|
-
handler: mp0st_delete as MosaddTool["handler"],
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
name: "mAYL_stats",
|
|
327
|
-
requires: "network",
|
|
328
|
-
description:
|
|
329
|
-
"Engagement summary for one sent email (by message_id): open_count, unique_opens, click_count, whether it was likely forwarded, first/last opened time, and a breakdown of tracked event types. Opens/clicks are real (tracking pixel + link-wrap); forward detection is best-effort (IP-subnet diversity). Owner-scoped.",
|
|
330
|
-
inputSchema: mp0st_stats_input,
|
|
331
|
-
handler: mp0st_stats as MosaddTool["handler"],
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
name: "mAYL_events",
|
|
335
|
-
requires: "network",
|
|
336
|
-
description:
|
|
337
|
-
"Raw engagement timeline for one email (by message_id): every tracked event (pixel_open, link_click, forwarded, page_view, copy/print/focus signals) with timestamp, device type and link URL. Use mAYL_stats for the rollup; use this for the per-event detail. Owner-scoped.",
|
|
338
|
-
inputSchema: mp0st_events_input,
|
|
339
|
-
handler: mp0st_events as MosaddTool["handler"],
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
name: "mAYL_metrics",
|
|
343
|
-
requires: "network",
|
|
344
|
-
description:
|
|
345
|
-
"Mailbox-wide engagement aggregate across the user's sent mail: total_sent, opened_emails, open_rate_pct, total_opens, total_clicks, forwarded_emails. Owner-scoped.",
|
|
346
|
-
inputSchema: mp0st_metrics_input,
|
|
347
|
-
handler: mp0st_metrics as MosaddTool["handler"],
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
name: "mAYL_revoke",
|
|
351
|
-
requires: "network",
|
|
352
|
-
description:
|
|
353
|
-
"Revoke (recall) a sent email's secure-reader access by message_id — the recipient can no longer open the full message via the mosadd reader link (Virtru-style recall, immediate). Pass restore:true to re-enable. HONEST LIMIT: cannot un-send or claw back content the recipient already read, copied, or screenshotted — only disables future reader access. Owner-scoped.",
|
|
354
|
-
inputSchema: mp0st_revoke_input,
|
|
355
|
-
handler: mp0st_revoke as MosaddTool["handler"],
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
name: "mAYL_audit_export",
|
|
359
|
-
requires: "network",
|
|
360
|
-
description:
|
|
361
|
-
"Export a tamper-evident engagement audit report for one sent email (RMail-style): full event trail (opens, clicks, reader print/copy/forward signals) + totals, plus an HMAC-SHA256 signature over the canonical JSON so the report can be proven unaltered. For legal/compliance use. HONEST LIMIT: proves what mosadd observed; it is not a qualified delivery receipt (ERDS). Owner-scoped.",
|
|
362
|
-
inputSchema: mp0st_audit_export_input,
|
|
363
|
-
handler: mp0st_audit_export as MosaddTool["handler"],
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
name: "mAYL_consent",
|
|
367
|
-
requires: "network",
|
|
368
|
-
description:
|
|
369
|
-
"Manage recipient tracking opt-outs (GDPR/ePrivacy). action 'list' = recipients who opted out of your tracking; 'check' {recipient} = whether one opted out; 'optin' {recipient} = re-enable. Recipients self-opt-out via the footer link in your tracked emails; mAYL_send then automatically sends them with NO pixel/link-wrap. Owner-scoped.",
|
|
370
|
-
inputSchema: mp0st_consent_input,
|
|
371
|
-
handler: mp0st_consent as MosaddTool["handler"],
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
name: "mAYL_notify",
|
|
375
|
-
requires: "network",
|
|
376
|
-
description:
|
|
377
|
-
"Recent engagement feed across ALL your sent mail — the 'who just opened/clicked my mail' notifications stream (opens, clicks, forwards, reader print/copy signals), newest first, each with the email subject + recipient. Poll: pass the returned `cursor` back as `since` to get only new activity. Owner-scoped.",
|
|
378
|
-
inputSchema: mp0st_notify_input,
|
|
379
|
-
handler: mp0st_notify as MosaddTool["handler"],
|
|
380
|
-
},
|
|
381
|
-
];
|
|
1
|
+
/**
|
|
2
|
+
* mp0st — Email.
|
|
3
|
+
*
|
|
4
|
+
* Every mosadd user gets `<userId>@mosadd.com` for free — incoming mail lands
|
|
5
|
+
* in their app, outgoing mail flows through the mosadd mp0st pipeline.
|
|
6
|
+
*
|
|
7
|
+
* Phase 1 alpha: wired to the mosadd backend's `mp0st-send` + `mp0st-view` Edge Functions.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import type { MosaddTool, MosaddToolContext } from "../types.js";
|
|
12
|
+
import { invokeFunction, readSupabaseEnv } from "../providers/supabase.js";
|
|
13
|
+
|
|
14
|
+
// ---- Schemas ----
|
|
15
|
+
|
|
16
|
+
const EmailAddress = z
|
|
17
|
+
.string()
|
|
18
|
+
.email()
|
|
19
|
+
.max(254)
|
|
20
|
+
.describe("RFC 5321 email address.");
|
|
21
|
+
|
|
22
|
+
const MessageId = z.string().min(1).describe("Message id (UUID) from mAYL_send or inbox.");
|
|
23
|
+
|
|
24
|
+
const mp0st_send_input = z.object({
|
|
25
|
+
to: z.union([EmailAddress, z.array(EmailAddress).min(1).max(50)]).describe(
|
|
26
|
+
"Recipient(s). Single address or array of up to 50.",
|
|
27
|
+
),
|
|
28
|
+
subject: z.string().min(1).max(998).describe("Email subject line. Max 998 chars (RFC 5322)."),
|
|
29
|
+
body_text: z.string().max(1_048_576).optional().describe("Plain text body. Max 1 MB."),
|
|
30
|
+
body_html: z.string().max(1_048_576).optional().describe("HTML body. Max 1 MB."),
|
|
31
|
+
cc: z.array(EmailAddress).max(50).optional(),
|
|
32
|
+
bcc: z.array(EmailAddress).max(50).optional(),
|
|
33
|
+
reply_to: EmailAddress.optional(),
|
|
34
|
+
tracking: z
|
|
35
|
+
.boolean()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Open-pixel + link-click tracking. Default true. Set false to send with NO tracking (privacy / GDPR-friendly)."),
|
|
38
|
+
force_reader: z
|
|
39
|
+
.boolean()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("Default false. If true, the email body is a stub only and the recipient must open it in mosadd's secure reader — maximizes tracking (print/copy/time-on-read become observable). Best for confidential / legal mail."),
|
|
42
|
+
disclose_tracking: z
|
|
43
|
+
.boolean()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("Default false. If true (and tracking on), append a tracking-disclosure footer to the email — recommended for GDPR/ePrivacy compliance."),
|
|
46
|
+
watermark: z
|
|
47
|
+
.union([z.boolean(), z.string().max(120)])
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("Inject a faint recipient watermark into the secure reader (shows in screenshots/prints). Pass true to watermark with the recipient address, or a custom string."),
|
|
50
|
+
auto_destruct: z
|
|
51
|
+
.enum(["1h", "24h", "7d"])
|
|
52
|
+
.optional()
|
|
53
|
+
.describe("Self-destruct timer: the secure-reader link expires after this window."),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const mp0st_view_input = z.object({
|
|
57
|
+
message_id: MessageId,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const mp0st_delete_input = z.object({
|
|
61
|
+
message_id: MessageId,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const mp0st_list_input = z.object({
|
|
65
|
+
direction: z
|
|
66
|
+
.enum(["inbound", "outbound"])
|
|
67
|
+
.optional()
|
|
68
|
+
.describe("Filter to received (inbound) or sent (outbound) mail. Omit for both."),
|
|
69
|
+
limit: z.number().int().min(1).max(200).optional().describe("Max emails to return. Default 50."),
|
|
70
|
+
before: z
|
|
71
|
+
.string()
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("Pagination cursor: pass the previous response's next_cursor to get the next (older) page."),
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const mp0st_stats_input = z.object({
|
|
77
|
+
message_id: MessageId,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const mp0st_events_input = z.object({
|
|
81
|
+
message_id: MessageId,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const mp0st_metrics_input = z.object({});
|
|
85
|
+
|
|
86
|
+
const mp0st_revoke_input = z.object({
|
|
87
|
+
message_id: MessageId,
|
|
88
|
+
restore: z
|
|
89
|
+
.boolean()
|
|
90
|
+
.optional()
|
|
91
|
+
.describe("Set true to UN-revoke (restore access). Default false = revoke."),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const mp0st_audit_export_input = z.object({
|
|
95
|
+
message_id: MessageId,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const mp0st_consent_input = z.object({
|
|
99
|
+
action: z
|
|
100
|
+
.enum(["list", "check", "optin"])
|
|
101
|
+
.describe("'list' = recipients who opted out of your tracking; 'check' = is one recipient opted out; 'optin' = re-enable tracking for a recipient."),
|
|
102
|
+
recipient: EmailAddress.optional().describe("Required for 'check' and 'optin'."),
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const mp0st_notify_input = z.object({
|
|
106
|
+
since: z
|
|
107
|
+
.string()
|
|
108
|
+
.optional()
|
|
109
|
+
.describe("ISO-8601 cursor — return only events newer than this. Pass the previous response's `cursor` to poll for new activity."),
|
|
110
|
+
limit: z.number().int().min(1).max(200).optional().describe("Max events. Default 50."),
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
interface MailListItem {
|
|
114
|
+
message_id: string;
|
|
115
|
+
direction: "inbound" | "outbound";
|
|
116
|
+
from: string;
|
|
117
|
+
to: string;
|
|
118
|
+
subject: string;
|
|
119
|
+
priority: string;
|
|
120
|
+
status: string;
|
|
121
|
+
sent_at: string;
|
|
122
|
+
snippet: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// ---- Handlers ----
|
|
126
|
+
|
|
127
|
+
async function mp0st_send(
|
|
128
|
+
input: z.infer<typeof mp0st_send_input>,
|
|
129
|
+
ctx: MosaddToolContext,
|
|
130
|
+
): Promise<{ message_id: string; status: string; is_internal: boolean }> {
|
|
131
|
+
readSupabaseEnv();
|
|
132
|
+
if (!input.body_text && !input.body_html) {
|
|
133
|
+
throw new Error("mp0st_send requires at least one of body_text or body_html.");
|
|
134
|
+
}
|
|
135
|
+
ctx.log("debug", "mp0st_send invoking mp0st-send", { to: input.to });
|
|
136
|
+
// mp0st-send returns { ok, email_id, status, is_internal } — remap email_id to the
|
|
137
|
+
// tool's message_id contract (email_id IS the message id). Surface backend errors.
|
|
138
|
+
const res = await invokeFunction<{ ok?: boolean; email_id?: string; status?: string; is_internal?: boolean; error?: string }>("mp0st-send", input);
|
|
139
|
+
if (res.error) throw new Error(res.error);
|
|
140
|
+
return { message_id: res.email_id ?? "", status: res.status ?? "sent", is_internal: res.is_internal ?? false };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function mp0st_view(
|
|
144
|
+
input: z.infer<typeof mp0st_view_input>,
|
|
145
|
+
ctx: MosaddToolContext,
|
|
146
|
+
): Promise<{
|
|
147
|
+
message_id: string;
|
|
148
|
+
from: string;
|
|
149
|
+
to: string[];
|
|
150
|
+
subject: string;
|
|
151
|
+
body_text: string | null;
|
|
152
|
+
body_html: string | null;
|
|
153
|
+
sent_at: string;
|
|
154
|
+
}> {
|
|
155
|
+
readSupabaseEnv();
|
|
156
|
+
// mp0st-get (NOT mp0st-view): mp0st-view is the open-tracking pixel endpoint
|
|
157
|
+
// keyed on ?t=<trackingId> and always 400s "Missing tracking ID" on a JSON POST.
|
|
158
|
+
// mp0st-get reads the owner-scoped email by id and returns the full body.
|
|
159
|
+
ctx.log("debug", "mp0st_view invoking mp0st-get", { message_id: input.message_id });
|
|
160
|
+
return await invokeFunction("mp0st-get", { message_id: input.message_id });
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
async function mp0st_list(
|
|
164
|
+
input: z.infer<typeof mp0st_list_input>,
|
|
165
|
+
ctx: MosaddToolContext,
|
|
166
|
+
): Promise<{ emails: MailListItem[]; next_cursor: string | null }> {
|
|
167
|
+
readSupabaseEnv();
|
|
168
|
+
ctx.log("debug", "mp0st_list invoking mp0st-list", { direction: input.direction });
|
|
169
|
+
return await invokeFunction<{ emails: MailListItem[]; next_cursor: string | null }>("mp0st-list", {
|
|
170
|
+
direction: input.direction ?? null,
|
|
171
|
+
limit: input.limit ?? 50,
|
|
172
|
+
before: input.before ?? null,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
async function mp0st_delete(
|
|
177
|
+
input: z.infer<typeof mp0st_delete_input>,
|
|
178
|
+
ctx: MosaddToolContext,
|
|
179
|
+
): Promise<{ ok: true; message_id: string; deleted: true }> {
|
|
180
|
+
readSupabaseEnv();
|
|
181
|
+
ctx.log("debug", "mp0st_delete invoking mp0st-delete", { message_id: input.message_id });
|
|
182
|
+
return await invokeFunction<{ ok: true; message_id: string; deleted: true }>("mp0st-delete", {
|
|
183
|
+
message_id: input.message_id,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
interface MailEngagement {
|
|
188
|
+
message_id: string;
|
|
189
|
+
subject: string;
|
|
190
|
+
to: string;
|
|
191
|
+
direction: string;
|
|
192
|
+
status: string;
|
|
193
|
+
sent_at: string;
|
|
194
|
+
open_count: number;
|
|
195
|
+
unique_opens: number;
|
|
196
|
+
click_count: number;
|
|
197
|
+
forwarded: boolean;
|
|
198
|
+
first_opened_at: string | null;
|
|
199
|
+
last_opened_at: string | null;
|
|
200
|
+
events_by_type: Record<string, number>;
|
|
201
|
+
total_events: number;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
async function mp0st_stats(
|
|
205
|
+
input: z.infer<typeof mp0st_stats_input>,
|
|
206
|
+
ctx: MosaddToolContext,
|
|
207
|
+
): Promise<{ summary: MailEngagement }> {
|
|
208
|
+
readSupabaseEnv();
|
|
209
|
+
ctx.log("debug", "mp0st_stats invoking mp0st-stats", { message_id: input.message_id });
|
|
210
|
+
return await invokeFunction<{ summary: MailEngagement }>("mp0st-stats", {
|
|
211
|
+
message_id: input.message_id,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
async function mp0st_events(
|
|
216
|
+
input: z.infer<typeof mp0st_events_input>,
|
|
217
|
+
ctx: MosaddToolContext,
|
|
218
|
+
): Promise<{
|
|
219
|
+
summary: MailEngagement;
|
|
220
|
+
events: Array<{ event_type: string; at: string; device: string | null; ip_hash: string | null; link_url: string | null }>;
|
|
221
|
+
}> {
|
|
222
|
+
readSupabaseEnv();
|
|
223
|
+
ctx.log("debug", "mp0st_events invoking mp0st-stats", { message_id: input.message_id });
|
|
224
|
+
return await invokeFunction("mp0st-stats", { message_id: input.message_id, events: true });
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
async function mp0st_metrics(
|
|
228
|
+
_input: z.infer<typeof mp0st_metrics_input>,
|
|
229
|
+
ctx: MosaddToolContext,
|
|
230
|
+
): Promise<{
|
|
231
|
+
mailbox: {
|
|
232
|
+
total_sent: number;
|
|
233
|
+
opened_emails: number;
|
|
234
|
+
open_rate_pct: number;
|
|
235
|
+
total_opens: number;
|
|
236
|
+
total_clicks: number;
|
|
237
|
+
forwarded_emails: number;
|
|
238
|
+
};
|
|
239
|
+
}> {
|
|
240
|
+
readSupabaseEnv();
|
|
241
|
+
ctx.log("debug", "mp0st_metrics invoking mp0st-stats");
|
|
242
|
+
return await invokeFunction("mp0st-stats", {});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
async function mp0st_revoke(
|
|
246
|
+
input: z.infer<typeof mp0st_revoke_input>,
|
|
247
|
+
ctx: MosaddToolContext,
|
|
248
|
+
): Promise<{ ok: true; message_id: string; revoked: boolean; expires_at: string | null }> {
|
|
249
|
+
readSupabaseEnv();
|
|
250
|
+
ctx.log("debug", "mp0st_revoke invoking mp0st-revoke", { message_id: input.message_id, restore: !!input.restore });
|
|
251
|
+
return await invokeFunction("mp0st-revoke", {
|
|
252
|
+
message_id: input.message_id,
|
|
253
|
+
restore: input.restore ?? false,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
async function mp0st_audit_export(
|
|
258
|
+
input: z.infer<typeof mp0st_audit_export_input>,
|
|
259
|
+
ctx: MosaddToolContext,
|
|
260
|
+
): Promise<{ audit: Record<string, unknown>; signature: string; algo: string; note: string }> {
|
|
261
|
+
readSupabaseEnv();
|
|
262
|
+
ctx.log("debug", "mp0st_audit_export invoking mp0st-audit", { message_id: input.message_id });
|
|
263
|
+
return await invokeFunction("mp0st-audit", { message_id: input.message_id });
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
async function mp0st_consent(
|
|
267
|
+
input: z.infer<typeof mp0st_consent_input>,
|
|
268
|
+
ctx: MosaddToolContext,
|
|
269
|
+
): Promise<Record<string, unknown>> {
|
|
270
|
+
readSupabaseEnv();
|
|
271
|
+
if ((input.action === "check" || input.action === "optin") && !input.recipient) {
|
|
272
|
+
throw new Error(`mp0st_consent action '${input.action}' requires a 'recipient' email address.`);
|
|
273
|
+
}
|
|
274
|
+
ctx.log("debug", "mp0st_consent invoking mp0st-consent", { action: input.action });
|
|
275
|
+
return await invokeFunction("mp0st-consent", { action: input.action, recipient: input.recipient ?? null });
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
async function mp0st_notify(
|
|
279
|
+
input: z.infer<typeof mp0st_notify_input>,
|
|
280
|
+
ctx: MosaddToolContext,
|
|
281
|
+
): Promise<{
|
|
282
|
+
events: Array<{ message_id: string; subject: string | null; to: string | null; event_type: string; device: string | null; link_url: string | null; at: string }>;
|
|
283
|
+
cursor: string | null;
|
|
284
|
+
count: number;
|
|
285
|
+
}> {
|
|
286
|
+
readSupabaseEnv();
|
|
287
|
+
ctx.log("debug", "mp0st_notify invoking mp0st-notify", { since: input.since });
|
|
288
|
+
return await invokeFunction("mp0st-notify", { action: "feed", since: input.since ?? null, limit: input.limit ?? 50 });
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// ---- Registration ----
|
|
292
|
+
|
|
293
|
+
export const mailTools: MosaddTool[] = [
|
|
294
|
+
{
|
|
295
|
+
name: "mAYL_list",
|
|
296
|
+
requires: "network",
|
|
297
|
+
description:
|
|
298
|
+
"List the user's mailbox (their <userId>@mosadd.com inbox/outbox) newest-first, with sender, subject, status and a short snippet. Filter by direction ('inbound' = received, 'outbound' = sent). Use the returned next_cursor with `before` to page through older mail. Call mAYL_view to read a full message body.",
|
|
299
|
+
inputSchema: mp0st_list_input,
|
|
300
|
+
handler: mp0st_list as MosaddTool["handler"],
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: "mAYL_send",
|
|
304
|
+
requires: "network",
|
|
305
|
+
description:
|
|
306
|
+
"Send an email from the user's mosadd address (<userId>@mosadd.com). Pass body_text or body_html (or both). Supports cc, bcc, reply_to. Monitoring/legal options: tracking (open+click, default on; set false for no tracking), force_reader (stub email → recipient opens in mosadd's secure reader, unlocking print/copy/time-on-read tracking + revoke), watermark (recipient watermark visible in screenshots/prints), disclose_tracking (GDPR footer), auto_destruct ('1h'|'24h'|'7d').",
|
|
307
|
+
inputSchema: mp0st_send_input,
|
|
308
|
+
handler: mp0st_send as MosaddTool["handler"],
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: "mAYL_view",
|
|
312
|
+
requires: "network",
|
|
313
|
+
description: "Read the full body and metadata of an email by message_id.",
|
|
314
|
+
inputSchema: mp0st_view_input,
|
|
315
|
+
handler: mp0st_view as MosaddTool["handler"],
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: "mAYL_delete",
|
|
319
|
+
requires: "network",
|
|
320
|
+
description:
|
|
321
|
+
"Delete one of the user's emails by message_id (from mAYL_list). Soft-delete — it stops showing in mAYL_list. Owner-scoped: only your own mail.",
|
|
322
|
+
inputSchema: mp0st_delete_input,
|
|
323
|
+
handler: mp0st_delete as MosaddTool["handler"],
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: "mAYL_stats",
|
|
327
|
+
requires: "network",
|
|
328
|
+
description:
|
|
329
|
+
"Engagement summary for one sent email (by message_id): open_count, unique_opens, click_count, whether it was likely forwarded, first/last opened time, and a breakdown of tracked event types. Opens/clicks are real (tracking pixel + link-wrap); forward detection is best-effort (IP-subnet diversity). Owner-scoped.",
|
|
330
|
+
inputSchema: mp0st_stats_input,
|
|
331
|
+
handler: mp0st_stats as MosaddTool["handler"],
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
name: "mAYL_events",
|
|
335
|
+
requires: "network",
|
|
336
|
+
description:
|
|
337
|
+
"Raw engagement timeline for one email (by message_id): every tracked event (pixel_open, link_click, forwarded, page_view, copy/print/focus signals) with timestamp, device type and link URL. Use mAYL_stats for the rollup; use this for the per-event detail. Owner-scoped.",
|
|
338
|
+
inputSchema: mp0st_events_input,
|
|
339
|
+
handler: mp0st_events as MosaddTool["handler"],
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: "mAYL_metrics",
|
|
343
|
+
requires: "network",
|
|
344
|
+
description:
|
|
345
|
+
"Mailbox-wide engagement aggregate across the user's sent mail: total_sent, opened_emails, open_rate_pct, total_opens, total_clicks, forwarded_emails. Owner-scoped.",
|
|
346
|
+
inputSchema: mp0st_metrics_input,
|
|
347
|
+
handler: mp0st_metrics as MosaddTool["handler"],
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: "mAYL_revoke",
|
|
351
|
+
requires: "network",
|
|
352
|
+
description:
|
|
353
|
+
"Revoke (recall) a sent email's secure-reader access by message_id — the recipient can no longer open the full message via the mosadd reader link (Virtru-style recall, immediate). Pass restore:true to re-enable. HONEST LIMIT: cannot un-send or claw back content the recipient already read, copied, or screenshotted — only disables future reader access. Owner-scoped.",
|
|
354
|
+
inputSchema: mp0st_revoke_input,
|
|
355
|
+
handler: mp0st_revoke as MosaddTool["handler"],
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
name: "mAYL_audit_export",
|
|
359
|
+
requires: "network",
|
|
360
|
+
description:
|
|
361
|
+
"Export a tamper-evident engagement audit report for one sent email (RMail-style): full event trail (opens, clicks, reader print/copy/forward signals) + totals, plus an HMAC-SHA256 signature over the canonical JSON so the report can be proven unaltered. For legal/compliance use. HONEST LIMIT: proves what mosadd observed; it is not a qualified delivery receipt (ERDS). Owner-scoped.",
|
|
362
|
+
inputSchema: mp0st_audit_export_input,
|
|
363
|
+
handler: mp0st_audit_export as MosaddTool["handler"],
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
name: "mAYL_consent",
|
|
367
|
+
requires: "network",
|
|
368
|
+
description:
|
|
369
|
+
"Manage recipient tracking opt-outs (GDPR/ePrivacy). action 'list' = recipients who opted out of your tracking; 'check' {recipient} = whether one opted out; 'optin' {recipient} = re-enable. Recipients self-opt-out via the footer link in your tracked emails; mAYL_send then automatically sends them with NO pixel/link-wrap. Owner-scoped.",
|
|
370
|
+
inputSchema: mp0st_consent_input,
|
|
371
|
+
handler: mp0st_consent as MosaddTool["handler"],
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
name: "mAYL_notify",
|
|
375
|
+
requires: "network",
|
|
376
|
+
description:
|
|
377
|
+
"Recent engagement feed across ALL your sent mail — the 'who just opened/clicked my mail' notifications stream (opens, clicks, forwards, reader print/copy signals), newest first, each with the email subject + recipient. Poll: pass the returned `cursor` back as `since` to get only new activity. Owner-scoped.",
|
|
378
|
+
inputSchema: mp0st_notify_input,
|
|
379
|
+
handler: mp0st_notify as MosaddTool["handler"],
|
|
380
|
+
},
|
|
381
|
+
];
|