@agentcomms/resend 0.25.0 → 0.26.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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { Bt as VERSION, Ft as RESEND_CALLER, H as CommsError, It as REFUSED, Lt as RESEND_API_ORIGIN, N as resendRequest, P as ResendContext, Pt as PACKAGE_NAME, Rt as RESEND_DOWNLOAD_ORIGIN, b as readBody, dt as newBoundary, h as resendId, ut as neutralise, v as addressesOf, wt as stripInvisible, y as attachmentRisks, z as keyPermissionOf, zt as ROUTES } from "./send-1murS6En.mjs";
2
- import { t as createResendMcpServer } from "./server-COls8j1E.mjs";
1
+ import { Bt as VERSION, Ft as RESEND_CALLER, H as CommsError, It as REFUSED, Lt as RESEND_API_ORIGIN, N as resendRequest, P as ResendContext, Pt as PACKAGE_NAME, Rt as RESEND_DOWNLOAD_ORIGIN, b as readBody, dt as newBoundary, h as resendId, ut as neutralise, v as addressesOf, wt as stripInvisible, y as attachmentRisks, z as keyPermissionOf, zt as ROUTES } from "./send-BjDliNlb.mjs";
2
+ import { t as createResendMcpServer } from "./server-D2WXrDVG.mjs";
3
3
  //#region src/operations/events.ts
4
4
  const BODY_LIMIT = 2e4;
5
5
  const STATUS = /* @__PURE__ */ new Set([
@@ -199,16 +199,4 @@ function createResendEventReaderForPaths(input) {
199
199
  return createResendEventReader(new ResendContext({ pathOverrides: input.pathOverrides }), input.account, input.accountId);
200
200
  }
201
201
  //#endregion
202
- //#region src/index.ts
203
- /**
204
- * The library entry of `@agentcomms/resend`.
205
- *
206
- * Deliberately small. Everything else is reached through the `agent-resend` command, which ships as a bundle whose
207
- * internals no caller can import — so what is exported here stays a contract that can be kept.
208
- *
209
- * The guard and its permits are **not** exported: a package root that handed out `spendOn` would hand every caller
210
- * the key to the door the guard exists to keep shut. The route table is exported — knowing what this package may
211
- * call grants nothing.
212
- */
213
- //#endregion
214
202
  export { PACKAGE_NAME, REFUSED, RESEND_API_ORIGIN, RESEND_CALLER, RESEND_DOWNLOAD_ORIGIN, ROUTES, VERSION, createResendEventReader, createResendEventReaderForPaths, createResendMcpServer, normaliseResendEventBody };
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
1
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.js
2
2
  function getEnumValues(entries) {
3
3
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
4
4
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -323,6 +323,17 @@ function prefixIssues(path, issues) {
323
323
  function unwrapMessage(message) {
324
324
  return typeof message === "string" ? message : message?.message;
325
325
  }
326
+ /** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
327
+ function sizeCaps(defChecks) {
328
+ const caps = [];
329
+ for (const ch of defChecks ?? []) {
330
+ const d = ch._zod.def;
331
+ if (!/_(length|size)$|_equals$/.test(d.check)) break;
332
+ const max = d.maximum ?? d.length ?? d.size;
333
+ if (max >= 0) caps.push([max, ch]);
334
+ }
335
+ return caps;
336
+ }
326
337
  function attachSchema(issues, start, inst) {
327
338
  var _a;
328
339
  for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
@@ -415,6 +426,7 @@ function hide(inst, key, value) {
415
426
  return own(inst, key, value, false);
416
427
  }
417
428
  /** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
429
+ /* @__NO_SIDE_EFFECTS__ */
418
430
  function derived(computes, table) {
419
431
  for (const key in computes) {
420
432
  const compute = computes[key];
@@ -539,7 +551,7 @@ function constantCatch(value) {
539
551
  return fn;
540
552
  }
541
553
  //#endregion
542
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
554
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.js
543
555
  var _a$1;
544
556
  /** A special constant with type `never` */
545
557
  const NEVER = /*@__PURE__*/ Object.freeze({ status: "aborted" });
@@ -568,6 +580,7 @@ function newError(Definition) {
568
580
  }
569
581
  return new Definition();
570
582
  }
583
+ /* @__NO_SIDE_EFFECTS__ */
571
584
  function $constructor(name, initializer, proto, params) {
572
585
  const zodProto = {};
573
586
  function Internals(def) {
@@ -647,7 +660,7 @@ function config(newConfig) {
647
660
  return globalConfig;
648
661
  }
649
662
  //#endregion
650
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
663
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.js
651
664
  function _getMessage() {
652
665
  const internals = this._zod;
653
666
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -698,8 +711,7 @@ const initializer$1 = (inst, def) => {
698
711
  });
699
712
  }
700
713
  };
701
- const $ZodError = $constructor("$ZodError", initializer$1);
702
- $constructor("$ZodError", initializer$1, void 0, { Parent: Error });
714
+ const $ZodError = /* @__PURE__ */ $constructor("$ZodError", initializer$1);
703
715
  /** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
704
716
  * ("toString", "constructor") would otherwise read through to the prototype, and assigning
705
717
  * "__proto__" would hit the setter instead of creating a key. */
@@ -763,7 +775,7 @@ function formatError(error, mapper = (issue) => issue.message) {
763
775
  return fieldErrors;
764
776
  }
765
777
  //#endregion
766
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
778
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/parse.js
767
779
  function finalizeParams(callee, params) {
768
780
  return {
769
781
  callee: params?.callee ?? callee,
@@ -966,7 +978,7 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
966
978
  return _safeParseAsync(_Err)(schema, value, _ctx);
967
979
  };
968
980
  //#endregion
969
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.js
981
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/regexes.js
970
982
  /**
971
983
  * @deprecated CUID v1 is deprecated by its authors due to information leakage
972
984
  * (timestamps embedded in the id). Use {@link cuid2} instead.
@@ -1039,7 +1051,7 @@ const _null$2 = /^null$/i;
1039
1051
  const lowercase = /^[^A-Z]*$/;
1040
1052
  const uppercase = /^[^a-z]*$/;
1041
1053
  //#endregion
1042
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
1054
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.js
1043
1055
  const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
1044
1056
  var _a;
1045
1057
  inst._zod ?? (inst._zod = {});
@@ -1335,7 +1347,7 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
1335
1347
  };
1336
1348
  });
1337
1349
  //#endregion
1338
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.js
1350
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/doc.js
1339
1351
  var Doc = class {
1340
1352
  constructor(args = [], closed = {}) {
1341
1353
  this.content = [];
@@ -1369,14 +1381,14 @@ var Doc = class {
1369
1381
  }
1370
1382
  };
1371
1383
  //#endregion
1372
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
1384
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.js
1373
1385
  const version = {
1374
1386
  major: 4,
1375
1387
  minor: 6,
1376
- patch: 5
1388
+ patch: 7
1377
1389
  };
1378
1390
  //#endregion
1379
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
1391
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.js
1380
1392
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1381
1393
  var _a;
1382
1394
  inst ?? (inst = {});
@@ -1893,6 +1905,26 @@ const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
1893
1905
  return payload;
1894
1906
  };
1895
1907
  });
1908
+ function capSize(inst, size) {
1909
+ const caps = sizeCaps(inst._zod.def.checks);
1910
+ if (!caps.length) return;
1911
+ const cap = Math.min(...caps.map((c) => c[0]));
1912
+ const parse = inst._zod.parse;
1913
+ inst._zod.parse = (payload, ctx) => {
1914
+ const n = size(payload.value);
1915
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
1916
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
1917
+ const start = payload.issues.length;
1918
+ ch._zod.check(payload);
1919
+ payload.issues[start].continue = false;
1920
+ attachSchema(payload.issues, start, inst);
1921
+ return payload;
1922
+ }
1923
+ }
1924
+ return parse(payload, ctx);
1925
+ };
1926
+ }
1927
+ const arraySize = (input) => Array.isArray(input) ? input.length : -1;
1896
1928
  function handleArrayResult(result, final, index) {
1897
1929
  if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
1898
1930
  final.value[index] = result.value;
@@ -1930,6 +1962,7 @@ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
1930
1962
  if (proms.length) return Promise.all(proms).then(() => payload);
1931
1963
  return payload;
1932
1964
  };
1965
+ capSize(inst, arraySize);
1933
1966
  });
1934
1967
  function handlePropertyResult(result, final, key, input, optin, optout) {
1935
1968
  const isPresent = key in input;
@@ -2038,7 +2071,7 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
2038
2071
  }
2039
2072
  return propValues;
2040
2073
  });
2041
- const isObject$2 = isObject;
2074
+ const isObject$1 = isObject;
2042
2075
  const catchall = def.catchall;
2043
2076
  let value;
2044
2077
  const memo = globalConfig.memoizer;
@@ -2046,7 +2079,7 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
2046
2079
  inst._zod.parse = (payload, ctx) => {
2047
2080
  value ?? (value = _normalized.value);
2048
2081
  const input = payload.value;
2049
- if (!isObject$2(input)) {
2082
+ if (!isObject$1(input)) {
2050
2083
  payload.issues.push({
2051
2084
  expected: "object",
2052
2085
  code: "invalid_type",
@@ -2176,7 +2209,7 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
2176
2209
  return doc.compile();
2177
2210
  };
2178
2211
  let fastpass;
2179
- const isObject$1 = isObject;
2212
+ const isObject$2 = isObject;
2180
2213
  const jit = !globalConfig.jitless;
2181
2214
  const fastEnabled = jit && allowsEval.value;
2182
2215
  const catchall = def.catchall;
@@ -2184,7 +2217,7 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
2184
2217
  inst._zod.parse = (payload, ctx) => {
2185
2218
  value ?? (value = _normalized.value);
2186
2219
  const input = payload.value;
2187
- if (!isObject$1(input)) {
2220
+ if (!isObject$2(input)) {
2188
2221
  payload.issues.push({
2189
2222
  expected: "object",
2190
2223
  code: "invalid_type",
@@ -2848,7 +2881,7 @@ function handleRefineResult(result, payload, input, inst) {
2848
2881
  }
2849
2882
  }
2850
2883
  //#endregion
2851
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.js
2884
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/memoizer.js
2852
2885
  var $ZodCyclicError = class extends Error {
2853
2886
  constructor() {
2854
2887
  super(`Cannot parse a reference cycle that closes through a transform`);
@@ -3101,7 +3134,7 @@ function isBackEdge(ctx, value) {
3101
3134
  return backEdges !== void 0 && isRef(value) && backEdges.has(value);
3102
3135
  }
3103
3136
  //#endregion
3104
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.js
3137
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/en.js
3105
3138
  const error = () => {
3106
3139
  const Sizable = {
3107
3140
  string: {
@@ -3209,7 +3242,7 @@ function en_default() {
3209
3242
  return { localeError: error() };
3210
3243
  }
3211
3244
  //#endregion
3212
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.js
3245
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.js
3213
3246
  var _a;
3214
3247
  var $ZodRegistry = class {
3215
3248
  constructor() {
@@ -3256,7 +3289,7 @@ function registry() {
3256
3289
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
3257
3290
  const globalRegistry = globalThis.__zod_globalRegistry;
3258
3291
  //#endregion
3259
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
3292
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.js
3260
3293
  function snapshotChecks(def) {
3261
3294
  if (def.checks) def.checks = [...def.checks];
3262
3295
  return def;
@@ -3785,7 +3818,7 @@ function _check(fn, params) {
3785
3818
  return ch;
3786
3819
  }
3787
3820
  //#endregion
3788
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
3821
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js
3789
3822
  function assignProps(target, ...sources) {
3790
3823
  for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
3791
3824
  return target;
@@ -4229,7 +4262,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
4229
4262
  return finalize(ctx, schema);
4230
4263
  };
4231
4264
  //#endregion
4232
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.js
4265
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js
4233
4266
  const narrowMin = (agg, key, value) => {
4234
4267
  if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
4235
4268
  };
@@ -4875,7 +4908,7 @@ function toJSONSchema(input, params) {
4875
4908
  return finalize(ctx, input);
4876
4909
  }
4877
4910
  //#endregion
4878
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.js
4911
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.js
4879
4912
  const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4880
4913
  function _lazyMethod(proto, key, make) {
4881
4914
  Object.defineProperty(proto, key, {
@@ -4925,7 +4958,7 @@ const initializer = (inst, issues) => {
4925
4958
  };
4926
4959
  const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
4927
4960
  //#endregion
4928
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.js
4961
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.js
4929
4962
  const parse = /* @__PURE__ */ _parse(ZodRealError);
4930
4963
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
4931
4964
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -4939,7 +4972,7 @@ const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
4939
4972
  const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
4940
4973
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
4941
4974
  //#endregion
4942
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.js
4975
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
4943
4976
  function _ensureDefaultLocale() {
4944
4977
  if (!globalConfig.localeError) config(en_default());
4945
4978
  }
@@ -5882,7 +5915,7 @@ function preprocess(fn, schema) {
5882
5915
  });
5883
5916
  }
5884
5917
  //#endregion
5885
- //#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.js
5918
+ //#region ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js
5886
5919
  function datetime(params) {
5887
5920
  return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
5888
5921
  }
@@ -1,5 +1,5 @@
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";
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-5-9R47LC.mjs";
2
+ import { n as ZodIssueCode, t as number$1 } from "./coerce-DUN95oU4.mjs";
3
3
  import process$1 from "node:process";
4
4
  //#region ../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs
5
5
  var __create = Object.create;