@namzu/cli 49.0.0 → 49.1.1

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 (350) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/chunks/{acp-2INAZYZT.js → acp-MBBNHTFF.js} +1134 -58
  4. package/dist/chunks/acp-MBBNHTFF.js.map +6 -0
  5. package/dist/chunks/{activity-command-J676MIML.js → activity-command-W7V33K4I.js} +12 -12
  6. package/dist/chunks/{add-LI4SX4YZ.js → add-FQUU7CPV.js} +20 -20
  7. package/dist/chunks/{agent-LUK4L4AW.js → agent-MJG43QEN.js} +36 -36
  8. package/dist/chunks/agent-session-K5GXC7TI.js +69 -0
  9. package/dist/chunks/{archive-IZRS7P6C.js → archive-VOUK2Z7P.js} +10 -10
  10. package/dist/chunks/{bin-main-XNB6LHOP.js → bin-main-FMGPWUMO.js} +7 -7
  11. package/dist/chunks/{binding-3EE2IYAM.js → binding-CRYJQ7PU.js} +3 -3
  12. package/dist/chunks/{browser-NI2ZPG4N.js → browser-MSESQ5SY.js} +6 -6
  13. package/dist/chunks/{chat-5OEOFTSO.js → chat-JK7GKOOT.js} +15 -15
  14. package/dist/chunks/{chunk-YJYFQW2F.js → chunk-24VVQCMV.js} +3 -3
  15. package/dist/chunks/{chunk-P7YVC6KA.js → chunk-26CZDEKO.js} +2 -2
  16. package/dist/chunks/{chunk-YPKTYCDZ.js → chunk-2BSKESPI.js} +3 -3
  17. package/dist/chunks/chunk-2HNRN4BZ.js +3039 -0
  18. package/dist/chunks/chunk-2HNRN4BZ.js.map +6 -0
  19. package/dist/chunks/{chunk-HUUVQBZR.js → chunk-2JZ6O4JX.js} +3 -3
  20. package/dist/chunks/{chunk-CDT745GI.js → chunk-2RWJX3XO.js} +4 -4
  21. package/dist/chunks/{chunk-Y34RP2OI.js → chunk-2SBMVMTO.js} +6 -6
  22. package/dist/chunks/{chunk-YYLILI2G.js → chunk-37JCXHFG.js} +2 -2
  23. package/dist/chunks/{chunk-YFKC2GZP.js → chunk-3KLNVOTV.js} +4 -4
  24. package/dist/chunks/{chunk-L3VAFXRU.js → chunk-3VMSB36D.js} +6 -6
  25. package/dist/chunks/{chunk-HNBF54TV.js → chunk-4DMJITJF.js} +5 -5
  26. package/dist/chunks/{chunk-XK4ANTIO.js → chunk-54NEBNV3.js} +2 -2
  27. package/dist/chunks/{chunk-GCIBSVYX.js → chunk-5EOQWRBM.js} +4 -4
  28. package/dist/chunks/{chunk-OOWGXPY2.js → chunk-5PAU4A3K.js} +2 -2
  29. package/dist/chunks/{chunk-G4SE3TXK.js → chunk-6BRAEYBL.js} +10 -10
  30. package/dist/chunks/{chunk-E6XGUJ2I.js → chunk-6GOXVYVF.js} +3 -3
  31. package/dist/chunks/{chunk-6T7HV4J5.js → chunk-6JGKF5CJ.js} +20 -13
  32. package/dist/chunks/chunk-6JGKF5CJ.js.map +6 -0
  33. package/dist/chunks/{chunk-G5LUEMDI.js → chunk-76DVKFKX.js} +53 -39
  34. package/dist/chunks/chunk-76DVKFKX.js.map +6 -0
  35. package/dist/chunks/{chunk-TP62BP32.js → chunk-B47YGS45.js} +9 -9
  36. package/dist/chunks/{chunk-4ET34X7Z.js → chunk-BBESTSGG.js} +2 -2
  37. package/dist/chunks/{chunk-NJWCOR7Z.js → chunk-BIV4ZVMQ.js} +2 -2
  38. package/dist/chunks/{chunk-R7TYDKKC.js → chunk-BTTD4VKX.js} +4 -4
  39. package/dist/chunks/{chunk-6TUISLKZ.js → chunk-CCYLACZC.js} +2 -2
  40. package/dist/chunks/{chunk-ZLQ5BZ4X.js → chunk-DZBKO5XZ.js} +2 -2
  41. package/dist/chunks/{chunk-GXSMCKZJ.js → chunk-EPMW4N5H.js} +3 -3
  42. package/dist/chunks/{chunk-7DSJTL5S.js → chunk-EQTOFC36.js} +2 -2
  43. package/dist/chunks/{chunk-2FMMT4JD.js → chunk-EWMX4NYZ.js} +2 -2
  44. package/dist/chunks/{chunk-XKRU6FOU.js → chunk-FAL6MHR7.js} +2 -2
  45. package/dist/chunks/{chunk-P2CHZ6FL.js → chunk-FDV7XIWK.js} +3 -3
  46. package/dist/chunks/{chunk-PVCJHQP5.js → chunk-GJABD7QF.js} +6 -6
  47. package/dist/chunks/{chunk-ZFBUNTJO.js → chunk-GO3IILJG.js} +3 -3
  48. package/dist/chunks/{chunk-LNDECWNR.js → chunk-GVT765NL.js} +2 -2
  49. package/dist/chunks/{chunk-4UXO3V22.js → chunk-HVNC42NZ.js} +3 -3
  50. package/dist/chunks/{chunk-ZBLTMOOD.js → chunk-IOCOFAL2.js} +114 -2
  51. package/dist/chunks/{chunk-ZBLTMOOD.js.map → chunk-IOCOFAL2.js.map} +2 -2
  52. package/dist/chunks/{chunk-QUKAQLNS.js → chunk-JCP7GH4E.js} +9 -9
  53. package/dist/chunks/{chunk-WX6B7RLT.js → chunk-JEIT4APA.js} +2 -2
  54. package/dist/chunks/{chunk-R2KYP3AT.js → chunk-JFAQGZU4.js} +2 -2
  55. package/dist/chunks/{chunk-GEX2EXU3.js → chunk-JPQSIROH.js} +4 -4
  56. package/dist/chunks/{chunk-EPS5ROMN.js → chunk-JW67WBS2.js} +10 -10
  57. package/dist/chunks/{chunk-BCFC5GGU.js → chunk-KL3CLIA2.js} +12 -12
  58. package/dist/chunks/{chunk-USIRIOSH.js → chunk-KOTJVZ33.js} +5 -5
  59. package/dist/chunks/{chunk-YJPHE4O3.js → chunk-LID7O2YP.js} +5 -5
  60. package/dist/chunks/{chunk-43Q3E36I.js → chunk-M2VJZ5G5.js} +2 -2
  61. package/dist/chunks/{chunk-5WOHNIH4.js → chunk-MJOO5EA4.js} +3 -3
  62. package/dist/chunks/{chunk-6CZOIEKE.js → chunk-MUT6I5NR.js} +15 -5
  63. package/dist/chunks/{chunk-6CZOIEKE.js.map → chunk-MUT6I5NR.js.map} +1 -1
  64. package/dist/chunks/{chunk-MCTUVMMB.js → chunk-MVMP5SIL.js} +4 -4
  65. package/dist/chunks/{chunk-SR32C4A7.js → chunk-NIBYXC3H.js} +3 -3
  66. package/dist/chunks/{chunk-GBRTN4AK.js → chunk-NPRTOWXF.js} +3 -3
  67. package/dist/chunks/{chunk-4GFWZYTR.js → chunk-NSPM2ALB.js} +5 -5
  68. package/dist/chunks/{chunk-SLRBCV4D.js → chunk-NZAFY2F4.js} +2 -2
  69. package/dist/chunks/{chunk-W3M3UGWQ.js → chunk-OS4QHE3D.js} +4 -4
  70. package/dist/chunks/{chunk-4IYPPPIR.js → chunk-PBGIIPSL.js} +4 -4
  71. package/dist/chunks/{chunk-SMJQ7LVL.js → chunk-PF32FZUI.js} +2 -2
  72. package/dist/chunks/{chunk-753B7NQX.js → chunk-Q6JWNB54.js} +34 -34
  73. package/dist/chunks/{chunk-YNJ3SWIL.js → chunk-QCL4LFUZ.js} +788 -230
  74. package/dist/chunks/chunk-QCL4LFUZ.js.map +6 -0
  75. package/dist/chunks/{chunk-VJAVIDVB.js → chunk-QDWRNNKU.js} +12 -110
  76. package/dist/chunks/chunk-QDWRNNKU.js.map +6 -0
  77. package/dist/chunks/{chunk-56IRGZRX.js → chunk-QHGD7RLH.js} +3 -3
  78. package/dist/chunks/{chunk-2GBI7JYG.js → chunk-QZAYT5UR.js} +2 -2
  79. package/dist/chunks/{chunk-EISC5X74.js → chunk-R4SQ7YG2.js} +2 -2
  80. package/dist/chunks/{chunk-JHDNGNQT.js → chunk-SF5VE66A.js} +2 -2
  81. package/dist/chunks/{chunk-LJHHAKBL.js → chunk-SVRLQQMB.js} +3 -3
  82. package/dist/chunks/{chunk-ZP4KWNIL.js → chunk-TGUXLYS2.js} +13 -13
  83. package/dist/chunks/{chunk-564OI5HN.js → chunk-TUHTURON.js} +2 -2
  84. package/dist/chunks/{chunk-4WFAYG6V.js → chunk-U73P6IJU.js} +2140 -3309
  85. package/dist/chunks/chunk-U73P6IJU.js.map +6 -0
  86. package/dist/chunks/{chunk-AOKRFS3Z.js → chunk-UEETLO7H.js} +2 -2
  87. package/dist/chunks/{chunk-HXV7TDNY.js → chunk-UNYSNMAQ.js} +2 -2
  88. package/dist/chunks/{chunk-5AQVWTHV.js → chunk-UVGXDFY5.js} +2 -2
  89. package/dist/chunks/{chunk-WI5ADHTS.js → chunk-VJXFLYGQ.js} +2 -2
  90. package/dist/chunks/{chunk-BPW5AT4B.js → chunk-WEQDKDC3.js} +3 -3
  91. package/dist/chunks/{chunk-LYSN3FIQ.js → chunk-WG7E73KJ.js} +3 -3
  92. package/dist/chunks/{chunk-DKJHMWCA.js → chunk-WH6LELNJ.js} +7 -7
  93. package/dist/chunks/{chunk-IE5XIE4W.js → chunk-XCECERRM.js} +32 -8
  94. package/dist/chunks/{chunk-IE5XIE4W.js.map → chunk-XCECERRM.js.map} +1 -1
  95. package/dist/chunks/{chunk-RR3ASZMK.js → chunk-XCGIZUMG.js} +3 -3
  96. package/dist/chunks/{chunk-YW3GNCCK.js → chunk-XKRGL5Z5.js} +3 -3
  97. package/dist/chunks/{chunk-P3KXW262.js → chunk-XWMIL5WP.js} +2 -2
  98. package/dist/chunks/{chunk-UZX4K743.js → chunk-YZFC3GTH.js} +3 -3
  99. package/dist/chunks/{chunk-CDOLJHIB.js → chunk-Z2PZBUDP.js} +2 -2
  100. package/dist/chunks/{cli-runtime-EDDXHFSX.js → cli-runtime-YAF6N4B4.js} +12 -12
  101. package/dist/chunks/{commands-KESYD3SM.js → commands-UJGFQSQ4.js} +5 -5
  102. package/dist/chunks/{crash-report-JRRCPLE7.js → crash-report-YQOJKQCG.js} +7 -7
  103. package/dist/chunks/{dist-XUIAXPXU.js → dist-2L7NSJJE.js} +2 -2
  104. package/dist/chunks/{dist-F3BMUZ3P.js → dist-AFI563E4.js} +2 -2
  105. package/dist/chunks/{dist-GZSRTUES.js → dist-B445LLNF.js} +2 -2
  106. package/dist/chunks/{dist-EGALCLMC.js → dist-GETHBP7P.js} +2 -2
  107. package/dist/chunks/{dist-7V7KU2WK.js → dist-GL2VWTJS.js} +174 -36
  108. package/dist/chunks/dist-GL2VWTJS.js.map +6 -0
  109. package/dist/chunks/{dist-IEWJJJHL.js → dist-H6SCKMJX.js} +2 -2
  110. package/dist/chunks/{dist-ML6MP7J3.js → dist-HYGOYQLL.js} +2 -2
  111. package/dist/chunks/{dist-DLVIWPSW.js → dist-MF62HCKV.js} +2 -2
  112. package/dist/chunks/{doctor-URLWCDCG.js → doctor-H27EQ5RE.js} +18 -18
  113. package/dist/chunks/{drain-XYBMXTKG.js → drain-WO6UFXH4.js} +9 -9
  114. package/dist/chunks/{entry-BTK3MMFH.js → entry-QFLKR4O3.js} +6 -6
  115. package/dist/chunks/{eval-SS6TIGOD.js → eval-SKVWJKSU.js} +2 -2
  116. package/dist/chunks/{exec-MGDFWPM2.js → exec-ZAXVBVTH.js} +35 -35
  117. package/dist/chunks/{home-PPWVKIU6.js → home-5EUINGKN.js} +3 -3
  118. package/dist/chunks/{host-RHMJMJAH.js → host-5EP6E23T.js} +10 -10
  119. package/dist/chunks/{host-queries-DUR62LWA.js → host-queries-6NEPSEAS.js} +15 -15
  120. package/dist/chunks/{install-LVQAT4QP.js → install-F6PU4SYH.js} +2 -2
  121. package/dist/chunks/{learn-AF7N7BLO.js → learn-HJMN624W.js} +11 -11
  122. package/dist/chunks/{learn-builtin-J7GKFBXU.js → learn-builtin-VRTLHEQW.js} +14 -14
  123. package/dist/chunks/{lifecycle-RGXBSC3L.js → lifecycle-MJTRWTCM.js} +29 -29
  124. package/dist/chunks/{list-YOLX5SWE.js → list-LFBLFIKV.js} +11 -11
  125. package/dist/chunks/{live-RVNUQYAY.js → live-MOEHIAAF.js} +17 -17
  126. package/dist/chunks/{login-RFNV3I7R.js → login-4NTLCW7N.js} +14 -14
  127. package/dist/chunks/{logs-RTREGKV5.js → logs-EUKQL5B7.js} +4 -4
  128. package/dist/chunks/{mcp-SPQQPLJE.js → mcp-CVG7FG6J.js} +37 -26
  129. package/dist/chunks/mcp-CVG7FG6J.js.map +6 -0
  130. package/dist/chunks/{message-command-E7V5KLFO.js → message-command-WCIE3455.js} +42 -42
  131. package/dist/chunks/{open-P43XO4HN.js → open-ZY2THIE3.js} +8 -8
  132. package/dist/chunks/{operator-tools-O43OOXJJ.js → operator-tools-D6L7ASDD.js} +13 -13
  133. package/dist/chunks/{output-schema-HQ37VOZT.js → output-schema-GR4GYBPU.js} +3 -3
  134. package/dist/chunks/{pal-24C6YOEW.js → pal-O2V75KQK.js} +17 -17
  135. package/dist/chunks/{peers-722AUQGX.js → peers-QB4HQ5PZ.js} +6 -6
  136. package/dist/chunks/{peers-IPO7XN5V.js → peers-TNGB6WQH.js} +7 -7
  137. package/dist/chunks/{providers-5OKXU3AF.js → providers-5VUFH7IJ.js} +12 -12
  138. package/dist/chunks/{pty-2YQ4ASHS.js → pty-ORVEC6FI.js} +3 -3
  139. package/dist/chunks/resume-YK5YX2GP.js +23 -0
  140. package/dist/chunks/{resume-command-SGKIUUR7.js → resume-command-26JB6FZZ.js} +4 -4
  141. package/dist/chunks/{schedule-6JFYGG2R.js → schedule-LSM2OF24.js} +8 -8
  142. package/dist/chunks/{service-WJ5VNXQ5.js → service-V2BNTEB4.js} +29 -29
  143. package/dist/chunks/{skills-PCETONZ5.js → skills-T2ZYRYZF.js} +8 -8
  144. package/dist/chunks/{start-check-UJOG3VAS.js → start-check-A4B3AXO2.js} +2 -2
  145. package/dist/chunks/{startup-failure-Q5I6S7KQ.js → startup-failure-YHDJI7YI.js} +2 -2
  146. package/dist/chunks/{state-NUXXHBA5.js → state-OY6VG73L.js} +2 -2
  147. package/dist/chunks/{store-3R5KTEP5.js → store-DBWWXNYV.js} +6 -6
  148. package/dist/chunks/{store-XO6CFKZI.js → store-IVQVINSF.js} +10 -10
  149. package/dist/chunks/{store-KO52OXSR.js → store-LEOLKXRN.js} +4 -4
  150. package/dist/chunks/{store-A2RYRTI6.js → store-QPO2TZ42.js} +3 -3
  151. package/dist/chunks/{tui-AAB7734Z.js → tui-VCNESTDO.js} +2012 -1188
  152. package/dist/chunks/tui-VCNESTDO.js.map +6 -0
  153. package/dist/chunks/{undici-LWANNIOV.js → undici-RMBWH37N.js} +999 -445
  154. package/dist/chunks/undici-RMBWH37N.js.map +6 -0
  155. package/dist/chunks/{upgrade-NPINYN5F.js → upgrade-QQ665A7W.js} +7 -7
  156. package/dist/chunks/{workspaces-BGRV6TQ6.js → workspaces-5JL7LPKW.js} +16 -16
  157. package/dist/chunks/{worktree-5LYQWD4H.js → worktree-U2RO5D47.js} +12 -12
  158. package/dist/commands/acp-screen-question.d.ts +32 -0
  159. package/dist/commands/acp-screen-question.d.ts.map +1 -0
  160. package/dist/commands/acp.d.ts +10 -1
  161. package/dist/commands/acp.d.ts.map +1 -1
  162. package/dist/commands/desktop-host.d.ts +2 -0
  163. package/dist/commands/desktop-host.d.ts.map +1 -1
  164. package/dist/commands/mcp-oauth-login.d.ts.map +1 -1
  165. package/dist/config/desktop-settings.d.ts +39 -0
  166. package/dist/config/desktop-settings.d.ts.map +1 -0
  167. package/dist/config/load.d.ts +8 -0
  168. package/dist/config/load.d.ts.map +1 -1
  169. package/dist/config/schema.d.ts +2 -2
  170. package/dist/config/settings-descriptors.d.ts +72 -0
  171. package/dist/config/settings-descriptors.d.ts.map +1 -0
  172. package/dist/index.js +21 -21
  173. package/dist/integrations/mcp/servers.d.ts.map +1 -1
  174. package/dist/integrations/providers/zen-catalogue.d.ts +14 -0
  175. package/dist/integrations/providers/zen-catalogue.d.ts.map +1 -1
  176. package/dist/tui/App.d.ts +5 -1
  177. package/dist/tui/App.d.ts.map +1 -1
  178. package/dist/tui/agent.d.ts +5 -0
  179. package/dist/tui/agent.d.ts.map +1 -1
  180. package/dist/tui/computer-use-screen-approval.d.ts +10 -0
  181. package/dist/tui/computer-use-screen-approval.d.ts.map +1 -1
  182. package/dist/tui/fullscreen/FullscreenTranscript.d.ts +30 -2
  183. package/dist/tui/fullscreen/FullscreenTranscript.d.ts.map +1 -1
  184. package/dist/tui/fullscreen/cells.d.ts +26 -0
  185. package/dist/tui/fullscreen/cells.d.ts.map +1 -0
  186. package/dist/tui/fullscreen/joiners.d.ts +17 -0
  187. package/dist/tui/fullscreen/joiners.d.ts.map +1 -0
  188. package/dist/tui/fullscreen/layout.d.ts +16 -3
  189. package/dist/tui/fullscreen/layout.d.ts.map +1 -1
  190. package/dist/tui/fullscreen/markdown-rows.d.ts +24 -0
  191. package/dist/tui/fullscreen/markdown-rows.d.ts.map +1 -0
  192. package/dist/tui/fullscreen/mouse-wheel.d.ts +16 -7
  193. package/dist/tui/fullscreen/mouse-wheel.d.ts.map +1 -1
  194. package/dist/tui/fullscreen/paint.d.ts +19 -0
  195. package/dist/tui/fullscreen/paint.d.ts.map +1 -0
  196. package/dist/tui/fullscreen/rows.d.ts +35 -0
  197. package/dist/tui/fullscreen/rows.d.ts.map +1 -0
  198. package/dist/tui/fullscreen/search.d.ts +69 -0
  199. package/dist/tui/fullscreen/search.d.ts.map +1 -0
  200. package/dist/tui/fullscreen/selection.d.ts +66 -0
  201. package/dist/tui/fullscreen/selection.d.ts.map +1 -0
  202. package/dist/tui/fullscreen/viewport.d.ts +5 -0
  203. package/dist/tui/fullscreen/viewport.d.ts.map +1 -1
  204. package/dist/tui/index.d.ts.map +1 -1
  205. package/dist/tui/keymap.d.ts +2 -0
  206. package/dist/tui/keymap.d.ts.map +1 -1
  207. package/dist/tui/transcript-scroll.d.ts +2 -0
  208. package/dist/tui/transcript-scroll.d.ts.map +1 -1
  209. package/package.json +9 -9
  210. package/dist/chunks/acp-2INAZYZT.js.map +0 -6
  211. package/dist/chunks/agent-session-5ZG6WNTC.js +0 -69
  212. package/dist/chunks/chunk-4WFAYG6V.js.map +0 -6
  213. package/dist/chunks/chunk-6T7HV4J5.js.map +0 -6
  214. package/dist/chunks/chunk-G5LUEMDI.js.map +0 -6
  215. package/dist/chunks/chunk-KZNMCCYK.js +0 -680
  216. package/dist/chunks/chunk-KZNMCCYK.js.map +0 -6
  217. package/dist/chunks/chunk-VJAVIDVB.js.map +0 -6
  218. package/dist/chunks/chunk-YNJ3SWIL.js.map +0 -6
  219. package/dist/chunks/dist-7V7KU2WK.js.map +0 -6
  220. package/dist/chunks/mcp-SPQQPLJE.js.map +0 -6
  221. package/dist/chunks/resume-IP4SVMRZ.js +0 -23
  222. package/dist/chunks/tui-AAB7734Z.js.map +0 -6
  223. package/dist/chunks/undici-LWANNIOV.js.map +0 -6
  224. /package/dist/chunks/{activity-command-J676MIML.js.map → activity-command-W7V33K4I.js.map} +0 -0
  225. /package/dist/chunks/{add-LI4SX4YZ.js.map → add-FQUU7CPV.js.map} +0 -0
  226. /package/dist/chunks/{agent-LUK4L4AW.js.map → agent-MJG43QEN.js.map} +0 -0
  227. /package/dist/chunks/{agent-session-5ZG6WNTC.js.map → agent-session-K5GXC7TI.js.map} +0 -0
  228. /package/dist/chunks/{archive-IZRS7P6C.js.map → archive-VOUK2Z7P.js.map} +0 -0
  229. /package/dist/chunks/{bin-main-XNB6LHOP.js.map → bin-main-FMGPWUMO.js.map} +0 -0
  230. /package/dist/chunks/{binding-3EE2IYAM.js.map → binding-CRYJQ7PU.js.map} +0 -0
  231. /package/dist/chunks/{browser-NI2ZPG4N.js.map → browser-MSESQ5SY.js.map} +0 -0
  232. /package/dist/chunks/{chat-5OEOFTSO.js.map → chat-JK7GKOOT.js.map} +0 -0
  233. /package/dist/chunks/{chunk-YJYFQW2F.js.map → chunk-24VVQCMV.js.map} +0 -0
  234. /package/dist/chunks/{chunk-P7YVC6KA.js.map → chunk-26CZDEKO.js.map} +0 -0
  235. /package/dist/chunks/{chunk-YPKTYCDZ.js.map → chunk-2BSKESPI.js.map} +0 -0
  236. /package/dist/chunks/{chunk-HUUVQBZR.js.map → chunk-2JZ6O4JX.js.map} +0 -0
  237. /package/dist/chunks/{chunk-CDT745GI.js.map → chunk-2RWJX3XO.js.map} +0 -0
  238. /package/dist/chunks/{chunk-Y34RP2OI.js.map → chunk-2SBMVMTO.js.map} +0 -0
  239. /package/dist/chunks/{chunk-YYLILI2G.js.map → chunk-37JCXHFG.js.map} +0 -0
  240. /package/dist/chunks/{chunk-YFKC2GZP.js.map → chunk-3KLNVOTV.js.map} +0 -0
  241. /package/dist/chunks/{chunk-L3VAFXRU.js.map → chunk-3VMSB36D.js.map} +0 -0
  242. /package/dist/chunks/{chunk-HNBF54TV.js.map → chunk-4DMJITJF.js.map} +0 -0
  243. /package/dist/chunks/{chunk-XK4ANTIO.js.map → chunk-54NEBNV3.js.map} +0 -0
  244. /package/dist/chunks/{chunk-GCIBSVYX.js.map → chunk-5EOQWRBM.js.map} +0 -0
  245. /package/dist/chunks/{chunk-OOWGXPY2.js.map → chunk-5PAU4A3K.js.map} +0 -0
  246. /package/dist/chunks/{chunk-G4SE3TXK.js.map → chunk-6BRAEYBL.js.map} +0 -0
  247. /package/dist/chunks/{chunk-E6XGUJ2I.js.map → chunk-6GOXVYVF.js.map} +0 -0
  248. /package/dist/chunks/{chunk-TP62BP32.js.map → chunk-B47YGS45.js.map} +0 -0
  249. /package/dist/chunks/{chunk-4ET34X7Z.js.map → chunk-BBESTSGG.js.map} +0 -0
  250. /package/dist/chunks/{chunk-NJWCOR7Z.js.map → chunk-BIV4ZVMQ.js.map} +0 -0
  251. /package/dist/chunks/{chunk-R7TYDKKC.js.map → chunk-BTTD4VKX.js.map} +0 -0
  252. /package/dist/chunks/{chunk-6TUISLKZ.js.map → chunk-CCYLACZC.js.map} +0 -0
  253. /package/dist/chunks/{chunk-ZLQ5BZ4X.js.map → chunk-DZBKO5XZ.js.map} +0 -0
  254. /package/dist/chunks/{chunk-GXSMCKZJ.js.map → chunk-EPMW4N5H.js.map} +0 -0
  255. /package/dist/chunks/{chunk-7DSJTL5S.js.map → chunk-EQTOFC36.js.map} +0 -0
  256. /package/dist/chunks/{chunk-2FMMT4JD.js.map → chunk-EWMX4NYZ.js.map} +0 -0
  257. /package/dist/chunks/{chunk-XKRU6FOU.js.map → chunk-FAL6MHR7.js.map} +0 -0
  258. /package/dist/chunks/{chunk-P2CHZ6FL.js.map → chunk-FDV7XIWK.js.map} +0 -0
  259. /package/dist/chunks/{chunk-PVCJHQP5.js.map → chunk-GJABD7QF.js.map} +0 -0
  260. /package/dist/chunks/{chunk-ZFBUNTJO.js.map → chunk-GO3IILJG.js.map} +0 -0
  261. /package/dist/chunks/{chunk-LNDECWNR.js.map → chunk-GVT765NL.js.map} +0 -0
  262. /package/dist/chunks/{chunk-4UXO3V22.js.map → chunk-HVNC42NZ.js.map} +0 -0
  263. /package/dist/chunks/{chunk-QUKAQLNS.js.map → chunk-JCP7GH4E.js.map} +0 -0
  264. /package/dist/chunks/{chunk-WX6B7RLT.js.map → chunk-JEIT4APA.js.map} +0 -0
  265. /package/dist/chunks/{chunk-R2KYP3AT.js.map → chunk-JFAQGZU4.js.map} +0 -0
  266. /package/dist/chunks/{chunk-GEX2EXU3.js.map → chunk-JPQSIROH.js.map} +0 -0
  267. /package/dist/chunks/{chunk-EPS5ROMN.js.map → chunk-JW67WBS2.js.map} +0 -0
  268. /package/dist/chunks/{chunk-BCFC5GGU.js.map → chunk-KL3CLIA2.js.map} +0 -0
  269. /package/dist/chunks/{chunk-USIRIOSH.js.map → chunk-KOTJVZ33.js.map} +0 -0
  270. /package/dist/chunks/{chunk-YJPHE4O3.js.map → chunk-LID7O2YP.js.map} +0 -0
  271. /package/dist/chunks/{chunk-43Q3E36I.js.map → chunk-M2VJZ5G5.js.map} +0 -0
  272. /package/dist/chunks/{chunk-5WOHNIH4.js.map → chunk-MJOO5EA4.js.map} +0 -0
  273. /package/dist/chunks/{chunk-MCTUVMMB.js.map → chunk-MVMP5SIL.js.map} +0 -0
  274. /package/dist/chunks/{chunk-SR32C4A7.js.map → chunk-NIBYXC3H.js.map} +0 -0
  275. /package/dist/chunks/{chunk-GBRTN4AK.js.map → chunk-NPRTOWXF.js.map} +0 -0
  276. /package/dist/chunks/{chunk-4GFWZYTR.js.map → chunk-NSPM2ALB.js.map} +0 -0
  277. /package/dist/chunks/{chunk-SLRBCV4D.js.map → chunk-NZAFY2F4.js.map} +0 -0
  278. /package/dist/chunks/{chunk-W3M3UGWQ.js.map → chunk-OS4QHE3D.js.map} +0 -0
  279. /package/dist/chunks/{chunk-4IYPPPIR.js.map → chunk-PBGIIPSL.js.map} +0 -0
  280. /package/dist/chunks/{chunk-SMJQ7LVL.js.map → chunk-PF32FZUI.js.map} +0 -0
  281. /package/dist/chunks/{chunk-753B7NQX.js.map → chunk-Q6JWNB54.js.map} +0 -0
  282. /package/dist/chunks/{chunk-56IRGZRX.js.map → chunk-QHGD7RLH.js.map} +0 -0
  283. /package/dist/chunks/{chunk-2GBI7JYG.js.map → chunk-QZAYT5UR.js.map} +0 -0
  284. /package/dist/chunks/{chunk-EISC5X74.js.map → chunk-R4SQ7YG2.js.map} +0 -0
  285. /package/dist/chunks/{chunk-JHDNGNQT.js.map → chunk-SF5VE66A.js.map} +0 -0
  286. /package/dist/chunks/{chunk-LJHHAKBL.js.map → chunk-SVRLQQMB.js.map} +0 -0
  287. /package/dist/chunks/{chunk-ZP4KWNIL.js.map → chunk-TGUXLYS2.js.map} +0 -0
  288. /package/dist/chunks/{chunk-564OI5HN.js.map → chunk-TUHTURON.js.map} +0 -0
  289. /package/dist/chunks/{chunk-AOKRFS3Z.js.map → chunk-UEETLO7H.js.map} +0 -0
  290. /package/dist/chunks/{chunk-HXV7TDNY.js.map → chunk-UNYSNMAQ.js.map} +0 -0
  291. /package/dist/chunks/{chunk-5AQVWTHV.js.map → chunk-UVGXDFY5.js.map} +0 -0
  292. /package/dist/chunks/{chunk-WI5ADHTS.js.map → chunk-VJXFLYGQ.js.map} +0 -0
  293. /package/dist/chunks/{chunk-BPW5AT4B.js.map → chunk-WEQDKDC3.js.map} +0 -0
  294. /package/dist/chunks/{chunk-LYSN3FIQ.js.map → chunk-WG7E73KJ.js.map} +0 -0
  295. /package/dist/chunks/{chunk-DKJHMWCA.js.map → chunk-WH6LELNJ.js.map} +0 -0
  296. /package/dist/chunks/{chunk-RR3ASZMK.js.map → chunk-XCGIZUMG.js.map} +0 -0
  297. /package/dist/chunks/{chunk-YW3GNCCK.js.map → chunk-XKRGL5Z5.js.map} +0 -0
  298. /package/dist/chunks/{chunk-P3KXW262.js.map → chunk-XWMIL5WP.js.map} +0 -0
  299. /package/dist/chunks/{chunk-UZX4K743.js.map → chunk-YZFC3GTH.js.map} +0 -0
  300. /package/dist/chunks/{chunk-CDOLJHIB.js.map → chunk-Z2PZBUDP.js.map} +0 -0
  301. /package/dist/chunks/{cli-runtime-EDDXHFSX.js.map → cli-runtime-YAF6N4B4.js.map} +0 -0
  302. /package/dist/chunks/{commands-KESYD3SM.js.map → commands-UJGFQSQ4.js.map} +0 -0
  303. /package/dist/chunks/{crash-report-JRRCPLE7.js.map → crash-report-YQOJKQCG.js.map} +0 -0
  304. /package/dist/chunks/{dist-XUIAXPXU.js.map → dist-2L7NSJJE.js.map} +0 -0
  305. /package/dist/chunks/{dist-F3BMUZ3P.js.map → dist-AFI563E4.js.map} +0 -0
  306. /package/dist/chunks/{dist-GZSRTUES.js.map → dist-B445LLNF.js.map} +0 -0
  307. /package/dist/chunks/{dist-EGALCLMC.js.map → dist-GETHBP7P.js.map} +0 -0
  308. /package/dist/chunks/{dist-IEWJJJHL.js.map → dist-H6SCKMJX.js.map} +0 -0
  309. /package/dist/chunks/{dist-ML6MP7J3.js.map → dist-HYGOYQLL.js.map} +0 -0
  310. /package/dist/chunks/{dist-DLVIWPSW.js.map → dist-MF62HCKV.js.map} +0 -0
  311. /package/dist/chunks/{doctor-URLWCDCG.js.map → doctor-H27EQ5RE.js.map} +0 -0
  312. /package/dist/chunks/{drain-XYBMXTKG.js.map → drain-WO6UFXH4.js.map} +0 -0
  313. /package/dist/chunks/{entry-BTK3MMFH.js.map → entry-QFLKR4O3.js.map} +0 -0
  314. /package/dist/chunks/{eval-SS6TIGOD.js.map → eval-SKVWJKSU.js.map} +0 -0
  315. /package/dist/chunks/{exec-MGDFWPM2.js.map → exec-ZAXVBVTH.js.map} +0 -0
  316. /package/dist/chunks/{home-PPWVKIU6.js.map → home-5EUINGKN.js.map} +0 -0
  317. /package/dist/chunks/{host-RHMJMJAH.js.map → host-5EP6E23T.js.map} +0 -0
  318. /package/dist/chunks/{host-queries-DUR62LWA.js.map → host-queries-6NEPSEAS.js.map} +0 -0
  319. /package/dist/chunks/{install-LVQAT4QP.js.map → install-F6PU4SYH.js.map} +0 -0
  320. /package/dist/chunks/{learn-AF7N7BLO.js.map → learn-HJMN624W.js.map} +0 -0
  321. /package/dist/chunks/{learn-builtin-J7GKFBXU.js.map → learn-builtin-VRTLHEQW.js.map} +0 -0
  322. /package/dist/chunks/{lifecycle-RGXBSC3L.js.map → lifecycle-MJTRWTCM.js.map} +0 -0
  323. /package/dist/chunks/{list-YOLX5SWE.js.map → list-LFBLFIKV.js.map} +0 -0
  324. /package/dist/chunks/{live-RVNUQYAY.js.map → live-MOEHIAAF.js.map} +0 -0
  325. /package/dist/chunks/{login-RFNV3I7R.js.map → login-4NTLCW7N.js.map} +0 -0
  326. /package/dist/chunks/{logs-RTREGKV5.js.map → logs-EUKQL5B7.js.map} +0 -0
  327. /package/dist/chunks/{message-command-E7V5KLFO.js.map → message-command-WCIE3455.js.map} +0 -0
  328. /package/dist/chunks/{open-P43XO4HN.js.map → open-ZY2THIE3.js.map} +0 -0
  329. /package/dist/chunks/{operator-tools-O43OOXJJ.js.map → operator-tools-D6L7ASDD.js.map} +0 -0
  330. /package/dist/chunks/{output-schema-HQ37VOZT.js.map → output-schema-GR4GYBPU.js.map} +0 -0
  331. /package/dist/chunks/{pal-24C6YOEW.js.map → pal-O2V75KQK.js.map} +0 -0
  332. /package/dist/chunks/{peers-722AUQGX.js.map → peers-QB4HQ5PZ.js.map} +0 -0
  333. /package/dist/chunks/{peers-IPO7XN5V.js.map → peers-TNGB6WQH.js.map} +0 -0
  334. /package/dist/chunks/{providers-5OKXU3AF.js.map → providers-5VUFH7IJ.js.map} +0 -0
  335. /package/dist/chunks/{pty-2YQ4ASHS.js.map → pty-ORVEC6FI.js.map} +0 -0
  336. /package/dist/chunks/{resume-IP4SVMRZ.js.map → resume-YK5YX2GP.js.map} +0 -0
  337. /package/dist/chunks/{resume-command-SGKIUUR7.js.map → resume-command-26JB6FZZ.js.map} +0 -0
  338. /package/dist/chunks/{schedule-6JFYGG2R.js.map → schedule-LSM2OF24.js.map} +0 -0
  339. /package/dist/chunks/{service-WJ5VNXQ5.js.map → service-V2BNTEB4.js.map} +0 -0
  340. /package/dist/chunks/{skills-PCETONZ5.js.map → skills-T2ZYRYZF.js.map} +0 -0
  341. /package/dist/chunks/{start-check-UJOG3VAS.js.map → start-check-A4B3AXO2.js.map} +0 -0
  342. /package/dist/chunks/{startup-failure-Q5I6S7KQ.js.map → startup-failure-YHDJI7YI.js.map} +0 -0
  343. /package/dist/chunks/{state-NUXXHBA5.js.map → state-OY6VG73L.js.map} +0 -0
  344. /package/dist/chunks/{store-3R5KTEP5.js.map → store-DBWWXNYV.js.map} +0 -0
  345. /package/dist/chunks/{store-A2RYRTI6.js.map → store-IVQVINSF.js.map} +0 -0
  346. /package/dist/chunks/{store-KO52OXSR.js.map → store-LEOLKXRN.js.map} +0 -0
  347. /package/dist/chunks/{store-XO6CFKZI.js.map → store-QPO2TZ42.js.map} +0 -0
  348. /package/dist/chunks/{upgrade-NPINYN5F.js.map → upgrade-QQ665A7W.js.map} +0 -0
  349. /package/dist/chunks/{workspaces-BGRV6TQ6.js.map → workspaces-5JL7LPKW.js.map} +0 -0
  350. /package/dist/chunks/{worktree-5LYQWD4H.js.map → worktree-U2RO5D47.js.map} +0 -0
@@ -5,10 +5,10 @@ import {
5
5
  } from "./chunk-NUGPLXVK.js";
6
6
  import {
7
7
  restrictToOwner
8
- } from "./chunk-ZLQ5BZ4X.js";
8
+ } from "./chunk-DZBKO5XZ.js";
9
9
  import {
10
10
  namzuHomePath
11
- } from "./chunk-5AQVWTHV.js";
11
+ } from "./chunk-UVGXDFY5.js";
12
12
  import {
13
13
  MCPClient,
14
14
  MCPHttpStatusError,
@@ -44,7 +44,7 @@ import {
44
44
  unknown,
45
45
  url,
46
46
  wrapUntrusted
47
- } from "./chunk-4WFAYG6V.js";
47
+ } from "./chunk-U73P6IJU.js";
48
48
  import {
49
49
  __name
50
50
  } from "./chunk-76FLAFCG.js";
@@ -544,7 +544,7 @@ function createMcpOAuthProvider(options) {
544
544
  }
545
545
  __name(createMcpOAuthProvider, "createMcpOAuthProvider");
546
546
 
547
- // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.1.0/node_modules/@modelcontextprotocol/client/dist/chunk-Br0eD_fh.mjs
547
+ // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.4.0/node_modules/@modelcontextprotocol/client/dist/chunk-DYPzFuB5.mjs
548
548
  var __create = Object.create;
549
549
  var __defProp = Object.defineProperty;
550
550
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -584,7 +584,7 @@ var __toESM = /* @__PURE__ */ __name((mod, isNodeMode, target) => (target = mod
584
584
  enumerable: true
585
585
  }) : target, mod)), "__toESM");
586
586
 
587
- // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.1.0/node_modules/@modelcontextprotocol/client/dist/dialects-BOhdv1Fc.mjs
587
+ // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.4.0/node_modules/@modelcontextprotocol/client/dist/dialects-BAIiebX0.mjs
588
588
  var DRAFT_2020_12_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft/2020-12/schema", "http://json-schema.org/draft/2020-12/schema"]);
589
589
  var DRAFT_2019_09_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft/2019-09/schema", "http://json-schema.org/draft/2019-09/schema"]);
590
590
  var DRAFT_07_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft-07/schema", "http://json-schema.org/draft-07/schema"]);
@@ -603,7 +603,7 @@ function declaredDialect(schema, remedy) {
603
603
  }
604
604
  __name(declaredDialect, "declaredDialect");
605
605
 
606
- // ../../node_modules/.pnpm/@modelcontextprotocol+core@2.1.0/node_modules/@modelcontextprotocol/core/dist/auth-CGP0BDVq.mjs
606
+ // ../../node_modules/.pnpm/@modelcontextprotocol+core@2.4.0/node_modules/@modelcontextprotocol/core/dist/schemas-DscsoNZN.mjs
607
607
  var LATEST_PROTOCOL_VERSION = "2025-11-25";
608
608
  var SUPPORTED_PROTOCOL_VERSIONS = [
609
609
  LATEST_PROTOCOL_VERSION,
@@ -1391,6 +1391,8 @@ var ServerResultSchema = union([
1391
1391
  ListToolsResultSchema,
1392
1392
  SubscriptionsListenResultSchema
1393
1393
  ]);
1394
+
1395
+ // ../../node_modules/.pnpm/@modelcontextprotocol+core@2.4.0/node_modules/@modelcontextprotocol/core/dist/auth-UMQCo-ad.mjs
1394
1396
  var SafeUrlSchema = url().superRefine((val, ctx) => {
1395
1397
  if (!URL.canParse(val)) {
1396
1398
  ctx.addIssue({
@@ -1492,7 +1494,8 @@ var OAuthTokensSchema = object({
1492
1494
  token_type: string(),
1493
1495
  expires_in: coerce_exports.number().optional(),
1494
1496
  scope: string().optional(),
1495
- refresh_token: string().optional()
1497
+ refresh_token: string().optional(),
1498
+ issuer: string().optional().catch(void 0)
1496
1499
  }).strip();
1497
1500
  var IdJagTokenExchangeResponseSchema = object({
1498
1501
  issued_token_type: literal("urn:ietf:params:oauth:token-type:id-jag"),
@@ -1530,7 +1533,8 @@ var OAuthClientInformationSchema = object({
1530
1533
  client_id: string(),
1531
1534
  client_secret: string().optional(),
1532
1535
  client_id_issued_at: number().optional(),
1533
- client_secret_expires_at: number().optional()
1536
+ client_secret_expires_at: number().optional(),
1537
+ issuer: string().optional().catch(void 0)
1534
1538
  }).strip();
1535
1539
  var OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
1536
1540
  var OAuthClientRegistrationErrorSchema = object({
@@ -1542,7 +1546,7 @@ var OAuthTokenRevocationRequestSchema = object({
1542
1546
  token_type_hint: string().optional()
1543
1547
  }).strip();
1544
1548
 
1545
- // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.1.0/node_modules/@modelcontextprotocol/client/dist/src-DDAAhLnO.mjs
1549
+ // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.4.0/node_modules/@modelcontextprotocol/client/dist/src-CeKsbNLO.mjs
1546
1550
  var BRANDS = /* @__PURE__ */ Symbol.for("mcp.sdk.errorBrands");
1547
1551
  function stampErrorBrands(instance, ctor) {
1548
1552
  const brands = /* @__PURE__ */ new Set();
@@ -1732,6 +1736,13 @@ function resourceUrlFromServerUrl(url2) {
1732
1736
  return resourceURL;
1733
1737
  }
1734
1738
  __name(resourceUrlFromServerUrl, "resourceUrlFromServerUrl");
1739
+ function withoutIssuer(body) {
1740
+ if (typeof body !== "object" || body === null || Array.isArray(body)) return body;
1741
+ const copy = { ...body };
1742
+ delete copy.issuer;
1743
+ return copy;
1744
+ }
1745
+ __name(withoutIssuer, "withoutIssuer");
1735
1746
  function checkResourceAllowed({ requestedResource, configuredResource }) {
1736
1747
  const requested = typeof requestedResource === "string" ? new URL(requestedResource) : new URL(requestedResource.href);
1737
1748
  const configured = typeof configuredResource === "string" ? new URL(configuredResource) : new URL(configuredResource.href);
@@ -3821,7 +3832,8 @@ function build() {
3821
3832
  ListResourceTemplatesResultResponseSchema: wireResultResponse(ListResourceTemplatesResultSchema$1),
3822
3833
  ReadResourceResultResponseSchema: wireResultResponse(union([ReadResourceResultSchema$1, InputRequiredResultSchema])),
3823
3834
  CompleteResultResponseSchema: wireResultResponse(CompleteResultSchema$1),
3824
- DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1)
3835
+ DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1),
3836
+ SubscriptionsListenResultResponseSchema: wireResultResponse(SubscriptionsListenResultSchema$1)
3825
3837
  };
3826
3838
  }
3827
3839
  __name(build, "build");
@@ -4269,6 +4281,8 @@ var rev2026Codec = {
4269
4281
  const rawInputRequests = raw["inputRequests"];
4270
4282
  const inputRequests = isPlainObject$3(rawInputRequests) ? rawInputRequests : {};
4271
4283
  const requestState = raw["requestState"];
4284
+ const metaParse = raw["_meta"] === void 0 ? void 0 : buildSchemas2026().ResultMetaSchema.safeParse(raw["_meta"]);
4285
+ const meta = metaParse?.success ? metaParse.data : void 0;
4272
4286
  if (Object.keys(inputRequests).length === 0 && typeof requestState !== "string") return {
4273
4287
  kind: "invalid",
4274
4288
  error: new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${method}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`, {
@@ -4279,7 +4293,8 @@ var rev2026Codec = {
4279
4293
  return {
4280
4294
  kind: "input_required",
4281
4295
  inputRequests,
4282
- ...typeof requestState === "string" && { requestState }
4296
+ ...typeof requestState === "string" && { requestState },
4297
+ ...meta !== void 0 && { _meta: meta }
4283
4298
  };
4284
4299
  }
4285
4300
  if (rawResultType !== "complete") return {
@@ -4351,6 +4366,10 @@ function isSpecNotificationMethod(method) {
4351
4366
  return ALL_CODECS.some((codec) => codec.hasNotificationMethod(method));
4352
4367
  }
4353
4368
  __name(isSpecNotificationMethod, "isSpecNotificationMethod");
4369
+ function isExtensionReusedRequestMethod(method) {
4370
+ return method === "tasks/get" || method === "tasks/cancel";
4371
+ }
4372
+ __name(isExtensionReusedRequestMethod, "isExtensionReusedRequestMethod");
4354
4373
  var ALL_CODECS = [rev2025Codec, rev2026Codec];
4355
4374
  var schemas_exports = /* @__PURE__ */ __exportAll({
4356
4375
  AnnotationsSchema: /* @__PURE__ */ __name(() => AnnotationsSchema, "AnnotationsSchema"),
@@ -4533,12 +4552,12 @@ var RFC9110_TOKEN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
4533
4552
  var PERMITTED_X_MCP_HEADER_TYPES = /* @__PURE__ */ new Set([
4534
4553
  "string",
4535
4554
  "integer",
4536
- "boolean",
4537
- "number"
4555
+ "boolean"
4538
4556
  ]);
4539
4557
  function scanXMcpHeaderDeclarations(inputSchema) {
4540
4558
  const declarations = [];
4541
4559
  const seenLower = /* @__PURE__ */ new Map();
4560
+ let numberFault;
4542
4561
  const visit = /* @__PURE__ */ __name((node, path, reachable) => {
4543
4562
  if (node === null || typeof node !== "object") return void 0;
4544
4563
  const schema = node;
@@ -4548,7 +4567,11 @@ function scanXMcpHeaderDeclarations(inputSchema) {
4548
4567
  if (typeof raw !== "string" || raw.length === 0) return `${pathName(path)}: x-mcp-header MUST be a non-empty string`;
4549
4568
  if (!RFC9110_TOKEN.test(raw)) return `${pathName(path)}: x-mcp-header '${raw}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;
4550
4569
  const type = typeof schema.type === "string" ? schema.type : void 0;
4551
- if (type === void 0 || !PERMITTED_X_MCP_HEADER_TYPES.has(type)) return `${pathName(path)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${type ?? "<none>"}`;
4570
+ if (type === void 0 || !PERMITTED_X_MCP_HEADER_TYPES.has(type)) {
4571
+ const fault$1 = `${pathName(path)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${type ?? "<none>"}`;
4572
+ if (type !== "number") return fault$1;
4573
+ numberFault ??= fault$1;
4574
+ }
4552
4575
  const lower = raw.toLowerCase();
4553
4576
  const prior = seenLower.get(lower);
4554
4577
  if (prior !== void 0) return `x-mcp-header '${raw}' is not case-insensitively unique (also declared as '${prior}')`;
@@ -4575,12 +4598,17 @@ function scanXMcpHeaderDeclarations(inputSchema) {
4575
4598
  }
4576
4599
  }, "visit");
4577
4600
  const fault = visit(inputSchema, [], true);
4578
- return fault === void 0 ? {
4601
+ if (fault !== void 0) return {
4602
+ valid: false,
4603
+ reason: numberFault ?? fault
4604
+ };
4605
+ return numberFault === void 0 ? {
4579
4606
  valid: true,
4580
4607
  declarations
4581
4608
  } : {
4582
4609
  valid: false,
4583
- reason: fault
4610
+ reason: numberFault,
4611
+ declarations
4584
4612
  };
4585
4613
  }
4586
4614
  __name(scanXMcpHeaderDeclarations, "scanXMcpHeaderDeclarations");
@@ -4826,15 +4854,18 @@ function standardSchemaToJsonSchema(schema, io = "input") {
4826
4854
  };
4827
4855
  }
4828
4856
  __name(standardSchemaToJsonSchema, "standardSchemaToJsonSchema");
4829
- function isProvablyObjectShapedRoot(schema) {
4857
+ var LOCAL_DEFINITION_REF = /^#\/(\$defs|definitions)\/([^/~%]+)$/;
4858
+ function isProvablyObjectShapedRoot(schema, root = schema) {
4830
4859
  if ("properties" in schema || "patternProperties" in schema || "additionalProperties" in schema || "required" in schema) return true;
4860
+ const ref = typeof schema.$ref === "string" && LOCAL_DEFINITION_REF.exec(schema.$ref);
4861
+ if (ref && root[ref[1]]?.[ref[2]]?.type === "object") return true;
4831
4862
  for (const key of [
4832
4863
  "oneOf",
4833
4864
  "anyOf",
4834
4865
  "allOf"
4835
4866
  ]) {
4836
4867
  const members = schema[key];
4837
- if (Array.isArray(members) && members.length > 0) return members.every((m) => m !== null && typeof m === "object" && (m.type === "object" || isProvablyObjectShapedRoot(m)));
4868
+ if (Array.isArray(members) && members.length > 0) return members.every((m) => m !== null && typeof m === "object" && (m.type === "object" || isProvablyObjectShapedRoot(m, "$id" in m ? {} : root)));
4838
4869
  }
4839
4870
  return false;
4840
4871
  }
@@ -5433,6 +5464,8 @@ var Protocol = class {
5433
5464
  _transport;
5434
5465
  _requestMessageId = 0;
5435
5466
  _requestHandlers = /* @__PURE__ */ new Map();
5467
+ /** Methods registered with an explicit schema; the era gate in `_onrequest` reads it for the Tasks extension names. */
5468
+ _customSchemaRequestMethods = /* @__PURE__ */ new Set();
5436
5469
  _requestHandlerAbortControllers = /* @__PURE__ */ new Map();
5437
5470
  _notificationHandlers = /* @__PURE__ */ new Map();
5438
5471
  _responseHandlers = /* @__PURE__ */ new Map();
@@ -5716,7 +5749,7 @@ var Protocol = class {
5716
5749
  return;
5717
5750
  }
5718
5751
  }
5719
- if (isSpecRequestMethod(request.method) && !codec.hasRequestMethod(request.method)) {
5752
+ if (isSpecRequestMethod(request.method) && !codec.hasRequestMethod(request.method) && !(isExtensionReusedRequestMethod(request.method) && this._customSchemaRequestMethods.has(request.method))) {
5720
5753
  sendErrorResponse(ProtocolErrorCode.MethodNotFound, "Method not found");
5721
5754
  return;
5722
5755
  }
@@ -5849,8 +5882,11 @@ var Protocol = class {
5849
5882
  }
5850
5883
  request(request, schemaOrOptions, maybeOptions) {
5851
5884
  const codec = this._resolveOutboundCodec(request.method);
5885
+ if (isStandardSchema(schemaOrOptions)) {
5886
+ if (!isExtensionReusedRequestMethod(request.method)) this._assertOutboundRequestInEra(codec, request.method);
5887
+ return this._requestWithSchemaViaCodec(codec, request, schemaOrOptions, maybeOptions);
5888
+ }
5852
5889
  this._assertOutboundRequestInEra(codec, request.method);
5853
- if (isStandardSchema(schemaOrOptions)) return this._requestWithSchemaViaCodec(codec, request, schemaOrOptions, maybeOptions);
5854
5890
  const validate = codecResultValidator(codec, request.method);
5855
5891
  if (validate === void 0) throw new TypeError(`'${request.method}' is not a spec method; pass a result schema as the second argument to request().`);
5856
5892
  return this._requestWithSchemaViaCodec(codec, request, validate, schemaOrOptions);
@@ -6043,7 +6079,7 @@ var Protocol = class {
6043
6079
  * Emits a notification, which is a one-way message that does not expect a response.
6044
6080
  */
6045
6081
  async notification(notification, options) {
6046
- return this._notificationViaCodec(this._resolveOutboundCodec(notification.method), notification, options);
6082
+ return await this._notificationViaCodec(this._resolveOutboundCodec(notification.method), notification, options);
6047
6083
  }
6048
6084
  /**
6049
6085
  * The notification funnel proper, keyed by the resolved era codec —
@@ -6094,6 +6130,8 @@ var Protocol = class {
6094
6130
  return maybeHandler(parsed.data, ctx);
6095
6131
  }, "stored");
6096
6132
  else throw new TypeError("setRequestHandler: handler is required");
6133
+ if (typeof schemasOrHandler === "function") this._customSchemaRequestMethods.delete(method);
6134
+ else this._customSchemaRequestMethods.add(method);
6097
6135
  this._requestHandlers.set(method, this._wrapHandler(method, stored));
6098
6136
  }
6099
6137
  /**
@@ -6123,6 +6161,7 @@ var Protocol = class {
6123
6161
  */
6124
6162
  removeRequestHandler(method) {
6125
6163
  this._requestHandlers.delete(method);
6164
+ this._customSchemaRequestMethods.delete(method);
6126
6165
  }
6127
6166
  /**
6128
6167
  * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
@@ -6282,7 +6321,8 @@ function manualInputRequiredValue(decoded) {
6282
6321
  return {
6283
6322
  resultType: "input_required",
6284
6323
  inputRequests: decoded.inputRequests,
6285
- ...decoded.requestState !== void 0 && { requestState: decoded.requestState }
6324
+ ...decoded.requestState !== void 0 && { requestState: decoded.requestState },
6325
+ ...decoded._meta !== void 0 && { _meta: decoded._meta }
6286
6326
  };
6287
6327
  }
6288
6328
  __name(manualInputRequiredValue, "manualInputRequiredValue");
@@ -6368,8 +6408,74 @@ function createFetchWithInit(baseFetch = fetch, baseInit) {
6368
6408
  };
6369
6409
  }
6370
6410
  __name(createFetchWithInit, "createFetchWithInit");
6411
+ var REDIRECT_STATUSES = /* @__PURE__ */ new Set([
6412
+ 301,
6413
+ 302,
6414
+ 303,
6415
+ 307,
6416
+ 308
6417
+ ]);
6418
+ var MAX_REDIRECTS = 5;
6419
+ function isWithinOrigin(from, to) {
6420
+ if (from.protocol === to.protocol && from.host === to.host) return true;
6421
+ return from.protocol === "http:" && to.protocol === "https:" && from.hostname === to.hostname && !from.port && !to.port;
6422
+ }
6423
+ __name(isWithinOrigin, "isWithinOrigin");
6424
+ function redirectTarget(url2, response) {
6425
+ const location = REDIRECT_STATUSES.has(response.status) ? response.headers?.get("location") : void 0;
6426
+ if (!location) return void 0;
6427
+ try {
6428
+ return new URL(location, url2);
6429
+ } catch {
6430
+ return;
6431
+ }
6432
+ }
6433
+ __name(redirectTarget, "redirectTarget");
6434
+ var leftToFetch = /* @__PURE__ */ new WeakSet();
6435
+ function fetchLeavingRedirects(baseFetch) {
6436
+ const copy = /* @__PURE__ */ __name((url2, init) => baseFetch(url2, init), "copy");
6437
+ leftToFetch.add(copy);
6438
+ return copy;
6439
+ }
6440
+ __name(fetchLeavingRedirects, "fetchLeavingRedirects");
6441
+ function fetchWithinOrigin(baseFetch) {
6442
+ if (leftToFetch.has(baseFetch)) return baseFetch;
6443
+ return async (url2, init) => {
6444
+ if (init?.redirect === "error" || init?.redirect === "manual") return baseFetch(url2, init);
6445
+ const method = (init?.method ?? "GET").toUpperCase();
6446
+ let current = url2;
6447
+ for (let followed = 0; ; followed++) {
6448
+ const response = await baseFetch(current, {
6449
+ ...init,
6450
+ redirect: "manual"
6451
+ });
6452
+ const target = redirectTarget(current, response);
6453
+ if (!target || followed === MAX_REDIRECTS) return response;
6454
+ const from = new URL(current);
6455
+ const keepsMethod = method === "GET" || response.status === 307 || response.status === 308;
6456
+ const keepsUserinfo = !(target.username || target.password) || target.username === from.username && target.password === from.password;
6457
+ if (!keepsMethod || !keepsUserinfo || !isWithinOrigin(from, target)) return response;
6458
+ await response.text?.().catch(() => {
6459
+ });
6460
+ current = target;
6461
+ }
6462
+ };
6463
+ }
6464
+ __name(fetchWithinOrigin, "fetchWithinOrigin");
6465
+ function unfollowedRedirect(url2, response) {
6466
+ if (response.type === "opaqueredirect") return "Redirect not followed: this runtime does not expose where it points";
6467
+ const target = redirectTarget(response.url || url2, response);
6468
+ if (!target) return void 0;
6469
+ target.username = target.password = target.search = target.hash = "";
6470
+ if (target.protocol === "http:" && new URL(response.url || url2).protocol === "https:") {
6471
+ target.protocol = "https:";
6472
+ return `Redirect from https to plain http not followed; try ${target.href} as the endpoint`;
6473
+ }
6474
+ return `Redirect to ${target.href} not followed; use that URL as the endpoint if it is the intended server`;
6475
+ }
6476
+ __name(unfollowedRedirect, "unfollowedRedirect");
6371
6477
 
6372
- // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.1.0/node_modules/@modelcontextprotocol/client/dist/ajvProvider-97rDpkRx.mjs
6478
+ // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.4.0/node_modules/@modelcontextprotocol/client/dist/ajvProvider-BIwGVY6G.mjs
6373
6479
  var require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
6374
6480
  Object.defineProperty(exports, "__esModule", { value: true });
6375
6481
  exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
@@ -9315,6 +9421,23 @@ var require_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9315
9421
  var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9316
9422
  const isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
9317
9423
  const isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
9424
+ const isPort = RegExp.prototype.test.bind(/^\d*$/u);
9425
+ const isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
9426
+ const isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
9427
+ const isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);
9428
+ const isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
9429
+ const isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
9430
+ const BYTE_HEX = new Array(256);
9431
+ {
9432
+ const HEX_DIGITS = "0123456789ABCDEF";
9433
+ for (let i = 0; i < 256; i++) BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
9434
+ }
9435
+ function percentEncodeNonAscii(cp) {
9436
+ if (cp < 2048) return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
9437
+ if (cp < 65536) return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
9438
+ return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
9439
+ }
9440
+ __name(percentEncodeNonAscii, "percentEncodeNonAscii");
9318
9441
  function stringArrayToHexStripped(input) {
9319
9442
  let acc = "";
9320
9443
  let code = 0;
@@ -9334,86 +9457,123 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9334
9457
  return acc;
9335
9458
  }
9336
9459
  __name(stringArrayToHexStripped, "stringArrayToHexStripped");
9460
+ const isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);
9461
+ const isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
9462
+ const isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
9337
9463
  const nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
9338
- function consumeIsZone(buffer) {
9339
- buffer.length = 0;
9340
- return true;
9341
- }
9342
- __name(consumeIsZone, "consumeIsZone");
9343
- function consumeHextets(buffer, address, output) {
9344
- if (buffer.length) {
9345
- const hex = stringArrayToHexStripped(buffer);
9346
- if (hex !== "") address.push(hex);
9347
- else {
9348
- output.error = true;
9349
- return false;
9464
+ function isZoneIdentifier(zone) {
9465
+ if (zone.length === 0) return false;
9466
+ for (let i = 0; i < zone.length; i++) {
9467
+ if (isZoneCharacter(zone[i])) continue;
9468
+ if (zone[i] === "%" && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {
9469
+ i += 2;
9470
+ continue;
9350
9471
  }
9351
- buffer.length = 0;
9472
+ return false;
9352
9473
  }
9353
9474
  return true;
9354
9475
  }
9355
- __name(consumeHextets, "consumeHextets");
9356
- function getIPV6(input) {
9357
- let tokenCount = 0;
9358
- const output = {
9359
- error: false,
9360
- address: "",
9361
- zone: ""
9362
- };
9363
- const address = [];
9364
- const buffer = [];
9365
- let endipv6Encountered = false;
9366
- let endIpv6 = false;
9367
- let consume = consumeHextets;
9368
- for (let i = 0; i < input.length; i++) {
9369
- const cursor = input[i];
9370
- if (cursor === "[" || cursor === "]") continue;
9371
- if (cursor === ":") {
9372
- if (endipv6Encountered === true) endIpv6 = true;
9373
- if (!consume(buffer, address, output)) break;
9374
- if (++tokenCount > 7) {
9375
- output.error = true;
9376
- break;
9377
- }
9378
- if (i > 0 && input[i - 1] === ":") endipv6Encountered = true;
9379
- address.push(":");
9380
- continue;
9381
- } else if (cursor === "%") {
9382
- if (!consume(buffer, address, output)) break;
9383
- consume = consumeIsZone;
9384
- } else {
9385
- buffer.push(cursor);
9476
+ __name(isZoneIdentifier, "isZoneIdentifier");
9477
+ function compressIPv6ZeroRun(hextets) {
9478
+ let bestStart = -1;
9479
+ let bestLength = 0;
9480
+ let runStart = -1;
9481
+ let runLength = 0;
9482
+ for (let i = 0; i < hextets.length; i++) if (hextets[i] === "0") {
9483
+ if (runStart === -1) runStart = i;
9484
+ runLength++;
9485
+ if (runLength > bestLength) {
9486
+ bestLength = runLength;
9487
+ bestStart = runStart;
9488
+ }
9489
+ } else {
9490
+ runStart = -1;
9491
+ runLength = 0;
9492
+ }
9493
+ if (bestLength < 2) return hextets.join(":");
9494
+ const head = hextets.slice(0, bestStart).join(":");
9495
+ const tail = hextets.slice(bestStart + bestLength).join(":");
9496
+ return head + "::" + tail;
9497
+ }
9498
+ __name(compressIPv6ZeroRun, "compressIPv6ZeroRun");
9499
+ function normalizeIPv6Address(input) {
9500
+ const compression = input.indexOf("::");
9501
+ if (compression !== -1 && input.indexOf("::", compression + 1) !== -1) return void 0;
9502
+ const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":");
9503
+ const right = compression === -1 ? [] : input.slice(compression + 2).split(":");
9504
+ if (compression !== -1) {
9505
+ if (left.length === 1 && left[0] === "") left.length = 0;
9506
+ if (right.length === 1 && right[0] === "") right.length = 0;
9507
+ }
9508
+ const parts = left.concat(right);
9509
+ let hextetCount = 0;
9510
+ for (let i = 0; i < parts.length; i++) {
9511
+ const part = parts[i];
9512
+ if (part === "") return void 0;
9513
+ if (part.indexOf(".") !== -1) {
9514
+ if (i !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part)) return void 0;
9515
+ hextetCount += 2;
9386
9516
  continue;
9387
9517
  }
9518
+ if (!isHextet(part)) return void 0;
9519
+ parts[i] = parseInt(part, 16).toString(16);
9520
+ hextetCount++;
9388
9521
  }
9389
- if (buffer.length) if (consume === consumeIsZone) output.zone = buffer.join("");
9390
- else if (endIpv6) address.push(buffer.join(""));
9391
- else address.push(stringArrayToHexStripped(buffer));
9392
- output.address = address.join("");
9393
- return output;
9522
+ if (compression === -1) {
9523
+ if (hextetCount !== 8) return void 0;
9524
+ return compressIPv6ZeroRun(parts);
9525
+ }
9526
+ if (hextetCount >= 8) return void 0;
9527
+ const expanded = parts.slice(0, left.length);
9528
+ for (let i = hextetCount; i < 8; i++) expanded.push("0");
9529
+ for (let i = left.length; i < parts.length; i++) expanded.push(parts[i]);
9530
+ return compressIPv6ZeroRun(expanded);
9394
9531
  }
9395
- __name(getIPV6, "getIPV6");
9532
+ __name(normalizeIPv6Address, "normalizeIPv6Address");
9396
9533
  function normalizeIPv6(host) {
9397
- if (findToken(host, ":") < 2) return {
9534
+ const bracketed = host[0] === "[" && host[host.length - 1] === "]";
9535
+ if ((host[0] === "[" || host[host.length - 1] === "]") && !bracketed) return {
9398
9536
  host,
9399
- isIPV6: false
9537
+ isIPV6: false,
9538
+ error: true
9400
9539
  };
9401
- const ipv6 = getIPV6(host);
9402
- if (!ipv6.error) {
9403
- let newHost = ipv6.address;
9404
- let escapedHost = ipv6.address;
9405
- if (ipv6.zone) {
9406
- newHost += "%" + ipv6.zone;
9407
- escapedHost += "%25" + ipv6.zone;
9408
- }
9540
+ let input = bracketed ? host.slice(1, -1) : host;
9541
+ if (bracketed && isIPvFuture(input)) {
9542
+ input = input.toLowerCase();
9409
9543
  return {
9410
- host: newHost,
9411
- isIPV6: true,
9412
- escapedHost
9544
+ host: `[${input}]`,
9545
+ escapedHost: input,
9546
+ isIPV6: false,
9547
+ isIPVFuture: true
9413
9548
  };
9414
- } else return {
9549
+ }
9550
+ if (findToken(input, ":") < 2) return {
9415
9551
  host,
9416
- isIPV6: false
9552
+ isIPV6: false,
9553
+ error: bracketed
9554
+ };
9555
+ let zoneIdentifier = "";
9556
+ const zoneSeparator = input.indexOf("%");
9557
+ if (zoneSeparator !== -1) {
9558
+ const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1;
9559
+ zoneIdentifier = input.slice(zoneSeparator + separatorLength);
9560
+ if (!isZoneIdentifier(zoneIdentifier)) return {
9561
+ host,
9562
+ isIPV6: false,
9563
+ error: true
9564
+ };
9565
+ input = input.slice(0, zoneSeparator);
9566
+ }
9567
+ const address = normalizeIPv6Address(input);
9568
+ if (address === void 0) return {
9569
+ host,
9570
+ isIPV6: false,
9571
+ error: true
9572
+ };
9573
+ return {
9574
+ host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""),
9575
+ escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""),
9576
+ isIPV6: true
9417
9577
  };
9418
9578
  }
9419
9579
  __name(normalizeIPv6, "normalizeIPv6");
@@ -9492,35 +9652,221 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9492
9652
  return output.join("");
9493
9653
  }
9494
9654
  __name(removeDotSegments, "removeDotSegments");
9495
- function normalizeComponentEncoding(component, esc) {
9496
- const func = esc !== true ? escape : unescape;
9497
- if (component.scheme !== void 0) component.scheme = func(component.scheme);
9498
- if (component.userinfo !== void 0) component.userinfo = func(component.userinfo);
9499
- if (component.host !== void 0) component.host = func(component.host);
9500
- if (component.path !== void 0) component.path = func(component.path);
9501
- if (component.query !== void 0) component.query = func(component.query);
9502
- if (component.fragment !== void 0) component.fragment = func(component.fragment);
9503
- return component;
9655
+ const HOST_DELIMS = {
9656
+ "@": "%40",
9657
+ "/": "%2F",
9658
+ "?": "%3F",
9659
+ "#": "%23",
9660
+ ":": "%3A"
9661
+ };
9662
+ const HOST_DELIM_RE = /[@/?#:]/g;
9663
+ const HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
9664
+ function reescapeHostDelimiters(host, isIP) {
9665
+ const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
9666
+ re.lastIndex = 0;
9667
+ return host.replace(re, (ch) => HOST_DELIMS[ch]);
9668
+ }
9669
+ __name(reescapeHostDelimiters, "reescapeHostDelimiters");
9670
+ function normalizePercentEncoding(input, decodeUnreserved = false) {
9671
+ if (input.indexOf("%") === -1) return input;
9672
+ let output = "";
9673
+ for (let i = 0; i < input.length; i++) {
9674
+ if (input[i] === "%" && i + 2 < input.length) {
9675
+ const hex = input.slice(i + 1, i + 3);
9676
+ if (isHexPair(hex)) {
9677
+ const normalizedHex = hex.toUpperCase();
9678
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
9679
+ if (decodeUnreserved && isUnreserved(decoded)) output += decoded;
9680
+ else output += "%" + normalizedHex;
9681
+ i += 2;
9682
+ continue;
9683
+ }
9684
+ }
9685
+ output += input[i];
9686
+ }
9687
+ return output;
9688
+ }
9689
+ __name(normalizePercentEncoding, "normalizePercentEncoding");
9690
+ function normalizePathEncoding(input) {
9691
+ let output = "";
9692
+ for (let i = 0; i < input.length; i++) {
9693
+ const ch = input[i];
9694
+ if (ch === "%" && i + 2 < input.length) {
9695
+ const hex = input.slice(i + 1, i + 3);
9696
+ if (isHexPair(hex)) {
9697
+ const normalizedHex = hex.toUpperCase();
9698
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
9699
+ if (decoded !== "." && isUnreserved(decoded)) output += decoded;
9700
+ else output += "%" + normalizedHex;
9701
+ i += 2;
9702
+ continue;
9703
+ }
9704
+ }
9705
+ if (isPathCharacter(ch)) output += ch;
9706
+ else {
9707
+ const code = input.charCodeAt(i);
9708
+ if (code < 128) output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
9709
+ else if (code < 55296 || code > 57343) output += percentEncodeNonAscii(code);
9710
+ else if (code <= 56319 && i + 1 < input.length) {
9711
+ const low = input.charCodeAt(i + 1);
9712
+ if (low >= 56320 && low <= 57343) {
9713
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
9714
+ i++;
9715
+ } else output += percentEncodeNonAscii(65533);
9716
+ } else output += percentEncodeNonAscii(65533);
9717
+ }
9718
+ }
9719
+ return output;
9720
+ }
9721
+ __name(normalizePathEncoding, "normalizePathEncoding");
9722
+ function serializePathEncoding(input, pathNoScheme = false) {
9723
+ let output = "";
9724
+ let firstSegment = pathNoScheme && input[0] !== "/";
9725
+ for (let i = 0; i < input.length; i++) {
9726
+ const ch = input[i];
9727
+ if (ch === "%" && i + 2 < input.length) {
9728
+ const hex = input.slice(i + 1, i + 3);
9729
+ if (isHexPair(hex)) {
9730
+ output += "%" + hex.toUpperCase();
9731
+ i += 2;
9732
+ continue;
9733
+ }
9734
+ }
9735
+ if (ch === "/") firstSegment = false;
9736
+ if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) output += ch;
9737
+ else {
9738
+ const code = input.charCodeAt(i);
9739
+ if (code < 128) output += BYTE_HEX[code];
9740
+ else if (code < 55296 || code > 57343) output += percentEncodeNonAscii(code);
9741
+ else if (code <= 56319 && i + 1 < input.length) {
9742
+ const low = input.charCodeAt(i + 1);
9743
+ if (low >= 56320 && low <= 57343) {
9744
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
9745
+ i++;
9746
+ } else output += percentEncodeNonAscii(65533);
9747
+ } else output += percentEncodeNonAscii(65533);
9748
+ }
9749
+ }
9750
+ return output;
9751
+ }
9752
+ __name(serializePathEncoding, "serializePathEncoding");
9753
+ function encodeComponent(input, isAllowed) {
9754
+ let output = "";
9755
+ for (let i = 0; i < input.length; i++) {
9756
+ const ch = input[i];
9757
+ if (ch === "%" && i + 2 < input.length) {
9758
+ const hex = input.slice(i + 1, i + 3);
9759
+ if (isHexPair(hex)) {
9760
+ output += "%" + hex.toUpperCase();
9761
+ i += 2;
9762
+ continue;
9763
+ }
9764
+ }
9765
+ if (isAllowed(ch)) output += ch;
9766
+ else {
9767
+ const code = input.charCodeAt(i);
9768
+ if (code < 128) output += BYTE_HEX[code];
9769
+ else if (code < 55296 || code > 57343) output += percentEncodeNonAscii(code);
9770
+ else if (code <= 56319 && i + 1 < input.length) {
9771
+ const low = input.charCodeAt(i + 1);
9772
+ if (low >= 56320 && low <= 57343) {
9773
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
9774
+ i++;
9775
+ } else output += percentEncodeNonAscii(65533);
9776
+ } else output += percentEncodeNonAscii(65533);
9777
+ }
9778
+ }
9779
+ return output;
9780
+ }
9781
+ __name(encodeComponent, "encodeComponent");
9782
+ function encodeUserinfo(input) {
9783
+ return encodeComponent(input, isUserinfoCharacter);
9784
+ }
9785
+ __name(encodeUserinfo, "encodeUserinfo");
9786
+ function encodeQuery(input) {
9787
+ return encodeComponent(input, isQueryFragmentCharacter);
9788
+ }
9789
+ __name(encodeQuery, "encodeQuery");
9790
+ function encodeFragment(input) {
9791
+ return encodeComponent(input, isQueryFragmentCharacter);
9792
+ }
9793
+ __name(encodeFragment, "encodeFragment");
9794
+ function isEscapeSafe(cp) {
9795
+ return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 42 || cp === 43 || cp === 45 || cp === 46 || cp === 47 || cp === 64 || cp === 95;
9796
+ }
9797
+ __name(isEscapeSafe, "isEscapeSafe");
9798
+ function normalizeQueryFragmentEncoding(input) {
9799
+ let output = "";
9800
+ for (let i = 0; i < input.length; i++) {
9801
+ const ch = input[i];
9802
+ if (ch === "%" && i + 2 < input.length) {
9803
+ const hex = input.slice(i + 1, i + 3);
9804
+ if (isHexPair(hex)) {
9805
+ const normalizedHex = hex.toUpperCase();
9806
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
9807
+ if (isUnreserved(decoded)) output += decoded;
9808
+ else output += "%" + normalizedHex;
9809
+ i += 2;
9810
+ continue;
9811
+ }
9812
+ }
9813
+ if (isQueryFragmentCharacter(ch)) output += ch;
9814
+ else {
9815
+ const code = input.charCodeAt(i);
9816
+ if (code < 128) output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
9817
+ else if (code < 55296 || code > 57343) output += percentEncodeNonAscii(code);
9818
+ else if (code <= 56319 && i + 1 < input.length) {
9819
+ const low = input.charCodeAt(i + 1);
9820
+ if (low >= 56320 && low <= 57343) {
9821
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
9822
+ i++;
9823
+ } else output += percentEncodeNonAscii(65533);
9824
+ } else output += percentEncodeNonAscii(65533);
9825
+ }
9826
+ }
9827
+ return output;
9828
+ }
9829
+ __name(normalizeQueryFragmentEncoding, "normalizeQueryFragmentEncoding");
9830
+ function escapePreservingEscapes(input) {
9831
+ let output = "";
9832
+ for (let i = 0; i < input.length; i++) {
9833
+ if (input[i] === "%" && i + 2 < input.length) {
9834
+ const hex = input.slice(i + 1, i + 3);
9835
+ if (isHexPair(hex)) {
9836
+ output += "%" + hex.toUpperCase();
9837
+ i += 2;
9838
+ continue;
9839
+ }
9840
+ }
9841
+ output += escape(input[i]);
9842
+ }
9843
+ return output;
9504
9844
  }
9505
- __name(normalizeComponentEncoding, "normalizeComponentEncoding");
9845
+ __name(escapePreservingEscapes, "escapePreservingEscapes");
9506
9846
  function recomposeAuthority(component) {
9507
9847
  const uriTokens = [];
9508
9848
  if (component.userinfo !== void 0) {
9509
- uriTokens.push(component.userinfo);
9849
+ uriTokens.push(encodeUserinfo(component.userinfo));
9510
9850
  uriTokens.push("@");
9511
9851
  }
9512
9852
  if (component.host !== void 0) {
9513
- let host = unescape(component.host);
9853
+ let host = component.host;
9514
9854
  if (!isIPv4(host)) {
9515
- const ipV6res = normalizeIPv6(host);
9516
- if (ipV6res.isIPV6 === true) host = `[${ipV6res.escapedHost}]`;
9517
- else host = component.host;
9855
+ let ipV6res = normalizeIPv6(host);
9856
+ if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
9857
+ host = normalizePercentEncoding(host, true);
9858
+ ipV6res = normalizeIPv6(host);
9859
+ }
9860
+ if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) host = `[${ipV6res.escapedHost}]`;
9861
+ else host = reescapeHostDelimiters(host, false);
9518
9862
  }
9519
9863
  uriTokens.push(host);
9520
9864
  }
9521
9865
  if (typeof component.port === "number" || typeof component.port === "string") {
9866
+ const port = String(component.port);
9867
+ if (!isPort(port)) throw new TypeError("URI port is malformed.");
9522
9868
  uriTokens.push(":");
9523
- uriTokens.push(String(component.port));
9869
+ uriTokens.push(port);
9524
9870
  }
9525
9871
  return uriTokens.length ? uriTokens.join("") : void 0;
9526
9872
  }
@@ -9528,7 +9874,15 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9528
9874
  module.exports = {
9529
9875
  nonSimpleDomain,
9530
9876
  recomposeAuthority,
9531
- normalizeComponentEncoding,
9877
+ reescapeHostDelimiters,
9878
+ normalizePercentEncoding,
9879
+ normalizePathEncoding,
9880
+ serializePathEncoding,
9881
+ normalizeQueryFragmentEncoding,
9882
+ encodeUserinfo,
9883
+ encodeQuery,
9884
+ encodeFragment,
9885
+ escapePreservingEscapes,
9532
9886
  removeDotSegments,
9533
9887
  isIPv4,
9534
9888
  isUUID,
@@ -9538,7 +9892,7 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9538
9892
  }));
9539
9893
  var require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9540
9894
  const { isUUID } = require_utils();
9541
- const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
9895
+ const URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
9542
9896
  const supportedSchemeNames = [
9543
9897
  "http",
9544
9898
  "https",
@@ -9585,9 +9939,10 @@ var require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9585
9939
  wsComponent.secure = void 0;
9586
9940
  }
9587
9941
  if (wsComponent.resourceName) {
9588
- const [path, query] = wsComponent.resourceName.split("?");
9942
+ const queryIndex = wsComponent.resourceName.indexOf("?");
9943
+ const path = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
9589
9944
  wsComponent.path = path && path !== "/" ? path : void 0;
9590
- wsComponent.query = query;
9945
+ wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
9591
9946
  wsComponent.resourceName = void 0;
9592
9947
  }
9593
9948
  wsComponent.fragment = void 0;
@@ -9600,7 +9955,7 @@ var require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9600
9955
  return urnComponent;
9601
9956
  }
9602
9957
  const matches = urnComponent.path.match(URN_REG);
9603
- if (matches) {
9958
+ if (matches && matches[0] === urnComponent.path) {
9604
9959
  const scheme = options.scheme || urnComponent.scheme || "urn";
9605
9960
  urnComponent.nid = matches[1].toLowerCase();
9606
9961
  urnComponent.nss = matches[2];
@@ -9695,17 +10050,34 @@ var require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9695
10050
  };
9696
10051
  }));
9697
10052
  var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9698
- const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();
10053
+ const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
9699
10054
  const { SCHEMES, getSchemeHandler } = require_schemes();
10055
+ const VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
10056
+ const MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
10057
+ function decodeValidScheme(scheme) {
10058
+ const decodedScheme = unescape(String(scheme));
10059
+ if (!VALID_SCHEME.test(decodedScheme)) throw new TypeError(MALFORMED_SCHEME_ERROR);
10060
+ return decodedScheme;
10061
+ }
10062
+ __name(decodeValidScheme, "decodeValidScheme");
9700
10063
  function normalize(uri, options) {
9701
- if (typeof uri === "string") uri = serialize(parse(uri, options), options);
10064
+ if (typeof uri === "string") uri = normalizeString(uri, options);
9702
10065
  else if (typeof uri === "object") uri = parse(serialize(uri, options), options);
9703
10066
  return uri;
9704
10067
  }
9705
10068
  __name(normalize, "normalize");
9706
10069
  function resolve(baseURI, relativeURI, options) {
9707
10070
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
9708
- const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
10071
+ const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed, malformedPercentEncoding: baseMalformedPercentEncoding, malformedSchemeSpecific: baseMalformedSchemeSpecific, malformedHost: baseMalformedHost, malformedScheme: baseMalformedScheme } = parseWithStatus(baseURI, schemelessOptions);
10072
+ const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed, malformedPercentEncoding: relativeMalformedPercentEncoding, malformedSchemeSpecific: relativeMalformedSchemeSpecific, malformedHost: relativeMalformedHost, malformedScheme: relativeMalformedScheme } = parseWithStatus(relativeURI, schemelessOptions);
10073
+ if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
10074
+ const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
10075
+ const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
10076
+ const resolvedHost = resolved.host;
10077
+ const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
10078
+ canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
10079
+ const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !new RegExp("\\P{ASCII}", "u").test(resolvedHost);
10080
+ if (resolved.error && !encodedASCIIHost) throw new Error(resolved.error);
9709
10081
  schemelessOptions.skipEscape = true;
9710
10082
  return serialize(resolved, schemelessOptions);
9711
10083
  }
@@ -9757,27 +10129,9 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9757
10129
  }
9758
10130
  __name(resolveComponent, "resolveComponent");
9759
10131
  function equal(uriA, uriB, options) {
9760
- if (typeof uriA === "string") {
9761
- uriA = unescape(uriA);
9762
- uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), {
9763
- ...options,
9764
- skipEscape: true
9765
- });
9766
- } else if (typeof uriA === "object") uriA = serialize(normalizeComponentEncoding(uriA, true), {
9767
- ...options,
9768
- skipEscape: true
9769
- });
9770
- if (typeof uriB === "string") {
9771
- uriB = unescape(uriB);
9772
- uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), {
9773
- ...options,
9774
- skipEscape: true
9775
- });
9776
- } else if (typeof uriB === "object") uriB = serialize(normalizeComponentEncoding(uriB, true), {
9777
- ...options,
9778
- skipEscape: true
9779
- });
9780
- return uriA.toLowerCase() === uriB.toLowerCase();
10132
+ const normalizedA = normalizeComparableURI(uriA, options);
10133
+ const normalizedB = normalizeComparableURI(uriB, options);
10134
+ return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA === normalizedB;
9781
10135
  }
9782
10136
  __name(equal, "equal");
9783
10137
  function serialize(cmpts, opts) {
@@ -9799,13 +10153,17 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9799
10153
  };
9800
10154
  const options = Object.assign({}, opts);
9801
10155
  const uriTokens = [];
10156
+ if (component.scheme) component.scheme = decodeValidScheme(component.scheme);
9802
10157
  const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
9803
10158
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
9804
- if (component.path !== void 0) if (!options.skipEscape) {
9805
- component.path = escape(component.path);
9806
- if (component.scheme !== void 0) component.path = component.path.split("%3A").join(":");
9807
- } else component.path = unescape(component.path);
9808
- if (options.reference !== "suffix" && component.scheme) uriTokens.push(component.scheme, ":");
10159
+ const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
10160
+ const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority;
10161
+ if (component.path !== void 0) if (!options.skipEscape) component.path = serializePathEncoding(component.path, pathNoScheme);
10162
+ else component.path = normalizePercentEncoding(component.path);
10163
+ if (options.reference !== "suffix" && component.scheme) {
10164
+ component.scheme = decodeValidScheme(component.scheme);
10165
+ uriTokens.push(component.scheme, ":");
10166
+ }
9809
10167
  const authority = recomposeAuthority(component);
9810
10168
  if (authority !== void 0) {
9811
10169
  if (options.reference !== "suffix") uriTokens.push("//");
@@ -9815,16 +10173,53 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9815
10173
  if (component.path !== void 0) {
9816
10174
  let s = component.path;
9817
10175
  if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) s = removeDotSegments(s);
10176
+ if (pathNoScheme) s = serializePathEncoding(s, true);
9818
10177
  if (authority === void 0 && s[0] === "/" && s[1] === "/") s = "/%2F" + s.slice(2);
9819
10178
  uriTokens.push(s);
9820
10179
  }
9821
- if (component.query !== void 0) uriTokens.push("?", component.query);
9822
- if (component.fragment !== void 0) uriTokens.push("#", component.fragment);
10180
+ if (component.query !== void 0) uriTokens.push("?", encodeQuery(component.query));
10181
+ if (component.fragment !== void 0) uriTokens.push("#", encodeFragment(component.fragment));
9823
10182
  return uriTokens.join("");
9824
10183
  }
9825
10184
  __name(serialize, "serialize");
9826
10185
  const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
9827
- function parse(uri, opts) {
10186
+ const AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
10187
+ const AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
10188
+ function getParseError(parsed, matches) {
10189
+ if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") return 'URI path must start with "/" when authority is present.';
10190
+ if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) return "URI port is malformed.";
10191
+ }
10192
+ __name(getParseError, "getParseError");
10193
+ function hasMalformedPercentEncoding(component) {
10194
+ if (component === void 0) return false;
10195
+ let percent = component.indexOf("%");
10196
+ while (percent !== -1) {
10197
+ if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) return true;
10198
+ percent = component.indexOf("%", percent + 3);
10199
+ }
10200
+ return false;
10201
+ }
10202
+ __name(hasMalformedPercentEncoding, "hasMalformedPercentEncoding");
10203
+ function isIPLiteral(host) {
10204
+ return host[0] === "[" && host[host.length - 1] === "]";
10205
+ }
10206
+ __name(isIPLiteral, "isIPLiteral");
10207
+ function hasMalformedComponentPercentEncoding(matches) {
10208
+ const host = matches[4];
10209
+ return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
10210
+ }
10211
+ __name(hasMalformedComponentPercentEncoding, "hasMalformedComponentPercentEncoding");
10212
+ function canonicalizeHost(parsed, options, schemeHandler, isIP) {
10213
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) try {
10214
+ parsed.host = new URL("http://" + parsed.host).hostname;
10215
+ } catch (e) {
10216
+ parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
10217
+ return true;
10218
+ }
10219
+ return false;
10220
+ }
10221
+ __name(canonicalizeHost, "canonicalizeHost");
10222
+ function parseWithStatus(uri, opts) {
9828
10223
  const options = Object.assign({}, opts);
9829
10224
  const parsed = {
9830
10225
  scheme: void 0,
@@ -9835,9 +10230,34 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9835
10230
  query: void 0,
9836
10231
  fragment: void 0
9837
10232
  };
10233
+ let malformedAuthorityOrPort = false;
10234
+ let malformedPercentEncoding = false;
10235
+ let malformedSchemeSpecific = false;
10236
+ let malformedHost = false;
10237
+ let malformedIPLiteral = false;
10238
+ let malformedScheme = false;
9838
10239
  let isIP = false;
9839
10240
  if (options.reference === "suffix") if (options.scheme) uri = options.scheme + ":" + uri;
9840
10241
  else uri = "//" + uri;
10242
+ const authorityMatch = uri.match(AUTHORITY_PREFIX);
10243
+ if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
10244
+ parsed.error = "URI authority must not contain a literal backslash.";
10245
+ malformedAuthorityOrPort = true;
10246
+ }
10247
+ const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION);
10248
+ if (introducerMatch !== null) {
10249
+ const region = introducerMatch[1];
10250
+ const normalizedRegion = region.replace(/[\t\n\r]/g, "");
10251
+ if (normalizedRegion.length >= 2) {
10252
+ if (normalizedRegion.slice(0, 2) !== "//") {
10253
+ parsed.error = parsed.error || "URI authority must not contain a literal backslash.";
10254
+ malformedAuthorityOrPort = true;
10255
+ } else if (region.length !== normalizedRegion.length) {
10256
+ parsed.error = parsed.error || "URI authority introducer must not contain whitespace.";
10257
+ malformedAuthorityOrPort = true;
10258
+ }
10259
+ }
10260
+ }
9841
10261
  const matches = uri.match(URI_PARSE);
9842
10262
  if (matches) {
9843
10263
  parsed.scheme = matches[1];
@@ -9847,11 +10267,33 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9847
10267
  parsed.path = matches[6] || "";
9848
10268
  parsed.query = matches[7];
9849
10269
  parsed.fragment = matches[8];
10270
+ if (parsed.scheme !== void 0) {
10271
+ const decodedScheme = unescape(parsed.scheme);
10272
+ if (VALID_SCHEME.test(decodedScheme)) parsed.scheme = decodedScheme.toLowerCase();
10273
+ else {
10274
+ parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
10275
+ malformedScheme = true;
10276
+ }
10277
+ }
10278
+ malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches);
10279
+ if (malformedPercentEncoding) parsed.error = parsed.error || "URI contains malformed percent-encoding.";
9850
10280
  if (isNaN(parsed.port)) parsed.port = matches[5];
10281
+ const parseError = getParseError(parsed, matches);
10282
+ if (parseError !== void 0) {
10283
+ parsed.error = parsed.error || parseError;
10284
+ malformedAuthorityOrPort = true;
10285
+ }
9851
10286
  if (parsed.host) if (isIPv4(parsed.host) === false) {
10287
+ const bracketedIPLiteral = isIPLiteral(parsed.host);
10288
+ const hasIPLiteralBracket = parsed.host.indexOf("[") !== -1 || parsed.host.indexOf("]") !== -1;
9852
10289
  const ipv6result = normalizeIPv6(parsed.host);
9853
- parsed.host = ipv6result.host.toLowerCase();
9854
- isIP = ipv6result.isIPV6;
10290
+ isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
10291
+ malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
10292
+ parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
10293
+ if (malformedIPLiteral) {
10294
+ parsed.error = parsed.error || "URI host is malformed.";
10295
+ malformedAuthorityOrPort = true;
10296
+ }
9855
10297
  } else isIP = true;
9856
10298
  if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) parsed.reference = "same-document";
9857
10299
  else if (parsed.scheme === void 0) parsed.reference = "relative";
@@ -9859,26 +10301,64 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9859
10301
  else parsed.reference = "uri";
9860
10302
  if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
9861
10303
  const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
9862
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
9863
- if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) try {
9864
- parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
9865
- } catch (e) {
9866
- parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
9867
- }
10304
+ if (!malformedIPLiteral) malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
10305
+ if (uri.indexOf("%") !== -1 && parsed.host !== void 0 && !malformedIPLiteral) {
10306
+ let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
10307
+ if (!isIP) host = normalizePercentEncoding(host.toLowerCase());
10308
+ parsed.host = reescapeHostDelimiters(host, isIP);
9868
10309
  }
9869
10310
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
9870
- if (uri.indexOf("%") !== -1) {
9871
- if (parsed.scheme !== void 0) parsed.scheme = unescape(parsed.scheme);
9872
- if (parsed.host !== void 0) parsed.host = unescape(parsed.host);
9873
- }
9874
- if (parsed.path) parsed.path = escape(unescape(parsed.path));
9875
- if (parsed.fragment) parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
10311
+ if (parsed.path) parsed.path = normalizePathEncoding(parsed.path);
10312
+ if (parsed.query) parsed.query = normalizeQueryFragmentEncoding(parsed.query);
10313
+ if (parsed.fragment) parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
10314
+ }
10315
+ if (schemeHandler && schemeHandler.parse) {
10316
+ schemeHandler.parse(parsed, options);
10317
+ if (schemeHandler === SCHEMES.urn && parsed.nid === void 0) malformedSchemeSpecific = true;
9876
10318
  }
9877
- if (schemeHandler && schemeHandler.parse) schemeHandler.parse(parsed, options);
9878
10319
  } else parsed.error = parsed.error || "URI can not be parsed.";
9879
- return parsed;
10320
+ return {
10321
+ parsed,
10322
+ malformedAuthorityOrPort,
10323
+ malformedPercentEncoding,
10324
+ malformedSchemeSpecific,
10325
+ malformedHost,
10326
+ malformedScheme
10327
+ };
10328
+ }
10329
+ __name(parseWithStatus, "parseWithStatus");
10330
+ function parse(uri, opts) {
10331
+ return parseWithStatus(uri, opts).parsed;
9880
10332
  }
9881
10333
  __name(parse, "parse");
10334
+ function normalizeString(uri, opts) {
10335
+ return normalizeStringWithStatus(uri, opts).normalized;
10336
+ }
10337
+ __name(normalizeString, "normalizeString");
10338
+ function normalizeStringWithStatus(uri, opts) {
10339
+ const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
10340
+ return {
10341
+ normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),
10342
+ malformedAuthorityOrPort,
10343
+ malformedPercentEncoding,
10344
+ malformedSchemeSpecific,
10345
+ malformedHost,
10346
+ malformedScheme
10347
+ };
10348
+ }
10349
+ __name(normalizeStringWithStatus, "normalizeStringWithStatus");
10350
+ function normalizeComparableURI(uri, opts) {
10351
+ if (typeof uri !== "string" && typeof uri !== "object") return;
10352
+ let value;
10353
+ try {
10354
+ value = typeof uri === "string" ? uri : serialize(uri, opts);
10355
+ } catch {
10356
+ return;
10357
+ }
10358
+ const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
10359
+ return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? void 0 : normalized;
10360
+ }
10361
+ __name(normalizeComparableURI, "normalizeComparableURI");
9882
10362
  const fastUri = {
9883
10363
  SCHEMES,
9884
10364
  normalize,
@@ -13796,7 +14276,7 @@ var AjvJsonSchemaValidator = class {
13796
14276
  };
13797
14277
  var Ajv = import_ajv.Ajv;
13798
14278
 
13799
- // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.1.0/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs
14279
+ // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.4.0/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs
13800
14280
  var CORS_IS_POSSIBLE = false;
13801
14281
 
13802
14282
  // ../../node_modules/.pnpm/pkce-challenge@5.0.1/node_modules/pkce-challenge/dist/index.node.js
@@ -13847,7 +14327,7 @@ async function pkceChallenge(length) {
13847
14327
  }
13848
14328
  __name(pkceChallenge, "pkceChallenge");
13849
14329
 
13850
- // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.1.0/node_modules/@modelcontextprotocol/client/dist/index.mjs
14330
+ // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.4.0/node_modules/@modelcontextprotocol/client/dist/public-CvV4ZHkX.mjs
13851
14331
  var OAuthClientFlowError = class extends Error {
13852
14332
  static {
13853
14333
  __name(this, "OAuthClientFlowError");
@@ -13927,7 +14407,7 @@ var InsecureTokenEndpointError = class extends OAuthClientFlowError {
13927
14407
  /** The token endpoint URL that was rejected. */
13928
14408
  tokenEndpoint;
13929
14409
  constructor(tokenEndpoint) {
13930
- super(`Refusing to send credentials to non-https token endpoint '${tokenEndpoint}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`);
14410
+ super(`Refusing to send credentials to non-https token endpoint '${tokenEndpoint}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`);
13931
14411
  this.tokenEndpoint = tokenEndpoint;
13932
14412
  }
13933
14413
  };
@@ -13939,7 +14419,7 @@ var AuthorizationServerMismatchError = class extends OAuthClientFlowError {
13939
14419
  Object.defineProperty(this, "mcpBrand", { value: "mcp.AuthorizationServerMismatchError" });
13940
14420
  }
13941
14421
  constructor(recordedIssuer, currentIssuer) {
13942
- super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(recordedIssuer)}, callback resolved ${JSON.stringify(currentIssuer)}); refusing to send authorization_code/code_verifier to a different token endpoint`);
14422
+ super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(recordedIssuer)} but this call resolved ${JSON.stringify(currentIssuer)}; refusing to present them to a different authorization server`);
13943
14423
  this.recordedIssuer = recordedIssuer;
13944
14424
  this.currentIssuer = currentIssuer;
13945
14425
  }
@@ -13965,10 +14445,13 @@ var InsufficientScopeError = class extends OAuthClientFlowError {
13965
14445
  }
13966
14446
  };
13967
14447
  function discardIfIssuerMismatch(stored, issuer, opts) {
13968
- if (stored === void 0) return void 0;
13969
- if (stored.issuer === void 0) {
14448
+ if (!stored) return void 0;
14449
+ if (typeof stored.issuer !== "string") {
13970
14450
  if (opts?.canPersistStamp !== false) console.warn("[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field.");
13971
- return stored;
14451
+ return stored.issuer === void 0 ? stored : {
14452
+ ...stored,
14453
+ issuer: void 0
14454
+ };
13972
14455
  }
13973
14456
  return issuersMatch(stored.issuer, issuer) ? stored : void 0;
13974
14457
  }
@@ -14142,7 +14625,7 @@ function applyPublicAuth(clientId, params) {
14142
14625
  }
14143
14626
  __name(applyPublicAuth, "applyPublicAuth");
14144
14627
  function isLoopbackHost(hostname) {
14145
- return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]" || hostname === "::1";
14628
+ return hostname === "localhost" || hostname.endsWith(".localhost") || hostname === "127.0.0.1" || hostname === "[::1]" || hostname === "::1";
14146
14629
  }
14147
14630
  __name(isLoopbackHost, "isLoopbackHost");
14148
14631
  function assertSecureTokenEndpoint(tokenEndpoint) {
@@ -14346,12 +14829,14 @@ async function authInternal(provider, { serverUrl, authorizationCode, iss, scope
14346
14829
  await provider.saveTokens(tokens, infoCtx);
14347
14830
  }
14348
14831
  if (tokens?.refresh_token && !forceReauthorization) {
14832
+ const refreshScope = await provider.scopeForRefresh?.(tokens);
14349
14833
  let newTokens;
14350
14834
  try {
14351
14835
  newTokens = await refreshAuthorization(authorizationServerUrl, {
14352
14836
  metadata,
14353
14837
  clientInformation,
14354
14838
  refreshToken: tokens.refresh_token,
14839
+ scope: refreshScope,
14355
14840
  resource,
14356
14841
  addClientAuthentication: provider.addClientAuthentication,
14357
14842
  dpop: await provider.dpop?.(),
@@ -14459,12 +14944,13 @@ async function discoverOAuthProtectedResourceMetadata(serverUrl, opts, fetchFn =
14459
14944
  }
14460
14945
  __name(discoverOAuthProtectedResourceMetadata, "discoverOAuthProtectedResourceMetadata");
14461
14946
  async function fetchWithCorsRetry(url2, headers, fetchFn = fetch) {
14947
+ const withinOrigin = fetchWithinOrigin(fetchFn);
14462
14948
  try {
14463
- return await fetchFn(url2, { headers });
14949
+ return await withinOrigin(url2, { headers });
14464
14950
  } catch (error) {
14465
14951
  if (!(error instanceof TypeError) || !CORS_IS_POSSIBLE) throw error;
14466
14952
  if (headers) try {
14467
- return await fetchFn(url2, {});
14953
+ return await withinOrigin(url2, {});
14468
14954
  } catch (retryError) {
14469
14955
  if (!(retryError instanceof TypeError)) throw retryError;
14470
14956
  return;
@@ -14485,7 +14971,7 @@ __name(tryMetadataDiscovery, "tryMetadataDiscovery");
14485
14971
  function shouldAttemptFallback(response, pathname) {
14486
14972
  if (!response) return true;
14487
14973
  if (pathname === "/") return false;
14488
- return response.status >= 400 && response.status < 500 || response.status === 502;
14974
+ return !response.ok && response.status < 500 || response.status === 502;
14489
14975
  }
14490
14976
  __name(shouldAttemptFallback, "shouldAttemptFallback");
14491
14977
  async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, opts) {
@@ -14545,7 +15031,7 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fet
14545
15031
  if (!response.ok) {
14546
15032
  await response.text?.().catch(() => {
14547
15033
  });
14548
- if (response.status >= 400 && response.status < 500 || response.status === 502) continue;
15034
+ if (response.status < 500 || response.status === 502) continue;
14549
15035
  throw new Error(`HTTP ${response.status} trying to load ${type === "oauth" ? "OAuth" : "OpenID provider"} metadata from ${endpointUrl}`);
14550
15036
  }
14551
15037
  const parsed = type === "oauth" ? OAuthMetadataSchema.parse(await response.json()) : OpenIdProviderDiscoveryMetadataSchema.parse(await response.json());
@@ -14631,7 +15117,7 @@ async function executeTokenRequest(authorizationServerUrl, { metadata, tokenRequ
14631
15117
  htm: "POST",
14632
15118
  htu: tokenUrl
14633
15119
  }));
14634
- return (fetchFn ?? fetch)(tokenUrl, {
15120
+ return fetchWithinOrigin(fetchFn ?? fetch)(tokenUrl, {
14635
15121
  method: "POST",
14636
15122
  headers: requestHeaders,
14637
15123
  body: tokenRequestParams
@@ -14649,28 +15135,32 @@ async function executeTokenRequest(authorizationServerUrl, { metadata, tokenRequ
14649
15135
  if (!response.ok) throw await parseErrorResponse(response);
14650
15136
  const json = await response.json();
14651
15137
  try {
14652
- return OAuthTokensSchema.parse(json);
15138
+ return OAuthTokensSchema.parse(withoutIssuer(json));
14653
15139
  } catch (parseError) {
14654
15140
  if (typeof json === "object" && json !== null && "error" in json) throw await parseErrorResponse(JSON.stringify(json));
14655
15141
  throw parseError;
14656
15142
  }
14657
15143
  }
14658
15144
  __name(executeTokenRequest, "executeTokenRequest");
14659
- async function refreshAuthorization(authorizationServerUrl, { metadata, clientInformation, refreshToken, resource, addClientAuthentication, dpop, fetchFn }) {
15145
+ async function refreshAuthorization(authorizationServerUrl, { metadata, clientInformation, refreshToken, scope, resource, addClientAuthentication, dpop, fetchFn }) {
15146
+ const tokenRequestParams = new URLSearchParams({
15147
+ grant_type: "refresh_token",
15148
+ refresh_token: refreshToken
15149
+ });
15150
+ if (scope) tokenRequestParams.set("scope", scope);
15151
+ const tokens = await executeTokenRequest(authorizationServerUrl, {
15152
+ metadata,
15153
+ tokenRequestParams,
15154
+ clientInformation,
15155
+ addClientAuthentication,
15156
+ resource,
15157
+ dpop,
15158
+ fetchFn
15159
+ });
14660
15160
  return {
14661
15161
  refresh_token: refreshToken,
14662
- ...await executeTokenRequest(authorizationServerUrl, {
14663
- metadata,
14664
- tokenRequestParams: new URLSearchParams({
14665
- grant_type: "refresh_token",
14666
- refresh_token: refreshToken
14667
- }),
14668
- clientInformation,
14669
- addClientAuthentication,
14670
- resource,
14671
- dpop,
14672
- fetchFn
14673
- })
15162
+ ...tokens,
15163
+ ...scope && !tokens.scope && { scope }
14674
15164
  };
14675
15165
  }
14676
15166
  __name(refreshAuthorization, "refreshAuthorization");
@@ -14680,6 +15170,14 @@ async function fetchToken(provider, authorizationServerUrl, { metadata, resource
14680
15170
  expectedIssuer: metadata?.issuer,
14681
15171
  issParameterSupported: isIssParameterSupported(metadata)
14682
15172
  });
15173
+ const issuer = metadata?.issuer ?? String(authorizationServerUrl);
15174
+ const readClientInformation = /* @__PURE__ */ __name(async () => {
15175
+ const rawClientInfo = await provider.clientInformation({ issuer });
15176
+ const checked = discardIfIssuerMismatch(rawClientInfo, issuer, { canPersistStamp: false });
15177
+ if (rawClientInfo && checked === void 0) throw new AuthorizationServerMismatchError(String(rawClientInfo.issuer), issuer);
15178
+ return checked;
15179
+ }, "readClientInformation");
15180
+ let clientInformation = await readClientInformation();
14683
15181
  const effectiveScope = scope ?? provider.clientMetadata.scope;
14684
15182
  let tokenRequestParams;
14685
15183
  if (provider.prepareTokenRequest) tokenRequestParams = await provider.prepareTokenRequest(effectiveScope);
@@ -14688,11 +15186,11 @@ async function fetchToken(provider, authorizationServerUrl, { metadata, resource
14688
15186
  if (!provider.redirectUrl) throw new Error("redirectUrl is required for authorization_code flow");
14689
15187
  tokenRequestParams = prepareAuthorizationCodeRequest(authorizationCode, await provider.codeVerifier(), provider.redirectUrl);
14690
15188
  }
14691
- const clientInformation = await provider.clientInformation({ issuer: metadata?.issuer ?? String(authorizationServerUrl) });
15189
+ clientInformation ??= await readClientInformation();
14692
15190
  return executeTokenRequest(authorizationServerUrl, {
14693
15191
  metadata,
14694
15192
  tokenRequestParams,
14695
- clientInformation: clientInformation ?? void 0,
15193
+ clientInformation,
14696
15194
  addClientAuthentication: provider.addClientAuthentication,
14697
15195
  resource,
14698
15196
  dpop: await provider.dpop?.(),
@@ -14710,7 +15208,7 @@ async function registerClient(authorizationServerUrl, { metadata, clientMetadata
14710
15208
  ...clientMetadata,
14711
15209
  ...scope === void 0 ? {} : { scope }
14712
15210
  };
14713
- const response = await (fetchFn ?? fetch)(registrationUrl, {
15211
+ const response = await fetchWithinOrigin(fetchFn ?? fetch)(registrationUrl, {
14714
15212
  method: "POST",
14715
15213
  headers: { "Content-Type": "application/json" },
14716
15214
  body: JSON.stringify(submittedMetadata)
@@ -14720,7 +15218,7 @@ async function registerClient(authorizationServerUrl, { metadata, clientMetadata
14720
15218
  body: await response.text(),
14721
15219
  submittedMetadata
14722
15220
  });
14723
- return OAuthClientInformationFullSchema.parse(await response.json());
15221
+ return OAuthClientInformationFullSchema.parse(withoutIssuer(await response.json()));
14724
15222
  }
14725
15223
  __name(registerClient, "registerClient");
14726
15224
  var CAP_EXEMPT_METHODS = /* @__PURE__ */ new Set([
@@ -15227,6 +15725,11 @@ function classifyProbeOutcome(outcome, context) {
15227
15725
  return classifyHttpError(outcome, context);
15228
15726
  case "network-error":
15229
15727
  return classifyNetworkError(outcome.error, context);
15728
+ case "unusable-reply":
15729
+ return {
15730
+ kind: "error",
15731
+ error: new SdkError(SdkErrorCode.EraNegotiationFailed, `Version negotiation probe failed: the server answered with an unusable reply (${describeError(outcome.error)})`, { cause: outcome.error }, { cause: outcome.error })
15732
+ };
15230
15733
  case "auth-required":
15231
15734
  return {
15232
15735
  kind: "error",
@@ -15535,6 +16038,11 @@ function buildProbeRequest(id, protocolVersion, clientInfo, capabilities) {
15535
16038
  };
15536
16039
  }
15537
16040
  __name(buildProbeRequest, "buildProbeRequest");
16041
+ function isUnusableReplyError(error) {
16042
+ if (error instanceof SdkError && error.code === SdkErrorCode.ClientHttpUnexpectedContent) return true;
16043
+ return error instanceof Error && error.name === "SyntaxError";
16044
+ }
16045
+ __name(isUnusableReplyError, "isUnusableReplyError");
15538
16046
  function normalizeReply(reply, timeoutMs) {
15539
16047
  switch (reply.kind) {
15540
16048
  case "response":
@@ -15560,6 +16068,10 @@ function normalizeReply(reply, timeoutMs) {
15560
16068
  statusText: error.data.statusText
15561
16069
  };
15562
16070
  }
16071
+ if (isUnusableReplyError(error)) return {
16072
+ kind: "unusable-reply",
16073
+ error
16074
+ };
15563
16075
  return {
15564
16076
  kind: "network-error",
15565
16077
  error
@@ -15740,6 +16252,7 @@ var LIST_CHANGED_EVICTIONS = {
15740
16252
  "notifications/resources/list_changed": ["resources/list", "resources/templates/list"]
15741
16253
  };
15742
16254
  var DEFAULT_LIST_MAX_PAGES = 64;
16255
+ var clientInternals = {};
15743
16256
  var Client = class extends Protocol {
15744
16257
  static {
15745
16258
  __name(this, "Client");
@@ -15787,6 +16300,11 @@ var Client = class extends Protocol {
15787
16300
  _autoOpenedSubscription;
15788
16301
  /** Backing store for {@linkcode getDiscoverResult}. Per-connection. */
15789
16302
  _discoverResult;
16303
+ static {
16304
+ clientInternals.enforceStrictCapabilities = (client) => client._enforceStrictCapabilities;
16305
+ clientInternals.walkPages = (client, method, fetchPage, items) => client._walkPages(method, fetchPage, items);
16306
+ clientInternals.readResource = (client, params, options) => client._readResource(params, options);
16307
+ }
15790
16308
  /**
15791
16309
  * Clears every per-connection field in one place. Called at the start of
15792
16310
  * each fresh (non-resuming) connect and from `close()`, so a stale
@@ -16383,7 +16901,7 @@ var Client = class extends Protocol {
16383
16901
  }, options);
16384
16902
  const hit = await this._serveFromCache("prompts/list", void 0, options);
16385
16903
  if (hit !== void 0) return hit;
16386
- return this._listAllPages("prompts/list", params, options, (acc, page) => acc.prompts.push(...page.prompts));
16904
+ return this._listAllPages("prompts/list", params, options, (r) => r.prompts);
16387
16905
  }
16388
16906
  /**
16389
16907
  * Lists available resources.
@@ -16422,7 +16940,7 @@ var Client = class extends Protocol {
16422
16940
  }, options);
16423
16941
  const hit = await this._serveFromCache("resources/list", void 0, options);
16424
16942
  if (hit !== void 0) return hit;
16425
- return this._listAllPages("resources/list", params, options, (acc, page) => acc.resources.push(...page.resources));
16943
+ return this._listAllPages("resources/list", params, options, (r) => r.resources);
16426
16944
  }
16427
16945
  /**
16428
16946
  * Lists available resource URI templates for dynamic resources.
@@ -16447,7 +16965,7 @@ var Client = class extends Protocol {
16447
16965
  }, options);
16448
16966
  const hit = await this._serveFromCache("resources/templates/list", void 0, options);
16449
16967
  if (hit !== void 0) return hit;
16450
- return this._listAllPages("resources/templates/list", params, options, (acc, page) => acc.resourceTemplates.push(...page.resourceTemplates));
16968
+ return this._listAllPages("resources/templates/list", params, options, (r) => r.resourceTemplates);
16451
16969
  }
16452
16970
  /**
16453
16971
  * Walk every page of a paginated list verb, aggregate, and write ONE
@@ -16455,8 +16973,7 @@ var Client = class extends Protocol {
16455
16973
  * methods' no-`cursor` auto-aggregate path. Page 1's result object is
16456
16974
  * mutated in place (its items array is extended; `nextCursor` is
16457
16975
  * cleared); page-1 metadata (`ttlMs`, `cacheScope`, `_meta`) is preserved.
16458
- * A `nextCursor` that repeats stops the walk (defence against a
16459
- * non-converging server, mcp.d's `drainList` guard);
16976
+ * A page with the same items and `nextCursor` as the previous page ends the walk;
16460
16977
  * {@linkcode ClientOptions.listMaxPages} is a hard cap — hitting it
16461
16978
  * throws, so a partial aggregate is never cached. The
16462
16979
  * captured-generation guard skips the write when a `list_changed` landed
@@ -16471,37 +16988,43 @@ var Client = class extends Protocol {
16471
16988
  * trace context) supplied to the public `list*()` reaches every wire
16472
16989
  * request the walk issues.
16473
16990
  */
16474
- async _listAllPages(method, baseParams, options, append, finalize) {
16991
+ async _listAllPages(method, baseParams, options, items, finalize) {
16475
16992
  const bypass = options?.cacheMode === "bypass";
16476
16993
  const generation = this._cache.captureGeneration(method);
16477
- const acc = await this.request({
16478
- method,
16479
- ...baseParams && { params: { ...baseParams } }
16480
- }, options);
16994
+ const fetchPage = /* @__PURE__ */ __name((cursor) => {
16995
+ const params = cursor === void 0 ? baseParams && { ...baseParams } : {
16996
+ ...baseParams,
16997
+ cursor
16998
+ };
16999
+ return this.request({
17000
+ method,
17001
+ ...params && { params }
17002
+ }, options);
17003
+ }, "fetchPage");
17004
+ const acc = await this._walkPages(method, fetchPage, items);
17005
+ delete acc.nextCursor;
17006
+ finalize?.(acc);
17007
+ if (bypass) return acc;
17008
+ await this._cache.write(method, acc, generation, this._freshness(acc));
17009
+ return acc;
17010
+ }
17011
+ async _walkPages(method, fetchPage, items) {
17012
+ const acc = await fetchPage(void 0);
16481
17013
  let cursor = acc.nextCursor;
16482
- const seen = /* @__PURE__ */ new Set();
17014
+ let previous = acc;
16483
17015
  let pages = 1;
16484
- while (cursor !== void 0 && !seen.has(cursor)) {
17016
+ while (cursor !== void 0) {
16485
17017
  if (this._listMaxPages !== 0 && pages >= this._listMaxPages) throw new SdkError(SdkErrorCode.ListPaginationExceeded, `${method}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`, {
16486
17018
  method,
16487
17019
  listMaxPages: this._listMaxPages
16488
17020
  });
16489
- seen.add(cursor);
16490
- const page = await this.request({
16491
- method,
16492
- params: {
16493
- ...baseParams,
16494
- cursor
16495
- }
16496
- }, options);
16497
- append(acc, page);
17021
+ const page = await fetchPage(cursor);
17022
+ if (page.nextCursor === cursor && JSON.stringify(items(page)) === JSON.stringify(items(previous))) break;
17023
+ items(acc).push(...items(page));
17024
+ previous = page;
16498
17025
  cursor = page.nextCursor;
16499
17026
  pages++;
16500
17027
  }
16501
- delete acc.nextCursor;
16502
- finalize?.(acc);
16503
- if (bypass) return acc;
16504
- await this._cache.write(method, acc, generation, this._freshness(acc));
16505
17028
  return acc;
16506
17029
  }
16507
17030
  /**
@@ -16617,8 +17140,15 @@ var Client = class extends Protocol {
16617
17140
  * unbounded).
16618
17141
  */
16619
17142
  async readResource(params, options) {
17143
+ const { result } = await this._readResource(params, options);
17144
+ return result;
17145
+ }
17146
+ async _readResource(params, options) {
16620
17147
  const hit = await this._serveFromCache("resources/read", params.uri, options);
16621
- if (hit !== void 0) return hit;
17148
+ if (hit !== void 0) return {
17149
+ result: hit,
17150
+ cached: true
17151
+ };
16622
17152
  const generation = this._cache.captureGeneration("resources/read", params.uri);
16623
17153
  const result = await this.request({
16624
17154
  method: "resources/read",
@@ -16629,7 +17159,10 @@ var Client = class extends Protocol {
16629
17159
  if (freshness.expiresAt > this._cache.now()) await this._cache.write("resources/read", result, generation, freshness);
16630
17160
  else if (options?.cacheMode === "refresh") await this._cache.evictKey("resources/read", params.uri);
16631
17161
  }
16632
- return result;
17162
+ return {
17163
+ result,
17164
+ cached: false
17165
+ };
16633
17166
  }
16634
17167
  /** Subscribes to change notifications for a resource. The server must support resource subscriptions. */
16635
17168
  async subscribeResource(params, options) {
@@ -16758,19 +17291,22 @@ var Client = class extends Protocol {
16758
17291
  notifications: filter
16759
17292
  }
16760
17293
  };
17294
+ const routeSendFailure = /* @__PURE__ */ __name((error) => {
17295
+ settle({
17296
+ cause: "remote",
17297
+ error: error instanceof Error ? error : new Error(String(error))
17298
+ });
17299
+ }, "routeSendFailure");
16761
17300
  try {
16762
- await this.transport.send(jsonrpcRequest, {
17301
+ this.transport.send(jsonrpcRequest, {
16763
17302
  requestSignal: requestAbort.signal,
16764
17303
  onRequestStreamEnd: /* @__PURE__ */ __name(() => settle({
16765
17304
  cause: "remote",
16766
17305
  error: /* @__PURE__ */ new Error("subscriptions/listen: stream ended")
16767
17306
  }), "onRequestStreamEnd")
16768
- });
17307
+ }).catch(routeSendFailure);
16769
17308
  } catch (error) {
16770
- settle({
16771
- cause: "remote",
16772
- error: error instanceof Error ? error : new Error(String(error))
16773
- });
17309
+ routeSendFailure(error);
16774
17310
  }
16775
17311
  return {
16776
17312
  honoredFilter: await opening,
@@ -17022,7 +17558,7 @@ var Client = class extends Protocol {
17022
17558
  }
17023
17559
  const hit = await this._serveFromCache("tools/list", void 0, options);
17024
17560
  if (hit !== void 0) return hit;
17025
- return this._listAllPages("tools/list", params, options, (acc, page) => acc.tools.push(...page.tools), (acc) => this._excludeInvalidXMcpHeaderTools(acc));
17561
+ return this._listAllPages("tools/list", params, options, (r) => r.tools, (acc) => this._excludeInvalidXMcpHeaderTools(acc));
17026
17562
  }
17027
17563
  /**
17028
17564
  * SEP-2243 (protocol revision 2026-07-28): a Streamable HTTP client MUST
@@ -17093,6 +17629,8 @@ var Client = class extends Protocol {
17093
17629
  return this.notification({ method: "notifications/roots/list_changed" });
17094
17630
  }
17095
17631
  };
17632
+
17633
+ // ../../node_modules/.pnpm/@modelcontextprotocol+client@2.4.0/node_modules/@modelcontextprotocol/client/dist/index.mjs
17096
17634
  function hasDpopChallenge(wwwAuthenticate) {
17097
17635
  return /(?:^|,)\s*dpop(?:\s|$|,)/i.test(wwwAuthenticate);
17098
17636
  }
@@ -17268,6 +17806,7 @@ var StreamableHTTPClientTransport = class {
17268
17806
  _skipIssuerMetadataValidation;
17269
17807
  _fetch;
17270
17808
  _fetchWithInit;
17809
+ _redirectPolicy;
17271
17810
  _sessionId;
17272
17811
  _reconnectionOptions;
17273
17812
  _protocolVersion;
@@ -17298,7 +17837,9 @@ var StreamableHTTPClientTransport = class {
17298
17837
  this._authProvider = adaptOAuthProvider(opts.authProvider, { skipIssuerMetadataValidation: opts.skipIssuerMetadataValidation });
17299
17838
  if (opts.authProvider.dpop) this._fetch = withDpopFromProvider(opts.authProvider)(opts.fetch ?? fetch);
17300
17839
  } else this._authProvider = opts?.authProvider;
17840
+ this._redirectPolicy = opts?.redirectPolicy;
17301
17841
  this._fetchWithInit = createFetchWithInit(opts?.fetch, opts?.requestInit);
17842
+ if (this._redirectPolicy === "follow") this._fetchWithInit = fetchLeavingRedirects(this._fetchWithInit);
17302
17843
  this._sessionId = opts?.sessionId;
17303
17844
  this._protocolVersion = opts?.protocolVersion;
17304
17845
  this._reconnectionOptions = opts?.reconnectionOptions ?? DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS;
@@ -17350,6 +17891,15 @@ var StreamableHTTPClientTransport = class {
17350
17891
  skipIssuerMetadataValidation: this._skipIssuerMetadataValidation
17351
17892
  });
17352
17893
  }
17894
+ /** `baseFetch` with redirects handled as `redirectPolicy` says. */
17895
+ _redirects(baseFetch) {
17896
+ return this._redirectPolicy === "follow" ? baseFetch : fetchWithinOrigin(baseFetch);
17897
+ }
17898
+ /** Error text for a redirect `response` that was not followed, or `undefined` for any other response. */
17899
+ _unfollowedRedirect(url2, response) {
17900
+ const text = this._redirectPolicy === "follow" ? void 0 : unfollowedRedirect(url2, response);
17901
+ return text && `${text} (redirectPolicy: 'same-origin')`;
17902
+ }
17353
17903
  async _commonHeaders() {
17354
17904
  const headers = new Headers(this._requestInit?.headers || void 0);
17355
17905
  let token;
@@ -17401,7 +17951,7 @@ var StreamableHTTPClientTransport = class {
17401
17951
  if (resumptionToken) headers.set("last-event-id", resumptionToken);
17402
17952
  const transportSignal = this._abortController?.signal;
17403
17953
  const signal = requestSignal !== void 0 && transportSignal !== void 0 ? anySignal(transportSignal, requestSignal) : requestSignal ?? transportSignal;
17404
- const response = await (this._fetch ?? fetch)(this._url, {
17954
+ const response = await this._redirects(this._fetch ?? fetch)(this._url, {
17405
17955
  ...this._requestInit,
17406
17956
  method: "GET",
17407
17957
  headers,
@@ -17456,7 +18006,8 @@ var StreamableHTTPClientTransport = class {
17456
18006
  options.onRequestStreamEnd?.();
17457
18007
  return;
17458
18008
  }
17459
- throw new SdkHttpError(SdkErrorCode.ClientHttpFailedToOpenStream, `Failed to open SSE stream: ${response.statusText}`, {
18009
+ const reason = this._unfollowedRedirect(this._url, response) ?? response.statusText;
18010
+ throw new SdkHttpError(SdkErrorCode.ClientHttpFailedToOpenStream, `Failed to open SSE stream: ${reason}`, {
17460
18011
  status: response.status,
17461
18012
  statusText: response.statusText
17462
18013
  });
@@ -17645,7 +18196,7 @@ var StreamableHTTPClientTransport = class {
17645
18196
  body: JSON.stringify(message),
17646
18197
  signal
17647
18198
  };
17648
- const response = await (this._fetch ?? fetch)(this._url, init);
18199
+ const response = await this._redirects(this._fetch ?? fetch)(this._url, init);
17649
18200
  if (isHandshake && response.ok) this._sessionId = response.headers.get("mcp-session-id") || void 0;
17650
18201
  if (!response.ok) {
17651
18202
  if (response.status === 401 && this._authProvider) {
@@ -17699,7 +18250,8 @@ var StreamableHTTPClientTransport = class {
17699
18250
  }
17700
18251
  } catch {
17701
18252
  }
17702
- throw new SdkHttpError(SdkErrorCode.ClientHttpNotImplemented, `Error POSTing to endpoint: ${text}`, {
18253
+ const reason = this._unfollowedRedirect(this._url, response) ?? text;
18254
+ throw new SdkHttpError(SdkErrorCode.ClientHttpNotImplemented, `Error POSTing to endpoint: ${reason}`, {
17703
18255
  status: response.status,
17704
18256
  statusText: response.statusText,
17705
18257
  text
@@ -17759,10 +18311,10 @@ var StreamableHTTPClientTransport = class {
17759
18311
  headers,
17760
18312
  signal: this._abortController?.signal
17761
18313
  };
17762
- const response = await (this._fetch ?? fetch)(this._url, init);
18314
+ const response = await this._redirects(this._fetch ?? fetch)(this._url, init);
17763
18315
  await response.text?.().catch(() => {
17764
18316
  });
17765
- if (!response.ok && response.status !== 405) throw new SdkHttpError(SdkErrorCode.ClientHttpFailedToTerminateSession, `Failed to terminate session: ${response.statusText}`, {
18317
+ if (!response.ok && response.status !== 405) throw new SdkHttpError(SdkErrorCode.ClientHttpFailedToTerminateSession, `Failed to terminate session: ${this._unfollowedRedirect(this._url, response) ?? response.statusText}`, {
17766
18318
  status: response.status,
17767
18319
  statusText: response.statusText
17768
18320
  });
@@ -18039,6 +18591,12 @@ function withSavedMcpOAuth(transport) {
18039
18591
  throw new Error("MCP OAuth refused a request to a different endpoint");
18040
18592
  }
18041
18593
  const response = await rawFetch(input, { ...init, redirect: "manual" });
18594
+ if (response.status >= 300 && response.status < 400) {
18595
+ void response.body?.cancel().catch(() => void 0);
18596
+ throw new Error(
18597
+ "MCP OAuth refused to follow a redirect; configure the final MCP endpoint directly."
18598
+ );
18599
+ }
18042
18600
  if (response.status !== 401) return response;
18043
18601
  const attemptedAuthorization = new Headers(init?.headers).get("authorization");
18044
18602
  const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response);
@@ -18607,11 +19165,11 @@ export {
18607
19165
  };
18608
19166
  /*! Bundled license information:
18609
19167
 
18610
- @modelcontextprotocol/client/dist/src-DDAAhLnO.mjs:
19168
+ @modelcontextprotocol/client/dist/src-CeKsbNLO.mjs:
18611
19169
  (*!
18612
19170
  * content-type
18613
19171
  * Copyright(c) 2015 Douglas Christopher Wilson
18614
19172
  * MIT Licensed
18615
19173
  *)
18616
19174
  */
18617
- //# sourceMappingURL=chunk-YNJ3SWIL.js.map
19175
+ //# sourceMappingURL=chunk-QCL4LFUZ.js.map