@mosadd/mcp 3.0.0-alpha.13 → 3.0.0-alpha.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createMosaddServer
4
- } from "../chunk-YLIPGVP7.js";
4
+ } from "../chunk-ZT7IBWW7.js";
5
5
  import "../chunk-Z7WR52GE.js";
6
6
 
7
7
  // src/bin/mcp.ts
@@ -458,8 +458,9 @@ async function mDM_respond_request(input, ctx) {
458
458
  readSupabaseEnv();
459
459
  ctx.log("debug", "mDM_respond_request invoking message-request-respond", input);
460
460
  await invokeFunction("message-request-respond", {
461
+ action: "respond",
461
462
  request_id: input.request_id,
462
- action: input.action
463
+ status: input.action === "accept" ? "accepted" : "rejected"
463
464
  });
464
465
  return { ok: true };
465
466
  }
@@ -734,9 +735,11 @@ async function mIRC_get(input, ctx) {
734
735
  async function mIRC_update(input, ctx) {
735
736
  readSupabaseEnv();
736
737
  ctx.log("debug", "mIRC_update invoking channel-manage", { channel_id: input.channel_id });
738
+ const { topic, ...rest } = input;
739
+ const payload = topic !== void 0 ? { ...rest, description: topic } : { ...rest };
737
740
  return await invokeFunction("channel-manage", {
738
741
  action: "update",
739
- ...input
742
+ ...payload
740
743
  });
741
744
  }
742
745
  async function mIRC_delete(input, ctx) {
@@ -1428,7 +1431,9 @@ async function mAIL_send(input, ctx) {
1428
1431
  throw new Error("mAIL_send requires at least one of body_text or body_html.");
1429
1432
  }
1430
1433
  ctx.log("debug", "mAIL_send invoking mp0st-send", { to: input.to });
1431
- return await invokeFunction("mp0st-send", input);
1434
+ const res = await invokeFunction("mp0st-send", input);
1435
+ if (res.error) throw new Error(res.error);
1436
+ return { message_id: res.email_id ?? "", status: res.status ?? "sent", is_internal: res.is_internal ?? false };
1432
1437
  }
1433
1438
  async function mAIL_view(input, ctx) {
1434
1439
  readSupabaseEnv();
@@ -1857,7 +1862,7 @@ var SupabaseDmProvider = class {
1857
1862
  space_id: "dm",
1858
1863
  thread_id: args.threadId,
1859
1864
  limit: args.limit ?? 50,
1860
- cursor: args.cursor
1865
+ before: args.cursor
1861
1866
  });
1862
1867
  return {
1863
1868
  messages: (data?.messages ?? []).map((m) => ({
@@ -1867,7 +1872,7 @@ var SupabaseDmProvider = class {
1867
1872
  timestamp: m.created_at,
1868
1873
  threadId: m.thread_id
1869
1874
  })),
1870
- nextCursor: data?.next_cursor ?? null
1875
+ nextCursor: data?.has_more ? data?.cursor ?? null : null
1871
1876
  };
1872
1877
  }
1873
1878
  };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  createMosaddServer,
4
4
  defaultProviders,
5
5
  runWithSupabaseEnv
6
- } from "./chunk-YLIPGVP7.js";
6
+ } from "./chunk-ZT7IBWW7.js";
7
7
  import "./chunk-Z7WR52GE.js";
8
8
  export {
9
9
  allTools,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mosadd/mcp",
3
- "version": "3.0.0-alpha.13",
3
+ "version": "3.0.0-alpha.15",
4
4
  "description": "Model Context Protocol server for mosadd. Exposes the 6 live m* modules (mDM, mIRC, mROOM, mTALK, mAIL, mRAG) — 61 tools — to any agent runtime (Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, custom).",
5
5
  "homepage": "https://github.com/Hei33enberg/mosadd-os/tree/main/packages/mcp",
6
6
  "repository": {
@@ -37,8 +37,8 @@
37
37
  "@supabase/supabase-js": "^2.48.0",
38
38
  "zod": "^4.3.6",
39
39
  "@mosadd/crypto": "3.0.0-alpha.4",
40
- "@mosadd/protocol": "3.0.0-alpha.4",
41
- "@mosadd/providers": "3.0.0-alpha.4"
40
+ "@mosadd/providers": "3.0.0-alpha.4",
41
+ "@mosadd/protocol": "3.0.0-alpha.4"
42
42
  },
43
43
  "devDependencies": {
44
44
  "tsup": "^8.3.5",
@@ -95,13 +95,16 @@ export class SupabaseDmProvider implements DmProvider {
95
95
  encrypted_payload: string;
96
96
  created_at: string;
97
97
  }>;
98
- next_cursor?: string | null;
98
+ cursor?: string | null;
99
+ has_more?: boolean;
99
100
  };
101
+ // message-list paginates history via `before` (a created_at marker) and returns
102
+ // the next marker as `cursor` — NOT `cursor` in / `next_cursor` out.
100
103
  const data = await invokeFunction<MessageListResponse>("message-list", {
101
104
  space_id: "dm",
102
105
  thread_id: args.threadId,
103
106
  limit: args.limit ?? 50,
104
- cursor: args.cursor,
107
+ before: args.cursor,
105
108
  });
106
109
  return {
107
110
  messages: (data?.messages ?? []).map((m) => ({
@@ -111,7 +114,7 @@ export class SupabaseDmProvider implements DmProvider {
111
114
  timestamp: m.created_at,
112
115
  threadId: m.thread_id,
113
116
  })),
114
- nextCursor: data?.next_cursor ?? null,
117
+ nextCursor: data?.has_more ? (data?.cursor ?? null) : null,
115
118
  };
116
119
  }
117
120
  }
package/src/tools/mail.ts CHANGED
@@ -127,13 +127,17 @@ interface MailListItem {
127
127
  async function mAIL_send(
128
128
  input: z.infer<typeof mAIL_send_input>,
129
129
  ctx: MosaddToolContext,
130
- ): Promise<{ message_id: string; queued_at: string }> {
130
+ ): Promise<{ message_id: string; status: string; is_internal: boolean }> {
131
131
  readSupabaseEnv();
132
132
  if (!input.body_text && !input.body_html) {
133
133
  throw new Error("mAIL_send requires at least one of body_text or body_html.");
134
134
  }
135
135
  ctx.log("debug", "mAIL_send invoking mp0st-send", { to: input.to });
136
- return await invokeFunction<{ message_id: string; queued_at: string }>("mp0st-send", input);
136
+ // mp0st-send returns { ok, email_id, status, is_internal } — remap email_id to the
137
+ // tool's message_id contract (email_id IS the message id). Surface backend errors.
138
+ const res = await invokeFunction<{ ok?: boolean; email_id?: string; status?: string; is_internal?: boolean; error?: string }>("mp0st-send", input);
139
+ if (res.error) throw new Error(res.error);
140
+ return { message_id: res.email_id ?? "", status: res.status ?? "sent", is_internal: res.is_internal ?? false };
137
141
  }
138
142
 
139
143
  async function mAIL_view(
package/src/tools/mdm.ts CHANGED
@@ -329,9 +329,12 @@ async function mDM_respond_request(
329
329
  ): Promise<{ ok: true }> {
330
330
  readSupabaseEnv();
331
331
  ctx.log("debug", "mDM_respond_request invoking message-request-respond", input);
332
+ // message-request-respond expects action:"respond" + status accepted/rejected
333
+ // (not action:"accept"/"reject"). Map it.
332
334
  await invokeFunction<{ ok: boolean }>("message-request-respond", {
335
+ action: "respond",
333
336
  request_id: input.request_id,
334
- action: input.action,
337
+ status: input.action === "accept" ? "accepted" : "rejected",
335
338
  });
336
339
  return { ok: true };
337
340
  }
package/src/tools/mirc.ts CHANGED
@@ -108,9 +108,13 @@ async function mIRC_update(
108
108
  ): Promise<{ channel: unknown }> {
109
109
  readSupabaseEnv();
110
110
  ctx.log("debug", "mIRC_update invoking channel-manage", { channel_id: input.channel_id });
111
+ // channel-manage reads `description`, not `topic` — map it so topic edits aren't
112
+ // silently dropped.
113
+ const { topic, ...rest } = input as typeof input & { topic?: string };
114
+ const payload = topic !== undefined ? { ...rest, description: topic } : { ...rest };
111
115
  return await invokeFunction<{ channel: unknown }>("channel-manage", {
112
116
  action: "update",
113
- ...input,
117
+ ...payload,
114
118
  });
115
119
  }
116
120