@mosadd/mcp 3.0.0-alpha.26 → 3.0.0-alpha.28
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/README.md +17 -9
- package/dist/bin/mcp.js +1 -1
- package/dist/{chunk-YBSQUORF.js → chunk-BOBYGUP4.js} +145 -274
- package/dist/index.d.ts +13 -9
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/src/__tests__/integration.test.ts +3 -2
- package/src/__tests__/server.test.ts +6 -6
- package/src/server.ts +1 -1
- package/src/tools/index.ts +24 -25
- package/src/tools/mail-aliases.ts +2 -2
- package/src/tools/mail.ts +5 -5
- package/src/tools/threat.ts +30 -3
package/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# @mosadd/mcp
|
|
2
2
|
|
|
3
|
-
MCP server for [mosADD](https://mosadd.com) —
|
|
3
|
+
**They're apps. We're the layer.** The MCP server for [mosADD](https://mosadd.com) — the omnichannel comms layer for humans, agents, and robots. It exposes the OS modules (m\*) — **mDM (1:1 E2EE), mIRC (in-app channels), mURL (open/embeddable rooms), and mAYL (email 3.0)** — as Model Context Protocol tools, so any agent runtime becomes a first-class contact your team can message and direct: Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, or your own.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
One key, one server, 70+ tools — MCP-native, no SDK to wire up. **Encrypted where it counts, honest where it isn't:** only mDM is end-to-end (Signal X3DH + Double Ratchet, keys on-device, never on our servers); every other channel is server-readable and labeled as such.
|
|
6
|
+
|
|
7
|
+
> **70+ tools** across **4 modules** (mDM, mIRC, mURL, mAYL) + cross-cutting capabilities (mTALK voice, mRAG search, comms agent-actions) + agent→user action links + the `comms_capabilities` discovery tool, wired to the mosADD backend (BYOK) as a strangler-fig step. Phase 2 routes through the hosted gateway at `mcp.mosadd.com`.
|
|
6
8
|
|
|
7
9
|
## Connect your agent
|
|
8
10
|
|
|
9
|
-
Three ways to authenticate, friendliest first — all three end with the same
|
|
11
|
+
Three ways to authenticate, friendliest first — all three end with the same 70+ tools.
|
|
10
12
|
|
|
11
13
|
### 1. `mosadd login` — recommended (one command, stays logged in)
|
|
12
14
|
|
|
@@ -65,19 +67,19 @@ In Phase 2 the hosted gateway at `mcp.mosadd.com` removes even this — add a UR
|
|
|
65
67
|
|
|
66
68
|
## Tools shipped in alpha
|
|
67
69
|
|
|
68
|
-
**
|
|
70
|
+
**70+ tools** — 4 modules (mDM, mIRC, mURL, mAYL) + capabilities (mTALK voice, mRAG search, comms agent-actions) + the `comms_capabilities` discovery tool. Highlights per module:
|
|
69
71
|
|
|
70
72
|
| Module | Tools | What it does |
|
|
71
73
|
|---|---|---|
|
|
72
|
-
| **mDM** (14) | `mDM_list_contacts`, `mDM_send`, `mDM_send_unencrypted
|
|
74
|
+
| **mDM** (14) | `mDM_list_contacts`, `mDM_send`, `mDM_send_unencrypted` (DEPRECATED — migration-window fallback, only when the peer hasn't published keys), `mDM_edit`, `mDM_delete`, `mDM_list`, `mDM_publish_keys`, `mDM_respond_request`, `mDM_call_start/answer/end`, `mDM_voice_note`, `mDM_send_voice`, `mDM_send_file` | 1:1 text, voice notes, calls + file/voice attachments. Multi-thread per contact. `mDM_send` is end-to-end encrypted by default (X3DH / Double Ratchet, `mosadd.e2ee.v2`); the operator cannot read message content |
|
|
73
75
|
| **mIRC** (22) | `mIRC_create/list/get/update/delete`, member RBAC (`mIRC_join/leave/kick/ban/unban/set_role/set_ptt/approve_request/reject_request/request_access`), `mIRC_post_message`, `mIRC_list_messages`, edge (`mIRC_mint_channel_token`, `mIRC_send_edge`, `mIRC_history_edge`), `mIRC_send_voice/file` | Persistent Discord/Slack-style channels + the agent-coordination edge transport |
|
|
74
|
-
| **
|
|
76
|
+
| **mURL** (4) | `mURL_read_channel`, `mURL_post`, `mURL_presence`, `mURL_list_channels` | IRC-for-URLs — open-web text rooms you can embed/share, no account needed; transport-encrypted, server-readable/public by design |
|
|
77
|
+
| **mAYL** (11) | `mAYL_send`, `mAYL_view`, `mAYL_list`, `mAYL_delete`, `mAYL_stats`, `mAYL_events`, `mAYL_metrics`, `mAYL_revoke`, `mAYL_audit_export`, `mAYL_consent`, `mAYL_notify` | Mail; every user gets `<id>@mosadd.com`. Transport + at-rest encrypted (server-readable), NOT E2EE. `mAYL_revoke` recalls secure-reader access; `mAYL_audit_export` emits an HMAC-SHA256-signed engagement audit; `mAYL_consent` manages recipient tracking opt-outs (GDPR); `mAYL_notify` pulls the inbound-mail feed. (Was mp0st; deprecated `mp0st_*` aliases still function until alpha.27) |
|
|
75
78
|
| **mTALK** (5) | `mTALK_open`, `mTALK_join`, `mTALK_press`, `mTALK_release`, `mTALK_state` | Half-duplex push-to-talk: one speaker, FIFO queue, anti-hog auto-release |
|
|
76
79
|
| **mRAG** (4) | `mRAG_ingest`, `mRAG_search`, `mRAG_list_sources`, `mRAG_delete` | RAG recall over the user's own data (hybrid vector + BM25) |
|
|
77
80
|
| **comms_** (3) | `comms_action_create`, `comms_action_frame_get`, `comms_capabilities` | `comms_action_create` mints an agent→user one-link browser action (Tier 1); `comms_action_frame_get` fetches a framed action; `comms_capabilities` is one-call discovery of every tool's transport `requires` flag |
|
|
78
|
-
| **threat_** (2) | `threat_catalog`, `threat_classify` | Pure defensive threat-event classification engine — enumerate the catalog and classify an operation against it |
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
Module tools: mDM (14) + mIRC (22) + mURL (4) + mAYL (11) = 51; capabilities: mTALK (5) + mRAG (4) + comms (3) = 12; plus the deprecated `mp0st_*` back-compat aliases for the mAYL rename — **70+ callable tools** in total. `threat_*` is unregistered — threat classification lives on-device as a security pillar, not as MCP tools. `mCALL` (telephony), `mROOM` — and the `mAYL_send_as_agent` provenance, `mTALK_ingest_ptt` PTT-ingest, and `comms_embed_create` (embed-keys EF undeployed) scaffolds — exist in the source but are **not registered**, so agents only ever see tools that actually work.
|
|
81
83
|
|
|
82
84
|
All tool names follow [RFC 0001](https://github.com/Hei33enberg/mosadd-os/blob/main/docs/rfcs/0001-module-naming.md) — `m<MODULE>_<operation>` snake_case.
|
|
83
85
|
|
|
@@ -125,7 +127,7 @@ For PTT / CALL (real-time media), the architecture separates **control plane** (
|
|
|
125
127
|
| `MOSADD_SUPABASE_URL` | Supabase project URL — DM / IRC / mail / KB backend | yes (BYOK) |
|
|
126
128
|
| `MOSADD_SUPABASE_ANON_KEY` | Supabase anon key | yes (BYOK) |
|
|
127
129
|
| `MOSADD_USER_JWT` | User session token | yes (for tools that touch user data) |
|
|
128
|
-
| `MOSADD_RESEND_API_KEY` | Resend API key — enables `
|
|
130
|
+
| `MOSADD_RESEND_API_KEY` | Resend API key — enables `mAYL` outbound mail (deprecated `mp0st_*` aliases still function) | no (mAYL disabled if unset) |
|
|
129
131
|
| `MOSADD_LIVEKIT_URL` | LiveKit `wss://…` URL — enables `mTALK` voice | no (voice disabled if unset) |
|
|
130
132
|
| `MOSADD_LIVEKIT_API_KEY` | LiveKit API key | no (with `…_URL` / `…_API_SECRET`) |
|
|
131
133
|
| `MOSADD_LIVEKIT_API_SECRET` | LiveKit API secret | no |
|
|
@@ -136,6 +138,12 @@ For PTT / CALL (real-time media), the architecture separates **control plane** (
|
|
|
136
138
|
|
|
137
139
|
Missing optional keys fail closed — that channel is simply absent from `comms_capabilities`.
|
|
138
140
|
|
|
141
|
+
## Links
|
|
142
|
+
|
|
143
|
+
- **Mint a key + docs** — [mosadd.com/keys](https://mosadd.com/keys) · [mosadd.com/docs](https://mosadd.com/docs) · [mosadd.com/mcp](https://mosadd.com/mcp)
|
|
144
|
+
- **Hosted gateway** — `https://mcp.mosadd.com/mcp` (BYOK key broker, zero-install for remote agents)
|
|
145
|
+
- **Source + self-host** — [github.com/Hei33enberg/mosADD-OS](https://github.com/Hei33enberg/mosADD-OS) (Apache-2.0)
|
|
146
|
+
|
|
139
147
|
## License
|
|
140
148
|
|
|
141
149
|
Apache-2.0. See repo [LICENSE](https://github.com/Hei33enberg/mosadd-os/blob/main/LICENSE) and [NOTICE](https://github.com/Hei33enberg/mosadd-os/blob/main/NOTICE).
|
package/dist/bin/mcp.js
CHANGED
|
@@ -1260,7 +1260,7 @@ var mircEdgeTools = [
|
|
|
1260
1260
|
// src/tools/mail.ts
|
|
1261
1261
|
import { z as z7 } from "zod";
|
|
1262
1262
|
var EmailAddress = z7.string().email().max(254).describe("RFC 5321 email address.");
|
|
1263
|
-
var MessageId = z7.string().min(1).describe("Message id (UUID) from
|
|
1263
|
+
var MessageId = z7.string().min(1).describe("Message id (UUID) from mAYL_send or inbox.");
|
|
1264
1264
|
var mp0st_send_input = z7.object({
|
|
1265
1265
|
to: z7.union([EmailAddress, z7.array(EmailAddress).min(1).max(50)]).describe(
|
|
1266
1266
|
"Recipient(s). Single address or array of up to 50."
|
|
@@ -1388,7 +1388,7 @@ var mailTools = [
|
|
|
1388
1388
|
{
|
|
1389
1389
|
name: "mAYL_list",
|
|
1390
1390
|
requires: "network",
|
|
1391
|
-
description: "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
|
|
1391
|
+
description: "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.",
|
|
1392
1392
|
inputSchema: mp0st_list_input,
|
|
1393
1393
|
handler: mp0st_list
|
|
1394
1394
|
},
|
|
@@ -1409,7 +1409,7 @@ var mailTools = [
|
|
|
1409
1409
|
{
|
|
1410
1410
|
name: "mAYL_delete",
|
|
1411
1411
|
requires: "network",
|
|
1412
|
-
description: "Delete one of the user's emails by message_id (from
|
|
1412
|
+
description: "Delete one of the user's emails by message_id (from mAYL_list). Soft-delete \u2014 it stops showing in mAYL_list. Owner-scoped: only your own mail.",
|
|
1413
1413
|
inputSchema: mp0st_delete_input,
|
|
1414
1414
|
handler: mp0st_delete
|
|
1415
1415
|
},
|
|
@@ -1423,7 +1423,7 @@ var mailTools = [
|
|
|
1423
1423
|
{
|
|
1424
1424
|
name: "mAYL_events",
|
|
1425
1425
|
requires: "network",
|
|
1426
|
-
description: "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
|
|
1426
|
+
description: "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.",
|
|
1427
1427
|
inputSchema: mp0st_events_input,
|
|
1428
1428
|
handler: mp0st_events
|
|
1429
1429
|
},
|
|
@@ -1451,7 +1451,7 @@ var mailTools = [
|
|
|
1451
1451
|
{
|
|
1452
1452
|
name: "mAYL_consent",
|
|
1453
1453
|
requires: "network",
|
|
1454
|
-
description: "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;
|
|
1454
|
+
description: "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.",
|
|
1455
1455
|
inputSchema: mp0st_consent_input,
|
|
1456
1456
|
handler: mp0st_consent
|
|
1457
1457
|
},
|
|
@@ -1464,99 +1464,17 @@ var mailTools = [
|
|
|
1464
1464
|
}
|
|
1465
1465
|
];
|
|
1466
1466
|
|
|
1467
|
-
// src/tools/mail-aliases.ts
|
|
1468
|
-
var mailAliasTools = mailTools.map((tool) => ({
|
|
1469
|
-
...tool,
|
|
1470
|
-
name: tool.name.replace(/^mAYL_/, "mp0st_"),
|
|
1471
|
-
description: `[DEPRECATED \u2014 use ${tool.name} instead. mp0st_* aliases stay through alpha.25 for back-compat; will be removed in alpha.27.] ` + tool.description
|
|
1472
|
-
}));
|
|
1473
|
-
|
|
1474
|
-
// src/tools/mail-provenance.ts
|
|
1475
|
-
import { z as z8 } from "zod";
|
|
1476
|
-
var DEFAULT_SUPABASE_URL2 = "https://rooffhgbxafyjcwmwpsy.supabase.co";
|
|
1477
|
-
function supabaseUrl2() {
|
|
1478
|
-
return process.env.MOSADD_SUPABASE_URL?.replace(/\/$/, "") ?? process.env.SUPABASE_URL?.replace(/\/$/, "") ?? DEFAULT_SUPABASE_URL2;
|
|
1479
|
-
}
|
|
1480
|
-
function hubKey2() {
|
|
1481
|
-
return process.env.MOSADD_API_KEY ?? process.env.MOSADD_HUB_KEY ?? null;
|
|
1482
|
-
}
|
|
1483
|
-
var EmailAddress2 = z8.string().email().max(254);
|
|
1484
|
-
var mp0st_send_as_agent_input = z8.object({
|
|
1485
|
-
to: z8.union([EmailAddress2, z8.array(EmailAddress2).min(1).max(50)]),
|
|
1486
|
-
subject: z8.string().min(1).max(998),
|
|
1487
|
-
body_text: z8.string().max(1048576).optional(),
|
|
1488
|
-
body_html: z8.string().max(1048576).optional(),
|
|
1489
|
-
cc: z8.array(EmailAddress2).max(50).optional(),
|
|
1490
|
-
bcc: z8.array(EmailAddress2).max(50).optional(),
|
|
1491
|
-
reply_to: EmailAddress2.optional(),
|
|
1492
|
-
tracking: z8.boolean().optional(),
|
|
1493
|
-
agent_id: z8.string().min(1).max(120).describe("Stable id of the agent doing the send. Stamped as sent_by_agent_id for provenance."),
|
|
1494
|
-
task_id: z8.string().min(1).max(120).optional().describe("Optional id of the task/run this send belongs to. Stamped as sent_by_task_id.")
|
|
1495
|
-
});
|
|
1496
|
-
async function mintHubClaim(agentId, taskId) {
|
|
1497
|
-
const key = hubKey2();
|
|
1498
|
-
if (!key) {
|
|
1499
|
-
throw new Error("mAYL_send_as_agent needs MOSADD_API_KEY (hub key) to mint a provenance claim.");
|
|
1500
|
-
}
|
|
1501
|
-
const r = await fetch(`${supabaseUrl2()}/functions/v1/hub-claim-mint`, {
|
|
1502
|
-
method: "POST",
|
|
1503
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${key}` },
|
|
1504
|
-
body: JSON.stringify({ agent_id: agentId, task_id: taskId ?? null })
|
|
1505
|
-
});
|
|
1506
|
-
if (!r.ok) {
|
|
1507
|
-
const b = await r.text().catch(() => "");
|
|
1508
|
-
throw new Error(`hub-claim-mint ${r.status}: ${b.slice(0, 200)}`);
|
|
1509
|
-
}
|
|
1510
|
-
const data = await r.json();
|
|
1511
|
-
if (!data?.access_token) throw new Error("hub-claim-mint: no access_token in response");
|
|
1512
|
-
return data.access_token;
|
|
1513
|
-
}
|
|
1514
|
-
async function mAYL_send_as_agent(input, ctx) {
|
|
1515
|
-
if (!input.body_text && !input.body_html) {
|
|
1516
|
-
throw new Error("mAYL_send_as_agent requires at least one of body_text or body_html.");
|
|
1517
|
-
}
|
|
1518
|
-
const claim = await mintHubClaim(input.agent_id, input.task_id);
|
|
1519
|
-
ctx.log("debug", "mAYL_send_as_agent invoking mp0st-send with hub-claim", { agent_id: input.agent_id });
|
|
1520
|
-
const { agent_id: _ai, task_id: _ti, ...mailFields } = input;
|
|
1521
|
-
const r = await fetch(`${supabaseUrl2()}/functions/v1/mp0st-send`, {
|
|
1522
|
-
method: "POST",
|
|
1523
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${claim}` },
|
|
1524
|
-
body: JSON.stringify(mailFields)
|
|
1525
|
-
});
|
|
1526
|
-
if (!r.ok) {
|
|
1527
|
-
const b = await r.text().catch(() => "");
|
|
1528
|
-
throw new Error(`mp0st-send ${r.status}: ${b.slice(0, 200)}`);
|
|
1529
|
-
}
|
|
1530
|
-
const res = await r.json();
|
|
1531
|
-
if (res.error) throw new Error(res.error);
|
|
1532
|
-
return {
|
|
1533
|
-
message_id: res.email_id ?? "",
|
|
1534
|
-
status: res.status ?? "sent",
|
|
1535
|
-
is_internal: res.is_internal ?? false,
|
|
1536
|
-
sent_by: "agent"
|
|
1537
|
-
};
|
|
1538
|
-
}
|
|
1539
|
-
var mailProvenanceTools = [
|
|
1540
|
-
{
|
|
1541
|
-
name: "mAYL_send_as_agent",
|
|
1542
|
-
requires: "network",
|
|
1543
|
-
description: "Send an email ATTRIBUTED TO THE AGENT (provenance-stamped). Unlike mAYL_send (sends as the user), this stamps sent_by='agent' plus your agent_id and optional task_id onto the email record and audit trail \u2014 so recipients and compliance can see the mail was agent-originated. Auth: presents a hub-claim JWT (needs MOSADD_API_KEY). The mp0st-send EF verifies the claim with HUB_JWT_SECRET; body trust is never granted for provenance.",
|
|
1544
|
-
inputSchema: mp0st_send_as_agent_input,
|
|
1545
|
-
handler: mAYL_send_as_agent
|
|
1546
|
-
}
|
|
1547
|
-
];
|
|
1548
|
-
|
|
1549
1467
|
// src/tools/mtalk.ts
|
|
1550
|
-
import { z as
|
|
1551
|
-
var RoomLabel =
|
|
1552
|
-
var RoomId2 =
|
|
1553
|
-
var mTALK_open_input =
|
|
1468
|
+
import { z as z8 } from "zod";
|
|
1469
|
+
var RoomLabel = z8.string().min(1).max(120).regex(/^[a-zA-Z0-9._-]+$/).describe("Human-readable room label (e.g. 'ops', 'field-team'). Used to derive a stable room id.");
|
|
1470
|
+
var RoomId2 = z8.string().min(1).describe("Room id returned by mTALK_open.");
|
|
1471
|
+
var mTALK_open_input = z8.object({
|
|
1554
1472
|
label: RoomLabel.optional().describe("Optional label; defaults to a personal room.")
|
|
1555
1473
|
});
|
|
1556
|
-
var mTALK_join_input =
|
|
1557
|
-
var mTALK_press_input =
|
|
1558
|
-
var mTALK_release_input =
|
|
1559
|
-
var mTALK_state_input =
|
|
1474
|
+
var mTALK_join_input = z8.object({ room_id: RoomId2 });
|
|
1475
|
+
var mTALK_press_input = z8.object({ room_id: RoomId2 });
|
|
1476
|
+
var mTALK_release_input = z8.object({ room_id: RoomId2 });
|
|
1477
|
+
var mTALK_state_input = z8.object({ room_id: RoomId2 });
|
|
1560
1478
|
async function mTALK_open(input, ctx) {
|
|
1561
1479
|
const { roomId } = await ctx.providers.voice.createRoom(input.label);
|
|
1562
1480
|
ctx.log("debug", "mTALK_open", { room_id: roomId });
|
|
@@ -1620,7 +1538,7 @@ var mtalkTools = [
|
|
|
1620
1538
|
];
|
|
1621
1539
|
|
|
1622
1540
|
// src/tools/attachments.ts
|
|
1623
|
-
import { z as
|
|
1541
|
+
import { z as z9 } from "zod";
|
|
1624
1542
|
|
|
1625
1543
|
// src/providers/blob-upload.ts
|
|
1626
1544
|
function defaultBucket(kind) {
|
|
@@ -1670,14 +1588,14 @@ function decodeBase64Body(b64) {
|
|
|
1670
1588
|
|
|
1671
1589
|
// src/tools/attachments.ts
|
|
1672
1590
|
var PROTOCOL_VERSION4 = "mosadd.chat.v1";
|
|
1673
|
-
var Base64Body =
|
|
1674
|
-
var Mime =
|
|
1675
|
-
var DurationMs =
|
|
1676
|
-
var Filename =
|
|
1677
|
-
var ReplyTo =
|
|
1678
|
-
var ContactRef3 =
|
|
1679
|
-
var RoomId3 =
|
|
1680
|
-
var ThreadLabel =
|
|
1591
|
+
var Base64Body = z9.string().min(1).max(2e7).describe("Attachment bytes as base64 (or a data: URL). MCP is JSON-only, so binary is base64-encoded. Max ~15 MB decoded.");
|
|
1592
|
+
var Mime = z9.string().min(1).max(120).describe("MIME type, e.g. audio/ogg, application/pdf, image/png.");
|
|
1593
|
+
var DurationMs = z9.number().int().positive().optional().describe("Audio clip length in ms (voice only), if known.");
|
|
1594
|
+
var Filename = z9.string().min(1).max(255).optional().describe("Original filename (file only).");
|
|
1595
|
+
var ReplyTo = z9.string().optional().describe("Optional id of the message being replied to.");
|
|
1596
|
+
var ContactRef3 = z9.string().min(1).describe("Recipient identity id (UUID). Use mDM_list_contacts to find it.");
|
|
1597
|
+
var RoomId3 = z9.string().min(1).describe("Room/channel id (UUID).");
|
|
1598
|
+
var ThreadLabel = z9.string().max(120).regex(/^[a-zA-Z0-9._-]+$/).optional().describe("Optional thread label within the conversation (mDM USP: multiple threads per contact).");
|
|
1681
1599
|
function dmThreadId3(selfId, otherId, label) {
|
|
1682
1600
|
const [a, b] = [selfId, otherId].sort();
|
|
1683
1601
|
return label ? `dm:${a}:${b}:${label}` : `dm:${a}:${b}`;
|
|
@@ -1720,21 +1638,21 @@ async function resolveLinkedSpaceId2(channelId) {
|
|
|
1720
1638
|
if (!spaceId) throw new Error(`Channel ${channelId} has no linked space yet \u2014 run mIRC_join/mIRC_list first or pass space_id.`);
|
|
1721
1639
|
return spaceId;
|
|
1722
1640
|
}
|
|
1723
|
-
var mDM_send_voice_input =
|
|
1641
|
+
var mDM_send_voice_input = z9.object({
|
|
1724
1642
|
to: ContactRef3,
|
|
1725
1643
|
audio_base64: Base64Body,
|
|
1726
1644
|
mime: Mime.default("audio/ogg"),
|
|
1727
1645
|
duration_ms: DurationMs,
|
|
1728
|
-
caption:
|
|
1646
|
+
caption: z9.string().max(2e3).optional(),
|
|
1729
1647
|
thread_label: ThreadLabel,
|
|
1730
1648
|
reply_to_id: ReplyTo
|
|
1731
1649
|
});
|
|
1732
|
-
var mDM_send_file_input =
|
|
1650
|
+
var mDM_send_file_input = z9.object({
|
|
1733
1651
|
to: ContactRef3,
|
|
1734
1652
|
file_base64: Base64Body,
|
|
1735
1653
|
filename: Filename,
|
|
1736
1654
|
mime: Mime,
|
|
1737
|
-
caption:
|
|
1655
|
+
caption: z9.string().max(2e3).optional(),
|
|
1738
1656
|
thread_label: ThreadLabel,
|
|
1739
1657
|
reply_to_id: ReplyTo
|
|
1740
1658
|
});
|
|
@@ -1780,23 +1698,23 @@ async function mDM_send_file(input, ctx) {
|
|
|
1780
1698
|
recipient_account_id: input.to
|
|
1781
1699
|
});
|
|
1782
1700
|
}
|
|
1783
|
-
var mIRC_send_voice_input =
|
|
1701
|
+
var mIRC_send_voice_input = z9.object({
|
|
1784
1702
|
channel_id: RoomId3,
|
|
1785
1703
|
audio_base64: Base64Body,
|
|
1786
1704
|
mime: Mime.default("audio/ogg"),
|
|
1787
1705
|
duration_ms: DurationMs,
|
|
1788
|
-
caption:
|
|
1706
|
+
caption: z9.string().max(2e3).optional(),
|
|
1789
1707
|
reply_to_id: ReplyTo,
|
|
1790
|
-
space_id:
|
|
1708
|
+
space_id: z9.string().optional().describe("Backing space id. Resolved automatically if omitted.")
|
|
1791
1709
|
});
|
|
1792
|
-
var mIRC_send_file_input =
|
|
1710
|
+
var mIRC_send_file_input = z9.object({
|
|
1793
1711
|
channel_id: RoomId3,
|
|
1794
1712
|
file_base64: Base64Body,
|
|
1795
1713
|
filename: Filename,
|
|
1796
1714
|
mime: Mime,
|
|
1797
|
-
caption:
|
|
1715
|
+
caption: z9.string().max(2e3).optional(),
|
|
1798
1716
|
reply_to_id: ReplyTo,
|
|
1799
|
-
space_id:
|
|
1717
|
+
space_id: z9.string().optional()
|
|
1800
1718
|
});
|
|
1801
1719
|
async function mIRC_send_voice(input, ctx) {
|
|
1802
1720
|
const space_id = input.space_id ?? await resolveLinkedSpaceId2(input.channel_id);
|
|
@@ -1841,54 +1759,13 @@ var attachmentTools = [
|
|
|
1841
1759
|
}
|
|
1842
1760
|
];
|
|
1843
1761
|
|
|
1844
|
-
// src/tools/ptt-ingest.ts
|
|
1845
|
-
import { z as z11 } from "zod";
|
|
1846
|
-
var mTALK_ingest_ptt_input = z11.object({
|
|
1847
|
-
audio_base64: z11.string().min(1).max(2e7).describe("Recorded PTT 'over' as base64 (a 'data:audio/\u2026;base64,\u2026' prefix is stripped if present)."),
|
|
1848
|
-
mime_type: z11.string().min(1).max(120).default("audio/webm").describe("MIME type of the audio. Default audio/webm (browser MediaRecorder default)."),
|
|
1849
|
-
direction: z11.enum(["human_to_agent", "agent_to_human"]).describe("Direction the PTT crossed: who originated, who received. 'human_to_agent' = user spoke to an agent; 'agent_to_human' = agent spoke to the user."),
|
|
1850
|
-
message_id: z11.string().min(1).max(120).optional().describe("Optional id of the messages_meta row this PTT belongs to. When present, links the transcript back to the message for jump-to-source from RAG."),
|
|
1851
|
-
thread_id: z11.string().min(1).max(120).optional().describe("Optional thread id (e.g. `chat:<channel_id>` or `dm:<a>:<b>`) so the transcript carries its conversational scope into RAG.")
|
|
1852
|
-
});
|
|
1853
|
-
async function mTALK_ingest_ptt(input, ctx) {
|
|
1854
|
-
readSupabaseEnv();
|
|
1855
|
-
const audio = input.audio_base64.replace(/^data:[^;]+;base64,/, "");
|
|
1856
|
-
ctx.log("debug", "mTALK_ingest_ptt invoking ptt-ingest", {
|
|
1857
|
-
direction: input.direction,
|
|
1858
|
-
thread_id: input.thread_id ?? null,
|
|
1859
|
-
mime_type: input.mime_type
|
|
1860
|
-
});
|
|
1861
|
-
const res = await invokeFunction("ptt-ingest", {
|
|
1862
|
-
audio_base64: audio,
|
|
1863
|
-
mime_type: input.mime_type,
|
|
1864
|
-
direction: input.direction,
|
|
1865
|
-
message_id: input.message_id ?? null,
|
|
1866
|
-
thread_id: input.thread_id ?? null
|
|
1867
|
-
});
|
|
1868
|
-
const status = res.status ?? "pending";
|
|
1869
|
-
return {
|
|
1870
|
-
ptt_id: res.ptt_id ?? "",
|
|
1871
|
-
status,
|
|
1872
|
-
opted_in: status !== "skipped_optout"
|
|
1873
|
-
};
|
|
1874
|
-
}
|
|
1875
|
-
var pttIngestTools = [
|
|
1876
|
-
{
|
|
1877
|
-
name: "mTALK_ingest_ptt",
|
|
1878
|
-
requires: "network",
|
|
1879
|
-
description: "Submit a finished PTT 'over' (push-to-talk audio segment) for transcription into the caller's RAG index \u2014 so 'what did X say on PTT?' is searchable later. The PERSISTENCE of the voice message itself (the message_meta row + fan-out) is handled by mDM_send_voice / mIRC_send_voice; this tool is the transcription bridge only. Honors per-user RAG opt-in: opted-out callers get status='skipped_optout' (no transcript stored). Auth: Supabase session JWT.",
|
|
1880
|
-
inputSchema: mTALK_ingest_ptt_input,
|
|
1881
|
-
handler: mTALK_ingest_ptt
|
|
1882
|
-
}
|
|
1883
|
-
];
|
|
1884
|
-
|
|
1885
1762
|
// src/tools/knowledge.ts
|
|
1886
|
-
import { z as
|
|
1887
|
-
var mRAG_search_input =
|
|
1888
|
-
query:
|
|
1889
|
-
top_k:
|
|
1890
|
-
source_types:
|
|
1891
|
-
thread_id:
|
|
1763
|
+
import { z as z10 } from "zod";
|
|
1764
|
+
var mRAG_search_input = z10.object({
|
|
1765
|
+
query: z10.string().min(1).max(2e3).describe("Natural-language question to answer from the user's own indexed messages/emails/calls/notes."),
|
|
1766
|
+
top_k: z10.number().int().min(1).max(25).optional().describe("Max number of source chunks to retrieve and ground the answer in. Default 8."),
|
|
1767
|
+
source_types: z10.array(z10.enum(["message", "email", "call", "note", "contact"])).optional().describe("Restrict retrieval to these source types. Omit to search everything."),
|
|
1768
|
+
thread_id: z10.string().optional().describe("Optional: restrict retrieval to a single thread id (e.g. a dm:/chat: thread).")
|
|
1892
1769
|
});
|
|
1893
1770
|
async function mRAG_search(input, ctx) {
|
|
1894
1771
|
readSupabaseEnv();
|
|
@@ -1905,12 +1782,12 @@ async function mRAG_search(input, ctx) {
|
|
|
1905
1782
|
chunks_found: data.chunks_found ?? (data.sources?.length ?? 0)
|
|
1906
1783
|
};
|
|
1907
1784
|
}
|
|
1908
|
-
var mRAG_ingest_input =
|
|
1909
|
-
content_text:
|
|
1910
|
-
source_type:
|
|
1911
|
-
source_id:
|
|
1912
|
-
thread_id:
|
|
1913
|
-
title:
|
|
1785
|
+
var mRAG_ingest_input = z10.object({
|
|
1786
|
+
content_text: z10.string().min(1).max(2e5).describe("Text to index into the user's private knowledge base (a note, document, transcript, pasted page\u2026). Chunked + embedded server-side."),
|
|
1787
|
+
source_type: z10.enum(["file", "note", "message", "email", "contact", "call"]).optional().describe("What kind of source this is. Default 'file' (a document/note). Use 'note' for ad-hoc text."),
|
|
1788
|
+
source_id: z10.string().optional().describe("Optional stable id for the source so re-ingests can be grouped."),
|
|
1789
|
+
thread_id: z10.string().optional().describe("Optional thread id to associate this knowledge with (e.g. a dm:/chat: thread)."),
|
|
1790
|
+
title: z10.string().max(300).optional().describe("Optional human title, stored in metadata.")
|
|
1914
1791
|
});
|
|
1915
1792
|
async function mRAG_ingest(input, ctx) {
|
|
1916
1793
|
readSupabaseEnv();
|
|
@@ -1925,15 +1802,15 @@ async function mRAG_ingest(input, ctx) {
|
|
|
1925
1802
|
});
|
|
1926
1803
|
return { indexed: data.indexed ?? 0, chunk_count: data.chunk_count ?? 0 };
|
|
1927
1804
|
}
|
|
1928
|
-
var mRAG_list_sources_input =
|
|
1805
|
+
var mRAG_list_sources_input = z10.object({});
|
|
1929
1806
|
async function mRAG_list_sources(_input, ctx) {
|
|
1930
1807
|
readSupabaseEnv();
|
|
1931
1808
|
ctx.log("debug", "mRAG_list_sources via rag-sources");
|
|
1932
1809
|
return await invokeFunction("rag-sources", { action: "list" });
|
|
1933
1810
|
}
|
|
1934
|
-
var mRAG_delete_input =
|
|
1935
|
-
source_id:
|
|
1936
|
-
thread_id:
|
|
1811
|
+
var mRAG_delete_input = z10.object({
|
|
1812
|
+
source_id: z10.string().optional().describe("Delete every indexed chunk with this source_id (from mRAG_list_sources)."),
|
|
1813
|
+
thread_id: z10.string().optional().describe("Delete every indexed chunk associated with this thread_id.")
|
|
1937
1814
|
}).refine((v) => v.source_id || v.thread_id, {
|
|
1938
1815
|
message: "Provide source_id or thread_id \u2014 mRAG_delete refuses to purge the whole index."
|
|
1939
1816
|
});
|
|
@@ -1978,34 +1855,34 @@ var knowledgeTools = [
|
|
|
1978
1855
|
];
|
|
1979
1856
|
|
|
1980
1857
|
// src/tools/actions.ts
|
|
1981
|
-
import { z as
|
|
1982
|
-
var formField =
|
|
1983
|
-
name:
|
|
1984
|
-
label:
|
|
1985
|
-
type:
|
|
1986
|
-
required:
|
|
1858
|
+
import { z as z11 } from "zod";
|
|
1859
|
+
var formField = z11.object({
|
|
1860
|
+
name: z11.string().min(1).max(60).describe("Field key \u2014 returned verbatim in the result."),
|
|
1861
|
+
label: z11.string().max(120).optional().describe("Human label shown to the recipient. Defaults to `name`."),
|
|
1862
|
+
type: z11.enum(["text", "email", "number", "textarea", "tel", "url"]).optional().describe("Input type. Default 'text'."),
|
|
1863
|
+
required: z11.boolean().optional().describe("Whether the recipient must fill this field.")
|
|
1987
1864
|
});
|
|
1988
|
-
var action_create_input =
|
|
1989
|
-
action_type:
|
|
1865
|
+
var action_create_input = z11.object({
|
|
1866
|
+
action_type: z11.enum(["confirm", "file_request", "form", "open_url", "screen_share"]).describe(
|
|
1990
1867
|
"What you want the recipient to do: 'confirm' (yes/no), 'file_request' (pick a file from their computer), 'form' (fill fields), 'open_url' (open a vetted https URL), 'screen_share' (recipient shares their screen so you can SEE it via comms_action_frame_get \u2014 view only)."
|
|
1991
1868
|
),
|
|
1992
|
-
message:
|
|
1993
|
-
creator_label:
|
|
1869
|
+
message: z11.string().min(1).max(2e3).describe("What you're asking \u2014 shown on the consent screen above the action UI."),
|
|
1870
|
+
creator_label: z11.string().max(80).optional().describe("How you're identified to the recipient (e.g. your agent name). Default 'Agent'."),
|
|
1994
1871
|
// confirm
|
|
1995
|
-
yes_label:
|
|
1996
|
-
no_label:
|
|
1872
|
+
yes_label: z11.string().max(40).optional().describe("[confirm] Affirmative button label. Default 'Tak'."),
|
|
1873
|
+
no_label: z11.string().max(40).optional().describe("[confirm] Negative button label. Default 'Nie'."),
|
|
1997
1874
|
// file_request
|
|
1998
|
-
accept:
|
|
1999
|
-
max_bytes:
|
|
1875
|
+
accept: z11.string().max(200).optional().describe("[file_request] Accepted file types (HTML accept attr, e.g. 'image/*,.pdf')."),
|
|
1876
|
+
max_bytes: z11.number().int().positive().max(5242880).optional().describe("[file_request] Max file size in bytes (\u2264 5 MB). NOTE: the returned file is NOT yet end-to-end encrypted \u2014 do not request sensitive files until Tier 1.1 ships."),
|
|
2000
1877
|
// form
|
|
2001
|
-
fields:
|
|
1878
|
+
fields: z11.array(formField).min(1).max(20).optional().describe("[form] Fields to collect from the recipient."),
|
|
2002
1879
|
// open_url
|
|
2003
|
-
url:
|
|
1880
|
+
url: z11.string().url().optional().describe("[open_url] The https URL to open. The full URL is shown to the recipient before they open it."),
|
|
2004
1881
|
// screen_share
|
|
2005
|
-
max_width:
|
|
1882
|
+
max_width: z11.number().int().positive().max(1920).optional().describe("[screen_share] Max captured frame width in px (default 1280). Frames are downscaled JPEGs."),
|
|
2006
1883
|
// lifecycle
|
|
2007
|
-
ttl_ms:
|
|
2008
|
-
max_uses:
|
|
1884
|
+
ttl_ms: z11.number().int().positive().optional().describe("Link lifetime in milliseconds. Default 24h, capped at 7d."),
|
|
1885
|
+
max_uses: z11.number().int().min(1).max(50).optional().describe("How many times the link can be redeemed. Default 1 (single-use).")
|
|
2009
1886
|
});
|
|
2010
1887
|
function buildParams(input) {
|
|
2011
1888
|
switch (input.action_type) {
|
|
@@ -2046,8 +1923,8 @@ async function action_create(input, ctx) {
|
|
|
2046
1923
|
expires_at: res.expires_at ?? ""
|
|
2047
1924
|
};
|
|
2048
1925
|
}
|
|
2049
|
-
var action_frame_get_input =
|
|
2050
|
-
action_id:
|
|
1926
|
+
var action_frame_get_input = z11.object({
|
|
1927
|
+
action_id: z11.string().min(1).describe("The action_id returned by comms_action_create for a 'screen_share' action you created.")
|
|
2051
1928
|
});
|
|
2052
1929
|
async function action_frame_get(input, ctx) {
|
|
2053
1930
|
readSupabaseEnv();
|
|
@@ -2087,67 +1964,68 @@ var actionTools = [
|
|
|
2087
1964
|
}
|
|
2088
1965
|
];
|
|
2089
1966
|
|
|
2090
|
-
// src/tools/
|
|
2091
|
-
import { z as
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
title: z14.string().max(60).optional().describe("Header title shown in the widget. Default 'mIRC'."),
|
|
2102
|
-
anon: z14.boolean().optional().describe("Allow visitors to join with just a nick (no mosadd account). Default true."),
|
|
2103
|
-
locale: z14.enum(["en", "pl"]).optional().describe("Widget UI language. Default 'en'."),
|
|
2104
|
-
mode: z14.enum(["live", "test"]).optional().describe("Key mode \u2014 'test' for local/dev origins, 'live' for production. Default 'live'.")
|
|
1967
|
+
// src/tools/threat.ts
|
|
1968
|
+
import { z as z12 } from "zod";
|
|
1969
|
+
import {
|
|
1970
|
+
THREAT_EVENTS,
|
|
1971
|
+
THREAT_EVENT_COUNT,
|
|
1972
|
+
evaluateEvent,
|
|
1973
|
+
getEventDef
|
|
1974
|
+
} from "@mosadd/threat-engine";
|
|
1975
|
+
var threat_catalog_input = z12.object({
|
|
1976
|
+
category: z12.enum(["COMINT", "ELINT", "MASINT", "CYBER", "BEHAVIORAL", "PRIVACY", "SIGINT", "OSINT", "MPOST"]).optional().describe("Filter the catalog to one intelligence-discipline category. Omit for the full catalog."),
|
|
1977
|
+
platform: z12.enum(["apk", "ios", "pwa", "harmony"]).optional().describe("Filter to events detectable on this platform. Omit for all platforms.")
|
|
2105
1978
|
});
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
if (input.
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
snippet: buildSnippet(input, res.key)
|
|
2132
|
-
};
|
|
1979
|
+
async function threat_catalog(input, _ctx) {
|
|
1980
|
+
let events = THREAT_EVENTS;
|
|
1981
|
+
if (input.category) events = events.filter((e) => e.category === input.category);
|
|
1982
|
+
if (input.platform) events = events.filter((e) => e.platforms.includes(input.platform));
|
|
1983
|
+
return { count: events.length, total: THREAT_EVENT_COUNT, events };
|
|
1984
|
+
}
|
|
1985
|
+
var threat_classify_input = z12.object({
|
|
1986
|
+
event_type: z12.string().min(1).max(120).describe('Event type to classify, e.g. "SIM_SWAP", "AUTH_BRUTEFORCE", "TOLL_FRAUD". Case-insensitive.'),
|
|
1987
|
+
severity: z12.string().optional().describe('Optional producer severity hint. "killswitch" \u2192 lock_account; "critical" \u2192 revoke_sessions; anything else is informational.'),
|
|
1988
|
+
details: z12.string().max(2e3).optional().describe("Optional free-text context (informational only).")
|
|
1989
|
+
});
|
|
1990
|
+
async function threat_classify(input, _ctx) {
|
|
1991
|
+
const def = getEventDef(String(input.event_type).toUpperCase());
|
|
1992
|
+
if (def) {
|
|
1993
|
+
return {
|
|
1994
|
+
action: "monitor",
|
|
1995
|
+
severity: def.severity,
|
|
1996
|
+
reason: `${def.label} (${def.category}) \u2014 classified from the mosadd threat taxonomy. Monitor-only: surfaced for you to act on, no automatic action taken.`,
|
|
1997
|
+
known_event: true,
|
|
1998
|
+
category: def.category,
|
|
1999
|
+
label: def.label
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
const decision = evaluateEvent({ eventType: input.event_type, severity: input.severity, details: input.details });
|
|
2003
|
+
return { ...decision, known_event: false, category: null, label: null };
|
|
2133
2004
|
}
|
|
2134
|
-
var
|
|
2005
|
+
var threatTools = [
|
|
2135
2006
|
{
|
|
2136
|
-
name: "
|
|
2137
|
-
requires: "
|
|
2138
|
-
description: "
|
|
2139
|
-
inputSchema:
|
|
2140
|
-
handler:
|
|
2007
|
+
name: "threat_catalog",
|
|
2008
|
+
requires: "any",
|
|
2009
|
+
description: "List the canonical mosadd threat-event taxonomy (the full radar catalog: id, category, default severity, auto-actions, per-platform availability). Filter by category or platform. Pure/offline \u2014 returns { count, total, events }. Use to discover what the defensive engine recognises.",
|
|
2010
|
+
inputSchema: threat_catalog_input,
|
|
2011
|
+
handler: threat_catalog
|
|
2012
|
+
},
|
|
2013
|
+
{
|
|
2014
|
+
name: "threat_classify",
|
|
2015
|
+
requires: "any",
|
|
2016
|
+
description: `Classify a single telemetry event against the mosadd threat taxonomy + DECK engine. For a known event type (e.g. PROCESS_INJECTION, STINGRAY_DETECT, IMSI_CATCHER_SCAN, MEMORY_INJECTION) it returns that event's real severity (info|warning|elevated|critical|killswitch) with action="monitor" \u2014 Pegasus-class events surface as critical immediately, but the engine NEVER auto-acts (it tells you, it never disconnects/locks). Unknown strings fall back to the pure DECK decision (log_only|revoke_sessions|lock_account|suspend_did). Returns { action, severity, reason, known_event, category, label }. Deterministic, offline, no backend.`,
|
|
2017
|
+
inputSchema: threat_classify_input,
|
|
2018
|
+
handler: threat_classify
|
|
2141
2019
|
}
|
|
2142
2020
|
];
|
|
2143
2021
|
|
|
2144
2022
|
// src/tools/murl.ts
|
|
2145
|
-
import { z as
|
|
2023
|
+
import { z as z13 } from "zod";
|
|
2146
2024
|
var DEFAULT_EDGE_URL2 = "https://mosadd-edge.mr-brics-33.workers.dev";
|
|
2147
2025
|
function edgeUrl2() {
|
|
2148
2026
|
return process.env.MOSADD_EDGE_URL?.replace(/\/$/, "") ?? DEFAULT_EDGE_URL2;
|
|
2149
2027
|
}
|
|
2150
|
-
function
|
|
2028
|
+
function hubKey2() {
|
|
2151
2029
|
const key = process.env.MOSADD_API_KEY ?? process.env.MOSADD_HUB_KEY ?? "";
|
|
2152
2030
|
if (!key) throw new Error("MOSADD_API_KEY required for mURL tools (see `mosadd login` / hub-keys).");
|
|
2153
2031
|
return key;
|
|
@@ -2165,17 +2043,17 @@ function urlToSlug(input) {
|
|
|
2165
2043
|
const base = host.replace(/\./g, "-");
|
|
2166
2044
|
return { domain: host, slug: segs.length ? `${base}__${segs.join("__")}` : base };
|
|
2167
2045
|
}
|
|
2168
|
-
var DomainArg =
|
|
2169
|
-
var mURL_read_channel_input =
|
|
2046
|
+
var DomainArg = z13.string().min(3).max(2048).describe("A domain ('example.com') or a full URL. Keyed PER-URL: a bare domain \u2192 the domain room; a URL with a path (e.g. 'site.com/articles/abc') \u2192 that page's own room.");
|
|
2047
|
+
var mURL_read_channel_input = z13.object({
|
|
2170
2048
|
domain: DomainArg,
|
|
2171
|
-
limit:
|
|
2049
|
+
limit: z13.number().int().min(1).max(100).optional().describe("Recent messages to return (max 100). Default 50.")
|
|
2172
2050
|
});
|
|
2173
2051
|
async function mURL_read_channel(input, ctx) {
|
|
2174
2052
|
const { domain, slug: slug2 } = urlToSlug(input.domain);
|
|
2175
2053
|
const limit = input.limit ?? 50;
|
|
2176
2054
|
ctx.log("debug", "mURL_read_channel", { domain });
|
|
2177
2055
|
const r = await fetch(`${edgeUrl2()}/c/${slug2}/history?limit=${limit}`, {
|
|
2178
|
-
headers: { Authorization: `Bearer ${
|
|
2056
|
+
headers: { Authorization: `Bearer ${hubKey2()}` }
|
|
2179
2057
|
});
|
|
2180
2058
|
if (!r.ok) {
|
|
2181
2059
|
const e = await r.text().catch(() => "");
|
|
@@ -2187,17 +2065,17 @@ async function mURL_read_channel(input, ctx) {
|
|
|
2187
2065
|
messages: (data.messages ?? []).map((m) => ({ id: m.id, from: m.from ?? null, text: m.text, timestamp: m.ts }))
|
|
2188
2066
|
};
|
|
2189
2067
|
}
|
|
2190
|
-
var mURL_post_input =
|
|
2068
|
+
var mURL_post_input = z13.object({
|
|
2191
2069
|
domain: DomainArg,
|
|
2192
|
-
text:
|
|
2193
|
-
from:
|
|
2070
|
+
text: z13.string().min(1).max(2e3).describe("Message body (max 2000 chars, up to 3 lines \u2014 Worker-enforced)."),
|
|
2071
|
+
from: z13.string().max(120).optional().describe("Sender hint shown to others (defaults to the hub-key owner / your agent name).")
|
|
2194
2072
|
});
|
|
2195
2073
|
async function mURL_post(input, ctx) {
|
|
2196
2074
|
const { domain, slug: slug2 } = urlToSlug(input.domain);
|
|
2197
2075
|
ctx.log("debug", "mURL_post", { domain });
|
|
2198
2076
|
const r = await fetch(`${edgeUrl2()}/c/${slug2}/send`, {
|
|
2199
2077
|
method: "POST",
|
|
2200
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${
|
|
2078
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${hubKey2()}` },
|
|
2201
2079
|
body: JSON.stringify({ text: input.text, from: input.from })
|
|
2202
2080
|
});
|
|
2203
2081
|
if (!r.ok) {
|
|
@@ -2208,12 +2086,12 @@ async function mURL_post(input, ctx) {
|
|
|
2208
2086
|
if (!data?.id) throw new Error("mosadd-edge: send returned no id");
|
|
2209
2087
|
return { domain, message_id: data.id, posted_at: data.ts ?? Date.now() };
|
|
2210
2088
|
}
|
|
2211
|
-
var mURL_list_channels_input =
|
|
2212
|
-
action:
|
|
2213
|
-
limit:
|
|
2214
|
-
hours:
|
|
2215
|
-
status:
|
|
2216
|
-
cursor:
|
|
2089
|
+
var mURL_list_channels_input = z13.object({
|
|
2090
|
+
action: z13.enum(["trending", "list", "mine"]).optional().describe("'trending' (default) = most active domain channels in the last N hours; 'list' = paginated catalogue filtered by status; 'mine' = channels you own (DNS-verified)."),
|
|
2091
|
+
limit: z13.number().int().min(1).max(100).optional().describe("Max channels to return. Default 20."),
|
|
2092
|
+
hours: z13.number().int().min(1).max(168).optional().describe("Trending window in hours. Default 24, max 168 (7d)."),
|
|
2093
|
+
status: z13.enum(["open", "claimed", "blocked"]).optional().describe("For action='list': filter (default 'open')."),
|
|
2094
|
+
cursor: z13.string().optional().describe("For action='list': pagination \u2014 pass previous response's next_cursor (created_at ISO).")
|
|
2217
2095
|
});
|
|
2218
2096
|
async function mURL_list_channels(input, ctx) {
|
|
2219
2097
|
readSupabaseEnv();
|
|
@@ -2227,7 +2105,7 @@ async function mURL_list_channels(input, ctx) {
|
|
|
2227
2105
|
cursor: input.cursor ?? null
|
|
2228
2106
|
});
|
|
2229
2107
|
}
|
|
2230
|
-
var mURL_presence_input =
|
|
2108
|
+
var mURL_presence_input = z13.object({ domain: DomainArg });
|
|
2231
2109
|
async function mURL_presence(input, ctx) {
|
|
2232
2110
|
const { domain, slug: slug2 } = urlToSlug(input.domain);
|
|
2233
2111
|
ctx.log("debug", "mURL_presence", { domain });
|
|
@@ -2271,7 +2149,7 @@ var murlTools = [
|
|
|
2271
2149
|
];
|
|
2272
2150
|
|
|
2273
2151
|
// src/tools/capabilities.ts
|
|
2274
|
-
import { z as
|
|
2152
|
+
import { z as z14 } from "zod";
|
|
2275
2153
|
var CONTRACT_VERSION = "1.0.0";
|
|
2276
2154
|
var ALL_REQUIREMENTS = ["any", "radio", "network"];
|
|
2277
2155
|
function buildCapabilityManifest(tools) {
|
|
@@ -2294,7 +2172,7 @@ function makeCapabilitiesTool(channelTools2) {
|
|
|
2294
2172
|
name: "comms_capabilities",
|
|
2295
2173
|
requires: "any",
|
|
2296
2174
|
description: "Discover which mosadd tools are available and what transport each requires (any | radio | network). Carrier-aware hosts (e.g. off-grid radio devices) call this once to gate the tool list to what the current carrier supports. Returns a manifest with per-tool requirements grouped by transport.",
|
|
2297
|
-
inputSchema:
|
|
2175
|
+
inputSchema: z14.object({}),
|
|
2298
2176
|
handler: async () => buildCapabilityManifest([...channelTools2, tool])
|
|
2299
2177
|
};
|
|
2300
2178
|
return tool;
|
|
@@ -2311,25 +2189,18 @@ var channelTools = [
|
|
|
2311
2189
|
// ...mroomTools, // mROOM: killed (LINEAR-3414) — channel re-cut into ephemeral private mIRC
|
|
2312
2190
|
// ...mroomMessagesTools, // mROOM: killed (LINEAR-3414)
|
|
2313
2191
|
...mailTools,
|
|
2314
|
-
// mAYL_*: canonical email module (was
|
|
2315
|
-
...mailAliasTools,
|
|
2316
|
-
//
|
|
2317
|
-
...mailProvenanceTools,
|
|
2318
|
-
// mAYL_send_as_agent: agent-attributed mail send via hub-claim-mint (LINEAR-3991)
|
|
2319
|
-
// endpoint (404s every call) + sends provenance body fields the EF never reads. Unregister until
|
|
2320
|
-
// rewired onto hub-key-exchange (agent_id/task_id + mosadd_hub JWT claim). See consistency ticket.
|
|
2192
|
+
// mAYL_*: canonical email module (was the mp0st codename; renamed re-arch 2026-06-27)
|
|
2193
|
+
// ...mailAliasTools, // mp0st_* aliases RETIRED 2026-07-15 — mAYL is the one name; the mp0st codename is now backend-internal only
|
|
2194
|
+
// ...mailProvenanceTools, // mAYL_send_as_agent: UNREGISTERED 2026-07-14 — hub-claim EF 404s every call; re-register when rewired onto hub-key-exchange (CTO-1 live-ping)
|
|
2321
2195
|
...mtalkTools,
|
|
2322
2196
|
...attachmentTools,
|
|
2323
|
-
...pttIngestTools,
|
|
2324
|
-
// mTALK_ingest_ptt: P4.1 / LINEAR-3998 — body aligned to deployed ptt-ingest EF
|
|
2325
|
-
// ptt-ingest EF (needs {direction, audio_base64, mime_type, message_id|thread_id} → 400s every
|
|
2326
|
-
// call) and the PTT→RAG path needs rework. Unregister until both are fixed. See consistency ticket.
|
|
2197
|
+
// ...pttIngestTools, // mTALK_ingest_ptt: UNREGISTERED 2026-07-14 — ptt-ingest EF 400s every call; re-register when payload + PTT→RAG path fixed (CTO-1 live-ping)
|
|
2327
2198
|
...knowledgeTools,
|
|
2328
2199
|
...actionTools,
|
|
2329
2200
|
// Action links (Tier 1): agent → user one-link browser action via action-create EF
|
|
2330
|
-
...embedTools,
|
|
2331
|
-
|
|
2332
|
-
//
|
|
2201
|
+
// ...embedTools, // comms_embed_create: UNREGISTERED 2026-07-14 — widget backend not live e2e; re-register when embed.mosadd.com ships (CTO-1 live-ping)
|
|
2202
|
+
...threatTools,
|
|
2203
|
+
// threat_catalog + threat_classify: RE-REGISTERED 2026-07-15 (founder directive + LINEAR-3498) — pure/offline, makes the Pegasus-class classification claim a live, callable capability
|
|
2333
2204
|
...murlTools
|
|
2334
2205
|
// mURL: revived as a full module (founder 2026-06-27) — read/post/presence/list_channels over live domain channels
|
|
2335
2206
|
// ...mcallTools, // mCALL: carrier-pending (no telephony carrier live) — re-register when a carrier is configured
|
|
@@ -2508,7 +2379,7 @@ function createMosaddServer(options = {}) {
|
|
|
2508
2379
|
const server = new McpServer(
|
|
2509
2380
|
{
|
|
2510
2381
|
name: "mosadd",
|
|
2511
|
-
version: "3.0.0-alpha.
|
|
2382
|
+
version: "3.0.0-alpha.28"
|
|
2512
2383
|
},
|
|
2513
2384
|
{
|
|
2514
2385
|
capabilities: {
|
package/dist/index.d.ts
CHANGED
|
@@ -202,23 +202,27 @@ declare function createMosaddServer(options?: MosaddServerOptions): McpServer;
|
|
|
202
202
|
*
|
|
203
203
|
* User-facing modules (4): mDM, mIRC, mURL, mAYL — the re-arch (LINEAR-3938)
|
|
204
204
|
* mAYL replaces the old mp0st name (mp0st_* still registered as back-compat
|
|
205
|
-
* aliases via mail-aliases.ts; will be removed in alpha
|
|
205
|
+
* aliases via mail-aliases.ts; will be removed in a later alpha).
|
|
206
206
|
*
|
|
207
207
|
* Capabilities (not modules — cross-cutting agent tooling): mRAG, comms_.
|
|
208
208
|
* mTALK = voice tier inside mIRC, still its own tools for now; folding into
|
|
209
|
-
* mIRC_voice_* in a follow-up release. threat_*
|
|
210
|
-
*
|
|
209
|
+
* mIRC_voice_* in a follow-up release. threat_* (threat_catalog + threat_classify)
|
|
210
|
+
* are REGISTERED (2026-07-15, founder directive + LINEAR-3498): pure/offline
|
|
211
|
+
* defensive classification over the threat taxonomy — the surveillance-era
|
|
212
|
+
* *marketing* was killed, the classification engine is real and wanted.
|
|
211
213
|
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
214
|
+
* ~70+ callable tools registered (public copy says "70+ tools", matching mosadd.com).
|
|
215
|
+
* Modules (4): mDM, mIRC, mURL, mAYL. Capabilities: mTALK (voice/PTT), mRAG, comms_.
|
|
216
|
+
* mp0st_* stay as DEPRECATED back-compat aliases for mAYL_* (removed in a later alpha).
|
|
217
|
+
* Exact integer pending a live EF ping (CTO-1) — don't hard-code a drifting count.
|
|
218
|
+
* UNREGISTERED 2026-07-14 (broken scaffolds whose EFs 404/400 every call — re-register when
|
|
219
|
+
* live): mAYL_send_as_agent (mail-provenance), mTALK_ingest_ptt (ptt-ingest), comms_embed_create.
|
|
216
220
|
* mROOM was KILLED (LINEAR-3414, channel re-cut → ephemeral private mIRC): its tools
|
|
217
221
|
* live in tools/mroom.ts + mroom-messages.ts but are NOT registered here.
|
|
218
222
|
* Plus action links: comms_action_create (agent → user one-link browser action,
|
|
219
223
|
* incl. screen_share) + comms_action_frame_get (see the recipient's shared screen).
|
|
220
|
-
* mURL is a
|
|
221
|
-
*
|
|
224
|
+
* mURL is a FULL registered dev module (revived, founder 2026-06-27) — IRC-for-URLs,
|
|
225
|
+
* agent-native; backends live (mosadd-edge + murl-channels EF). tools/murl.ts.
|
|
222
226
|
* mCALL is carrier-pending (no telephony carrier live yet): its tools live in
|
|
223
227
|
* tools/mcall.ts but are NOT registered here, so an agent only ever discovers
|
|
224
228
|
* tools that actually work. Re-register the one line below when a carrier ships.
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mosadd/mcp",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.28",
|
|
4
4
|
"mcpName": "io.github.hei33enberg/mosadd-mcp",
|
|
5
|
-
"description": "Model Context Protocol server for mosadd. Exposes 4 modules (mDM, mIRC, mURL, mAYL) and capabilities (mTALK, mRAG) plus comms agent-actions —
|
|
5
|
+
"description": "Model Context Protocol server for mosadd. Exposes 4 modules (mDM, mIRC, mURL, mAYL) and capabilities (mTALK, mRAG) plus comms agent-actions — 65 tools — to any agent runtime (Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, custom).",
|
|
6
6
|
"homepage": "https://github.com/Hei33enberg/mosADD-OS/tree/main/packages/mcp",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
39
39
|
"@supabase/supabase-js": "^2.48.0",
|
|
40
40
|
"zod": "^4.3.6",
|
|
41
|
+
"@mosadd/protocol": "3.0.0-alpha.26",
|
|
41
42
|
"@mosadd/crypto": "3.0.0-alpha.26",
|
|
42
43
|
"@mosadd/threat-engine": "3.0.0-alpha.26",
|
|
43
|
-
"@mosadd/protocol": "3.0.0-alpha.26",
|
|
44
44
|
"@mosadd/providers": "3.0.0-alpha.26"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -137,8 +137,9 @@ describe("@mosadd/mcp — integration (real stdio)", () => {
|
|
|
137
137
|
// All live channels surface their tools
|
|
138
138
|
expect(names).toContain("mDM_send");
|
|
139
139
|
expect(names).toContain("mIRC_create");
|
|
140
|
-
expect(names).toContain("
|
|
141
|
-
expect(names).toContain("
|
|
140
|
+
expect(names).toContain("mURL_post"); // mURL revived module (2026-06-27)
|
|
141
|
+
expect(names).toContain("mAYL_send"); // mAYL = email 3.0 (was mp0st); threat_catalog/threat_classify ARE registered (LINEAR-3498)
|
|
142
|
+
expect(names).not.toContain("mp0st_send"); // mp0st_* aliases RETIRED 2026-07-15 — mAYL only
|
|
142
143
|
expect(names).toContain("mTALK_press"); // mTALK PTT now shipped
|
|
143
144
|
expect(names).toContain("mRAG_search"); // mRAG RAG-for-devs now shipped
|
|
144
145
|
expect(names).toContain("mIRC_post_message"); // channel messaging now shipped
|
|
@@ -15,12 +15,12 @@ describe("@mosadd/mcp", () => {
|
|
|
15
15
|
// mIRC (5 tools)
|
|
16
16
|
expect(names).toContain("mIRC_create");
|
|
17
17
|
expect(names).toContain("mIRC_delete");
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
expect(names).toContain("
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
expect(names).
|
|
18
|
+
// mURL (revived module) + mAYL (email 3.0, was mp0st) — threat_* re-registered (LINEAR-3498)
|
|
19
|
+
// (surveillance-era direction killed 2026-06-27; on-device security pillar, not an MCP tool)
|
|
20
|
+
expect(names).toContain("mURL_post");
|
|
21
|
+
expect(names).toContain("mAYL_send");
|
|
22
|
+
// mp0st_* aliases RETIRED 2026-07-15 — mAYL is the one name (mp0st is backend-internal only)
|
|
23
|
+
expect(names.some((n) => n.startsWith("mp0st_"))).toBe(false);
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
it("follows RFC 0001 naming — channel tools m<MODULE>_<operation>, meta tools comms_<op>", () => {
|
package/src/server.ts
CHANGED
package/src/tools/index.ts
CHANGED
|
@@ -3,23 +3,27 @@
|
|
|
3
3
|
*
|
|
4
4
|
* User-facing modules (4): mDM, mIRC, mURL, mAYL — the re-arch (LINEAR-3938)
|
|
5
5
|
* mAYL replaces the old mp0st name (mp0st_* still registered as back-compat
|
|
6
|
-
* aliases via mail-aliases.ts; will be removed in alpha
|
|
6
|
+
* aliases via mail-aliases.ts; will be removed in a later alpha).
|
|
7
7
|
*
|
|
8
8
|
* Capabilities (not modules — cross-cutting agent tooling): mRAG, comms_.
|
|
9
9
|
* mTALK = voice tier inside mIRC, still its own tools for now; folding into
|
|
10
|
-
* mIRC_voice_* in a follow-up release. threat_*
|
|
11
|
-
*
|
|
10
|
+
* mIRC_voice_* in a follow-up release. threat_* (threat_catalog + threat_classify)
|
|
11
|
+
* are REGISTERED (2026-07-15, founder directive + LINEAR-3498): pure/offline
|
|
12
|
+
* defensive classification over the threat taxonomy — the surveillance-era
|
|
13
|
+
* *marketing* was killed, the classification engine is real and wanted.
|
|
12
14
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* ~70+ callable tools registered (public copy says "70+ tools", matching mosadd.com).
|
|
16
|
+
* Modules (4): mDM, mIRC, mURL, mAYL. Capabilities: mTALK (voice/PTT), mRAG, comms_.
|
|
17
|
+
* mp0st_* stay as DEPRECATED back-compat aliases for mAYL_* (removed in a later alpha).
|
|
18
|
+
* Exact integer pending a live EF ping (CTO-1) — don't hard-code a drifting count.
|
|
19
|
+
* UNREGISTERED 2026-07-14 (broken scaffolds whose EFs 404/400 every call — re-register when
|
|
20
|
+
* live): mAYL_send_as_agent (mail-provenance), mTALK_ingest_ptt (ptt-ingest), comms_embed_create.
|
|
17
21
|
* mROOM was KILLED (LINEAR-3414, channel re-cut → ephemeral private mIRC): its tools
|
|
18
22
|
* live in tools/mroom.ts + mroom-messages.ts but are NOT registered here.
|
|
19
23
|
* Plus action links: comms_action_create (agent → user one-link browser action,
|
|
20
24
|
* incl. screen_share) + comms_action_frame_get (see the recipient's shared screen).
|
|
21
|
-
* mURL is a
|
|
22
|
-
*
|
|
25
|
+
* mURL is a FULL registered dev module (revived, founder 2026-06-27) — IRC-for-URLs,
|
|
26
|
+
* agent-native; backends live (mosadd-edge + murl-channels EF). tools/murl.ts.
|
|
23
27
|
* mCALL is carrier-pending (no telephony carrier live yet): its tools live in
|
|
24
28
|
* tools/mcall.ts but are NOT registered here, so an agent only ever discovers
|
|
25
29
|
* tools that actually work. Re-register the one line below when a carrier ships.
|
|
@@ -35,17 +39,16 @@ import { mircEdgeTools } from "./mirc-edge.js";
|
|
|
35
39
|
// import { mroomTools } from "./mroom.js"; // mROOM: killed (LINEAR-3414) — not registered
|
|
36
40
|
// import { mroomMessagesTools } from "./mroom-messages.js"; // mROOM: killed (LINEAR-3414) — not registered
|
|
37
41
|
import { mailTools } from "./mail.js";
|
|
38
|
-
import { mailAliasTools } from "./mail-aliases.js";
|
|
39
|
-
import { mailProvenanceTools } from "./mail-provenance.js";
|
|
40
|
-
// import { mailProvenanceTools } from "./mail-provenance.js"; // scaffold (mp0st_send_as_agent) — not registered, see below
|
|
42
|
+
// import { mailAliasTools } from "./mail-aliases.js"; // mp0st_* aliases RETIRED 2026-07-15 (founder: unify on mAYL, drop the mp0st codename from every user-visible surface). Source kept for reference.
|
|
43
|
+
// import { mailProvenanceTools } from "./mail-provenance.js"; // mAYL_send_as_agent SCAFFOLD — UNREGISTERED 2026-07-14 (hub-claim EF 404s; re-register when live — CTO-1 live-ping)
|
|
41
44
|
import { mtalkTools } from "./mtalk.js";
|
|
42
45
|
import { attachmentTools } from "./attachments.js";
|
|
43
|
-
import { pttIngestTools } from "./ptt-ingest.js"; //
|
|
46
|
+
// import { pttIngestTools } from "./ptt-ingest.js"; // mTALK_ingest_ptt SCAFFOLD — UNREGISTERED 2026-07-14 (ptt-ingest EF 400s; re-register when fixed — CTO-1 live-ping)
|
|
44
47
|
// import { mcallTools } from "./mcall.js"; // mCALL: carrier-pending — not registered (see header note)
|
|
45
48
|
import { knowledgeTools } from "./knowledge.js";
|
|
46
49
|
import { actionTools } from "./actions.js";
|
|
47
|
-
import { embedTools } from "./embed.js"; //
|
|
48
|
-
|
|
50
|
+
// import { embedTools } from "./embed.js"; // comms_embed_create SCAFFOLD — UNREGISTERED 2026-07-14 (widget backend not live e2e; re-register when embed.mosadd.com ships — CTO-1 live-ping)
|
|
51
|
+
import { threatTools } from "./threat.js"; // threat_*: RE-REGISTERED 2026-07-15 (founder directive + LINEAR-3498). Pure/offline classification of the real Pegasus-class threat taxonomy — the engine DECIDES, the caller acts; no surveillance, no backend.
|
|
49
52
|
import { murlTools } from "./murl.js"; // mURL: REGISTERED — revived as a full dev module (founder 2026-06-27, re-arch). IRC-for-URLs, agent-native; backends live (mosadd-edge + murl-channels EF).
|
|
50
53
|
import { makeCapabilitiesTool } from "./capabilities.js";
|
|
51
54
|
|
|
@@ -59,20 +62,16 @@ const channelTools: MosaddTool[] = [
|
|
|
59
62
|
...mircEdgeTools,
|
|
60
63
|
// ...mroomTools, // mROOM: killed (LINEAR-3414) — channel re-cut into ephemeral private mIRC
|
|
61
64
|
// ...mroomMessagesTools, // mROOM: killed (LINEAR-3414)
|
|
62
|
-
...mailTools, // mAYL_*: canonical email module (was
|
|
63
|
-
...mailAliasTools,
|
|
64
|
-
...mailProvenanceTools, // mAYL_send_as_agent:
|
|
65
|
-
// endpoint (404s every call) + sends provenance body fields the EF never reads. Unregister until
|
|
66
|
-
// rewired onto hub-key-exchange (agent_id/task_id + mosadd_hub JWT claim). See consistency ticket.
|
|
65
|
+
...mailTools, // mAYL_*: canonical email module (was the mp0st codename; renamed re-arch 2026-06-27)
|
|
66
|
+
// ...mailAliasTools, // mp0st_* aliases RETIRED 2026-07-15 — mAYL is the one name; the mp0st codename is now backend-internal only
|
|
67
|
+
// ...mailProvenanceTools, // mAYL_send_as_agent: UNREGISTERED 2026-07-14 — hub-claim EF 404s every call; re-register when rewired onto hub-key-exchange (CTO-1 live-ping)
|
|
67
68
|
...mtalkTools,
|
|
68
69
|
...attachmentTools,
|
|
69
|
-
...pttIngestTools, // mTALK_ingest_ptt:
|
|
70
|
-
// ptt-ingest EF (needs {direction, audio_base64, mime_type, message_id|thread_id} → 400s every
|
|
71
|
-
// call) and the PTT→RAG path needs rework. Unregister until both are fixed. See consistency ticket.
|
|
70
|
+
// ...pttIngestTools, // mTALK_ingest_ptt: UNREGISTERED 2026-07-14 — ptt-ingest EF 400s every call; re-register when payload + PTT→RAG path fixed (CTO-1 live-ping)
|
|
72
71
|
...knowledgeTools,
|
|
73
72
|
...actionTools, // Action links (Tier 1): agent → user one-link browser action via action-create EF
|
|
74
|
-
...embedTools, // comms_embed_create:
|
|
75
|
-
|
|
73
|
+
// ...embedTools, // comms_embed_create: UNREGISTERED 2026-07-14 — widget backend not live e2e; re-register when embed.mosadd.com ships (CTO-1 live-ping)
|
|
74
|
+
...threatTools, // threat_catalog + threat_classify: RE-REGISTERED 2026-07-15 (founder directive + LINEAR-3498) — pure/offline, makes the Pegasus-class classification claim a live, callable capability
|
|
76
75
|
...murlTools, // mURL: revived as a full module (founder 2026-06-27) — read/post/presence/list_channels over live domain channels
|
|
77
76
|
// ...mcallTools, // mCALL: carrier-pending (no telephony carrier live) — re-register when a carrier is configured
|
|
78
77
|
// mirlTools,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
//
|
|
9
9
|
// Rule: never drop an alias in the release that adds its replacement — live
|
|
10
10
|
// agents would 404. mp0st_* aliases stay through alpha.25 and the next minor;
|
|
11
|
-
// flag for removal goes into the
|
|
11
|
+
// flag for removal goes into the a later release's notes.
|
|
12
12
|
// =============================================================================
|
|
13
13
|
|
|
14
14
|
import type { MosaddTool } from "../types.js";
|
|
@@ -20,6 +20,6 @@ export const mailAliasTools: MosaddTool[] = mailTools.map((tool) => ({
|
|
|
20
20
|
name: tool.name.replace(/^mAYL_/, "mp0st_"),
|
|
21
21
|
description:
|
|
22
22
|
`[DEPRECATED — use ${tool.name} instead. mp0st_* aliases stay through alpha.25 ` +
|
|
23
|
-
`for back-compat; will be removed in alpha.
|
|
23
|
+
`for back-compat; will be removed in a later alpha.] ` +
|
|
24
24
|
tool.description,
|
|
25
25
|
}));
|
package/src/tools/mail.ts
CHANGED
|
@@ -19,7 +19,7 @@ const EmailAddress = z
|
|
|
19
19
|
.max(254)
|
|
20
20
|
.describe("RFC 5321 email address.");
|
|
21
21
|
|
|
22
|
-
const MessageId = z.string().min(1).describe("Message id (UUID) from
|
|
22
|
+
const MessageId = z.string().min(1).describe("Message id (UUID) from mAYL_send or inbox.");
|
|
23
23
|
|
|
24
24
|
const mp0st_send_input = z.object({
|
|
25
25
|
to: z.union([EmailAddress, z.array(EmailAddress).min(1).max(50)]).describe(
|
|
@@ -295,7 +295,7 @@ export const mailTools: MosaddTool[] = [
|
|
|
295
295
|
name: "mAYL_list",
|
|
296
296
|
requires: "network",
|
|
297
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
|
|
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
299
|
inputSchema: mp0st_list_input,
|
|
300
300
|
handler: mp0st_list as MosaddTool["handler"],
|
|
301
301
|
},
|
|
@@ -318,7 +318,7 @@ export const mailTools: MosaddTool[] = [
|
|
|
318
318
|
name: "mAYL_delete",
|
|
319
319
|
requires: "network",
|
|
320
320
|
description:
|
|
321
|
-
"Delete one of the user's emails by message_id (from
|
|
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
322
|
inputSchema: mp0st_delete_input,
|
|
323
323
|
handler: mp0st_delete as MosaddTool["handler"],
|
|
324
324
|
},
|
|
@@ -334,7 +334,7 @@ export const mailTools: MosaddTool[] = [
|
|
|
334
334
|
name: "mAYL_events",
|
|
335
335
|
requires: "network",
|
|
336
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
|
|
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
338
|
inputSchema: mp0st_events_input,
|
|
339
339
|
handler: mp0st_events as MosaddTool["handler"],
|
|
340
340
|
},
|
|
@@ -366,7 +366,7 @@ export const mailTools: MosaddTool[] = [
|
|
|
366
366
|
name: "mAYL_consent",
|
|
367
367
|
requires: "network",
|
|
368
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;
|
|
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
370
|
inputSchema: mp0st_consent_input,
|
|
371
371
|
handler: mp0st_consent as MosaddTool["handler"],
|
|
372
372
|
},
|
package/src/tools/threat.ts
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
THREAT_EVENTS,
|
|
23
23
|
THREAT_EVENT_COUNT,
|
|
24
24
|
evaluateEvent,
|
|
25
|
+
getEventDef,
|
|
25
26
|
type ThreatEventDef,
|
|
26
27
|
} from "@mosadd/threat-engine";
|
|
27
28
|
|
|
@@ -66,8 +67,34 @@ const threat_classify_input = z.object({
|
|
|
66
67
|
async function threat_classify(
|
|
67
68
|
input: z.infer<typeof threat_classify_input>,
|
|
68
69
|
_ctx: MosaddToolContext,
|
|
69
|
-
): Promise<{
|
|
70
|
-
|
|
70
|
+
): Promise<{
|
|
71
|
+
action: string;
|
|
72
|
+
severity: string;
|
|
73
|
+
reason: string;
|
|
74
|
+
known_event: boolean;
|
|
75
|
+
category: string | null;
|
|
76
|
+
label: string | null;
|
|
77
|
+
}> {
|
|
78
|
+
// Known taxonomy event → surface ITS severity immediately. Pegasus-class events
|
|
79
|
+
// (PROCESS_INJECTION, STINGRAY_DETECT, IMSI_CATCHER_SCAN, MEMORY_INJECTION, SS7_PROBE…)
|
|
80
|
+
// classify as critical/killswitch right away. But the engine NEVER auto-acts:
|
|
81
|
+
// action is always "monitor" — it tells you, it never disconnects, locks, or wipes.
|
|
82
|
+
// The taxonomy's own autoActions are what a stricter host policy COULD do; we do
|
|
83
|
+
// not execute them here ("monitoruje, nie działa").
|
|
84
|
+
const def = getEventDef(String(input.event_type).toUpperCase());
|
|
85
|
+
if (def) {
|
|
86
|
+
return {
|
|
87
|
+
action: "monitor",
|
|
88
|
+
severity: def.severity,
|
|
89
|
+
reason: `${def.label} (${def.category}) — classified from the mosadd threat taxonomy. Monitor-only: surfaced for you to act on, no automatic action taken.`,
|
|
90
|
+
known_event: true,
|
|
91
|
+
category: def.category,
|
|
92
|
+
label: def.label,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
// Unknown event string → fall back to the pure DECK decision engine (unchanged).
|
|
96
|
+
const decision = evaluateEvent({ eventType: input.event_type, severity: input.severity, details: input.details });
|
|
97
|
+
return { ...decision, known_event: false, category: null, label: null };
|
|
71
98
|
}
|
|
72
99
|
|
|
73
100
|
// ── Registration ──
|
|
@@ -85,7 +112,7 @@ export const threatTools: MosaddTool[] = [
|
|
|
85
112
|
name: "threat_classify",
|
|
86
113
|
requires: "any",
|
|
87
114
|
description:
|
|
88
|
-
"Classify a single telemetry event
|
|
115
|
+
"Classify a single telemetry event against the mosadd threat taxonomy + DECK engine. For a known event type (e.g. PROCESS_INJECTION, STINGRAY_DETECT, IMSI_CATCHER_SCAN, MEMORY_INJECTION) it returns that event's real severity (info|warning|elevated|critical|killswitch) with action=\"monitor\" — Pegasus-class events surface as critical immediately, but the engine NEVER auto-acts (it tells you, it never disconnects/locks). Unknown strings fall back to the pure DECK decision (log_only|revoke_sessions|lock_account|suspend_did). Returns { action, severity, reason, known_event, category, label }. Deterministic, offline, no backend.",
|
|
89
116
|
inputSchema: threat_classify_input,
|
|
90
117
|
handler: threat_classify as MosaddTool["handler"],
|
|
91
118
|
},
|