@mosadd/mcp 3.0.0-alpha.45 → 3.0.0-alpha.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +309 -298
- package/README.md +150 -150
- package/dist/bin/mcp.js +1 -1
- package/dist/{chunk-ZAQJVVBS.js → chunk-STWB7DEK.js} +253 -202
- package/dist/index.d.ts +8 -4
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/src/__tests__/mirc-invite.test.ts +112 -0
- package/src/__tests__/tool-count-consistency.test.ts +199 -164
- package/src/tools/index.ts +8 -4
- package/src/tools/mirc-members.ts +287 -218
- package/src/tools/mirc.ts +308 -264
|
@@ -883,69 +883,284 @@ var mdmVoiceTools = [
|
|
|
883
883
|
];
|
|
884
884
|
|
|
885
885
|
// src/tools/mirc.ts
|
|
886
|
+
import { z as z5 } from "zod";
|
|
887
|
+
|
|
888
|
+
// src/tools/mirc-members.ts
|
|
886
889
|
import { z as z4 } from "zod";
|
|
887
|
-
var ChannelId = z4.string().min(1).max(120).describe("Channel id (UUID).
|
|
888
|
-
var
|
|
889
|
-
var
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
890
|
+
var ChannelId = z4.string().min(1).max(120).describe("Channel id (UUID). From mIRC_list / mIRC_create.");
|
|
891
|
+
var MemberIdentity = z4.string().min(1).describe("Target user's identity id (UUID). From mDM_list_contacts or radar logs.");
|
|
892
|
+
var Role = z4.enum(["superadmin", "admin", "moderator", "member"]).describe("Role to assign. owner = channel creator (not assignable); promote up to one tier below your own.");
|
|
893
|
+
var mIRC_join_input = z4.object({
|
|
894
|
+
channel_id: ChannelId,
|
|
895
|
+
password: z4.string().min(1).optional().describe("Pass only for access_mode=password channels. Private channels cannot be joined directly (403) \u2014 use mIRC_request_access.")
|
|
896
|
+
});
|
|
897
|
+
var mIRC_request_access_input = z4.object({
|
|
898
|
+
channel_id: ChannelId
|
|
899
|
+
});
|
|
900
|
+
var InviteRole = z4.enum(["member", "moderator", "admin"]).describe("Role the invitee lands with (default member). Must be strictly below your own role \u2014 the EF applies the same tier rule as mIRC_set_role.");
|
|
901
|
+
var mIRC_invite_input = z4.object({
|
|
902
|
+
channel_id: ChannelId,
|
|
903
|
+
identity_id: z4.string().min(1).describe("Identity id (UUID) of who to add. Your own agents: mDM_list_my_agents \u2192 agents[].identity_id (that list is kind=agent ONLY \u2014 a robot you own is NOT in it; take the robot's identity id from the app's Robots page). People / other people's agents: mDM_list_contacts."),
|
|
904
|
+
role: InviteRole.optional(),
|
|
905
|
+
wrapped_group_key: z4.string().optional().describe(
|
|
906
|
+
"Required on password/private channels that hold a group key: the channel group key wrapped to the INVITEE's identity key (the same material mIRC_approve_request takes). Without it the EF refuses with 400 ('This channel is encrypted \u2014 unlock your vault\u2026'). Open channels: omit."
|
|
907
|
+
),
|
|
908
|
+
ttl_seconds: z4.number().int().min(300).max(30 * 86400).optional().describe("Lifetime of an invite CODE (code path only; ignored when the target auto-joins). Default 7 days; the EF clamps to 5 min \u2026 30 days.")
|
|
909
|
+
});
|
|
910
|
+
var mIRC_leave_input = z4.object({
|
|
911
|
+
channel_id: ChannelId
|
|
912
|
+
});
|
|
913
|
+
var mIRC_reject_request_input = z4.object({
|
|
914
|
+
channel_id: ChannelId,
|
|
915
|
+
identity_id: z4.string().min(1).describe("Identity id of the requester to reject (state=requested; from mIRC_list members).")
|
|
916
|
+
});
|
|
917
|
+
var mIRC_approve_request_input = mIRC_reject_request_input.extend({
|
|
918
|
+
wrapped_group_key: z4.string().optional().describe(
|
|
919
|
+
"Required to approve a join to a password/private (group-key) channel: the channel group key wrapped to the approved member's identity key. Without it the backend rejects the approval with a 'wrapped_group_key required' error. (Access requests only exist on non-open channels, so this is effectively always required.)"
|
|
920
|
+
)
|
|
921
|
+
});
|
|
922
|
+
var mIRC_kick_input = z4.object({
|
|
923
|
+
channel_id: ChannelId,
|
|
924
|
+
identity_id: MemberIdentity
|
|
925
|
+
// NOTE: a `reason` field used to be advertised here but channel-members-manage
|
|
926
|
+
// never persists it (no audit row on kick) — removed until the backend logs it
|
|
927
|
+
// (see consistency ticket) so the tool doesn't claim an audit trail it can't deliver.
|
|
928
|
+
});
|
|
929
|
+
var mIRC_ban_input = z4.object({
|
|
930
|
+
channel_id: ChannelId,
|
|
931
|
+
identity_id: MemberIdentity
|
|
932
|
+
// NOTE: `reason` (no storage) and `until` (timed ban) were removed — the EF ban
|
|
933
|
+
// branch ignores both, so `until` produced a SILENT PERMANENT ban when a caller
|
|
934
|
+
// asked for a temporary one. Ban is permanent-until-unban; enforced temp-bans +
|
|
935
|
+
// ban audit are tracked in the consistency ticket.
|
|
936
|
+
});
|
|
937
|
+
var mIRC_unban_input = z4.object({
|
|
938
|
+
channel_id: ChannelId,
|
|
939
|
+
identity_id: MemberIdentity
|
|
940
|
+
});
|
|
941
|
+
var mIRC_set_role_input = z4.object({
|
|
942
|
+
channel_id: ChannelId,
|
|
943
|
+
identity_id: MemberIdentity,
|
|
944
|
+
role: Role
|
|
945
|
+
});
|
|
946
|
+
var mIRC_set_ptt_input = z4.object({
|
|
947
|
+
channel_id: ChannelId,
|
|
948
|
+
identity_id: MemberIdentity,
|
|
949
|
+
ptt_enabled: z4.boolean().describe("Allow this member to hold the PTT floor in voice mode.")
|
|
950
|
+
});
|
|
951
|
+
async function invokeChannelMembers(action, body, ctx) {
|
|
952
|
+
const b = { ...body };
|
|
953
|
+
if ("identity_id" in b) {
|
|
954
|
+
b.target_identity_id = b.identity_id;
|
|
955
|
+
delete b.identity_id;
|
|
956
|
+
}
|
|
957
|
+
if ("role" in b && action !== "invite") {
|
|
958
|
+
b.new_role = b.role;
|
|
959
|
+
delete b.role;
|
|
960
|
+
}
|
|
961
|
+
if ("ptt_enabled" in b) {
|
|
962
|
+
b.can_ptt = b.ptt_enabled;
|
|
963
|
+
delete b.ptt_enabled;
|
|
964
|
+
}
|
|
965
|
+
readSupabaseEnv();
|
|
966
|
+
ctx.log("debug", `mIRC.${action}`, b);
|
|
967
|
+
return await invokeFunction("channel-members-manage", { action, ...b });
|
|
968
|
+
}
|
|
969
|
+
async function inviteToChannel(input, ctx) {
|
|
970
|
+
return await invokeChannelMembers("invite", input, ctx);
|
|
971
|
+
}
|
|
972
|
+
var mircMembersTools = [
|
|
973
|
+
{
|
|
974
|
+
name: "mIRC_join",
|
|
975
|
+
title: "Join channel",
|
|
976
|
+
annotations: { readOnlyHint: false },
|
|
977
|
+
requires: "network",
|
|
978
|
+
description: "Join a channel as the current user. Pass `password` only for access_mode=password channels; private channels cannot be joined directly (403) \u2014 use mIRC_request_access + approval. Idempotent: an existing active member gets their membership row back (200, no 409).",
|
|
979
|
+
inputSchema: mIRC_join_input,
|
|
980
|
+
handler: ((input, ctx) => invokeChannelMembers("join", input, ctx))
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
// Własny agent/robot → auto_joined:true (channel_members + space_members + klucz grupy);
|
|
984
|
+
// człowiek / cudzy agent → kod zaproszenia. Rozgałęzia SERWER (channel-members-manage), nie toolkit.
|
|
985
|
+
name: "mIRC_invite",
|
|
986
|
+
title: "Invite / add a member",
|
|
987
|
+
annotations: { readOnlyHint: false },
|
|
988
|
+
requires: "network",
|
|
989
|
+
description: "Add someone to a channel you own or admin (owner/superadmin/admin; you cannot hand out a role equal to or above your own). TWO OUTCOMES, decided server-side by who the target is. (1) An agent or robot YOU OWN joins immediately \u2014 reply {auto_joined:true, member}: the backend writes channel_members AND the linked space_members row (both are required before its posts pass message-send) plus a channel_keys row when you pass wrapped_group_key. No code, nothing to redeem. THIS is the step that lets an agent speak in a channel: mIRC_join adds the KEY's identity (usually you, the human), while channel posts are signed by the AGENT \u2014 a channel created from the toolkit stays mute until its agent is added here (or via invite_agents on mIRC_create). (2) A human, or an agent owned by somebody else, gets an invite code \u2014 reply {invite:{code, expires_at, \u2026}}; hand the code over and they redeem it in the app (+ \u2192 I have an invite code). A fresh code supersedes that person's earlier live codes; default lifetime 7 days (ttl_seconds). Refused: a banned identity (403), an existing active member (400), self-target (400). Rate limit: 20 invites/min per caller. Password/private channels that hold a group key need wrapped_group_key (wrapped to the invitee's identity key) \u2014 the toolkit does not derive group keys, so either supply it as with mIRC_approve_request, or add the member from the mosadd.com member drawer, which wraps it for you.",
|
|
990
|
+
inputSchema: mIRC_invite_input,
|
|
991
|
+
handler: ((input, ctx) => inviteToChannel(input, ctx))
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
name: "mIRC_request_access",
|
|
995
|
+
title: "Request channel access",
|
|
996
|
+
annotations: { readOnlyHint: false },
|
|
997
|
+
requires: "network",
|
|
998
|
+
description: "Request access to a password/private channel (your membership goes to state=requested for an admin to approve).",
|
|
999
|
+
inputSchema: mIRC_request_access_input,
|
|
1000
|
+
handler: ((input, ctx) => invokeChannelMembers("request-access", input, ctx))
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
name: "mIRC_leave",
|
|
1004
|
+
title: "Leave channel",
|
|
1005
|
+
annotations: { readOnlyHint: false },
|
|
1006
|
+
requires: "network",
|
|
1007
|
+
description: "Leave a channel as the current user. Owner cannot leave without transferring ownership first.",
|
|
1008
|
+
inputSchema: mIRC_leave_input,
|
|
1009
|
+
handler: ((input, ctx) => invokeChannelMembers("leave", input, ctx))
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
name: "mIRC_approve_request",
|
|
1013
|
+
title: "Approve access request",
|
|
1014
|
+
annotations: { readOnlyHint: false },
|
|
1015
|
+
requires: "network",
|
|
1016
|
+
description: "Approve a pending access request (state=requested \u2192 active). Admins / moderators / owner only. Because access requests only exist on non-open (password/private) channels, you must pass wrapped_group_key \u2014 the channel group key wrapped to the approved member's identity key.",
|
|
1017
|
+
inputSchema: mIRC_approve_request_input,
|
|
1018
|
+
handler: ((input, ctx) => invokeChannelMembers("approve-request", input, ctx))
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
name: "mIRC_reject_request",
|
|
1022
|
+
title: "Reject access request",
|
|
1023
|
+
annotations: { readOnlyHint: false },
|
|
1024
|
+
requires: "network",
|
|
1025
|
+
description: "Reject a pending access request. Admins / moderators / owner only.",
|
|
1026
|
+
inputSchema: mIRC_reject_request_input,
|
|
1027
|
+
handler: ((input, ctx) => invokeChannelMembers("reject-request", input, ctx))
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
name: "mIRC_kick",
|
|
1031
|
+
title: "Kick a member",
|
|
1032
|
+
annotations: { destructiveHint: true },
|
|
1033
|
+
requires: "network",
|
|
1034
|
+
description: "Remove a member from the channel. They can rejoin if not banned. Requires moderator+.",
|
|
1035
|
+
inputSchema: mIRC_kick_input,
|
|
1036
|
+
handler: ((input, ctx) => invokeChannelMembers("kick", input, ctx))
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
name: "mIRC_ban",
|
|
1040
|
+
title: "Ban a member",
|
|
1041
|
+
annotations: { destructiveHint: true },
|
|
1042
|
+
requires: "network",
|
|
1043
|
+
description: "Ban a member from the channel. The ban is permanent until you call mIRC_unban. Requires admin+.",
|
|
1044
|
+
inputSchema: mIRC_ban_input,
|
|
1045
|
+
handler: ((input, ctx) => invokeChannelMembers("ban", input, ctx))
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
name: "mIRC_unban",
|
|
1049
|
+
title: "Lift a ban",
|
|
1050
|
+
annotations: { readOnlyHint: false },
|
|
1051
|
+
requires: "network",
|
|
1052
|
+
description: "Lift a ban. Requires admin+.",
|
|
1053
|
+
inputSchema: mIRC_unban_input,
|
|
1054
|
+
handler: ((input, ctx) => invokeChannelMembers("unban", input, ctx))
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
name: "mIRC_set_role",
|
|
1058
|
+
title: "Set member role",
|
|
1059
|
+
annotations: { readOnlyHint: false },
|
|
1060
|
+
requires: "network",
|
|
1061
|
+
description: "Promote / demote a member. Roles: owner(100) > superadmin(90) > admin(80) > moderator(70) > member(10). No 'guest'. An actor may assign any role below their own tier \u2014 so a superadmin (not only the owner) can promote to admin.",
|
|
1062
|
+
inputSchema: mIRC_set_role_input,
|
|
1063
|
+
handler: ((input, ctx) => invokeChannelMembers("set-role", input, ctx))
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
name: "mIRC_set_ptt",
|
|
1067
|
+
title: "Set push-to-talk permission",
|
|
1068
|
+
annotations: { readOnlyHint: false },
|
|
1069
|
+
requires: "network",
|
|
1070
|
+
description: "Grant or revoke PTT floor permission for a member in voice-capable channels (capabilities.ptt=true). Requires moderator+.",
|
|
1071
|
+
inputSchema: mIRC_set_ptt_input,
|
|
1072
|
+
handler: ((input, ctx) => invokeChannelMembers("set-ptt", input, ctx))
|
|
1073
|
+
}
|
|
1074
|
+
];
|
|
1075
|
+
|
|
1076
|
+
// src/tools/mirc.ts
|
|
1077
|
+
var ChannelId2 = z5.string().min(1).max(120).describe("Channel id (UUID). Use mIRC_list to discover available channels.");
|
|
1078
|
+
var AccessMode = z5.enum(["open", "password", "private"]).describe("open: anyone can join \xB7 password: join with a shared password \xB7 private: invite-only.");
|
|
1079
|
+
var Capabilities = z5.object({
|
|
1080
|
+
txt: z5.boolean().default(true),
|
|
1081
|
+
voice: z5.boolean().default(false),
|
|
1082
|
+
files: z5.boolean().default(false),
|
|
1083
|
+
ptt: z5.boolean().default(false),
|
|
1084
|
+
live: z5.boolean().default(false)
|
|
895
1085
|
}).describe("Which modes are enabled: txt (text), voice (group voice), files (file attach), ptt (push-to-talk), live (live stream). Voice/PTT/live are server-relayed via LiveKit \u2014 NOT end-to-end encrypted.").optional();
|
|
896
|
-
var mIRC_create_input =
|
|
897
|
-
name:
|
|
898
|
-
topic:
|
|
1086
|
+
var mIRC_create_input = z5.object({
|
|
1087
|
+
name: z5.string().min(1).max(80).describe("Channel display name."),
|
|
1088
|
+
topic: z5.string().max(500).optional().describe("Optional channel topic/description."),
|
|
899
1089
|
access_mode: AccessMode.default("open"),
|
|
900
|
-
password:
|
|
1090
|
+
password: z5.string().min(6).max(120).optional().describe("Password (only for access_mode=password)."),
|
|
901
1091
|
capabilities: Capabilities,
|
|
902
|
-
discoverable:
|
|
903
|
-
wrapped_group_key:
|
|
1092
|
+
discoverable: z5.boolean().optional().describe("List this channel in the PUBLIC directory (mIRC_discover). Honoured ONLY for access_mode=open; ignored for password/private."),
|
|
1093
|
+
wrapped_group_key: z5.string().optional().describe(
|
|
904
1094
|
"Required for access_mode=password|private (these channels are provisioned for group-key text encryption on supported clients): the channel's group key wrapped to the creator's identity key. Open channels ignore it. If omitted on a non-open channel the backend rejects the call with a 'wrapped_group_key required' error."
|
|
1095
|
+
),
|
|
1096
|
+
invite_agents: z5.array(z5.string().min(1)).max(20).optional().describe(
|
|
1097
|
+
"Identity ids (UUID) of YOUR agents/robots to add right after the channel is created (agents: mDM_list_my_agents \u2192 agents[].identity_id; robots are not in that list \u2014 use the identity id from the app's Robots page). Each is fanned out to mIRC_invite: your own agents auto-join (auto_joined:true); anything else gets an invite code. Per-agent failures are reported in invites[] \u2014 the channel itself is still created. Max 20 per call (the invite mint is rate-limited to 20/min). On password/private channels the fan-out cannot carry a per-agent wrapped_group_key \u2014 use mIRC_invite per agent there."
|
|
905
1098
|
)
|
|
906
1099
|
});
|
|
907
|
-
var mIRC_list_input =
|
|
908
|
-
limit:
|
|
909
|
-
offset:
|
|
1100
|
+
var mIRC_list_input = z5.object({
|
|
1101
|
+
limit: z5.number().int().min(1).max(500).default(100).optional(),
|
|
1102
|
+
offset: z5.number().int().min(0).default(0).optional()
|
|
910
1103
|
// NOTE: an access_mode filter was removed — channel-manage's list branch doesn't
|
|
911
1104
|
// filter by it (it was a silent no-op). Filter client-side on the returned
|
|
912
1105
|
// access_mode field. Server-side filtering is tracked in the consistency ticket.
|
|
913
1106
|
});
|
|
914
|
-
var mIRC_get_input =
|
|
915
|
-
channel_id:
|
|
1107
|
+
var mIRC_get_input = z5.object({
|
|
1108
|
+
channel_id: ChannelId2
|
|
916
1109
|
});
|
|
917
|
-
var mIRC_update_input =
|
|
918
|
-
channel_id:
|
|
919
|
-
name:
|
|
920
|
-
topic:
|
|
1110
|
+
var mIRC_update_input = z5.object({
|
|
1111
|
+
channel_id: ChannelId2,
|
|
1112
|
+
name: z5.string().min(1).max(80).optional(),
|
|
1113
|
+
topic: z5.string().max(500).optional(),
|
|
921
1114
|
// NOTE: access_mode was removed — channel-manage's update branch ignores it, and
|
|
922
1115
|
// switching an existing channel to/from an E2EE (password/private) mode needs
|
|
923
1116
|
// group-key handling that isn't wired yet. Recreate the channel to change mode.
|
|
924
1117
|
capabilities: Capabilities,
|
|
925
|
-
discoverable:
|
|
1118
|
+
discoverable: z5.boolean().optional().describe("Toggle public-directory listing (open channels only).")
|
|
926
1119
|
});
|
|
927
|
-
var mIRC_discover_input =
|
|
928
|
-
q:
|
|
929
|
-
limit:
|
|
930
|
-
offset:
|
|
1120
|
+
var mIRC_discover_input = z5.object({
|
|
1121
|
+
q: z5.string().max(100).optional().describe("Optional channel-name filter."),
|
|
1122
|
+
limit: z5.number().int().min(1).max(500).default(50).optional(),
|
|
1123
|
+
offset: z5.number().int().min(0).default(0).optional()
|
|
931
1124
|
});
|
|
932
|
-
var mIRC_report_input =
|
|
933
|
-
channel_id:
|
|
934
|
-
reason:
|
|
935
|
-
detail:
|
|
1125
|
+
var mIRC_report_input = z5.object({
|
|
1126
|
+
channel_id: ChannelId2,
|
|
1127
|
+
reason: z5.enum(["spam", "abuse", "harassment", "illegal", "other"]).describe("Report reason."),
|
|
1128
|
+
detail: z5.string().max(1e3).optional().describe("Optional free-text context.")
|
|
936
1129
|
});
|
|
937
|
-
var mIRC_delete_input =
|
|
938
|
-
channel_id:
|
|
1130
|
+
var mIRC_delete_input = z5.object({
|
|
1131
|
+
channel_id: ChannelId2
|
|
939
1132
|
});
|
|
940
1133
|
async function mIRC_create(input, ctx) {
|
|
941
1134
|
readSupabaseEnv();
|
|
942
1135
|
ctx.log("debug", "mIRC_create invoking channel-manage", { name: input.name });
|
|
943
|
-
const { topic, ...rest } = input;
|
|
1136
|
+
const { topic, invite_agents, ...rest } = input;
|
|
944
1137
|
const payload = topic !== void 0 ? { ...rest, description: topic } : { ...rest };
|
|
945
|
-
|
|
1138
|
+
const created = await invokeFunction("channel-manage", {
|
|
946
1139
|
action: "create",
|
|
947
1140
|
...payload
|
|
948
1141
|
});
|
|
1142
|
+
if (!invite_agents?.length) return created;
|
|
1143
|
+
const channelId = created.channel?.id;
|
|
1144
|
+
if (typeof channelId !== "string" || !channelId) {
|
|
1145
|
+
return {
|
|
1146
|
+
...created,
|
|
1147
|
+
invites: invite_agents.map((identity_id) => ({
|
|
1148
|
+
identity_id,
|
|
1149
|
+
ok: false,
|
|
1150
|
+
error: "channel created but its id was missing from the reply \u2014 call mIRC_invite with the id from mIRC_list"
|
|
1151
|
+
}))
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
const invites = [];
|
|
1155
|
+
for (const identity_id of invite_agents) {
|
|
1156
|
+
try {
|
|
1157
|
+
const result = await inviteToChannel({ channel_id: channelId, identity_id }, ctx);
|
|
1158
|
+
invites.push({ identity_id, ok: true, auto_joined: "auto_joined" in result && result.auto_joined === true, result });
|
|
1159
|
+
} catch (e) {
|
|
1160
|
+
invites.push({ identity_id, ok: false, error: e instanceof Error ? e.message : String(e) });
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
return { ...created, invites };
|
|
949
1164
|
}
|
|
950
1165
|
async function mIRC_list(input, ctx) {
|
|
951
1166
|
readSupabaseEnv();
|
|
@@ -1005,7 +1220,7 @@ var mircTools = [
|
|
|
1005
1220
|
title: "Create channel",
|
|
1006
1221
|
annotations: { readOnlyHint: false },
|
|
1007
1222
|
requires: "network",
|
|
1008
|
-
description: "Create a new persistent channel (Discord/Slack-style). Set access_mode to open (anyone joins), password (shared-password gated), or private (invite-only). capabilities controls modes (txt/voice/files/ptt/live; voice/ptt/live are server-relayed via LiveKit, NOT E2EE). Set discoverable:true (open channels only) to list it in the public directory. NOTE: password/private channels are provisioned for group-key TEXT encryption \u2014 supply wrapped_group_key (the group key wrapped to your identity key); open channels do not need it. The mosadd.com app encrypts/decrypts channel text with that key on supported clients; the toolkit's own mIRC_post_message posts server-readable text today (group-key parity is the next milestone). Channel voice is never E2EE.",
|
|
1223
|
+
description: "Create a new persistent channel (Discord/Slack-style). Set access_mode to open (anyone joins), password (shared-password gated), or private (invite-only). capabilities controls modes (txt/voice/files/ptt/live; voice/ptt/live are server-relayed via LiveKit, NOT E2EE). Set discoverable:true (open channels only) to list it in the public directory. NOTE: password/private channels are provisioned for group-key TEXT encryption \u2014 supply wrapped_group_key (the group key wrapped to your identity key); open channels do not need it. The mosadd.com app encrypts/decrypts channel text with that key on supported clients; the toolkit's own mIRC_post_message posts server-readable text today (group-key parity is the next milestone). Channel voice is never E2EE. A channel WITHOUT its agent is a silent room \u2014 pass invite_agents (identity ids of your own agents, from mDM_list_my_agents) to add them in the same call, or call mIRC_invite afterwards.",
|
|
1009
1224
|
inputSchema: mIRC_create_input,
|
|
1010
1225
|
handler: mIRC_create
|
|
1011
1226
|
},
|
|
@@ -1065,170 +1280,6 @@ var mircTools = [
|
|
|
1065
1280
|
}
|
|
1066
1281
|
];
|
|
1067
1282
|
|
|
1068
|
-
// src/tools/mirc-members.ts
|
|
1069
|
-
import { z as z5 } from "zod";
|
|
1070
|
-
var ChannelId2 = z5.string().min(1).max(120).describe("Channel id (UUID). From mIRC_list / mIRC_create.");
|
|
1071
|
-
var MemberIdentity = z5.string().min(1).describe("Target user's identity id (UUID). From mDM_list_contacts or radar logs.");
|
|
1072
|
-
var Role = z5.enum(["superadmin", "admin", "moderator", "member"]).describe("Role to assign. owner = channel creator (not assignable); promote up to one tier below your own.");
|
|
1073
|
-
var mIRC_join_input = z5.object({
|
|
1074
|
-
channel_id: ChannelId2,
|
|
1075
|
-
password: z5.string().min(1).optional().describe("Pass only for access_mode=password channels. Private channels cannot be joined directly (403) \u2014 use mIRC_request_access.")
|
|
1076
|
-
});
|
|
1077
|
-
var mIRC_request_access_input = z5.object({
|
|
1078
|
-
channel_id: ChannelId2
|
|
1079
|
-
});
|
|
1080
|
-
var mIRC_leave_input = z5.object({
|
|
1081
|
-
channel_id: ChannelId2
|
|
1082
|
-
});
|
|
1083
|
-
var mIRC_reject_request_input = z5.object({
|
|
1084
|
-
channel_id: ChannelId2,
|
|
1085
|
-
identity_id: z5.string().min(1).describe("Identity id of the requester to reject (state=requested; from mIRC_list members).")
|
|
1086
|
-
});
|
|
1087
|
-
var mIRC_approve_request_input = mIRC_reject_request_input.extend({
|
|
1088
|
-
wrapped_group_key: z5.string().optional().describe(
|
|
1089
|
-
"Required to approve a join to a password/private (group-key) channel: the channel group key wrapped to the approved member's identity key. Without it the backend rejects the approval with a 'wrapped_group_key required' error. (Access requests only exist on non-open channels, so this is effectively always required.)"
|
|
1090
|
-
)
|
|
1091
|
-
});
|
|
1092
|
-
var mIRC_kick_input = z5.object({
|
|
1093
|
-
channel_id: ChannelId2,
|
|
1094
|
-
identity_id: MemberIdentity
|
|
1095
|
-
// NOTE: a `reason` field used to be advertised here but channel-members-manage
|
|
1096
|
-
// never persists it (no audit row on kick) — removed until the backend logs it
|
|
1097
|
-
// (see consistency ticket) so the tool doesn't claim an audit trail it can't deliver.
|
|
1098
|
-
});
|
|
1099
|
-
var mIRC_ban_input = z5.object({
|
|
1100
|
-
channel_id: ChannelId2,
|
|
1101
|
-
identity_id: MemberIdentity
|
|
1102
|
-
// NOTE: `reason` (no storage) and `until` (timed ban) were removed — the EF ban
|
|
1103
|
-
// branch ignores both, so `until` produced a SILENT PERMANENT ban when a caller
|
|
1104
|
-
// asked for a temporary one. Ban is permanent-until-unban; enforced temp-bans +
|
|
1105
|
-
// ban audit are tracked in the consistency ticket.
|
|
1106
|
-
});
|
|
1107
|
-
var mIRC_unban_input = z5.object({
|
|
1108
|
-
channel_id: ChannelId2,
|
|
1109
|
-
identity_id: MemberIdentity
|
|
1110
|
-
});
|
|
1111
|
-
var mIRC_set_role_input = z5.object({
|
|
1112
|
-
channel_id: ChannelId2,
|
|
1113
|
-
identity_id: MemberIdentity,
|
|
1114
|
-
role: Role
|
|
1115
|
-
});
|
|
1116
|
-
var mIRC_set_ptt_input = z5.object({
|
|
1117
|
-
channel_id: ChannelId2,
|
|
1118
|
-
identity_id: MemberIdentity,
|
|
1119
|
-
ptt_enabled: z5.boolean().describe("Allow this member to hold the PTT floor in voice mode.")
|
|
1120
|
-
});
|
|
1121
|
-
async function invokeChannelMembers(action, body, ctx) {
|
|
1122
|
-
const b = { ...body };
|
|
1123
|
-
if ("identity_id" in b) {
|
|
1124
|
-
b.target_identity_id = b.identity_id;
|
|
1125
|
-
delete b.identity_id;
|
|
1126
|
-
}
|
|
1127
|
-
if ("role" in b) {
|
|
1128
|
-
b.new_role = b.role;
|
|
1129
|
-
delete b.role;
|
|
1130
|
-
}
|
|
1131
|
-
if ("ptt_enabled" in b) {
|
|
1132
|
-
b.can_ptt = b.ptt_enabled;
|
|
1133
|
-
delete b.ptt_enabled;
|
|
1134
|
-
}
|
|
1135
|
-
readSupabaseEnv();
|
|
1136
|
-
ctx.log("debug", `mIRC.${action}`, b);
|
|
1137
|
-
return await invokeFunction("channel-members-manage", { action, ...b });
|
|
1138
|
-
}
|
|
1139
|
-
var mircMembersTools = [
|
|
1140
|
-
{
|
|
1141
|
-
name: "mIRC_join",
|
|
1142
|
-
title: "Join channel",
|
|
1143
|
-
annotations: { readOnlyHint: false },
|
|
1144
|
-
requires: "network",
|
|
1145
|
-
description: "Join a channel as the current user. Pass `password` only for access_mode=password channels; private channels cannot be joined directly (403) \u2014 use mIRC_request_access + approval. Idempotent: an existing active member gets their membership row back (200, no 409).",
|
|
1146
|
-
inputSchema: mIRC_join_input,
|
|
1147
|
-
handler: ((input, ctx) => invokeChannelMembers("join", input, ctx))
|
|
1148
|
-
},
|
|
1149
|
-
{
|
|
1150
|
-
name: "mIRC_request_access",
|
|
1151
|
-
title: "Request channel access",
|
|
1152
|
-
annotations: { readOnlyHint: false },
|
|
1153
|
-
requires: "network",
|
|
1154
|
-
description: "Request access to a password/private channel (your membership goes to state=requested for an admin to approve).",
|
|
1155
|
-
inputSchema: mIRC_request_access_input,
|
|
1156
|
-
handler: ((input, ctx) => invokeChannelMembers("request-access", input, ctx))
|
|
1157
|
-
},
|
|
1158
|
-
{
|
|
1159
|
-
name: "mIRC_leave",
|
|
1160
|
-
title: "Leave channel",
|
|
1161
|
-
annotations: { readOnlyHint: false },
|
|
1162
|
-
requires: "network",
|
|
1163
|
-
description: "Leave a channel as the current user. Owner cannot leave without transferring ownership first.",
|
|
1164
|
-
inputSchema: mIRC_leave_input,
|
|
1165
|
-
handler: ((input, ctx) => invokeChannelMembers("leave", input, ctx))
|
|
1166
|
-
},
|
|
1167
|
-
{
|
|
1168
|
-
name: "mIRC_approve_request",
|
|
1169
|
-
title: "Approve access request",
|
|
1170
|
-
annotations: { readOnlyHint: false },
|
|
1171
|
-
requires: "network",
|
|
1172
|
-
description: "Approve a pending access request (state=requested \u2192 active). Admins / moderators / owner only. Because access requests only exist on non-open (password/private) channels, you must pass wrapped_group_key \u2014 the channel group key wrapped to the approved member's identity key.",
|
|
1173
|
-
inputSchema: mIRC_approve_request_input,
|
|
1174
|
-
handler: ((input, ctx) => invokeChannelMembers("approve-request", input, ctx))
|
|
1175
|
-
},
|
|
1176
|
-
{
|
|
1177
|
-
name: "mIRC_reject_request",
|
|
1178
|
-
title: "Reject access request",
|
|
1179
|
-
annotations: { readOnlyHint: false },
|
|
1180
|
-
requires: "network",
|
|
1181
|
-
description: "Reject a pending access request. Admins / moderators / owner only.",
|
|
1182
|
-
inputSchema: mIRC_reject_request_input,
|
|
1183
|
-
handler: ((input, ctx) => invokeChannelMembers("reject-request", input, ctx))
|
|
1184
|
-
},
|
|
1185
|
-
{
|
|
1186
|
-
name: "mIRC_kick",
|
|
1187
|
-
title: "Kick a member",
|
|
1188
|
-
annotations: { destructiveHint: true },
|
|
1189
|
-
requires: "network",
|
|
1190
|
-
description: "Remove a member from the channel. They can rejoin if not banned. Requires moderator+.",
|
|
1191
|
-
inputSchema: mIRC_kick_input,
|
|
1192
|
-
handler: ((input, ctx) => invokeChannelMembers("kick", input, ctx))
|
|
1193
|
-
},
|
|
1194
|
-
{
|
|
1195
|
-
name: "mIRC_ban",
|
|
1196
|
-
title: "Ban a member",
|
|
1197
|
-
annotations: { destructiveHint: true },
|
|
1198
|
-
requires: "network",
|
|
1199
|
-
description: "Ban a member from the channel. The ban is permanent until you call mIRC_unban. Requires admin+.",
|
|
1200
|
-
inputSchema: mIRC_ban_input,
|
|
1201
|
-
handler: ((input, ctx) => invokeChannelMembers("ban", input, ctx))
|
|
1202
|
-
},
|
|
1203
|
-
{
|
|
1204
|
-
name: "mIRC_unban",
|
|
1205
|
-
title: "Lift a ban",
|
|
1206
|
-
annotations: { readOnlyHint: false },
|
|
1207
|
-
requires: "network",
|
|
1208
|
-
description: "Lift a ban. Requires admin+.",
|
|
1209
|
-
inputSchema: mIRC_unban_input,
|
|
1210
|
-
handler: ((input, ctx) => invokeChannelMembers("unban", input, ctx))
|
|
1211
|
-
},
|
|
1212
|
-
{
|
|
1213
|
-
name: "mIRC_set_role",
|
|
1214
|
-
title: "Set member role",
|
|
1215
|
-
annotations: { readOnlyHint: false },
|
|
1216
|
-
requires: "network",
|
|
1217
|
-
description: "Promote / demote a member. Roles: owner(100) > superadmin(90) > admin(80) > moderator(70) > member(10). No 'guest'. An actor may assign any role below their own tier \u2014 so a superadmin (not only the owner) can promote to admin.",
|
|
1218
|
-
inputSchema: mIRC_set_role_input,
|
|
1219
|
-
handler: ((input, ctx) => invokeChannelMembers("set-role", input, ctx))
|
|
1220
|
-
},
|
|
1221
|
-
{
|
|
1222
|
-
name: "mIRC_set_ptt",
|
|
1223
|
-
title: "Set push-to-talk permission",
|
|
1224
|
-
annotations: { readOnlyHint: false },
|
|
1225
|
-
requires: "network",
|
|
1226
|
-
description: "Grant or revoke PTT floor permission for a member in voice-capable channels (capabilities.ptt=true). Requires moderator+.",
|
|
1227
|
-
inputSchema: mIRC_set_ptt_input,
|
|
1228
|
-
handler: ((input, ctx) => invokeChannelMembers("set-ptt", input, ctx))
|
|
1229
|
-
}
|
|
1230
|
-
];
|
|
1231
|
-
|
|
1232
1283
|
// src/tools/mirc-messages.ts
|
|
1233
1284
|
import { z as z6 } from "zod";
|
|
1234
1285
|
var PROTOCOL_VERSION3 = "mosadd.chat.v1";
|
|
@@ -3231,7 +3282,7 @@ var package_default = {
|
|
|
3231
3282
|
name: "@mosadd/mcp",
|
|
3232
3283
|
version: "3.0.0-alpha.45",
|
|
3233
3284
|
mcpName: "io.github.hei33enberg/mosadd-mcp",
|
|
3234
|
-
description: "Model Context Protocol server for mosadd. Exposes 4 modules (mDM, mIRC, mURL, mAYL) and capabilities (mTALK, mRAG) plus comms agent-actions \u2014
|
|
3285
|
+
description: "Model Context Protocol server for mosadd. Exposes 4 modules (mDM, mIRC, mURL, mAYL) and capabilities (mTALK, mRAG) plus comms agent-actions \u2014 85 tools \u2014 to any agent runtime (Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, custom).",
|
|
3235
3286
|
homepage: "https://github.com/Hei33enberg/mosADD-OS/tree/main/packages/mcp",
|
|
3236
3287
|
repository: {
|
|
3237
3288
|
type: "git",
|
package/dist/index.d.ts
CHANGED
|
@@ -237,12 +237,16 @@ declare function createMosaddServer(options?: MosaddServerOptions): McpServer;
|
|
|
237
237
|
* defensive classification over the threat taxonomy — the surveillance-era
|
|
238
238
|
* *marketing* was killed, the classification engine is real and wanted.
|
|
239
239
|
*
|
|
240
|
-
*
|
|
240
|
+
* 85 callable tools registered — the exact live count is exported as TOOL_COUNT
|
|
241
241
|
* (= allTools.length) below; ALWAYS reference that, never re-hard-code a number that drifts.
|
|
242
|
-
* Breakdown (2026-
|
|
243
|
-
*
|
|
242
|
+
* Breakdown (2026-09-03, from allTools in this tree; the live tools/list on mcp.mosadd.com catches up
|
|
243
|
+
* when the alpha carrying mIRC_invite is published and the gateway redeployed):
|
|
244
|
+
* modules mDM 16 · mIRC 25 · mURL 7 · mAYL 16 = 64; capabilities mTALK 6 · mRAG 8 ·
|
|
244
245
|
* comms 5 (action_create/action_frame_get/embed_create/capabilities/session_attach) · Irondome/threat 2
|
|
245
|
-
* = 21.
|
|
246
|
+
* = 21. 64 + 21 = 85. (mIRC 25 = 24 + mIRC_invite added 2026-09-03 (LINEAR-5870): mIRC_join adds the KEY's
|
|
247
|
+
* identity while channel posts are signed by the AGENT, so every channel created from the toolkit was mute
|
|
248
|
+
* until its agent was added from the app — mIRC_invite wraps channel-members-manage `invite`: own agent →
|
|
249
|
+
* auto_joined, anyone else → invite code. mDM 16 = 14 + mDM_send_as_agent/mDM_list_my_agents added 2026-08-17: an MCP key
|
|
246
250
|
* is bound to a USER, so an agent runtime wired up with its owner's key spoke AS THE OWNER — these
|
|
247
251
|
* let it speak as an agent it OWNS instead, checked server-side. mRAG 8 = 4 search/ingest + 4 mRAG_graph_* traversal tools added 2026-08-11.
|
|
248
252
|
* comms_session_attach added 2026-08-14: a live agent session claims the account's reply lane so
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mosadd/mcp",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.46",
|
|
4
4
|
"mcpName": "io.github.hei33enberg/mosadd-mcp",
|
|
5
|
-
"description": "Model Context Protocol server for mosadd. Exposes 4 modules (mDM, mIRC, mURL, mAYL) and capabilities (mTALK, mRAG) plus comms agent-actions —
|
|
5
|
+
"description": "Model Context Protocol server for mosadd. Exposes 4 modules (mDM, mIRC, mURL, mAYL) and capabilities (mTALK, mRAG) plus comms agent-actions — 85 tools — to any agent runtime (Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, custom).",
|
|
6
6
|
"homepage": "https://github.com/Hei33enberg/mosADD-OS/tree/main/packages/mcp",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -38,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/
|
|
42
|
-
"@mosadd/protocol": "3.0.0-alpha.28",
|
|
41
|
+
"@mosadd/threat-engine": "3.0.0-alpha.28",
|
|
43
42
|
"@mosadd/crypto": "3.0.0-alpha.27",
|
|
44
|
-
"@mosadd/
|
|
43
|
+
"@mosadd/providers": "3.0.0-alpha.27",
|
|
44
|
+
"@mosadd/protocol": "3.0.0-alpha.28"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"tsup": "^8.3.5",
|