@agentcomms/resend 0.8.0 → 0.9.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.
package/dist/cli.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { B as canPrompt, C as policyReport, D as showAccount, E as sendPolicyOf, F as CommsError, G as gatedChangeAtTerminal, H as colorEnabled, I as EXIT_CODES, J as renderInstall, K as installExitStatus, L as agentMarker, M as checkNewName, O as ResendContext, P as CHANNEL_SERVERS, Q as serverPruneChange, R as approvalKind, S as policyChange, T as removeAccountChange, U as escapeForDisplay, X as runCommand, Y as renderPrune, Z as serverInstallChange, _ as runDoctor, a as revokeSendApproval, b as listAccounts, c as downloadReceived, d as listReceived, et as truncateDisplay, f as listScheduled, g as showSentEmail, h as showReceived, i as prepareSend, l as getMetrics, m as listSuppressions, n as executeSend, o as sendStatus, ot as VERSION, p as listSentEmails, q as paint, r as finishSendApproval, s as cancelScheduledChange, t as beginSendApproval, tt as writeResult, u as listDomains, v as addAccountChange, w as policyWanted, x as modeOf, y as inspectKey, z as approveChangeAtTerminal } from "./send-BpwXJL8C.mjs";
2
+ import { $ as openCore, B as approvalKind, C as policyChange, D as sendPolicyOf, E as removeAccountChange, F as CHANNEL_SERVERS, H as approveChangeAtTerminal, I as CommsError, J as escapeForDisplay, K as colorEnabled, L as EXIT_CODES, N as checkNewName, O as showAccount, Q as installExitStatus, R as SEND_LOOKUP, S as policyApprovalRefusal, T as policyWanted, U as canPrompt, V as approvalsOf, Y as exemptFromUpdateGate, Z as gatedChangeAtTerminal, _ as runDoctor, _t as VERSION, a as revokeSendApproval, at as serverInstallChange, b as listAccounts, c as downloadReceived, d as listReceived, et as paint, f as listScheduled, ft as writeResult, g as showSentEmail, h as showReceived, i as prepareSend, it as runCommand, k as ResendContext, l as getMetrics, lt as truncateDisplay, m as listSuppressions, n as executeSend, nt as renderInstall, o as sendStatus, ot as serverPruneChange, p as listSentEmails, q as commandPathOf, r as finishSendApproval, rt as renderPrune, s as cancelScheduledChange, st as terminalUpdateHooks, t as beginSendApproval, tt as refuseUnclaimedApproval, u as listDomains, ut as updateGateAtTerminal, v as addAccountChange, w as policyReport, x as modeOf, y as inspectKey, z as agentMarker } from "./send-D9aAM9kv.mjs";
3
3
  import path from "node:path";
4
+ import childProcess from "node:child_process";
4
5
  import { createInterface } from "node:readline/promises";
5
6
  import { stripVTControlCharacters } from "node:util";
6
- import childProcess from "node:child_process";
7
7
  import fs from "node:fs";
8
8
  import process$1 from "node:process";
9
9
  import { EventEmitter } from "node:events";
@@ -3160,7 +3160,8 @@ Getting started:
3160
3160
  agent-resend received list --account acme/resend
3161
3161
  agent-resend mcp install --client claude-code register the server with an agent, once a person approves it
3162
3162
 
3163
- Exit codes: 0 ok · 1 unexpected · 10 a send or a change was refused or needs approval · 64 usage ·
3163
+ Exit codes: 0 ok · 1 unexpected · 10 a send or a change was refused or needs approval · 11 an update
3164
+ is out: update first, or put it off (agentcomms update, agentcomms update --later) · 64 usage ·
3164
3165
  65 bad data · 66 not found · 69 provider or secret store unavailable · 75 temporary (retry later) ·
3165
3166
  77 key or permission needed · 78 configuration problem.`).exitOverride();
3166
3167
  const globals = () => {
@@ -3174,9 +3175,41 @@ Exit codes: 0 ok · 1 unexpected · 10 a send or a change was refused or needs a
3174
3175
  json: globals().json,
3175
3176
  color: globals().color
3176
3177
  });
3178
+ let gated = null;
3179
+ program.hook("preAction", async (_program, command) => {
3180
+ const path = commandPathOf(command);
3181
+ if (exemptFromUpdateGate(path)) return;
3182
+ const core = openCore({ env });
3183
+ let ended = null;
3184
+ const code = await runCommand(output(), async () => {
3185
+ ended = await updateGateAtTerminal({
3186
+ core,
3187
+ env,
3188
+ binary: "agent-resend",
3189
+ channel: "resend",
3190
+ running: VERSION,
3191
+ output: output(),
3192
+ noInput: false,
3193
+ streams,
3194
+ approveCommand: "agent-resend approve",
3195
+ approvals: approvalsOf(command),
3196
+ approvalClaim: path.join(" ") === "send status" ? SEND_LOOKUP : void 0,
3197
+ ...terminalUpdateHooks(core, env, {
3198
+ output: output(),
3199
+ streams,
3200
+ approveCommand: "agent-resend approve"
3201
+ })
3202
+ });
3203
+ }, streams);
3204
+ gated = code !== 0 ? code : ended;
3205
+ });
3177
3206
  const act = (body) => async (...args) => {
3178
3207
  ran = true;
3179
3208
  softExit = null;
3209
+ if (gated !== null) {
3210
+ exitCode = gated;
3211
+ return;
3212
+ }
3180
3213
  const context = new ResendContext({
3181
3214
  ...deps,
3182
3215
  env,
@@ -3237,7 +3270,9 @@ Exit codes: 0 ok · 1 unexpected · 10 a send or a change was refused or needs a
3237
3270
  mode: flags.mode,
3238
3271
  change: flags.change
3239
3272
  });
3240
- const result = wanted.send === void 0 && wanted.mode === void 0 && wanted.change === void 0 ? await policyReport(context, name) : await changeAt(context, policyChange(context, name, wanted), flags, `agent-resend account policy ${name}${wanted.send ? ` --send ${wanted.send}` : ""}${wanted.mode ? ` --mode ${wanted.mode}` : ""}${wanted.change ? ` --change ${wanted.change}` : ""}`);
3273
+ const reporting = wanted.send === void 0 && wanted.mode === void 0 && wanted.change === void 0;
3274
+ if (reporting) refuseUnclaimedApproval(flags.approval, policyApprovalRefusal("cli"));
3275
+ const result = reporting ? await policyReport(context, name) : await changeAt(context, policyChange(context, name, wanted), flags, `agent-resend account policy ${name}${wanted.send ? ` --send ${wanted.send}` : ""}${wanted.mode ? ` --mode ${wanted.mode}` : ""}${wanted.change ? ` --change ${wanted.change}` : ""}`);
3241
3276
  writeResult(result, output(), renderPolicy, streams);
3242
3277
  }));
3243
3278
  program.command("doctor").description("check what has to work, and say who enforces what — read-only is this package’s promise, not the key’s").option("--account <name>", "check only this account").option("--offline", "do not ask Resend anything", false).action(act(async (context, options, flags) => {
@@ -3370,7 +3405,7 @@ Exit codes: 0 ok · 1 unexpected · 10 a send or a change was refused or needs a
3370
3405
  }));
3371
3406
  const mcp = program.command("mcp").description("run the MCP server on stdio, for a coding agent to connect to").option("--account <name>", "pin the server to one account; every tool then acts on it and no other").action(async (flags) => {
3372
3407
  ran = true;
3373
- const { startResendStdioServer } = await import("./stdio-entry-CVMfmkCS.mjs");
3408
+ const { startResendStdioServer } = await import("./stdio-entry-F1YLLUXd.mjs");
3374
3409
  await startResendStdioServer({
3375
3410
  ...deps,
3376
3411
  env,
package/dist/index.d.mts CHANGED
@@ -11519,6 +11519,8 @@ type SendPolicy = "chat" | "confirm" | "never";
11519
11519
  * way to change it, and that passes no gate at all.
11520
11520
  */
11521
11521
  type ChangePolicy = "chat" | "confirm";
11522
+ /** Whether this machine checks for a newer release once a day, and stops until it is updated or put off. */
11523
+ type UpdateCheckSetting = "on" | "off";
11522
11524
  type StoreKind = "keychain" | "file";
11523
11525
  interface ClientConfig {
11524
11526
  provider: string;
@@ -11573,6 +11575,15 @@ interface Defaults {
11573
11575
  */
11574
11576
  elicitationClients: string[];
11575
11577
  };
11578
+ /**
11579
+ * The daily update check (design 2026-09-28): once a day this machine asks npm whether a newer release is out, and
11580
+ * every server and command stops until it is updated or put off until tomorrow. Absent reads as `on`.
11581
+ *
11582
+ * Absent rather than filled in, as `changePolicy` is: a default the schema supplied would be written into the file
11583
+ * by the next unrelated change, where it would look like a choice somebody made. Turning it off is a loosening —
11584
+ * it is what keeps a machine from quietly falling behind a release — so it is approved like one; on applies at once.
11585
+ */
11586
+ updateCheck?: UpdateCheckSetting | undefined;
11576
11587
  }
11577
11588
  /**
11578
11589
  * A connected account on a platform that is not mail: a Slack workspace, and every channel after it (design
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { at as ROUTES, it as RESEND_DOWNLOAD_ORIGIN, nt as REFUSED, ot as VERSION, rt as RESEND_API_ORIGIN } from "./send-BpwXJL8C.mjs";
2
- import { t as createResendMcpServer } from "./server-C3PKeQSN.mjs";
1
+ import { _t as VERSION, gt as ROUTES, ht as RESEND_DOWNLOAD_ORIGIN, mt as RESEND_API_ORIGIN, pt as REFUSED } from "./send-D9aAM9kv.mjs";
2
+ import { t as createResendMcpServer } from "./server-Cr9ZXT1i.mjs";
3
3
  //#region src/index.ts
4
4
  /**
5
5
  * The library entry of `@agentcomms/resend`.