@agentcomms/resend 0.13.1 → 0.14.0

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,4 +1,4 @@
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";
1
+ import { A as CHANGE_POLICIES, C as policyChange, Ct as waitCallOptions, E as removeAccountChange, I as CommsError, K as changeToolResult, M as SEND_POLICIES, Nt as VERSION, O as showAccount, P as strictToolArguments, S as policyApprovalRefusal, St as updateToolGate, T as policyWanted, _ as runDoctor, b as listAccounts, c as downloadReceived, d as listReceived, et as gatedChange, f as listScheduled, g as showSentEmail, h as showReceived, i as prepareSend, j as MODES, k as ResendContext, l as getMetrics, lt as refuseUnclaimedApproval, m as listSuppressions, n as executeSend, o as sendStatus, p as listSentEmails, q as checkForUpdates, s as cancelScheduledChange, u as listDomains, w as policyReport, wt as waitForApproval, yt as toCommsError, z as SEND_LOOKUP } from "./send-9pskzeUY.mjs";
2
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
3
  import { t as McpServer } from "./mcp-DXXb3Vv3-kCxsVLO4.mjs";
4
4
  //#region src/mcp/server.ts
@@ -30,8 +30,8 @@ async function buildInstructions(context, pinned) {
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
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`.",
33
+ "you cannot approve it yourself, so say so; resend_send_wait tells you when they have. Under `never` nothing",
34
+ "sends. Never repeat a send whose outcome is unknown: check it with `resend_send_status`.",
35
35
  "",
36
36
  "Read-only is enforced by this package’s own code, not by the key: Resend has no read-only key.",
37
37
  "A key is added only by a person, at their own terminal. Never ask for one in chat.",
@@ -89,7 +89,10 @@ async function createResendMcpServer(options = {}) {
89
89
  channel: "resend",
90
90
  running: VERSION,
91
91
  exempt: ["resend_doctor"],
92
- approvals: { resend_send_status: SEND_LOOKUP },
92
+ approvals: {
93
+ resend_send_status: SEND_LOOKUP,
94
+ resend_send_wait: { lookup: true }
95
+ },
93
96
  refresh: () => checkForUpdates(context.core, context.env)
94
97
  }));
95
98
  /** Which account a call acts on. A pinned server refuses any other, and re-checks the pin against the id. */
@@ -104,6 +107,7 @@ async function createResendMcpServer(options = {}) {
104
107
  return named;
105
108
  };
106
109
  const runChange = async (change, approvalId) => changeToolResult(await gatedChange(context.core, change, {
110
+ channel: "resend",
107
111
  surface: "mcp",
108
112
  approvalId,
109
113
  platform: context.platform
@@ -364,7 +368,7 @@ async function createResendMcpServer(options = {}) {
364
368
  }));
365
369
  server.registerTool("resend_send_status", {
366
370
  title: "Send status",
367
- description: "What happened to a send: the approval, the local record, and Resend’s last event. Read only — it never sends again.",
371
+ description: "What happened to a send: the approval, the local record, and its current `outcome` as Resend’s own last event reports it. One event for the whole email, attributed to Resend — never a word about every recipient; an event this version does not interpret comes only inside <untrusted-content>. Read only — it never sends again.",
368
372
  inputSchema: {
369
373
  ...accountArg,
370
374
  approvalId: string()
@@ -374,6 +378,26 @@ async function createResendMcpServer(options = {}) {
374
378
  const name = await resolve(args.account);
375
379
  return sendStatus(context, name, args.approvalId);
376
380
  }));
381
+ server.registerTool("resend_send_wait", {
382
+ title: "Wait for an approval",
383
+ description: `Wait for an approval — a send or a change — to be usable or finished, and say where it stands: pending (with \`claimable\` true when a yes in the chat can use it), approved, being sent, used, failed, unknown, expired, revoked or corrupt. \`waitSeconds\` is 30 when left out, 300 at most, and 0 for its status now. It only looks: it never approves, claims or sends, and never asks Resend. Ended still waiting, wait again — never prepare it again while it is pending or being sent. The same as \`send wait\` in the Resend CLI.`,
384
+ inputSchema: {
385
+ approvalId: string().describe("the approval to wait for"),
386
+ waitSeconds: number().int().min(0).max(300).optional().describe(`how long to wait: 30 when left out, 300 at most, 0 for the status now`)
387
+ },
388
+ annotations: readsLocal
389
+ }, async (args, ctx) => {
390
+ try {
391
+ return reply(await waitForApproval(context.core, args.approvalId, {
392
+ waitSeconds: args.waitSeconds,
393
+ channel: "resend",
394
+ ...pinnedId === void 0 ? {} : { owner: pinnedId },
395
+ ...waitCallOptions(ctx)
396
+ }));
397
+ } catch (error) {
398
+ return fail(error);
399
+ }
400
+ });
377
401
  server.registerTool("resend_scheduled_list", {
378
402
  title: "Scheduled emails",
379
403
  description: "Emails waiting to be sent later, among the most recent 300 sent, and whether this machine scheduled each.",
@@ -1,4 +1,4 @@
1
- import { t as createResendMcpServer } from "./server-B5FPOBcz.mjs";
1
+ import { t as createResendMcpServer } from "./server-DFbgMT3K.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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentcomms/resend",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
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",
@@ -31,7 +31,7 @@
31
31
  "THIRD_PARTY_LICENSES"
32
32
  ],
33
33
  "dependencies": {
34
- "@agentcomms/core": "0.13.1"
34
+ "@agentcomms/core": "0.14.0"
35
35
  },
36
36
  "optionalDependencies": {
37
37
  "@napi-rs/keyring": "2.1.0"
@@ -86,6 +86,7 @@
86
86
  "inbound-cdn.resend.com"
87
87
  ],
88
88
  "approve": "agent-resend approve",
89
+ "approvalGrouping": "draft",
89
90
  "skills": {
90
91
  "prefix": "resend-",
91
92
  "contract": "skills/_shared/contract-resend.md"
@@ -96,5 +97,5 @@
96
97
  "typecheck": "tsc -p tsconfig.json",
97
98
  "test": "node --experimental-strip-types --test --test-timeout=600000 \"test/**/*.test.ts\""
98
99
  },
99
- "gitHead": "88c1c7f3e0c23ecc05eb0adc03d3446202812179"
100
+ "gitHead": "6f6a9de4c7e18e88d779f04de384fbc4e5397352"
100
101
  }