@mosadd/mcp 3.0.0-alpha.26 → 3.0.0-alpha.27

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 CHANGED
@@ -1,12 +1,14 @@
1
1
  # @mosadd/mcp
2
2
 
3
- MCP server for [mosADD](https://mosadd.com) — **the comms layer for AI agents and the humans who direct them.** Exposes the OS modules (m\*) — **mDM (1:1 E2EE), mIRC (in-app channels), mURL (open/embeddable text rooms), and mAYL (email 3.0)** — as Model Context Protocol tools so any agent runtime can talk to mosadd: Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, custom.
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
- > **3.0.0-alpha.23** — **61 live tools across 5 live modules** (mDM incl. voice + files, mIRC, mp0st, mTALK, mRAG) + agent→user action links + the `comms_capabilities` discovery tool + the defensive `threat_*` engine, wired to the mosADD backend (BYOK) as a strangler-fig step. Phase 2 routes through the hosted gateway at `mcp.mosadd.com` with the 166-event radar in front.
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 ~61 tools.
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
- **61 live tools across 5 live modules** (mDM, mIRC, mp0st, mTALK, mRAG) + agent→user action links + the `comms_capabilities` discovery tool + the defensive `threat_*` engine. Highlights per module:
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`, `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 |
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
- | **mp0st** (11) | `mp0st_send`, `mp0st_view`, `mp0st_list`, `mp0st_delete`, `mp0st_stats`, `mp0st_events`, `mp0st_metrics`, `mp0st_revoke`, `mp0st_audit_export`, `mp0st_consent`, `mp0st_notify` | Mail; every user gets `<id>@mosadd.com`. `mp0st_revoke` recalls secure-reader access; `mp0st_audit_export` emits an HMAC-SHA256-signed engagement audit; `mp0st_consent` manages recipient tracking opt-outs (GDPR); `mp0st_notify` pulls the inbound-mail feed |
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
- Counts by module prefix sum to **56 channel tools**; the 3 `comms_*` tools and 2 `threat_*` tools make **61 callable** in total. `mCALL` (telephony), `mROOM`, `mURL` — and the `mp0st_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.
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 `mp0st` outbound | no (mp0st disabled if unset) |
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
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createMosaddServer
4
- } from "../chunk-YBSQUORF.js";
4
+ } from "../chunk-EE7UQFSI.js";
5
5
  import {
6
6
  isSessionExpired,
7
7
  loadSession,
@@ -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 mp0st_send or inbox.");
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 mp0st_view to read a full message body.",
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 mp0st_list). Soft-delete \u2014 it stops showing in mp0st_list. Owner-scoped: only your own mail.",
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 mp0st_stats for the rollup; use this for the per-event detail. Owner-scoped.",
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; mp0st_send then automatically sends them with NO pixel/link-wrap. Owner-scoped.",
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
  },
@@ -1468,95 +1468,20 @@ var mailTools = [
1468
1468
  var mailAliasTools = mailTools.map((tool) => ({
1469
1469
  ...tool,
1470
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
1471
+ description: `[DEPRECATED \u2014 use ${tool.name} instead. mp0st_* aliases stay through alpha.25 for back-compat; will be removed in a later alpha.] ` + tool.description
1472
1472
  }));
1473
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
1474
  // src/tools/mtalk.ts
1550
- import { z as z9 } from "zod";
1551
- var RoomLabel = z9.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.");
1552
- var RoomId2 = z9.string().min(1).describe("Room id returned by mTALK_open.");
1553
- var mTALK_open_input = z9.object({
1475
+ import { z as z8 } from "zod";
1476
+ 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.");
1477
+ var RoomId2 = z8.string().min(1).describe("Room id returned by mTALK_open.");
1478
+ var mTALK_open_input = z8.object({
1554
1479
  label: RoomLabel.optional().describe("Optional label; defaults to a personal room.")
1555
1480
  });
1556
- var mTALK_join_input = z9.object({ room_id: RoomId2 });
1557
- var mTALK_press_input = z9.object({ room_id: RoomId2 });
1558
- var mTALK_release_input = z9.object({ room_id: RoomId2 });
1559
- var mTALK_state_input = z9.object({ room_id: RoomId2 });
1481
+ var mTALK_join_input = z8.object({ room_id: RoomId2 });
1482
+ var mTALK_press_input = z8.object({ room_id: RoomId2 });
1483
+ var mTALK_release_input = z8.object({ room_id: RoomId2 });
1484
+ var mTALK_state_input = z8.object({ room_id: RoomId2 });
1560
1485
  async function mTALK_open(input, ctx) {
1561
1486
  const { roomId } = await ctx.providers.voice.createRoom(input.label);
1562
1487
  ctx.log("debug", "mTALK_open", { room_id: roomId });
@@ -1620,7 +1545,7 @@ var mtalkTools = [
1620
1545
  ];
1621
1546
 
1622
1547
  // src/tools/attachments.ts
1623
- import { z as z10 } from "zod";
1548
+ import { z as z9 } from "zod";
1624
1549
 
1625
1550
  // src/providers/blob-upload.ts
1626
1551
  function defaultBucket(kind) {
@@ -1670,14 +1595,14 @@ function decodeBase64Body(b64) {
1670
1595
 
1671
1596
  // src/tools/attachments.ts
1672
1597
  var PROTOCOL_VERSION4 = "mosadd.chat.v1";
1673
- var Base64Body = z10.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.");
1674
- var Mime = z10.string().min(1).max(120).describe("MIME type, e.g. audio/ogg, application/pdf, image/png.");
1675
- var DurationMs = z10.number().int().positive().optional().describe("Audio clip length in ms (voice only), if known.");
1676
- var Filename = z10.string().min(1).max(255).optional().describe("Original filename (file only).");
1677
- var ReplyTo = z10.string().optional().describe("Optional id of the message being replied to.");
1678
- var ContactRef3 = z10.string().min(1).describe("Recipient identity id (UUID). Use mDM_list_contacts to find it.");
1679
- var RoomId3 = z10.string().min(1).describe("Room/channel id (UUID).");
1680
- var ThreadLabel = z10.string().max(120).regex(/^[a-zA-Z0-9._-]+$/).optional().describe("Optional thread label within the conversation (mDM USP: multiple threads per contact).");
1598
+ 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.");
1599
+ var Mime = z9.string().min(1).max(120).describe("MIME type, e.g. audio/ogg, application/pdf, image/png.");
1600
+ var DurationMs = z9.number().int().positive().optional().describe("Audio clip length in ms (voice only), if known.");
1601
+ var Filename = z9.string().min(1).max(255).optional().describe("Original filename (file only).");
1602
+ var ReplyTo = z9.string().optional().describe("Optional id of the message being replied to.");
1603
+ var ContactRef3 = z9.string().min(1).describe("Recipient identity id (UUID). Use mDM_list_contacts to find it.");
1604
+ var RoomId3 = z9.string().min(1).describe("Room/channel id (UUID).");
1605
+ 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
1606
  function dmThreadId3(selfId, otherId, label) {
1682
1607
  const [a, b] = [selfId, otherId].sort();
1683
1608
  return label ? `dm:${a}:${b}:${label}` : `dm:${a}:${b}`;
@@ -1720,21 +1645,21 @@ async function resolveLinkedSpaceId2(channelId) {
1720
1645
  if (!spaceId) throw new Error(`Channel ${channelId} has no linked space yet \u2014 run mIRC_join/mIRC_list first or pass space_id.`);
1721
1646
  return spaceId;
1722
1647
  }
1723
- var mDM_send_voice_input = z10.object({
1648
+ var mDM_send_voice_input = z9.object({
1724
1649
  to: ContactRef3,
1725
1650
  audio_base64: Base64Body,
1726
1651
  mime: Mime.default("audio/ogg"),
1727
1652
  duration_ms: DurationMs,
1728
- caption: z10.string().max(2e3).optional(),
1653
+ caption: z9.string().max(2e3).optional(),
1729
1654
  thread_label: ThreadLabel,
1730
1655
  reply_to_id: ReplyTo
1731
1656
  });
1732
- var mDM_send_file_input = z10.object({
1657
+ var mDM_send_file_input = z9.object({
1733
1658
  to: ContactRef3,
1734
1659
  file_base64: Base64Body,
1735
1660
  filename: Filename,
1736
1661
  mime: Mime,
1737
- caption: z10.string().max(2e3).optional(),
1662
+ caption: z9.string().max(2e3).optional(),
1738
1663
  thread_label: ThreadLabel,
1739
1664
  reply_to_id: ReplyTo
1740
1665
  });
@@ -1780,23 +1705,23 @@ async function mDM_send_file(input, ctx) {
1780
1705
  recipient_account_id: input.to
1781
1706
  });
1782
1707
  }
1783
- var mIRC_send_voice_input = z10.object({
1708
+ var mIRC_send_voice_input = z9.object({
1784
1709
  channel_id: RoomId3,
1785
1710
  audio_base64: Base64Body,
1786
1711
  mime: Mime.default("audio/ogg"),
1787
1712
  duration_ms: DurationMs,
1788
- caption: z10.string().max(2e3).optional(),
1713
+ caption: z9.string().max(2e3).optional(),
1789
1714
  reply_to_id: ReplyTo,
1790
- space_id: z10.string().optional().describe("Backing space id. Resolved automatically if omitted.")
1715
+ space_id: z9.string().optional().describe("Backing space id. Resolved automatically if omitted.")
1791
1716
  });
1792
- var mIRC_send_file_input = z10.object({
1717
+ var mIRC_send_file_input = z9.object({
1793
1718
  channel_id: RoomId3,
1794
1719
  file_base64: Base64Body,
1795
1720
  filename: Filename,
1796
1721
  mime: Mime,
1797
- caption: z10.string().max(2e3).optional(),
1722
+ caption: z9.string().max(2e3).optional(),
1798
1723
  reply_to_id: ReplyTo,
1799
- space_id: z10.string().optional()
1724
+ space_id: z9.string().optional()
1800
1725
  });
1801
1726
  async function mIRC_send_voice(input, ctx) {
1802
1727
  const space_id = input.space_id ?? await resolveLinkedSpaceId2(input.channel_id);
@@ -1841,54 +1766,13 @@ var attachmentTools = [
1841
1766
  }
1842
1767
  ];
1843
1768
 
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
1769
  // src/tools/knowledge.ts
1886
- import { z as z12 } from "zod";
1887
- var mRAG_search_input = z12.object({
1888
- query: z12.string().min(1).max(2e3).describe("Natural-language question to answer from the user's own indexed messages/emails/calls/notes."),
1889
- top_k: z12.number().int().min(1).max(25).optional().describe("Max number of source chunks to retrieve and ground the answer in. Default 8."),
1890
- source_types: z12.array(z12.enum(["message", "email", "call", "note", "contact"])).optional().describe("Restrict retrieval to these source types. Omit to search everything."),
1891
- thread_id: z12.string().optional().describe("Optional: restrict retrieval to a single thread id (e.g. a dm:/chat: thread).")
1770
+ import { z as z10 } from "zod";
1771
+ var mRAG_search_input = z10.object({
1772
+ query: z10.string().min(1).max(2e3).describe("Natural-language question to answer from the user's own indexed messages/emails/calls/notes."),
1773
+ 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."),
1774
+ source_types: z10.array(z10.enum(["message", "email", "call", "note", "contact"])).optional().describe("Restrict retrieval to these source types. Omit to search everything."),
1775
+ thread_id: z10.string().optional().describe("Optional: restrict retrieval to a single thread id (e.g. a dm:/chat: thread).")
1892
1776
  });
1893
1777
  async function mRAG_search(input, ctx) {
1894
1778
  readSupabaseEnv();
@@ -1905,12 +1789,12 @@ async function mRAG_search(input, ctx) {
1905
1789
  chunks_found: data.chunks_found ?? (data.sources?.length ?? 0)
1906
1790
  };
1907
1791
  }
1908
- var mRAG_ingest_input = z12.object({
1909
- content_text: z12.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."),
1910
- source_type: z12.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."),
1911
- source_id: z12.string().optional().describe("Optional stable id for the source so re-ingests can be grouped."),
1912
- thread_id: z12.string().optional().describe("Optional thread id to associate this knowledge with (e.g. a dm:/chat: thread)."),
1913
- title: z12.string().max(300).optional().describe("Optional human title, stored in metadata.")
1792
+ var mRAG_ingest_input = z10.object({
1793
+ 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."),
1794
+ 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."),
1795
+ source_id: z10.string().optional().describe("Optional stable id for the source so re-ingests can be grouped."),
1796
+ thread_id: z10.string().optional().describe("Optional thread id to associate this knowledge with (e.g. a dm:/chat: thread)."),
1797
+ title: z10.string().max(300).optional().describe("Optional human title, stored in metadata.")
1914
1798
  });
1915
1799
  async function mRAG_ingest(input, ctx) {
1916
1800
  readSupabaseEnv();
@@ -1925,15 +1809,15 @@ async function mRAG_ingest(input, ctx) {
1925
1809
  });
1926
1810
  return { indexed: data.indexed ?? 0, chunk_count: data.chunk_count ?? 0 };
1927
1811
  }
1928
- var mRAG_list_sources_input = z12.object({});
1812
+ var mRAG_list_sources_input = z10.object({});
1929
1813
  async function mRAG_list_sources(_input, ctx) {
1930
1814
  readSupabaseEnv();
1931
1815
  ctx.log("debug", "mRAG_list_sources via rag-sources");
1932
1816
  return await invokeFunction("rag-sources", { action: "list" });
1933
1817
  }
1934
- var mRAG_delete_input = z12.object({
1935
- source_id: z12.string().optional().describe("Delete every indexed chunk with this source_id (from mRAG_list_sources)."),
1936
- thread_id: z12.string().optional().describe("Delete every indexed chunk associated with this thread_id.")
1818
+ var mRAG_delete_input = z10.object({
1819
+ source_id: z10.string().optional().describe("Delete every indexed chunk with this source_id (from mRAG_list_sources)."),
1820
+ thread_id: z10.string().optional().describe("Delete every indexed chunk associated with this thread_id.")
1937
1821
  }).refine((v) => v.source_id || v.thread_id, {
1938
1822
  message: "Provide source_id or thread_id \u2014 mRAG_delete refuses to purge the whole index."
1939
1823
  });
@@ -1978,34 +1862,34 @@ var knowledgeTools = [
1978
1862
  ];
1979
1863
 
1980
1864
  // src/tools/actions.ts
1981
- import { z as z13 } from "zod";
1982
- var formField = z13.object({
1983
- name: z13.string().min(1).max(60).describe("Field key \u2014 returned verbatim in the result."),
1984
- label: z13.string().max(120).optional().describe("Human label shown to the recipient. Defaults to `name`."),
1985
- type: z13.enum(["text", "email", "number", "textarea", "tel", "url"]).optional().describe("Input type. Default 'text'."),
1986
- required: z13.boolean().optional().describe("Whether the recipient must fill this field.")
1865
+ import { z as z11 } from "zod";
1866
+ var formField = z11.object({
1867
+ name: z11.string().min(1).max(60).describe("Field key \u2014 returned verbatim in the result."),
1868
+ label: z11.string().max(120).optional().describe("Human label shown to the recipient. Defaults to `name`."),
1869
+ type: z11.enum(["text", "email", "number", "textarea", "tel", "url"]).optional().describe("Input type. Default 'text'."),
1870
+ required: z11.boolean().optional().describe("Whether the recipient must fill this field.")
1987
1871
  });
1988
- var action_create_input = z13.object({
1989
- action_type: z13.enum(["confirm", "file_request", "form", "open_url", "screen_share"]).describe(
1872
+ var action_create_input = z11.object({
1873
+ action_type: z11.enum(["confirm", "file_request", "form", "open_url", "screen_share"]).describe(
1990
1874
  "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
1875
  ),
1992
- message: z13.string().min(1).max(2e3).describe("What you're asking \u2014 shown on the consent screen above the action UI."),
1993
- creator_label: z13.string().max(80).optional().describe("How you're identified to the recipient (e.g. your agent name). Default 'Agent'."),
1876
+ message: z11.string().min(1).max(2e3).describe("What you're asking \u2014 shown on the consent screen above the action UI."),
1877
+ creator_label: z11.string().max(80).optional().describe("How you're identified to the recipient (e.g. your agent name). Default 'Agent'."),
1994
1878
  // confirm
1995
- yes_label: z13.string().max(40).optional().describe("[confirm] Affirmative button label. Default 'Tak'."),
1996
- no_label: z13.string().max(40).optional().describe("[confirm] Negative button label. Default 'Nie'."),
1879
+ yes_label: z11.string().max(40).optional().describe("[confirm] Affirmative button label. Default 'Tak'."),
1880
+ no_label: z11.string().max(40).optional().describe("[confirm] Negative button label. Default 'Nie'."),
1997
1881
  // file_request
1998
- accept: z13.string().max(200).optional().describe("[file_request] Accepted file types (HTML accept attr, e.g. 'image/*,.pdf')."),
1999
- max_bytes: z13.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."),
1882
+ accept: z11.string().max(200).optional().describe("[file_request] Accepted file types (HTML accept attr, e.g. 'image/*,.pdf')."),
1883
+ 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
1884
  // form
2001
- fields: z13.array(formField).min(1).max(20).optional().describe("[form] Fields to collect from the recipient."),
1885
+ fields: z11.array(formField).min(1).max(20).optional().describe("[form] Fields to collect from the recipient."),
2002
1886
  // open_url
2003
- url: z13.string().url().optional().describe("[open_url] The https URL to open. The full URL is shown to the recipient before they open it."),
1887
+ 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
1888
  // screen_share
2005
- max_width: z13.number().int().positive().max(1920).optional().describe("[screen_share] Max captured frame width in px (default 1280). Frames are downscaled JPEGs."),
1889
+ 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
1890
  // lifecycle
2007
- ttl_ms: z13.number().int().positive().optional().describe("Link lifetime in milliseconds. Default 24h, capped at 7d."),
2008
- max_uses: z13.number().int().min(1).max(50).optional().describe("How many times the link can be redeemed. Default 1 (single-use).")
1891
+ ttl_ms: z11.number().int().positive().optional().describe("Link lifetime in milliseconds. Default 24h, capped at 7d."),
1892
+ max_uses: z11.number().int().min(1).max(50).optional().describe("How many times the link can be redeemed. Default 1 (single-use).")
2009
1893
  });
2010
1894
  function buildParams(input) {
2011
1895
  switch (input.action_type) {
@@ -2046,8 +1930,8 @@ async function action_create(input, ctx) {
2046
1930
  expires_at: res.expires_at ?? ""
2047
1931
  };
2048
1932
  }
2049
- var action_frame_get_input = z13.object({
2050
- action_id: z13.string().min(1).describe("The action_id returned by comms_action_create for a 'screen_share' action you created.")
1933
+ var action_frame_get_input = z11.object({
1934
+ action_id: z11.string().min(1).describe("The action_id returned by comms_action_create for a 'screen_share' action you created.")
2051
1935
  });
2052
1936
  async function action_frame_get(input, ctx) {
2053
1937
  readSupabaseEnv();
@@ -2087,67 +1971,68 @@ var actionTools = [
2087
1971
  }
2088
1972
  ];
2089
1973
 
2090
- // src/tools/embed.ts
2091
- import { z as z14 } from "zod";
2092
- var EMBED_CDN = (process.env.MOSADD_EMBED_CDN ?? "https://embed.mosadd.com").replace(/\/+$/, "");
2093
- var POSITIONS = ["inline", "sidebar-left", "sidebar-right", "floating-bl", "floating-br", "fullscreen"];
2094
- var SKINS = ["default", "retro-irc-1990", "terminal", "minimal-dark", "minimal-light"];
2095
- var embed_create_input = z14.object({
2096
- channel: z14.string().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/).describe("The mIRC channel id everyone on the embed shares (e.g. 'acme-support'). Auto-created on first message if new."),
2097
- allowed_origins: z14.array(z14.string().min(1)).min(1).max(10).describe("REQUIRED. Domain(s) where the widget will be served \u2014 the key only works from these origins. Use the host(s) of the app you're building, e.g. ['app.acme.com','*.acme.com']. For local testing use mode:'test' and e.g. 'localhost:3000'."),
2098
- name: z14.string().max(64).optional().describe("Label for the key in the owner's dashboard. Default 'embed: <channel>'."),
2099
- position: z14.enum(POSITIONS).optional().describe("Where the widget renders. Default 'inline'."),
2100
- skin: z14.enum(SKINS).optional().describe("Visual skin. Default 'default' (mosadd-branded retro mIRC)."),
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'.")
1974
+ // src/tools/threat.ts
1975
+ import { z as z12 } from "zod";
1976
+ import {
1977
+ THREAT_EVENTS,
1978
+ THREAT_EVENT_COUNT,
1979
+ evaluateEvent,
1980
+ getEventDef
1981
+ } from "@mosadd/threat-engine";
1982
+ var threat_catalog_input = z12.object({
1983
+ 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."),
1984
+ platform: z12.enum(["apk", "ios", "pwa", "harmony"]).optional().describe("Filter to events detectable on this platform. Omit for all platforms.")
2105
1985
  });
2106
- var attrSafe = (s) => s.replace(/["'<>]/g, "");
2107
- function buildSnippet(input, key) {
2108
- const attrs = [`data-channel="${attrSafe(input.channel)}"`, `data-position="${input.position ?? "inline"}"`];
2109
- if (input.skin) attrs.push(`data-skin="${input.skin}"`);
2110
- if (input.title) attrs.push(`data-title="${attrSafe(input.title)}"`);
2111
- if (input.anon === false) attrs.push(`data-anon="false"`);
2112
- if (input.locale) attrs.push(`data-locale="${input.locale}"`);
2113
- return `<div id="mosadd-mirc" ${attrs.join(" ")}></div>
2114
- <script src="${EMBED_CDN}/v1.js" data-key="${key}"></script>`;
2115
- }
2116
- async function embed_create(input, ctx) {
2117
- readSupabaseEnv();
2118
- ctx.log("debug", "comms_embed_create minting embed key", { channel: input.channel, origins: input.allowed_origins.length });
2119
- const res = await invokeFunction("embed-keys", {
2120
- name: input.name ?? `embed: ${input.channel}`,
2121
- channels: [input.channel],
2122
- allowed_origins: input.allowed_origins,
2123
- mode: input.mode ?? "live"
2124
- });
2125
- if (res.error) throw new Error(res.error);
2126
- if (!res.key) throw new Error("embed-keys returned no publishable key (missing `key`).");
2127
- return {
2128
- embed_key: res.key,
2129
- channel: input.channel,
2130
- allowed_origins: input.allowed_origins,
2131
- snippet: buildSnippet(input, res.key)
2132
- };
1986
+ async function threat_catalog(input, _ctx) {
1987
+ let events = THREAT_EVENTS;
1988
+ if (input.category) events = events.filter((e) => e.category === input.category);
1989
+ if (input.platform) events = events.filter((e) => e.platforms.includes(input.platform));
1990
+ return { count: events.length, total: THREAT_EVENT_COUNT, events };
1991
+ }
1992
+ var threat_classify_input = z12.object({
1993
+ event_type: z12.string().min(1).max(120).describe('Event type to classify, e.g. "SIM_SWAP", "AUTH_BRUTEFORCE", "TOLL_FRAUD". Case-insensitive.'),
1994
+ severity: z12.string().optional().describe('Optional producer severity hint. "killswitch" \u2192 lock_account; "critical" \u2192 revoke_sessions; anything else is informational.'),
1995
+ details: z12.string().max(2e3).optional().describe("Optional free-text context (informational only).")
1996
+ });
1997
+ async function threat_classify(input, _ctx) {
1998
+ const def = getEventDef(String(input.event_type).toUpperCase());
1999
+ if (def) {
2000
+ return {
2001
+ action: "monitor",
2002
+ severity: def.severity,
2003
+ reason: `${def.label} (${def.category}) \u2014 classified from the mosadd threat taxonomy. Monitor-only: surfaced for you to act on, no automatic action taken.`,
2004
+ known_event: true,
2005
+ category: def.category,
2006
+ label: def.label
2007
+ };
2008
+ }
2009
+ const decision = evaluateEvent({ eventType: input.event_type, severity: input.severity, details: input.details });
2010
+ return { ...decision, known_event: false, category: null, label: null };
2133
2011
  }
2134
- var embedTools = [
2012
+ var threatTools = [
2135
2013
  {
2136
- name: "comms_embed_create",
2137
- requires: "network",
2138
- description: "Embed a LIVE mosadd chat channel into an app/site you're building (great for builder-agents on Lovable/Bolt/Cursor/v0). Mints a publishable embed key scoped to a channel + the app's domain(s) and returns a ready-to-paste HTML snippet (a <div> + <script src=embed.mosadd.com/v1.js data-key=\u2026>). Visitors of the host page chat in real time (anonymous nick or mosadd login). REQUIRES `allowed_origins` \u2014 the domain(s) the app is served from (the key only works there). The publishable key is browser-safe (mints only channel-scoped JWTs); your hub key never leaves the server. Returns { embed_key, channel, allowed_origins, snippet }.",
2139
- inputSchema: embed_create_input,
2140
- handler: embed_create
2014
+ name: "threat_catalog",
2015
+ requires: "any",
2016
+ 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.",
2017
+ inputSchema: threat_catalog_input,
2018
+ handler: threat_catalog
2019
+ },
2020
+ {
2021
+ name: "threat_classify",
2022
+ requires: "any",
2023
+ 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.`,
2024
+ inputSchema: threat_classify_input,
2025
+ handler: threat_classify
2141
2026
  }
2142
2027
  ];
2143
2028
 
2144
2029
  // src/tools/murl.ts
2145
- import { z as z15 } from "zod";
2030
+ import { z as z13 } from "zod";
2146
2031
  var DEFAULT_EDGE_URL2 = "https://mosadd-edge.mr-brics-33.workers.dev";
2147
2032
  function edgeUrl2() {
2148
2033
  return process.env.MOSADD_EDGE_URL?.replace(/\/$/, "") ?? DEFAULT_EDGE_URL2;
2149
2034
  }
2150
- function hubKey3() {
2035
+ function hubKey2() {
2151
2036
  const key = process.env.MOSADD_API_KEY ?? process.env.MOSADD_HUB_KEY ?? "";
2152
2037
  if (!key) throw new Error("MOSADD_API_KEY required for mURL tools (see `mosadd login` / hub-keys).");
2153
2038
  return key;
@@ -2165,17 +2050,17 @@ function urlToSlug(input) {
2165
2050
  const base = host.replace(/\./g, "-");
2166
2051
  return { domain: host, slug: segs.length ? `${base}__${segs.join("__")}` : base };
2167
2052
  }
2168
- var DomainArg = z15.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.");
2169
- var mURL_read_channel_input = z15.object({
2053
+ 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.");
2054
+ var mURL_read_channel_input = z13.object({
2170
2055
  domain: DomainArg,
2171
- limit: z15.number().int().min(1).max(100).optional().describe("Recent messages to return (max 100). Default 50.")
2056
+ limit: z13.number().int().min(1).max(100).optional().describe("Recent messages to return (max 100). Default 50.")
2172
2057
  });
2173
2058
  async function mURL_read_channel(input, ctx) {
2174
2059
  const { domain, slug: slug2 } = urlToSlug(input.domain);
2175
2060
  const limit = input.limit ?? 50;
2176
2061
  ctx.log("debug", "mURL_read_channel", { domain });
2177
2062
  const r = await fetch(`${edgeUrl2()}/c/${slug2}/history?limit=${limit}`, {
2178
- headers: { Authorization: `Bearer ${hubKey3()}` }
2063
+ headers: { Authorization: `Bearer ${hubKey2()}` }
2179
2064
  });
2180
2065
  if (!r.ok) {
2181
2066
  const e = await r.text().catch(() => "");
@@ -2187,17 +2072,17 @@ async function mURL_read_channel(input, ctx) {
2187
2072
  messages: (data.messages ?? []).map((m) => ({ id: m.id, from: m.from ?? null, text: m.text, timestamp: m.ts }))
2188
2073
  };
2189
2074
  }
2190
- var mURL_post_input = z15.object({
2075
+ var mURL_post_input = z13.object({
2191
2076
  domain: DomainArg,
2192
- text: z15.string().min(1).max(2e3).describe("Message body (max 2000 chars, up to 3 lines \u2014 Worker-enforced)."),
2193
- from: z15.string().max(120).optional().describe("Sender hint shown to others (defaults to the hub-key owner / your agent name).")
2077
+ text: z13.string().min(1).max(2e3).describe("Message body (max 2000 chars, up to 3 lines \u2014 Worker-enforced)."),
2078
+ from: z13.string().max(120).optional().describe("Sender hint shown to others (defaults to the hub-key owner / your agent name).")
2194
2079
  });
2195
2080
  async function mURL_post(input, ctx) {
2196
2081
  const { domain, slug: slug2 } = urlToSlug(input.domain);
2197
2082
  ctx.log("debug", "mURL_post", { domain });
2198
2083
  const r = await fetch(`${edgeUrl2()}/c/${slug2}/send`, {
2199
2084
  method: "POST",
2200
- headers: { "Content-Type": "application/json", Authorization: `Bearer ${hubKey3()}` },
2085
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${hubKey2()}` },
2201
2086
  body: JSON.stringify({ text: input.text, from: input.from })
2202
2087
  });
2203
2088
  if (!r.ok) {
@@ -2208,12 +2093,12 @@ async function mURL_post(input, ctx) {
2208
2093
  if (!data?.id) throw new Error("mosadd-edge: send returned no id");
2209
2094
  return { domain, message_id: data.id, posted_at: data.ts ?? Date.now() };
2210
2095
  }
2211
- var mURL_list_channels_input = z15.object({
2212
- action: z15.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)."),
2213
- limit: z15.number().int().min(1).max(100).optional().describe("Max channels to return. Default 20."),
2214
- hours: z15.number().int().min(1).max(168).optional().describe("Trending window in hours. Default 24, max 168 (7d)."),
2215
- status: z15.enum(["open", "claimed", "blocked"]).optional().describe("For action='list': filter (default 'open')."),
2216
- cursor: z15.string().optional().describe("For action='list': pagination \u2014 pass previous response's next_cursor (created_at ISO).")
2096
+ var mURL_list_channels_input = z13.object({
2097
+ 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)."),
2098
+ limit: z13.number().int().min(1).max(100).optional().describe("Max channels to return. Default 20."),
2099
+ hours: z13.number().int().min(1).max(168).optional().describe("Trending window in hours. Default 24, max 168 (7d)."),
2100
+ status: z13.enum(["open", "claimed", "blocked"]).optional().describe("For action='list': filter (default 'open')."),
2101
+ cursor: z13.string().optional().describe("For action='list': pagination \u2014 pass previous response's next_cursor (created_at ISO).")
2217
2102
  });
2218
2103
  async function mURL_list_channels(input, ctx) {
2219
2104
  readSupabaseEnv();
@@ -2227,7 +2112,7 @@ async function mURL_list_channels(input, ctx) {
2227
2112
  cursor: input.cursor ?? null
2228
2113
  });
2229
2114
  }
2230
- var mURL_presence_input = z15.object({ domain: DomainArg });
2115
+ var mURL_presence_input = z13.object({ domain: DomainArg });
2231
2116
  async function mURL_presence(input, ctx) {
2232
2117
  const { domain, slug: slug2 } = urlToSlug(input.domain);
2233
2118
  ctx.log("debug", "mURL_presence", { domain });
@@ -2271,7 +2156,7 @@ var murlTools = [
2271
2156
  ];
2272
2157
 
2273
2158
  // src/tools/capabilities.ts
2274
- import { z as z16 } from "zod";
2159
+ import { z as z14 } from "zod";
2275
2160
  var CONTRACT_VERSION = "1.0.0";
2276
2161
  var ALL_REQUIREMENTS = ["any", "radio", "network"];
2277
2162
  function buildCapabilityManifest(tools) {
@@ -2294,7 +2179,7 @@ function makeCapabilitiesTool(channelTools2) {
2294
2179
  name: "comms_capabilities",
2295
2180
  requires: "any",
2296
2181
  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: z16.object({}),
2182
+ inputSchema: z14.object({}),
2298
2183
  handler: async () => buildCapabilityManifest([...channelTools2, tool])
2299
2184
  };
2300
2185
  return tool;
@@ -2313,23 +2198,17 @@ var channelTools = [
2313
2198
  ...mailTools,
2314
2199
  // mAYL_*: canonical email module (was mp0st_*; renamed re-arch 2026-06-27)
2315
2200
  ...mailAliasTools,
2316
- // mp0st_*: back-compat aliases — DEPRECATED, removed in alpha.27
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.
2201
+ // mp0st_*: back-compat aliases — DEPRECATED, removed in a later alpha
2202
+ // ...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
2203
  ...mtalkTools,
2322
2204
  ...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.
2205
+ // ...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
2206
  ...knowledgeTools,
2328
2207
  ...actionTools,
2329
2208
  // Action links (Tier 1): agent → user one-link browser action via action-create EF
2330
- ...embedTools,
2331
- // comms_embed_create: P5.1 / LINEAR-4002 — EFs live, widget at embed.mosadd.com awaits owner-deploy
2332
- // ...threatTools, // UNREGISTERED 2026-06-27 — killed direction; source kept for archival
2209
+ // ...embedTools, // comms_embed_create: UNREGISTERED 2026-07-14 — widget backend not live e2e; re-register when embed.mosadd.com ships (CTO-1 live-ping)
2210
+ ...threatTools,
2211
+ // 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
2212
  ...murlTools
2334
2213
  // mURL: revived as a full module (founder 2026-06-27) — read/post/presence/list_channels over live domain channels
2335
2214
  // ...mcallTools, // mCALL: carrier-pending (no telephony carrier live) — re-register when a carrier is configured
@@ -2508,7 +2387,7 @@ function createMosaddServer(options = {}) {
2508
2387
  const server = new McpServer(
2509
2388
  {
2510
2389
  name: "mosadd",
2511
- version: "3.0.0-alpha.0"
2390
+ version: "3.0.0-alpha.27"
2512
2391
  },
2513
2392
  {
2514
2393
  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.27).
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_* UNREGISTERED — surveillance-
210
- * era direction is dead (decision_killed_directions).
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
- * 76 callable tools at registration:
213
- * mDM 14 + mIRC 22 + mURL 4 + mAYL 11 (= 51 module tools) +
214
- * mTALK 5 + mRAG 4 + comms_ 3 (= 12 capability tools) +
215
- * mp0st_* 11 back-compat aliases + comms_capabilities (1) = 76.
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 consumer/brand surface (murl.mosadd.com), NOT a dev product — its tools
221
- * live in tools/murl.ts but are NOT registered here (founder decision 2026-06-10).
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
@@ -3,7 +3,7 @@ import {
3
3
  createMosaddServer,
4
4
  defaultProviders,
5
5
  runWithSupabaseEnv
6
- } from "./chunk-YBSQUORF.js";
6
+ } from "./chunk-EE7UQFSI.js";
7
7
  import "./chunk-Z7WR52GE.js";
8
8
  export {
9
9
  allTools,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@mosadd/mcp",
3
- "version": "3.0.0-alpha.26",
3
+ "version": "3.0.0-alpha.27",
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 — 74 tools (mp0st_* aliases through alpha.26) — to any agent runtime (Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, custom).",
5
+ "description": "Model Context Protocol server for mosadd. Exposes 4 modules (mDM, mIRC, mURL, mAYL) and capabilities (mTALK, mRAG) plus comms agent-actions — 70+ tools (mp0st_* aliases for back-compat) — 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,10 +38,10 @@
38
38
  "@modelcontextprotocol/sdk": "^1.0.4",
39
39
  "@supabase/supabase-js": "^2.48.0",
40
40
  "zod": "^4.3.6",
41
- "@mosadd/crypto": "3.0.0-alpha.26",
42
41
  "@mosadd/threat-engine": "3.0.0-alpha.26",
42
+ "@mosadd/providers": "3.0.0-alpha.26",
43
43
  "@mosadd/protocol": "3.0.0-alpha.26",
44
- "@mosadd/providers": "3.0.0-alpha.26"
44
+ "@mosadd/crypto": "3.0.0-alpha.26"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.3.5",
@@ -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("threat_classify"); // threat engine exposed (LINEAR-3498); mROOM killed (LINEAR-3414)
141
- expect(names).toContain("mp0st_send");
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).toContain("mp0st_send"); // deprecated back-compat alias
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,10 +15,11 @@ describe("@mosadd/mcp", () => {
15
15
  // mIRC (5 tools)
16
16
  expect(names).toContain("mIRC_create");
17
17
  expect(names).toContain("mIRC_delete");
18
- // threat engine (LINEAR-3498) — mROOM killed (LINEAR-3414)
19
- expect(names).toContain("threat_catalog");
20
- expect(names).toContain("threat_classify");
21
- // mp0st (2 tools)
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_* remain as deprecated back-compat aliases for mAYL_*
22
23
  expect(names).toContain("mp0st_send");
23
24
  expect(names).toContain("mp0st_view");
24
25
  });
package/src/server.ts CHANGED
@@ -60,7 +60,7 @@ export function createMosaddServer(options: MosaddServerOptions = {}) {
60
60
  const server = new McpServer(
61
61
  {
62
62
  name: "mosadd",
63
- version: "3.0.0-alpha.0",
63
+ version: "3.0.0-alpha.27",
64
64
  },
65
65
  {
66
66
  capabilities: {
@@ -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.27).
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_* UNREGISTERED — surveillance-
11
- * era direction is dead (decision_killed_directions).
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
- * 76 callable tools at registration:
14
- * mDM 14 + mIRC 22 + mURL 4 + mAYL 11 (= 51 module tools) +
15
- * mTALK 5 + mRAG 4 + comms_ 3 (= 12 capability tools) +
16
- * mp0st_* 11 back-compat aliases + comms_capabilities (1) = 76.
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 consumer/brand surface (murl.mosadd.com), NOT a dev product — its tools
22
- * live in tools/murl.ts but are NOT registered here (founder decision 2026-06-10).
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.
@@ -36,16 +40,15 @@ import { mircEdgeTools } from "./mirc-edge.js";
36
40
  // import { mroomMessagesTools } from "./mroom-messages.js"; // mROOM: killed (LINEAR-3414) — not registered
37
41
  import { mailTools } from "./mail.js";
38
42
  import { mailAliasTools } from "./mail-aliases.js"; // mp0st_* back-compat aliases for mAYL_*
39
- import { mailProvenanceTools } from "./mail-provenance.js"; // mAYL_send_as_agent — LINEAR-3991
40
- // import { mailProvenanceTools } from "./mail-provenance.js"; // scaffold (mp0st_send_as_agent) — not registered, see below
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"; // P4.1 / LINEAR-3998 — body aligned to deployed ptt-ingest EF
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"; // P5.1 / LINEAR-4002 — embed-keys + mirc-embed-token deployed to prod 2026-06-27. Widget at embed.mosadd.com still owner-deploy (separate Vercel project).
48
- // import { threatTools } from "./threat.js"; // threat_*: UNREGISTERED 2026-06-27 (re-arch). Surveillance-era direction killed; source kept for archival.
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
 
@@ -60,19 +63,15 @@ const channelTools: MosaddTool[] = [
60
63
  // ...mroomTools, // mROOM: killed (LINEAR-3414) — channel re-cut into ephemeral private mIRC
61
64
  // ...mroomMessagesTools, // mROOM: killed (LINEAR-3414)
62
65
  ...mailTools, // mAYL_*: canonical email module (was mp0st_*; renamed re-arch 2026-06-27)
63
- ...mailAliasTools, // mp0st_*: back-compat aliases — DEPRECATED, removed in alpha.27
64
- ...mailProvenanceTools, // mAYL_send_as_agent: agent-attributed mail send via hub-claim-mint (LINEAR-3991)
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.
66
+ ...mailAliasTools, // mp0st_*: back-compat aliases — DEPRECATED, removed in a later alpha
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: P4.1 / LINEAR-3998 — body aligned to deployed ptt-ingest EF
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: P5.1 / LINEAR-4002 — EFs live, widget at embed.mosadd.com awaits owner-deploy
75
- // ...threatTools, // UNREGISTERED 2026-06-27 — killed direction; source kept for archival
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 alpha.27 release notes.
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.27.] ` +
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 mp0st_send or inbox.");
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 mp0st_view to read a full message body.",
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 mp0st_list). Soft-delete — it stops showing in mp0st_list. Owner-scoped: only your own mail.",
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 mp0st_stats for the rollup; use this for the per-event detail. Owner-scoped.",
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; mp0st_send then automatically sends them with NO pixel/link-wrap. Owner-scoped.",
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
  },
@@ -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<{ action: string; severity: string; reason: string }> {
70
- return evaluateEvent({ eventType: input.event_type, severity: input.severity, details: input.details });
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 with the pure mosadd DECK decision engine and get a defensive recommendation: { action (log_only|revoke_sessions|lock_account|suspend_did), severity, reason }. Deterministic, side-effect-free, no backend — the engine DECIDES; the caller carries out the action. Use to evaluate a threat event you already observed.",
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
  },