@mosadd/mcp 3.0.0-alpha.24 → 3.0.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/mcp.js +1 -1
- package/dist/{chunk-S6OWXISZ.js → chunk-YBSQUORF.js} +287 -143
- package/dist/index.d.ts +13 -2
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/src/tools/index.ts +24 -12
- package/src/tools/mail-aliases.ts +25 -0
- package/src/tools/mail-provenance.ts +22 -24
- package/src/tools/mail.ts +11 -11
- package/src/tools/murl.ts +27 -13
- package/src/tools/ptt-ingest.ts +58 -53
|
@@ -1386,77 +1386,77 @@ async function mp0st_notify(input, ctx) {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
var mailTools = [
|
|
1388
1388
|
{
|
|
1389
|
-
name: "
|
|
1389
|
+
name: "mAYL_list",
|
|
1390
1390
|
requires: "network",
|
|
1391
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.",
|
|
1392
1392
|
inputSchema: mp0st_list_input,
|
|
1393
1393
|
handler: mp0st_list
|
|
1394
1394
|
},
|
|
1395
1395
|
{
|
|
1396
|
-
name: "
|
|
1396
|
+
name: "mAYL_send",
|
|
1397
1397
|
requires: "network",
|
|
1398
1398
|
description: "Send an email from the user's mosadd address (<userId>@mosadd.com). Pass body_text or body_html (or both). Supports cc, bcc, reply_to. Monitoring/legal options: tracking (open+click, default on; set false for no tracking), force_reader (stub email \u2192 recipient opens in mosadd's secure reader, unlocking print/copy/time-on-read tracking + revoke), watermark (recipient watermark visible in screenshots/prints), disclose_tracking (GDPR footer), auto_destruct ('1h'|'24h'|'7d').",
|
|
1399
1399
|
inputSchema: mp0st_send_input,
|
|
1400
1400
|
handler: mp0st_send
|
|
1401
1401
|
},
|
|
1402
1402
|
{
|
|
1403
|
-
name: "
|
|
1403
|
+
name: "mAYL_view",
|
|
1404
1404
|
requires: "network",
|
|
1405
1405
|
description: "Read the full body and metadata of an email by message_id.",
|
|
1406
1406
|
inputSchema: mp0st_view_input,
|
|
1407
1407
|
handler: mp0st_view
|
|
1408
1408
|
},
|
|
1409
1409
|
{
|
|
1410
|
-
name: "
|
|
1410
|
+
name: "mAYL_delete",
|
|
1411
1411
|
requires: "network",
|
|
1412
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.",
|
|
1413
1413
|
inputSchema: mp0st_delete_input,
|
|
1414
1414
|
handler: mp0st_delete
|
|
1415
1415
|
},
|
|
1416
1416
|
{
|
|
1417
|
-
name: "
|
|
1417
|
+
name: "mAYL_stats",
|
|
1418
1418
|
requires: "network",
|
|
1419
1419
|
description: "Engagement summary for one sent email (by message_id): open_count, unique_opens, click_count, whether it was likely forwarded, first/last opened time, and a breakdown of tracked event types. Opens/clicks are real (tracking pixel + link-wrap); forward detection is best-effort (IP-subnet diversity). Owner-scoped.",
|
|
1420
1420
|
inputSchema: mp0st_stats_input,
|
|
1421
1421
|
handler: mp0st_stats
|
|
1422
1422
|
},
|
|
1423
1423
|
{
|
|
1424
|
-
name: "
|
|
1424
|
+
name: "mAYL_events",
|
|
1425
1425
|
requires: "network",
|
|
1426
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.",
|
|
1427
1427
|
inputSchema: mp0st_events_input,
|
|
1428
1428
|
handler: mp0st_events
|
|
1429
1429
|
},
|
|
1430
1430
|
{
|
|
1431
|
-
name: "
|
|
1431
|
+
name: "mAYL_metrics",
|
|
1432
1432
|
requires: "network",
|
|
1433
1433
|
description: "Mailbox-wide engagement aggregate across the user's sent mail: total_sent, opened_emails, open_rate_pct, total_opens, total_clicks, forwarded_emails. Owner-scoped.",
|
|
1434
1434
|
inputSchema: mp0st_metrics_input,
|
|
1435
1435
|
handler: mp0st_metrics
|
|
1436
1436
|
},
|
|
1437
1437
|
{
|
|
1438
|
-
name: "
|
|
1438
|
+
name: "mAYL_revoke",
|
|
1439
1439
|
requires: "network",
|
|
1440
1440
|
description: "Revoke (recall) a sent email's secure-reader access by message_id \u2014 the recipient can no longer open the full message via the mosadd reader link (Virtru-style recall, immediate). Pass restore:true to re-enable. HONEST LIMIT: cannot un-send or claw back content the recipient already read, copied, or screenshotted \u2014 only disables future reader access. Owner-scoped.",
|
|
1441
1441
|
inputSchema: mp0st_revoke_input,
|
|
1442
1442
|
handler: mp0st_revoke
|
|
1443
1443
|
},
|
|
1444
1444
|
{
|
|
1445
|
-
name: "
|
|
1445
|
+
name: "mAYL_audit_export",
|
|
1446
1446
|
requires: "network",
|
|
1447
1447
|
description: "Export a tamper-evident engagement audit report for one sent email (RMail-style): full event trail (opens, clicks, reader print/copy/forward signals) + totals, plus an HMAC-SHA256 signature over the canonical JSON so the report can be proven unaltered. For legal/compliance use. HONEST LIMIT: proves what mosadd observed; it is not a qualified delivery receipt (ERDS). Owner-scoped.",
|
|
1448
1448
|
inputSchema: mp0st_audit_export_input,
|
|
1449
1449
|
handler: mp0st_audit_export
|
|
1450
1450
|
},
|
|
1451
1451
|
{
|
|
1452
|
-
name: "
|
|
1452
|
+
name: "mAYL_consent",
|
|
1453
1453
|
requires: "network",
|
|
1454
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.",
|
|
1455
1455
|
inputSchema: mp0st_consent_input,
|
|
1456
1456
|
handler: mp0st_consent
|
|
1457
1457
|
},
|
|
1458
1458
|
{
|
|
1459
|
-
name: "
|
|
1459
|
+
name: "mAYL_notify",
|
|
1460
1460
|
requires: "network",
|
|
1461
1461
|
description: "Recent engagement feed across ALL your sent mail \u2014 the 'who just opened/clicked my mail' notifications stream (opens, clicks, forwards, reader print/copy signals), newest first, each with the email subject + recipient. Poll: pass the returned `cursor` back as `since` to get only new activity. Owner-scoped.",
|
|
1462
1462
|
inputSchema: mp0st_notify_input,
|
|
@@ -1464,17 +1464,99 @@ var mailTools = [
|
|
|
1464
1464
|
}
|
|
1465
1465
|
];
|
|
1466
1466
|
|
|
1467
|
-
// src/tools/
|
|
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
|
|
1468
1475
|
import { z as z8 } from "zod";
|
|
1469
|
-
var
|
|
1470
|
-
|
|
1471
|
-
|
|
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
|
+
// 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({
|
|
1472
1554
|
label: RoomLabel.optional().describe("Optional label; defaults to a personal room.")
|
|
1473
1555
|
});
|
|
1474
|
-
var mTALK_join_input =
|
|
1475
|
-
var mTALK_press_input =
|
|
1476
|
-
var mTALK_release_input =
|
|
1477
|
-
var mTALK_state_input =
|
|
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 });
|
|
1478
1560
|
async function mTALK_open(input, ctx) {
|
|
1479
1561
|
const { roomId } = await ctx.providers.voice.createRoom(input.label);
|
|
1480
1562
|
ctx.log("debug", "mTALK_open", { room_id: roomId });
|
|
@@ -1538,7 +1620,7 @@ var mtalkTools = [
|
|
|
1538
1620
|
];
|
|
1539
1621
|
|
|
1540
1622
|
// src/tools/attachments.ts
|
|
1541
|
-
import { z as
|
|
1623
|
+
import { z as z10 } from "zod";
|
|
1542
1624
|
|
|
1543
1625
|
// src/providers/blob-upload.ts
|
|
1544
1626
|
function defaultBucket(kind) {
|
|
@@ -1588,14 +1670,14 @@ function decodeBase64Body(b64) {
|
|
|
1588
1670
|
|
|
1589
1671
|
// src/tools/attachments.ts
|
|
1590
1672
|
var PROTOCOL_VERSION4 = "mosadd.chat.v1";
|
|
1591
|
-
var Base64Body =
|
|
1592
|
-
var Mime =
|
|
1593
|
-
var DurationMs =
|
|
1594
|
-
var Filename =
|
|
1595
|
-
var ReplyTo =
|
|
1596
|
-
var ContactRef3 =
|
|
1597
|
-
var RoomId3 =
|
|
1598
|
-
var ThreadLabel =
|
|
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).");
|
|
1599
1681
|
function dmThreadId3(selfId, otherId, label) {
|
|
1600
1682
|
const [a, b] = [selfId, otherId].sort();
|
|
1601
1683
|
return label ? `dm:${a}:${b}:${label}` : `dm:${a}:${b}`;
|
|
@@ -1638,21 +1720,21 @@ async function resolveLinkedSpaceId2(channelId) {
|
|
|
1638
1720
|
if (!spaceId) throw new Error(`Channel ${channelId} has no linked space yet \u2014 run mIRC_join/mIRC_list first or pass space_id.`);
|
|
1639
1721
|
return spaceId;
|
|
1640
1722
|
}
|
|
1641
|
-
var mDM_send_voice_input =
|
|
1723
|
+
var mDM_send_voice_input = z10.object({
|
|
1642
1724
|
to: ContactRef3,
|
|
1643
1725
|
audio_base64: Base64Body,
|
|
1644
1726
|
mime: Mime.default("audio/ogg"),
|
|
1645
1727
|
duration_ms: DurationMs,
|
|
1646
|
-
caption:
|
|
1728
|
+
caption: z10.string().max(2e3).optional(),
|
|
1647
1729
|
thread_label: ThreadLabel,
|
|
1648
1730
|
reply_to_id: ReplyTo
|
|
1649
1731
|
});
|
|
1650
|
-
var mDM_send_file_input =
|
|
1732
|
+
var mDM_send_file_input = z10.object({
|
|
1651
1733
|
to: ContactRef3,
|
|
1652
1734
|
file_base64: Base64Body,
|
|
1653
1735
|
filename: Filename,
|
|
1654
1736
|
mime: Mime,
|
|
1655
|
-
caption:
|
|
1737
|
+
caption: z10.string().max(2e3).optional(),
|
|
1656
1738
|
thread_label: ThreadLabel,
|
|
1657
1739
|
reply_to_id: ReplyTo
|
|
1658
1740
|
});
|
|
@@ -1698,23 +1780,23 @@ async function mDM_send_file(input, ctx) {
|
|
|
1698
1780
|
recipient_account_id: input.to
|
|
1699
1781
|
});
|
|
1700
1782
|
}
|
|
1701
|
-
var mIRC_send_voice_input =
|
|
1783
|
+
var mIRC_send_voice_input = z10.object({
|
|
1702
1784
|
channel_id: RoomId3,
|
|
1703
1785
|
audio_base64: Base64Body,
|
|
1704
1786
|
mime: Mime.default("audio/ogg"),
|
|
1705
1787
|
duration_ms: DurationMs,
|
|
1706
|
-
caption:
|
|
1788
|
+
caption: z10.string().max(2e3).optional(),
|
|
1707
1789
|
reply_to_id: ReplyTo,
|
|
1708
|
-
space_id:
|
|
1790
|
+
space_id: z10.string().optional().describe("Backing space id. Resolved automatically if omitted.")
|
|
1709
1791
|
});
|
|
1710
|
-
var mIRC_send_file_input =
|
|
1792
|
+
var mIRC_send_file_input = z10.object({
|
|
1711
1793
|
channel_id: RoomId3,
|
|
1712
1794
|
file_base64: Base64Body,
|
|
1713
1795
|
filename: Filename,
|
|
1714
1796
|
mime: Mime,
|
|
1715
|
-
caption:
|
|
1797
|
+
caption: z10.string().max(2e3).optional(),
|
|
1716
1798
|
reply_to_id: ReplyTo,
|
|
1717
|
-
space_id:
|
|
1799
|
+
space_id: z10.string().optional()
|
|
1718
1800
|
});
|
|
1719
1801
|
async function mIRC_send_voice(input, ctx) {
|
|
1720
1802
|
const space_id = input.space_id ?? await resolveLinkedSpaceId2(input.channel_id);
|
|
@@ -1759,13 +1841,54 @@ var attachmentTools = [
|
|
|
1759
1841
|
}
|
|
1760
1842
|
];
|
|
1761
1843
|
|
|
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
|
+
|
|
1762
1885
|
// src/tools/knowledge.ts
|
|
1763
|
-
import { z as
|
|
1764
|
-
var mRAG_search_input =
|
|
1765
|
-
query:
|
|
1766
|
-
top_k:
|
|
1767
|
-
source_types:
|
|
1768
|
-
thread_id:
|
|
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).")
|
|
1769
1892
|
});
|
|
1770
1893
|
async function mRAG_search(input, ctx) {
|
|
1771
1894
|
readSupabaseEnv();
|
|
@@ -1782,12 +1905,12 @@ async function mRAG_search(input, ctx) {
|
|
|
1782
1905
|
chunks_found: data.chunks_found ?? (data.sources?.length ?? 0)
|
|
1783
1906
|
};
|
|
1784
1907
|
}
|
|
1785
|
-
var mRAG_ingest_input =
|
|
1786
|
-
content_text:
|
|
1787
|
-
source_type:
|
|
1788
|
-
source_id:
|
|
1789
|
-
thread_id:
|
|
1790
|
-
title:
|
|
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.")
|
|
1791
1914
|
});
|
|
1792
1915
|
async function mRAG_ingest(input, ctx) {
|
|
1793
1916
|
readSupabaseEnv();
|
|
@@ -1802,15 +1925,15 @@ async function mRAG_ingest(input, ctx) {
|
|
|
1802
1925
|
});
|
|
1803
1926
|
return { indexed: data.indexed ?? 0, chunk_count: data.chunk_count ?? 0 };
|
|
1804
1927
|
}
|
|
1805
|
-
var mRAG_list_sources_input =
|
|
1928
|
+
var mRAG_list_sources_input = z12.object({});
|
|
1806
1929
|
async function mRAG_list_sources(_input, ctx) {
|
|
1807
1930
|
readSupabaseEnv();
|
|
1808
1931
|
ctx.log("debug", "mRAG_list_sources via rag-sources");
|
|
1809
1932
|
return await invokeFunction("rag-sources", { action: "list" });
|
|
1810
1933
|
}
|
|
1811
|
-
var mRAG_delete_input =
|
|
1812
|
-
source_id:
|
|
1813
|
-
thread_id:
|
|
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.")
|
|
1814
1937
|
}).refine((v) => v.source_id || v.thread_id, {
|
|
1815
1938
|
message: "Provide source_id or thread_id \u2014 mRAG_delete refuses to purge the whole index."
|
|
1816
1939
|
});
|
|
@@ -1855,34 +1978,34 @@ var knowledgeTools = [
|
|
|
1855
1978
|
];
|
|
1856
1979
|
|
|
1857
1980
|
// src/tools/actions.ts
|
|
1858
|
-
import { z as
|
|
1859
|
-
var formField =
|
|
1860
|
-
name:
|
|
1861
|
-
label:
|
|
1862
|
-
type:
|
|
1863
|
-
required:
|
|
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.")
|
|
1864
1987
|
});
|
|
1865
|
-
var action_create_input =
|
|
1866
|
-
action_type:
|
|
1988
|
+
var action_create_input = z13.object({
|
|
1989
|
+
action_type: z13.enum(["confirm", "file_request", "form", "open_url", "screen_share"]).describe(
|
|
1867
1990
|
"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)."
|
|
1868
1991
|
),
|
|
1869
|
-
message:
|
|
1870
|
-
creator_label:
|
|
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'."),
|
|
1871
1994
|
// confirm
|
|
1872
|
-
yes_label:
|
|
1873
|
-
no_label:
|
|
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'."),
|
|
1874
1997
|
// file_request
|
|
1875
|
-
accept:
|
|
1876
|
-
max_bytes:
|
|
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."),
|
|
1877
2000
|
// form
|
|
1878
|
-
fields:
|
|
2001
|
+
fields: z13.array(formField).min(1).max(20).optional().describe("[form] Fields to collect from the recipient."),
|
|
1879
2002
|
// open_url
|
|
1880
|
-
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."),
|
|
1881
2004
|
// screen_share
|
|
1882
|
-
max_width:
|
|
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."),
|
|
1883
2006
|
// lifecycle
|
|
1884
|
-
ttl_ms:
|
|
1885
|
-
max_uses:
|
|
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).")
|
|
1886
2009
|
});
|
|
1887
2010
|
function buildParams(input) {
|
|
1888
2011
|
switch (input.action_type) {
|
|
@@ -1923,8 +2046,8 @@ async function action_create(input, ctx) {
|
|
|
1923
2046
|
expires_at: res.expires_at ?? ""
|
|
1924
2047
|
};
|
|
1925
2048
|
}
|
|
1926
|
-
var action_frame_get_input =
|
|
1927
|
-
action_id:
|
|
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.")
|
|
1928
2051
|
});
|
|
1929
2052
|
async function action_frame_get(input, ctx) {
|
|
1930
2053
|
readSupabaseEnv();
|
|
@@ -1964,79 +2087,95 @@ var actionTools = [
|
|
|
1964
2087
|
}
|
|
1965
2088
|
];
|
|
1966
2089
|
|
|
1967
|
-
// src/tools/
|
|
1968
|
-
import { z as
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
return { count: events.length, total: THREAT_EVENT_COUNT, events };
|
|
1983
|
-
}
|
|
1984
|
-
var threat_classify_input = z12.object({
|
|
1985
|
-
event_type: z12.string().min(1).max(120).describe('Event type to classify, e.g. "SIM_SWAP", "AUTH_BRUTEFORCE", "TOLL_FRAUD". Case-insensitive.'),
|
|
1986
|
-
severity: z12.string().optional().describe('Optional producer severity hint. "killswitch" \u2192 lock_account; "critical" \u2192 revoke_sessions; anything else is informational.'),
|
|
1987
|
-
details: z12.string().max(2e3).optional().describe("Optional free-text context (informational only).")
|
|
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'.")
|
|
1988
2105
|
});
|
|
1989
|
-
|
|
1990
|
-
|
|
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
|
+
};
|
|
1991
2133
|
}
|
|
1992
|
-
var
|
|
2134
|
+
var embedTools = [
|
|
1993
2135
|
{
|
|
1994
|
-
name: "
|
|
1995
|
-
requires: "
|
|
1996
|
-
description: "
|
|
1997
|
-
inputSchema:
|
|
1998
|
-
handler:
|
|
1999
|
-
},
|
|
2000
|
-
{
|
|
2001
|
-
name: "threat_classify",
|
|
2002
|
-
requires: "any",
|
|
2003
|
-
description: "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 \u2014 the engine DECIDES; the caller carries out the action. Use to evaluate a threat event you already observed.",
|
|
2004
|
-
inputSchema: threat_classify_input,
|
|
2005
|
-
handler: threat_classify
|
|
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
|
|
2006
2141
|
}
|
|
2007
2142
|
];
|
|
2008
2143
|
|
|
2009
2144
|
// src/tools/murl.ts
|
|
2010
|
-
import { z as
|
|
2145
|
+
import { z as z15 } from "zod";
|
|
2011
2146
|
var DEFAULT_EDGE_URL2 = "https://mosadd-edge.mr-brics-33.workers.dev";
|
|
2012
2147
|
function edgeUrl2() {
|
|
2013
2148
|
return process.env.MOSADD_EDGE_URL?.replace(/\/$/, "") ?? DEFAULT_EDGE_URL2;
|
|
2014
2149
|
}
|
|
2015
|
-
function
|
|
2150
|
+
function hubKey3() {
|
|
2016
2151
|
const key = process.env.MOSADD_API_KEY ?? process.env.MOSADD_HUB_KEY ?? "";
|
|
2017
2152
|
if (!key) throw new Error("MOSADD_API_KEY required for mURL tools (see `mosadd login` / hub-keys).");
|
|
2018
2153
|
return key;
|
|
2019
2154
|
}
|
|
2020
|
-
function
|
|
2021
|
-
let
|
|
2022
|
-
|
|
2155
|
+
function urlToSlug(input) {
|
|
2156
|
+
let s = String(input).trim().toLowerCase();
|
|
2157
|
+
s = s.replace(/^[a-z]+:\/\//, "").replace(/[?#].*$/, "");
|
|
2158
|
+
const slash = s.indexOf("/");
|
|
2159
|
+
let host = (slash >= 0 ? s.slice(0, slash) : s).replace(/:\d+$/, "");
|
|
2023
2160
|
if (host.startsWith("www.")) host = host.slice(4);
|
|
2024
2161
|
if (!host || !/^[a-z0-9-]+(\.[a-z0-9-]+)+$/.test(host)) {
|
|
2025
|
-
throw new Error(`Invalid
|
|
2162
|
+
throw new Error(`Invalid URL: "${input}" \u2014 pass a domain like "example.com" or a full URL.`);
|
|
2026
2163
|
}
|
|
2027
|
-
|
|
2164
|
+
const segs = (slash >= 0 ? s.slice(slash) : "").split("/").map((seg) => seg.replace(/[^a-z0-9-]+/g, "-").replace(/^-+|-+$/g, "")).filter(Boolean);
|
|
2165
|
+
const base = host.replace(/\./g, "-");
|
|
2166
|
+
return { domain: host, slug: segs.length ? `${base}__${segs.join("__")}` : base };
|
|
2028
2167
|
}
|
|
2029
|
-
var DomainArg =
|
|
2030
|
-
var mURL_read_channel_input =
|
|
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({
|
|
2031
2170
|
domain: DomainArg,
|
|
2032
|
-
limit:
|
|
2171
|
+
limit: z15.number().int().min(1).max(100).optional().describe("Recent messages to return (max 100). Default 50.")
|
|
2033
2172
|
});
|
|
2034
2173
|
async function mURL_read_channel(input, ctx) {
|
|
2035
|
-
const { domain, slug: slug2 } =
|
|
2174
|
+
const { domain, slug: slug2 } = urlToSlug(input.domain);
|
|
2036
2175
|
const limit = input.limit ?? 50;
|
|
2037
2176
|
ctx.log("debug", "mURL_read_channel", { domain });
|
|
2038
2177
|
const r = await fetch(`${edgeUrl2()}/c/${slug2}/history?limit=${limit}`, {
|
|
2039
|
-
headers: { Authorization: `Bearer ${
|
|
2178
|
+
headers: { Authorization: `Bearer ${hubKey3()}` }
|
|
2040
2179
|
});
|
|
2041
2180
|
if (!r.ok) {
|
|
2042
2181
|
const e = await r.text().catch(() => "");
|
|
@@ -2048,17 +2187,17 @@ async function mURL_read_channel(input, ctx) {
|
|
|
2048
2187
|
messages: (data.messages ?? []).map((m) => ({ id: m.id, from: m.from ?? null, text: m.text, timestamp: m.ts }))
|
|
2049
2188
|
};
|
|
2050
2189
|
}
|
|
2051
|
-
var mURL_post_input =
|
|
2190
|
+
var mURL_post_input = z15.object({
|
|
2052
2191
|
domain: DomainArg,
|
|
2053
|
-
text:
|
|
2054
|
-
from:
|
|
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).")
|
|
2055
2194
|
});
|
|
2056
2195
|
async function mURL_post(input, ctx) {
|
|
2057
|
-
const { domain, slug: slug2 } =
|
|
2196
|
+
const { domain, slug: slug2 } = urlToSlug(input.domain);
|
|
2058
2197
|
ctx.log("debug", "mURL_post", { domain });
|
|
2059
2198
|
const r = await fetch(`${edgeUrl2()}/c/${slug2}/send`, {
|
|
2060
2199
|
method: "POST",
|
|
2061
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${
|
|
2200
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${hubKey3()}` },
|
|
2062
2201
|
body: JSON.stringify({ text: input.text, from: input.from })
|
|
2063
2202
|
});
|
|
2064
2203
|
if (!r.ok) {
|
|
@@ -2069,12 +2208,12 @@ async function mURL_post(input, ctx) {
|
|
|
2069
2208
|
if (!data?.id) throw new Error("mosadd-edge: send returned no id");
|
|
2070
2209
|
return { domain, message_id: data.id, posted_at: data.ts ?? Date.now() };
|
|
2071
2210
|
}
|
|
2072
|
-
var mURL_list_channels_input =
|
|
2073
|
-
action:
|
|
2074
|
-
limit:
|
|
2075
|
-
hours:
|
|
2076
|
-
status:
|
|
2077
|
-
cursor:
|
|
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).")
|
|
2078
2217
|
});
|
|
2079
2218
|
async function mURL_list_channels(input, ctx) {
|
|
2080
2219
|
readSupabaseEnv();
|
|
@@ -2088,9 +2227,9 @@ async function mURL_list_channels(input, ctx) {
|
|
|
2088
2227
|
cursor: input.cursor ?? null
|
|
2089
2228
|
});
|
|
2090
2229
|
}
|
|
2091
|
-
var mURL_presence_input =
|
|
2230
|
+
var mURL_presence_input = z15.object({ domain: DomainArg });
|
|
2092
2231
|
async function mURL_presence(input, ctx) {
|
|
2093
|
-
const { domain, slug: slug2 } =
|
|
2232
|
+
const { domain, slug: slug2 } = urlToSlug(input.domain);
|
|
2094
2233
|
ctx.log("debug", "mURL_presence", { domain });
|
|
2095
2234
|
const r = await fetch(`${edgeUrl2()}/c/${slug2}/presence`);
|
|
2096
2235
|
if (!r.ok) {
|
|
@@ -2132,7 +2271,7 @@ var murlTools = [
|
|
|
2132
2271
|
];
|
|
2133
2272
|
|
|
2134
2273
|
// src/tools/capabilities.ts
|
|
2135
|
-
import { z as
|
|
2274
|
+
import { z as z16 } from "zod";
|
|
2136
2275
|
var CONTRACT_VERSION = "1.0.0";
|
|
2137
2276
|
var ALL_REQUIREMENTS = ["any", "radio", "network"];
|
|
2138
2277
|
function buildCapabilityManifest(tools) {
|
|
@@ -2155,7 +2294,7 @@ function makeCapabilitiesTool(channelTools2) {
|
|
|
2155
2294
|
name: "comms_capabilities",
|
|
2156
2295
|
requires: "any",
|
|
2157
2296
|
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.",
|
|
2158
|
-
inputSchema:
|
|
2297
|
+
inputSchema: z16.object({}),
|
|
2159
2298
|
handler: async () => buildCapabilityManifest([...channelTools2, tool])
|
|
2160
2299
|
};
|
|
2161
2300
|
return tool;
|
|
@@ -2172,20 +2311,25 @@ var channelTools = [
|
|
|
2172
2311
|
// ...mroomTools, // mROOM: killed (LINEAR-3414) — channel re-cut into ephemeral private mIRC
|
|
2173
2312
|
// ...mroomMessagesTools, // mROOM: killed (LINEAR-3414)
|
|
2174
2313
|
...mailTools,
|
|
2175
|
-
//
|
|
2314
|
+
// mAYL_*: canonical email module (was mp0st_*; renamed re-arch 2026-06-27)
|
|
2315
|
+
...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)
|
|
2176
2319
|
// endpoint (404s every call) + sends provenance body fields the EF never reads. Unregister until
|
|
2177
2320
|
// rewired onto hub-key-exchange (agent_id/task_id + mosadd_hub JWT claim). See consistency ticket.
|
|
2178
2321
|
...mtalkTools,
|
|
2179
2322
|
...attachmentTools,
|
|
2180
|
-
|
|
2323
|
+
...pttIngestTools,
|
|
2324
|
+
// mTALK_ingest_ptt: P4.1 / LINEAR-3998 — body aligned to deployed ptt-ingest EF
|
|
2181
2325
|
// ptt-ingest EF (needs {direction, audio_base64, mime_type, message_id|thread_id} → 400s every
|
|
2182
2326
|
// call) and the PTT→RAG path needs rework. Unregister until both are fixed. See consistency ticket.
|
|
2183
2327
|
...knowledgeTools,
|
|
2184
2328
|
...actionTools,
|
|
2185
2329
|
// Action links (Tier 1): agent → user one-link browser action via action-create EF
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
//
|
|
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
|
|
2189
2333
|
...murlTools
|
|
2190
2334
|
// mURL: revived as a full module (founder 2026-06-27) — read/post/presence/list_channels over live domain channels
|
|
2191
2335
|
// ...mcallTools, // mCALL: carrier-pending (no telephony carrier live) — re-register when a carrier is configured
|