@zuplo/cli 7.8.6 → 7.8.8

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.
Files changed (122) hide show
  1. package/node_modules/@modelcontextprotocol/client/dist/{index-CHhhk6PQ.d.cts → index-BCtJi0p5.d.mts} +38 -6
  2. package/node_modules/@modelcontextprotocol/client/dist/index-BCtJi0p5.d.mts.map +1 -0
  3. package/node_modules/@modelcontextprotocol/client/dist/{index-D4xIIEF6.d.mts → index-CEk3qkZM.d.cts} +41 -3
  4. package/node_modules/@modelcontextprotocol/client/dist/index-CEk3qkZM.d.cts.map +1 -0
  5. package/node_modules/@modelcontextprotocol/client/dist/index.cjs +375 -60
  6. package/node_modules/@modelcontextprotocol/client/dist/index.cjs.map +1 -1
  7. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts +227 -11
  8. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -1
  9. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts +227 -11
  10. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -1
  11. package/node_modules/@modelcontextprotocol/client/dist/index.mjs +369 -61
  12. package/node_modules/@modelcontextprotocol/client/dist/index.mjs.map +1 -1
  13. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +1 -1
  14. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +1 -1
  15. package/node_modules/@modelcontextprotocol/client/dist/{src-NAgB4Mp8.cjs → src-D0qEN74R.cjs} +111 -38
  16. package/node_modules/@modelcontextprotocol/client/dist/src-D0qEN74R.cjs.map +1 -0
  17. package/node_modules/@modelcontextprotocol/client/dist/{src-D_zzAWoS.mjs → src-DDAAhLnO.mjs} +106 -33
  18. package/node_modules/@modelcontextprotocol/client/dist/src-DDAAhLnO.mjs.map +1 -0
  19. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +8 -2
  20. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs.map +1 -1
  21. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts +1 -1
  22. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +1 -1
  23. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts +1 -1
  24. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +1 -1
  25. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +8 -2
  26. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs.map +1 -1
  27. package/node_modules/@modelcontextprotocol/client/package.json +4 -4
  28. package/node_modules/@modelcontextprotocol/core/dist/{auth-BWdKR39I.d.mts → auth--n_Yzytt.d.cts} +6 -1
  29. package/node_modules/@modelcontextprotocol/core/dist/{auth-BWdKR39I.d.mts.map → auth--n_Yzytt.d.cts.map} +1 -1
  30. package/node_modules/@modelcontextprotocol/core/dist/{auth-CfDMXiII.cjs → auth-4-zilcqg.cjs} +3 -2
  31. package/node_modules/@modelcontextprotocol/core/dist/{auth-CfDMXiII.cjs.map → auth-4-zilcqg.cjs.map} +1 -1
  32. package/node_modules/@modelcontextprotocol/core/dist/{auth-CUe6YdwF.mjs → auth-CGP0BDVq.mjs} +3 -2
  33. package/node_modules/@modelcontextprotocol/core/dist/{auth-CUe6YdwF.mjs.map → auth-CGP0BDVq.mjs.map} +1 -1
  34. package/node_modules/@modelcontextprotocol/core/dist/{auth-hYtaIUZm.d.cts → auth-YUQV3RRv.d.mts} +6 -1
  35. package/node_modules/@modelcontextprotocol/core/dist/{auth-hYtaIUZm.d.cts.map → auth-YUQV3RRv.d.mts.map} +1 -1
  36. package/node_modules/@modelcontextprotocol/core/dist/index.cjs +1 -1
  37. package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +1 -1
  38. package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +1 -1
  39. package/node_modules/@modelcontextprotocol/core/dist/index.mjs +1 -1
  40. package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +1 -1
  41. package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +1 -1
  42. package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +1 -1
  43. package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +1 -1
  44. package/node_modules/@modelcontextprotocol/core/package.json +1 -1
  45. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts +15 -4
  46. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts.map +1 -1
  47. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js +22 -3
  48. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js.map +1 -1
  49. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts.map +1 -1
  50. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js +3 -1
  51. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js.map +1 -1
  52. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.d.ts +25 -0
  53. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.d.ts.map +1 -0
  54. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.js +64 -0
  55. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.js.map +1 -0
  56. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts +10 -1
  57. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts.map +1 -1
  58. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js +13 -1
  59. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js.map +1 -1
  60. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts +15 -4
  61. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts.map +1 -1
  62. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js +22 -3
  63. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map +1 -1
  64. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts.map +1 -1
  65. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js +3 -1
  66. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js.map +1 -1
  67. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.d.ts +25 -0
  68. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.d.ts.map +1 -0
  69. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.js +58 -0
  70. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.js.map +1 -0
  71. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts +10 -1
  72. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts.map +1 -1
  73. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js +13 -1
  74. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js.map +1 -1
  75. package/node_modules/@modelcontextprotocol/sdk/package.json +1 -1
  76. package/node_modules/@modelcontextprotocol/server/dist/{createMcpHandler-dBHMsxwf.d.cts → createMcpHandler-BLVe3qmU.d.cts} +110 -7
  77. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-BLVe3qmU.d.cts.map +1 -0
  78. package/node_modules/@modelcontextprotocol/server/dist/{createMcpHandler-CLhGwQTn.d.mts → createMcpHandler-Bt6U_Fqb.d.mts} +110 -7
  79. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-Bt6U_Fqb.d.mts.map +1 -0
  80. package/node_modules/@modelcontextprotocol/server/dist/index.cjs +144 -248
  81. package/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -1
  82. package/node_modules/@modelcontextprotocol/server/dist/index.d.cts +38 -3
  83. package/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -1
  84. package/node_modules/@modelcontextprotocol/server/dist/index.d.mts +38 -3
  85. package/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -1
  86. package/node_modules/@modelcontextprotocol/server/dist/index.mjs +136 -243
  87. package/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -1
  88. package/node_modules/@modelcontextprotocol/server/dist/{mcp-D7GmuPnv.cjs → mcp-DUcCQSTW.cjs} +426 -21
  89. package/node_modules/@modelcontextprotocol/server/dist/mcp-DUcCQSTW.cjs.map +1 -0
  90. package/node_modules/@modelcontextprotocol/server/dist/{mcp-DXXb3Vv3.mjs → mcp-Dw2OlZ1f.mjs} +367 -22
  91. package/node_modules/@modelcontextprotocol/server/dist/mcp-Dw2OlZ1f.mjs.map +1 -0
  92. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +1 -1
  93. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +1 -1
  94. package/node_modules/@modelcontextprotocol/server/dist/{src-STyD_Vvf.cjs → src-CgFsfg3E.cjs} +114 -36
  95. package/node_modules/@modelcontextprotocol/server/dist/src-CgFsfg3E.cjs.map +1 -0
  96. package/node_modules/@modelcontextprotocol/server/dist/{src-CX2iR2pK.mjs → src-D-y6h4N7.mjs} +114 -36
  97. package/node_modules/@modelcontextprotocol/server/dist/src-D-y6h4N7.mjs.map +1 -0
  98. package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +30 -3
  99. package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -1
  100. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +9 -1
  101. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -1
  102. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +9 -1
  103. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -1
  104. package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +30 -3
  105. package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -1
  106. package/node_modules/@modelcontextprotocol/server/package.json +3 -3
  107. package/node_modules/@zuplo/core/package.json +1 -1
  108. package/node_modules/@zuplo/graphql/package.json +1 -1
  109. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  110. package/node_modules/@zuplo/otel/package.json +1 -1
  111. package/node_modules/@zuplo/runtime/package.json +1 -1
  112. package/package.json +11 -11
  113. package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts.map +0 -1
  114. package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts.map +0 -1
  115. package/node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs.map +0 -1
  116. package/node_modules/@modelcontextprotocol/client/dist/src-NAgB4Mp8.cjs.map +0 -1
  117. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts.map +0 -1
  118. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts.map +0 -1
  119. package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs.map +0 -1
  120. package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs.map +0 -1
  121. package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs.map +0 -1
  122. package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs.map +0 -1
@@ -176,6 +176,16 @@ let OAuthErrorCode = /* @__PURE__ */ function(OAuthErrorCode$1) {
176
176
  * The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)
177
177
  */
178
178
  OAuthErrorCode$1["InvalidTarget"] = "invalid_target";
179
+ /**
180
+ * The DPoP proof accompanying the request is invalid, or does not match the key the grant
181
+ * (e.g. a refresh token) is bound to. (RFC 9449 §5 / §7.1)
182
+ */
183
+ OAuthErrorCode$1["InvalidDpopProof"] = "invalid_dpop_proof";
184
+ /**
185
+ * The server requires a server-supplied nonce in the DPoP proof; retry with the `DPoP-Nonce`
186
+ * it returned. (RFC 9449 §8 / §9)
187
+ */
188
+ OAuthErrorCode$1["UseDpopNonce"] = "use_dpop_nonce";
179
189
  return OAuthErrorCode$1;
180
190
  }({});
181
191
  /**
@@ -359,8 +369,18 @@ var SdkError = class extends Error {
359
369
  if (typeof this !== "function") throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
360
370
  return brandedHasInstance(this, value);
361
371
  }
362
- constructor(code, message, data) {
363
- super(message);
372
+ /**
373
+ * @param code - Stable string code identifying the failure ({@linkcode SdkErrorCode}).
374
+ * @param message - Human-readable description.
375
+ * @param data - Optional structured payload (for example the HTTP status carried by
376
+ * {@linkcode SdkHttpError}). Opaque to the SDK: a `cause` key inside `data` is not
377
+ * promoted to `Error.cause`.
378
+ * @param options - Standard `ErrorOptions`, forwarded to `Error`. Pass the underlying
379
+ * failure as `{ cause }` so it is reachable through the `Error.cause` chain that
380
+ * loggers and error trackers walk.
381
+ */
382
+ constructor(code, message, data, options) {
383
+ super(message, options);
364
384
  this.code = code;
365
385
  this.data = data;
366
386
  this.name = "SdkError";
@@ -387,8 +407,11 @@ var SdkHttpError = class extends SdkError {
387
407
  static {
388
408
  Object.defineProperty(this, "mcpBrand", { value: "mcp.SdkHttpError" });
389
409
  }
390
- constructor(code, message, data) {
391
- super(code, message, data);
410
+ /**
411
+ * @param options - Standard `ErrorOptions`, forwarded to `Error` (see {@linkcode SdkError}).
412
+ */
413
+ constructor(code, message, data, options) {
414
+ super(code, message, data, options);
392
415
  this.name = "SdkHttpError";
393
416
  }
394
417
  get status() {
@@ -2214,7 +2237,7 @@ const rev2025NotificationMethods = Object.keys(notificationMethodKeys$1);
2214
2237
 
2215
2238
  //#endregion
2216
2239
  //#region ../core-internal/src/wire/rev2025-11-25/codec.ts
2217
- function isPlainObject$4(value) {
2240
+ function isPlainObject$5(value) {
2218
2241
  return value !== null && typeof value === "object" && !Array.isArray(value);
2219
2242
  }
2220
2243
  /** Tri-state wrap of an optional Zod schema lookup (the function-only contract). */
@@ -2239,7 +2262,7 @@ const NOT_IN_ERA$1 = {
2239
2262
  };
2240
2263
  /** Whether a `tools/list` entry advertises a non-object `outputSchema` root that needs the SEP-2106 legacy wrap. */
2241
2264
  function toolNeedsLegacyWrap(t) {
2242
- return isPlainObject$4(t) && isPlainObject$4(t["outputSchema"]) && isNonObjectJsonSchemaRoot(t["outputSchema"]);
2265
+ return isPlainObject$5(t) && isPlainObject$5(t["outputSchema"]) && isNonObjectJsonSchemaRoot(t["outputSchema"]);
2243
2266
  }
2244
2267
  /** The wire→neutral trust boundary: a decoded 2025-era wire result is adopted as the neutral `Result` here (the module's single deliberate assertion). */
2245
2268
  function toNeutralResult(value) {
@@ -2274,7 +2297,7 @@ const rev2025Codec = {
2274
2297
  };
2275
2298
  },
2276
2299
  decodeResult(_method, raw) {
2277
- if (isPlainObject$4(raw) && "resultType" in raw) {
2300
+ if (isPlainObject$5(raw) && "resultType" in raw) {
2278
2301
  const stripped = { ...raw };
2279
2302
  delete stripped["resultType"];
2280
2303
  return {
@@ -3649,7 +3672,7 @@ function fillCacheFields(method, result) {
3649
3672
  delete filled[RESULT_CACHE_HINT_FALLBACK];
3650
3673
  return filled;
3651
3674
  }
3652
- function isPlainObject$3(value) {
3675
+ function isPlainObject$4(value) {
3653
3676
  return value !== null && typeof value === "object" && !Array.isArray(value);
3654
3677
  }
3655
3678
  /**
@@ -3677,7 +3700,7 @@ function stampServerInfoMeta(result, serverInfo) {
3677
3700
  ...result,
3678
3701
  _meta: { [SERVER_INFO_META_KEY]: serverInfo }
3679
3702
  };
3680
- if (!isPlainObject$3(meta)) return result;
3703
+ if (!isPlainObject$4(meta)) return result;
3681
3704
  if (meta[SERVER_INFO_META_KEY] !== void 0) return result;
3682
3705
  return {
3683
3706
  ...result,
@@ -3822,7 +3845,7 @@ const rev2026NotificationMethods = Object.keys(notificationMethodKeys);
3822
3845
 
3823
3846
  //#endregion
3824
3847
  //#region ../core-internal/src/wire/rev2026-07-28/codec.ts
3825
- function isPlainObject$2(value) {
3848
+ function isPlainObject$3(value) {
3826
3849
  return value !== null && typeof value === "object" && !Array.isArray(value);
3827
3850
  }
3828
3851
  /** Tri-state wrap of an optional Zod schema lookup (the function-only contract). */
@@ -3864,14 +3887,14 @@ function enforceDeletedFields(method, result) {
3864
3887
  return next;
3865
3888
  };
3866
3889
  const tools = result.tools;
3867
- if (method === "tools/list" && Array.isArray(tools) && tools.some((tool) => isPlainObject$2(tool) && "execution" in tool)) copy().tools = tools.map((tool) => {
3868
- if (!isPlainObject$2(tool) || !("execution" in tool)) return tool;
3890
+ if (method === "tools/list" && Array.isArray(tools) && tools.some((tool) => isPlainObject$3(tool) && "execution" in tool)) copy().tools = tools.map((tool) => {
3891
+ if (!isPlainObject$3(tool) || !("execution" in tool)) return tool;
3869
3892
  const rest = { ...tool };
3870
3893
  delete rest["execution"];
3871
3894
  return rest;
3872
3895
  });
3873
3896
  const capabilities = result.capabilities;
3874
- if (isPlainObject$2(capabilities) && "tasks" in capabilities) {
3897
+ if (isPlainObject$3(capabilities) && "tasks" in capabilities) {
3875
3898
  const rest = { ...capabilities };
3876
3899
  delete rest["tasks"];
3877
3900
  copy().capabilities = rest;
@@ -3918,7 +3941,7 @@ const rev2026Codec = {
3918
3941
  projectCallToolResult: (result) => appendTextFallbackForNonObject(result),
3919
3942
  inputRequestSchema: getInputRequestSchema2026,
3920
3943
  decodeResult(method, raw) {
3921
- if (!isPlainObject$2(raw)) return {
3944
+ if (!isPlainObject$3(raw)) return {
3922
3945
  kind: "invalid",
3923
3946
  error: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: not an object`, { method })
3924
3947
  };
@@ -3939,7 +3962,7 @@ const rev2026Codec = {
3939
3962
  };
3940
3963
  if (rawResultType === "input_required") {
3941
3964
  const rawInputRequests = raw["inputRequests"];
3942
- const inputRequests = isPlainObject$2(rawInputRequests) ? rawInputRequests : {};
3965
+ const inputRequests = isPlainObject$3(rawInputRequests) ? rawInputRequests : {};
3943
3966
  const requestState = raw["requestState"];
3944
3967
  if (Object.keys(inputRequests).length === 0 && typeof requestState !== "string") return {
3945
3968
  kind: "invalid",
@@ -4607,7 +4630,7 @@ const INBOUND_VALIDATION_LADDER = [
4607
4630
  evaluatedAt: "pre-dispatch",
4608
4631
  codes: [HEADER_MISMATCH_ERROR_CODE],
4609
4632
  conformance: ["http-header-validation"],
4610
- rationale: "SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."
4633
+ rationale: "SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half — including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."
4611
4634
  },
4612
4635
  {
4613
4636
  rung: "client-capabilities",
@@ -4650,6 +4673,55 @@ const LADDER_ERROR_HTTP_STATUS = {
4650
4673
  [ProtocolErrorCode.MissingRequiredClientCapability]: 400,
4651
4674
  [HEADER_MISMATCH_ERROR_CODE]: 400
4652
4675
  };
4676
+ /**
4677
+ * The methods whose body carries a `params.name` / `params.uri` /
4678
+ * `params.taskId` value the `Mcp-Name` header must mirror, and which body
4679
+ * field supplies it. The core rows come from SEP-2243 § Standard Request
4680
+ * Headers (`Required For` column); the `tasks/*` rows come from SEP-2663's
4681
+ * Streamable HTTP binding ("the client MUST set the `Mcp-Name` header to the
4682
+ * value of `params.taskId`" for `tasks/get` / `tasks/update` /
4683
+ * `tasks/cancel`, so intermediaries can route every request for a task to the
4684
+ * instance holding its state). Shared by the client transport (header
4685
+ * emission) and the server ladder (validation) so both sides derive from one
4686
+ * table.
4687
+ */
4688
+ const MCP_NAME_HEADER_SOURCE = {
4689
+ "tools/call": "name",
4690
+ "prompts/get": "name",
4691
+ "resources/read": "uri",
4692
+ "tasks/get": "taskId",
4693
+ "tasks/update": "taskId",
4694
+ "tasks/cancel": "taskId"
4695
+ };
4696
+ /**
4697
+ * Resolve the `Mcp-Name` source for one request against
4698
+ * {@linkcode MCP_NAME_HEADER_SOURCE}: which body field the header mirrors for
4699
+ * `method`, and the string value that field carries in `params`.
4700
+ *
4701
+ * Returns `undefined` when `method` is off-table (no `Mcp-Name` is emitted or
4702
+ * required). Otherwise `value` is the field's string value, or `undefined`
4703
+ * when `params` is not a plain object or the field is absent / not a string —
4704
+ * the client emits no header then, and the server leaves that body to the
4705
+ * rungs further down the ladder.
4706
+ *
4707
+ * `method` is peer-supplied on the server and caller-supplied on the client,
4708
+ * so the table lookup is `Object.hasOwn`-guarded against `Object.prototype`
4709
+ * collisions (`constructor`, `toString`, …). Shared by the client transport
4710
+ * (emission) and {@linkcode validateStandardRequestHeaders} (validation) so
4711
+ * the extraction — not just the table — cannot drift between the two sides.
4712
+ */
4713
+ function mcpNameSource(method, params) {
4714
+ const field = Object.hasOwn(MCP_NAME_HEADER_SOURCE, method) ? MCP_NAME_HEADER_SOURCE[method] : void 0;
4715
+ if (field === void 0) return;
4716
+ const raw = isPlainObject$2(params) ? params[field] : void 0;
4717
+ return {
4718
+ field,
4719
+ value: typeof raw === "string" ? raw : void 0
4720
+ };
4721
+ }
4722
+ function isPlainObject$2(value) {
4723
+ return value !== null && typeof value === "object" && !Array.isArray(value);
4724
+ }
4653
4725
 
4654
4726
  //#endregion
4655
4727
  //#region ../core-internal/src/util/schema.ts
@@ -5697,7 +5769,7 @@ var Protocol = class {
5697
5769
  return this._requestHandlers.get(method);
5698
5770
  }
5699
5771
  async _oncancel(notification) {
5700
- if (!notification.params.requestId) return;
5772
+ if (notification.params.requestId === void 0) return;
5701
5773
  this._requestHandlerAbortControllers.get(notification.params.requestId)?.abort(notification.params.reason);
5702
5774
  }
5703
5775
  _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
@@ -6096,19 +6168,20 @@ var Protocol = class {
6096
6168
  const cancel = (reason) => {
6097
6169
  if (responseReceived) return;
6098
6170
  this._progressHandlers.delete(messageId);
6099
- if (requestAbort === void 0) this._transport?.send(this._envelopeOutbound({
6100
- jsonrpc: "2.0",
6101
- method: "notifications/cancelled",
6102
- params: {
6103
- requestId: messageId,
6104
- reason: String(reason)
6105
- }
6106
- }), {
6107
- relatedRequestId,
6108
- resumptionToken,
6109
- onresumptiontoken
6110
- }).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send cancellation: ${error}`)));
6111
- else requestAbort.abort();
6171
+ if (requestAbort === void 0) {
6172
+ if (request.method !== "initialize") this._transport?.send(this._envelopeOutbound({
6173
+ jsonrpc: "2.0",
6174
+ method: "notifications/cancelled",
6175
+ params: {
6176
+ requestId: messageId,
6177
+ reason: String(reason)
6178
+ }
6179
+ }), {
6180
+ relatedRequestId,
6181
+ resumptionToken,
6182
+ onresumptiontoken
6183
+ }).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send cancellation: ${error}`)));
6184
+ } else requestAbort.abort();
6112
6185
  reject(reason instanceof SdkError ? reason : new SdkError(SdkErrorCode.RequestTimeout, String(reason)));
6113
6186
  };
6114
6187
  this._responseHandlers.set(messageId, (response) => {
@@ -6188,7 +6261,7 @@ var Protocol = class {
6188
6261
  jsonrpc: "2.0",
6189
6262
  ...notification
6190
6263
  });
6191
- if ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params && !options?.relatedRequestId) {
6264
+ if ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params && options?.relatedRequestId === void 0) {
6192
6265
  if (this._pendingDebouncedNotifications.has(notification.method)) return;
6193
6266
  this._pendingDebouncedNotifications.add(notification.method);
6194
6267
  Promise.resolve().then(() => {
@@ -7059,5 +7132,5 @@ function fromJsonSchema(schema, validator) {
7059
7132
  }
7060
7133
 
7061
7134
  //#endregion
7062
- export { legacyProtocolVersions as $, isInitializeRequest as A, SdkErrorCode as At, DiscoverResultSchema as B, HEADER_MISMATCH_ERROR_CODE as C, OAuthClientInformationFullSchema as Ct, assertCompleteRequestPrompt as D, OAuthTokensSchema as Dt, scanXMcpHeaderDeclarations as E, OAuthProtectedResourceMetadataSchema as Et, isJSONRPCRequest as F, stampErrorBrands as Ft, MissingRequiredClientCapabilityError as G, ListChangedOptionsBaseSchema as H, isJSONRPCResponse as I, UnsupportedProtocolVersionError as J, ProtocolError as K, isJSONRPCResultResponse as L, isInputRequiredResult as M, OAuthError as Mt, isJSONRPCErrorResponse as N, OAuthErrorCode as Nt, assertCompleteRequestResourceTemplate as O, OpenIdProviderDiscoveryMetadataSchema as Ot, isJSONRPCNotification as P, brandedHasInstance as Pt, isModernProtocolVersion as Q, isTaskAugmentedRequestParams as R, parseSchema as S, IdJagTokenExchangeResponseSchema as St, encodeMcpParamValue as T, OAuthMetadataSchema as Tt, MODERN_WIRE_REVISION as U, JSONRPCMessageSchema as V, codecForVersion as W, ProtocolErrorCode as X, UrlElicitationRequiredError as Y, SUPPORTED_MODERN_PROTOCOL_VERSIONS as Z, mergeCapabilities as _, SUPPORTED_PROTOCOL_VERSIONS as _t, createFetchWithInit as a, INTERNAL_ERROR as at, resolveInputRequiredDriverConfig as b, checkResourceAllowed as bt, STDIO_DEFAULT_MAX_BUFFER_SIZE as c, JSONRPC_VERSION as ct, getDisplayName as d, METHOD_NOT_FOUND as dt, modernProtocolVersions as et, isJsonContentType as f, PARSE_ERROR as ft, Protocol as g, SUBSCRIPTION_ID_META_KEY as gt, DEFAULT_REQUEST_TIMEOUT_MSEC as h, SERVER_INFO_META_KEY as ht, UriTemplate as i, DEFAULT_NEGOTIATED_PROTOCOL_VERSION as it, isInitializedNotification as j, SdkHttpError as jt, isCallToolResult as k, SdkError as kt, deserializeMessage as l, LATEST_PROTOCOL_VERSION as lt, runInputRequiredFlow as m, RELATED_TASK_META_KEY as mt, preloadSchemas as n, CLIENT_CAPABILITIES_META_KEY as nt, normalizeHeaders as o, INVALID_PARAMS as ot, mediaTypeEssence as p, PROTOCOL_VERSION_META_KEY as pt, ResourceNotFoundError as q, InMemoryTransport as r, CLIENT_INFO_META_KEY as rt, ReadBuffer as s, INVALID_REQUEST as st, fromJsonSchema as t, BAGGAGE_META_KEY as tt, serializeMessage as u, LOG_LEVEL_META_KEY as ut, isSpecType as v, TRACEPARENT_META_KEY as vt, buildMcpParamHeaders as w, OAuthErrorResponseSchema as wt, withInputRequired as x, resourceUrlFromServerUrl as xt, specTypeSchemas as y, TRACESTATE_META_KEY as yt, parseJSONRPCMessage as z };
7063
- //# sourceMappingURL=src-D_zzAWoS.mjs.map
7135
+ export { legacyProtocolVersions as $, isInitializeRequest as A, SdkErrorCode as At, DiscoverResultSchema as B, mcpNameSource as C, OAuthClientInformationFullSchema as Ct, assertCompleteRequestPrompt as D, OAuthTokensSchema as Dt, scanXMcpHeaderDeclarations as E, OAuthProtectedResourceMetadataSchema as Et, isJSONRPCRequest as F, stampErrorBrands as Ft, MissingRequiredClientCapabilityError as G, ListChangedOptionsBaseSchema as H, isJSONRPCResponse as I, UnsupportedProtocolVersionError as J, ProtocolError as K, isJSONRPCResultResponse as L, isInputRequiredResult as M, OAuthError as Mt, isJSONRPCErrorResponse as N, OAuthErrorCode as Nt, assertCompleteRequestResourceTemplate as O, OpenIdProviderDiscoveryMetadataSchema as Ot, isJSONRPCNotification as P, brandedHasInstance as Pt, isModernProtocolVersion as Q, isTaskAugmentedRequestParams as R, HEADER_MISMATCH_ERROR_CODE as S, IdJagTokenExchangeResponseSchema as St, encodeMcpParamValue as T, OAuthMetadataSchema as Tt, MODERN_WIRE_REVISION as U, JSONRPCMessageSchema as V, codecForVersion as W, ProtocolErrorCode as X, UrlElicitationRequiredError as Y, SUPPORTED_MODERN_PROTOCOL_VERSIONS as Z, isSpecType as _, SUPPORTED_PROTOCOL_VERSIONS as _t, createFetchWithInit as a, INTERNAL_ERROR as at, withInputRequired as b, checkResourceAllowed as bt, deserializeMessage as c, JSONRPC_VERSION as ct, isJsonContentType as d, METHOD_NOT_FOUND as dt, modernProtocolVersions as et, mediaTypeEssence as f, PARSE_ERROR as ft, mergeCapabilities as g, SUBSCRIPTION_ID_META_KEY as gt, Protocol as h, SERVER_INFO_META_KEY as ht, UriTemplate as i, DEFAULT_NEGOTIATED_PROTOCOL_VERSION as it, isInitializedNotification as j, SdkHttpError as jt, isCallToolResult as k, SdkError as kt, serializeMessage as l, LATEST_PROTOCOL_VERSION as lt, DEFAULT_REQUEST_TIMEOUT_MSEC as m, RELATED_TASK_META_KEY as mt, preloadSchemas as n, CLIENT_CAPABILITIES_META_KEY as nt, ReadBuffer as o, INVALID_PARAMS as ot, runInputRequiredFlow as p, PROTOCOL_VERSION_META_KEY as pt, ResourceNotFoundError as q, InMemoryTransport as r, CLIENT_INFO_META_KEY as rt, STDIO_DEFAULT_MAX_BUFFER_SIZE as s, INVALID_REQUEST as st, fromJsonSchema as t, BAGGAGE_META_KEY as tt, getDisplayName as u, LOG_LEVEL_META_KEY as ut, specTypeSchemas as v, TRACEPARENT_META_KEY as vt, buildMcpParamHeaders as w, OAuthErrorResponseSchema as wt, parseSchema as x, resourceUrlFromServerUrl as xt, resolveInputRequiredDriverConfig as y, TRACESTATE_META_KEY as yt, parseJSONRPCMessage as z };
7136
+ //# sourceMappingURL=src-DDAAhLnO.mjs.map