@noodleseed/one 0.95.1 → 0.96.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 (549) hide show
  1. package/dist/commands/auth-live-doctor.d.ts +1 -0
  2. package/dist/commands/auth-live-doctor.d.ts.map +1 -1
  3. package/dist/commands/auth-live-doctor.js +7 -6
  4. package/dist/commands/auth-live-doctor.js.map +1 -1
  5. package/dist/commands/auth-metadata-readiness.d.ts +2 -0
  6. package/dist/commands/auth-metadata-readiness.d.ts.map +1 -1
  7. package/dist/commands/auth-metadata-readiness.js +7 -0
  8. package/dist/commands/auth-metadata-readiness.js.map +1 -1
  9. package/dist/commands/auth-ops.d.ts +1 -0
  10. package/dist/commands/auth-ops.d.ts.map +1 -1
  11. package/dist/commands/auth-ops.js +26 -7
  12. package/dist/commands/auth-ops.js.map +1 -1
  13. package/dist/commands/author-loop.d.ts.map +1 -1
  14. package/dist/commands/author-loop.js +3 -2
  15. package/dist/commands/author-loop.js.map +1 -1
  16. package/dist/commands/catalog-data-auth-discovery.d.ts.map +1 -1
  17. package/dist/commands/catalog-data-auth-discovery.js +7 -0
  18. package/dist/commands/catalog-data-auth-discovery.js.map +1 -1
  19. package/dist/commands/connect-oauth.d.ts.map +1 -1
  20. package/dist/commands/connect-oauth.js +1 -0
  21. package/dist/commands/connect-oauth.js.map +1 -1
  22. package/dist/dev.d.ts +6 -1
  23. package/dist/dev.d.ts.map +1 -1
  24. package/dist/dev.js +120 -34
  25. package/dist/dev.js.map +1 -1
  26. package/dist/device-login.js +1 -0
  27. package/dist/device-login.js.map +1 -1
  28. package/dist/devtools-preview.d.ts.map +1 -1
  29. package/dist/devtools-preview.js +82 -8
  30. package/dist/devtools-preview.js.map +1 -1
  31. package/dist/plugin-mode/build-readiness-server.d.ts +1 -1
  32. package/dist/plugin-mode/build-readiness-server.d.ts.map +1 -1
  33. package/dist/plugin-mode/build-readiness-server.js +3 -4
  34. package/dist/plugin-mode/build-readiness-server.js.map +1 -1
  35. package/dist/plugin-mode/plugin-operation-contract.d.ts +1 -1
  36. package/dist/plugin-mode/plugin-operation-contract.d.ts.map +1 -1
  37. package/dist/plugin-mode/plugin-operation-tools.d.ts +1 -2
  38. package/dist/plugin-mode/plugin-operation-tools.d.ts.map +1 -1
  39. package/dist/plugin-mode/plugin-operation-tools.js.map +1 -1
  40. package/dist/saas-scaffold-template.d.ts.map +1 -1
  41. package/dist/saas-scaffold-template.js +2 -1
  42. package/dist/saas-scaffold-template.js.map +1 -1
  43. package/node_modules/@modelcontextprotocol/client/LICENSE +216 -0
  44. package/node_modules/@modelcontextprotocol/client/README.md +26 -0
  45. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-1b6pVpkg.cjs +7531 -0
  46. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-1b6pVpkg.cjs.map +1 -0
  47. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-97rDpkRx.mjs +7514 -0
  48. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-97rDpkRx.mjs.map +1 -0
  49. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-FOQRM7up.d.cts +1071 -0
  50. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-FOQRM7up.d.cts.map +1 -0
  51. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-INpkxUi1.d.mts +1071 -0
  52. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-INpkxUi1.d.mts.map +1 -0
  53. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3ZJEoRM.d.mts +74 -0
  54. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3ZJEoRM.d.mts.map +1 -0
  55. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3dvjU3F.cjs +986 -0
  56. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-B3dvjU3F.cjs.map +1 -0
  57. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-BylNJ1R5.mjs +981 -0
  58. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-BylNJ1R5.mjs.map +1 -0
  59. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-doTkZbTr.d.cts +74 -0
  60. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
  61. package/node_modules/@modelcontextprotocol/client/dist/chunk-Bnu9O96Y.cjs +60 -0
  62. package/node_modules/@modelcontextprotocol/client/dist/chunk-Br0eD_fh.mjs +42 -0
  63. package/node_modules/@modelcontextprotocol/client/dist/dialects-BGO_ZrYF.cjs +46 -0
  64. package/node_modules/@modelcontextprotocol/client/dist/dialects-BGO_ZrYF.cjs.map +1 -0
  65. package/node_modules/@modelcontextprotocol/client/dist/dialects-BOhdv1Fc.mjs +34 -0
  66. package/node_modules/@modelcontextprotocol/client/dist/dialects-BOhdv1Fc.mjs.map +1 -0
  67. package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts +2526 -0
  68. package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts.map +1 -0
  69. package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts +2523 -0
  70. package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts.map +1 -0
  71. package/node_modules/@modelcontextprotocol/client/dist/index.cjs +5690 -0
  72. package/node_modules/@modelcontextprotocol/client/dist/index.cjs.map +1 -0
  73. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts +3252 -0
  74. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -0
  75. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts +3252 -0
  76. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -0
  77. package/node_modules/@modelcontextprotocol/client/dist/index.mjs +5481 -0
  78. package/node_modules/@modelcontextprotocol/client/dist/index.mjs.map +1 -0
  79. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs +14 -0
  80. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs.map +1 -0
  81. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts +13 -0
  82. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts.map +1 -0
  83. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts +13 -0
  84. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts.map +1 -0
  85. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs +13 -0
  86. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs.map +1 -0
  87. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs +14 -0
  88. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs.map +1 -0
  89. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts +13 -0
  90. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts.map +1 -0
  91. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts +13 -0
  92. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts.map +1 -0
  93. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs +13 -0
  94. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs.map +1 -0
  95. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +21 -0
  96. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs.map +1 -0
  97. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts +13 -0
  98. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts.map +1 -0
  99. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts +13 -0
  100. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts.map +1 -0
  101. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +20 -0
  102. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs.map +1 -0
  103. package/node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs +7063 -0
  104. package/node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs.map +1 -0
  105. package/node_modules/@modelcontextprotocol/client/dist/src-NAgB4Mp8.cjs +7431 -0
  106. package/node_modules/@modelcontextprotocol/client/dist/src-NAgB4Mp8.cjs.map +1 -0
  107. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +217 -0
  108. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs.map +1 -0
  109. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts +96 -0
  110. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +1 -0
  111. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts +96 -0
  112. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +1 -0
  113. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +212 -0
  114. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs.map +1 -0
  115. package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts +1099 -0
  116. package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts.map +1 -0
  117. package/node_modules/@modelcontextprotocol/client/dist/types-mS0yxCL0.d.mts +1099 -0
  118. package/node_modules/@modelcontextprotocol/client/dist/types-mS0yxCL0.d.mts.map +1 -0
  119. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.cjs +5 -0
  120. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.cts +2 -0
  121. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.mts +2 -0
  122. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.mjs +3 -0
  123. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.cjs +3 -0
  124. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.cts +2 -0
  125. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.mts +2 -0
  126. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.mjs +3 -0
  127. package/node_modules/@modelcontextprotocol/client/package.json +166 -0
  128. package/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
  129. package/node_modules/@modelcontextprotocol/core/README.md +40 -0
  130. package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts +8501 -0
  131. package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts.map +1 -0
  132. package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs +1678 -0
  133. package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +1 -0
  134. package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs +2899 -0
  135. package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +1 -0
  136. package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts +8501 -0
  137. package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts.map +1 -0
  138. package/node_modules/@modelcontextprotocol/core/dist/index.cjs +175 -0
  139. package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -0
  140. package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -0
  141. package/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
  142. package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +201 -0
  143. package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +99 -0
  144. package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
  145. package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +99 -0
  146. package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
  147. package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
  148. package/node_modules/@modelcontextprotocol/core/package.json +85 -0
  149. package/node_modules/@modelcontextprotocol/server/LICENSE +216 -0
  150. package/node_modules/@modelcontextprotocol/server/README.md +30 -0
  151. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs +7514 -0
  152. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs.map +1 -0
  153. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts +1071 -0
  154. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts.map +1 -0
  155. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts +1071 -0
  156. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts.map +1 -0
  157. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs +7531 -0
  158. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs.map +1 -0
  159. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs +986 -0
  160. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs.map +1 -0
  161. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts +74 -0
  162. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts.map +1 -0
  163. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts +74 -0
  164. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
  165. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs +981 -0
  166. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs.map +1 -0
  167. package/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +60 -0
  168. package/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +42 -0
  169. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts +4043 -0
  170. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts.map +1 -0
  171. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts +4045 -0
  172. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts.map +1 -0
  173. package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs +46 -0
  174. package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs.map +1 -0
  175. package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs +34 -0
  176. package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs.map +1 -0
  177. package/node_modules/@modelcontextprotocol/server/dist/index.cjs +2055 -0
  178. package/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -0
  179. package/node_modules/@modelcontextprotocol/server/dist/index.d.cts +739 -0
  180. package/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -0
  181. package/node_modules/@modelcontextprotocol/server/dist/index.d.mts +739 -0
  182. package/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -0
  183. package/node_modules/@modelcontextprotocol/server/dist/index.mjs +1870 -0
  184. package/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -0
  185. package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs +2022 -0
  186. package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs.map +1 -0
  187. package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs +1931 -0
  188. package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs.map +1 -0
  189. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +23 -0
  190. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +1 -0
  191. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +11 -0
  192. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +1 -0
  193. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +11 -0
  194. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +1 -0
  195. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +22 -0
  196. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +1 -0
  197. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +12 -0
  198. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +3 -0
  199. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +3 -0
  200. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +4 -0
  201. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +30 -0
  202. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +1 -0
  203. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +10 -0
  204. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +1 -0
  205. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +10 -0
  206. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +1 -0
  207. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +29 -0
  208. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +1 -0
  209. package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs +7606 -0
  210. package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs.map +1 -0
  211. package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs +8104 -0
  212. package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs.map +1 -0
  213. package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +564 -0
  214. package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -0
  215. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +107 -0
  216. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -0
  217. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +107 -0
  218. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -0
  219. package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +562 -0
  220. package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -0
  221. package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts +1099 -0
  222. package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts.map +1 -0
  223. package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +1099 -0
  224. package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +1 -0
  225. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +5 -0
  226. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +2 -0
  227. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +2 -0
  228. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +3 -0
  229. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +3 -0
  230. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +2 -0
  231. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +2 -0
  232. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +3 -0
  233. package/node_modules/@modelcontextprotocol/server/package.json +160 -0
  234. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +4 -4
  235. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js.map +1 -1
  236. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-auth-ref.js +3 -3
  237. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-auth-ref.js.map +1 -1
  238. package/node_modules/@noodle-borg/agent-kit/dist/skill-server-playbook-ref.d.ts.map +1 -1
  239. package/node_modules/@noodle-borg/agent-kit/dist/skill-server-playbook-ref.js +1 -0
  240. package/node_modules/@noodle-borg/agent-kit/dist/skill-server-playbook-ref.js.map +1 -1
  241. package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
  242. package/node_modules/@noodle-borg/capabilities/dist/index.d.ts.map +1 -1
  243. package/node_modules/@noodle-borg/capabilities/dist/index.js +11 -4
  244. package/node_modules/@noodle-borg/capabilities/dist/index.js.map +1 -1
  245. package/node_modules/@noodle-borg/developer-mcp/dist/prompts.d.ts +1 -1
  246. package/node_modules/@noodle-borg/developer-mcp/dist/prompts.d.ts.map +1 -1
  247. package/node_modules/@noodle-borg/developer-mcp/dist/resources.d.ts +1 -1
  248. package/node_modules/@noodle-borg/developer-mcp/dist/resources.d.ts.map +1 -1
  249. package/node_modules/@noodle-borg/developer-mcp/dist/server.d.ts +1 -1
  250. package/node_modules/@noodle-borg/developer-mcp/dist/server.d.ts.map +1 -1
  251. package/node_modules/@noodle-borg/developer-mcp/dist/server.js +3 -1
  252. package/node_modules/@noodle-borg/developer-mcp/dist/server.js.map +1 -1
  253. package/node_modules/@noodle-borg/developer-mcp/package.json +2 -1
  254. package/node_modules/@noodle-borg/module/dist/contract.d.ts +3 -1
  255. package/node_modules/@noodle-borg/module/dist/contract.d.ts.map +1 -1
  256. package/node_modules/@noodle-borg/module/dist/contract.js.map +1 -1
  257. package/node_modules/@noodle-borg/protocol/dist/error-codes.d.ts +11 -0
  258. package/node_modules/@noodle-borg/protocol/dist/error-codes.d.ts.map +1 -0
  259. package/node_modules/@noodle-borg/protocol/dist/error-codes.js +11 -0
  260. package/node_modules/@noodle-borg/protocol/dist/error-codes.js.map +1 -0
  261. package/node_modules/@noodle-borg/protocol/dist/handlers/prompts.d.ts +6 -0
  262. package/node_modules/@noodle-borg/protocol/dist/handlers/prompts.d.ts.map +1 -0
  263. package/node_modules/@noodle-borg/protocol/dist/handlers/prompts.js +31 -0
  264. package/node_modules/@noodle-borg/protocol/dist/handlers/prompts.js.map +1 -0
  265. package/node_modules/@noodle-borg/protocol/dist/handlers/resources.d.ts +6 -0
  266. package/node_modules/@noodle-borg/protocol/dist/handlers/resources.d.ts.map +1 -0
  267. package/node_modules/@noodle-borg/protocol/dist/handlers/resources.js +50 -0
  268. package/node_modules/@noodle-borg/protocol/dist/handlers/resources.js.map +1 -0
  269. package/node_modules/@noodle-borg/protocol/dist/handlers/tools.d.ts +6 -0
  270. package/node_modules/@noodle-borg/protocol/dist/handlers/tools.d.ts.map +1 -0
  271. package/node_modules/@noodle-borg/protocol/dist/handlers/tools.js +126 -0
  272. package/node_modules/@noodle-borg/protocol/dist/handlers/tools.js.map +1 -0
  273. package/node_modules/@noodle-borg/protocol/dist/index.d.ts +6 -2
  274. package/node_modules/@noodle-borg/protocol/dist/index.d.ts.map +1 -1
  275. package/node_modules/@noodle-borg/protocol/dist/index.js +4 -1
  276. package/node_modules/@noodle-borg/protocol/dist/index.js.map +1 -1
  277. package/node_modules/@noodle-borg/protocol/dist/interaction-envelope.d.ts +10 -0
  278. package/node_modules/@noodle-borg/protocol/dist/interaction-envelope.d.ts.map +1 -0
  279. package/node_modules/@noodle-borg/protocol/dist/interaction-envelope.js +66 -0
  280. package/node_modules/@noodle-borg/protocol/dist/interaction-envelope.js.map +1 -0
  281. package/node_modules/@noodle-borg/protocol/dist/jsonrpc.d.ts +1 -0
  282. package/node_modules/@noodle-borg/protocol/dist/jsonrpc.d.ts.map +1 -1
  283. package/node_modules/@noodle-borg/protocol/dist/jsonrpc.js +1 -0
  284. package/node_modules/@noodle-borg/protocol/dist/jsonrpc.js.map +1 -1
  285. package/node_modules/@noodle-borg/protocol/dist/observation.d.ts +27 -0
  286. package/node_modules/@noodle-borg/protocol/dist/observation.d.ts.map +1 -0
  287. package/node_modules/@noodle-borg/protocol/dist/observation.js +20 -0
  288. package/node_modules/@noodle-borg/protocol/dist/observation.js.map +1 -0
  289. package/node_modules/@noodle-borg/protocol/dist/request-deps.d.ts +6 -0
  290. package/node_modules/@noodle-borg/protocol/dist/request-deps.d.ts.map +1 -0
  291. package/node_modules/@noodle-borg/protocol/dist/request-deps.js +16 -0
  292. package/node_modules/@noodle-borg/protocol/dist/request-deps.js.map +1 -0
  293. package/node_modules/@noodle-borg/protocol/dist/request-state.d.ts +50 -0
  294. package/node_modules/@noodle-borg/protocol/dist/request-state.d.ts.map +1 -0
  295. package/node_modules/@noodle-borg/protocol/dist/request-state.js +195 -0
  296. package/node_modules/@noodle-borg/protocol/dist/request-state.js.map +1 -0
  297. package/node_modules/@noodle-borg/protocol/dist/sdk-server.d.ts +16 -23
  298. package/node_modules/@noodle-borg/protocol/dist/sdk-server.d.ts.map +1 -1
  299. package/node_modules/@noodle-borg/protocol/dist/sdk-server.js +7 -341
  300. package/node_modules/@noodle-borg/protocol/dist/sdk-server.js.map +1 -1
  301. package/node_modules/@noodle-borg/protocol/dist/tool-authorization.d.ts +1 -1
  302. package/node_modules/@noodle-borg/protocol/dist/tool-authorization.d.ts.map +1 -1
  303. package/node_modules/@noodle-borg/protocol/dist/tool-authorization.js +1 -1
  304. package/node_modules/@noodle-borg/protocol/dist/tool-authorization.js.map +1 -1
  305. package/node_modules/@noodle-borg/protocol/dist/tool-interaction.d.ts +7 -2
  306. package/node_modules/@noodle-borg/protocol/dist/tool-interaction.d.ts.map +1 -1
  307. package/node_modules/@noodle-borg/protocol/dist/tool-interaction.js +8 -1
  308. package/node_modules/@noodle-borg/protocol/dist/tool-interaction.js.map +1 -1
  309. package/node_modules/@noodle-borg/protocol/dist/tool-results.d.ts +7 -0
  310. package/node_modules/@noodle-borg/protocol/dist/tool-results.d.ts.map +1 -0
  311. package/node_modules/@noodle-borg/protocol/dist/tool-results.js +49 -0
  312. package/node_modules/@noodle-borg/protocol/dist/tool-results.js.map +1 -0
  313. package/node_modules/@noodle-borg/protocol/dist/v2/cache-hints.d.ts +11 -0
  314. package/node_modules/@noodle-borg/protocol/dist/v2/cache-hints.d.ts.map +1 -0
  315. package/node_modules/@noodle-borg/protocol/dist/v2/cache-hints.js +14 -0
  316. package/node_modules/@noodle-borg/protocol/dist/v2/cache-hints.js.map +1 -0
  317. package/node_modules/@noodle-borg/protocol/dist/v2/confirmation.d.ts +16 -0
  318. package/node_modules/@noodle-borg/protocol/dist/v2/confirmation.d.ts.map +1 -0
  319. package/node_modules/@noodle-borg/protocol/dist/v2/confirmation.js +57 -0
  320. package/node_modules/@noodle-borg/protocol/dist/v2/confirmation.js.map +1 -0
  321. package/node_modules/@noodle-borg/protocol/dist/v2/handler.d.ts +11 -0
  322. package/node_modules/@noodle-borg/protocol/dist/v2/handler.d.ts.map +1 -0
  323. package/node_modules/@noodle-borg/protocol/dist/v2/handler.js +154 -0
  324. package/node_modules/@noodle-borg/protocol/dist/v2/handler.js.map +1 -0
  325. package/node_modules/@noodle-borg/protocol/dist/v2/input-required.d.ts +12 -0
  326. package/node_modules/@noodle-borg/protocol/dist/v2/input-required.d.ts.map +1 -0
  327. package/node_modules/@noodle-borg/protocol/dist/v2/input-required.js +78 -0
  328. package/node_modules/@noodle-borg/protocol/dist/v2/input-required.js.map +1 -0
  329. package/node_modules/@noodle-borg/protocol/dist/v2/server.d.ts +5 -0
  330. package/node_modules/@noodle-borg/protocol/dist/v2/server.d.ts.map +1 -0
  331. package/node_modules/@noodle-borg/protocol/dist/v2/server.js +314 -0
  332. package/node_modules/@noodle-borg/protocol/dist/v2/server.js.map +1 -0
  333. package/node_modules/@noodle-borg/protocol/dist/v2/tool-list.d.ts +4 -0
  334. package/node_modules/@noodle-borg/protocol/dist/v2/tool-list.d.ts.map +1 -0
  335. package/node_modules/@noodle-borg/protocol/dist/v2/tool-list.js +25 -0
  336. package/node_modules/@noodle-borg/protocol/dist/v2/tool-list.js.map +1 -0
  337. package/node_modules/@noodle-borg/protocol/dist/v2/versions.d.ts +6 -0
  338. package/node_modules/@noodle-borg/protocol/dist/v2/versions.d.ts.map +1 -0
  339. package/node_modules/@noodle-borg/protocol/dist/v2/versions.js +11 -0
  340. package/node_modules/@noodle-borg/protocol/dist/v2/versions.js.map +1 -0
  341. package/node_modules/@noodle-borg/protocol/package.json +3 -0
  342. package/node_modules/@noodle-borg/service/dist/billing/usage-identity.d.ts +2 -0
  343. package/node_modules/@noodle-borg/service/dist/billing/usage-identity.d.ts.map +1 -1
  344. package/node_modules/@noodle-borg/service/dist/billing/usage-identity.js +15 -7
  345. package/node_modules/@noodle-borg/service/dist/billing/usage-identity.js.map +1 -1
  346. package/node_modules/@noodle-borg/service/dist/customer-auth-audience-binding.d.ts +37 -0
  347. package/node_modules/@noodle-borg/service/dist/customer-auth-audience-binding.d.ts.map +1 -0
  348. package/node_modules/@noodle-borg/service/dist/customer-auth-audience-binding.js +182 -0
  349. package/node_modules/@noodle-borg/service/dist/customer-auth-audience-binding.js.map +1 -0
  350. package/node_modules/@noodle-borg/service/dist/customer-auth-audience-quarantine.d.ts +5 -0
  351. package/node_modules/@noodle-borg/service/dist/customer-auth-audience-quarantine.d.ts.map +1 -0
  352. package/node_modules/@noodle-borg/service/dist/customer-auth-audience-quarantine.js +14 -0
  353. package/node_modules/@noodle-borg/service/dist/customer-auth-audience-quarantine.js.map +1 -0
  354. package/node_modules/@noodle-borg/service/dist/customer-verifier.js +5 -4
  355. package/node_modules/@noodle-borg/service/dist/customer-verifier.js.map +1 -1
  356. package/node_modules/@noodle-borg/service/dist/developer-mcp/mount.d.ts +2 -1
  357. package/node_modules/@noodle-borg/service/dist/developer-mcp/mount.d.ts.map +1 -1
  358. package/node_modules/@noodle-borg/service/dist/developer-mcp/mount.js +16 -14
  359. package/node_modules/@noodle-borg/service/dist/developer-mcp/mount.js.map +1 -1
  360. package/node_modules/@noodle-borg/service/dist/developer-mcp/service-options.d.ts.map +1 -1
  361. package/node_modules/@noodle-borg/service/dist/developer-mcp/service-options.js +1 -0
  362. package/node_modules/@noodle-borg/service/dist/developer-mcp/service-options.js.map +1 -1
  363. package/node_modules/@noodle-borg/service/dist/index.d.ts +2 -0
  364. package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
  365. package/node_modules/@noodle-borg/service/dist/index.js +2 -0
  366. package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
  367. package/node_modules/@noodle-borg/service/dist/main.js +3 -0
  368. package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
  369. package/node_modules/@noodle-borg/service/dist/mcp-confirmation-nonce-postgres.d.ts +14 -0
  370. package/node_modules/@noodle-borg/service/dist/mcp-confirmation-nonce-postgres.d.ts.map +1 -0
  371. package/node_modules/@noodle-borg/service/dist/mcp-confirmation-nonce-postgres.js +35 -0
  372. package/node_modules/@noodle-borg/service/dist/mcp-confirmation-nonce-postgres.js.map +1 -0
  373. package/node_modules/@noodle-borg/service/dist/mcp-protocol-runtime.d.ts +16 -0
  374. package/node_modules/@noodle-borg/service/dist/mcp-protocol-runtime.d.ts.map +1 -0
  375. package/node_modules/@noodle-borg/service/dist/mcp-protocol-runtime.js +21 -0
  376. package/node_modules/@noodle-borg/service/dist/mcp-protocol-runtime.js.map +1 -0
  377. package/node_modules/@noodle-borg/service/dist/oauth/app.d.ts.map +1 -1
  378. package/node_modules/@noodle-borg/service/dist/oauth/app.js +47 -0
  379. package/node_modules/@noodle-borg/service/dist/oauth/app.js.map +1 -1
  380. package/node_modules/@noodle-borg/service/dist/oauth/authorization-response.d.ts +4 -0
  381. package/node_modules/@noodle-borg/service/dist/oauth/authorization-response.d.ts.map +1 -0
  382. package/node_modules/@noodle-borg/service/dist/oauth/authorization-response.js +6 -0
  383. package/node_modules/@noodle-borg/service/dist/oauth/authorization-response.js.map +1 -0
  384. package/node_modules/@noodle-borg/service/dist/oauth/consent-decision.d.ts.map +1 -1
  385. package/node_modules/@noodle-borg/service/dist/oauth/consent-decision.js +2 -1
  386. package/node_modules/@noodle-borg/service/dist/oauth/consent-decision.js.map +1 -1
  387. package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-flow.js +2 -1
  388. package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-flow.js.map +1 -1
  389. package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.d.ts.map +1 -1
  390. package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.js +1 -0
  391. package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.js.map +1 -1
  392. package/node_modules/@noodle-borg/service/dist/oauth/metadata.d.ts.map +1 -1
  393. package/node_modules/@noodle-borg/service/dist/oauth/metadata.js +1 -0
  394. package/node_modules/@noodle-borg/service/dist/oauth/metadata.js.map +1 -1
  395. package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts.map +1 -1
  396. package/node_modules/@noodle-borg/service/dist/oauth/provider.js +1 -0
  397. package/node_modules/@noodle-borg/service/dist/oauth/provider.js.map +1 -1
  398. package/node_modules/@noodle-borg/service/dist/oauth/token-issuer.d.ts.map +1 -1
  399. package/node_modules/@noodle-borg/service/dist/oauth/token-issuer.js +2 -1
  400. package/node_modules/@noodle-borg/service/dist/oauth/token-issuer.js.map +1 -1
  401. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.d.ts.map +1 -1
  402. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js +1 -0
  403. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js.map +1 -1
  404. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts +1 -0
  405. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts.map +1 -1
  406. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.js +2 -1
  407. package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.js.map +1 -1
  408. package/node_modules/@noodle-borg/service/dist/options.d.ts +10 -3
  409. package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
  410. package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.d.ts.map +1 -1
  411. package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.js +20 -8
  412. package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.js.map +1 -1
  413. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.d.ts +2 -0
  414. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.d.ts.map +1 -1
  415. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.js +58 -13
  416. package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.js.map +1 -1
  417. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.d.ts +1 -0
  418. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.d.ts.map +1 -1
  419. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.js +3 -0
  420. package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-transaction-postgres.js.map +1 -1
  421. package/node_modules/@noodle-borg/service/dist/platform-auth-operator.d.ts +24 -24
  422. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts +2 -1
  423. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts.map +1 -1
  424. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js +4 -1
  425. package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js.map +1 -1
  426. package/node_modules/@noodle-borg/service/dist/registry-access.d.ts +5 -1
  427. package/node_modules/@noodle-borg/service/dist/registry-access.d.ts.map +1 -1
  428. package/node_modules/@noodle-borg/service/dist/registry-access.js +64 -15
  429. package/node_modules/@noodle-borg/service/dist/registry-access.js.map +1 -1
  430. package/node_modules/@noodle-borg/service/dist/registry-rollback.d.ts +19 -0
  431. package/node_modules/@noodle-borg/service/dist/registry-rollback.d.ts.map +1 -0
  432. package/node_modules/@noodle-borg/service/dist/registry-rollback.js +91 -0
  433. package/node_modules/@noodle-borg/service/dist/registry-rollback.js.map +1 -0
  434. package/node_modules/@noodle-borg/service/dist/registry-state.d.ts +18 -2
  435. package/node_modules/@noodle-borg/service/dist/registry-state.d.ts.map +1 -1
  436. package/node_modules/@noodle-borg/service/dist/registry-state.js +83 -7
  437. package/node_modules/@noodle-borg/service/dist/registry-state.js.map +1 -1
  438. package/node_modules/@noodle-borg/service/dist/registry-targets.d.ts +8 -0
  439. package/node_modules/@noodle-borg/service/dist/registry-targets.d.ts.map +1 -1
  440. package/node_modules/@noodle-borg/service/dist/registry-targets.js +24 -0
  441. package/node_modules/@noodle-borg/service/dist/registry-targets.js.map +1 -1
  442. package/node_modules/@noodle-borg/service/dist/registry-types.d.ts +1 -1
  443. package/node_modules/@noodle-borg/service/dist/registry-types.d.ts.map +1 -1
  444. package/node_modules/@noodle-borg/service/dist/registry.d.ts +2 -1
  445. package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
  446. package/node_modules/@noodle-borg/service/dist/registry.js +72 -83
  447. package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
  448. package/node_modules/@noodle-borg/service/dist/routes/archive.d.ts.map +1 -1
  449. package/node_modules/@noodle-borg/service/dist/routes/archive.js +14 -0
  450. package/node_modules/@noodle-borg/service/dist/routes/archive.js.map +1 -1
  451. package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-dispatch.d.ts.map +1 -1
  452. package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-dispatch.js +4 -0
  453. package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-dispatch.js.map +1 -1
  454. package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-live.d.ts +1 -0
  455. package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-live.d.ts.map +1 -1
  456. package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-live.js +17 -4
  457. package/node_modules/@noodle-borg/service/dist/routes/auth-doctor-live.js.map +1 -1
  458. package/node_modules/@noodle-borg/service/dist/routes/contracts.d.ts +9 -9
  459. package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.d.ts.map +1 -1
  460. package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.js +1 -1
  461. package/node_modules/@noodle-borg/service/dist/routes/private-platform-auth-dispatch.js.map +1 -1
  462. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  463. package/node_modules/@noodle-borg/service/dist/serve.js +19 -2
  464. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  465. package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
  466. package/node_modules/@noodle-borg/service/dist/service.js +5 -0
  467. package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
  468. package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts +5 -2
  469. package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts.map +1 -1
  470. package/node_modules/@noodle-borg/service/dist/store/in-memory.js +51 -8
  471. package/node_modules/@noodle-borg/service/dist/store/in-memory.js.map +1 -1
  472. package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts +5 -2
  473. package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts.map +1 -1
  474. package/node_modules/@noodle-borg/service/dist/store/json-file.js +55 -6
  475. package/node_modules/@noodle-borg/service/dist/store/json-file.js.map +1 -1
  476. package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts +2 -2
  477. package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts.map +1 -1
  478. package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js +30 -15
  479. package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js.map +1 -1
  480. package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience-schema.d.ts +16 -0
  481. package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience-schema.d.ts.map +1 -0
  482. package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience-schema.js +329 -0
  483. package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience-schema.js.map +1 -0
  484. package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience.d.ts +5 -0
  485. package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience.d.ts.map +1 -0
  486. package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience.js +24 -0
  487. package/node_modules/@noodle-borg/service/dist/store/postgres-customer-auth-audience.js.map +1 -0
  488. package/node_modules/@noodle-borg/service/dist/store/postgres-deploy-records.d.ts.map +1 -1
  489. package/node_modules/@noodle-borg/service/dist/store/postgres-deploy-records.js +2 -1
  490. package/node_modules/@noodle-borg/service/dist/store/postgres-deploy-records.js.map +1 -1
  491. package/node_modules/@noodle-borg/service/dist/store/postgres-deployment-access.d.ts +9 -0
  492. package/node_modules/@noodle-borg/service/dist/store/postgres-deployment-access.d.ts.map +1 -0
  493. package/node_modules/@noodle-borg/service/dist/store/postgres-deployment-access.js +53 -0
  494. package/node_modules/@noodle-borg/service/dist/store/postgres-deployment-access.js.map +1 -0
  495. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts.map +1 -1
  496. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js +2 -1
  497. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js.map +1 -1
  498. package/node_modules/@noodle-borg/service/dist/store/postgres-rows.d.ts +2 -1
  499. package/node_modules/@noodle-borg/service/dist/store/postgres-rows.d.ts.map +1 -1
  500. package/node_modules/@noodle-borg/service/dist/store/postgres-rows.js +2 -24
  501. package/node_modules/@noodle-borg/service/dist/store/postgres-rows.js.map +1 -1
  502. package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts +2 -1
  503. package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts.map +1 -1
  504. package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js +3 -0
  505. package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js.map +1 -1
  506. package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts +7 -2
  507. package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts.map +1 -1
  508. package/node_modules/@noodle-borg/service/dist/store/postgres.js +27 -31
  509. package/node_modules/@noodle-borg/service/dist/store/postgres.js.map +1 -1
  510. package/node_modules/@noodle-borg/service/dist/store/request-events-postgres.d.ts.map +1 -1
  511. package/node_modules/@noodle-borg/service/dist/store/request-events-postgres.js +9 -2
  512. package/node_modules/@noodle-borg/service/dist/store/request-events-postgres.js.map +1 -1
  513. package/node_modules/@noodle-borg/service/dist/store/request-events.d.ts.map +1 -1
  514. package/node_modules/@noodle-borg/service/dist/store/request-events.js +1 -0
  515. package/node_modules/@noodle-borg/service/dist/store/request-events.js.map +1 -1
  516. package/node_modules/@noodle-borg/service/dist/store.d.ts +20 -1
  517. package/node_modules/@noodle-borg/service/dist/store.d.ts.map +1 -1
  518. package/node_modules/@noodle-borg/transport-http/dist/handler.d.ts +19 -67
  519. package/node_modules/@noodle-borg/transport-http/dist/handler.d.ts.map +1 -1
  520. package/node_modules/@noodle-borg/transport-http/dist/handler.js +12 -281
  521. package/node_modules/@noodle-borg/transport-http/dist/handler.js.map +1 -1
  522. package/node_modules/@noodle-borg/transport-http/dist/index.d.ts +2 -1
  523. package/node_modules/@noodle-borg/transport-http/dist/index.d.ts.map +1 -1
  524. package/node_modules/@noodle-borg/transport-http/dist/index.js +1 -0
  525. package/node_modules/@noodle-borg/transport-http/dist/index.js.map +1 -1
  526. package/node_modules/@noodle-borg/transport-http/dist/request-capture.d.ts.map +1 -1
  527. package/node_modules/@noodle-borg/transport-http/dist/request-capture.js +38 -4
  528. package/node_modules/@noodle-borg/transport-http/dist/request-capture.js.map +1 -1
  529. package/node_modules/@noodle-borg/transport-http/dist/responses.d.ts +28 -0
  530. package/node_modules/@noodle-borg/transport-http/dist/responses.d.ts.map +1 -0
  531. package/node_modules/@noodle-borg/transport-http/dist/responses.js +50 -0
  532. package/node_modules/@noodle-borg/transport-http/dist/responses.js.map +1 -0
  533. package/node_modules/@noodle-borg/transport-http/dist/routing.d.ts +28 -0
  534. package/node_modules/@noodle-borg/transport-http/dist/routing.d.ts.map +1 -0
  535. package/node_modules/@noodle-borg/transport-http/dist/routing.js +52 -0
  536. package/node_modules/@noodle-borg/transport-http/dist/routing.js.map +1 -0
  537. package/node_modules/@noodle-borg/transport-http/dist/serve-request.d.ts +35 -0
  538. package/node_modules/@noodle-borg/transport-http/dist/serve-request.d.ts.map +1 -0
  539. package/node_modules/@noodle-borg/transport-http/dist/serve-request.js +190 -0
  540. package/node_modules/@noodle-borg/transport-http/dist/serve-request.js.map +1 -0
  541. package/node_modules/@noodle-borg/transport-http/dist/tool-dispatch.d.ts +1 -1
  542. package/node_modules/@noodle-borg/transport-http/dist/tool-dispatch.d.ts.map +1 -1
  543. package/node_modules/@noodle-borg/transport-http/dist/tool-dispatch.js +17 -5
  544. package/node_modules/@noodle-borg/transport-http/dist/tool-dispatch.js.map +1 -1
  545. package/node_modules/@noodle-borg/transport-http/dist/web-bridge.d.ts +9 -0
  546. package/node_modules/@noodle-borg/transport-http/dist/web-bridge.d.ts.map +1 -0
  547. package/node_modules/@noodle-borg/transport-http/dist/web-bridge.js +61 -0
  548. package/node_modules/@noodle-borg/transport-http/dist/web-bridge.js.map +1 -0
  549. package/package.json +6 -2
@@ -0,0 +1,2523 @@
1
+ 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";
2
+ import * as z from "zod/v4";
3
+
4
+ //#region ../core-internal/src/auth/errors.d.ts
5
+ /**
6
+ * OAuth error codes as defined by {@link https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 | RFC 6749}
7
+ * and extensions.
8
+ */
9
+ declare enum OAuthErrorCode {
10
+ /**
11
+ * The request is missing a required parameter, includes an invalid parameter value,
12
+ * includes a parameter more than once, or is otherwise malformed.
13
+ */
14
+ InvalidRequest = "invalid_request",
15
+ /**
16
+ * Client authentication failed (e.g., unknown client, no client authentication included,
17
+ * or unsupported authentication method).
18
+ */
19
+ InvalidClient = "invalid_client",
20
+ /**
21
+ * The provided authorization grant or refresh token is invalid, expired, revoked,
22
+ * does not match the redirection URI used in the authorization request, or was issued to another client.
23
+ */
24
+ InvalidGrant = "invalid_grant",
25
+ /**
26
+ * The authenticated client is not authorized to use this authorization grant type.
27
+ */
28
+ UnauthorizedClient = "unauthorized_client",
29
+ /**
30
+ * The authorization grant type is not supported by the authorization server.
31
+ */
32
+ UnsupportedGrantType = "unsupported_grant_type",
33
+ /**
34
+ * The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.
35
+ */
36
+ InvalidScope = "invalid_scope",
37
+ /**
38
+ * The resource owner or authorization server denied the request.
39
+ */
40
+ AccessDenied = "access_denied",
41
+ /**
42
+ * The authorization server encountered an unexpected condition that prevented it from fulfilling the request.
43
+ */
44
+ ServerError = "server_error",
45
+ /**
46
+ * The authorization server is currently unable to handle the request due to temporary overloading or maintenance.
47
+ */
48
+ TemporarilyUnavailable = "temporarily_unavailable",
49
+ /**
50
+ * The authorization server does not support obtaining an authorization code using this method.
51
+ */
52
+ UnsupportedResponseType = "unsupported_response_type",
53
+ /**
54
+ * The authorization server does not support the requested token type.
55
+ */
56
+ UnsupportedTokenType = "unsupported_token_type",
57
+ /**
58
+ * The access token provided is expired, revoked, malformed, or invalid for other reasons.
59
+ */
60
+ InvalidToken = "invalid_token",
61
+ /**
62
+ * The HTTP method used is not allowed for this endpoint. (Custom, non-standard error)
63
+ */
64
+ MethodNotAllowed = "method_not_allowed",
65
+ /**
66
+ * Rate limit exceeded. (Custom, non-standard error based on RFC 6585)
67
+ */
68
+ TooManyRequests = "too_many_requests",
69
+ /**
70
+ * The client metadata is invalid. (Custom error for dynamic client registration - RFC 7591)
71
+ */
72
+ InvalidClientMetadata = "invalid_client_metadata",
73
+ /**
74
+ * The value of one or more redirection URIs is invalid. (Dynamic client registration - RFC 7591 §3.2.2)
75
+ */
76
+ InvalidRedirectUri = "invalid_redirect_uri",
77
+ /**
78
+ * The request requires higher privileges than provided by the access token.
79
+ */
80
+ InsufficientScope = "insufficient_scope",
81
+ /**
82
+ * The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)
83
+ */
84
+ InvalidTarget = "invalid_target",
85
+ }
86
+ /**
87
+ * OAuth error class for all OAuth-related errors.
88
+ */
89
+ declare class OAuthError extends Error {
90
+ readonly code: OAuthErrorCode | string;
91
+ readonly errorUri?: string | undefined;
92
+ static [Symbol.hasInstance](value: unknown): boolean;
93
+ /**
94
+ * Brand-based type guard: equivalent to `value instanceof this`, as an
95
+ * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
96
+ * the caller's own brand via `this`, so every branded subclass gets a
97
+ * correctly-scoped guard by inheritance. Must be invoked on the class —
98
+ * in callback position write `v => SdkError.isInstance(v)`, not
99
+ * `.filter(SdkError.isInstance)` (detached calls throw rather than
100
+ * silently matching nothing).
101
+ */
102
+ static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
103
+ constructor(code: OAuthErrorCode | string, message: string, errorUri?: string | undefined);
104
+ /**
105
+ * Converts the error to a standard OAuth error response object.
106
+ */
107
+ toResponseObject(): OAuthErrorResponse;
108
+ /**
109
+ * Creates an {@linkcode OAuthError} from an OAuth error response.
110
+ */
111
+ static fromResponse(response: OAuthErrorResponse): OAuthError;
112
+ }
113
+ //#endregion
114
+ //#region ../core-internal/src/errors/sdkErrors.d.ts
115
+ /**
116
+ * Error codes for SDK errors (local errors that never cross the wire).
117
+ * Unlike {@linkcode ProtocolErrorCode} which uses numeric JSON-RPC codes, `SdkErrorCode` uses
118
+ * descriptive string values for better developer experience.
119
+ *
120
+ * These errors are thrown locally by the SDK and are never serialized as
121
+ * JSON-RPC error responses.
122
+ */
123
+ declare enum SdkErrorCode {
124
+ /** Transport is not connected */
125
+ NotConnected = "NOT_CONNECTED",
126
+ /** Transport is already connected */
127
+ AlreadyConnected = "ALREADY_CONNECTED",
128
+ /** Protocol is not initialized */
129
+ NotInitialized = "NOT_INITIALIZED",
130
+ /** Required capability is not supported by the remote side */
131
+ CapabilityNotSupported = "CAPABILITY_NOT_SUPPORTED",
132
+ /** Request timed out waiting for response */
133
+ RequestTimeout = "REQUEST_TIMEOUT",
134
+ /** Connection was closed */
135
+ ConnectionClosed = "CONNECTION_CLOSED",
136
+ /** Failed to send message */
137
+ SendFailed = "SEND_FAILED",
138
+ /** Response result failed local schema validation */
139
+ InvalidResult = "INVALID_RESULT",
140
+ /**
141
+ * The response carried a `resultType` discriminator (protocol revision
142
+ * 2026-07-28) naming a result kind this client cannot consume yet, e.g.
143
+ * `input_required`. The kind is carried in `data.resultType`.
144
+ */
145
+ UnsupportedResultType = "UNSUPPORTED_RESULT_TYPE",
146
+ /**
147
+ * The multi-round-trip auto-fulfilment driver exhausted its round cap
148
+ * (`inputRequired.maxRounds`) without the server returning a complete
149
+ * result. `data.rounds` carries the cap that was hit and
150
+ * `data.lastResult` carries the last `input_required` payload received
151
+ * (`{ inputRequests, requestState? }`), so callers can inspect or resume
152
+ * the flow manually.
153
+ */
154
+ InputRequiredRoundsExceeded = "INPUT_REQUIRED_ROUNDS_EXCEEDED",
155
+ /**
156
+ * The auto-aggregating no-`cursor` `listTools()` / `listPrompts()` /
157
+ * `listResources()` / `listResourceTemplates()` walk hit the
158
+ * `ClientOptions.listMaxPages` cap without the server's pagination
159
+ * converging. `data.method` carries the list verb and
160
+ * `data.listMaxPages` the cap that was hit; raise the cap or fall back to
161
+ * explicit per-page `{ cursor }` calls.
162
+ */
163
+ ListPaginationExceeded = "LIST_PAGINATION_EXCEEDED",
164
+ /**
165
+ * The spec method being sent does not exist on the negotiated protocol
166
+ * version's wire era (e.g. `tasks/get` toward a 2026-07-28 peer, or
167
+ * `server/discover` toward a 2025-era peer). Raised locally, before
168
+ * anything reaches the transport. The method and era are carried in
169
+ * `data.method` / `data.era`.
170
+ */
171
+ MethodNotSupportedByProtocolVersion = "METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",
172
+ /**
173
+ * Protocol-era negotiation at connect time failed without producing either a
174
+ * usable modern (2026-07-28+) era or a definitive legacy fallback signal —
175
+ * e.g. the negotiation mode forbids falling back (`pin`), the probe hit a
176
+ * network failure, or the server answered the probe with a 5xx (a typed
177
+ * connect error, never an era verdict).
178
+ *
179
+ * Negotiation-phase only: this code is never used once an era is
180
+ * established. Auth walls never carry it: a 401/403 rejecting the probe
181
+ * uses {@linkcode ClientHttpAuthentication} / {@linkcode ClientHttpForbidden}
182
+ * instead, so era-recovery flows keyed on this code (e.g. cached-verdict
183
+ * gateways) can never persist a verdict for an unauthorized exchange.
184
+ */
185
+ EraNegotiationFailed = "ERA_NEGOTIATION_FAILED",
186
+ ClientHttpNotImplemented = "CLIENT_HTTP_NOT_IMPLEMENTED",
187
+ /**
188
+ * HTTP 401 authentication failure: the transport's re-auth retry still got
189
+ * 401 (`Server returned 401 after re-authentication`), or the version
190
+ * negotiation probe was rejected 401 with no `authProvider` configured
191
+ * (`Version negotiation failed: the server requires authorization (HTTP 401)`).
192
+ * Carried on an {@linkcode SdkHttpError} with `status: 401`.
193
+ */
194
+ ClientHttpAuthentication = "CLIENT_HTTP_AUTHENTICATION",
195
+ /**
196
+ * HTTP 403 denial: the step-up re-authorization retry limit was reached,
197
+ * or the version negotiation probe was rejected 403
198
+ * (`Version negotiation failed: the server denied access (HTTP 403)`).
199
+ * Carried on an {@linkcode SdkHttpError} with `status: 403`.
200
+ */
201
+ ClientHttpForbidden = "CLIENT_HTTP_FORBIDDEN",
202
+ ClientHttpUnexpectedContent = "CLIENT_HTTP_UNEXPECTED_CONTENT",
203
+ ClientHttpFailedToOpenStream = "CLIENT_HTTP_FAILED_TO_OPEN_STREAM",
204
+ ClientHttpFailedToTerminateSession = "CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",
205
+ }
206
+ /**
207
+ * SDK errors are local errors that never cross the wire.
208
+ * They are distinct from {@linkcode ProtocolError} which represents JSON-RPC protocol errors
209
+ * that are serialized and sent as error responses.
210
+ *
211
+ * @example
212
+ * ```ts source="./sdkErrors.examples.ts#SdkError_basicUsage"
213
+ * try {
214
+ * // Throwing an SDK error
215
+ * throw new SdkError(SdkErrorCode.NotConnected, 'Transport is not connected');
216
+ * } catch (error) {
217
+ * // Checking error type by code
218
+ * if (error instanceof SdkError && error.code === SdkErrorCode.RequestTimeout) {
219
+ * // Handle timeout
220
+ * }
221
+ * }
222
+ * ```
223
+ */
224
+ declare class SdkError extends Error {
225
+ readonly code: SdkErrorCode;
226
+ readonly data?: unknown | undefined;
227
+ static [Symbol.hasInstance](value: unknown): boolean;
228
+ /**
229
+ * Brand-based type guard: equivalent to `value instanceof this`, as an
230
+ * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
231
+ * the caller's own brand via `this`, so every branded subclass gets a
232
+ * correctly-scoped guard by inheritance. Must be invoked on the class —
233
+ * in callback position write `v => SdkError.isInstance(v)`, not
234
+ * `.filter(SdkError.isInstance)` (detached calls throw rather than
235
+ * silently matching nothing).
236
+ */
237
+ static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
238
+ constructor(code: SdkErrorCode, message: string, data?: unknown | undefined);
239
+ }
240
+ /**
241
+ * Typed shape for HTTP error data carried by {@linkcode SdkHttpError}.
242
+ */
243
+ interface SdkHttpErrorData {
244
+ status: number;
245
+ statusText?: string;
246
+ [key: string]: unknown;
247
+ }
248
+ /**
249
+ * An {@linkcode SdkError} subclass for HTTP transport failures.
250
+ *
251
+ * Thrown by the streamable HTTP transport when the server responds with a
252
+ * non-OK status code. Narrows {@linkcode SdkError.data | data} to
253
+ * {@linkcode SdkHttpErrorData} so consumers can inspect the HTTP status
254
+ * without unsafe casting.
255
+ *
256
+ * @example
257
+ * ```ts source="./sdkErrors.examples.ts#SdkHttpError_basicUsage"
258
+ * if (error instanceof SdkHttpError) {
259
+ * console.log(error.status); // number
260
+ * console.log(error.statusText); // string | undefined
261
+ * }
262
+ * ```
263
+ */
264
+ declare class SdkHttpError extends SdkError {
265
+ readonly data: SdkHttpErrorData;
266
+ constructor(code: SdkErrorCode, message: string, data: SdkHttpErrorData);
267
+ get status(): number;
268
+ get statusText(): string | undefined;
269
+ }
270
+ //#endregion
271
+ //#region ../core-internal/src/shared/authUtils.d.ts
272
+ /**
273
+ * Utilities for handling OAuth resource URIs.
274
+ */
275
+ /**
276
+ * Converts a server URL to a resource URL by removing the fragment.
277
+ * {@link https://datatracker.ietf.org/doc/html/rfc8707#section-2 | RFC 8707 section 2}
278
+ * states that resource URIs "MUST NOT include a fragment component".
279
+ * Keeps everything else unchanged (scheme, domain, port, path, query).
280
+ */
281
+ declare function resourceUrlFromServerUrl(url: URL | string): URL;
282
+ /**
283
+ * Checks if a requested resource URL matches a configured resource URL.
284
+ * A requested resource matches if it has the same scheme, domain, port,
285
+ * and its path starts with the configured resource's path.
286
+ *
287
+ * @param options - The options object
288
+ * @param options.requestedResource - The resource URL being requested
289
+ * @param options.configuredResource - The resource URL that has been configured
290
+ * @returns true if the requested resource matches the configured resource, false otherwise
291
+ */
292
+ declare function checkResourceAllowed({
293
+ requestedResource,
294
+ configuredResource
295
+ }: {
296
+ requestedResource: URL | string;
297
+ configuredResource: URL | string;
298
+ }): boolean;
299
+ declare namespace schemas_d_exports {
300
+ 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 };
301
+ }
302
+ //#endregion
303
+ //#region ../core-internal/src/types/types.d.ts
304
+ /**
305
+ * Utility types
306
+ */
307
+ type ExpandRecursively<T$1> = T$1 extends object ? (T$1 extends infer O ? { [K in keyof O]: ExpandRecursively<O[K]> } : never) : T$1;
308
+ type Primitive = string | number | boolean | bigint | null | undefined;
309
+ 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;
310
+ type Infer<Schema extends z.ZodTypeAny> = Flatten<z.infer<Schema>>;
311
+ /**
312
+ * Wire-only members hidden from the public types.
313
+ *
314
+ * `resultType` is the protocol-revision-2026-07-28 wire discrimination field
315
+ * on results. It is consumed by the SDK's protocol layer (and stripped before
316
+ * results reach consumers), so the public result types do not declare it.
317
+ * The wire schemas continue to model it internally.
318
+ */
319
+ type WireOnlyResultKey = 'resultType';
320
+ /**
321
+ * Removes wire-only members from a (possibly union) schema-inferred type
322
+ * while preserving every other declared member, optionality, and the loose
323
+ * index signature.
324
+ */
325
+ type StripWireOnly<T$1> = T$1 extends unknown ? { [K in keyof T$1 as K extends WireOnlyResultKey ? never : K]: T$1[K] } : never;
326
+ type ProgressToken = Infer<typeof ProgressTokenSchema>;
327
+ type Cursor = Infer<typeof CursorSchema>;
328
+ type Request = Infer<typeof RequestSchema>;
329
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
330
+ type TaskAugmentedRequestParams = Infer<typeof TaskAugmentedRequestParamsSchema>;
331
+ type RequestMeta = Infer<typeof RequestMetaSchema>;
332
+ type Notification = Infer<typeof NotificationSchema>;
333
+ type Result$1 = StripWireOnly<Infer<typeof ResultSchema>>;
334
+ type RequestId = Infer<typeof RequestIdSchema>;
335
+ type JSONRPCRequest = Infer<typeof JSONRPCRequestSchema>;
336
+ type JSONRPCNotification = Infer<typeof JSONRPCNotificationSchema>;
337
+ type JSONRPCErrorResponse = Infer<typeof JSONRPCErrorResponseSchema>;
338
+ type JSONRPCResultResponse = Omit<Infer<typeof JSONRPCResultResponseSchema>, 'result'> & {
339
+ result: Result$1;
340
+ };
341
+ type JSONRPCResponse = JSONRPCResultResponse | JSONRPCErrorResponse;
342
+ type JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResultResponse | JSONRPCErrorResponse;
343
+ type RequestParams = Infer<typeof BaseRequestParamsSchema>;
344
+ type NotificationParams = Infer<typeof NotificationsParamsSchema>;
345
+ /**
346
+ * The per-request `_meta` envelope carried by every request under protocol revision
347
+ * 2026-07-28 (protocol version, client info, client capabilities, optional log level).
348
+ *
349
+ * Neutral hand-written shape keyed by the public meta-key constants — never
350
+ * inferred from a wire-module schema (this neutral layer does not import from
351
+ * `wire/rev*`). A `type` alias rather than an interface so it stays assignable
352
+ * to `_meta`'s string-indexed object slot.
353
+ */
354
+ type RequestMetaEnvelope = {};
355
+ type EmptyResult = StripWireOnly<Infer<typeof EmptyResultSchema>>;
356
+ type CancelledNotificationParams = Infer<typeof CancelledNotificationParamsSchema>;
357
+ type CancelledNotification = Infer<typeof CancelledNotificationSchema>;
358
+ type Icon = Infer<typeof IconSchema>;
359
+ type Icons = Infer<typeof IconsSchema>;
360
+ type BaseMetadata = Infer<typeof BaseMetadataSchema>;
361
+ type Annotations = Infer<typeof AnnotationsSchema>;
362
+ type Role = Infer<typeof RoleSchema>;
363
+ type Implementation = Infer<typeof ImplementationSchema>;
364
+ /**
365
+ * Capabilities a client may support.
366
+ *
367
+ * Note: the `roots` and `sampling` capabilities are deprecated as of protocol
368
+ * version 2026-07-28 (SEP-2577); they remain in the specification for at least
369
+ * twelve months. See `ClientCapabilitiesSchema`.
370
+ */
371
+ type ClientCapabilities = Infer<typeof ClientCapabilitiesSchema>;
372
+ type InitializeRequestParams = Infer<typeof InitializeRequestParamsSchema>;
373
+ type InitializeRequest = Infer<typeof InitializeRequestSchema>;
374
+ /**
375
+ * Capabilities a server may support.
376
+ *
377
+ * Note: the `logging` capability is deprecated as of protocol version
378
+ * 2026-07-28 (SEP-2577); it remains in the specification for at least twelve
379
+ * months. See `ServerCapabilitiesSchema`.
380
+ */
381
+ type ServerCapabilities = Infer<typeof ServerCapabilitiesSchema>;
382
+ type InitializeResult = StripWireOnly<Infer<typeof InitializeResultSchema>>;
383
+ type InitializedNotification = Infer<typeof InitializedNotificationSchema>;
384
+ type DiscoverRequest = Infer<typeof DiscoverRequestSchema>;
385
+ type DiscoverResult = StripWireOnly<Infer<typeof DiscoverResultSchema>>;
386
+ type PingRequest = Infer<typeof PingRequestSchema>;
387
+ type Progress = Infer<typeof ProgressSchema>;
388
+ type ProgressNotificationParams = Infer<typeof ProgressNotificationParamsSchema>;
389
+ type ProgressNotification = Infer<typeof ProgressNotificationSchema>;
390
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
391
+ type Task = Infer<typeof TaskSchema>;
392
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
393
+ type TaskStatus = Infer<typeof TaskStatusSchema>;
394
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
395
+ type TaskCreationParams = Infer<typeof TaskCreationParamsSchema>;
396
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
397
+ type TaskMetadata = Infer<typeof TaskMetadataSchema>;
398
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
399
+ type RelatedTaskMetadata = Infer<typeof RelatedTaskMetadataSchema>;
400
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
401
+ type CreateTaskResult = StripWireOnly<Infer<typeof CreateTaskResultSchema>>;
402
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
403
+ type TaskStatusNotificationParams = Infer<typeof TaskStatusNotificationParamsSchema>;
404
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
405
+ type TaskStatusNotification = Infer<typeof TaskStatusNotificationSchema>;
406
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
407
+ type GetTaskRequest = Infer<typeof GetTaskRequestSchema>;
408
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
409
+ type GetTaskResult = StripWireOnly<Infer<typeof GetTaskResultSchema>>;
410
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
411
+ type GetTaskPayloadRequest = Infer<typeof GetTaskPayloadRequestSchema>;
412
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
413
+ type ListTasksRequest = Infer<typeof ListTasksRequestSchema>;
414
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
415
+ type ListTasksResult = StripWireOnly<Infer<typeof ListTasksResultSchema>>;
416
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
417
+ type CancelTaskRequest = Infer<typeof CancelTaskRequestSchema>;
418
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
419
+ type CancelTaskResult = StripWireOnly<Infer<typeof CancelTaskResultSchema>>;
420
+ /** @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only. */
421
+ type GetTaskPayloadResult = StripWireOnly<Infer<typeof GetTaskPayloadResultSchema>>;
422
+ type PaginatedRequestParams = Infer<typeof PaginatedRequestParamsSchema>;
423
+ type PaginatedRequest = Infer<typeof PaginatedRequestSchema>;
424
+ type PaginatedResult = StripWireOnly<Infer<typeof PaginatedResultSchema>>;
425
+ type ResourceContents = Infer<typeof ResourceContentsSchema>;
426
+ type TextResourceContents = Infer<typeof TextResourceContentsSchema>;
427
+ type BlobResourceContents = Infer<typeof BlobResourceContentsSchema>;
428
+ type Resource = Infer<typeof ResourceSchema>;
429
+ type ResourceTemplateType = Infer<typeof ResourceTemplateSchema>;
430
+ type ListResourcesRequest = Infer<typeof ListResourcesRequestSchema>;
431
+ type ListResourcesResult = StripWireOnly<Infer<typeof ListResourcesResultSchema>>;
432
+ type ListResourceTemplatesRequest = Infer<typeof ListResourceTemplatesRequestSchema>;
433
+ type ListResourceTemplatesResult = StripWireOnly<Infer<typeof ListResourceTemplatesResultSchema>>;
434
+ type ResourceRequestParams = Infer<typeof ResourceRequestParamsSchema>;
435
+ type ReadResourceRequestParams = Infer<typeof ReadResourceRequestParamsSchema>;
436
+ type ReadResourceRequest = Infer<typeof ReadResourceRequestSchema>;
437
+ type ReadResourceResult = StripWireOnly<Infer<typeof ReadResourceResultSchema>>;
438
+ type ResourceListChangedNotification = Infer<typeof ResourceListChangedNotificationSchema>;
439
+ type SubscribeRequestParams = Infer<typeof SubscribeRequestParamsSchema>;
440
+ type SubscribeRequest = Infer<typeof SubscribeRequestSchema>;
441
+ type UnsubscribeRequestParams = Infer<typeof UnsubscribeRequestParamsSchema>;
442
+ type UnsubscribeRequest = Infer<typeof UnsubscribeRequestSchema>;
443
+ type ResourceUpdatedNotificationParams = Infer<typeof ResourceUpdatedNotificationParamsSchema>;
444
+ type ResourceUpdatedNotification = Infer<typeof ResourceUpdatedNotificationSchema>;
445
+ type SubscriptionFilter = Infer<typeof SubscriptionFilterSchema>;
446
+ type SubscriptionsListenRequestParams = Infer<typeof SubscriptionsListenRequestParamsSchema>;
447
+ type SubscriptionsListenRequest = Infer<typeof SubscriptionsListenRequestSchema>;
448
+ type SubscriptionsAcknowledgedNotificationParams = Infer<typeof SubscriptionsAcknowledgedNotificationParamsSchema>;
449
+ type SubscriptionsAcknowledgedNotification = Infer<typeof SubscriptionsAcknowledgedNotificationSchema>;
450
+ type SubscriptionsListenResultMeta = Infer<typeof SubscriptionsListenResultMetaSchema>;
451
+ type SubscriptionsListenResult = StripWireOnly<Infer<typeof SubscriptionsListenResultSchema>>;
452
+ type PromptArgument = Infer<typeof PromptArgumentSchema>;
453
+ type Prompt = Infer<typeof PromptSchema>;
454
+ type ListPromptsRequest = Infer<typeof ListPromptsRequestSchema>;
455
+ type ListPromptsResult = StripWireOnly<Infer<typeof ListPromptsResultSchema>>;
456
+ type GetPromptRequestParams = Infer<typeof GetPromptRequestParamsSchema>;
457
+ type GetPromptRequest = Infer<typeof GetPromptRequestSchema>;
458
+ type TextContent = Infer<typeof TextContentSchema>;
459
+ type ImageContent = Infer<typeof ImageContentSchema>;
460
+ type AudioContent = Infer<typeof AudioContentSchema>;
461
+ /**
462
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
463
+ * in the specification for at least twelve months. Migrate to calling LLM
464
+ * provider APIs directly.
465
+ */
466
+ type ToolUseContent = Infer<typeof ToolUseContentSchema>;
467
+ /**
468
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
469
+ * in the specification for at least twelve months. Migrate to calling LLM
470
+ * provider APIs directly.
471
+ */
472
+ type ToolResultContent = Infer<typeof ToolResultContentSchema>;
473
+ type EmbeddedResource = Infer<typeof EmbeddedResourceSchema>;
474
+ type ResourceLink = Infer<typeof ResourceLinkSchema>;
475
+ type ContentBlock = Infer<typeof ContentBlockSchema>;
476
+ type PromptMessage = Infer<typeof PromptMessageSchema>;
477
+ type GetPromptResult = StripWireOnly<Infer<typeof GetPromptResultSchema>>;
478
+ type PromptListChangedNotification = Infer<typeof PromptListChangedNotificationSchema>;
479
+ type ToolAnnotations = Infer<typeof ToolAnnotationsSchema>;
480
+ type ToolExecution = Infer<typeof ToolExecutionSchema>;
481
+ type Tool = Infer<typeof ToolSchema>;
482
+ type ListToolsRequest = Infer<typeof ListToolsRequestSchema>;
483
+ type ListToolsResult = StripWireOnly<Infer<typeof ListToolsResultSchema>>;
484
+ type CallToolRequestParams = Infer<typeof CallToolRequestParamsSchema>;
485
+ type CallToolResult = StripWireOnly<Infer<typeof CallToolResultSchema>>;
486
+ type CompatibilityCallToolResult = StripWireOnly<Infer<typeof CompatibilityCallToolResultSchema>>;
487
+ type CallToolRequest = Infer<typeof CallToolRequestSchema>;
488
+ type ToolListChangedNotification = Infer<typeof ToolListChangedNotificationSchema>;
489
+ /**
490
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
491
+ * in the specification for at least twelve months. Migrate to stderr logging
492
+ * (STDIO servers) or OpenTelemetry.
493
+ */
494
+ type LoggingLevel = Infer<typeof LoggingLevelSchema>;
495
+ /**
496
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
497
+ * in the specification for at least twelve months. Migrate to stderr logging
498
+ * (STDIO servers) or OpenTelemetry.
499
+ */
500
+ type SetLevelRequestParams = Infer<typeof SetLevelRequestParamsSchema>;
501
+ /**
502
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
503
+ * in the specification for at least twelve months. Migrate to stderr logging
504
+ * (STDIO servers) or OpenTelemetry.
505
+ */
506
+ type SetLevelRequest = Infer<typeof SetLevelRequestSchema>;
507
+ /**
508
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
509
+ * in the specification for at least twelve months. Migrate to stderr logging
510
+ * (STDIO servers) or OpenTelemetry.
511
+ */
512
+ type LoggingMessageNotificationParams = Infer<typeof LoggingMessageNotificationParamsSchema>;
513
+ /**
514
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
515
+ * in the specification for at least twelve months. Migrate to stderr logging
516
+ * (STDIO servers) or OpenTelemetry.
517
+ */
518
+ type LoggingMessageNotification = Infer<typeof LoggingMessageNotificationSchema>;
519
+ /**
520
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
521
+ * in the specification for at least twelve months. Migrate to calling LLM
522
+ * provider APIs directly.
523
+ */
524
+ type ToolChoice = Infer<typeof ToolChoiceSchema>;
525
+ /**
526
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
527
+ * in the specification for at least twelve months. Migrate to calling LLM
528
+ * provider APIs directly.
529
+ */
530
+ type ModelHint = Infer<typeof ModelHintSchema>;
531
+ /**
532
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
533
+ * in the specification for at least twelve months. Migrate to calling LLM
534
+ * provider APIs directly.
535
+ */
536
+ type ModelPreferences = Infer<typeof ModelPreferencesSchema>;
537
+ /**
538
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
539
+ * in the specification for at least twelve months. Migrate to calling LLM
540
+ * provider APIs directly.
541
+ */
542
+ type SamplingContent = Infer<typeof SamplingContentSchema>;
543
+ /**
544
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
545
+ * in the specification for at least twelve months. Migrate to calling LLM
546
+ * provider APIs directly.
547
+ */
548
+ type SamplingMessageContentBlock = Infer<typeof SamplingMessageContentBlockSchema>;
549
+ /**
550
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
551
+ * in the specification for at least twelve months. Migrate to calling LLM
552
+ * provider APIs directly.
553
+ */
554
+ type SamplingMessage = Infer<typeof SamplingMessageSchema>;
555
+ /**
556
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
557
+ * in the specification for at least twelve months. Migrate to calling LLM
558
+ * provider APIs directly.
559
+ */
560
+ type CreateMessageRequestParams = Infer<typeof CreateMessageRequestParamsSchema>;
561
+ /**
562
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
563
+ * in the specification for at least twelve months. Migrate to calling LLM
564
+ * provider APIs directly.
565
+ */
566
+ type CreateMessageRequest = Infer<typeof CreateMessageRequestSchema>;
567
+ /**
568
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
569
+ * in the specification for at least twelve months. Migrate to calling LLM
570
+ * provider APIs directly.
571
+ */
572
+ type CreateMessageResult = StripWireOnly<Infer<typeof CreateMessageResultSchema>>;
573
+ /**
574
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
575
+ * in the specification for at least twelve months. Migrate to calling LLM
576
+ * provider APIs directly.
577
+ */
578
+ type CreateMessageResultWithTools = StripWireOnly<Infer<typeof CreateMessageResultWithToolsSchema>>;
579
+ type BooleanSchema = Infer<typeof BooleanSchemaSchema>;
580
+ type StringSchema = Infer<typeof StringSchemaSchema>;
581
+ type NumberSchema = Infer<typeof NumberSchemaSchema>;
582
+ type EnumSchema = Infer<typeof EnumSchemaSchema>;
583
+ type UntitledSingleSelectEnumSchema = Infer<typeof UntitledSingleSelectEnumSchemaSchema>;
584
+ type TitledSingleSelectEnumSchema = Infer<typeof TitledSingleSelectEnumSchemaSchema>;
585
+ type LegacyTitledEnumSchema = Infer<typeof LegacyTitledEnumSchemaSchema>;
586
+ type UntitledMultiSelectEnumSchema = Infer<typeof UntitledMultiSelectEnumSchemaSchema>;
587
+ type TitledMultiSelectEnumSchema = Infer<typeof TitledMultiSelectEnumSchemaSchema>;
588
+ type SingleSelectEnumSchema = Infer<typeof SingleSelectEnumSchemaSchema>;
589
+ type MultiSelectEnumSchema = Infer<typeof MultiSelectEnumSchemaSchema>;
590
+ type PrimitiveSchemaDefinition = Infer<typeof PrimitiveSchemaDefinitionSchema>;
591
+ type ElicitRequestParams = Infer<typeof ElicitRequestParamsSchema>;
592
+ type ElicitRequestFormParams = Infer<typeof ElicitRequestFormParamsSchema>;
593
+ type ElicitRequestURLParams = Infer<typeof ElicitRequestURLParamsSchema>;
594
+ type ElicitRequest = Infer<typeof ElicitRequestSchema>;
595
+ /** @deprecated Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification. */
596
+ type ElicitationCompleteNotificationParams = Infer<typeof ElicitationCompleteNotificationParamsSchema>;
597
+ /** @deprecated Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification. */
598
+ type ElicitationCompleteNotification = Infer<typeof ElicitationCompleteNotificationSchema>;
599
+ type ElicitResult = StripWireOnly<Infer<typeof ElicitResultSchema>>;
600
+ type ResourceTemplateReference = Infer<typeof ResourceTemplateReferenceSchema>;
601
+ type PromptReference = Infer<typeof PromptReferenceSchema>;
602
+ type CompleteRequestParams = Infer<typeof CompleteRequestParamsSchema>;
603
+ type CompleteRequest = Infer<typeof CompleteRequestSchema>;
604
+ type CompleteResult = StripWireOnly<Infer<typeof CompleteResultSchema>>;
605
+ /**
606
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
607
+ * in the specification for at least twelve months. Migrate to passing paths via
608
+ * tool parameters, resource URIs, or configuration.
609
+ */
610
+ type Root = Infer<typeof RootSchema>;
611
+ /**
612
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
613
+ * in the specification for at least twelve months. Migrate to passing paths via
614
+ * tool parameters, resource URIs, or configuration.
615
+ */
616
+ type ListRootsRequest = Infer<typeof ListRootsRequestSchema>;
617
+ /**
618
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
619
+ * in the specification for at least twelve months. Migrate to passing paths via
620
+ * tool parameters, resource URIs, or configuration.
621
+ */
622
+ type ListRootsResult = StripWireOnly<Infer<typeof ListRootsResultSchema>>;
623
+ /**
624
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
625
+ * in the specification for at least twelve months. Migrate to passing paths via
626
+ * tool parameters, resource URIs, or configuration.
627
+ */
628
+ type RootsListChangedNotification = Infer<typeof RootsListChangedNotificationSchema>;
629
+ /**
630
+ * A single embedded (de-JSON-RPC'd) input request inside an
631
+ * {@linkcode InputRequiredResult}: an elicitation, sampling, or roots request
632
+ * object carried in-band rather than sent as a server→client JSON-RPC request.
633
+ */
634
+ type InputRequest = CreateMessageRequest | ListRootsRequest | ElicitRequest;
635
+ /**
636
+ * A single embedded (de-JSON-RPC'd) input response inside a retried request's
637
+ * `inputResponses`: the bare result object for the corresponding
638
+ * {@linkcode InputRequest} (never wrapped in a `{method, result}` envelope).
639
+ */
640
+ type InputResponse = CreateMessageResult | ListRootsResult | ElicitResult;
641
+ /**
642
+ * A map of embedded input requests, keyed by server-assigned identifiers that
643
+ * are unique within the scope of the request.
644
+ */
645
+ interface InputRequests {
646
+ [key: string]: InputRequest;
647
+ }
648
+ /**
649
+ * A map of embedded input responses. Keys correspond to the keys of the
650
+ * {@linkcode InputRequests} map the server sent; values are the client's bare
651
+ * result for each request.
652
+ */
653
+ interface InputResponses {
654
+ [key: string]: InputResponse;
655
+ }
656
+ /**
657
+ * The input-required result a handler for a multi-round-trip method
658
+ * (`tools/call`, `prompts/get`, `resources/read`) returns to request more
659
+ * input from the client (protocol revision 2026-07-28). Build it with the
660
+ * `inputRequired()` builder; hand-built literals are equally legal —
661
+ * `resultType: 'input_required'` is the discriminator, and the SDK re-checks
662
+ * the at-least-one rule at the seam.
663
+ *
664
+ * This is the one place the wire discriminator `resultType` appears on the
665
+ * neutral surface: the handler authors it, the 2026-07-28 codec passes it
666
+ * through to the wire, and consumers receiving results never see it (complete
667
+ * results are lifted).
668
+ *
669
+ * At least one of `inputRequests` or `requestState` must be present.
670
+ *
671
+ * `requestState` is an opaque, server-minted string echoed back verbatim by
672
+ * the client on retry. It travels through the client and MUST be treated by
673
+ * the server as attacker-controlled input on re-entry: if it influences
674
+ * authorization, resource access, or business logic, the server MUST protect
675
+ * its integrity (e.g. HMAC or AEAD) and MUST reject state that fails
676
+ * verification (spec: basic/patterns/mrtr §Server Requirements). The SDK
677
+ * applies no integrity protection by default — without a configured
678
+ * `ServerOptions.requestState.verify` hook, `ctx.mcpReq.requestState()`
679
+ * returns the raw, unverified string; with one, the seam rejects state the
680
+ * hook refuses and the accessor returns the hook's decoded payload.
681
+ */
682
+ interface InputRequiredResult extends Result$1 {
683
+ resultType: 'input_required';
684
+ /** Embedded requests the client must fulfil before retrying. */
685
+ inputRequests?: InputRequests;
686
+ /** Opaque server state the client echoes back verbatim on retry. */
687
+ requestState?: string;
688
+ }
689
+ type ClientRequest = Infer<typeof ClientRequestSchema>;
690
+ type ClientNotification = Infer<typeof ClientNotificationSchema>;
691
+ type ClientResult = StripWireOnly<Infer<typeof ClientResultSchema>>;
692
+ type ServerRequest = Infer<typeof ServerRequestSchema>;
693
+ type ServerNotification = Infer<typeof ServerNotificationSchema>;
694
+ type ServerResult = StripWireOnly<Infer<typeof ServerResultSchema>>;
695
+ type MethodToTypeMap<U$1> = { [T in U$1 as T extends {
696
+ method: infer M extends string;
697
+ } ? M : never]: T };
698
+ /**
699
+ * Task methods are 2025-11-25 wire vocabulary with no SDK runtime: the task
700
+ * wire types stay importable (see the Tasks section above), but the typed
701
+ * method surface — `request()`, `setRequestHandler()`, `ctx.mcpReq.send()` —
702
+ * does not offer them. The wire schemas keep parsing task vocabulary for
703
+ * interoperability with 2025-11-25 peers.
704
+ */
705
+ type TaskRequestMethod = 'tasks/get' | 'tasks/result' | 'tasks/list' | 'tasks/cancel';
706
+ type TaskNotificationMethod = 'notifications/tasks/status';
707
+ type RequestMethod = Exclude<ClientRequest['method'] | ServerRequest['method'], TaskRequestMethod>;
708
+ type NotificationMethod = Exclude<ClientNotification['method'] | ServerNotification['method'], TaskNotificationMethod>;
709
+ type RequestTypeMap = MethodToTypeMap<Exclude<ClientRequest | ServerRequest, {
710
+ method: TaskRequestMethod;
711
+ }>>;
712
+ type NotificationTypeMap = MethodToTypeMap<Exclude<ClientNotification | ServerNotification, {
713
+ method: TaskNotificationMethod;
714
+ }>>;
715
+ type ResultTypeMap = {
716
+ ping: EmptyResult;
717
+ initialize: InitializeResult;
718
+ 'server/discover': DiscoverResult;
719
+ 'completion/complete': CompleteResult;
720
+ 'logging/setLevel': EmptyResult;
721
+ 'prompts/get': GetPromptResult;
722
+ 'prompts/list': ListPromptsResult;
723
+ 'resources/list': ListResourcesResult;
724
+ 'resources/templates/list': ListResourceTemplatesResult;
725
+ 'resources/read': ReadResourceResult;
726
+ 'resources/subscribe': EmptyResult;
727
+ 'resources/unsubscribe': EmptyResult;
728
+ 'subscriptions/listen': SubscriptionsListenResult;
729
+ 'tools/call': CallToolResult;
730
+ 'tools/list': ListToolsResult;
731
+ 'sampling/createMessage': CreateMessageResult | CreateMessageResultWithTools;
732
+ 'elicitation/create': ElicitResult;
733
+ 'roots/list': ListRootsResult;
734
+ };
735
+ /**
736
+ * The handler-return counterpart of {@linkcode ResultTypeMap}: what a
737
+ * registered request handler may RETURN for each method. Identical to
738
+ * `ResultTypeMap` except that the multi-round-trip methods (`tools/call`,
739
+ * `prompts/get`, `resources/read`) additionally accept an
740
+ * {@linkcode InputRequiredResult} (protocol revision 2026-07-28).
741
+ *
742
+ * `ResultTypeMap` itself — what a *requester* receives — is deliberately NOT
743
+ * widened: `client.callTool()` returns a plain {@linkcode CallToolResult} on
744
+ * both protocol eras.
745
+ */
746
+ type HandlerResultTypeMap = { [M in keyof ResultTypeMap]: M extends 'tools/call' | 'prompts/get' | 'resources/read' ? ResultTypeMap[M] | InputRequiredResult : ResultTypeMap[M] };
747
+ /**
748
+ * Information about a validated access token, provided to request handlers.
749
+ */
750
+ interface AuthInfo {
751
+ /**
752
+ * The access token.
753
+ */
754
+ token: string;
755
+ /**
756
+ * The client ID associated with this token.
757
+ */
758
+ clientId: string;
759
+ /**
760
+ * Scopes associated with this token.
761
+ */
762
+ scopes: string[];
763
+ /**
764
+ * When the token expires (in seconds since epoch).
765
+ */
766
+ expiresAt?: number;
767
+ /**
768
+ * The RFC 8707 resource server identifier for which this token is valid.
769
+ * If set, this MUST match the MCP server's resource identifier (minus hash fragment).
770
+ */
771
+ resource?: URL;
772
+ /**
773
+ * Additional data associated with the token.
774
+ * This field should be used for any additional data that needs to be attached to the auth info.
775
+ */
776
+ extra?: Record<string, unknown>;
777
+ }
778
+ type JSONRPCErrorObject = {
779
+ code: number;
780
+ message: string;
781
+ data?: unknown;
782
+ };
783
+ interface ParseError extends JSONRPCErrorObject {
784
+ code: typeof PARSE_ERROR;
785
+ }
786
+ interface InvalidRequestError extends JSONRPCErrorObject {
787
+ code: typeof INVALID_REQUEST;
788
+ }
789
+ interface MethodNotFoundError extends JSONRPCErrorObject {
790
+ code: typeof METHOD_NOT_FOUND;
791
+ }
792
+ interface InvalidParamsError extends JSONRPCErrorObject {
793
+ code: typeof INVALID_PARAMS;
794
+ }
795
+ interface InternalError extends JSONRPCErrorObject {
796
+ code: typeof INTERNAL_ERROR;
797
+ }
798
+ /**
799
+ * Data carried by a `-32021` MissingRequiredClientCapability protocol error
800
+ * (protocol revision 2026-07-28).
801
+ */
802
+ interface MissingRequiredClientCapabilityErrorData {
803
+ /**
804
+ * The capabilities the server requires from the client to process the
805
+ * request, in the `ClientCapabilities` shape (only the missing
806
+ * capabilities are listed).
807
+ */
808
+ requiredCapabilities: ClientCapabilities;
809
+ }
810
+ /**
811
+ * Data carried by a `-32022` UnsupportedProtocolVersion protocol error
812
+ * (protocol revision 2026-07-28).
813
+ */
814
+ interface UnsupportedProtocolVersionErrorData {
815
+ /**
816
+ * Protocol versions the receiver supports. The sender should choose a
817
+ * mutually supported version from this list and retry.
818
+ */
819
+ supported: string[];
820
+ /**
821
+ * The protocol version that was requested.
822
+ */
823
+ requested: string;
824
+ }
825
+ /**
826
+ * Callback type for list changed notifications.
827
+ */
828
+ type ListChangedCallback<T$1> = (error: Error | null, items: T$1[] | null) => void;
829
+ /**
830
+ * Options for subscribing to list changed notifications.
831
+ *
832
+ * @typeParam T - The type of items in the list (`Tool`, `Prompt`, or `Resource`)
833
+ */
834
+ type ListChangedOptions<T$1> = {
835
+ /**
836
+ * If `true`, the list will be refreshed automatically when a list changed notification is received.
837
+ * @default true
838
+ */
839
+ autoRefresh?: boolean;
840
+ /**
841
+ * Debounce time in milliseconds. Set to `0` to disable.
842
+ * @default 300
843
+ */
844
+ debounceMs?: number;
845
+ /**
846
+ * Callback invoked when the list changes.
847
+ *
848
+ * If `autoRefresh` is `true`, `items` contains the updated list.
849
+ * If `autoRefresh` is `false`, `items` is `null` (caller should refresh manually).
850
+ */
851
+ onChanged: ListChangedCallback<T$1>;
852
+ };
853
+ /**
854
+ * Configuration for list changed notification handlers.
855
+ *
856
+ * Use this to configure handlers for tools, prompts, and resources list changes
857
+ * when creating a client.
858
+ *
859
+ * Note: Handlers are only activated if the server advertises the corresponding
860
+ * `listChanged` capability (e.g., `tools.listChanged: true`). If the server
861
+ * doesn't advertise this capability, the handler will not be set up.
862
+ */
863
+ type ListChangedHandlers = {
864
+ /**
865
+ * Handler for tool list changes.
866
+ */
867
+ tools?: ListChangedOptions<Tool>;
868
+ /**
869
+ * Handler for prompt list changes.
870
+ */
871
+ prompts?: ListChangedOptions<Prompt>;
872
+ /**
873
+ * Handler for resource list changes.
874
+ */
875
+ resources?: ListChangedOptions<Resource>;
876
+ };
877
+ /**
878
+ * Protocol-era classification of an inbound message.
879
+ *
880
+ * Populated by transports that classify messages at the edge (e.g. an HTTP
881
+ * entry distinguishing 2025-era from 2026-era traffic). The wire era itself
882
+ * is connection state (the negotiated protocol version held by the
883
+ * `Client`/`Server` instance); the protocol layer validates a classified
884
+ * message against that instance era at dispatch — a mismatch is treated as
885
+ * an entry/routing error, never a per-message era switch. Unclassified
886
+ * traffic is dispatched on the instance era unchanged.
887
+ */
888
+ interface MessageClassification {
889
+ /**
890
+ * The wire era the message was classified into: `legacy` for the
891
+ * 2025-11-25 family of revisions, `modern` for 2026-07-28 and later.
892
+ */
893
+ era: 'legacy' | 'modern';
894
+ /**
895
+ * The exact protocol revision, when the classifier derived one.
896
+ */
897
+ revision?: string;
898
+ }
899
+ /**
900
+ * Extra information about a message.
901
+ */
902
+ interface MessageExtraInfo {
903
+ /**
904
+ * The original HTTP request.
905
+ */
906
+ request?: globalThis.Request;
907
+ /**
908
+ * Protocol-era classification of the message, when the transport
909
+ * classified it at the edge. Validated by the protocol layer against the
910
+ * instance's negotiated era at dispatch (the edge→instance handoff
911
+ * check); it does not select the era itself.
912
+ */
913
+ classification?: MessageClassification;
914
+ /**
915
+ * The authentication information.
916
+ */
917
+ authInfo?: AuthInfo;
918
+ /**
919
+ * Callback to close the SSE stream for this request, triggering client reconnection.
920
+ * Only available when using {@linkcode @modelcontextprotocol/node!streamableHttp.NodeStreamableHTTPServerTransport | NodeStreamableHTTPServerTransport} with eventStore configured.
921
+ */
922
+ closeSSEStream?: () => void;
923
+ /**
924
+ * Callback to close the standalone GET SSE stream, triggering client reconnection.
925
+ * Only available when using {@linkcode @modelcontextprotocol/node!streamableHttp.NodeStreamableHTTPServerTransport | NodeStreamableHTTPServerTransport} with eventStore configured.
926
+ */
927
+ closeStandaloneSSEStream?: () => void;
928
+ }
929
+ type MetaObject = Record<string, unknown>;
930
+ type RequestMetaObject = RequestMeta;
931
+ /**
932
+ * The contents of a result's `_meta` field (the 2026-07-28 `ResultMetaObject`):
933
+ * loose, with the optional self-reported serverInfo key typed when present.
934
+ */
935
+ type ResultMetaObject = Infer<typeof ResultMetaObjectSchema>;
936
+ /**
937
+ * {@linkcode CreateMessageRequestParams} without tools - for backwards-compatible overload.
938
+ * Excludes tools/toolChoice to indicate they should not be provided.
939
+ *
940
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
941
+ * in the specification for at least twelve months. Migrate to calling LLM
942
+ * provider APIs directly.
943
+ */
944
+ type CreateMessageRequestParamsBase = Omit<CreateMessageRequestParams, 'tools' | 'toolChoice'>;
945
+ /**
946
+ * {@linkcode CreateMessageRequestParams} with required tools - for tool-enabled overload.
947
+ *
948
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577); remains
949
+ * in the specification for at least twelve months. Migrate to calling LLM
950
+ * provider APIs directly.
951
+ */
952
+ interface CreateMessageRequestParamsWithTools extends CreateMessageRequestParams {
953
+ tools: Tool[];
954
+ }
955
+ type CompleteRequestResourceTemplate = ExpandRecursively<CompleteRequest & {
956
+ params: CompleteRequestParams & {
957
+ ref: ResourceTemplateReference;
958
+ };
959
+ }>;
960
+ type CompleteRequestPrompt = ExpandRecursively<CompleteRequest & {
961
+ params: CompleteRequestParams & {
962
+ ref: PromptReference;
963
+ };
964
+ }>;
965
+ //#endregion
966
+ //#region ../core-internal/src/wire/codec.d.ts
967
+ /** Wire eras with distinct vocabulary. */
968
+ type WireEra = '2025-11-25' | '2026-07-28';
969
+ /**
970
+ * Wire-only material lifted off an inbound message by the protocol layer
971
+ * before dispatch (the V-3 seam): the reserved `_meta` envelope keys and the
972
+ * multi-round-trip driver fields. This is the typed driver-material channel
973
+ * of the codec contract — handlers never see it; the protocol layer surfaces
974
+ * it via `ctx.mcpReq.envelope` / `.inputResponses` / `.requestState`, and the
975
+ * MRTR driver (M4.1) consumes the retry fields from here.
976
+ */
977
+ interface LiftedWireMaterial {
978
+ envelope?: Partial<RequestMetaEnvelope>;
979
+ inputResponses?: Record<string, unknown>;
980
+ requestState?: string;
981
+ }
982
+ /**
983
+ * Tri-state validation outcome — the function-only contract for what the
984
+ * schema-getter pair (`hasRequestMethod` ⇒ −32601-by-absence; `…Schema(m)
985
+ * .parse` throw ⇒ −32602) used to encode in two pieces. Preserving the split
986
+ * is the point: collapsing 'absent from this era's registry' into 'invalid'
987
+ * would make the in-band fallback chain (validate → on `not-in-era` fall to
988
+ * validateInputRequest) treat absence as failure and never fall through.
989
+ */
990
+ type ValidateOutcome<T$1> = {
991
+ readonly ok: true;
992
+ readonly value: T$1;
993
+ }
994
+ /**
995
+ * Method is spec vocabulary but absent from THIS era's registry. Callers
996
+ * map to −32601 (inbound) or a typed local SdkError (outbound), or fall
997
+ * through to the in-band validator.
998
+ */ | {
999
+ readonly ok: false;
1000
+ readonly reason: 'not-in-era';
1001
+ }
1002
+ /**
1003
+ * Method is in this era's registry; payload failed the era-exact schema.
1004
+ * Callers map to −32602.
1005
+ */ | {
1006
+ readonly ok: false;
1007
+ readonly reason: 'invalid';
1008
+ readonly message: string;
1009
+ };
1010
+ /** A single self-identifying problem found while validating a per-request `_meta` envelope. */
1011
+ interface EnvelopeIssue {
1012
+ /**
1013
+ * The envelope key the problem is about: one of the reserved `_meta`
1014
+ * keys, or a dotted path inside one.
1015
+ */
1016
+ readonly key: string;
1017
+ /** A short description of what is wrong with that key (`missing`, or a validation message). */
1018
+ readonly problem: string;
1019
+ }
1020
+ /** Material a Client supplies for an era to build its per-request `_meta` envelope from. */
1021
+ interface OutboundEnvelopeMaterial {
1022
+ readonly protocolVersion: string;
1023
+ readonly clientInfo: Implementation;
1024
+ readonly clientCapabilities: ClientCapabilities;
1025
+ readonly logLevel?: LoggingLevel;
1026
+ }
1027
+ /** Result decode outcomes — the raw-first discrimination (V-1) lives in `decodeResult`. */
1028
+ type DecodedResult = {
1029
+ kind: 'complete';
1030
+ /** The neutral result value: wire-only material consumed/stripped. */
1031
+ result: Result$1;
1032
+ } | {
1033
+ kind: 'input_required';
1034
+ /**
1035
+ * Driver-only material (never consumer-visible). The full
1036
+ * multi-round-trip driver is M4.1 scope; this seam carries the
1037
+ * discriminated payload to it.
1038
+ */
1039
+ inputRequests: Record<string, unknown>;
1040
+ requestState?: string;
1041
+ } | {
1042
+ kind: 'invalid';
1043
+ error: SdkError;
1044
+ };
1045
+ /**
1046
+ * The per-era wire codec contract (design C §3, adapted to the live funnel
1047
+ * layout: the universal wire-only LIFT runs once in the protocol layer for
1048
+ * every message — spec, custom, and fallback paths alike — and codecs consume
1049
+ * the lifted material rather than re-implementing the strip per era).
1050
+ */
1051
+ interface WireCodec {
1052
+ readonly era: WireEra;
1053
+ /** Registry membership — the deletion story (inbound −32601 by absence; outbound typed local error). */
1054
+ hasRequestMethod(method: string): boolean;
1055
+ hasNotificationMethod(method: string): boolean;
1056
+ hasInputRequestMethod(method: string): boolean;
1057
+ /** Era-exact request validation. `not-in-era` ≡ −32601-by-absence; `invalid` ≡ −32602. */
1058
+ validateRequest<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<RequestTypeMap[M$1]>;
1059
+ validateRequest(method: string, raw: unknown): ValidateOutcome<unknown>;
1060
+ /** Era-exact result validation (same registry as `validateRequest`). */
1061
+ validateResult<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<ResultTypeMap[M$1]>;
1062
+ validateResult(method: string, raw: unknown): ValidateOutcome<unknown>;
1063
+ /** Era-exact notification validation. */
1064
+ validateNotification<M$1 extends NotificationMethod>(method: M$1, raw: unknown): ValidateOutcome<NotificationTypeMap[M$1]>;
1065
+ validateNotification(method: string, raw: unknown): ValidateOutcome<unknown>;
1066
+ /**
1067
+ * In-band (de-JSON-RPC'd) input-request validation — the embedded
1068
+ * requests a multi-round-trip `input_required` result may carry. Always
1069
+ * `not-in-era` on the 2025 era (elicitation/sampling/roots are wire
1070
+ * request methods there). Does NOT grant registry membership.
1071
+ */
1072
+ validateInputRequest<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<RequestTypeMap[M$1]>;
1073
+ validateInputRequest(method: string, raw: unknown): ValidateOutcome<unknown>;
1074
+ /** In-band bare-response validation answering an embedded input request. */
1075
+ validateInputResponse<M$1 extends RequestMethod>(method: M$1, raw: unknown): ValidateOutcome<ResultTypeMap[M$1]>;
1076
+ validateInputResponse(method: string, raw: unknown): ValidateOutcome<unknown>;
1077
+ /**
1078
+ * Param-conditional `sampling/createMessage` result validation — the one
1079
+ * spec result whose schema depends on REQUEST params (tools vs no tools).
1080
+ * The 2025 era owns the with-tools/plain frozen schemas; the 2026 era
1081
+ * returns `not-in-era` (sampling is in-band there — callers fall through
1082
+ * to `validateInputResponse`).
1083
+ */
1084
+ samplingResultVariant(hasTools: true, raw: unknown): ValidateOutcome<CreateMessageResultWithTools>;
1085
+ samplingResultVariant(hasTools: false, raw: unknown): ValidateOutcome<CreateMessageResult>;
1086
+ samplingResultVariant(hasTools: boolean, raw: unknown): ValidateOutcome<CreateMessageResult | CreateMessageResultWithTools>;
1087
+ /**
1088
+ * Outbound per-request `_meta` envelope encode. Returns the keyed object
1089
+ * to merge into `params._meta` on this era, or `undefined` when this era
1090
+ * carries no per-request envelope (the 2025 era — legacy wire stays
1091
+ * byte-identical).
1092
+ */
1093
+ outboundEnvelope(material: OutboundEnvelopeMaterial): Readonly<Record<string, unknown>> | undefined;
1094
+ /**
1095
+ * Structured envelope validation: maps a `_meta` object to
1096
+ * self-identifying issues. The 2025 era never requires an envelope and
1097
+ * always returns `[]`; the 2026 era owns the required-key pre-pass plus
1098
+ * the wire-exact `RequestMetaEnvelopeSchema` parse.
1099
+ */
1100
+ validateEnvelopeMeta(meta: Readonly<Record<string, unknown>>): EnvelopeIssue[];
1101
+ /**
1102
+ * Per-registration `tools/call` result projection. Two independent
1103
+ * decisions, both owned here so server-side code never re-derives them:
1104
+ *
1105
+ * - SEP-2106 §4.3 TextContent auto-append (EVERY era, value-shape-based):
1106
+ * when `structuredContent` is a non-object value (array/primitive/
1107
+ * `null`) and the handler authored no `type:'text'` block, append
1108
+ * `{type:'text', text: JSON.stringify(value)}` so consumers that read
1109
+ * only `content` still receive a rendering. The author opts out by
1110
+ * returning any `text` block themselves.
1111
+ *
1112
+ * - `{result:…}` wrap (2025 era only): wrap as `{result:<value>}` when the
1113
+ * value is non-object (the 2025 wire shape requires `structuredContent`
1114
+ * to be an object — a schema-less tool returning `[1,2,3]` would
1115
+ * otherwise ship wire-illegal bytes) OR when the tool's ADVERTISED
1116
+ * `outputSchema` has a non-object root (so the result matches the
1117
+ * `encodeResult('tools/list')` projection of the same tool). Identity on
1118
+ * the 2026 era — the wire shape carries the natural value directly.
1119
+ */
1120
+ projectCallToolResult(result: CallToolResult, advertisedOutputSchema: Readonly<Record<string, unknown>> | undefined): CallToolResult;
1121
+ /**
1122
+ * Step 1 of result decoding: RAW `resultType` handling BEFORE any schema
1123
+ * validation (V-1's structural home). Era postures (Q1-SD3):
1124
+ * - 2026 era: required discriminator — absent ⇒ typed error naming the
1125
+ * spec violation; `input_required` ⇒ driver payload; unknown ⇒ invalid,
1126
+ * no retry; `complete` ⇒ consume + lift.
1127
+ * - 2025 era: `resultType` is foreign vocabulary ⇒ strip-on-lift.
1128
+ */
1129
+ decodeResult(method: string, raw: unknown): DecodedResult;
1130
+ /**
1131
+ * Outbound result mapping (the stamp seam). The 2025-era codec is the
1132
+ * identity — it has NO stamp code path (the never-stamp guarantee; it
1133
+ * never reads `serverInfo`). The 2026-era codec strictly enforces the
1134
+ * 2026 wire shape for the known deleted-field set
1135
+ * (`execution.taskSupport`, `capabilities.tasks` — Q1-SD3 iii), stamps
1136
+ * `resultType`, fills the required `ttlMs`/`cacheScope` fields on
1137
+ * cacheable results, and — when the caller supplies its identity —
1138
+ * stamps `_meta['io.modelcontextprotocol/serverInfo']` on every result
1139
+ * (spec PR #3002 SHOULD; a handler-authored value wins). `Server`
1140
+ * instances pass their identity; clients and hand-constructed protocol
1141
+ * objects pass nothing and no identity is ever invented.
1142
+ */
1143
+ encodeResult(method: string, result: Result$1, serverInfo?: Implementation): Result$1;
1144
+ /**
1145
+ * Outbound error-code mapping (the error half of the stamp seam). A
1146
+ * handler-thrown `ProtocolError`'s numeric code passes through here on
1147
+ * its way to the JSON-RPC error response, so per-era wire-code selection
1148
+ * lives in the codec rather than in handler/funnel code. The current
1149
+ * mapping is identical on both eras (the `-32002` resource-not-found
1150
+ * domain code maps to `-32602` Invalid Params on the wire — the
1151
+ * 2026-07-28 spec MUST, and what the deployed v1.x SDK already emits on
1152
+ * earlier revisions); the seam is the structural home for any future
1153
+ * per-era divergence. Unknown codes pass through unchanged.
1154
+ */
1155
+ encodeErrorCode(code: number): number;
1156
+ /**
1157
+ * @deprecated Use {@link validateEnvelopeMeta}. Inbound envelope
1158
+ * enforcement for era-classified traffic: validates the lifted envelope
1159
+ * material of a request. Returns an error message when the era requires
1160
+ * an envelope and it is missing/invalid (→ −32602 at the dispatch
1161
+ * layer); `undefined` when acceptable. The 2025 era never requires an
1162
+ * envelope.
1163
+ */
1164
+ checkInboundEnvelope(material: LiftedWireMaterial): string | undefined;
1165
+ }
1166
+ //#endregion
1167
+ //#region ../core-internal/src/util/standardSchema.d.ts
1168
+ interface StandardTypedV1<Input = unknown, Output = Input> {
1169
+ readonly '~standard': StandardTypedV1.Props<Input, Output>;
1170
+ }
1171
+ declare namespace StandardTypedV1 {
1172
+ interface Props<Input = unknown, Output = Input> {
1173
+ readonly version: 1;
1174
+ readonly vendor: string;
1175
+ readonly types?: Types<Input, Output> | undefined;
1176
+ }
1177
+ interface Types<Input = unknown, Output = Input> {
1178
+ readonly input: Input;
1179
+ readonly output: Output;
1180
+ }
1181
+ type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['input'];
1182
+ type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['output'];
1183
+ }
1184
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
1185
+ readonly '~standard': StandardSchemaV1.Props<Input, Output>;
1186
+ }
1187
+ declare namespace StandardSchemaV1 {
1188
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
1189
+ readonly validate: (value: unknown, options?: Options | undefined) => Result<Output> | Promise<Result<Output>>;
1190
+ }
1191
+ interface Options {
1192
+ readonly libraryOptions?: Record<string, unknown> | undefined;
1193
+ }
1194
+ type Result<Output> = SuccessResult<Output> | FailureResult;
1195
+ interface SuccessResult<Output> {
1196
+ readonly value: Output;
1197
+ readonly issues?: undefined;
1198
+ }
1199
+ interface FailureResult {
1200
+ readonly issues: ReadonlyArray<Issue>;
1201
+ }
1202
+ interface Issue {
1203
+ readonly message: string;
1204
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
1205
+ }
1206
+ interface PathSegment {
1207
+ readonly key: PropertyKey;
1208
+ }
1209
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1210
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1211
+ }
1212
+ interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
1213
+ readonly '~standard': StandardJSONSchemaV1.Props<Input, Output>;
1214
+ }
1215
+ declare namespace StandardJSONSchemaV1 {
1216
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
1217
+ readonly jsonSchema: Converter;
1218
+ }
1219
+ interface Converter {
1220
+ readonly input: (options: Options) => Record<string, unknown>;
1221
+ readonly output: (options: Options) => Record<string, unknown>;
1222
+ }
1223
+ type Target = 'draft-2020-12' | 'draft-07' | 'openapi-3.0' | (object & string);
1224
+ interface Options {
1225
+ readonly target: Target;
1226
+ readonly libraryOptions?: Record<string, unknown> | undefined;
1227
+ }
1228
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1229
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1230
+ }
1231
+ /**
1232
+ * Combined interface for schemas with both validation and JSON Schema conversion —
1233
+ * the intersection of {@linkcode StandardSchemaV1} and {@linkcode StandardJSONSchemaV1}.
1234
+ *
1235
+ * This is the type accepted by `registerTool` / `registerPrompt`. The SDK needs
1236
+ * `~standard.jsonSchema` to advertise the tool's argument shape in `tools/list`, and
1237
+ * `~standard.validate` to check incoming arguments when a `tools/call` arrives.
1238
+ *
1239
+ * Zod v4, ArkType, and Valibot (via `@valibot/to-json-schema`'s `toStandardJsonSchema`)
1240
+ * all implement both interfaces.
1241
+ *
1242
+ * @see https://standardschema.dev/ for the Standard Schema specification
1243
+ */
1244
+ interface StandardSchemaWithJSON<Input = unknown, Output = Input> {
1245
+ readonly '~standard': StandardSchemaV1.Props<Input, Output> & StandardJSONSchemaV1.Props<Input, Output>;
1246
+ }
1247
+ declare namespace StandardSchemaWithJSON {
1248
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1249
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1250
+ }
1251
+ /**
1252
+ * Narrowing of {@linkcode StandardSchemaV1} whose `validate` is guaranteed synchronous.
1253
+ *
1254
+ * The Zod schemas backing `specTypeSchemas` contain no async refinements or transforms,
1255
+ * so every entry satisfies this interface. Consumers can call `validate()` and access
1256
+ * `.issues` / `.value` on the result without `await`.
1257
+ *
1258
+ * `StandardSchemaV1Sync` is assignable to `StandardSchemaV1` — it is a strict subtype.
1259
+ */
1260
+ interface StandardSchemaV1Sync<Input = unknown, Output = Input> extends StandardSchemaV1<Input, Output> {
1261
+ readonly '~standard': StandardSchemaV1Sync.Props<Input, Output>;
1262
+ }
1263
+ declare namespace StandardSchemaV1Sync {
1264
+ interface Props<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output> {
1265
+ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<Output>;
1266
+ }
1267
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
1268
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
1269
+ }
1270
+ //#endregion
1271
+ //#region ../core-internal/src/shared/inputRequired.d.ts
1272
+ /**
1273
+ * Wraps a result schema so a request issued through `client.request()` /
1274
+ * `ctx.mcpReq.send()` with `allowInputRequired: true` is typed as either the
1275
+ * schema's result or an {@linkcode InputRequiredResult}.
1276
+ *
1277
+ * The manual multi-round-trip path: pass `{ allowInputRequired: true }` in the
1278
+ * request options so an `input_required` response is handed back to the
1279
+ * caller instead of being auto-fulfilled (or rejected), and wrap the result
1280
+ * schema with `withInputRequired()` so the returned value is typed and
1281
+ * validated correctly for both outcomes — `input_required` values pass
1282
+ * through as-is, complete results validate against the wrapped schema.
1283
+ */
1284
+ declare function withInputRequired<S extends StandardSchemaV1>(schema: S): StandardSchemaV1<unknown, StandardSchemaV1.InferOutput<S> | InputRequiredResult>;
1285
+ //#endregion
1286
+ //#region ../core-internal/src/shared/inputRequiredDriver.d.ts
1287
+ /**
1288
+ * Multi-round-trip driver options (`inputRequired` on the client options bag).
1289
+ */
1290
+ interface InputRequiredOptions {
1291
+ /**
1292
+ * Fulfil `input_required` results automatically by dispatching the
1293
+ * embedded requests to the registered handlers and retrying.
1294
+ *
1295
+ * Set to `false` for manual mode: an `input_required` response then
1296
+ * surfaces as a typed error unless the individual call opts in with
1297
+ * `allowInputRequired: true` (and, for typed results on the explicit
1298
+ * schema path, `withInputRequired()`).
1299
+ *
1300
+ * @default true
1301
+ */
1302
+ autoFulfill?: boolean;
1303
+ /**
1304
+ * Maximum number of rounds (retries) the driver performs for a single
1305
+ * call before failing with a typed
1306
+ * {@linkcode SdkErrorCode.InputRequiredRoundsExceeded} error.
1307
+ *
1308
+ * @default 10
1309
+ */
1310
+ maxRounds?: number;
1311
+ }
1312
+ //#endregion
1313
+ //#region ../core-internal/src/types/enums.d.ts
1314
+ /**
1315
+ * Error codes for protocol errors that cross the wire as JSON-RPC error responses.
1316
+ * These follow the JSON-RPC specification and MCP-specific extensions.
1317
+ */
1318
+ declare enum ProtocolErrorCode {
1319
+ ParseError = -32700,
1320
+ InvalidRequest = -32600,
1321
+ MethodNotFound = -32601,
1322
+ InvalidParams = -32602,
1323
+ InternalError = -32603,
1324
+ /**
1325
+ * Resource not found.
1326
+ *
1327
+ * Receive-tolerated only: the SDK never EMITS `-32002` — `resources/read`
1328
+ * misses answer `-32602` (Invalid Params) on every protocol revision per
1329
+ * the 2026-07-28 spec MUST, and a handler-thrown `-32002` is mapped to
1330
+ * `-32602` at the era encode seam. The member stays importable so clients
1331
+ * can recognise `-32002` from peers built on earlier SDK releases (the
1332
+ * spec's "clients SHOULD also accept `-32002`" backwards-compatibility
1333
+ * clause). Throw `ResourceNotFoundError` instead.
1334
+ */
1335
+ ResourceNotFound = -32002,
1336
+ /**
1337
+ * Processing the request requires a capability the client did not declare
1338
+ * in the request's `clientCapabilities` (protocol revision 2026-07-28).
1339
+ */
1340
+ MissingRequiredClientCapability = -32021,
1341
+ /**
1342
+ * The request's protocol version is unknown to the server or unsupported
1343
+ * by it (protocol revision 2026-07-28).
1344
+ */
1345
+ UnsupportedProtocolVersion = -32022,
1346
+ UrlElicitationRequired = -32042,
1347
+ }
1348
+ //#endregion
1349
+ //#region ../core-internal/src/types/errors.d.ts
1350
+ /**
1351
+ * Protocol errors are JSON-RPC errors that cross the wire as error responses.
1352
+ * They use numeric error codes from the {@linkcode ProtocolErrorCode} enum.
1353
+ *
1354
+ * `instanceof` on this class (and its subclasses) is brand-matched, so it works
1355
+ * across separately bundled copies of the SDK — e.g. an error constructed by
1356
+ * `@modelcontextprotocol/client` matches the class re-exported by
1357
+ * `@modelcontextprotocol/server` in the same process.
1358
+ */
1359
+ declare class ProtocolError extends Error {
1360
+ readonly code: number;
1361
+ readonly data?: unknown | undefined;
1362
+ static [Symbol.hasInstance](value: unknown): boolean;
1363
+ /**
1364
+ * Brand-based type guard: equivalent to `value instanceof this`, as an
1365
+ * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
1366
+ * the caller's own brand via `this`, so every branded subclass gets a
1367
+ * correctly-scoped guard by inheritance. Must be invoked on the class —
1368
+ * in callback position write `v => SdkError.isInstance(v)`, not
1369
+ * `.filter(SdkError.isInstance)` (detached calls throw rather than
1370
+ * silently matching nothing).
1371
+ */
1372
+ static isInstance<T$1 extends abstract new (...args: never[]) => unknown>(this: T$1, value: unknown): value is InstanceType<T$1>;
1373
+ constructor(code: number, message: string, data?: unknown | undefined);
1374
+ /**
1375
+ * Factory method to create the appropriate error type based on the error code and data
1376
+ */
1377
+ static fromError(code: number, message: string, data?: unknown): ProtocolError;
1378
+ }
1379
+ /**
1380
+ * Error type for a `resources/read` miss: the requested resource does not
1381
+ * exist. The wire code is `-32602` (Invalid Params) on every protocol
1382
+ * revision — the spec MUST for revision 2026-07-28, and the value the v1.x
1383
+ * SDK has always emitted on earlier revisions. The error data echoes the
1384
+ * requested URI.
1385
+ *
1386
+ * Recognise this error by checking `error.data` is exactly `{ uri: string }`
1387
+ * (a `-32602` whose data carries `uri` and nothing else is resource-not-found;
1388
+ * any other `-32602` is an ordinary Invalid Params). For backwards compatibility, clients should also
1389
+ * accept `-32002` as resource not found — earlier SDK builds emitted that
1390
+ * code, and {@linkcode ProtocolError.fromError} reconstructs this class for
1391
+ * either code **when `error.data` carries `uri`** (a bare `-32002` without
1392
+ * `data.uri` stays a generic {@linkcode ProtocolError}). `instanceof` checks
1393
+ * are brand-matched and work across separately bundled copies of the SDK.
1394
+ */
1395
+ declare class ResourceNotFoundError extends ProtocolError {
1396
+ constructor(uri: string, message?: string);
1397
+ /** The URI that was requested and not found. */
1398
+ get uri(): string;
1399
+ }
1400
+ /**
1401
+ * Specialized error type when a tool requires a URL mode elicitation.
1402
+ * 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.
1403
+ */
1404
+ declare class UrlElicitationRequiredError extends ProtocolError {
1405
+ constructor(elicitations: ElicitRequestURLParams[], message?: string);
1406
+ get elicitations(): ElicitRequestURLParams[];
1407
+ }
1408
+ /**
1409
+ * Error type for the `-32022` UnsupportedProtocolVersion protocol error (protocol
1410
+ * revision 2026-07-28): the request's protocol version is unknown to the server or
1411
+ * unsupported by it.
1412
+ *
1413
+ * The error data lists the protocol versions the receiver supports (`supported`),
1414
+ * so the sender can choose a mutually supported version and retry, and echoes the
1415
+ * version that was requested (`requested`).
1416
+ */
1417
+ declare class UnsupportedProtocolVersionError extends ProtocolError {
1418
+ constructor(data: UnsupportedProtocolVersionErrorData, message?: string);
1419
+ /**
1420
+ * Protocol versions the receiver supports.
1421
+ */
1422
+ get supported(): string[];
1423
+ /**
1424
+ * The protocol version that was requested.
1425
+ */
1426
+ get requested(): string;
1427
+ }
1428
+ /**
1429
+ * Error type for the `-32021` MissingRequiredClientCapability protocol error
1430
+ * (protocol revision 2026-07-28): processing the request requires a capability
1431
+ * the client did not declare in the request's `clientCapabilities`.
1432
+ *
1433
+ * The error data lists the missing capabilities (`requiredCapabilities`) in
1434
+ * the `ClientCapabilities` shape, so the client can see exactly what it would
1435
+ * have to declare for the request to be served. On HTTP, the response status
1436
+ * is `400 Bad Request`.
1437
+ *
1438
+ * Recognize this error by its code and `data.requiredCapabilities`, or by
1439
+ * `instanceof` — checks are brand-matched and work across separately bundled
1440
+ * copies of the SDK.
1441
+ */
1442
+ declare class MissingRequiredClientCapabilityError extends ProtocolError {
1443
+ constructor(data: MissingRequiredClientCapabilityErrorData, message?: string);
1444
+ /**
1445
+ * The capabilities the server requires from the client to process the
1446
+ * request (only the missing capabilities are listed).
1447
+ */
1448
+ get requiredCapabilities(): ClientCapabilities;
1449
+ }
1450
+ //#endregion
1451
+ //#region ../core-internal/src/types/guards.d.ts
1452
+ /**
1453
+ * Validates and parses an unknown value as a JSON-RPC message.
1454
+ *
1455
+ * Use this to validate incoming messages in custom transport implementations.
1456
+ * Throws if the value does not conform to the JSON-RPC message schema.
1457
+ *
1458
+ * @param value - The value to validate (typically a parsed JSON object).
1459
+ * @returns The validated {@linkcode JSONRPCMessage}.
1460
+ * @throws If validation fails.
1461
+ */
1462
+ declare function parseJSONRPCMessage(value: unknown): JSONRPCMessage;
1463
+ declare const isJSONRPCRequest: (value: unknown) => value is JSONRPCRequest;
1464
+ declare const isJSONRPCNotification: (value: unknown) => value is JSONRPCNotification;
1465
+ /**
1466
+ * Checks if a value is a valid {@linkcode JSONRPCResultResponse}.
1467
+ * @param value - The value to check.
1468
+ *
1469
+ * @returns True if the value is a valid {@linkcode JSONRPCResultResponse}, false otherwise.
1470
+ */
1471
+ declare const isJSONRPCResultResponse: (value: unknown) => value is JSONRPCResultResponse;
1472
+ /**
1473
+ * Checks if a value is a valid {@linkcode JSONRPCErrorResponse}.
1474
+ * @param value - The value to check.
1475
+ *
1476
+ * @returns True if the value is a valid {@linkcode JSONRPCErrorResponse}, false otherwise.
1477
+ */
1478
+ declare const isJSONRPCErrorResponse: (value: unknown) => value is JSONRPCErrorResponse;
1479
+ /**
1480
+ * Checks if a value is a valid {@linkcode JSONRPCResponse} (either a result or error response).
1481
+ * @param value - The value to check.
1482
+ *
1483
+ * @returns True if the value is a valid {@linkcode JSONRPCResponse}, false otherwise.
1484
+ */
1485
+ declare const isJSONRPCResponse: (value: unknown) => value is JSONRPCResponse;
1486
+ /**
1487
+ * Checks if a value is a valid {@linkcode CallToolResult}.
1488
+ *
1489
+ * This is a consumer-side VALUE check against the neutral model, not a wire
1490
+ * validator: a raw wire object that additionally carries wire-only members
1491
+ * (e.g. `resultType`) still passes through the loose index signature. Use a
1492
+ * transport-level parse to validate raw wire traffic.
1493
+ *
1494
+ * @param value - The value to check.
1495
+ *
1496
+ * @returns True if the value is a valid {@linkcode CallToolResult}, false otherwise.
1497
+ */
1498
+ declare const isCallToolResult: (value: unknown) => value is CallToolResult;
1499
+ /**
1500
+ * Checks whether a value is an input-required result (protocol revision
1501
+ * 2026-07-28): the multi-round-trip return shape discriminated by
1502
+ * `resultType: 'input_required'`.
1503
+ *
1504
+ * This is a discriminator check, not a full validator — the at-least-one rule
1505
+ * (`inputRequests` or `requestState`) is enforced by the `inputRequired()`
1506
+ * builder and re-checked by the server seam for hand-built values.
1507
+ *
1508
+ * @param value - The value to check.
1509
+ * @returns True if the value carries the `input_required` discriminator.
1510
+ */
1511
+ declare const isInputRequiredResult: (value: unknown) => value is InputRequiredResult;
1512
+ /**
1513
+ * Checks if a value is a valid {@linkcode TaskAugmentedRequestParams}.
1514
+ * @param value - The value to check.
1515
+ *
1516
+ * @returns True if the value is a valid {@linkcode TaskAugmentedRequestParams}, false otherwise.
1517
+ *
1518
+ * @deprecated Recognizes 2025-11-25 task wire vocabulary, which has no SDK
1519
+ * runtime; kept importable for interoperability only.
1520
+ */
1521
+ declare const isTaskAugmentedRequestParams: (value: unknown) => value is TaskAugmentedRequestParams;
1522
+ declare const isInitializeRequest: (value: unknown) => value is InitializeRequest;
1523
+ declare const isInitializedNotification: (value: unknown) => value is InitializedNotification;
1524
+ declare function assertCompleteRequestPrompt(request: CompleteRequest): asserts request is CompleteRequestPrompt;
1525
+ declare function assertCompleteRequestResourceTemplate(request: CompleteRequest): asserts request is CompleteRequestResourceTemplate;
1526
+ //#endregion
1527
+ //#region ../core-internal/src/types/specTypeSchema.d.ts
1528
+ /**
1529
+ * Explicit allowlist of protocol Zod schemas that correspond to a public spec type in `types.ts`.
1530
+ *
1531
+ * This intentionally excludes internal helper schemas exported from `schemas.ts` that have no
1532
+ * matching public type (e.g. `ListChangedOptionsBaseSchema`, `BaseRequestParamsSchema`,
1533
+ * `NotificationsParamsSchema`, `ClientTasksCapabilitySchema`, `ServerTasksCapabilitySchema`).
1534
+ * Keeping the list explicit means new public spec types must be added here deliberately, and
1535
+ * internals never leak into `SpecTypeName`.
1536
+ *
1537
+ * `ResourceTemplateSchema` is included; its public type is exported as `ResourceTemplateType`
1538
+ * (the bare name collides with the server package's `ResourceTemplate` class), so
1539
+ * `SpecTypes['ResourceTemplate']` is structurally equal to `ResourceTemplateType` rather than to
1540
+ * a type literally named `ResourceTemplate`.
1541
+ */
1542
+ 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"];
1543
+ declare const authSchemas: {
1544
+ readonly IdJagTokenExchangeResponseSchema: any;
1545
+ readonly OAuthClientInformationFullSchema: any;
1546
+ readonly OAuthClientInformationSchema: any;
1547
+ readonly OAuthClientMetadataSchema: any;
1548
+ readonly OAuthClientRegistrationErrorSchema: any;
1549
+ readonly OAuthErrorResponseSchema: any;
1550
+ readonly OAuthMetadataSchema: any;
1551
+ readonly OAuthProtectedResourceMetadataSchema: any;
1552
+ readonly OAuthTokenRevocationRequestSchema: any;
1553
+ readonly OAuthTokensSchema: any;
1554
+ readonly OpenIdProviderDiscoveryMetadataSchema: any;
1555
+ readonly OpenIdProviderMetadataSchema: any;
1556
+ };
1557
+ type ProtocolSchemaKey = (typeof SPEC_SCHEMA_KEYS)[number];
1558
+ type AuthSchemaKey = keyof typeof authSchemas;
1559
+ type SchemaKey = ProtocolSchemaKey | AuthSchemaKey;
1560
+ 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;
1561
+ type StripSchemaSuffix<K$1> = K$1 extends `${infer N}Schema` ? N : never;
1562
+ /**
1563
+ * Union of every named type in the SDK's protocol and OAuth schemas (e.g. `'CallToolResult'`,
1564
+ * `'ContentBlock'`, `'Tool'`, `'OAuthTokens'`). Derived from the internal Zod schemas, so it stays
1565
+ * in sync with the spec.
1566
+ */
1567
+ type SpecTypeName = StripSchemaSuffix<SchemaKey>;
1568
+ /**
1569
+ * Maps each {@linkcode SpecTypeName} to its TypeScript type.
1570
+ *
1571
+ * `SpecTypes['Tool']` is equivalent to importing the `Tool` type directly.
1572
+ * These validators cover the NEUTRAL model — the consumer-facing shapes with
1573
+ * no wire-only members (`resultType`, the reserved `_meta` envelope keys).
1574
+ * Per-revision WIRE validators are deliberately not public surface; they are
1575
+ * planned to return as versioned `zod-schemas/<revision>` exports for
1576
+ * consumers who validate raw wire traffic themselves.
1577
+ */
1578
+ type SpecTypes = { [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.output<SchemaFor<K>> : never };
1579
+ /**
1580
+ * Input shape for each {@linkcode SpecTypeName}. For most types this equals {@linkcode SpecTypes},
1581
+ * but a few schemas apply defaults/preprocessing, so the accepted input may be looser than the
1582
+ * resulting output type.
1583
+ */
1584
+ type SpecTypeInputs = { [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.input<SchemaFor<K>> : never };
1585
+ type SchemaRecord = { readonly [K in SpecTypeName]: StandardSchemaV1Sync<SpecTypeInputs[K], SpecTypes[K]> };
1586
+ type GuardRecord = { readonly [K in SpecTypeName]: (value: unknown) => value is SpecTypeInputs[K] };
1587
+ /**
1588
+ * Runtime validators for every MCP spec type, keyed by type name.
1589
+ *
1590
+ * Use this when you need to validate a spec-defined shape at a boundary the SDK does not own, for
1591
+ * example an extension's custom-method payload that embeds a `CallToolResult`, or a value read from
1592
+ * storage that should be a `Tool`.
1593
+ *
1594
+ * Each entry implements the Standard Schema interface, so it composes with any
1595
+ * Standard-Schema-aware library. For a simple boolean check, use {@linkcode isSpecType} instead.
1596
+ *
1597
+ * @example
1598
+ * ```ts source="./specTypeSchema.examples.ts#specTypeSchemas_basicUsage"
1599
+ * const result = specTypeSchemas.CallToolResult['~standard'].validate(untrusted);
1600
+ * if (result.issues === undefined) {
1601
+ * // result.value is CallToolResult
1602
+ * }
1603
+ * ```
1604
+ */
1605
+ declare const specTypeSchemas: SchemaRecord;
1606
+ /**
1607
+ * Type predicates for every MCP spec type, keyed by type name.
1608
+ *
1609
+ * Returns `true` if the value satisfies the schema's input type (`z.input<>`, before defaults and
1610
+ * transforms are applied), and narrows to that input type. For schemas with `.default()` or
1611
+ * `.preprocess()`, this may accept values that do not structurally match the named output type;
1612
+ * for example `isSpecType.CallToolResult({})` is `true` because `content` has a default. Use
1613
+ * `specTypeSchemas.X['~standard'].validate(value)` when you need the validated output value.
1614
+ *
1615
+ * Each guard is a standalone function, so it can be passed directly as a callback.
1616
+ *
1617
+ * @example
1618
+ * ```ts source="./specTypeSchema.examples.ts#isSpecType_basicUsage"
1619
+ * if (isSpecType.ContentBlock(value)) {
1620
+ * // value is ContentBlock
1621
+ * }
1622
+ *
1623
+ * const blocks = mixed.filter(isSpecType.ContentBlock);
1624
+ * ```
1625
+ */
1626
+ declare const isSpecType: GuardRecord;
1627
+ //#endregion
1628
+ //#region ../core-internal/src/shared/transport.d.ts
1629
+ type FetchLike = (url: string | URL, init?: RequestInit) => Promise<Response>;
1630
+ /**
1631
+ * Creates a fetch function that includes base `RequestInit` options.
1632
+ * This ensures requests inherit settings like credentials, mode, headers, etc. from the base init.
1633
+ *
1634
+ * @param baseFetch - The base fetch function to wrap (defaults to global `fetch`)
1635
+ * @param baseInit - The base `RequestInit` to merge with each request
1636
+ * @returns A wrapped fetch function that merges base options with call-specific options
1637
+ */
1638
+ declare function createFetchWithInit(baseFetch?: FetchLike, baseInit?: RequestInit): FetchLike;
1639
+ /**
1640
+ * Options for sending a JSON-RPC message.
1641
+ */
1642
+ type TransportSendOptions = {
1643
+ /**
1644
+ * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
1645
+ */
1646
+ relatedRequestId?: RequestId | undefined;
1647
+ /**
1648
+ * The resumption token used to continue long-running requests that were interrupted.
1649
+ *
1650
+ * This allows clients to reconnect and continue from where they left off, if supported by the transport.
1651
+ */
1652
+ resumptionToken?: string | undefined;
1653
+ /**
1654
+ * A callback that is invoked when the resumption token changes, if supported by the transport.
1655
+ *
1656
+ * This allows clients to persist the latest token for potential reconnection.
1657
+ */
1658
+ onresumptiontoken?: ((token: string) => void) | undefined;
1659
+ /**
1660
+ * An abort signal for THIS outbound message's underlying request, when the
1661
+ * transport sends one outbound message per underlying request (the
1662
+ * Streamable HTTP transport's POST-per-request model). Aborting it cancels
1663
+ * the underlying request (and its SSE response stream) without closing the
1664
+ * transport. Transports that share a single channel (stdio, in-memory)
1665
+ * ignore it.
1666
+ */
1667
+ requestSignal?: AbortSignal | undefined;
1668
+ /**
1669
+ * Fired by transports that open a per-request stream (the Streamable HTTP
1670
+ * transport's POST-per-request SSE response) when that stream ends or
1671
+ * errors for any reason OTHER than a deliberate `requestSignal` abort —
1672
+ * i.e. the server closed the stream, the network dropped it, or
1673
+ * reconnection was exhausted. Transports that share a single channel
1674
+ * (stdio, in-memory) ignore it.
1675
+ */
1676
+ onRequestStreamEnd?: (() => void) | undefined;
1677
+ /**
1678
+ * Additional HTTP headers to send with THIS outbound message, when the
1679
+ * transport sends one outbound message per underlying HTTP request (the
1680
+ * Streamable HTTP transport's POST-per-request model). Transports that
1681
+ * share a single channel (stdio, in-memory) ignore it.
1682
+ *
1683
+ * The Client uses this to attach SEP-2243 `Mcp-Param-{Name}` headers to a
1684
+ * `tools/call` request on a 2026-07-28 connection. Values are sent
1685
+ * verbatim — encode anything that is not a safe RFC 9110 field value
1686
+ * before passing it here.
1687
+ */
1688
+ headers?: Readonly<Record<string, string>> | undefined;
1689
+ };
1690
+ /**
1691
+ * Describes the minimal contract for an MCP transport that a client or server can communicate over.
1692
+ */
1693
+ interface Transport {
1694
+ /**
1695
+ * Starts processing messages on the transport, including any connection steps that might need to be taken.
1696
+ *
1697
+ * This method should only be called after callbacks are installed, or else messages may be lost.
1698
+ *
1699
+ * 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()}.
1700
+ */
1701
+ start(): Promise<void>;
1702
+ /**
1703
+ * Sends a JSON-RPC message (request or response).
1704
+ *
1705
+ * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with.
1706
+ */
1707
+ send(message: JSONRPCMessage, options?: TransportSendOptions): Promise<void>;
1708
+ /**
1709
+ * Closes the connection.
1710
+ */
1711
+ close(): Promise<void>;
1712
+ /**
1713
+ * `true` when this transport opens one underlying request per outbound
1714
+ * JSON-RPC request (the Streamable HTTP POST-per-request model) and
1715
+ * therefore honors {@linkcode TransportSendOptions.requestSignal}. The
1716
+ * 2026-07-28 spec makes closing that per-request stream the cancellation
1717
+ * signal — the protocol layer aborts `requestSignal` instead of POSTing
1718
+ * `notifications/cancelled` when this flag is set on a 2026-era
1719
+ * connection. Transports that share a single channel (stdio, in-memory)
1720
+ * leave it `undefined`.
1721
+ */
1722
+ readonly hasPerRequestStream?: boolean;
1723
+ /**
1724
+ * Callback for when the connection is closed for any reason.
1725
+ *
1726
+ * This should be invoked when {@linkcode Transport.close | close()} is called as well.
1727
+ */
1728
+ onclose?: (() => void) | undefined;
1729
+ /**
1730
+ * Callback for when an error occurs.
1731
+ *
1732
+ * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
1733
+ */
1734
+ onerror?: ((error: Error) => void) | undefined;
1735
+ /**
1736
+ * Callback for when a message (request or response) is received over the connection.
1737
+ *
1738
+ * Includes the {@linkcode MessageExtraInfo.request | request} and {@linkcode MessageExtraInfo.authInfo | authInfo} if the transport is authenticated.
1739
+ *
1740
+ * The {@linkcode MessageExtraInfo.request | request} can be used to get the original request information (headers, etc.)
1741
+ */
1742
+ onmessage?: (<T$1 extends JSONRPCMessage>(message: T$1, extra?: MessageExtraInfo) => void) | undefined;
1743
+ /**
1744
+ * The session ID generated for this connection.
1745
+ */
1746
+ sessionId?: string | undefined;
1747
+ /**
1748
+ * Sets the protocol version used for the connection (called when the initialize response is received).
1749
+ */
1750
+ setProtocolVersion?: ((version: string) => void) | undefined;
1751
+ /**
1752
+ * Sets the supported protocol versions for header validation (called during connect).
1753
+ * This allows the server to pass its supported versions to the transport.
1754
+ */
1755
+ setSupportedProtocolVersions?: ((versions: string[]) => void) | undefined;
1756
+ }
1757
+ //#endregion
1758
+ //#region ../core-internal/src/shared/protocol.d.ts
1759
+ /**
1760
+ * Callback for progress notifications.
1761
+ */
1762
+ type ProgressCallback = (progress: Progress) => void;
1763
+ /**
1764
+ * Additional initialization options.
1765
+ */
1766
+ type ProtocolOptions = {
1767
+ /**
1768
+ * Protocol versions supported. The legacy `initialize` handshake offers and
1769
+ * falls back to the first 2025-era entry in the list (the client sends it,
1770
+ * the server counter-offers it); 2026-era entries are only ever selected via
1771
+ * `server/discover`. Passed to transport during {@linkcode Protocol.connect | connect()}.
1772
+ *
1773
+ * @default {@linkcode SUPPORTED_PROTOCOL_VERSIONS}
1774
+ */
1775
+ supportedProtocolVersions?: string[];
1776
+ /**
1777
+ * Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities.
1778
+ *
1779
+ * Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those.
1780
+ *
1781
+ * Currently this defaults to `false`, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to `true`.
1782
+ */
1783
+ enforceStrictCapabilities?: boolean;
1784
+ /**
1785
+ * An array of notification method names that should be automatically debounced.
1786
+ * Any notifications with a method in this list will be coalesced if they
1787
+ * occur in the same tick of the event loop.
1788
+ * e.g., `['notifications/tools/list_changed']`
1789
+ */
1790
+ debouncedNotificationMethods?: string[];
1791
+ };
1792
+ /**
1793
+ * The default request timeout, in milliseconds.
1794
+ */
1795
+ declare const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
1796
+ /**
1797
+ * Options that can be given per request.
1798
+ */
1799
+ type RequestOptions = {
1800
+ /**
1801
+ * If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked.
1802
+ */
1803
+ onprogress?: ProgressCallback;
1804
+ /**
1805
+ * Can be used to cancel an in-flight request. This will cause an `AbortError` to be raised from {@linkcode Protocol.request | request()}.
1806
+ */
1807
+ signal?: AbortSignal;
1808
+ /**
1809
+ * 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()}.
1810
+ *
1811
+ * If not specified, {@linkcode DEFAULT_REQUEST_TIMEOUT_MSEC} will be used as the timeout.
1812
+ */
1813
+ timeout?: number;
1814
+ /**
1815
+ * If `true`, receiving a progress notification will reset the request timeout.
1816
+ * This is useful for long-running operations that send periodic progress updates.
1817
+ * Default: `false`
1818
+ */
1819
+ resetTimeoutOnProgress?: boolean;
1820
+ /**
1821
+ * Maximum total time (in milliseconds) to wait for a response.
1822
+ * If exceeded, an {@linkcode SdkError} with code {@linkcode SdkErrorCode.RequestTimeout} will be raised, regardless of progress notifications.
1823
+ * If not specified, there is no maximum total timeout.
1824
+ *
1825
+ * For multi-round-trip requests fulfilled by the auto-fulfilment driver
1826
+ * (protocol revision 2026-07-28), the budget bounds the WHOLE flow: every
1827
+ * retry leg is given only the time remaining.
1828
+ */
1829
+ maxTotalTimeout?: number;
1830
+ /**
1831
+ * Manual multi-round-trip mode for this call (protocol revision
1832
+ * 2026-07-28): when the response is an `input_required` result, hand it
1833
+ * back to the caller instead of auto-fulfilling it (or raising a typed
1834
+ * error). The resolved value is the neutral input-required shape
1835
+ * (`resultType: 'input_required'`, `inputRequests?`, `requestState?`);
1836
+ * wrap the result schema with `withInputRequired()` on the explicit
1837
+ * schema path to type both outcomes. The caller is then responsible for
1838
+ * gathering the requested input and retrying the original request with
1839
+ * `inputResponses` / `requestState` params and a fresh request.
1840
+ *
1841
+ * Default: `false`.
1842
+ */
1843
+ allowInputRequired?: boolean;
1844
+ } & TransportSendOptions;
1845
+ /**
1846
+ * Flow context handed to {@linkcode Protocol._resolveNonCompleteResult}: the
1847
+ * originating request, its options, the wire codec that decoded the response,
1848
+ * the timestamp the originating leg was issued at (for whole-flow timeout
1849
+ * accounting), and a `retry` closure that re-enters the request funnel with
1850
+ * fresh params on a fresh request id.
1851
+ */
1852
+ interface NonCompleteResultFlow<T$1 extends StandardSchemaV1 = StandardSchemaV1> {
1853
+ codec: WireCodec;
1854
+ request: Request;
1855
+ resultSchema: T$1;
1856
+ options: RequestOptions | undefined;
1857
+ flowStartedAt: number;
1858
+ /** Re-issue the originating request with the given params and per-leg options. */
1859
+ retry(params: Record<string, unknown> | undefined, legOptions: RequestOptions): Promise<unknown>;
1860
+ }
1861
+ /**
1862
+ * Options that can be given per notification.
1863
+ */
1864
+ type NotificationOptions = {
1865
+ /**
1866
+ * May be used to indicate to the transport which incoming request to associate this outgoing notification with.
1867
+ */
1868
+ relatedRequestId?: RequestId;
1869
+ };
1870
+ /**
1871
+ * The type of `ctx.mcpReq.requestState`. The type parameter is
1872
+ * caller-asserted (no validation, like the two-argument `acceptedContent<T>`)
1873
+ * — pair with `createRequestStateCodec<T>` so the claim is backed by the
1874
+ * codec's verification.
1875
+ */
1876
+ type RequestStateAccessor = <T$1 = unknown>() => T$1 | undefined;
1877
+ /**
1878
+ * Base context provided to all request handlers.
1879
+ */
1880
+ type BaseContext = {
1881
+ /**
1882
+ * The session ID from the transport, if available.
1883
+ */
1884
+ sessionId?: string;
1885
+ /**
1886
+ * Information about the MCP request being handled.
1887
+ */
1888
+ mcpReq: {
1889
+ /**
1890
+ * The JSON-RPC ID of the request being handled.
1891
+ */
1892
+ id: RequestId;
1893
+ /**
1894
+ * The method name of the request (e.g., 'tools/call', 'ping').
1895
+ */
1896
+ method: string;
1897
+ /**
1898
+ * Metadata from the original request, with the reserved
1899
+ * `io.modelcontextprotocol/*` envelope keys already lifted out
1900
+ * (readable via `ctx.mcpReq.envelope`).
1901
+ */
1902
+ _meta?: RequestMeta;
1903
+ /**
1904
+ * The per-request `_meta` envelope (protocol revision 2026-07-28):
1905
+ * the reserved `io.modelcontextprotocol/*` keys carried by the
1906
+ * request, lifted out of the `_meta` the handler sees. Surfaced as
1907
+ * received — `Partial` because only the keys the request actually
1908
+ * carried are present (envelope requiredness is enforced per request
1909
+ * at dispatch time, not by the lift); only present at all when the
1910
+ * request carried envelope keys.
1911
+ */
1912
+ envelope?: Partial<RequestMetaEnvelope>;
1913
+ /**
1914
+ * Multi-round-trip input responses carried by a retried request
1915
+ * (protocol revision 2026-07-28), lifted out of the params the
1916
+ * handler sees. Entries are the BARE response objects keyed by the
1917
+ * identifiers the server assigned in `inputRequests`; entries that do
1918
+ * not look like bare responses (e.g. a `{method, result}` wrapper)
1919
+ * are dropped and their keys recorded in `droppedInputResponseKeys`.
1920
+ *
1921
+ * The values arrive from the client and are NOT validated by the SDK
1922
+ * — treat them as untrusted input.
1923
+ */
1924
+ inputResponses?: Record<string, unknown>;
1925
+ /**
1926
+ * Keys of `inputResponses` entries the SDK dropped because they were
1927
+ * not bare response objects (for example the wrapped `{method,
1928
+ * result}` shape some peers emit). Surfaced so a handler can re-issue
1929
+ * the corresponding input request rather than hard-fail.
1930
+ */
1931
+ droppedInputResponseKeys?: string[];
1932
+ /**
1933
+ * Reads the multi-round-trip request state for the current round:
1934
+ * the value the configured `ServerOptions.requestState.verify` hook
1935
+ * resolved with (e.g. `createRequestStateCodec.verify`'s decoded
1936
+ * payload — `mint<T>`/`requestState<T>()` are the typed pair), the
1937
+ * raw wire string when no hook is configured, or `undefined` when
1938
+ * the round carried no state. The type parameter is a compile-time
1939
+ * cast only.
1940
+ *
1941
+ * SECURITY: `requestState` round-trips through the client and MUST
1942
+ * be treated as attacker-controlled input. The SDK applies no
1943
+ * integrity protection by default — servers whose state influences
1944
+ * authorization or business logic MUST integrity-protect it and
1945
+ * verify via the `requestState.verify` hook (spec:
1946
+ * basic/patterns/mrtr, server requirements 4–5).
1947
+ */
1948
+ requestState: RequestStateAccessor;
1949
+ /**
1950
+ * An abort signal used to communicate if the request was cancelled from the sender's side.
1951
+ */
1952
+ signal: AbortSignal;
1953
+ /**
1954
+ * Sends a request that relates to the current request being handled.
1955
+ *
1956
+ * This is used by certain transports to correctly associate related messages.
1957
+ *
1958
+ * For spec methods the result type is inferred from the method name.
1959
+ * For custom (non-spec) methods, pass a result schema as the second argument.
1960
+ */
1961
+ send: {
1962
+ <M$1 extends RequestMethod>(request: {
1963
+ method: M$1;
1964
+ params?: Record<string, unknown>;
1965
+ }, options?: RequestOptions): Promise<ResultTypeMap[M$1]>;
1966
+ <T$1 extends StandardSchemaV1>(request: Request, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
1967
+ };
1968
+ /**
1969
+ * Sends a notification that relates to the current request being handled.
1970
+ *
1971
+ * This is used by certain transports to correctly associate related messages.
1972
+ */
1973
+ notify: (notification: Notification) => Promise<void>;
1974
+ };
1975
+ /**
1976
+ * HTTP transport information, only available when using an HTTP-based transport.
1977
+ */
1978
+ http?: {
1979
+ /**
1980
+ * Information about a validated access token, provided to request handlers.
1981
+ */
1982
+ authInfo?: AuthInfo;
1983
+ };
1984
+ };
1985
+ /**
1986
+ * Context provided to server-side request handlers, extending {@linkcode BaseContext} with server-specific fields.
1987
+ */
1988
+ type ServerContext = BaseContext & {
1989
+ mcpReq: {
1990
+ /**
1991
+ * Send a log message notification to the client.
1992
+ * Respects the client's log level filter set via logging/setLevel.
1993
+ *
1994
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
1995
+ * Remains functional during the deprecation window (at least twelve months).
1996
+ * Migrate to stderr logging (STDIO servers) or OpenTelemetry.
1997
+ */
1998
+ log: (level: LoggingLevel, data: unknown, logger?: string) => Promise<void>;
1999
+ /**
2000
+ * Send an elicitation request to the client, requesting user input.
2001
+ *
2002
+ * @deprecated Throws on a 2026-07-28-era request — return `inputRequired(...)`
2003
+ * (multi-round-trip) from the handler instead. The 2025 push-style server-to-client request model is
2004
+ * replaced by input_required results in the 2026-07-28 protocol. If your factory serves
2005
+ * both eras, this only works on the legacy path.
2006
+ */
2007
+ elicitInput: (params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions) => Promise<ElicitResult>;
2008
+ /**
2009
+ * Request LLM sampling from the client.
2010
+ *
2011
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
2012
+ * Throws on a 2026-07-28-era request — return `inputRequired(...)` (multi-round-trip)
2013
+ * from the handler instead, or migrate to calling LLM provider APIs directly. The 2025 push-style
2014
+ * server-to-client request model is replaced by input_required results in the 2026-07-28
2015
+ * protocol. If your factory serves both eras, this only works on the legacy path.
2016
+ */
2017
+ requestSampling: (params: CreateMessageRequest['params'], options?: RequestOptions) => Promise<CreateMessageResult | CreateMessageResultWithTools>;
2018
+ };
2019
+ http?: {
2020
+ /**
2021
+ * The original HTTP request.
2022
+ */
2023
+ req?: globalThis.Request;
2024
+ /**
2025
+ * Closes the SSE stream for this request, triggering client reconnection.
2026
+ * Only available when using a StreamableHTTPServerTransport with eventStore configured.
2027
+ */
2028
+ closeSSE?: () => void;
2029
+ /**
2030
+ * Closes the standalone GET SSE stream, triggering client reconnection.
2031
+ * Only available when using a StreamableHTTPServerTransport with eventStore configured.
2032
+ */
2033
+ closeStandaloneSSE?: () => void;
2034
+ };
2035
+ };
2036
+ /**
2037
+ * Context provided to client-side request handlers.
2038
+ */
2039
+ type ClientContext = BaseContext;
2040
+ /**
2041
+ * Implements MCP protocol framing on top of a pluggable transport, including
2042
+ * features like request/response linking, notifications, and progress.
2043
+ *
2044
+ * `Protocol` is abstract; `Client` and `Server` are the concrete role-specific
2045
+ * implementations most code should use.
2046
+ */
2047
+ declare abstract class Protocol<ContextT extends BaseContext> {
2048
+ private _options?;
2049
+ private _transport?;
2050
+ private _requestMessageId;
2051
+ private _requestHandlers;
2052
+ private _requestHandlerAbortControllers;
2053
+ private _notificationHandlers;
2054
+ private _responseHandlers;
2055
+ private _progressHandlers;
2056
+ private _timeoutInfo;
2057
+ private _pendingDebouncedNotifications;
2058
+ /**
2059
+ * The protocol version negotiated for the current connection (`undefined`
2060
+ * before negotiation completes), which determines the wire era this
2061
+ * instance speaks. Set by the SDK's negotiation and initialize paths
2062
+ * (`Client.connect`, `Server._oninitialize`).
2063
+ */
2064
+ protected _negotiatedProtocolVersion?: string;
2065
+ protected _supportedProtocolVersions: string[];
2066
+ /**
2067
+ * Callback for when the connection is closed for any reason.
2068
+ *
2069
+ * This is invoked when {@linkcode Protocol.close | close()} is called as well.
2070
+ */
2071
+ onclose?: () => void;
2072
+ /**
2073
+ * Callback for when an error occurs.
2074
+ *
2075
+ * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
2076
+ */
2077
+ onerror?: (error: Error) => void;
2078
+ /**
2079
+ * A handler to invoke for any request types that do not have their own handler installed.
2080
+ */
2081
+ fallbackRequestHandler?: (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>;
2082
+ /**
2083
+ * A handler to invoke for any notification types that do not have their own handler installed.
2084
+ */
2085
+ fallbackNotificationHandler?: (notification: Notification) => Promise<void>;
2086
+ constructor(_options?: ProtocolOptions | undefined);
2087
+ /**
2088
+ * Builds the context object for request handlers. Subclasses must override
2089
+ * to return the appropriate context type (e.g., ServerContext adds HTTP request info).
2090
+ */
2091
+ protected abstract buildContext(ctx: BaseContext, transportInfo?: MessageExtraInfo): ContextT;
2092
+ /**
2093
+ * Drop consult for inbound messages whose transport did not classify them
2094
+ * at the edge — long-lived channels such as stdio, where a role class may
2095
+ * need to decline traffic the negotiated era has no answer for (the
2096
+ * client-side inbound-request drop on modern-era connections: the
2097
+ * 2026-07-28 era has no server→client request channel, and on stdio the
2098
+ * client must never write JSON-RPC responses).
2099
+ *
2100
+ * Consulted ONLY when the transport supplied no
2101
+ * {@linkcode MessageExtraInfo.classification}: edge-classified traffic
2102
+ * never reaches the hook. Returning `'drop'` discards the message without
2103
+ * writing any response (requests are surfaced via `onerror`). The base
2104
+ * implementation returns `undefined`: unclassified traffic keeps today's
2105
+ * dispatch path unchanged. Era selection never happens here — era is
2106
+ * instance state, owned by the serving entry that constructed and
2107
+ * connected the instance.
2108
+ */
2109
+ protected _shouldDropInbound(_message: JSONRPCRequest | JSONRPCNotification): 'drop' | undefined;
2110
+ /**
2111
+ * The per-request `_meta` envelope this instance attaches to every outgoing
2112
+ * request and notification, when one applies. The base implementation
2113
+ * returns `undefined` (no envelope — the 2025-era posture, so legacy-era
2114
+ * outbound traffic is byte-identical to a build without this seam).
2115
+ * `Client` overrides it on a connection that negotiated a modern (2026-07-28+)
2116
+ * era to return the reserved protocol-version / client-info /
2117
+ * client-capabilities keys. User-supplied `_meta` keys take precedence over
2118
+ * the auto-attached ones.
2119
+ */
2120
+ protected _outboundMetaEnvelope(): Readonly<Record<string, unknown>> | undefined;
2121
+ /**
2122
+ * Attach this instance's outbound `_meta` envelope (when one is configured)
2123
+ * to a request or notification. A no-op when the seam returns `undefined`
2124
+ * — the message returns by reference, so the legacy-era wire stays
2125
+ * byte-identical. User-supplied `_meta` keys are spread last so they win
2126
+ * over the auto-attached envelope keys.
2127
+ */
2128
+ private _envelopeOutbound;
2129
+ /**
2130
+ * Extension point for non-`complete` decoded results in the response
2131
+ * funnel: a result the wire codec discriminated into a kind other than
2132
+ * `'complete'` or `'invalid'` is handed here for the role class to
2133
+ * resolve. The base default surfaces it as a typed
2134
+ * {@linkcode SdkErrorCode.UnsupportedResultType} error (no retry).
2135
+ *
2136
+ * Intended consumers (named so the seam stays accountable):
2137
+ * - the `Client`'s multi-round-trip auto-fulfilment engine, which fulfils
2138
+ * `'input_required'` results through the registered
2139
+ * elicitation/sampling/roots handlers and retries via `flow.retry`;
2140
+ * - a future client-side terminal-result handler for
2141
+ * `subscriptions/listen`, when the spec defines one.
2142
+ *
2143
+ * `Server` instances never receive `input_required` responses on their
2144
+ * outbound legs and leave the base behavior in place.
2145
+ */
2146
+ protected _resolveNonCompleteResult<T$1 extends StandardSchemaV1>(decoded: ReturnType<WireCodec['decodeResult']> & {
2147
+ kind: 'input_required';
2148
+ }, flow: NonCompleteResultFlow<T$1>): Promise<unknown>;
2149
+ /**
2150
+ * Protected accessor for a registered request handler. Used by role
2151
+ * classes that dispatch synthesized requests through the same stored
2152
+ * handler chain (e.g. the `Client` fulfilling an embedded multi-round-trip
2153
+ * input request).
2154
+ */
2155
+ protected _getRequestHandler(method: string): ((request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>) | undefined;
2156
+ private _oncancel;
2157
+ private _setupTimeout;
2158
+ private _resetTimeout;
2159
+ private _cleanupTimeout;
2160
+ /**
2161
+ * Attaches to the given transport, starts it, and starts listening for messages.
2162
+ *
2163
+ * 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.
2164
+ */
2165
+ connect(transport: Transport): Promise<void>;
2166
+ /**
2167
+ * Transport-close hook. Subclass overrides MUST call `super._onclose()`
2168
+ * after their own cleanup — base teardown (response-handler settlement,
2169
+ * timeout clearing, in-flight request abort) does not run otherwise.
2170
+ */
2171
+ protected _onclose(): void;
2172
+ private _onerror;
2173
+ /**
2174
+ * Inbound-notification dispatch. Subclass overrides MUST delegate
2175
+ * unmatched traffic to `super._onnotification(rawNotification, extra)` —
2176
+ * an override that consumes only what it owns and falls through to base
2177
+ * dispatch for everything else.
2178
+ */
2179
+ protected _onnotification(rawNotification: JSONRPCNotification, extra?: MessageExtraInfo): void;
2180
+ private _onrequest;
2181
+ private _onprogress;
2182
+ /**
2183
+ * Inbound-response dispatch. Subclass overrides MUST delegate unmatched
2184
+ * traffic to `super._onresponse(response)` — an override that consumes
2185
+ * only what it owns and falls through to base dispatch for everything
2186
+ * else.
2187
+ */
2188
+ protected _onresponse(response: JSONRPCResponse | JSONRPCErrorResponse): void;
2189
+ get transport(): Transport | undefined;
2190
+ /**
2191
+ * Closes the connection.
2192
+ */
2193
+ close(): Promise<void>;
2194
+ /**
2195
+ * A method to check if a capability is supported by the remote side, for the given method to be called.
2196
+ *
2197
+ * This should be implemented by subclasses.
2198
+ */
2199
+ protected abstract assertCapabilityForMethod(method: RequestMethod | string): void;
2200
+ /**
2201
+ * A method to check if a notification is supported by the local side, for the given method to be sent.
2202
+ *
2203
+ * This should be implemented by subclasses.
2204
+ */
2205
+ protected abstract assertNotificationCapability(method: NotificationMethod | string): void;
2206
+ /**
2207
+ * A method to check if a request handler is supported by the local side, for the given method to be handled.
2208
+ *
2209
+ * This should be implemented by subclasses.
2210
+ */
2211
+ protected abstract assertRequestHandlerCapability(method: string): void;
2212
+ /**
2213
+ * Sends a request and waits for a response.
2214
+ *
2215
+ * For spec methods the result schema is resolved automatically from the method name
2216
+ * and the return type is method-keyed. For custom (non-spec) methods, pass a
2217
+ * `resultSchema` as the second argument; the response is validated against it and
2218
+ * the return type is inferred from the schema.
2219
+ *
2220
+ * Do not use this method to emit notifications! Use {@linkcode Protocol.notification | notification()} instead.
2221
+ */
2222
+ request<M$1 extends RequestMethod>(request: {
2223
+ method: M$1;
2224
+ params?: Record<string, unknown>;
2225
+ }, options?: RequestOptions): Promise<ResultTypeMap[M$1]>;
2226
+ request<T$1 extends StandardSchemaV1>(request: Request, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
2227
+ /**
2228
+ * The wire codec for this instance's negotiated era — the phase-2 truth:
2229
+ * everything an established connection sends and receives resolves
2230
+ * through it. Legacy until a version has been negotiated.
2231
+ */
2232
+ private _negotiatedWireCodec;
2233
+ /**
2234
+ * Protected accessor for the instance's negotiated wire codec, for role
2235
+ * classes (Client/Server/McpServer) routing era-dependent behavior
2236
+ * through the codec's function-only surface — `samplingResultVariant`,
2237
+ * `outboundEnvelope`, `projectCallToolResult` — instead of branching on
2238
+ * the protocol version themselves.
2239
+ */
2240
+ protected _wireCodec(): WireCodec;
2241
+ /**
2242
+ * Outbound codec resolution: while the negotiated version is still unset
2243
+ * (the negotiation window), lifecycle messages are bootstrap-pinned BY
2244
+ * METHOD — they self-identify their era (`initialize` IS the legacy
2245
+ * handshake, `server/discover` IS the modern probe). Once a version has
2246
+ * been negotiated, the instance era is authoritative for everything — a
2247
+ * negotiated session never re-routes a method onto the other era.
2248
+ */
2249
+ private _resolveOutboundCodec;
2250
+ /**
2251
+ * Era gate for outbound requests — deletions are physical in BOTH
2252
+ * directions: sending a spec method that the resolved era does not define
2253
+ * dies locally with a typed error before anything reaches the transport.
2254
+ * Methods outside the spec universe are consumer-owned extension methods
2255
+ * and stay era-blind.
2256
+ */
2257
+ private _assertOutboundRequestInEra;
2258
+ /**
2259
+ * Sends a request and waits for a response, using the provided schema for
2260
+ * validation instead of the era registry's method-keyed entry.
2261
+ *
2262
+ * This is the internal implementation used by SDK methods whose result
2263
+ * schema cannot be expressed as a method-keyed registry entry — the one
2264
+ * surviving case is `server.createMessage`, whose result schema depends
2265
+ * on the REQUEST params (tools vs no tools) — and by callers passing
2266
+ * explicit compatibility schemas. Spec methods are still era-gated here:
2267
+ * an explicit schema never smuggles a deleted method onto the wire.
2268
+ */
2269
+ protected _requestWithSchema<T$1 extends StandardSchemaV1>(request: Request, resultSchema: T$1, options?: RequestOptions): Promise<StandardSchemaV1.InferOutput<T$1>>;
2270
+ /**
2271
+ * The request funnel proper, keyed by the resolved era codec: the codec
2272
+ * owns result decoding (raw-first `resultType` discrimination — V-1 —
2273
+ * and the era's lift posture) before the schema validation step.
2274
+ */
2275
+ private _requestWithSchemaViaCodec;
2276
+ /**
2277
+ * Emits a notification, which is a one-way message that does not expect a response.
2278
+ */
2279
+ notification(notification: Notification, options?: NotificationOptions): Promise<void>;
2280
+ /**
2281
+ * The notification funnel proper, keyed by the resolved era codec —
2282
+ * direct sends and related notifications (`ctx.mcpReq.notify`) alike
2283
+ * resolve through the instance's negotiated era at send time.
2284
+ */
2285
+ private _notificationViaCodec;
2286
+ /**
2287
+ * Registers a handler to invoke when this protocol object receives a request with the given method.
2288
+ *
2289
+ * Note that this will replace any previous request handler for the same method.
2290
+ *
2291
+ * For spec methods, pass `(method, handler)`; the request is parsed with the spec
2292
+ * schema and the handler receives the typed `Request`. For custom (non-spec)
2293
+ * methods, pass `(method, schemas, handler)`; `params` are validated against
2294
+ * `schemas.params` and the handler receives the parsed params object directly.
2295
+ * Supplying `schemas.result` types the handler's return value.
2296
+ *
2297
+ * @example Custom request method
2298
+ * ```ts source="./protocol.examples.ts#Protocol_setRequestHandler_customMethod"
2299
+ * const SearchParams = z.object({ query: z.string(), limit: z.number().optional() });
2300
+ * const SearchResult = z.object({ hits: z.array(z.string()) });
2301
+ *
2302
+ * protocol.setRequestHandler('acme/search', { params: SearchParams, result: SearchResult }, async (params, _ctx) => {
2303
+ * return { hits: [`result for ${params.query}`] };
2304
+ * });
2305
+ * ```
2306
+ */
2307
+ setRequestHandler<M$1 extends RequestMethod>(method: M$1, handler: (request: RequestTypeMap[M$1], ctx: ContextT) => HandlerResultTypeMap[M$1] | Promise<HandlerResultTypeMap[M$1]>): void;
2308
+ setRequestHandler<P extends StandardSchemaV1, R extends StandardSchemaV1 | undefined = undefined>(method: string, schemas: {
2309
+ params: P;
2310
+ result?: R;
2311
+ }, handler: (params: StandardSchemaV1.InferOutput<P>, ctx: ContextT) => InferHandlerResult<R> | Promise<InferHandlerResult<R>>): void;
2312
+ /**
2313
+ * Hook for subclasses to wrap a registered request handler with role-specific
2314
+ * validation or behavior (e.g. `Server` validates `tools/call` results, `Client`
2315
+ * validates `elicitation/create` mode and result). Runs for both the 2-arg and
2316
+ * 3-arg registration paths. The default implementation is identity.
2317
+ *
2318
+ * Subclasses overriding this hook avoid redeclaring `setRequestHandler`'s overload set.
2319
+ */
2320
+ protected _wrapHandler(_method: string, handler: (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>): (request: JSONRPCRequest, ctx: ContextT) => Promise<Result$1>;
2321
+ /**
2322
+ * Hook for subclasses to supply the implementation identity the 2026-era
2323
+ * encode seam stamps into outbound result `_meta` under
2324
+ * `io.modelcontextprotocol/serverInfo` (spec PR #3002: servers SHOULD
2325
+ * identify themselves on every response). The default is `undefined` — no
2326
+ * stamp. Only `Server` overrides this: the key identifies the software
2327
+ * producing a response, and the 2025-era codec never stamps anything
2328
+ * regardless (the never-stamp guarantee).
2329
+ */
2330
+ protected _outboundServerInfo(): Implementation | undefined;
2331
+ /**
2332
+ * Removes the request handler for the given method.
2333
+ */
2334
+ removeRequestHandler(method: RequestMethod | string): void;
2335
+ /**
2336
+ * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
2337
+ */
2338
+ assertCanSetRequestHandler(method: RequestMethod | string): void;
2339
+ /**
2340
+ * Registers a handler to invoke when this protocol object receives a notification with the given method.
2341
+ *
2342
+ * Note that this will replace any previous notification handler for the same method.
2343
+ *
2344
+ * For spec methods, pass `(method, handler)`; the notification is parsed with the
2345
+ * spec schema. For custom (non-spec) methods, pass `(method, schemas, handler)`;
2346
+ * `params` are validated against `schemas.params` and the handler receives the
2347
+ * parsed params object directly. The raw notification is passed as the second
2348
+ * argument; `_meta` is recoverable via `notification.params?._meta` (minus the
2349
+ * reserved `io.modelcontextprotocol/*` envelope keys, which the protocol layer
2350
+ * lifts out before dispatch).
2351
+ */
2352
+ setNotificationHandler<M$1 extends NotificationMethod>(method: M$1, handler: (notification: NotificationTypeMap[M$1]) => void | Promise<void>): void;
2353
+ setNotificationHandler<P extends StandardSchemaV1>(method: string, schemas: {
2354
+ params: P;
2355
+ }, handler: (params: StandardSchemaV1.InferOutput<P>, notification: Notification) => void | Promise<void>): void;
2356
+ /**
2357
+ * Removes the notification handler for the given method.
2358
+ */
2359
+ removeNotificationHandler(method: NotificationMethod | string): void;
2360
+ }
2361
+ /**
2362
+ * Schema bundle accepted by {@linkcode Protocol.setRequestHandler | setRequestHandler}'s 3-arg form.
2363
+ *
2364
+ * `params` is required and validates the inbound `request.params`. `result` is optional;
2365
+ * when supplied it types the handler's return value (no runtime validation is performed
2366
+ * on the result).
2367
+ */
2368
+ interface RequestHandlerSchemas<P extends StandardSchemaV1 = StandardSchemaV1, R extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> {
2369
+ params: P;
2370
+ result?: R;
2371
+ }
2372
+ type InferHandlerResult<R extends StandardSchemaV1 | undefined> = R extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<R> : Result$1;
2373
+ declare function mergeCapabilities(base: ServerCapabilities, additional: Partial<ServerCapabilities>): ServerCapabilities;
2374
+ declare function mergeCapabilities(base: ClientCapabilities, additional: Partial<ClientCapabilities>): ClientCapabilities;
2375
+ //#endregion
2376
+ //#region ../core-internal/src/shared/mediaType.d.ts
2377
+ /**
2378
+ * Whether a raw `Content-Type` header value denotes `application/json`.
2379
+ * Parameters (for example `charset=utf-8`) are allowed and ignored; malformed
2380
+ * parameter sections do not reject a header whose media type is unambiguously
2381
+ * `application/json` (see `mediaTypeEssence` for the exact grammar).
2382
+ */
2383
+ declare function isJsonContentType(header: string | null | undefined): boolean;
2384
+ //#endregion
2385
+ //#region ../core-internal/src/shared/metadataUtils.d.ts
2386
+ /**
2387
+ * Utilities for working with {@linkcode BaseMetadata} objects.
2388
+ */
2389
+ /**
2390
+ * Gets the display name for an object with {@linkcode BaseMetadata}.
2391
+ * For tools, the precedence is: `title` → {@linkcode index.ToolAnnotations | annotations}.`title` → `name`
2392
+ * For other objects: `title` → `name`
2393
+ * This implements the spec requirement: "if no title is provided, name should be used for display purposes"
2394
+ */
2395
+ declare function getDisplayName(metadata: BaseMetadata | (BaseMetadata & {
2396
+ annotations?: {
2397
+ title?: string;
2398
+ };
2399
+ })): string;
2400
+ //#endregion
2401
+ //#region ../core-internal/src/shared/protocolEras.d.ts
2402
+ /**
2403
+ * Protocol-era helpers (pure module). The MCP wire protocol splits into two eras:
2404
+ * legacy (the 2025-11-25 family and earlier; the version is negotiated via the
2405
+ * `initialize` handshake) and modern (2026-07-28 and later; no `initialize` —
2406
+ * servers advertise versions via `server/discover` and every request carries a
2407
+ * `_meta` envelope).
2408
+ *
2409
+ * An operation that belongs to one era must only ever consult that era's subset
2410
+ * of a supported-versions list: `initialize` never accepts or counter-offers a
2411
+ * modern revision, and the `server/discover` advertisement only ever contains
2412
+ * modern revisions.
2413
+ */
2414
+ /**
2415
+ * The protocol era of a connection: `'legacy'` for the 2025-11-25 family and
2416
+ * earlier (negotiated via `initialize`), `'modern'` for 2026-07-28 and later
2417
+ * (negotiated via `server/discover`; every request carries a `_meta` envelope).
2418
+ */
2419
+ type ProtocolEra = 'legacy' | 'modern';
2420
+ //#endregion
2421
+ //#region ../core-internal/src/shared/stdio.d.ts
2422
+ declare const STDIO_DEFAULT_MAX_BUFFER_SIZE: number;
2423
+ /**
2424
+ * Buffers a continuous stdio stream into discrete JSON-RPC messages.
2425
+ */
2426
+ declare class ReadBuffer {
2427
+ private _buffer?;
2428
+ private _maxBufferSize;
2429
+ constructor(options?: {
2430
+ maxBufferSize?: number;
2431
+ });
2432
+ append(chunk: Buffer): void;
2433
+ readMessage(): JSONRPCMessage | null;
2434
+ clear(): void;
2435
+ }
2436
+ declare function deserializeMessage(line: string): JSONRPCMessage;
2437
+ declare function serializeMessage(message: JSONRPCMessage): string;
2438
+ //#endregion
2439
+ //#region ../core-internal/src/shared/uriTemplate.d.ts
2440
+ type Variables = Record<string, string | string[]>;
2441
+ declare class UriTemplate {
2442
+ /**
2443
+ * Returns true if the given string contains any URI template expressions.
2444
+ * A template expression is a sequence of characters enclosed in curly braces,
2445
+ * like `{foo}` or `{?bar}`.
2446
+ */
2447
+ static isTemplate(str: string): boolean;
2448
+ private static validateLength;
2449
+ private readonly template;
2450
+ private readonly parts;
2451
+ get variableNames(): string[];
2452
+ constructor(template: string);
2453
+ toString(): string;
2454
+ private parse;
2455
+ private getOperator;
2456
+ private getNames;
2457
+ private encodeValue;
2458
+ private expandPart;
2459
+ expand(variables: Variables): string;
2460
+ private escapeRegExp;
2461
+ private partToRegExp;
2462
+ match(uri: string): Variables | null;
2463
+ }
2464
+ //#endregion
2465
+ //#region ../core-internal/src/util/inMemory.d.ts
2466
+ /**
2467
+ * In-memory transport for creating clients and servers that talk to each other within the same process.
2468
+ *
2469
+ * Intended for testing and development. For production in-process connections, use
2470
+ * `StreamableHTTPClientTransport` against a local server URL.
2471
+ */
2472
+ declare class InMemoryTransport implements Transport {
2473
+ private _otherTransport?;
2474
+ private _messageQueue;
2475
+ private _closed;
2476
+ onclose?: () => void;
2477
+ onerror?: (error: Error) => void;
2478
+ onmessage?: (message: JSONRPCMessage, extra?: {
2479
+ authInfo?: AuthInfo;
2480
+ }) => void;
2481
+ sessionId?: string;
2482
+ /**
2483
+ * 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}.
2484
+ */
2485
+ static createLinkedPair(): [InMemoryTransport, InMemoryTransport];
2486
+ start(): Promise<void>;
2487
+ close(): Promise<void>;
2488
+ /**
2489
+ * Sends a message with optional auth info.
2490
+ * This is useful for testing authentication scenarios.
2491
+ */
2492
+ send(message: JSONRPCMessage, options?: {
2493
+ relatedRequestId?: RequestId;
2494
+ authInfo?: AuthInfo;
2495
+ }): Promise<void>;
2496
+ }
2497
+ //#endregion
2498
+ //#region ../core-internal/src/wire/preload.d.ts
2499
+ /**
2500
+ * Eagerly builds every lazily-constructed wire-schema layer, so that no later
2501
+ * validation pays schema-construction cost.
2502
+ *
2503
+ * Synchronous and idempotent: every layer is a memo, so the first call does
2504
+ * all the work and subsequent calls return immediately. Reference identity is
2505
+ * unaffected — this forces the same memos every lazy consumer pulls through.
2506
+ *
2507
+ * Call it at module scope on platforms that bill per-request CPU but not
2508
+ * module evaluation (isolate-based edge/serverless runtimes), where deferring
2509
+ * construction would move it into the first request of every fresh isolate:
2510
+ *
2511
+ * ```ts
2512
+ * // from '@modelcontextprotocol/server' or '@modelcontextprotocol/client' —
2513
+ * // each package bundles its own schema copy, so warm the one(s) you import.
2514
+ * preloadSchemas(); // module scope — runs during isolate warm-up
2515
+ * ```
2516
+ *
2517
+ * On Node CLIs and other process-per-invocation runtimes, prefer the lazy
2518
+ * default — there, module-scope construction is pure added boot latency.
2519
+ */
2520
+ declare function preloadSchemas(): void;
2521
+ //#endregion
2522
+ export { withInputRequired as $, TRACESTATE_META_KEY as $i, Notification as $n, SetLevelRequest as $r, GetTaskResult as $t, SpecTypes as A, UnsubscribeRequest as Ai, ListPromptsRequest as An, RequestTypeMap as Ar, CreateMessageRequestParamsWithTools as At, isJSONRPCNotification as B, INVALID_PARAMS as Bi, ListToolsRequest as Bn, Result$1 as Br, ElicitRequestURLParams as Bt, ServerContext as C, StoredOAuthTokens as Ca, Tool as Ci, JSONRPCResponse as Cn, Request as Cr, CompleteRequestPrompt as Ct, TransportSendOptions as D, ToolListChangedNotification as Di, ListChangedCallback as Dn, RequestMetaObject as Dr, CreateMessageRequest as Dt, Transport as E, ToolExecution as Ei, LegacyTitledEnumSchema as En, RequestMetaEnvelope as Er, ContentBlock as Et, isCallToolResult as F, BAGGAGE_META_KEY as Fi, ListResourcesResult as Fn, ResourceRequestParams as Fr, DiscoverRequest as Ft, parseJSONRPCMessage as G, METHOD_NOT_FOUND as Gi, MessageClassification as Gn, RootsListChangedNotification as Gr, EmptyResult as Gt, isJSONRPCResponse as H, JSONRPC_VERSION as Hi, LoggingLevel as Hn, ResultTypeMap as Hr, ElicitationCompleteNotification as Ht, isInitializeRequest as I, CLIENT_CAPABILITIES_META_KEY as Ii, ListRootsRequest as In, ResourceTemplateReference as Ir, DiscoverResult as It, ResourceNotFoundError as J, RELATED_TASK_META_KEY as Ji, MethodNotFoundError as Jn, SamplingMessageContentBlock as Jr, GetPromptRequestParams as Jt, MissingRequiredClientCapabilityError as K, PARSE_ERROR as Ki, MessageExtraInfo as Kn, SamplingContent as Kr, EnumSchema as Kt, isInitializedNotification as L, CLIENT_INFO_META_KEY as Li, ListRootsResult as Ln, ResourceTemplateType as Lr, ElicitRequest as Lt, specTypeSchemas as M, UnsupportedProtocolVersionErrorData as Mi, ListResourceTemplatesRequest as Mn, ResourceContents as Mr, CreateMessageResultWithTools as Mt, assertCompleteRequestPrompt as N, UntitledMultiSelectEnumSchema as Ni, ListResourceTemplatesResult as Nn, ResourceLink as Nr, CreateTaskResult as Nt, createFetchWithInit as O, ToolResultContent as Oi, ListChangedHandlers as On, RequestMethod as Or, CreateMessageRequestParams as Ot, assertCompleteRequestResourceTemplate as P, UntitledSingleSelectEnumSchema as Pi, ListResourcesRequest as Pn, ResourceListChangedNotification as Pr, Cursor as Pt, InputRequiredOptions as Q, TRACEPARENT_META_KEY as Qi, MultiSelectEnumSchema as Qn, ServerResult as Qr, GetTaskRequest as Qt, isInputRequiredResult as R, DEFAULT_NEGOTIATED_PROTOCOL_VERSION as Ri, ListTasksRequest as Rn, ResourceUpdatedNotification as Rr, ElicitRequestFormParams as Rt, RequestStateAccessor as S, StoredOAuthClientInformation as Sa, TitledSingleSelectEnumSchema as Si, JSONRPCRequest as Sn, RelatedTaskMetadata as Sr, CompleteRequestParams as St, FetchLike as T, ToolChoice as Ti, JSONValue as Tn, RequestMeta as Tr, CompleteResult as Tt, isJSONRPCResultResponse as U, LATEST_PROTOCOL_VERSION as Ui, LoggingMessageNotification as Un, Role as Ur, ElicitationCompleteNotificationParams as Ut, isJSONRPCRequest as V, INVALID_REQUEST as Vi, ListToolsResult as Vn, ResultMetaObject as Vr, ElicitResult as Vt, isTaskAugmentedRequestParams as W, LOG_LEVEL_META_KEY as Wi, LoggingMessageNotificationParams as Wn, Root as Wr, EmbeddedResource as Wt, UrlElicitationRequiredError as X, SUBSCRIPTION_ID_META_KEY as Xi, ModelHint as Xn, ServerNotification as Xr, GetTaskPayloadRequest as Xt, UnsupportedProtocolVersionError as Y, SERVER_INFO_META_KEY as Yi, MissingRequiredClientCapabilityErrorData as Yn, ServerCapabilities as Yr, GetPromptResult as Yt, ProtocolErrorCode as Z, SUPPORTED_PROTOCOL_VERSIONS as Zi, ModelPreferences as Zn, ServerRequest as Zr, GetTaskPayloadResult as Zt, ProgressCallback as _, OAuthProtectedResourceMetadata as _a, TaskStatusNotification as _i, JSONArray as _n, PromptMessage as _r, ClientNotification as _t, ReadBuffer as a, SdkHttpErrorData as aa, SubscriptionFilter as ai, InitializeRequest as an, PaginatedRequestParams as ar, AuthInfo as at, RequestHandlerSchemas as b, OpenIdProviderDiscoveryMetadata as ba, TextResourceContents as bi, JSONRPCMessage as bn, ReadResourceRequestParams as br, CompatibilityCallToolResult as bt, serializeMessage as c, AuthorizationServerMetadata as ca, SubscriptionsListenRequest as ci, InitializedNotification as cn, PingRequest as cr, BooleanSchema as ct, isJsonContentType as d, OAuthClientInformationFull as da, SubscriptionsListenResultMeta as di, InputRequiredResult as dn, ProgressNotification as dr, CallToolResult as dt, checkResourceAllowed as ea, SetLevelRequestParams as ei, HandlerResultTypeMap as en, NotificationMethod as er, StandardSchemaV1 as et, BaseContext as f, OAuthClientInformationMixed as fa, Task as fi, InputResponse as fn, ProgressNotificationParams as fr, CancelTaskRequest as ft, NotificationOptions as g, OAuthMetadata as ga, TaskStatus as gi, InvalidRequestError as gn, PromptListChangedNotification as gr, ClientCapabilities as gt, NonCompleteResultFlow as h, OAuthErrorResponse as ha, TaskMetadata as hi, InvalidParamsError as hn, PromptArgument as hr, CancelledNotificationParams as ht, Variables as i, SdkHttpError as ia, SubscribeRequestParams as ii, Implementation as in, PaginatedRequest as ir, AudioContent as it, isSpecType as j, UnsubscribeRequestParams as ji, ListPromptsResult as jn, Resource as jr, CreateMessageResult as jt, SpecTypeName as k, ToolUseContent as ki, ListChangedOptions as kn, RequestParams as kr, CreateMessageRequestParamsBase as kt, ProtocolEra as l, IdJagTokenExchangeResponse as la, SubscriptionsListenRequestParams as li, InputRequest as ln, PrimitiveSchemaDefinition as lr, CallToolRequest as lt, DEFAULT_REQUEST_TIMEOUT_MSEC as m, OAuthClientRegistrationError as ma, TaskCreationParams as mi, InternalError as mn, Prompt as mr, CancelledNotification as mt, InMemoryTransport as n, SdkError as na, StringSchema as ni, Icons as nn, NotificationTypeMap as nr, StandardSchemaWithJSON as nt, STDIO_DEFAULT_MAX_BUFFER_SIZE as o, OAuthError as oa, SubscriptionsAcknowledgedNotification as oi, InitializeRequestParams as on, PaginatedResult as or, BaseMetadata as ot, ClientContext as p, OAuthClientMetadata as pa, TaskAugmentedRequestParams as pi, InputResponses as pn, ProgressToken as pr, CancelTaskResult as pt, ProtocolError as q, PROTOCOL_VERSION_META_KEY as qi, MetaObject as qn, SamplingMessage as qr, GetPromptRequest as qt, UriTemplate as r, SdkErrorCode as ra, SubscribeRequest as ri, ImageContent as rn, NumberSchema as rr, Annotations as rt, deserializeMessage as s, OAuthErrorCode as sa, SubscriptionsAcknowledgedNotificationParams as si, InitializeResult as sn, ParseError as sr, BlobResourceContents as st, preloadSchemas as t, resourceUrlFromServerUrl as ta, SingleSelectEnumSchema as ti, Icon as tn, NotificationParams as tr, StandardSchemaV1Sync as tt, getDisplayName as u, OAuthClientInformation as ua, SubscriptionsListenResult as ui, InputRequests as un, Progress as ur, CallToolRequestParams as ut, Protocol as v, OAuthTokenRevocationRequest as va, TaskStatusNotificationParams as vi, JSONObject as vn, PromptReference as vr, ClientRequest as vt, mergeCapabilities as w, ToolAnnotations as wi, JSONRPCResultResponse as wn, RequestId as wr, CompleteRequestResourceTemplate as wt, RequestOptions as x, OpenIdProviderMetadata as xa, TitledMultiSelectEnumSchema as xi, JSONRPCNotification as xn, ReadResourceResult as xr, CompleteRequest as xt, ProtocolOptions as y, OAuthTokens as ya, TextContent as yi, JSONRPCErrorResponse as yn, ReadResourceRequest as yr, ClientResult as yt, isJSONRPCErrorResponse as z, INTERNAL_ERROR as zi, ListTasksResult as zn, ResourceUpdatedNotificationParams as zr, ElicitRequestParams as zt };
2523
+ //# sourceMappingURL=index-D4xIIEF6.d.mts.map