@agentcomms/resend 0.17.0 → 0.18.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/index.d.mts CHANGED
@@ -4322,7 +4322,7 @@ declare namespace external_d_exports {
4322
4322
  export { $brand, $input, $output, BRAND, CompileOptions, GlobalMeta, INVALID, Infer$1 as Infer, IssueData, JSONType, NEVER, $RefinementCtx as RefinementCtx, SafeExtendShape, Schema, TimePrecision, TypeOf, ZodAny, ZodArray, ZodBase64, ZodBase64URL, ZodBigInt, ZodBigIntFormat, ZodBoolean, ZodCIDRv4, ZodCIDRv6, ZodCUID, ZodCUID2, ZodCatch, ZodCodec, ZodCoercedBigInt, ZodCoercedBoolean, ZodCoercedDate, ZodCoercedNumber, ZodCoercedString, ZodCompileAsyncError, ZodCompileUnsupportedError, ZodCreditCard, ZodCustom, ZodCustomStringFormat, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodE164, ZodEmail, ZodEmoji, ZodEnum, ZodError, ZodErrorMap, ZodExactOptional, ZodFile, ZodFirstPartySchemaTypes, ZodFirstPartyTypeKind, ZodFlattenedError, ZodFloat32, ZodFloat64, ZodFormattedError, ZodFunction, ZodGUID, ZodIBAN, ZodIPv4, ZodIPv6, ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime, ZodInstanceOf, ZodInt, ZodInt32, ZodInt64, ZodIntersection, ZodIssue, ZodIssueCode, ZodJSONSchema, ZodJSONSchemaInternals, ZodJWT, ZodKSUID, ZodLazy, ZodLiteral, ZodMAC, ZodMap, ZodNaN, ZodNanoID, ZodNever, ZodNonOptional, ZodNull, ZodNullable, ZodNumber, ZodNumberFormat, ZodObject, ZodOptional, ZodPipe, ZodPrefault, ZodPreprocess, ZodPromise, ZodRawShape$1 as ZodRawShape, ZodReadonly, ZodRealError, ZodRecord, ZodSafeParseError, ZodSafeParseResult, ZodSafeParseSuccess, ZodSchema, ZodSet, ZodStandardSchemaWithJSON, ZodString, ZodStringFormat, ZodSuccess, ZodSymbol, ZodTemplateLiteral, ZodTransform, ZodTuple, ZodType, ZodTypeAny, ZodUInt32, ZodUInt64, ZodULID, ZodURL, ZodUUID, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, ZodXID, ZodXor, _ZodBigInt, _ZodBoolean, _ZodDate, _ZodNumber, _ZodString, _ZodType, _default, _function, any, array, base64, base64url, bigint$1 as bigint, boolean$1 as boolean, _catch as catch, check, cidrv4, cidrv6, clone, codec, coerce_d_exports as coerce, compile, config, index_d_exports$1 as core, creditCard, cuid, cuid2, currencyCode, custom, date$2 as date, decode, decodeAsync, deepPartial, describe, discriminatedUnion, e164, email, emoji, encode, encodeAsync, _endsWith as endsWith, _enum as enum, exactOptional, file, flattenError, float32, float64, formatError, fromJSONSchema, _function as function, getDiscriminatedOption, getErrorMap, globalRegistry, _gt as gt, _gte as gte, guid, hash, hex, hostname, httpUrl, iban, _includes as includes, output$1 as infer, inferFlattenedErrors, inferFormattedError, input, _instanceof as instanceof, int, int32, int64, intersection, invertCodec, ipv4, ipv6, iso_d_exports as iso, json, jwt, keyof, ksuid, lazy, _length as length, literal, index_d_exports$2 as locales, looseObject, looseRecord, _lowercase as lowercase, _lt as lt, _lte as lte, mac, map, _maxLength as maxLength, _maxSize as maxSize, memoizer, meta, _mime as mime, _minLength as minLength, _minSize as minSize, _multipleOf as multipleOf, nan, nanoid, nativeEnum, _negative as negative, never, _nonnegative as nonnegative, nonoptional, _nonpositive as nonpositive, _normalize as normalize, _null as null, nullable, nullish, number$1 as number, object, optional, output, _overwrite as overwrite, parse, parseAsync, partialRecord, pipe, _positive as positive, prefault, preprocess, prettifyError, promise, _properties as properties, _property as property, readonly, record, refine, _regex as regex, regexes_d_exports as regexes, registry, safeDecode, safeDecodeAsync, safeEncode, safeEncodeAsync, safeParse, safeParseAsync, set, setErrorMap, _size as size, _slugify as slugify, _startsWith as startsWith, strictObject, string$1 as string, stringFormat, stringbool, success, superRefine, symbol, templateLiteral, toJSONSchema, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, toZod, transform, treeifyError, _trim as trim, tuple, uint32, uint64, ulid, _undefined as undefined, union, unknown, _uppercase as uppercase, url, util_d_exports as util, uuid, uuidv4, uuidv6, uuidv7, validate, validateAsync, _void as void, withParser, xid, xor };
4323
4323
  }
4324
4324
  //#endregion
4325
- //#region ../core/dist/change-flow-B_bGbrkO.d.mts
4325
+ //#region ../core/dist/change-flow-j65bYTxL.d.mts
4326
4326
  //#region src/config-hooks.d.ts
4327
4327
  /**
4328
4328
  * Test-only pauses inside `ConfigStore.convertToVersion3`, for the tests that prove a write racing the conversion is
@@ -4428,6 +4428,25 @@ declare class CommsError extends Error {
4428
4428
  get exitCode(): number;
4429
4429
  get retryable(): boolean;
4430
4430
  }
4431
+ /**
4432
+ * The file operations a lock is made of, one method each, so a test can count and interrupt every one of them: the
4433
+ * create that is the attempt, the read that checks a holder, the touch that renews, the unlink that releases.
4434
+ * `withFileLock` uses the real ones; `tryFileLock` takes another for a caller whose every step is counted.
4435
+ */
4436
+ interface LockIo {
4437
+ /** Creates `path` exclusively (`wx`, 0600) holding `body`: the one attempt to take the lock. */
4438
+ create(path: string, body: string): Promise<void>;
4439
+ /** The lock file's text: a holder's body. */
4440
+ read(path: string): Promise<string>;
4441
+ /** The lock file's modification time, in milliseconds: where a renewal shows. */
4442
+ mtime(path: string): Promise<number>;
4443
+ /** Sets the lock file's times to now: a renewal. */
4444
+ touch(path: string): Promise<void>;
4445
+ rename(from: string, to: string): Promise<void>;
4446
+ link(from: string, to: string): Promise<void>;
4447
+ /** Removes a lock file, or one moved aside; a missing one is no error. */
4448
+ remove(path: string): Promise<void>;
4449
+ }
4431
4450
  //#endregion
4432
4451
  //#region src/cli-command.d.ts
4433
4452
  /**
@@ -4465,9 +4484,10 @@ declare class PrintedCommand {
4465
4484
  #private;
4466
4485
  /** The words, as the program is to receive them: this Node, its flags, the entry, then the CLI's own words. */
4467
4486
  readonly words: readonly string[];
4468
- /** The line to paste; null when one of the words has no printing that every Windows shell passes on alike. */
4487
+ /** The line to paste; null when no supported common or labelled shell rendering is safe. */
4469
4488
  readonly line: string | null;
4470
4489
  readonly platform: NodeJS.Platform;
4490
+ readonly shell?: "powershell" | undefined;
4471
4491
  constructor(gate: typeof GATE$1, words: readonly string[], platform: NodeJS.Platform, entry: string);
4472
4492
  /**
4473
4493
  * The real path of the file it runs, as it was checked when the command was located: a fact about then (D6). The
@@ -5072,25 +5092,6 @@ interface DisclosureBinding {
5072
5092
  * change to no owner at all, stored with `inboxId: ''`.
5073
5093
  */
5074
5094
  type OwnerScope = "owner" | "prospective" | "global";
5075
- /**
5076
- * The file operations a lock is made of, one method each, so a test can count and interrupt every one of them: the
5077
- * create that is the attempt, the read that checks a holder, the touch that renews, the unlink that releases.
5078
- * `withFileLock` uses the real ones; `tryFileLock` takes another for a caller whose every step is counted.
5079
- */
5080
- interface LockIo {
5081
- /** Creates `path` exclusively (`wx`, 0600) holding `body`: the one attempt to take the lock. */
5082
- create(path: string, body: string): Promise<void>;
5083
- /** The lock file's text: a holder's body. */
5084
- read(path: string): Promise<string>;
5085
- /** The lock file's modification time, in milliseconds: where a renewal shows. */
5086
- mtime(path: string): Promise<number>;
5087
- /** Sets the lock file's times to now: a renewal. */
5088
- touch(path: string): Promise<void>;
5089
- rename(from: string, to: string): Promise<void>;
5090
- link(from: string, to: string): Promise<void>;
5091
- /** Removes a lock file, or one moved aside; a missing one is no error. */
5092
- remove(path: string): Promise<void>;
5093
- }
5094
5095
  //#endregion
5095
5096
  //#region src/approval-io.d.ts
5096
5097
  /**
@@ -6301,7 +6302,7 @@ export declare const PACKAGE_NAME = "@agentcomms/resend";
6301
6302
  */
6302
6303
  export declare const RESEND_CALLER: CliCommandCaller;
6303
6304
  //#endregion
6304
- //#region ../../node_modules/.pnpm/@modelcontextprotocol+server@2.0.0/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts
6305
+ //#region ../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts
6305
6306
  //#region ../../node_modules/.pnpm/json-schema-typed@8.0.2/node_modules/json-schema-typed/draft_2020_12.d.ts
6306
6307
  type MaybeReadonlyArray<T> = Array<T> | ReadonlyArray<T>;
6307
6308
  type ValueOf<T> = T[keyof T];
@@ -7400,7 +7401,7 @@ declare namespace index_d_exports {
7400
7401
  export { $brand, $input, $output, BRAND, CompileOptions, GlobalMeta, INVALID, Infer$1 as Infer, IssueData, JSONType, NEVER, $RefinementCtx as RefinementCtx, SafeExtendShape, Schema, TimePrecision, TypeOf, ZodAny, ZodArray, ZodBase64, ZodBase64URL, ZodBigInt, ZodBigIntFormat, ZodBoolean, ZodCIDRv4, ZodCIDRv6, ZodCUID, ZodCUID2, ZodCatch, ZodCodec, ZodCoercedBigInt, ZodCoercedBoolean, ZodCoercedDate, ZodCoercedNumber, ZodCoercedString, ZodCompileAsyncError, ZodCompileUnsupportedError, ZodCreditCard, ZodCustom, ZodCustomStringFormat, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodE164, ZodEmail, ZodEmoji, ZodEnum, ZodError, ZodErrorMap, ZodExactOptional, ZodFile, ZodFirstPartySchemaTypes, ZodFirstPartyTypeKind, ZodFlattenedError, ZodFloat32, ZodFloat64, ZodFormattedError, ZodFunction, ZodGUID, ZodIBAN, ZodIPv4, ZodIPv6, ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime, ZodInstanceOf, ZodInt, ZodInt32, ZodInt64, ZodIntersection, ZodIssue, ZodIssueCode, ZodJSONSchema, ZodJSONSchemaInternals, ZodJWT, ZodKSUID, ZodLazy, ZodLiteral, ZodMAC, ZodMap, ZodNaN, ZodNanoID, ZodNever, ZodNonOptional, ZodNull, ZodNullable, ZodNumber, ZodNumberFormat, ZodObject, ZodOptional, ZodPipe, ZodPrefault, ZodPreprocess, ZodPromise, ZodRawShape$1 as ZodRawShape, ZodReadonly, ZodRealError, ZodRecord, ZodSafeParseError, ZodSafeParseResult, ZodSafeParseSuccess, ZodSchema, ZodSet, ZodStandardSchemaWithJSON, ZodString, ZodStringFormat, ZodSuccess, ZodSymbol, ZodTemplateLiteral, ZodTransform, ZodTuple, ZodType, ZodTypeAny, ZodUInt32, ZodUInt64, ZodULID, ZodURL, ZodUUID, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, ZodXID, ZodXor, _ZodBigInt, _ZodBoolean, _ZodDate, _ZodNumber, _ZodString, _ZodType, _default, _function, any, array, base64, base64url, bigint$1 as bigint, boolean$1 as boolean, _catch as catch, check, cidrv4, cidrv6, clone, codec, coerce_d_exports as coerce, compile, config, index_d_exports$1 as core, creditCard, cuid, cuid2, currencyCode, custom, date$2 as date, decode, decodeAsync, deepPartial, external_d_exports as default, describe, discriminatedUnion, e164, email, emoji, encode, encodeAsync, _endsWith as endsWith, _enum as enum, exactOptional, file, flattenError, float32, float64, formatError, fromJSONSchema, _function as function, getDiscriminatedOption, getErrorMap, globalRegistry, _gt as gt, _gte as gte, guid, hash, hex, hostname, httpUrl, iban, _includes as includes, output$1 as infer, inferFlattenedErrors, inferFormattedError, input, _instanceof as instanceof, int, int32, int64, intersection, invertCodec, ipv4, ipv6, iso_d_exports as iso, json, jwt, keyof, ksuid, lazy, _length as length, literal, index_d_exports$2 as locales, looseObject, looseRecord, _lowercase as lowercase, _lt as lt, _lte as lte, mac, map, _maxLength as maxLength, _maxSize as maxSize, memoizer, meta, _mime as mime, _minLength as minLength, _minSize as minSize, _multipleOf as multipleOf, nan, nanoid, nativeEnum, _negative as negative, never, _nonnegative as nonnegative, nonoptional, _nonpositive as nonpositive, _normalize as normalize, _null as null, nullable, nullish, number$1 as number, object, optional, output, _overwrite as overwrite, parse, parseAsync, partialRecord, pipe, _positive as positive, prefault, preprocess, prettifyError, promise, _properties as properties, _property as property, readonly, record, refine, _regex as regex, regexes_d_exports as regexes, registry, safeDecode, safeDecodeAsync, safeEncode, safeEncodeAsync, safeParse, safeParseAsync, set, setErrorMap, _size as size, _slugify as slugify, _startsWith as startsWith, strictObject, string$1 as string, stringFormat, stringbool, success, superRefine, symbol, templateLiteral, toJSONSchema, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, toZod, transform, treeifyError, _trim as trim, tuple, uint32, uint64, ulid, _undefined as undefined, union, unknown, _uppercase as uppercase, url, util_d_exports as util, uuid, uuidv4, uuidv6, uuidv7, validate, validateAsync, _void as void, withParser, xid, xor, external_d_exports as z };
7401
7402
  }
7402
7403
  //#endregion
7403
- //#region ../../node_modules/.pnpm/@modelcontextprotocol+core@2.0.0/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts
7404
+ //#region ../../node_modules/.pnpm/@modelcontextprotocol+core@2.3.1/node_modules/@modelcontextprotocol/core/dist/auth-Anm-lwWi.d.mts
7404
7405
  //#region src/types.d.ts
7405
7406
  type JSONValue = string | number | boolean | null | JSONObject | JSONArray;
7406
7407
  type JSONObject = {
@@ -7453,6 +7454,33 @@ declare const NotificationSchema: ZodObject<{
7453
7454
  }, $loose>>;
7454
7455
  }, $loose>>;
7455
7456
  }, $strip>;
7457
+ /**
7458
+ * The contents of a result's `_meta` field (the 2026-07-28 `ResultMetaObject`).
7459
+ * Loose — implementation-specific keys pass through.
7460
+ *
7461
+ * The serverInfo key identifies the server software producing the response
7462
+ * (servers SHOULD include it on every response; the value is self-reported
7463
+ * and intended for display, logging, and debugging). The getter defers the
7464
+ * `ImplementationSchema` reference, which is declared later in this file.
7465
+ */
7466
+ declare const ResultMetaObjectSchema: ZodObject<{
7467
+ readonly "io.modelcontextprotocol/serverInfo": ZodCatch<ZodOptional<ZodObject<{
7468
+ version: ZodString;
7469
+ websiteUrl: ZodOptional<ZodString>;
7470
+ description: ZodOptional<ZodString>;
7471
+ icons: ZodOptional<ZodArray<ZodObject<{
7472
+ src: ZodString;
7473
+ mimeType: ZodOptional<ZodString>;
7474
+ sizes: ZodOptional<ZodArray<ZodString>>;
7475
+ theme: ZodOptional<ZodEnum<{
7476
+ light: "light";
7477
+ dark: "dark";
7478
+ }>>;
7479
+ }, $strip>>>;
7480
+ name: ZodString;
7481
+ title: ZodOptional<ZodString>;
7482
+ }, $strip>>>;
7483
+ }, $loose>;
7456
7484
  declare const ResultSchema: ZodObject<{
7457
7485
  /**
7458
7486
  * See [MCP specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#general-fields)
@@ -11131,7 +11159,7 @@ declare const ServerNotificationSchema: ZodUnion<readonly [ZodObject<{
11131
11159
  }, $strip>;
11132
11160
  }, $strip>]>;
11133
11161
  //#endregion
11134
- //#region ../../node_modules/.pnpm/@modelcontextprotocol+server@2.0.0/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts
11162
+ //#region ../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D4NN8WsG.d.mts
11135
11163
  //#endregion
11136
11164
  //#region ../core-internal/src/errors/sdkErrors.d.ts
11137
11165
  /**
@@ -11257,7 +11285,17 @@ declare class SdkError extends Error {
11257
11285
  * silently matching nothing).
11258
11286
  */
11259
11287
  static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
11260
- constructor(code: SdkErrorCode, message: string, data?: unknown | undefined);
11288
+ /**
11289
+ * @param code - Stable string code identifying the failure ({@linkcode SdkErrorCode}).
11290
+ * @param message - Human-readable description.
11291
+ * @param data - Optional structured payload (for example the HTTP status carried by
11292
+ * {@linkcode SdkHttpError}). Opaque to the SDK: a `cause` key inside `data` is not
11293
+ * promoted to `Error.cause`.
11294
+ * @param options - Standard `ErrorOptions`, forwarded to `Error`. Pass the underlying
11295
+ * failure as `{ cause }` so it is reachable through the `Error.cause` chain that
11296
+ * loggers and error trackers walk.
11297
+ */
11298
+ constructor(code: SdkErrorCode, message: string, data?: unknown | undefined, options?: ErrorOptions);
11261
11299
  }
11262
11300
  type Primitive = string | number | boolean | bigint | null | undefined;
11263
11301
  type Flatten<T$1> = T$1 extends Primitive ? T$1 : T$1 extends Array<infer U> ? Array<Flatten<U>> : T$1 extends Set<infer U> ? Set<Flatten<U>> : T$1 extends Map<infer K, infer V> ? Map<Flatten<K>, Flatten<V>> : T$1 extends object ? { [K in keyof T$1]: Flatten<T$1[K]>; } : T$1;
@@ -11515,6 +11553,18 @@ interface AuthInfo {
11515
11553
  * If set, this MUST match the MCP server's resource identifier (minus hash fragment).
11516
11554
  */
11517
11555
  resource?: URL;
11556
+ /**
11557
+ * URL of the RFC 9728 Protected Resource Metadata document for the
11558
+ * resource server that accepted this token.
11559
+ *
11560
+ * The bearer-auth helpers stamp their configured `resourceMetadataUrl`
11561
+ * here when verification succeeds, so challenge responses built after
11562
+ * authentication (for example per-operation `insufficient_scope` scope
11563
+ * challenges) can advertise the same document as the authentication
11564
+ * gate's own challenges without separate configuration. Verifiers may
11565
+ * also populate it directly; a verifier-set value wins.
11566
+ */
11567
+ resourceMetadataUrl?: string;
11518
11568
  /**
11519
11569
  * Additional data associated with the token.
11520
11570
  * This field should be used for any additional data that needs to be attached to the auth info.
@@ -11573,6 +11623,11 @@ interface MessageExtraInfo {
11573
11623
  */
11574
11624
  closeStandaloneSSEStream?: () => void;
11575
11625
  }
11626
+ /**
11627
+ * The contents of a result's `_meta` field (the 2026-07-28 `ResultMetaObject`):
11628
+ * loose, with the optional self-reported serverInfo key typed when present.
11629
+ */
11630
+ type ResultMetaObject = Infer<typeof ResultMetaObjectSchema>;
11576
11631
  /**
11577
11632
  * {@linkcode CreateMessageRequestParams} without tools - for backwards-compatible overload.
11578
11633
  * Excludes tools/toolChoice to indicate they should not be provided.
@@ -11666,6 +11721,8 @@ type DecodedResult = {
11666
11721
  */
11667
11722
  inputRequests: Record<string, unknown>;
11668
11723
  requestState?: string;
11724
+ /** Result-level `_meta`, carried through so a manual caller sees it. */
11725
+ _meta?: ResultMetaObject;
11669
11726
  } | {
11670
11727
  kind: 'invalid';
11671
11728
  error: SdkError;
@@ -12281,6 +12338,8 @@ declare abstract class Protocol<ContextT extends BaseContext> {
12281
12338
  private _transport?;
12282
12339
  private _requestMessageId;
12283
12340
  private _requestHandlers;
12341
+ /** Methods registered with an explicit schema; the era gate in `_onrequest` reads it for the Tasks extension names. */
12342
+ private _customSchemaRequestMethods;
12284
12343
  private _requestHandlerAbortControllers;
12285
12344
  private _notificationHandlers;
12286
12345
  private _responseHandlers;
@@ -12664,6 +12723,20 @@ declare class UriTemplate {
12664
12723
  match(uri: string): Variables | null;
12665
12724
  }
12666
12725
  //#endregion
12726
+ //#region src/server/scopeChallenge.d.ts
12727
+ /** OAuth scopes to request before handling an MCP request. */
12728
+ interface ScopeChallenge {
12729
+ /** The exact, complete scope set to include in the challenge. Each scope must satisfy the OAuth `scope-token` grammar. */
12730
+ scopes: readonly [string, ...string[]];
12731
+ /** Optional human-readable detail satisfying the RFC 6750 `error-description` grammar. */
12732
+ errorDescription?: string;
12733
+ }
12734
+ /** Determines whether an MCP request needs an OAuth scope challenge. */
12735
+ type ScopeChallengeHandler = (context: {
12736
+ request: JSONRPCRequest;
12737
+ authInfo?: AuthInfo;
12738
+ }) => ScopeChallenge | undefined | Promise<ScopeChallenge | undefined>;
12739
+ //#endregion
12667
12740
  //#region src/server/server.d.ts
12668
12741
  type ServerOptions = ProtocolOptions & {
12669
12742
  /**
@@ -12805,6 +12878,8 @@ declare class Server extends Protocol<ServerContext> {
12805
12878
  * Initializes this server with the given name and version information.
12806
12879
  */
12807
12880
  constructor(_serverInfo: Implementation, options?: ServerOptions);
12881
+ /** Attaches to the given transport; rejects while this instance is connected to another one. */
12882
+ connect(transport: Transport): Promise<void>;
12808
12883
  /**
12809
12884
  * Registers the built-in `logging/setLevel` request handler.
12810
12885
  *
@@ -13063,6 +13138,16 @@ declare class Server extends Protocol<ServerContext> {
13063
13138
  }
13064
13139
  //#endregion
13065
13140
  //#region src/server/mcp.d.ts
13141
+ /**
13142
+ * Options for {@linkcode McpServer}: everything {@linkcode ServerOptions} accepts, plus `maxToolInputElements`.
13143
+ */
13144
+ type McpServerOptions = ServerOptions & {
13145
+ /**
13146
+ * Largest combined number of array elements and object members a single `tools/call` `arguments` payload may contain.
13147
+ * A number of at least 1; unset or `Infinity` means no limit.
13148
+ */
13149
+ maxToolInputElements?: number;
13150
+ };
13066
13151
  /**
13067
13152
  * High-level MCP server that provides a simpler API for working with resources, tools, and prompts.
13068
13153
  * For advanced usage (like sending notifications or setting custom request handlers), use the underlying
@@ -13081,16 +13166,12 @@ declare class McpServer {
13081
13166
  * The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.
13082
13167
  */
13083
13168
  readonly server: Server;
13169
+ private readonly _maxToolInputElements;
13084
13170
  private _registeredResources;
13085
13171
  private _registeredResourceTemplates;
13086
13172
  private _registeredTools;
13087
13173
  private _registeredPrompts;
13088
- /**
13089
- * Per-tool JSON-converted `inputSchema`, memoized so the SEP-2243
13090
- * registration-time scan and the pre-dispatch validation step share one
13091
- * conversion instead of paying it twice per request under the
13092
- * per-request-factory `createMcpHandler` model.
13093
- */
13174
+ /** Per-tool JSON-converted `inputSchema`, filled on first use by `toolInputSchemaJson()`. */
13094
13175
  private _toolInputSchemaJson;
13095
13176
  /**
13096
13177
  * The JSON-serialized `inputSchema` of a registered tool, or `undefined`
@@ -13101,7 +13182,7 @@ declare class McpServer {
13101
13182
  * @internal
13102
13183
  */
13103
13184
  toolInputSchemaJson(name: string): Record<string, unknown> | undefined;
13104
- constructor(serverInfo: Implementation, options?: ServerOptions);
13185
+ constructor(serverInfo: Implementation, options?: McpServerOptions);
13105
13186
  /**
13106
13187
  * Attaches to the given transport, starts it, and starts listening for messages.
13107
13188
  *
@@ -13119,6 +13200,8 @@ declare class McpServer {
13119
13200
  * Closes the connection.
13120
13201
  */
13121
13202
  close(): Promise<void>;
13203
+ /** @internal */
13204
+ resolveScopeChallenge: ScopeChallengeHandler;
13122
13205
  private _toolHandlersInitialized;
13123
13206
  private setToolRequestHandlers;
13124
13207
  /**
@@ -13169,9 +13252,11 @@ declare class McpServer {
13169
13252
  */
13170
13253
  registerResource(name: string, uriOrTemplate: string, config: ResourceMetadata & {
13171
13254
  cacheHint?: CacheHint;
13255
+ scopeChallenge?: ScopeChallengeHandler;
13172
13256
  }, readCallback: ReadResourceCallback): RegisteredResource;
13173
13257
  registerResource(name: string, uriOrTemplate: ResourceTemplate, config: ResourceMetadata & {
13174
13258
  cacheHint?: CacheHint;
13259
+ scopeChallenge?: ScopeChallengeHandler;
13175
13260
  }, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate;
13176
13261
  private _createRegisteredResource;
13177
13262
  private _createRegisteredResourceTemplate;
@@ -13210,6 +13295,8 @@ declare class McpServer {
13210
13295
  outputSchema?: OutputArgs;
13211
13296
  annotations?: ToolAnnotations;
13212
13297
  icons?: Icon[];
13298
+ /** Determines whether this tool call needs an OAuth scope challenge. */
13299
+ scopeChallenge?: ScopeChallengeHandler;
13213
13300
  _meta?: Record<string, unknown>;
13214
13301
  }, cb: ToolCallback<InputArgs>): RegisteredTool;
13215
13302
  /** @deprecated Wrap with `z.object({...})` instead. Raw-shape form: `inputSchema`/`outputSchema` may be a plain `{ field: z.string() }` record; it is auto-wrapped with `z.object()`. */
@@ -13220,6 +13307,7 @@ declare class McpServer {
13220
13307
  outputSchema?: OutputArgs;
13221
13308
  annotations?: ToolAnnotations;
13222
13309
  icons?: Icon[];
13310
+ scopeChallenge?: ScopeChallengeHandler;
13223
13311
  _meta?: Record<string, unknown>;
13224
13312
  }, cb: LegacyToolCallback<InputArgs>): RegisteredTool;
13225
13313
  /**
@@ -13248,11 +13336,22 @@ declare class McpServer {
13248
13336
  * );
13249
13337
  * ```
13250
13338
  */
13339
+ registerPrompt(name: string, config: {
13340
+ title?: string;
13341
+ description?: string;
13342
+ argsSchema?: undefined;
13343
+ icons?: Icon[];
13344
+ /** Determines whether this prompt retrieval needs an OAuth scope challenge. */
13345
+ scopeChallenge?: ScopeChallengeHandler;
13346
+ _meta?: Record<string, unknown>;
13347
+ }, cb: PromptCallback): RegisteredPrompt;
13251
13348
  registerPrompt<Args extends StandardSchemaWithJSON>(name: string, config: {
13252
13349
  title?: string;
13253
13350
  description?: string;
13254
13351
  argsSchema?: Args;
13255
13352
  icons?: Icon[];
13353
+ /** Determines whether this prompt retrieval needs an OAuth scope challenge. */
13354
+ scopeChallenge?: ScopeChallengeHandler;
13256
13355
  _meta?: Record<string, unknown>;
13257
13356
  }, cb: PromptCallback<Args>): RegisteredPrompt;
13258
13357
  /** @deprecated Wrap with `z.object({...})` instead. Raw-shape form: `argsSchema` may be a plain `{ field: z.string() }` record; it is auto-wrapped with `z.object()`. */
@@ -13261,6 +13360,7 @@ declare class McpServer {
13261
13360
  description?: string;
13262
13361
  argsSchema?: Args;
13263
13362
  icons?: Icon[];
13363
+ scopeChallenge?: ScopeChallengeHandler;
13264
13364
  _meta?: Record<string, unknown>;
13265
13365
  }, cb: LegacyPromptCallback<Args>): RegisteredPrompt;
13266
13366
  /**
@@ -13371,7 +13471,7 @@ type RegisteredTool = {
13371
13471
  outputSchema?: StandardSchemaWithJSON;
13372
13472
  /**
13373
13473
  * @hidden
13374
- * The converted JSON Schema of `outputSchema`, memoised at registration (and on
13474
+ * The converted JSON Schema of `outputSchema`, memoised on first use (and on
13375
13475
  * `update({outputSchema})`) so the `tools/call` handler passes the SAME advertised schema
13376
13476
  * `tools/list` emits to the wire codec's `projectCallToolResult` — the SEP-2106 `{result:…}`
13377
13477
  * wrap predicate follows the schema's root, never the runtime value shape. `undefined` when
@@ -13381,6 +13481,7 @@ type RegisteredTool = {
13381
13481
  annotations?: ToolAnnotations;
13382
13482
  icons?: Icon[];
13383
13483
  execution?: ToolExecution;
13484
+ scopeChallenge?: ScopeChallengeHandler;
13384
13485
  _meta?: Record<string, unknown>;
13385
13486
  handler: AnyToolHandler<StandardSchemaWithJSON | undefined>;
13386
13487
  /** @hidden */
@@ -13396,6 +13497,7 @@ type RegisteredTool = {
13396
13497
  outputSchema?: StandardSchemaWithJSON;
13397
13498
  annotations?: ToolAnnotations;
13398
13499
  icons?: Icon[];
13500
+ scopeChallenge?: ScopeChallengeHandler | null;
13399
13501
  _meta?: Record<string, unknown>;
13400
13502
  callback?: ToolCallback<StandardSchemaWithJSON>;
13401
13503
  enabled?: boolean;
@@ -13420,6 +13522,7 @@ type RegisteredResource = {
13420
13522
  metadata?: ResourceMetadata;
13421
13523
  /** Cache hint applied to this resource's `resources/read` results on the 2026-07-28 revision. */
13422
13524
  cacheHint?: CacheHint;
13525
+ scopeChallenge?: ScopeChallengeHandler;
13423
13526
  readCallback: ReadResourceCallback;
13424
13527
  enabled: boolean;
13425
13528
  enable(): void;
@@ -13429,6 +13532,7 @@ type RegisteredResource = {
13429
13532
  title?: string;
13430
13533
  uri?: string | null;
13431
13534
  metadata?: ResourceMetadata;
13535
+ scopeChallenge?: ScopeChallengeHandler | null;
13432
13536
  callback?: ReadResourceCallback;
13433
13537
  enabled?: boolean;
13434
13538
  }): void;
@@ -13444,6 +13548,7 @@ type RegisteredResourceTemplate = {
13444
13548
  metadata?: ResourceMetadata;
13445
13549
  /** Cache hint applied to this template's `resources/read` results on the 2026-07-28 revision. */
13446
13550
  cacheHint?: CacheHint;
13551
+ scopeChallenge?: ScopeChallengeHandler;
13447
13552
  readCallback: ReadResourceTemplateCallback;
13448
13553
  enabled: boolean;
13449
13554
  enable(): void;
@@ -13453,6 +13558,7 @@ type RegisteredResourceTemplate = {
13453
13558
  title?: string;
13454
13559
  template?: ResourceTemplate;
13455
13560
  metadata?: ResourceMetadata;
13561
+ scopeChallenge?: ScopeChallengeHandler | null;
13456
13562
  callback?: ReadResourceTemplateCallback;
13457
13563
  enabled?: boolean;
13458
13564
  }): void;
@@ -13469,6 +13575,7 @@ type RegisteredPrompt = {
13469
13575
  description?: string;
13470
13576
  argsSchema?: StandardSchemaWithJSON;
13471
13577
  icons?: Icon[];
13578
+ scopeChallenge?: ScopeChallengeHandler;
13472
13579
  _meta?: Record<string, unknown>;
13473
13580
  /** @hidden */
13474
13581
  handler: PromptHandler;
@@ -13481,6 +13588,7 @@ type RegisteredPrompt = {
13481
13588
  description?: string;
13482
13589
  argsSchema?: Args;
13483
13590
  icons?: Icon[];
13591
+ scopeChallenge?: ScopeChallengeHandler | null;
13484
13592
  _meta?: Record<string, unknown>;
13485
13593
  callback?: PromptCallback<Args>;
13486
13594
  enabled?: boolean;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { Bt as RESEND_DOWNLOAD_ORIGIN, Et as stripInvisible, H as CommsError, Ht as VERSION, It as PACKAGE_NAME, Lt as RESEND_CALLER, N as resendRequest, P as ResendContext, Rt as REFUSED, Vt as ROUTES, b as readBody, ft as neutralise, h as resendId, pt as newBoundary, v as addressesOf, y as attachmentRisks, z as keyPermissionOf, zt as RESEND_API_ORIGIN } from "./send-DEor7f1N.mjs";
2
- import { t as createResendMcpServer } from "./server-xhrQV9qo.mjs";
1
+ import { Bt as RESEND_DOWNLOAD_ORIGIN, Et as stripInvisible, H as CommsError, Ht as VERSION, It as PACKAGE_NAME, Lt as RESEND_CALLER, N as resendRequest, P as ResendContext, Rt as REFUSED, Vt as ROUTES, b as readBody, ft as neutralise, h as resendId, pt as newBoundary, v as addressesOf, y as attachmentRisks, z as keyPermissionOf, zt as RESEND_API_ORIGIN } from "./send-D-SXJezp.mjs";
2
+ import { t as createResendMcpServer } from "./server-BZOLLDTu.mjs";
3
3
  //#region src/operations/events.ts
4
4
  const BODY_LIMIT = 2e4;
5
5
  const STATUS = /* @__PURE__ */ new Set([