@atxp/client 0.10.2 → 0.10.4

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 (782) hide show
  1. package/dist/_virtual/additionalItems.js +4 -0
  2. package/dist/_virtual/additionalItems.js.map +1 -0
  3. package/dist/_virtual/additionalItems2.js +4 -0
  4. package/dist/_virtual/additionalItems2.js.map +1 -0
  5. package/dist/_virtual/additionalProperties.js +4 -0
  6. package/dist/_virtual/additionalProperties.js.map +1 -0
  7. package/dist/_virtual/additionalProperties2.js +4 -0
  8. package/dist/_virtual/additionalProperties2.js.map +1 -0
  9. package/dist/_virtual/ajv.js +1 -1
  10. package/dist/_virtual/ajv2.js +4 -0
  11. package/dist/_virtual/ajv2.js.map +1 -0
  12. package/dist/_virtual/ajv3.js +4 -0
  13. package/dist/_virtual/ajv3.js.map +1 -0
  14. package/dist/_virtual/allOf.js +4 -0
  15. package/dist/_virtual/allOf.js.map +1 -0
  16. package/dist/_virtual/allOf2.js +4 -0
  17. package/dist/_virtual/allOf2.js.map +1 -0
  18. package/dist/_virtual/anyOf.js +4 -0
  19. package/dist/_virtual/anyOf.js.map +1 -0
  20. package/dist/_virtual/anyOf2.js +4 -0
  21. package/dist/_virtual/anyOf2.js.map +1 -0
  22. package/dist/_virtual/applicability.js +4 -0
  23. package/dist/_virtual/applicability.js.map +1 -0
  24. package/dist/_virtual/applicability2.js +4 -0
  25. package/dist/_virtual/applicability2.js.map +1 -0
  26. package/dist/_virtual/boolSchema.js +4 -0
  27. package/dist/_virtual/boolSchema.js.map +1 -0
  28. package/dist/_virtual/boolSchema2.js +4 -0
  29. package/dist/_virtual/boolSchema2.js.map +1 -0
  30. package/dist/_virtual/code.js +4 -0
  31. package/dist/_virtual/code.js.map +1 -0
  32. package/dist/_virtual/code2.js +4 -0
  33. package/dist/_virtual/code2.js.map +1 -0
  34. package/dist/_virtual/code3.js +4 -0
  35. package/dist/_virtual/code3.js.map +1 -0
  36. package/dist/_virtual/code4.js +4 -0
  37. package/dist/_virtual/code4.js.map +1 -0
  38. package/dist/_virtual/const.js +4 -0
  39. package/dist/_virtual/const.js.map +1 -0
  40. package/dist/_virtual/const2.js +4 -0
  41. package/dist/_virtual/const2.js.map +1 -0
  42. package/dist/_virtual/contains.js +4 -0
  43. package/dist/_virtual/contains.js.map +1 -0
  44. package/dist/_virtual/contains2.js +4 -0
  45. package/dist/_virtual/contains2.js.map +1 -0
  46. package/dist/_virtual/core.js +4 -0
  47. package/dist/_virtual/core.js.map +1 -0
  48. package/dist/_virtual/core2.js +4 -0
  49. package/dist/_virtual/core2.js.map +1 -0
  50. package/dist/_virtual/dataType.js +4 -0
  51. package/dist/_virtual/dataType.js.map +1 -0
  52. package/dist/_virtual/dataType2.js +4 -0
  53. package/dist/_virtual/dataType2.js.map +1 -0
  54. package/dist/_virtual/defaults.js +4 -0
  55. package/dist/_virtual/defaults.js.map +1 -0
  56. package/dist/_virtual/defaults2.js +4 -0
  57. package/dist/_virtual/defaults2.js.map +1 -0
  58. package/dist/_virtual/dependencies.js +4 -0
  59. package/dist/_virtual/dependencies.js.map +1 -0
  60. package/dist/_virtual/dependencies2.js +4 -0
  61. package/dist/_virtual/dependencies2.js.map +1 -0
  62. package/dist/_virtual/draft7.js +4 -0
  63. package/dist/_virtual/draft7.js.map +1 -0
  64. package/dist/_virtual/draft72.js +4 -0
  65. package/dist/_virtual/draft72.js.map +1 -0
  66. package/dist/_virtual/enum.js +4 -0
  67. package/dist/_virtual/enum.js.map +1 -0
  68. package/dist/_virtual/enum2.js +4 -0
  69. package/dist/_virtual/enum2.js.map +1 -0
  70. package/dist/_virtual/equal.js +4 -0
  71. package/dist/_virtual/equal.js.map +1 -0
  72. package/dist/_virtual/equal2.js +4 -0
  73. package/dist/_virtual/equal2.js.map +1 -0
  74. package/dist/_virtual/errors.js +4 -0
  75. package/dist/_virtual/errors.js.map +1 -0
  76. package/dist/_virtual/errors2.js +4 -0
  77. package/dist/_virtual/errors2.js.map +1 -0
  78. package/dist/_virtual/format.js +4 -0
  79. package/dist/_virtual/format.js.map +1 -0
  80. package/dist/_virtual/format2.js +4 -0
  81. package/dist/_virtual/format2.js.map +1 -0
  82. package/dist/_virtual/formats.js +4 -0
  83. package/dist/_virtual/formats.js.map +1 -0
  84. package/dist/_virtual/id.js +4 -0
  85. package/dist/_virtual/id.js.map +1 -0
  86. package/dist/_virtual/id2.js +4 -0
  87. package/dist/_virtual/id2.js.map +1 -0
  88. package/dist/_virtual/if.js +4 -0
  89. package/dist/_virtual/if.js.map +1 -0
  90. package/dist/_virtual/if2.js +4 -0
  91. package/dist/_virtual/if2.js.map +1 -0
  92. package/dist/_virtual/index.js +6 -2
  93. package/dist/_virtual/index.js.map +1 -1
  94. package/dist/_virtual/index10.js +4 -0
  95. package/dist/_virtual/index10.js.map +1 -0
  96. package/dist/_virtual/index11.js +4 -0
  97. package/dist/_virtual/index11.js.map +1 -0
  98. package/dist/_virtual/index12.js +4 -0
  99. package/dist/_virtual/index12.js.map +1 -0
  100. package/dist/_virtual/index13.js +4 -0
  101. package/dist/_virtual/index13.js.map +1 -0
  102. package/dist/_virtual/index14.js +4 -0
  103. package/dist/_virtual/index14.js.map +1 -0
  104. package/dist/_virtual/index15.js +4 -0
  105. package/dist/_virtual/index15.js.map +1 -0
  106. package/dist/_virtual/index16.js +4 -0
  107. package/dist/_virtual/index16.js.map +1 -0
  108. package/dist/_virtual/index17.js +4 -0
  109. package/dist/_virtual/index17.js.map +1 -0
  110. package/dist/_virtual/index18.js +4 -0
  111. package/dist/_virtual/index18.js.map +1 -0
  112. package/dist/_virtual/index19.js +4 -0
  113. package/dist/_virtual/index19.js.map +1 -0
  114. package/dist/_virtual/index2.js +4 -0
  115. package/dist/_virtual/index2.js.map +1 -0
  116. package/dist/_virtual/index20.js +4 -0
  117. package/dist/_virtual/index20.js.map +1 -0
  118. package/dist/_virtual/index21.js +4 -0
  119. package/dist/_virtual/index21.js.map +1 -0
  120. package/dist/_virtual/index3.js +4 -0
  121. package/dist/_virtual/index3.js.map +1 -0
  122. package/dist/_virtual/index4.js +4 -0
  123. package/dist/_virtual/index4.js.map +1 -0
  124. package/dist/_virtual/index5.js +4 -0
  125. package/dist/_virtual/index5.js.map +1 -0
  126. package/dist/_virtual/index6.js +4 -0
  127. package/dist/_virtual/index6.js.map +1 -0
  128. package/dist/_virtual/index7.js +4 -0
  129. package/dist/_virtual/index7.js.map +1 -0
  130. package/dist/_virtual/index8.js +4 -0
  131. package/dist/_virtual/index8.js.map +1 -0
  132. package/dist/_virtual/index9.js +4 -0
  133. package/dist/_virtual/index9.js.map +1 -0
  134. package/dist/_virtual/items.js +4 -0
  135. package/dist/_virtual/items.js.map +1 -0
  136. package/dist/_virtual/items2.js +4 -0
  137. package/dist/_virtual/items2.js.map +1 -0
  138. package/dist/_virtual/items2020.js +4 -0
  139. package/dist/_virtual/items2020.js.map +1 -0
  140. package/dist/_virtual/items20202.js +4 -0
  141. package/dist/_virtual/items20202.js.map +1 -0
  142. package/dist/_virtual/keyword.js +4 -0
  143. package/dist/_virtual/keyword.js.map +1 -0
  144. package/dist/_virtual/keyword2.js +4 -0
  145. package/dist/_virtual/keyword2.js.map +1 -0
  146. package/dist/_virtual/limit.js +4 -0
  147. package/dist/_virtual/limit.js.map +1 -0
  148. package/dist/_virtual/limitItems.js +4 -0
  149. package/dist/_virtual/limitItems.js.map +1 -0
  150. package/dist/_virtual/limitItems2.js +4 -0
  151. package/dist/_virtual/limitItems2.js.map +1 -0
  152. package/dist/_virtual/limitLength.js +4 -0
  153. package/dist/_virtual/limitLength.js.map +1 -0
  154. package/dist/_virtual/limitLength2.js +4 -0
  155. package/dist/_virtual/limitLength2.js.map +1 -0
  156. package/dist/_virtual/limitNumber.js +4 -0
  157. package/dist/_virtual/limitNumber.js.map +1 -0
  158. package/dist/_virtual/limitNumber2.js +4 -0
  159. package/dist/_virtual/limitNumber2.js.map +1 -0
  160. package/dist/_virtual/limitProperties.js +4 -0
  161. package/dist/_virtual/limitProperties.js.map +1 -0
  162. package/dist/_virtual/limitProperties2.js +4 -0
  163. package/dist/_virtual/limitProperties2.js.map +1 -0
  164. package/dist/_virtual/metadata.js +4 -0
  165. package/dist/_virtual/metadata.js.map +1 -0
  166. package/dist/_virtual/metadata2.js +4 -0
  167. package/dist/_virtual/metadata2.js.map +1 -0
  168. package/dist/_virtual/multipleOf.js +4 -0
  169. package/dist/_virtual/multipleOf.js.map +1 -0
  170. package/dist/_virtual/multipleOf2.js +4 -0
  171. package/dist/_virtual/multipleOf2.js.map +1 -0
  172. package/dist/_virtual/names.js +4 -0
  173. package/dist/_virtual/names.js.map +1 -0
  174. package/dist/_virtual/names2.js +4 -0
  175. package/dist/_virtual/names2.js.map +1 -0
  176. package/dist/_virtual/not.js +4 -0
  177. package/dist/_virtual/not.js.map +1 -0
  178. package/dist/_virtual/not2.js +4 -0
  179. package/dist/_virtual/not2.js.map +1 -0
  180. package/dist/_virtual/oneOf.js +4 -0
  181. package/dist/_virtual/oneOf.js.map +1 -0
  182. package/dist/_virtual/oneOf2.js +4 -0
  183. package/dist/_virtual/oneOf2.js.map +1 -0
  184. package/dist/_virtual/pattern.js +4 -0
  185. package/dist/_virtual/pattern.js.map +1 -0
  186. package/dist/_virtual/pattern2.js +4 -0
  187. package/dist/_virtual/pattern2.js.map +1 -0
  188. package/dist/_virtual/patternProperties.js +4 -0
  189. package/dist/_virtual/patternProperties.js.map +1 -0
  190. package/dist/_virtual/patternProperties2.js +4 -0
  191. package/dist/_virtual/patternProperties2.js.map +1 -0
  192. package/dist/_virtual/prefixItems.js +4 -0
  193. package/dist/_virtual/prefixItems.js.map +1 -0
  194. package/dist/_virtual/prefixItems2.js +4 -0
  195. package/dist/_virtual/prefixItems2.js.map +1 -0
  196. package/dist/_virtual/properties.js +4 -0
  197. package/dist/_virtual/properties.js.map +1 -0
  198. package/dist/_virtual/properties2.js +4 -0
  199. package/dist/_virtual/properties2.js.map +1 -0
  200. package/dist/_virtual/propertyNames.js +4 -0
  201. package/dist/_virtual/propertyNames.js.map +1 -0
  202. package/dist/_virtual/propertyNames2.js +4 -0
  203. package/dist/_virtual/propertyNames2.js.map +1 -0
  204. package/dist/_virtual/ref.js +4 -0
  205. package/dist/_virtual/ref.js.map +1 -0
  206. package/dist/_virtual/ref2.js +4 -0
  207. package/dist/_virtual/ref2.js.map +1 -0
  208. package/dist/_virtual/ref_error.js +4 -0
  209. package/dist/_virtual/ref_error.js.map +1 -0
  210. package/dist/_virtual/ref_error2.js +4 -0
  211. package/dist/_virtual/ref_error2.js.map +1 -0
  212. package/dist/_virtual/required.js +4 -0
  213. package/dist/_virtual/required.js.map +1 -0
  214. package/dist/_virtual/required2.js +4 -0
  215. package/dist/_virtual/required2.js.map +1 -0
  216. package/dist/_virtual/resolve.js +4 -0
  217. package/dist/_virtual/resolve.js.map +1 -0
  218. package/dist/_virtual/resolve2.js +4 -0
  219. package/dist/_virtual/resolve2.js.map +1 -0
  220. package/dist/_virtual/rules.js +4 -0
  221. package/dist/_virtual/rules.js.map +1 -0
  222. package/dist/_virtual/rules2.js +4 -0
  223. package/dist/_virtual/rules2.js.map +1 -0
  224. package/dist/_virtual/scope.js +4 -0
  225. package/dist/_virtual/scope.js.map +1 -0
  226. package/dist/_virtual/scope2.js +4 -0
  227. package/dist/_virtual/scope2.js.map +1 -0
  228. package/dist/_virtual/subschema.js +4 -0
  229. package/dist/_virtual/subschema.js.map +1 -0
  230. package/dist/_virtual/subschema2.js +4 -0
  231. package/dist/_virtual/subschema2.js.map +1 -0
  232. package/dist/_virtual/thenElse.js +4 -0
  233. package/dist/_virtual/thenElse.js.map +1 -0
  234. package/dist/_virtual/thenElse2.js +4 -0
  235. package/dist/_virtual/thenElse2.js.map +1 -0
  236. package/dist/_virtual/types.js +4 -0
  237. package/dist/_virtual/types.js.map +1 -0
  238. package/dist/_virtual/types2.js +4 -0
  239. package/dist/_virtual/types2.js.map +1 -0
  240. package/dist/_virtual/ucs2length.js +4 -0
  241. package/dist/_virtual/ucs2length.js.map +1 -0
  242. package/dist/_virtual/ucs2length2.js +4 -0
  243. package/dist/_virtual/ucs2length2.js.map +1 -0
  244. package/dist/_virtual/uniqueItems.js +4 -0
  245. package/dist/_virtual/uniqueItems.js.map +1 -0
  246. package/dist/_virtual/uniqueItems2.js +4 -0
  247. package/dist/_virtual/uniqueItems2.js.map +1 -0
  248. package/dist/_virtual/uri.js +4 -0
  249. package/dist/_virtual/uri.js.map +1 -0
  250. package/dist/_virtual/uri2.js +4 -0
  251. package/dist/_virtual/uri2.js.map +1 -0
  252. package/dist/_virtual/util.js +4 -0
  253. package/dist/_virtual/util.js.map +1 -0
  254. package/dist/_virtual/util2.js +4 -0
  255. package/dist/_virtual/util2.js.map +1 -0
  256. package/dist/_virtual/validation_error.js +4 -0
  257. package/dist/_virtual/validation_error.js.map +1 -0
  258. package/dist/_virtual/validation_error2.js +4 -0
  259. package/dist/_virtual/validation_error2.js.map +1 -0
  260. package/dist/atxpAccount.d.ts +20 -0
  261. package/dist/atxpAccount.d.ts.map +1 -0
  262. package/dist/atxpAccount.js +161 -0
  263. package/dist/atxpAccount.js.map +1 -0
  264. package/dist/atxpFetcher.d.ts.map +1 -1
  265. package/dist/atxpFetcher.js +3 -2
  266. package/dist/atxpFetcher.js.map +1 -1
  267. package/dist/base.cjs +34 -0
  268. package/dist/base.cjs.map +1 -0
  269. package/dist/base.d.ts +4 -0
  270. package/dist/base.d.ts.map +1 -0
  271. package/dist/base.js +5 -0
  272. package/dist/base.js.map +1 -0
  273. package/dist/baseAccount.d.ts +20 -0
  274. package/dist/baseAccount.d.ts.map +1 -0
  275. package/dist/baseAccount.js +47 -0
  276. package/dist/baseAccount.js.map +1 -0
  277. package/dist/baseConstants.d.ts +10 -0
  278. package/dist/baseConstants.d.ts.map +1 -0
  279. package/dist/baseConstants.js +21 -0
  280. package/dist/baseConstants.js.map +1 -0
  281. package/dist/basePaymentMaker.d.ts +23 -0
  282. package/dist/basePaymentMaker.d.ts.map +1 -0
  283. package/dist/basePaymentMaker.js +169 -0
  284. package/dist/basePaymentMaker.js.map +1 -0
  285. package/dist/clientTestHelpers.d.ts.map +1 -1
  286. package/dist/index.cjs +19885 -11547
  287. package/dist/index.cjs.map +1 -1
  288. package/dist/index.js +19885 -11547
  289. package/dist/index.js.map +1 -1
  290. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js +277 -202
  291. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map +1 -1
  292. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +399 -65
  293. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +1 -1
  294. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js +195 -93
  295. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js.map +1 -1
  296. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js +187 -0
  297. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js.map +1 -0
  298. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js +60 -0
  299. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js.map +1 -0
  300. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js +18 -0
  301. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js.map +1 -0
  302. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js +25 -17
  303. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js.map +1 -1
  304. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +85 -0
  305. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -0
  306. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +30 -0
  307. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +1 -0
  308. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js +3 -3
  309. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js.map +1 -1
  310. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +129 -123
  311. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js.map +1 -1
  312. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +785 -114
  313. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -1
  314. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js +41 -0
  315. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js.map +1 -0
  316. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1207 -513
  317. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -1
  318. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +90 -0
  319. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +1 -0
  320. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js +71 -0
  321. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js.map +1 -0
  322. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js +169 -0
  323. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
  324. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js +712 -0
  325. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
  326. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js +157 -0
  327. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
  328. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js +139 -0
  329. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js.map +1 -0
  330. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js +259 -0
  331. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js.map +1 -0
  332. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js +40 -0
  333. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js.map +1 -0
  334. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js +24 -0
  335. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
  336. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js +169 -0
  337. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js.map +1 -0
  338. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js +37 -0
  339. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js.map +1 -0
  340. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js +191 -0
  341. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js.map +1 -0
  342. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js +30 -0
  343. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
  344. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js +64 -0
  345. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
  346. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js +219 -0
  347. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
  348. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js +48 -0
  349. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
  350. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js +541 -0
  351. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
  352. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js +139 -0
  353. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
  354. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js +94 -0
  355. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
  356. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js +642 -0
  357. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js.map +1 -0
  358. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/data.json.js +31 -0
  359. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/data.json.js.map +1 -0
  360. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +254 -0
  361. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -0
  362. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js +19 -0
  363. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js.map +1 -0
  364. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js +35 -0
  365. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
  366. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js +18 -0
  367. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js.map +1 -0
  368. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js +22 -0
  369. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
  370. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +62 -0
  371. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
  372. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +121 -0
  373. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
  374. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js +35 -0
  375. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
  376. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +24 -0
  377. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
  378. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js +108 -0
  379. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
  380. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +101 -0
  381. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
  382. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js +79 -0
  383. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
  384. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js +71 -0
  385. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
  386. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js +66 -0
  387. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
  388. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js +45 -0
  389. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
  390. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js +38 -0
  391. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
  392. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +73 -0
  393. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
  394. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +89 -0
  395. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
  396. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +24 -0
  397. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
  398. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js +69 -0
  399. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
  400. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +51 -0
  401. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
  402. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +25 -0
  403. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
  404. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js +145 -0
  405. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
  406. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js +21 -0
  407. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
  408. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js +29 -0
  409. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
  410. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js +139 -0
  411. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
  412. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js +120 -0
  413. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
  414. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js +20 -0
  415. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
  416. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js +33 -0
  417. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
  418. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js +104 -0
  419. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
  420. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js +18 -0
  421. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
  422. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js +29 -0
  423. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
  424. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js +39 -0
  425. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
  426. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js +62 -0
  427. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
  428. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js +54 -0
  429. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
  430. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js +36 -0
  431. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
  432. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js +41 -0
  433. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
  434. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +39 -0
  435. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
  436. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +36 -0
  437. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
  438. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +38 -0
  439. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
  440. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js +37 -0
  441. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
  442. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js +93 -0
  443. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
  444. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +79 -0
  445. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
  446. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js +104 -0
  447. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js.map +1 -0
  448. package/dist/node_modules/ajv/dist/ajv.js +71 -0
  449. package/dist/node_modules/ajv/dist/ajv.js.map +1 -0
  450. package/dist/node_modules/ajv/dist/compile/codegen/code.js +169 -0
  451. package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
  452. package/dist/node_modules/ajv/dist/compile/codegen/index.js +712 -0
  453. package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
  454. package/dist/node_modules/ajv/dist/compile/codegen/scope.js +157 -0
  455. package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
  456. package/dist/node_modules/ajv/dist/compile/errors.js +139 -0
  457. package/dist/node_modules/ajv/dist/compile/errors.js.map +1 -0
  458. package/dist/node_modules/ajv/dist/compile/index.js +259 -0
  459. package/dist/node_modules/ajv/dist/compile/index.js.map +1 -0
  460. package/dist/node_modules/ajv/dist/compile/names.js +40 -0
  461. package/dist/node_modules/ajv/dist/compile/names.js.map +1 -0
  462. package/dist/node_modules/ajv/dist/compile/ref_error.js +24 -0
  463. package/dist/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
  464. package/dist/node_modules/ajv/dist/compile/resolve.js +169 -0
  465. package/dist/node_modules/ajv/dist/compile/resolve.js.map +1 -0
  466. package/dist/node_modules/ajv/dist/compile/rules.js +37 -0
  467. package/dist/node_modules/ajv/dist/compile/rules.js.map +1 -0
  468. package/dist/node_modules/ajv/dist/compile/util.js +191 -0
  469. package/dist/node_modules/ajv/dist/compile/util.js.map +1 -0
  470. package/dist/node_modules/ajv/dist/compile/validate/applicability.js +30 -0
  471. package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
  472. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +64 -0
  473. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
  474. package/dist/node_modules/ajv/dist/compile/validate/dataType.js +219 -0
  475. package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
  476. package/dist/node_modules/ajv/dist/compile/validate/defaults.js +48 -0
  477. package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
  478. package/dist/node_modules/ajv/dist/compile/validate/index.js +541 -0
  479. package/dist/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
  480. package/dist/node_modules/ajv/dist/compile/validate/keyword.js +139 -0
  481. package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
  482. package/dist/node_modules/ajv/dist/compile/validate/subschema.js +94 -0
  483. package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
  484. package/dist/node_modules/ajv/dist/core.js +642 -0
  485. package/dist/node_modules/ajv/dist/core.js.map +1 -0
  486. package/dist/node_modules/ajv/dist/refs/data.json.js +31 -0
  487. package/dist/node_modules/ajv/dist/refs/data.json.js.map +1 -0
  488. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +254 -0
  489. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -0
  490. package/dist/node_modules/ajv/dist/runtime/equal.js +19 -0
  491. package/dist/node_modules/ajv/dist/runtime/equal.js.map +1 -0
  492. package/dist/node_modules/ajv/dist/runtime/ucs2length.js +35 -0
  493. package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
  494. package/dist/node_modules/ajv/dist/runtime/uri.js +18 -0
  495. package/dist/node_modules/ajv/dist/runtime/uri.js.map +1 -0
  496. package/dist/node_modules/ajv/dist/runtime/validation_error.js +22 -0
  497. package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
  498. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +62 -0
  499. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
  500. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +121 -0
  501. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
  502. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +35 -0
  503. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
  504. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +24 -0
  505. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
  506. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +108 -0
  507. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
  508. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +101 -0
  509. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
  510. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +79 -0
  511. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
  512. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +71 -0
  513. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
  514. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +66 -0
  515. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
  516. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +45 -0
  517. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
  518. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +38 -0
  519. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
  520. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +73 -0
  521. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
  522. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +89 -0
  523. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
  524. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +24 -0
  525. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
  526. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +69 -0
  527. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
  528. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +51 -0
  529. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
  530. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +25 -0
  531. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
  532. package/dist/node_modules/ajv/dist/vocabularies/code.js +145 -0
  533. package/dist/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
  534. package/dist/node_modules/ajv/dist/vocabularies/core/id.js +21 -0
  535. package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
  536. package/dist/node_modules/ajv/dist/vocabularies/core/index.js +29 -0
  537. package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
  538. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +139 -0
  539. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
  540. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +120 -0
  541. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
  542. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +20 -0
  543. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
  544. package/dist/node_modules/ajv/dist/vocabularies/draft7.js +33 -0
  545. package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
  546. package/dist/node_modules/ajv/dist/vocabularies/format/format.js +104 -0
  547. package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
  548. package/dist/node_modules/ajv/dist/vocabularies/format/index.js +18 -0
  549. package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
  550. package/dist/node_modules/ajv/dist/vocabularies/metadata.js +29 -0
  551. package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
  552. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +39 -0
  553. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
  554. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +62 -0
  555. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
  556. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +54 -0
  557. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
  558. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +36 -0
  559. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
  560. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +41 -0
  561. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
  562. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +39 -0
  563. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
  564. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +36 -0
  565. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
  566. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +38 -0
  567. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
  568. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +37 -0
  569. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
  570. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +93 -0
  571. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
  572. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +79 -0
  573. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
  574. package/dist/node_modules/ajv-formats/dist/formats.js +221 -0
  575. package/dist/node_modules/ajv-formats/dist/formats.js.map +1 -0
  576. package/dist/node_modules/ajv-formats/dist/index.js +53 -0
  577. package/dist/node_modules/ajv-formats/dist/index.js.map +1 -0
  578. package/dist/node_modules/ajv-formats/dist/limit.js +84 -0
  579. package/dist/node_modules/ajv-formats/dist/limit.js.map +1 -0
  580. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.js +71 -0
  581. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.js.map +1 -0
  582. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js +169 -0
  583. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
  584. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.js +712 -0
  585. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
  586. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js +157 -0
  587. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
  588. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js +139 -0
  589. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js.map +1 -0
  590. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js +259 -0
  591. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js.map +1 -0
  592. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js +40 -0
  593. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js.map +1 -0
  594. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js +24 -0
  595. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
  596. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js +169 -0
  597. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js.map +1 -0
  598. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/rules.js +37 -0
  599. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/rules.js.map +1 -0
  600. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js +191 -0
  601. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js.map +1 -0
  602. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/applicability.js +30 -0
  603. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
  604. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/boolSchema.js +64 -0
  605. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
  606. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js +219 -0
  607. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
  608. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/defaults.js +48 -0
  609. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
  610. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js +541 -0
  611. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
  612. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/keyword.js +139 -0
  613. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
  614. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.js +94 -0
  615. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
  616. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.js +642 -0
  617. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.js.map +1 -0
  618. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/data.json.js +31 -0
  619. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/data.json.js.map +1 -0
  620. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +254 -0
  621. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -0
  622. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/equal.js +19 -0
  623. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/equal.js.map +1 -0
  624. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/ucs2length.js +35 -0
  625. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
  626. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js +18 -0
  627. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js.map +1 -0
  628. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/validation_error.js +22 -0
  629. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
  630. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +62 -0
  631. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
  632. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +121 -0
  633. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
  634. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/allOf.js +35 -0
  635. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
  636. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +24 -0
  637. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
  638. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.js +108 -0
  639. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
  640. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +101 -0
  641. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
  642. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.js +79 -0
  643. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
  644. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.js +71 -0
  645. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
  646. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items.js +66 -0
  647. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
  648. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items2020.js +45 -0
  649. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
  650. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.js +38 -0
  651. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
  652. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +73 -0
  653. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
  654. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +89 -0
  655. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
  656. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +24 -0
  657. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
  658. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/properties.js +69 -0
  659. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
  660. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +51 -0
  661. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
  662. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +25 -0
  663. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
  664. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/code.js +145 -0
  665. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
  666. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/id.js +21 -0
  667. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
  668. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/index.js +29 -0
  669. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
  670. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js +139 -0
  671. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
  672. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js +120 -0
  673. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
  674. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js +20 -0
  675. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
  676. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft7.js +33 -0
  677. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
  678. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.js +104 -0
  679. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
  680. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/index.js +18 -0
  681. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
  682. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/metadata.js +29 -0
  683. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
  684. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.js +39 -0
  685. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
  686. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js +62 -0
  687. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
  688. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.js +54 -0
  689. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
  690. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitItems.js +36 -0
  691. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
  692. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitLength.js +41 -0
  693. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
  694. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +39 -0
  695. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
  696. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +36 -0
  697. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
  698. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +38 -0
  699. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
  700. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/pattern.js +37 -0
  701. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
  702. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.js +93 -0
  703. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
  704. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +79 -0
  705. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
  706. package/dist/node_modules/ajv-formats/node_modules/json-schema-traverse/index.js +104 -0
  707. package/dist/node_modules/ajv-formats/node_modules/json-schema-traverse/index.js.map +1 -0
  708. package/dist/node_modules/fast-uri/index.js +353 -0
  709. package/dist/node_modules/fast-uri/index.js.map +1 -0
  710. package/dist/node_modules/fast-uri/lib/schemes.js +279 -0
  711. package/dist/node_modules/fast-uri/lib/schemes.js.map +1 -0
  712. package/dist/node_modules/fast-uri/lib/utils.js +345 -0
  713. package/dist/node_modules/fast-uri/lib/utils.js.map +1 -0
  714. package/dist/node_modules/json-schema-traverse/index.js +6 -2
  715. package/dist/node_modules/json-schema-traverse/index.js.map +1 -1
  716. package/dist/node_modules/pkce-challenge/dist/index.browser.js +8 -5
  717. package/dist/node_modules/pkce-challenge/dist/index.browser.js.map +1 -1
  718. package/dist/node_modules/zod/v4/classic/coerce.js +9 -0
  719. package/dist/node_modules/zod/v4/classic/coerce.js.map +1 -0
  720. package/dist/node_modules/zod/v4/classic/compat.js +8 -0
  721. package/dist/node_modules/zod/v4/classic/compat.js.map +1 -0
  722. package/dist/node_modules/zod/v4/classic/errors.js +44 -0
  723. package/dist/node_modules/zod/v4/classic/errors.js.map +1 -0
  724. package/dist/node_modules/zod/v4/classic/iso.js +36 -0
  725. package/dist/node_modules/zod/v4/classic/iso.js.map +1 -0
  726. package/dist/node_modules/zod/v4/classic/parse.js +10 -0
  727. package/dist/node_modules/zod/v4/classic/parse.js.map +1 -0
  728. package/dist/node_modules/zod/v4/classic/schemas.js +674 -0
  729. package/dist/node_modules/zod/v4/classic/schemas.js.map +1 -0
  730. package/dist/node_modules/zod/v4/core/api.js +468 -0
  731. package/dist/node_modules/zod/v4/core/api.js.map +1 -0
  732. package/dist/node_modules/zod/v4/core/checks.js +413 -0
  733. package/dist/node_modules/zod/v4/core/checks.js.map +1 -0
  734. package/dist/node_modules/zod/v4/core/core.js +60 -0
  735. package/dist/node_modules/zod/v4/core/core.js.map +1 -0
  736. package/dist/node_modules/zod/v4/core/doc.js +38 -0
  737. package/dist/node_modules/zod/v4/core/doc.js.map +1 -0
  738. package/dist/node_modules/zod/v4/core/errors.js +86 -0
  739. package/dist/node_modules/zod/v4/core/errors.js.map +1 -0
  740. package/dist/node_modules/zod/v4/core/parse.js +59 -0
  741. package/dist/node_modules/zod/v4/core/parse.js.map +1 -0
  742. package/dist/node_modules/zod/v4/core/regexes.js +81 -0
  743. package/dist/node_modules/zod/v4/core/regexes.js.map +1 -0
  744. package/dist/node_modules/zod/v4/core/registries.js +52 -0
  745. package/dist/node_modules/zod/v4/core/registries.js.map +1 -0
  746. package/dist/node_modules/zod/v4/core/schemas.js +1328 -0
  747. package/dist/node_modules/zod/v4/core/schemas.js.map +1 -0
  748. package/dist/node_modules/zod/v4/core/util.js +335 -0
  749. package/dist/node_modules/zod/v4/core/util.js.map +1 -0
  750. package/dist/node_modules/zod/v4/core/versions.js +8 -0
  751. package/dist/node_modules/zod/v4/core/versions.js.map +1 -0
  752. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +2 -0
  753. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
  754. package/dist/polygon.cjs +39 -0
  755. package/dist/polygon.cjs.map +1 -0
  756. package/dist/polygon.d.ts +1 -0
  757. package/dist/polygon.d.ts.map +1 -0
  758. package/dist/polygon.js +2 -0
  759. package/dist/polygon.js.map +1 -0
  760. package/dist/solana.cjs +20 -0
  761. package/dist/solana.cjs.map +1 -0
  762. package/dist/solana.d.ts +2 -0
  763. package/dist/solana.d.ts.map +1 -0
  764. package/dist/solana.js +3 -0
  765. package/dist/solana.js.map +1 -0
  766. package/dist/solanaAccount.d.ts +13 -0
  767. package/dist/solanaAccount.d.ts.map +1 -0
  768. package/dist/solanaAccount.js +34 -0
  769. package/dist/solanaAccount.js.map +1 -0
  770. package/dist/solanaPaymentMaker.d.ts +25 -0
  771. package/dist/solanaPaymentMaker.d.ts.map +1 -0
  772. package/dist/solanaPaymentMaker.js +108 -0
  773. package/dist/solanaPaymentMaker.js.map +1 -0
  774. package/dist/types.js +152 -0
  775. package/dist/types.js.map +1 -0
  776. package/dist/world.cjs +39 -0
  777. package/dist/world.cjs.map +1 -0
  778. package/dist/world.d.ts +1 -0
  779. package/dist/world.d.ts.map +1 -0
  780. package/dist/world.js +2 -0
  781. package/dist/world.js.map +1 -0
  782. package/package.json +10 -10
@@ -1,90 +1,150 @@
1
- import { union as unionType, string as stringType, number as numberType, object as objectType, optional as optionalType, literal as literalType, unknown as unknownType, array as arrayType, boolean as booleanType, record as recordType, enum as enumType, discriminatedUnion as discriminatedUnionType } from '../../../../zod/v3/types.js';
1
+ import { custom, union, string, number, looseObject, null as _null, object, literal, unknown, enum as _enum, array, intersection, record, boolean, preprocess, optional, discriminatedUnion } from '../../../../zod/v4/classic/schemas.js';
2
+ import { datetime } from '../../../../zod/v4/classic/iso.js';
2
3
 
3
- const LATEST_PROTOCOL_VERSION = "2025-06-18";
4
- const SUPPORTED_PROTOCOL_VERSIONS = [
5
- LATEST_PROTOCOL_VERSION,
6
- "2025-03-26",
7
- "2024-11-05",
8
- "2024-10-07",
9
- ];
4
+ const LATEST_PROTOCOL_VERSION = '2025-11-25';
5
+ const SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, '2025-06-18', '2025-03-26', '2024-11-05', '2024-10-07'];
6
+ const RELATED_TASK_META_KEY = 'io.modelcontextprotocol/related-task';
10
7
  /* JSON-RPC types */
11
- const JSONRPC_VERSION = "2.0";
8
+ const JSONRPC_VERSION = '2.0';
9
+ /**
10
+ * Assert 'object' type schema.
11
+ *
12
+ * @internal
13
+ */
14
+ const AssertObjectSchema = custom((v) => v !== null && (typeof v === 'object' || typeof v === 'function'));
12
15
  /**
13
16
  * A progress token, used to associate progress notifications with the original request.
14
17
  */
15
- const ProgressTokenSchema = unionType([stringType(), numberType().int()]);
18
+ const ProgressTokenSchema = union([string(), number().int()]);
16
19
  /**
17
20
  * An opaque token used to represent a cursor for pagination.
18
21
  */
19
- const CursorSchema = stringType();
20
- const RequestMetaSchema = objectType({
22
+ const CursorSchema = string();
23
+ /**
24
+ * Task creation parameters, used to ask that the server create a task to represent a request.
25
+ */
26
+ looseObject({
27
+ /**
28
+ * Time in milliseconds to keep task results available after completion.
29
+ * If null, the task has unlimited lifetime until manually cleaned up.
30
+ */
31
+ ttl: union([number(), _null()]).optional(),
32
+ /**
33
+ * Time in milliseconds to wait between task status requests.
34
+ */
35
+ pollInterval: number().optional()
36
+ });
37
+ const TaskMetadataSchema = object({
38
+ ttl: number().optional()
39
+ });
40
+ /**
41
+ * Metadata for associating messages with a task.
42
+ * Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`.
43
+ */
44
+ const RelatedTaskMetadataSchema = object({
45
+ taskId: string()
46
+ });
47
+ const RequestMetaSchema = looseObject({
21
48
  /**
22
49
  * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
23
50
  */
24
- progressToken: optionalType(ProgressTokenSchema),
25
- })
26
- .passthrough();
27
- const BaseRequestParamsSchema = objectType({
28
- _meta: optionalType(RequestMetaSchema),
29
- })
30
- .passthrough();
31
- const RequestSchema = objectType({
32
- method: stringType(),
33
- params: optionalType(BaseRequestParamsSchema),
51
+ progressToken: ProgressTokenSchema.optional(),
52
+ /**
53
+ * If specified, this request is related to the provided task.
54
+ */
55
+ [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
56
+ });
57
+ /**
58
+ * Common params for any request.
59
+ */
60
+ const BaseRequestParamsSchema = object({
61
+ /**
62
+ * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
63
+ */
64
+ _meta: RequestMetaSchema.optional()
34
65
  });
35
- const BaseNotificationParamsSchema = objectType({
66
+ /**
67
+ * Common params for any task-augmented request.
68
+ */
69
+ const TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({
70
+ /**
71
+ * If specified, the caller is requesting task-augmented execution for this request.
72
+ * The request will return a CreateTaskResult immediately, and the actual result can be
73
+ * retrieved later via tasks/result.
74
+ *
75
+ * Task augmentation is subject to capability negotiation - receivers MUST declare support
76
+ * for task augmentation of specific request types in their capabilities.
77
+ */
78
+ task: TaskMetadataSchema.optional()
79
+ });
80
+ /**
81
+ * Checks if a value is a valid TaskAugmentedRequestParams.
82
+ * @param value - The value to check.
83
+ *
84
+ * @returns True if the value is a valid TaskAugmentedRequestParams, false otherwise.
85
+ */
86
+ const isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
87
+ const RequestSchema = object({
88
+ method: string(),
89
+ params: BaseRequestParamsSchema.loose().optional()
90
+ });
91
+ const NotificationsParamsSchema = object({
36
92
  /**
37
93
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
38
94
  * for notes on _meta usage.
39
95
  */
40
- _meta: optionalType(objectType({}).passthrough()),
41
- })
42
- .passthrough();
43
- const NotificationSchema = objectType({
44
- method: stringType(),
45
- params: optionalType(BaseNotificationParamsSchema),
96
+ _meta: RequestMetaSchema.optional()
46
97
  });
47
- const ResultSchema = objectType({
98
+ const NotificationSchema = object({
99
+ method: string(),
100
+ params: NotificationsParamsSchema.loose().optional()
101
+ });
102
+ const ResultSchema = looseObject({
48
103
  /**
49
104
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
50
105
  * for notes on _meta usage.
51
106
  */
52
- _meta: optionalType(objectType({}).passthrough()),
53
- })
54
- .passthrough();
107
+ _meta: RequestMetaSchema.optional()
108
+ });
55
109
  /**
56
110
  * A uniquely identifying ID for a request in JSON-RPC.
57
111
  */
58
- const RequestIdSchema = unionType([stringType(), numberType().int()]);
112
+ const RequestIdSchema = union([string(), number().int()]);
59
113
  /**
60
114
  * A request that expects a response.
61
115
  */
62
- const JSONRPCRequestSchema = objectType({
63
- jsonrpc: literalType(JSONRPC_VERSION),
116
+ const JSONRPCRequestSchema = object({
117
+ jsonrpc: literal(JSONRPC_VERSION),
64
118
  id: RequestIdSchema,
119
+ ...RequestSchema.shape
65
120
  })
66
- .merge(RequestSchema)
67
121
  .strict();
68
122
  const isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
69
123
  /**
70
124
  * A notification which does not expect a response.
71
125
  */
72
- const JSONRPCNotificationSchema = objectType({
73
- jsonrpc: literalType(JSONRPC_VERSION),
126
+ const JSONRPCNotificationSchema = object({
127
+ jsonrpc: literal(JSONRPC_VERSION),
128
+ ...NotificationSchema.shape
74
129
  })
75
- .merge(NotificationSchema)
76
130
  .strict();
77
131
  const isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
78
132
  /**
79
133
  * A successful (non-error) response to a request.
80
134
  */
81
- const JSONRPCResponseSchema = objectType({
82
- jsonrpc: literalType(JSONRPC_VERSION),
135
+ const JSONRPCResultResponseSchema = object({
136
+ jsonrpc: literal(JSONRPC_VERSION),
83
137
  id: RequestIdSchema,
84
- result: ResultSchema,
138
+ result: ResultSchema
85
139
  })
86
140
  .strict();
87
- const isJSONRPCResponse = (value) => JSONRPCResponseSchema.safeParse(value).success;
141
+ /**
142
+ * Checks if a value is a valid JSONRPCResultResponse.
143
+ * @param value - The value to check.
144
+ *
145
+ * @returns True if the value is a valid JSONRPCResultResponse, false otherwise.
146
+ */
147
+ const isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success;
88
148
  /**
89
149
  * Error codes defined by the JSON-RPC specification.
90
150
  */
@@ -99,41 +159,62 @@ var ErrorCode;
99
159
  ErrorCode[ErrorCode["MethodNotFound"] = -32601] = "MethodNotFound";
100
160
  ErrorCode[ErrorCode["InvalidParams"] = -32602] = "InvalidParams";
101
161
  ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError";
162
+ // MCP-specific error codes
163
+ ErrorCode[ErrorCode["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
102
164
  })(ErrorCode || (ErrorCode = {}));
103
165
  /**
104
166
  * A response to a request that indicates an error occurred.
105
167
  */
106
- const JSONRPCErrorSchema = objectType({
107
- jsonrpc: literalType(JSONRPC_VERSION),
108
- id: RequestIdSchema,
109
- error: objectType({
168
+ const JSONRPCErrorResponseSchema = object({
169
+ jsonrpc: literal(JSONRPC_VERSION),
170
+ id: RequestIdSchema.optional(),
171
+ error: object({
110
172
  /**
111
173
  * The error type that occurred.
112
174
  */
113
- code: numberType().int(),
175
+ code: number().int(),
114
176
  /**
115
177
  * A short description of the error. The message SHOULD be limited to a concise single sentence.
116
178
  */
117
- message: stringType(),
179
+ message: string(),
118
180
  /**
119
181
  * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
120
182
  */
121
- data: optionalType(unknownType()),
122
- }),
183
+ data: unknown().optional()
184
+ })
123
185
  })
124
186
  .strict();
125
- const isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
126
- const JSONRPCMessageSchema = unionType([
187
+ /**
188
+ * Checks if a value is a valid JSONRPCErrorResponse.
189
+ * @param value - The value to check.
190
+ *
191
+ * @returns True if the value is a valid JSONRPCErrorResponse, false otherwise.
192
+ */
193
+ const isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
194
+ const JSONRPCMessageSchema = union([
127
195
  JSONRPCRequestSchema,
128
196
  JSONRPCNotificationSchema,
129
- JSONRPCResponseSchema,
130
- JSONRPCErrorSchema,
197
+ JSONRPCResultResponseSchema,
198
+ JSONRPCErrorResponseSchema
131
199
  ]);
200
+ union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
132
201
  /* Empty result */
133
202
  /**
134
203
  * A response that indicates success but carries no data.
135
204
  */
136
205
  const EmptyResultSchema = ResultSchema.strict();
206
+ const CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
207
+ /**
208
+ * The ID of the request to cancel.
209
+ *
210
+ * This MUST correspond to the ID of a request previously issued in the same direction.
211
+ */
212
+ requestId: RequestIdSchema.optional(),
213
+ /**
214
+ * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
215
+ */
216
+ reason: string().optional()
217
+ });
137
218
  /* Cancellation */
138
219
  /**
139
220
  * This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
@@ -145,170 +226,278 @@ const EmptyResultSchema = ResultSchema.strict();
145
226
  * A client MUST NOT attempt to cancel its `initialize` request.
146
227
  */
147
228
  const CancelledNotificationSchema = NotificationSchema.extend({
148
- method: literalType("notifications/cancelled"),
149
- params: BaseNotificationParamsSchema.extend({
150
- /**
151
- * The ID of the request to cancel.
152
- *
153
- * This MUST correspond to the ID of a request previously issued in the same direction.
154
- */
155
- requestId: RequestIdSchema,
156
- /**
157
- * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
158
- */
159
- reason: stringType().optional(),
160
- }),
229
+ method: literal('notifications/cancelled'),
230
+ params: CancelledNotificationParamsSchema
161
231
  });
162
232
  /* Base Metadata */
163
233
  /**
164
234
  * Icon schema for use in tools, prompts, resources, and implementations.
165
235
  */
166
- const IconSchema = objectType({
236
+ const IconSchema = object({
167
237
  /**
168
238
  * URL or data URI for the icon.
169
239
  */
170
- src: stringType(),
240
+ src: string(),
171
241
  /**
172
242
  * Optional MIME type for the icon.
173
243
  */
174
- mimeType: optionalType(stringType()),
244
+ mimeType: string().optional(),
175
245
  /**
176
- * Optional string specifying icon dimensions (e.g., "48x48 96x96").
246
+ * Optional array of strings that specify sizes at which the icon can be used.
247
+ * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
248
+ *
249
+ * If not provided, the client should assume that the icon can be used at any size.
177
250
  */
178
- sizes: optionalType(stringType()),
179
- })
180
- .passthrough();
251
+ sizes: array(string()).optional(),
252
+ /**
253
+ * Optional specifier for the theme this icon is designed for. `light` indicates
254
+ * the icon is designed to be used with a light background, and `dark` indicates
255
+ * the icon is designed to be used with a dark background.
256
+ *
257
+ * If not provided, the client should assume the icon can be used with any theme.
258
+ */
259
+ theme: _enum(['light', 'dark']).optional()
260
+ });
261
+ /**
262
+ * Base schema to add `icons` property.
263
+ *
264
+ */
265
+ const IconsSchema = object({
266
+ /**
267
+ * Optional set of sized icons that the client can display in a user interface.
268
+ *
269
+ * Clients that support rendering icons MUST support at least the following MIME types:
270
+ * - `image/png` - PNG images (safe, universal compatibility)
271
+ * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
272
+ *
273
+ * Clients that support rendering icons SHOULD also support:
274
+ * - `image/svg+xml` - SVG images (scalable but requires security precautions)
275
+ * - `image/webp` - WebP images (modern, efficient format)
276
+ */
277
+ icons: array(IconSchema).optional()
278
+ });
181
279
  /**
182
280
  * Base metadata interface for common properties across resources, tools, prompts, and implementations.
183
281
  */
184
- const BaseMetadataSchema = objectType({
282
+ const BaseMetadataSchema = object({
185
283
  /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
186
- name: stringType(),
187
- /**
188
- * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
189
- * even by those unfamiliar with domain-specific terminology.
190
- *
191
- * If not provided, the name should be used for display (except for Tool,
192
- * where `annotations.title` should be given precedence over using `name`,
193
- * if present).
194
- */
195
- title: optionalType(stringType()),
196
- })
197
- .passthrough();
284
+ name: string(),
285
+ /**
286
+ * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
287
+ * even by those unfamiliar with domain-specific terminology.
288
+ *
289
+ * If not provided, the name should be used for display (except for Tool,
290
+ * where `annotations.title` should be given precedence over using `name`,
291
+ * if present).
292
+ */
293
+ title: string().optional()
294
+ });
198
295
  /* Initialization */
199
296
  /**
200
297
  * Describes the name and version of an MCP implementation.
201
298
  */
202
299
  const ImplementationSchema = BaseMetadataSchema.extend({
203
- version: stringType(),
300
+ ...BaseMetadataSchema.shape,
301
+ ...IconsSchema.shape,
302
+ version: string(),
204
303
  /**
205
304
  * An optional URL of the website for this implementation.
206
305
  */
207
- websiteUrl: optionalType(stringType()),
306
+ websiteUrl: string().optional(),
307
+ /**
308
+ * An optional human-readable description of what this implementation does.
309
+ *
310
+ * This can be used by clients or servers to provide context about their purpose
311
+ * and capabilities. For example, a server might describe the types of resources
312
+ * or tools it provides, while a client might describe its intended use case.
313
+ */
314
+ description: string().optional()
315
+ });
316
+ const FormElicitationCapabilitySchema = intersection(object({
317
+ applyDefaults: boolean().optional()
318
+ }), record(string(), unknown()));
319
+ const ElicitationCapabilitySchema = preprocess(value => {
320
+ if (value && typeof value === 'object' && !Array.isArray(value)) {
321
+ if (Object.keys(value).length === 0) {
322
+ return { form: {} };
323
+ }
324
+ }
325
+ return value;
326
+ }, intersection(object({
327
+ form: FormElicitationCapabilitySchema.optional(),
328
+ url: AssertObjectSchema.optional()
329
+ }), record(string(), unknown()).optional()));
330
+ /**
331
+ * Task capabilities for clients, indicating which request types support task creation.
332
+ */
333
+ const ClientTasksCapabilitySchema = looseObject({
334
+ /**
335
+ * Present if the client supports listing tasks.
336
+ */
337
+ list: AssertObjectSchema.optional(),
338
+ /**
339
+ * Present if the client supports cancelling tasks.
340
+ */
341
+ cancel: AssertObjectSchema.optional(),
208
342
  /**
209
- * An optional list of icons for this implementation.
210
- * This can be used by clients to display the implementation in a user interface.
211
- * Each icon should have a `kind` property that specifies whether it is a data representation or a URL source, a `src` property that points to the icon file or data representation, and may also include a `mimeType` and `sizes` property.
212
- * The `mimeType` property should be a valid MIME type for the icon file, such as "image/png" or "image/svg+xml".
213
- * The `sizes` property should be a string that specifies one or more sizes at which the icon file can be used, such as "48x48" or "any" for scalable formats like SVG.
214
- * The `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.
343
+ * Capabilities for task creation on specific request types.
215
344
  */
216
- icons: optionalType(arrayType(IconSchema)),
345
+ requests: looseObject({
346
+ /**
347
+ * Task support for sampling requests.
348
+ */
349
+ sampling: looseObject({
350
+ createMessage: AssertObjectSchema.optional()
351
+ })
352
+ .optional(),
353
+ /**
354
+ * Task support for elicitation requests.
355
+ */
356
+ elicitation: looseObject({
357
+ create: AssertObjectSchema.optional()
358
+ })
359
+ .optional()
360
+ })
361
+ .optional()
362
+ });
363
+ /**
364
+ * Task capabilities for servers, indicating which request types support task creation.
365
+ */
366
+ const ServerTasksCapabilitySchema = looseObject({
367
+ /**
368
+ * Present if the server supports listing tasks.
369
+ */
370
+ list: AssertObjectSchema.optional(),
371
+ /**
372
+ * Present if the server supports cancelling tasks.
373
+ */
374
+ cancel: AssertObjectSchema.optional(),
375
+ /**
376
+ * Capabilities for task creation on specific request types.
377
+ */
378
+ requests: looseObject({
379
+ /**
380
+ * Task support for tool requests.
381
+ */
382
+ tools: looseObject({
383
+ call: AssertObjectSchema.optional()
384
+ })
385
+ .optional()
386
+ })
387
+ .optional()
217
388
  });
218
389
  /**
219
390
  * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.
220
391
  */
221
- const ClientCapabilitiesSchema = objectType({
392
+ const ClientCapabilitiesSchema = object({
222
393
  /**
223
394
  * Experimental, non-standard capabilities that the client supports.
224
395
  */
225
- experimental: optionalType(objectType({}).passthrough()),
396
+ experimental: record(string(), AssertObjectSchema).optional(),
226
397
  /**
227
398
  * Present if the client supports sampling from an LLM.
228
399
  */
229
- sampling: optionalType(objectType({}).passthrough()),
400
+ sampling: object({
401
+ /**
402
+ * Present if the client supports context inclusion via includeContext parameter.
403
+ * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
404
+ */
405
+ context: AssertObjectSchema.optional(),
406
+ /**
407
+ * Present if the client supports tool use via tools and toolChoice parameters.
408
+ */
409
+ tools: AssertObjectSchema.optional()
410
+ })
411
+ .optional(),
230
412
  /**
231
413
  * Present if the client supports eliciting user input.
232
414
  */
233
- elicitation: optionalType(objectType({}).passthrough()),
415
+ elicitation: ElicitationCapabilitySchema.optional(),
234
416
  /**
235
417
  * Present if the client supports listing roots.
236
418
  */
237
- roots: optionalType(objectType({
419
+ roots: object({
238
420
  /**
239
421
  * Whether the client supports issuing notifications for changes to the roots list.
240
422
  */
241
- listChanged: optionalType(booleanType()),
423
+ listChanged: boolean().optional()
242
424
  })
243
- .passthrough()),
244
- })
245
- .passthrough();
425
+ .optional(),
426
+ /**
427
+ * Present if the client supports task creation.
428
+ */
429
+ tasks: ClientTasksCapabilitySchema.optional()
430
+ });
431
+ const InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
432
+ /**
433
+ * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
434
+ */
435
+ protocolVersion: string(),
436
+ capabilities: ClientCapabilitiesSchema,
437
+ clientInfo: ImplementationSchema
438
+ });
246
439
  /**
247
440
  * This request is sent from the client to the server when it first connects, asking it to begin initialization.
248
441
  */
249
442
  const InitializeRequestSchema = RequestSchema.extend({
250
- method: literalType("initialize"),
251
- params: BaseRequestParamsSchema.extend({
252
- /**
253
- * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
254
- */
255
- protocolVersion: stringType(),
256
- capabilities: ClientCapabilitiesSchema,
257
- clientInfo: ImplementationSchema,
258
- }),
443
+ method: literal('initialize'),
444
+ params: InitializeRequestParamsSchema
259
445
  });
260
446
  /**
261
447
  * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.
262
448
  */
263
- const ServerCapabilitiesSchema = objectType({
449
+ const ServerCapabilitiesSchema = object({
264
450
  /**
265
451
  * Experimental, non-standard capabilities that the server supports.
266
452
  */
267
- experimental: optionalType(objectType({}).passthrough()),
453
+ experimental: record(string(), AssertObjectSchema).optional(),
268
454
  /**
269
455
  * Present if the server supports sending log messages to the client.
270
456
  */
271
- logging: optionalType(objectType({}).passthrough()),
457
+ logging: AssertObjectSchema.optional(),
272
458
  /**
273
459
  * Present if the server supports sending completions to the client.
274
460
  */
275
- completions: optionalType(objectType({}).passthrough()),
461
+ completions: AssertObjectSchema.optional(),
276
462
  /**
277
463
  * Present if the server offers any prompt templates.
278
464
  */
279
- prompts: optionalType(objectType({
465
+ prompts: object({
280
466
  /**
281
467
  * Whether this server supports issuing notifications for changes to the prompt list.
282
468
  */
283
- listChanged: optionalType(booleanType()),
469
+ listChanged: boolean().optional()
284
470
  })
285
- .passthrough()),
471
+ .optional(),
286
472
  /**
287
473
  * Present if the server offers any resources to read.
288
474
  */
289
- resources: optionalType(objectType({
475
+ resources: object({
290
476
  /**
291
477
  * Whether this server supports clients subscribing to resource updates.
292
478
  */
293
- subscribe: optionalType(booleanType()),
479
+ subscribe: boolean().optional(),
294
480
  /**
295
481
  * Whether this server supports issuing notifications for changes to the resource list.
296
482
  */
297
- listChanged: optionalType(booleanType()),
483
+ listChanged: boolean().optional()
298
484
  })
299
- .passthrough()),
485
+ .optional(),
300
486
  /**
301
487
  * Present if the server offers any tools to call.
302
488
  */
303
- tools: optionalType(objectType({
489
+ tools: object({
304
490
  /**
305
491
  * Whether this server supports issuing notifications for changes to the tool list.
306
492
  */
307
- listChanged: optionalType(booleanType()),
493
+ listChanged: boolean().optional()
308
494
  })
309
- .passthrough()),
310
- })
311
- .passthrough();
495
+ .optional(),
496
+ /**
497
+ * Present if the server supports task creation.
498
+ */
499
+ tasks: ServerTasksCapabilitySchema.optional()
500
+ });
312
501
  /**
313
502
  * After receiving an initialize request from the client, the server sends this response.
314
503
  */
@@ -316,7 +505,7 @@ const InitializeResultSchema = ResultSchema.extend({
316
505
  /**
317
506
  * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
318
507
  */
319
- protocolVersion: stringType(),
508
+ protocolVersion: string(),
320
509
  capabilities: ServerCapabilitiesSchema,
321
510
  serverInfo: ImplementationSchema,
322
511
  /**
@@ -324,13 +513,14 @@ const InitializeResultSchema = ResultSchema.extend({
324
513
  *
325
514
  * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
326
515
  */
327
- instructions: optionalType(stringType()),
516
+ instructions: string().optional()
328
517
  });
329
518
  /**
330
519
  * This notification is sent from the client to the server after initialization has finished.
331
520
  */
332
521
  const InitializedNotificationSchema = NotificationSchema.extend({
333
- method: literalType("notifications/initialized"),
522
+ method: literal('notifications/initialized'),
523
+ params: NotificationsParamsSchema.optional()
334
524
  });
335
525
  const isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;
336
526
  /* Ping */
@@ -338,327 +528,470 @@ const isInitializedNotification = (value) => InitializedNotificationSchema.safeP
338
528
  * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
339
529
  */
340
530
  const PingRequestSchema = RequestSchema.extend({
341
- method: literalType("ping"),
531
+ method: literal('ping'),
532
+ params: BaseRequestParamsSchema.optional()
342
533
  });
343
534
  /* Progress notifications */
344
- const ProgressSchema = objectType({
535
+ const ProgressSchema = object({
345
536
  /**
346
537
  * The progress thus far. This should increase every time progress is made, even if the total is unknown.
347
538
  */
348
- progress: numberType(),
539
+ progress: number(),
349
540
  /**
350
541
  * Total number of items to process (or total progress required), if known.
351
542
  */
352
- total: optionalType(numberType()),
543
+ total: optional(number()),
353
544
  /**
354
545
  * An optional message describing the current progress.
355
546
  */
356
- message: optionalType(stringType()),
357
- })
358
- .passthrough();
547
+ message: optional(string())
548
+ });
549
+ const ProgressNotificationParamsSchema = object({
550
+ ...NotificationsParamsSchema.shape,
551
+ ...ProgressSchema.shape,
552
+ /**
553
+ * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
554
+ */
555
+ progressToken: ProgressTokenSchema
556
+ });
359
557
  /**
360
558
  * An out-of-band notification used to inform the receiver of a progress update for a long-running request.
559
+ *
560
+ * @category notifications/progress
361
561
  */
362
562
  const ProgressNotificationSchema = NotificationSchema.extend({
363
- method: literalType("notifications/progress"),
364
- params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({
365
- /**
366
- * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
367
- */
368
- progressToken: ProgressTokenSchema,
369
- }),
563
+ method: literal('notifications/progress'),
564
+ params: ProgressNotificationParamsSchema
565
+ });
566
+ const PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
567
+ /**
568
+ * An opaque token representing the current pagination position.
569
+ * If provided, the server should return results starting after this cursor.
570
+ */
571
+ cursor: CursorSchema.optional()
370
572
  });
371
573
  /* Pagination */
372
574
  const PaginatedRequestSchema = RequestSchema.extend({
373
- params: BaseRequestParamsSchema.extend({
374
- /**
375
- * An opaque token representing the current pagination position.
376
- * If provided, the server should return results starting after this cursor.
377
- */
378
- cursor: optionalType(CursorSchema),
379
- }).optional(),
575
+ params: PaginatedRequestParamsSchema.optional()
380
576
  });
381
577
  const PaginatedResultSchema = ResultSchema.extend({
382
578
  /**
383
579
  * An opaque token representing the pagination position after the last returned result.
384
580
  * If present, there may be more results available.
385
581
  */
386
- nextCursor: optionalType(CursorSchema),
582
+ nextCursor: CursorSchema.optional()
387
583
  });
584
+ /**
585
+ * The status of a task.
586
+ * */
587
+ const TaskStatusSchema = _enum(['working', 'input_required', 'completed', 'failed', 'cancelled']);
588
+ /* Tasks */
589
+ /**
590
+ * A pollable state object associated with a request.
591
+ */
592
+ const TaskSchema = object({
593
+ taskId: string(),
594
+ status: TaskStatusSchema,
595
+ /**
596
+ * Time in milliseconds to keep task results available after completion.
597
+ * If null, the task has unlimited lifetime until manually cleaned up.
598
+ */
599
+ ttl: union([number(), _null()]),
600
+ /**
601
+ * ISO 8601 timestamp when the task was created.
602
+ */
603
+ createdAt: string(),
604
+ /**
605
+ * ISO 8601 timestamp when the task was last updated.
606
+ */
607
+ lastUpdatedAt: string(),
608
+ pollInterval: optional(number()),
609
+ /**
610
+ * Optional diagnostic message for failed tasks or other status information.
611
+ */
612
+ statusMessage: optional(string())
613
+ });
614
+ /**
615
+ * Result returned when a task is created, containing the task data wrapped in a task field.
616
+ */
617
+ const CreateTaskResultSchema = ResultSchema.extend({
618
+ task: TaskSchema
619
+ });
620
+ /**
621
+ * Parameters for task status notification.
622
+ */
623
+ const TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
624
+ /**
625
+ * A notification sent when a task's status changes.
626
+ */
627
+ const TaskStatusNotificationSchema = NotificationSchema.extend({
628
+ method: literal('notifications/tasks/status'),
629
+ params: TaskStatusNotificationParamsSchema
630
+ });
631
+ /**
632
+ * A request to get the state of a specific task.
633
+ */
634
+ const GetTaskRequestSchema = RequestSchema.extend({
635
+ method: literal('tasks/get'),
636
+ params: BaseRequestParamsSchema.extend({
637
+ taskId: string()
638
+ })
639
+ });
640
+ /**
641
+ * The response to a tasks/get request.
642
+ */
643
+ const GetTaskResultSchema = ResultSchema.merge(TaskSchema);
644
+ /**
645
+ * A request to get the result of a specific task.
646
+ */
647
+ const GetTaskPayloadRequestSchema = RequestSchema.extend({
648
+ method: literal('tasks/result'),
649
+ params: BaseRequestParamsSchema.extend({
650
+ taskId: string()
651
+ })
652
+ });
653
+ /**
654
+ * The response to a tasks/result request.
655
+ * The structure matches the result type of the original request.
656
+ * For example, a tools/call task would return the CallToolResult structure.
657
+ *
658
+ */
659
+ ResultSchema.loose();
660
+ /**
661
+ * A request to list tasks.
662
+ */
663
+ const ListTasksRequestSchema = PaginatedRequestSchema.extend({
664
+ method: literal('tasks/list')
665
+ });
666
+ /**
667
+ * The response to a tasks/list request.
668
+ */
669
+ const ListTasksResultSchema = PaginatedResultSchema.extend({
670
+ tasks: array(TaskSchema)
671
+ });
672
+ /**
673
+ * A request to cancel a specific task.
674
+ */
675
+ const CancelTaskRequestSchema = RequestSchema.extend({
676
+ method: literal('tasks/cancel'),
677
+ params: BaseRequestParamsSchema.extend({
678
+ taskId: string()
679
+ })
680
+ });
681
+ /**
682
+ * The response to a tasks/cancel request.
683
+ */
684
+ const CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
388
685
  /* Resources */
389
686
  /**
390
687
  * The contents of a specific resource or sub-resource.
391
688
  */
392
- const ResourceContentsSchema = objectType({
689
+ const ResourceContentsSchema = object({
393
690
  /**
394
691
  * The URI of this resource.
395
692
  */
396
- uri: stringType(),
693
+ uri: string(),
397
694
  /**
398
695
  * The MIME type of this resource, if known.
399
696
  */
400
- mimeType: optionalType(stringType()),
697
+ mimeType: optional(string()),
401
698
  /**
402
699
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
403
700
  * for notes on _meta usage.
404
701
  */
405
- _meta: optionalType(objectType({}).passthrough()),
406
- })
407
- .passthrough();
702
+ _meta: record(string(), unknown()).optional()
703
+ });
408
704
  const TextResourceContentsSchema = ResourceContentsSchema.extend({
409
705
  /**
410
706
  * The text of the item. This must only be set if the item can actually be represented as text (not binary data).
411
707
  */
412
- text: stringType(),
708
+ text: string()
413
709
  });
414
710
  /**
415
711
  * A Zod schema for validating Base64 strings that is more performant and
416
712
  * robust for very large inputs than the default regex-based check. It avoids
417
713
  * stack overflows by using the native `atob` function for validation.
418
714
  */
419
- const Base64Schema = stringType().refine((val) => {
715
+ const Base64Schema = string().refine(val => {
420
716
  try {
421
717
  // atob throws a DOMException if the string contains characters
422
718
  // that are not part of the Base64 character set.
423
719
  atob(val);
424
720
  return true;
425
721
  }
426
- catch (_a) {
722
+ catch {
427
723
  return false;
428
724
  }
429
- }, { message: "Invalid Base64 string" });
725
+ }, { message: 'Invalid Base64 string' });
430
726
  const BlobResourceContentsSchema = ResourceContentsSchema.extend({
431
727
  /**
432
728
  * A base64-encoded string representing the binary data of the item.
433
729
  */
434
- blob: Base64Schema,
730
+ blob: Base64Schema
731
+ });
732
+ /**
733
+ * The sender or recipient of messages and data in a conversation.
734
+ */
735
+ const RoleSchema = _enum(['user', 'assistant']);
736
+ /**
737
+ * Optional annotations providing clients additional context about a resource.
738
+ */
739
+ const AnnotationsSchema = object({
740
+ /**
741
+ * Intended audience(s) for the resource.
742
+ */
743
+ audience: array(RoleSchema).optional(),
744
+ /**
745
+ * Importance hint for the resource, from 0 (least) to 1 (most).
746
+ */
747
+ priority: number().min(0).max(1).optional(),
748
+ /**
749
+ * ISO 8601 timestamp for the most recent modification.
750
+ */
751
+ lastModified: datetime({ offset: true }).optional()
435
752
  });
436
753
  /**
437
754
  * A known resource that the server is capable of reading.
438
755
  */
439
- const ResourceSchema = BaseMetadataSchema.extend({
756
+ const ResourceSchema = object({
757
+ ...BaseMetadataSchema.shape,
758
+ ...IconsSchema.shape,
440
759
  /**
441
760
  * The URI of this resource.
442
761
  */
443
- uri: stringType(),
762
+ uri: string(),
444
763
  /**
445
764
  * A description of what this resource represents.
446
765
  *
447
766
  * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
448
767
  */
449
- description: optionalType(stringType()),
768
+ description: optional(string()),
450
769
  /**
451
770
  * The MIME type of this resource, if known.
452
771
  */
453
- mimeType: optionalType(stringType()),
772
+ mimeType: optional(string()),
454
773
  /**
455
- * An optional list of icons for this resource.
774
+ * Optional annotations for the client.
456
775
  */
457
- icons: optionalType(arrayType(IconSchema)),
776
+ annotations: AnnotationsSchema.optional(),
458
777
  /**
459
778
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
460
779
  * for notes on _meta usage.
461
780
  */
462
- _meta: optionalType(objectType({}).passthrough()),
781
+ _meta: optional(looseObject({}))
463
782
  });
464
783
  /**
465
784
  * A template description for resources available on the server.
466
785
  */
467
- const ResourceTemplateSchema = BaseMetadataSchema.extend({
786
+ const ResourceTemplateSchema = object({
787
+ ...BaseMetadataSchema.shape,
788
+ ...IconsSchema.shape,
468
789
  /**
469
790
  * A URI template (according to RFC 6570) that can be used to construct resource URIs.
470
791
  */
471
- uriTemplate: stringType(),
792
+ uriTemplate: string(),
472
793
  /**
473
794
  * A description of what this template is for.
474
795
  *
475
796
  * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
476
797
  */
477
- description: optionalType(stringType()),
798
+ description: optional(string()),
478
799
  /**
479
800
  * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
480
801
  */
481
- mimeType: optionalType(stringType()),
802
+ mimeType: optional(string()),
803
+ /**
804
+ * Optional annotations for the client.
805
+ */
806
+ annotations: AnnotationsSchema.optional(),
482
807
  /**
483
808
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
484
809
  * for notes on _meta usage.
485
810
  */
486
- _meta: optionalType(objectType({}).passthrough()),
811
+ _meta: optional(looseObject({}))
487
812
  });
488
813
  /**
489
814
  * Sent from the client to request a list of resources the server has.
490
815
  */
491
816
  const ListResourcesRequestSchema = PaginatedRequestSchema.extend({
492
- method: literalType("resources/list"),
817
+ method: literal('resources/list')
493
818
  });
494
819
  /**
495
820
  * The server's response to a resources/list request from the client.
496
821
  */
497
822
  const ListResourcesResultSchema = PaginatedResultSchema.extend({
498
- resources: arrayType(ResourceSchema),
823
+ resources: array(ResourceSchema)
499
824
  });
500
825
  /**
501
826
  * Sent from the client to request a list of resource templates the server has.
502
827
  */
503
828
  const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
504
- method: literalType("resources/templates/list"),
829
+ method: literal('resources/templates/list')
505
830
  });
506
831
  /**
507
832
  * The server's response to a resources/templates/list request from the client.
508
833
  */
509
834
  const ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
510
- resourceTemplates: arrayType(ResourceTemplateSchema),
835
+ resourceTemplates: array(ResourceTemplateSchema)
836
+ });
837
+ const ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
838
+ /**
839
+ * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
840
+ *
841
+ * @format uri
842
+ */
843
+ uri: string()
511
844
  });
845
+ /**
846
+ * Parameters for a `resources/read` request.
847
+ */
848
+ const ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
512
849
  /**
513
850
  * Sent from the client to the server, to read a specific resource URI.
514
851
  */
515
852
  const ReadResourceRequestSchema = RequestSchema.extend({
516
- method: literalType("resources/read"),
517
- params: BaseRequestParamsSchema.extend({
518
- /**
519
- * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
520
- */
521
- uri: stringType(),
522
- }),
853
+ method: literal('resources/read'),
854
+ params: ReadResourceRequestParamsSchema
523
855
  });
524
856
  /**
525
857
  * The server's response to a resources/read request from the client.
526
858
  */
527
859
  const ReadResourceResultSchema = ResultSchema.extend({
528
- contents: arrayType(unionType([TextResourceContentsSchema, BlobResourceContentsSchema])),
860
+ contents: array(union([TextResourceContentsSchema, BlobResourceContentsSchema]))
529
861
  });
530
862
  /**
531
863
  * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
532
864
  */
533
865
  const ResourceListChangedNotificationSchema = NotificationSchema.extend({
534
- method: literalType("notifications/resources/list_changed"),
866
+ method: literal('notifications/resources/list_changed'),
867
+ params: NotificationsParamsSchema.optional()
535
868
  });
869
+ const SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
536
870
  /**
537
871
  * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
538
872
  */
539
873
  const SubscribeRequestSchema = RequestSchema.extend({
540
- method: literalType("resources/subscribe"),
541
- params: BaseRequestParamsSchema.extend({
542
- /**
543
- * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
544
- */
545
- uri: stringType(),
546
- }),
874
+ method: literal('resources/subscribe'),
875
+ params: SubscribeRequestParamsSchema
547
876
  });
877
+ const UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
548
878
  /**
549
879
  * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
550
880
  */
551
881
  const UnsubscribeRequestSchema = RequestSchema.extend({
552
- method: literalType("resources/unsubscribe"),
553
- params: BaseRequestParamsSchema.extend({
554
- /**
555
- * The URI of the resource to unsubscribe from.
556
- */
557
- uri: stringType(),
558
- }),
882
+ method: literal('resources/unsubscribe'),
883
+ params: UnsubscribeRequestParamsSchema
884
+ });
885
+ /**
886
+ * Parameters for a `notifications/resources/updated` notification.
887
+ */
888
+ const ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
889
+ /**
890
+ * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
891
+ */
892
+ uri: string()
559
893
  });
560
894
  /**
561
895
  * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
562
896
  */
563
897
  const ResourceUpdatedNotificationSchema = NotificationSchema.extend({
564
- method: literalType("notifications/resources/updated"),
565
- params: BaseNotificationParamsSchema.extend({
566
- /**
567
- * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
568
- */
569
- uri: stringType(),
570
- }),
898
+ method: literal('notifications/resources/updated'),
899
+ params: ResourceUpdatedNotificationParamsSchema
571
900
  });
572
901
  /* Prompts */
573
902
  /**
574
903
  * Describes an argument that a prompt can accept.
575
904
  */
576
- const PromptArgumentSchema = objectType({
905
+ const PromptArgumentSchema = object({
577
906
  /**
578
907
  * The name of the argument.
579
908
  */
580
- name: stringType(),
909
+ name: string(),
581
910
  /**
582
911
  * A human-readable description of the argument.
583
912
  */
584
- description: optionalType(stringType()),
913
+ description: optional(string()),
585
914
  /**
586
915
  * Whether this argument must be provided.
587
916
  */
588
- required: optionalType(booleanType()),
589
- })
590
- .passthrough();
917
+ required: optional(boolean())
918
+ });
591
919
  /**
592
920
  * A prompt or prompt template that the server offers.
593
921
  */
594
- const PromptSchema = BaseMetadataSchema.extend({
922
+ const PromptSchema = object({
923
+ ...BaseMetadataSchema.shape,
924
+ ...IconsSchema.shape,
595
925
  /**
596
926
  * An optional description of what this prompt provides
597
927
  */
598
- description: optionalType(stringType()),
928
+ description: optional(string()),
599
929
  /**
600
930
  * A list of arguments to use for templating the prompt.
601
931
  */
602
- arguments: optionalType(arrayType(PromptArgumentSchema)),
603
- /**
604
- * An optional list of icons for this prompt.
605
- */
606
- icons: optionalType(arrayType(IconSchema)),
932
+ arguments: optional(array(PromptArgumentSchema)),
607
933
  /**
608
934
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
609
935
  * for notes on _meta usage.
610
936
  */
611
- _meta: optionalType(objectType({}).passthrough()),
937
+ _meta: optional(looseObject({}))
612
938
  });
613
939
  /**
614
940
  * Sent from the client to request a list of prompts and prompt templates the server has.
615
941
  */
616
942
  const ListPromptsRequestSchema = PaginatedRequestSchema.extend({
617
- method: literalType("prompts/list"),
943
+ method: literal('prompts/list')
618
944
  });
619
945
  /**
620
946
  * The server's response to a prompts/list request from the client.
621
947
  */
622
948
  const ListPromptsResultSchema = PaginatedResultSchema.extend({
623
- prompts: arrayType(PromptSchema),
949
+ prompts: array(PromptSchema)
950
+ });
951
+ /**
952
+ * Parameters for a `prompts/get` request.
953
+ */
954
+ const GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
955
+ /**
956
+ * The name of the prompt or prompt template.
957
+ */
958
+ name: string(),
959
+ /**
960
+ * Arguments to use for templating the prompt.
961
+ */
962
+ arguments: record(string(), string()).optional()
624
963
  });
625
964
  /**
626
965
  * Used by the client to get a prompt provided by the server.
627
966
  */
628
967
  const GetPromptRequestSchema = RequestSchema.extend({
629
- method: literalType("prompts/get"),
630
- params: BaseRequestParamsSchema.extend({
631
- /**
632
- * The name of the prompt or prompt template.
633
- */
634
- name: stringType(),
635
- /**
636
- * Arguments to use for templating the prompt.
637
- */
638
- arguments: optionalType(recordType(stringType())),
639
- }),
968
+ method: literal('prompts/get'),
969
+ params: GetPromptRequestParamsSchema
640
970
  });
641
971
  /**
642
972
  * Text provided to or from an LLM.
643
973
  */
644
- const TextContentSchema = objectType({
645
- type: literalType("text"),
974
+ const TextContentSchema = object({
975
+ type: literal('text'),
646
976
  /**
647
977
  * The text content of the message.
648
978
  */
649
- text: stringType(),
979
+ text: string(),
980
+ /**
981
+ * Optional annotations for the client.
982
+ */
983
+ annotations: AnnotationsSchema.optional(),
650
984
  /**
651
985
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
652
986
  * for notes on _meta usage.
653
987
  */
654
- _meta: optionalType(objectType({}).passthrough()),
655
- })
656
- .passthrough();
988
+ _meta: record(string(), unknown()).optional()
989
+ });
657
990
  /**
658
991
  * An image provided to or from an LLM.
659
992
  */
660
- const ImageContentSchema = objectType({
661
- type: literalType("image"),
993
+ const ImageContentSchema = object({
994
+ type: literal('image'),
662
995
  /**
663
996
  * The base64-encoded image data.
664
997
  */
@@ -666,19 +999,22 @@ const ImageContentSchema = objectType({
666
999
  /**
667
1000
  * The MIME type of the image. Different providers may support different image types.
668
1001
  */
669
- mimeType: stringType(),
1002
+ mimeType: string(),
1003
+ /**
1004
+ * Optional annotations for the client.
1005
+ */
1006
+ annotations: AnnotationsSchema.optional(),
670
1007
  /**
671
1008
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
672
1009
  * for notes on _meta usage.
673
1010
  */
674
- _meta: optionalType(objectType({}).passthrough()),
675
- })
676
- .passthrough();
1011
+ _meta: record(string(), unknown()).optional()
1012
+ });
677
1013
  /**
678
1014
  * An Audio provided to or from an LLM.
679
1015
  */
680
- const AudioContentSchema = objectType({
681
- type: literalType("audio"),
1016
+ const AudioContentSchema = object({
1017
+ type: literal('audio'),
682
1018
  /**
683
1019
  * The base64-encoded audio data.
684
1020
  */
@@ -686,53 +1022,85 @@ const AudioContentSchema = objectType({
686
1022
  /**
687
1023
  * The MIME type of the audio. Different providers may support different audio types.
688
1024
  */
689
- mimeType: stringType(),
1025
+ mimeType: string(),
1026
+ /**
1027
+ * Optional annotations for the client.
1028
+ */
1029
+ annotations: AnnotationsSchema.optional(),
690
1030
  /**
691
1031
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
692
1032
  * for notes on _meta usage.
693
1033
  */
694
- _meta: optionalType(objectType({}).passthrough()),
695
- })
696
- .passthrough();
1034
+ _meta: record(string(), unknown()).optional()
1035
+ });
1036
+ /**
1037
+ * A tool call request from an assistant (LLM).
1038
+ * Represents the assistant's request to use a tool.
1039
+ */
1040
+ const ToolUseContentSchema = object({
1041
+ type: literal('tool_use'),
1042
+ /**
1043
+ * The name of the tool to invoke.
1044
+ * Must match a tool name from the request's tools array.
1045
+ */
1046
+ name: string(),
1047
+ /**
1048
+ * Unique identifier for this tool call.
1049
+ * Used to correlate with ToolResultContent in subsequent messages.
1050
+ */
1051
+ id: string(),
1052
+ /**
1053
+ * Arguments to pass to the tool.
1054
+ * Must conform to the tool's inputSchema.
1055
+ */
1056
+ input: record(string(), unknown()),
1057
+ /**
1058
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
1059
+ * for notes on _meta usage.
1060
+ */
1061
+ _meta: record(string(), unknown()).optional()
1062
+ });
697
1063
  /**
698
1064
  * The contents of a resource, embedded into a prompt or tool call result.
699
1065
  */
700
- const EmbeddedResourceSchema = objectType({
701
- type: literalType("resource"),
702
- resource: unionType([TextResourceContentsSchema, BlobResourceContentsSchema]),
1066
+ const EmbeddedResourceSchema = object({
1067
+ type: literal('resource'),
1068
+ resource: union([TextResourceContentsSchema, BlobResourceContentsSchema]),
1069
+ /**
1070
+ * Optional annotations for the client.
1071
+ */
1072
+ annotations: AnnotationsSchema.optional(),
703
1073
  /**
704
1074
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
705
1075
  * for notes on _meta usage.
706
1076
  */
707
- _meta: optionalType(objectType({}).passthrough()),
708
- })
709
- .passthrough();
1077
+ _meta: record(string(), unknown()).optional()
1078
+ });
710
1079
  /**
711
1080
  * A resource that the server is capable of reading, included in a prompt or tool call result.
712
1081
  *
713
1082
  * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests.
714
1083
  */
715
1084
  const ResourceLinkSchema = ResourceSchema.extend({
716
- type: literalType("resource_link"),
1085
+ type: literal('resource_link')
717
1086
  });
718
1087
  /**
719
1088
  * A content block that can be used in prompts and tool results.
720
1089
  */
721
- const ContentBlockSchema = unionType([
1090
+ const ContentBlockSchema = union([
722
1091
  TextContentSchema,
723
1092
  ImageContentSchema,
724
1093
  AudioContentSchema,
725
1094
  ResourceLinkSchema,
726
- EmbeddedResourceSchema,
1095
+ EmbeddedResourceSchema
727
1096
  ]);
728
1097
  /**
729
1098
  * Describes a message returned as part of a prompt.
730
1099
  */
731
- const PromptMessageSchema = objectType({
732
- role: enumType(["user", "assistant"]),
733
- content: ContentBlockSchema,
734
- })
735
- .passthrough();
1100
+ const PromptMessageSchema = object({
1101
+ role: RoleSchema,
1102
+ content: ContentBlockSchema
1103
+ });
736
1104
  /**
737
1105
  * The server's response to a prompts/get request from the client.
738
1106
  */
@@ -740,14 +1108,15 @@ const GetPromptResultSchema = ResultSchema.extend({
740
1108
  /**
741
1109
  * An optional description for the prompt.
742
1110
  */
743
- description: optionalType(stringType()),
744
- messages: arrayType(PromptMessageSchema),
1111
+ description: string().optional(),
1112
+ messages: array(PromptMessageSchema)
745
1113
  });
746
1114
  /**
747
1115
  * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
748
1116
  */
749
1117
  const PromptListChangedNotificationSchema = NotificationSchema.extend({
750
- method: literalType("notifications/prompts/list_changed"),
1118
+ method: literal('notifications/prompts/list_changed'),
1119
+ params: NotificationsParamsSchema.optional()
751
1120
  });
752
1121
  /* Tools */
753
1122
  /**
@@ -760,17 +1129,17 @@ const PromptListChangedNotificationSchema = NotificationSchema.extend({
760
1129
  * Clients should never make tool use decisions based on ToolAnnotations
761
1130
  * received from untrusted servers.
762
1131
  */
763
- const ToolAnnotationsSchema = objectType({
1132
+ const ToolAnnotationsSchema = object({
764
1133
  /**
765
1134
  * A human-readable title for the tool.
766
1135
  */
767
- title: optionalType(stringType()),
1136
+ title: string().optional(),
768
1137
  /**
769
1138
  * If true, the tool does not modify its environment.
770
1139
  *
771
1140
  * Default: false
772
1141
  */
773
- readOnlyHint: optionalType(booleanType()),
1142
+ readOnlyHint: boolean().optional(),
774
1143
  /**
775
1144
  * If true, the tool may perform destructive updates to its environment.
776
1145
  * If false, the tool performs only additive updates.
@@ -779,7 +1148,7 @@ const ToolAnnotationsSchema = objectType({
779
1148
  *
780
1149
  * Default: true
781
1150
  */
782
- destructiveHint: optionalType(booleanType()),
1151
+ destructiveHint: boolean().optional(),
783
1152
  /**
784
1153
  * If true, calling the tool repeatedly with the same arguments
785
1154
  * will have no additional effect on the its environment.
@@ -788,7 +1157,7 @@ const ToolAnnotationsSchema = objectType({
788
1157
  *
789
1158
  * Default: false
790
1159
  */
791
- idempotentHint: optionalType(booleanType()),
1160
+ idempotentHint: boolean().optional(),
792
1161
  /**
793
1162
  * If true, this tool may interact with an "open world" of external
794
1163
  * entities. If false, the tool's domain of interaction is closed.
@@ -797,61 +1166,79 @@ const ToolAnnotationsSchema = objectType({
797
1166
  *
798
1167
  * Default: true
799
1168
  */
800
- openWorldHint: optionalType(booleanType()),
801
- })
802
- .passthrough();
1169
+ openWorldHint: boolean().optional()
1170
+ });
1171
+ /**
1172
+ * Execution-related properties for a tool.
1173
+ */
1174
+ const ToolExecutionSchema = object({
1175
+ /**
1176
+ * Indicates the tool's preference for task-augmented execution.
1177
+ * - "required": Clients MUST invoke the tool as a task
1178
+ * - "optional": Clients MAY invoke the tool as a task or normal request
1179
+ * - "forbidden": Clients MUST NOT attempt to invoke the tool as a task
1180
+ *
1181
+ * If not present, defaults to "forbidden".
1182
+ */
1183
+ taskSupport: _enum(['required', 'optional', 'forbidden']).optional()
1184
+ });
803
1185
  /**
804
1186
  * Definition for a tool the client can call.
805
1187
  */
806
- const ToolSchema = BaseMetadataSchema.extend({
1188
+ const ToolSchema = object({
1189
+ ...BaseMetadataSchema.shape,
1190
+ ...IconsSchema.shape,
807
1191
  /**
808
1192
  * A human-readable description of the tool.
809
1193
  */
810
- description: optionalType(stringType()),
1194
+ description: string().optional(),
811
1195
  /**
812
- * A JSON Schema object defining the expected parameters for the tool.
1196
+ * A JSON Schema 2020-12 object defining the expected parameters for the tool.
1197
+ * Must have type: 'object' at the root level per MCP spec.
813
1198
  */
814
- inputSchema: objectType({
815
- type: literalType("object"),
816
- properties: optionalType(objectType({}).passthrough()),
817
- required: optionalType(arrayType(stringType())),
1199
+ inputSchema: object({
1200
+ type: literal('object'),
1201
+ properties: record(string(), AssertObjectSchema).optional(),
1202
+ required: array(string()).optional()
818
1203
  })
819
- .passthrough(),
1204
+ .catchall(unknown()),
820
1205
  /**
821
- * An optional JSON Schema object defining the structure of the tool's output returned in
822
- * the structuredContent field of a CallToolResult.
1206
+ * An optional JSON Schema 2020-12 object defining the structure of the tool's output
1207
+ * returned in the structuredContent field of a CallToolResult.
1208
+ * Must have type: 'object' at the root level per MCP spec.
823
1209
  */
824
- outputSchema: optionalType(objectType({
825
- type: literalType("object"),
826
- properties: optionalType(objectType({}).passthrough()),
827
- required: optionalType(arrayType(stringType())),
1210
+ outputSchema: object({
1211
+ type: literal('object'),
1212
+ properties: record(string(), AssertObjectSchema).optional(),
1213
+ required: array(string()).optional()
828
1214
  })
829
- .passthrough()),
1215
+ .catchall(unknown())
1216
+ .optional(),
830
1217
  /**
831
1218
  * Optional additional tool information.
832
1219
  */
833
- annotations: optionalType(ToolAnnotationsSchema),
1220
+ annotations: ToolAnnotationsSchema.optional(),
834
1221
  /**
835
- * An optional list of icons for this tool.
1222
+ * Execution-related properties for this tool.
836
1223
  */
837
- icons: optionalType(arrayType(IconSchema)),
1224
+ execution: ToolExecutionSchema.optional(),
838
1225
  /**
839
1226
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
840
1227
  * for notes on _meta usage.
841
1228
  */
842
- _meta: optionalType(objectType({}).passthrough()),
1229
+ _meta: record(string(), unknown()).optional()
843
1230
  });
844
1231
  /**
845
1232
  * Sent from the client to request a list of tools the server has.
846
1233
  */
847
1234
  const ListToolsRequestSchema = PaginatedRequestSchema.extend({
848
- method: literalType("tools/list"),
1235
+ method: literal('tools/list')
849
1236
  });
850
1237
  /**
851
1238
  * The server's response to a tools/list request from the client.
852
1239
  */
853
1240
  const ListToolsResultSchema = PaginatedResultSchema.extend({
854
- tools: arrayType(ToolSchema),
1241
+ tools: array(ToolSchema)
855
1242
  });
856
1243
  /**
857
1244
  * The server's response to a tool call.
@@ -863,13 +1250,13 @@ const CallToolResultSchema = ResultSchema.extend({
863
1250
  * If the Tool does not define an outputSchema, this field MUST be present in the result.
864
1251
  * For backwards compatibility, this field is always present, but it may be empty.
865
1252
  */
866
- content: arrayType(ContentBlockSchema).default([]),
1253
+ content: array(ContentBlockSchema).default([]),
867
1254
  /**
868
1255
  * An object containing structured tool output.
869
1256
  *
870
1257
  * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
871
1258
  */
872
- structuredContent: objectType({}).passthrough().optional(),
1259
+ structuredContent: record(string(), unknown()).optional(),
873
1260
  /**
874
1261
  * Whether the tool call ended in an error.
875
1262
  *
@@ -884,368 +1271,629 @@ const CallToolResultSchema = ResultSchema.extend({
884
1271
  * server does not support tool calls, or any other exceptional conditions,
885
1272
  * should be reported as an MCP error response.
886
1273
  */
887
- isError: optionalType(booleanType()),
1274
+ isError: boolean().optional()
888
1275
  });
889
1276
  /**
890
1277
  * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07.
891
1278
  */
892
1279
  CallToolResultSchema.or(ResultSchema.extend({
893
- toolResult: unknownType(),
1280
+ toolResult: unknown()
894
1281
  }));
1282
+ /**
1283
+ * Parameters for a `tools/call` request.
1284
+ */
1285
+ const CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
1286
+ /**
1287
+ * The name of the tool to call.
1288
+ */
1289
+ name: string(),
1290
+ /**
1291
+ * Arguments to pass to the tool.
1292
+ */
1293
+ arguments: record(string(), unknown()).optional()
1294
+ });
895
1295
  /**
896
1296
  * Used by the client to invoke a tool provided by the server.
897
1297
  */
898
1298
  const CallToolRequestSchema = RequestSchema.extend({
899
- method: literalType("tools/call"),
900
- params: BaseRequestParamsSchema.extend({
901
- name: stringType(),
902
- arguments: optionalType(recordType(unknownType())),
903
- }),
1299
+ method: literal('tools/call'),
1300
+ params: CallToolRequestParamsSchema
904
1301
  });
905
1302
  /**
906
1303
  * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
907
1304
  */
908
1305
  const ToolListChangedNotificationSchema = NotificationSchema.extend({
909
- method: literalType("notifications/tools/list_changed"),
1306
+ method: literal('notifications/tools/list_changed'),
1307
+ params: NotificationsParamsSchema.optional()
1308
+ });
1309
+ /**
1310
+ * Base schema for list changed subscription options (without callback).
1311
+ * Used internally for Zod validation of autoRefresh and debounceMs.
1312
+ */
1313
+ const ListChangedOptionsBaseSchema = object({
1314
+ /**
1315
+ * If true, the list will be refreshed automatically when a list changed notification is received.
1316
+ * The callback will be called with the updated list.
1317
+ *
1318
+ * If false, the callback will be called with null items, allowing manual refresh.
1319
+ *
1320
+ * @default true
1321
+ */
1322
+ autoRefresh: boolean().default(true),
1323
+ /**
1324
+ * Debounce time in milliseconds for list changed notification processing.
1325
+ *
1326
+ * Multiple notifications received within this timeframe will only trigger one refresh.
1327
+ * Set to 0 to disable debouncing.
1328
+ *
1329
+ * @default 300
1330
+ */
1331
+ debounceMs: number().int().nonnegative().default(300)
910
1332
  });
911
1333
  /* Logging */
912
1334
  /**
913
1335
  * The severity of a log message.
914
1336
  */
915
- const LoggingLevelSchema = enumType([
916
- "debug",
917
- "info",
918
- "notice",
919
- "warning",
920
- "error",
921
- "critical",
922
- "alert",
923
- "emergency",
924
- ]);
1337
+ const LoggingLevelSchema = _enum(['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency']);
1338
+ /**
1339
+ * Parameters for a `logging/setLevel` request.
1340
+ */
1341
+ const SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
1342
+ /**
1343
+ * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
1344
+ */
1345
+ level: LoggingLevelSchema
1346
+ });
925
1347
  /**
926
1348
  * A request from the client to the server, to enable or adjust logging.
927
1349
  */
928
1350
  const SetLevelRequestSchema = RequestSchema.extend({
929
- method: literalType("logging/setLevel"),
930
- params: BaseRequestParamsSchema.extend({
931
- /**
932
- * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
933
- */
934
- level: LoggingLevelSchema,
935
- }),
1351
+ method: literal('logging/setLevel'),
1352
+ params: SetLevelRequestParamsSchema
1353
+ });
1354
+ /**
1355
+ * Parameters for a `notifications/message` notification.
1356
+ */
1357
+ const LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
1358
+ /**
1359
+ * The severity of this log message.
1360
+ */
1361
+ level: LoggingLevelSchema,
1362
+ /**
1363
+ * An optional name of the logger issuing this message.
1364
+ */
1365
+ logger: string().optional(),
1366
+ /**
1367
+ * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
1368
+ */
1369
+ data: unknown()
936
1370
  });
937
1371
  /**
938
1372
  * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
939
1373
  */
940
1374
  const LoggingMessageNotificationSchema = NotificationSchema.extend({
941
- method: literalType("notifications/message"),
942
- params: BaseNotificationParamsSchema.extend({
943
- /**
944
- * The severity of this log message.
945
- */
946
- level: LoggingLevelSchema,
947
- /**
948
- * An optional name of the logger issuing this message.
949
- */
950
- logger: optionalType(stringType()),
951
- /**
952
- * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
953
- */
954
- data: unknownType(),
955
- }),
1375
+ method: literal('notifications/message'),
1376
+ params: LoggingMessageNotificationParamsSchema
956
1377
  });
957
1378
  /* Sampling */
958
1379
  /**
959
1380
  * Hints to use for model selection.
960
1381
  */
961
- const ModelHintSchema = objectType({
1382
+ const ModelHintSchema = object({
962
1383
  /**
963
1384
  * A hint for a model name.
964
1385
  */
965
- name: stringType().optional(),
966
- })
967
- .passthrough();
1386
+ name: string().optional()
1387
+ });
968
1388
  /**
969
1389
  * The server's preferences for model selection, requested of the client during sampling.
970
1390
  */
971
- const ModelPreferencesSchema = objectType({
1391
+ const ModelPreferencesSchema = object({
972
1392
  /**
973
1393
  * Optional hints to use for model selection.
974
1394
  */
975
- hints: optionalType(arrayType(ModelHintSchema)),
1395
+ hints: array(ModelHintSchema).optional(),
976
1396
  /**
977
1397
  * How much to prioritize cost when selecting a model.
978
1398
  */
979
- costPriority: optionalType(numberType().min(0).max(1)),
1399
+ costPriority: number().min(0).max(1).optional(),
980
1400
  /**
981
1401
  * How much to prioritize sampling speed (latency) when selecting a model.
982
1402
  */
983
- speedPriority: optionalType(numberType().min(0).max(1)),
1403
+ speedPriority: number().min(0).max(1).optional(),
984
1404
  /**
985
1405
  * How much to prioritize intelligence and capabilities when selecting a model.
986
1406
  */
987
- intelligencePriority: optionalType(numberType().min(0).max(1)),
988
- })
989
- .passthrough();
1407
+ intelligencePriority: number().min(0).max(1).optional()
1408
+ });
1409
+ /**
1410
+ * Controls tool usage behavior in sampling requests.
1411
+ */
1412
+ const ToolChoiceSchema = object({
1413
+ /**
1414
+ * Controls when tools are used:
1415
+ * - "auto": Model decides whether to use tools (default)
1416
+ * - "required": Model MUST use at least one tool before completing
1417
+ * - "none": Model MUST NOT use any tools
1418
+ */
1419
+ mode: _enum(['auto', 'required', 'none']).optional()
1420
+ });
1421
+ /**
1422
+ * The result of a tool execution, provided by the user (server).
1423
+ * Represents the outcome of invoking a tool requested via ToolUseContent.
1424
+ */
1425
+ const ToolResultContentSchema = object({
1426
+ type: literal('tool_result'),
1427
+ toolUseId: string().describe('The unique identifier for the corresponding tool call.'),
1428
+ content: array(ContentBlockSchema).default([]),
1429
+ structuredContent: object({}).loose().optional(),
1430
+ isError: boolean().optional(),
1431
+ /**
1432
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
1433
+ * for notes on _meta usage.
1434
+ */
1435
+ _meta: record(string(), unknown()).optional()
1436
+ });
1437
+ /**
1438
+ * Basic content types for sampling responses (without tool use).
1439
+ * Used for backwards-compatible CreateMessageResult when tools are not used.
1440
+ */
1441
+ const SamplingContentSchema = discriminatedUnion('type', [TextContentSchema, ImageContentSchema, AudioContentSchema]);
1442
+ /**
1443
+ * Content block types allowed in sampling messages.
1444
+ * This includes text, image, audio, tool use requests, and tool results.
1445
+ */
1446
+ const SamplingMessageContentBlockSchema = discriminatedUnion('type', [
1447
+ TextContentSchema,
1448
+ ImageContentSchema,
1449
+ AudioContentSchema,
1450
+ ToolUseContentSchema,
1451
+ ToolResultContentSchema
1452
+ ]);
990
1453
  /**
991
1454
  * Describes a message issued to or received from an LLM API.
992
1455
  */
993
- const SamplingMessageSchema = objectType({
994
- role: enumType(["user", "assistant"]),
995
- content: unionType([TextContentSchema, ImageContentSchema, AudioContentSchema]),
996
- })
997
- .passthrough();
1456
+ const SamplingMessageSchema = object({
1457
+ role: RoleSchema,
1458
+ content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)]),
1459
+ /**
1460
+ * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
1461
+ * for notes on _meta usage.
1462
+ */
1463
+ _meta: record(string(), unknown()).optional()
1464
+ });
1465
+ /**
1466
+ * Parameters for a `sampling/createMessage` request.
1467
+ */
1468
+ const CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
1469
+ messages: array(SamplingMessageSchema),
1470
+ /**
1471
+ * The server's preferences for which model to select. The client MAY modify or omit this request.
1472
+ */
1473
+ modelPreferences: ModelPreferencesSchema.optional(),
1474
+ /**
1475
+ * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
1476
+ */
1477
+ systemPrompt: string().optional(),
1478
+ /**
1479
+ * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
1480
+ * The client MAY ignore this request.
1481
+ *
1482
+ * Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
1483
+ * declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
1484
+ */
1485
+ includeContext: _enum(['none', 'thisServer', 'allServers']).optional(),
1486
+ temperature: number().optional(),
1487
+ /**
1488
+ * The requested maximum number of tokens to sample (to prevent runaway completions).
1489
+ *
1490
+ * The client MAY choose to sample fewer tokens than the requested maximum.
1491
+ */
1492
+ maxTokens: number().int(),
1493
+ stopSequences: array(string()).optional(),
1494
+ /**
1495
+ * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
1496
+ */
1497
+ metadata: AssertObjectSchema.optional(),
1498
+ /**
1499
+ * Tools that the model may use during generation.
1500
+ * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
1501
+ */
1502
+ tools: array(ToolSchema).optional(),
1503
+ /**
1504
+ * Controls how the model uses tools.
1505
+ * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
1506
+ * Default is `{ mode: "auto" }`.
1507
+ */
1508
+ toolChoice: ToolChoiceSchema.optional()
1509
+ });
998
1510
  /**
999
1511
  * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
1000
1512
  */
1001
1513
  const CreateMessageRequestSchema = RequestSchema.extend({
1002
- method: literalType("sampling/createMessage"),
1003
- params: BaseRequestParamsSchema.extend({
1004
- messages: arrayType(SamplingMessageSchema),
1005
- /**
1006
- * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
1007
- */
1008
- systemPrompt: optionalType(stringType()),
1009
- /**
1010
- * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
1011
- */
1012
- includeContext: optionalType(enumType(["none", "thisServer", "allServers"])),
1013
- temperature: optionalType(numberType()),
1014
- /**
1015
- * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.
1016
- */
1017
- maxTokens: numberType().int(),
1018
- stopSequences: optionalType(arrayType(stringType())),
1019
- /**
1020
- * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
1021
- */
1022
- metadata: optionalType(objectType({}).passthrough()),
1023
- /**
1024
- * The server's preferences for which model to select.
1025
- */
1026
- modelPreferences: optionalType(ModelPreferencesSchema),
1027
- }),
1514
+ method: literal('sampling/createMessage'),
1515
+ params: CreateMessageRequestParamsSchema
1028
1516
  });
1029
1517
  /**
1030
- * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.
1518
+ * The client's response to a sampling/create_message request from the server.
1519
+ * This is the backwards-compatible version that returns single content (no arrays).
1520
+ * Used when the request does not include tools.
1031
1521
  */
1032
1522
  const CreateMessageResultSchema = ResultSchema.extend({
1033
1523
  /**
1034
1524
  * The name of the model that generated the message.
1035
1525
  */
1036
- model: stringType(),
1526
+ model: string(),
1527
+ /**
1528
+ * The reason why sampling stopped, if known.
1529
+ *
1530
+ * Standard values:
1531
+ * - "endTurn": Natural end of the assistant's turn
1532
+ * - "stopSequence": A stop sequence was encountered
1533
+ * - "maxTokens": Maximum token limit was reached
1534
+ *
1535
+ * This field is an open string to allow for provider-specific stop reasons.
1536
+ */
1537
+ stopReason: optional(_enum(['endTurn', 'stopSequence', 'maxTokens']).or(string())),
1538
+ role: RoleSchema,
1539
+ /**
1540
+ * Response content. Single content block (text, image, or audio).
1541
+ */
1542
+ content: SamplingContentSchema
1543
+ });
1544
+ /**
1545
+ * The client's response to a sampling/create_message request when tools were provided.
1546
+ * This version supports array content for tool use flows.
1547
+ */
1548
+ const CreateMessageResultWithToolsSchema = ResultSchema.extend({
1549
+ /**
1550
+ * The name of the model that generated the message.
1551
+ */
1552
+ model: string(),
1553
+ /**
1554
+ * The reason why sampling stopped, if known.
1555
+ *
1556
+ * Standard values:
1557
+ * - "endTurn": Natural end of the assistant's turn
1558
+ * - "stopSequence": A stop sequence was encountered
1559
+ * - "maxTokens": Maximum token limit was reached
1560
+ * - "toolUse": The model wants to use one or more tools
1561
+ *
1562
+ * This field is an open string to allow for provider-specific stop reasons.
1563
+ */
1564
+ stopReason: optional(_enum(['endTurn', 'stopSequence', 'maxTokens', 'toolUse']).or(string())),
1565
+ role: RoleSchema,
1037
1566
  /**
1038
- * The reason why sampling stopped.
1567
+ * Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
1039
1568
  */
1040
- stopReason: optionalType(enumType(["endTurn", "stopSequence", "maxTokens"]).or(stringType())),
1041
- role: enumType(["user", "assistant"]),
1042
- content: discriminatedUnionType("type", [
1043
- TextContentSchema,
1044
- ImageContentSchema,
1045
- AudioContentSchema
1046
- ]),
1569
+ content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)])
1047
1570
  });
1048
1571
  /* Elicitation */
1049
1572
  /**
1050
1573
  * Primitive schema definition for boolean fields.
1051
1574
  */
1052
- const BooleanSchemaSchema = objectType({
1053
- type: literalType("boolean"),
1054
- title: optionalType(stringType()),
1055
- description: optionalType(stringType()),
1056
- default: optionalType(booleanType()),
1057
- })
1058
- .passthrough();
1575
+ const BooleanSchemaSchema = object({
1576
+ type: literal('boolean'),
1577
+ title: string().optional(),
1578
+ description: string().optional(),
1579
+ default: boolean().optional()
1580
+ });
1059
1581
  /**
1060
1582
  * Primitive schema definition for string fields.
1061
1583
  */
1062
- const StringSchemaSchema = objectType({
1063
- type: literalType("string"),
1064
- title: optionalType(stringType()),
1065
- description: optionalType(stringType()),
1066
- minLength: optionalType(numberType()),
1067
- maxLength: optionalType(numberType()),
1068
- format: optionalType(enumType(["email", "uri", "date", "date-time"])),
1069
- })
1070
- .passthrough();
1584
+ const StringSchemaSchema = object({
1585
+ type: literal('string'),
1586
+ title: string().optional(),
1587
+ description: string().optional(),
1588
+ minLength: number().optional(),
1589
+ maxLength: number().optional(),
1590
+ format: _enum(['email', 'uri', 'date', 'date-time']).optional(),
1591
+ default: string().optional()
1592
+ });
1071
1593
  /**
1072
1594
  * Primitive schema definition for number fields.
1073
1595
  */
1074
- const NumberSchemaSchema = objectType({
1075
- type: enumType(["number", "integer"]),
1076
- title: optionalType(stringType()),
1077
- description: optionalType(stringType()),
1078
- minimum: optionalType(numberType()),
1079
- maximum: optionalType(numberType()),
1080
- })
1081
- .passthrough();
1596
+ const NumberSchemaSchema = object({
1597
+ type: _enum(['number', 'integer']),
1598
+ title: string().optional(),
1599
+ description: string().optional(),
1600
+ minimum: number().optional(),
1601
+ maximum: number().optional(),
1602
+ default: number().optional()
1603
+ });
1604
+ /**
1605
+ * Schema for single-selection enumeration without display titles for options.
1606
+ */
1607
+ const UntitledSingleSelectEnumSchemaSchema = object({
1608
+ type: literal('string'),
1609
+ title: string().optional(),
1610
+ description: string().optional(),
1611
+ enum: array(string()),
1612
+ default: string().optional()
1613
+ });
1614
+ /**
1615
+ * Schema for single-selection enumeration with display titles for each option.
1616
+ */
1617
+ const TitledSingleSelectEnumSchemaSchema = object({
1618
+ type: literal('string'),
1619
+ title: string().optional(),
1620
+ description: string().optional(),
1621
+ oneOf: array(object({
1622
+ const: string(),
1623
+ title: string()
1624
+ })),
1625
+ default: string().optional()
1626
+ });
1627
+ /**
1628
+ * Use TitledSingleSelectEnumSchema instead.
1629
+ * This interface will be removed in a future version.
1630
+ */
1631
+ const LegacyTitledEnumSchemaSchema = object({
1632
+ type: literal('string'),
1633
+ title: string().optional(),
1634
+ description: string().optional(),
1635
+ enum: array(string()),
1636
+ enumNames: array(string()).optional(),
1637
+ default: string().optional()
1638
+ });
1639
+ // Combined single selection enumeration
1640
+ const SingleSelectEnumSchemaSchema = union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
1641
+ /**
1642
+ * Schema for multiple-selection enumeration without display titles for options.
1643
+ */
1644
+ const UntitledMultiSelectEnumSchemaSchema = object({
1645
+ type: literal('array'),
1646
+ title: string().optional(),
1647
+ description: string().optional(),
1648
+ minItems: number().optional(),
1649
+ maxItems: number().optional(),
1650
+ items: object({
1651
+ type: literal('string'),
1652
+ enum: array(string())
1653
+ }),
1654
+ default: array(string()).optional()
1655
+ });
1656
+ /**
1657
+ * Schema for multiple-selection enumeration with display titles for each option.
1658
+ */
1659
+ const TitledMultiSelectEnumSchemaSchema = object({
1660
+ type: literal('array'),
1661
+ title: string().optional(),
1662
+ description: string().optional(),
1663
+ minItems: number().optional(),
1664
+ maxItems: number().optional(),
1665
+ items: object({
1666
+ anyOf: array(object({
1667
+ const: string(),
1668
+ title: string()
1669
+ }))
1670
+ }),
1671
+ default: array(string()).optional()
1672
+ });
1673
+ /**
1674
+ * Combined schema for multiple-selection enumeration
1675
+ */
1676
+ const MultiSelectEnumSchemaSchema = union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
1082
1677
  /**
1083
1678
  * Primitive schema definition for enum fields.
1084
1679
  */
1085
- const EnumSchemaSchema = objectType({
1086
- type: literalType("string"),
1087
- title: optionalType(stringType()),
1088
- description: optionalType(stringType()),
1089
- enum: arrayType(stringType()),
1090
- enumNames: optionalType(arrayType(stringType())),
1091
- })
1092
- .passthrough();
1680
+ const EnumSchemaSchema = union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
1093
1681
  /**
1094
1682
  * Union of all primitive schema definitions.
1095
1683
  */
1096
- const PrimitiveSchemaDefinitionSchema = unionType([
1097
- BooleanSchemaSchema,
1098
- StringSchemaSchema,
1099
- NumberSchemaSchema,
1100
- EnumSchemaSchema,
1101
- ]);
1684
+ const PrimitiveSchemaDefinitionSchema = union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
1685
+ /**
1686
+ * Parameters for an `elicitation/create` request for form-based elicitation.
1687
+ */
1688
+ const ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
1689
+ /**
1690
+ * The elicitation mode.
1691
+ *
1692
+ * Optional for backward compatibility. Clients MUST treat missing mode as "form".
1693
+ */
1694
+ mode: literal('form').optional(),
1695
+ /**
1696
+ * The message to present to the user describing what information is being requested.
1697
+ */
1698
+ message: string(),
1699
+ /**
1700
+ * A restricted subset of JSON Schema.
1701
+ * Only top-level properties are allowed, without nesting.
1702
+ */
1703
+ requestedSchema: object({
1704
+ type: literal('object'),
1705
+ properties: record(string(), PrimitiveSchemaDefinitionSchema),
1706
+ required: array(string()).optional()
1707
+ })
1708
+ });
1709
+ /**
1710
+ * Parameters for an `elicitation/create` request for URL-based elicitation.
1711
+ */
1712
+ const ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
1713
+ /**
1714
+ * The elicitation mode.
1715
+ */
1716
+ mode: literal('url'),
1717
+ /**
1718
+ * The message to present to the user explaining why the interaction is needed.
1719
+ */
1720
+ message: string(),
1721
+ /**
1722
+ * The ID of the elicitation, which must be unique within the context of the server.
1723
+ * The client MUST treat this ID as an opaque value.
1724
+ */
1725
+ elicitationId: string(),
1726
+ /**
1727
+ * The URL that the user should navigate to.
1728
+ */
1729
+ url: string().url()
1730
+ });
1731
+ /**
1732
+ * The parameters for a request to elicit additional information from the user via the client.
1733
+ */
1734
+ const ElicitRequestParamsSchema = union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
1102
1735
  /**
1103
1736
  * A request from the server to elicit user input via the client.
1104
- * The client should present the message and form fields to the user.
1737
+ * The client should present the message and form fields to the user (form mode)
1738
+ * or navigate to a URL (URL mode).
1105
1739
  */
1106
1740
  const ElicitRequestSchema = RequestSchema.extend({
1107
- method: literalType("elicitation/create"),
1108
- params: BaseRequestParamsSchema.extend({
1109
- /**
1110
- * The message to present to the user.
1111
- */
1112
- message: stringType(),
1113
- /**
1114
- * The schema for the requested user input.
1115
- */
1116
- requestedSchema: objectType({
1117
- type: literalType("object"),
1118
- properties: recordType(stringType(), PrimitiveSchemaDefinitionSchema),
1119
- required: optionalType(arrayType(stringType())),
1120
- })
1121
- .passthrough(),
1122
- }),
1741
+ method: literal('elicitation/create'),
1742
+ params: ElicitRequestParamsSchema
1743
+ });
1744
+ /**
1745
+ * Parameters for a `notifications/elicitation/complete` notification.
1746
+ *
1747
+ * @category notifications/elicitation/complete
1748
+ */
1749
+ const ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
1750
+ /**
1751
+ * The ID of the elicitation that completed.
1752
+ */
1753
+ elicitationId: string()
1754
+ });
1755
+ /**
1756
+ * A notification from the server to the client, informing it of a completion of an out-of-band elicitation request.
1757
+ *
1758
+ * @category notifications/elicitation/complete
1759
+ */
1760
+ const ElicitationCompleteNotificationSchema = NotificationSchema.extend({
1761
+ method: literal('notifications/elicitation/complete'),
1762
+ params: ElicitationCompleteNotificationParamsSchema
1123
1763
  });
1124
1764
  /**
1125
1765
  * The client's response to an elicitation/create request from the server.
1126
1766
  */
1127
1767
  const ElicitResultSchema = ResultSchema.extend({
1128
1768
  /**
1129
- * The user's response action.
1769
+ * The user action in response to the elicitation.
1770
+ * - "accept": User submitted the form/confirmed the action
1771
+ * - "decline": User explicitly decline the action
1772
+ * - "cancel": User dismissed without making an explicit choice
1130
1773
  */
1131
- action: enumType(["accept", "decline", "cancel"]),
1774
+ action: _enum(['accept', 'decline', 'cancel']),
1132
1775
  /**
1133
- * The collected user input content (only present if action is "accept").
1776
+ * The submitted form data, only present when action is "accept".
1777
+ * Contains values matching the requested schema.
1778
+ * Per MCP spec, content is "typically omitted" for decline/cancel actions.
1779
+ * We normalize null to undefined for leniency while maintaining type compatibility.
1134
1780
  */
1135
- content: optionalType(recordType(stringType(), unknownType())),
1781
+ content: preprocess(val => (val === null ? undefined : val), record(string(), union([string(), number(), boolean(), array(string())])).optional())
1136
1782
  });
1137
1783
  /* Autocomplete */
1138
1784
  /**
1139
1785
  * A reference to a resource or resource template definition.
1140
1786
  */
1141
- const ResourceTemplateReferenceSchema = objectType({
1142
- type: literalType("ref/resource"),
1787
+ const ResourceTemplateReferenceSchema = object({
1788
+ type: literal('ref/resource'),
1143
1789
  /**
1144
1790
  * The URI or URI template of the resource.
1145
1791
  */
1146
- uri: stringType(),
1147
- })
1148
- .passthrough();
1792
+ uri: string()
1793
+ });
1149
1794
  /**
1150
1795
  * Identifies a prompt.
1151
1796
  */
1152
- const PromptReferenceSchema = objectType({
1153
- type: literalType("ref/prompt"),
1797
+ const PromptReferenceSchema = object({
1798
+ type: literal('ref/prompt'),
1154
1799
  /**
1155
1800
  * The name of the prompt or prompt template
1156
1801
  */
1157
- name: stringType(),
1158
- })
1159
- .passthrough();
1802
+ name: string()
1803
+ });
1160
1804
  /**
1161
- * A request from the client to the server, to ask for completion options.
1805
+ * Parameters for a `completion/complete` request.
1162
1806
  */
1163
- const CompleteRequestSchema = RequestSchema.extend({
1164
- method: literalType("completion/complete"),
1165
- params: BaseRequestParamsSchema.extend({
1166
- ref: unionType([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
1807
+ const CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
1808
+ ref: union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
1809
+ /**
1810
+ * The argument's information
1811
+ */
1812
+ argument: object({
1167
1813
  /**
1168
- * The argument's information
1814
+ * The name of the argument
1169
1815
  */
1170
- argument: objectType({
1171
- /**
1172
- * The name of the argument
1173
- */
1174
- name: stringType(),
1175
- /**
1176
- * The value of the argument to use for completion matching.
1177
- */
1178
- value: stringType(),
1179
- })
1180
- .passthrough(),
1181
- context: optionalType(objectType({
1182
- /**
1183
- * Previously-resolved variables in a URI template or prompt.
1184
- */
1185
- arguments: optionalType(recordType(stringType(), stringType())),
1186
- })),
1816
+ name: string(),
1817
+ /**
1818
+ * The value of the argument to use for completion matching.
1819
+ */
1820
+ value: string()
1187
1821
  }),
1822
+ context: object({
1823
+ /**
1824
+ * Previously-resolved variables in a URI template or prompt.
1825
+ */
1826
+ arguments: record(string(), string()).optional()
1827
+ })
1828
+ .optional()
1829
+ });
1830
+ /**
1831
+ * A request from the client to the server, to ask for completion options.
1832
+ */
1833
+ const CompleteRequestSchema = RequestSchema.extend({
1834
+ method: literal('completion/complete'),
1835
+ params: CompleteRequestParamsSchema
1188
1836
  });
1189
1837
  /**
1190
1838
  * The server's response to a completion/complete request
1191
1839
  */
1192
1840
  const CompleteResultSchema = ResultSchema.extend({
1193
- completion: objectType({
1841
+ completion: looseObject({
1194
1842
  /**
1195
1843
  * An array of completion values. Must not exceed 100 items.
1196
1844
  */
1197
- values: arrayType(stringType()).max(100),
1845
+ values: array(string()).max(100),
1198
1846
  /**
1199
1847
  * The total number of completion options available. This can exceed the number of values actually sent in the response.
1200
1848
  */
1201
- total: optionalType(numberType().int()),
1849
+ total: optional(number().int()),
1202
1850
  /**
1203
1851
  * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
1204
1852
  */
1205
- hasMore: optionalType(booleanType()),
1853
+ hasMore: optional(boolean())
1206
1854
  })
1207
- .passthrough(),
1208
1855
  });
1209
1856
  /* Roots */
1210
1857
  /**
1211
1858
  * Represents a root directory or file that the server can operate on.
1212
1859
  */
1213
- const RootSchema = objectType({
1860
+ const RootSchema = object({
1214
1861
  /**
1215
1862
  * The URI identifying the root. This *must* start with file:// for now.
1216
1863
  */
1217
- uri: stringType().startsWith("file://"),
1864
+ uri: string().startsWith('file://'),
1218
1865
  /**
1219
1866
  * An optional name for the root.
1220
1867
  */
1221
- name: optionalType(stringType()),
1868
+ name: string().optional(),
1222
1869
  /**
1223
1870
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
1224
1871
  * for notes on _meta usage.
1225
1872
  */
1226
- _meta: optionalType(objectType({}).passthrough()),
1227
- })
1228
- .passthrough();
1873
+ _meta: record(string(), unknown()).optional()
1874
+ });
1229
1875
  /**
1230
1876
  * Sent from the server to request a list of root URIs from the client.
1231
1877
  */
1232
1878
  const ListRootsRequestSchema = RequestSchema.extend({
1233
- method: literalType("roots/list"),
1879
+ method: literal('roots/list'),
1880
+ params: BaseRequestParamsSchema.optional()
1234
1881
  });
1235
1882
  /**
1236
1883
  * The client's response to a roots/list request from the server.
1237
1884
  */
1238
1885
  const ListRootsResultSchema = ResultSchema.extend({
1239
- roots: arrayType(RootSchema),
1886
+ roots: array(RootSchema)
1240
1887
  });
1241
1888
  /**
1242
1889
  * A notification from the client to the server, informing it that the list of roots has changed.
1243
1890
  */
1244
1891
  const RootsListChangedNotificationSchema = NotificationSchema.extend({
1245
- method: literalType("notifications/roots/list_changed"),
1892
+ method: literal('notifications/roots/list_changed'),
1893
+ params: NotificationsParamsSchema.optional()
1246
1894
  });
1247
1895
  /* Client messages */
1248
- unionType([
1896
+ union([
1249
1897
  PingRequestSchema,
1250
1898
  InitializeRequestSchema,
1251
1899
  CompleteRequestSchema,
@@ -1259,27 +1907,40 @@ unionType([
1259
1907
  UnsubscribeRequestSchema,
1260
1908
  CallToolRequestSchema,
1261
1909
  ListToolsRequestSchema,
1910
+ GetTaskRequestSchema,
1911
+ GetTaskPayloadRequestSchema,
1912
+ ListTasksRequestSchema,
1913
+ CancelTaskRequestSchema
1262
1914
  ]);
1263
- unionType([
1915
+ union([
1264
1916
  CancelledNotificationSchema,
1265
1917
  ProgressNotificationSchema,
1266
1918
  InitializedNotificationSchema,
1267
1919
  RootsListChangedNotificationSchema,
1920
+ TaskStatusNotificationSchema
1268
1921
  ]);
1269
- unionType([
1922
+ union([
1270
1923
  EmptyResultSchema,
1271
1924
  CreateMessageResultSchema,
1925
+ CreateMessageResultWithToolsSchema,
1272
1926
  ElicitResultSchema,
1273
1927
  ListRootsResultSchema,
1928
+ GetTaskResultSchema,
1929
+ ListTasksResultSchema,
1930
+ CreateTaskResultSchema
1274
1931
  ]);
1275
1932
  /* Server messages */
1276
- unionType([
1933
+ union([
1277
1934
  PingRequestSchema,
1278
1935
  CreateMessageRequestSchema,
1279
1936
  ElicitRequestSchema,
1280
1937
  ListRootsRequestSchema,
1938
+ GetTaskRequestSchema,
1939
+ GetTaskPayloadRequestSchema,
1940
+ ListTasksRequestSchema,
1941
+ CancelTaskRequestSchema
1281
1942
  ]);
1282
- unionType([
1943
+ union([
1283
1944
  CancelledNotificationSchema,
1284
1945
  ProgressNotificationSchema,
1285
1946
  LoggingMessageNotificationSchema,
@@ -1287,8 +1948,10 @@ unionType([
1287
1948
  ResourceListChangedNotificationSchema,
1288
1949
  ToolListChangedNotificationSchema,
1289
1950
  PromptListChangedNotificationSchema,
1951
+ TaskStatusNotificationSchema,
1952
+ ElicitationCompleteNotificationSchema
1290
1953
  ]);
1291
- unionType([
1954
+ union([
1292
1955
  EmptyResultSchema,
1293
1956
  InitializeResultSchema,
1294
1957
  CompleteResultSchema,
@@ -1299,15 +1962,46 @@ unionType([
1299
1962
  ReadResourceResultSchema,
1300
1963
  CallToolResultSchema,
1301
1964
  ListToolsResultSchema,
1965
+ GetTaskResultSchema,
1966
+ ListTasksResultSchema,
1967
+ CreateTaskResultSchema
1302
1968
  ]);
1303
1969
  class McpError extends Error {
1304
1970
  constructor(code, message, data) {
1305
1971
  super(`MCP error ${code}: ${message}`);
1306
1972
  this.code = code;
1307
1973
  this.data = data;
1308
- this.name = "McpError";
1974
+ this.name = 'McpError';
1975
+ }
1976
+ /**
1977
+ * Factory method to create the appropriate error type based on the error code and data
1978
+ */
1979
+ static fromError(code, message, data) {
1980
+ // Check for specific error types
1981
+ if (code === ErrorCode.UrlElicitationRequired && data) {
1982
+ const errorData = data;
1983
+ if (errorData.elicitations) {
1984
+ return new UrlElicitationRequiredError(errorData.elicitations, message);
1985
+ }
1986
+ }
1987
+ // Default to generic McpError
1988
+ return new McpError(code, message, data);
1989
+ }
1990
+ }
1991
+ /**
1992
+ * Specialized error type when a tool requires a URL mode elicitation.
1993
+ * 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.
1994
+ */
1995
+ class UrlElicitationRequiredError extends McpError {
1996
+ constructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? 's' : ''} required`) {
1997
+ super(ErrorCode.UrlElicitationRequired, message, {
1998
+ elicitations: elicitations
1999
+ });
2000
+ }
2001
+ get elicitations() {
2002
+ return this.data?.elicitations ?? [];
1309
2003
  }
1310
2004
  }
1311
2005
 
1312
- export { AudioContentSchema, BaseMetadataSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CallToolRequestSchema, CallToolResultSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CursorSchema, ElicitRequestSchema, ElicitResultSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, ErrorCode, GetPromptRequestSchema, GetPromptResultSchema, IconSchema, ImageContentSchema, ImplementationSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONRPCErrorSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResponseSchema, JSONRPC_VERSION, LATEST_PROTOCOL_VERSION, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationSchema, McpError, ModelHintSchema, ModelPreferencesSchema, NotificationSchema, NumberSchemaSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RequestIdSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationSchema, ResultSchema, RootSchema, RootsListChangedNotificationSchema, SUPPORTED_PROTOCOL_VERSIONS, SamplingMessageSchema, ServerCapabilitiesSchema, SetLevelRequestSchema, StringSchemaSchema, SubscribeRequestSchema, TextContentSchema, TextResourceContentsSchema, ToolAnnotationsSchema, ToolListChangedNotificationSchema, ToolSchema, UnsubscribeRequestSchema, isInitializedNotification, isJSONRPCError, isJSONRPCNotification, isJSONRPCRequest, isJSONRPCResponse };
2006
+ export { AnnotationsSchema, AudioContentSchema, BaseMetadataSchema, BlobResourceContentsSchema, BooleanSchemaSchema, CallToolRequestParamsSchema, CallToolRequestSchema, CallToolResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, ClientCapabilitiesSchema, ClientTasksCapabilitySchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, ContentBlockSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, CreateTaskResultSchema, CursorSchema, ElicitRequestFormParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitRequestURLParamsSchema, ElicitResultSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, EmbeddedResourceSchema, EmptyResultSchema, EnumSchemaSchema, ErrorCode, GetPromptRequestParamsSchema, GetPromptRequestSchema, GetPromptResultSchema, GetTaskPayloadRequestSchema, GetTaskRequestSchema, GetTaskResultSchema, IconSchema, IconsSchema, ImageContentSchema, ImplementationSchema, InitializeRequestParamsSchema, InitializeRequestSchema, InitializeResultSchema, InitializedNotificationSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCNotificationSchema, JSONRPCRequestSchema, JSONRPCResultResponseSchema, JSONRPC_VERSION, LATEST_PROTOCOL_VERSION, LegacyTitledEnumSchemaSchema, ListChangedOptionsBaseSchema, ListPromptsRequestSchema, ListPromptsResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListRootsRequestSchema, ListRootsResultSchema, ListTasksRequestSchema, ListTasksResultSchema, ListToolsRequestSchema, ListToolsResultSchema, LoggingLevelSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, McpError, ModelHintSchema, ModelPreferencesSchema, MultiSelectEnumSchemaSchema, NotificationSchema, NumberSchemaSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, PingRequestSchema, PrimitiveSchemaDefinitionSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, ProgressSchema, ProgressTokenSchema, PromptArgumentSchema, PromptListChangedNotificationSchema, PromptMessageSchema, PromptReferenceSchema, PromptSchema, RELATED_TASK_META_KEY, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, RelatedTaskMetadataSchema, RequestIdSchema, RequestSchema, ResourceContentsSchema, ResourceLinkSchema, ResourceListChangedNotificationSchema, ResourceRequestParamsSchema, ResourceSchema, ResourceTemplateReferenceSchema, ResourceTemplateSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, ResultSchema, RoleSchema, RootSchema, RootsListChangedNotificationSchema, SUPPORTED_PROTOCOL_VERSIONS, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, ServerCapabilitiesSchema, ServerTasksCapabilitySchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, SingleSelectEnumSchemaSchema, StringSchemaSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, TaskAugmentedRequestParamsSchema, TaskMetadataSchema, TaskSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, TaskStatusSchema, TextContentSchema, TextResourceContentsSchema, TitledMultiSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, ToolAnnotationsSchema, ToolChoiceSchema, ToolExecutionSchema, ToolListChangedNotificationSchema, ToolResultContentSchema, ToolSchema, ToolUseContentSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, UntitledMultiSelectEnumSchemaSchema, UntitledSingleSelectEnumSchemaSchema, UrlElicitationRequiredError, isInitializedNotification, isJSONRPCErrorResponse, isJSONRPCNotification, isJSONRPCRequest, isJSONRPCResultResponse, isTaskAugmentedRequestParams };
1313
2007
  //# sourceMappingURL=types.js.map