@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() {
@@ -4770,9 +4793,15 @@ function paramHeaderMismatchRejection(cell, header, body) {
4770
4793
  * named revision belongs to (a malformed envelope behind a present claim is
4771
4794
  * a validation error, never a silent fall back to legacy handling).
4772
4795
  * - A request without a claim is legacy-era traffic.
4773
- * - The `MCP-Protocol-Version` header is a cross-check only: it never
4774
- * upgrades or downgrades a body-derived classification, and a disagreement
4775
- * between header and body is an explicit ladder outcome.
4796
+ * - The `MCP-Protocol-Version` header is a cross-check only *for
4797
+ * classification*: it never upgrades or downgrades a body-derived
4798
+ * classification, and a disagreement between header and body is an explicit
4799
+ * ladder outcome. Its absence likewise never changes the era — but the spec
4800
+ * requires the header on every modern *request* POST, so a
4801
+ * modern-classified request that omits it is refused one rung later, by
4802
+ * {@linkcode validateStandardRequestHeaders}, not here. Notification POSTs
4803
+ * are exempt (see the next bullet), and that rung enforces presence on
4804
+ * requests only.
4776
4805
  * - Notifications carry no envelope claim of their own under the current
4777
4806
  * spec, so for notification POSTs without a body claim the modern header is
4778
4807
  * determinative; the `Mcp-Method` header is validated against the body when
@@ -4900,7 +4929,7 @@ const INBOUND_VALIDATION_LADDER = [
4900
4929
  evaluatedAt: "pre-dispatch",
4901
4930
  codes: [HEADER_MISMATCH_ERROR_CODE],
4902
4931
  conformance: ["http-header-validation"],
4903
- 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."
4932
+ 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."
4904
4933
  },
4905
4934
  {
4906
4935
  rung: "client-capabilities",
@@ -4983,15 +5012,51 @@ function crossCheckMismatch(cell, header, body, rung = "era-classification") {
4983
5012
  } }), true);
4984
5013
  }
4985
5014
  /**
4986
- * The methods whose body carries a `params.name` / `params.uri` value the
4987
- * `Mcp-Name` header must mirror, and which body field supplies it (SEP-2243
4988
- * § Standard Request Headers, `Required For` column).
5015
+ * The methods whose body carries a `params.name` / `params.uri` /
5016
+ * `params.taskId` value the `Mcp-Name` header must mirror, and which body
5017
+ * field supplies it. The core rows come from SEP-2243 § Standard Request
5018
+ * Headers (`Required For` column); the `tasks/*` rows come from SEP-2663's
5019
+ * Streamable HTTP binding ("the client MUST set the `Mcp-Name` header to the
5020
+ * value of `params.taskId`" for `tasks/get` / `tasks/update` /
5021
+ * `tasks/cancel`, so intermediaries can route every request for a task to the
5022
+ * instance holding its state). Shared by the client transport (header
5023
+ * emission) and the server ladder (validation) so both sides derive from one
5024
+ * table.
4989
5025
  */
4990
5026
  const MCP_NAME_HEADER_SOURCE = {
4991
5027
  "tools/call": "name",
4992
5028
  "prompts/get": "name",
4993
- "resources/read": "uri"
5029
+ "resources/read": "uri",
5030
+ "tasks/get": "taskId",
5031
+ "tasks/update": "taskId",
5032
+ "tasks/cancel": "taskId"
4994
5033
  };
5034
+ /**
5035
+ * Resolve the `Mcp-Name` source for one request against
5036
+ * {@linkcode MCP_NAME_HEADER_SOURCE}: which body field the header mirrors for
5037
+ * `method`, and the string value that field carries in `params`.
5038
+ *
5039
+ * Returns `undefined` when `method` is off-table (no `Mcp-Name` is emitted or
5040
+ * required). Otherwise `value` is the field's string value, or `undefined`
5041
+ * when `params` is not a plain object or the field is absent / not a string —
5042
+ * the client emits no header then, and the server leaves that body to the
5043
+ * rungs further down the ladder.
5044
+ *
5045
+ * `method` is peer-supplied on the server and caller-supplied on the client,
5046
+ * so the table lookup is `Object.hasOwn`-guarded against `Object.prototype`
5047
+ * collisions (`constructor`, `toString`, …). Shared by the client transport
5048
+ * (emission) and {@linkcode validateStandardRequestHeaders} (validation) so
5049
+ * the extraction — not just the table — cannot drift between the two sides.
5050
+ */
5051
+ function mcpNameSource(method, params) {
5052
+ const field = Object.hasOwn(MCP_NAME_HEADER_SOURCE, method) ? MCP_NAME_HEADER_SOURCE[method] : void 0;
5053
+ if (field === void 0) return;
5054
+ const raw = isPlainObject$2(params) ? params[field] : void 0;
5055
+ return {
5056
+ field,
5057
+ value: typeof raw === "string" ? raw : void 0
5058
+ };
5059
+ }
4995
5060
  /** Strip RFC 9110 optional whitespace (SP / HTAB) around a field value in linear time. */
4996
5061
  function stripHttpOws(value) {
4997
5062
  let start = 0;
@@ -5019,13 +5084,19 @@ function stripHttpOws(value) {
5019
5084
  * `era-classification` rung for the `MCP-Protocol-Version` and
5020
5085
  * `Mcp-Method` *mismatch* cells) when:
5021
5086
  *
5087
+ * - the required `MCP-Protocol-Version` header is absent (SEP-2243 requires it
5088
+ * on every modern *request* POST, and lists it first among the required
5089
+ * standard headers — so a request missing it *and* `Mcp-Method` is answered
5090
+ * by this cell);
5022
5091
  * - the required `Mcp-Method` header is absent;
5023
5092
  * - the required `Mcp-Name` header is absent on a `tools/call`,
5024
- * `prompts/get`, or `resources/read` request whose body carries the
5025
- * `params.name` / `params.uri` value the header mirrors;
5093
+ * `prompts/get`, `resources/read`, or (per SEP-2663's Streamable HTTP
5094
+ * binding) `tasks/get` / `tasks/update` / `tasks/cancel` request whose
5095
+ * body carries the `params.name` / `params.uri` / `params.taskId` value
5096
+ * the header mirrors;
5026
5097
  * - the `Mcp-Name` header carries an invalid `=?base64?…?=` sentinel; or
5027
5098
  * - the (decoded) `Mcp-Name` value disagrees with the body's
5028
- * `params.name` / `params.uri`.
5099
+ * `params.name` / `params.uri` / `params.taskId`.
5029
5100
  *
5030
5101
  * Returns `undefined` (pass) for notifications (the spec table reads
5031
5102
  * "All requests"), for methods that have no `Mcp-Name` source, and when the
@@ -5036,16 +5107,22 @@ function stripHttpOws(value) {
5036
5107
  * call to the classifier (no headers passed) keeps routing a modern request
5037
5108
  * unchanged: the classifier remains a pure body-primary router, and this
5038
5109
  * function is the presence/`Mcp-Name` half of the standard-header rung the
5039
- * entry layers on top.
5110
+ * entry layers on top. That separation is what lets the missing
5111
+ * `MCP-Protocol-Version` cell live here without disturbing the body-primary
5112
+ * rule — classification still resolves from the body (a proxy stripping the
5113
+ * header must not change the era), and only this rung refuses to serve it.
5040
5114
  */
5041
5115
  function validateStandardRequestHeaders(request, route) {
5042
5116
  if (route.messageKind !== "request") return;
5043
5117
  const method = route.message.method;
5118
+ if (request.protocolVersionHeader === void 0) {
5119
+ const claimed = route.classification.revision;
5120
+ return crossCheckMismatch("version-header-missing", "(missing)", claimed === void 0 ? "the body carries a modern per-request envelope but the required MCP-Protocol-Version header is absent" : `the body envelope names protocol version ${claimed} but the required MCP-Protocol-Version header is absent`, "standard-header-validation");
5121
+ }
5044
5122
  if (request.mcpMethodHeader === void 0) return crossCheckMismatch("method-header-missing", "(missing)", `the body names method ${method} but the required Mcp-Method header is absent`, "standard-header-validation");
5045
- const sourceField = Object.hasOwn(MCP_NAME_HEADER_SOURCE, method) ? MCP_NAME_HEADER_SOURCE[method] : void 0;
5046
- if (sourceField === void 0) return;
5047
- const sourceValue = route.message.params?.[sourceField];
5048
- const bodyValue = typeof sourceValue === "string" ? sourceValue : void 0;
5123
+ const source = mcpNameSource(method, route.message.params);
5124
+ if (source === void 0) return;
5125
+ const { field: sourceField, value: bodyValue } = source;
5049
5126
  if (request.mcpNameHeader === void 0) {
5050
5127
  if (bodyValue === void 0) return;
5051
5128
  return crossCheckMismatch("name-header-missing", "(missing)", `the body carries params.${sourceField}="${bodyValue}" but the required Mcp-Name header is absent`, "standard-header-validation");
@@ -6247,7 +6324,7 @@ var Protocol = class {
6247
6324
  return this._requestHandlers.get(method);
6248
6325
  }
6249
6326
  async _oncancel(notification) {
6250
- if (!notification.params.requestId) return;
6327
+ if (notification.params.requestId === void 0) return;
6251
6328
  this._requestHandlerAbortControllers.get(notification.params.requestId)?.abort(notification.params.reason);
6252
6329
  }
6253
6330
  _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
@@ -6646,19 +6723,20 @@ var Protocol = class {
6646
6723
  const cancel = (reason) => {
6647
6724
  if (responseReceived) return;
6648
6725
  this._progressHandlers.delete(messageId);
6649
- if (requestAbort === void 0) this._transport?.send(this._envelopeOutbound({
6650
- jsonrpc: "2.0",
6651
- method: "notifications/cancelled",
6652
- params: {
6653
- requestId: messageId,
6654
- reason: String(reason)
6655
- }
6656
- }), {
6657
- relatedRequestId,
6658
- resumptionToken,
6659
- onresumptiontoken
6660
- }).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send cancellation: ${error}`)));
6661
- else requestAbort.abort();
6726
+ if (requestAbort === void 0) {
6727
+ if (request.method !== "initialize") this._transport?.send(this._envelopeOutbound({
6728
+ jsonrpc: "2.0",
6729
+ method: "notifications/cancelled",
6730
+ params: {
6731
+ requestId: messageId,
6732
+ reason: String(reason)
6733
+ }
6734
+ }), {
6735
+ relatedRequestId,
6736
+ resumptionToken,
6737
+ onresumptiontoken
6738
+ }).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send cancellation: ${error}`)));
6739
+ } else requestAbort.abort();
6662
6740
  reject(reason instanceof SdkError ? reason : new SdkError(SdkErrorCode.RequestTimeout, String(reason)));
6663
6741
  };
6664
6742
  this._responseHandlers.set(messageId, (response) => {
@@ -6738,7 +6816,7 @@ var Protocol = class {
6738
6816
  jsonrpc: "2.0",
6739
6817
  ...notification
6740
6818
  });
6741
- if ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params && !options?.relatedRequestId) {
6819
+ if ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params && options?.relatedRequestId === void 0) {
6742
6820
  if (this._pendingDebouncedNotifications.has(notification.method)) return;
6743
6821
  this._pendingDebouncedNotifications.add(notification.method);
6744
6822
  Promise.resolve().then(() => {
@@ -7603,4 +7681,4 @@ function fromJsonSchema(schema, validator) {
7603
7681
 
7604
7682
  //#endregion
7605
7683
  export { isTaskAugmentedRequestParams as $, promptArgumentsFromStandardSchema as A, LATEST_PROTOCOL_VERSION as At, scanXMcpHeaderDeclarations as B, TRACESTATE_META_KEY as Bt, REQUEST_STATE_ONLY_LEG_PACING_MS as C, CLIENT_CAPABILITIES_META_KEY as Ct, acceptedContent as D, INVALID_PARAMS as Dt, sleep as E, INTERNAL_ERROR as Et, carriesValidModernEnvelopeClaim as F, RELATED_TASK_META_KEY as Ft, isInitializeRequest as G, resourceUrlFromServerUrl as Gt, assertCompleteRequestPrompt as H, requiredClientCapabilitiesForInputRequest as Ht, classifyInboundRequest as I, SERVER_INFO_META_KEY as It, isJSONRPCErrorResponse as J, SdkHttpError as Jt, isInitializedNotification as K, SdkError as Kt, httpStatusForErrorCode as L, SUBSCRIPTION_ID_META_KEY as Lt, validateStandardSchema as M, METHOD_NOT_FOUND as Mt, parseSchema as N, PARSE_ERROR as Nt, inputRequired as O, INVALID_REQUEST as Ot, LADDER_ERROR_HTTP_STATUS as P, PROTOCOL_VERSION_META_KEY as Pt, isJSONRPCResultResponse as Q, modernOnlyStrictRejection as R, SUPPORTED_PROTOCOL_VERSIONS as Rt, specTypeSchemas as S, BAGGAGE_META_KEY as St, linkedRoundAbort as T, DEFAULT_NEGOTIATED_PROTOCOL_VERSION as Tt, assertCompleteRequestResourceTemplate as U, requiredClientCapabilitiesForRequest as Ut, validateMcpParamHeaders as V, missingClientCapabilities as Vt, isCallToolResult as W, checkResourceAllowed as Wt, isJSONRPCRequest as X, OAuthErrorCode as Xt, isJSONRPCNotification as Y, OAuthError as Yt, isJSONRPCResponse as Z, mergeCapabilities as _, normalizeContentlessToolResult as _t, UriTemplate as a, requestMetaOf as at, withRequestStateValue as b, legacyProtocolVersions as bt, ReadBuffer as c, codecForVersion as ct, serializeMessage as d, ResourceNotFoundError as dt, parseJSONRPCMessage as et, getDisplayName as f, UnsupportedProtocolVersionError as ft, Protocol as g, attachCacheHintFallback as gt, DEFAULT_REQUEST_TIMEOUT_MSEC as h, assertValidCacheHint as ht, InMemoryTransport as i, hasEnvelopeClaim as it, standardSchemaToJsonSchema as j, LOG_LEVEL_META_KEY as jt, inputResponse as k, JSONRPC_VERSION as kt, STDIO_DEFAULT_MAX_BUFFER_SIZE as l, MissingRequiredClientCapabilityError as lt, mediaTypeEssence as m, ProtocolErrorCode as mt, preloadSchemas as n, LoggingLevelSchema as nt, createFetchWithInit as o, validateEnvelopeMeta as ot, isJsonContentType as p, UrlElicitationRequiredError as pt, isInputRequiredResult as q, SdkErrorCode as qt, normalizeRawShapeSchema as r, envelopeClaimVersion as rt, validateAndWarnToolName as s, MODERN_WIRE_REVISION as st, fromJsonSchema as t, JSONRPCMessageSchema as tt, deserializeMessage as u, ProtocolError as ut, requestStateAccessor as v, SUPPORTED_MODERN_PROTOCOL_VERSIONS as vt, inputRequiredRoundsExceededMessage as w, CLIENT_INFO_META_KEY as wt, isSpecType as x, modernProtocolVersions as xt, setNegotiatedProtocolVersion as y, isModernProtocolVersion as yt, validateStandardRequestHeaders as z, TRACEPARENT_META_KEY as zt };
7606
- //# sourceMappingURL=src-CX2iR2pK.mjs.map
7684
+ //# sourceMappingURL=src-D-y6h4N7.mjs.map