@agentcomms/resend 0.12.3 → 0.13.1

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.
@@ -1,6 +1,6 @@
1
- import { A as CHANGE_POLICIES, C as policyChange, E as removeAccountChange, G as changeToolResult, I as CommsError, K as checkForUpdates, M as SEND_POLICIES, O as showAccount, P as strictToolArguments, R as SEND_LOOKUP, S as policyApprovalRefusal, T as policyWanted, Z as gatedChange, _ as runDoctor, b as listAccounts, c as downloadReceived, d as listReceived, f as listScheduled, ft as toCommsError, g as showSentEmail, h as showReceived, ht as updateToolGate, i as prepareSend, j as MODES, k as ResendContext, l as getMetrics, m as listSuppressions, n as executeSend, o as sendStatus, p as listSentEmails, rt as refuseUnclaimedApproval, s as cancelScheduledChange, u as listDomains, w as policyReport, xt as VERSION } from "./send-BedjeO_M.mjs";
2
- import { S as union, c as boolean, g as object, h as number, s as array, x as string } from "./schemas-DiGKNDNq.mjs";
3
- import { t as McpServer } from "./mcp-DXXb3Vv3-Co5BzjYe.mjs";
1
+ import { $ as gatedChange, A as CHANGE_POLICIES, C as policyChange, Dt as VERSION, E as removeAccountChange, I as CommsError, K as changeToolResult, M as SEND_POLICIES, O as showAccount, P as strictToolArguments, S as policyApprovalRefusal, T as policyWanted, _ as runDoctor, b as listAccounts, c as downloadReceived, d as listReceived, f as listScheduled, g as showSentEmail, gt as toCommsError, h as showReceived, i as prepareSend, j as MODES, k as ResendContext, l as getMetrics, m as listSuppressions, n as executeSend, o as sendStatus, p as listSentEmails, q as checkForUpdates, s as cancelScheduledChange, st as refuseUnclaimedApproval, u as listDomains, w as policyReport, yt as updateToolGate, z as SEND_LOOKUP } from "./send-DtBNDnE4.mjs";
2
+ import { S as union, c as boolean, g as object, h as number, s as array, x as string } from "./iso-USuVU_sk.mjs";
3
+ import { t as McpServer } from "./mcp-DXXb3Vv3-kCxsVLO4.mjs";
4
4
  //#region src/mcp/server.ts
5
5
  const MAX_LISTED = 8;
6
6
  function listOf(names) {
@@ -29,19 +29,19 @@ async function buildInstructions(context, pinned) {
29
29
  "",
30
30
  "Sending needs a person’s yes to that exact email. `resend_send_prepare` returns a preview: show it in full and",
31
31
  "wait. Under the account’s `chat` policy `resend_send_execute` then sends it, once. Under `confirm` — and always",
32
- "above 10 recipients — the person runs `agent-resend approve <id>` at their own terminal; you cannot approve it",
33
- "yourself, so say so and wait. Under `never` nothing sends. Never repeat a send whose outcome is unknown: check",
34
- "it with `resend_send_status`.",
32
+ "above 10 recipients — the person runs the approve command the preparation gives, at their own terminal;",
33
+ "you cannot approve it yourself, so say so and wait. Under `never` nothing sends. Never repeat a send whose",
34
+ "outcome is unknown: check it with `resend_send_status`.",
35
35
  "",
36
- "Read-only is enforced by agent-resend, not by the key: Resend has no read-only key.",
37
- "A key is added only by a person at a terminal (`agent-resend account add`). Never ask for one in chat.",
36
+ "Read-only is enforced by this package’s own code, not by the key: Resend has no read-only key.",
37
+ "A key is added only by a person, at their own terminal. Never ask for one in chat.",
38
38
  "",
39
39
  pinned ? `This server is pinned to "${pinned}"; the account argument may be omitted.` : "Pass `account` on every call — there is no default.",
40
40
  names.length > 0 ? `Known accounts — "can send" means only after a person approves: ${listOf(names)}.` : "No account is connected yet.",
41
41
  "",
42
42
  "Changing an account (send mode, a looser policy, removing it) or cancelling an email scheduled elsewhere returns",
43
43
  "`approvalRequired` and a preview: show it and ask. Under the `chat` change policy call again with `approvalId`",
44
- "after their yes; under `confirm` they run `agent-resend approve <id>` first. Tightening applies at once."
44
+ "after their yes; under `confirm` they first run the approve command the result gives. Tightening applies at once."
45
45
  ].join("\n");
46
46
  }
47
47
  async function createResendMcpServer(options = {}) {
@@ -56,7 +56,7 @@ async function createResendMcpServer(options = {}) {
56
56
  version: VERSION
57
57
  }, { instructions: await buildInstructions(context, pinned) });
58
58
  const reply = (data) => {
59
- const structured = data;
59
+ const structured = JSON.parse(JSON.stringify(data));
60
60
  return {
61
61
  structuredContent: structured,
62
62
  content: [{
@@ -67,12 +67,12 @@ async function createResendMcpServer(options = {}) {
67
67
  };
68
68
  const fail = (error) => {
69
69
  const comms = toCommsError(error);
70
- const structured = { error: {
70
+ const structured = JSON.parse(JSON.stringify({ error: {
71
71
  code: comms.code,
72
72
  message: comms.message,
73
73
  hint: comms.hint ?? null,
74
74
  ...comms.details !== void 0 ? { details: comms.details } : {}
75
- } };
75
+ } }));
76
76
  return {
77
77
  isError: true,
78
78
  structuredContent: structured,
@@ -106,7 +106,6 @@ async function createResendMcpServer(options = {}) {
106
106
  const runChange = async (change, approvalId) => changeToolResult(await gatedChange(context.core, change, {
107
107
  surface: "mcp",
108
108
  approvalId,
109
- approveCommand: "agent-resend approve",
110
109
  platform: context.platform
111
110
  }));
112
111
  const readsResend = {
@@ -118,7 +117,7 @@ async function createResendMcpServer(options = {}) {
118
117
  openWorldHint: false
119
118
  };
120
119
  const accountArg = { account: string().optional().describe("which account, as `organisation/resend`") };
121
- const approvalArg = { approvalId: string().optional().describe("the approval the preview named, once the person has agreed (or run `agent-resend approve`)") };
120
+ const approvalArg = { approvalId: string().optional().describe("the approval the preview named, once the person has agreed (or run the approve command it gave)") };
122
121
  const number$1 = union([number(), string()]);
123
122
  const words = (values) => string().meta({ enum: [...values] });
124
123
  const paging = {
@@ -134,7 +133,7 @@ async function createResendMcpServer(options = {}) {
134
133
  };
135
134
  server.registerTool("resend_accounts_list", {
136
135
  title: "List accounts",
137
- description: "The connected Resend accounts: each key’s permission, its mode, its send policy, and who enforces what. Read-only is agent-resend’s own promise, never the key’s.",
136
+ description: "The connected Resend accounts: each key’s permission, its mode, its send policy, and who enforces what. Read-only is this package’s own promise, never the key’s.",
138
137
  inputSchema: {},
139
138
  annotations: readsLocal
140
139
  }, wrapped(async () => {
@@ -149,7 +148,7 @@ async function createResendMcpServer(options = {}) {
149
148
  }, wrapped(async (args) => showAccount(context, await resolve(args.account))));
150
149
  server.registerTool("resend_account_remove", {
151
150
  title: "Remove an account",
152
- description: "Forget an account and delete its key from this machine. Returns `approvalRequired` and a preview first: show it and ask; call again with `approvalId` after their yes (under `confirm`, after they run `agent-resend approve <id>` — you cannot approve it yourself).",
151
+ description: "Forget an account and delete its key from this machine. Returns `approvalRequired` and a preview first: show it and ask; call again with `approvalId` after their yes (under `confirm`, after they run the approve command the result gives — you cannot approve it yourself).",
153
152
  inputSchema: {
154
153
  ...accountArg,
155
154
  ...approvalArg
@@ -195,7 +194,7 @@ async function createResendMcpServer(options = {}) {
195
194
  }));
196
195
  server.registerTool("resend_doctor", {
197
196
  title: "Doctor",
198
- description: "What works and what does not, per account — and, plainly, that read-only is enforced by agent-resend’s code, not by the key.",
197
+ description: "What works and what does not, per account — and, plainly, that read-only is enforced by this package’s code, not by the key.",
199
198
  inputSchema: {
200
199
  ...accountArg,
201
200
  offline: boolean().optional().describe("do not ask Resend anything")
@@ -339,7 +338,7 @@ async function createResendMcpServer(options = {}) {
339
338
  }));
340
339
  server.registerTool("resend_send_execute", {
341
340
  title: "Send a prepared email",
342
- description: "Send a prepared email, once, after the person approved its preview. Under `confirm` the person must first run `agent-resend approve <approvalId>` at their own terminal — you cannot approve it yourself. `expect` restates the recipients and subject shown. Never call it again for an email whose outcome is unknown: use `resend_send_status`.",
341
+ description: "Send a prepared email, once, after the person approved its preview. Under `confirm` the person must first run the approve command `resend_send_prepare` gave, at their own terminal — you cannot approve it yourself. `expect` restates the recipients and subject shown. Never call it again for an email whose outcome is unknown: use `resend_send_status`.",
343
342
  inputSchema: {
344
343
  ...accountArg,
345
344
  approvalId: string().describe("the approval `resend_send_prepare` returned"),
@@ -402,7 +401,7 @@ async function createResendMcpServer(options = {}) {
402
401
  return {
403
402
  server,
404
403
  async connectStdio() {
405
- const { StdioServerTransport } = await import("./stdio-BR8R87El.mjs");
404
+ const { StdioServerTransport } = await import("./stdio-q4c3585j.mjs");
406
405
  const transport = new StdioServerTransport();
407
406
  const closed = new Promise((settle) => {
408
407
  transport.onclose = () => settle();
@@ -1,5 +1,5 @@
1
- import { A as NEVER, C as unknown, E as toJSONSchema, S as union, T as safeParse, _ as optional, a as _null, c as boolean, d as intersection, f as lazy, g as object, h as number, i as _enum, l as discriminatedUnion, m as looseObject, o as any, p as literal, s as array, u as email, v as preprocess, w as url, x as string, y as record } from "./schemas-DiGKNDNq.mjs";
2
- import { i as ZodIssueCode, n as date, r as datetime, t as number$1 } from "./coerce-BscjcmYU.mjs";
1
+ import { C as unknown, E as toJSONSchema, O as NEVER, S as union, T as safeParse, _ as optional, a as _null, c as boolean, d as intersection, f as lazy, g as object, h as number, i as _enum, l as discriminatedUnion, m as looseObject, n as datetime, o as any, p as literal, s as array, t as date, u as email, v as preprocess, w as url, x as string, y as record } from "./iso-USuVU_sk.mjs";
2
+ import { n as ZodIssueCode, t as number$1 } from "./coerce-CqGigABD.mjs";
3
3
  const SUPPORTED_PROTOCOL_VERSIONS = [
4
4
  "2025-11-25",
5
5
  "2025-06-18",
@@ -1,4 +1,4 @@
1
- import { a as ReadBuffer, c as SdkErrorCode, k as serializeMessage, s as SdkError } from "./src-D_zzAWoS-BhK0GFdq-XAvBzdGB.mjs";
1
+ import { a as ReadBuffer, c as SdkErrorCode, k as serializeMessage, s as SdkError } from "./src-D_zzAWoS-BhK0GFdq-oo-8IJem.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import process$1 from "node:process";
4
4
  import { PassThrough } from "node:stream";
@@ -1,4 +1,4 @@
1
- import { t as createResendMcpServer } from "./server-Bq2OYONI.mjs";
1
+ import { t as createResendMcpServer } from "./server-B5FPOBcz.mjs";
2
2
  //#region src/mcp/stdio-entry.ts
3
3
  /**
4
4
  * Starting the stdio server. On stdio, **stdout is the protocol**: one stray `console.log` corrupts the stream, so
@@ -1,4 +1,4 @@
1
- import { i as serializeMessage, n as process, r as ReadBuffer } from "./mcp-DXXb3Vv3-Co5BzjYe.mjs";
1
+ import { i as serializeMessage, n as process, r as ReadBuffer } from "./mcp-DXXb3Vv3-kCxsVLO4.mjs";
2
2
  //#region ../../node_modules/.pnpm/@modelcontextprotocol+server@2.0.0/node_modules/@modelcontextprotocol/server/dist/stdio.mjs
3
3
  /**
4
4
  * Server transport for stdio: this communicates with an MCP client by reading from the current process' `stdin` and writing to `stdout`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentcomms/resend",
3
- "version": "0.12.3",
3
+ "version": "0.13.1",
4
4
  "description": "Resend for coding agents: read domains, sent and received mail, metrics and suppressions, and send mail that nothing sends without a person's approval of exactly what goes out.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,6 +30,9 @@
30
30
  "LICENSE",
31
31
  "THIRD_PARTY_LICENSES"
32
32
  ],
33
+ "dependencies": {
34
+ "@agentcomms/core": "0.13.1"
35
+ },
33
36
  "optionalDependencies": {
34
37
  "@napi-rs/keyring": "2.1.0"
35
38
  },
@@ -37,8 +40,7 @@
37
40
  "@modelcontextprotocol/client": "2.0.0",
38
41
  "@modelcontextprotocol/server": "^2.0.0",
39
42
  "commander": "^15.0.0",
40
- "zod": "^4.6.5",
41
- "@agentcomms/core": "0.12.3"
43
+ "zod": "^4.6.5"
42
44
  },
43
45
  "publishConfig": {
44
46
  "access": "public"
@@ -65,7 +67,7 @@
65
67
  "guarantee": {
66
68
  "ceiling": "code",
67
69
  "floor": "code",
68
- "why": "Resend has no read-only key, and a full-access key can also manage domains and keys: read mode, and send mode's limit to sending, are enforced by agent-resend's own code. A sending-access key can only send, and Resend enforces that."
70
+ "why": "Resend has no read-only key, and a full-access key can also manage domains and keys: read mode, and send mode's limit to sending, are enforced by this package's own code. A sending-access key can only send, and Resend enforces that."
69
71
  }
70
72
  },
71
73
  "narrowing": [
@@ -94,5 +96,5 @@
94
96
  "typecheck": "tsc -p tsconfig.json",
95
97
  "test": "node --experimental-strip-types --test --test-timeout=600000 \"test/**/*.test.ts\""
96
98
  },
97
- "gitHead": "1945e1e3a0532c20d3da33ad9f84ceeda88c30a2"
99
+ "gitHead": "88c1c7f3e0c23ecc05eb0adc03d3446202812179"
98
100
  }