mcp-use 2.0.0-beta.18 → 2.0.0-beta.2

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 (1058) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/bin/args.d.ts +0 -2
  3. package/dist/bin/args.d.ts.map +1 -1
  4. package/dist/bin/main.d.ts +0 -2
  5. package/dist/bin/main.d.ts.map +1 -1
  6. package/dist/bin.js +4 -9
  7. package/dist/bin.js.map +1 -1
  8. package/dist/{chunk-IG2BCCMU.js → chunk-Q4PUTBMV.js} +1 -5
  9. package/dist/chunk-Q4PUTBMV.js.map +1 -0
  10. package/dist/{chunk-RHITI5QM.js → chunk-RQRT27Q3.js} +16 -190
  11. package/dist/chunk-RQRT27Q3.js.map +1 -0
  12. package/dist/{chunk-QUUANIE4.js → chunk-SFI2T6TE.js} +80 -34
  13. package/dist/chunk-SFI2T6TE.js.map +1 -0
  14. package/dist/{chunk-O3CUL5VH.js → chunk-UDLRVMML.js} +18 -68
  15. package/dist/chunk-UDLRVMML.js.map +1 -0
  16. package/dist/cli/build.d.ts +2 -7
  17. package/dist/cli/build.d.ts.map +1 -1
  18. package/dist/cli/dev.d.ts.map +1 -1
  19. package/dist/cli/port.d.ts.map +1 -1
  20. package/dist/cli/tunnel.d.ts.map +1 -1
  21. package/dist/cli/views-bindings.d.ts +0 -9
  22. package/dist/cli/views-bindings.d.ts.map +1 -1
  23. package/dist/cli/views-plugin.d.ts.map +1 -1
  24. package/dist/cli/views.d.ts +5 -7
  25. package/dist/cli/views.d.ts.map +1 -1
  26. package/dist/cli/workspace.d.ts +10 -2
  27. package/dist/cli/workspace.d.ts.map +1 -1
  28. package/dist/commands/build.js +25 -136
  29. package/dist/commands/build.js.map +1 -1
  30. package/dist/commands/client.d.ts.map +1 -1
  31. package/dist/commands/client.js +1 -1
  32. package/dist/commands/dev.js +15 -110
  33. package/dist/commands/dev.js.map +1 -1
  34. package/dist/commands/load-client.d.ts +2 -9
  35. package/dist/commands/load-client.d.ts.map +1 -1
  36. package/dist/commands/screenshot.js +1 -1
  37. package/dist/commands/start.js +1 -1
  38. package/dist/completable.d.ts +0 -9
  39. package/dist/completable.d.ts.map +1 -1
  40. package/dist/config.d.ts +4 -125
  41. package/dist/config.d.ts.map +1 -1
  42. package/dist/fetch-app.d.ts +0 -43
  43. package/dist/fetch-app.d.ts.map +1 -1
  44. package/dist/index.d.ts +5 -20
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +248 -1312
  47. package/dist/index.js.map +1 -1
  48. package/dist/inspector-shell.d.ts +6 -19
  49. package/dist/inspector-shell.d.ts.map +1 -1
  50. package/dist/mount-mcp.d.ts +4 -0
  51. package/dist/mount-mcp.d.ts.map +1 -1
  52. package/dist/oauth/index.js +1 -2
  53. package/dist/{chunk-SMN75YED.js → public-route-7IK5D7V7.js} +10 -16
  54. package/dist/public-route-7IK5D7V7.js.map +1 -0
  55. package/dist/react/components/theme-provider.d.ts +0 -3
  56. package/dist/react/components/theme-provider.d.ts.map +1 -1
  57. package/dist/react/hooks/use-host-context.d.ts +0 -5
  58. package/dist/react/hooks/use-host-context.d.ts.map +1 -1
  59. package/dist/react/index.d.ts +0 -2
  60. package/dist/react/index.d.ts.map +1 -1
  61. package/dist/react/index.js +3 -124
  62. package/dist/react/index.js.map +1 -1
  63. package/dist/react/runtime/view-runtime.d.ts +0 -23
  64. package/dist/react/runtime/view-runtime.d.ts.map +1 -1
  65. package/dist/react/types/register.d.ts +1 -1
  66. package/dist/react/types/register.d.ts.map +1 -1
  67. package/dist/resources.d.ts +4 -59
  68. package/dist/resources.d.ts.map +1 -1
  69. package/dist/server.d.ts +5 -118
  70. package/dist/server.d.ts.map +1 -1
  71. package/dist/tools.d.ts +1 -12
  72. package/dist/tools.d.ts.map +1 -1
  73. package/dist/views/document.d.ts +7 -25
  74. package/dist/views/document.d.ts.map +1 -1
  75. package/dist/views/index.d.ts +3 -4
  76. package/dist/views/index.d.ts.map +1 -1
  77. package/dist/views/origin.d.ts +9 -37
  78. package/dist/views/origin.d.ts.map +1 -1
  79. package/dist/views/public-route.d.ts +3 -9
  80. package/dist/views/public-route.d.ts.map +1 -1
  81. package/dist/views/routes.d.ts +1 -20
  82. package/dist/views/routes.d.ts.map +1 -1
  83. package/dist/views/types.d.ts +4 -7
  84. package/dist/views/types.d.ts.map +1 -1
  85. package/dist/views/wire.d.ts +30 -19
  86. package/dist/views/wire.d.ts.map +1 -1
  87. package/package.json +10 -21
  88. package/dist/branding.d.ts +0 -82
  89. package/dist/branding.d.ts.map +0 -1
  90. package/dist/chunk-FC2Z2VFO.js +0 -99
  91. package/dist/chunk-FC2Z2VFO.js.map +0 -1
  92. package/dist/chunk-IG2BCCMU.js.map +0 -1
  93. package/dist/chunk-KIZ72TIK.js +0 -38
  94. package/dist/chunk-KIZ72TIK.js.map +0 -1
  95. package/dist/chunk-O3CUL5VH.js.map +0 -1
  96. package/dist/chunk-QUUANIE4.js.map +0 -1
  97. package/dist/chunk-RHITI5QM.js.map +0 -1
  98. package/dist/chunk-SMN75YED.js.map +0 -1
  99. package/dist/chunk-XUI7QE2D.js +0 -98
  100. package/dist/chunk-XUI7QE2D.js.map +0 -1
  101. package/dist/chunk-Z326HADF.js +0 -82
  102. package/dist/chunk-Z326HADF.js.map +0 -1
  103. package/dist/chunk-ZJJD33SF.js +0 -741
  104. package/dist/chunk-ZJJD33SF.js.map +0 -1
  105. package/dist/cli/mcp-env-declaration.d.ts +0 -20
  106. package/dist/cli/mcp-env-declaration.d.ts.map +0 -1
  107. package/dist/internal/resource-completion.js +0 -7
  108. package/dist/internal/resource-completion.js.map +0 -1
  109. package/dist/landing-handler-WE66NIGB.js +0 -37
  110. package/dist/landing-handler-WE66NIGB.js.map +0 -1
  111. package/dist/landing-handler.d.ts +0 -24
  112. package/dist/landing-handler.d.ts.map +0 -1
  113. package/dist/landing.d.ts +0 -67
  114. package/dist/landing.d.ts.map +0 -1
  115. package/dist/landing.js +0 -7
  116. package/dist/landing.js.map +0 -1
  117. package/dist/middleware/cors.d.ts +0 -11
  118. package/dist/middleware/cors.d.ts.map +0 -1
  119. package/dist/middleware/mcp-middleware.d.ts +0 -175
  120. package/dist/middleware/mcp-middleware.d.ts.map +0 -1
  121. package/dist/oauth/better-auth.d.ts +0 -29
  122. package/dist/oauth/better-auth.d.ts.map +0 -1
  123. package/dist/oauth/better-auth.js +0 -76
  124. package/dist/oauth/better-auth.js.map +0 -1
  125. package/dist/proxy-DJYWGTGX.js +0 -282
  126. package/dist/proxy-DJYWGTGX.js.map +0 -1
  127. package/dist/proxy.d.ts +0 -153
  128. package/dist/proxy.d.ts.map +0 -1
  129. package/dist/public-route-5JEGFEIN.js +0 -9
  130. package/dist/public-route-5JEGFEIN.js.map +0 -1
  131. package/dist/react/hooks/use-files.d.ts +0 -25
  132. package/dist/react/hooks/use-files.d.ts.map +0 -1
  133. package/dist/react/types/file-types.d.ts +0 -16
  134. package/dist/react/types/file-types.d.ts.map +0 -1
  135. package/dist/resource-completion.d.ts +0 -12
  136. package/dist/resource-completion.d.ts.map +0 -1
  137. package/dist/views/csp-env.d.ts +0 -37
  138. package/dist/views/csp-env.d.ts.map +0 -1
  139. package/node_modules/@modelcontextprotocol/client/LICENSE +0 -216
  140. package/node_modules/@modelcontextprotocol/client/README.md +0 -26
  141. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-Asx17_Co.mjs +0 -7069
  142. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-Asx17_Co.mjs.map +0 -1
  143. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B7GnTXYx.d.mts +0 -1054
  144. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B7GnTXYx.d.mts.map +0 -1
  145. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B_4czhCS.d.cts +0 -1054
  146. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B_4czhCS.d.cts.map +0 -1
  147. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-DNzBrkxq.cjs +0 -7086
  148. package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-DNzBrkxq.cjs.map +0 -1
  149. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-D9GAttn8.d.cts +0 -59
  150. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-D9GAttn8.d.cts.map +0 -1
  151. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-DbU8BxXO.mjs +0 -970
  152. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-DbU8BxXO.mjs.map +0 -1
  153. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Djgwc46-.cjs +0 -976
  154. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Djgwc46-.cjs.map +0 -1
  155. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Xtj52JOa.d.mts +0 -59
  156. package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Xtj52JOa.d.mts.map +0 -1
  157. package/node_modules/@modelcontextprotocol/client/dist/chunk-Bnu9O96Y.cjs +0 -60
  158. package/node_modules/@modelcontextprotocol/client/dist/chunk-Br0eD_fh.mjs +0 -42
  159. package/node_modules/@modelcontextprotocol/client/dist/index-ZagFkUbt.d.mts +0 -2675
  160. package/node_modules/@modelcontextprotocol/client/dist/index-ZagFkUbt.d.mts.map +0 -1
  161. package/node_modules/@modelcontextprotocol/client/dist/index-gN3EXmil.d.cts +0 -2678
  162. package/node_modules/@modelcontextprotocol/client/dist/index-gN3EXmil.d.cts.map +0 -1
  163. package/node_modules/@modelcontextprotocol/client/dist/index.cjs +0 -5427
  164. package/node_modules/@modelcontextprotocol/client/dist/index.cjs.map +0 -1
  165. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts +0 -3196
  166. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +0 -1
  167. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts +0 -3196
  168. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +0 -1
  169. package/node_modules/@modelcontextprotocol/client/dist/index.mjs +0 -5224
  170. package/node_modules/@modelcontextprotocol/client/dist/index.mjs.map +0 -1
  171. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs +0 -14
  172. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs.map +0 -1
  173. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts +0 -13
  174. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts.map +0 -1
  175. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts +0 -13
  176. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts.map +0 -1
  177. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs +0 -13
  178. package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs.map +0 -1
  179. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs +0 -14
  180. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs.map +0 -1
  181. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts +0 -13
  182. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts.map +0 -1
  183. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts +0 -13
  184. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts.map +0 -1
  185. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs +0 -13
  186. package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs.map +0 -1
  187. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +0 -21
  188. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs.map +0 -1
  189. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts +0 -13
  190. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts.map +0 -1
  191. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts +0 -13
  192. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts.map +0 -1
  193. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +0 -20
  194. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs.map +0 -1
  195. package/node_modules/@modelcontextprotocol/client/dist/src-BzzZSQyL.cjs +0 -7331
  196. package/node_modules/@modelcontextprotocol/client/dist/src-BzzZSQyL.cjs.map +0 -1
  197. package/node_modules/@modelcontextprotocol/client/dist/src-DGeA9On3.mjs +0 -6963
  198. package/node_modules/@modelcontextprotocol/client/dist/src-DGeA9On3.mjs.map +0 -1
  199. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +0 -181
  200. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs.map +0 -1
  201. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts +0 -87
  202. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +0 -1
  203. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts +0 -87
  204. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +0 -1
  205. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +0 -176
  206. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs.map +0 -1
  207. package/node_modules/@modelcontextprotocol/client/dist/types-BDNQEPSs.d.mts +0 -1099
  208. package/node_modules/@modelcontextprotocol/client/dist/types-BDNQEPSs.d.mts.map +0 -1
  209. package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts +0 -1099
  210. package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts.map +0 -1
  211. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.cjs +0 -5
  212. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.cts +0 -2
  213. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.mts +0 -2
  214. package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.mjs +0 -3
  215. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.cjs +0 -3
  216. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.cts +0 -2
  217. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.mts +0 -2
  218. package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.mjs +0 -3
  219. package/node_modules/@modelcontextprotocol/client/package.json +0 -166
  220. package/node_modules/@modelcontextprotocol/core/LICENSE +0 -216
  221. package/node_modules/@modelcontextprotocol/core/README.md +0 -40
  222. package/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts +0 -8198
  223. package/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts.map +0 -1
  224. package/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs +0 -2862
  225. package/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs.map +0 -1
  226. package/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts +0 -8198
  227. package/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts.map +0 -1
  228. package/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs +0 -1653
  229. package/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs.map +0 -1
  230. package/node_modules/@modelcontextprotocol/core/dist/index.cjs +0 -174
  231. package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +0 -2
  232. package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +0 -2
  233. package/node_modules/@modelcontextprotocol/core/dist/index.mjs +0 -3
  234. package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +0 -199
  235. package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +0 -87
  236. package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +0 -1
  237. package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +0 -87
  238. package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +0 -1
  239. package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +0 -3
  240. package/node_modules/@modelcontextprotocol/core/package.json +0 -85
  241. package/node_modules/jose/LICENSE.md +0 -21
  242. package/node_modules/jose/README.md +0 -153
  243. package/node_modules/jose/dist/types/index.d.ts +0 -55
  244. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +0 -31
  245. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +0 -65
  246. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +0 -31
  247. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +0 -83
  248. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +0 -31
  249. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +0 -74
  250. package/node_modules/jose/dist/types/jwk/embedded.d.ts +0 -17
  251. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +0 -32
  252. package/node_modules/jose/dist/types/jwks/local.d.ts +0 -29
  253. package/node_modules/jose/dist/types/jwks/remote.d.ts +0 -237
  254. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +0 -36
  255. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +0 -33
  256. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +0 -42
  257. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +0 -33
  258. package/node_modules/jose/dist/types/jws/general/sign.d.ts +0 -53
  259. package/node_modules/jose/dist/types/jws/general/verify.d.ts +0 -33
  260. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +0 -35
  261. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +0 -91
  262. package/node_modules/jose/dist/types/jwt/sign.d.ts +0 -43
  263. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +0 -43
  264. package/node_modules/jose/dist/types/jwt/verify.d.ts +0 -37
  265. package/node_modules/jose/dist/types/key/export.d.ts +0 -33
  266. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +0 -47
  267. package/node_modules/jose/dist/types/key/generate_secret.d.ts +0 -35
  268. package/node_modules/jose/dist/types/key/import.d.ts +0 -83
  269. package/node_modules/jose/dist/types/types.d.ts +0 -841
  270. package/node_modules/jose/dist/types/util/base64url.d.ts +0 -9
  271. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +0 -18
  272. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +0 -17
  273. package/node_modules/jose/dist/types/util/errors.d.ts +0 -213
  274. package/node_modules/jose/dist/webapi/index.js +0 -32
  275. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +0 -27
  276. package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +0 -27
  277. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +0 -165
  278. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +0 -169
  279. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +0 -31
  280. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +0 -187
  281. package/node_modules/jose/dist/webapi/jwk/embedded.js +0 -17
  282. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +0 -68
  283. package/node_modules/jose/dist/webapi/jwks/local.js +0 -119
  284. package/node_modules/jose/dist/webapi/jwks/remote.js +0 -179
  285. package/node_modules/jose/dist/webapi/jws/compact/sign.js +0 -18
  286. package/node_modules/jose/dist/webapi/jws/compact/verify.js +0 -21
  287. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +0 -92
  288. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +0 -120
  289. package/node_modules/jose/dist/webapi/jws/general/sign.js +0 -73
  290. package/node_modules/jose/dist/webapi/jws/general/verify.js +0 -24
  291. package/node_modules/jose/dist/webapi/jwt/decrypt.js +0 -23
  292. package/node_modules/jose/dist/webapi/jwt/encrypt.js +0 -108
  293. package/node_modules/jose/dist/webapi/jwt/sign.js +0 -52
  294. package/node_modules/jose/dist/webapi/jwt/unsecured.js +0 -63
  295. package/node_modules/jose/dist/webapi/jwt/verify.js +0 -15
  296. package/node_modules/jose/dist/webapi/key/export.js +0 -11
  297. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +0 -97
  298. package/node_modules/jose/dist/webapi/key/generate_secret.js +0 -40
  299. package/node_modules/jose/dist/webapi/key/import.js +0 -57
  300. package/node_modules/jose/dist/webapi/lib/aesgcmkw.js +0 -16
  301. package/node_modules/jose/dist/webapi/lib/aeskw.js +0 -25
  302. package/node_modules/jose/dist/webapi/lib/asn1.js +0 -243
  303. package/node_modules/jose/dist/webapi/lib/base64.js +0 -22
  304. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +0 -43
  305. package/node_modules/jose/dist/webapi/lib/cek.js +0 -19
  306. package/node_modules/jose/dist/webapi/lib/check_cek_length.js +0 -7
  307. package/node_modules/jose/dist/webapi/lib/check_iv_length.js +0 -7
  308. package/node_modules/jose/dist/webapi/lib/check_key_length.js +0 -8
  309. package/node_modules/jose/dist/webapi/lib/check_key_type.js +0 -122
  310. package/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -143
  311. package/node_modules/jose/dist/webapi/lib/decrypt.js +0 -106
  312. package/node_modules/jose/dist/webapi/lib/decrypt_key_management.js +0 -127
  313. package/node_modules/jose/dist/webapi/lib/digest.js +0 -4
  314. package/node_modules/jose/dist/webapi/lib/ecdhes.js +0 -52
  315. package/node_modules/jose/dist/webapi/lib/encrypt.js +0 -74
  316. package/node_modules/jose/dist/webapi/lib/encrypt_key_management.js +0 -92
  317. package/node_modules/jose/dist/webapi/lib/get_sign_verify_key.js +0 -12
  318. package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -27
  319. package/node_modules/jose/dist/webapi/lib/is_disjoint.js +0 -21
  320. package/node_modules/jose/dist/webapi/lib/is_jwk.js +0 -6
  321. package/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -17
  322. package/node_modules/jose/dist/webapi/lib/is_object.js +0 -14
  323. package/node_modules/jose/dist/webapi/lib/iv.js +0 -19
  324. package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -109
  325. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +0 -238
  326. package/node_modules/jose/dist/webapi/lib/key_to_jwk.js +0 -31
  327. package/node_modules/jose/dist/webapi/lib/normalize_key.js +0 -176
  328. package/node_modules/jose/dist/webapi/lib/pbes2kw.js +0 -39
  329. package/node_modules/jose/dist/webapi/lib/private_symbols.js +0 -1
  330. package/node_modules/jose/dist/webapi/lib/rsaes.js +0 -24
  331. package/node_modules/jose/dist/webapi/lib/sign.js +0 -9
  332. package/node_modules/jose/dist/webapi/lib/subtle_dsa.js +0 -31
  333. package/node_modules/jose/dist/webapi/lib/validate_algorithms.js +0 -10
  334. package/node_modules/jose/dist/webapi/lib/validate_crit.js +0 -33
  335. package/node_modules/jose/dist/webapi/lib/verify.js +0 -14
  336. package/node_modules/jose/dist/webapi/util/base64url.js +0 -30
  337. package/node_modules/jose/dist/webapi/util/decode_jwt.js +0 -32
  338. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +0 -34
  339. package/node_modules/jose/dist/webapi/util/errors.js +0 -99
  340. package/node_modules/jose/package.json +0 -200
  341. package/node_modules/zod/LICENSE +0 -21
  342. package/node_modules/zod/README.md +0 -191
  343. package/node_modules/zod/index.cjs +0 -33
  344. package/node_modules/zod/index.d.cts +0 -4
  345. package/node_modules/zod/index.d.ts +0 -4
  346. package/node_modules/zod/index.js +0 -4
  347. package/node_modules/zod/locales/index.cjs +0 -17
  348. package/node_modules/zod/locales/index.d.cts +0 -1
  349. package/node_modules/zod/locales/index.d.ts +0 -1
  350. package/node_modules/zod/locales/index.js +0 -1
  351. package/node_modules/zod/locales/package.json +0 -7
  352. package/node_modules/zod/mini/index.cjs +0 -32
  353. package/node_modules/zod/mini/index.d.cts +0 -3
  354. package/node_modules/zod/mini/index.d.ts +0 -3
  355. package/node_modules/zod/mini/index.js +0 -3
  356. package/node_modules/zod/mini/package.json +0 -7
  357. package/node_modules/zod/package.json +0 -135
  358. package/node_modules/zod/src/index.ts +0 -4
  359. package/node_modules/zod/src/locales/index.ts +0 -1
  360. package/node_modules/zod/src/mini/index.ts +0 -3
  361. package/node_modules/zod/src/v3/ZodError.ts +0 -330
  362. package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  363. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  364. package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  365. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  366. package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  367. package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  368. package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  369. package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  370. package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  371. package/node_modules/zod/src/v3/errors.ts +0 -13
  372. package/node_modules/zod/src/v3/external.ts +0 -6
  373. package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  374. package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  375. package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  376. package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  377. package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  378. package/node_modules/zod/src/v3/helpers/util.ts +0 -224
  379. package/node_modules/zod/src/v3/index.ts +0 -4
  380. package/node_modules/zod/src/v3/locales/en.ts +0 -124
  381. package/node_modules/zod/src/v3/standard-schema.ts +0 -113
  382. package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  383. package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  384. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  385. package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  386. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  387. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  388. package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  389. package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  390. package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  391. package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  392. package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  393. package/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
  394. package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  395. package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  396. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  397. package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  398. package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  399. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  400. package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  401. package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
  402. package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  403. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  404. package/node_modules/zod/src/v3/tests/function.test.ts +0 -261
  405. package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  406. package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  407. package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
  408. package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  409. package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
  410. package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  411. package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  412. package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  413. package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  414. package/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
  415. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  416. package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  417. package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  418. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  419. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  420. package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
  421. package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  422. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  423. package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  424. package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  425. package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  426. package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  427. package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  428. package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  429. package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  430. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
  431. package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  432. package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  433. package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  434. package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  435. package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  436. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  437. package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
  438. package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  439. package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  440. package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  441. package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  442. package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  443. package/node_modules/zod/src/v3/types.ts +0 -5138
  444. package/node_modules/zod/src/v4/classic/checks.ts +0 -32
  445. package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  446. package/node_modules/zod/src/v4/classic/compat.ts +0 -70
  447. package/node_modules/zod/src/v4/classic/errors.ts +0 -82
  448. package/node_modules/zod/src/v4/classic/external.ts +0 -52
  449. package/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -659
  450. package/node_modules/zod/src/v4/classic/index.ts +0 -5
  451. package/node_modules/zod/src/v4/classic/iso.ts +0 -90
  452. package/node_modules/zod/src/v4/classic/parse.ts +0 -82
  453. package/node_modules/zod/src/v4/classic/schemas.ts +0 -2672
  454. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  455. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -59
  456. package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  457. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -216
  458. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  459. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  460. package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  461. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
  462. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
  463. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -326
  464. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  465. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -573
  466. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -703
  467. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  468. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
  469. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  470. package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -62
  471. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -302
  472. package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -409
  473. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
  474. package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  475. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -197
  476. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -694
  477. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
  478. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -807
  479. package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
  480. package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  481. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  482. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
  483. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -895
  484. package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -360
  485. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  486. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -39
  487. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -68
  488. package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -939
  489. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -60
  490. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -198
  491. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -46
  492. package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
  493. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
  494. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -117
  495. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
  496. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
  497. package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -330
  498. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  499. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  500. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  501. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  502. package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -325
  503. package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -717
  504. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -333
  505. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -450
  506. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
  507. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  508. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
  509. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -26
  510. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
  511. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  512. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  513. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  514. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
  515. package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -717
  516. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -631
  517. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -633
  518. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
  519. package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -181
  520. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -134
  521. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  522. package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1224
  523. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -106
  524. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -771
  525. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
  526. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -3125
  527. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
  528. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -496
  529. package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -273
  530. package/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
  531. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  532. package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  533. package/node_modules/zod/src/v4/core/api.ts +0 -1823
  534. package/node_modules/zod/src/v4/core/checks.ts +0 -1293
  535. package/node_modules/zod/src/v4/core/config.ts +0 -15
  536. package/node_modules/zod/src/v4/core/core.ts +0 -153
  537. package/node_modules/zod/src/v4/core/doc.ts +0 -44
  538. package/node_modules/zod/src/v4/core/errors.ts +0 -455
  539. package/node_modules/zod/src/v4/core/index.ts +0 -16
  540. package/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -126
  541. package/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -666
  542. package/node_modules/zod/src/v4/core/json-schema.ts +0 -147
  543. package/node_modules/zod/src/v4/core/parse.ts +0 -195
  544. package/node_modules/zod/src/v4/core/regexes.ts +0 -190
  545. package/node_modules/zod/src/v4/core/registries.ts +0 -105
  546. package/node_modules/zod/src/v4/core/schemas.ts +0 -4730
  547. package/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
  548. package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
  549. package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  550. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  551. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -215
  552. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  553. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -181
  554. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
  555. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
  556. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
  557. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
  558. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  559. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  560. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
  561. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
  562. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
  563. package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -622
  564. package/node_modules/zod/src/v4/core/util.ts +0 -983
  565. package/node_modules/zod/src/v4/core/versions.ts +0 -5
  566. package/node_modules/zod/src/v4/core/zsf.ts +0 -323
  567. package/node_modules/zod/src/v4/index.ts +0 -4
  568. package/node_modules/zod/src/v4/locales/ar.ts +0 -115
  569. package/node_modules/zod/src/v4/locales/az.ts +0 -111
  570. package/node_modules/zod/src/v4/locales/be.ts +0 -176
  571. package/node_modules/zod/src/v4/locales/bg.ts +0 -128
  572. package/node_modules/zod/src/v4/locales/ca.ts +0 -116
  573. package/node_modules/zod/src/v4/locales/cs.ts +0 -118
  574. package/node_modules/zod/src/v4/locales/da.ts +0 -123
  575. package/node_modules/zod/src/v4/locales/de.ts +0 -116
  576. package/node_modules/zod/src/v4/locales/el.ts +0 -121
  577. package/node_modules/zod/src/v4/locales/en.ts +0 -123
  578. package/node_modules/zod/src/v4/locales/eo.ts +0 -118
  579. package/node_modules/zod/src/v4/locales/es.ts +0 -141
  580. package/node_modules/zod/src/v4/locales/fa.ts +0 -126
  581. package/node_modules/zod/src/v4/locales/fi.ts +0 -121
  582. package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -116
  583. package/node_modules/zod/src/v4/locales/fr.ts +0 -132
  584. package/node_modules/zod/src/v4/locales/he.ts +0 -246
  585. package/node_modules/zod/src/v4/locales/hr.ts +0 -131
  586. package/node_modules/zod/src/v4/locales/hu.ts +0 -117
  587. package/node_modules/zod/src/v4/locales/hy.ts +0 -164
  588. package/node_modules/zod/src/v4/locales/id.ts +0 -115
  589. package/node_modules/zod/src/v4/locales/index.ts +0 -52
  590. package/node_modules/zod/src/v4/locales/is.ts +0 -119
  591. package/node_modules/zod/src/v4/locales/it.ts +0 -116
  592. package/node_modules/zod/src/v4/locales/ja.ts +0 -114
  593. package/node_modules/zod/src/v4/locales/ka.ts +0 -123
  594. package/node_modules/zod/src/v4/locales/kh.ts +0 -7
  595. package/node_modules/zod/src/v4/locales/km.ts +0 -119
  596. package/node_modules/zod/src/v4/locales/ko.ts +0 -121
  597. package/node_modules/zod/src/v4/locales/lt.ts +0 -239
  598. package/node_modules/zod/src/v4/locales/mk.ts +0 -118
  599. package/node_modules/zod/src/v4/locales/ms.ts +0 -115
  600. package/node_modules/zod/src/v4/locales/nl.ts +0 -121
  601. package/node_modules/zod/src/v4/locales/no.ts +0 -116
  602. package/node_modules/zod/src/v4/locales/ota.ts +0 -117
  603. package/node_modules/zod/src/v4/locales/pl.ts +0 -118
  604. package/node_modules/zod/src/v4/locales/ps.ts +0 -126
  605. package/node_modules/zod/src/v4/locales/pt.ts +0 -116
  606. package/node_modules/zod/src/v4/locales/ro.ts +0 -129
  607. package/node_modules/zod/src/v4/locales/ru.ts +0 -176
  608. package/node_modules/zod/src/v4/locales/sl.ts +0 -118
  609. package/node_modules/zod/src/v4/locales/sv.ts +0 -119
  610. package/node_modules/zod/src/v4/locales/ta.ts +0 -118
  611. package/node_modules/zod/src/v4/locales/th.ts +0 -119
  612. package/node_modules/zod/src/v4/locales/tr.ts +0 -111
  613. package/node_modules/zod/src/v4/locales/ua.ts +0 -7
  614. package/node_modules/zod/src/v4/locales/uk.ts +0 -117
  615. package/node_modules/zod/src/v4/locales/ur.ts +0 -119
  616. package/node_modules/zod/src/v4/locales/uz.ts +0 -117
  617. package/node_modules/zod/src/v4/locales/vi.ts +0 -117
  618. package/node_modules/zod/src/v4/locales/yo.ts +0 -124
  619. package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -116
  620. package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -115
  621. package/node_modules/zod/src/v4/mini/checks.ts +0 -32
  622. package/node_modules/zod/src/v4/mini/coerce.ts +0 -27
  623. package/node_modules/zod/src/v4/mini/external.ts +0 -41
  624. package/node_modules/zod/src/v4/mini/index.ts +0 -3
  625. package/node_modules/zod/src/v4/mini/iso.ts +0 -66
  626. package/node_modules/zod/src/v4/mini/parse.ts +0 -14
  627. package/node_modules/zod/src/v4/mini/schemas.ts +0 -1947
  628. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -24
  629. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
  630. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
  631. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
  632. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -548
  633. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  634. package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
  635. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -5
  636. package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -993
  637. package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
  638. package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -227
  639. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  640. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -325
  641. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
  642. package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -352
  643. package/node_modules/zod/src/v4-mini/index.ts +0 -3
  644. package/node_modules/zod/v3/ZodError.cjs +0 -138
  645. package/node_modules/zod/v3/ZodError.d.cts +0 -164
  646. package/node_modules/zod/v3/ZodError.d.ts +0 -164
  647. package/node_modules/zod/v3/ZodError.js +0 -133
  648. package/node_modules/zod/v3/errors.cjs +0 -17
  649. package/node_modules/zod/v3/errors.d.cts +0 -5
  650. package/node_modules/zod/v3/errors.d.ts +0 -5
  651. package/node_modules/zod/v3/errors.js +0 -9
  652. package/node_modules/zod/v3/external.cjs +0 -22
  653. package/node_modules/zod/v3/external.d.cts +0 -6
  654. package/node_modules/zod/v3/external.d.ts +0 -6
  655. package/node_modules/zod/v3/external.js +0 -6
  656. package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  657. package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  658. package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  659. package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  660. package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  661. package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  662. package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  663. package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  664. package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  665. package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  666. package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  667. package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  668. package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  669. package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  670. package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  671. package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  672. package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  673. package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  674. package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  675. package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  676. package/node_modules/zod/v3/helpers/util.cjs +0 -137
  677. package/node_modules/zod/v3/helpers/util.d.cts +0 -85
  678. package/node_modules/zod/v3/helpers/util.d.ts +0 -85
  679. package/node_modules/zod/v3/helpers/util.js +0 -133
  680. package/node_modules/zod/v3/index.cjs +0 -33
  681. package/node_modules/zod/v3/index.d.cts +0 -4
  682. package/node_modules/zod/v3/index.d.ts +0 -4
  683. package/node_modules/zod/v3/index.js +0 -4
  684. package/node_modules/zod/v3/locales/en.cjs +0 -112
  685. package/node_modules/zod/v3/locales/en.d.cts +0 -3
  686. package/node_modules/zod/v3/locales/en.d.ts +0 -3
  687. package/node_modules/zod/v3/locales/en.js +0 -109
  688. package/node_modules/zod/v3/package.json +0 -7
  689. package/node_modules/zod/v3/standard-schema.cjs +0 -2
  690. package/node_modules/zod/v3/standard-schema.d.cts +0 -102
  691. package/node_modules/zod/v3/standard-schema.d.ts +0 -102
  692. package/node_modules/zod/v3/standard-schema.js +0 -1
  693. package/node_modules/zod/v3/types.cjs +0 -3777
  694. package/node_modules/zod/v3/types.d.cts +0 -1034
  695. package/node_modules/zod/v3/types.d.ts +0 -1034
  696. package/node_modules/zod/v3/types.js +0 -3695
  697. package/node_modules/zod/v4/classic/checks.cjs +0 -33
  698. package/node_modules/zod/v4/classic/checks.d.cts +0 -1
  699. package/node_modules/zod/v4/classic/checks.d.ts +0 -1
  700. package/node_modules/zod/v4/classic/checks.js +0 -1
  701. package/node_modules/zod/v4/classic/coerce.cjs +0 -47
  702. package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  703. package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  704. package/node_modules/zod/v4/classic/coerce.js +0 -17
  705. package/node_modules/zod/v4/classic/compat.cjs +0 -61
  706. package/node_modules/zod/v4/classic/compat.d.cts +0 -50
  707. package/node_modules/zod/v4/classic/compat.d.ts +0 -50
  708. package/node_modules/zod/v4/classic/compat.js +0 -31
  709. package/node_modules/zod/v4/classic/errors.cjs +0 -74
  710. package/node_modules/zod/v4/classic/errors.d.cts +0 -30
  711. package/node_modules/zod/v4/classic/errors.d.ts +0 -30
  712. package/node_modules/zod/v4/classic/errors.js +0 -48
  713. package/node_modules/zod/v4/classic/external.cjs +0 -73
  714. package/node_modules/zod/v4/classic/external.d.cts +0 -16
  715. package/node_modules/zod/v4/classic/external.d.ts +0 -16
  716. package/node_modules/zod/v4/classic/external.js +0 -20
  717. package/node_modules/zod/v4/classic/from-json-schema.cjs +0 -625
  718. package/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
  719. package/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
  720. package/node_modules/zod/v4/classic/from-json-schema.js +0 -599
  721. package/node_modules/zod/v4/classic/index.cjs +0 -33
  722. package/node_modules/zod/v4/classic/index.d.cts +0 -4
  723. package/node_modules/zod/v4/classic/index.d.ts +0 -4
  724. package/node_modules/zod/v4/classic/index.js +0 -4
  725. package/node_modules/zod/v4/classic/iso.cjs +0 -60
  726. package/node_modules/zod/v4/classic/iso.d.cts +0 -22
  727. package/node_modules/zod/v4/classic/iso.d.ts +0 -22
  728. package/node_modules/zod/v4/classic/iso.js +0 -30
  729. package/node_modules/zod/v4/classic/package.json +0 -7
  730. package/node_modules/zod/v4/classic/parse.cjs +0 -41
  731. package/node_modules/zod/v4/classic/parse.d.cts +0 -31
  732. package/node_modules/zod/v4/classic/parse.d.ts +0 -31
  733. package/node_modules/zod/v4/classic/parse.js +0 -15
  734. package/node_modules/zod/v4/classic/schemas.cjs +0 -1511
  735. package/node_modules/zod/v4/classic/schemas.d.cts +0 -767
  736. package/node_modules/zod/v4/classic/schemas.d.ts +0 -767
  737. package/node_modules/zod/v4/classic/schemas.js +0 -1395
  738. package/node_modules/zod/v4/core/api.cjs +0 -1227
  739. package/node_modules/zod/v4/core/api.d.cts +0 -325
  740. package/node_modules/zod/v4/core/api.d.ts +0 -325
  741. package/node_modules/zod/v4/core/api.js +0 -1087
  742. package/node_modules/zod/v4/core/checks.cjs +0 -601
  743. package/node_modules/zod/v4/core/checks.d.cts +0 -278
  744. package/node_modules/zod/v4/core/checks.d.ts +0 -278
  745. package/node_modules/zod/v4/core/checks.js +0 -575
  746. package/node_modules/zod/v4/core/core.cjs +0 -85
  747. package/node_modules/zod/v4/core/core.d.cts +0 -70
  748. package/node_modules/zod/v4/core/core.d.ts +0 -70
  749. package/node_modules/zod/v4/core/core.js +0 -78
  750. package/node_modules/zod/v4/core/doc.cjs +0 -39
  751. package/node_modules/zod/v4/core/doc.d.cts +0 -14
  752. package/node_modules/zod/v4/core/doc.d.ts +0 -14
  753. package/node_modules/zod/v4/core/doc.js +0 -35
  754. package/node_modules/zod/v4/core/errors.cjs +0 -216
  755. package/node_modules/zod/v4/core/errors.d.cts +0 -221
  756. package/node_modules/zod/v4/core/errors.d.ts +0 -221
  757. package/node_modules/zod/v4/core/errors.js +0 -185
  758. package/node_modules/zod/v4/core/index.cjs +0 -47
  759. package/node_modules/zod/v4/core/index.d.cts +0 -16
  760. package/node_modules/zod/v4/core/index.d.ts +0 -16
  761. package/node_modules/zod/v4/core/index.js +0 -16
  762. package/node_modules/zod/v4/core/json-schema-generator.cjs +0 -99
  763. package/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
  764. package/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
  765. package/node_modules/zod/v4/core/json-schema-generator.js +0 -95
  766. package/node_modules/zod/v4/core/json-schema-processors.cjs +0 -644
  767. package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -49
  768. package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -49
  769. package/node_modules/zod/v4/core/json-schema-processors.js +0 -601
  770. package/node_modules/zod/v4/core/json-schema.cjs +0 -2
  771. package/node_modules/zod/v4/core/json-schema.d.cts +0 -88
  772. package/node_modules/zod/v4/core/json-schema.d.ts +0 -88
  773. package/node_modules/zod/v4/core/json-schema.js +0 -1
  774. package/node_modules/zod/v4/core/package.json +0 -7
  775. package/node_modules/zod/v4/core/parse.cjs +0 -131
  776. package/node_modules/zod/v4/core/parse.d.cts +0 -49
  777. package/node_modules/zod/v4/core/parse.d.ts +0 -49
  778. package/node_modules/zod/v4/core/parse.js +0 -93
  779. package/node_modules/zod/v4/core/regexes.cjs +0 -172
  780. package/node_modules/zod/v4/core/regexes.d.cts +0 -85
  781. package/node_modules/zod/v4/core/regexes.d.ts +0 -85
  782. package/node_modules/zod/v4/core/regexes.js +0 -139
  783. package/node_modules/zod/v4/core/registries.cjs +0 -56
  784. package/node_modules/zod/v4/core/registries.d.cts +0 -35
  785. package/node_modules/zod/v4/core/registries.d.ts +0 -35
  786. package/node_modules/zod/v4/core/registries.js +0 -51
  787. package/node_modules/zod/v4/core/schemas.cjs +0 -2270
  788. package/node_modules/zod/v4/core/schemas.d.cts +0 -1184
  789. package/node_modules/zod/v4/core/schemas.d.ts +0 -1184
  790. package/node_modules/zod/v4/core/schemas.js +0 -2239
  791. package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
  792. package/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
  793. package/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
  794. package/node_modules/zod/v4/core/standard-schema.js +0 -1
  795. package/node_modules/zod/v4/core/to-json-schema.cjs +0 -457
  796. package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -114
  797. package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -114
  798. package/node_modules/zod/v4/core/to-json-schema.js +0 -448
  799. package/node_modules/zod/v4/core/util.cjs +0 -734
  800. package/node_modules/zod/v4/core/util.d.cts +0 -200
  801. package/node_modules/zod/v4/core/util.d.ts +0 -200
  802. package/node_modules/zod/v4/core/util.js +0 -674
  803. package/node_modules/zod/v4/core/versions.cjs +0 -8
  804. package/node_modules/zod/v4/core/versions.d.cts +0 -5
  805. package/node_modules/zod/v4/core/versions.d.ts +0 -5
  806. package/node_modules/zod/v4/core/versions.js +0 -5
  807. package/node_modules/zod/v4/index.cjs +0 -22
  808. package/node_modules/zod/v4/index.d.cts +0 -3
  809. package/node_modules/zod/v4/index.d.ts +0 -3
  810. package/node_modules/zod/v4/index.js +0 -3
  811. package/node_modules/zod/v4/locales/ar.cjs +0 -133
  812. package/node_modules/zod/v4/locales/ar.d.cts +0 -5
  813. package/node_modules/zod/v4/locales/ar.d.ts +0 -4
  814. package/node_modules/zod/v4/locales/ar.js +0 -106
  815. package/node_modules/zod/v4/locales/az.cjs +0 -132
  816. package/node_modules/zod/v4/locales/az.d.cts +0 -5
  817. package/node_modules/zod/v4/locales/az.d.ts +0 -4
  818. package/node_modules/zod/v4/locales/az.js +0 -105
  819. package/node_modules/zod/v4/locales/be.cjs +0 -183
  820. package/node_modules/zod/v4/locales/be.d.cts +0 -5
  821. package/node_modules/zod/v4/locales/be.d.ts +0 -4
  822. package/node_modules/zod/v4/locales/be.js +0 -156
  823. package/node_modules/zod/v4/locales/bg.cjs +0 -147
  824. package/node_modules/zod/v4/locales/bg.d.cts +0 -5
  825. package/node_modules/zod/v4/locales/bg.d.ts +0 -4
  826. package/node_modules/zod/v4/locales/bg.js +0 -120
  827. package/node_modules/zod/v4/locales/ca.cjs +0 -134
  828. package/node_modules/zod/v4/locales/ca.d.cts +0 -5
  829. package/node_modules/zod/v4/locales/ca.d.ts +0 -4
  830. package/node_modules/zod/v4/locales/ca.js +0 -107
  831. package/node_modules/zod/v4/locales/cs.cjs +0 -138
  832. package/node_modules/zod/v4/locales/cs.d.cts +0 -5
  833. package/node_modules/zod/v4/locales/cs.d.ts +0 -4
  834. package/node_modules/zod/v4/locales/cs.js +0 -111
  835. package/node_modules/zod/v4/locales/da.cjs +0 -142
  836. package/node_modules/zod/v4/locales/da.d.cts +0 -5
  837. package/node_modules/zod/v4/locales/da.d.ts +0 -4
  838. package/node_modules/zod/v4/locales/da.js +0 -115
  839. package/node_modules/zod/v4/locales/de.cjs +0 -135
  840. package/node_modules/zod/v4/locales/de.d.cts +0 -5
  841. package/node_modules/zod/v4/locales/de.d.ts +0 -4
  842. package/node_modules/zod/v4/locales/de.js +0 -108
  843. package/node_modules/zod/v4/locales/el.cjs +0 -136
  844. package/node_modules/zod/v4/locales/el.d.cts +0 -5
  845. package/node_modules/zod/v4/locales/el.d.ts +0 -4
  846. package/node_modules/zod/v4/locales/el.js +0 -109
  847. package/node_modules/zod/v4/locales/en.cjs +0 -140
  848. package/node_modules/zod/v4/locales/en.d.cts +0 -5
  849. package/node_modules/zod/v4/locales/en.d.ts +0 -4
  850. package/node_modules/zod/v4/locales/en.js +0 -113
  851. package/node_modules/zod/v4/locales/eo.cjs +0 -136
  852. package/node_modules/zod/v4/locales/eo.d.cts +0 -5
  853. package/node_modules/zod/v4/locales/eo.d.ts +0 -4
  854. package/node_modules/zod/v4/locales/eo.js +0 -109
  855. package/node_modules/zod/v4/locales/es.cjs +0 -159
  856. package/node_modules/zod/v4/locales/es.d.cts +0 -5
  857. package/node_modules/zod/v4/locales/es.d.ts +0 -4
  858. package/node_modules/zod/v4/locales/es.js +0 -132
  859. package/node_modules/zod/v4/locales/fa.cjs +0 -141
  860. package/node_modules/zod/v4/locales/fa.d.cts +0 -5
  861. package/node_modules/zod/v4/locales/fa.d.ts +0 -4
  862. package/node_modules/zod/v4/locales/fa.js +0 -114
  863. package/node_modules/zod/v4/locales/fi.cjs +0 -139
  864. package/node_modules/zod/v4/locales/fi.d.cts +0 -5
  865. package/node_modules/zod/v4/locales/fi.d.ts +0 -4
  866. package/node_modules/zod/v4/locales/fi.js +0 -112
  867. package/node_modules/zod/v4/locales/fr-CA.cjs +0 -134
  868. package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  869. package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  870. package/node_modules/zod/v4/locales/fr-CA.js +0 -107
  871. package/node_modules/zod/v4/locales/fr.cjs +0 -152
  872. package/node_modules/zod/v4/locales/fr.d.cts +0 -5
  873. package/node_modules/zod/v4/locales/fr.d.ts +0 -4
  874. package/node_modules/zod/v4/locales/fr.js +0 -125
  875. package/node_modules/zod/v4/locales/he.cjs +0 -241
  876. package/node_modules/zod/v4/locales/he.d.cts +0 -5
  877. package/node_modules/zod/v4/locales/he.d.ts +0 -4
  878. package/node_modules/zod/v4/locales/he.js +0 -214
  879. package/node_modules/zod/v4/locales/hr.cjs +0 -149
  880. package/node_modules/zod/v4/locales/hr.d.cts +0 -5
  881. package/node_modules/zod/v4/locales/hr.d.ts +0 -4
  882. package/node_modules/zod/v4/locales/hr.js +0 -122
  883. package/node_modules/zod/v4/locales/hu.cjs +0 -135
  884. package/node_modules/zod/v4/locales/hu.d.cts +0 -5
  885. package/node_modules/zod/v4/locales/hu.d.ts +0 -4
  886. package/node_modules/zod/v4/locales/hu.js +0 -108
  887. package/node_modules/zod/v4/locales/hy.cjs +0 -174
  888. package/node_modules/zod/v4/locales/hy.d.cts +0 -5
  889. package/node_modules/zod/v4/locales/hy.d.ts +0 -4
  890. package/node_modules/zod/v4/locales/hy.js +0 -147
  891. package/node_modules/zod/v4/locales/id.cjs +0 -133
  892. package/node_modules/zod/v4/locales/id.d.cts +0 -5
  893. package/node_modules/zod/v4/locales/id.d.ts +0 -4
  894. package/node_modules/zod/v4/locales/id.js +0 -106
  895. package/node_modules/zod/v4/locales/index.cjs +0 -111
  896. package/node_modules/zod/v4/locales/index.d.cts +0 -52
  897. package/node_modules/zod/v4/locales/index.d.ts +0 -52
  898. package/node_modules/zod/v4/locales/index.js +0 -52
  899. package/node_modules/zod/v4/locales/is.cjs +0 -136
  900. package/node_modules/zod/v4/locales/is.d.cts +0 -5
  901. package/node_modules/zod/v4/locales/is.d.ts +0 -4
  902. package/node_modules/zod/v4/locales/is.js +0 -109
  903. package/node_modules/zod/v4/locales/it.cjs +0 -135
  904. package/node_modules/zod/v4/locales/it.d.cts +0 -5
  905. package/node_modules/zod/v4/locales/it.d.ts +0 -4
  906. package/node_modules/zod/v4/locales/it.js +0 -108
  907. package/node_modules/zod/v4/locales/ja.cjs +0 -134
  908. package/node_modules/zod/v4/locales/ja.d.cts +0 -5
  909. package/node_modules/zod/v4/locales/ja.d.ts +0 -4
  910. package/node_modules/zod/v4/locales/ja.js +0 -107
  911. package/node_modules/zod/v4/locales/ka.cjs +0 -139
  912. package/node_modules/zod/v4/locales/ka.d.cts +0 -5
  913. package/node_modules/zod/v4/locales/ka.d.ts +0 -4
  914. package/node_modules/zod/v4/locales/ka.js +0 -112
  915. package/node_modules/zod/v4/locales/kh.cjs +0 -12
  916. package/node_modules/zod/v4/locales/kh.d.cts +0 -5
  917. package/node_modules/zod/v4/locales/kh.d.ts +0 -5
  918. package/node_modules/zod/v4/locales/kh.js +0 -5
  919. package/node_modules/zod/v4/locales/km.cjs +0 -137
  920. package/node_modules/zod/v4/locales/km.d.cts +0 -5
  921. package/node_modules/zod/v4/locales/km.d.ts +0 -4
  922. package/node_modules/zod/v4/locales/km.js +0 -110
  923. package/node_modules/zod/v4/locales/ko.cjs +0 -138
  924. package/node_modules/zod/v4/locales/ko.d.cts +0 -5
  925. package/node_modules/zod/v4/locales/ko.d.ts +0 -4
  926. package/node_modules/zod/v4/locales/ko.js +0 -111
  927. package/node_modules/zod/v4/locales/lt.cjs +0 -230
  928. package/node_modules/zod/v4/locales/lt.d.cts +0 -5
  929. package/node_modules/zod/v4/locales/lt.d.ts +0 -4
  930. package/node_modules/zod/v4/locales/lt.js +0 -203
  931. package/node_modules/zod/v4/locales/mk.cjs +0 -136
  932. package/node_modules/zod/v4/locales/mk.d.cts +0 -5
  933. package/node_modules/zod/v4/locales/mk.d.ts +0 -4
  934. package/node_modules/zod/v4/locales/mk.js +0 -109
  935. package/node_modules/zod/v4/locales/ms.cjs +0 -134
  936. package/node_modules/zod/v4/locales/ms.d.cts +0 -5
  937. package/node_modules/zod/v4/locales/ms.d.ts +0 -4
  938. package/node_modules/zod/v4/locales/ms.js +0 -107
  939. package/node_modules/zod/v4/locales/nl.cjs +0 -137
  940. package/node_modules/zod/v4/locales/nl.d.cts +0 -5
  941. package/node_modules/zod/v4/locales/nl.d.ts +0 -4
  942. package/node_modules/zod/v4/locales/nl.js +0 -110
  943. package/node_modules/zod/v4/locales/no.cjs +0 -135
  944. package/node_modules/zod/v4/locales/no.d.cts +0 -5
  945. package/node_modules/zod/v4/locales/no.d.ts +0 -4
  946. package/node_modules/zod/v4/locales/no.js +0 -108
  947. package/node_modules/zod/v4/locales/ota.cjs +0 -136
  948. package/node_modules/zod/v4/locales/ota.d.cts +0 -5
  949. package/node_modules/zod/v4/locales/ota.d.ts +0 -4
  950. package/node_modules/zod/v4/locales/ota.js +0 -109
  951. package/node_modules/zod/v4/locales/package.json +0 -7
  952. package/node_modules/zod/v4/locales/pl.cjs +0 -136
  953. package/node_modules/zod/v4/locales/pl.d.cts +0 -5
  954. package/node_modules/zod/v4/locales/pl.d.ts +0 -4
  955. package/node_modules/zod/v4/locales/pl.js +0 -109
  956. package/node_modules/zod/v4/locales/ps.cjs +0 -141
  957. package/node_modules/zod/v4/locales/ps.d.cts +0 -5
  958. package/node_modules/zod/v4/locales/ps.d.ts +0 -4
  959. package/node_modules/zod/v4/locales/ps.js +0 -114
  960. package/node_modules/zod/v4/locales/pt.cjs +0 -135
  961. package/node_modules/zod/v4/locales/pt.d.cts +0 -5
  962. package/node_modules/zod/v4/locales/pt.d.ts +0 -4
  963. package/node_modules/zod/v4/locales/pt.js +0 -108
  964. package/node_modules/zod/v4/locales/ro.cjs +0 -146
  965. package/node_modules/zod/v4/locales/ro.d.cts +0 -5
  966. package/node_modules/zod/v4/locales/ro.d.ts +0 -4
  967. package/node_modules/zod/v4/locales/ro.js +0 -119
  968. package/node_modules/zod/v4/locales/ru.cjs +0 -183
  969. package/node_modules/zod/v4/locales/ru.d.cts +0 -5
  970. package/node_modules/zod/v4/locales/ru.d.ts +0 -4
  971. package/node_modules/zod/v4/locales/ru.js +0 -156
  972. package/node_modules/zod/v4/locales/sl.cjs +0 -136
  973. package/node_modules/zod/v4/locales/sl.d.cts +0 -5
  974. package/node_modules/zod/v4/locales/sl.d.ts +0 -4
  975. package/node_modules/zod/v4/locales/sl.js +0 -109
  976. package/node_modules/zod/v4/locales/sv.cjs +0 -137
  977. package/node_modules/zod/v4/locales/sv.d.cts +0 -5
  978. package/node_modules/zod/v4/locales/sv.d.ts +0 -4
  979. package/node_modules/zod/v4/locales/sv.js +0 -110
  980. package/node_modules/zod/v4/locales/ta.cjs +0 -137
  981. package/node_modules/zod/v4/locales/ta.d.cts +0 -5
  982. package/node_modules/zod/v4/locales/ta.d.ts +0 -4
  983. package/node_modules/zod/v4/locales/ta.js +0 -110
  984. package/node_modules/zod/v4/locales/th.cjs +0 -137
  985. package/node_modules/zod/v4/locales/th.d.cts +0 -5
  986. package/node_modules/zod/v4/locales/th.d.ts +0 -4
  987. package/node_modules/zod/v4/locales/th.js +0 -110
  988. package/node_modules/zod/v4/locales/tr.cjs +0 -132
  989. package/node_modules/zod/v4/locales/tr.d.cts +0 -5
  990. package/node_modules/zod/v4/locales/tr.d.ts +0 -4
  991. package/node_modules/zod/v4/locales/tr.js +0 -105
  992. package/node_modules/zod/v4/locales/ua.cjs +0 -12
  993. package/node_modules/zod/v4/locales/ua.d.cts +0 -5
  994. package/node_modules/zod/v4/locales/ua.d.ts +0 -5
  995. package/node_modules/zod/v4/locales/ua.js +0 -5
  996. package/node_modules/zod/v4/locales/uk.cjs +0 -135
  997. package/node_modules/zod/v4/locales/uk.d.cts +0 -5
  998. package/node_modules/zod/v4/locales/uk.d.ts +0 -4
  999. package/node_modules/zod/v4/locales/uk.js +0 -108
  1000. package/node_modules/zod/v4/locales/ur.cjs +0 -137
  1001. package/node_modules/zod/v4/locales/ur.d.cts +0 -5
  1002. package/node_modules/zod/v4/locales/ur.d.ts +0 -4
  1003. package/node_modules/zod/v4/locales/ur.js +0 -110
  1004. package/node_modules/zod/v4/locales/uz.cjs +0 -137
  1005. package/node_modules/zod/v4/locales/uz.d.cts +0 -5
  1006. package/node_modules/zod/v4/locales/uz.d.ts +0 -4
  1007. package/node_modules/zod/v4/locales/uz.js +0 -110
  1008. package/node_modules/zod/v4/locales/vi.cjs +0 -135
  1009. package/node_modules/zod/v4/locales/vi.d.cts +0 -5
  1010. package/node_modules/zod/v4/locales/vi.d.ts +0 -4
  1011. package/node_modules/zod/v4/locales/vi.js +0 -108
  1012. package/node_modules/zod/v4/locales/yo.cjs +0 -134
  1013. package/node_modules/zod/v4/locales/yo.d.cts +0 -5
  1014. package/node_modules/zod/v4/locales/yo.d.ts +0 -4
  1015. package/node_modules/zod/v4/locales/yo.js +0 -107
  1016. package/node_modules/zod/v4/locales/zh-CN.cjs +0 -136
  1017. package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  1018. package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  1019. package/node_modules/zod/v4/locales/zh-CN.js +0 -109
  1020. package/node_modules/zod/v4/locales/zh-TW.cjs +0 -134
  1021. package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  1022. package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  1023. package/node_modules/zod/v4/locales/zh-TW.js +0 -107
  1024. package/node_modules/zod/v4/mini/checks.cjs +0 -34
  1025. package/node_modules/zod/v4/mini/checks.d.cts +0 -1
  1026. package/node_modules/zod/v4/mini/checks.d.ts +0 -1
  1027. package/node_modules/zod/v4/mini/checks.js +0 -1
  1028. package/node_modules/zod/v4/mini/coerce.cjs +0 -52
  1029. package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  1030. package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  1031. package/node_modules/zod/v4/mini/coerce.js +0 -22
  1032. package/node_modules/zod/v4/mini/external.cjs +0 -63
  1033. package/node_modules/zod/v4/mini/external.d.cts +0 -13
  1034. package/node_modules/zod/v4/mini/external.d.ts +0 -13
  1035. package/node_modules/zod/v4/mini/external.js +0 -14
  1036. package/node_modules/zod/v4/mini/index.cjs +0 -32
  1037. package/node_modules/zod/v4/mini/index.d.cts +0 -3
  1038. package/node_modules/zod/v4/mini/index.d.ts +0 -3
  1039. package/node_modules/zod/v4/mini/index.js +0 -3
  1040. package/node_modules/zod/v4/mini/iso.cjs +0 -64
  1041. package/node_modules/zod/v4/mini/iso.d.cts +0 -22
  1042. package/node_modules/zod/v4/mini/iso.d.ts +0 -22
  1043. package/node_modules/zod/v4/mini/iso.js +0 -34
  1044. package/node_modules/zod/v4/mini/package.json +0 -7
  1045. package/node_modules/zod/v4/mini/parse.cjs +0 -16
  1046. package/node_modules/zod/v4/mini/parse.d.cts +0 -1
  1047. package/node_modules/zod/v4/mini/parse.d.ts +0 -1
  1048. package/node_modules/zod/v4/mini/parse.js +0 -1
  1049. package/node_modules/zod/v4/mini/schemas.cjs +0 -1083
  1050. package/node_modules/zod/v4/mini/schemas.d.cts +0 -445
  1051. package/node_modules/zod/v4/mini/schemas.d.ts +0 -445
  1052. package/node_modules/zod/v4/mini/schemas.js +0 -961
  1053. package/node_modules/zod/v4/package.json +0 -7
  1054. package/node_modules/zod/v4-mini/index.cjs +0 -32
  1055. package/node_modules/zod/v4-mini/index.d.cts +0 -3
  1056. package/node_modules/zod/v4-mini/index.d.ts +0 -3
  1057. package/node_modules/zod/v4-mini/index.js +0 -3
  1058. package/node_modules/zod/v4-mini/package.json +0 -7
package/dist/index.js CHANGED
@@ -1,49 +1,27 @@
1
- import {
2
- resolvePublicFilePath,
3
- servePublicFile
4
- } from "./chunk-SMN75YED.js";
5
- import {
6
- registerOpenAPITools
7
- } from "./chunk-AATFAERC.js";
8
- import {
9
- completable,
10
- normalizeCompletions
11
- } from "./chunk-KIZ72TIK.js";
12
- import {
13
- synthesizeViewDocument
14
- } from "./chunk-XUI7QE2D.js";
15
- import {
16
- hasExplicitAssetsBase,
17
- originFromAssetsBase,
18
- resolveAssetsBase,
19
- resolveServerOrigin
20
- } from "./chunk-FC2Z2VFO.js";
21
1
  import {
22
2
  authInfoFromRequest,
23
- getOAuthProtectedResourceMetadataUrl,
24
- oauthMetadata,
25
- requireBearerAuth
26
- } from "./chunk-Z326HADF.js";
27
- import {
28
3
  composeFetch,
4
+ getOAuthProtectedResourceMetadataUrl,
29
5
  getRequestBag,
30
6
  hostValidationMiddleware,
31
- isHtmlNavigationRequest,
32
7
  jsonBodyMiddleware,
33
8
  matchesPath,
34
9
  matchesPathPrefix,
10
+ oauthMetadata,
35
11
  originValidationMiddleware,
36
- pathUnderBase,
37
12
  pathnameOf,
38
- routeFetch,
39
- toFrameworkHandler
40
- } from "./chunk-QUUANIE4.js";
13
+ requireBearerAuth,
14
+ routeFetch
15
+ } from "./chunk-SFI2T6TE.js";
41
16
  import {
42
17
  getOAuthProviderOptions,
43
18
  resolveConfiguredOAuthResource,
44
19
  resolveLocalOAuthResource,
45
20
  wrapOAuthTokenVerifier
46
21
  } from "./chunk-DPL7OEXC.js";
22
+ import {
23
+ registerOpenAPITools
24
+ } from "./chunk-AATFAERC.js";
47
25
 
48
26
  // src/server.ts
49
27
  import {
@@ -51,236 +29,9 @@ import {
51
29
  localhostAllowedOrigins,
52
30
  McpServer as SdkMcpServer,
53
31
  ResourceTemplate,
54
- isInputRequiredResult as isInputRequiredResult2
32
+ isInputRequiredResult
55
33
  } from "@modelcontextprotocol/server";
56
34
 
57
- // src/branding.ts
58
- var FAVICON_CACHE_CONTROL = "public, max-age=31536000, immutable";
59
- var FAVICON_REDIRECT_CACHE_CONTROL = "public, max-age=300";
60
- function protocolOf(value) {
61
- const match = /^([a-z][a-z\d+.-]*):/i.exec(value);
62
- return match?.[1]?.toLowerCase();
63
- }
64
- function publicAssetPath(basePath, source) {
65
- const prefix = basePath === "/" ? "" : basePath;
66
- return `${prefix}/_mcp-use/public/${source.split("/").map((segment) => encodeURIComponent(segment)).join("/")}`;
67
- }
68
- function isLocalPublicSource(source) {
69
- return protocolOf(source) === void 0;
70
- }
71
- function selectFaviconFromIcons(icons) {
72
- return icons[0];
73
- }
74
- function assertLocalPublicSource(source, field) {
75
- if (source.startsWith("/") || source.includes("\\") || source.includes("?") || source.includes("#") || source.split("/").some((segment) => segment === "" || segment === "..")) {
76
- throw new TypeError(
77
- `${field} must be an http(s) URL, image data URL, or safe path relative to public/`
78
- );
79
- }
80
- }
81
- function parseDataImage(source, field) {
82
- const comma = source.indexOf(",");
83
- if (comma < 0) {
84
- throw new TypeError(`${field} must be a valid image data URL`);
85
- }
86
- const metadata = source.slice(5, comma);
87
- const payload = source.slice(comma + 1);
88
- const parts = metadata.split(";");
89
- const mimeType = parts[0]?.toLowerCase() ?? "";
90
- if (!mimeType.startsWith("image/")) {
91
- throw new TypeError(`${field} data URL must use an image MIME type`);
92
- }
93
- try {
94
- if (parts.includes("base64")) {
95
- const binary = atob(payload);
96
- return {
97
- mimeType,
98
- bytes: Uint8Array.from(binary, (character) => character.charCodeAt(0))
99
- };
100
- }
101
- return {
102
- mimeType,
103
- bytes: new TextEncoder().encode(decodeURIComponent(payload))
104
- };
105
- } catch {
106
- throw new TypeError(`${field} must be a valid image data URL`);
107
- }
108
- }
109
- function assertBrandingSource(source, field) {
110
- if (typeof source !== "string" || source.length === 0) {
111
- throw new TypeError(`${field} must be a non-empty string`);
112
- }
113
- const protocol = protocolOf(source);
114
- if (protocol === void 0) {
115
- assertLocalPublicSource(source, field);
116
- return source;
117
- }
118
- if (protocol === "data") {
119
- parseDataImage(source, field);
120
- return source;
121
- }
122
- if (protocol !== "http" && protocol !== "https") {
123
- throw new TypeError(
124
- `${field} must be an http(s) URL, image data URL, or safe path relative to public/`
125
- );
126
- }
127
- try {
128
- new URL(source);
129
- } catch {
130
- throw new TypeError(`${field} must be a valid absolute http(s) URL`);
131
- }
132
- return source;
133
- }
134
- function normalizeServerBranding(config) {
135
- let websiteUrl;
136
- if (config.websiteUrl !== void 0) {
137
- if (typeof config.websiteUrl !== "string" || config.websiteUrl.length === 0) {
138
- throw new TypeError(
139
- "websiteUrl must be a non-empty absolute http(s) URL"
140
- );
141
- }
142
- let parsed;
143
- try {
144
- parsed = new URL(config.websiteUrl);
145
- } catch {
146
- throw new TypeError(
147
- "websiteUrl must be a non-empty absolute http(s) URL"
148
- );
149
- }
150
- if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
151
- throw new TypeError(
152
- "websiteUrl must be a non-empty absolute http(s) URL"
153
- );
154
- }
155
- websiteUrl = config.websiteUrl;
156
- }
157
- let icons;
158
- if (config.icons !== void 0) {
159
- if (!Array.isArray(config.icons)) {
160
- throw new TypeError("icons must be an array of MCP Icon objects");
161
- }
162
- icons = Object.freeze(
163
- config.icons.map((value, index) => {
164
- if (typeof value !== "object" || value === null) {
165
- throw new TypeError(`icons[${index}] must be an MCP Icon object`);
166
- }
167
- const icon = value;
168
- const src = assertBrandingSource(icon["src"], `icons[${index}].src`);
169
- const mimeType = icon["mimeType"];
170
- if (mimeType !== void 0 && (typeof mimeType !== "string" || !mimeType.toLowerCase().startsWith("image/"))) {
171
- throw new TypeError(
172
- `icons[${index}].mimeType must be an image MIME type when provided`
173
- );
174
- }
175
- const sizes = icon["sizes"];
176
- if (sizes !== void 0 && (!Array.isArray(sizes) || sizes.some((size) => typeof size !== "string" || size.length === 0))) {
177
- throw new TypeError(
178
- `icons[${index}].sizes must be an array of non-empty strings when provided`
179
- );
180
- }
181
- const normalizedSizes = sizes === void 0 ? void 0 : sizes.map((size) => size);
182
- const theme = icon["theme"];
183
- if (theme !== void 0 && theme !== "light" && theme !== "dark") {
184
- throw new TypeError(
185
- `icons[${index}].theme must be "light" or "dark" when provided`
186
- );
187
- }
188
- return Object.freeze({
189
- src,
190
- ...mimeType !== void 0 && { mimeType },
191
- ...normalizedSizes !== void 0 && {
192
- sizes: Object.freeze(normalizedSizes)
193
- },
194
- ...theme !== void 0 && { theme }
195
- });
196
- })
197
- );
198
- }
199
- const explicitFavicon = config.favicon === void 0 ? void 0 : assertBrandingSource(config.favicon, "favicon");
200
- const inferred = explicitFavicon === void 0 ? selectFaviconFromIcons(icons ?? []) : void 0;
201
- const favicon = explicitFavicon ?? inferred?.src;
202
- const faviconMimeType = inferred?.mimeType ?? icons?.find((icon) => icon.src === explicitFavicon)?.mimeType;
203
- return Object.freeze({
204
- ...favicon !== void 0 && { favicon },
205
- ...faviconMimeType !== void 0 && { faviconMimeType },
206
- ...icons !== void 0 && { icons },
207
- ...websiteUrl !== void 0 && { websiteUrl }
208
- });
209
- }
210
- function resolveImplementationIcons(icons, request, basePath) {
211
- if (icons === void 0) {
212
- return void 0;
213
- }
214
- return icons.map((icon) => ({
215
- ...icon,
216
- src: request !== void 0 && isLocalPublicSource(icon.src) ? `${resolveAssetsBase(request)}${publicAssetPath(basePath, icon.src)}` : icon.src,
217
- ...icon.sizes !== void 0 && { sizes: [...icon.sizes] }
218
- }));
219
- }
220
- function hasLocalBrandingAsset(branding) {
221
- return branding.favicon !== void 0 && isLocalPublicSource(branding.favicon) || branding.icons?.some((icon) => isLocalPublicSource(icon.src)) === true;
222
- }
223
- function createFaviconHandler(branding, options) {
224
- const source = branding.favicon;
225
- if (source === void 0) {
226
- return void 0;
227
- }
228
- return async (request) => {
229
- if (request.method !== "GET" && request.method !== "HEAD") {
230
- return new Response("Method Not Allowed", {
231
- status: 405,
232
- headers: { Allow: "GET, HEAD" }
233
- });
234
- }
235
- if (new URL(request.url).pathname !== "/favicon.ico") {
236
- return new Response("Not Found", { status: 404 });
237
- }
238
- const protocol = protocolOf(source);
239
- if (protocol === "http" || protocol === "https") {
240
- return new Response(null, {
241
- status: 307,
242
- headers: {
243
- Location: source,
244
- "Cache-Control": FAVICON_REDIRECT_CACHE_CONTROL
245
- }
246
- });
247
- }
248
- if (protocol === "data") {
249
- const data = parseDataImage(source, "favicon");
250
- return new Response(
251
- request.method === "HEAD" ? null : data.bytes.buffer,
252
- {
253
- status: 200,
254
- headers: {
255
- "Content-Type": branding.faviconMimeType ?? data.mimeType,
256
- "Cache-Control": FAVICON_CACHE_CONTROL,
257
- "X-Content-Type-Options": "nosniff"
258
- }
259
- }
260
- );
261
- }
262
- const { join } = await import("path");
263
- const publicRoot = options.dev ? join(options.projectRoot, "public") : join(options.projectRoot, ".mcp-use/build/views/public");
264
- const diskPath = await resolvePublicFilePath(publicRoot, source);
265
- if (diskPath === null) {
266
- return new Response("Not Found", {
267
- status: 404,
268
- headers: { "Cache-Control": "no-store" }
269
- });
270
- }
271
- const response = await servePublicFile(diskPath, {
272
- ...options.deferCors === true && { deferCors: true },
273
- ...request.method === "HEAD" && { head: true }
274
- });
275
- response.headers.set("Cache-Control", FAVICON_CACHE_CONTROL);
276
- response.headers.set("X-Content-Type-Options", "nosniff");
277
- if (branding.faviconMimeType !== void 0) {
278
- response.headers.set("Content-Type", branding.faviconMimeType);
279
- }
280
- return response;
281
- };
282
- }
283
-
284
35
  // src/config.ts
285
36
  function assertServerConfig(config) {
286
37
  if (config.basePath !== void 0) {
@@ -471,317 +222,12 @@ function toAuthenticatedRequestContext(ctx) {
471
222
  };
472
223
  }
473
224
 
474
- // src/middleware/cors.ts
475
- var DEFAULT_METHODS = ["GET", "HEAD", "POST", "OPTIONS"];
476
- var DEFAULT_ALLOWED_HEADERS = [
477
- "Content-Type",
478
- "Authorization",
479
- "mcp-protocol-version",
480
- "mcp-method",
481
- "mcp-name"
482
- ];
483
- function resolveAllowedOrigin(origin, requestOrigin) {
484
- if (origin === void 0) {
485
- return requestOrigin;
486
- }
487
- if (typeof origin === "function") {
488
- return origin(requestOrigin);
489
- }
490
- if (origin === "*") {
491
- return "*";
492
- }
493
- if (Array.isArray(origin)) {
494
- if (requestOrigin !== null && origin.includes(requestOrigin)) {
495
- return requestOrigin;
496
- }
497
- return null;
498
- }
499
- return origin;
500
- }
501
- function corsHeaders(options, request) {
502
- if (request.headers.has("Access-Control-Allow-Origin")) {
503
- return void 0;
504
- }
505
- const requestOrigin = request.headers.get("Origin");
506
- const allowedOrigin = resolveAllowedOrigin(options.origin, requestOrigin);
507
- if (allowedOrigin === null) {
508
- return void 0;
509
- }
510
- const headers = {
511
- "Access-Control-Allow-Origin": allowedOrigin,
512
- "Access-Control-Allow-Methods": options.methods.join(", "),
513
- "Access-Control-Allow-Headers": options.allowedHeaders.join(", ")
514
- };
515
- if (options.credentials) {
516
- headers["Access-Control-Allow-Credentials"] = "true";
517
- }
518
- if (allowedOrigin !== "*") {
519
- headers.Vary = "Origin";
520
- }
521
- return headers;
522
- }
523
- function mergeCorsHeaders(response, headers) {
524
- if (response.headers.has("Access-Control-Allow-Origin")) {
525
- return response;
526
- }
527
- const merged = new Headers(response.headers);
528
- const corsHeaders2 = new Headers(headers);
529
- corsHeaders2.forEach((value, key) => {
530
- merged.set(key, value);
531
- });
532
- return new Response(response.body, {
533
- status: response.status,
534
- statusText: response.statusText,
535
- headers: merged
536
- });
537
- }
538
- function corsFetchMiddleware(options) {
539
- const enabled = options.enabled !== false;
540
- if (!enabled) {
541
- return async (_request, next) => next();
542
- }
543
- const resolved = {
544
- ...options.origin !== void 0 && { origin: options.origin },
545
- methods: options.methods ?? DEFAULT_METHODS,
546
- allowedHeaders: options.allowedHeaders ?? DEFAULT_ALLOWED_HEADERS,
547
- credentials: options.credentials ?? false
548
- };
549
- return async (request, next) => {
550
- const headers = corsHeaders(resolved, request);
551
- if (headers === void 0) {
552
- return next();
553
- }
554
- if (request.method === "OPTIONS") {
555
- return new Response(null, { status: 204, headers });
556
- }
557
- const response = await next();
558
- return mergeCorsHeaders(response, headers);
559
- };
560
- }
561
- function isGlobalCorsEnabled(cors) {
562
- return cors !== void 0 && cors.enabled !== false;
563
- }
564
-
565
- // src/middleware/mcp-middleware.ts
566
- import {
567
- CallToolResultSchema,
568
- GetPromptResultSchema,
569
- ListPromptsResultSchema,
570
- ListResourcesResultSchema,
571
- ListToolsResultSchema,
572
- ReadResourceResultSchema
573
- } from "@modelcontextprotocol/core";
574
- import { isInputRequiredResult } from "@modelcontextprotocol/server";
575
- var MCP_MIDDLEWARE_METHODS = [
576
- "tools/call",
577
- "tools/list",
578
- "resources/read",
579
- "resources/list",
580
- "prompts/get",
581
- "prompts/list"
582
- ];
583
- function withMcpMiddlewareParams(request, params) {
584
- if (typeof request !== "object" || request === null || Array.isArray(request)) {
585
- throw new TypeError(
586
- "[mcp-use] MCP middleware received an invalid downstream request"
587
- );
588
- }
589
- return { ...request, params };
590
- }
591
- function createMcpMiddlewareEntry(pattern, handler) {
592
- const normalizedPattern = normalizeMcpMiddlewarePattern(pattern);
593
- const invoke = handler;
594
- if (normalizedPattern !== "*" && !isMcpMiddlewareMethod(normalizedPattern)) {
595
- throw new TypeError(
596
- `Unsupported MCP middleware pattern "${pattern}". Use an exact MCP method or "mcp:*".`
597
- );
598
- }
599
- if (normalizedPattern === "*") {
600
- return {
601
- pattern: normalizedPattern,
602
- handler: async (ctx, next) => {
603
- let downstreamCalled = false;
604
- let downstreamResult;
605
- await invoke(ctx, async () => {
606
- downstreamResult = await next();
607
- downstreamCalled = true;
608
- });
609
- if (!downstreamCalled) {
610
- throw new Error(
611
- `Wildcard MCP middleware "${normalizedPattern}" must call next()`
612
- );
613
- }
614
- return downstreamResult;
615
- }
616
- };
617
- }
618
- return {
619
- pattern: normalizedPattern,
620
- handler: (ctx, next) => invoke(ctx, next)
621
- };
622
- }
623
- function createMcpEventListenerEntry(pattern, handler) {
624
- const { pattern: normalizedPattern, phase } = parseMcpPattern(pattern);
625
- const invoke = handler;
626
- return {
627
- pattern: normalizedPattern,
628
- phase,
629
- handler: (ctx, result) => invoke(ctx, result)
630
- };
631
- }
632
- function matchesPattern(pattern, method) {
633
- if (pattern === "*") return true;
634
- if (pattern.endsWith("/*")) {
635
- const prefix = pattern.slice(0, -1);
636
- return method.startsWith(prefix);
637
- }
638
- return pattern === method;
639
- }
640
- function isMcpMiddlewareMethod(value) {
641
- return MCP_MIDDLEWARE_METHODS.some((method) => method === value);
642
- }
643
- function composeMiddleware(entries, method, innerFn) {
644
- const matching = entries.filter(
645
- (entry) => matchesPattern(entry.pattern, method)
646
- );
647
- if (matching.length === 0) {
648
- return (_ctx) => innerFn();
649
- }
650
- return (ctx) => {
651
- let index = -1;
652
- const dispatch = (i) => {
653
- if (i <= index) {
654
- return Promise.reject(new Error("next() called multiple times"));
655
- }
656
- index = i;
657
- if (i === matching.length) {
658
- return innerFn();
659
- }
660
- const entry = matching[i];
661
- return entry.handler(ctx, () => dispatch(i + 1));
662
- };
663
- return dispatch(0);
664
- };
665
- }
666
- function freezeMiddlewareContext(ctx) {
667
- return Object.freeze({
668
- method: ctx.method,
669
- params: Object.freeze({ ...ctx.params }),
670
- ...ctx.session !== void 0 && {
671
- session: Object.freeze({ ...ctx.session })
672
- },
673
- ...ctx.auth !== void 0 && { auth: ctx.auth },
674
- state: new Map(ctx.state)
675
- });
676
- }
677
- async function runMcpOperation(middlewares, events, method, ctx, innerFn) {
678
- dispatchMcpEvents(events, method, "before", ctx);
679
- const chained = composeMiddleware(middlewares, method, innerFn);
680
- const result = await chained(ctx);
681
- assertValidMiddlewareResult(method, result);
682
- dispatchMcpEvents(events, method, "complete", ctx, result);
683
- return result;
684
- }
685
- function assertValidMiddlewareResult(method, result) {
686
- if ((method === "tools/call" || method === "resources/read" || method === "prompts/get") && isInputRequiredResult(result)) {
687
- return;
688
- }
689
- const validation = (() => {
690
- switch (method) {
691
- case "tools/call":
692
- assertArrayProperty(method, result, "content");
693
- return CallToolResultSchema.safeParse(result);
694
- case "tools/list":
695
- assertArrayResult(method, result);
696
- return ListToolsResultSchema.safeParse({ tools: result });
697
- case "resources/read":
698
- assertArrayProperty(method, result, "contents");
699
- return ReadResourceResultSchema.safeParse(result);
700
- case "resources/list":
701
- assertArrayResult(method, result);
702
- return ListResourcesResultSchema.safeParse({ resources: result });
703
- case "prompts/get":
704
- assertArrayProperty(method, result, "messages");
705
- return GetPromptResultSchema.safeParse(result);
706
- case "prompts/list":
707
- assertArrayResult(method, result);
708
- return ListPromptsResultSchema.safeParse({ prompts: result });
709
- default:
710
- throw new TypeError(`Unsupported MCP middleware method "${method}"`);
711
- }
712
- })();
713
- if (!validation.success) {
714
- throw new TypeError(
715
- `[mcp-use] ${method} middleware returned an invalid result: ${validation.error.message}`
716
- );
717
- }
718
- }
719
- function assertArrayResult(method, result) {
720
- if (!Array.isArray(result)) {
721
- throw new TypeError(
722
- `[mcp-use] ${method} middleware returned an invalid result: expected an array`
723
- );
724
- }
725
- }
726
- function assertArrayProperty(method, result, property) {
727
- if (typeof result !== "object" || result === null || !Array.isArray(result[property])) {
728
- throw new TypeError(
729
- `[mcp-use] ${method} middleware returned an invalid result: expected a ${property} array`
730
- );
731
- }
732
- }
733
- function dispatchMcpEvents(events, method, phase, ctx, result) {
734
- const frozen = freezeMiddlewareContext(ctx);
735
- for (const entry of events) {
736
- if (entry.phase !== phase || !matchesPattern(entry.pattern, method)) {
737
- continue;
738
- }
739
- try {
740
- entry.handler(frozen, result);
741
- } catch (error) {
742
- console.error(
743
- `[mcp-use] MCP event listener for "${entry.pattern}" (${phase}) threw:`,
744
- error
745
- );
746
- }
747
- }
748
- }
749
- function parseMcpPattern(raw) {
750
- const pattern = raw.startsWith("mcp:") ? raw.slice(4) : raw;
751
- if (pattern.endsWith(":complete")) {
752
- return {
753
- pattern: pattern.slice(0, -":complete".length),
754
- phase: "complete"
755
- };
756
- }
757
- return { pattern, phase: "before" };
758
- }
759
- function normalizeMcpMiddlewarePattern(raw) {
760
- return raw.startsWith("mcp:") ? raw.slice(4) : raw;
761
- }
762
-
763
225
  // src/inspector-shell.ts
764
226
  var INSPECTOR_TAG = "beta";
765
227
  var DEFAULT_INSPECTOR_ASSETS_URL = `https://cdn.jsdelivr.net/npm/@mcp-use/inspector@${INSPECTOR_TAG}/dist/cdn/inspector.js`;
766
228
  function inspectorStylesUrl(assetsUrl) {
767
229
  return assetsUrl.replace(/\.js(?=$|[?#])/, ".css");
768
230
  }
769
- function isDefaultJsdelivrInspectorUrl(url) {
770
- return url.startsWith("https://cdn.jsdelivr.net/npm/@mcp-use/inspector@");
771
- }
772
- function withInspectorCacheBust(assetsUrl) {
773
- if (!isDefaultJsdelivrInspectorUrl(assetsUrl)) return assetsUrl;
774
- const sep = assetsUrl.includes("?") ? "&" : "?";
775
- return `${assetsUrl}${sep}cb=${crypto.randomUUID()}`;
776
- }
777
- function matchesInspectorShellPath(pathname, basePath) {
778
- const prefix = pathUnderBase(basePath, "inspector");
779
- if (pathname !== prefix && !pathname.startsWith(`${prefix}/`)) {
780
- return false;
781
- }
782
- const suffix = pathname.slice(prefix.length);
783
- return suffix !== "/api" && !suffix.startsWith("/api/");
784
- }
785
231
  function escapeHtml(value) {
786
232
  return value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#39;");
787
233
  }
@@ -789,18 +235,10 @@ function serializeForInlineScript(value) {
789
235
  return JSON.stringify(value).replaceAll("<", "\\u003c");
790
236
  }
791
237
  function renderInspectorShell(options) {
792
- const {
793
- serverName,
794
- basePath,
795
- faviconHref,
796
- faviconType,
797
- assetsUrl,
798
- manufactChatUrl
799
- } = options;
238
+ const { serverName, basePath, assetsUrl, manufactChatUrl } = options;
800
239
  const serializedBasePath = serializeForInlineScript(basePath);
801
240
  const serializedManufactChatUrl = manufactChatUrl ? serializeForInlineScript(manufactChatUrl) : null;
802
- const rawUrl = assetsUrl ?? DEFAULT_INSPECTOR_ASSETS_URL;
803
- const bundleUrl = withInspectorCacheBust(rawUrl);
241
+ const bundleUrl = assetsUrl ?? DEFAULT_INSPECTOR_ASSETS_URL;
804
242
  const scriptSrc = escapeHtml(bundleUrl);
805
243
  const stylesHref = escapeHtml(inspectorStylesUrl(bundleUrl));
806
244
  return `<!doctype html>
@@ -809,7 +247,6 @@ function renderInspectorShell(options) {
809
247
  <meta charset="utf-8" />
810
248
  <meta name="viewport" content="width=device-width, initial-scale=1" />
811
249
  <title>${escapeHtml(serverName)} \u2014 MCP Inspector</title>
812
- ${faviconHref !== void 0 ? `<link rel="icon"${faviconType !== void 0 ? ` type="${escapeHtml(faviconType)}"` : ""} href="${escapeHtml(faviconHref)}" />` : ""}
813
250
  <link rel="preconnect" href="https://fonts.googleapis.com" />
814
251
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
815
252
  <link
@@ -820,65 +257,10 @@ function renderInspectorShell(options) {
820
257
  <style>
821
258
  :root { color-scheme: light dark; }
822
259
  html, body { height: 100%; margin: 0; background-color: #f3f3f3; }
823
- #root { height: 100%; }
824
- .mcp-boot {
825
- display: flex;
826
- height: 100%;
827
- align-items: center;
828
- justify-content: center;
829
- background-color: #f3f3f3;
830
- }
831
- .mcp-boot-inner {
832
- display: flex;
833
- flex-direction: column;
834
- align-items: center;
835
- gap: 16px;
836
- }
837
- .mcp-boot-spinner {
838
- width: 32px;
839
- height: 32px;
840
- color: #52525b;
841
- animation: mcp-boot-spin 1s linear infinite;
842
- }
843
- .mcp-boot-label {
844
- margin: 0;
845
- font-family: Ubuntu, sans-serif;
846
- font-size: 0.875rem;
847
- line-height: 1.25rem;
848
- color: #52525b;
849
- }
850
- @keyframes mcp-boot-spin {
851
- to { transform: rotate(360deg); }
852
- }
853
- @media (prefers-color-scheme: dark) {
854
- html, body { background-color: #000; }
855
- .mcp-boot { background-color: #000; }
856
- .mcp-boot-spinner, .mcp-boot-label { color: #a1a1aa; }
857
- }
858
260
  </style>
859
261
  </head>
860
262
  <body>
861
- <div id="root">
862
- <div class="mcp-boot">
863
- <div class="mcp-boot-inner">
864
- <svg
865
- class="mcp-boot-spinner"
866
- xmlns="http://www.w3.org/2000/svg"
867
- viewBox="0 0 24 24"
868
- fill="none"
869
- stroke="currentColor"
870
- stroke-width="2"
871
- stroke-linecap="round"
872
- stroke-linejoin="round"
873
- role="status"
874
- aria-label="Loading"
875
- >
876
- <path d="M21 12a9 9 0 1 1-6.219-8.56" />
877
- </svg>
878
- <p class="mcp-boot-label">Connecting to MCP server...</p>
879
- </div>
880
- </div>
881
- </div>
263
+ <div id="root"></div>
882
264
  <script>
883
265
  (function () {
884
266
  var basePath = ${serializedBasePath};
@@ -890,7 +272,6 @@ function renderInspectorShell(options) {
890
272
  };
891
273
  // Read by the current inspector bundle to derive its own URLs.
892
274
  window.__MCP_BASE_PATH__ = basePath;
893
- ${process.env.MCP_USE_DEV_CLI === "1" ? "window.__MCP_DEV_CLI__ = true;" : ""}
894
275
  ${serializedManufactChatUrl ? `window.__MANUFACT_CHAT_URL__ = ${serializedManufactChatUrl};` : ""}
895
276
  // The bundle carries Node-flavored dependencies that touch \`process\`
896
277
  // at module scope; give them the same browser polyfill the v1
@@ -923,27 +304,22 @@ function createInspectorHandler(inspector, options) {
923
304
  const { assetsUrl: configAssetsUrl, manufactChatUrl: configManufactChatUrl } = inspector ?? {};
924
305
  const assetsUrl = configAssetsUrl ?? process.env["MCP_USE_INSPECTOR_ASSETS_URL"] ?? void 0;
925
306
  const manufactChatUrl = configManufactChatUrl ?? process.env["MANUFACT_CHAT_URL"] ?? void 0;
926
- const shellOptions = {
307
+ const html = renderInspectorShell({
927
308
  serverName: options.serverName,
928
309
  basePath: options.basePath,
929
- ...options.faviconHref !== void 0 && {
930
- faviconHref: options.faviconHref
931
- },
932
- ...options.faviconType !== void 0 && {
933
- faviconType: options.faviconType
934
- },
935
310
  assetsUrl,
936
311
  manufactChatUrl
937
- };
312
+ });
313
+ const path = `${options.basePath}/inspector`;
314
+ const slashPath = `${path}/`;
938
315
  return async (request) => {
939
316
  if (request.method !== "GET" && request.method !== "HEAD") {
940
317
  return new Response("Method Not Allowed", { status: 405 });
941
318
  }
942
319
  const pathname = new URL(request.url).pathname;
943
- if (!matchesInspectorShellPath(pathname, options.basePath)) {
320
+ if (pathname !== path && pathname !== slashPath) {
944
321
  return new Response("Not Found", { status: 404 });
945
322
  }
946
- const html = renderInspectorShell(shellOptions);
947
323
  return new Response(request.method === "HEAD" ? null : html, {
948
324
  status: 200,
949
325
  headers: { "content-type": "text/html; charset=utf-8" }
@@ -1333,6 +709,9 @@ function createMcpMount(factory, options = {}) {
1333
709
  };
1334
710
  return { handler, fetch };
1335
711
  }
712
+ function mountMcp(factory, options = {}) {
713
+ return createMcpMount(factory, options);
714
+ }
1336
715
 
1337
716
  // src/tools.ts
1338
717
  function resolveToolInputSchema(definition) {
@@ -1342,148 +721,117 @@ function resolveToolInputSchema(definition) {
1342
721
  // src/views/register.ts
1343
722
  var registerViews = /* @__PURE__ */ Symbol("mcp-use/registerViews");
1344
723
 
1345
- // src/views/csp-env.ts
1346
- var CATEGORY_ENV = {
1347
- connectDomains: "CSP_CONNECT_DOMAINS",
1348
- resourceDomains: "CSP_RESOURCE_DOMAINS",
1349
- frameDomains: "CSP_FRAME_DOMAINS",
1350
- baseUriDomains: "CSP_BASE_URI_DOMAINS"
1351
- };
1352
- function parseDomainList(raw) {
1353
- if (raw === void 0 || raw.trim() === "") {
1354
- return [];
724
+ // src/views/document.ts
725
+ function resolveAssetUrl(assetPath, origin) {
726
+ if (!assetPath.startsWith("/")) {
727
+ throw new Error(
728
+ `View manifest asset path must be origin-absolute (start with "/"); got ${JSON.stringify(assetPath)}`
729
+ );
1355
730
  }
1356
- return raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
731
+ return `${origin}${assetPath}`;
1357
732
  }
1358
- function readEnvDomains(name) {
1359
- if (typeof process === "undefined") {
1360
- return void 0;
1361
- }
1362
- const raw = process.env[name];
1363
- if (raw === void 0 || raw.trim() === "") {
1364
- return void 0;
1365
- }
1366
- return parseDomainList(raw);
733
+ function resolvePublicBase(origin, basePath) {
734
+ return `${origin}${basePath}/_mcp-use/public/`;
1367
735
  }
1368
- function readCspUrlsShortcut() {
1369
- return readEnvDomains("CSP_URLS") ?? [];
736
+ function escapeInlineScript(code) {
737
+ return code.replaceAll(/<\/script/gi, "<\\/script").replaceAll("<!--", "\\x3C!--");
1370
738
  }
1371
- function readEnvDomainsForCategory(category) {
1372
- const perCategory = readEnvDomains(CATEGORY_ENV[category]);
1373
- if (perCategory !== void 0) {
1374
- return perCategory;
1375
- }
1376
- return readCspUrlsShortcut();
739
+ function escapeInlineStyle(css) {
740
+ return css.replaceAll(/<\/style/gi, "<\\/style");
1377
741
  }
1378
- function mergeDomainLists(...segments) {
1379
- const seen = /* @__PURE__ */ new Set();
1380
- const out = [];
1381
- for (const segment of segments) {
1382
- for (const domain of segment) {
1383
- if (!seen.has(domain)) {
1384
- seen.add(domain);
1385
- out.push(domain);
1386
- }
1387
- }
1388
- }
1389
- return out;
742
+ function escapeHtml2(value) {
743
+ return value.replaceAll("&", "&amp;").replaceAll('"', "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
1390
744
  }
1391
- function toWebSocketOrigin(serverOrigin) {
1392
- if (serverOrigin.startsWith("https://")) {
1393
- return `wss://${serverOrigin.slice("https://".length)}`;
1394
- }
1395
- if (serverOrigin.startsWith("http://")) {
1396
- return `ws://${serverOrigin.slice("http://".length)}`;
1397
- }
1398
- return serverOrigin;
745
+ function synthesizeViewDocument(entry, origin, basePath) {
746
+ const viewConfig = {
747
+ publicBase: resolvePublicBase(origin, basePath)
748
+ };
749
+ const configScript = `<script>globalThis.__mcpUseViewConfig=${JSON.stringify(viewConfig)};</script>`;
750
+ if (entry.kind === "inline") {
751
+ const styleTag = entry.css.length > 0 ? `<style>${escapeInlineStyle(entry.css)}</style>` : "";
752
+ const moduleScript = `<script type="module">${escapeInlineScript(entry.js)}</script>`;
753
+ return `<!doctype html>
754
+ <html>
755
+ <head>
756
+ <meta charset="utf-8">
757
+ ${configScript}
758
+ ${styleTag}
759
+ </head>
760
+ <body>
761
+ <div id="root"></div>
762
+ ${moduleScript}
763
+ </body>
764
+ </html>`;
765
+ }
766
+ const cssLinks = entry.css.map(
767
+ (path) => `<link rel="stylesheet" href="${escapeHtml2(resolveAssetUrl(path, origin))}">`
768
+ ).join("\n");
769
+ const scriptTags = (entry.scripts ?? []).map(
770
+ (path) => `<script type="module" src="${escapeHtml2(resolveAssetUrl(path, origin))}"></script>`
771
+ ).join("\n");
772
+ const entryUrl = resolveAssetUrl(entry.entry, origin);
773
+ return `<!doctype html>
774
+ <html>
775
+ <head>
776
+ <meta charset="utf-8">
777
+ ${configScript}
778
+ ${cssLinks}
779
+ </head>
780
+ <body>
781
+ <div id="root"></div>
782
+ ${scriptTags}
783
+ <script type="module" src="${escapeHtml2(entryUrl)}"></script>
784
+ </body>
785
+ </html>`;
1399
786
  }
1400
- function buildMergedResourceCsp(authorFacts, options) {
1401
- const author = authorFacts?.csp;
1402
- const mcpConnectAuto = [];
1403
- if (options.serverOrigin !== "") {
1404
- mcpConnectAuto.push(options.serverOrigin);
1405
- if (options.hmrWs === true) {
1406
- mcpConnectAuto.push(toWebSocketOrigin(options.serverOrigin));
787
+
788
+ // src/views/origin.ts
789
+ function resolveRequestOrigin(request) {
790
+ const forwarded = request.headers.get("forwarded");
791
+ if (forwarded !== null) {
792
+ const fromForwarded = parseForwardedHeader(forwarded);
793
+ if (fromForwarded !== void 0) {
794
+ return fromForwarded;
795
+ }
796
+ }
797
+ const proto = request.headers.get("x-forwarded-proto");
798
+ const host = request.headers.get("x-forwarded-host");
799
+ if (proto !== null && host !== null) {
800
+ const firstHost = host.split(",")[0]?.trim();
801
+ const firstProto = proto.split(",")[0]?.trim();
802
+ if (firstHost !== void 0 && firstProto !== void 0 && firstHost !== "") {
803
+ return `${firstProto}://${firstHost}`;
804
+ }
805
+ }
806
+ return new URL(request.url).origin;
807
+ }
808
+ function parseForwardedHeader(header) {
809
+ for (const part of header.split(",")) {
810
+ const params = /* @__PURE__ */ new Map();
811
+ for (const token of part.split(";")) {
812
+ const [key, ...rest] = token.trim().split("=");
813
+ if (key === void 0 || rest.length === 0) {
814
+ continue;
815
+ }
816
+ params.set(key.toLowerCase(), rest.join("=").replace(/^"|"$/g, ""));
817
+ }
818
+ const proto = params.get("proto");
819
+ const host = params.get("host");
820
+ if (proto !== void 0 && host !== void 0) {
821
+ return `${proto}://${host}`;
1407
822
  }
1408
823
  }
1409
- const mcpResourceAuto = [];
1410
- const resourceOrigin = options.explicitAssetsBase ? options.assetsOrigin : options.serverOrigin;
1411
- if (resourceOrigin !== "") {
1412
- mcpResourceAuto.push(resourceOrigin);
1413
- }
1414
- const connectDomains = mergeDomainLists(
1415
- author?.connectDomains ?? [],
1416
- readEnvDomainsForCategory("connectDomains"),
1417
- mcpConnectAuto
1418
- );
1419
- const resourceDomains = mergeDomainLists(
1420
- author?.resourceDomains ?? [],
1421
- readEnvDomainsForCategory("resourceDomains"),
1422
- mcpResourceAuto
1423
- );
1424
- const frameDomains = mergeDomainLists(
1425
- author?.frameDomains ?? [],
1426
- readEnvDomainsForCategory("frameDomains")
1427
- );
1428
- const baseUriDomains = mergeDomainLists(
1429
- author?.baseUriDomains ?? [],
1430
- readEnvDomainsForCategory("baseUriDomains")
1431
- );
1432
- return {
1433
- ...author,
1434
- connectDomains,
1435
- resourceDomains,
1436
- frameDomains,
1437
- baseUriDomains
1438
- };
824
+ return void 0;
1439
825
  }
1440
826
 
1441
827
  // src/views/routes.ts
1442
828
  var PUBLIC_BUILD_DIR = ".mcp-use/build/views/public";
1443
829
  var PUBLIC_DEV_DIR = "public";
1444
- var VIEW_ASSETS_BUILD_ROOT = ".mcp-use/build/views";
1445
- function createViewAssetsHandler(basePath, views, options) {
1446
- if (views.size === 0) {
1447
- return void 0;
1448
- }
1449
- const assetsPrefix = pathUnderBase(basePath, "_mcp-use/views");
1450
- const projectRoot = options?.projectRoot ?? process.cwd();
1451
- return async (request) => {
1452
- if (request.method !== "GET" && request.method !== "HEAD") {
1453
- return new Response("Method Not Allowed", { status: 405 });
1454
- }
1455
- if (!matchesPathPrefix(request, assetsPrefix)) {
1456
- return new Response("Not Found", { status: 404 });
1457
- }
1458
- const pathname = pathnameOf(request);
1459
- const remainder = pathname.slice(assetsPrefix.length + 1);
1460
- const slash = remainder.indexOf("/");
1461
- if (slash <= 0 || slash === remainder.length - 1) {
1462
- return new Response("Not Found", { status: 404 });
1463
- }
1464
- const viewName = remainder.slice(0, slash);
1465
- const subpath = remainder.slice(slash + 1);
1466
- const entry = views.get(viewName);
1467
- if (entry === void 0 || entry.kind !== "external") {
1468
- return new Response("Not Found", { status: 404 });
1469
- }
1470
- const [{ join }, { resolvePublicFilePath: resolvePublicFilePath2, servePublicFile: servePublicFile2 }] = await Promise.all([import("path"), import("./public-route-5JEGFEIN.js")]);
1471
- const viewRoot = join(projectRoot, VIEW_ASSETS_BUILD_ROOT, viewName);
1472
- const diskPath = await resolvePublicFilePath2(viewRoot, subpath);
1473
- if (diskPath === null) {
1474
- return new Response("Not Found", { status: 404 });
1475
- }
1476
- return await servePublicFile2(diskPath, {
1477
- ...options?.deferCors === true && { deferCors: true },
1478
- ...request.method === "HEAD" && { head: true }
1479
- });
1480
- };
1481
- }
1482
830
  function createViewPublicHandler(basePath, views, options) {
1483
- if (views.size === 0 && options?.enabled !== true) {
831
+ if (views.size === 0) {
1484
832
  return void 0;
1485
833
  }
1486
- const publicPrefix = pathUnderBase(basePath, "_mcp-use/public");
834
+ const publicPrefix = `${basePath}/_mcp-use/public`;
1487
835
  const subdir = options?.dev === true ? PUBLIC_DEV_DIR : PUBLIC_BUILD_DIR;
1488
836
  const projectRoot = options?.projectRoot ?? process.cwd();
1489
837
  return async (request) => {
@@ -1494,53 +842,34 @@ function createViewPublicHandler(basePath, views, options) {
1494
842
  return new Response("Not Found", { status: 404 });
1495
843
  }
1496
844
  const pathname = pathnameOf(request);
1497
- const encodedSubpath = pathname.slice(publicPrefix.length + 1);
1498
- let subpath;
1499
- try {
1500
- subpath = decodeURIComponent(encodedSubpath);
1501
- } catch {
1502
- return new Response("Not Found", { status: 404 });
1503
- }
845
+ const subpath = pathname.slice(publicPrefix.length + 1);
1504
846
  if (subpath.length === 0) {
1505
847
  return new Response("Not Found", { status: 404 });
1506
848
  }
1507
- const [{ join }, { resolvePublicFilePath: resolvePublicFilePath2, servePublicFile: servePublicFile2 }] = await Promise.all([import("path"), import("./public-route-5JEGFEIN.js")]);
849
+ const [{ join }, { resolvePublicFilePath, servePublicFile }] = await Promise.all([import("path"), import("./public-route-7IK5D7V7.js")]);
1508
850
  const publicRoot = join(projectRoot, subdir);
1509
- const diskPath = await resolvePublicFilePath2(publicRoot, subpath);
851
+ const diskPath = await resolvePublicFilePath(publicRoot, subpath);
1510
852
  if (diskPath === null) {
1511
853
  return new Response("Not Found", { status: 404 });
1512
854
  }
1513
- return await servePublicFile2(diskPath, {
1514
- ...options?.deferCors === true && { deferCors: true },
1515
- ...request.method === "HEAD" && { head: true }
1516
- });
855
+ return await servePublicFile(diskPath);
1517
856
  };
1518
857
  }
1519
858
 
1520
859
  // src/views/wire.ts
1521
- function buildToolUiMeta(viewName, visibility, existingMetadata) {
1522
- if (viewName === void 0 && visibility === void 0 && existingMetadata === void 0) {
860
+ function buildToolUiMeta(viewName, visibility) {
861
+ if (viewName === void 0 && visibility === void 0) {
1523
862
  return void 0;
1524
863
  }
1525
- const meta = { ...existingMetadata };
1526
- const existingUi = existingMetadata?.[UI_META_KEY];
1527
- const existingUiIsObject = typeof existingUi === "object" && existingUi !== null && !Array.isArray(existingUi);
1528
- const ui = existingUiIsObject ? { ...existingUi } : {};
864
+ const ui = {};
865
+ const meta = { [UI_META_KEY]: ui };
1529
866
  if (viewName !== void 0) {
1530
867
  const resourceUri = viewResourceUri(viewName);
1531
868
  ui["resourceUri"] = resourceUri;
1532
869
  meta[UI_RESOURCE_URI_META_KEY] = resourceUri;
1533
- } else {
1534
- delete ui["resourceUri"];
1535
- delete meta[UI_RESOURCE_URI_META_KEY];
1536
870
  }
1537
871
  if (visibility !== void 0) {
1538
872
  ui["visibility"] = [visibility];
1539
- } else {
1540
- delete ui["visibility"];
1541
- }
1542
- if (viewName !== void 0 || visibility !== void 0 || existingUiIsObject) {
1543
- meta[UI_META_KEY] = ui;
1544
873
  }
1545
874
  return meta;
1546
875
  }
@@ -1551,20 +880,36 @@ function buildToolResultUiMeta(viewName) {
1551
880
  [UI_RESOURCE_URI_META_KEY]: resourceUri
1552
881
  };
1553
882
  }
1554
- function resolveCspOptions(options) {
1555
- const request = options?.request;
1556
- const serverOrigin = options?.serverOrigin ?? (request !== void 0 ? resolveServerOrigin(request) : "");
1557
- const assetsBase = options?.assetsBase ?? (request !== void 0 ? resolveAssetsBase(request) : serverOrigin);
1558
- return {
1559
- serverOrigin,
1560
- assetsOrigin: originFromAssetsBase(assetsBase),
1561
- explicitAssetsBase: hasExplicitAssetsBase(),
1562
- ...options?.hmrWs === true ? { hmrWs: true } : {}
1563
- };
883
+ function toWebSocketOrigin(servingOrigin) {
884
+ if (servingOrigin.startsWith("https://")) {
885
+ return `wss://${servingOrigin.slice("https://".length)}`;
886
+ }
887
+ if (servingOrigin.startsWith("http://")) {
888
+ return `ws://${servingOrigin.slice("http://".length)}`;
889
+ }
890
+ return servingOrigin;
1564
891
  }
1565
- function buildResourceUiMeta(authorFacts, options) {
1566
- const csp = buildMergedResourceCsp(authorFacts, resolveCspOptions(options));
1567
- const ui = { csp };
892
+ function buildResourceUiMeta(authorFacts, servingOrigin, options) {
893
+ const authorResourceDomains = authorFacts?.csp?.resourceDomains ?? [];
894
+ const resourceDomains = [
895
+ ...authorResourceDomains,
896
+ ...servingOrigin !== "" ? [servingOrigin] : []
897
+ ];
898
+ const authorConnectDomains = authorFacts?.csp?.connectDomains ?? [];
899
+ const connectDomains = [...authorConnectDomains];
900
+ if (options?.hmrWs === true && servingOrigin !== "") {
901
+ const wsOrigin = toWebSocketOrigin(servingOrigin);
902
+ if (!connectDomains.includes(wsOrigin)) {
903
+ connectDomains.push(wsOrigin);
904
+ }
905
+ }
906
+ const ui = {
907
+ csp: {
908
+ ...authorFacts?.csp,
909
+ connectDomains,
910
+ resourceDomains
911
+ }
912
+ };
1568
913
  if (authorFacts?.permissions !== void 0) {
1569
914
  ui["permissions"] = authorFacts.permissions;
1570
915
  }
@@ -1576,35 +921,19 @@ function buildResourceUiMeta(authorFacts, options) {
1576
921
  }
1577
922
  return { [UI_META_KEY]: ui };
1578
923
  }
1579
- function viewResourceConfig(_viewName, _entry, authorFacts, options) {
924
+ function viewResourceConfig(_viewName, _entry, authorFacts, servingOrigin, options) {
1580
925
  return {
1581
926
  mimeType: UI_MIME_TYPE,
1582
927
  ...authorFacts?.description !== void 0 && {
1583
928
  description: authorFacts.description
1584
929
  },
1585
- _meta: buildResourceUiMeta(authorFacts, options)
930
+ _meta: buildResourceUiMeta(authorFacts, servingOrigin, options)
1586
931
  };
1587
932
  }
1588
933
 
1589
934
  // src/server.ts
1590
- function omitRootSchemaDialect(schema) {
1591
- if (typeof schema !== "object" || schema === null || Array.isArray(schema) || !("$schema" in schema)) {
1592
- return schema;
1593
- }
1594
- const emittedSchema = { ...schema };
1595
- delete emittedSchema["$schema"];
1596
- return emittedSchema;
1597
- }
1598
- function omitToolSchemaDialects(tools) {
1599
- return tools.map((tool) => ({
1600
- ...tool,
1601
- inputSchema: omitRootSchemaDialect(tool.inputSchema),
1602
- ...tool.outputSchema === void 0 ? {} : { outputSchema: omitRootSchemaDialect(tool.outputSchema) }
1603
- }));
1604
- }
1605
935
  var MCPServer = class _MCPServer {
1606
936
  #config;
1607
- #branding;
1608
937
  #tools = /* @__PURE__ */ new Map();
1609
938
  #resources = /* @__PURE__ */ new Map();
1610
939
  #resourceTemplates = /* @__PURE__ */ new Map();
@@ -1629,14 +958,6 @@ var MCPServer = class _MCPServer {
1629
958
  #oauthResourceConfigurationAbsent = false;
1630
959
  /** Whether the mounted app validates Host headers (fixed at first mount). */
1631
960
  #hostValidated = false;
1632
- #mcpMiddlewares = [];
1633
- #mcpEventListeners = [];
1634
- /** Client instances created by {@link MCPServer.proxy} and owned by this server. */
1635
- #proxyOwners = [];
1636
- /** Proxy registrations that {@link close} must let finish before cleanup. */
1637
- #proxyOperations = /* @__PURE__ */ new Set();
1638
- /** Whether terminal shutdown has begun. */
1639
- #closed = false;
1640
961
  /**
1641
962
  * Create an MCP server from a parsed, bundled OpenAPI document.
1642
963
  *
@@ -1676,7 +997,6 @@ var MCPServer = class _MCPServer {
1676
997
  constructor(config) {
1677
998
  assertServerConfig(config);
1678
999
  this.#config = config;
1679
- this.#branding = normalizeServerBranding(config);
1680
1000
  if (config.oauth !== void 0) {
1681
1001
  const mcpUrl = typeof process === "undefined" ? void 0 : process.env["MCP_URL"];
1682
1002
  const resource = resolveConfiguredOAuthResource({
@@ -1699,24 +1019,6 @@ var MCPServer = class _MCPServer {
1699
1019
  get basePath() {
1700
1020
  return this.#basePath();
1701
1021
  }
1702
- /**
1703
- * Immutable normalized branding shared by MCP identity and browser pages.
1704
- *
1705
- * `favicon` is the final source after explicit-favicon and icon-selection
1706
- * precedence. Landing-page integrations can use this accessor and link to
1707
- * the server's root-level `/favicon.ico` route without reading private
1708
- * configuration or depending on the inspector/view layers.
1709
- *
1710
- * @example
1711
- * ```ts
1712
- * if (server.branding.favicon) {
1713
- * console.log("Browser favicon: /favicon.ico");
1714
- * }
1715
- * ```
1716
- */
1717
- get branding() {
1718
- return this.#branding;
1719
- }
1720
1022
  /**
1721
1023
  * Register a tool. Input is validated against `inputSchema` before the callback
1722
1024
  * runs; results carrying `structuredContent` are type-checked against
@@ -1796,10 +1098,8 @@ var MCPServer = class _MCPServer {
1796
1098
  */
1797
1099
  resourceTemplate(definition, callback) {
1798
1100
  this.#assertNotStarted("resourceTemplate", definition.name);
1799
- const complete = definition.complete === void 0 ? void 0 : normalizeCompletions(definition.complete);
1800
1101
  this.#resourceTemplates.set(definition.name, {
1801
1102
  definition,
1802
- ...complete !== void 0 && { complete },
1803
1103
  callback
1804
1104
  });
1805
1105
  return this;
@@ -1816,23 +1116,6 @@ var MCPServer = class _MCPServer {
1816
1116
  });
1817
1117
  return this;
1818
1118
  }
1819
- async proxy(input) {
1820
- this.#assertOpen("proxy()");
1821
- const operation = (async () => {
1822
- const { isProxyConnection, mountProxyConnection, mountProxyServers } = await import("./proxy-DJYWGTGX.js");
1823
- if (isProxyConnection(input)) {
1824
- await mountProxyConnection(this.#proxyHost(), input);
1825
- return;
1826
- }
1827
- await mountProxyServers(this.#proxyHost(), input);
1828
- })();
1829
- this.#proxyOperations.add(operation);
1830
- try {
1831
- await operation;
1832
- } finally {
1833
- this.#proxyOperations.delete(operation);
1834
- }
1835
- }
1836
1119
  /**
1837
1120
  * Web-standard request handler for the whole app (MCP endpoint included) —
1838
1121
  * usable directly on serverless/edge runtimes or in tests.
@@ -1856,68 +1139,8 @@ var MCPServer = class _MCPServer {
1856
1139
  * ```
1857
1140
  */
1858
1141
  getHandler(options = {}) {
1859
- this.#assertOpen("getHandler()");
1860
1142
  const { fetch } = this.#ensureMounted("handler", void 0, options.bus);
1861
- return toFrameworkHandler(fetch);
1862
- }
1863
- /**
1864
- * Node `(req, res) => void` handler for composing with an existing
1865
- * `http.Server`. Uses the same internal `toNodeHandler` bridge as
1866
- * {@link MCPServer.listen}; MCPServer users do not need to import
1867
- * `mcp-use/node`.
1868
- *
1869
- * @example
1870
- * ```ts
1871
- * import { createServer } from "node:http";
1872
- * const httpServer = createServer(await server.getNodeHandler());
1873
- * httpServer.listen(3000);
1874
- * ```
1875
- */
1876
- async getNodeHandler() {
1877
- const { fetch } = this.#ensureMounted("handler");
1878
- const { toNodeHandler } = await import("./node-bridge.js");
1879
- return toNodeHandler({ fetch });
1880
- }
1881
- /**
1882
- * Register MCP operation middleware that intercepts JSON-RPC dispatch.
1883
- *
1884
- * Patterns use an `mcp:` prefix (for example `mcp:tools/call`, `mcp:*`).
1885
- * Exact methods may transform their typed result. The global `mcp:*` pattern
1886
- * is pass-through middleware. Middleware runs in registration order; call
1887
- * `next()` to continue the chain.
1888
- *
1889
- * @example
1890
- * ```ts
1891
- * server.use("mcp:tools/call", async (ctx, next) => {
1892
- * console.log(`Calling tool: ${ctx.params.name}`);
1893
- * return next();
1894
- * });
1895
- * ```
1896
- */
1897
- use(pattern, handler) {
1898
- this.#assertNotStarted("middleware", pattern);
1899
- this.#mcpMiddlewares.push(createMcpMiddlewareEntry(pattern, handler));
1900
- return this;
1901
- }
1902
- /**
1903
- * Register a read-only MCP observer. Unlike {@link MCPServer.use}, listeners
1904
- * cannot block, override, or mutate params. Throwing is logged and does not
1905
- * fail the request.
1906
- *
1907
- * Append `:complete` to run after the handler (for example
1908
- * `mcp:tools/call:complete`).
1909
- *
1910
- * @example
1911
- * ```ts
1912
- * server.on("mcp:tools/call", (ctx) => {
1913
- * metrics.increment("tools.call", { tool: ctx.params.name });
1914
- * });
1915
- * ```
1916
- */
1917
- on(pattern, handler) {
1918
- this.#assertNotStarted("event listener", pattern);
1919
- this.#mcpEventListeners.push(createMcpEventListenerEntry(pattern, handler));
1920
- return this;
1143
+ return fetch;
1921
1144
  }
1922
1145
  /**
1923
1146
  * Publish a tools-list change to v2 clients with active subscriptions.
@@ -1969,8 +1192,9 @@ var MCPServer = class _MCPServer {
1969
1192
  * Serve over HTTP on Node. Pass port `0` for an ephemeral port.
1970
1193
  *
1971
1194
  * Binds `config.host` (default `127.0.0.1`). Localhost-class binds get
1972
- * DNS-rebinding Host protection automatically. Origin validation is off
1973
- * unless `allowedOrigins` is set. To serve publicly set `host: "0.0.0.0"`;
1195
+ * DNS-rebinding protection automatically: `Host` on every request,
1196
+ * `Origin` only on non-GET/HEAD (sandboxed view iframes send
1197
+ * `Origin: null` on asset GETs). To serve publicly set `host: "0.0.0.0"`;
1974
1198
  * behind a platform edge that is all that's needed, and `allowedHosts`
1975
1199
  * restricts direct exposure (additive — localhost-class values stay allowed).
1976
1200
  *
@@ -1984,7 +1208,6 @@ var MCPServer = class _MCPServer {
1984
1208
  * already mounted the app without Host validation.
1985
1209
  */
1986
1210
  async listen(port = 3e3) {
1987
- this.#assertOpen("listen()");
1988
1211
  this.#assertListenOAuthConfiguration();
1989
1212
  const { createServer } = await import("http");
1990
1213
  const { toNodeHandler } = await import("./node-bridge.js");
@@ -2049,42 +1272,14 @@ var MCPServer = class _MCPServer {
2049
1272
  * instance to serve again.
2050
1273
  */
2051
1274
  async close() {
2052
- this.#closed = true;
2053
- await Promise.allSettled([...this.#proxyOperations]);
2054
- const errors = [];
2055
- const proxyOwners = this.#proxyOwners.splice(0);
2056
- const ownerResults = await Promise.allSettled(
2057
- proxyOwners.map((owner) => owner.close())
2058
- );
2059
- for (const result of ownerResults) {
2060
- if (result.status === "rejected") errors.push(result.reason);
2061
- }
2062
- try {
2063
- await this.#handler?.close();
2064
- } catch (error) {
2065
- errors.push(error);
2066
- }
1275
+ await this.#handler?.close();
2067
1276
  const httpServer = this.#httpServer;
2068
1277
  if (httpServer !== void 0) {
2069
- try {
2070
- await new Promise((resolve, reject) => {
2071
- httpServer.close((err) => err ? reject(err) : resolve());
2072
- });
2073
- this.#httpServer = void 0;
2074
- } catch (error) {
2075
- errors.push(error);
2076
- }
2077
- }
2078
- if (errors.length > 0) {
2079
- throw new AggregateError(errors, "Failed to close MCP server cleanly");
2080
- }
2081
- }
2082
- #assertOpen(operation) {
2083
- if (!this.#closed) return;
2084
- if (operation !== void 0) {
2085
- throw new Error(`Cannot call ${operation} after the server has closed.`);
1278
+ await new Promise((resolve, reject) => {
1279
+ httpServer.close((err) => err ? reject(err) : resolve());
1280
+ });
1281
+ this.#httpServer = void 0;
2086
1282
  }
2087
- throw new Error("Cannot use the server after it has closed.");
2088
1283
  }
2089
1284
  #basePath() {
2090
1285
  return this.#config.basePath ?? "/mcp";
@@ -2131,79 +1326,40 @@ var MCPServer = class _MCPServer {
2131
1326
  );
2132
1327
  }
2133
1328
  }
2134
- #proxyHost() {
2135
- return {
2136
- isStarted: () => this.#handler !== void 0,
2137
- hasTool: (name) => this.#tools.has(name),
2138
- hasResource: (name) => this.#resources.has(name),
2139
- hasPrompt: (name) => this.#prompts.has(name),
2140
- registerTool: (definition, callback) => {
2141
- this.#assertNotStarted("tool", definition.name);
2142
- this.#tools.set(definition.name, {
2143
- definition,
2144
- callback
2145
- });
2146
- },
2147
- registerResource: (definition, callback) => {
2148
- this.#assertNotStarted("resource", definition.name);
2149
- this.#resources.set(definition.name, {
2150
- definition,
2151
- callback
2152
- });
2153
- },
2154
- registerPrompt: (definition, callback) => {
2155
- this.#assertNotStarted("prompt", definition.name);
2156
- this.#prompts.set(definition.name, {
2157
- definition,
2158
- callback
2159
- });
2160
- },
2161
- trackOwner: (owner) => {
2162
- this.#proxyOwners.push(owner);
2163
- }
2164
- };
2165
- }
2166
1329
  /**
2167
1330
  * Effective Host/Origin allowlists for a mount mode; `undefined` means the
2168
1331
  * corresponding validation is off.
2169
1332
  *
2170
1333
  * Configured lists are additive to the localhost-class allowlists, so local
2171
1334
  * runs keep working when a deployment hostname is added. With nothing
2172
- * configured, `listen()` on a localhost-class bind validates Host against the
1335
+ * configured, `listen()` on a localhost-class bind validates against the
2173
1336
  * localhost lists (the DNS-rebinding threat model), while `getHandler()` —
2174
- * which never binds — applies no validation. Origin validation is off unless
2175
- * `allowedOrigins` is set explicitly (SDK-aligned: the handler is open by
2176
- * default). When enabled, Origin is checked only on non-GET/HEAD requests.
1337
+ * which never binds — applies no validation. `allowedOrigins` defaults to
1338
+ * mirroring the effective Host allowlist. Origin validation runs only on
1339
+ * non-GET/HEAD requests.
2177
1340
  */
2178
1341
  #validationPolicy(mode) {
2179
1342
  const { host = "127.0.0.1", allowedHosts, allowedOrigins } = this.#config;
2180
1343
  const localhostBind = ["127.0.0.1", "localhost", "::1"].includes(host);
2181
1344
  const hosts = allowedHosts !== void 0 ? [.../* @__PURE__ */ new Set([...localhostAllowedHostnames(), ...allowedHosts])] : mode === "listen" && localhostBind ? localhostAllowedHostnames() : void 0;
2182
- const origins = allowedOrigins !== void 0 ? [.../* @__PURE__ */ new Set([...localhostAllowedOrigins(), ...allowedOrigins])] : void 0;
1345
+ const origins = allowedOrigins !== void 0 ? [.../* @__PURE__ */ new Set([...localhostAllowedOrigins(), ...allowedOrigins])] : hosts;
2183
1346
  return { hosts, origins };
2184
1347
  }
2185
1348
  #ensureMounted(mode, listenPort, bus) {
2186
- this.#assertOpen();
2187
1349
  if (this.#fetchHandler === void 0 || this.#handler === void 0) {
2188
1350
  const { hosts, origins } = this.#validationPolicy(mode);
2189
1351
  const basePath = this.#basePath();
2190
- const nestedBasePath = basePath === "/" ? "" : basePath;
2191
1352
  const middlewares = [
2192
1353
  jsonBodyMiddleware(),
2193
1354
  requestLogger(this.#config.logging)
2194
1355
  ];
2195
- const corsConfig = this.#config.cors;
2196
- if (corsConfig !== void 0) {
2197
- middlewares.unshift(corsFetchMiddleware(corsConfig));
2198
- }
2199
- const deferViewCors = isGlobalCorsEnabled(corsConfig);
2200
1356
  if (hosts !== void 0) {
2201
1357
  middlewares.unshift(hostValidationMiddleware(hosts));
2202
- }
2203
- if (origins !== void 0) {
2204
- middlewares.push(originValidationMiddleware(origins));
2205
- }
2206
- if (hosts === void 0) {
1358
+ middlewares.push(originValidationMiddleware(origins ?? hosts));
1359
+ } else {
1360
+ if (origins !== void 0) {
1361
+ middlewares.push(originValidationMiddleware(origins));
1362
+ }
2207
1363
  if (mode === "listen") {
2208
1364
  console.warn(
2209
1365
  `[mcp-use] listen() is serving on ${this.#config.host} without Host validation. Behind a platform edge that only routes your own domains this is expected; if this process is reachable directly, set allowedHosts to restrict it.`
@@ -2233,7 +1389,7 @@ var MCPServer = class _MCPServer {
2233
1389
  }
2234
1390
  }
2235
1391
  );
2236
- let protectWithBearer = async (_request, next) => next();
1392
+ let mcpRouteHandler = mcpFetch;
2237
1393
  if (resource !== void 0) {
2238
1394
  const provider = this.#config.oauth;
2239
1395
  const providerOptions = getOAuthProviderOptions(provider);
@@ -2244,89 +1400,32 @@ var MCPServer = class _MCPServer {
2244
1400
  requiredScopes: providerOptions.requiredScopes
2245
1401
  }
2246
1402
  });
2247
- protectWithBearer = async (request, next) => {
1403
+ mcpRouteHandler = async (request) => {
2248
1404
  const result = await gate(request);
2249
1405
  if (result instanceof Response) {
2250
1406
  return result;
2251
1407
  }
2252
1408
  const bag = getRequestBag(request);
2253
1409
  bag.authInfo = result;
2254
- return next();
1410
+ return mcpFetch(request);
2255
1411
  };
2256
1412
  }
2257
- const mcpRouteHandler = (request) => protectWithBearer(request, () => mcpFetch(request));
2258
- const endpointHandler = async (request) => {
2259
- if (!isHtmlNavigationRequest(request)) {
2260
- return mcpRouteHandler(request);
2261
- }
2262
- const respond = async () => {
2263
- const { createLandingPageResponse } = await import("./landing-handler-WE66NIGB.js");
2264
- return createLandingPageResponse(
2265
- request,
2266
- basePath,
2267
- this.#config,
2268
- this.#branding,
2269
- this.#tools.values(),
2270
- this.#prompts.values(),
2271
- this.#resources.values()
2272
- );
2273
- };
2274
- if (resource !== void 0 && this.#config.publicLandingPage !== true) {
2275
- return protectWithBearer(request, respond);
2276
- }
2277
- return respond();
2278
- };
2279
1413
  const routes = [];
2280
- const brandingDevMode = this.#viewsPrimed ? this.#viewsDevMode : process.env["NODE_ENV"] !== "production";
2281
- const faviconHandler = createFaviconHandler(this.#branding, {
2282
- dev: brandingDevMode,
2283
- projectRoot: this.#viewsProjectRoot,
2284
- deferCors: deferViewCors
2285
- });
2286
- if (faviconHandler !== void 0) {
2287
- routes.push({
2288
- match: (request) => new URL(request.url).pathname === "/favicon.ico",
2289
- handler: faviconHandler
2290
- });
2291
- }
2292
1414
  const viewHandler = createViewPublicHandler(basePath, this.#views, {
2293
- dev: this.#viewsPrimed ? this.#viewsDevMode : brandingDevMode,
2294
- projectRoot: this.#viewsProjectRoot,
2295
- enabled: hasLocalBrandingAsset(this.#branding),
2296
- deferCors: deferViewCors
1415
+ dev: this.#viewsDevMode,
1416
+ projectRoot: this.#viewsProjectRoot
2297
1417
  });
2298
1418
  if (viewHandler !== void 0) {
2299
1419
  routes.push({
2300
1420
  match: (request) => request.method === "GET" || request.method === "HEAD" ? new URL(request.url).pathname.startsWith(
2301
- `${nestedBasePath}/_mcp-use/public/`
1421
+ `${basePath}/_mcp-use/public/`
2302
1422
  ) : false,
2303
1423
  handler: viewHandler
2304
1424
  });
2305
1425
  }
2306
- if (!this.#viewsDevMode) {
2307
- const viewAssetsHandler = createViewAssetsHandler(
2308
- basePath,
2309
- this.#views,
2310
- { projectRoot: this.#viewsProjectRoot, deferCors: deferViewCors }
2311
- );
2312
- if (viewAssetsHandler !== void 0) {
2313
- routes.push({
2314
- match: (request) => request.method === "GET" || request.method === "HEAD" ? new URL(request.url).pathname.startsWith(
2315
- `${nestedBasePath}/_mcp-use/views/`
2316
- ) : false,
2317
- handler: viewAssetsHandler
2318
- });
2319
- }
2320
- }
2321
1426
  const inspectorHandler = createInspectorHandler(this.#config.inspector, {
2322
1427
  serverName: this.#config.name,
2323
- basePath,
2324
- ...faviconHandler !== void 0 && {
2325
- faviconHref: "/favicon.ico",
2326
- ...this.#branding.faviconMimeType !== void 0 && {
2327
- faviconType: this.#branding.faviconMimeType
2328
- }
2329
- }
1428
+ basePath
2330
1429
  });
2331
1430
  if (inspectorHandler !== void 0) {
2332
1431
  routes.push({
@@ -2335,14 +1434,14 @@ var MCPServer = class _MCPServer {
2335
1434
  return false;
2336
1435
  }
2337
1436
  const pathname = new URL(request.url).pathname;
2338
- return matchesInspectorShellPath(pathname, basePath);
1437
+ return pathname === `${basePath}/inspector` || pathname === `${basePath}/inspector/`;
2339
1438
  },
2340
1439
  handler: inspectorHandler
2341
1440
  });
2342
1441
  }
2343
1442
  routes.push({
2344
1443
  match: (request) => matchesPath(request, basePath),
2345
- handler: endpointHandler
1444
+ handler: mcpRouteHandler
2346
1445
  });
2347
1446
  const terminal = routeFetch(routes);
2348
1447
  this.#fetchHandler = composeFetch(terminal, ...middlewares);
@@ -2415,17 +1514,7 @@ var MCPServer = class _MCPServer {
2415
1514
  name,
2416
1515
  version,
2417
1516
  ...title !== void 0 && { title },
2418
- ...description !== void 0 && { description },
2419
- ...this.#branding.websiteUrl !== void 0 && {
2420
- websiteUrl: this.#branding.websiteUrl
2421
- },
2422
- ...this.#branding.icons !== void 0 && {
2423
- icons: resolveImplementationIcons(
2424
- this.#branding.icons,
2425
- ctx.requestInfo,
2426
- this.#basePath()
2427
- )
2428
- }
1517
+ ...description !== void 0 && { description }
2429
1518
  },
2430
1519
  {
2431
1520
  capabilities: {
@@ -2441,7 +1530,7 @@ var MCPServer = class _MCPServer {
2441
1530
  }
2442
1531
  );
2443
1532
  const request = ctx.requestInfo;
2444
- const viewMetaOptions = request !== void 0 ? { request, hmrWs: this.#viewsDevMode } : { hmrWs: this.#viewsDevMode };
1533
+ const servingOrigin = request !== void 0 ? resolveRequestOrigin(request) : "";
2445
1534
  const basePath = this.#basePath();
2446
1535
  for (const entry of this.#tools.values()) {
2447
1536
  this.#registerTool(server, entry);
@@ -2460,108 +1549,15 @@ var MCPServer = class _MCPServer {
2460
1549
  server,
2461
1550
  viewName,
2462
1551
  viewEntry,
2463
- viewMetaOptions,
1552
+ servingOrigin,
2464
1553
  basePath
2465
1554
  );
2466
1555
  }
2467
- this.#wrapListHandlers(server);
2468
1556
  return server;
2469
1557
  }
2470
- #createMiddlewareContext(method, params, ctx) {
2471
- return {
2472
- method,
2473
- params,
2474
- ...ctx.sessionId !== void 0 && {
2475
- session: { sessionId: ctx.sessionId }
2476
- },
2477
- ...ctx.http?.authInfo !== void 0 && { auth: ctx.http.authInfo },
2478
- state: /* @__PURE__ */ new Map()
2479
- };
2480
- }
2481
- #runMcpHook(method, ctx, innerFn) {
2482
- return runMcpOperation(
2483
- this.#mcpMiddlewares,
2484
- this.#mcpEventListeners,
2485
- method,
2486
- ctx,
2487
- innerFn
2488
- );
2489
- }
2490
- /**
2491
- * Wrap native SDK list handlers with the MCP middleware chain.
2492
- *
2493
- * ponytail: uses SDK-private `_requestHandlers`; pin compile-time test.
2494
- *
2495
- * @internal
2496
- */
2497
- #wrapListHandlers(server) {
2498
- const handlers = server.server._requestHandlers;
2499
- if (handlers === void 0) {
2500
- return;
2501
- }
2502
- const wrapListMethod = (method, resultKey, transform) => {
2503
- const original = handlers.get(method);
2504
- if (original === void 0) {
2505
- return;
2506
- }
2507
- if (original.__mcpListWrapped) {
2508
- return;
2509
- }
2510
- const wrapped = async (request, extra) => {
2511
- const serverContext = extra;
2512
- const params = request.params ?? {};
2513
- const mwCtx = this.#createMiddlewareContext(
2514
- method,
2515
- params,
2516
- serverContext
2517
- );
2518
- let originalEnvelope;
2519
- const innerFn = async () => {
2520
- const downstreamRequest = withMcpMiddlewareParams(
2521
- request,
2522
- mwCtx.params
2523
- );
2524
- const result = await original(downstreamRequest, extra);
2525
- if (typeof result !== "object" || result === null) {
2526
- throw new TypeError(
2527
- `[mcp-use] ${method} handler returned a non-object result`
2528
- );
2529
- }
2530
- originalEnvelope = result;
2531
- const items = originalEnvelope[resultKey];
2532
- if (!Array.isArray(items)) {
2533
- throw new TypeError(
2534
- `[mcp-use] ${method} handler result is missing a ${resultKey} array`
2535
- );
2536
- }
2537
- return items;
2538
- };
2539
- const filtered = await this.#runMcpHook(method, mwCtx, innerFn);
2540
- if (!Array.isArray(filtered)) {
2541
- throw new TypeError(
2542
- `[mcp-use] ${method} middleware must return a ${resultKey} array`
2543
- );
2544
- }
2545
- const emitted = transform?.(filtered) ?? filtered;
2546
- return {
2547
- ...originalEnvelope,
2548
- [resultKey]: emitted
2549
- };
2550
- };
2551
- wrapped.__mcpListWrapped = true;
2552
- handlers.set(method, wrapped);
2553
- };
2554
- wrapListMethod("tools/list", "tools", omitToolSchemaDialects);
2555
- wrapListMethod("resources/list", "resources");
2556
- wrapListMethod("prompts/list", "prompts");
2557
- }
2558
1558
  #registerTool(server, { definition, callback }) {
2559
1559
  const view = definition.view;
2560
- const toolMeta = buildToolUiMeta(
2561
- view?.name,
2562
- definition.visibility,
2563
- definition._meta
2564
- );
1560
+ const toolUiMeta = buildToolUiMeta(view?.name, definition.visibility);
2565
1561
  const config = {
2566
1562
  ...definition.title !== void 0 && { title: definition.title },
2567
1563
  ...definition.description !== void 0 && {
@@ -2573,60 +1569,51 @@ var MCPServer = class _MCPServer {
2573
1569
  ...definition.outputSchema !== void 0 && {
2574
1570
  outputSchema: definition.outputSchema
2575
1571
  },
2576
- ...toolMeta !== void 0 && { _meta: toolMeta }
1572
+ ...toolUiMeta !== void 0 && { _meta: toolUiMeta }
2577
1573
  };
2578
1574
  const wireResultMeta = view !== void 0 ? buildToolResultUiMeta(view.name) : void 0;
2579
1575
  const inputSchema = resolveToolInputSchema(definition);
2580
- const invokeTool = async (args, ctx) => {
2581
- const mwCtx = this.#createMiddlewareContext(
2582
- "tools/call",
2583
- {
2584
- name: definition.name,
2585
- arguments: args,
2586
- ...ctx.mcpReq._meta !== void 0 && { _meta: ctx.mcpReq._meta }
2587
- },
2588
- ctx
1576
+ if (inputSchema !== void 0) {
1577
+ server.registerTool(
1578
+ definition.name,
1579
+ { ...config, inputSchema },
1580
+ async (args, ctx) => {
1581
+ const params = args;
1582
+ const result = await callback(params, this.#toRequestContext(ctx));
1583
+ if (isInputRequiredResult(result) || wireResultMeta === void 0 || result.isError === true) {
1584
+ return result;
1585
+ }
1586
+ return {
1587
+ ...result,
1588
+ _meta: { ...result._meta, ...wireResultMeta }
1589
+ };
1590
+ }
2589
1591
  );
2590
- const innerFn = async () => {
2591
- const effectiveArgs = mwCtx.params.arguments ?? {};
2592
- const result = await callback(
2593
- effectiveArgs,
2594
- this.#toRequestContext(ctx)
2595
- );
2596
- if (isInputRequiredResult2(result) || wireResultMeta === void 0 || result.isError === true) {
1592
+ } else {
1593
+ server.registerTool(definition.name, config, async (ctx) => {
1594
+ const result = await callback({}, this.#toRequestContext(ctx));
1595
+ if (isInputRequiredResult(result) || wireResultMeta === void 0 || result.isError === true) {
2597
1596
  return result;
2598
1597
  }
2599
1598
  return {
2600
1599
  ...result,
2601
1600
  _meta: { ...result._meta, ...wireResultMeta }
2602
1601
  };
2603
- };
2604
- return await this.#runMcpHook("tools/call", mwCtx, innerFn);
2605
- };
2606
- if (inputSchema !== void 0) {
2607
- server.registerTool(
2608
- definition.name,
2609
- { ...config, inputSchema },
2610
- async (args, ctx) => invokeTool(args, ctx)
2611
- );
2612
- } else {
2613
- server.registerTool(
2614
- definition.name,
2615
- config,
2616
- async (ctx) => invokeTool({}, ctx)
2617
- );
1602
+ });
2618
1603
  }
2619
1604
  }
2620
- #registerViewResource(server, viewName, entry, metaOptions, basePath) {
1605
+ #registerViewResource(server, viewName, entry, servingOrigin, basePath) {
2621
1606
  const uri = viewResourceUri(viewName);
2622
1607
  const authorFacts = this.#viewResourceFacts(
2623
1608
  this.#viewBindings.get(viewName)?.config
2624
1609
  );
1610
+ const hmrWs = this.#viewsDevMode;
2625
1611
  const resourceConfig = viewResourceConfig(
2626
1612
  viewName,
2627
1613
  entry,
2628
1614
  authorFacts,
2629
- metaOptions
1615
+ servingOrigin,
1616
+ { hmrWs }
2630
1617
  );
2631
1618
  server.registerResource(
2632
1619
  viewName,
@@ -2634,24 +1621,15 @@ var MCPServer = class _MCPServer {
2634
1621
  resourceConfig,
2635
1622
  async (readUri, ctx) => {
2636
1623
  const req = ctx.http?.req;
2637
- const readOptions = req !== void 0 ? {
2638
- request: req,
2639
- ...metaOptions.hmrWs === true ? { hmrWs: true } : {}
2640
- } : metaOptions.hmrWs === true ? { hmrWs: true } : {};
2641
- const assetsBase = req !== void 0 ? resolveAssetsBase(req) : metaOptions.request !== void 0 ? resolveAssetsBase(metaOptions.request) : "";
2642
- const html = synthesizeViewDocument(
2643
- entry,
2644
- assetsBase,
2645
- basePath,
2646
- viewName
2647
- );
1624
+ const origin = req !== void 0 ? resolveRequestOrigin(req) : servingOrigin;
1625
+ const html = synthesizeViewDocument(entry, origin, basePath);
2648
1626
  return {
2649
1627
  contents: [
2650
1628
  {
2651
1629
  uri: readUri.href,
2652
1630
  mimeType: resourceConfig.mimeType,
2653
1631
  text: html,
2654
- _meta: buildResourceUiMeta(authorFacts, readOptions)
1632
+ _meta: buildResourceUiMeta(authorFacts, origin, { hmrWs })
2655
1633
  }
2656
1634
  ]
2657
1635
  };
@@ -2669,36 +1647,14 @@ var MCPServer = class _MCPServer {
2669
1647
  },
2670
1648
  ...definition.mimeType !== void 0 && {
2671
1649
  mimeType: definition.mimeType
2672
- },
2673
- ...definition.annotations !== void 0 && {
2674
- annotations: definition.annotations
2675
- },
2676
- ...definition._meta !== void 0 && {
2677
- _meta: { ...definition._meta }
2678
1650
  }
2679
1651
  },
2680
- async (uri, ctx) => {
2681
- const mwCtx = this.#createMiddlewareContext(
2682
- "resources/read",
2683
- {
2684
- uri: uri.href,
2685
- ...ctx.mcpReq._meta !== void 0 && { _meta: ctx.mcpReq._meta }
2686
- },
2687
- ctx
2688
- );
2689
- const innerFn = async () => callback(uri, this.#toRequestContext(ctx));
2690
- return await this.#runMcpHook(
2691
- "resources/read",
2692
- mwCtx,
2693
- innerFn
2694
- );
2695
- }
1652
+ async (uri, ctx) => callback(uri, this.#toRequestContext(ctx))
2696
1653
  );
2697
1654
  }
2698
- #registerResourceTemplate(server, { definition, callback, complete }) {
1655
+ #registerResourceTemplate(server, { definition, callback }) {
2699
1656
  const template = new ResourceTemplate(definition.uriTemplate, {
2700
- list: void 0,
2701
- ...complete !== void 0 && { complete }
1657
+ list: void 0
2702
1658
  });
2703
1659
  server.registerResource(
2704
1660
  definition.name,
@@ -2710,34 +1666,13 @@ var MCPServer = class _MCPServer {
2710
1666
  },
2711
1667
  ...definition.mimeType !== void 0 && {
2712
1668
  mimeType: definition.mimeType
2713
- },
2714
- ...definition.annotations !== void 0 && {
2715
- annotations: definition.annotations
2716
- },
2717
- ...definition._meta !== void 0 && {
2718
- _meta: { ...definition._meta }
2719
1669
  }
2720
1670
  },
2721
- async (uri, variables, ctx) => {
2722
- const mwCtx = this.#createMiddlewareContext(
2723
- "resources/read",
2724
- {
2725
- uri: uri.href,
2726
- ...ctx.mcpReq._meta !== void 0 && { _meta: ctx.mcpReq._meta }
2727
- },
2728
- ctx
2729
- );
2730
- const innerFn = async () => callback(
2731
- uri,
2732
- variables,
2733
- this.#toRequestContext(ctx)
2734
- );
2735
- return await this.#runMcpHook(
2736
- "resources/read",
2737
- mwCtx,
2738
- innerFn
2739
- );
2740
- }
1671
+ async (uri, variables, ctx) => callback(
1672
+ uri,
1673
+ variables,
1674
+ this.#toRequestContext(ctx)
1675
+ )
2741
1676
  );
2742
1677
  }
2743
1678
  #viewResourceFacts(viewConfig) {
@@ -2765,30 +1700,17 @@ var MCPServer = class _MCPServer {
2765
1700
  description: definition.description
2766
1701
  }
2767
1702
  };
2768
- const invokePrompt = async (args, ctx) => {
2769
- const mwCtx = this.#createMiddlewareContext(
2770
- "prompts/get",
2771
- {
2772
- name: definition.name,
2773
- arguments: args,
2774
- ...ctx.mcpReq._meta !== void 0 && { _meta: ctx.mcpReq._meta }
2775
- },
2776
- ctx
2777
- );
2778
- const innerFn = async () => {
2779
- const effectiveArgs = mwCtx.params.arguments ?? {};
2780
- return callback(effectiveArgs, this.#toRequestContext(ctx));
2781
- };
2782
- return await this.#runMcpHook("prompts/get", mwCtx, innerFn);
2783
- };
2784
1703
  if (definition.schema !== void 0) {
2785
1704
  server.registerPrompt(
2786
1705
  definition.name,
2787
1706
  { ...config, argsSchema: definition.schema },
2788
- async (args, ctx) => invokePrompt(args, ctx)
1707
+ async (args, ctx) => {
1708
+ const params = args;
1709
+ return callback(params, this.#toRequestContext(ctx));
1710
+ }
2789
1711
  );
2790
1712
  } else {
2791
- const handler = async (ctx) => invokePrompt({}, ctx);
1713
+ const handler = async (ctx) => callback({}, this.#toRequestContext(ctx));
2792
1714
  server.registerPrompt(
2793
1715
  definition.name,
2794
1716
  config,
@@ -2810,32 +1732,46 @@ import {
2810
1732
  createRequestStateCodec,
2811
1733
  inputRequired as inputRequired2,
2812
1734
  inputResponse as inputResponse2,
2813
- isInputRequiredResult as isInputRequiredResult3
1735
+ isInputRequiredResult as isInputRequiredResult2
2814
1736
  } from "@modelcontextprotocol/server";
1737
+
1738
+ // src/completable.ts
1739
+ import {
1740
+ completable as sdkCompletable
1741
+ } from "@modelcontextprotocol/server";
1742
+ function completable(schema, complete) {
1743
+ if (typeof complete === "function") {
1744
+ return sdkCompletable(
1745
+ schema,
1746
+ (value, context) => complete(String(value ?? ""), context)
1747
+ );
1748
+ }
1749
+ const values = complete.map(String);
1750
+ return sdkCompletable(schema, (value) => {
1751
+ const prefix = String(value ?? "").toLowerCase();
1752
+ return values.filter((v) => v.toLowerCase().startsWith(prefix));
1753
+ });
1754
+ }
2815
1755
  export {
2816
1756
  MCPServer,
2817
1757
  acceptedContent,
2818
1758
  completable,
2819
1759
  composeFetch,
2820
- composeMiddleware,
2821
- createMcpEventListenerEntry,
2822
- createMcpMiddlewareEntry,
2823
1760
  createMcpMount,
2824
1761
  createRequestStateCodec,
2825
1762
  getRequestBag,
2826
1763
  hostValidationMiddleware,
2827
1764
  inputRequired2 as inputRequired,
2828
1765
  inputResponse2 as inputResponse,
2829
- isInputRequiredResult3 as isInputRequiredResult,
1766
+ isInputRequiredResult2 as isInputRequiredResult,
2830
1767
  jsonBodyMiddleware,
2831
1768
  matchesPath,
2832
1769
  matchesPathPrefix,
2833
- matchesPattern,
1770
+ mountMcp,
2834
1771
  originValidationMiddleware,
2835
1772
  pathnameOf,
2836
1773
  registerViews,
2837
1774
  requestLogger,
2838
- routeFetch,
2839
- toFrameworkHandler
1775
+ routeFetch
2840
1776
  };
2841
1777
  //# sourceMappingURL=index.js.map