@mosadd/mcp 3.0.0-alpha.46 → 3.0.0-alpha.48
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/bin/mcp.js +1 -1
- package/dist/{chunk-STWB7DEK.js → chunk-MGF7BV3M.js} +59 -24
- package/dist/index.js +1 -1
- package/package.json +73 -73
- package/src/__tests__/knowledge-ingest.test.ts +114 -114
- package/src/__tests__/presence.test.ts +190 -190
- package/src/__tests__/serverJsonVersion.test.ts +45 -45
- package/src/providers/supabase.ts +40 -2
- package/src/server.ts +162 -162
- package/src/tools/__tests__/ragDeleteFoldsSourceId.test.ts +67 -67
- package/src/tools/knowledge-graph.ts +186 -186
- package/src/tools/mail-agentbox.ts +155 -155
- package/src/tools/mcall.ts +216 -216
- package/src/tools/mdm-as-agent.ts +126 -126
- package/src/tools/mdm-voice.ts +220 -220
- package/src/tools/mdm.ts +495 -494
- package/src/tools/mirc-messages.ts +186 -185
- package/src/tools/murl.ts +314 -314
- package/src/tools/presence.ts +442 -414
- package/src/tools/ptt-ingest.ts +99 -99
- package/src/tools/threat.ts +123 -123
- package/src/tools/voice-format.ts +28 -0
- package/src/version.ts +8 -8
- package/LICENSE +0 -201
- package/dist/bin/login.d.ts +0 -13
- package/dist/bin/mcp.d.ts +0 -1
- package/dist/index.d.ts +0 -310
|
@@ -1,155 +1,155 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mAYL agent inboxes — disposable, two-way mailboxes an agent can mint for itself.
|
|
3
|
-
*
|
|
4
|
-
* Backed by the mosADD `mayl-agentbox` Edge Function (owner-scoped CRUD over
|
|
5
|
-
* public.mayl_agent_boxes) + the mp0st-inbound-webhook receive path. A box is a REAL
|
|
6
|
-
* address `agent-<hex>@mosadd.com` that can both SEND (via mAYL_send's from-selector)
|
|
7
|
-
* and — since 2026-08-06 — RECEIVE (inbound mail resolves the box → the owner account).
|
|
8
|
-
*
|
|
9
|
-
* This is the mosADD answer to AgentMail's `create_inbox`: the agent gets its own real
|
|
10
|
-
* inbox on demand, but inside an E2EE messenger where the agent is already a first-class
|
|
11
|
-
* contact and every send carries cryptographic provenance — not a bare third-party API.
|
|
12
|
-
*
|
|
13
|
-
* Auth is identical to every other mAYL tool: invokeFunction sends the caller's
|
|
14
|
-
* `Authorization: Bearer <userJwt>`, which mayl-agentbox validates via requireUser
|
|
15
|
-
* (auth.uid() owner-scoping). No new auth surface.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import { z } from "zod";
|
|
19
|
-
import type { MosaddTool, MosaddToolContext } from "../types.js";
|
|
20
|
-
import { invokeFunction, readSupabaseEnv } from "../providers/supabase.js";
|
|
21
|
-
|
|
22
|
-
// ---- Schemas ----
|
|
23
|
-
|
|
24
|
-
const BoxId = z.string().min(1).describe("Agent-box id (UUID) from mAYL_agentbox_provision or mAYL_agentbox_list.");
|
|
25
|
-
|
|
26
|
-
const agentbox_provision_input = z.object({
|
|
27
|
-
display_name: z
|
|
28
|
-
.string()
|
|
29
|
-
.max(120)
|
|
30
|
-
.optional()
|
|
31
|
-
.describe("Optional human label for the box (e.g. 'signup catcher'). Max 120 chars."),
|
|
32
|
-
agent_id: z
|
|
33
|
-
.string()
|
|
34
|
-
.optional()
|
|
35
|
-
.describe("Optional identity id to attribute the box to — must be an agent identity you own."),
|
|
36
|
-
kind: z
|
|
37
|
-
.enum(["ephemeral", "persistent"])
|
|
38
|
-
.optional()
|
|
39
|
-
.describe("'ephemeral' (default) auto-expires + is reaped; 'persistent' never expires."),
|
|
40
|
-
ttl_seconds: z
|
|
41
|
-
.number()
|
|
42
|
-
.int()
|
|
43
|
-
.positive()
|
|
44
|
-
.max(86_400)
|
|
45
|
-
.optional()
|
|
46
|
-
.describe("Lifetime for an ephemeral box, in seconds. Default 600 (10 min). Max 86400 (24 h). Ignored for persistent."),
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const agentbox_list_input = z.object({});
|
|
50
|
-
|
|
51
|
-
const agentbox_release_input = z.object({ id: BoxId });
|
|
52
|
-
|
|
53
|
-
const agentbox_extend_input = z.object({
|
|
54
|
-
id: BoxId,
|
|
55
|
-
ttl_seconds: z
|
|
56
|
-
.number()
|
|
57
|
-
.int()
|
|
58
|
-
.positive()
|
|
59
|
-
.max(86_400)
|
|
60
|
-
.optional()
|
|
61
|
-
.describe("New lifetime from NOW, in seconds. Default 600 (10 min). Max 86400 (24 h). Ephemeral boxes only."),
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// ---- Handlers ----
|
|
65
|
-
|
|
66
|
-
async function agentbox_provision(
|
|
67
|
-
input: z.infer<typeof agentbox_provision_input>,
|
|
68
|
-
ctx: MosaddToolContext,
|
|
69
|
-
): Promise<Record<string, unknown>> {
|
|
70
|
-
readSupabaseEnv();
|
|
71
|
-
ctx.log("debug", "mAYL_agentbox_provision invoking mayl-agentbox", { kind: input.kind ?? "ephemeral" });
|
|
72
|
-
return await invokeFunction("mayl-agentbox", {
|
|
73
|
-
action: "create",
|
|
74
|
-
display_name: input.display_name ?? null,
|
|
75
|
-
agent_id: input.agent_id ?? null,
|
|
76
|
-
kind: input.kind ?? "ephemeral",
|
|
77
|
-
ttl_seconds: input.ttl_seconds ?? null,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
async function agentbox_list(
|
|
82
|
-
_input: z.infer<typeof agentbox_list_input>,
|
|
83
|
-
ctx: MosaddToolContext,
|
|
84
|
-
): Promise<Record<string, unknown>> {
|
|
85
|
-
readSupabaseEnv();
|
|
86
|
-
ctx.log("debug", "mAYL_agentbox_list invoking mayl-agentbox", {});
|
|
87
|
-
return await invokeFunction("mayl-agentbox", { action: "list" });
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
async function agentbox_release(
|
|
91
|
-
input: z.infer<typeof agentbox_release_input>,
|
|
92
|
-
ctx: MosaddToolContext,
|
|
93
|
-
): Promise<Record<string, unknown>> {
|
|
94
|
-
readSupabaseEnv();
|
|
95
|
-
ctx.log("debug", "mAYL_agentbox_release invoking mayl-agentbox", { id: input.id });
|
|
96
|
-
return await invokeFunction("mayl-agentbox", { action: "release", id: input.id });
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
async function agentbox_extend(
|
|
100
|
-
input: z.infer<typeof agentbox_extend_input>,
|
|
101
|
-
ctx: MosaddToolContext,
|
|
102
|
-
): Promise<Record<string, unknown>> {
|
|
103
|
-
readSupabaseEnv();
|
|
104
|
-
ctx.log("debug", "mAYL_agentbox_extend invoking mayl-agentbox", { id: input.id });
|
|
105
|
-
return await invokeFunction("mayl-agentbox", {
|
|
106
|
-
action: "extend",
|
|
107
|
-
id: input.id,
|
|
108
|
-
ttl_seconds: input.ttl_seconds ?? null,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// ---- Registration ----
|
|
113
|
-
|
|
114
|
-
export const mailAgentboxTools: MosaddTool[] = [
|
|
115
|
-
{
|
|
116
|
-
name: "mAYL_agentbox_provision",
|
|
117
|
-
title: "Provision disposable inbox",
|
|
118
|
-
annotations: { readOnlyHint: false },
|
|
119
|
-
requires: "network",
|
|
120
|
-
description:
|
|
121
|
-
"Mint the agent its OWN real, disposable email inbox at agent-<hex>@mosadd.com that can SEND and RECEIVE. Default ephemeral with a 10-minute TTL (auto-expires + is reaped); pass kind:'persistent' for a permanent box, or ttl_seconds (max 86400) for a custom lifetime. Optional display_name + agent_id. Returns the box {id, address, expires_at}. Use the address to catch signup/verification codes or replies, then mAYL_list (filter by the box address) + mAYL_view to read what arrived. Owner-scoped; max 25 active boxes per account.",
|
|
122
|
-
inputSchema: agentbox_provision_input,
|
|
123
|
-
handler: agentbox_provision as MosaddTool["handler"],
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: "mAYL_agentbox_list",
|
|
127
|
-
title: "List disposable inboxes",
|
|
128
|
-
annotations: { readOnlyHint: true },
|
|
129
|
-
requires: "network",
|
|
130
|
-
description:
|
|
131
|
-
"List your active agent inboxes (address, display_name, kind, agent_id, expires_at), newest first. Owner-scoped.",
|
|
132
|
-
inputSchema: agentbox_list_input,
|
|
133
|
-
handler: agentbox_list as MosaddTool["handler"],
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
name: "mAYL_agentbox_release",
|
|
137
|
-
title: "Release disposable inbox",
|
|
138
|
-
annotations: { destructiveHint: true },
|
|
139
|
-
requires: "network",
|
|
140
|
-
description:
|
|
141
|
-
"Release (delete) one of your agent inboxes by id — frees the address immediately so it stops receiving. Owner-scoped.",
|
|
142
|
-
inputSchema: agentbox_release_input,
|
|
143
|
-
handler: agentbox_release as MosaddTool["handler"],
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: "mAYL_agentbox_extend",
|
|
147
|
-
title: "Extend disposable inbox",
|
|
148
|
-
annotations: { readOnlyHint: false },
|
|
149
|
-
requires: "network",
|
|
150
|
-
description:
|
|
151
|
-
"Extend an EPHEMERAL agent inbox's lifetime by id (ttl_seconds counted from NOW, max 24 h). Persistent boxes never expire and cannot be extended. Owner-scoped.",
|
|
152
|
-
inputSchema: agentbox_extend_input,
|
|
153
|
-
handler: agentbox_extend as MosaddTool["handler"],
|
|
154
|
-
},
|
|
155
|
-
];
|
|
1
|
+
/**
|
|
2
|
+
* mAYL agent inboxes — disposable, two-way mailboxes an agent can mint for itself.
|
|
3
|
+
*
|
|
4
|
+
* Backed by the mosADD `mayl-agentbox` Edge Function (owner-scoped CRUD over
|
|
5
|
+
* public.mayl_agent_boxes) + the mp0st-inbound-webhook receive path. A box is a REAL
|
|
6
|
+
* address `agent-<hex>@mosadd.com` that can both SEND (via mAYL_send's from-selector)
|
|
7
|
+
* and — since 2026-08-06 — RECEIVE (inbound mail resolves the box → the owner account).
|
|
8
|
+
*
|
|
9
|
+
* This is the mosADD answer to AgentMail's `create_inbox`: the agent gets its own real
|
|
10
|
+
* inbox on demand, but inside an E2EE messenger where the agent is already a first-class
|
|
11
|
+
* contact and every send carries cryptographic provenance — not a bare third-party API.
|
|
12
|
+
*
|
|
13
|
+
* Auth is identical to every other mAYL tool: invokeFunction sends the caller's
|
|
14
|
+
* `Authorization: Bearer <userJwt>`, which mayl-agentbox validates via requireUser
|
|
15
|
+
* (auth.uid() owner-scoping). No new auth surface.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
import type { MosaddTool, MosaddToolContext } from "../types.js";
|
|
20
|
+
import { invokeFunction, readSupabaseEnv } from "../providers/supabase.js";
|
|
21
|
+
|
|
22
|
+
// ---- Schemas ----
|
|
23
|
+
|
|
24
|
+
const BoxId = z.string().min(1).describe("Agent-box id (UUID) from mAYL_agentbox_provision or mAYL_agentbox_list.");
|
|
25
|
+
|
|
26
|
+
const agentbox_provision_input = z.object({
|
|
27
|
+
display_name: z
|
|
28
|
+
.string()
|
|
29
|
+
.max(120)
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Optional human label for the box (e.g. 'signup catcher'). Max 120 chars."),
|
|
32
|
+
agent_id: z
|
|
33
|
+
.string()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Optional identity id to attribute the box to — must be an agent identity you own."),
|
|
36
|
+
kind: z
|
|
37
|
+
.enum(["ephemeral", "persistent"])
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("'ephemeral' (default) auto-expires + is reaped; 'persistent' never expires."),
|
|
40
|
+
ttl_seconds: z
|
|
41
|
+
.number()
|
|
42
|
+
.int()
|
|
43
|
+
.positive()
|
|
44
|
+
.max(86_400)
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("Lifetime for an ephemeral box, in seconds. Default 600 (10 min). Max 86400 (24 h). Ignored for persistent."),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const agentbox_list_input = z.object({});
|
|
50
|
+
|
|
51
|
+
const agentbox_release_input = z.object({ id: BoxId });
|
|
52
|
+
|
|
53
|
+
const agentbox_extend_input = z.object({
|
|
54
|
+
id: BoxId,
|
|
55
|
+
ttl_seconds: z
|
|
56
|
+
.number()
|
|
57
|
+
.int()
|
|
58
|
+
.positive()
|
|
59
|
+
.max(86_400)
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("New lifetime from NOW, in seconds. Default 600 (10 min). Max 86400 (24 h). Ephemeral boxes only."),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// ---- Handlers ----
|
|
65
|
+
|
|
66
|
+
async function agentbox_provision(
|
|
67
|
+
input: z.infer<typeof agentbox_provision_input>,
|
|
68
|
+
ctx: MosaddToolContext,
|
|
69
|
+
): Promise<Record<string, unknown>> {
|
|
70
|
+
readSupabaseEnv();
|
|
71
|
+
ctx.log("debug", "mAYL_agentbox_provision invoking mayl-agentbox", { kind: input.kind ?? "ephemeral" });
|
|
72
|
+
return await invokeFunction("mayl-agentbox", {
|
|
73
|
+
action: "create",
|
|
74
|
+
display_name: input.display_name ?? null,
|
|
75
|
+
agent_id: input.agent_id ?? null,
|
|
76
|
+
kind: input.kind ?? "ephemeral",
|
|
77
|
+
ttl_seconds: input.ttl_seconds ?? null,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function agentbox_list(
|
|
82
|
+
_input: z.infer<typeof agentbox_list_input>,
|
|
83
|
+
ctx: MosaddToolContext,
|
|
84
|
+
): Promise<Record<string, unknown>> {
|
|
85
|
+
readSupabaseEnv();
|
|
86
|
+
ctx.log("debug", "mAYL_agentbox_list invoking mayl-agentbox", {});
|
|
87
|
+
return await invokeFunction("mayl-agentbox", { action: "list" });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async function agentbox_release(
|
|
91
|
+
input: z.infer<typeof agentbox_release_input>,
|
|
92
|
+
ctx: MosaddToolContext,
|
|
93
|
+
): Promise<Record<string, unknown>> {
|
|
94
|
+
readSupabaseEnv();
|
|
95
|
+
ctx.log("debug", "mAYL_agentbox_release invoking mayl-agentbox", { id: input.id });
|
|
96
|
+
return await invokeFunction("mayl-agentbox", { action: "release", id: input.id });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function agentbox_extend(
|
|
100
|
+
input: z.infer<typeof agentbox_extend_input>,
|
|
101
|
+
ctx: MosaddToolContext,
|
|
102
|
+
): Promise<Record<string, unknown>> {
|
|
103
|
+
readSupabaseEnv();
|
|
104
|
+
ctx.log("debug", "mAYL_agentbox_extend invoking mayl-agentbox", { id: input.id });
|
|
105
|
+
return await invokeFunction("mayl-agentbox", {
|
|
106
|
+
action: "extend",
|
|
107
|
+
id: input.id,
|
|
108
|
+
ttl_seconds: input.ttl_seconds ?? null,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ---- Registration ----
|
|
113
|
+
|
|
114
|
+
export const mailAgentboxTools: MosaddTool[] = [
|
|
115
|
+
{
|
|
116
|
+
name: "mAYL_agentbox_provision",
|
|
117
|
+
title: "Provision disposable inbox",
|
|
118
|
+
annotations: { readOnlyHint: false },
|
|
119
|
+
requires: "network",
|
|
120
|
+
description:
|
|
121
|
+
"Mint the agent its OWN real, disposable email inbox at agent-<hex>@mosadd.com that can SEND and RECEIVE. Default ephemeral with a 10-minute TTL (auto-expires + is reaped); pass kind:'persistent' for a permanent box, or ttl_seconds (max 86400) for a custom lifetime. Optional display_name + agent_id. Returns the box {id, address, expires_at}. Use the address to catch signup/verification codes or replies, then mAYL_list (filter by the box address) + mAYL_view to read what arrived. Owner-scoped; max 25 active boxes per account.",
|
|
122
|
+
inputSchema: agentbox_provision_input,
|
|
123
|
+
handler: agentbox_provision as MosaddTool["handler"],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "mAYL_agentbox_list",
|
|
127
|
+
title: "List disposable inboxes",
|
|
128
|
+
annotations: { readOnlyHint: true },
|
|
129
|
+
requires: "network",
|
|
130
|
+
description:
|
|
131
|
+
"List your active agent inboxes (address, display_name, kind, agent_id, expires_at), newest first. Owner-scoped.",
|
|
132
|
+
inputSchema: agentbox_list_input,
|
|
133
|
+
handler: agentbox_list as MosaddTool["handler"],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "mAYL_agentbox_release",
|
|
137
|
+
title: "Release disposable inbox",
|
|
138
|
+
annotations: { destructiveHint: true },
|
|
139
|
+
requires: "network",
|
|
140
|
+
description:
|
|
141
|
+
"Release (delete) one of your agent inboxes by id — frees the address immediately so it stops receiving. Owner-scoped.",
|
|
142
|
+
inputSchema: agentbox_release_input,
|
|
143
|
+
handler: agentbox_release as MosaddTool["handler"],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "mAYL_agentbox_extend",
|
|
147
|
+
title: "Extend disposable inbox",
|
|
148
|
+
annotations: { readOnlyHint: false },
|
|
149
|
+
requires: "network",
|
|
150
|
+
description:
|
|
151
|
+
"Extend an EPHEMERAL agent inbox's lifetime by id (ttl_seconds counted from NOW, max 24 h). Persistent boxes never expire and cannot be extended. Owner-scoped.",
|
|
152
|
+
inputSchema: agentbox_extend_input,
|
|
153
|
+
handler: agentbox_extend as MosaddTool["handler"],
|
|
154
|
+
},
|
|
155
|
+
];
|