@mosadd/mcp 3.0.0-alpha.3 → 3.0.0-alpha.31

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +224 -0
  2. package/README.md +150 -116
  3. package/dist/bin/mcp.js +42 -3
  4. package/dist/chunk-P4ENU5MW.js +2556 -0
  5. package/dist/index.d.ts +99 -7
  6. package/dist/index.js +7 -3
  7. package/package.json +10 -7
  8. package/src/__tests__/golden-path.test.ts +137 -132
  9. package/src/__tests__/integration.test.ts +179 -175
  10. package/src/__tests__/mdm-e2ee.test.ts +212 -149
  11. package/src/__tests__/mtalk.test.ts +122 -0
  12. package/src/__tests__/server.test.ts +71 -67
  13. package/src/bin/login.ts +138 -138
  14. package/src/bin/mcp.ts +145 -97
  15. package/src/config.ts +66 -66
  16. package/src/crypto/mdm-session.ts +502 -378
  17. package/src/index.ts +19 -17
  18. package/src/observability/sentry.ts +79 -79
  19. package/src/providers/blob-upload.ts +116 -0
  20. package/src/providers/memory-voice.ts +79 -0
  21. package/src/providers/supabase-dm.ts +122 -117
  22. package/src/providers/supabase-voice.ts +91 -0
  23. package/src/providers/supabase.ts +148 -96
  24. package/src/server.ts +123 -103
  25. package/src/tools/actions.ts +162 -0
  26. package/src/tools/attachments.ts +268 -0
  27. package/src/tools/capabilities.ts +68 -68
  28. package/src/tools/embed.ts +108 -0
  29. package/src/tools/index.ts +104 -37
  30. package/src/tools/knowledge.ts +191 -0
  31. package/src/tools/mail-aliases.ts +25 -0
  32. package/src/tools/mail-provenance.ts +135 -0
  33. package/src/tools/mail.ts +381 -89
  34. package/src/tools/mcall.ts +216 -0
  35. package/src/tools/mdm-voice.ts +212 -0
  36. package/src/tools/mdm.ts +479 -379
  37. package/src/tools/mirc-edge.ts +190 -0
  38. package/src/tools/mirc-members.ts +198 -177
  39. package/src/tools/mirc-messages.ts +155 -0
  40. package/src/tools/mirc.ts +190 -170
  41. package/src/tools/mroom-messages.ts +142 -142
  42. package/src/tools/mroom.ts +221 -189
  43. package/src/tools/mtalk.ts +121 -0
  44. package/src/tools/murl.ts +298 -0
  45. package/src/tools/ptt-ingest.ts +97 -0
  46. package/src/tools/threat.ts +119 -0
  47. package/src/types.ts +94 -79
  48. package/src/voice/floor.ts +132 -0
  49. package/dist/chunk-HD5RLE5K.js +0 -1193
@@ -0,0 +1,155 @@
1
+ /**
2
+ * mIRC text mode — post + list messages inside a channel.
3
+ *
4
+ * Channel messages route through the same the mosadd backend's `message-send` / `message-list`
5
+ * Edge Functions as DMs, but with `thread_id: 'chat:<channelId>'` so the
6
+ * RLS / access checks apply channel-membership rules. Each channel is linked to a
7
+ * backing space (`metadata.linked_space_id`); message-send needs that space id, so
8
+ * these tools resolve it from the channel automatically (or accept an override).
9
+ */
10
+
11
+ import { z } from "zod";
12
+ import type { MosaddTool, MosaddToolContext } from "../types.js";
13
+ import { invokeFunction, readSupabaseEnv } from "../providers/supabase.js";
14
+
15
+ const PROTOCOL_VERSION = "mosadd.chat.v1";
16
+
17
+ const ChannelId = z.string().min(1).max(120).describe("Channel id (UUID). From mIRC_create / mIRC_list.");
18
+
19
+ const mIRC_post_message_input = z.object({
20
+ channel_id: ChannelId,
21
+ text: z.string().min(1).max(64_000).describe("Message body (UTF-8). Max 64 KB."),
22
+ reply_to_id: z.string().optional().describe("Optional id of the message being replied to."),
23
+ space_id: z
24
+ .string()
25
+ .optional()
26
+ .describe("Optional backing space id. Resolved automatically from the channel if omitted."),
27
+ });
28
+
29
+ const mIRC_list_messages_input = z.object({
30
+ channel_id: ChannelId,
31
+ limit: z.number().int().min(1).max(200).default(50).optional(),
32
+ cursor: z.string().optional().describe("Opaque pagination cursor from a prior list response."),
33
+ space_id: z.string().optional().describe("Optional backing space id. Resolved automatically if omitted."),
34
+ });
35
+
36
+ // ALPHA: channel messages are NOT end-to-end encrypted here — the body is wrapped
37
+ // in a JSON envelope and base64-encoded (server-readable). The mosadd.com app
38
+ // encrypts channel messages with a per-channel group key, so app clients cannot
39
+ // decrypt these dev-posted plaintext payloads (and vice-versa) until the toolkit
40
+ // adopts the same group-key scheme. See docs/security/e2ee-posture.md.
41
+ function packPlaintextPayload(text: string, replyToId?: string): string {
42
+ const envelope = {
43
+ v: PROTOCOL_VERSION,
44
+ type: "text",
45
+ text,
46
+ reply_to: replyToId ?? null,
47
+ sent_at: new Date().toISOString(),
48
+ };
49
+ return Buffer.from(JSON.stringify(envelope), "utf8").toString("base64");
50
+ }
51
+
52
+ function unpackPayload(payload: string): { text: string } {
53
+ try {
54
+ const obj = JSON.parse(Buffer.from(payload, "base64").toString("utf8"));
55
+ if (typeof obj?.text === "string") return obj;
56
+ } catch {
57
+ /* fall through */
58
+ }
59
+ return { text: "<ciphertext>" };
60
+ }
61
+
62
+ /** Resolve a channel's backing space id (metadata.linked_space_id) via channel-manage. */
63
+ async function resolveLinkedSpaceId(channelId: string): Promise<string> {
64
+ type GetResponse = {
65
+ channel?: { metadata?: { linked_space_id?: string } | null };
66
+ linked_space_id?: string;
67
+ };
68
+ const data = await invokeFunction<GetResponse>("channel-manage", { action: "get", channel_id: channelId });
69
+ const spaceId = data?.linked_space_id ?? data?.channel?.metadata?.linked_space_id;
70
+ if (!spaceId) {
71
+ throw new Error(
72
+ `Channel ${channelId} has no linked space yet. Run mIRC_list (which repairs linked spaces) or mIRC_join first, ` +
73
+ `or pass space_id explicitly.`,
74
+ );
75
+ }
76
+ return spaceId;
77
+ }
78
+
79
+ async function mIRC_post_message(
80
+ input: z.infer<typeof mIRC_post_message_input>,
81
+ ctx: MosaddToolContext,
82
+ ): Promise<{ message_id: string; delivered_at: string; thread_id: string }> {
83
+ readSupabaseEnv();
84
+ const space_id = input.space_id ?? (await resolveLinkedSpaceId(input.channel_id));
85
+ const thread_id = `chat:${input.channel_id}`;
86
+ ctx.log("debug", "mIRC_post_message", { thread_id, space_id });
87
+
88
+ const data = await invokeFunction<{ message?: { id: string; created_at: string } }>("message-send", {
89
+ space_id,
90
+ thread_id,
91
+ encrypted_payload: packPlaintextPayload(input.text, input.reply_to_id),
92
+ message_type: "txt",
93
+ protocol_version: PROTOCOL_VERSION,
94
+ reply_to_id: input.reply_to_id ?? null,
95
+ });
96
+
97
+ if (!data?.message?.id) throw new Error("message-send returned no message id");
98
+ return { message_id: data.message.id, delivered_at: data.message.created_at ?? new Date().toISOString(), thread_id };
99
+ }
100
+
101
+ async function mIRC_list_messages(
102
+ input: z.infer<typeof mIRC_list_messages_input>,
103
+ ctx: MosaddToolContext,
104
+ ): Promise<{
105
+ messages: Array<{ id: string; sender_identity_id: string; text: string; timestamp: string }>;
106
+ next_cursor: string | null;
107
+ }> {
108
+ readSupabaseEnv();
109
+ const space_id = input.space_id ?? (await resolveLinkedSpaceId(input.channel_id));
110
+ const thread_id = `chat:${input.channel_id}`;
111
+ ctx.log("debug", "mIRC_list_messages", { thread_id, space_id });
112
+
113
+ type MessageListResponse = {
114
+ messages?: Array<{ id: string; sender_identity_id: string; encrypted_payload: string; created_at: string }>;
115
+ next_before?: string | null;
116
+ cursor?: string | null;
117
+ };
118
+ // message-list reads `before` (history) / `since` (incremental) — NOT `cursor`.
119
+ // Sending `cursor` left `before` unset → every call returned the newest page.
120
+ const data = await invokeFunction<MessageListResponse>("message-list", {
121
+ space_id,
122
+ thread_id,
123
+ limit: input.limit ?? 50,
124
+ before: input.cursor,
125
+ });
126
+
127
+ return {
128
+ messages: (data?.messages ?? []).map((m) => ({
129
+ id: m.id,
130
+ sender_identity_id: m.sender_identity_id,
131
+ text: unpackPayload(m.encrypted_payload).text,
132
+ timestamp: m.created_at,
133
+ })),
134
+ next_cursor: data?.next_before ?? data?.cursor ?? null,
135
+ };
136
+ }
137
+
138
+ export const mircMessagesTools: MosaddTool[] = [
139
+ {
140
+ name: "mIRC_post_message",
141
+ requires: "network",
142
+ description:
143
+ "Post a text message into a persistent channel (mIRC). Pass channel_id from mIRC_create / mIRC_list; the backing space is resolved automatically. You must be a member of private channels (use mIRC_join first). This is how an agent actually talks in a channel — the other mIRC_* tools only manage it. NOTE (alpha): the payload is NOT end-to-end encrypted — it is plaintext base64 and is readable by the server; the mosadd.com app uses per-channel group-key encryption, so app clients cannot read these messages yet (and vice-versa). Group-key parity is planned.",
144
+ inputSchema: mIRC_post_message_input,
145
+ handler: mIRC_post_message as MosaddTool["handler"],
146
+ },
147
+ {
148
+ name: "mIRC_list_messages",
149
+ requires: "network",
150
+ description:
151
+ "List recent text messages in a persistent channel (mIRC), newest first, cursor-paginated. Pass channel_id; the backing space is resolved automatically.",
152
+ inputSchema: mIRC_list_messages_input,
153
+ handler: mIRC_list_messages as MosaddTool["handler"],
154
+ },
155
+ ];
package/src/tools/mirc.ts CHANGED
@@ -1,170 +1,190 @@
1
- /**
2
- * mIRC — Persistent Channels.
3
- *
4
- * IRC-style persistent channels (Discord/Slack semantics). Channels live forever
5
- * until deleted, members come and go. Distinct from mROOM (ephemeral, no-account).
6
- *
7
- * Phase 1 alpha: wired to m0ssad-3 `channel-manage` Edge Function (strangler-fig).
8
- * The single edge fn dispatches on `action` — we expose each action as its own
9
- * MCP tool for clarity.
10
- */
11
-
12
- import { z } from "zod";
13
- import type { MosaddTool, MosaddToolContext } from "../types.js";
14
- import { invokeFunction, readSupabaseEnv } from "../providers/supabase.js";
15
-
16
- // ---- Schemas ----
17
-
18
- const ChannelId = z
19
- .string()
20
- .min(1)
21
- .max(120)
22
- .describe("Channel id (UUID). Use mIRC_list to discover available channels.");
23
-
24
- const AccessMode = z
25
- .enum(["public", "private", "invite_only"])
26
- .describe("public: anyone joins · private: requires invite + password · invite_only: invite only.");
27
-
28
- const Capabilities = z
29
- .object({
30
- txt: z.boolean().default(true),
31
- ptt: z.boolean().default(false),
32
- live: z.boolean().default(false),
33
- })
34
- .describe("Which modes are enabled in this channel: txt (text), ptt (push-to-talk voice), live (live stream).")
35
- .optional();
36
-
37
- const mIRC_create_input = z.object({
38
- name: z.string().min(1).max(80).describe("Channel display name."),
39
- topic: z.string().max(500).optional().describe("Optional channel topic/description."),
40
- access_mode: AccessMode.default("public"),
41
- password: z.string().min(6).max(120).optional().describe("Password (only for access_mode=private)."),
42
- capabilities: Capabilities,
43
- });
44
-
45
- const mIRC_list_input = z.object({
46
- limit: z.number().int().min(1).max(500).default(100).optional(),
47
- offset: z.number().int().min(0).default(0).optional(),
48
- access_mode: AccessMode.optional().describe("Filter to a single access mode."),
49
- });
50
-
51
- const mIRC_get_input = z.object({
52
- channel_id: ChannelId,
53
- });
54
-
55
- const mIRC_update_input = z.object({
56
- channel_id: ChannelId,
57
- name: z.string().min(1).max(80).optional(),
58
- topic: z.string().max(500).optional(),
59
- access_mode: AccessMode.optional(),
60
- capabilities: Capabilities,
61
- });
62
-
63
- const mIRC_delete_input = z.object({
64
- channel_id: ChannelId,
65
- });
66
-
67
- // ---- Handlers ----
68
-
69
- async function mIRC_create(
70
- input: z.infer<typeof mIRC_create_input>,
71
- ctx: MosaddToolContext,
72
- ): Promise<{ channel: unknown }> {
73
- readSupabaseEnv();
74
- ctx.log("debug", "mIRC_create invoking channel-manage", { name: input.name });
75
- return await invokeFunction<{ channel: unknown }>("channel-manage", {
76
- action: "create",
77
- ...input,
78
- });
79
- }
80
-
81
- async function mIRC_list(
82
- input: z.infer<typeof mIRC_list_input>,
83
- ctx: MosaddToolContext,
84
- ): Promise<{ channels: unknown[] }> {
85
- readSupabaseEnv();
86
- ctx.log("debug", "mIRC_list invoking channel-manage");
87
- return await invokeFunction<{ channels: unknown[] }>("channel-manage", {
88
- action: "list",
89
- ...input,
90
- });
91
- }
92
-
93
- async function mIRC_get(
94
- input: z.infer<typeof mIRC_get_input>,
95
- ctx: MosaddToolContext,
96
- ): Promise<{ channel: unknown }> {
97
- readSupabaseEnv();
98
- ctx.log("debug", "mIRC_get invoking channel-manage", { channel_id: input.channel_id });
99
- return await invokeFunction<{ channel: unknown }>("channel-manage", {
100
- action: "get",
101
- channel_id: input.channel_id,
102
- });
103
- }
104
-
105
- async function mIRC_update(
106
- input: z.infer<typeof mIRC_update_input>,
107
- ctx: MosaddToolContext,
108
- ): Promise<{ channel: unknown }> {
109
- readSupabaseEnv();
110
- ctx.log("debug", "mIRC_update invoking channel-manage", { channel_id: input.channel_id });
111
- return await invokeFunction<{ channel: unknown }>("channel-manage", {
112
- action: "update",
113
- ...input,
114
- });
115
- }
116
-
117
- async function mIRC_delete(
118
- input: z.infer<typeof mIRC_delete_input>,
119
- ctx: MosaddToolContext,
120
- ): Promise<{ deleted: true }> {
121
- readSupabaseEnv();
122
- ctx.log("debug", "mIRC_delete invoking channel-manage", { channel_id: input.channel_id });
123
- await invokeFunction<{ deleted: boolean }>("channel-manage", {
124
- action: "delete",
125
- channel_id: input.channel_id,
126
- });
127
- return { deleted: true };
128
- }
129
-
130
- // ---- Registration ----
131
-
132
- export const mircTools: MosaddTool[] = [
133
- {
134
- name: "mIRC_create",
135
- requires: "network",
136
- description:
137
- "Create a new persistent channel (Discord/Slack-style). Set access_mode to public for open join, private for password-gated, invite_only for explicit invites. capabilities controls modes (txt/ptt/live).",
138
- inputSchema: mIRC_create_input,
139
- handler: mIRC_create as MosaddTool["handler"],
140
- },
141
- {
142
- name: "mIRC_list",
143
- requires: "network",
144
- description:
145
- "List channels available to the current user. Optionally filter by access_mode.",
146
- inputSchema: mIRC_list_input,
147
- handler: mIRC_list as MosaddTool["handler"],
148
- },
149
- {
150
- name: "mIRC_get",
151
- requires: "network",
152
- description: "Get full details of a single channel by id.",
153
- inputSchema: mIRC_get_input,
154
- handler: mIRC_get as MosaddTool["handler"],
155
- },
156
- {
157
- name: "mIRC_update",
158
- requires: "network",
159
- description: "Update channel metadata (name, topic, access_mode, capabilities). Owner only.",
160
- inputSchema: mIRC_update_input,
161
- handler: mIRC_update as MosaddTool["handler"],
162
- },
163
- {
164
- name: "mIRC_delete",
165
- requires: "network",
166
- description: "Delete a channel and cascade-remove its members. Owner only.",
167
- inputSchema: mIRC_delete_input,
168
- handler: mIRC_delete as MosaddTool["handler"],
169
- },
170
- ];
1
+ /**
2
+ * mIRC — Persistent Channels.
3
+ *
4
+ * IRC-style persistent channels (Discord/Slack semantics). Channels live forever
5
+ * until deleted, members come and go. Ephemeral / no-account / single-action
6
+ * channels are PRESETS of mIRC (planned: LINEAR-3523 — TTL `expires_at` +
7
+ * guest-link + voice), not a separate module. The killed mROOM is absorbed here.
8
+ *
9
+ * Phase 1 alpha: wired to the mosadd backend's `channel-manage` Edge Function (strangler-fig).
10
+ * The single edge fn dispatches on `action` — we expose each action as its own
11
+ * MCP tool for clarity.
12
+ */
13
+
14
+ import { z } from "zod";
15
+ import type { MosaddTool, MosaddToolContext } from "../types.js";
16
+ import { invokeFunction, readSupabaseEnv } from "../providers/supabase.js";
17
+
18
+ // ---- Schemas ----
19
+
20
+ const ChannelId = z
21
+ .string()
22
+ .min(1)
23
+ .max(120)
24
+ .describe("Channel id (UUID). Use mIRC_list to discover available channels.");
25
+
26
+ const AccessMode = z
27
+ .enum(["open", "password", "private"])
28
+ .describe("open: anyone can join · password: join with a shared password · private: invite-only.");
29
+
30
+ const Capabilities = z
31
+ .object({
32
+ txt: z.boolean().default(true),
33
+ ptt: z.boolean().default(false),
34
+ live: z.boolean().default(false),
35
+ })
36
+ .describe("Which modes are enabled in this channel: txt (text), ptt (push-to-talk voice), live (live stream).")
37
+ .optional();
38
+
39
+ const mIRC_create_input = z.object({
40
+ name: z.string().min(1).max(80).describe("Channel display name."),
41
+ topic: z.string().max(500).optional().describe("Optional channel topic/description."),
42
+ access_mode: AccessMode.default("open"),
43
+ password: z.string().min(6).max(120).optional().describe("Password (only for access_mode=password)."),
44
+ capabilities: Capabilities,
45
+ wrapped_group_key: z
46
+ .string()
47
+ .optional()
48
+ .describe(
49
+ "Required for access_mode=password|private (these are E2EE channels): 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.",
50
+ ),
51
+ });
52
+
53
+ const mIRC_list_input = z.object({
54
+ limit: z.number().int().min(1).max(500).default(100).optional(),
55
+ offset: z.number().int().min(0).default(0).optional(),
56
+ // NOTE: an access_mode filter was removed — channel-manage's list branch doesn't
57
+ // filter by it (it was a silent no-op). Filter client-side on the returned
58
+ // access_mode field. Server-side filtering is tracked in the consistency ticket.
59
+ });
60
+
61
+ const mIRC_get_input = z.object({
62
+ channel_id: ChannelId,
63
+ });
64
+
65
+ const mIRC_update_input = z.object({
66
+ channel_id: ChannelId,
67
+ name: z.string().min(1).max(80).optional(),
68
+ topic: z.string().max(500).optional(),
69
+ // NOTE: access_mode was removed — channel-manage's update branch ignores it, and
70
+ // switching an existing channel to/from an E2EE (password/private) mode needs
71
+ // group-key handling that isn't wired yet. Recreate the channel to change mode.
72
+ capabilities: Capabilities,
73
+ });
74
+
75
+ const mIRC_delete_input = z.object({
76
+ channel_id: ChannelId,
77
+ });
78
+
79
+ // ---- Handlers ----
80
+
81
+ async function mIRC_create(
82
+ input: z.infer<typeof mIRC_create_input>,
83
+ ctx: MosaddToolContext,
84
+ ): Promise<{ channel: unknown }> {
85
+ readSupabaseEnv();
86
+ ctx.log("debug", "mIRC_create invoking channel-manage", { name: input.name });
87
+ // channel-manage reads `description`, not `topic` — map it so the channel
88
+ // topic isn't silently dropped on create (the update handler does the same).
89
+ const { topic, ...rest } = input as typeof input & { topic?: string };
90
+ const payload = topic !== undefined ? { ...rest, description: topic } : { ...rest };
91
+ return await invokeFunction<{ channel: unknown }>("channel-manage", {
92
+ action: "create",
93
+ ...payload,
94
+ });
95
+ }
96
+
97
+ async function mIRC_list(
98
+ input: z.infer<typeof mIRC_list_input>,
99
+ ctx: MosaddToolContext,
100
+ ): Promise<{ channels: unknown[] }> {
101
+ readSupabaseEnv();
102
+ ctx.log("debug", "mIRC_list invoking channel-manage");
103
+ return await invokeFunction<{ channels: unknown[] }>("channel-manage", {
104
+ action: "list",
105
+ ...input,
106
+ });
107
+ }
108
+
109
+ async function mIRC_get(
110
+ input: z.infer<typeof mIRC_get_input>,
111
+ ctx: MosaddToolContext,
112
+ ): Promise<{ channel: unknown }> {
113
+ readSupabaseEnv();
114
+ ctx.log("debug", "mIRC_get invoking channel-manage", { channel_id: input.channel_id });
115
+ return await invokeFunction<{ channel: unknown }>("channel-manage", {
116
+ action: "get",
117
+ channel_id: input.channel_id,
118
+ });
119
+ }
120
+
121
+ async function mIRC_update(
122
+ input: z.infer<typeof mIRC_update_input>,
123
+ ctx: MosaddToolContext,
124
+ ): Promise<{ channel: unknown }> {
125
+ readSupabaseEnv();
126
+ ctx.log("debug", "mIRC_update invoking channel-manage", { channel_id: input.channel_id });
127
+ // channel-manage reads `description`, not `topic` — map it so topic edits aren't
128
+ // silently dropped.
129
+ const { topic, ...rest } = input as typeof input & { topic?: string };
130
+ const payload = topic !== undefined ? { ...rest, description: topic } : { ...rest };
131
+ return await invokeFunction<{ channel: unknown }>("channel-manage", {
132
+ action: "update",
133
+ ...payload,
134
+ });
135
+ }
136
+
137
+ async function mIRC_delete(
138
+ input: z.infer<typeof mIRC_delete_input>,
139
+ ctx: MosaddToolContext,
140
+ ): Promise<{ deleted: true }> {
141
+ readSupabaseEnv();
142
+ ctx.log("debug", "mIRC_delete invoking channel-manage", { channel_id: input.channel_id });
143
+ await invokeFunction<{ deleted: boolean }>("channel-manage", {
144
+ action: "delete",
145
+ channel_id: input.channel_id,
146
+ });
147
+ return { deleted: true };
148
+ }
149
+
150
+ // ---- Registration ----
151
+
152
+ export const mircTools: MosaddTool[] = [
153
+ {
154
+ name: "mIRC_create",
155
+ requires: "network",
156
+ description:
157
+ "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/ptt/live). NOTE: password and private channels are end-to-end encrypted — you must supply wrapped_group_key (the group key wrapped to your identity key); open channels do not need it.",
158
+ inputSchema: mIRC_create_input,
159
+ handler: mIRC_create as MosaddTool["handler"],
160
+ },
161
+ {
162
+ name: "mIRC_list",
163
+ requires: "network",
164
+ description:
165
+ "List channels available to the current user.",
166
+ inputSchema: mIRC_list_input,
167
+ handler: mIRC_list as MosaddTool["handler"],
168
+ },
169
+ {
170
+ name: "mIRC_get",
171
+ requires: "network",
172
+ description: "Get full details of a single channel by id.",
173
+ inputSchema: mIRC_get_input,
174
+ handler: mIRC_get as MosaddTool["handler"],
175
+ },
176
+ {
177
+ name: "mIRC_update",
178
+ requires: "network",
179
+ description: "Update channel metadata (name, topic, capabilities). Owner only. Access mode is fixed at creation — recreate the channel to change it.",
180
+ inputSchema: mIRC_update_input,
181
+ handler: mIRC_update as MosaddTool["handler"],
182
+ },
183
+ {
184
+ name: "mIRC_delete",
185
+ requires: "network",
186
+ description: "Delete a channel and cascade-remove its members. Owner only.",
187
+ inputSchema: mIRC_delete_input,
188
+ handler: mIRC_delete as MosaddTool["handler"],
189
+ },
190
+ ];