ostacky 0.5.9 → 0.6.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.
Files changed (911) hide show
  1. package/README.md +20 -19
  2. package/assets/agents/ostacky.md +191 -61
  3. package/assets/commands/install-stack.md +137 -66
  4. package/assets/mcp/openspec/bun.lock +20 -0
  5. package/assets/mcp/openspec/index.js +300 -0
  6. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
  7. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/README.md +40 -0
  8. package/assets/mcp/{ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts → openspec/node_modules/@modelcontextprotocol/core/dist/auth-B2Q9_Vxp.d.cts} +768 -465
  9. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/auth-B2Q9_Vxp.d.cts.map +1 -0
  10. package/assets/mcp/{ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs → openspec/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs} +31 -6
  11. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +1 -0
  12. package/assets/mcp/{ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts → openspec/node_modules/@modelcontextprotocol/core/dist/auth-CVhIKulL.d.mts} +768 -465
  13. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/auth-CVhIKulL.d.mts.map +1 -0
  14. package/assets/mcp/{ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs → openspec/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs} +42 -5
  15. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +1 -0
  16. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/index.cjs +175 -0
  17. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -0
  18. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -0
  19. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
  20. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/internal.cjs +201 -0
  21. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +99 -0
  22. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
  23. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +99 -0
  24. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
  25. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
  26. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/core/package.json +85 -0
  27. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/LICENSE +216 -0
  28. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/README.md +30 -0
  29. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/ajvProvider-B_4czhCS.d.cts +1054 -0
  30. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/ajvProvider-B_4czhCS.d.cts.map +1 -0
  31. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/ajvProvider-BdSo9BII.d.mts +1054 -0
  32. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/ajvProvider-BdSo9BII.d.mts.map +1 -0
  33. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/ajvProvider-Brn-Q2J_.cjs +7086 -0
  34. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/ajvProvider-Brn-Q2J_.cjs.map +1 -0
  35. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CplOkyLC.mjs +7069 -0
  36. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CplOkyLC.mjs.map +1 -0
  37. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BYRW5af5.d.mts +59 -0
  38. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BYRW5af5.d.mts.map +1 -0
  39. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-Bd-iTHAF.mjs +970 -0
  40. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-Bd-iTHAF.mjs.map +1 -0
  41. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-D9GAttn8.d.cts +59 -0
  42. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-D9GAttn8.d.cts.map +1 -0
  43. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-ojcZaap3.cjs +976 -0
  44. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-ojcZaap3.cjs.map +1 -0
  45. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +60 -0
  46. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +42 -0
  47. package/assets/mcp/{ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D93NefGZ.d.mts → openspec/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CEckaSEs.d.mts} +41 -13
  48. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CEckaSEs.d.mts.map +1 -0
  49. package/assets/mcp/{ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-BRM5MGf9.d.cts → openspec/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-DzBzpE4_.d.cts} +41 -13
  50. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-DzBzpE4_.d.cts.map +1 -0
  51. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/index.cjs +1999 -0
  52. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -0
  53. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/index.d.cts +732 -0
  54. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -0
  55. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/index.d.mts +732 -0
  56. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -0
  57. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/index.mjs +1814 -0
  58. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -0
  59. package/assets/mcp/{ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-CzU40gwu.cjs → openspec/node_modules/@modelcontextprotocol/server/dist/mcp-DM1iHYFo.cjs} +55 -14
  60. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/mcp-DM1iHYFo.cjs.map +1 -0
  61. package/assets/mcp/{ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-Ctiu4nBa.mjs → openspec/node_modules/@modelcontextprotocol/server/dist/mcp-IJurDZVN.mjs} +50 -15
  62. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/mcp-IJurDZVN.mjs.map +1 -0
  63. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +23 -0
  64. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +1 -0
  65. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +11 -0
  66. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +1 -0
  67. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +11 -0
  68. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +1 -0
  69. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +22 -0
  70. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +1 -0
  71. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +12 -0
  72. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +3 -0
  73. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +3 -0
  74. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +4 -0
  75. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +30 -0
  76. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +1 -0
  77. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +10 -0
  78. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +1 -0
  79. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +10 -0
  80. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +1 -0
  81. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +29 -0
  82. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +1 -0
  83. package/assets/mcp/{ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D9A7ArDn.cjs → openspec/node_modules/@modelcontextprotocol/server/dist/src-BX_fm-dB.cjs} +91 -22
  84. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/src-BX_fm-dB.cjs.map +1 -0
  85. package/assets/mcp/{ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D5Nfqtoz.mjs → openspec/node_modules/@modelcontextprotocol/server/dist/src-D86MbS1I.mjs} +93 -24
  86. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/src-D86MbS1I.mjs.map +1 -0
  87. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +564 -0
  88. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -0
  89. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +107 -0
  90. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -0
  91. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +107 -0
  92. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -0
  93. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +562 -0
  94. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -0
  95. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +1099 -0
  96. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +1 -0
  97. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/types-mS0yxCL0.d.mts +1099 -0
  98. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/types-mS0yxCL0.d.mts.map +1 -0
  99. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +5 -0
  100. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +2 -0
  101. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +2 -0
  102. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +3 -0
  103. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +3 -0
  104. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +2 -0
  105. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +2 -0
  106. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +3 -0
  107. package/assets/mcp/openspec/node_modules/@modelcontextprotocol/server/package.json +160 -0
  108. package/assets/mcp/openspec/node_modules/zod/LICENSE +21 -0
  109. package/assets/mcp/openspec/node_modules/zod/README.md +191 -0
  110. package/assets/mcp/openspec/node_modules/zod/index.cjs +33 -0
  111. package/assets/mcp/openspec/node_modules/zod/index.d.cts +4 -0
  112. package/assets/mcp/openspec/node_modules/zod/index.d.ts +4 -0
  113. package/assets/mcp/openspec/node_modules/zod/index.js +4 -0
  114. package/assets/mcp/openspec/node_modules/zod/locales/index.cjs +17 -0
  115. package/assets/mcp/openspec/node_modules/zod/locales/index.d.cts +1 -0
  116. package/assets/mcp/openspec/node_modules/zod/locales/index.d.ts +1 -0
  117. package/assets/mcp/openspec/node_modules/zod/locales/index.js +1 -0
  118. package/assets/mcp/openspec/node_modules/zod/locales/package.json +7 -0
  119. package/assets/mcp/openspec/node_modules/zod/mini/index.cjs +32 -0
  120. package/assets/mcp/openspec/node_modules/zod/mini/index.d.cts +3 -0
  121. package/assets/mcp/openspec/node_modules/zod/mini/index.d.ts +3 -0
  122. package/assets/mcp/openspec/node_modules/zod/mini/index.js +3 -0
  123. package/assets/mcp/openspec/node_modules/zod/mini/package.json +7 -0
  124. package/assets/mcp/openspec/node_modules/zod/package.json +135 -0
  125. package/assets/mcp/openspec/node_modules/zod/src/index.ts +4 -0
  126. package/assets/mcp/openspec/node_modules/zod/src/locales/index.ts +1 -0
  127. package/assets/mcp/openspec/node_modules/zod/src/mini/index.ts +3 -0
  128. package/assets/mcp/openspec/node_modules/zod/src/v3/ZodError.ts +330 -0
  129. package/assets/mcp/openspec/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  130. package/assets/mcp/openspec/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  131. package/assets/mcp/openspec/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  132. package/assets/mcp/openspec/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  133. package/assets/mcp/openspec/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  134. package/assets/mcp/openspec/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  135. package/assets/mcp/openspec/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  136. package/assets/mcp/openspec/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  137. package/assets/mcp/openspec/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  138. package/assets/mcp/openspec/node_modules/zod/src/v3/errors.ts +13 -0
  139. package/assets/mcp/openspec/node_modules/zod/src/v3/external.ts +6 -0
  140. package/assets/mcp/openspec/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  141. package/assets/mcp/openspec/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  142. package/assets/mcp/openspec/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  143. package/assets/mcp/openspec/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  144. package/assets/mcp/openspec/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  145. package/assets/mcp/openspec/node_modules/zod/src/v3/helpers/util.ts +224 -0
  146. package/assets/mcp/openspec/node_modules/zod/src/v3/index.ts +4 -0
  147. package/assets/mcp/openspec/node_modules/zod/src/v3/locales/en.ts +124 -0
  148. package/assets/mcp/openspec/node_modules/zod/src/v3/standard-schema.ts +113 -0
  149. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  150. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  151. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  152. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  153. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  154. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  155. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  156. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  157. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  158. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  159. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  160. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
  161. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  162. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  163. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  164. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  165. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  166. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  167. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  168. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/error.test.ts +551 -0
  169. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  170. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  171. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/function.test.ts +261 -0
  172. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  173. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  174. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
  175. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  176. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
  177. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  178. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  179. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  180. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  181. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
  182. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  183. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  184. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  185. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  186. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  187. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/object.test.ts +434 -0
  188. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  189. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  190. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  191. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  192. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  193. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  194. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  195. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  196. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  197. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
  198. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  199. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  200. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  201. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  202. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  203. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  204. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/string.test.ts +916 -0
  205. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  206. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  207. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  208. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  209. package/assets/mcp/openspec/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  210. package/assets/mcp/openspec/node_modules/zod/src/v3/types.ts +5138 -0
  211. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/checks.ts +32 -0
  212. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  213. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/compat.ts +70 -0
  214. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/errors.ts +82 -0
  215. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/external.ts +52 -0
  216. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -0
  217. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/index.ts +5 -0
  218. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/iso.ts +90 -0
  219. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/parse.ts +82 -0
  220. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/schemas.ts +2672 -0
  221. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  222. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -0
  223. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
  224. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/assignability.test.ts +216 -0
  225. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  226. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  227. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  228. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
  229. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
  230. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/catch.test.ts +326 -0
  231. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  232. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
  233. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -0
  234. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  235. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
  236. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  237. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
  238. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
  239. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -0
  240. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
  241. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  242. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
  243. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -0
  244. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
  245. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +807 -0
  246. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
  247. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
  248. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
  249. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
  250. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +895 -0
  251. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
  252. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  253. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
  254. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
  255. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
  256. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
  257. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
  258. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
  259. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
  260. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
  261. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
  262. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
  263. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
  264. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -0
  265. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  266. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  267. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
  268. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  269. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/number.test.ts +325 -0
  270. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
  271. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
  272. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -0
  273. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
  274. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
  275. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
  276. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -0
  277. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
  278. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  279. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  280. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  281. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
  282. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/record.test.ts +717 -0
  283. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
  284. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -0
  285. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
  286. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
  287. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
  288. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
  289. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/string.test.ts +1224 -0
  290. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
  291. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
  292. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
  293. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3125 -0
  294. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
  295. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/tuple.test.ts +496 -0
  296. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
  297. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
  298. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  299. package/assets/mcp/openspec/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  300. package/assets/mcp/openspec/node_modules/zod/src/v4/core/api.ts +1823 -0
  301. package/assets/mcp/openspec/node_modules/zod/src/v4/core/checks.ts +1293 -0
  302. package/assets/mcp/openspec/node_modules/zod/src/v4/core/config.ts +15 -0
  303. package/assets/mcp/openspec/node_modules/zod/src/v4/core/core.ts +153 -0
  304. package/assets/mcp/openspec/node_modules/zod/src/v4/core/doc.ts +44 -0
  305. package/assets/mcp/openspec/node_modules/zod/src/v4/core/errors.ts +455 -0
  306. package/assets/mcp/openspec/node_modules/zod/src/v4/core/index.ts +16 -0
  307. package/assets/mcp/openspec/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
  308. package/assets/mcp/openspec/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
  309. package/assets/mcp/openspec/node_modules/zod/src/v4/core/json-schema.ts +147 -0
  310. package/assets/mcp/openspec/node_modules/zod/src/v4/core/parse.ts +195 -0
  311. package/assets/mcp/openspec/node_modules/zod/src/v4/core/regexes.ts +190 -0
  312. package/assets/mcp/openspec/node_modules/zod/src/v4/core/registries.ts +105 -0
  313. package/assets/mcp/openspec/node_modules/zod/src/v4/core/schemas.ts +4730 -0
  314. package/assets/mcp/openspec/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
  315. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
  316. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  317. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  318. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/locales/el.test.ts +215 -0
  319. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  320. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
  321. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
  322. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
  323. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
  324. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
  325. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  326. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  327. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
  328. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
  329. package/assets/mcp/openspec/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
  330. package/assets/mcp/openspec/node_modules/zod/src/v4/core/to-json-schema.ts +622 -0
  331. package/assets/mcp/openspec/node_modules/zod/src/v4/core/util.ts +983 -0
  332. package/assets/mcp/openspec/node_modules/zod/src/v4/core/versions.ts +5 -0
  333. package/assets/mcp/openspec/node_modules/zod/src/v4/core/zsf.ts +323 -0
  334. package/assets/mcp/openspec/node_modules/zod/src/v4/index.ts +4 -0
  335. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ar.ts +115 -0
  336. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/az.ts +111 -0
  337. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/be.ts +176 -0
  338. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/bg.ts +128 -0
  339. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ca.ts +116 -0
  340. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/cs.ts +118 -0
  341. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/da.ts +123 -0
  342. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/de.ts +116 -0
  343. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/el.ts +121 -0
  344. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/en.ts +123 -0
  345. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/eo.ts +118 -0
  346. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/es.ts +141 -0
  347. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/fa.ts +126 -0
  348. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/fi.ts +121 -0
  349. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
  350. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/fr.ts +132 -0
  351. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/he.ts +246 -0
  352. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/hr.ts +131 -0
  353. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/hu.ts +117 -0
  354. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/hy.ts +164 -0
  355. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/id.ts +115 -0
  356. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/index.ts +52 -0
  357. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/is.ts +119 -0
  358. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/it.ts +116 -0
  359. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ja.ts +114 -0
  360. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ka.ts +123 -0
  361. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/kh.ts +7 -0
  362. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/km.ts +119 -0
  363. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ko.ts +121 -0
  364. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/lt.ts +239 -0
  365. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/mk.ts +118 -0
  366. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ms.ts +115 -0
  367. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/nl.ts +121 -0
  368. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/no.ts +116 -0
  369. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ota.ts +117 -0
  370. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/pl.ts +118 -0
  371. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ps.ts +126 -0
  372. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/pt.ts +116 -0
  373. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ro.ts +129 -0
  374. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ru.ts +176 -0
  375. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/sl.ts +118 -0
  376. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/sv.ts +119 -0
  377. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ta.ts +118 -0
  378. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/th.ts +119 -0
  379. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/tr.ts +111 -0
  380. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ua.ts +7 -0
  381. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/uk.ts +117 -0
  382. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/ur.ts +119 -0
  383. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/uz.ts +117 -0
  384. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/vi.ts +117 -0
  385. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/yo.ts +124 -0
  386. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
  387. package/assets/mcp/openspec/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
  388. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/checks.ts +32 -0
  389. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/coerce.ts +27 -0
  390. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/external.ts +41 -0
  391. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/index.ts +3 -0
  392. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/iso.ts +66 -0
  393. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/parse.ts +14 -0
  394. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
  395. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
  396. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
  397. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
  398. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
  399. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -0
  400. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
  401. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
  402. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
  403. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -0
  404. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
  405. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -0
  406. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  407. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
  408. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
  409. package/assets/mcp/openspec/node_modules/zod/src/v4/mini/tests/string.test.ts +352 -0
  410. package/assets/mcp/openspec/node_modules/zod/src/v4-mini/index.ts +3 -0
  411. package/assets/mcp/openspec/node_modules/zod/v3/ZodError.cjs +138 -0
  412. package/assets/mcp/openspec/node_modules/zod/v3/ZodError.d.cts +164 -0
  413. package/assets/mcp/openspec/node_modules/zod/v3/ZodError.d.ts +164 -0
  414. package/assets/mcp/openspec/node_modules/zod/v3/ZodError.js +133 -0
  415. package/assets/mcp/openspec/node_modules/zod/v3/errors.cjs +17 -0
  416. package/assets/mcp/openspec/node_modules/zod/v3/errors.d.cts +5 -0
  417. package/assets/mcp/openspec/node_modules/zod/v3/errors.d.ts +5 -0
  418. package/assets/mcp/openspec/node_modules/zod/v3/errors.js +9 -0
  419. package/assets/mcp/openspec/node_modules/zod/v3/external.cjs +22 -0
  420. package/assets/mcp/openspec/node_modules/zod/v3/external.d.cts +6 -0
  421. package/assets/mcp/openspec/node_modules/zod/v3/external.d.ts +6 -0
  422. package/assets/mcp/openspec/node_modules/zod/v3/external.js +6 -0
  423. package/assets/mcp/openspec/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
  424. package/assets/mcp/openspec/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  425. package/assets/mcp/openspec/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  426. package/assets/mcp/openspec/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  427. package/assets/mcp/openspec/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
  428. package/assets/mcp/openspec/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  429. package/assets/mcp/openspec/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  430. package/assets/mcp/openspec/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  431. package/assets/mcp/openspec/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
  432. package/assets/mcp/openspec/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  433. package/assets/mcp/openspec/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  434. package/assets/mcp/openspec/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  435. package/assets/mcp/openspec/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
  436. package/assets/mcp/openspec/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  437. package/assets/mcp/openspec/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  438. package/assets/mcp/openspec/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  439. package/assets/mcp/openspec/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
  440. package/assets/mcp/openspec/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  441. package/assets/mcp/openspec/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  442. package/assets/mcp/openspec/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  443. package/assets/mcp/openspec/node_modules/zod/v3/helpers/util.cjs +137 -0
  444. package/assets/mcp/openspec/node_modules/zod/v3/helpers/util.d.cts +85 -0
  445. package/assets/mcp/openspec/node_modules/zod/v3/helpers/util.d.ts +85 -0
  446. package/assets/mcp/openspec/node_modules/zod/v3/helpers/util.js +133 -0
  447. package/assets/mcp/openspec/node_modules/zod/v3/index.cjs +33 -0
  448. package/assets/mcp/openspec/node_modules/zod/v3/index.d.cts +4 -0
  449. package/assets/mcp/openspec/node_modules/zod/v3/index.d.ts +4 -0
  450. package/assets/mcp/openspec/node_modules/zod/v3/index.js +4 -0
  451. package/assets/mcp/openspec/node_modules/zod/v3/locales/en.cjs +112 -0
  452. package/assets/mcp/openspec/node_modules/zod/v3/locales/en.d.cts +3 -0
  453. package/assets/mcp/openspec/node_modules/zod/v3/locales/en.d.ts +3 -0
  454. package/assets/mcp/openspec/node_modules/zod/v3/locales/en.js +109 -0
  455. package/assets/mcp/openspec/node_modules/zod/v3/package.json +7 -0
  456. package/assets/mcp/openspec/node_modules/zod/v3/standard-schema.cjs +2 -0
  457. package/assets/mcp/openspec/node_modules/zod/v3/standard-schema.d.cts +102 -0
  458. package/assets/mcp/openspec/node_modules/zod/v3/standard-schema.d.ts +102 -0
  459. package/assets/mcp/openspec/node_modules/zod/v3/standard-schema.js +1 -0
  460. package/assets/mcp/openspec/node_modules/zod/v3/types.cjs +3777 -0
  461. package/assets/mcp/openspec/node_modules/zod/v3/types.d.cts +1034 -0
  462. package/assets/mcp/openspec/node_modules/zod/v3/types.d.ts +1034 -0
  463. package/assets/mcp/openspec/node_modules/zod/v3/types.js +3695 -0
  464. package/assets/mcp/openspec/node_modules/zod/v4/classic/checks.cjs +33 -0
  465. package/assets/mcp/openspec/node_modules/zod/v4/classic/checks.d.cts +1 -0
  466. package/assets/mcp/openspec/node_modules/zod/v4/classic/checks.d.ts +1 -0
  467. package/assets/mcp/openspec/node_modules/zod/v4/classic/checks.js +1 -0
  468. package/assets/mcp/openspec/node_modules/zod/v4/classic/coerce.cjs +47 -0
  469. package/assets/mcp/openspec/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  470. package/assets/mcp/openspec/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  471. package/assets/mcp/openspec/node_modules/zod/v4/classic/coerce.js +17 -0
  472. package/assets/mcp/openspec/node_modules/zod/v4/classic/compat.cjs +61 -0
  473. package/assets/mcp/openspec/node_modules/zod/v4/classic/compat.d.cts +50 -0
  474. package/assets/mcp/openspec/node_modules/zod/v4/classic/compat.d.ts +50 -0
  475. package/assets/mcp/openspec/node_modules/zod/v4/classic/compat.js +31 -0
  476. package/assets/mcp/openspec/node_modules/zod/v4/classic/errors.cjs +74 -0
  477. package/assets/mcp/openspec/node_modules/zod/v4/classic/errors.d.cts +30 -0
  478. package/assets/mcp/openspec/node_modules/zod/v4/classic/errors.d.ts +30 -0
  479. package/assets/mcp/openspec/node_modules/zod/v4/classic/errors.js +48 -0
  480. package/assets/mcp/openspec/node_modules/zod/v4/classic/external.cjs +73 -0
  481. package/assets/mcp/openspec/node_modules/zod/v4/classic/external.d.cts +16 -0
  482. package/assets/mcp/openspec/node_modules/zod/v4/classic/external.d.ts +16 -0
  483. package/assets/mcp/openspec/node_modules/zod/v4/classic/external.js +20 -0
  484. package/assets/mcp/openspec/node_modules/zod/v4/classic/from-json-schema.cjs +625 -0
  485. package/assets/mcp/openspec/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
  486. package/assets/mcp/openspec/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
  487. package/assets/mcp/openspec/node_modules/zod/v4/classic/from-json-schema.js +599 -0
  488. package/assets/mcp/openspec/node_modules/zod/v4/classic/index.cjs +33 -0
  489. package/assets/mcp/openspec/node_modules/zod/v4/classic/index.d.cts +4 -0
  490. package/assets/mcp/openspec/node_modules/zod/v4/classic/index.d.ts +4 -0
  491. package/assets/mcp/openspec/node_modules/zod/v4/classic/index.js +4 -0
  492. package/assets/mcp/openspec/node_modules/zod/v4/classic/iso.cjs +60 -0
  493. package/assets/mcp/openspec/node_modules/zod/v4/classic/iso.d.cts +22 -0
  494. package/assets/mcp/openspec/node_modules/zod/v4/classic/iso.d.ts +22 -0
  495. package/assets/mcp/openspec/node_modules/zod/v4/classic/iso.js +30 -0
  496. package/assets/mcp/openspec/node_modules/zod/v4/classic/package.json +7 -0
  497. package/assets/mcp/openspec/node_modules/zod/v4/classic/parse.cjs +41 -0
  498. package/assets/mcp/openspec/node_modules/zod/v4/classic/parse.d.cts +31 -0
  499. package/assets/mcp/openspec/node_modules/zod/v4/classic/parse.d.ts +31 -0
  500. package/assets/mcp/openspec/node_modules/zod/v4/classic/parse.js +15 -0
  501. package/assets/mcp/openspec/node_modules/zod/v4/classic/schemas.cjs +1511 -0
  502. package/assets/mcp/openspec/node_modules/zod/v4/classic/schemas.d.cts +767 -0
  503. package/assets/mcp/openspec/node_modules/zod/v4/classic/schemas.d.ts +767 -0
  504. package/assets/mcp/openspec/node_modules/zod/v4/classic/schemas.js +1395 -0
  505. package/assets/mcp/openspec/node_modules/zod/v4/core/api.cjs +1227 -0
  506. package/assets/mcp/openspec/node_modules/zod/v4/core/api.d.cts +325 -0
  507. package/assets/mcp/openspec/node_modules/zod/v4/core/api.d.ts +325 -0
  508. package/assets/mcp/openspec/node_modules/zod/v4/core/api.js +1087 -0
  509. package/assets/mcp/openspec/node_modules/zod/v4/core/checks.cjs +601 -0
  510. package/assets/mcp/openspec/node_modules/zod/v4/core/checks.d.cts +278 -0
  511. package/assets/mcp/openspec/node_modules/zod/v4/core/checks.d.ts +278 -0
  512. package/assets/mcp/openspec/node_modules/zod/v4/core/checks.js +575 -0
  513. package/assets/mcp/openspec/node_modules/zod/v4/core/core.cjs +85 -0
  514. package/assets/mcp/openspec/node_modules/zod/v4/core/core.d.cts +70 -0
  515. package/assets/mcp/openspec/node_modules/zod/v4/core/core.d.ts +70 -0
  516. package/assets/mcp/openspec/node_modules/zod/v4/core/core.js +78 -0
  517. package/assets/mcp/openspec/node_modules/zod/v4/core/doc.cjs +39 -0
  518. package/assets/mcp/openspec/node_modules/zod/v4/core/doc.d.cts +14 -0
  519. package/assets/mcp/openspec/node_modules/zod/v4/core/doc.d.ts +14 -0
  520. package/assets/mcp/openspec/node_modules/zod/v4/core/doc.js +35 -0
  521. package/assets/mcp/openspec/node_modules/zod/v4/core/errors.cjs +216 -0
  522. package/assets/mcp/openspec/node_modules/zod/v4/core/errors.d.cts +221 -0
  523. package/assets/mcp/openspec/node_modules/zod/v4/core/errors.d.ts +221 -0
  524. package/assets/mcp/openspec/node_modules/zod/v4/core/errors.js +185 -0
  525. package/assets/mcp/openspec/node_modules/zod/v4/core/index.cjs +47 -0
  526. package/assets/mcp/openspec/node_modules/zod/v4/core/index.d.cts +16 -0
  527. package/assets/mcp/openspec/node_modules/zod/v4/core/index.d.ts +16 -0
  528. package/assets/mcp/openspec/node_modules/zod/v4/core/index.js +16 -0
  529. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
  530. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
  531. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
  532. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema-generator.js +95 -0
  533. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
  534. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
  535. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
  536. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema-processors.js +601 -0
  537. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema.cjs +2 -0
  538. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema.d.cts +88 -0
  539. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema.d.ts +88 -0
  540. package/assets/mcp/openspec/node_modules/zod/v4/core/json-schema.js +1 -0
  541. package/assets/mcp/openspec/node_modules/zod/v4/core/package.json +7 -0
  542. package/assets/mcp/openspec/node_modules/zod/v4/core/parse.cjs +131 -0
  543. package/assets/mcp/openspec/node_modules/zod/v4/core/parse.d.cts +49 -0
  544. package/assets/mcp/openspec/node_modules/zod/v4/core/parse.d.ts +49 -0
  545. package/assets/mcp/openspec/node_modules/zod/v4/core/parse.js +93 -0
  546. package/assets/mcp/openspec/node_modules/zod/v4/core/regexes.cjs +172 -0
  547. package/assets/mcp/openspec/node_modules/zod/v4/core/regexes.d.cts +85 -0
  548. package/assets/mcp/openspec/node_modules/zod/v4/core/regexes.d.ts +85 -0
  549. package/assets/mcp/openspec/node_modules/zod/v4/core/regexes.js +139 -0
  550. package/assets/mcp/openspec/node_modules/zod/v4/core/registries.cjs +56 -0
  551. package/assets/mcp/openspec/node_modules/zod/v4/core/registries.d.cts +35 -0
  552. package/assets/mcp/openspec/node_modules/zod/v4/core/registries.d.ts +35 -0
  553. package/assets/mcp/openspec/node_modules/zod/v4/core/registries.js +51 -0
  554. package/assets/mcp/openspec/node_modules/zod/v4/core/schemas.cjs +2270 -0
  555. package/assets/mcp/openspec/node_modules/zod/v4/core/schemas.d.cts +1184 -0
  556. package/assets/mcp/openspec/node_modules/zod/v4/core/schemas.d.ts +1184 -0
  557. package/assets/mcp/openspec/node_modules/zod/v4/core/schemas.js +2239 -0
  558. package/assets/mcp/openspec/node_modules/zod/v4/core/standard-schema.cjs +2 -0
  559. package/assets/mcp/openspec/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
  560. package/assets/mcp/openspec/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
  561. package/assets/mcp/openspec/node_modules/zod/v4/core/standard-schema.js +1 -0
  562. package/assets/mcp/openspec/node_modules/zod/v4/core/to-json-schema.cjs +457 -0
  563. package/assets/mcp/openspec/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
  564. package/assets/mcp/openspec/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
  565. package/assets/mcp/openspec/node_modules/zod/v4/core/to-json-schema.js +448 -0
  566. package/assets/mcp/openspec/node_modules/zod/v4/core/util.cjs +734 -0
  567. package/assets/mcp/openspec/node_modules/zod/v4/core/util.d.cts +200 -0
  568. package/assets/mcp/openspec/node_modules/zod/v4/core/util.d.ts +200 -0
  569. package/assets/mcp/openspec/node_modules/zod/v4/core/util.js +674 -0
  570. package/assets/mcp/openspec/node_modules/zod/v4/core/versions.cjs +8 -0
  571. package/assets/mcp/openspec/node_modules/zod/v4/core/versions.d.cts +5 -0
  572. package/assets/mcp/openspec/node_modules/zod/v4/core/versions.d.ts +5 -0
  573. package/assets/mcp/openspec/node_modules/zod/v4/core/versions.js +5 -0
  574. package/assets/mcp/openspec/node_modules/zod/v4/index.cjs +22 -0
  575. package/assets/mcp/openspec/node_modules/zod/v4/index.d.cts +3 -0
  576. package/assets/mcp/openspec/node_modules/zod/v4/index.d.ts +3 -0
  577. package/assets/mcp/openspec/node_modules/zod/v4/index.js +3 -0
  578. package/assets/mcp/openspec/node_modules/zod/v4/locales/ar.cjs +133 -0
  579. package/assets/mcp/openspec/node_modules/zod/v4/locales/ar.d.cts +5 -0
  580. package/assets/mcp/openspec/node_modules/zod/v4/locales/ar.d.ts +4 -0
  581. package/assets/mcp/openspec/node_modules/zod/v4/locales/ar.js +106 -0
  582. package/assets/mcp/openspec/node_modules/zod/v4/locales/az.cjs +132 -0
  583. package/assets/mcp/openspec/node_modules/zod/v4/locales/az.d.cts +5 -0
  584. package/assets/mcp/openspec/node_modules/zod/v4/locales/az.d.ts +4 -0
  585. package/assets/mcp/openspec/node_modules/zod/v4/locales/az.js +105 -0
  586. package/assets/mcp/openspec/node_modules/zod/v4/locales/be.cjs +183 -0
  587. package/assets/mcp/openspec/node_modules/zod/v4/locales/be.d.cts +5 -0
  588. package/assets/mcp/openspec/node_modules/zod/v4/locales/be.d.ts +4 -0
  589. package/assets/mcp/openspec/node_modules/zod/v4/locales/be.js +156 -0
  590. package/assets/mcp/openspec/node_modules/zod/v4/locales/bg.cjs +147 -0
  591. package/assets/mcp/openspec/node_modules/zod/v4/locales/bg.d.cts +5 -0
  592. package/assets/mcp/openspec/node_modules/zod/v4/locales/bg.d.ts +4 -0
  593. package/assets/mcp/openspec/node_modules/zod/v4/locales/bg.js +120 -0
  594. package/assets/mcp/openspec/node_modules/zod/v4/locales/ca.cjs +134 -0
  595. package/assets/mcp/openspec/node_modules/zod/v4/locales/ca.d.cts +5 -0
  596. package/assets/mcp/openspec/node_modules/zod/v4/locales/ca.d.ts +4 -0
  597. package/assets/mcp/openspec/node_modules/zod/v4/locales/ca.js +107 -0
  598. package/assets/mcp/openspec/node_modules/zod/v4/locales/cs.cjs +138 -0
  599. package/assets/mcp/openspec/node_modules/zod/v4/locales/cs.d.cts +5 -0
  600. package/assets/mcp/openspec/node_modules/zod/v4/locales/cs.d.ts +4 -0
  601. package/assets/mcp/openspec/node_modules/zod/v4/locales/cs.js +111 -0
  602. package/assets/mcp/openspec/node_modules/zod/v4/locales/da.cjs +142 -0
  603. package/assets/mcp/openspec/node_modules/zod/v4/locales/da.d.cts +5 -0
  604. package/assets/mcp/openspec/node_modules/zod/v4/locales/da.d.ts +4 -0
  605. package/assets/mcp/openspec/node_modules/zod/v4/locales/da.js +115 -0
  606. package/assets/mcp/openspec/node_modules/zod/v4/locales/de.cjs +135 -0
  607. package/assets/mcp/openspec/node_modules/zod/v4/locales/de.d.cts +5 -0
  608. package/assets/mcp/openspec/node_modules/zod/v4/locales/de.d.ts +4 -0
  609. package/assets/mcp/openspec/node_modules/zod/v4/locales/de.js +108 -0
  610. package/assets/mcp/openspec/node_modules/zod/v4/locales/el.cjs +136 -0
  611. package/assets/mcp/openspec/node_modules/zod/v4/locales/el.d.cts +5 -0
  612. package/assets/mcp/openspec/node_modules/zod/v4/locales/el.d.ts +4 -0
  613. package/assets/mcp/openspec/node_modules/zod/v4/locales/el.js +109 -0
  614. package/assets/mcp/openspec/node_modules/zod/v4/locales/en.cjs +140 -0
  615. package/assets/mcp/openspec/node_modules/zod/v4/locales/en.d.cts +5 -0
  616. package/assets/mcp/openspec/node_modules/zod/v4/locales/en.d.ts +4 -0
  617. package/assets/mcp/openspec/node_modules/zod/v4/locales/en.js +113 -0
  618. package/assets/mcp/openspec/node_modules/zod/v4/locales/eo.cjs +136 -0
  619. package/assets/mcp/openspec/node_modules/zod/v4/locales/eo.d.cts +5 -0
  620. package/assets/mcp/openspec/node_modules/zod/v4/locales/eo.d.ts +4 -0
  621. package/assets/mcp/openspec/node_modules/zod/v4/locales/eo.js +109 -0
  622. package/assets/mcp/openspec/node_modules/zod/v4/locales/es.cjs +159 -0
  623. package/assets/mcp/openspec/node_modules/zod/v4/locales/es.d.cts +5 -0
  624. package/assets/mcp/openspec/node_modules/zod/v4/locales/es.d.ts +4 -0
  625. package/assets/mcp/openspec/node_modules/zod/v4/locales/es.js +132 -0
  626. package/assets/mcp/openspec/node_modules/zod/v4/locales/fa.cjs +141 -0
  627. package/assets/mcp/openspec/node_modules/zod/v4/locales/fa.d.cts +5 -0
  628. package/assets/mcp/openspec/node_modules/zod/v4/locales/fa.d.ts +4 -0
  629. package/assets/mcp/openspec/node_modules/zod/v4/locales/fa.js +114 -0
  630. package/assets/mcp/openspec/node_modules/zod/v4/locales/fi.cjs +139 -0
  631. package/assets/mcp/openspec/node_modules/zod/v4/locales/fi.d.cts +5 -0
  632. package/assets/mcp/openspec/node_modules/zod/v4/locales/fi.d.ts +4 -0
  633. package/assets/mcp/openspec/node_modules/zod/v4/locales/fi.js +112 -0
  634. package/assets/mcp/openspec/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
  635. package/assets/mcp/openspec/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  636. package/assets/mcp/openspec/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  637. package/assets/mcp/openspec/node_modules/zod/v4/locales/fr-CA.js +107 -0
  638. package/assets/mcp/openspec/node_modules/zod/v4/locales/fr.cjs +152 -0
  639. package/assets/mcp/openspec/node_modules/zod/v4/locales/fr.d.cts +5 -0
  640. package/assets/mcp/openspec/node_modules/zod/v4/locales/fr.d.ts +4 -0
  641. package/assets/mcp/openspec/node_modules/zod/v4/locales/fr.js +125 -0
  642. package/assets/mcp/openspec/node_modules/zod/v4/locales/he.cjs +241 -0
  643. package/assets/mcp/openspec/node_modules/zod/v4/locales/he.d.cts +5 -0
  644. package/assets/mcp/openspec/node_modules/zod/v4/locales/he.d.ts +4 -0
  645. package/assets/mcp/openspec/node_modules/zod/v4/locales/he.js +214 -0
  646. package/assets/mcp/openspec/node_modules/zod/v4/locales/hr.cjs +149 -0
  647. package/assets/mcp/openspec/node_modules/zod/v4/locales/hr.d.cts +5 -0
  648. package/assets/mcp/openspec/node_modules/zod/v4/locales/hr.d.ts +4 -0
  649. package/assets/mcp/openspec/node_modules/zod/v4/locales/hr.js +122 -0
  650. package/assets/mcp/openspec/node_modules/zod/v4/locales/hu.cjs +135 -0
  651. package/assets/mcp/openspec/node_modules/zod/v4/locales/hu.d.cts +5 -0
  652. package/assets/mcp/openspec/node_modules/zod/v4/locales/hu.d.ts +4 -0
  653. package/assets/mcp/openspec/node_modules/zod/v4/locales/hu.js +108 -0
  654. package/assets/mcp/openspec/node_modules/zod/v4/locales/hy.cjs +174 -0
  655. package/assets/mcp/openspec/node_modules/zod/v4/locales/hy.d.cts +5 -0
  656. package/assets/mcp/openspec/node_modules/zod/v4/locales/hy.d.ts +4 -0
  657. package/assets/mcp/openspec/node_modules/zod/v4/locales/hy.js +147 -0
  658. package/assets/mcp/openspec/node_modules/zod/v4/locales/id.cjs +133 -0
  659. package/assets/mcp/openspec/node_modules/zod/v4/locales/id.d.cts +5 -0
  660. package/assets/mcp/openspec/node_modules/zod/v4/locales/id.d.ts +4 -0
  661. package/assets/mcp/openspec/node_modules/zod/v4/locales/id.js +106 -0
  662. package/assets/mcp/openspec/node_modules/zod/v4/locales/index.cjs +111 -0
  663. package/assets/mcp/openspec/node_modules/zod/v4/locales/index.d.cts +52 -0
  664. package/assets/mcp/openspec/node_modules/zod/v4/locales/index.d.ts +52 -0
  665. package/assets/mcp/openspec/node_modules/zod/v4/locales/index.js +52 -0
  666. package/assets/mcp/openspec/node_modules/zod/v4/locales/is.cjs +136 -0
  667. package/assets/mcp/openspec/node_modules/zod/v4/locales/is.d.cts +5 -0
  668. package/assets/mcp/openspec/node_modules/zod/v4/locales/is.d.ts +4 -0
  669. package/assets/mcp/openspec/node_modules/zod/v4/locales/is.js +109 -0
  670. package/assets/mcp/openspec/node_modules/zod/v4/locales/it.cjs +135 -0
  671. package/assets/mcp/openspec/node_modules/zod/v4/locales/it.d.cts +5 -0
  672. package/assets/mcp/openspec/node_modules/zod/v4/locales/it.d.ts +4 -0
  673. package/assets/mcp/openspec/node_modules/zod/v4/locales/it.js +108 -0
  674. package/assets/mcp/openspec/node_modules/zod/v4/locales/ja.cjs +134 -0
  675. package/assets/mcp/openspec/node_modules/zod/v4/locales/ja.d.cts +5 -0
  676. package/assets/mcp/openspec/node_modules/zod/v4/locales/ja.d.ts +4 -0
  677. package/assets/mcp/openspec/node_modules/zod/v4/locales/ja.js +107 -0
  678. package/assets/mcp/openspec/node_modules/zod/v4/locales/ka.cjs +139 -0
  679. package/assets/mcp/openspec/node_modules/zod/v4/locales/ka.d.cts +5 -0
  680. package/assets/mcp/openspec/node_modules/zod/v4/locales/ka.d.ts +4 -0
  681. package/assets/mcp/openspec/node_modules/zod/v4/locales/ka.js +112 -0
  682. package/assets/mcp/openspec/node_modules/zod/v4/locales/kh.cjs +12 -0
  683. package/assets/mcp/openspec/node_modules/zod/v4/locales/kh.d.cts +5 -0
  684. package/assets/mcp/openspec/node_modules/zod/v4/locales/kh.d.ts +5 -0
  685. package/assets/mcp/openspec/node_modules/zod/v4/locales/kh.js +5 -0
  686. package/assets/mcp/openspec/node_modules/zod/v4/locales/km.cjs +137 -0
  687. package/assets/mcp/openspec/node_modules/zod/v4/locales/km.d.cts +5 -0
  688. package/assets/mcp/openspec/node_modules/zod/v4/locales/km.d.ts +4 -0
  689. package/assets/mcp/openspec/node_modules/zod/v4/locales/km.js +110 -0
  690. package/assets/mcp/openspec/node_modules/zod/v4/locales/ko.cjs +138 -0
  691. package/assets/mcp/openspec/node_modules/zod/v4/locales/ko.d.cts +5 -0
  692. package/assets/mcp/openspec/node_modules/zod/v4/locales/ko.d.ts +4 -0
  693. package/assets/mcp/openspec/node_modules/zod/v4/locales/ko.js +111 -0
  694. package/assets/mcp/openspec/node_modules/zod/v4/locales/lt.cjs +230 -0
  695. package/assets/mcp/openspec/node_modules/zod/v4/locales/lt.d.cts +5 -0
  696. package/assets/mcp/openspec/node_modules/zod/v4/locales/lt.d.ts +4 -0
  697. package/assets/mcp/openspec/node_modules/zod/v4/locales/lt.js +203 -0
  698. package/assets/mcp/openspec/node_modules/zod/v4/locales/mk.cjs +136 -0
  699. package/assets/mcp/openspec/node_modules/zod/v4/locales/mk.d.cts +5 -0
  700. package/assets/mcp/openspec/node_modules/zod/v4/locales/mk.d.ts +4 -0
  701. package/assets/mcp/openspec/node_modules/zod/v4/locales/mk.js +109 -0
  702. package/assets/mcp/openspec/node_modules/zod/v4/locales/ms.cjs +134 -0
  703. package/assets/mcp/openspec/node_modules/zod/v4/locales/ms.d.cts +5 -0
  704. package/assets/mcp/openspec/node_modules/zod/v4/locales/ms.d.ts +4 -0
  705. package/assets/mcp/openspec/node_modules/zod/v4/locales/ms.js +107 -0
  706. package/assets/mcp/openspec/node_modules/zod/v4/locales/nl.cjs +137 -0
  707. package/assets/mcp/openspec/node_modules/zod/v4/locales/nl.d.cts +5 -0
  708. package/assets/mcp/openspec/node_modules/zod/v4/locales/nl.d.ts +4 -0
  709. package/assets/mcp/openspec/node_modules/zod/v4/locales/nl.js +110 -0
  710. package/assets/mcp/openspec/node_modules/zod/v4/locales/no.cjs +135 -0
  711. package/assets/mcp/openspec/node_modules/zod/v4/locales/no.d.cts +5 -0
  712. package/assets/mcp/openspec/node_modules/zod/v4/locales/no.d.ts +4 -0
  713. package/assets/mcp/openspec/node_modules/zod/v4/locales/no.js +108 -0
  714. package/assets/mcp/openspec/node_modules/zod/v4/locales/ota.cjs +136 -0
  715. package/assets/mcp/openspec/node_modules/zod/v4/locales/ota.d.cts +5 -0
  716. package/assets/mcp/openspec/node_modules/zod/v4/locales/ota.d.ts +4 -0
  717. package/assets/mcp/openspec/node_modules/zod/v4/locales/ota.js +109 -0
  718. package/assets/mcp/openspec/node_modules/zod/v4/locales/package.json +7 -0
  719. package/assets/mcp/openspec/node_modules/zod/v4/locales/pl.cjs +136 -0
  720. package/assets/mcp/openspec/node_modules/zod/v4/locales/pl.d.cts +5 -0
  721. package/assets/mcp/openspec/node_modules/zod/v4/locales/pl.d.ts +4 -0
  722. package/assets/mcp/openspec/node_modules/zod/v4/locales/pl.js +109 -0
  723. package/assets/mcp/openspec/node_modules/zod/v4/locales/ps.cjs +141 -0
  724. package/assets/mcp/openspec/node_modules/zod/v4/locales/ps.d.cts +5 -0
  725. package/assets/mcp/openspec/node_modules/zod/v4/locales/ps.d.ts +4 -0
  726. package/assets/mcp/openspec/node_modules/zod/v4/locales/ps.js +114 -0
  727. package/assets/mcp/openspec/node_modules/zod/v4/locales/pt.cjs +135 -0
  728. package/assets/mcp/openspec/node_modules/zod/v4/locales/pt.d.cts +5 -0
  729. package/assets/mcp/openspec/node_modules/zod/v4/locales/pt.d.ts +4 -0
  730. package/assets/mcp/openspec/node_modules/zod/v4/locales/pt.js +108 -0
  731. package/assets/mcp/openspec/node_modules/zod/v4/locales/ro.cjs +146 -0
  732. package/assets/mcp/openspec/node_modules/zod/v4/locales/ro.d.cts +5 -0
  733. package/assets/mcp/openspec/node_modules/zod/v4/locales/ro.d.ts +4 -0
  734. package/assets/mcp/openspec/node_modules/zod/v4/locales/ro.js +119 -0
  735. package/assets/mcp/openspec/node_modules/zod/v4/locales/ru.cjs +183 -0
  736. package/assets/mcp/openspec/node_modules/zod/v4/locales/ru.d.cts +5 -0
  737. package/assets/mcp/openspec/node_modules/zod/v4/locales/ru.d.ts +4 -0
  738. package/assets/mcp/openspec/node_modules/zod/v4/locales/ru.js +156 -0
  739. package/assets/mcp/openspec/node_modules/zod/v4/locales/sl.cjs +136 -0
  740. package/assets/mcp/openspec/node_modules/zod/v4/locales/sl.d.cts +5 -0
  741. package/assets/mcp/openspec/node_modules/zod/v4/locales/sl.d.ts +4 -0
  742. package/assets/mcp/openspec/node_modules/zod/v4/locales/sl.js +109 -0
  743. package/assets/mcp/openspec/node_modules/zod/v4/locales/sv.cjs +137 -0
  744. package/assets/mcp/openspec/node_modules/zod/v4/locales/sv.d.cts +5 -0
  745. package/assets/mcp/openspec/node_modules/zod/v4/locales/sv.d.ts +4 -0
  746. package/assets/mcp/openspec/node_modules/zod/v4/locales/sv.js +110 -0
  747. package/assets/mcp/openspec/node_modules/zod/v4/locales/ta.cjs +137 -0
  748. package/assets/mcp/openspec/node_modules/zod/v4/locales/ta.d.cts +5 -0
  749. package/assets/mcp/openspec/node_modules/zod/v4/locales/ta.d.ts +4 -0
  750. package/assets/mcp/openspec/node_modules/zod/v4/locales/ta.js +110 -0
  751. package/assets/mcp/openspec/node_modules/zod/v4/locales/th.cjs +137 -0
  752. package/assets/mcp/openspec/node_modules/zod/v4/locales/th.d.cts +5 -0
  753. package/assets/mcp/openspec/node_modules/zod/v4/locales/th.d.ts +4 -0
  754. package/assets/mcp/openspec/node_modules/zod/v4/locales/th.js +110 -0
  755. package/assets/mcp/openspec/node_modules/zod/v4/locales/tr.cjs +132 -0
  756. package/assets/mcp/openspec/node_modules/zod/v4/locales/tr.d.cts +5 -0
  757. package/assets/mcp/openspec/node_modules/zod/v4/locales/tr.d.ts +4 -0
  758. package/assets/mcp/openspec/node_modules/zod/v4/locales/tr.js +105 -0
  759. package/assets/mcp/openspec/node_modules/zod/v4/locales/ua.cjs +12 -0
  760. package/assets/mcp/openspec/node_modules/zod/v4/locales/ua.d.cts +5 -0
  761. package/assets/mcp/openspec/node_modules/zod/v4/locales/ua.d.ts +5 -0
  762. package/assets/mcp/openspec/node_modules/zod/v4/locales/ua.js +5 -0
  763. package/assets/mcp/openspec/node_modules/zod/v4/locales/uk.cjs +135 -0
  764. package/assets/mcp/openspec/node_modules/zod/v4/locales/uk.d.cts +5 -0
  765. package/assets/mcp/openspec/node_modules/zod/v4/locales/uk.d.ts +4 -0
  766. package/assets/mcp/openspec/node_modules/zod/v4/locales/uk.js +108 -0
  767. package/assets/mcp/openspec/node_modules/zod/v4/locales/ur.cjs +137 -0
  768. package/assets/mcp/openspec/node_modules/zod/v4/locales/ur.d.cts +5 -0
  769. package/assets/mcp/openspec/node_modules/zod/v4/locales/ur.d.ts +4 -0
  770. package/assets/mcp/openspec/node_modules/zod/v4/locales/ur.js +110 -0
  771. package/assets/mcp/openspec/node_modules/zod/v4/locales/uz.cjs +137 -0
  772. package/assets/mcp/openspec/node_modules/zod/v4/locales/uz.d.cts +5 -0
  773. package/assets/mcp/openspec/node_modules/zod/v4/locales/uz.d.ts +4 -0
  774. package/assets/mcp/openspec/node_modules/zod/v4/locales/uz.js +110 -0
  775. package/assets/mcp/openspec/node_modules/zod/v4/locales/vi.cjs +135 -0
  776. package/assets/mcp/openspec/node_modules/zod/v4/locales/vi.d.cts +5 -0
  777. package/assets/mcp/openspec/node_modules/zod/v4/locales/vi.d.ts +4 -0
  778. package/assets/mcp/openspec/node_modules/zod/v4/locales/vi.js +108 -0
  779. package/assets/mcp/openspec/node_modules/zod/v4/locales/yo.cjs +134 -0
  780. package/assets/mcp/openspec/node_modules/zod/v4/locales/yo.d.cts +5 -0
  781. package/assets/mcp/openspec/node_modules/zod/v4/locales/yo.d.ts +4 -0
  782. package/assets/mcp/openspec/node_modules/zod/v4/locales/yo.js +107 -0
  783. package/assets/mcp/openspec/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
  784. package/assets/mcp/openspec/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  785. package/assets/mcp/openspec/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  786. package/assets/mcp/openspec/node_modules/zod/v4/locales/zh-CN.js +109 -0
  787. package/assets/mcp/openspec/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
  788. package/assets/mcp/openspec/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  789. package/assets/mcp/openspec/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  790. package/assets/mcp/openspec/node_modules/zod/v4/locales/zh-TW.js +107 -0
  791. package/assets/mcp/openspec/node_modules/zod/v4/mini/checks.cjs +34 -0
  792. package/assets/mcp/openspec/node_modules/zod/v4/mini/checks.d.cts +1 -0
  793. package/assets/mcp/openspec/node_modules/zod/v4/mini/checks.d.ts +1 -0
  794. package/assets/mcp/openspec/node_modules/zod/v4/mini/checks.js +1 -0
  795. package/assets/mcp/openspec/node_modules/zod/v4/mini/coerce.cjs +52 -0
  796. package/assets/mcp/openspec/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  797. package/assets/mcp/openspec/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  798. package/assets/mcp/openspec/node_modules/zod/v4/mini/coerce.js +22 -0
  799. package/assets/mcp/openspec/node_modules/zod/v4/mini/external.cjs +63 -0
  800. package/assets/mcp/openspec/node_modules/zod/v4/mini/external.d.cts +13 -0
  801. package/assets/mcp/openspec/node_modules/zod/v4/mini/external.d.ts +13 -0
  802. package/assets/mcp/openspec/node_modules/zod/v4/mini/external.js +14 -0
  803. package/assets/mcp/openspec/node_modules/zod/v4/mini/index.cjs +32 -0
  804. package/assets/mcp/openspec/node_modules/zod/v4/mini/index.d.cts +3 -0
  805. package/assets/mcp/openspec/node_modules/zod/v4/mini/index.d.ts +3 -0
  806. package/assets/mcp/openspec/node_modules/zod/v4/mini/index.js +3 -0
  807. package/assets/mcp/openspec/node_modules/zod/v4/mini/iso.cjs +64 -0
  808. package/assets/mcp/openspec/node_modules/zod/v4/mini/iso.d.cts +22 -0
  809. package/assets/mcp/openspec/node_modules/zod/v4/mini/iso.d.ts +22 -0
  810. package/assets/mcp/openspec/node_modules/zod/v4/mini/iso.js +34 -0
  811. package/assets/mcp/openspec/node_modules/zod/v4/mini/package.json +7 -0
  812. package/assets/mcp/openspec/node_modules/zod/v4/mini/parse.cjs +16 -0
  813. package/assets/mcp/openspec/node_modules/zod/v4/mini/parse.d.cts +1 -0
  814. package/assets/mcp/openspec/node_modules/zod/v4/mini/parse.d.ts +1 -0
  815. package/assets/mcp/openspec/node_modules/zod/v4/mini/parse.js +1 -0
  816. package/assets/mcp/openspec/node_modules/zod/v4/mini/schemas.cjs +1083 -0
  817. package/assets/mcp/openspec/node_modules/zod/v4/mini/schemas.d.cts +445 -0
  818. package/assets/mcp/openspec/node_modules/zod/v4/mini/schemas.d.ts +445 -0
  819. package/assets/mcp/openspec/node_modules/zod/v4/mini/schemas.js +961 -0
  820. package/assets/mcp/openspec/node_modules/zod/v4/package.json +7 -0
  821. package/assets/mcp/openspec/node_modules/zod/v4-mini/index.cjs +32 -0
  822. package/assets/mcp/openspec/node_modules/zod/v4-mini/index.d.cts +3 -0
  823. package/assets/mcp/openspec/node_modules/zod/v4-mini/index.d.ts +3 -0
  824. package/assets/mcp/openspec/node_modules/zod/v4-mini/index.js +3 -0
  825. package/assets/mcp/openspec/node_modules/zod/v4-mini/package.json +7 -0
  826. package/assets/mcp/openspec/package.json +10 -0
  827. package/assets/mcp/ostacky-controller/index.js +455 -164
  828. package/assets/mcp/ostacky-controller/node_modules/.package-lock.json +8 -8
  829. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-B2Q9_Vxp.d.cts +8501 -0
  830. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-B2Q9_Vxp.d.cts.map +1 -0
  831. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs +1678 -0
  832. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +1 -0
  833. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CVhIKulL.d.mts +8501 -0
  834. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CVhIKulL.d.mts.map +1 -0
  835. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs +2899 -0
  836. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +1 -0
  837. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.cjs +2 -1
  838. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -2
  839. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -2
  840. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.mjs +2 -2
  841. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.cjs +3 -1
  842. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +14 -2
  843. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -1
  844. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +14 -2
  845. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -1
  846. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.mjs +2 -2
  847. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/package.json +1 -1
  848. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CEckaSEs.d.mts +4041 -0
  849. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CEckaSEs.d.mts.map +1 -0
  850. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-DzBzpE4_.d.cts +4043 -0
  851. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-DzBzpE4_.d.cts.map +1 -0
  852. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.cjs +12 -3
  853. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -1
  854. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.d.cts +2 -2
  855. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.d.mts +2 -2
  856. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.mjs +5 -4
  857. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -1
  858. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-DM1iHYFo.cjs +2004 -0
  859. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-DM1iHYFo.cjs.map +1 -0
  860. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-IJurDZVN.mjs +1919 -0
  861. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-IJurDZVN.mjs.map +1 -0
  862. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +1 -1
  863. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +1 -1
  864. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-BX_fm-dB.cjs +8069 -0
  865. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-BX_fm-dB.cjs.map +1 -0
  866. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D86MbS1I.mjs +7571 -0
  867. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D86MbS1I.mjs.map +1 -0
  868. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +3 -3
  869. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -1
  870. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +1 -1
  871. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +1 -1
  872. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +3 -3
  873. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -1
  874. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/package.json +3 -3
  875. package/assets/mcp/ostacky-controller/package-lock.json +10 -10
  876. package/assets/mcp/ostacky-controller/package.json +2 -2
  877. package/assets/plugins/engram.ts +537 -0
  878. package/assets/skills/{thinking → brainstorming}/SKILL.md +8 -6
  879. package/assets/skills/dispatching-parallel-agents/SKILL.md +7 -7
  880. package/assets/skills/execution-mode-evaluation/SKILL.md +10 -8
  881. package/assets/skills/graceful-degradation/SKILL.md +235 -0
  882. package/assets/skills/openspec-apply-change/SKILL.md +4 -2
  883. package/assets/skills/openspec-archive-change/SKILL.md +4 -4
  884. package/assets/skills/openspec-explore/SKILL.md +288 -0
  885. package/assets/skills/openspec-propose/SKILL.md +7 -5
  886. package/assets/skills/subagent-driven-development/SKILL.md +18 -17
  887. package/assets/skills/tdd/SKILL.md +1 -1
  888. package/assets/skills/using-git-worktrees/SKILL.md +3 -11
  889. package/assets/skills/using-superpowers/SKILL.md +14 -20
  890. package/assets/skills/writing-plans/SKILL.md +5 -3
  891. package/assets/skills/writing-skills/SKILL.md +9 -9
  892. package/dist/cli.js +2351 -1728
  893. package/manifest.json +61 -40
  894. package/package.json +9 -3
  895. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts.map +0 -1
  896. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs.map +0 -1
  897. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts.map +0 -1
  898. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs.map +0 -1
  899. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-BRM5MGf9.d.cts.map +0 -1
  900. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D93NefGZ.d.mts.map +0 -1
  901. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-Ctiu4nBa.mjs.map +0 -1
  902. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-CzU40gwu.cjs.map +0 -1
  903. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D5Nfqtoz.mjs.map +0 -1
  904. package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D9A7ArDn.cjs.map +0 -1
  905. package/assets/skills/execution-mode-evaluation/README.md +0 -257
  906. package/assets/tests/agent-contract.test.js +0 -226
  907. package/assets/tests/controller.test.js +0 -187
  908. package/assets/tests/e2e-scenarios.md +0 -502
  909. package/assets/tests/validate-config.sh +0 -272
  910. package/dist/mcp/ask-user-server/index.js +0 -19657
  911. package/dist/mcp/ostacky-controller/index.js +0 -20085
@@ -0,0 +1,4041 @@
1
+ import { i as jsonSchemaValidator } from "./types-mS0yxCL0.mjs";
2
+ import { AnnotationsSchema, AudioContentSchema, AuthorizationServerMetadata, BAGGAGE_META_KEY, BaseMetadataSchema, BaseRequestParamsSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CLIENT_CAPABILITIES_META_KEY, CLIENT_INFO_META_KEY, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, ClientNotificationSchema, ClientRequestSchema, ClientResultSchema, ClientTasksCapabilitySchema, CompatibilityCallToolResultSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, CreateTaskResultSchema, CursorSchema, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, DiscoverRequestSchema, DiscoverResultSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, GetTaskRequestSchema, GetTaskResultSchema, INTERNAL_ERROR, INVALID_PARAMS, INVALID_REQUEST, IconSchema, IconsSchema, IdJagTokenExchangeResponse, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONArray, JSONArraySchema, JSONObject, JSONObjectSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPCResultResponseSchema, JSONRPC_VERSION, JSONValue, JSONValueSchema, LATEST_PROTOCOL_VERSION, LOG_LEVEL_META_KEY, LegacyTitledEnumSchemaSchema, ListChangedOptionsBaseSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListTasksRequestSchema, ListTasksResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, METHOD_NOT_FOUND, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NotificationsParamsSchema, NumberSchemaSchema, OAuthClientInformation, OAuthClientInformationFull, OAuthClientInformationMixed, OAuthClientMetadata, OAuthClientRegistrationError, OAuthErrorResponse, OAuthMetadata, OAuthProtectedResourceMetadata, OAuthTokenRevocationRequest, OAuthTokens, OpenIdProviderDiscoveryMetadata, OpenIdProviderMetadata, PARSE_ERROR, PROTOCOL_VERSION_META_KEY, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, RELATED_TASK_META_KEY, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RelatedTaskMetadataSchema, RequestIdSchema, RequestMetaSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultMetaObjectSchema, ResultSchema, RoleSchema, RootSchema, RootsListChangedNotificationSchema, SERVER_INFO_META_KEY, SUBSCRIPTION_ID_META_KEY, SUPPORTED_PROTOCOL_VERSIONS, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, ServerNotificationSchema, ServerRequestSchema, ServerResultSchema, ServerTasksCapabilitySchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StoredOAuthClientInformation, StoredOAuthTokens, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, TRACEPARENT_META_KEY, TRACESTATE_META_KEY, TaskAugmentedRequestParamsSchema, TaskCreationParamsSchema, TaskMetadataSchema, TaskSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, TaskStatusSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolExecutionSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema } from "@modelcontextprotocol/core/internal";
3
+ import * as z from "zod/v4";
4
+
5
+ //#region ../core-internal/src/auth/errors.d.ts
6
+ /**
7
+ * OAuth error codes as defined by {@link https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 | RFC 6749}
8
+ * and extensions.
9
+ */
10
+ declare enum OAuthErrorCode {
11
+ /**
12
+ * The request is missing a required parameter, includes an invalid parameter value,
13
+ * includes a parameter more than once, or is otherwise malformed.
14
+ */
15
+ InvalidRequest = "invalid_request",
16
+ /**
17
+ * Client authentication failed (e.g., unknown client, no client authentication included,
18
+ * or unsupported authentication method).
19
+ */
20
+ InvalidClient = "invalid_client",
21
+ /**
22
+ * The provided authorization grant or refresh token is invalid, expired, revoked,
23
+ * does not match the redirection URI used in the authorization request, or was issued to another client.
24
+ */
25
+ InvalidGrant = "invalid_grant",
26
+ /**
27
+ * The authenticated client is not authorized to use this authorization grant type.
28
+ */
29
+ UnauthorizedClient = "unauthorized_client",
30
+ /**
31
+ * The authorization grant type is not supported by the authorization server.
32
+ */
33
+ UnsupportedGrantType = "unsupported_grant_type",
34
+ /**
35
+ * The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.
36
+ */
37
+ InvalidScope = "invalid_scope",
38
+ /**
39
+ * The resource owner or authorization server denied the request.
40
+ */
41
+ AccessDenied = "access_denied",
42
+ /**
43
+ * The authorization server encountered an unexpected condition that prevented it from fulfilling the request.
44
+ */
45
+ ServerError = "server_error",
46
+ /**
47
+ * The authorization server is currently unable to handle the request due to temporary overloading or maintenance.
48
+ */
49
+ TemporarilyUnavailable = "temporarily_unavailable",
50
+ /**
51
+ * The authorization server does not support obtaining an authorization code using this method.
52
+ */
53
+ UnsupportedResponseType = "unsupported_response_type",
54
+ /**
55
+ * The authorization server does not support the requested token type.
56
+ */
57
+ UnsupportedTokenType = "unsupported_token_type",
58
+ /**
59
+ * The access token provided is expired, revoked, malformed, or invalid for other reasons.
60
+ */
61
+ InvalidToken = "invalid_token",
62
+ /**
63
+ * The HTTP method used is not allowed for this endpoint. (Custom, non-standard error)
64
+ */
65
+ MethodNotAllowed = "method_not_allowed",
66
+ /**
67
+ * Rate limit exceeded. (Custom, non-standard error based on RFC 6585)
68
+ */
69
+ TooManyRequests = "too_many_requests",
70
+ /**
71
+ * The client metadata is invalid. (Custom error for dynamic client registration - RFC 7591)
72
+ */
73
+ InvalidClientMetadata = "invalid_client_metadata",
74
+ /**
75
+ * The value of one or more redirection URIs is invalid. (Dynamic client registration - RFC 7591 §3.2.2)
76
+ */
77
+ InvalidRedirectUri = "invalid_redirect_uri",
78
+ /**
79
+ * The request requires higher privileges than provided by the access token.
80
+ */
81
+ InsufficientScope = "insufficient_scope",
82
+ /**
83
+ * The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)
84
+ */
85
+ InvalidTarget = "invalid_target",
86
+ }
87
+ /**
88
+ * OAuth error class for all OAuth-related errors.
89
+ */
90
+ declare class OAuthError extends Error {
91
+ readonly code: OAuthErrorCode | string;
92
+ readonly errorUri?: string | undefined;
93
+ static [Symbol.hasInstance](value: unknown): boolean;
94
+ /**
95
+ * Brand-based type guard: equivalent to `value instanceof this`, as an
96
+ * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
97
+ * the caller's own brand via `this`, so every branded subclass gets a
98
+ * correctly-scoped guard by inheritance. Must be invoked on the class —
99
+ * in callback position write `v => SdkError.isInstance(v)`, not
100
+ * `.filter(SdkError.isInstance)` (detached calls throw rather than
101
+ * silently matching nothing).
102
+ */
103
+ static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
104
+ constructor(code: OAuthErrorCode | string, message: string, errorUri?: string | undefined);
105
+ /**
106
+ * Converts the error to a standard OAuth error response object.
107
+ */
108
+ toResponseObject(): OAuthErrorResponse;
109
+ /**
110
+ * Creates an {@linkcode OAuthError} from an OAuth error response.
111
+ */
112
+ static fromResponse(response: OAuthErrorResponse): OAuthError;
113
+ }
114
+ //#endregion
115
+ //#region ../core-internal/src/errors/sdkErrors.d.ts
116
+ /**
117
+ * Error codes for SDK errors (local errors that never cross the wire).
118
+ * Unlike {@linkcode ProtocolErrorCode} which uses numeric JSON-RPC codes, `SdkErrorCode` uses
119
+ * descriptive string values for better developer experience.
120
+ *
121
+ * These errors are thrown locally by the SDK and are never serialized as
122
+ * JSON-RPC error responses.
123
+ */
124
+ declare enum SdkErrorCode {
125
+ /** Transport is not connected */
126
+ NotConnected = "NOT_CONNECTED",
127
+ /** Transport is already connected */
128
+ AlreadyConnected = "ALREADY_CONNECTED",
129
+ /** Protocol is not initialized */
130
+ NotInitialized = "NOT_INITIALIZED",
131
+ /** Required capability is not supported by the remote side */
132
+ CapabilityNotSupported = "CAPABILITY_NOT_SUPPORTED",
133
+ /** Request timed out waiting for response */
134
+ RequestTimeout = "REQUEST_TIMEOUT",
135
+ /** Connection was closed */
136
+ ConnectionClosed = "CONNECTION_CLOSED",
137
+ /** Failed to send message */
138
+ SendFailed = "SEND_FAILED",
139
+ /** Response result failed local schema validation */
140
+ InvalidResult = "INVALID_RESULT",
141
+ /**
142
+ * The response carried a `resultType` discriminator (protocol revision
143
+ * 2026-07-28) naming a result kind this client cannot consume yet, e.g.
144
+ * `input_required`. The kind is carried in `data.resultType`.
145
+ */
146
+ UnsupportedResultType = "UNSUPPORTED_RESULT_TYPE",
147
+ /**
148
+ * The multi-round-trip auto-fulfilment driver exhausted its round cap
149
+ * (`inputRequired.maxRounds`) without the server returning a complete
150
+ * result. `data.rounds` carries the cap that was hit and
151
+ * `data.lastResult` carries the last `input_required` payload received
152
+ * (`{ inputRequests, requestState? }`), so callers can inspect or resume
153
+ * the flow manually.
154
+ */
155
+ InputRequiredRoundsExceeded = "INPUT_REQUIRED_ROUNDS_EXCEEDED",
156
+ /**
157
+ * The auto-aggregating no-`cursor` `listTools()` / `listPrompts()` /
158
+ * `listResources()` / `listResourceTemplates()` walk hit the
159
+ * `ClientOptions.listMaxPages` cap without the server's pagination
160
+ * converging. `data.method` carries the list verb and
161
+ * `data.listMaxPages` the cap that was hit; raise the cap or fall back to
162
+ * explicit per-page `{ cursor }` calls.
163
+ */
164
+ ListPaginationExceeded = "LIST_PAGINATION_EXCEEDED",
165
+ /**
166
+ * The spec method being sent does not exist on the negotiated protocol
167
+ * version's wire era (e.g. `tasks/get` toward a 2026-07-28 peer, or
168
+ * `server/discover` toward a 2025-era peer). Raised locally, before
169
+ * anything reaches the transport. The method and era are carried in
170
+ * `data.method` / `data.era`.
171
+ */
172
+ MethodNotSupportedByProtocolVersion = "METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",
173
+ /**
174
+ * Protocol-era negotiation at connect time failed without producing either a
175
+ * usable modern (2026-07-28+) era or a definitive legacy fallback signal —
176
+ * e.g. the negotiation mode forbids falling back (`pin`), or the probe hit a
177
+ * network failure (a typed connect error, never an era verdict).
178
+ *
179
+ * Negotiation-phase only: this code is never used once an era is established.
180
+ */
181
+ EraNegotiationFailed = "ERA_NEGOTIATION_FAILED",
182
+ ClientHttpNotImplemented = "CLIENT_HTTP_NOT_IMPLEMENTED",
183
+ ClientHttpAuthentication = "CLIENT_HTTP_AUTHENTICATION",
184
+ ClientHttpForbidden = "CLIENT_HTTP_FORBIDDEN",
185
+ ClientHttpUnexpectedContent = "CLIENT_HTTP_UNEXPECTED_CONTENT",
186
+ ClientHttpFailedToOpenStream = "CLIENT_HTTP_FAILED_TO_OPEN_STREAM",
187
+ ClientHttpFailedToTerminateSession = "CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",
188
+ }
189
+ /**
190
+ * SDK errors are local errors that never cross the wire.
191
+ * They are distinct from {@linkcode ProtocolError} which represents JSON-RPC protocol errors
192
+ * that are serialized and sent as error responses.
193
+ *
194
+ * @example
195
+ * ```ts source="./sdkErrors.examples.ts#SdkError_basicUsage"
196
+ * try {
197
+ * // Throwing an SDK error
198
+ * throw new SdkError(SdkErrorCode.NotConnected, 'Transport is not connected');
199
+ * } catch (error) {
200
+ * // Checking error type by code
201
+ * if (error instanceof SdkError && error.code === SdkErrorCode.RequestTimeout) {
202
+ * // Handle timeout
203
+ * }
204
+ * }
205
+ * ```
206
+ */
207
+ declare class SdkError extends Error {
208
+ readonly code: SdkErrorCode;
209
+ readonly data?: unknown | undefined;
210
+ static [Symbol.hasInstance](value: unknown): boolean;
211
+ /**
212
+ * Brand-based type guard: equivalent to `value instanceof this`, as an
213
+ * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
214
+ * the caller's own brand via `this`, so every branded subclass gets a
215
+ * correctly-scoped guard by inheritance. Must be invoked on the class —
216
+ * in callback position write `v => SdkError.isInstance(v)`, not
217
+ * `.filter(SdkError.isInstance)` (detached calls throw rather than
218
+ * silently matching nothing).
219
+ */
220
+ static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
221
+ constructor(code: SdkErrorCode, message: string, data?: unknown | undefined);
222
+ }
223
+ /**
224
+ * Typed shape for HTTP error data carried by {@linkcode SdkHttpError}.
225
+ */
226
+ interface SdkHttpErrorData {
227
+ status: number;
228
+ statusText?: string;
229
+ [key: string]: unknown;
230
+ }
231
+ /**
232
+ * An {@linkcode SdkError} subclass for HTTP transport failures.
233
+ *
234
+ * Thrown by the streamable HTTP transport when the server responds with a
235
+ * non-OK status code. Narrows {@linkcode SdkError.data | data} to
236
+ * {@linkcode SdkHttpErrorData} so consumers can inspect the HTTP status
237
+ * without unsafe casting.
238
+ *
239
+ * @example
240
+ * ```ts source="./sdkErrors.examples.ts#SdkHttpError_basicUsage"
241
+ * if (error instanceof SdkHttpError) {
242
+ * console.log(error.status); // number
243
+ * console.log(error.statusText); // string | undefined
244
+ * }
245
+ * ```
246
+ */
247
+ declare class SdkHttpError extends SdkError {
248
+ readonly data: SdkHttpErrorData;
249
+ constructor(code: SdkErrorCode, message: string, data: SdkHttpErrorData);
250
+ get status(): number;
251
+ get statusText(): string | undefined;
252
+ }
253
+ //#endregion
254
+ //#region ../core-internal/src/shared/authUtils.d.ts
255
+ /**
256
+ * Utilities for handling OAuth resource URIs.
257
+ */
258
+ /**
259
+ * Converts a server URL to a resource URL by removing the fragment.
260
+ * {@link https://datatracker.ietf.org/doc/html/rfc8707#section-2 | RFC 8707 section 2}
261
+ * states that resource URIs "MUST NOT include a fragment component".
262
+ * Keeps everything else unchanged (scheme, domain, port, path, query).
263
+ */
264
+ declare function resourceUrlFromServerUrl(url: URL | string): URL;
265
+ /**
266
+ * Checks if a requested resource URL matches a configured resource URL.
267
+ * A requested resource matches if it has the same scheme, domain, port,
268
+ * and its path starts with the configured resource's path.
269
+ *
270
+ * @param options - The options object
271
+ * @param options.requestedResource - The resource URL being requested
272
+ * @param options.configuredResource - The resource URL that has been configured
273
+ * @returns true if the requested resource matches the configured resource, false otherwise
274
+ */
275
+ declare function checkResourceAllowed({
276
+ requestedResource,
277
+ configuredResource
278
+ }: {
279
+ requestedResource: URL | string;
280
+ configuredResource: URL | string;
281
+ }): boolean;
282
+ declare namespace schemas_d_exports {
283
+ export { AnnotationsSchema, AudioContentSchema, BaseMetadataSchema, BaseRequestParamsSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, ClientNotificationSchema, ClientRequestSchema, ClientResultSchema, ClientTasksCapabilitySchema, CompatibilityCallToolResultSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, CreateTaskResultSchema, CursorSchema, DiscoverRequestSchema, DiscoverResultSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, GetTaskRequestSchema, GetTaskResultSchema, IconSchema, IconsSchema, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONArraySchema, JSONObjectSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPCResultResponseSchema, JSONValueSchema, LegacyTitledEnumSchemaSchema, ListChangedOptionsBaseSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListTasksRequestSchema, ListTasksResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NotificationsParamsSchema, NumberSchemaSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RelatedTaskMetadataSchema, RequestIdSchema, RequestMetaSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultMetaObjectSchema, ResultSchema, RoleSchema, RootSchema, RootsListChangedNotificationSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, ServerNotificationSchema, ServerRequestSchema, ServerResultSchema, ServerTasksCapabilitySchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, TaskAugmentedRequestParamsSchema, TaskCreationParamsSchema, TaskMetadataSchema, TaskSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, TaskStatusSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolExecutionSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema };
284
+ }
285
+ //#endregion
286
+ //#region ../core-internal/src/types/types.d.ts
287
+ /**
288
+ * Utility types
289
+ */
290
+ type ExpandRecursively<T$1> = T$1 extends object ? (T$1 extends infer O ? { [K in keyof O]: ExpandRecursively<O[K]> } : never) : T$1;
291
+ type Primitive = string | number | boolean | bigint | null | undefined;
292
+ 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;
293
+ type Infer<Schema extends z.ZodTypeAny> = Flatten<z.infer<Schema>>;
294
+ /**
295
+ * Wire-only members hidden from the public types.
296
+ *
297
+ * `resultType` is the protocol-revision-2026-07-28 wire discrimination field
298
+ * on results. It is consumed by the SDK's protocol layer (and stripped before
299
+ * results reach consumers), so the public result types do not declare it.
300
+ * The wire schemas continue to model it internally.
301
+ */
302
+ type WireOnlyResultKey = 'resultType';
303
+ /**
304
+ * Removes wire-only members from a (possibly union) schema-inferred type
305
+ * while preserving every other declared member, optionality, and the loose
306
+ * index signature.
307
+ */
308
+ type StripWireOnly<T$1> = T$1 extends unknown ? { [K in keyof T$1 as K extends WireOnlyResultKey ? never : K]: T$1[K] } : never;
309
+ type ProgressToken = Infer<typeof ProgressTokenSchema>;
310
+ type Cursor = Infer<typeof CursorSchema>;
311
+ type Request$1 = Infer<typeof RequestSchema>;
312
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
313
+ type TaskAugmentedRequestParams = Infer<typeof TaskAugmentedRequestParamsSchema>;
314
+ type RequestMeta = Infer<typeof RequestMetaSchema>;
315
+ type Notification = Infer<typeof NotificationSchema>;
316
+ type Result$1 = StripWireOnly<Infer<typeof ResultSchema>>;
317
+ type RequestId = Infer<typeof RequestIdSchema>;
318
+ type JSONRPCRequest = Infer<typeof JSONRPCRequestSchema>;
319
+ type JSONRPCNotification = Infer<typeof JSONRPCNotificationSchema>;
320
+ type JSONRPCErrorResponse = Infer<typeof JSONRPCErrorResponseSchema>;
321
+ type JSONRPCResultResponse = Omit<Infer<typeof JSONRPCResultResponseSchema>, 'result'> & {
322
+ result: Result$1;
323
+ };
324
+ type JSONRPCResponse = JSONRPCResultResponse | JSONRPCErrorResponse;
325
+ type JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResultResponse | JSONRPCErrorResponse;
326
+ type RequestParams = Infer<typeof BaseRequestParamsSchema>;
327
+ type NotificationParams = Infer<typeof NotificationsParamsSchema>;
328
+ /**
329
+ * The per-request `_meta` envelope carried by every request under protocol revision
330
+ * 2026-07-28 (protocol version, client info, client capabilities, optional log level).
331
+ *
332
+ * Neutral hand-written shape keyed by the public meta-key constants — never
333
+ * inferred from a wire-module schema (this neutral layer does not import from
334
+ * `wire/rev*`). A `type` alias rather than an interface so it stays assignable
335
+ * to `_meta`'s string-indexed object slot.
336
+ */
337
+ type RequestMetaEnvelope = {};
338
+ type EmptyResult = StripWireOnly<Infer<typeof EmptyResultSchema>>;
339
+ type CancelledNotificationParams = Infer<typeof CancelledNotificationParamsSchema>;
340
+ type CancelledNotification = Infer<typeof CancelledNotificationSchema>;
341
+ type Icon = Infer<typeof IconSchema>;
342
+ type Icons = Infer<typeof IconsSchema>;
343
+ type BaseMetadata = Infer<typeof BaseMetadataSchema>;
344
+ type Annotations = Infer<typeof AnnotationsSchema>;
345
+ type Role = Infer<typeof RoleSchema>;
346
+ type Implementation = Infer<typeof ImplementationSchema>;
347
+ /**
348
+ * Capabilities a client may support.
349
+ *
350
+ * Note: the `roots` and `sampling` capabilities are deprecated as of protocol
351
+ * version 2026-07-28 (SEP-2577); they remain in the specification for at least
352
+ * twelve months. See `ClientCapabilitiesSchema`.
353
+ */
354
+ type ClientCapabilities = Infer<typeof ClientCapabilitiesSchema>;
355
+ type InitializeRequestParams = Infer<typeof InitializeRequestParamsSchema>;
356
+ type InitializeRequest = Infer<typeof InitializeRequestSchema>;
357
+ /**
358
+ * Capabilities a server may support.
359
+ *
360
+ * Note: the `logging` capability is deprecated as of protocol version
361
+ * 2026-07-28 (SEP-2577); it remains in the specification for at least twelve
362
+ * months. See `ServerCapabilitiesSchema`.
363
+ */
364
+ type ServerCapabilities = Infer<typeof ServerCapabilitiesSchema>;
365
+ type InitializeResult = StripWireOnly<Infer<typeof InitializeResultSchema>>;
366
+ type InitializedNotification = Infer<typeof InitializedNotificationSchema>;
367
+ type DiscoverRequest = Infer<typeof DiscoverRequestSchema>;
368
+ type DiscoverResult = StripWireOnly<Infer<typeof DiscoverResultSchema>>;
369
+ type PingRequest = Infer<typeof PingRequestSchema>;
370
+ type Progress = Infer<typeof ProgressSchema>;
371
+ type ProgressNotificationParams = Infer<typeof ProgressNotificationParamsSchema>;
372
+ type ProgressNotification = Infer<typeof ProgressNotificationSchema>;
373
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
374
+ type Task = Infer<typeof TaskSchema>;
375
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
376
+ type TaskStatus = Infer<typeof TaskStatusSchema>;
377
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
378
+ type TaskCreationParams = Infer<typeof TaskCreationParamsSchema>;
379
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
380
+ type TaskMetadata = Infer<typeof TaskMetadataSchema>;
381
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
382
+ type RelatedTaskMetadata = Infer<typeof RelatedTaskMetadataSchema>;
383
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
384
+ type CreateTaskResult = StripWireOnly<Infer<typeof CreateTaskResultSchema>>;
385
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
386
+ type TaskStatusNotificationParams = Infer<typeof TaskStatusNotificationParamsSchema>;
387
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
388
+ type TaskStatusNotification = Infer<typeof TaskStatusNotificationSchema>;
389
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
390
+ type GetTaskRequest = Infer<typeof GetTaskRequestSchema>;
391
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
392
+ type GetTaskResult = StripWireOnly<Infer<typeof GetTaskResultSchema>>;
393
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
394
+ type GetTaskPayloadRequest = Infer<typeof GetTaskPayloadRequestSchema>;
395
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
396
+ type ListTasksRequest = Infer<typeof ListTasksRequestSchema>;
397
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
398
+ type ListTasksResult = StripWireOnly<Infer<typeof ListTasksResultSchema>>;
399
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
400
+ type CancelTaskRequest = Infer<typeof CancelTaskRequestSchema>;
401
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
402
+ type CancelTaskResult = StripWireOnly<Infer<typeof CancelTaskResultSchema>>;
403
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
404
+ type GetTaskPayloadResult = StripWireOnly<Infer<typeof GetTaskPayloadResultSchema>>;
405
+ type PaginatedRequestParams = Infer<typeof PaginatedRequestParamsSchema>;
406
+ type PaginatedRequest = Infer<typeof PaginatedRequestSchema>;
407
+ type PaginatedResult = StripWireOnly<Infer<typeof PaginatedResultSchema>>;
408
+ type ResourceContents = Infer<typeof ResourceContentsSchema>;
409
+ type TextResourceContents = Infer<typeof TextResourceContentsSchema>;
410
+ type BlobResourceContents = Infer<typeof BlobResourceContentsSchema>;
411
+ type Resource = Infer<typeof ResourceSchema>;
412
+ type ResourceTemplateType = Infer<typeof ResourceTemplateSchema>;
413
+ type ListResourcesRequest = Infer<typeof ListResourcesRequestSchema>;
414
+ type ListResourcesResult = StripWireOnly<Infer<typeof ListResourcesResultSchema>>;
415
+ type ListResourceTemplatesRequest = Infer<typeof ListResourceTemplatesRequestSchema>;
416
+ type ListResourceTemplatesResult = StripWireOnly<Infer<typeof ListResourceTemplatesResultSchema>>;
417
+ type ResourceRequestParams = Infer<typeof ResourceRequestParamsSchema>;
418
+ type ReadResourceRequestParams = Infer<typeof ReadResourceRequestParamsSchema>;
419
+ type ReadResourceRequest = Infer<typeof ReadResourceRequestSchema>;
420
+ type ReadResourceResult = StripWireOnly<Infer<typeof ReadResourceResultSchema>>;
421
+ type ResourceListChangedNotification = Infer<typeof ResourceListChangedNotificationSchema>;
422
+ type SubscribeRequestParams = Infer<typeof SubscribeRequestParamsSchema>;
423
+ type SubscribeRequest = Infer<typeof SubscribeRequestSchema>;
424
+ type UnsubscribeRequestParams = Infer<typeof UnsubscribeRequestParamsSchema>;
425
+ type UnsubscribeRequest = Infer<typeof UnsubscribeRequestSchema>;
426
+ type ResourceUpdatedNotificationParams = Infer<typeof ResourceUpdatedNotificationParamsSchema>;
427
+ type ResourceUpdatedNotification = Infer<typeof ResourceUpdatedNotificationSchema>;
428
+ type SubscriptionFilter = Infer<typeof SubscriptionFilterSchema>;
429
+ type SubscriptionsListenRequestParams = Infer<typeof SubscriptionsListenRequestParamsSchema>;
430
+ type SubscriptionsListenRequest = Infer<typeof SubscriptionsListenRequestSchema>;
431
+ type SubscriptionsAcknowledgedNotificationParams = Infer<typeof SubscriptionsAcknowledgedNotificationParamsSchema>;
432
+ type SubscriptionsAcknowledgedNotification = Infer<typeof SubscriptionsAcknowledgedNotificationSchema>;
433
+ type SubscriptionsListenResultMeta = Infer<typeof SubscriptionsListenResultMetaSchema>;
434
+ type SubscriptionsListenResult = StripWireOnly<Infer<typeof SubscriptionsListenResultSchema>>;
435
+ type PromptArgument = Infer<typeof PromptArgumentSchema>;
436
+ type Prompt = Infer<typeof PromptSchema>;
437
+ type ListPromptsRequest = Infer<typeof ListPromptsRequestSchema>;
438
+ type ListPromptsResult = StripWireOnly<Infer<typeof ListPromptsResultSchema>>;
439
+ type GetPromptRequestParams = Infer<typeof GetPromptRequestParamsSchema>;
440
+ type GetPromptRequest = Infer<typeof GetPromptRequestSchema>;
441
+ type TextContent = Infer<typeof TextContentSchema>;
442
+ type ImageContent = Infer<typeof ImageContentSchema>;
443
+ type AudioContent = Infer<typeof AudioContentSchema>;
444
+ /**
445
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
446
+ * in the specification for at least twelve months. Migrate to calling LLM
447
+ * provider APIs directly.
448
+ */
449
+ type ToolUseContent = Infer<typeof ToolUseContentSchema>;
450
+ /**
451
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
452
+ * in the specification for at least twelve months. Migrate to calling LLM
453
+ * provider APIs directly.
454
+ */
455
+ type ToolResultContent = Infer<typeof ToolResultContentSchema>;
456
+ type EmbeddedResource = Infer<typeof EmbeddedResourceSchema>;
457
+ type ResourceLink = Infer<typeof ResourceLinkSchema>;
458
+ type ContentBlock = Infer<typeof ContentBlockSchema>;
459
+ type PromptMessage = Infer<typeof PromptMessageSchema>;
460
+ type GetPromptResult = StripWireOnly<Infer<typeof GetPromptResultSchema>>;
461
+ type PromptListChangedNotification = Infer<typeof PromptListChangedNotificationSchema>;
462
+ type ToolAnnotations = Infer<typeof ToolAnnotationsSchema>;
463
+ type ToolExecution = Infer<typeof ToolExecutionSchema>;
464
+ type Tool = Infer<typeof ToolSchema>;
465
+ type ListToolsRequest = Infer<typeof ListToolsRequestSchema>;
466
+ type ListToolsResult = StripWireOnly<Infer<typeof ListToolsResultSchema>>;
467
+ type CallToolRequestParams = Infer<typeof CallToolRequestParamsSchema>;
468
+ type CallToolResult = StripWireOnly<Infer<typeof CallToolResultSchema>>;
469
+ type CompatibilityCallToolResult = StripWireOnly<Infer<typeof CompatibilityCallToolResultSchema>>;
470
+ type CallToolRequest = Infer<typeof CallToolRequestSchema>;
471
+ type ToolListChangedNotification = Infer<typeof ToolListChangedNotificationSchema>;
472
+ /**
473
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
474
+ * in the specification for at least twelve months. Migrate to stderr logging
475
+ * (STDIO servers) or OpenTelemetry.
476
+ */
477
+ type LoggingLevel = Infer<typeof LoggingLevelSchema>;
478
+ /**
479
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
480
+ * in the specification for at least twelve months. Migrate to stderr logging
481
+ * (STDIO servers) or OpenTelemetry.
482
+ */
483
+ type SetLevelRequestParams = Infer<typeof SetLevelRequestParamsSchema>;
484
+ /**
485
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
486
+ * in the specification for at least twelve months. Migrate to stderr logging
487
+ * (STDIO servers) or OpenTelemetry.
488
+ */
489
+ type SetLevelRequest = Infer<typeof SetLevelRequestSchema>;
490
+ /**
491
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
492
+ * in the specification for at least twelve months. Migrate to stderr logging
493
+ * (STDIO servers) or OpenTelemetry.
494
+ */
495
+ type LoggingMessageNotificationParams = Infer<typeof LoggingMessageNotificationParamsSchema>;
496
+ /**
497
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
498
+ * in the specification for at least twelve months. Migrate to stderr logging
499
+ * (STDIO servers) or OpenTelemetry.
500
+ */
501
+ type LoggingMessageNotification = Infer<typeof LoggingMessageNotificationSchema>;
502
+ /**
503
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
504
+ * in the specification for at least twelve months. Migrate to calling LLM
505
+ * provider APIs directly.
506
+ */
507
+ type ToolChoice = Infer<typeof ToolChoiceSchema>;
508
+ /**
509
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
510
+ * in the specification for at least twelve months. Migrate to calling LLM
511
+ * provider APIs directly.
512
+ */
513
+ type ModelHint = Infer<typeof ModelHintSchema>;
514
+ /**
515
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
516
+ * in the specification for at least twelve months. Migrate to calling LLM
517
+ * provider APIs directly.
518
+ */
519
+ type ModelPreferences = Infer<typeof ModelPreferencesSchema>;
520
+ /**
521
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
522
+ * in the specification for at least twelve months. Migrate to calling LLM
523
+ * provider APIs directly.
524
+ */
525
+ type SamplingContent = Infer<typeof SamplingContentSchema>;
526
+ /**
527
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
528
+ * in the specification for at least twelve months. Migrate to calling LLM
529
+ * provider APIs directly.
530
+ */
531
+ type SamplingMessageContentBlock = Infer<typeof SamplingMessageContentBlockSchema>;
532
+ /**
533
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
534
+ * in the specification for at least twelve months. Migrate to calling LLM
535
+ * provider APIs directly.
536
+ */
537
+ type SamplingMessage = Infer<typeof SamplingMessageSchema>;
538
+ /**
539
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
540
+ * in the specification for at least twelve months. Migrate to calling LLM
541
+ * provider APIs directly.
542
+ */
543
+ type CreateMessageRequestParams = Infer<typeof CreateMessageRequestParamsSchema>;
544
+ /**
545
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
546
+ * in the specification for at least twelve months. Migrate to calling LLM
547
+ * provider APIs directly.
548
+ */
549
+ type CreateMessageRequest = Infer<typeof CreateMessageRequestSchema>;
550
+ /**
551
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
552
+ * in the specification for at least twelve months. Migrate to calling LLM
553
+ * provider APIs directly.
554
+ */
555
+ type CreateMessageResult = StripWireOnly<Infer<typeof CreateMessageResultSchema>>;
556
+ /**
557
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
558
+ * in the specification for at least twelve months. Migrate to calling LLM
559
+ * provider APIs directly.
560
+ */
561
+ type CreateMessageResultWithTools = StripWireOnly<Infer<typeof CreateMessageResultWithToolsSchema>>;
562
+ type BooleanSchema = Infer<typeof BooleanSchemaSchema>;
563
+ type StringSchema = Infer<typeof StringSchemaSchema>;
564
+ type NumberSchema = Infer<typeof NumberSchemaSchema>;
565
+ type EnumSchema = Infer<typeof EnumSchemaSchema>;
566
+ type UntitledSingleSelectEnumSchema = Infer<typeof UntitledSingleSelectEnumSchemaSchema>;
567
+ type TitledSingleSelectEnumSchema = Infer<typeof TitledSingleSelectEnumSchemaSchema>;
568
+ type LegacyTitledEnumSchema = Infer<typeof LegacyTitledEnumSchemaSchema>;
569
+ type UntitledMultiSelectEnumSchema = Infer<typeof UntitledMultiSelectEnumSchemaSchema>;
570
+ type TitledMultiSelectEnumSchema = Infer<typeof TitledMultiSelectEnumSchemaSchema>;
571
+ type SingleSelectEnumSchema = Infer<typeof SingleSelectEnumSchemaSchema>;
572
+ type MultiSelectEnumSchema = Infer<typeof MultiSelectEnumSchemaSchema>;
573
+ type PrimitiveSchemaDefinition = Infer<typeof PrimitiveSchemaDefinitionSchema>;
574
+ type ElicitRequestParams = Infer<typeof ElicitRequestParamsSchema>;
575
+ type ElicitRequestFormParams = Infer<typeof ElicitRequestFormParamsSchema>;
576
+ type ElicitRequestURLParams = Infer<typeof ElicitRequestURLParamsSchema>;
577
+ type ElicitRequest = Infer<typeof ElicitRequestSchema>;
578
+ /** @deprecated Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification. */
579
+ type ElicitationCompleteNotificationParams = Infer<typeof ElicitationCompleteNotificationParamsSchema>;
580
+ /** @deprecated Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification. */
581
+ type ElicitationCompleteNotification = Infer<typeof ElicitationCompleteNotificationSchema>;
582
+ type ElicitResult = StripWireOnly<Infer<typeof ElicitResultSchema>>;
583
+ type ResourceTemplateReference = Infer<typeof ResourceTemplateReferenceSchema>;
584
+ type PromptReference = Infer<typeof PromptReferenceSchema>;
585
+ type CompleteRequestParams = Infer<typeof CompleteRequestParamsSchema>;
586
+ type CompleteRequest = Infer<typeof CompleteRequestSchema>;
587
+ type CompleteResult = StripWireOnly<Infer<typeof CompleteResultSchema>>;
588
+ /**
589
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
590
+ * in the specification for at least twelve months. Migrate to passing paths via
591
+ * tool parameters, resource URIs, or configuration.
592
+ */
593
+ type Root = Infer<typeof RootSchema>;
594
+ /**
595
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
596
+ * in the specification for at least twelve months. Migrate to passing paths via
597
+ * tool parameters, resource URIs, or configuration.
598
+ */
599
+ type ListRootsRequest = Infer<typeof ListRootsRequestSchema>;
600
+ /**
601
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
602
+ * in the specification for at least twelve months. Migrate to passing paths via
603
+ * tool parameters, resource URIs, or configuration.
604
+ */
605
+ type ListRootsResult = StripWireOnly<Infer<typeof ListRootsResultSchema>>;
606
+ /**
607
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
608
+ * in the specification for at least twelve months. Migrate to passing paths via
609
+ * tool parameters, resource URIs, or configuration.
610
+ */
611
+ type RootsListChangedNotification = Infer<typeof RootsListChangedNotificationSchema>;
612
+ /**
613
+ * A single embedded (de-JSON-RPC'd) input request inside an
614
+ * {@linkcode InputRequiredResult}: an elicitation, sampling, or roots request
615
+ * object carried in-band rather than sent as a server→client JSON-RPC request.
616
+ */
617
+ type InputRequest = CreateMessageRequest | ListRootsRequest | ElicitRequest;
618
+ /**
619
+ * A single embedded (de-JSON-RPC'd) input response inside a retried request's
620
+ * `inputResponses`: the bare result object for the corresponding
621
+ * {@linkcode InputRequest} (never wrapped in a `{method, result}` envelope).
622
+ */
623
+ type InputResponse = CreateMessageResult | ListRootsResult | ElicitResult;
624
+ /**
625
+ * A map of embedded input requests, keyed by server-assigned identifiers that
626
+ * are unique within the scope of the request.
627
+ */
628
+ interface InputRequests {
629
+ [key: string]: InputRequest;
630
+ }
631
+ /**
632
+ * A map of embedded input responses. Keys correspond to the keys of the
633
+ * {@linkcode InputRequests} map the server sent; values are the client's bare
634
+ * result for each request.
635
+ */
636
+ interface InputResponses {
637
+ [key: string]: InputResponse;
638
+ }
639
+ /**
640
+ * The input-required result a handler for a multi-round-trip method
641
+ * (`tools/call`, `prompts/get`, `resources/read`) returns to request more
642
+ * input from the client (protocol revision 2026-07-28). Build it with the
643
+ * `inputRequired()` builder; hand-built literals are equally legal —
644
+ * `resultType: 'input_required'` is the discriminator, and the SDK re-checks
645
+ * the at-least-one rule at the seam.
646
+ *
647
+ * This is the one place the wire discriminator `resultType` appears on the
648
+ * neutral surface: the handler authors it, the 2026-07-28 codec passes it
649
+ * through to the wire, and consumers receiving results never see it (complete
650
+ * results are lifted).
651
+ *
652
+ * At least one of `inputRequests` or `requestState` must be present.
653
+ *
654
+ * `requestState` is an opaque, server-minted string echoed back verbatim by
655
+ * the client on retry. It travels through the client and MUST be treated by
656
+ * the server as attacker-controlled input on re-entry: if it influences
657
+ * authorization, resource access, or business logic, the server MUST protect
658
+ * its integrity (e.g. HMAC or AEAD) and MUST reject state that fails
659
+ * verification (spec: basic/patterns/mrtr §Server Requirements). The SDK
660
+ * applies no integrity protection by default — without a configured
661
+ * `ServerOptions.requestState.verify` hook, `ctx.mcpReq.requestState()`
662
+ * returns the raw, unverified string; with one, the seam rejects state the
663
+ * hook refuses and the accessor returns the hook's decoded payload.
664
+ */
665
+ interface InputRequiredResult extends Result$1 {
666
+ resultType: 'input_required';
667
+ /** Embedded requests the client must fulfil before retrying. */
668
+ inputRequests?: InputRequests;
669
+ /** Opaque server state the client echoes back verbatim on retry. */
670
+ requestState?: string;
671
+ }
672
+ type ClientRequest = Infer<typeof ClientRequestSchema>;
673
+ type ClientNotification = Infer<typeof ClientNotificationSchema>;
674
+ type ClientResult = StripWireOnly<Infer<typeof ClientResultSchema>>;
675
+ type ServerRequest = Infer<typeof ServerRequestSchema>;
676
+ type ServerNotification = Infer<typeof ServerNotificationSchema>;
677
+ type ServerResult = StripWireOnly<Infer<typeof ServerResultSchema>>;
678
+ type MethodToTypeMap<U$1> = { [T in U$1 as T extends {
679
+ method: infer M extends string;
680
+ } ? M : never]: T };
681
+ /**
682
+ * Task methods are 2025-11-25 wire vocabulary with no SDK runtime: the task
683
+ * wire types stay importable (see the Tasks section above), but the typed
684
+ * method surface — `request()`, `setRequestHandler()`, `ctx.mcpReq.send()` —
685
+ * does not offer them. The wire schemas keep parsing task vocabulary for
686
+ * interoperability with 2025-11-25 peers.
687
+ */
688
+ type TaskRequestMethod = 'tasks/get' | 'tasks/result' | 'tasks/list' | 'tasks/cancel';
689
+ type TaskNotificationMethod = 'notifications/tasks/status';
690
+ type RequestMethod = Exclude<ClientRequest['method'] | ServerRequest['method'], TaskRequestMethod>;
691
+ type NotificationMethod = Exclude<ClientNotification['method'] | ServerNotification['method'], TaskNotificationMethod>;
692
+ type RequestTypeMap = MethodToTypeMap<Exclude<ClientRequest | ServerRequest, {
693
+ method: TaskRequestMethod;
694
+ }>>;
695
+ type NotificationTypeMap = MethodToTypeMap<Exclude<ClientNotification | ServerNotification, {
696
+ method: TaskNotificationMethod;
697
+ }>>;
698
+ type ResultTypeMap = {
699
+ ping: EmptyResult;
700
+ initialize: InitializeResult;
701
+ 'server/discover': DiscoverResult;
702
+ 'completion/complete': CompleteResult;
703
+ 'logging/setLevel': EmptyResult;
704
+ 'prompts/get': GetPromptResult;
705
+ 'prompts/list': ListPromptsResult;
706
+ 'resources/list': ListResourcesResult;
707
+ 'resources/templates/list': ListResourceTemplatesResult;
708
+ 'resources/read': ReadResourceResult;
709
+ 'resources/subscribe': EmptyResult;
710
+ 'resources/unsubscribe': EmptyResult;
711
+ 'subscriptions/listen': SubscriptionsListenResult;
712
+ 'tools/call': CallToolResult;
713
+ 'tools/list': ListToolsResult;
714
+ 'sampling/createMessage': CreateMessageResult | CreateMessageResultWithTools;
715
+ 'elicitation/create': ElicitResult;
716
+ 'roots/list': ListRootsResult;
717
+ };
718
+ /**
719
+ * The handler-return counterpart of {@linkcode ResultTypeMap}: what a
720
+ * registered request handler may RETURN for each method. Identical to
721
+ * `ResultTypeMap` except that the multi-round-trip methods (`tools/call`,
722
+ * `prompts/get`, `resources/read`) additionally accept an
723
+ * {@linkcode InputRequiredResult} (protocol revision 2026-07-28).
724
+ *
725
+ * `ResultTypeMap` itself — what a *requester* receives — is deliberately NOT
726
+ * widened: `client.callTool()` returns a plain {@linkcode CallToolResult} on
727
+ * both protocol eras.
728
+ */
729
+ type HandlerResultTypeMap = { [M in keyof ResultTypeMap]: M extends 'tools/call' | 'prompts/get' | 'resources/read' ? ResultTypeMap[M] | InputRequiredResult : ResultTypeMap[M] };
730
+ /**
731
+ * Information about a validated access token, provided to request handlers.
732
+ */
733
+ interface AuthInfo {
734
+ /**
735
+ * The access token.
736
+ */
737
+ token: string;
738
+ /**
739
+ * The client ID associated with this token.
740
+ */
741
+ clientId: string;
742
+ /**
743
+ * Scopes associated with this token.
744
+ */
745
+ scopes: string[];
746
+ /**
747
+ * When the token expires (in seconds since epoch).
748
+ */
749
+ expiresAt?: number;
750
+ /**
751
+ * The RFC 8707 resource server identifier for which this token is valid.
752
+ * If set, this MUST match the MCP server's resource identifier (minus hash fragment).
753
+ */
754
+ resource?: URL;
755
+ /**
756
+ * Additional data associated with the token.
757
+ * This field should be used for any additional data that needs to be attached to the auth info.
758
+ */
759
+ extra?: Record<string, unknown>;
760
+ }
761
+ type JSONRPCErrorObject = {
762
+ code: number;
763
+ message: string;
764
+ data?: unknown;
765
+ };
766
+ interface ParseError extends JSONRPCErrorObject {
767
+ code: typeof PARSE_ERROR;
768
+ }
769
+ interface InvalidRequestError extends JSONRPCErrorObject {
770
+ code: typeof INVALID_REQUEST;
771
+ }
772
+ interface MethodNotFoundError extends JSONRPCErrorObject {
773
+ code: typeof METHOD_NOT_FOUND;
774
+ }
775
+ interface InvalidParamsError extends JSONRPCErrorObject {
776
+ code: typeof INVALID_PARAMS;
777
+ }
778
+ interface InternalError extends JSONRPCErrorObject {
779
+ code: typeof INTERNAL_ERROR;
780
+ }
781
+ /**
782
+ * Data carried by a `-32021` MissingRequiredClientCapability protocol error
783
+ * (protocol revision 2026-07-28).
784
+ */
785
+ interface MissingRequiredClientCapabilityErrorData {
786
+ /**
787
+ * The capabilities the server requires from the client to process the
788
+ * request, in the `ClientCapabilities` shape (only the missing
789
+ * capabilities are listed).
790
+ */
791
+ requiredCapabilities: ClientCapabilities;
792
+ }
793
+ /**
794
+ * Data carried by a `-32022` UnsupportedProtocolVersion protocol error
795
+ * (protocol revision 2026-07-28).
796
+ */
797
+ interface UnsupportedProtocolVersionErrorData {
798
+ /**
799
+ * Protocol versions the receiver supports. The sender should choose a
800
+ * mutually supported version from this list and retry.
801
+ */
802
+ supported: string[];
803
+ /**
804
+ * The protocol version that was requested.
805
+ */
806
+ requested: string;
807
+ }
808
+ /**
809
+ * Callback type for list changed notifications.
810
+ */
811
+ type ListChangedCallback<T$1> = (error: Error | null, items: T$1[] | null) => void;
812
+ /**
813
+ * Options for subscribing to list changed notifications.
814
+ *
815
+ * @typeParam T - The type of items in the list (`Tool`, `Prompt`, or `Resource`)
816
+ */
817
+ type ListChangedOptions<T$1> = {
818
+ /**
819
+ * If `true`, the list will be refreshed automatically when a list changed notification is received.
820
+ * @default true
821
+ */
822
+ autoRefresh?: boolean;
823
+ /**
824
+ * Debounce time in milliseconds. Set to `0` to disable.
825
+ * @default 300
826
+ */
827
+ debounceMs?: number;
828
+ /**
829
+ * Callback invoked when the list changes.
830
+ *
831
+ * If `autoRefresh` is `true`, `items` contains the updated list.
832
+ * If `autoRefresh` is `false`, `items` is `null` (caller should refresh manually).
833
+ */
834
+ onChanged: ListChangedCallback<T$1>;
835
+ };
836
+ /**
837
+ * Configuration for list changed notification handlers.
838
+ *
839
+ * Use this to configure handlers for tools, prompts, and resources list changes
840
+ * when creating a client.
841
+ *
842
+ * Note: Handlers are only activated if the server advertises the corresponding
843
+ * `listChanged` capability (e.g., `tools.listChanged: true`). If the server
844
+ * doesn't advertise this capability, the handler will not be set up.
845
+ */
846
+ type ListChangedHandlers = {
847
+ /**
848
+ * Handler for tool list changes.
849
+ */
850
+ tools?: ListChangedOptions<Tool>;
851
+ /**
852
+ * Handler for prompt list changes.
853
+ */
854
+ prompts?: ListChangedOptions<Prompt>;
855
+ /**
856
+ * Handler for resource list changes.
857
+ */
858
+ resources?: ListChangedOptions<Resource>;
859
+ };
860
+ /**
861
+ * Protocol-era classification of an inbound message.
862
+ *
863
+ * Populated by transports that classify messages at the edge (e.g. an HTTP
864
+ * entry distinguishing 2025-era from 2026-era traffic). The wire era itself
865
+ * is connection state (the negotiated protocol version held by the
866
+ * `Client`/`Server` instance); the protocol layer validates a classified
867
+ * message against that instance era at dispatch — a mismatch is treated as
868
+ * an entry/routing error, never a per-message era switch. Unclassified
869
+ * traffic is dispatched on the instance era unchanged.
870
+ */
871
+ interface MessageClassification {
872
+ /**
873
+ * The wire era the message was classified into: `legacy` for the
874
+ * 2025-11-25 family of revisions, `modern` for 2026-07-28 and later.
875
+ */
876
+ era: 'legacy' | 'modern';
877
+ /**
878
+ * The exact protocol revision, when the classifier derived one.
879
+ */
880
+ revision?: string;
881
+ }
882
+ /**
883
+ * Extra information about a message.
884
+ */
885
+ interface MessageExtraInfo {
886
+ /**
887
+ * The original HTTP request.
888
+ */
889
+ request?: globalThis.Request;
890
+ /**
891
+ * Protocol-era classification of the message, when the transport
892
+ * classified it at the edge. Validated by the protocol layer against the
893
+ * instance's negotiated era at dispatch (the edge→instance handoff
894
+ * check); it does not select the era itself.
895
+ */
896
+ classification?: MessageClassification;
897
+ /**
898
+ * The authentication information.
899
+ */
900
+ authInfo?: AuthInfo;
901
+ /**
902
+ * Callback to close the SSE stream for this request, triggering client reconnection.
903
+ * Only available when using {@linkcode @modelcontextprotocol/node!streamableHttp.NodeStreamableHTTPServerTransport | NodeStreamableHTTPServerTransport} with eventStore configured.
904
+ */
905
+ closeSSEStream?: () => void;
906
+ /**
907
+ * Callback to close the standalone GET SSE stream, triggering client reconnection.
908
+ * Only available when using {@linkcode @modelcontextprotocol/node!streamableHttp.NodeStreamableHTTPServerTransport | NodeStreamableHTTPServerTransport} with eventStore configured.
909
+ */
910
+ closeStandaloneSSEStream?: () => void;
911
+ }
912
+ type MetaObject = Record<string, unknown>;
913
+ type RequestMetaObject = RequestMeta;
914
+ /**
915
+ * The contents of a result's `_meta` field (the 2026-07-28 `ResultMetaObject`):
916
+ * loose, with the optional self-reported serverInfo key typed when present.
917
+ */
918
+ type ResultMetaObject = Infer<typeof ResultMetaObjectSchema>;
919
+ /**
920
+ * {@linkcode CreateMessageRequestParams} without tools - for backwards-compatible overload.
921
+ * Excludes tools/toolChoice to indicate they should not be provided.
922
+ *
923
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
924
+ * in the specification for at least twelve months. Migrate to calling LLM
925
+ * provider APIs directly.
926
+ */
927
+ type CreateMessageRequestParamsBase = Omit<CreateMessageRequestParams, 'tools' | 'toolChoice'>;
928
+ /**
929
+ * {@linkcode CreateMessageRequestParams} with required tools - for tool-enabled overload.
930
+ *
931
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
932
+ * in the specification for at least twelve months. Migrate to calling LLM
933
+ * provider APIs directly.
934
+ */
935
+ interface CreateMessageRequestParamsWithTools extends CreateMessageRequestParams {
936
+ tools: Tool[];
937
+ }
938
+ type CompleteRequestResourceTemplate = ExpandRecursively<CompleteRequest & {
939
+ params: CompleteRequestParams & {
940
+ ref: ResourceTemplateReference;
941
+ };
942
+ }>;
943
+ type CompleteRequestPrompt = ExpandRecursively<CompleteRequest & {
944
+ params: CompleteRequestParams & {
945
+ ref: PromptReference;
946
+ };
947
+ }>;
948
+ //#endregion
949
+ //#region ../core-internal/src/wire/codec.d.ts
950
+ /** Wire eras with distinct vocabulary. */
951
+ type WireEra = '2025-11-25' | '2026-07-28';
952
+ /**
953
+ * Wire-only material lifted off an inbound message by the protocol layer
954
+ * before dispatch (the V-3 seam): the reserved `_meta` envelope keys and the
955
+ * multi-round-trip driver fields. This is the typed driver-material channel
956
+ * of the codec contract — handlers never see it; the protocol layer surfaces
957
+ * it via `ctx.mcpReq.envelope` / `.inputResponses` / `.requestState`, and the
958
+ * MRTR driver (M4.1) consumes the retry fields from here.
959
+ */
960
+ interface LiftedWireMaterial {
961
+ envelope?: Partial<RequestMetaEnvelope>;
962
+ inputResponses?: Record<string, unknown>;
963
+ requestState?: string;
964
+ }
965
+ /**
966
+ * Tri-state validation outcome — the function-only contract for what the
967
+ * schema-getter pair (`hasRequestMethod` ⇒ −32601-by-absence; `…Schema(m)
968
+ * .parse` throw ⇒ −32602) used to encode in two pieces. Preserving the split
969
+ * is the point: collapsing 'absent from this era's registry' into 'invalid'
970
+ * would make the in-band fallback chain (validate → on `not-in-era` fall to
971
+ * validateInputRequest) treat absence as failure and never fall through.
972
+ */
973
+ type ValidateOutcome<T$1> = {
974
+ readonly ok: true;
975
+ readonly value: T$1;
976
+ }
977
+ /**
978
+ * Method is spec vocabulary but absent from THIS era's registry. Callers
979
+ * map to −32601 (inbound) or a typed local SdkError (outbound), or fall
980
+ * through to the in-band validator.
981
+ */ | {
982
+ readonly ok: false;
983
+ readonly reason: 'not-in-era';
984
+ }
985
+ /**
986
+ * Method is in this era's registry; payload failed the era-exact schema.
987
+ * Callers map to −32602.
988
+ */ | {
989
+ readonly ok: false;
990
+ readonly reason: 'invalid';
991
+ readonly message: string;
992
+ };
993
+ /** A single self-identifying problem found while validating a per-request `_meta` envelope. */
994
+ interface EnvelopeIssue {
995
+ /**
996
+ * The envelope key the problem is about: one of the reserved `_meta`
997
+ * keys, or a dotted path inside one.
998
+ */
999
+ readonly key: string;
1000
+ /** A short description of what is wrong with that key (`missing`, or a validation message). */
1001
+ readonly problem: string;
1002
+ }
1003
+ /** Material a Client supplies for an era to build its per-request `_meta` envelope from. */
1004
+ interface OutboundEnvelopeMaterial {
1005
+ readonly protocolVersion: string;
1006
+ readonly clientInfo: Implementation;
1007
+ readonly clientCapabilities: ClientCapabilities;
1008
+ readonly logLevel?: LoggingLevel;
1009
+ }
1010
+ /** Result decode outcomes — the raw-first discrimination (V-1) lives in `decodeResult`. */
1011
+ type DecodedResult = {
1012
+ kind: 'complete';
1013
+ /** The neutral result value: wire-only material consumed/stripped. */
1014
+ result: Result$1;
1015
+ } | {
1016
+ kind: 'input_required';
1017
+ /**
1018
+ * Driver-only material (never consumer-visible). The full
1019
+ * multi-round-trip driver is M4.1 scope; this seam carries the
1020
+ * discriminated payload to it.
1021
+ */
1022
+ inputRequests: Record<string, unknown>;
1023
+ requestState?: string;
1024
+ } | {
1025
+ kind: 'invalid';
1026
+ error: SdkError;
1027
+ };
1028
+ /**
1029
+ * The per-era wire codec contract (design C §3, adapted to the live funnel
1030
+ * layout: the universal wire-only LIFT runs once in the protocol layer for
1031
+ * every message — spec, custom, and fallback paths alike — and codecs consume
1032
+ * the lifted material rather than re-implementing the strip per era).
1033
+ */
1034
+ interface WireCodec {
1035
+ readonly era: WireEra;
1036
+ /** Registry membership — the deletion story (inbound −32601 by absence; outbound typed local error). */
1037
+ hasRequestMethod(method: string): boolean;
1038
+ hasNotificationMethod(method: string): boolean;
1039
+ hasInputRequestMethod(method: string): boolean;
1040
+ /** Era-exact request validation. `not-in-era` ≡ −32601-by-absence; `invalid` ≡ −32602. */
1041
+ validateRequest<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<RequestTypeMap[M$1]>;
1042
+ validateRequest(method: string, raw: unknown): ValidateOutcome<unknown>;
1043
+ /** Era-exact result validation (same registry as `validateRequest`). */
1044
+ validateResult<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<ResultTypeMap[M$1]>;
1045
+ validateResult(method: string, raw: unknown): ValidateOutcome<unknown>;
1046
+ /** Era-exact notification validation. */
1047
+ validateNotification<M$1 extends NotificationMethod>(method: M$1, raw: unknown): ValidateOutcome<NotificationTypeMap[M$1]>;
1048
+ validateNotification(method: string, raw: unknown): ValidateOutcome<unknown>;
1049
+ /**
1050
+ * In-band (de-JSON-RPC'd) input-request validation — the embedded
1051
+ * requests a multi-round-trip `input_required` result may carry. Always
1052
+ * `not-in-era` on the 2025 era (elicitation/sampling/roots are wire
1053
+ * request methods there). Does NOT grant registry membership.
1054
+ */
1055
+ validateInputRequest<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<RequestTypeMap[M$1]>;
1056
+ validateInputRequest(method: string, raw: unknown): ValidateOutcome<unknown>;
1057
+ /** In-band bare-response validation answering an embedded input request. */
1058
+ validateInputResponse<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<ResultTypeMap[M$1]>;
1059
+ validateInputResponse(method: string, raw: unknown): ValidateOutcome<unknown>;
1060
+ /**
1061
+ * Param-conditional `sampling/createMessage` result validation — the one
1062
+ * spec result whose schema depends on REQUEST params (tools vs no tools).
1063
+ * The 2025 era owns the with-tools/plain frozen schemas; the 2026 era
1064
+ * returns `not-in-era` (sampling is in-band there — callers fall through
1065
+ * to `validateInputResponse`).
1066
+ */
1067
+ samplingResultVariant(hasTools: true, raw: unknown): ValidateOutcome<CreateMessageResultWithTools>;
1068
+ samplingResultVariant(hasTools: false, raw: unknown): ValidateOutcome<CreateMessageResult>;
1069
+ samplingResultVariant(hasTools: boolean, raw: unknown): ValidateOutcome<CreateMessageResult | CreateMessageResultWithTools>;
1070
+ /**
1071
+ * Outbound per-request `_meta` envelope encode. Returns the keyed object
1072
+ * to merge into `params._meta` on this era, or `undefined` when this era
1073
+ * carries no per-request envelope (the 2025 era — legacy wire stays
1074
+ * byte-identical).
1075
+ */
1076
+ outboundEnvelope(material: OutboundEnvelopeMaterial): Readonly<Record<string, unknown>> | undefined;
1077
+ /**
1078
+ * Structured envelope validation: maps a `_meta` object to
1079
+ * self-identifying issues. The 2025 era never requires an envelope and
1080
+ * always returns `[]`; the 2026 era owns the required-key pre-pass plus
1081
+ * the wire-exact `RequestMetaEnvelopeSchema` parse.
1082
+ */
1083
+ validateEnvelopeMeta(meta: Readonly<Record<string, unknown>>): EnvelopeIssue[];
1084
+ /**
1085
+ * Per-registration `tools/call` result projection. Two independent
1086
+ * decisions, both owned here so server-side code never re-derives them:
1087
+ *
1088
+ * - SEP-2106 §4.3 TextContent auto-append (EVERY era, value-shape-based):
1089
+ * when `structuredContent` is a non-object value (array/primitive/
1090
+ * `null`) and the handler authored no `type:'text'` block, append
1091
+ * `{type:'text', text: JSON.stringify(value)}` so consumers that read
1092
+ * only `content` still receive a rendering. The author opts out by
1093
+ * returning any `text` block themselves.
1094
+ *
1095
+ * - `{result:…}` wrap (2025 era only): wrap as `{result:<value>}` when the
1096
+ * value is non-object (the 2025 wire shape requires `structuredContent`
1097
+ * to be an object — a schema-less tool returning `[1,2,3]` would
1098
+ * otherwise ship wire-illegal bytes) OR when the tool's ADVERTISED
1099
+ * `outputSchema` has a non-object root (so the result matches the
1100
+ * `encodeResult('tools/list')` projection of the same tool). Identity on
1101
+ * the 2026 era — the wire shape carries the natural value directly.
1102
+ */
1103
+ projectCallToolResult(result: CallToolResult, advertisedOutputSchema: Readonly<Record<string, unknown>> | undefined): CallToolResult;
1104
+ /**
1105
+ * Step 1 of result decoding: RAW `resultType` handling BEFORE any schema
1106
+ * validation (V-1's structural home). Era postures (Q1-SD3):
1107
+ * - 2026 era: required discriminator — absent ⇒ typed error naming the
1108
+ * spec violation; `input_required` ⇒ driver payload; unknown ⇒ invalid,
1109
+ * no retry; `complete` ⇒ consume + lift.
1110
+ * - 2025 era: `resultType` is foreign vocabulary ⇒ strip-on-lift.
1111
+ */
1112
+ decodeResult(method: string, raw: unknown): DecodedResult;
1113
+ /**
1114
+ * Outbound result mapping (the stamp seam). The 2025-era codec is the
1115
+ * identity — it has NO stamp code path (the never-stamp guarantee; it
1116
+ * never reads `serverInfo`). The 2026-era codec strictly enforces the
1117
+ * 2026 wire shape for the known deleted-field set
1118
+ * (`execution.taskSupport`, `capabilities.tasks` — Q1-SD3 iii), stamps
1119
+ * `resultType`, fills the required `ttlMs`/`cacheScope` fields on
1120
+ * cacheable results, and — when the caller supplies its identity —
1121
+ * stamps `_meta['io.modelcontextprotocol/serverInfo']` on every result
1122
+ * (spec PR #3002 SHOULD; a handler-authored value wins). `Server`
1123
+ * instances pass their identity; clients and hand-constructed protocol
1124
+ * objects pass nothing and no identity is ever invented.
1125
+ */
1126
+ encodeResult(method: string, result: Result$1, serverInfo?: Implementation): Result$1;
1127
+ /**
1128
+ * Outbound error-code mapping (the error half of the stamp seam). A
1129
+ * handler-thrown `ProtocolError`'s numeric code passes through here on
1130
+ * its way to the JSON-RPC error response, so per-era wire-code selection
1131
+ * lives in the codec rather than in handler/funnel code. The current
1132
+ * mapping is identical on both eras (the `-32002` resource-not-found
1133
+ * domain code maps to `-32602` Invalid Params on the wire — the
1134
+ * 2026-07-28 spec MUST, and what the deployed v1.x SDK already emits on
1135
+ * earlier revisions); the seam is the structural home for any future
1136
+ * per-era divergence. Unknown codes pass through unchanged.
1137
+ */
1138
+ encodeErrorCode(code: number): number;
1139
+ /**
1140
+ * @deprecated Use {@link validateEnvelopeMeta}. Inbound envelope
1141
+ * enforcement for era-classified traffic: validates the lifted envelope
1142
+ * material of a request. Returns an error message when the era requires
1143
+ * an envelope and it is missing/invalid (→ −32602 at the dispatch
1144
+ * layer); `undefined` when acceptable. The 2025 era never requires an
1145
+ * envelope.
1146
+ */
1147
+ checkInboundEnvelope(material: LiftedWireMaterial): string | undefined;
1148
+ }
1149
+ //#endregion
1150
+ //#region ../core-internal/src/shared/inboundClassification.d.ts
1151
+ /**
1152
+ * The transport-neutral description of an inbound HTTP request the classifier
1153
+ * evaluates. The caller (the HTTP entry) reads the body exactly once and
1154
+ * extracts the two protocol headers; the classifier never touches a request
1155
+ * object itself.
1156
+ */
1157
+ interface InboundHttpRequest {
1158
+ /** The HTTP request method, e.g. `POST`, `GET`, `DELETE`. */
1159
+ httpMethod: string;
1160
+ /** The value of the `MCP-Protocol-Version` header, when present. */
1161
+ protocolVersionHeader?: string;
1162
+ /** The value of the `Mcp-Method` header, when present. */
1163
+ mcpMethodHeader?: string;
1164
+ /** The value of the `Mcp-Name` header, when present. */
1165
+ mcpNameHeader?: string;
1166
+ /** The parsed JSON request body (`undefined` for body-less methods). */
1167
+ body?: unknown;
1168
+ }
1169
+ /** Why an inbound request was routed to legacy-era serving. */
1170
+ type InboundLegacyRouteReason = /** Non-`POST` HTTP method: a body-less 2025-era session operation. */
1171
+ 'http-method'
1172
+ /** An `initialize` request without a valid modern envelope claim — the legacy handshake by definition. */ | 'initialize'
1173
+ /** A request without a per-request envelope claim. */ | 'no-claim'
1174
+ /** A notification without a body claim or a modern protocol-version header. */ | 'notification'
1175
+ /** An all-legacy JSON-RPC batch array. */ | 'batch'
1176
+ /** A JSON-RPC response posted to the endpoint (2025-era session traffic). */ | 'response';
1177
+ /**
1178
+ * The request is legacy-era traffic. It carries no classification on purpose:
1179
+ * legacy serving receives it exactly as a hand-wired 2025 transport would.
1180
+ */
1181
+ interface InboundLegacyRoute {
1182
+ kind: 'legacy';
1183
+ reason: InboundLegacyRouteReason;
1184
+ /**
1185
+ * The protocol version the request named, when it named one (an
1186
+ * `initialize` body's `protocolVersion`, or the `MCP-Protocol-Version`
1187
+ * header). Used to echo `requested` when legacy serving is not configured.
1188
+ */
1189
+ requestedVersion?: string;
1190
+ }
1191
+ /**
1192
+ * The request claims the per-request envelope mechanism and is served on the
1193
+ * modern path. Discriminated by `messageKind` so the typed `message` narrows
1194
+ * with it — the classifier has already proved the JSON-RPC shape via the
1195
+ * `isJSONRPCRequest` / `isJSONRPCNotification` guards, so consumers never
1196
+ * cast the body again.
1197
+ */
1198
+ type InboundModernRoute = {
1199
+ kind: 'modern';
1200
+ messageKind: 'request';
1201
+ /** The classified body — guard-proved {@linkcode JSONRPCRequest} shape. */
1202
+ message: JSONRPCRequest;
1203
+ /**
1204
+ * The classification handed to the per-request transport and validated by
1205
+ * the protocol layer against the serving instance's negotiated era.
1206
+ */
1207
+ classification: MessageClassification;
1208
+ } | {
1209
+ kind: 'modern';
1210
+ messageKind: 'notification';
1211
+ /** The classified body — guard-proved {@linkcode JSONRPCNotification} shape. */
1212
+ message: JSONRPCNotification;
1213
+ classification: MessageClassification;
1214
+ };
1215
+ /** The named steps of the inbound validation ladder, in evaluation order. */
1216
+ type InboundValidationRung = 'http-method' | 'jsonrpc-shape' | 'era-classification' | 'envelope' | 'method-registry' | 'request-params' | 'standard-header-validation' | 'client-capabilities' | 'param-header-validation';
1217
+ /** A ladder rejection: the JSON-RPC error to emit and the HTTP status to emit it with. */
1218
+ interface InboundLadderRejection {
1219
+ kind: 'reject';
1220
+ /** The ladder rung that produced the rejection. */
1221
+ rung: InboundValidationRung;
1222
+ /** The cell this rejection corresponds to on the ladder cell sheet (stable identifier for tests). */
1223
+ cell: string;
1224
+ /** The HTTP status the rejection is emitted with. */
1225
+ httpStatus: number;
1226
+ /** The JSON-RPC error code. */
1227
+ code: number;
1228
+ /** The JSON-RPC error message. */
1229
+ message: string;
1230
+ /** Structured error data (recognizers parse this; they never rely on class identity). */
1231
+ data?: unknown;
1232
+ /**
1233
+ * `false` when the exact error code for this cell is not settled upstream
1234
+ * yet and the emitted code is provisional.
1235
+ */
1236
+ settled: boolean;
1237
+ }
1238
+ /** The outcome of classifying one inbound HTTP request. */
1239
+ type InboundClassificationOutcome = InboundLegacyRoute | InboundModernRoute | InboundLadderRejection;
1240
+ /**
1241
+ * Classifies one inbound HTTP request for dual-era serving.
1242
+ *
1243
+ * The body-primary predicate, evaluated once at the entry boundary: see the
1244
+ * module documentation for the rules. Returns a routing outcome (`legacy` or
1245
+ * `modern`) or a ladder rejection; it never throws.
1246
+ */
1247
+ declare function classifyInboundRequest(request: InboundHttpRequest): InboundClassificationOutcome;
1248
+ //#endregion
1249
+ //#region ../core-internal/src/util/standardSchema.d.ts
1250
+ interface StandardTypedV1<Input = unknown, Output = Input> {
1251
+ readonly '~standard': StandardTypedV1.Props<Input, Output>;
1252
+ }
1253
+ declare namespace StandardTypedV1 {
1254
+ interface Props<Input = unknown, Output = Input> {
1255
+ readonly version: 1;
1256
+ readonly vendor: string;
1257
+ readonly types?: Types<Input, Output> | undefined;
1258
+ }
1259
+ interface Types<Input = unknown, Output = Input> {
1260
+ readonly input: Input;
1261
+ readonly output: Output;
1262
+ }
1263
+ type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['input'];
1264
+ type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['output'];
1265
+ }
1266
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
1267
+ readonly '~standard': StandardSchemaV1.Props<Input, Output>;
1268
+ }
1269
+ declare namespace StandardSchemaV1 {
1270
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
1271
+ readonly validate: (value: unknown, options?: Options | undefined) => Result<Output> | Promise<Result<Output>>;
1272
+ }
1273
+ interface Options {
1274
+ readonly libraryOptions?: Record<string, unknown> | undefined;
1275
+ }
1276
+ type Result<Output> = SuccessResult<Output> | FailureResult;
1277
+ interface SuccessResult<Output> {
1278
+ readonly value: Output;
1279
+ readonly issues?: undefined;
1280
+ }
1281
+ interface FailureResult {
1282
+ readonly issues: ReadonlyArray<Issue>;
1283
+ }
1284
+ interface Issue {
1285
+ readonly message: string;
1286
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
1287
+ }
1288
+ interface PathSegment {
1289
+ readonly key: PropertyKey;
1290
+ }
1291
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1292
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1293
+ }
1294
+ interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
1295
+ readonly '~standard': StandardJSONSchemaV1.Props<Input, Output>;
1296
+ }
1297
+ declare namespace StandardJSONSchemaV1 {
1298
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
1299
+ readonly jsonSchema: Converter;
1300
+ }
1301
+ interface Converter {
1302
+ readonly input: (options: Options) => Record<string, unknown>;
1303
+ readonly output: (options: Options) => Record<string, unknown>;
1304
+ }
1305
+ type Target = 'draft-2020-12' | 'draft-07' | 'openapi-3.0' | (object & string);
1306
+ interface Options {
1307
+ readonly target: Target;
1308
+ readonly libraryOptions?: Record<string, unknown> | undefined;
1309
+ }
1310
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1311
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1312
+ }
1313
+ /**
1314
+ * Combined interface for schemas with both validation and JSON Schema conversion —
1315
+ * the intersection of {@linkcode StandardSchemaV1} and {@linkcode StandardJSONSchemaV1}.
1316
+ *
1317
+ * This is the type accepted by `registerTool` / `registerPrompt`. The SDK needs
1318
+ * `~standard.jsonSchema` to advertise the tool's argument shape in `tools/list`, and
1319
+ * `~standard.validate` to check incoming arguments when a `tools/call` arrives.
1320
+ *
1321
+ * Zod v4, ArkType, and Valibot (via `@valibot/to-json-schema`'s `toStandardJsonSchema`)
1322
+ * all implement both interfaces.
1323
+ *
1324
+ * @see https://standardschema.dev/ for the Standard Schema specification
1325
+ */
1326
+ interface StandardSchemaWithJSON<Input = unknown, Output = Input> {
1327
+ readonly '~standard': StandardSchemaV1.Props<Input, Output> & StandardJSONSchemaV1.Props<Input, Output>;
1328
+ }
1329
+ declare namespace StandardSchemaWithJSON {
1330
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1331
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1332
+ }
1333
+ /**
1334
+ * Narrowing of {@linkcode StandardSchemaV1} whose `validate` is guaranteed synchronous.
1335
+ *
1336
+ * The Zod schemas backing `specTypeSchemas` contain no async refinements or transforms,
1337
+ * so every entry satisfies this interface. Consumers can call `validate()` and access
1338
+ * `.issues` / `.value` on the result without `await`.
1339
+ *
1340
+ * `StandardSchemaV1Sync` is assignable to `StandardSchemaV1` — it is a strict subtype.
1341
+ */
1342
+ interface StandardSchemaV1Sync<Input = unknown, Output = Input> extends StandardSchemaV1<Input, Output> {
1343
+ readonly '~standard': StandardSchemaV1Sync.Props<Input, Output>;
1344
+ }
1345
+ declare namespace StandardSchemaV1Sync {
1346
+ interface Props<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output> {
1347
+ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<Output>;
1348
+ }
1349
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1350
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1351
+ }
1352
+ //#endregion
1353
+ //#region ../core-internal/src/shared/elicitation.d.ts
1354
+ /** Input accepted by `inputRequired.elicit()`: a wire-ready elicitation JSON Schema or a Standard Schema. */
1355
+ type ElicitInputParams = Omit<ElicitRequestFormParams, 'requestedSchema'> & {
1356
+ requestedSchema: ElicitRequestFormParams['requestedSchema'] | StandardSchemaWithJSON;
1357
+ };
1358
+ //#endregion
1359
+ //#region ../core-internal/src/shared/inputRequired.d.ts
1360
+ /** The shape accepted by {@linkcode inputRequired}. */
1361
+ interface InputRequiredSpec {
1362
+ /** Embedded requests the client must fulfil before retrying. */
1363
+ inputRequests?: InputRequests;
1364
+ /** Opaque server state echoed back verbatim by the client on retry. */
1365
+ requestState?: string;
1366
+ }
1367
+ interface InputRequiredBuilder {
1368
+ /**
1369
+ * Builds the input-required return value for a multi-round-trip handler.
1370
+ *
1371
+ * At least one of `inputRequests` or `requestState` must be provided
1372
+ * (spec: basic/patterns/mrtr, server requirements) — the builder throws a
1373
+ * `TypeError` otherwise, and the server seam re-checks the same rule for
1374
+ * hand-built results.
1375
+ *
1376
+ * `requestState` is opaque, server-minted state. It round-trips through
1377
+ * the client and comes back as attacker-controlled input: a server that
1378
+ * lets it influence authorization, resource access, or business logic
1379
+ * MUST integrity-protect it (e.g. HMAC or AEAD) and MUST reject state
1380
+ * that fails verification. The SDK does not do this for you.
1381
+ */
1382
+ (spec: InputRequiredSpec): InputRequiredResult;
1383
+ /**
1384
+ * Builds an embedded form-mode elicitation request (`elicitation/create`).
1385
+ *
1386
+ * A Standard Schema `requestedSchema` is converted to the restricted wire shape;
1387
+ * shapes it cannot express throw a `TypeError` before anything is sent. Responses
1388
+ * are not validated against it — pass the same schema to `acceptedContent()` on
1389
+ * re-entry for validated, typed content.
1390
+ */
1391
+ elicit(params: ElicitInputParams): InputRequest;
1392
+ /**
1393
+ * Builds an embedded URL-mode elicitation request (`elicitation/create`).
1394
+ * On the 2026-07-28 revision URL elicitation rides the multi-round-trip
1395
+ * flow — the `-32042` error of earlier revisions never appears on this
1396
+ * era's wire. The 2025-era `elicitationId` is not part of the 2026-07-28
1397
+ * URL-mode shape; correlation across retries is the server's own
1398
+ * identifier inside `requestState`.
1399
+ */
1400
+ elicitUrl(params: Omit<ElicitRequestURLParams, 'mode' | 'elicitationId'>): InputRequest;
1401
+ /** Builds an embedded sampling request (`sampling/createMessage`). */
1402
+ createMessage(params: CreateMessageRequestParams): InputRequest;
1403
+ /** Builds an embedded roots listing request (`roots/list`). */
1404
+ listRoots(): InputRequest;
1405
+ }
1406
+ /**
1407
+ * Builder for the input-required return value of multi-round-trip handlers,
1408
+ * with per-kind constructors for the embedded requests
1409
+ * (`inputRequired.elicit`, `inputRequired.elicitUrl`,
1410
+ * `inputRequired.createMessage`, `inputRequired.listRoots`).
1411
+ *
1412
+ * @example Write-once tool requesting confirmation
1413
+ * ```ts
1414
+ * server.registerTool('deploy', { inputSchema: z.object({ env: z.string() }) }, async ({ env }, ctx) => {
1415
+ * const confirmed = acceptedContent<{ confirm: boolean }>(ctx.mcpReq.inputResponses, 'confirm');
1416
+ * if (!confirmed) {
1417
+ * return inputRequired({
1418
+ * inputRequests: {
1419
+ * confirm: inputRequired.elicit({
1420
+ * message: `Deploy to ${env}?`,
1421
+ * requestedSchema: { type: 'object', properties: { confirm: { type: 'boolean' } }, required: ['confirm'] }
1422
+ * })
1423
+ * }
1424
+ * });
1425
+ * }
1426
+ * return { content: [{ type: 'text', text: `deployed to ${env}` }] };
1427
+ * });
1428
+ * ```
1429
+ */
1430
+ declare const inputRequired: InputRequiredBuilder;
1431
+ /**
1432
+ * Reads the accepted content of a form-mode elicitation response from a
1433
+ * retried request's `inputResponses` (`ctx.mcpReq.inputResponses`).
1434
+ *
1435
+ * Returns the response's `content` for `key` when the entry is an accepted
1436
+ * elicitation result, and `undefined` otherwise (missing key, declined or
1437
+ * cancelled elicitation, or a response of another kind). The values arrive
1438
+ * from the client and are not re-validated here — treat them as untrusted
1439
+ * input.
1440
+ */
1441
+ declare function acceptedContent<T$1 extends Record<string, unknown> = Record<string, unknown>>(responses: InputResponses | Record<string, unknown> | undefined, key: string): T$1 | undefined;
1442
+ /**
1443
+ * Schema-aware overload: validates the accepted content against the given
1444
+ * schema (any Standard Schema, e.g. a zod object) before returning it, so the
1445
+ * untrusted client value arrives in the handler already validated and typed.
1446
+ *
1447
+ * Returns `undefined` when the response is missing/declined/of another kind
1448
+ * (as the two-argument form does) AND when the accepted content fails schema
1449
+ * validation — handlers treat both the same way (re-issue the request or
1450
+ * give up). Only synchronous schemas are supported (zod schemas without async
1451
+ * refinements are synchronous); an asynchronously-validating schema throws a
1452
+ * `TypeError`.
1453
+ */
1454
+ declare function acceptedContent<S extends StandardSchemaV1>(responses: InputResponses | Record<string, unknown> | undefined, key: string, schema: S): StandardSchemaV1.InferOutput<S> | undefined;
1455
+ /**
1456
+ * The discriminated view {@linkcode inputResponse} returns: which kind of
1457
+ * embedded response (if any) a retried request carried for a key. Bare
1458
+ * response objects are discriminated structurally — an `action` member means
1459
+ * an elicitation result, a `roots` array a roots listing, a `role` + `content`
1460
+ * pair a sampling result. A missing key or an entry that matches none of the
1461
+ * three shapes reads as `{ kind: 'missing' }`.
1462
+ */
1463
+ type InputResponseView = {
1464
+ kind: 'missing';
1465
+ } | {
1466
+ kind: 'elicit';
1467
+ action: 'accept' | 'decline' | 'cancel';
1468
+ content?: Record<string, unknown>;
1469
+ } | {
1470
+ kind: 'sampling';
1471
+ result: CreateMessageResult | CreateMessageResultWithTools;
1472
+ } | {
1473
+ kind: 'roots';
1474
+ roots: Root[];
1475
+ };
1476
+ /**
1477
+ * Reads one entry of a retried request's `inputResponses`
1478
+ * (`ctx.mcpReq.inputResponses`) as a discriminated view, covering
1479
+ * decline/cancel detection and the non-elicitation response kinds that
1480
+ * {@linkcode acceptedContent} does not surface.
1481
+ *
1482
+ * The values arrive from the client and are not re-validated here — treat
1483
+ * them as untrusted input (validate elicitation content with the
1484
+ * schema-aware {@linkcode acceptedContent} overload where it matters).
1485
+ */
1486
+ declare function inputResponse(responses: InputResponses | Record<string, unknown> | undefined, key: string): InputResponseView;
1487
+ //#endregion
1488
+ //#region ../core-internal/src/types/enums.d.ts
1489
+ /**
1490
+ * Error codes for protocol errors that cross the wire as JSON-RPC error responses.
1491
+ * These follow the JSON-RPC specification and MCP-specific extensions.
1492
+ */
1493
+ declare enum ProtocolErrorCode {
1494
+ ParseError = -32700,
1495
+ InvalidRequest = -32600,
1496
+ MethodNotFound = -32601,
1497
+ InvalidParams = -32602,
1498
+ InternalError = -32603,
1499
+ /**
1500
+ * Resource not found.
1501
+ *
1502
+ * Receive-tolerated only: the SDK never EMITS `-32002` — `resources/read`
1503
+ * misses answer `-32602` (Invalid Params) on every protocol revision per
1504
+ * the 2026-07-28 spec MUST, and a handler-thrown `-32002` is mapped to
1505
+ * `-32602` at the era encode seam. The member stays importable so clients
1506
+ * can recognise `-32002` from peers built on earlier SDK releases (the
1507
+ * spec's "clients SHOULD also accept `-32002`" backwards-compatibility
1508
+ * clause). Throw `ResourceNotFoundError` instead.
1509
+ */
1510
+ ResourceNotFound = -32002,
1511
+ /**
1512
+ * Processing the request requires a capability the client did not declare
1513
+ * in the request's `clientCapabilities` (protocol revision 2026-07-28).
1514
+ */
1515
+ MissingRequiredClientCapability = -32021,
1516
+ /**
1517
+ * The request's protocol version is unknown to the server or unsupported
1518
+ * by it (protocol revision 2026-07-28).
1519
+ */
1520
+ UnsupportedProtocolVersion = -32022,
1521
+ UrlElicitationRequired = -32042,
1522
+ }
1523
+ //#endregion
1524
+ //#region ../core-internal/src/types/errors.d.ts
1525
+ /**
1526
+ * Protocol errors are JSON-RPC errors that cross the wire as error responses.
1527
+ * They use numeric error codes from the {@linkcode ProtocolErrorCode} enum.
1528
+ *
1529
+ * `instanceof` on this class (and its subclasses) is brand-matched, so it works
1530
+ * across separately bundled copies of the SDK — e.g. an error constructed by
1531
+ * `@modelcontextprotocol/client` matches the class re-exported by
1532
+ * `@modelcontextprotocol/server` in the same process.
1533
+ */
1534
+ declare class ProtocolError extends Error {
1535
+ readonly code: number;
1536
+ readonly data?: unknown | undefined;
1537
+ static [Symbol.hasInstance](value: unknown): boolean;
1538
+ /**
1539
+ * Brand-based type guard: equivalent to `value instanceof this`, as an
1540
+ * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
1541
+ * the caller's own brand via `this`, so every branded subclass gets a
1542
+ * correctly-scoped guard by inheritance. Must be invoked on the class —
1543
+ * in callback position write `v => SdkError.isInstance(v)`, not
1544
+ * `.filter(SdkError.isInstance)` (detached calls throw rather than
1545
+ * silently matching nothing).
1546
+ */
1547
+ static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
1548
+ constructor(code: number, message: string, data?: unknown | undefined);
1549
+ /**
1550
+ * Factory method to create the appropriate error type based on the error code and data
1551
+ */
1552
+ static fromError(code: number, message: string, data?: unknown): ProtocolError;
1553
+ }
1554
+ /**
1555
+ * Error type for a `resources/read` miss: the requested resource does not
1556
+ * exist. The wire code is `-32602` (Invalid Params) on every protocol
1557
+ * revision — the spec MUST for revision 2026-07-28, and the value the v1.x
1558
+ * SDK has always emitted on earlier revisions. The error data echoes the
1559
+ * requested URI.
1560
+ *
1561
+ * Recognise this error by checking `error.data` is exactly `{ uri: string }`
1562
+ * (a `-32602` whose data carries `uri` and nothing else is resource-not-found;
1563
+ * any other `-32602` is an ordinary Invalid Params). For backwards compatibility, clients should also
1564
+ * accept `-32002` as resource not found — earlier SDK builds emitted that
1565
+ * code, and {@linkcode ProtocolError.fromError} reconstructs this class for
1566
+ * either code **when `error.data` carries `uri`** (a bare `-32002` without
1567
+ * `data.uri` stays a generic {@linkcode ProtocolError}). `instanceof` checks
1568
+ * are brand-matched and work across separately bundled copies of the SDK.
1569
+ */
1570
+ declare class ResourceNotFoundError extends ProtocolError {
1571
+ constructor(uri: string, message?: string);
1572
+ /** The URI that was requested and not found. */
1573
+ get uri(): string;
1574
+ }
1575
+ /**
1576
+ * Specialized error type when a tool requires a URL mode elicitation.
1577
+ * This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against.
1578
+ */
1579
+ declare class UrlElicitationRequiredError extends ProtocolError {
1580
+ constructor(elicitations: ElicitRequestURLParams[], message?: string);
1581
+ get elicitations(): ElicitRequestURLParams[];
1582
+ }
1583
+ /**
1584
+ * Error type for the `-32022` UnsupportedProtocolVersion protocol error (protocol
1585
+ * revision 2026-07-28): the request's protocol version is unknown to the server or
1586
+ * unsupported by it.
1587
+ *
1588
+ * The error data lists the protocol versions the receiver supports (`supported`),
1589
+ * so the sender can choose a mutually supported version and retry, and echoes the
1590
+ * version that was requested (`requested`).
1591
+ */
1592
+ declare class UnsupportedProtocolVersionError extends ProtocolError {
1593
+ constructor(data: UnsupportedProtocolVersionErrorData, message?: string);
1594
+ /**
1595
+ * Protocol versions the receiver supports.
1596
+ */
1597
+ get supported(): string[];
1598
+ /**
1599
+ * The protocol version that was requested.
1600
+ */
1601
+ get requested(): string;
1602
+ }
1603
+ /**
1604
+ * Error type for the `-32021` MissingRequiredClientCapability protocol error
1605
+ * (protocol revision 2026-07-28): processing the request requires a capability
1606
+ * the client did not declare in the request's `clientCapabilities`.
1607
+ *
1608
+ * The error data lists the missing capabilities (`requiredCapabilities`) in
1609
+ * the `ClientCapabilities` shape, so the client can see exactly what it would
1610
+ * have to declare for the request to be served. On HTTP, the response status
1611
+ * is `400 Bad Request`.
1612
+ *
1613
+ * Recognize this error by its code and `data.requiredCapabilities`, or by
1614
+ * `instanceof` — checks are brand-matched and work across separately bundled
1615
+ * copies of the SDK.
1616
+ */
1617
+ declare class MissingRequiredClientCapabilityError extends ProtocolError {
1618
+ constructor(data: MissingRequiredClientCapabilityErrorData, message?: string);
1619
+ /**
1620
+ * The capabilities the server requires from the client to process the
1621
+ * request (only the missing capabilities are listed).
1622
+ */
1623
+ get requiredCapabilities(): ClientCapabilities;
1624
+ }
1625
+ //#endregion
1626
+ //#region ../core-internal/src/types/guards.d.ts
1627
+ /**
1628
+ * Validates and parses an unknown value as a JSON-RPC message.
1629
+ *
1630
+ * Use this to validate incoming messages in custom transport implementations.
1631
+ * Throws if the value does not conform to the JSON-RPC message schema.
1632
+ *
1633
+ * @param value - The value to validate (typically a parsed JSON object).
1634
+ * @returns The validated {@linkcode JSONRPCMessage}.
1635
+ * @throws If validation fails.
1636
+ */
1637
+ declare function parseJSONRPCMessage(value: unknown): JSONRPCMessage;
1638
+ declare const isJSONRPCRequest: (value: unknown) => value is JSONRPCRequest;
1639
+ declare const isJSONRPCNotification: (value: unknown) => value is JSONRPCNotification;
1640
+ /**
1641
+ * Checks if a value is a valid {@linkcode JSONRPCResultResponse}.
1642
+ * @param value - The value to check.
1643
+ *
1644
+ * @returns True if the value is a valid {@linkcode JSONRPCResultResponse}, false otherwise.
1645
+ */
1646
+ declare const isJSONRPCResultResponse: (value: unknown) => value is JSONRPCResultResponse;
1647
+ /**
1648
+ * Checks if a value is a valid {@linkcode JSONRPCErrorResponse}.
1649
+ * @param value - The value to check.
1650
+ *
1651
+ * @returns True if the value is a valid {@linkcode JSONRPCErrorResponse}, false otherwise.
1652
+ */
1653
+ declare const isJSONRPCErrorResponse: (value: unknown) => value is JSONRPCErrorResponse;
1654
+ /**
1655
+ * Checks if a value is a valid {@linkcode JSONRPCResponse} (either a result or error response).
1656
+ * @param value - The value to check.
1657
+ *
1658
+ * @returns True if the value is a valid {@linkcode JSONRPCResponse}, false otherwise.
1659
+ */
1660
+ declare const isJSONRPCResponse: (value: unknown) => value is JSONRPCResponse;
1661
+ /**
1662
+ * Checks if a value is a valid {@linkcode CallToolResult}.
1663
+ *
1664
+ * This is a consumer-side VALUE check against the neutral model, not a wire
1665
+ * validator: a raw wire object that additionally carries wire-only members
1666
+ * (e.g. `resultType`) still passes through the loose index signature. Use a
1667
+ * transport-level parse to validate raw wire traffic.
1668
+ *
1669
+ * @param value - The value to check.
1670
+ *
1671
+ * @returns True if the value is a valid {@linkcode CallToolResult}, false otherwise.
1672
+ */
1673
+ declare const isCallToolResult: (value: unknown) => value is CallToolResult;
1674
+ /**
1675
+ * Checks whether a value is an input-required result (protocol revision
1676
+ * 2026-07-28): the multi-round-trip return shape discriminated by
1677
+ * `resultType: 'input_required'`.
1678
+ *
1679
+ * This is a discriminator check, not a full validator — the at-least-one rule
1680
+ * (`inputRequests` or `requestState`) is enforced by the `inputRequired()`
1681
+ * builder and re-checked by the server seam for hand-built values.
1682
+ *
1683
+ * @param value - The value to check.
1684
+ * @returns True if the value carries the `input_required` discriminator.
1685
+ */
1686
+ declare const isInputRequiredResult: (value: unknown) => value is InputRequiredResult;
1687
+ /**
1688
+ * Checks if a value is a valid {@linkcode TaskAugmentedRequestParams}.
1689
+ * @param value - The value to check.
1690
+ *
1691
+ * @returns True if the value is a valid {@linkcode TaskAugmentedRequestParams}, false otherwise.
1692
+ *
1693
+ * @deprecated Recognizes 2025-11-25 task wire vocabulary, which has no SDK
1694
+ * runtime; kept importable for interoperability only.
1695
+ */
1696
+ declare const isTaskAugmentedRequestParams: (value: unknown) => value is TaskAugmentedRequestParams;
1697
+ declare const isInitializeRequest: (value: unknown) => value is InitializeRequest;
1698
+ declare const isInitializedNotification: (value: unknown) => value is InitializedNotification;
1699
+ declare function assertCompleteRequestPrompt(request: CompleteRequest): asserts request is CompleteRequestPrompt;
1700
+ declare function assertCompleteRequestResourceTemplate(request: CompleteRequest): asserts request is CompleteRequestResourceTemplate;
1701
+ //#endregion
1702
+ //#region ../core-internal/src/types/specTypeSchema.d.ts
1703
+ /**
1704
+ * Explicit allowlist of protocol Zod schemas that correspond to a public spec type in `types.ts`.
1705
+ *
1706
+ * This intentionally excludes internal helper schemas exported from `schemas.ts` that have no
1707
+ * matching public type (e.g. `ListChangedOptionsBaseSchema`, `BaseRequestParamsSchema`,
1708
+ * `NotificationsParamsSchema`, `ClientTasksCapabilitySchema`, `ServerTasksCapabilitySchema`).
1709
+ * Keeping the list explicit means new public spec types must be added here deliberately, and
1710
+ * internals never leak into `SpecTypeName`.
1711
+ *
1712
+ * `ResourceTemplateSchema` is included; its public type is exported as `ResourceTemplateType`
1713
+ * (the bare name collides with the server package's `ResourceTemplate` class), so
1714
+ * `SpecTypes['ResourceTemplate']` is structurally equal to `ResourceTemplateType` rather than to
1715
+ * a type literally named `ResourceTemplate`.
1716
+ */
1717
+ declare const SPEC_SCHEMA_KEYS: readonly ["AnnotationsSchema", "AudioContentSchema", "BaseMetadataSchema", "BlobResourceContentsSchema", "BooleanSchemaSchema", "CallToolRequestSchema", "CallToolRequestParamsSchema", "CallToolResultSchema", "CancelledNotificationSchema", "CancelledNotificationParamsSchema", "CancelTaskRequestSchema", "CancelTaskResultSchema", "ClientCapabilitiesSchema", "ClientNotificationSchema", "ClientRequestSchema", "ClientResultSchema", "CompatibilityCallToolResultSchema", "CompleteRequestSchema", "CompleteRequestParamsSchema", "CompleteResultSchema", "ContentBlockSchema", "CreateMessageRequestSchema", "CreateMessageRequestParamsSchema", "CreateMessageResultSchema", "CreateMessageResultWithToolsSchema", "CreateTaskResultSchema", "CursorSchema", "DiscoverRequestSchema", "DiscoverResultSchema", "ElicitationCompleteNotificationSchema", "ElicitationCompleteNotificationParamsSchema", "ElicitRequestSchema", "ElicitRequestFormParamsSchema", "ElicitRequestParamsSchema", "ElicitRequestURLParamsSchema", "ElicitResultSchema", "EmbeddedResourceSchema", "EmptyResultSchema", "EnumSchemaSchema", "GetPromptRequestSchema", "GetPromptRequestParamsSchema", "GetPromptResultSchema", "GetTaskPayloadRequestSchema", "GetTaskPayloadResultSchema", "GetTaskRequestSchema", "GetTaskResultSchema", "IconSchema", "IconsSchema", "ImageContentSchema", "ImplementationSchema", "InitializedNotificationSchema", "InitializeRequestSchema", "InitializeRequestParamsSchema", "InitializeResultSchema", "JSONArraySchema", "JSONObjectSchema", "JSONRPCErrorResponseSchema", "JSONRPCMessageSchema", "JSONRPCNotificationSchema", "JSONRPCRequestSchema", "JSONRPCResponseSchema", "JSONRPCResultResponseSchema", "JSONValueSchema", "LegacyTitledEnumSchemaSchema", "ListPromptsRequestSchema", "ListPromptsResultSchema", "ListResourcesRequestSchema", "ListResourcesResultSchema", "ListResourceTemplatesRequestSchema", "ListResourceTemplatesResultSchema", "ListRootsRequestSchema", "ListRootsResultSchema", "ListTasksRequestSchema", "ListTasksResultSchema", "ListToolsRequestSchema", "ListToolsResultSchema", "LoggingLevelSchema", "LoggingMessageNotificationSchema", "LoggingMessageNotificationParamsSchema", "ModelHintSchema", "ModelPreferencesSchema", "MultiSelectEnumSchemaSchema", "NotificationSchema", "NumberSchemaSchema", "PaginatedRequestSchema", "PaginatedRequestParamsSchema", "PaginatedResultSchema", "PingRequestSchema", "PrimitiveSchemaDefinitionSchema", "ProgressSchema", "ProgressNotificationSchema", "ProgressNotificationParamsSchema", "ProgressTokenSchema", "PromptSchema", "PromptArgumentSchema", "PromptListChangedNotificationSchema", "PromptMessageSchema", "PromptReferenceSchema", "ReadResourceRequestSchema", "ReadResourceRequestParamsSchema", "ReadResourceResultSchema", "RelatedTaskMetadataSchema", "RequestSchema", "RequestIdSchema", "RequestMetaSchema", "ResourceSchema", "ResourceContentsSchema", "ResourceLinkSchema", "ResourceListChangedNotificationSchema", "ResourceRequestParamsSchema", "ResourceTemplateSchema", "ResourceTemplateReferenceSchema", "ResourceUpdatedNotificationSchema", "ResourceUpdatedNotificationParamsSchema", "ResultMetaObjectSchema", "ResultSchema", "RoleSchema", "RootSchema", "RootsListChangedNotificationSchema", "SamplingContentSchema", "SamplingMessageSchema", "SamplingMessageContentBlockSchema", "ServerCapabilitiesSchema", "ServerNotificationSchema", "ServerRequestSchema", "ServerResultSchema", "SetLevelRequestSchema", "SetLevelRequestParamsSchema", "SingleSelectEnumSchemaSchema", "StringSchemaSchema", "SubscribeRequestSchema", "SubscribeRequestParamsSchema", "SubscriptionFilterSchema", "SubscriptionsAcknowledgedNotificationSchema", "SubscriptionsAcknowledgedNotificationParamsSchema", "SubscriptionsListenRequestSchema", "SubscriptionsListenRequestParamsSchema", "SubscriptionsListenResultSchema", "SubscriptionsListenResultMetaSchema", "TaskAugmentedRequestParamsSchema", "TaskCreationParamsSchema", "TaskMetadataSchema", "TaskSchema", "TaskStatusSchema", "TaskStatusNotificationSchema", "TaskStatusNotificationParamsSchema", "TextContentSchema", "TextResourceContentsSchema", "TitledMultiSelectEnumSchemaSchema", "TitledSingleSelectEnumSchemaSchema", "ToolSchema", "ToolAnnotationsSchema", "ToolChoiceSchema", "ToolExecutionSchema", "ToolListChangedNotificationSchema", "ToolResultContentSchema", "ToolUseContentSchema", "UnsubscribeRequestSchema", "UnsubscribeRequestParamsSchema", "UntitledMultiSelectEnumSchemaSchema", "UntitledSingleSelectEnumSchemaSchema"];
1718
+ declare const authSchemas: {
1719
+ readonly IdJagTokenExchangeResponseSchema: any;
1720
+ readonly OAuthClientInformationFullSchema: any;
1721
+ readonly OAuthClientInformationSchema: any;
1722
+ readonly OAuthClientMetadataSchema: any;
1723
+ readonly OAuthClientRegistrationErrorSchema: any;
1724
+ readonly OAuthErrorResponseSchema: any;
1725
+ readonly OAuthMetadataSchema: any;
1726
+ readonly OAuthProtectedResourceMetadataSchema: any;
1727
+ readonly OAuthTokenRevocationRequestSchema: any;
1728
+ readonly OAuthTokensSchema: any;
1729
+ readonly OpenIdProviderDiscoveryMetadataSchema: any;
1730
+ readonly OpenIdProviderMetadataSchema: any;
1731
+ };
1732
+ type ProtocolSchemaKey = (typeof SPEC_SCHEMA_KEYS)[number];
1733
+ type AuthSchemaKey = keyof typeof authSchemas;
1734
+ type SchemaKey = ProtocolSchemaKey | AuthSchemaKey;
1735
+ type SchemaFor<K$1 extends SchemaKey> = K$1 extends ProtocolSchemaKey ? (typeof schemas_d_exports)[K$1] : K$1 extends AuthSchemaKey ? (typeof authSchemas)[K$1] : never;
1736
+ type StripSchemaSuffix<K$1> = K$1 extends `${infer N}Schema` ? N : never;
1737
+ /**
1738
+ * Union of every named type in the SDK's protocol and OAuth schemas (e.g. `'CallToolResult'`,
1739
+ * `'ContentBlock'`, `'Tool'`, `'OAuthTokens'`). Derived from the internal Zod schemas, so it stays
1740
+ * in sync with the spec.
1741
+ */
1742
+ type SpecTypeName = StripSchemaSuffix<SchemaKey>;
1743
+ /**
1744
+ * Maps each {@linkcode SpecTypeName} to its TypeScript type.
1745
+ *
1746
+ * `SpecTypes['Tool']` is equivalent to importing the `Tool` type directly.
1747
+ * These validators cover the NEUTRAL model — the consumer-facing shapes with
1748
+ * no wire-only members (`resultType`, the reserved `_meta` envelope keys).
1749
+ * Per-revision WIRE validators are deliberately not public surface; they are
1750
+ * planned to return as versioned `zod-schemas/<revision>` exports for
1751
+ * consumers who validate raw wire traffic themselves.
1752
+ */
1753
+ type SpecTypes = { [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.output<SchemaFor<K>> : never };
1754
+ /**
1755
+ * Input shape for each {@linkcode SpecTypeName}. For most types this equals {@linkcode SpecTypes},
1756
+ * but a few schemas apply defaults/preprocessing, so the accepted input may be looser than the
1757
+ * resulting output type.
1758
+ */
1759
+ type SpecTypeInputs = { [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.input<SchemaFor<K>> : never };
1760
+ type SchemaRecord = { readonly [K in SpecTypeName]: StandardSchemaV1Sync<SpecTypeInputs[K], SpecTypes[K]> };
1761
+ type GuardRecord = { readonly [K in SpecTypeName]: (value: unknown) => value is SpecTypeInputs[K] };
1762
+ /**
1763
+ * Runtime validators for every MCP spec type, keyed by type name.
1764
+ *
1765
+ * Use this when you need to validate a spec-defined shape at a boundary the SDK does not own, for
1766
+ * example an extension's custom-method payload that embeds a `CallToolResult`, or a value read from
1767
+ * storage that should be a `Tool`.
1768
+ *
1769
+ * Each entry implements the Standard Schema interface, so it composes with any
1770
+ * Standard-Schema-aware library. For a simple boolean check, use {@linkcode isSpecType} instead.
1771
+ *
1772
+ * @example
1773
+ * ```ts source="./specTypeSchema.examples.ts#specTypeSchemas_basicUsage"
1774
+ * const result = specTypeSchemas.CallToolResult['~standard'].validate(untrusted);
1775
+ * if (result.issues === undefined) {
1776
+ * // result.value is CallToolResult
1777
+ * }
1778
+ * ```
1779
+ */
1780
+ declare const specTypeSchemas: SchemaRecord;
1781
+ /**
1782
+ * Type predicates for every MCP spec type, keyed by type name.
1783
+ *
1784
+ * Returns `true` if the value satisfies the schema's input type (`z.input<>`, before defaults and
1785
+ * transforms are applied), and narrows to that input type. For schemas with `.default()` or
1786
+ * `.preprocess()`, this may accept values that do not structurally match the named output type;
1787
+ * for example `isSpecType.CallToolResult({})` is `true` because `content` has a default. Use
1788
+ * `specTypeSchemas.X['~standard'].validate(value)` when you need the validated output value.
1789
+ *
1790
+ * Each guard is a standalone function, so it can be passed directly as a callback.
1791
+ *
1792
+ * @example
1793
+ * ```ts source="./specTypeSchema.examples.ts#isSpecType_basicUsage"
1794
+ * if (isSpecType.ContentBlock(value)) {
1795
+ * // value is ContentBlock
1796
+ * }
1797
+ *
1798
+ * const blocks = mixed.filter(isSpecType.ContentBlock);
1799
+ * ```
1800
+ */
1801
+ declare const isSpecType: GuardRecord;
1802
+ //#endregion
1803
+ //#region ../core-internal/src/shared/transport.d.ts
1804
+ type FetchLike = (url: string | URL, init?: RequestInit) => Promise<Response>;
1805
+ /**
1806
+ * Creates a fetch function that includes base `RequestInit` options.
1807
+ * This ensures requests inherit settings like credentials, mode, headers, etc. from the base init.
1808
+ *
1809
+ * @param baseFetch - The base fetch function to wrap (defaults to global `fetch`)
1810
+ * @param baseInit - The base `RequestInit` to merge with each request
1811
+ * @returns A wrapped fetch function that merges base options with call-specific options
1812
+ */
1813
+ declare function createFetchWithInit(baseFetch?: FetchLike, baseInit?: RequestInit): FetchLike;
1814
+ /**
1815
+ * Options for sending a JSON-RPC message.
1816
+ */
1817
+ type TransportSendOptions = {
1818
+ /**
1819
+ * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
1820
+ */
1821
+ relatedRequestId?: RequestId | undefined;
1822
+ /**
1823
+ * The resumption token used to continue long-running requests that were interrupted.
1824
+ *
1825
+ * This allows clients to reconnect and continue from where they left off, if supported by the transport.
1826
+ */
1827
+ resumptionToken?: string | undefined;
1828
+ /**
1829
+ * A callback that is invoked when the resumption token changes, if supported by the transport.
1830
+ *
1831
+ * This allows clients to persist the latest token for potential reconnection.
1832
+ */
1833
+ onresumptiontoken?: ((token: string) => void) | undefined;
1834
+ /**
1835
+ * An abort signal for THIS outbound message's underlying request, when the
1836
+ * transport sends one outbound message per underlying request (the
1837
+ * Streamable HTTP transport's POST-per-request model). Aborting it cancels
1838
+ * the underlying request (and its SSE response stream) without closing the
1839
+ * transport. Transports that share a single channel (stdio, in-memory)
1840
+ * ignore it.
1841
+ */
1842
+ requestSignal?: AbortSignal | undefined;
1843
+ /**
1844
+ * Fired by transports that open a per-request stream (the Streamable HTTP
1845
+ * transport's POST-per-request SSE response) when that stream ends or
1846
+ * errors for any reason OTHER than a deliberate `requestSignal` abort —
1847
+ * i.e. the server closed the stream, the network dropped it, or
1848
+ * reconnection was exhausted. Transports that share a single channel
1849
+ * (stdio, in-memory) ignore it.
1850
+ */
1851
+ onRequestStreamEnd?: (() => void) | undefined;
1852
+ /**
1853
+ * Additional HTTP headers to send with THIS outbound message, when the
1854
+ * transport sends one outbound message per underlying HTTP request (the
1855
+ * Streamable HTTP transport's POST-per-request model). Transports that
1856
+ * share a single channel (stdio, in-memory) ignore it.
1857
+ *
1858
+ * The Client uses this to attach SEP-2243 `Mcp-Param-{Name}` headers to a
1859
+ * `tools/call` request on a 2026-07-28 connection. Values are sent
1860
+ * verbatim — encode anything that is not a safe RFC 9110 field value
1861
+ * before passing it here.
1862
+ */
1863
+ headers?: Readonly<Record<string, string>> | undefined;
1864
+ };
1865
+ /**
1866
+ * Describes the minimal contract for an MCP transport that a client or server can communicate over.
1867
+ */
1868
+ interface Transport {
1869
+ /**
1870
+ * Starts processing messages on the transport, including any connection steps that might need to be taken.
1871
+ *
1872
+ * This method should only be called after callbacks are installed, or else messages may be lost.
1873
+ *
1874
+ * NOTE: This method should not be called explicitly when using {@linkcode @modelcontextprotocol/client!client/client.Client | Client} or {@linkcode @modelcontextprotocol/server!server/server.Server | Server} classes, as they will implicitly call {@linkcode Transport.start | start()}.
1875
+ */
1876
+ start(): Promise<void>;
1877
+ /**
1878
+ * Sends a JSON-RPC message (request or response).
1879
+ *
1880
+ * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
1881
+ */
1882
+ send(message: JSONRPCMessage, options?: TransportSendOptions): Promise<void>;
1883
+ /**
1884
+ * Closes the connection.
1885
+ */
1886
+ close(): Promise<void>;
1887
+ /**
1888
+ * `true` when this transport opens one underlying request per outbound
1889
+ * JSON-RPC request (the Streamable HTTP POST-per-request model) and
1890
+ * therefore honors {@linkcode TransportSendOptions.requestSignal}. The
1891
+ * 2026-07-28 spec makes closing that per-request stream the cancellation
1892
+ * signal — the protocol layer aborts `requestSignal` instead of POSTing
1893
+ * `notifications/cancelled` when this flag is set on a 2026-era
1894
+ * connection. Transports that share a single channel (stdio, in-memory)
1895
+ * leave it `undefined`.
1896
+ */
1897
+ readonly hasPerRequestStream?: boolean;
1898
+ /**
1899
+ * Callback for when the connection is closed for any reason.
1900
+ *
1901
+ * This should be invoked when {@linkcode Transport.close | close()} is called as well.
1902
+ */
1903
+ onclose?: (() => void) | undefined;
1904
+ /**
1905
+ * Callback for when an error occurs.
1906
+ *
1907
+ * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
1908
+ */
1909
+ onerror?: ((error: Error) => void) | undefined;
1910
+ /**
1911
+ * Callback for when a message (request or response) is received over the connection.
1912
+ *
1913
+ * Includes the {@linkcode MessageExtraInfo.request | request} and {@linkcode MessageExtraInfo.authInfo | authInfo} if the transport is authenticated.
1914
+ *
1915
+ * The {@linkcode MessageExtraInfo.request | request} can be used to get the original request information (headers, etc.)
1916
+ */
1917
+ onmessage?: (<T$1 extends JSONRPCMessage>(message: T$1, extra?: MessageExtraInfo) => void) | undefined;
1918
+ /**
1919
+ * The session ID generated for this connection.
1920
+ */
1921
+ sessionId?: string | undefined;
1922
+ /**
1923
+ * Sets the protocol version used for the connection (called when the initialize response is received).
1924
+ */
1925
+ setProtocolVersion?: ((version: string) => void) | undefined;
1926
+ /**
1927
+ * Sets the supported protocol versions for header validation (called during connect).
1928
+ * This allows the server to pass its supported versions to the transport.
1929
+ */
1930
+ setSupportedProtocolVersions?: ((versions: string[]) => void) | undefined;
1931
+ }
1932
+ //#endregion
1933
+ //#region ../core-internal/src/shared/protocol.d.ts
1934
+ /**
1935
+ * Callback for progress notifications.
1936
+ */
1937
+ type ProgressCallback = (progress: Progress) => void;
1938
+ /**
1939
+ * Additional initialization options.
1940
+ */
1941
+ type ProtocolOptions = {
1942
+ /**
1943
+ * Protocol versions supported. The legacy `initialize` handshake offers and
1944
+ * falls back to the first 2025-era entry in the list (the client sends it,
1945
+ * the server counter-offers it); 2026-era entries are only ever selected via
1946
+ * `server/discover`. Passed to transport during {@linkcode Protocol.connect | connect()}.
1947
+ *
1948
+ * @default {@linkcode SUPPORTED_PROTOCOL_VERSIONS}
1949
+ */
1950
+ supportedProtocolVersions?: string[];
1951
+ /**
1952
+ * Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities.
1953
+ *
1954
+ * Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those.
1955
+ *
1956
+ * Currently this defaults to `false`, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to `true`.
1957
+ */
1958
+ enforceStrictCapabilities?: boolean;
1959
+ /**
1960
+ * An array of notification method names that should be automatically debounced.
1961
+ * Any notifications with a method in this list will be coalesced if they
1962
+ * occur in the same tick of the event loop.
1963
+ * e.g., `['notifications/tools/list_changed']`
1964
+ */
1965
+ debouncedNotificationMethods?: string[];
1966
+ };
1967
+ /**
1968
+ * The default request timeout, in milliseconds.
1969
+ */
1970
+ declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
1971
+ /**
1972
+ * Options that can be given per request.
1973
+ */
1974
+ type RequestOptions = {
1975
+ /**
1976
+ * If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked.
1977
+ */
1978
+ onprogress?: ProgressCallback;
1979
+ /**
1980
+ * Can be used to cancel an in-flight request. This will cause an `AbortError` to be raised from {@linkcode Protocol.request | request()}.
1981
+ */
1982
+ signal?: AbortSignal;
1983
+ /**
1984
+ * A timeout (in milliseconds) for this request. If exceeded, an {@linkcode SdkError} with code {@linkcode SdkErrorCode.RequestTimeout} will be raised from {@linkcode Protocol.request | request()}.
1985
+ *
1986
+ * If not specified, {@linkcode DEFAULT_REQUEST_TIMEOUT_MSEC} will be used as the timeout.
1987
+ */
1988
+ timeout?: number;
1989
+ /**
1990
+ * If `true`, receiving a progress notification will reset the request timeout.
1991
+ * This is useful for long-running operations that send periodic progress updates.
1992
+ * Default: `false`
1993
+ */
1994
+ resetTimeoutOnProgress?: boolean;
1995
+ /**
1996
+ * Maximum total time (in milliseconds) to wait for a response.
1997
+ * If exceeded, an {@linkcode SdkError} with code {@linkcode SdkErrorCode.RequestTimeout} will be raised, regardless of progress notifications.
1998
+ * If not specified, there is no maximum total timeout.
1999
+ *
2000
+ * For multi-round-trip requests fulfilled by the auto-fulfilment driver
2001
+ * (protocol revision 2026-07-28), the budget bounds the WHOLE flow: every
2002
+ * retry leg is given only the time remaining.
2003
+ */
2004
+ maxTotalTimeout?: number;
2005
+ /**
2006
+ * Manual multi-round-trip mode for this call (protocol revision
2007
+ * 2026-07-28): when the response is an `input_required` result, hand it
2008
+ * back to the caller instead of auto-fulfilling it (or raising a typed
2009
+ * error). The resolved value is the neutral input-required shape
2010
+ * (`resultType: 'input_required'`, `inputRequests?`, `requestState?`);
2011
+ * wrap the result schema with `withInputRequired()` on the explicit
2012
+ * schema path to type both outcomes. The caller is then responsible for
2013
+ * gathering the requested input and retrying the original request with
2014
+ * `inputResponses` / `requestState` params and a fresh request.
2015
+ *
2016
+ * Default: `false`.
2017
+ */
2018
+ allowInputRequired?: boolean;
2019
+ } & TransportSendOptions;
2020
+ /**
2021
+ * Flow context handed to {@linkcode Protocol._resolveNonCompleteResult}: the
2022
+ * originating request, its options, the wire codec that decoded the response,
2023
+ * the timestamp the originating leg was issued at (for whole-flow timeout
2024
+ * accounting), and a `retry` closure that re-enters the request funnel with
2025
+ * fresh params on a fresh request id.
2026
+ */
2027
+ interface NonCompleteResultFlow<T$1 extends StandardSchemaV1 = StandardSchemaV1> {
2028
+ codec: WireCodec;
2029
+ request: Request$1;
2030
+ resultSchema: T$1;
2031
+ options: RequestOptions | undefined;
2032
+ flowStartedAt: number;
2033
+ /** Re-issue the originating request with the given params and per-leg options. */
2034
+ retry(params: Record<string, unknown> | undefined, legOptions: RequestOptions): Promise<unknown>;
2035
+ }
2036
+ /**
2037
+ * Options that can be given per notification.
2038
+ */
2039
+ type NotificationOptions = {
2040
+ /**
2041
+ * May be used to indicate to the transport which incoming request to associate this outgoing notification with.
2042
+ */
2043
+ relatedRequestId?: RequestId;
2044
+ };
2045
+ /**
2046
+ * The type of `ctx.mcpReq.requestState`. The type parameter is
2047
+ * caller-asserted (no validation, like the two-argument `acceptedContent<T>`)
2048
+ * — pair with `createRequestStateCodec<T>` so the claim is backed by the
2049
+ * codec's verification.
2050
+ */
2051
+ type RequestStateAccessor = <T$1 = unknown>() => T$1 | undefined;
2052
+ /**
2053
+ * Base context provided to all request handlers.
2054
+ */
2055
+ type BaseContext = {
2056
+ /**
2057
+ * The session ID from the transport, if available.
2058
+ */
2059
+ sessionId?: string;
2060
+ /**
2061
+ * Information about the MCP request being handled.
2062
+ */
2063
+ mcpReq: {
2064
+ /**
2065
+ * The JSON-RPC ID of the request being handled.
2066
+ */
2067
+ id: RequestId;
2068
+ /**
2069
+ * The method name of the request (e.g., 'tools/call', 'ping').
2070
+ */
2071
+ method: string;
2072
+ /**
2073
+ * Metadata from the original request, with the reserved
2074
+ * `io.modelcontextprotocol/*` envelope keys already lifted out
2075
+ * (readable via `ctx.mcpReq.envelope`).
2076
+ */
2077
+ _meta?: RequestMeta;
2078
+ /**
2079
+ * The per-request `_meta` envelope (protocol revision 2026-07-28):
2080
+ * the reserved `io.modelcontextprotocol/*` keys carried by the
2081
+ * request, lifted out of the `_meta` the handler sees. Surfaced as
2082
+ * received — `Partial` because only the keys the request actually
2083
+ * carried are present (envelope requiredness is enforced per request
2084
+ * at dispatch time, not by the lift); only present at all when the
2085
+ * request carried envelope keys.
2086
+ */
2087
+ envelope?: Partial<RequestMetaEnvelope>;
2088
+ /**
2089
+ * Multi-round-trip input responses carried by a retried request
2090
+ * (protocol revision 2026-07-28), lifted out of the params the
2091
+ * handler sees. Entries are the BARE response objects keyed by the
2092
+ * identifiers the server assigned in `inputRequests`; entries that do
2093
+ * not look like bare responses (e.g. a `{method, result}` wrapper)
2094
+ * are dropped and their keys recorded in `droppedInputResponseKeys`.
2095
+ *
2096
+ * The values arrive from the client and are NOT validated by the SDK
2097
+ * — treat them as untrusted input.
2098
+ */
2099
+ inputResponses?: Record<string, unknown>;
2100
+ /**
2101
+ * Keys of `inputResponses` entries the SDK dropped because they were
2102
+ * not bare response objects (for example the wrapped `{method,
2103
+ * result}` shape some peers emit). Surfaced so a handler can re-issue
2104
+ * the corresponding input request rather than hard-fail.
2105
+ */
2106
+ droppedInputResponseKeys?: string[];
2107
+ /**
2108
+ * Reads the multi-round-trip request state for the current round:
2109
+ * the value the configured `ServerOptions.requestState.verify` hook
2110
+ * resolved with (e.g. `createRequestStateCodec.verify`'s decoded
2111
+ * payload — `mint<T>`/`requestState<T>()` are the typed pair), the
2112
+ * raw wire string when no hook is configured, or `undefined` when
2113
+ * the round carried no state. The type parameter is a compile-time
2114
+ * cast only.
2115
+ *
2116
+ * SECURITY: `requestState` round-trips through the client and MUST
2117
+ * be treated as attacker-controlled input. The SDK applies no
2118
+ * integrity protection by default — servers whose state influences
2119
+ * authorization or business logic MUST integrity-protect it and
2120
+ * verify via the `requestState.verify` hook (spec:
2121
+ * basic/patterns/mrtr, server requirements 4–5).
2122
+ */
2123
+ requestState: RequestStateAccessor;
2124
+ /**
2125
+ * An abort signal used to communicate if the request was cancelled from the sender's side.
2126
+ */
2127
+ signal: AbortSignal;
2128
+ /**
2129
+ * Sends a request that relates to the current request being handled.
2130
+ *
2131
+ * This is used by certain transports to correctly associate related messages.
2132
+ *
2133
+ * For spec methods the result type is inferred from the method name.
2134
+ * For custom (non-spec) methods, pass a result schema as the second argument.
2135
+ */
2136
+ send: {
2137
+ <M$1 extends RequestMethod>(request: {
2138
+ method: M$1;
2139
+ params?: Record<string, unknown>;
2140
+ }, options?: RequestOptions): Promise<ResultTypeMap[M$1]>;
2141
+ <T$1 extends StandardSchemaV1>(request: Request$1, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
2142
+ };
2143
+ /**
2144
+ * Sends a notification that relates to the current request being handled.
2145
+ *
2146
+ * This is used by certain transports to correctly associate related messages.
2147
+ */
2148
+ notify: (notification: Notification) => Promise<void>;
2149
+ };
2150
+ /**
2151
+ * HTTP transport information, only available when using an HTTP-based transport.
2152
+ */
2153
+ http?: {
2154
+ /**
2155
+ * Information about a validated access token, provided to request handlers.
2156
+ */
2157
+ authInfo?: AuthInfo;
2158
+ };
2159
+ };
2160
+ /**
2161
+ * Context provided to server-side request handlers, extending {@linkcode BaseContext} with server-specific fields.
2162
+ */
2163
+ type ServerContext = BaseContext & {
2164
+ mcpReq: {
2165
+ /**
2166
+ * Send a log message notification to the client.
2167
+ * Respects the client's log level filter set via logging/setLevel.
2168
+ *
2169
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
2170
+ * Remains functional during the deprecation window (at least twelve months).
2171
+ * Migrate to stderr logging (STDIO servers) or OpenTelemetry.
2172
+ */
2173
+ log: (level: LoggingLevel, data: unknown, logger?: string) => Promise<void>;
2174
+ /**
2175
+ * Send an elicitation request to the client, requesting user input.
2176
+ *
2177
+ * @deprecated Throws on a 2026-07-28-era request — return `inputRequired(...)`
2178
+ * (multi-round-trip) from the handler instead. The 2025 push-style server-to-client request model is
2179
+ * replaced by input_required results in the 2026-07-28 protocol. If your factory serves
2180
+ * both eras, this only works on the legacy path.
2181
+ */
2182
+ elicitInput: (params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions) => Promise<ElicitResult>;
2183
+ /**
2184
+ * Request LLM sampling from the client.
2185
+ *
2186
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
2187
+ * Throws on a 2026-07-28-era request — return `inputRequired(...)` (multi-round-trip)
2188
+ * from the handler instead, or migrate to calling LLM provider APIs directly. The 2025 push-style
2189
+ * server-to-client request model is replaced by input_required results in the 2026-07-28
2190
+ * protocol. If your factory serves both eras, this only works on the legacy path.
2191
+ */
2192
+ requestSampling: (params: CreateMessageRequest['params'], options?: RequestOptions) => Promise<CreateMessageResult | CreateMessageResultWithTools>;
2193
+ };
2194
+ http?: {
2195
+ /**
2196
+ * The original HTTP request.
2197
+ */
2198
+ req?: globalThis.Request;
2199
+ /**
2200
+ * Closes the SSE stream for this request, triggering client reconnection.
2201
+ * Only available when using a StreamableHTTPServerTransport with eventStore configured.
2202
+ */
2203
+ closeSSE?: () => void;
2204
+ /**
2205
+ * Closes the standalone GET SSE stream, triggering client reconnection.
2206
+ * Only available when using a StreamableHTTPServerTransport with eventStore configured.
2207
+ */
2208
+ closeStandaloneSSE?: () => void;
2209
+ };
2210
+ };
2211
+ /**
2212
+ * Context provided to client-side request handlers.
2213
+ */
2214
+ type ClientContext = BaseContext;
2215
+ /**
2216
+ * Implements MCP protocol framing on top of a pluggable transport, including
2217
+ * features like request/response linking, notifications, and progress.
2218
+ *
2219
+ * `Protocol` is abstract; `Client` and `Server` are the concrete role-specific
2220
+ * implementations most code should use.
2221
+ */
2222
+ declare abstract class Protocol<ContextT extends BaseContext> {
2223
+ private _options?;
2224
+ private _transport?;
2225
+ private _requestMessageId;
2226
+ private _requestHandlers;
2227
+ private _requestHandlerAbortControllers;
2228
+ private _notificationHandlers;
2229
+ private _responseHandlers;
2230
+ private _progressHandlers;
2231
+ private _timeoutInfo;
2232
+ private _pendingDebouncedNotifications;
2233
+ /**
2234
+ * The protocol version negotiated for the current connection (`undefined`
2235
+ * before negotiation completes), which determines the wire era this
2236
+ * instance speaks. Set by the SDK's negotiation and initialize paths
2237
+ * (`Client.connect`, `Server._oninitialize`).
2238
+ */
2239
+ protected _negotiatedProtocolVersion?: string;
2240
+ protected _supportedProtocolVersions: string[];
2241
+ /**
2242
+ * Callback for when the connection is closed for any reason.
2243
+ *
2244
+ * This is invoked when {@linkcode Protocol.close | close()} is called as well.
2245
+ */
2246
+ onclose?: () => void;
2247
+ /**
2248
+ * Callback for when an error occurs.
2249
+ *
2250
+ * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
2251
+ */
2252
+ onerror?: (error: Error) => void;
2253
+ /**
2254
+ * A handler to invoke for any request types that do not have their own handler installed.
2255
+ */
2256
+ fallbackRequestHandler?: (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>;
2257
+ /**
2258
+ * A handler to invoke for any notification types that do not have their own handler installed.
2259
+ */
2260
+ fallbackNotificationHandler?: (notification: Notification) => Promise<void>;
2261
+ constructor(_options?: ProtocolOptions | undefined);
2262
+ /**
2263
+ * Builds the context object for request handlers. Subclasses must override
2264
+ * to return the appropriate context type (e.g., ServerContext adds HTTP request info).
2265
+ */
2266
+ protected abstract buildContext(ctx: BaseContext, transportInfo?: MessageExtraInfo): ContextT;
2267
+ /**
2268
+ * Drop consult for inbound messages whose transport did not classify them
2269
+ * at the edge — long-lived channels such as stdio, where a role class may
2270
+ * need to decline traffic the negotiated era has no answer for (the
2271
+ * client-side inbound-request drop on modern-era connections: the
2272
+ * 2026-07-28 era has no server→client request channel, and on stdio the
2273
+ * client must never write JSON-RPC responses).
2274
+ *
2275
+ * Consulted ONLY when the transport supplied no
2276
+ * {@linkcode MessageExtraInfo.classification}: edge-classified traffic
2277
+ * never reaches the hook. Returning `'drop'` discards the message without
2278
+ * writing any response (requests are surfaced via `onerror`). The base
2279
+ * implementation returns `undefined`: unclassified traffic keeps today's
2280
+ * dispatch path unchanged. Era selection never happens here — era is
2281
+ * instance state, owned by the serving entry that constructed and
2282
+ * connected the instance.
2283
+ */
2284
+ protected _shouldDropInbound(_message: JSONRPCRequest | JSONRPCNotification): 'drop' | undefined;
2285
+ /**
2286
+ * The per-request `_meta` envelope this instance attaches to every outgoing
2287
+ * request and notification, when one applies. The base implementation
2288
+ * returns `undefined` (no envelope — the 2025-era posture, so legacy-era
2289
+ * outbound traffic is byte-identical to a build without this seam).
2290
+ * `Client` overrides it on a connection that negotiated a modern (2026-07-28+)
2291
+ * era to return the reserved protocol-version / client-info /
2292
+ * client-capabilities keys. User-supplied `_meta` keys take precedence over
2293
+ * the auto-attached ones.
2294
+ */
2295
+ protected _outboundMetaEnvelope(): Readonly<Record<string, unknown>> | undefined;
2296
+ /**
2297
+ * Attach this instance's outbound `_meta` envelope (when one is configured)
2298
+ * to a request or notification. A no-op when the seam returns `undefined`
2299
+ * — the message returns by reference, so the legacy-era wire stays
2300
+ * byte-identical. User-supplied `_meta` keys are spread last so they win
2301
+ * over the auto-attached envelope keys.
2302
+ */
2303
+ private _envelopeOutbound;
2304
+ /**
2305
+ * Extension point for non-`complete` decoded results in the response
2306
+ * funnel: a result the wire codec discriminated into a kind other than
2307
+ * `'complete'` or `'invalid'` is handed here for the role class to
2308
+ * resolve. The base default surfaces it as a typed
2309
+ * {@linkcode SdkErrorCode.UnsupportedResultType} error (no retry).
2310
+ *
2311
+ * Intended consumers (named so the seam stays accountable):
2312
+ * - the `Client`'s multi-round-trip auto-fulfilment engine, which fulfils
2313
+ * `'input_required'` results through the registered
2314
+ * elicitation/sampling/roots handlers and retries via `flow.retry`;
2315
+ * - a future client-side terminal-result handler for
2316
+ * `subscriptions/listen`, when the spec defines one.
2317
+ *
2318
+ * `Server` instances never receive `input_required` responses on their
2319
+ * outbound legs and leave the base behavior in place.
2320
+ */
2321
+ protected _resolveNonCompleteResult<T$1 extends StandardSchemaV1>(decoded: ReturnType<WireCodec['decodeResult']> & {
2322
+ kind: 'input_required';
2323
+ }, flow: NonCompleteResultFlow<T$1>): Promise<unknown>;
2324
+ /**
2325
+ * Protected accessor for a registered request handler. Used by role
2326
+ * classes that dispatch synthesized requests through the same stored
2327
+ * handler chain (e.g. the `Client` fulfilling an embedded multi-round-trip
2328
+ * input request).
2329
+ */
2330
+ protected _getRequestHandler(method: string): ((request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>) | undefined;
2331
+ private _oncancel;
2332
+ private _setupTimeout;
2333
+ private _resetTimeout;
2334
+ private _cleanupTimeout;
2335
+ /**
2336
+ * Attaches to the given transport, starts it, and starts listening for messages.
2337
+ *
2338
+ * The caller assumes ownership of the {@linkcode Transport}, replacing any callbacks that have already been set, and expects that it is the only user of the {@linkcode Transport} instance going forward.
2339
+ */
2340
+ connect(transport: Transport): Promise<void>;
2341
+ /**
2342
+ * Transport-close hook. Subclass overrides MUST call `super._onclose()`
2343
+ * after their own cleanup — base teardown (response-handler settlement,
2344
+ * timeout clearing, in-flight request abort) does not run otherwise.
2345
+ */
2346
+ protected _onclose(): void;
2347
+ private _onerror;
2348
+ /**
2349
+ * Inbound-notification dispatch. Subclass overrides MUST delegate
2350
+ * unmatched traffic to `super._onnotification(rawNotification, extra)` —
2351
+ * an override that consumes only what it owns and falls through to base
2352
+ * dispatch for everything else.
2353
+ */
2354
+ protected _onnotification(rawNotification: JSONRPCNotification, extra?: MessageExtraInfo): void;
2355
+ private _onrequest;
2356
+ private _onprogress;
2357
+ /**
2358
+ * Inbound-response dispatch. Subclass overrides MUST delegate unmatched
2359
+ * traffic to `super._onresponse(response)` — an override that consumes
2360
+ * only what it owns and falls through to base dispatch for everything
2361
+ * else.
2362
+ */
2363
+ protected _onresponse(response: JSONRPCResponse | JSONRPCErrorResponse): void;
2364
+ get transport(): Transport | undefined;
2365
+ /**
2366
+ * Closes the connection.
2367
+ */
2368
+ close(): Promise<void>;
2369
+ /**
2370
+ * A method to check if a capability is supported by the remote side, for the given method to be called.
2371
+ *
2372
+ * This should be implemented by subclasses.
2373
+ */
2374
+ protected abstract assertCapabilityForMethod(method: RequestMethod | string): void;
2375
+ /**
2376
+ * A method to check if a notification is supported by the local side, for the given method to be sent.
2377
+ *
2378
+ * This should be implemented by subclasses.
2379
+ */
2380
+ protected abstract assertNotificationCapability(method: NotificationMethod | string): void;
2381
+ /**
2382
+ * A method to check if a request handler is supported by the local side, for the given method to be handled.
2383
+ *
2384
+ * This should be implemented by subclasses.
2385
+ */
2386
+ protected abstract assertRequestHandlerCapability(method: string): void;
2387
+ /**
2388
+ * Sends a request and waits for a response.
2389
+ *
2390
+ * For spec methods the result schema is resolved automatically from the method name
2391
+ * and the return type is method-keyed. For custom (non-spec) methods, pass a
2392
+ * `resultSchema` as the second argument; the response is validated against it and
2393
+ * the return type is inferred from the schema.
2394
+ *
2395
+ * Do not use this method to emit notifications! Use {@linkcode Protocol.notification | notification()} instead.
2396
+ */
2397
+ request<M$1 extends RequestMethod>(request: {
2398
+ method: M$1;
2399
+ params?: Record<string, unknown>;
2400
+ }, options?: RequestOptions): Promise<ResultTypeMap[M$1]>;
2401
+ request<T$1 extends StandardSchemaV1>(request: Request$1, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
2402
+ /**
2403
+ * The wire codec for this instance's negotiated era — the phase-2 truth:
2404
+ * everything an established connection sends and receives resolves
2405
+ * through it. Legacy until a version has been negotiated.
2406
+ */
2407
+ private _negotiatedWireCodec;
2408
+ /**
2409
+ * Protected accessor for the instance's negotiated wire codec, for role
2410
+ * classes (Client/Server/McpServer) routing era-dependent behavior
2411
+ * through the codec's function-only surface — `samplingResultVariant`,
2412
+ * `outboundEnvelope`, `projectCallToolResult` — instead of branching on
2413
+ * the protocol version themselves.
2414
+ */
2415
+ protected _wireCodec(): WireCodec;
2416
+ /**
2417
+ * Outbound codec resolution: while the negotiated version is still unset
2418
+ * (the negotiation window), lifecycle messages are bootstrap-pinned BY
2419
+ * METHOD — they self-identify their era (`initialize` IS the legacy
2420
+ * handshake, `server/discover` IS the modern probe). Once a version has
2421
+ * been negotiated, the instance era is authoritative for everything — a
2422
+ * negotiated session never re-routes a method onto the other era.
2423
+ */
2424
+ private _resolveOutboundCodec;
2425
+ /**
2426
+ * Era gate for outbound requests — deletions are physical in BOTH
2427
+ * directions: sending a spec method that the resolved era does not define
2428
+ * dies locally with a typed error before anything reaches the transport.
2429
+ * Methods outside the spec universe are consumer-owned extension methods
2430
+ * and stay era-blind.
2431
+ */
2432
+ private _assertOutboundRequestInEra;
2433
+ /**
2434
+ * Sends a request and waits for a response, using the provided schema for
2435
+ * validation instead of the era registry's method-keyed entry.
2436
+ *
2437
+ * This is the internal implementation used by SDK methods whose result
2438
+ * schema cannot be expressed as a method-keyed registry entry — the one
2439
+ * surviving case is `server.createMessage`, whose result schema depends
2440
+ * on the REQUEST params (tools vs no tools) — and by callers passing
2441
+ * explicit compatibility schemas. Spec methods are still era-gated here:
2442
+ * an explicit schema never smuggles a deleted method onto the wire.
2443
+ */
2444
+ protected _requestWithSchema<T$1 extends StandardSchemaV1>(request: Request$1, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
2445
+ /**
2446
+ * The request funnel proper, keyed by the resolved era codec: the codec
2447
+ * owns result decoding (raw-first `resultType` discrimination — V-1 —
2448
+ * and the era's lift posture) before the schema validation step.
2449
+ */
2450
+ private _requestWithSchemaViaCodec;
2451
+ /**
2452
+ * Emits a notification, which is a one-way message that does not expect a response.
2453
+ */
2454
+ notification(notification: Notification, options?: NotificationOptions): Promise<void>;
2455
+ /**
2456
+ * The notification funnel proper, keyed by the resolved era codec —
2457
+ * direct sends and related notifications (`ctx.mcpReq.notify`) alike
2458
+ * resolve through the instance's negotiated era at send time.
2459
+ */
2460
+ private _notificationViaCodec;
2461
+ /**
2462
+ * Registers a handler to invoke when this protocol object receives a request with the given method.
2463
+ *
2464
+ * Note that this will replace any previous request handler for the same method.
2465
+ *
2466
+ * For spec methods, pass `(method, handler)`; the request is parsed with the spec
2467
+ * schema and the handler receives the typed `Request`. For custom (non-spec)
2468
+ * methods, pass `(method, schemas, handler)`; `params` are validated against
2469
+ * `schemas.params` and the handler receives the parsed params object directly.
2470
+ * Supplying `schemas.result` types the handler's return value.
2471
+ *
2472
+ * @example Custom request method
2473
+ * ```ts source="./protocol.examples.ts#Protocol_setRequestHandler_customMethod"
2474
+ * const SearchParams = z.object({ query: z.string(), limit: z.number().optional() });
2475
+ * const SearchResult = z.object({ hits: z.array(z.string()) });
2476
+ *
2477
+ * protocol.setRequestHandler('acme/search', { params: SearchParams, result: SearchResult }, async (params, _ctx) => {
2478
+ * return { hits: [`result for ${params.query}`] };
2479
+ * });
2480
+ * ```
2481
+ */
2482
+ setRequestHandler<M$1 extends RequestMethod>(method: M$1, handler: (request: RequestTypeMap[M$1], ctx: ContextT) => HandlerResultTypeMap[M$1] | Promise<HandlerResultTypeMap[M$1]>): void;
2483
+ setRequestHandler<P extends StandardSchemaV1, R extends StandardSchemaV1 | undefined = undefined>(method: string, schemas: {
2484
+ params: P;
2485
+ result?: R;
2486
+ }, handler: (params: StandardSchemaV1.InferOutput<P>, ctx: ContextT) => InferHandlerResult<R> | Promise<InferHandlerResult<R>>): void;
2487
+ /**
2488
+ * Hook for subclasses to wrap a registered request handler with role-specific
2489
+ * validation or behavior (e.g. `Server` validates `tools/call` results, `Client`
2490
+ * validates `elicitation/create` mode and result). Runs for both the 2-arg and
2491
+ * 3-arg registration paths. The default implementation is identity.
2492
+ *
2493
+ * Subclasses overriding this hook avoid redeclaring `setRequestHandler`'s overload set.
2494
+ */
2495
+ protected _wrapHandler(_method: string, handler: (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>): (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>;
2496
+ /**
2497
+ * Hook for subclasses to supply the implementation identity the 2026-era
2498
+ * encode seam stamps into outbound result `_meta` under
2499
+ * `io.modelcontextprotocol/serverInfo` (spec PR #3002: servers SHOULD
2500
+ * identify themselves on every response). The default is `undefined` — no
2501
+ * stamp. Only `Server` overrides this: the key identifies the software
2502
+ * producing a response, and the 2025-era codec never stamps anything
2503
+ * regardless (the never-stamp guarantee).
2504
+ */
2505
+ protected _outboundServerInfo(): Implementation | undefined;
2506
+ /**
2507
+ * Removes the request handler for the given method.
2508
+ */
2509
+ removeRequestHandler(method: RequestMethod | string): void;
2510
+ /**
2511
+ * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
2512
+ */
2513
+ assertCanSetRequestHandler(method: RequestMethod | string): void;
2514
+ /**
2515
+ * Registers a handler to invoke when this protocol object receives a notification with the given method.
2516
+ *
2517
+ * Note that this will replace any previous notification handler for the same method.
2518
+ *
2519
+ * For spec methods, pass `(method, handler)`; the notification is parsed with the
2520
+ * spec schema. For custom (non-spec) methods, pass `(method, schemas, handler)`;
2521
+ * `params` are validated against `schemas.params` and the handler receives the
2522
+ * parsed params object directly. The raw notification is passed as the second
2523
+ * argument; `_meta` is recoverable via `notification.params?._meta` (minus the
2524
+ * reserved `io.modelcontextprotocol/*` envelope keys, which the protocol layer
2525
+ * lifts out before dispatch).
2526
+ */
2527
+ setNotificationHandler<M$1 extends NotificationMethod>(method: M$1, handler: (notification: NotificationTypeMap[M$1]) => void | Promise<void>): void;
2528
+ setNotificationHandler<P extends StandardSchemaV1>(method: string, schemas: {
2529
+ params: P;
2530
+ }, handler: (params: StandardSchemaV1.InferOutput<P>, notification: Notification) => void | Promise<void>): void;
2531
+ /**
2532
+ * Removes the notification handler for the given method.
2533
+ */
2534
+ removeNotificationHandler(method: NotificationMethod | string): void;
2535
+ }
2536
+ /**
2537
+ * Schema bundle accepted by {@linkcode Protocol.setRequestHandler | setRequestHandler}'s 3-arg form.
2538
+ *
2539
+ * `params` is required and validates the inbound `request.params`. `result` is optional;
2540
+ * when supplied it types the handler's return value (no runtime validation is performed
2541
+ * on the result).
2542
+ */
2543
+ interface RequestHandlerSchemas<P extends StandardSchemaV1 = StandardSchemaV1, R extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> {
2544
+ params: P;
2545
+ result?: R;
2546
+ }
2547
+ type InferHandlerResult<R extends StandardSchemaV1 | undefined> = R extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<R> : Result$1;
2548
+ declare function mergeCapabilities(base: ServerCapabilities, additional: Partial<ServerCapabilities>): ServerCapabilities;
2549
+ declare function mergeCapabilities(base: ClientCapabilities, additional: Partial<ClientCapabilities>): ClientCapabilities;
2550
+ //#endregion
2551
+ //#region ../core-internal/src/shared/mediaType.d.ts
2552
+ /**
2553
+ * Whether a raw `Content-Type` header value denotes `application/json`.
2554
+ * Parameters (for example `charset=utf-8`) are allowed and ignored; malformed
2555
+ * parameter sections do not reject a header whose media type is unambiguously
2556
+ * `application/json` (see `mediaTypeEssence` for the exact grammar).
2557
+ */
2558
+ declare function isJsonContentType(header: string | null | undefined): boolean;
2559
+ //#endregion
2560
+ //#region ../core-internal/src/shared/metadataUtils.d.ts
2561
+ /**
2562
+ * Utilities for working with {@linkcode BaseMetadata} objects.
2563
+ */
2564
+ /**
2565
+ * Gets the display name for an object with {@linkcode BaseMetadata}.
2566
+ * For tools, the precedence is: `title` → {@linkcode index.ToolAnnotations | annotations}.`title` → `name`
2567
+ * For other objects: `title` → `name`
2568
+ * This implements the spec requirement: "if no title is provided, name should be used for display purposes"
2569
+ */
2570
+ declare function getDisplayName(metadata: BaseMetadata | (BaseMetadata & {
2571
+ annotations?: {
2572
+ title?: string;
2573
+ };
2574
+ })): string;
2575
+ //#endregion
2576
+ //#region ../core-internal/src/shared/protocolEras.d.ts
2577
+ /**
2578
+ * Protocol-era helpers (pure module). The MCP wire protocol splits into two eras:
2579
+ * legacy (the 2025-11-25 family and earlier; the version is negotiated via the
2580
+ * `initialize` handshake) and modern (2026-07-28 and later; no `initialize` —
2581
+ * servers advertise versions via `server/discover` and every request carries a
2582
+ * `_meta` envelope).
2583
+ *
2584
+ * An operation that belongs to one era must only ever consult that era's subset
2585
+ * of a supported-versions list: `initialize` never accepts or counter-offers a
2586
+ * modern revision, and the `server/discover` advertisement only ever contains
2587
+ * modern revisions.
2588
+ */
2589
+ /**
2590
+ * The protocol era of a connection: `'legacy'` for the 2025-11-25 family and
2591
+ * earlier (negotiated via `initialize`), `'modern'` for 2026-07-28 and later
2592
+ * (negotiated via `server/discover`; every request carries a `_meta` envelope).
2593
+ */
2594
+ type ProtocolEra = 'legacy' | 'modern';
2595
+ //#endregion
2596
+ //#region ../core-internal/src/shared/resultCacheHints.d.ts
2597
+ /**
2598
+ * Cache-hint plumbing for cacheable results (protocol revision 2026-07-28).
2599
+ *
2600
+ * The 2026-07-28 revision requires `ttlMs`/`cacheScope` on the cacheable
2601
+ * result types (SEP-2549 `CacheableResult`). The values are resolved at the
2602
+ * era-aware encode seam (the 2026 wire codec's `encodeResult`), most specific
2603
+ * author first:
2604
+ *
2605
+ * 1. fields the handler returned on the result itself (when valid),
2606
+ * 2. a configured cache hint attached by the server layer
2607
+ * (per-registration hint, then the server-level per-operation hint,
2608
+ * combined per field — see {@linkcode attachCacheHintFallback}),
2609
+ * 3. the conservative defaults `{ ttlMs: 0, cacheScope: 'private' }`.
2610
+ *
2611
+ * The configured hint travels from the (era-blind) server configuration to the
2612
+ * (era-aware) encode seam on a symbol-keyed property of the result object —
2613
+ * {@linkcode RESULT_CACHE_HINT_FALLBACK}. Symbol-keyed properties are never
2614
+ * serialized to JSON, so attaching a hint can never change what a 2025-era
2615
+ * response looks like on the wire: only the 2026-era codec reads (and removes)
2616
+ * it while filling the required fields. The 2025-era codec has no cache code
2617
+ * path at all.
2618
+ */
2619
+ /** The cache scopes defined for cacheable results (SEP-2549). */
2620
+ type CacheScope = 'public' | 'private';
2621
+ /**
2622
+ * A cache hint for a cacheable result (protocol revision 2026-07-28): the
2623
+ * values to emit for `ttlMs` / `cacheScope` when the handler does not provide
2624
+ * them itself. Absent fields fall back to the conservative defaults
2625
+ * (`ttlMs: 0`, `cacheScope: 'private'`).
2626
+ */
2627
+ interface CacheHint {
2628
+ /** Cache lifetime in milliseconds. Must be a non-negative safe integer. */
2629
+ ttlMs?: number;
2630
+ /** Whether the result may be cached by shared caches (`public`) or only by the requesting client (`private`). */
2631
+ cacheScope?: CacheScope;
2632
+ }
2633
+ /**
2634
+ * The operations whose results are cacheable on the 2026-07-28 revision (the
2635
+ * `CacheableResult` extenders). This list is closed: no other operation's
2636
+ * result ever receives cache fields from the SDK.
2637
+ */
2638
+ declare const CACHEABLE_RESULT_METHODS: readonly ["tools/list", "prompts/list", "resources/list", "resources/templates/list", "resources/read", "server/discover"];
2639
+ /** A method whose result is cacheable on the 2026-07-28 revision. */
2640
+ type CacheableResultMethod = (typeof CACHEABLE_RESULT_METHODS)[number];
2641
+ //#endregion
2642
+ //#region ../core-internal/src/shared/stdio.d.ts
2643
+ declare const STDIO_DEFAULT_MAX_BUFFER_SIZE: number;
2644
+ /**
2645
+ * Buffers a continuous stdio stream into discrete JSON-RPC messages.
2646
+ */
2647
+ declare class ReadBuffer {
2648
+ private _buffer?;
2649
+ private _maxBufferSize;
2650
+ constructor(options?: {
2651
+ maxBufferSize?: number;
2652
+ });
2653
+ append(chunk: Buffer): void;
2654
+ readMessage(): JSONRPCMessage | null;
2655
+ clear(): void;
2656
+ }
2657
+ declare function deserializeMessage(line: string): JSONRPCMessage;
2658
+ declare function serializeMessage(message: JSONRPCMessage): string;
2659
+ //#endregion
2660
+ //#region ../core-internal/src/shared/uriTemplate.d.ts
2661
+ type Variables = Record<string, string | string[]>;
2662
+ declare class UriTemplate {
2663
+ /**
2664
+ * Returns true if the given string contains any URI template expressions.
2665
+ * A template expression is a sequence of characters enclosed in curly braces,
2666
+ * like `{foo}` or `{?bar}`.
2667
+ */
2668
+ static isTemplate(str: string): boolean;
2669
+ private static validateLength;
2670
+ private readonly template;
2671
+ private readonly parts;
2672
+ get variableNames(): string[];
2673
+ constructor(template: string);
2674
+ toString(): string;
2675
+ private parse;
2676
+ private getOperator;
2677
+ private getNames;
2678
+ private encodeValue;
2679
+ private expandPart;
2680
+ expand(variables: Variables): string;
2681
+ private escapeRegExp;
2682
+ private partToRegExp;
2683
+ match(uri: string): Variables | null;
2684
+ }
2685
+ //#endregion
2686
+ //#region ../core-internal/src/util/inMemory.d.ts
2687
+ /**
2688
+ * In-memory transport for creating clients and servers that talk to each other within the same process.
2689
+ *
2690
+ * Intended for testing and development. For production in-process connections, use
2691
+ * `StreamableHTTPClientTransport` against a local server URL.
2692
+ */
2693
+ declare class InMemoryTransport implements Transport {
2694
+ private _otherTransport?;
2695
+ private _messageQueue;
2696
+ private _closed;
2697
+ onclose?: () => void;
2698
+ onerror?: (error: Error) => void;
2699
+ onmessage?: (message: JSONRPCMessage, extra?: {
2700
+ authInfo?: AuthInfo;
2701
+ }) => void;
2702
+ sessionId?: string;
2703
+ /**
2704
+ * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a {@linkcode @modelcontextprotocol/client!client/client.Client | Client} and one to a {@linkcode @modelcontextprotocol/server!server/server.Server | Server}.
2705
+ */
2706
+ static createLinkedPair(): [InMemoryTransport, InMemoryTransport];
2707
+ start(): Promise<void>;
2708
+ close(): Promise<void>;
2709
+ /**
2710
+ * Sends a message with optional auth info.
2711
+ * This is useful for testing authentication scenarios.
2712
+ */
2713
+ send(message: JSONRPCMessage, options?: {
2714
+ relatedRequestId?: RequestId;
2715
+ authInfo?: AuthInfo;
2716
+ }): Promise<void>;
2717
+ }
2718
+ //#endregion
2719
+ //#region ../core-internal/src/wire/preload.d.ts
2720
+ /**
2721
+ * Eagerly builds every lazily-constructed wire-schema layer, so that no later
2722
+ * validation pays schema-construction cost.
2723
+ *
2724
+ * Synchronous and idempotent: every layer is a memo, so the first call does
2725
+ * all the work and subsequent calls return immediately. Reference identity is
2726
+ * unaffected — this forces the same memos every lazy consumer pulls through.
2727
+ *
2728
+ * Call it at module scope on platforms that bill per-request CPU but not
2729
+ * module evaluation (isolate-based edge/serverless runtimes), where deferring
2730
+ * construction would move it into the first request of every fresh isolate:
2731
+ *
2732
+ * ```ts
2733
+ * // from '@modelcontextprotocol/server' or '@modelcontextprotocol/client' —
2734
+ * // each package bundles its own schema copy, so warm the one(s) you import.
2735
+ * preloadSchemas(); // module scope — runs during isolate warm-up
2736
+ * ```
2737
+ *
2738
+ * On Node CLIs and other process-per-invocation runtimes, prefer the lazy
2739
+ * default — there, module-scope construction is pure added boot latency.
2740
+ */
2741
+ declare function preloadSchemas(): void;
2742
+ //#endregion
2743
+ //#region src/server/server.d.ts
2744
+ type ServerOptions = ProtocolOptions & {
2745
+ /**
2746
+ * Capabilities to advertise as being supported by this server.
2747
+ *
2748
+ * Note: per the MCP spec, a server that declares a capability MUST respond to that
2749
+ * capability's requests (e.g. `tools/list` for `tools`) — potentially with an empty
2750
+ * result — rather than with a "Method not found" error. {@linkcode server/mcp.McpServer | McpServer}
2751
+ * handles this automatically for capabilities declared here; when using the low-level
2752
+ * {@linkcode Server} directly, you are responsible for registering a request handler for
2753
+ * every capability you declare.
2754
+ */
2755
+ capabilities?: ServerCapabilities;
2756
+ /**
2757
+ * Optional instructions describing how to use the server and its features.
2758
+ */
2759
+ instructions?: string;
2760
+ /**
2761
+ * JSON Schema validator for elicitation response validation.
2762
+ *
2763
+ * The validator is used to validate user input returned from elicitation
2764
+ * requests against the requested schema.
2765
+ *
2766
+ * @default Runtime-selected validator (AJV-backed on Node.js, `@cfworker/json-schema`-backed on browser/workerd runtimes)
2767
+ */
2768
+ jsonSchemaValidator?: jsonSchemaValidator;
2769
+ /**
2770
+ * Cache hints for the cacheable results of the 2026-07-28 protocol
2771
+ * revision (`ttlMs` / `cacheScope`), keyed by operation. The cacheable
2772
+ * operations are `tools/list`, `prompts/list`, `resources/list`,
2773
+ * `resources/templates/list`, `resources/read` and `server/discover`. The
2774
+ * hint is used when the result for that operation does not provide its own
2775
+ * cache fields — most useful for the list results and `server/discover`,
2776
+ * which the SDK builds itself. A hint registered with an individual
2777
+ * resource (`registerResource(..., { cacheHint })`) takes precedence for
2778
+ * that resource's `resources/read` results, field by field: a field the
2779
+ * per-resource hint leaves unset still falls back to the per-operation
2780
+ * hint configured here.
2781
+ *
2782
+ * Absent hints (or omitting this option entirely) keep today's behavior:
2783
+ * cacheable 2026-07-28 results are emitted with `ttlMs: 0` and
2784
+ * `cacheScope: 'private'`. Responses to 2025-era requests are never
2785
+ * affected. Invalid values throw a `RangeError` at construction time.
2786
+ */
2787
+ cacheHints?: Partial<Record<CacheableResultMethod, CacheHint>>;
2788
+ /**
2789
+ * Multi-round-trip serving knobs. On 2026-era requests the client
2790
+ * fulfils `input_required` returns; on 2025-era connections the SDK's
2791
+ * legacy shim fulfils them server-side (real server→client requests +
2792
+ * handler re-entry), so handlers are written once and serve both eras.
2793
+ */
2794
+ inputRequired?: {
2795
+ /**
2796
+ * Handler re-entries per originating request before the shim fails
2797
+ * (tools/call: `isError` result; prompts/resources: JSON-RPC error).
2798
+ * @default 8
2799
+ */
2800
+ maxRounds?: number;
2801
+ /**
2802
+ * Per-leg timeout (ms) for the shim's embedded server→client
2803
+ * requests, sent with `resetTimeoutOnProgress: true`. Human-paced —
2804
+ * deliberately far above the 60s protocol default.
2805
+ * @default 600_000
2806
+ */
2807
+ roundTimeoutMs?: number;
2808
+ /**
2809
+ * `false` disables the shim: an `input_required` return on a
2810
+ * 2025-era request fails loudly (the pre-shim behavior).
2811
+ * @default true
2812
+ */
2813
+ legacyShim?: boolean;
2814
+ };
2815
+ /**
2816
+ * Multi-round-trip `requestState` integrity hook (protocol revision
2817
+ * 2026-07-28).
2818
+ */
2819
+ requestState?: {
2820
+ /**
2821
+ * Called on every multi-round-trip request round whose echoed
2822
+ * `requestState` is a string (i.e. whenever
2823
+ * `ctx.mcpReq.requestState()` would return one), BEFORE the handler
2824
+ * runs — including the legacy shim's in-process rounds. Throw or
2825
+ * reject to refuse the request: the seam answers with a wire-level
2826
+ * `-32602` Invalid Params error whose message is frozen to
2827
+ * `"Invalid or expired requestState"` and whose `data.reason` is
2828
+ * `'invalid_request_state'` — the thrown reason is surfaced via the
2829
+ * server's `onerror` callback only and never reaches the wire.
2830
+ *
2831
+ * This is the place to put HMAC or AEAD verification of
2832
+ * `requestState`. The spec MUST for integrity-protecting state that
2833
+ * influences authorization, resource access, or business logic is on
2834
+ * the server author (basic/patterns/mrtr, server requirements 4–5);
2835
+ * the SDK provides NO default verification —
2836
+ * {@linkcode server/requestStateCodec.createRequestStateCodec | createRequestStateCodec}
2837
+ * is the SDK-provided HMAC helper whose `verify` drops in here
2838
+ * directly. Leaving this option unconfigured keeps the passthrough
2839
+ * behavior — `ctx.mcpReq.requestState()` returns the raw wire string,
2840
+ * which MUST be treated as attacker-controlled input.
2841
+ *
2842
+ * The resolved value is LOAD-BEARING: when the hook resolves with a
2843
+ * non-`undefined` value — as
2844
+ * {@linkcode server/requestStateCodec.RequestStateCodec | RequestStateCodec}`.verify`
2845
+ * does (the decoded payload) — the seam hands THAT value to the
2846
+ * handler via the typed `ctx.mcpReq.requestState<T>()` accessor, so a
2847
+ * codec-using handler reads its verified state with no second decode
2848
+ * call. A verifier that is not also the decoder should resolve
2849
+ * `undefined` (return nothing) to keep the accessor on the raw wire
2850
+ * string — resolving an incidental value (e.g. a boolean
2851
+ * verification flag) would replace what the handler reads.
2852
+ */
2853
+ verify?: (state: string, ctx: ServerContext) => unknown | Promise<unknown>;
2854
+ };
2855
+ };
2856
+ /**
2857
+ * An MCP server on top of a pluggable transport.
2858
+ *
2859
+ * This server will automatically respond to the initialization flow as initiated from the client.
2860
+ *
2861
+ * @deprecated Use {@linkcode server/mcp.McpServer | McpServer} instead for the high-level API. Only use `Server` for advanced use cases.
2862
+ */
2863
+ declare class Server extends Protocol<ServerContext> {
2864
+ private _serverInfo;
2865
+ private _clientCapabilities?;
2866
+ private _clientVersion?;
2867
+ private _capabilities;
2868
+ private _instructions?;
2869
+ private _jsonSchemaValidator;
2870
+ private _cacheHints?;
2871
+ private _requestStateVerify?;
2872
+ private _inputRequiredServing;
2873
+ private _legacyShim?;
2874
+ /** Lazily-built legacy shim; the loop lives in legacyInputRequiredShim.ts behind a narrow host contract. */
2875
+ private _legacyInputRequiredShim;
2876
+ /**
2877
+ * Callback for when initialization has fully completed (i.e., the client has sent an `notifications/initialized` notification).
2878
+ */
2879
+ oninitialized?: () => void;
2880
+ /**
2881
+ * Initializes this server with the given name and version information.
2882
+ */
2883
+ constructor(_serverInfo: Implementation, options?: ServerOptions);
2884
+ /**
2885
+ * Registers the built-in `logging/setLevel` request handler.
2886
+ *
2887
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
2888
+ * Remains functional during the deprecation window (at least twelve months).
2889
+ * Migrate to stderr logging (STDIO servers) or OpenTelemetry.
2890
+ */
2891
+ private _registerLoggingHandler;
2892
+ protected buildContext(ctx: BaseContext, transportInfo?: MessageExtraInfo): ServerContext;
2893
+ private _loggingLevels;
2894
+ private readonly LOG_LEVEL_SEVERITY;
2895
+ private isMessageIgnored;
2896
+ /**
2897
+ * Registers new capabilities. This can only be called before connecting to a transport.
2898
+ *
2899
+ * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
2900
+ */
2901
+ registerCapabilities(capabilities: ServerCapabilities): void;
2902
+ /**
2903
+ * Enforces server-side validation for `tools/call` results regardless of how the
2904
+ * handler was registered, attaches the configured per-operation cache hint
2905
+ * (when one exists) so the 2026-07-28 encode seam can fill `ttlMs`/`cacheScope`
2906
+ * for results that do not provide their own, and owns the multi-round-trip
2907
+ * seam: on the methods whose 2026-07-28 result vocabulary includes
2908
+ * `input_required` (`tools/call`, `prompts/get`, `resources/read`) an
2909
+ * input-required return skips result-schema validation and is checked
2910
+ * against the served era, the at-least-one rule, and the request's own
2911
+ * declared client capabilities; on every other method an input-required
2912
+ * return is a server bug and fails loudly. The hint rides a symbol-keyed
2913
+ * property that is never serialized, so 2025-era responses are unaffected.
2914
+ */
2915
+ protected _wrapHandler(method: string, handler: (request: JSONRPCRequest, ctx: ServerContext) => Promise<Result$1>): (request: JSONRPCRequest, ctx: ServerContext) => Promise<Result$1>;
2916
+ /**
2917
+ * Whether this instance is bound to a 2026-07-28-or-later protocol
2918
+ * revision. Era is instance state — a serving entry (`createMcpHandler`,
2919
+ * `serveStdio`) marks the instance modern at construction; a 2025-era
2920
+ * `initialize` handshake binds it legacy. The multi-round-trip seam reads
2921
+ * this directly: there is no per-request era consult.
2922
+ */
2923
+ private _servedModernEra;
2924
+ /**
2925
+ * Invokes a handler for one of the multi-round-trip methods and applies
2926
+ * the input-required seam:
2927
+ *
2928
+ * - a `UrlElicitationRequiredError` (or any 2025-style server→client
2929
+ * request idiom) escaping the handler on a request served on the
2930
+ * 2026-07-28 era fails LOUDLY with a clear steer to
2931
+ * `inputRequired.elicitUrl(...)` — the `-32042` error never reaches the
2932
+ * 2026-07-28 wire and the throw is not silently converted. Requests
2933
+ * served on the 2025 era keep today's `-32042` behavior byte-exact (the
2934
+ * error is rethrown unchanged).
2935
+ * - an input-required RETURN toward a 2026-07-28 request must satisfy
2936
+ * the at-least-one rule, and every embedded request must be covered by
2937
+ * the capabilities declared on the request's envelope (violations
2938
+ * answer the typed `-32021` error). Toward a 2025-era request the
2939
+ * return is fulfilled by the default-on legacy shim, whose own gate
2940
+ * consults the initialize-declared capabilities and surfaces
2941
+ * violations per family; `inputRequired.legacyShim: false` restores
2942
+ * the pre-shim loud failure.
2943
+ */
2944
+ private _invokeInputRequiredCapableHandler;
2945
+ /**
2946
+ * Runs the configured `requestState.verify` hook and returns its
2947
+ * resolved value (`undefined` when unconfigured or the hook returns
2948
+ * nothing). Deny-on-error: any hook failure answers the frozen `-32602`;
2949
+ * the reason goes to `onerror` only.
2950
+ */
2951
+ private _verifyRequestState;
2952
+ /**
2953
+ * The per-request resolved client-capabilities view: the request's own
2954
+ * `_meta` envelope on the 2026 era; the `initialize`-declared state on a
2955
+ * 2025-era connection. Per-request instances that never saw an
2956
+ * initialize (stateless legacy) hold nothing, so gates refuse there.
2957
+ */
2958
+ private _inputRequestCapabilityView;
2959
+ /**
2960
+ * Guard for the push-style server→client request APIs ({@linkcode createMessage},
2961
+ * {@linkcode elicitInput}, {@linkcode listRoots}, {@linkcode ping}) on a
2962
+ * modern-era instance: the 2026-07-28 revision has no server→client request
2963
+ * channel, so the call fails before any wire traffic with a typed error
2964
+ * whose message steers to `inputRequired(...)`. The base era gate would
2965
+ * also reject it; this guard runs first to carry the steer.
2966
+ */
2967
+ private _assertPushApiInServedEra;
2968
+ protected assertCapabilityForMethod(method: RequestMethod | string): void;
2969
+ protected assertNotificationCapability(method: NotificationMethod | string): void;
2970
+ protected assertRequestHandlerCapability(method: string): void;
2971
+ private _oninitialize;
2972
+ /**
2973
+ * Answers `server/discover` (protocol revision 2026-07-28). `supportedVersions`
2974
+ * lists only modern revisions (2025-era versions are negotiated via `initialize`);
2975
+ * the capabilities are advertised as-is, listChanged/subscribe bits included
2976
+ * (see {@linkcode discoverAdvertisedCapabilities}).
2977
+ */
2978
+ private _ondiscover;
2979
+ /**
2980
+ * The identity the 2026-era encode seam stamps into every outbound
2981
+ * result's `_meta` under `io.modelcontextprotocol/serverInfo` (spec PR
2982
+ * #3002: servers SHOULD identify themselves on every response).
2983
+ */
2984
+ protected _outboundServerInfo(): Implementation | undefined;
2985
+ /**
2986
+ * After initialization has completed, this will be populated with the client's reported capabilities.
2987
+ *
2988
+ * @deprecated Read client identity from the per-request handler context instead: on
2989
+ * 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's
2990
+ * declared capabilities, while on 2025-era connections this accessor keeps returning the
2991
+ * `initialize`-scoped value. The accessor remains functional — instances serving the
2992
+ * 2026-07-28 era are backfilled per request from the validated envelope.
2993
+ */
2994
+ getClientCapabilities(): ClientCapabilities | undefined;
2995
+ /**
2996
+ * After initialization has completed, this will be populated with information about the client's name and version.
2997
+ *
2998
+ * @deprecated Read client identity from the per-request handler context instead: on
2999
+ * 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` carries the client's
3000
+ * name and version, while on 2025-era connections this accessor keeps returning the
3001
+ * `initialize`-scoped value. The accessor remains functional — instances serving the
3002
+ * 2026-07-28 era are backfilled per request from the validated envelope.
3003
+ */
3004
+ getClientVersion(): Implementation | undefined;
3005
+ /**
3006
+ * After initialization has completed, this will be populated with the protocol version negotiated
3007
+ * with the client (the version the server responded with during the initialize handshake), or
3008
+ * `undefined` before initialization.
3009
+ *
3010
+ * @deprecated Read the protocol revision from the per-request handler context instead: on
3011
+ * 2026-07-28 (per-request envelope) requests `ctx.mcpReq.envelope` names the revision the
3012
+ * request was sent for, while on 2025-era connections this accessor keeps returning the
3013
+ * `initialize`-negotiated version. The accessor remains functional — instances serving the
3014
+ * 2026-07-28 era report that revision.
3015
+ */
3016
+ getNegotiatedProtocolVersion(): string | undefined;
3017
+ /**
3018
+ * Project a `tools/call` result through this instance's negotiated wire
3019
+ * codec — the era-agnostic SEP-2106 §4.3 TextContent auto-append, plus on
3020
+ * the 2025 era the `{result:…}` wrap when `structuredContent` is a
3021
+ * non-object value or the advertised `outputSchema` had a non-object root.
3022
+ * Identity for object-shaped `structuredContent` on the 2026 era.
3023
+ *
3024
+ * `McpServer`'s built-in `tools/call` handler routes through this method.
3025
+ * Low-level `setRequestHandler('tools/call', …)` authors call it
3026
+ * themselves so the projection lives in one place (the codec) and the
3027
+ * server-side handler stays era-blind.
3028
+ *
3029
+ * This is the only codec function exposed on `Server` — the full
3030
+ * `WireCodec` is intentionally not part of the public surface.
3031
+ */
3032
+ projectCallToolResult(result: CallToolResult, advertisedOutputSchema: Readonly<Record<string, unknown>> | undefined): CallToolResult;
3033
+ /**
3034
+ * Returns the current server capabilities.
3035
+ */
3036
+ getCapabilities(): ServerCapabilities;
3037
+ /**
3038
+ * Sends a `ping` request to the connected client.
3039
+ *
3040
+ * @deprecated The 2026-07-28 protocol removed ping; it throws on a 2026-07-28-era instance.
3041
+ * If your factory serves both eras, this only works on the legacy path.
3042
+ */
3043
+ ping(): Promise<EmptyResult>;
3044
+ /**
3045
+ * Request LLM sampling from the client (without tools).
3046
+ * Returns single content block for backwards compatibility.
3047
+ *
3048
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3049
+ * Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
3050
+ * or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client
3051
+ * request model is replaced by input_required results in the 2026-07-28 protocol. If your
3052
+ * factory serves both eras, this only works on the legacy path.
3053
+ */
3054
+ createMessage(params: CreateMessageRequestParamsBase, options?: RequestOptions): Promise<CreateMessageResult>;
3055
+ /**
3056
+ * Request LLM sampling from the client with tool support.
3057
+ * Returns content that may be a single block or array (for parallel tool calls).
3058
+ *
3059
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3060
+ * Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
3061
+ * or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client
3062
+ * request model is replaced by input_required results in the 2026-07-28 protocol. If your
3063
+ * factory serves both eras, this only works on the legacy path.
3064
+ */
3065
+ createMessage(params: CreateMessageRequestParamsWithTools, options?: RequestOptions): Promise<CreateMessageResultWithTools>;
3066
+ /**
3067
+ * Request LLM sampling from the client.
3068
+ * When tools may or may not be present, returns the union type.
3069
+ *
3070
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3071
+ * Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
3072
+ * or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client
3073
+ * request model is replaced by input_required results in the 2026-07-28 protocol. If your
3074
+ * factory serves both eras, this only works on the legacy path.
3075
+ */
3076
+ createMessage(params: CreateMessageRequest['params'], options?: RequestOptions): Promise<CreateMessageResult | CreateMessageResultWithTools>;
3077
+ /**
3078
+ * Creates an elicitation request for the given parameters.
3079
+ * For backwards compatibility, `mode` may be omitted for form requests and will default to `"form"`.
3080
+ * @param params The parameters for the elicitation request.
3081
+ * @param options Optional request options.
3082
+ * @returns The result of the elicitation request.
3083
+ *
3084
+ * @deprecated Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip)
3085
+ * instead. The 2025 push-style server-to-client request model is replaced by input_required
3086
+ * results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the
3087
+ * legacy path.
3088
+ */
3089
+ elicitInput(params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions): Promise<ElicitResult>;
3090
+ /**
3091
+ * The capability-check-free core of {@linkcode elicitInput}. The shim
3092
+ * uses it because its gate differs from the public checks: a bare
3093
+ * `elicitation: {}` counts as form support (the pre-mode rule), and
3094
+ * accepted content passes through unvalidated for parity with the
3095
+ * modern client driver (handlers validate via the schema-aware
3096
+ * `acceptedContent` overload and can re-ask).
3097
+ */
3098
+ private _sendElicitationLeg;
3099
+ /**
3100
+ * Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete`
3101
+ * notification for the specified elicitation ID.
3102
+ *
3103
+ * The notification (and the `elicitationId` it references) exists only on protocol revision
3104
+ * 2025-11-25 — the 2026-07-28 draft removed both. On a connection negotiated at 2026-07-28 the
3105
+ * returned callback rejects with a typed local error before anything reaches the transport
3106
+ * (the method is not part of that revision's wire registry).
3107
+ *
3108
+ * @param elicitationId The ID of the elicitation to mark as complete.
3109
+ * @param options Optional notification options. Useful when the completion notification should be related to a prior request.
3110
+ * @returns A function that emits the completion notification when awaited.
3111
+ */
3112
+ createElicitationCompletionNotifier(elicitationId: string, options?: NotificationOptions): () => Promise<void>;
3113
+ /**
3114
+ * Requests the list of roots from the client.
3115
+ *
3116
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3117
+ * Throws on a 2026-07-28-era request — use {@link index.inputRequired | inputRequired} (multi-round-trip) instead,
3118
+ * or migrate to passing paths via tool parameters, resource URIs, or configuration. The 2025
3119
+ * push-style server-to-client request model is replaced by input_required results in the
3120
+ * 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.
3121
+ */
3122
+ listRoots(params?: ListRootsRequest['params'], options?: RequestOptions): Promise<ListRootsResult>;
3123
+ /**
3124
+ * Sends a logging message to the client, if connected.
3125
+ * Note: You only need to send the parameters object, not the entire JSON-RPC message.
3126
+ * @see {@linkcode LoggingMessageNotification}
3127
+ * @param params
3128
+ * @param sessionId Optional for stateless transports and backward compatibility.
3129
+ *
3130
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3131
+ * Remains functional during the deprecation window (at least twelve months).
3132
+ * Migrate to stderr logging (STDIO servers) or OpenTelemetry.
3133
+ */
3134
+ sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise<void>;
3135
+ sendResourceUpdated(params: ResourceUpdatedNotification['params']): Promise<void>;
3136
+ sendResourceListChanged(): Promise<void>;
3137
+ sendToolListChanged(): Promise<void>;
3138
+ sendPromptListChanged(): Promise<void>;
3139
+ }
3140
+ //#endregion
3141
+ //#region src/server/mcp.d.ts
3142
+ /**
3143
+ * High-level MCP server that provides a simpler API for working with resources, tools, and prompts.
3144
+ * For advanced usage (like sending notifications or setting custom request handlers), use the underlying
3145
+ * {@linkcode Server} instance available via the {@linkcode McpServer.server | server} property.
3146
+ *
3147
+ * @example
3148
+ * ```ts source="./mcp.examples.ts#McpServer_basicUsage"
3149
+ * const server = new McpServer({
3150
+ * name: 'my-server',
3151
+ * version: '1.0.0'
3152
+ * });
3153
+ * ```
3154
+ */
3155
+ declare class McpServer {
3156
+ /**
3157
+ * The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.
3158
+ */
3159
+ readonly server: Server;
3160
+ private _registeredResources;
3161
+ private _registeredResourceTemplates;
3162
+ private _registeredTools;
3163
+ private _registeredPrompts;
3164
+ /**
3165
+ * Per-tool JSON-converted `inputSchema`, memoized so the SEP-2243
3166
+ * registration-time scan and the pre-dispatch validation step share one
3167
+ * conversion instead of paying it twice per request under the
3168
+ * per-request-factory `createMcpHandler` model.
3169
+ */
3170
+ private _toolInputSchemaJson;
3171
+ /**
3172
+ * The JSON-serialized `inputSchema` of a registered tool, or `undefined`
3173
+ * when no such tool is registered. Used by the HTTP entry's pre-dispatch
3174
+ * SEP-2243 `Mcp-Param-*` validation step (which needs the same JSON Schema
3175
+ * `tools/list` would emit, before dispatch reaches the handler).
3176
+ *
3177
+ * @internal
3178
+ */
3179
+ toolInputSchemaJson(name: string): Record<string, unknown> | undefined;
3180
+ constructor(serverInfo: Implementation, options?: ServerOptions);
3181
+ /**
3182
+ * Attaches to the given transport, starts it, and starts listening for messages.
3183
+ *
3184
+ * The `server` object assumes ownership of the {@linkcode Transport}, replacing any callbacks that have already been set, and expects that it is the only user of the {@linkcode Transport} instance going forward.
3185
+ *
3186
+ * @example
3187
+ * ```ts source="./mcp.examples.ts#McpServer_connect_stdio"
3188
+ * const server = new McpServer({ name: 'my-server', version: '1.0.0' });
3189
+ * const transport = new StdioServerTransport();
3190
+ * await server.connect(transport);
3191
+ * ```
3192
+ */
3193
+ connect(transport: Transport): Promise<void>;
3194
+ /**
3195
+ * Closes the connection.
3196
+ */
3197
+ close(): Promise<void>;
3198
+ private _toolHandlersInitialized;
3199
+ private setToolRequestHandlers;
3200
+ /**
3201
+ * Creates a tool error result.
3202
+ *
3203
+ * @param errorMessage - The error message.
3204
+ * @returns The tool error result.
3205
+ */
3206
+ private createToolError;
3207
+ /**
3208
+ * Validates tool input arguments against the tool's input schema.
3209
+ */
3210
+ private validateToolInput;
3211
+ /**
3212
+ * Validates tool output against the tool's output schema.
3213
+ */
3214
+ private validateToolOutput;
3215
+ /**
3216
+ * Executes a tool handler.
3217
+ */
3218
+ private executeToolHandler;
3219
+ private _completionHandlerInitialized;
3220
+ private setCompletionRequestHandler;
3221
+ private handlePromptCompletion;
3222
+ private handleResourceCompletion;
3223
+ private _resourceHandlersInitialized;
3224
+ private setResourceRequestHandlers;
3225
+ private _promptHandlersInitialized;
3226
+ private setPromptRequestHandlers;
3227
+ /**
3228
+ * Registers a resource with a config object and callback.
3229
+ * For static resources, use a URI string. For dynamic resources, use a {@linkcode ResourceTemplate}.
3230
+ *
3231
+ * @example
3232
+ * ```ts source="./mcp.examples.ts#McpServer_registerResource_static"
3233
+ * server.registerResource(
3234
+ * 'config',
3235
+ * 'config://app',
3236
+ * {
3237
+ * title: 'Application Config',
3238
+ * mimeType: 'text/plain'
3239
+ * },
3240
+ * async uri => ({
3241
+ * contents: [{ uri: uri.href, text: 'App configuration here' }]
3242
+ * })
3243
+ * );
3244
+ * ```
3245
+ */
3246
+ registerResource(name: string, uriOrTemplate: string, config: ResourceMetadata & {
3247
+ cacheHint?: CacheHint;
3248
+ }, readCallback: ReadResourceCallback): RegisteredResource;
3249
+ registerResource(name: string, uriOrTemplate: ResourceTemplate, config: ResourceMetadata & {
3250
+ cacheHint?: CacheHint;
3251
+ }, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate;
3252
+ private _createRegisteredResource;
3253
+ private _createRegisteredResourceTemplate;
3254
+ private _createRegisteredPrompt;
3255
+ private _createRegisteredTool;
3256
+ /**
3257
+ * Registers a tool with a config object and callback.
3258
+ *
3259
+ * @example
3260
+ * ```ts source="./mcp.examples.ts#McpServer_registerTool_basic"
3261
+ * server.registerTool(
3262
+ * 'calculate-bmi',
3263
+ * {
3264
+ * title: 'BMI Calculator',
3265
+ * description: 'Calculate Body Mass Index',
3266
+ * inputSchema: z.object({
3267
+ * weightKg: z.number(),
3268
+ * heightM: z.number()
3269
+ * }),
3270
+ * outputSchema: z.object({ bmi: z.number() })
3271
+ * },
3272
+ * async ({ weightKg, heightM }) => {
3273
+ * const output = { bmi: weightKg / (heightM * heightM) };
3274
+ * return {
3275
+ * content: [{ type: 'text', text: JSON.stringify(output) }],
3276
+ * structuredContent: output
3277
+ * };
3278
+ * }
3279
+ * );
3280
+ * ```
3281
+ */
3282
+ registerTool<OutputArgs extends StandardSchemaWithJSON, InputArgs extends StandardSchemaWithJSON | undefined = undefined>(name: string, config: {
3283
+ title?: string;
3284
+ description?: string;
3285
+ inputSchema?: InputArgs;
3286
+ outputSchema?: OutputArgs;
3287
+ annotations?: ToolAnnotations;
3288
+ icons?: Icon[];
3289
+ _meta?: Record<string, unknown>;
3290
+ }, cb: ToolCallback<InputArgs>): RegisteredTool;
3291
+ /** @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()`. */
3292
+ registerTool<InputArgs extends ZodRawShape, OutputArgs extends ZodRawShape | StandardSchemaWithJSON | undefined = undefined>(name: string, config: {
3293
+ title?: string;
3294
+ description?: string;
3295
+ inputSchema?: InputArgs;
3296
+ outputSchema?: OutputArgs;
3297
+ annotations?: ToolAnnotations;
3298
+ icons?: Icon[];
3299
+ _meta?: Record<string, unknown>;
3300
+ }, cb: LegacyToolCallback<InputArgs>): RegisteredTool;
3301
+ /**
3302
+ * Registers a prompt with a config object and callback.
3303
+ *
3304
+ * @example
3305
+ * ```ts source="./mcp.examples.ts#McpServer_registerPrompt_basic"
3306
+ * server.registerPrompt(
3307
+ * 'review-code',
3308
+ * {
3309
+ * title: 'Code Review',
3310
+ * description: 'Review code for best practices',
3311
+ * argsSchema: z.object({ code: z.string() })
3312
+ * },
3313
+ * ({ code }) => ({
3314
+ * messages: [
3315
+ * {
3316
+ * role: 'user' as const,
3317
+ * content: {
3318
+ * type: 'text' as const,
3319
+ * text: `Please review this code:\n\n${code}`
3320
+ * }
3321
+ * }
3322
+ * ]
3323
+ * })
3324
+ * );
3325
+ * ```
3326
+ */
3327
+ registerPrompt<Args extends StandardSchemaWithJSON>(name: string, config: {
3328
+ title?: string;
3329
+ description?: string;
3330
+ argsSchema?: Args;
3331
+ icons?: Icon[];
3332
+ _meta?: Record<string, unknown>;
3333
+ }, cb: PromptCallback<Args>): RegisteredPrompt;
3334
+ /** @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()`. */
3335
+ registerPrompt<Args extends ZodRawShape>(name: string, config: {
3336
+ title?: string;
3337
+ description?: string;
3338
+ argsSchema?: Args;
3339
+ icons?: Icon[];
3340
+ _meta?: Record<string, unknown>;
3341
+ }, cb: LegacyPromptCallback<Args>): RegisteredPrompt;
3342
+ /**
3343
+ * Checks if the server is connected to a transport.
3344
+ * @returns `true` if the server is connected
3345
+ */
3346
+ isConnected(): boolean;
3347
+ /**
3348
+ * Sends a logging message to the client, if connected.
3349
+ * Note: You only need to send the parameters object, not the entire JSON-RPC message.
3350
+ * @see {@linkcode LoggingMessageNotification}
3351
+ * @param params
3352
+ * @param sessionId Optional for stateless transports and backward compatibility.
3353
+ *
3354
+ * @example
3355
+ * ```ts source="./mcp.examples.ts#McpServer_sendLoggingMessage_basic"
3356
+ * await server.sendLoggingMessage({
3357
+ * level: 'info',
3358
+ * data: 'Processing complete'
3359
+ * });
3360
+ * ```
3361
+ *
3362
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3363
+ * Remains functional during the deprecation window (at least twelve months).
3364
+ * Migrate to stderr logging (STDIO servers) or OpenTelemetry.
3365
+ */
3366
+ sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise<void>;
3367
+ /**
3368
+ * Sends a resource list changed event to the client, if connected.
3369
+ */
3370
+ sendResourceListChanged(): void;
3371
+ /**
3372
+ * Sends a tool list changed event to the client, if connected.
3373
+ */
3374
+ sendToolListChanged(): void;
3375
+ /**
3376
+ * Sends a prompt list changed event to the client, if connected.
3377
+ */
3378
+ sendPromptListChanged(): void;
3379
+ }
3380
+ /**
3381
+ * A callback to complete one variable within a resource template's URI template.
3382
+ */
3383
+ type CompleteResourceTemplateCallback = (value: string, context?: {
3384
+ arguments?: Record<string, string>;
3385
+ }) => string[] | Promise<string[]>;
3386
+ /**
3387
+ * A resource template combines a URI pattern with optional functionality to enumerate
3388
+ * all resources matching that pattern.
3389
+ */
3390
+ declare class ResourceTemplate {
3391
+ private _callbacks;
3392
+ private _uriTemplate;
3393
+ constructor(uriTemplate: string | UriTemplate, _callbacks: {
3394
+ /**
3395
+ * A callback to list all resources matching this template. This is required to be specified, even if `undefined`, to avoid accidentally forgetting resource listing.
3396
+ */
3397
+ list: ListResourcesCallback | undefined;
3398
+ /**
3399
+ * An optional callback to autocomplete variables within the URI template. Useful for clients and users to discover possible values.
3400
+ */
3401
+ complete?: {
3402
+ [variable: string]: CompleteResourceTemplateCallback;
3403
+ };
3404
+ });
3405
+ /**
3406
+ * Gets the URI template pattern.
3407
+ */
3408
+ get uriTemplate(): UriTemplate;
3409
+ /**
3410
+ * Gets the list callback, if one was provided.
3411
+ */
3412
+ get listCallback(): ListResourcesCallback | undefined;
3413
+ /**
3414
+ * Gets the callback for completing a specific URI template variable, if one was provided.
3415
+ */
3416
+ completeCallback(variable: string): CompleteResourceTemplateCallback | undefined;
3417
+ }
3418
+ /**
3419
+ * A plain record of Zod field schemas, e.g. `{ name: z.string() }`. Accepted by
3420
+ * `registerTool`/`registerPrompt` as a shorthand; auto-wrapped with `z.object()`.
3421
+ * Zod schemas only — `z.object()` cannot wrap other Standard Schema libraries.
3422
+ */
3423
+ type ZodRawShape = Record<string, z.ZodType>;
3424
+ /** Infers the parsed-output type of a {@linkcode ZodRawShape}. */
3425
+ type InferRawShape<S extends ZodRawShape> = z.infer<z.ZodObject<S>>;
3426
+ /** {@linkcode ToolCallback} variant used when `inputSchema` is a {@linkcode ZodRawShape}. */
3427
+ type LegacyToolCallback<Args extends ZodRawShape | undefined> = Args extends ZodRawShape ? (args: InferRawShape<Args>, ctx: ServerContext) => CallToolResult | InputRequiredResult | Promise<CallToolResult | InputRequiredResult> : (ctx: ServerContext) => CallToolResult | InputRequiredResult | Promise<CallToolResult | InputRequiredResult>;
3428
+ /** {@linkcode PromptCallback} variant used when `argsSchema` is a {@linkcode ZodRawShape}. */
3429
+ type LegacyPromptCallback<Args extends ZodRawShape | undefined> = Args extends ZodRawShape ? (args: InferRawShape<Args>, ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult> : (ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult>;
3430
+ type BaseToolCallback<SendResultT extends Result$1, Ctx extends ServerContext, Args extends StandardSchemaWithJSON | undefined> = Args extends StandardSchemaWithJSON ? (args: StandardSchemaWithJSON.InferOutput<Args>, ctx: Ctx) => SendResultT | Promise<SendResultT> : (ctx: Ctx) => SendResultT | Promise<SendResultT>;
3431
+ /**
3432
+ * Callback for a tool handler registered with {@linkcode McpServer.registerTool}.
3433
+ */
3434
+ type ToolCallback<Args extends StandardSchemaWithJSON | undefined = undefined> = BaseToolCallback<CallToolResult | InputRequiredResult, ServerContext, Args>;
3435
+ /**
3436
+ * Tool handler callback type.
3437
+ */
3438
+ type AnyToolHandler<Args extends StandardSchemaWithJSON | undefined = undefined> = ToolCallback<Args>;
3439
+ /**
3440
+ * Internal executor type that encapsulates handler invocation with proper types.
3441
+ */
3442
+ type ToolExecutor = (args: unknown, ctx: ServerContext) => Promise<CallToolResult | InputRequiredResult>;
3443
+ type RegisteredTool = {
3444
+ title?: string;
3445
+ description?: string;
3446
+ inputSchema?: StandardSchemaWithJSON;
3447
+ outputSchema?: StandardSchemaWithJSON;
3448
+ /**
3449
+ * @hidden
3450
+ * The converted JSON Schema of `outputSchema`, memoised at registration (and on
3451
+ * `update({outputSchema})`) so the `tools/call` handler passes the SAME advertised schema
3452
+ * `tools/list` emits to the wire codec's `projectCallToolResult` — the SEP-2106 `{result:…}`
3453
+ * wrap predicate follows the schema's root, never the runtime value shape. `undefined` when
3454
+ * no `outputSchema` is registered or its conversion threw (see {@link convertOutputSchemaJson}).
3455
+ */
3456
+ outputSchemaJson?: Record<string, unknown>;
3457
+ annotations?: ToolAnnotations;
3458
+ icons?: Icon[];
3459
+ execution?: ToolExecution;
3460
+ _meta?: Record<string, unknown>;
3461
+ handler: AnyToolHandler<StandardSchemaWithJSON | undefined>;
3462
+ /** @hidden */
3463
+ executor: ToolExecutor;
3464
+ enabled: boolean;
3465
+ enable(): void;
3466
+ disable(): void;
3467
+ update(updates: {
3468
+ name?: string | null;
3469
+ title?: string;
3470
+ description?: string;
3471
+ paramsSchema?: StandardSchemaWithJSON;
3472
+ outputSchema?: StandardSchemaWithJSON;
3473
+ annotations?: ToolAnnotations;
3474
+ icons?: Icon[];
3475
+ _meta?: Record<string, unknown>;
3476
+ callback?: ToolCallback<StandardSchemaWithJSON>;
3477
+ enabled?: boolean;
3478
+ }): void;
3479
+ remove(): void;
3480
+ };
3481
+ /**
3482
+ * Additional, optional information for annotating a resource.
3483
+ */
3484
+ type ResourceMetadata = Omit<Resource, 'uri' | 'name'>;
3485
+ /**
3486
+ * Callback to list all resources matching a given template.
3487
+ */
3488
+ type ListResourcesCallback = (ctx: ServerContext) => ListResourcesResult | Promise<ListResourcesResult>;
3489
+ /**
3490
+ * Callback to read a resource at a given URI.
3491
+ */
3492
+ type ReadResourceCallback = (uri: URL, ctx: ServerContext) => ReadResourceResult | InputRequiredResult | Promise<ReadResourceResult | InputRequiredResult>;
3493
+ type RegisteredResource = {
3494
+ name: string;
3495
+ title?: string;
3496
+ metadata?: ResourceMetadata;
3497
+ /** Cache hint applied to this resource's `resources/read` results on the 2026-07-28 revision. */
3498
+ cacheHint?: CacheHint;
3499
+ readCallback: ReadResourceCallback;
3500
+ enabled: boolean;
3501
+ enable(): void;
3502
+ disable(): void;
3503
+ update(updates: {
3504
+ name?: string;
3505
+ title?: string;
3506
+ uri?: string | null;
3507
+ metadata?: ResourceMetadata;
3508
+ callback?: ReadResourceCallback;
3509
+ enabled?: boolean;
3510
+ }): void;
3511
+ remove(): void;
3512
+ };
3513
+ /**
3514
+ * Callback to read a resource at a given URI, following a filled-in URI template.
3515
+ */
3516
+ type ReadResourceTemplateCallback = (uri: URL, variables: Variables, ctx: ServerContext) => ReadResourceResult | InputRequiredResult | Promise<ReadResourceResult | InputRequiredResult>;
3517
+ type RegisteredResourceTemplate = {
3518
+ resourceTemplate: ResourceTemplate;
3519
+ title?: string;
3520
+ metadata?: ResourceMetadata;
3521
+ /** Cache hint applied to this template's `resources/read` results on the 2026-07-28 revision. */
3522
+ cacheHint?: CacheHint;
3523
+ readCallback: ReadResourceTemplateCallback;
3524
+ enabled: boolean;
3525
+ enable(): void;
3526
+ disable(): void;
3527
+ update(updates: {
3528
+ name?: string | null;
3529
+ title?: string;
3530
+ template?: ResourceTemplate;
3531
+ metadata?: ResourceMetadata;
3532
+ callback?: ReadResourceTemplateCallback;
3533
+ enabled?: boolean;
3534
+ }): void;
3535
+ remove(): void;
3536
+ };
3537
+ type PromptCallback<Args extends StandardSchemaWithJSON | undefined = undefined> = Args extends StandardSchemaWithJSON ? (args: StandardSchemaWithJSON.InferOutput<Args>, ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult> : (ctx: ServerContext) => GetPromptResult | InputRequiredResult | Promise<GetPromptResult | InputRequiredResult>;
3538
+ /**
3539
+ * Internal handler type that encapsulates parsing and callback invocation.
3540
+ * This allows type-safe handling without runtime type assertions.
3541
+ */
3542
+ type PromptHandler = (args: Record<string, unknown> | undefined, ctx: ServerContext) => Promise<GetPromptResult | InputRequiredResult>;
3543
+ type RegisteredPrompt = {
3544
+ title?: string;
3545
+ description?: string;
3546
+ argsSchema?: StandardSchemaWithJSON;
3547
+ icons?: Icon[];
3548
+ _meta?: Record<string, unknown>;
3549
+ /** @hidden */
3550
+ handler: PromptHandler;
3551
+ enabled: boolean;
3552
+ enable(): void;
3553
+ disable(): void;
3554
+ update<Args extends StandardSchemaWithJSON>(updates: {
3555
+ name?: string | null;
3556
+ title?: string;
3557
+ description?: string;
3558
+ argsSchema?: Args;
3559
+ icons?: Icon[];
3560
+ _meta?: Record<string, unknown>;
3561
+ callback?: PromptCallback<Args>;
3562
+ enabled?: boolean;
3563
+ }): void;
3564
+ remove(): void;
3565
+ };
3566
+ //#endregion
3567
+ //#region src/server/perRequestTransport.d.ts
3568
+ /**
3569
+ * How the transport shapes its HTTP response for a request:
3570
+ *
3571
+ * - `auto` (default): answer with a single JSON body unless the handler emits
3572
+ * a related message before its result, in which case the response upgrades
3573
+ * to an SSE stream.
3574
+ * - `sse`: always answer handler output over an SSE stream. The stream opens
3575
+ * once the request has passed the pre-dispatch validation gates, so ladder
3576
+ * rejections keep their mapped HTTP status instead of being framed onto a
3577
+ * 200 stream.
3578
+ * - `json`: never stream; related messages other than the terminal response
3579
+ * are dropped.
3580
+ */
3581
+ type PerRequestResponseMode = 'auto' | 'sse' | 'json';
3582
+ /** Constructor options for {@linkcode PerRequestHTTPServerTransport}. */
3583
+ interface PerRequestHTTPServerTransportOptions {
3584
+ /** The edge classification of the message this transport will serve. */
3585
+ classification: MessageClassification;
3586
+ /** Response shaping for the exchange; defaults to `auto`. */
3587
+ responseMode?: PerRequestResponseMode;
3588
+ }
3589
+ /** Per-exchange context handed to {@linkcode PerRequestHTTPServerTransport.handleMessage}. */
3590
+ interface PerRequestMessageExtra {
3591
+ /**
3592
+ * The original HTTP request. Used for handler context and, when the
3593
+ * runtime provides an abort signal on it, to cancel the exchange when the
3594
+ * client disconnects.
3595
+ */
3596
+ request?: globalThis.Request;
3597
+ /**
3598
+ * Validated authentication information supplied by the caller. Strictly
3599
+ * pass-through: the transport never populates this from request headers.
3600
+ */
3601
+ authInfo?: AuthInfo;
3602
+ }
3603
+ /**
3604
+ * The per-request micro-transport: a real, connected `Transport` whose whole
3605
+ * lifetime is one HTTP exchange. See the module documentation for the
3606
+ * response shapes it produces.
3607
+ */
3608
+ declare class PerRequestHTTPServerTransport implements Transport {
3609
+ onclose?: () => void;
3610
+ onerror?: (error: Error) => void;
3611
+ onmessage?: <T$1 extends JSONRPCMessage>(message: T$1, extra?: MessageExtraInfo) => void;
3612
+ private readonly _classification;
3613
+ private readonly _responseMode;
3614
+ private _started;
3615
+ private _used;
3616
+ private _closed;
3617
+ private _terminalDelivered;
3618
+ /**
3619
+ * `true` only while the inbound message is being delivered synchronously
3620
+ * to the connected protocol layer. The pre-handler gates (the era
3621
+ * registry gate, the edge→instance handoff check, the missing-handler
3622
+ * rejection) answer inside this window; request handlers always run
3623
+ * after it (the protocol layer defers them to a microtask). An error
3624
+ * sent inside the window is therefore ladder-originated, and an error
3625
+ * sent after it is handler-produced.
3626
+ */
3627
+ private _dispatchWindowOpen;
3628
+ private _requestId?;
3629
+ private _deferredResponse?;
3630
+ private _sse?;
3631
+ private _abortCleanup?;
3632
+ constructor(options: PerRequestHTTPServerTransportOptions);
3633
+ start(): Promise<void>;
3634
+ /**
3635
+ * Serves the single exchange: delivers the classified message to the
3636
+ * connected server instance and resolves with the HTTP response.
3637
+ *
3638
+ * Throws when called a second time (the transport is strictly
3639
+ * single-use), or before a server has been connected to the transport.
3640
+ * The returned promise rejects with a connection-closed error when the
3641
+ * transport is closed before a response was produced (for example because
3642
+ * the client disconnected).
3643
+ */
3644
+ handleMessage(message: JSONRPCRequest | JSONRPCNotification, extra?: PerRequestMessageExtra): Promise<Response>;
3645
+ send(message: JSONRPCMessage, options?: TransportSendOptions): Promise<void>;
3646
+ /**
3647
+ * Writes an SSE comment frame (a keep-alive heartbeat). Dropped when the
3648
+ * exchange is not currently streaming.
3649
+ */
3650
+ writeCommentFrame(comment: string): void;
3651
+ close(): Promise<void>;
3652
+ private settleResponse;
3653
+ private upgradeToSse;
3654
+ private finalizeStream;
3655
+ private writeMessageFrame;
3656
+ private writeFrame;
3657
+ }
3658
+ //#endregion
3659
+ //#region src/server/serverEventBus.d.ts
3660
+ /**
3661
+ * A change event a server publishes for delivery on open `subscriptions/listen`
3662
+ * streams. Each variant maps onto exactly one notification method:
3663
+ *
3664
+ * - `tools_list_changed` → `notifications/tools/list_changed`
3665
+ * - `prompts_list_changed` → `notifications/prompts/list_changed`
3666
+ * - `resources_list_changed` → `notifications/resources/list_changed`
3667
+ * - `resource_updated` → `notifications/resources/updated` (carries the URI)
3668
+ *
3669
+ * The bus carries the EVENT, not the wire shape — the entry's listen router
3670
+ * owns subscription-id stamping and per-stream filtering.
3671
+ */
3672
+ type ServerEvent = {
3673
+ kind: 'tools_list_changed';
3674
+ } | {
3675
+ kind: 'prompts_list_changed';
3676
+ } | {
3677
+ kind: 'resources_list_changed';
3678
+ } | {
3679
+ kind: 'resource_updated';
3680
+ uri: string;
3681
+ };
3682
+ /**
3683
+ * The server-side change-event seam for `subscriptions/listen`.
3684
+ *
3685
+ * The serving entry (`createMcpHandler`) owns the per-stream listen router:
3686
+ * each open `subscriptions/listen` stream registers a listener via
3687
+ * `subscribe()`, and consumer code (typically via `handler.notify.*` sugar)
3688
+ * publishes change events via `publish()`. In-process servers can use the
3689
+ * default {@linkcode InMemoryServerEventBus}; multi-process deployments
3690
+ * implement this interface over their own pub/sub.
3691
+ *
3692
+ * The SDK owns wire semantics (ack-first, filtering, subscription-id
3693
+ * stamping, teardown); a `ServerEventBus` only sources the events. It MUST
3694
+ * NOT echo back to the listener that published an event when called from
3695
+ * inside that listener (no surprise here — the default delivers
3696
+ * synchronously and listeners never publish).
3697
+ */
3698
+ interface ServerEventBus {
3699
+ /**
3700
+ * Publish a change event to every registered listener.
3701
+ */
3702
+ publish(event: ServerEvent): void;
3703
+ /**
3704
+ * Register a listener; returns an idempotent unsubscribe function.
3705
+ */
3706
+ subscribe(listener: (event: ServerEvent) => void): () => void;
3707
+ }
3708
+ /**
3709
+ * A `ServerEventBus` backed by an in-process listener set.
3710
+ *
3711
+ * `publish()` delivers synchronously to the live listener set (a listener
3712
+ * unsubscribing itself mid-dispatch is safe; the entry's listen-router
3713
+ * listeners never unsubscribe peers). A throwing listener does not stop
3714
+ * delivery to the others.
3715
+ */
3716
+ declare class InMemoryServerEventBus implements ServerEventBus {
3717
+ private readonly onerror?;
3718
+ private readonly _listeners;
3719
+ /**
3720
+ * @param onerror - Optional callback for errors thrown by listeners
3721
+ * during dispatch.
3722
+ */
3723
+ constructor(onerror?: ((error: Error) => void) | undefined);
3724
+ publish(event: ServerEvent): void;
3725
+ subscribe(listener: (event: ServerEvent) => void): () => void;
3726
+ /** The number of currently registered listeners (test/introspection only — the routers track capacity via their own open-subscription set). */
3727
+ get listenerCount(): number;
3728
+ }
3729
+ /**
3730
+ * Typed publish-side facade over `bus.publish` returned by `createMcpHandler`:
3731
+ * each method publishes the corresponding {@linkcode ServerEvent}. Prefer this
3732
+ * over calling `bus.publish` directly — the names match the wire methods.
3733
+ */
3734
+ interface ServerNotifier {
3735
+ /** Publish `notifications/tools/list_changed` to every open subscription that opted in. */
3736
+ toolsChanged(): void;
3737
+ /** Publish `notifications/prompts/list_changed` to every open subscription that opted in. */
3738
+ promptsChanged(): void;
3739
+ /** Publish `notifications/resources/list_changed` to every open subscription that opted in. */
3740
+ resourcesChanged(): void;
3741
+ /** Publish `notifications/resources/updated` for `uri` to every open subscription that opted in to that URI. */
3742
+ resourceUpdated(uri: string): void;
3743
+ }
3744
+ //#endregion
3745
+ //#region src/server/createMcpHandler.d.ts
3746
+ /**
3747
+ * Construction context handed to an {@linkcode McpServerFactory}.
3748
+ *
3749
+ * Both serving entries call the factory with this context whenever they need
3750
+ * a fresh instance: {@linkcode createMcpHandler} once per HTTP request, and
3751
+ * `serveStdio` (from `@modelcontextprotocol/server/stdio`) once per
3752
+ * connection — plus once for a `server/discover` probe instance that is
3753
+ * discarded again if the client falls back to `initialize`.
3754
+ *
3755
+ * Zero-argument factories remain assignable unchanged; the context exists for
3756
+ * factories that vary by principal or era (for example multi-tenant servers
3757
+ * keyed off `authInfo`, or a factory that registers extra surface only for one
3758
+ * era).
3759
+ */
3760
+ interface McpRequestContext {
3761
+ /**
3762
+ * The protocol era the constructed instance will serve: `modern` for
3763
+ * 2026-07-28 (per-request envelope) traffic, `legacy` for 2025-era
3764
+ * traffic. Under {@linkcode createMcpHandler} a `legacy` instance serves
3765
+ * one request through the stateless legacy fallback (the default —
3766
+ * `legacy: 'reject'` endpoints are strict and never construct one); under
3767
+ * `serveStdio` it serves a connection that opened with the 2025 handshake
3768
+ * and stays pinned to that era for its lifetime.
3769
+ */
3770
+ era: 'legacy' | 'modern';
3771
+ /**
3772
+ * Validated authentication information passed by the caller of the
3773
+ * handler face (pass-through; HTTP only — `serveStdio` never sets it).
3774
+ */
3775
+ authInfo?: AuthInfo;
3776
+ /** The original HTTP request being served, when available (HTTP only — `serveStdio` never sets it). */
3777
+ requestInfo?: Request;
3778
+ }
3779
+ /**
3780
+ * A factory producing a fresh {@linkcode McpServer} (or low-level
3781
+ * {@linkcode Server}) instance for one serving unit: one HTTP request under
3782
+ * {@linkcode createMcpHandler}, or one connection (or one discarded
3783
+ * `server/discover` probe) under `serveStdio`. The same factory backs every
3784
+ * era either entry serves — define your tools, resources and prompts once and
3785
+ * serve them to both eras.
3786
+ */
3787
+ type McpServerFactory = (ctx: McpRequestContext) => McpServer | Server | Promise<McpServer | Server>;
3788
+ /** Caller-provided per-request inputs for {@linkcode McpHttpHandler.fetch} and fetch-shaped legacy handlers ({@linkcode LegacyHttpHandler}). */
3789
+ interface McpHandlerRequestOptions {
3790
+ /**
3791
+ * Validated authentication information for the request. Strictly
3792
+ * pass-through: the handler never populates this from request headers and
3793
+ * performs no token verification of its own.
3794
+ */
3795
+ authInfo?: AuthInfo;
3796
+ /** A pre-parsed JSON request body (e.g. `req.body` from `express.json()`). */
3797
+ parsedBody?: unknown;
3798
+ }
3799
+ /**
3800
+ * A fetch-shaped handler serving 2025-era traffic: the shape produced by
3801
+ * {@linkcode legacyStatelessFallback}, and the shape a hand-wired composition
3802
+ * routes legacy requests to (see {@linkcode isLegacyRequest}). It is not a
3803
+ * `legacy` option value — the entry's own legacy serving is selected by the
3804
+ * `'stateless' | 'reject'` posture only.
3805
+ */
3806
+ type LegacyHttpHandler = (request: Request, options?: McpHandlerRequestOptions) => Promise<Response>;
3807
+ /** Options for {@linkcode createMcpHandler}. */
3808
+ interface CreateMcpHandlerOptions {
3809
+ /**
3810
+ * How 2025-era (non-envelope) traffic is served:
3811
+ *
3812
+ * - `'stateless'` (the default, also when the option is omitted) —
3813
+ * old-school stateless serving: each legacy request is answered by a
3814
+ * fresh instance from the same factory over a streamable HTTP transport
3815
+ * constructed with only `sessionIdGenerator: undefined` (the established
3816
+ * stateless idiom). Because serving is per-request and stateless, GET and
3817
+ * DELETE (2025 session operations) are answered with `405` /
3818
+ * `Method not allowed.`.
3819
+ * - `'reject'` — modern-only strict: legacy-classified requests are
3820
+ * rejected with the unsupported-protocol-version error naming the
3821
+ * endpoint's supported revisions (legacy-classified notifications are
3822
+ * acknowledged with `202` and dropped). **There is no 2025 serving in
3823
+ * this mode.**
3824
+ *
3825
+ * There is no handler-valued option: to keep an existing legacy deployment
3826
+ * (for example a sessionful streamable HTTP wiring) serving 2025 traffic
3827
+ * next to this entry, route in user land with {@linkcode isLegacyRequest}
3828
+ * in front of a `legacy: 'reject'` handler — see that predicate's
3829
+ * documentation for the pattern.
3830
+ */
3831
+ legacy?: 'stateless' | 'reject';
3832
+ /** Callback for out-of-band errors and rejected requests (reporting only; it never alters the response). */
3833
+ onerror?: (error: Error) => void;
3834
+ /**
3835
+ * Response shaping for modern (2026-07-28) request exchanges:
3836
+ *
3837
+ * - `'auto'` (default) — a single JSON body unless the handler emits a
3838
+ * related message before its result, in which case the response upgrades
3839
+ * to an SSE stream.
3840
+ * - `'sse'` — always stream.
3841
+ * - `'json'` — never stream. **Mid-call notifications (progress, logging,
3842
+ * any related message emitted before the result) are dropped** — only the
3843
+ * terminal result is delivered. Listen-class subscription streams are
3844
+ * always served over SSE regardless of this setting.
3845
+ */
3846
+ responseMode?: PerRequestResponseMode;
3847
+ /**
3848
+ * The change-event bus `subscriptions/listen` streams subscribe to.
3849
+ *
3850
+ * When omitted, an in-process {@link InMemoryServerEventBus} is created
3851
+ * and the returned handler's `notify` sugar publishes onto it.
3852
+ * Multi-process deployments supply their own implementation over their
3853
+ * pub/sub backend; the same instance can be shared across handlers.
3854
+ */
3855
+ bus?: ServerEventBus;
3856
+ /**
3857
+ * Reject a new `subscriptions/listen` with `-32603` 'Subscription limit
3858
+ * reached' (in-band, HTTP 200, before the ack) when this many subscription
3859
+ * streams are already open on this handler.
3860
+ * @default 1024
3861
+ */
3862
+ maxSubscriptions?: number;
3863
+ /**
3864
+ * SSE comment-frame keepalive interval for `subscriptions/listen` streams,
3865
+ * in milliseconds. Set to `0` to disable.
3866
+ * @default 15000
3867
+ */
3868
+ keepAliveMs?: number;
3869
+ }
3870
+ /**
3871
+ * The handler returned by {@linkcode createMcpHandler}: a web-standard
3872
+ * `{ fetch, close, notify, bus }` object — the shape Workers/Bun/Deno expect
3873
+ * from `export default`. `fetch` is an arrow-assigned bound property: it can be
3874
+ * detached and passed around (`const { fetch } = handler`) without losing its
3875
+ * binding.
3876
+ *
3877
+ * Node frameworks (Express, Fastify, plain `node:http`) wrap the handler once
3878
+ * with `toNodeHandler(handler)` from `@modelcontextprotocol/node`.
3879
+ */
3880
+ interface McpHttpHandler {
3881
+ /** Web-standard face: serve one HTTP request and resolve with the response. */
3882
+ fetch: (request: Request, options?: McpHandlerRequestOptions) => Promise<Response>;
3883
+ /**
3884
+ * Tears down the modern leg: aborts in-flight modern exchanges and closes
3885
+ * their per-request instances. Legacy serving is unaffected — the
3886
+ * stateless fallback is per-request by construction and holds nothing
3887
+ * between exchanges.
3888
+ */
3889
+ close: () => Promise<void>;
3890
+ /**
3891
+ * Typed publish-side facade over the handler's `subscriptions/listen` bus:
3892
+ * each method publishes the corresponding change event to every open
3893
+ * subscription stream that opted in to that notification type.
3894
+ *
3895
+ * Safe to call when no subscription is open (no-op).
3896
+ */
3897
+ notify: ServerNotifier;
3898
+ /**
3899
+ * The change-event bus this handler's `subscriptions/listen` streams
3900
+ * subscribe to (the supplied `bus` option, or the auto-created in-process
3901
+ * default).
3902
+ */
3903
+ bus: ServerEventBus;
3904
+ }
3905
+ /**
3906
+ * The entry's default legacy serving (`legacy: 'stateless'`): per-request
3907
+ * stateless serving of 2025-era traffic using the same factory as the modern
3908
+ * path. Exported as a standalone building block for hand-wired compositions
3909
+ * (for example mounting legacy stateless serving on its own route next to a
3910
+ * strict modern endpoint).
3911
+ *
3912
+ * Each POST is served by a fresh instance from the factory connected to a
3913
+ * fresh streamable HTTP transport constructed with only
3914
+ * `sessionIdGenerator: undefined` — the established stateless idiom, unchanged.
3915
+ * Because serving is per-request and stateless, GET and DELETE (2025 session
3916
+ * operations) are answered with `405` / `Method not allowed.`, exactly like the
3917
+ * canonical stateless example.
3918
+ *
3919
+ * The optional `onerror` callback receives factory and serving failures on
3920
+ * this leg (reporting only — the response stays the 500 internal-error body).
3921
+ * The entry passes its own `onerror` here when expanding the default, so
3922
+ * legacy-leg failures are never silently swallowed.
3923
+ */
3924
+ declare function legacyStatelessFallback(factory: McpServerFactory, onerror?: (error: Error) => void): LegacyHttpHandler;
3925
+ /**
3926
+ * Whether {@linkcode createMcpHandler} would route this request to its legacy
3927
+ * (2025-era) serving rather than the modern (2026-07-28) path.
3928
+ *
3929
+ * Call it with just the request: `await isLegacyRequest(request)`. For a
3930
+ * `POST` the body is read from an internal clone, so the request you pass
3931
+ * stays fully readable for whichever handler you route it to — no second
3932
+ * argument is needed. (In a Node `(req, res)` handler, build that `Request`
3933
+ * with `toWebRequest(req)` from `@modelcontextprotocol/node`; behind a body
3934
+ * parser, which has already drained the Node stream, build it as
3935
+ * `toWebRequest(req, req.body)` so the bytes come from the parsed body —
3936
+ * either way the predicate still takes just the request.) The optional
3937
+ * `parsedBody` is a perf escape hatch for a body you already hold parsed:
3938
+ * pass it and the predicate classifies from the value directly, reading and
3939
+ * cloning nothing. It is needed, not just faster, when the request's own
3940
+ * body was already read — the internal clone is then impossible (cloning a
3941
+ * used body throws a `TypeError`), so such a single-argument call rejects
3942
+ * instead of guessing.
3943
+ *
3944
+ * This is the entry's own classification step exported as a predicate — it
3945
+ * runs exactly the code `createMcpHandler` runs to make the routing decision,
3946
+ * not a re-implementation — so a hand-wired composition that branches on it
3947
+ * can never disagree with the entry. It is classification only: hand-wired
3948
+ * compositions must validate Content-Type themselves (415 for POSTs whose
3949
+ * media type is not `application/json`, via {@linkcode isJsonContentType})
3950
+ * before dispatching either leg — routing the legacy leg into the SDK
3951
+ * transports gets their built-in check, but a custom modern leg has none. Use it to keep an existing legacy
3952
+ * deployment (for example a sessionful streamable HTTP wiring) serving 2025
3953
+ * traffic next to a strict modern endpoint, now that the entry has no
3954
+ * handler-valued `legacy` option:
3955
+ *
3956
+ * ```ts
3957
+ * import { createMcpHandler, isLegacyRequest } from '@modelcontextprotocol/server';
3958
+ *
3959
+ * const modern = createMcpHandler(factory, { legacy: 'reject' });
3960
+ *
3961
+ * export default {
3962
+ * async fetch(request: Request): Promise<Response> {
3963
+ * if (await isLegacyRequest(request)) {
3964
+ * // e.g. an existing sessionful WebStandardStreamableHTTPServerTransport wiring
3965
+ * return myExistingLegacyHandler(request);
3966
+ * }
3967
+ * return modern.fetch(request);
3968
+ * }
3969
+ * };
3970
+ * ```
3971
+ *
3972
+ * Semantics (identical to the entry's routing):
3973
+ *
3974
+ * - Returns `true` only for requests with no per-request `_meta` envelope
3975
+ * claim: claim-less POSTs (including the `initialize` handshake and 2025-era
3976
+ * notification POSTs without a modern protocol-version header), body-less
3977
+ * GET/DELETE session operations, all-legacy JSON-RPC batch arrays, posted
3978
+ * JSON-RPC responses, and POSTs whose body is empty or not valid JSON.
3979
+ * - Returns `false` for everything the modern path answers, including its
3980
+ * validation-ladder rejections: a request carrying the envelope claim (even
3981
+ * one naming a revision the endpoint does not serve — the modern path
3982
+ * answers it with the unsupported-protocol-version error), a malformed
3983
+ * envelope behind a present claim (answered `-32602`), a request whose
3984
+ * `MCP-Protocol-Version` header names a modern revision but that lacks the
3985
+ * envelope (`-32602`), and header/body mismatches (`-32020`). Consumers
3986
+ * routing on the predicate must send `false` traffic to the modern handler,
3987
+ * never to a legacy handler — the modern path owns those error answers.
3988
+ * - `server/discover` probes sent by negotiating clients always carry the
3989
+ * envelope claim, so they are never legacy; a hand-built claim-less POST to
3990
+ * a method named `server/discover` has no claim and classifies legacy,
3991
+ * exactly as the entry itself routes it.
3992
+ */
3993
+ declare function isLegacyRequest(request: Request, parsedBody?: unknown): Promise<boolean>;
3994
+ /**
3995
+ * Creates an HTTP handler that serves the 2026-07-28 protocol revision from a
3996
+ * per-request server factory and, by default, falls back to old-school
3997
+ * stateless serving for 2025-era traffic. Pass `legacy: 'reject'` for a
3998
+ * modern-only strict endpoint.
3999
+ *
4000
+ * Mounting: `handler.fetch` is the web-standard face (Cloudflare Workers,
4001
+ * Deno, Bun, Hono's `c.req.raw`); for Express/Fastify/plain `node:http`, wrap
4002
+ * the handler once with `toNodeHandler(handler)` from
4003
+ * `@modelcontextprotocol/node`. When mounting bare on a fetch-native runtime,
4004
+ * put Origin/Host validation in front of the handler — the entry itself is
4005
+ * deliberately validation-free:
4006
+ *
4007
+ * ```ts
4008
+ * import { hostHeaderValidationResponse, originValidationResponse, localhostAllowedHostnames, localhostAllowedOrigins } from '@modelcontextprotocol/server';
4009
+ *
4010
+ * export default {
4011
+ * async fetch(request: Request): Promise<Response> {
4012
+ * const rejected =
4013
+ * hostHeaderValidationResponse(request, localhostAllowedHostnames()) ??
4014
+ * originValidationResponse(request, localhostAllowedOrigins());
4015
+ * return rejected ?? handler.fetch(request);
4016
+ * }
4017
+ * };
4018
+ * ```
4019
+ *
4020
+ * Use ONE factory for both legs: the same tools/resources/prompts definition
4021
+ * backs the modern path and the stateless legacy fallback, so the two eras can
4022
+ * never drift apart. To keep an existing legacy deployment (for example a
4023
+ * sessionful streamable HTTP wiring) serving 2025 traffic instead of the
4024
+ * stateless fallback, route in user land with {@linkcode isLegacyRequest} in
4025
+ * front of a strict handler — see that predicate's documentation for the
4026
+ * pattern. Power users composing transport-neutral routing can also use the
4027
+ * exported building blocks directly: {@linkcode classifyInboundRequest} for
4028
+ * the era decision and `PerRequestHTTPServerTransport` for single-exchange
4029
+ * serving — such compositions must reject POSTs whose Content-Type media type
4030
+ * is not `application/json` (415) before parsing the body, using
4031
+ * {@linkcode isJsonContentType}; neither building block performs this
4032
+ * validation itself.
4033
+ *
4034
+ * The entry performs no token verification: `authInfo` given to `fetch` is
4035
+ * passed through to handlers and the factory as-is and is never derived from
4036
+ * request headers.
4037
+ */
4038
+ declare function createMcpHandler(factory: McpServerFactory, options?: CreateMcpHandlerOptions): McpHttpHandler;
4039
+ //#endregion
4040
+ export { Protocol as $, OAuthError as $a, SubscriptionsAcknowledgedNotification as $i, InitializeRequestParams as $n, PaginatedResult as $r, BaseMetadata as $t, ResourceMetadata as A, CLIENT_INFO_META_KEY as Aa, ResourceTemplateType as Ai, ElicitRequest as An, ListRootsResult as Ar, UnsupportedProtocolVersionError as At, STDIO_DEFAULT_MAX_BUFFER_SIZE as B, PROTOCOL_VERSION_META_KEY as Ba, SamplingMessage as Bi, GetPromptRequest as Bn, MetaObject as Br, StandardSchemaV1Sync as Bt, PromptCallback as C, UnsubscribeRequest as Ca, RequestTypeMap as Ci, CreateMessageRequestParamsWithTools as Cn, ListPromptsRequest as Cr, isJSONRPCResponse as Ct, RegisteredResource as D, UntitledSingleSelectEnumSchema as Da, ResourceListChangedNotification as Di, Cursor as Dn, ListResourcesRequest as Dr, MissingRequiredClientCapabilityError as Dt, RegisteredPrompt as E, UntitledMultiSelectEnumSchema as Ea, ResourceLink as Ei, CreateTaskResult as En, ListResourceTemplatesResult as Er, parseJSONRPCMessage as Et, preloadSchemas as F, JSONRPC_VERSION as Fa, ResultTypeMap as Fi, ElicitationCompleteNotification as Fn, LoggingLevel as Fr, acceptedContent as Ft, ProtocolEra as G, TRACEPARENT_META_KEY as Ga, ServerResult as Gi, GetTaskRequest as Gn, MultiSelectEnumSchema as Gr, InboundLegacyRoute as Gt, serializeMessage as H, SERVER_INFO_META_KEY as Ha, ServerCapabilities as Hi, GetPromptResult as Hn, MissingRequiredClientCapabilityErrorData as Hr, InboundClassificationOutcome as Ht, InMemoryTransport as I, LATEST_PROTOCOL_VERSION as Ia, Role as Ii, ElicitationCompleteNotificationParams as In, LoggingMessageNotification as Ir, inputRequired as It, BaseContext as J, resourceUrlFromServerUrl as Ja, SingleSelectEnumSchema as Ji, Icon as Jn, NotificationParams as Jr, InboundValidationRung as Jt, getDisplayName as K, TRACESTATE_META_KEY as Ka, SetLevelRequest as Ki, GetTaskResult as Kn, Notification as Kr, InboundLegacyRouteReason as Kt, UriTemplate as L, LOG_LEVEL_META_KEY as La, Root as Li, EmbeddedResource as Ln, LoggingMessageNotificationParams as Lr, inputResponse as Lt, ToolCallback as M, INTERNAL_ERROR as Ma, ResourceUpdatedNotificationParams as Mi, ElicitRequestParams as Mn, ListTasksResult as Mr, ProtocolErrorCode as Mt, Server as N, INVALID_PARAMS as Na, Result$1 as Ni, ElicitRequestURLParams as Nn, ListToolsRequest as Nr, InputRequiredSpec as Nt, RegisteredResourceTemplate as O, BAGGAGE_META_KEY as Oa, ResourceRequestParams as Oi, DiscoverRequest as On, ListResourcesResult as Or, ProtocolError as Ot, ServerOptions as P, INVALID_REQUEST as Pa, ResultMetaObject as Pi, ElicitResult as Pn, ListToolsResult as Pr, InputResponseView as Pt, ProgressCallback as Q, SdkHttpErrorData as Qa, SubscriptionFilter as Qi, InitializeRequest as Qn, PaginatedRequestParams as Qr, AuthInfo as Qt, Variables as R, METHOD_NOT_FOUND as Ra, RootsListChangedNotification as Ri, EmptyResult as Rn, MessageClassification as Rr, ElicitInputParams as Rt, McpServer as S, ToolUseContent as Sa, RequestParams as Si, CreateMessageRequestParamsBase as Sn, ListChangedOptions as Sr, isJSONRPCRequest as St, ReadResourceTemplateCallback as T, UnsupportedProtocolVersionErrorData as Ta, ResourceContents as Ti, CreateMessageResultWithTools as Tn, ListResourceTemplatesRequest as Tr, isTaskAugmentedRequestParams as Tt, CacheHint as U, SUBSCRIPTION_ID_META_KEY as Ua, ServerNotification as Ui, GetTaskPayloadRequest as Un, ModelHint as Ur, InboundHttpRequest as Ut, deserializeMessage as V, RELATED_TASK_META_KEY as Va, SamplingMessageContentBlock as Vi, GetPromptRequestParams as Vn, MethodNotFoundError as Vr, StandardSchemaWithJSON as Vt, CacheScope as W, SUPPORTED_PROTOCOL_VERSIONS as Wa, ServerRequest as Wi, GetTaskPayloadResult as Wn, ModelPreferences as Wr, InboundLadderRejection as Wt, DEFAULT_REQUEST_TIMEOUT_MSEC as X, SdkErrorCode as Xa, SubscribeRequest as Xi, ImageContent as Xn, NumberSchema as Xr, Annotations as Xt, ClientContext as Y, SdkError as Ya, StringSchema as Yi, Icons as Yn, NotificationTypeMap as Yr, classifyInboundRequest as Yt, NotificationOptions as Z, SdkHttpError as Za, SubscribeRequestParams as Zi, Implementation as Zn, PaginatedRequest as Zr, AudioContent as Zt, PerRequestResponseMode as _, ToolAnnotations as _a, RequestId as _i, CompleteRequestResourceTemplate as _n, JSONRPCResultResponse as _r, isInitializeRequest as _t, McpRequestContext as a, Task as aa, ProgressNotificationParams as ai, CancelTaskRequest as an, OAuthClientInformationMixed as ao, InputResponse as ar, mergeCapabilities as at, CompleteResourceTemplateCallback as b, ToolListChangedNotification as ba, RequestMetaObject as bi, CreateMessageRequest as bn, ListChangedCallback as br, isJSONRPCErrorResponse as bt, isLegacyRequest as c, TaskMetadata as ca, PromptArgument as ci, CancelledNotificationParams as cn, OAuthErrorResponse as co, InvalidParamsError as cr, TransportSendOptions as ct, ServerEvent as d, TaskStatusNotificationParams as da, PromptReference as di, ClientRequest as dn, OAuthTokenRevocationRequest as do, JSONObject as dr, SpecTypes as dt, SubscriptionsAcknowledgedNotificationParams as ea, ParseError as ei, BlobResourceContents as en, OAuthErrorCode as eo, InitializeResult as er, ProtocolOptions as et, ServerEventBus as f, TextContent as fa, ReadResourceRequest as fi, ClientResult as fn, OAuthTokens as fo, JSONRPCErrorResponse as fr, isSpecType as ft, PerRequestMessageExtra as g, Tool as ga, Request$1 as gi, CompleteRequestPrompt as gn, StoredOAuthTokens as go, JSONRPCResponse as gr, isCallToolResult as gt, PerRequestHTTPServerTransportOptions as h, TitledSingleSelectEnumSchema as ha, RelatedTaskMetadata as hi, CompleteRequestParams as hn, StoredOAuthClientInformation as ho, JSONRPCRequest as hr, assertCompleteRequestResourceTemplate as ht, McpHttpHandler as i, SubscriptionsListenResultMeta as ia, ProgressNotification as ii, CallToolResult as in, OAuthClientInformationFull as io, InputRequiredResult as ir, ServerContext as it, ResourceTemplate as j, DEFAULT_NEGOTIATED_PROTOCOL_VERSION as ja, ResourceUpdatedNotification as ji, ElicitRequestFormParams as jn, ListTasksRequest as jr, UrlElicitationRequiredError as jt, RegisteredTool as k, CLIENT_CAPABILITIES_META_KEY as ka, ResourceTemplateReference as ki, DiscoverResult as kn, ListRootsRequest as kr, ResourceNotFoundError as kt, legacyStatelessFallback as l, TaskStatus as la, PromptListChangedNotification as li, ClientCapabilities as ln, OAuthMetadata as lo, InvalidRequestError as lr, createFetchWithInit as lt, PerRequestHTTPServerTransport as m, TitledMultiSelectEnumSchema as ma, ReadResourceResult as mi, CompleteRequest as mn, OpenIdProviderMetadata as mo, JSONRPCNotification as mr, assertCompleteRequestPrompt as mt, LegacyHttpHandler as n, SubscriptionsListenRequestParams as na, PrimitiveSchemaDefinition as ni, CallToolRequest as nn, IdJagTokenExchangeResponse as no, InputRequest as nr, RequestOptions as nt, McpServerFactory as o, TaskAugmentedRequestParams as oa, ProgressToken as oi, CancelTaskResult as on, OAuthClientMetadata as oo, InputResponses as or, FetchLike as ot, ServerNotifier as p, TextResourceContents as pa, ReadResourceRequestParams as pi, CompatibilityCallToolResult as pn, OpenIdProviderDiscoveryMetadata as po, JSONRPCMessage as pr, specTypeSchemas as pt, isJsonContentType as q, checkResourceAllowed as qa, SetLevelRequestParams as qi, HandlerResultTypeMap as qn, NotificationMethod as qr, InboundModernRoute as qt, McpHandlerRequestOptions as r, SubscriptionsListenResult as ra, Progress as ri, CallToolRequestParams as rn, OAuthClientInformation as ro, InputRequests as rr, RequestStateAccessor as rt, createMcpHandler as s, TaskCreationParams as sa, Prompt as si, CancelledNotification as sn, OAuthClientRegistrationError as so, InternalError as sr, Transport as st, CreateMcpHandlerOptions as t, SubscriptionsListenRequest as ta, PingRequest as ti, BooleanSchema as tn, AuthorizationServerMetadata as to, InitializedNotification as tr, RequestHandlerSchemas as tt, InMemoryServerEventBus as u, TaskStatusNotification as ua, PromptMessage as ui, ClientNotification as un, OAuthProtectedResourceMetadata as uo, JSONArray as ur, SpecTypeName as ut, AnyToolHandler as v, ToolChoice as va, RequestMeta as vi, CompleteResult as vn, JSONValue as vr, isInitializedNotification as vt, ReadResourceCallback as w, UnsubscribeRequestParams as wa, Resource as wi, CreateMessageResult as wn, ListPromptsResult as wr, isJSONRPCResultResponse as wt, ListResourcesCallback as x, ToolResultContent as xa, RequestMethod as xi, CreateMessageRequestParams as xn, ListChangedHandlers as xr, isJSONRPCNotification as xt, BaseToolCallback as y, ToolExecution as ya, RequestMetaEnvelope as yi, ContentBlock as yn, LegacyTitledEnumSchema as yr, isInputRequiredResult as yt, ReadBuffer as z, PARSE_ERROR as za, SamplingContent as zi, EnumSchema as zn, MessageExtraInfo as zr, StandardSchemaV1 as zt };
4041
+ //# sourceMappingURL=createMcpHandler-CEckaSEs.d.mts.map