agentworkshop 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2345) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{C83WgjYi2.js → 0Nb816vM2.js} +1 -1
  3. package/.output/public/_nuxt/{9fFmgoEg.js → 1MRs7VEN.js} +2 -2
  4. package/.output/public/_nuxt/{na-v7AnV.js → 2G5QY7Ve.js} +1 -1
  5. package/.output/public/_nuxt/{BSoelv0a.js → 2_epppnS.js} +1 -1
  6. package/.output/public/_nuxt/3Z3Bt_nO.js +1 -0
  7. package/.output/public/_nuxt/45EP5kW5.js +1 -0
  8. package/.output/public/_nuxt/{1ACUYRbX2.js → 4zHSAgHR2.js} +1 -1
  9. package/.output/public/_nuxt/{v9siq2t2.js → 7cEEdXUB.js} +1 -1
  10. package/.output/public/_nuxt/{CwKer8HM.js → AoMWPlS4.js} +1 -1
  11. package/.output/public/_nuxt/B1Byv4Xd.js +1 -0
  12. package/.output/public/_nuxt/{CcUK7VEO.js → B2aNBGWY.js} +1 -1
  13. package/.output/public/_nuxt/B5JMr9Bq2.js +1 -0
  14. package/.output/public/_nuxt/{BGNdJs0u.js → B6OzW5oQ.js} +1 -1
  15. package/.output/public/_nuxt/{DkT2GNoe2.js → B7qnHEGS2.js} +1 -1
  16. package/.output/public/_nuxt/{C2T_likn.js → B9bDLMV2.js} +1 -1
  17. package/.output/public/_nuxt/{C1aw8M-y.js → BFCXlEri.js} +1 -1
  18. package/.output/public/_nuxt/{ButdHBAG2.js → BIA1pgdK2.js} +1 -1
  19. package/.output/public/_nuxt/{CaO16PEo.js → BJOvMgHZ.js} +1 -1
  20. package/.output/public/_nuxt/{DShhJiJ2.js → BMNTU63B.js} +1 -1
  21. package/.output/public/_nuxt/{CxsGwDxD.js → BOTwLI58.js} +1 -1
  22. package/.output/public/_nuxt/{DyVSH3z12.js → BOZ5H3qp2.js} +1 -1
  23. package/.output/public/_nuxt/{D6YOm08o2.js → BQUP8S2f2.js} +1 -1
  24. package/.output/public/_nuxt/{DlQwaDvT.js → BTolZqCl.js} +1 -1
  25. package/.output/public/_nuxt/{CqGPK3qr.js → BU9ngoXz.js} +1 -1
  26. package/.output/public/_nuxt/BVg1W_bo.js +1 -0
  27. package/.output/public/_nuxt/{tDcrlXNq2.js → BWDUeB9r2.js} +1 -1
  28. package/.output/public/_nuxt/BXjiBMuG.js +1 -0
  29. package/.output/public/_nuxt/BZiINJYa.js +1 -0
  30. package/.output/public/_nuxt/{Dv-aRRw6.js → BdNcCEk9.js} +1 -1
  31. package/.output/public/_nuxt/{BXmw2gVr2.js → Bdk78w-12.js} +1 -1
  32. package/.output/public/_nuxt/{CjUhmJu4.js → Bm9CxEDc.js} +1 -1
  33. package/.output/public/_nuxt/{BO1EKPwz.js → Bmnkd0yI.js} +1 -1
  34. package/.output/public/_nuxt/BpqmshmO.js +1 -0
  35. package/.output/public/_nuxt/{BzMtfH7I.js → BzrnUjnS.js} +1 -1
  36. package/.output/public/_nuxt/{B58_RyYq.js → C-3VV0kR2.js} +1 -1
  37. package/.output/public/_nuxt/{BgbWJIxO.js → C-9AbHCK.js} +1 -1
  38. package/.output/public/_nuxt/{C-4CbiNS.js → C-TWLsL1.js} +1 -1
  39. package/.output/public/_nuxt/{BMWX8Piz2.js → C2Tq3YFf2.js} +1 -1
  40. package/.output/public/_nuxt/{E0JVrptf2.js → C3OtCFuc.js} +1 -1
  41. package/.output/public/_nuxt/{DbdSzhaN.js → C3quMY1Z.js} +1 -1
  42. package/.output/public/_nuxt/C7cwKZqJ2.js +1 -0
  43. package/.output/public/_nuxt/{DhZ92AxX.js → C7gQe4Lf.js} +1 -1
  44. package/.output/public/_nuxt/C83neYZq2.js +1 -0
  45. package/.output/public/_nuxt/C8z8bWb7.js +2 -0
  46. package/.output/public/_nuxt/{DzeHYeCo2.js → CBNfkSs72.js} +1 -1
  47. package/.output/public/_nuxt/CC8gRGAU.js +1 -0
  48. package/.output/public/_nuxt/{p1ERztZ9.js → CCb05LCf.js} +1 -1
  49. package/.output/public/_nuxt/{CsdezMu9.js → CES9PcLp.js} +6 -6
  50. package/.output/public/_nuxt/{CljTL3qL.js → CGZVhxgy.js} +1 -1
  51. package/.output/public/_nuxt/{Cy0eCUDp.js → CGcb6CEO.js} +5 -5
  52. package/.output/public/_nuxt/CL0ndeUz2.js +1 -0
  53. package/.output/public/_nuxt/{DVz_Lb-o.js → CLocB-kZ.js} +1 -1
  54. package/.output/public/_nuxt/{B074kQfG.js → CMNP1flG.js} +1 -1
  55. package/.output/public/_nuxt/{lfOlRKYk.js → CNanQPIl.js} +1 -1
  56. package/.output/public/_nuxt/COxoJT2N.js +1 -0
  57. package/.output/public/_nuxt/CTHjVKYV.js +1 -0
  58. package/.output/public/_nuxt/CV9ChSul.js +1 -0
  59. package/.output/public/_nuxt/CWwOJ-8h2.js +1 -0
  60. package/.output/public/_nuxt/CaY6Vh5o2.js +1 -0
  61. package/.output/public/_nuxt/{WL1R8lPA.js → ChAyptzV.js} +1 -1
  62. package/.output/public/_nuxt/{DbY_bP7w.js → CjSLwcFL.js} +1 -1
  63. package/.output/public/_nuxt/CjsItGmV.js +1 -0
  64. package/.output/public/_nuxt/{DiGhNsS32.js → ClVN8KaH2.js} +1 -1
  65. package/.output/public/_nuxt/{unupYhzt.js → CnBU3M3H.js} +1 -1
  66. package/.output/public/_nuxt/CnwJOtRh.js +1 -0
  67. package/.output/public/_nuxt/{D1BCZoPK2.js → Cprjhp0y2.js} +1 -1
  68. package/.output/public/_nuxt/Cq04yCfv.js +2 -0
  69. package/.output/public/_nuxt/{DqlqbG4p.js → CuOY9HU5.js} +1 -1
  70. package/.output/public/_nuxt/CuiM5V6m.js +1 -0
  71. package/.output/public/_nuxt/{DkNIO2bC2.js → CzpwkMW62.js} +1 -1
  72. package/.output/public/_nuxt/{DSAh0j8H.js → D3bkMZ9s.js} +1 -1
  73. package/.output/public/_nuxt/{DnN04BP7.js → D7sN-Wpq.js} +1 -1
  74. package/.output/public/_nuxt/{CXcry5882.js → D8nDqaC82.js} +1 -1
  75. package/.output/public/_nuxt/{BhEXWepB2.js → DBYWT65a2.js} +1 -1
  76. package/.output/public/_nuxt/DBj6ccke.js +1 -0
  77. package/.output/public/_nuxt/{CPoQsxkj2.js → DIXtjY5n2.js} +1 -1
  78. package/.output/public/_nuxt/{B47j3rCX2.js → DL06zqLJ2.js} +1 -1
  79. package/.output/public/_nuxt/{_zZ5SC-g2.js → DMDHmyw22.js} +1 -1
  80. package/.output/public/_nuxt/{DMqyOhMS2.js → DOhhieKA2.js} +1 -1
  81. package/.output/public/_nuxt/DU3fuQcm2.js +1 -0
  82. package/.output/public/_nuxt/DVG0F_vR2.js +1 -0
  83. package/.output/public/_nuxt/{PdLKns9u.js → DWmUsWoT.js} +1 -1
  84. package/.output/public/_nuxt/DXY8bTqS.js +1 -0
  85. package/.output/public/_nuxt/{Do_puYWy.js → DXYZpZc3.js} +1 -1
  86. package/.output/public/_nuxt/{BlssjBI62.js → Ddngq6o32.js} +1 -1
  87. package/.output/public/_nuxt/{BnhT9mKJ.js → Del58ZQ1.js} +1 -1
  88. package/.output/public/_nuxt/{C-0XFiGd2.js → Dfd0oCMi2.js} +1 -1
  89. package/.output/public/_nuxt/{zMAN4sWM.js → DhB3DaCJ.js} +1 -1
  90. package/.output/public/_nuxt/{KuauUl3M2.js → DmpthR5e2.js} +1 -1
  91. package/.output/public/_nuxt/{DW3J3wwr.js → DnECgSKV.js} +1 -1
  92. package/.output/public/_nuxt/{C09UDduo.js → DnKJsP9R.js} +1 -1
  93. package/.output/public/_nuxt/{CYVBeAN02.js → DoUe2o1b2.js} +1 -1
  94. package/.output/public/_nuxt/{1-nXTmsz.js → DqugL6kI.js} +1 -1
  95. package/.output/public/_nuxt/{B2-Wuy0u.js → DrtAZmJr.js} +1 -1
  96. package/.output/public/_nuxt/{DLOrQRt8.js → Dycod_QI2.js} +1 -1
  97. package/.output/public/_nuxt/GTQ1F8wZ.js +1 -0
  98. package/.output/public/_nuxt/{BRidIwYz.js → MNmYIrmo.js} +1 -1
  99. package/.output/public/_nuxt/P2Ooyttz2.js +2 -0
  100. package/.output/public/_nuxt/Phf3amPG2.js +1 -0
  101. package/.output/public/_nuxt/Uuf6Jdzd.js +1 -0
  102. package/.output/public/_nuxt/{C41aYETX.js → XOEJCfKe.js} +1 -1
  103. package/.output/public/_nuxt/{_wsId_.zZS-8BeH.css → _wsId_.B2sLoyzZ.css} +1 -1
  104. package/.output/public/_nuxt/{DtZhgwuA.js → abcxuPE9.js} +1 -1
  105. package/.output/public/_nuxt/builds/latest.json +1 -1
  106. package/.output/public/_nuxt/builds/meta/c1f41981-1e18-4ae0-be61-9db5f5bc284e.json +1 -0
  107. package/.output/public/_nuxt/czIOEnW42.js +1 -0
  108. package/.output/public/_nuxt/{CiRZsefJ2.js → e4nLwBjY2.js} +1 -1
  109. package/.output/public/_nuxt/egk5d2O4.js +1 -0
  110. package/.output/public/_nuxt/{entry.Bi6D2eNv.css → entry.CxkSJUk3.css} +1 -1
  111. package/.output/public/_nuxt/{C5qsWljd2.js → pO0uy14N2.js} +1 -1
  112. package/.output/public/_nuxt/settings.BRjXthG4.css +1 -0
  113. package/.output/public/_nuxt/{C9GYA3gx2.js → uH70PXCU2.js} +1 -1
  114. package/.output/public/_nuxt/{BLb7g0SY.js → y3xy6Xpo.js} +1 -1
  115. package/.output/server/chunks/_/access.mjs +2 -1
  116. package/.output/server/chunks/_/access.mjs.map +1 -1
  117. package/.output/server/chunks/_/bench-run.mjs +8 -4
  118. package/.output/server/chunks/_/bench-run.mjs.map +1 -1
  119. package/.output/server/chunks/_/binding-authz.mjs +1 -1
  120. package/.output/server/chunks/_/candidate-store.mjs +1 -1
  121. package/.output/server/chunks/_/catalog-view.mjs +1 -1
  122. package/.output/server/chunks/_/character-asset.repo.mjs +1 -1
  123. package/.output/server/chunks/_/chart-repo.mjs +1 -1
  124. package/.output/server/chunks/_/dashboard-repo.mjs +1 -1
  125. package/.output/server/chunks/_/data-export.mjs +6 -6
  126. package/.output/server/chunks/_/data-query.mjs +3 -3
  127. package/.output/server/chunks/_/eda-run.repo.mjs +3 -2
  128. package/.output/server/chunks/_/eda-run.repo.mjs.map +1 -1
  129. package/.output/server/chunks/_/entity.mjs +1 -1
  130. package/.output/server/chunks/_/features.mjs +6 -5
  131. package/.output/server/chunks/_/features.mjs.map +1 -1
  132. package/.output/server/chunks/_/golden.mjs +3 -3
  133. package/.output/server/chunks/_/host-bindings.mjs +2 -1
  134. package/.output/server/chunks/_/host-bindings.mjs.map +1 -1
  135. package/.output/server/chunks/_/index.mjs +2 -1
  136. package/.output/server/chunks/_/index.mjs.map +1 -1
  137. package/.output/server/chunks/_/line-scope.mjs +1 -1
  138. package/.output/server/chunks/_/mes-console.mjs +1 -1
  139. package/.output/server/chunks/_/mes-secrets.repo.mjs +2 -1
  140. package/.output/server/chunks/_/mes-secrets.repo.mjs.map +1 -1
  141. package/.output/server/chunks/_/mes-templates.mjs +1 -1
  142. package/.output/server/chunks/_/nitro.mjs +4946 -2295
  143. package/.output/server/chunks/_/nitro.mjs.map +1 -1
  144. package/.output/server/chunks/_/ocap.mjs +1 -1
  145. package/.output/server/chunks/_/orchestrator.mjs +2 -1
  146. package/.output/server/chunks/_/orchestrator.mjs.map +1 -1
  147. package/.output/server/chunks/_/promote.mjs +8 -2
  148. package/.output/server/chunks/_/promote.mjs.map +1 -1
  149. package/.output/server/chunks/_/rest-auth.mjs +1 -1
  150. package/.output/server/chunks/_/runtime.mjs +9 -8
  151. package/.output/server/chunks/_/runtime.mjs.map +1 -1
  152. package/.output/server/chunks/_/scene-layout.repo.mjs +1 -1
  153. package/.output/server/chunks/_/spc.mjs +3 -2
  154. package/.output/server/chunks/_/spc.mjs.map +1 -1
  155. package/.output/server/chunks/_/template-repo.mjs +1 -1
  156. package/.output/server/chunks/_/validator.mjs +1 -1
  157. package/.output/server/chunks/build/TownView-DD1zY8xq.mjs +1 -1
  158. package/.output/server/chunks/build/_id_-B9zi8WEg.mjs +1 -0
  159. package/.output/server/chunks/build/_id_-B9zi8WEg.mjs.map +1 -1
  160. package/.output/server/chunks/build/_id_-BB-OZCsp.mjs +1 -0
  161. package/.output/server/chunks/build/_id_-BB-OZCsp.mjs.map +1 -1
  162. package/.output/server/chunks/build/_id_-DLdvNP4J.mjs +1 -0
  163. package/.output/server/chunks/build/_id_-DLdvNP4J.mjs.map +1 -1
  164. package/.output/server/chunks/build/{_wsId_-LDv5SEW_.mjs → _wsId_-DpPJ8wKL.mjs} +116 -19
  165. package/.output/server/chunks/build/{_wsId_-LDv5SEW_.mjs.map → _wsId_-DpPJ8wKL.mjs.map} +1 -1
  166. package/.output/server/chunks/build/agents-DeRHs8c9.mjs +1 -0
  167. package/.output/server/chunks/build/agents-DeRHs8c9.mjs.map +1 -1
  168. package/.output/server/chunks/build/aml-DVcZDyvA.mjs +1 -0
  169. package/.output/server/chunks/build/aml-DVcZDyvA.mjs.map +1 -1
  170. package/.output/server/chunks/build/analysis-DQM-3YKP.mjs +1 -0
  171. package/.output/server/chunks/build/analysis-DQM-3YKP.mjs.map +1 -1
  172. package/.output/server/chunks/build/api-BQ9AQHv-.mjs +1 -0
  173. package/.output/server/chunks/build/api-BQ9AQHv-.mjs.map +1 -1
  174. package/.output/server/chunks/build/api-ByIV5jMN.mjs +1 -0
  175. package/.output/server/chunks/build/api-ByIV5jMN.mjs.map +1 -1
  176. package/.output/server/chunks/build/api-DbUqSbs2.mjs +1 -0
  177. package/.output/server/chunks/build/api-DbUqSbs2.mjs.map +1 -1
  178. package/.output/server/chunks/build/board-CKUuAY_Q.mjs +1 -0
  179. package/.output/server/chunks/build/board-CKUuAY_Q.mjs.map +1 -1
  180. package/.output/server/chunks/build/channel-templates-4Zdu0Eyr.mjs +1 -0
  181. package/.output/server/chunks/build/channel-templates-4Zdu0Eyr.mjs.map +1 -1
  182. package/.output/server/chunks/build/console-nsxH0t5s.mjs +1 -0
  183. package/.output/server/chunks/build/console-nsxH0t5s.mjs.map +1 -1
  184. package/.output/server/chunks/build/constants-HPHJvjne.mjs +1 -0
  185. package/.output/server/chunks/build/constants-HPHJvjne.mjs.map +1 -1
  186. package/.output/server/chunks/build/daq-B5zlUIlb.mjs +2 -1
  187. package/.output/server/chunks/build/daq-B5zlUIlb.mjs.map +1 -1
  188. package/.output/server/chunks/build/data-CdyujjU3.mjs +1 -0
  189. package/.output/server/chunks/build/data-CdyujjU3.mjs.map +1 -1
  190. package/.output/server/chunks/build/dcw-B-eoU7sq.mjs +2 -1
  191. package/.output/server/chunks/build/dcw-B-eoU7sq.mjs.map +1 -1
  192. package/.output/server/chunks/build/default-Bbyb2qEG.mjs +1 -0
  193. package/.output/server/chunks/build/es-DHnUVWGO.mjs +1 -0
  194. package/.output/server/chunks/build/es-DHnUVWGO.mjs.map +1 -1
  195. package/.output/server/chunks/build/logs-ByxK-myz.mjs +1 -0
  196. package/.output/server/chunks/build/logs-ByxK-myz.mjs.map +1 -1
  197. package/.output/server/chunks/build/monitor-BWd4h4K9.mjs +1 -0
  198. package/.output/server/chunks/build/ontology-C3WzgG5p.mjs +1 -0
  199. package/.output/server/chunks/build/ontology-C3WzgG5p.mjs.map +1 -1
  200. package/.output/server/chunks/build/operations-tE63Vy9Z.mjs +1 -0
  201. package/.output/server/chunks/build/operations-tE63Vy9Z.mjs.map +1 -1
  202. package/.output/server/chunks/build/optimizer-A6UyksVT.mjs +1 -0
  203. package/.output/server/chunks/build/pages-D-cFfP_K.mjs +1 -0
  204. package/.output/server/chunks/build/pages-D-cFfP_K.mjs.map +1 -1
  205. package/.output/server/chunks/build/permissions-44GsBS_4.mjs +1 -0
  206. package/.output/server/chunks/build/permissions-44GsBS_4.mjs.map +1 -1
  207. package/.output/server/chunks/build/pipeline-B2TDdGx6.mjs +1 -0
  208. package/.output/server/chunks/build/pipeline-B2TDdGx6.mjs.map +1 -1
  209. package/.output/server/chunks/build/plugins-CfVTAFbT.mjs +1 -0
  210. package/.output/server/chunks/build/plugins-CfVTAFbT.mjs.map +1 -1
  211. package/.output/server/chunks/build/projects-taoNPGqx.mjs +1 -0
  212. package/.output/server/chunks/build/projects-taoNPGqx.mjs.map +1 -1
  213. package/.output/server/chunks/build/schedules-DnHxYWcd.mjs +1 -0
  214. package/.output/server/chunks/build/settings-DpVwa_M8.mjs +3537 -0
  215. package/.output/server/chunks/build/settings-DpVwa_M8.mjs.map +1 -0
  216. package/.output/server/chunks/build/studio-CB0a63bK.mjs +1 -0
  217. package/.output/server/chunks/build/studio-CB0a63bK.mjs.map +1 -1
  218. package/.output/server/chunks/build/teams-DkwgH6Ab.mjs +1 -0
  219. package/.output/server/chunks/build/teams-DkwgH6Ab.mjs.map +1 -1
  220. package/.output/server/chunks/build/tokens-yzJOx8lm.mjs +1 -0
  221. package/.output/server/chunks/build/tokens-yzJOx8lm.mjs.map +1 -1
  222. package/.output/server/chunks/build/tools-Bd7u9FCc.mjs +1 -0
  223. package/.output/server/chunks/build/tools-Bd7u9FCc.mjs.map +1 -1
  224. package/.output/server/chunks/build/town-CyJy_4k5.mjs +1 -0
  225. package/.output/server/chunks/build/town-CyJy_4k5.mjs.map +1 -1
  226. package/.output/server/chunks/build/town-pIgFRdcR.mjs +1 -0
  227. package/.output/server/chunks/build/town-pIgFRdcR.mjs.map +1 -1
  228. package/.output/server/chunks/build/types-D6J7slEa.mjs +1 -1
  229. package/.output/server/chunks/build/types-DWqIeMRP.mjs +1 -0
  230. package/.output/server/chunks/build/types-DWqIeMRP.mjs.map +1 -1
  231. package/.output/server/chunks/build/useAgentHarnessOptions-BkPrqFxg.mjs +1 -0
  232. package/.output/server/chunks/build/useAgentHarnessOptions-BkPrqFxg.mjs.map +1 -1
  233. package/.output/server/chunks/build/useAgentTemplateActions-BftyRRwI.mjs +1 -0
  234. package/.output/server/chunks/build/useAgentTemplateActions-BftyRRwI.mjs.map +1 -1
  235. package/.output/server/chunks/build/useAgentTemplateDialogState-CZzpu5og.mjs +1 -0
  236. package/.output/server/chunks/build/useAgentTemplateDialogState-CZzpu5og.mjs.map +1 -1
  237. package/.output/server/chunks/build/useAgentTemplateForm-D7NAXZ59.mjs +1 -0
  238. package/.output/server/chunks/build/useAgentTemplateForm-D7NAXZ59.mjs.map +1 -1
  239. package/.output/server/chunks/build/useAgentTemplatesCatalog-DnqTc0oL.mjs +1 -0
  240. package/.output/server/chunks/build/useAgentTemplatesCatalog-DnqTc0oL.mjs.map +1 -1
  241. package/.output/server/chunks/build/useAmlDatasets-Cr25p62c.mjs +1 -0
  242. package/.output/server/chunks/build/useAmlDatasets-Cr25p62c.mjs.map +1 -1
  243. package/.output/server/chunks/build/useAmlEntities-DBDpqmC3.mjs +1 -0
  244. package/.output/server/chunks/build/useAmlEntities-DBDpqmC3.mjs.map +1 -1
  245. package/.output/server/chunks/build/useAmlEnv-B94CxtjW.mjs +1 -0
  246. package/.output/server/chunks/build/useAmlEnv-B94CxtjW.mjs.map +1 -1
  247. package/.output/server/chunks/build/useAmlExperiments-B2HI1odc.mjs +1 -0
  248. package/.output/server/chunks/build/useAmlExperiments-B2HI1odc.mjs.map +1 -1
  249. package/.output/server/chunks/build/useAmlFormat-DNrSqItx.mjs +1 -0
  250. package/.output/server/chunks/build/useAmlFormat-DNrSqItx.mjs.map +1 -1
  251. package/.output/server/chunks/build/useAmlJobs-C-EheCdn.mjs +1 -0
  252. package/.output/server/chunks/build/useAmlJobs-C-EheCdn.mjs.map +1 -1
  253. package/.output/server/chunks/build/useAmlModels-BqWz2YoO.mjs +1 -0
  254. package/.output/server/chunks/build/useAmlModels-BqWz2YoO.mjs.map +1 -1
  255. package/.output/server/chunks/build/useAmlNotes-nRlk9fOE.mjs +1 -0
  256. package/.output/server/chunks/build/useAmlNotes-nRlk9fOE.mjs.map +1 -1
  257. package/.output/server/chunks/build/useAmlPredict-BQbSLob6.mjs +1 -0
  258. package/.output/server/chunks/build/useAmlPredict-BQbSLob6.mjs.map +1 -1
  259. package/.output/server/chunks/build/useAnalysisFeed-CzZmTTqq.mjs +1 -0
  260. package/.output/server/chunks/build/useAnalysisFeed-CzZmTTqq.mjs.map +1 -1
  261. package/.output/server/chunks/build/useDaqAddNode-Dr5CfMpU.mjs +2 -1
  262. package/.output/server/chunks/build/useDaqAddNode-Dr5CfMpU.mjs.map +1 -1
  263. package/.output/server/chunks/build/useDaqDetailBinding-BAAoyUdv.mjs +1 -0
  264. package/.output/server/chunks/build/useDaqDetailBinding-BAAoyUdv.mjs.map +1 -1
  265. package/.output/server/chunks/build/useDaqDetailFrames-4zuFL3Q5.mjs +1 -0
  266. package/.output/server/chunks/build/useDaqDetailFrames-4zuFL3Q5.mjs.map +1 -1
  267. package/.output/server/chunks/build/useDaqDetailHistory-CHrHfBOm.mjs +1 -0
  268. package/.output/server/chunks/build/useDaqDetailHistory-CHrHfBOm.mjs.map +1 -1
  269. package/.output/server/chunks/build/useDaqDetailNode-DDq5osE-.mjs +2 -1
  270. package/.output/server/chunks/build/useDaqDetailNode-DDq5osE-.mjs.map +1 -1
  271. package/.output/server/chunks/build/useDaqDetailParams-DdOcUvHG.mjs +2 -1
  272. package/.output/server/chunks/build/useDaqDetailParams-DdOcUvHG.mjs.map +1 -1
  273. package/.output/server/chunks/build/useDaqFilters-Y_NRhP6i.mjs +2 -1
  274. package/.output/server/chunks/build/useDaqFilters-Y_NRhP6i.mjs.map +1 -1
  275. package/.output/server/chunks/build/useDaqNodeWindow-1DWj2H5G.mjs +1 -0
  276. package/.output/server/chunks/build/useDaqNodeWindow-1DWj2H5G.mjs.map +1 -1
  277. package/.output/server/chunks/build/useDaqOptimizations-O4JdRYUR.mjs +1 -0
  278. package/.output/server/chunks/build/useDaqOptimizations-O4JdRYUR.mjs.map +1 -1
  279. package/.output/server/chunks/build/useDaqStream-phwM5tIN.mjs +1 -1
  280. package/.output/server/chunks/build/useDaqTemplates-lKw2b01d.mjs +2 -1
  281. package/.output/server/chunks/build/useDaqTemplates-lKw2b01d.mjs.map +1 -1
  282. package/.output/server/chunks/build/useDashboardCharts-Cw7u2wUU.mjs +1 -0
  283. package/.output/server/chunks/build/useDashboardCharts-Cw7u2wUU.mjs.map +1 -1
  284. package/.output/server/chunks/build/useDashboardData-BBBMb6v_.mjs +1 -0
  285. package/.output/server/chunks/build/useDashboardData-BBBMb6v_.mjs.map +1 -1
  286. package/.output/server/chunks/build/useDcwAddNode-CT-oOFom.mjs +2 -1
  287. package/.output/server/chunks/build/useDcwAddNode-CT-oOFom.mjs.map +1 -1
  288. package/.output/server/chunks/build/useDcwCards-COffSnEh.mjs +1 -0
  289. package/.output/server/chunks/build/useDcwCards-COffSnEh.mjs.map +1 -1
  290. package/.output/server/chunks/build/useDcwDetailScope-CPYeNib2.mjs +1 -0
  291. package/.output/server/chunks/build/useDcwDetailScope-CPYeNib2.mjs.map +1 -1
  292. package/.output/server/chunks/build/useDcwDetailTemplates-jXerMgzY.mjs +1 -0
  293. package/.output/server/chunks/build/useDcwDetailTemplates-jXerMgzY.mjs.map +1 -1
  294. package/.output/server/chunks/build/useDcwFilter-BmuVZkbW.mjs +1 -0
  295. package/.output/server/chunks/build/useDcwFilter-BmuVZkbW.mjs.map +1 -1
  296. package/.output/server/chunks/build/useDcwLedger-Do4JjGEu.mjs +1 -0
  297. package/.output/server/chunks/build/useDcwLedger-Do4JjGEu.mjs.map +1 -1
  298. package/.output/server/chunks/build/useDcwLineMutations-BNx-gh7I.mjs +1 -0
  299. package/.output/server/chunks/build/useDcwLineMutations-BNx-gh7I.mjs.map +1 -1
  300. package/.output/server/chunks/build/useDcwLineRun-CbJWDWZl.mjs +1 -0
  301. package/.output/server/chunks/build/useDcwLineRun-CbJWDWZl.mjs.map +1 -1
  302. package/.output/server/chunks/build/useDcwParamApprovals-BsoHHvme.mjs +1 -0
  303. package/.output/server/chunks/build/useDcwParamApprovals-BsoHHvme.mjs.map +1 -1
  304. package/.output/server/chunks/build/useDcwProducts-CXNhswqK.mjs +1 -0
  305. package/.output/server/chunks/build/useDcwProducts-CXNhswqK.mjs.map +1 -1
  306. package/.output/server/chunks/build/useDcwQuery-CBPkHlA7.mjs +1 -0
  307. package/.output/server/chunks/build/useDcwQuery-CBPkHlA7.mjs.map +1 -1
  308. package/.output/server/chunks/build/useDcwQuickActions-By6bAfeD.mjs +1 -0
  309. package/.output/server/chunks/build/useDcwQuickActions-By6bAfeD.mjs.map +1 -1
  310. package/.output/server/chunks/build/useDcwRecipes-ZUNE8GaL.mjs +1 -0
  311. package/.output/server/chunks/build/useDcwRecipes-ZUNE8GaL.mjs.map +1 -1
  312. package/.output/server/chunks/build/useDcwStream-CNtMGcR0.mjs +1 -1
  313. package/.output/server/chunks/build/useDcwTemplates-B5asHSLs.mjs +1 -0
  314. package/.output/server/chunks/build/useDcwTemplates-B5asHSLs.mjs.map +1 -1
  315. package/.output/server/chunks/build/useDcwWrites-B0RF3zFE.mjs +1 -0
  316. package/.output/server/chunks/build/useDcwWrites-B0RF3zFE.mjs.map +1 -1
  317. package/.output/server/chunks/build/useExpConfirmations-BxGYvtvI.mjs +1 -0
  318. package/.output/server/chunks/build/useExpConfirmations-BxGYvtvI.mjs.map +1 -1
  319. package/.output/server/chunks/build/useLogsFormat-jAfh97vI.mjs +1 -0
  320. package/.output/server/chunks/build/useLogsFormat-jAfh97vI.mjs.map +1 -1
  321. package/.output/server/chunks/build/useLogsManual-CIcgIGCP.mjs +1 -0
  322. package/.output/server/chunks/build/useLogsManual-CIcgIGCP.mjs.map +1 -1
  323. package/.output/server/chunks/build/useLogsQuery-CAkEW5e7.mjs +1 -0
  324. package/.output/server/chunks/build/useLogsQuery-CAkEW5e7.mjs.map +1 -1
  325. package/.output/server/chunks/build/useLogsScope-DGFmQgcV.mjs +1 -0
  326. package/.output/server/chunks/build/useLogsScope-DGFmQgcV.mjs.map +1 -1
  327. package/.output/server/chunks/build/useMonitorColumns-B9v7KZdO.mjs +1 -0
  328. package/.output/server/chunks/build/useMonitorColumns-B9v7KZdO.mjs.map +1 -1
  329. package/.output/server/chunks/build/useMonitorData-CXJzv8yG.mjs +1 -0
  330. package/.output/server/chunks/build/useMonitorData-CXJzv8yG.mjs.map +1 -1
  331. package/.output/server/chunks/build/useMonitorFormat-BEESOsgH.mjs +1 -0
  332. package/.output/server/chunks/build/useMonitorFormat-BEESOsgH.mjs.map +1 -1
  333. package/.output/server/chunks/build/useMonitorTerminal-Dj4QwRNW.mjs +1 -0
  334. package/.output/server/chunks/build/useMonitorTerminal-Dj4QwRNW.mjs.map +1 -1
  335. package/.output/server/chunks/build/useOperationsFeed-BK8B0A0L.mjs +1 -0
  336. package/.output/server/chunks/build/useOperationsFeed-BK8B0A0L.mjs.map +1 -1
  337. package/.output/server/chunks/build/useRecipeDispatchApprovals-NuH_3Bpu.mjs +1 -0
  338. package/.output/server/chunks/build/useRecipeDispatchApprovals-NuH_3Bpu.mjs.map +1 -1
  339. package/.output/server/chunks/build/useTeamActions-B4QCFYq8.mjs +1 -0
  340. package/.output/server/chunks/build/useTeamActions-B4QCFYq8.mjs.map +1 -1
  341. package/.output/server/chunks/build/useTeamAddMemberDialog-CF0Qb5l7.mjs +1 -0
  342. package/.output/server/chunks/build/useTeamAddMemberDialog-CF0Qb5l7.mjs.map +1 -1
  343. package/.output/server/chunks/build/useTeamCreateDialog-B-P-LG3N.mjs +1 -0
  344. package/.output/server/chunks/build/useTeamCreateDialog-B-P-LG3N.mjs.map +1 -1
  345. package/.output/server/chunks/build/useTeamDeployDialog-DHA-c9Tk.mjs +1 -0
  346. package/.output/server/chunks/build/useTeamDeployDialog-DHA-c9Tk.mjs.map +1 -1
  347. package/.output/server/chunks/build/useTeamDialogState-CFRUQxAf.mjs +1 -0
  348. package/.output/server/chunks/build/useTeamDialogState-CFRUQxAf.mjs.map +1 -1
  349. package/.output/server/chunks/build/useTeamPluginDialog-CDf1S9ME.mjs +1 -0
  350. package/.output/server/chunks/build/useTeamPluginDialog-CDf1S9ME.mjs.map +1 -1
  351. package/.output/server/chunks/build/useTeamsCatalog-BHP6g4ON.mjs +1 -0
  352. package/.output/server/chunks/build/useTeamsCatalog-BHP6g4ON.mjs.map +1 -1
  353. package/.output/server/chunks/build/useTokenClipboard-CwQpoFeP.mjs +1 -0
  354. package/.output/server/chunks/build/useTokenClipboard-CwQpoFeP.mjs.map +1 -1
  355. package/.output/server/chunks/build/useTokenCreate-Bl6fJXjW.mjs +1 -0
  356. package/.output/server/chunks/build/useTokenCreate-Bl6fJXjW.mjs.map +1 -1
  357. package/.output/server/chunks/build/useTokenRename-CHm_kIgW.mjs +1 -0
  358. package/.output/server/chunks/build/useTokenRename-CHm_kIgW.mjs.map +1 -1
  359. package/.output/server/chunks/build/useTokenReveal-DMRadzcq.mjs +1 -0
  360. package/.output/server/chunks/build/useTokenReveal-DMRadzcq.mjs.map +1 -1
  361. package/.output/server/chunks/build/useTokensList-DnT_Sn0Q.mjs +1 -0
  362. package/.output/server/chunks/build/useTokensList-DnT_Sn0Q.mjs.map +1 -1
  363. package/.output/server/chunks/build/useWorkbenchAuth-DgxFoSli.mjs +1 -0
  364. package/.output/server/chunks/build/useWorkbenchAuth-DgxFoSli.mjs.map +1 -1
  365. package/.output/server/chunks/build/useWorkbenchWorkspaces-BHRTd7aZ.mjs +1 -0
  366. package/.output/server/chunks/build/useWorkbenchWorkspaces-BHRTd7aZ.mjs.map +1 -1
  367. package/.output/server/chunks/build/useWorkspaceAuth-cgLRP1X_.mjs +1 -0
  368. package/.output/server/chunks/build/useWorkspaceAuth-cgLRP1X_.mjs.map +1 -1
  369. package/.output/server/chunks/build/useWorkspaceChannels-C4b7dg1J.mjs +1 -0
  370. package/.output/server/chunks/build/useWorkspaceChannels-C4b7dg1J.mjs.map +1 -1
  371. package/.output/server/chunks/build/useWorkspacePanels-ht2LWq_7.mjs +1 -0
  372. package/.output/server/chunks/build/useWorkspacePanels-ht2LWq_7.mjs.map +1 -1
  373. package/.output/server/chunks/build/useWorkspaceShell-C9rDcdde.mjs +1 -0
  374. package/.output/server/chunks/build/useWorkspaceShell-C9rDcdde.mjs.map +1 -1
  375. package/.output/server/chunks/build/users-nLXiihNX.mjs +1 -0
  376. package/.output/server/chunks/build/users-nLXiihNX.mjs.map +1 -1
  377. package/.output/server/chunks/build/workshop-DDci854s.mjs +1 -0
  378. package/.output/server/chunks/build/workshop-DDci854s.mjs.map +1 -1
  379. package/.output/server/chunks/routes/api/health.get.mjs +1 -0
  380. package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
  381. package/.output/server/chunks/routes/api/index.get.mjs +2 -1
  382. package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
  383. package/.output/server/chunks/routes/api/index.post.mjs +2 -1
  384. package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
  385. package/.output/server/chunks/routes/api/mcp/workshop.mjs +110 -12
  386. package/.output/server/chunks/routes/api/mcp/workshop.mjs.map +1 -1
  387. package/.output/server/chunks/routes/api/metrics.mjs +1 -0
  388. package/.output/server/chunks/routes/api/metrics.mjs.map +1 -1
  389. package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +1 -0
  390. package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs.map +1 -1
  391. package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs +1 -0
  392. package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs.map +1 -1
  393. package/.output/server/chunks/routes/api/plugins/i18n.get.mjs +1 -0
  394. package/.output/server/chunks/routes/api/plugins/i18n.get.mjs.map +1 -1
  395. package/.output/server/chunks/routes/api/plugins/manifest.get.mjs +1 -0
  396. package/.output/server/chunks/routes/api/plugins/manifest.get.mjs.map +1 -1
  397. package/.output/server/chunks/routes/api/system/backup/list.get.mjs +1 -0
  398. package/.output/server/chunks/routes/api/system/backup/list.get.mjs.map +1 -1
  399. package/.output/server/chunks/routes/api/system/backup/restore.post.mjs +2 -1
  400. package/.output/server/chunks/routes/api/system/backup/restore.post.mjs.map +1 -1
  401. package/.output/server/chunks/routes/api/system/backup/run.post.mjs +3 -2
  402. package/.output/server/chunks/routes/api/system/backup/run.post.mjs.map +1 -1
  403. package/.output/server/chunks/routes/api/system/config-groups/_id_.delete.mjs +1 -0
  404. package/.output/server/chunks/routes/api/system/config-groups/_id_.delete.mjs.map +1 -1
  405. package/.output/server/chunks/routes/api/system/config-groups/_id_.patch.mjs +1 -0
  406. package/.output/server/chunks/routes/api/system/config-groups/_id_.patch.mjs.map +1 -1
  407. package/.output/server/chunks/routes/api/system/config.get.mjs +1 -0
  408. package/.output/server/chunks/routes/api/system/config.get.mjs.map +1 -1
  409. package/.output/server/chunks/routes/api/system/index.get.mjs +1 -0
  410. package/.output/server/chunks/routes/api/system/index.get.mjs.map +1 -1
  411. package/.output/server/chunks/routes/api/system/index.patch.mjs +4 -3
  412. package/.output/server/chunks/routes/api/system/index.patch.mjs.map +1 -1
  413. package/.output/server/chunks/routes/api/system/index.post.mjs +1 -0
  414. package/.output/server/chunks/routes/api/system/index.post.mjs.map +1 -1
  415. package/.output/server/chunks/routes/api/system/index2.get.mjs +4 -2
  416. package/.output/server/chunks/routes/api/system/index2.get.mjs.map +1 -1
  417. package/.output/server/chunks/routes/api/system/index2.post.mjs +59 -0
  418. package/.output/server/chunks/routes/api/system/index2.post.mjs.map +1 -0
  419. package/.output/server/chunks/routes/api/system/index3.get.mjs +34 -0
  420. package/.output/server/chunks/routes/api/system/index3.get.mjs.map +1 -0
  421. package/.output/server/chunks/routes/api/system/index4.get.mjs +35 -0
  422. package/.output/server/chunks/routes/api/system/index4.get.mjs.map +1 -0
  423. package/.output/server/chunks/routes/api/system/mcp-servers/_id/discover.post.mjs +47 -0
  424. package/.output/server/chunks/routes/api/system/mcp-servers/_id/discover.post.mjs.map +1 -0
  425. package/.output/server/chunks/routes/api/system/mcp-servers/_id/review.post.mjs +57 -0
  426. package/.output/server/chunks/routes/api/system/mcp-servers/_id/review.post.mjs.map +1 -0
  427. package/.output/server/chunks/routes/api/system/mcp-servers/_id_.delete.mjs +47 -0
  428. package/.output/server/chunks/routes/api/system/mcp-servers/_id_.delete.mjs.map +1 -0
  429. package/.output/server/chunks/routes/api/system/mcp-servers/_id_.get.mjs +36 -0
  430. package/.output/server/chunks/routes/api/system/mcp-servers/_id_.get.mjs.map +1 -0
  431. package/.output/server/chunks/routes/api/system/mcp-servers/_id_.patch.mjs +59 -0
  432. package/.output/server/chunks/routes/api/system/mcp-servers/_id_.patch.mjs.map +1 -0
  433. package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs +2 -1
  434. package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs.map +1 -1
  435. package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs +2 -1
  436. package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs.map +1 -1
  437. package/.output/server/chunks/routes/api/system/monitor.get.mjs +1 -0
  438. package/.output/server/chunks/routes/api/system/monitor.get.mjs.map +1 -1
  439. package/.output/server/chunks/routes/api/system/settings/events.get.mjs +2 -1
  440. package/.output/server/chunks/routes/api/system/settings/events.get.mjs.map +1 -1
  441. package/.output/server/chunks/routes/api/system/settings/reset.post.mjs +2 -1
  442. package/.output/server/chunks/routes/api/system/settings/reset.post.mjs.map +1 -1
  443. package/.output/server/chunks/routes/api/system/shutdown.post.mjs +3 -2
  444. package/.output/server/chunks/routes/api/system/shutdown.post.mjs.map +1 -1
  445. package/.output/server/chunks/routes/api/system/skills/_id/file.get.mjs +39 -0
  446. package/.output/server/chunks/routes/api/system/skills/_id/file.get.mjs.map +1 -0
  447. package/.output/server/chunks/routes/api/system/skills/_id_.delete.mjs +49 -0
  448. package/.output/server/chunks/routes/api/system/skills/_id_.delete.mjs.map +1 -0
  449. package/.output/server/chunks/routes/api/system/skills/_id_.patch.mjs +49 -0
  450. package/.output/server/chunks/routes/api/system/skills/_id_.patch.mjs.map +1 -0
  451. package/.output/server/chunks/routes/api/system/skills/discover.get.mjs +35 -0
  452. package/.output/server/chunks/routes/api/system/skills/discover.get.mjs.map +1 -0
  453. package/.output/server/chunks/routes/api/system/skills/import.post.mjs +49 -0
  454. package/.output/server/chunks/routes/api/system/skills/import.post.mjs.map +1 -0
  455. package/.output/server/chunks/routes/api/system/timezone.get.mjs +2 -1
  456. package/.output/server/chunks/routes/api/system/timezone.get.mjs.map +1 -1
  457. package/.output/server/chunks/routes/api/users/_id_.delete.mjs +2 -1
  458. package/.output/server/chunks/routes/api/users/_id_.delete.mjs.map +1 -1
  459. package/.output/server/chunks/routes/api/users/_id_.get.mjs +2 -1
  460. package/.output/server/chunks/routes/api/users/_id_.get.mjs.map +1 -1
  461. package/.output/server/chunks/routes/api/users/_id_.put.mjs +2 -1
  462. package/.output/server/chunks/routes/api/users/_id_.put.mjs.map +1 -1
  463. package/.output/server/chunks/routes/api/users/change-password.post.mjs +2 -1
  464. package/.output/server/chunks/routes/api/users/change-password.post.mjs.map +1 -1
  465. package/.output/server/chunks/routes/api/users/index.get.mjs +2 -1
  466. package/.output/server/chunks/routes/api/users/index.get.mjs.map +1 -1
  467. package/.output/server/chunks/routes/api/users/index.post.mjs +2 -1
  468. package/.output/server/chunks/routes/api/users/index.post.mjs.map +1 -1
  469. package/.output/server/chunks/routes/api/users/login.post.mjs +2 -1
  470. package/.output/server/chunks/routes/api/users/login.post.mjs.map +1 -1
  471. package/.output/server/chunks/routes/api/users/logout.post.mjs +2 -1
  472. package/.output/server/chunks/routes/api/users/logout.post.mjs.map +1 -1
  473. package/.output/server/chunks/routes/api/users/me.get.mjs +2 -1
  474. package/.output/server/chunks/routes/api/users/me.get.mjs.map +1 -1
  475. package/.output/server/chunks/routes/api/users/register.post.mjs +2 -1
  476. package/.output/server/chunks/routes/api/users/register.post.mjs.map +1 -1
  477. package/.output/server/chunks/routes/api/users/session.delete.mjs +2 -1
  478. package/.output/server/chunks/routes/api/users/session.delete.mjs.map +1 -1
  479. package/.output/server/chunks/routes/api/users/session.get.mjs +2 -1
  480. package/.output/server/chunks/routes/api/users/session.get.mjs.map +1 -1
  481. package/.output/server/chunks/routes/api/users/session.post.mjs +2 -1
  482. package/.output/server/chunks/routes/api/users/session.post.mjs.map +1 -1
  483. package/.output/server/chunks/routes/api/users/setup-status.get.mjs +2 -1
  484. package/.output/server/chunks/routes/api/users/setup-status.get.mjs.map +1 -1
  485. package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs +2 -1
  486. package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs.map +1 -1
  487. package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs +2 -1
  488. package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs.map +1 -1
  489. package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs +2 -1
  490. package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs.map +1 -1
  491. package/.output/server/chunks/routes/api/workshop/_...path_.mjs +1 -0
  492. package/.output/server/chunks/routes/api/workshop/_...path_.mjs.map +1 -1
  493. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs +2 -1
  494. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs.map +1 -1
  495. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs +2 -1
  496. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs.map +1 -1
  497. package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs +2 -1
  498. package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs.map +1 -1
  499. package/.output/server/chunks/routes/api/workshop/agent-prefabs/_id/publish.post.mjs +48 -0
  500. package/.output/server/chunks/routes/api/workshop/agent-prefabs/_id/publish.post.mjs.map +1 -0
  501. package/.output/server/chunks/routes/api/workshop/agent-prefabs/_id/revisions/_revision_.get.mjs +49 -0
  502. package/.output/server/chunks/routes/api/workshop/agent-prefabs/_id/revisions/_revision_.get.mjs.map +1 -0
  503. package/.output/server/chunks/routes/api/workshop/agent-prefabs/_id_.get.mjs +47 -0
  504. package/.output/server/chunks/routes/api/workshop/agent-prefabs/_id_.get.mjs.map +1 -0
  505. package/.output/server/chunks/routes/api/workshop/agent-prefabs/_id_.patch.mjs +43 -0
  506. package/.output/server/chunks/routes/api/workshop/agent-prefabs/_id_.patch.mjs.map +1 -0
  507. package/.output/server/chunks/routes/api/workshop/agent-prefabs/catalog.get.mjs +42 -0
  508. package/.output/server/chunks/routes/api/workshop/agent-prefabs/catalog.get.mjs.map +1 -0
  509. package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs +2 -1
  510. package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs.map +1 -1
  511. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs +2 -1
  512. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs.map +1 -1
  513. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs +2 -1
  514. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs.map +1 -1
  515. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/grant.post.mjs +2 -1
  516. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/grant.post.mjs.map +1 -1
  517. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/revoke.post.mjs +2 -1
  518. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/revoke.post.mjs.map +1 -1
  519. package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs +2 -1
  520. package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs.map +1 -1
  521. package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +3 -2
  522. package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs.map +1 -1
  523. package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs +2 -1
  524. package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs.map +1 -1
  525. package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs +2 -1
  526. package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs.map +1 -1
  527. package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs +2 -1
  528. package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs.map +1 -1
  529. package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs +1 -0
  530. package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs.map +1 -1
  531. package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs +1 -0
  532. package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs.map +1 -1
  533. package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +2 -1
  534. package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs.map +1 -1
  535. package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs +2 -1
  536. package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs.map +1 -1
  537. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id/preview.get.mjs +2 -1
  538. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id/preview.get.mjs.map +1 -1
  539. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.delete.mjs +2 -1
  540. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.delete.mjs.map +1 -1
  541. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.get.mjs +2 -1
  542. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.get.mjs.map +1 -1
  543. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.patch.mjs +2 -1
  544. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.patch.mjs.map +1 -1
  545. package/.output/server/chunks/routes/api/workshop/aml/entities/prune.post.mjs +2 -1
  546. package/.output/server/chunks/routes/api/workshop/aml/entities/prune.post.mjs.map +1 -1
  547. package/.output/server/chunks/routes/api/workshop/aml/env/recheck.post.mjs +2 -1
  548. package/.output/server/chunks/routes/api/workshop/aml/env/recheck.post.mjs.map +1 -1
  549. package/.output/server/chunks/routes/api/workshop/aml/env/uv.post.mjs +2 -1
  550. package/.output/server/chunks/routes/api/workshop/aml/env/uv.post.mjs.map +1 -1
  551. package/.output/server/chunks/routes/api/workshop/aml/env/venv.post.mjs +2 -1
  552. package/.output/server/chunks/routes/api/workshop/aml/env/venv.post.mjs.map +1 -1
  553. package/.output/server/chunks/routes/api/workshop/aml/index.get.mjs +2 -1
  554. package/.output/server/chunks/routes/api/workshop/aml/index.get.mjs.map +1 -1
  555. package/.output/server/chunks/routes/api/workshop/aml/index.post.mjs +2 -1
  556. package/.output/server/chunks/routes/api/workshop/aml/index.post.mjs.map +1 -1
  557. package/.output/server/chunks/routes/api/workshop/aml/index2.get.mjs +1 -0
  558. package/.output/server/chunks/routes/api/workshop/aml/index2.get.mjs.map +1 -1
  559. package/.output/server/chunks/routes/api/workshop/aml/index2.post.mjs +2 -1
  560. package/.output/server/chunks/routes/api/workshop/aml/index2.post.mjs.map +1 -1
  561. package/.output/server/chunks/routes/api/workshop/aml/index3.get.mjs +2 -1
  562. package/.output/server/chunks/routes/api/workshop/aml/index3.get.mjs.map +1 -1
  563. package/.output/server/chunks/routes/api/workshop/aml/index3.post.mjs +2 -1
  564. package/.output/server/chunks/routes/api/workshop/aml/index3.post.mjs.map +1 -1
  565. package/.output/server/chunks/routes/api/workshop/aml/index4.get.mjs +2 -1
  566. package/.output/server/chunks/routes/api/workshop/aml/index4.get.mjs.map +1 -1
  567. package/.output/server/chunks/routes/api/workshop/aml/index5.get.mjs +2 -1
  568. package/.output/server/chunks/routes/api/workshop/aml/index5.get.mjs.map +1 -1
  569. package/.output/server/chunks/routes/api/workshop/aml/index6.get.mjs +2 -1
  570. package/.output/server/chunks/routes/api/workshop/aml/index6.get.mjs.map +1 -1
  571. package/.output/server/chunks/routes/api/workshop/aml/index7.get.mjs +2 -1
  572. package/.output/server/chunks/routes/api/workshop/aml/index7.get.mjs.map +1 -1
  573. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/cancel.post.mjs +2 -1
  574. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/cancel.post.mjs.map +1 -1
  575. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/logs.get.mjs +2 -1
  576. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/logs.get.mjs.map +1 -1
  577. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/retry.post.mjs +2 -1
  578. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/retry.post.mjs.map +1 -1
  579. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.delete.mjs +2 -1
  580. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.delete.mjs.map +1 -1
  581. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.get.mjs +2 -1
  582. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.get.mjs.map +1 -1
  583. package/.output/server/chunks/routes/api/workshop/aml/models/_id/predict.post.mjs +2 -1
  584. package/.output/server/chunks/routes/api/workshop/aml/models/_id/predict.post.mjs.map +1 -1
  585. package/.output/server/chunks/routes/api/workshop/aml/models/_id/promote.post.mjs +2 -1
  586. package/.output/server/chunks/routes/api/workshop/aml/models/_id/promote.post.mjs.map +1 -1
  587. package/.output/server/chunks/routes/api/workshop/aml/models/_id_.delete.mjs +2 -1
  588. package/.output/server/chunks/routes/api/workshop/aml/models/_id_.delete.mjs.map +1 -1
  589. package/.output/server/chunks/routes/api/workshop/aml/models/_id_.patch.mjs +2 -1
  590. package/.output/server/chunks/routes/api/workshop/aml/models/_id_.patch.mjs.map +1 -1
  591. package/.output/server/chunks/routes/api/workshop/aml/models/index.get.mjs +2 -1
  592. package/.output/server/chunks/routes/api/workshop/aml/models/index.get.mjs.map +1 -1
  593. package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id/train.post.mjs +2 -1
  594. package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id/train.post.mjs.map +1 -1
  595. package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id_.delete.mjs +2 -1
  596. package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id_.delete.mjs.map +1 -1
  597. package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id_.patch.mjs +2 -1
  598. package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id_.patch.mjs.map +1 -1
  599. package/.output/server/chunks/routes/api/workshop/aml/training-plans/index.get.mjs +2 -1
  600. package/.output/server/chunks/routes/api/workshop/aml/training-plans/index.get.mjs.map +1 -1
  601. package/.output/server/chunks/routes/api/workshop/aml/twin/providers.get.mjs +2 -1
  602. package/.output/server/chunks/routes/api/workshop/aml/twin/providers.get.mjs.map +1 -1
  603. package/.output/server/chunks/routes/api/workshop/analysis/_id_.delete.mjs +2 -1
  604. package/.output/server/chunks/routes/api/workshop/analysis/_id_.delete.mjs.map +1 -1
  605. package/.output/server/chunks/routes/api/workshop/analysis/_id_.get.mjs +2 -1
  606. package/.output/server/chunks/routes/api/workshop/analysis/_id_.get.mjs.map +1 -1
  607. package/.output/server/chunks/routes/api/workshop/analysis/_id_.patch.mjs +2 -1
  608. package/.output/server/chunks/routes/api/workshop/analysis/_id_.patch.mjs.map +1 -1
  609. package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs +2 -1
  610. package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs.map +1 -1
  611. package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs +1 -0
  612. package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs.map +1 -1
  613. package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs +2 -1
  614. package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs.map +1 -1
  615. package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs +1 -0
  616. package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs.map +1 -1
  617. package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs +2 -1
  618. package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs.map +1 -1
  619. package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs +1 -0
  620. package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs.map +1 -1
  621. package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +2 -1
  622. package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs.map +1 -1
  623. package/.output/server/chunks/routes/api/workshop/audit.get.mjs +1 -0
  624. package/.output/server/chunks/routes/api/workshop/audit.get.mjs.map +1 -1
  625. package/.output/server/chunks/routes/api/workshop/caller.mjs +2 -1
  626. package/.output/server/chunks/routes/api/workshop/caller.mjs.map +1 -1
  627. package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +3 -2
  628. package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs.map +1 -1
  629. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs +1 -0
  630. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs.map +1 -1
  631. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs +1 -0
  632. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs.map +1 -1
  633. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +2 -1
  634. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs.map +1 -1
  635. package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.mjs +2 -1
  636. package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.mjs.map +1 -1
  637. package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs +2 -1
  638. package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs.map +1 -1
  639. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs +1 -0
  640. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs.map +1 -1
  641. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs +2 -1
  642. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs.map +1 -1
  643. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs +1 -0
  644. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs.map +1 -1
  645. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs +2 -1
  646. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs.map +1 -1
  647. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs +1 -0
  648. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs.map +1 -1
  649. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs +1 -0
  650. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs.map +1 -1
  651. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/prefab.patch.mjs +59 -0
  652. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/prefab.patch.mjs.map +1 -0
  653. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs +1 -0
  654. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs.map +1 -1
  655. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/rotate-token.post.mjs +2 -1
  656. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/rotate-token.post.mjs.map +1 -1
  657. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs +1 -0
  658. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs.map +1 -1
  659. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs +1 -0
  660. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs.map +1 -1
  661. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +2 -1
  662. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs.map +1 -1
  663. package/.output/server/chunks/routes/api/workshop/channels/_id/chat/index.get.mjs +1 -0
  664. package/.output/server/chunks/routes/api/workshop/channels/_id/chat/index.get.mjs.map +1 -1
  665. package/.output/server/chunks/routes/api/workshop/channels/_id/chat/index.post.mjs +2 -1
  666. package/.output/server/chunks/routes/api/workshop/channels/_id/chat/index.post.mjs.map +1 -1
  667. package/.output/server/chunks/routes/api/workshop/channels/_id/chat/messages/_messageId/read.post.mjs +1 -0
  668. package/.output/server/chunks/routes/api/workshop/channels/_id/chat/messages/_messageId/read.post.mjs.map +1 -1
  669. package/.output/server/chunks/routes/api/workshop/channels/_id/chat/permissions.get.mjs +1 -0
  670. package/.output/server/chunks/routes/api/workshop/channels/_id/chat/permissions.get.mjs.map +1 -1
  671. package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs +2 -1
  672. package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs.map +1 -1
  673. package/.output/server/chunks/routes/api/workshop/channels/_id/execution-mode.patch.mjs +2 -1
  674. package/.output/server/chunks/routes/api/workshop/channels/_id/execution-mode.patch.mjs.map +1 -1
  675. package/.output/server/chunks/routes/api/workshop/channels/_id/harness-profiles/promote.post.mjs +2 -1
  676. package/.output/server/chunks/routes/api/workshop/channels/_id/harness-profiles/promote.post.mjs.map +1 -1
  677. package/.output/server/chunks/routes/api/workshop/channels/_id/improvement-proposals/decide.post.mjs +2 -1
  678. package/.output/server/chunks/routes/api/workshop/channels/_id/improvement-proposals/decide.post.mjs.map +1 -1
  679. package/.output/server/chunks/routes/api/workshop/channels/_id/improvement-stats.get.mjs +1 -0
  680. package/.output/server/chunks/routes/api/workshop/channels/_id/improvement-stats.get.mjs.map +1 -1
  681. package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs +1 -0
  682. package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs.map +1 -1
  683. package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +2 -1
  684. package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs.map +1 -1
  685. package/.output/server/chunks/routes/api/workshop/channels/_id/index.put.mjs +2 -1
  686. package/.output/server/chunks/routes/api/workshop/channels/_id/index.put.mjs.map +1 -1
  687. package/.output/server/chunks/routes/api/workshop/channels/_id/index10.get.mjs +1 -0
  688. package/.output/server/chunks/routes/api/workshop/channels/_id/index10.get.mjs.map +1 -1
  689. package/.output/server/chunks/routes/api/workshop/channels/_id/index11.get.mjs +2 -1
  690. package/.output/server/chunks/routes/api/workshop/channels/_id/index11.get.mjs.map +1 -1
  691. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +2 -1
  692. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs.map +1 -1
  693. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs +2 -1
  694. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs.map +1 -1
  695. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.put.mjs +2 -1
  696. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.put.mjs.map +1 -1
  697. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs +2 -1
  698. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs.map +1 -1
  699. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs +2 -1
  700. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs.map +1 -1
  701. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs +1 -0
  702. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs.map +1 -1
  703. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs +2 -1
  704. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs.map +1 -1
  705. package/.output/server/chunks/routes/api/workshop/channels/_id/index5.get.mjs +1 -0
  706. package/.output/server/chunks/routes/api/workshop/channels/_id/index5.get.mjs.map +1 -1
  707. package/.output/server/chunks/routes/api/workshop/channels/_id/index5.post.mjs +2 -1
  708. package/.output/server/chunks/routes/api/workshop/channels/_id/index5.post.mjs.map +1 -1
  709. package/.output/server/chunks/routes/api/workshop/channels/_id/index6.get.mjs +2 -1
  710. package/.output/server/chunks/routes/api/workshop/channels/_id/index6.get.mjs.map +1 -1
  711. package/.output/server/chunks/routes/api/workshop/channels/_id/index6.post.mjs +2 -1
  712. package/.output/server/chunks/routes/api/workshop/channels/_id/index6.post.mjs.map +1 -1
  713. package/.output/server/chunks/routes/api/workshop/channels/_id/index7.get.mjs +2 -1
  714. package/.output/server/chunks/routes/api/workshop/channels/_id/index7.get.mjs.map +1 -1
  715. package/.output/server/chunks/routes/api/workshop/channels/_id/index7.post.mjs +2 -1
  716. package/.output/server/chunks/routes/api/workshop/channels/_id/index7.post.mjs.map +1 -1
  717. package/.output/server/chunks/routes/api/workshop/channels/_id/index8.get.mjs +1 -0
  718. package/.output/server/chunks/routes/api/workshop/channels/_id/index8.get.mjs.map +1 -1
  719. package/.output/server/chunks/routes/api/workshop/channels/_id/index9.get.mjs +1 -0
  720. package/.output/server/chunks/routes/api/workshop/channels/_id/index9.get.mjs.map +1 -1
  721. package/.output/server/chunks/routes/api/workshop/channels/_id/line.put.mjs +2 -1
  722. package/.output/server/chunks/routes/api/workshop/channels/_id/line.put.mjs.map +1 -1
  723. package/.output/server/chunks/routes/api/workshop/channels/_id/members/_userId/approve.post.mjs +1 -0
  724. package/.output/server/chunks/routes/api/workshop/channels/_id/members/_userId/approve.post.mjs.map +1 -1
  725. package/.output/server/chunks/routes/api/workshop/channels/_id/members/_userId_.delete.mjs +1 -0
  726. package/.output/server/chunks/routes/api/workshop/channels/_id/members/_userId_.delete.mjs.map +1 -1
  727. package/.output/server/chunks/routes/api/workshop/channels/_id/members/join.post.mjs +2 -1
  728. package/.output/server/chunks/routes/api/workshop/channels/_id/members/join.post.mjs.map +1 -1
  729. package/.output/server/chunks/routes/api/workshop/channels/_id/members/leave.post.mjs +1 -0
  730. package/.output/server/chunks/routes/api/workshop/channels/_id/members/leave.post.mjs.map +1 -1
  731. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId/experience.get.mjs +69 -0
  732. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId/experience.get.mjs.map +1 -0
  733. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId/promote.post.mjs +2 -1
  734. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId/promote.post.mjs.map +1 -1
  735. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs +1 -0
  736. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs.map +1 -1
  737. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/experience-stats.get.mjs +1 -0
  738. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/experience-stats.get.mjs.map +1 -1
  739. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/merge.post.mjs +2 -1
  740. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/merge.post.mjs.map +1 -1
  741. package/.output/server/chunks/routes/api/workshop/channels/_id/products.get.mjs +2 -1
  742. package/.output/server/chunks/routes/api/workshop/channels/_id/products.get.mjs.map +1 -1
  743. package/.output/server/chunks/routes/api/workshop/channels/_id/products.put.mjs +2 -1
  744. package/.output/server/chunks/routes/api/workshop/channels/_id/products.put.mjs.map +1 -1
  745. package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs +1 -0
  746. package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs.map +1 -1
  747. package/.output/server/chunks/routes/api/workshop/channels/_id/rescue.post.mjs +1 -0
  748. package/.output/server/chunks/routes/api/workshop/channels/_id/rescue.post.mjs.map +1 -1
  749. package/.output/server/chunks/routes/api/workshop/channels/_id/sessions/_sid/brief.get.mjs +1 -0
  750. package/.output/server/chunks/routes/api/workshop/channels/_id/sessions/_sid/brief.get.mjs.map +1 -1
  751. package/.output/server/chunks/routes/api/workshop/channels/_id/sessions/_sid/close.post.mjs +2 -1
  752. package/.output/server/chunks/routes/api/workshop/channels/_id/sessions/_sid/close.post.mjs.map +1 -1
  753. package/.output/server/chunks/routes/api/workshop/channels/_id/sessions/_sid/history.get.mjs +1 -0
  754. package/.output/server/chunks/routes/api/workshop/channels/_id/sessions/_sid/history.get.mjs.map +1 -1
  755. package/.output/server/chunks/routes/api/workshop/channels/_id/sessions/_sid/messages.post.mjs +2 -1
  756. package/.output/server/chunks/routes/api/workshop/channels/_id/sessions/_sid/messages.post.mjs.map +1 -1
  757. package/.output/server/chunks/routes/api/workshop/channels/_id/sessions/index.get.mjs +1 -0
  758. package/.output/server/chunks/routes/api/workshop/channels/_id/sessions/index.get.mjs.map +1 -1
  759. package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +2 -1
  760. package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs.map +1 -1
  761. package/.output/server/chunks/routes/api/workshop/channels/_id/tool-usage.get.mjs +2 -1
  762. package/.output/server/chunks/routes/api/workshop/channels/_id/tool-usage.get.mjs.map +1 -1
  763. package/.output/server/chunks/routes/api/workshop/channels/_id/tools/reset.post.mjs +2 -1
  764. package/.output/server/chunks/routes/api/workshop/channels/_id/tools/reset.post.mjs.map +1 -1
  765. package/.output/server/chunks/routes/api/workshop/channels/_id/twin-profile.get.mjs +2 -1
  766. package/.output/server/chunks/routes/api/workshop/channels/_id/twin-profile.get.mjs.map +1 -1
  767. package/.output/server/chunks/routes/api/workshop/channels/_id/twin-profile.patch.mjs +2 -1
  768. package/.output/server/chunks/routes/api/workshop/channels/_id/twin-profile.patch.mjs.map +1 -1
  769. package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs +2 -1
  770. package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs.map +1 -1
  771. package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +2 -1
  772. package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs.map +1 -1
  773. package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +3 -2
  774. package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs.map +1 -1
  775. package/.output/server/chunks/routes/api/workshop/channels.get.mjs +1 -0
  776. package/.output/server/chunks/routes/api/workshop/channels.get.mjs.map +1 -1
  777. package/.output/server/chunks/routes/api/workshop/channels.post.mjs +8 -7
  778. package/.output/server/chunks/routes/api/workshop/channels.post.mjs.map +1 -1
  779. package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +2 -1
  780. package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs.map +1 -1
  781. package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs +2 -1
  782. package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs.map +1 -1
  783. package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +2 -1
  784. package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs.map +1 -1
  785. package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +2 -1
  786. package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs.map +1 -1
  787. package/.output/server/chunks/routes/api/workshop/daq/_id/ingest.post.mjs +3 -2
  788. package/.output/server/chunks/routes/api/workshop/daq/_id/ingest.post.mjs.map +1 -1
  789. package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +2 -1
  790. package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs.map +1 -1
  791. package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs +2 -1
  792. package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs.map +1 -1
  793. package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +2 -1
  794. package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs.map +1 -1
  795. package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +2 -1
  796. package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs.map +1 -1
  797. package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +2 -1
  798. package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs.map +1 -1
  799. package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs +2 -1
  800. package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs.map +1 -1
  801. package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +2 -1
  802. package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs.map +1 -1
  803. package/.output/server/chunks/routes/api/workshop/daq/export/_id_.get.mjs +2 -1
  804. package/.output/server/chunks/routes/api/workshop/daq/export/_id_.get.mjs.map +1 -1
  805. package/.output/server/chunks/routes/api/workshop/daq/export-file.get.mjs +1 -0
  806. package/.output/server/chunks/routes/api/workshop/daq/export-file.get.mjs.map +1 -1
  807. package/.output/server/chunks/routes/api/workshop/daq/index.get.mjs +2 -1
  808. package/.output/server/chunks/routes/api/workshop/daq/index.get.mjs.map +1 -1
  809. package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs +1 -0
  810. package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs.map +1 -1
  811. package/.output/server/chunks/routes/api/workshop/daq/index2.get.mjs +1 -0
  812. package/.output/server/chunks/routes/api/workshop/daq/index2.get.mjs.map +1 -1
  813. package/.output/server/chunks/routes/api/workshop/daq/index2.post.mjs +2 -1
  814. package/.output/server/chunks/routes/api/workshop/daq/index2.post.mjs.map +1 -1
  815. package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +2 -1
  816. package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs.map +1 -1
  817. package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +1 -0
  818. package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs.map +1 -1
  819. package/.output/server/chunks/routes/api/workshop/daq/query.get.mjs +2 -1
  820. package/.output/server/chunks/routes/api/workshop/daq/query.get.mjs.map +1 -1
  821. package/.output/server/chunks/routes/api/workshop/daq/storage/retention.put.mjs +2 -1
  822. package/.output/server/chunks/routes/api/workshop/daq/storage/retention.put.mjs.map +1 -1
  823. package/.output/server/chunks/routes/api/workshop/daq/storage/rollup.post.mjs +2 -1
  824. package/.output/server/chunks/routes/api/workshop/daq/storage/rollup.post.mjs.map +1 -1
  825. package/.output/server/chunks/routes/api/workshop/daq/storage.get.mjs +2 -1
  826. package/.output/server/chunks/routes/api/workshop/daq/storage.get.mjs.map +1 -1
  827. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +2 -1
  828. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs.map +1 -1
  829. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +2 -1
  830. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs.map +1 -1
  831. package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +2 -1
  832. package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs.map +1 -1
  833. package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +2 -1
  834. package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs.map +1 -1
  835. package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs +2 -1
  836. package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs.map +1 -1
  837. package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +2 -1
  838. package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs.map +1 -1
  839. package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +2 -1
  840. package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs.map +1 -1
  841. package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +2 -1
  842. package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs.map +1 -1
  843. package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +2 -1
  844. package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs.map +1 -1
  845. package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +2 -1
  846. package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs.map +1 -1
  847. package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +2 -1
  848. package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs.map +1 -1
  849. package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +2 -1
  850. package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs.map +1 -1
  851. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +2 -1
  852. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs.map +1 -1
  853. package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +2 -1
  854. package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs.map +1 -1
  855. package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +2 -1
  856. package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs.map +1 -1
  857. package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +2 -1
  858. package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs.map +1 -1
  859. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +2 -1
  860. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs.map +1 -1
  861. package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +2 -1
  862. package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs.map +1 -1
  863. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +2 -1
  864. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs.map +1 -1
  865. package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +2 -1
  866. package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs.map +1 -1
  867. package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +2 -1
  868. package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs.map +1 -1
  869. package/.output/server/chunks/routes/api/workshop/dcw/index5.post.mjs +2 -1
  870. package/.output/server/chunks/routes/api/workshop/dcw/index5.post.mjs.map +1 -1
  871. package/.output/server/chunks/routes/api/workshop/dcw/index6.get.mjs +2 -1
  872. package/.output/server/chunks/routes/api/workshop/dcw/index6.get.mjs.map +1 -1
  873. package/.output/server/chunks/routes/api/workshop/dcw/index7.get.mjs +2 -1
  874. package/.output/server/chunks/routes/api/workshop/dcw/index7.get.mjs.map +1 -1
  875. package/.output/server/chunks/routes/api/workshop/dcw/index8.get.mjs +2 -1
  876. package/.output/server/chunks/routes/api/workshop/dcw/index8.get.mjs.map +1 -1
  877. package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +2 -1
  878. package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs.map +1 -1
  879. package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +2 -1
  880. package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs.map +1 -1
  881. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +2 -1
  882. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs.map +1 -1
  883. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +2 -1
  884. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs.map +1 -1
  885. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +2 -1
  886. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs.map +1 -1
  887. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs +2 -1
  888. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs.map +1 -1
  889. package/.output/server/chunks/routes/api/workshop/dcw/lines/index.get.mjs +2 -1
  890. package/.output/server/chunks/routes/api/workshop/dcw/lines/index.get.mjs.map +1 -1
  891. package/.output/server/chunks/routes/api/workshop/dcw/mes-artifacts/file.get.mjs +2 -1
  892. package/.output/server/chunks/routes/api/workshop/dcw/mes-artifacts/file.get.mjs.map +1 -1
  893. package/.output/server/chunks/routes/api/workshop/dcw/mes-hook-test.post.mjs +2 -1
  894. package/.output/server/chunks/routes/api/workshop/dcw/mes-hook-test.post.mjs.map +1 -1
  895. package/.output/server/chunks/routes/api/workshop/dcw/mes-test-read.post.mjs +2 -1
  896. package/.output/server/chunks/routes/api/workshop/dcw/mes-test-read.post.mjs.map +1 -1
  897. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +2 -1
  898. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs.map +1 -1
  899. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +2 -1
  900. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs.map +1 -1
  901. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +2 -1
  902. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs.map +1 -1
  903. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +2 -1
  904. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs.map +1 -1
  905. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/read.post.mjs +2 -1
  906. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/read.post.mjs.map +1 -1
  907. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/write.post.mjs +2 -1
  908. package/.output/server/chunks/routes/api/workshop/dcw/params/_id/write.post.mjs.map +1 -1
  909. package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.delete.mjs +2 -1
  910. package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.delete.mjs.map +1 -1
  911. package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.patch.mjs +2 -1
  912. package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.patch.mjs.map +1 -1
  913. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +2 -1
  914. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs.map +1 -1
  915. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +2 -1
  916. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs.map +1 -1
  917. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +2 -1
  918. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs.map +1 -1
  919. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +2 -1
  920. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs.map +1 -1
  921. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/revert.post.mjs +2 -1
  922. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/revert.post.mjs.map +1 -1
  923. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +2 -1
  924. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs.map +1 -1
  925. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/versions.get.mjs +2 -1
  926. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/versions.get.mjs.map +1 -1
  927. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +3 -2
  928. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs.map +1 -1
  929. package/.output/server/chunks/routes/api/workshop/dcw/recipes/index.patch.mjs +2 -1
  930. package/.output/server/chunks/routes/api/workshop/dcw/recipes/index.patch.mjs.map +1 -1
  931. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +2 -1
  932. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs.map +1 -1
  933. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +2 -1
  934. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs.map +1 -1
  935. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +2 -1
  936. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs.map +1 -1
  937. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +2 -1
  938. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs.map +1 -1
  939. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +2 -1
  940. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs.map +1 -1
  941. package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +2 -1
  942. package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs.map +1 -1
  943. package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +2 -1
  944. package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs.map +1 -1
  945. package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +2 -1
  946. package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs.map +1 -1
  947. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +2 -1
  948. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs.map +1 -1
  949. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +2 -1
  950. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs.map +1 -1
  951. package/.output/server/chunks/routes/api/workshop/eda/charts/_id_.delete.mjs +1 -0
  952. package/.output/server/chunks/routes/api/workshop/eda/charts/_id_.delete.mjs.map +1 -1
  953. package/.output/server/chunks/routes/api/workshop/eda/charts/_id_.get.mjs +1 -0
  954. package/.output/server/chunks/routes/api/workshop/eda/charts/_id_.get.mjs.map +1 -1
  955. package/.output/server/chunks/routes/api/workshop/eda/charts/_id_.patch.mjs +1 -0
  956. package/.output/server/chunks/routes/api/workshop/eda/charts/_id_.patch.mjs.map +1 -1
  957. package/.output/server/chunks/routes/api/workshop/eda/commonality.get.mjs +2 -1
  958. package/.output/server/chunks/routes/api/workshop/eda/commonality.get.mjs.map +1 -1
  959. package/.output/server/chunks/routes/api/workshop/eda/dashboards/_id_.delete.mjs +1 -0
  960. package/.output/server/chunks/routes/api/workshop/eda/dashboards/_id_.delete.mjs.map +1 -1
  961. package/.output/server/chunks/routes/api/workshop/eda/dashboards/_id_.get.mjs +1 -0
  962. package/.output/server/chunks/routes/api/workshop/eda/dashboards/_id_.get.mjs.map +1 -1
  963. package/.output/server/chunks/routes/api/workshop/eda/dashboards/_id_.patch.mjs +1 -0
  964. package/.output/server/chunks/routes/api/workshop/eda/dashboards/_id_.patch.mjs.map +1 -1
  965. package/.output/server/chunks/routes/api/workshop/eda/features/jobs.get.mjs +1 -0
  966. package/.output/server/chunks/routes/api/workshop/eda/features/jobs.get.mjs.map +1 -1
  967. package/.output/server/chunks/routes/api/workshop/eda/features/run.post.mjs +2 -1
  968. package/.output/server/chunks/routes/api/workshop/eda/features/run.post.mjs.map +1 -1
  969. package/.output/server/chunks/routes/api/workshop/eda/golden/_id_.delete.mjs +1 -0
  970. package/.output/server/chunks/routes/api/workshop/eda/golden/_id_.delete.mjs.map +1 -1
  971. package/.output/server/chunks/routes/api/workshop/eda/golden/deviation.get.mjs +1 -0
  972. package/.output/server/chunks/routes/api/workshop/eda/golden/deviation.get.mjs.map +1 -1
  973. package/.output/server/chunks/routes/api/workshop/eda/golden/single.get.mjs +1 -0
  974. package/.output/server/chunks/routes/api/workshop/eda/golden/single.get.mjs.map +1 -1
  975. package/.output/server/chunks/routes/api/workshop/eda/index.get.mjs +1 -0
  976. package/.output/server/chunks/routes/api/workshop/eda/index.get.mjs.map +1 -1
  977. package/.output/server/chunks/routes/api/workshop/eda/index.post.mjs +1 -0
  978. package/.output/server/chunks/routes/api/workshop/eda/index.post.mjs.map +1 -1
  979. package/.output/server/chunks/routes/api/workshop/eda/index2.get.mjs +1 -0
  980. package/.output/server/chunks/routes/api/workshop/eda/index2.get.mjs.map +1 -1
  981. package/.output/server/chunks/routes/api/workshop/eda/index2.post.mjs +1 -0
  982. package/.output/server/chunks/routes/api/workshop/eda/index2.post.mjs.map +1 -1
  983. package/.output/server/chunks/routes/api/workshop/eda/index3.get.mjs +2 -1
  984. package/.output/server/chunks/routes/api/workshop/eda/index3.get.mjs.map +1 -1
  985. package/.output/server/chunks/routes/api/workshop/eda/index3.post.mjs +2 -1
  986. package/.output/server/chunks/routes/api/workshop/eda/index3.post.mjs.map +1 -1
  987. package/.output/server/chunks/routes/api/workshop/eda/index4.get.mjs +1 -0
  988. package/.output/server/chunks/routes/api/workshop/eda/index4.get.mjs.map +1 -1
  989. package/.output/server/chunks/routes/api/workshop/eda/index4.post.mjs +1 -0
  990. package/.output/server/chunks/routes/api/workshop/eda/index4.post.mjs.map +1 -1
  991. package/.output/server/chunks/routes/api/workshop/eda/index5.get.mjs +1 -0
  992. package/.output/server/chunks/routes/api/workshop/eda/index5.get.mjs.map +1 -1
  993. package/.output/server/chunks/routes/api/workshop/eda/index5.post.mjs +1 -0
  994. package/.output/server/chunks/routes/api/workshop/eda/index5.post.mjs.map +1 -1
  995. package/.output/server/chunks/routes/api/workshop/eda/index6.get.mjs +2 -1
  996. package/.output/server/chunks/routes/api/workshop/eda/index6.get.mjs.map +1 -1
  997. package/.output/server/chunks/routes/api/workshop/eda/index6.post.mjs +2 -1
  998. package/.output/server/chunks/routes/api/workshop/eda/index6.post.mjs.map +1 -1
  999. package/.output/server/chunks/routes/api/workshop/eda/index7.get.mjs +1 -0
  1000. package/.output/server/chunks/routes/api/workshop/eda/index7.get.mjs.map +1 -1
  1001. package/.output/server/chunks/routes/api/workshop/eda/index7.post.mjs +1 -0
  1002. package/.output/server/chunks/routes/api/workshop/eda/index7.post.mjs.map +1 -1
  1003. package/.output/server/chunks/routes/api/workshop/eda/index8.get.mjs +1 -0
  1004. package/.output/server/chunks/routes/api/workshop/eda/index8.get.mjs.map +1 -1
  1005. package/.output/server/chunks/routes/api/workshop/eda/index8.post.mjs +1 -0
  1006. package/.output/server/chunks/routes/api/workshop/eda/index8.post.mjs.map +1 -1
  1007. package/.output/server/chunks/routes/api/workshop/eda/ocap/_id_.get.mjs +1 -0
  1008. package/.output/server/chunks/routes/api/workshop/eda/ocap/_id_.get.mjs.map +1 -1
  1009. package/.output/server/chunks/routes/api/workshop/eda/ocap/_id_.patch.mjs +1 -0
  1010. package/.output/server/chunks/routes/api/workshop/eda/ocap/_id_.patch.mjs.map +1 -1
  1011. package/.output/server/chunks/routes/api/workshop/eda/runs/_id/labels.patch.mjs +2 -1
  1012. package/.output/server/chunks/routes/api/workshop/eda/runs/_id/labels.patch.mjs.map +1 -1
  1013. package/.output/server/chunks/routes/api/workshop/eda/runs.get.mjs +2 -1
  1014. package/.output/server/chunks/routes/api/workshop/eda/runs.get.mjs.map +1 -1
  1015. package/.output/server/chunks/routes/api/workshop/eda/spc/_id/recompute.post.mjs +1 -0
  1016. package/.output/server/chunks/routes/api/workshop/eda/spc/_id/recompute.post.mjs.map +1 -1
  1017. package/.output/server/chunks/routes/api/workshop/eda/spc/_id_.delete.mjs +1 -0
  1018. package/.output/server/chunks/routes/api/workshop/eda/spc/_id_.delete.mjs.map +1 -1
  1019. package/.output/server/chunks/routes/api/workshop/eda/spc/_id_.get.mjs +1 -0
  1020. package/.output/server/chunks/routes/api/workshop/eda/spc/_id_.get.mjs.map +1 -1
  1021. package/.output/server/chunks/routes/api/workshop/eda/templates/_id_.delete.mjs +1 -0
  1022. package/.output/server/chunks/routes/api/workshop/eda/templates/_id_.delete.mjs.map +1 -1
  1023. package/.output/server/chunks/routes/api/workshop/eda/templates/_id_.get.mjs +1 -0
  1024. package/.output/server/chunks/routes/api/workshop/eda/templates/_id_.get.mjs.map +1 -1
  1025. package/.output/server/chunks/routes/api/workshop/eda/templates/_id_.patch.mjs +1 -0
  1026. package/.output/server/chunks/routes/api/workshop/eda/templates/_id_.patch.mjs.map +1 -1
  1027. package/.output/server/chunks/routes/api/workshop/eda/vm/predict.post.mjs +2 -1
  1028. package/.output/server/chunks/routes/api/workshop/eda/vm/predict.post.mjs.map +1 -1
  1029. package/.output/server/chunks/routes/api/workshop/exp/confirmations/_id/decide.post.mjs +2 -1
  1030. package/.output/server/chunks/routes/api/workshop/exp/confirmations/_id/decide.post.mjs.map +1 -1
  1031. package/.output/server/chunks/routes/api/workshop/exp/index.get.mjs +2 -1
  1032. package/.output/server/chunks/routes/api/workshop/exp/index.get.mjs.map +1 -1
  1033. package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +2 -1
  1034. package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs.map +1 -1
  1035. package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +2 -1
  1036. package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs.map +1 -1
  1037. package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +2 -1
  1038. package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs.map +1 -1
  1039. package/.output/server/chunks/routes/api/workshop/hitl/history.get.mjs +2 -1
  1040. package/.output/server/chunks/routes/api/workshop/hitl/history.get.mjs.map +1 -1
  1041. package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +2 -1
  1042. package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs.map +1 -1
  1043. package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +2 -1
  1044. package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs.map +1 -1
  1045. package/.output/server/chunks/routes/api/workshop/index.get.mjs +15 -5
  1046. package/.output/server/chunks/routes/api/workshop/index.get.mjs.map +1 -1
  1047. package/.output/server/chunks/routes/api/workshop/index.mjs +2 -1
  1048. package/.output/server/chunks/routes/api/workshop/index.mjs.map +1 -1
  1049. package/.output/server/chunks/routes/api/workshop/index.post.mjs +9 -17
  1050. package/.output/server/chunks/routes/api/workshop/index.post.mjs.map +1 -1
  1051. package/.output/server/chunks/routes/api/workshop/index.put.mjs +2 -1
  1052. package/.output/server/chunks/routes/api/workshop/index.put.mjs.map +1 -1
  1053. package/.output/server/chunks/routes/api/workshop/index10.get.mjs +41 -37
  1054. package/.output/server/chunks/routes/api/workshop/index10.get.mjs.map +1 -1
  1055. package/.output/server/chunks/routes/api/workshop/index10.post.mjs +22 -14
  1056. package/.output/server/chunks/routes/api/workshop/index10.post.mjs.map +1 -1
  1057. package/.output/server/chunks/routes/api/workshop/index11.get.mjs +38 -23
  1058. package/.output/server/chunks/routes/api/workshop/index11.get.mjs.map +1 -1
  1059. package/.output/server/chunks/routes/api/workshop/index11.post.mjs +14 -15
  1060. package/.output/server/chunks/routes/api/workshop/index11.post.mjs.map +1 -1
  1061. package/.output/server/chunks/routes/api/workshop/index12.get.mjs +24 -27
  1062. package/.output/server/chunks/routes/api/workshop/index12.get.mjs.map +1 -1
  1063. package/.output/server/chunks/routes/api/workshop/index12.post.mjs +19 -4
  1064. package/.output/server/chunks/routes/api/workshop/index12.post.mjs.map +1 -1
  1065. package/.output/server/chunks/routes/api/workshop/index13.get.mjs +27 -17
  1066. package/.output/server/chunks/routes/api/workshop/index13.get.mjs.map +1 -1
  1067. package/.output/server/chunks/routes/api/workshop/index13.post.mjs +36 -0
  1068. package/.output/server/chunks/routes/api/workshop/index13.post.mjs.map +1 -0
  1069. package/.output/server/chunks/routes/api/workshop/index14.get.mjs +18 -2
  1070. package/.output/server/chunks/routes/api/workshop/index14.get.mjs.map +1 -1
  1071. package/.output/server/chunks/routes/api/workshop/index15.get.mjs +3 -2
  1072. package/.output/server/chunks/routes/api/workshop/index15.get.mjs.map +1 -1
  1073. package/.output/server/chunks/routes/api/workshop/index16.get.mjs +3 -3
  1074. package/.output/server/chunks/routes/api/workshop/index16.get.mjs.map +1 -1
  1075. package/.output/server/chunks/routes/api/workshop/index17.get.mjs +6 -5
  1076. package/.output/server/chunks/routes/api/workshop/index17.get.mjs.map +1 -1
  1077. package/.output/server/chunks/routes/api/workshop/index18.get.mjs +6 -4
  1078. package/.output/server/chunks/routes/api/workshop/index18.get.mjs.map +1 -1
  1079. package/.output/server/chunks/routes/api/workshop/index19.get.mjs +34 -0
  1080. package/.output/server/chunks/routes/api/workshop/index19.get.mjs.map +1 -0
  1081. package/.output/server/chunks/routes/api/workshop/index2.get.mjs +6 -26
  1082. package/.output/server/chunks/routes/api/workshop/index2.get.mjs.map +1 -1
  1083. package/.output/server/chunks/routes/api/workshop/index2.post.mjs +18 -58
  1084. package/.output/server/chunks/routes/api/workshop/index2.post.mjs.map +1 -1
  1085. package/.output/server/chunks/routes/api/workshop/index3.get.mjs +24 -23
  1086. package/.output/server/chunks/routes/api/workshop/index3.get.mjs.map +1 -1
  1087. package/.output/server/chunks/routes/api/workshop/index3.post.mjs +59 -50
  1088. package/.output/server/chunks/routes/api/workshop/index3.post.mjs.map +1 -1
  1089. package/.output/server/chunks/routes/api/workshop/index4.get.mjs +25 -9
  1090. package/.output/server/chunks/routes/api/workshop/index4.get.mjs.map +1 -1
  1091. package/.output/server/chunks/routes/api/workshop/index4.post.mjs +50 -253
  1092. package/.output/server/chunks/routes/api/workshop/index4.post.mjs.map +1 -1
  1093. package/.output/server/chunks/routes/api/workshop/index5.get.mjs +11 -4
  1094. package/.output/server/chunks/routes/api/workshop/index5.get.mjs.map +1 -1
  1095. package/.output/server/chunks/routes/api/workshop/index5.post.mjs +239 -13
  1096. package/.output/server/chunks/routes/api/workshop/index5.post.mjs.map +1 -1
  1097. package/.output/server/chunks/routes/api/workshop/index6.get.mjs +5 -29
  1098. package/.output/server/chunks/routes/api/workshop/index6.get.mjs.map +1 -1
  1099. package/.output/server/chunks/routes/api/workshop/index6.post.mjs +30 -19
  1100. package/.output/server/chunks/routes/api/workshop/index6.post.mjs.map +1 -1
  1101. package/.output/server/chunks/routes/api/workshop/index7.get.mjs +26 -22
  1102. package/.output/server/chunks/routes/api/workshop/index7.get.mjs.map +1 -1
  1103. package/.output/server/chunks/routes/api/workshop/index7.post.mjs +19 -56
  1104. package/.output/server/chunks/routes/api/workshop/index7.post.mjs.map +1 -1
  1105. package/.output/server/chunks/routes/api/workshop/index8.get.mjs +27 -5
  1106. package/.output/server/chunks/routes/api/workshop/index8.get.mjs.map +1 -1
  1107. package/.output/server/chunks/routes/api/workshop/index8.post.mjs +58 -32
  1108. package/.output/server/chunks/routes/api/workshop/index8.post.mjs.map +1 -1
  1109. package/.output/server/chunks/routes/api/workshop/index9.get.mjs +5 -39
  1110. package/.output/server/chunks/routes/api/workshop/index9.get.mjs.map +1 -1
  1111. package/.output/server/chunks/routes/api/workshop/index9.post.mjs +28 -19
  1112. package/.output/server/chunks/routes/api/workshop/index9.post.mjs.map +1 -1
  1113. package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs +1 -0
  1114. package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs.map +1 -1
  1115. package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs +1 -0
  1116. package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs.map +1 -1
  1117. package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs +1 -0
  1118. package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs.map +1 -1
  1119. package/.output/server/chunks/routes/api/workshop/mes/bridge.post.mjs +2 -1
  1120. package/.output/server/chunks/routes/api/workshop/mes/bridge.post.mjs.map +1 -1
  1121. package/.output/server/chunks/routes/api/workshop/mes/datasets.get.mjs +2 -1
  1122. package/.output/server/chunks/routes/api/workshop/mes/datasets.get.mjs.map +1 -1
  1123. package/.output/server/chunks/routes/api/workshop/mes/index.get.mjs +1 -0
  1124. package/.output/server/chunks/routes/api/workshop/mes/index.get.mjs.map +1 -1
  1125. package/.output/server/chunks/routes/api/workshop/mes/index.put.mjs +2 -1
  1126. package/.output/server/chunks/routes/api/workshop/mes/index.put.mjs.map +1 -1
  1127. package/.output/server/chunks/routes/api/workshop/mes/points.get.mjs +1 -0
  1128. package/.output/server/chunks/routes/api/workshop/mes/points.get.mjs.map +1 -1
  1129. package/.output/server/chunks/routes/api/workshop/mes/preview.post.mjs +2 -1
  1130. package/.output/server/chunks/routes/api/workshop/mes/preview.post.mjs.map +1 -1
  1131. package/.output/server/chunks/routes/api/workshop/mes/secrets/_ref_.delete.mjs +2 -1
  1132. package/.output/server/chunks/routes/api/workshop/mes/secrets/_ref_.delete.mjs.map +1 -1
  1133. package/.output/server/chunks/routes/api/workshop/mes/templates.get.mjs +1 -0
  1134. package/.output/server/chunks/routes/api/workshop/mes/templates.get.mjs.map +1 -1
  1135. package/.output/server/chunks/routes/api/workshop/mes/templates.post.mjs +2 -1
  1136. package/.output/server/chunks/routes/api/workshop/mes/templates.post.mjs.map +1 -1
  1137. package/.output/server/chunks/routes/api/workshop/notifications/read.post.mjs +2 -1
  1138. package/.output/server/chunks/routes/api/workshop/notifications/read.post.mjs.map +1 -1
  1139. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/autofix.mjs +2 -1
  1140. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/autofix.mjs.map +1 -1
  1141. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/compile.mjs +2 -1
  1142. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/compile.mjs.map +1 -1
  1143. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/evidence.mjs +2 -1
  1144. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/evidence.mjs.map +1 -1
  1145. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/publish.mjs +2 -1
  1146. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/publish.mjs.map +1 -1
  1147. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval-decision.mjs +2 -1
  1148. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval-decision.mjs.map +1 -1
  1149. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval.mjs +2 -1
  1150. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval.mjs.map +1 -1
  1151. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/transition.mjs +2 -1
  1152. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/transition.mjs.map +1 -1
  1153. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/subgraph.mjs +2 -1
  1154. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/subgraph.mjs.map +1 -1
  1155. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/validate.mjs +2 -1
  1156. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/validate.mjs.map +1 -1
  1157. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId_.mjs +2 -1
  1158. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId_.mjs.map +1 -1
  1159. package/.output/server/chunks/routes/api/workshop/ontology/export/_ontologyId_.mjs +2 -1
  1160. package/.output/server/chunks/routes/api/workshop/ontology/export/_ontologyId_.mjs.map +1 -1
  1161. package/.output/server/chunks/routes/api/workshop/ontology/index.mjs +2 -1
  1162. package/.output/server/chunks/routes/api/workshop/ontology/index.mjs.map +1 -1
  1163. package/.output/server/chunks/routes/api/workshop/ontology/scene.mjs +2 -1
  1164. package/.output/server/chunks/routes/api/workshop/ontology/scene.mjs.map +1 -1
  1165. package/.output/server/chunks/routes/api/workshop/ontology/traces/_ontologyId_.mjs +2 -1
  1166. package/.output/server/chunks/routes/api/workshop/ontology/traces/_ontologyId_.mjs.map +1 -1
  1167. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId/compare.mjs +2 -1
  1168. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId/compare.mjs.map +1 -1
  1169. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId_.mjs +2 -1
  1170. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId_.mjs.map +1 -1
  1171. package/.output/server/chunks/routes/api/workshop/optimization/bindings/_id_.delete.mjs +1 -0
  1172. package/.output/server/chunks/routes/api/workshop/optimization/bindings/_id_.delete.mjs.map +1 -1
  1173. package/.output/server/chunks/routes/api/workshop/optimization/capabilities.get.mjs +2 -1
  1174. package/.output/server/chunks/routes/api/workshop/optimization/capabilities.get.mjs.map +1 -1
  1175. package/.output/server/chunks/routes/api/workshop/optimization/index.get.mjs +2 -1
  1176. package/.output/server/chunks/routes/api/workshop/optimization/index.get.mjs.map +1 -1
  1177. package/.output/server/chunks/routes/api/workshop/optimization/index.mjs +2 -1
  1178. package/.output/server/chunks/routes/api/workshop/optimization/index.mjs.map +1 -1
  1179. package/.output/server/chunks/routes/api/workshop/optimization/index2.mjs +2 -1
  1180. package/.output/server/chunks/routes/api/workshop/optimization/index2.mjs.map +1 -1
  1181. package/.output/server/chunks/routes/api/workshop/optimization/profiles/_id/publish.post.mjs +2 -1
  1182. package/.output/server/chunks/routes/api/workshop/optimization/profiles/_id/publish.post.mjs.map +1 -1
  1183. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/crosscheck.post.mjs +2 -1
  1184. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/crosscheck.post.mjs.map +1 -1
  1185. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/dispatch.post.mjs +2 -1
  1186. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/dispatch.post.mjs.map +1 -1
  1187. package/.output/server/chunks/routes/api/workshop/optimization/solve.post.mjs +2 -1
  1188. package/.output/server/chunks/routes/api/workshop/optimization/solve.post.mjs.map +1 -1
  1189. package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +2 -1
  1190. package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs.map +1 -1
  1191. package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +2 -1
  1192. package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs.map +1 -1
  1193. package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs +1 -0
  1194. package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs.map +1 -1
  1195. package/.output/server/chunks/routes/api/workshop/process-model/datasets.post.mjs +2 -1
  1196. package/.output/server/chunks/routes/api/workshop/process-model/datasets.post.mjs.map +1 -1
  1197. package/.output/server/chunks/routes/api/workshop/process-model/eligibility.mjs +2 -1
  1198. package/.output/server/chunks/routes/api/workshop/process-model/eligibility.mjs.map +1 -1
  1199. package/.output/server/chunks/routes/api/workshop/process-model/experiments.mjs +2 -1
  1200. package/.output/server/chunks/routes/api/workshop/process-model/experiments.mjs.map +1 -1
  1201. package/.output/server/chunks/routes/api/workshop/process-model/index.mjs +2 -1
  1202. package/.output/server/chunks/routes/api/workshop/process-model/index.mjs.map +1 -1
  1203. package/.output/server/chunks/routes/api/workshop/process-model/specs/_id/publish.post.mjs +2 -1
  1204. package/.output/server/chunks/routes/api/workshop/process-model/specs/_id/publish.post.mjs.map +1 -1
  1205. package/.output/server/chunks/routes/api/workshop/process-model/train.post.mjs +2 -1
  1206. package/.output/server/chunks/routes/api/workshop/process-model/train.post.mjs.map +1 -1
  1207. package/.output/server/chunks/routes/api/workshop/projects/_id/activate.post.mjs +2 -1
  1208. package/.output/server/chunks/routes/api/workshop/projects/_id/activate.post.mjs.map +1 -1
  1209. package/.output/server/chunks/routes/api/workshop/projects/_id/approvals/_aid/decide.post.mjs +2 -1
  1210. package/.output/server/chunks/routes/api/workshop/projects/_id/approvals/_aid/decide.post.mjs.map +1 -1
  1211. package/.output/server/chunks/routes/api/workshop/projects/_id/archive.post.mjs +2 -1
  1212. package/.output/server/chunks/routes/api/workshop/projects/_id/archive.post.mjs.map +1 -1
  1213. package/.output/server/chunks/routes/api/workshop/projects/_id/channels/_channelId_.delete.mjs +2 -1
  1214. package/.output/server/chunks/routes/api/workshop/projects/_id/channels/_channelId_.delete.mjs.map +1 -1
  1215. package/.output/server/chunks/routes/api/workshop/projects/_id/complete.post.mjs +2 -1
  1216. package/.output/server/chunks/routes/api/workshop/projects/_id/complete.post.mjs.map +1 -1
  1217. package/.output/server/chunks/routes/api/workshop/projects/_id/continue.post.mjs +2 -1
  1218. package/.output/server/chunks/routes/api/workshop/projects/_id/continue.post.mjs.map +1 -1
  1219. package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/_did/waive.post.mjs +2 -1
  1220. package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/_did/waive.post.mjs.map +1 -1
  1221. package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/index.get.mjs +2 -1
  1222. package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/index.get.mjs.map +1 -1
  1223. package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/index.patch.mjs +2 -1
  1224. package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/index.patch.mjs.map +1 -1
  1225. package/.output/server/chunks/routes/api/workshop/projects/_id/health.get.mjs +2 -1
  1226. package/.output/server/chunks/routes/api/workshop/projects/_id/health.get.mjs.map +1 -1
  1227. package/.output/server/chunks/routes/api/workshop/projects/_id/index.get.mjs +2 -1
  1228. package/.output/server/chunks/routes/api/workshop/projects/_id/index.get.mjs.map +1 -1
  1229. package/.output/server/chunks/routes/api/workshop/projects/_id/index.post.mjs +2 -1
  1230. package/.output/server/chunks/routes/api/workshop/projects/_id/index.post.mjs.map +1 -1
  1231. package/.output/server/chunks/routes/api/workshop/projects/_id/index2.get.mjs +2 -1
  1232. package/.output/server/chunks/routes/api/workshop/projects/_id/index2.get.mjs.map +1 -1
  1233. package/.output/server/chunks/routes/api/workshop/projects/_id/index2.post.mjs +2 -1
  1234. package/.output/server/chunks/routes/api/workshop/projects/_id/index2.post.mjs.map +1 -1
  1235. package/.output/server/chunks/routes/api/workshop/projects/_id/index3.get.mjs +2 -1
  1236. package/.output/server/chunks/routes/api/workshop/projects/_id/index3.get.mjs.map +1 -1
  1237. package/.output/server/chunks/routes/api/workshop/projects/_id/index3.post.mjs +2 -1
  1238. package/.output/server/chunks/routes/api/workshop/projects/_id/index3.post.mjs.map +1 -1
  1239. package/.output/server/chunks/routes/api/workshop/projects/_id/index4.get.mjs +2 -1
  1240. package/.output/server/chunks/routes/api/workshop/projects/_id/index4.get.mjs.map +1 -1
  1241. package/.output/server/chunks/routes/api/workshop/projects/_id/index4.post.mjs +2 -1
  1242. package/.output/server/chunks/routes/api/workshop/projects/_id/index4.post.mjs.map +1 -1
  1243. package/.output/server/chunks/routes/api/workshop/projects/_id/index5.get.mjs +2 -1
  1244. package/.output/server/chunks/routes/api/workshop/projects/_id/index5.get.mjs.map +1 -1
  1245. package/.output/server/chunks/routes/api/workshop/projects/_id/index6.get.mjs +2 -1
  1246. package/.output/server/chunks/routes/api/workshop/projects/_id/index6.get.mjs.map +1 -1
  1247. package/.output/server/chunks/routes/api/workshop/projects/_id/index7.get.mjs +2 -1
  1248. package/.output/server/chunks/routes/api/workshop/projects/_id/index7.get.mjs.map +1 -1
  1249. package/.output/server/chunks/routes/api/workshop/projects/_id/index8.get.mjs +2 -1
  1250. package/.output/server/chunks/routes/api/workshop/projects/_id/index8.get.mjs.map +1 -1
  1251. package/.output/server/chunks/routes/api/workshop/projects/_id/kernel/tick.post.mjs +2 -1
  1252. package/.output/server/chunks/routes/api/workshop/projects/_id/kernel/tick.post.mjs.map +1 -1
  1253. package/.output/server/chunks/routes/api/workshop/projects/_id/ledger.get.mjs +2 -1
  1254. package/.output/server/chunks/routes/api/workshop/projects/_id/ledger.get.mjs.map +1 -1
  1255. package/.output/server/chunks/routes/api/workshop/projects/_id/members/_userId_.delete.mjs +2 -1
  1256. package/.output/server/chunks/routes/api/workshop/projects/_id/members/_userId_.delete.mjs.map +1 -1
  1257. package/.output/server/chunks/routes/api/workshop/projects/_id/observability/activity.get.mjs +2 -1
  1258. package/.output/server/chunks/routes/api/workshop/projects/_id/observability/activity.get.mjs.map +1 -1
  1259. package/.output/server/chunks/routes/api/workshop/projects/_id/observability/route.get.mjs +2 -1
  1260. package/.output/server/chunks/routes/api/workshop/projects/_id/observability/route.get.mjs.map +1 -1
  1261. package/.output/server/chunks/routes/api/workshop/projects/_id/observability/work-items/_wid_.get.mjs +2 -1
  1262. package/.output/server/chunks/routes/api/workshop/projects/_id/observability/work-items/_wid_.get.mjs.map +1 -1
  1263. package/.output/server/chunks/routes/api/workshop/projects/_id/observability.get.mjs +2 -1
  1264. package/.output/server/chunks/routes/api/workshop/projects/_id/observability.get.mjs.map +1 -1
  1265. package/.output/server/chunks/routes/api/workshop/projects/_id/pause.post.mjs +2 -1
  1266. package/.output/server/chunks/routes/api/workshop/projects/_id/pause.post.mjs.map +1 -1
  1267. package/.output/server/chunks/routes/api/workshop/projects/_id/plan/request-approval.post.mjs +2 -1
  1268. package/.output/server/chunks/routes/api/workshop/projects/_id/plan/request-approval.post.mjs.map +1 -1
  1269. package/.output/server/chunks/routes/api/workshop/projects/_id/proposals/_decisionId/apply.post.mjs +2 -1
  1270. package/.output/server/chunks/routes/api/workshop/projects/_id/proposals/_decisionId/apply.post.mjs.map +1 -1
  1271. package/.output/server/chunks/routes/api/workshop/projects/_id/reconcile.post.mjs +2 -1
  1272. package/.output/server/chunks/routes/api/workshop/projects/_id/reconcile.post.mjs.map +1 -1
  1273. package/.output/server/chunks/routes/api/workshop/projects/_id/report.get.mjs +2 -1
  1274. package/.output/server/chunks/routes/api/workshop/projects/_id/report.get.mjs.map +1 -1
  1275. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/request-acceptance.post.mjs +2 -1
  1276. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/request-acceptance.post.mjs.map +1 -1
  1277. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/review.post.mjs +2 -1
  1278. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/review.post.mjs.map +1 -1
  1279. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/submit.post.mjs +2 -1
  1280. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/submit.post.mjs.map +1 -1
  1281. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/supersede.post.mjs +2 -1
  1282. package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/supersede.post.mjs.map +1 -1
  1283. package/.output/server/chunks/routes/api/workshop/projects/_id/resume.post.mjs +2 -1
  1284. package/.output/server/chunks/routes/api/workshop/projects/_id/resume.post.mjs.map +1 -1
  1285. package/.output/server/chunks/routes/api/workshop/projects/_id/sessions.get.mjs +2 -1
  1286. package/.output/server/chunks/routes/api/workshop/projects/_id/sessions.get.mjs.map +1 -1
  1287. package/.output/server/chunks/routes/api/workshop/projects/_id/snapshot.get.mjs +2 -1
  1288. package/.output/server/chunks/routes/api/workshop/projects/_id/snapshot.get.mjs.map +1 -1
  1289. package/.output/server/chunks/routes/api/workshop/projects/_id/terminate.post.mjs +2 -1
  1290. package/.output/server/chunks/routes/api/workshop/projects/_id/terminate.post.mjs.map +1 -1
  1291. package/.output/server/chunks/routes/api/workshop/projects/_id/trace/_traceId_.get.mjs +2 -1
  1292. package/.output/server/chunks/routes/api/workshop/projects/_id/trace/_traceId_.get.mjs.map +1 -1
  1293. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/cancel.post.mjs +2 -1
  1294. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/cancel.post.mjs.map +1 -1
  1295. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/dispatch.post.mjs +2 -1
  1296. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/dispatch.post.mjs.map +1 -1
  1297. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/retry.post.mjs +2 -1
  1298. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/retry.post.mjs.map +1 -1
  1299. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/index.get.mjs +2 -1
  1300. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/index.get.mjs.map +1 -1
  1301. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/index.patch.mjs +2 -1
  1302. package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/index.patch.mjs.map +1 -1
  1303. package/.output/server/chunks/routes/api/workshop/projects/_id_.get.mjs +2 -1
  1304. package/.output/server/chunks/routes/api/workshop/projects/_id_.get.mjs.map +1 -1
  1305. package/.output/server/chunks/routes/api/workshop/projects/_id_.patch.mjs +2 -1
  1306. package/.output/server/chunks/routes/api/workshop/projects/_id_.patch.mjs.map +1 -1
  1307. package/.output/server/chunks/routes/api/workshop/projects/instantiate.post.mjs +2 -1
  1308. package/.output/server/chunks/routes/api/workshop/projects/instantiate.post.mjs.map +1 -1
  1309. package/.output/server/chunks/routes/api/workshop/runtime.get.mjs +1 -0
  1310. package/.output/server/chunks/routes/api/workshop/runtime.get.mjs.map +1 -1
  1311. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +2 -1
  1312. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs.map +1 -1
  1313. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +2 -1
  1314. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs.map +1 -1
  1315. package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs +1 -0
  1316. package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs.map +1 -1
  1317. package/.output/server/chunks/routes/api/workshop/schedules/_id/run.post.mjs +1 -0
  1318. package/.output/server/chunks/routes/api/workshop/schedules/_id/run.post.mjs.map +1 -1
  1319. package/.output/server/chunks/routes/api/workshop/schedules/_id/runs.get.mjs +1 -0
  1320. package/.output/server/chunks/routes/api/workshop/schedules/_id/runs.get.mjs.map +1 -1
  1321. package/.output/server/chunks/routes/api/workshop/schedules/_id_.delete.mjs +1 -0
  1322. package/.output/server/chunks/routes/api/workshop/schedules/_id_.delete.mjs.map +1 -1
  1323. package/.output/server/chunks/routes/api/workshop/schedules/_id_.get.mjs +1 -0
  1324. package/.output/server/chunks/routes/api/workshop/schedules/_id_.get.mjs.map +1 -1
  1325. package/.output/server/chunks/routes/api/workshop/schedules/_id_.patch.mjs +2 -1
  1326. package/.output/server/chunks/routes/api/workshop/schedules/_id_.patch.mjs.map +1 -1
  1327. package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs +2 -1
  1328. package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs.map +1 -1
  1329. package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs +2 -1
  1330. package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs.map +1 -1
  1331. package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs +1 -0
  1332. package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs.map +1 -1
  1333. package/.output/server/chunks/routes/api/workshop/tasks/_id/reassign.post.mjs +1 -0
  1334. package/.output/server/chunks/routes/api/workshop/tasks/_id/reassign.post.mjs.map +1 -1
  1335. package/.output/server/chunks/routes/api/workshop/tasks/_id/recovery-disposition.post.mjs +1 -0
  1336. package/.output/server/chunks/routes/api/workshop/tasks/_id/recovery-disposition.post.mjs.map +1 -1
  1337. package/.output/server/chunks/routes/api/workshop/tasks/_id/reopen.post.mjs +2 -1
  1338. package/.output/server/chunks/routes/api/workshop/tasks/_id/reopen.post.mjs.map +1 -1
  1339. package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs +2 -1
  1340. package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs.map +1 -1
  1341. package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs +1 -0
  1342. package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs.map +1 -1
  1343. package/.output/server/chunks/routes/api/workshop/tasks/_id/supersede.post.mjs +2 -1
  1344. package/.output/server/chunks/routes/api/workshop/tasks/_id/supersede.post.mjs.map +1 -1
  1345. package/.output/server/chunks/routes/api/workshop/tasks/_id/update.post.mjs +1 -0
  1346. package/.output/server/chunks/routes/api/workshop/tasks/_id/update.post.mjs.map +1 -1
  1347. package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs +1 -0
  1348. package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs.map +1 -1
  1349. package/.output/server/chunks/routes/api/workshop/tasks/recovery-holds.get.mjs +1 -0
  1350. package/.output/server/chunks/routes/api/workshop/tasks/recovery-holds.get.mjs.map +1 -1
  1351. package/.output/server/chunks/routes/api/workshop/tasks.get.mjs +1 -0
  1352. package/.output/server/chunks/routes/api/workshop/tasks.get.mjs.map +1 -1
  1353. package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +2 -1
  1354. package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs.map +1 -1
  1355. package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs +1 -0
  1356. package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs.map +1 -1
  1357. package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs +2 -1
  1358. package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs.map +1 -1
  1359. package/.output/server/chunks/routes/api/workshop/teams/_id/index.put.mjs +2 -1
  1360. package/.output/server/chunks/routes/api/workshop/teams/_id/index.put.mjs.map +1 -1
  1361. package/.output/server/chunks/routes/api/workshop/teams/_id/index2.get.mjs +2 -1
  1362. package/.output/server/chunks/routes/api/workshop/teams/_id/index2.get.mjs.map +1 -1
  1363. package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs +1 -0
  1364. package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs.map +1 -1
  1365. package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs +1 -0
  1366. package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs.map +1 -1
  1367. package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs +1 -0
  1368. package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs.map +1 -1
  1369. package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs +2 -1
  1370. package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs.map +1 -1
  1371. package/.output/server/chunks/routes/api/workshop/tools/_name_.get.mjs +2 -1
  1372. package/.output/server/chunks/routes/api/workshop/tools/_name_.get.mjs.map +1 -1
  1373. package/.output/server/chunks/routes/api/workshop/tools/sync.post.mjs +2 -1
  1374. package/.output/server/chunks/routes/api/workshop/tools/sync.post.mjs.map +1 -1
  1375. package/.output/server/chunks/routes/api/workshop/users/me.get.mjs +1 -0
  1376. package/.output/server/chunks/routes/api/workshop/users/me.get.mjs.map +1 -1
  1377. package/.output/server/chunks/routes/api/workshop/users/register.post.mjs +2 -1
  1378. package/.output/server/chunks/routes/api/workshop/users/register.post.mjs.map +1 -1
  1379. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +3 -2
  1380. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs.map +1 -1
  1381. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs +1 -0
  1382. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs.map +1 -1
  1383. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs +1 -0
  1384. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs.map +1 -1
  1385. package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs +1 -0
  1386. package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs.map +1 -1
  1387. package/.output/server/chunks/routes/api/workshop/ws/ticket.post.mjs +2 -1
  1388. package/.output/server/chunks/routes/api/workshop/ws/ticket.post.mjs.map +1 -1
  1389. package/.output/server/chunks/routes/renderer.mjs +2 -2
  1390. package/.output/server/chunks/virtual/entry.mjs +207 -5
  1391. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  1392. package/.output/server/index.mjs +1 -0
  1393. package/.output/server/index.mjs.map +1 -1
  1394. package/.output/server/node_modules/.nitro/zod@3.25.76/index.js +4 -0
  1395. package/.output/server/node_modules/.nitro/zod@3.25.76/package.json +118 -0
  1396. package/.output/server/node_modules/.nitro/zod@3.25.76/v3/ZodError.js +133 -0
  1397. package/.output/server/node_modules/.nitro/zod@3.25.76/v3/errors.js +9 -0
  1398. package/.output/server/node_modules/.nitro/zod@3.25.76/v3/external.js +6 -0
  1399. package/.output/server/node_modules/.nitro/zod@3.25.76/v3/helpers/errorUtil.js +6 -0
  1400. package/.output/server/node_modules/.nitro/zod@3.25.76/v3/helpers/parseUtil.js +109 -0
  1401. package/.output/server/node_modules/.nitro/zod@3.25.76/v3/helpers/typeAliases.js +1 -0
  1402. package/.output/server/node_modules/.nitro/zod@3.25.76/v3/helpers/util.js +133 -0
  1403. package/.output/server/node_modules/.nitro/zod@3.25.76/v3/index.js +4 -0
  1404. package/.output/server/node_modules/.nitro/zod@3.25.76/v3/locales/en.js +109 -0
  1405. package/.output/server/node_modules/.nitro/zod@3.25.76/v3/types.js +3693 -0
  1406. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/classic/checks.js +1 -0
  1407. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/classic/coerce.js +17 -0
  1408. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/classic/compat.js +27 -0
  1409. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/classic/errors.js +41 -0
  1410. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/classic/external.js +18 -0
  1411. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/classic/index.js +4 -0
  1412. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/classic/iso.js +30 -0
  1413. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/classic/parse.js +6 -0
  1414. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/classic/schemas.js +1006 -0
  1415. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/api.js +906 -0
  1416. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/checks.js +565 -0
  1417. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/core.js +61 -0
  1418. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/doc.js +35 -0
  1419. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/errors.js +195 -0
  1420. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/function.js +75 -0
  1421. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/index.js +15 -0
  1422. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/json-schema.js +1 -0
  1423. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/parse.js +57 -0
  1424. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/regexes.js +95 -0
  1425. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/registries.js +51 -0
  1426. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/schemas.js +1717 -0
  1427. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/to-json-schema.js +849 -0
  1428. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/util.js +493 -0
  1429. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/core/versions.js +5 -0
  1430. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/index.js +3 -0
  1431. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/ar.js +116 -0
  1432. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/az.js +115 -0
  1433. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/be.js +164 -0
  1434. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/ca.js +118 -0
  1435. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/cs.js +135 -0
  1436. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/de.js +116 -0
  1437. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/en.js +117 -0
  1438. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/eo.js +116 -0
  1439. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/es.js +117 -0
  1440. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/fa.js +122 -0
  1441. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/fi.js +122 -0
  1442. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/fr-CA.js +117 -0
  1443. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/fr.js +116 -0
  1444. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/he.js +117 -0
  1445. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/hu.js +117 -0
  1446. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/id.js +116 -0
  1447. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/index.js +39 -0
  1448. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/it.js +117 -0
  1449. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/ja.js +115 -0
  1450. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/kh.js +117 -0
  1451. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/ko.js +121 -0
  1452. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/mk.js +118 -0
  1453. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/ms.js +116 -0
  1454. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/nl.js +117 -0
  1455. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/no.js +116 -0
  1456. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/ota.js +117 -0
  1457. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/pl.js +117 -0
  1458. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/ps.js +122 -0
  1459. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/pt.js +116 -0
  1460. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/ru.js +164 -0
  1461. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/sl.js +117 -0
  1462. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/sv.js +118 -0
  1463. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/ta.js +117 -0
  1464. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/th.js +117 -0
  1465. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/tr.js +115 -0
  1466. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/ua.js +117 -0
  1467. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/ur.js +117 -0
  1468. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/vi.js +116 -0
  1469. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/zh-CN.js +116 -0
  1470. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/locales/zh-TW.js +117 -0
  1471. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/mini/checks.js +1 -0
  1472. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/mini/coerce.js +17 -0
  1473. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/mini/external.js +13 -0
  1474. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/mini/index.js +3 -0
  1475. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/mini/iso.js +30 -0
  1476. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/mini/parse.js +1 -0
  1477. package/.output/server/node_modules/.nitro/zod@3.25.76/v4/mini/schemas.js +732 -0
  1478. package/.output/server/node_modules/.nitro/zod@3.25.76/v4-mini/index.js +1 -0
  1479. package/.output/server/node_modules/.nitro/zod@4.6.7/package.json +147 -0
  1480. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/checks.js +1 -0
  1481. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/coerce.js +17 -0
  1482. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/compat.js +31 -0
  1483. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/deep-partial.js +13 -0
  1484. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/errors.js +57 -0
  1485. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/external.js +17 -0
  1486. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/from-json-schema.js +881 -0
  1487. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/in-out.js +36 -0
  1488. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/index.js +4 -0
  1489. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/iso.js +15 -0
  1490. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/package.json +7 -0
  1491. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/parse.js +16 -0
  1492. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/classic/schemas.js +1535 -0
  1493. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/api.js +1107 -0
  1494. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/checks.js +516 -0
  1495. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/compile.js +1866 -0
  1496. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/core.js +141 -0
  1497. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/doc.js +38 -0
  1498. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/errors.js +267 -0
  1499. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/index.js +19 -0
  1500. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/json-schema-generator.js +99 -0
  1501. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/json-schema-processors.js +843 -0
  1502. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/json-schema.js +1 -0
  1503. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/memoizer.js +311 -0
  1504. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/package.json +7 -0
  1505. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/parse.js +175 -0
  1506. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/regexes.js +156 -0
  1507. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/registries.js +51 -0
  1508. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/schemas.js +2636 -0
  1509. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/to-json-schema.js +651 -0
  1510. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/util.js +873 -0
  1511. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/versions.js +5 -0
  1512. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/core/visit.js +169 -0
  1513. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/index.js +4 -0
  1514. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ar.js +111 -0
  1515. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/az.js +110 -0
  1516. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/be.js +168 -0
  1517. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/bg.js +125 -0
  1518. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/bn.js +113 -0
  1519. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ca.js +112 -0
  1520. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ckb.js +133 -0
  1521. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/cs.js +116 -0
  1522. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/da.js +120 -0
  1523. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/de.js +113 -0
  1524. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/el.js +112 -0
  1525. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/en.js +125 -0
  1526. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/eo.js +114 -0
  1527. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/es.js +136 -0
  1528. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/fa.js +119 -0
  1529. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/fi.js +117 -0
  1530. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/fr-CA.js +112 -0
  1531. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/fr.js +129 -0
  1532. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/gu.js +113 -0
  1533. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/he.js +221 -0
  1534. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/hi.js +111 -0
  1535. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/hr.js +126 -0
  1536. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/hu.js +113 -0
  1537. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/hy.js +158 -0
  1538. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/id.js +111 -0
  1539. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/index.js +63 -0
  1540. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/is.js +114 -0
  1541. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/it.js +113 -0
  1542. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ja.js +112 -0
  1543. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ka.js +117 -0
  1544. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/kh.js +5 -0
  1545. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/km.js +115 -0
  1546. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/kn.js +116 -0
  1547. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ko.js +116 -0
  1548. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/lt.js +207 -0
  1549. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/mk.js +114 -0
  1550. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ms.js +112 -0
  1551. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ne.js +111 -0
  1552. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/nl.js +115 -0
  1553. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/nn.js +113 -0
  1554. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/no.js +113 -0
  1555. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ota.js +114 -0
  1556. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/package.json +7 -0
  1557. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/pl.js +114 -0
  1558. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ps.js +119 -0
  1559. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/pt-BR.js +143 -0
  1560. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/pt.js +142 -0
  1561. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ro.js +122 -0
  1562. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ru.js +168 -0
  1563. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/sk.js +116 -0
  1564. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/sl.js +114 -0
  1565. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/sv.js +115 -0
  1566. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ta.js +115 -0
  1567. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/tg.js +117 -0
  1568. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/th.js +115 -0
  1569. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/tk.js +107 -0
  1570. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/tr.js +110 -0
  1571. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ua.js +5 -0
  1572. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/uk.js +113 -0
  1573. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/ur.js +115 -0
  1574. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/uz.js +113 -0
  1575. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/vi.js +113 -0
  1576. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/yo.js +112 -0
  1577. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/zh-CN.js +114 -0
  1578. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/locales/zh-TW.js +112 -0
  1579. package/.output/server/node_modules/.nitro/zod@4.6.7/v4/package.json +7 -0
  1580. package/.output/server/node_modules/@modelcontextprotocol/client/dist/ajvProvider-BIwGVY6G.mjs +8010 -0
  1581. package/.output/server/node_modules/@modelcontextprotocol/client/dist/chunk-DYPzFuB5.mjs +42 -0
  1582. package/.output/server/node_modules/@modelcontextprotocol/client/dist/dialects-BAIiebX0.mjs +34 -0
  1583. package/.output/server/node_modules/@modelcontextprotocol/client/dist/index.mjs +1875 -0
  1584. package/.output/server/node_modules/@modelcontextprotocol/client/dist/public-CvV4ZHkX.mjs +4046 -0
  1585. package/.output/server/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs +13 -0
  1586. package/.output/server/node_modules/@modelcontextprotocol/client/dist/src-CeKsbNLO.mjs +7237 -0
  1587. package/.output/server/node_modules/@modelcontextprotocol/client/package.json +179 -0
  1588. package/.output/server/node_modules/@modelcontextprotocol/core/dist/auth-UMQCo-ad.mjs +209 -0
  1589. package/.output/server/node_modules/@modelcontextprotocol/core/dist/internal.mjs +4 -0
  1590. package/.output/server/node_modules/@modelcontextprotocol/core/dist/schemas-DscsoNZN.mjs +1476 -0
  1591. package/.output/server/node_modules/@modelcontextprotocol/core/package.json +98 -0
  1592. package/.output/server/node_modules/eventsource/dist/index.js +273 -0
  1593. package/.output/server/node_modules/eventsource/package.json +130 -0
  1594. package/.output/server/node_modules/eventsource-parser/dist/index.js +177 -0
  1595. package/.output/server/node_modules/eventsource-parser/dist/stream.js +30 -0
  1596. package/.output/server/node_modules/eventsource-parser/package.json +92 -0
  1597. package/.output/server/node_modules/pkce-challenge/dist/index.node.js +78 -0
  1598. package/.output/server/node_modules/pkce-challenge/package.json +59 -0
  1599. package/.output/server/node_modules/zod/LICENSE +21 -0
  1600. package/.output/server/node_modules/zod/README.md +208 -0
  1601. package/.output/server/node_modules/zod/index.cjs +33 -0
  1602. package/.output/server/node_modules/zod/index.d.cts +4 -0
  1603. package/.output/server/node_modules/zod/index.d.ts +4 -0
  1604. package/.output/server/node_modules/zod/package.json +1 -1
  1605. package/.output/server/node_modules/zod/src/index.ts +4 -0
  1606. package/.output/server/node_modules/zod/src/v3/ZodError.ts +330 -0
  1607. package/.output/server/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  1608. package/.output/server/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  1609. package/.output/server/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  1610. package/.output/server/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  1611. package/.output/server/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  1612. package/.output/server/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  1613. package/.output/server/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  1614. package/.output/server/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  1615. package/.output/server/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  1616. package/.output/server/node_modules/zod/src/v3/errors.ts +13 -0
  1617. package/.output/server/node_modules/zod/src/v3/external.ts +6 -0
  1618. package/.output/server/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  1619. package/.output/server/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  1620. package/.output/server/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  1621. package/.output/server/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  1622. package/.output/server/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  1623. package/.output/server/node_modules/zod/src/v3/helpers/util.ts +224 -0
  1624. package/.output/server/node_modules/zod/src/v3/index.ts +4 -0
  1625. package/.output/server/node_modules/zod/src/v3/locales/en.ts +124 -0
  1626. package/.output/server/node_modules/zod/src/v3/standard-schema.ts +113 -0
  1627. package/.output/server/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  1628. package/.output/server/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  1629. package/.output/server/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  1630. package/.output/server/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  1631. package/.output/server/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  1632. package/.output/server/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  1633. package/.output/server/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  1634. package/.output/server/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  1635. package/.output/server/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  1636. package/.output/server/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  1637. package/.output/server/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  1638. package/.output/server/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
  1639. package/.output/server/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  1640. package/.output/server/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  1641. package/.output/server/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  1642. package/.output/server/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  1643. package/.output/server/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  1644. package/.output/server/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  1645. package/.output/server/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  1646. package/.output/server/node_modules/zod/src/v3/tests/error.test.ts +551 -0
  1647. package/.output/server/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  1648. package/.output/server/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  1649. package/.output/server/node_modules/zod/src/v3/tests/function.test.ts +257 -0
  1650. package/.output/server/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  1651. package/.output/server/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  1652. package/.output/server/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
  1653. package/.output/server/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  1654. package/.output/server/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
  1655. package/.output/server/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  1656. package/.output/server/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  1657. package/.output/server/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  1658. package/.output/server/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  1659. package/.output/server/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
  1660. package/.output/server/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  1661. package/.output/server/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  1662. package/.output/server/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  1663. package/.output/server/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  1664. package/.output/server/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  1665. package/.output/server/node_modules/zod/src/v3/tests/object.test.ts +434 -0
  1666. package/.output/server/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  1667. package/.output/server/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  1668. package/.output/server/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  1669. package/.output/server/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  1670. package/.output/server/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  1671. package/.output/server/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  1672. package/.output/server/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  1673. package/.output/server/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  1674. package/.output/server/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  1675. package/.output/server/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
  1676. package/.output/server/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  1677. package/.output/server/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  1678. package/.output/server/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  1679. package/.output/server/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  1680. package/.output/server/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  1681. package/.output/server/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  1682. package/.output/server/node_modules/zod/src/v3/tests/string.test.ts +916 -0
  1683. package/.output/server/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  1684. package/.output/server/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  1685. package/.output/server/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  1686. package/.output/server/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  1687. package/.output/server/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  1688. package/.output/server/node_modules/zod/src/v3/types.ts +5136 -0
  1689. package/.output/server/node_modules/zod/src/v4/classic/checks.ts +30 -0
  1690. package/.output/server/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  1691. package/.output/server/node_modules/zod/src/v4/classic/compat.ts +66 -0
  1692. package/.output/server/node_modules/zod/src/v4/classic/errors.ts +75 -0
  1693. package/.output/server/node_modules/zod/src/v4/classic/external.ts +50 -0
  1694. package/.output/server/node_modules/zod/src/v4/classic/index.ts +5 -0
  1695. package/.output/server/node_modules/zod/src/v4/classic/iso.ts +90 -0
  1696. package/.output/server/node_modules/zod/src/v4/classic/parse.ts +33 -0
  1697. package/.output/server/node_modules/zod/src/v4/classic/schemas.ts +2054 -0
  1698. package/.output/server/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  1699. package/.output/server/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
  1700. package/.output/server/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
  1701. package/.output/server/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  1702. package/.output/server/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  1703. package/.output/server/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  1704. package/.output/server/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
  1705. package/.output/server/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
  1706. package/.output/server/node_modules/zod/src/v4/classic/tests/catch.test.ts +252 -0
  1707. package/.output/server/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  1708. package/.output/server/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  1709. package/.output/server/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
  1710. package/.output/server/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  1711. package/.output/server/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
  1712. package/.output/server/node_modules/zod/src/v4/classic/tests/datetime.test.ts +296 -0
  1713. package/.output/server/node_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
  1714. package/.output/server/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  1715. package/.output/server/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
  1716. package/.output/server/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
  1717. package/.output/server/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
  1718. package/.output/server/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
  1719. package/.output/server/node_modules/zod/src/v4/classic/tests/file.test.ts +91 -0
  1720. package/.output/server/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
  1721. package/.output/server/node_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
  1722. package/.output/server/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  1723. package/.output/server/node_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
  1724. package/.output/server/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
  1725. package/.output/server/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
  1726. package/.output/server/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
  1727. package/.output/server/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
  1728. package/.output/server/node_modules/zod/src/v4/classic/tests/literal.test.ts +92 -0
  1729. package/.output/server/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
  1730. package/.output/server/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  1731. package/.output/server/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  1732. package/.output/server/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
  1733. package/.output/server/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  1734. package/.output/server/node_modules/zod/src/v4/classic/tests/number.test.ts +247 -0
  1735. package/.output/server/node_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
  1736. package/.output/server/node_modules/zod/src/v4/classic/tests/optional.test.ts +123 -0
  1737. package/.output/server/node_modules/zod/src/v4/classic/tests/partial.test.ts +147 -0
  1738. package/.output/server/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
  1739. package/.output/server/node_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
  1740. package/.output/server/node_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
  1741. package/.output/server/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
  1742. package/.output/server/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  1743. package/.output/server/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  1744. package/.output/server/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  1745. package/.output/server/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
  1746. package/.output/server/node_modules/zod/src/v4/classic/tests/record.test.ts +342 -0
  1747. package/.output/server/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
  1748. package/.output/server/node_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
  1749. package/.output/server/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
  1750. package/.output/server/node_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
  1751. package/.output/server/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
  1752. package/.output/server/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
  1753. package/.output/server/node_modules/zod/src/v4/classic/tests/string.test.ts +881 -0
  1754. package/.output/server/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
  1755. package/.output/server/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
  1756. package/.output/server/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
  1757. package/.output/server/node_modules/zod/src/v4/classic/tests/transform.test.ts +250 -0
  1758. package/.output/server/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
  1759. package/.output/server/node_modules/zod/src/v4/classic/tests/union.test.ts +94 -0
  1760. package/.output/server/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  1761. package/.output/server/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  1762. package/.output/server/node_modules/zod/src/v4/core/api.ts +1594 -0
  1763. package/.output/server/node_modules/zod/src/v4/core/checks.ts +1283 -0
  1764. package/.output/server/node_modules/zod/src/v4/core/config.ts +15 -0
  1765. package/.output/server/node_modules/zod/src/v4/core/core.ts +134 -0
  1766. package/.output/server/node_modules/zod/src/v4/core/doc.ts +44 -0
  1767. package/.output/server/node_modules/zod/src/v4/core/errors.ts +424 -0
  1768. package/.output/server/node_modules/zod/src/v4/core/function.ts +176 -0
  1769. package/.output/server/node_modules/zod/src/v4/core/index.ts +15 -0
  1770. package/.output/server/node_modules/zod/src/v4/core/json-schema.ts +143 -0
  1771. package/.output/server/node_modules/zod/src/v4/core/parse.ts +94 -0
  1772. package/.output/server/node_modules/zod/src/v4/core/regexes.ts +135 -0
  1773. package/.output/server/node_modules/zod/src/v4/core/registries.ts +96 -0
  1774. package/.output/server/node_modules/zod/src/v4/core/schemas.ts +3842 -0
  1775. package/.output/server/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
  1776. package/.output/server/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  1777. package/.output/server/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  1778. package/.output/server/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  1779. package/.output/server/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  1780. package/.output/server/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  1781. package/.output/server/node_modules/zod/src/v4/core/to-json-schema.ts +977 -0
  1782. package/.output/server/node_modules/zod/src/v4/core/util.ts +775 -0
  1783. package/.output/server/node_modules/zod/src/v4/core/versions.ts +5 -0
  1784. package/.output/server/node_modules/zod/src/v4/core/zsf.ts +323 -0
  1785. package/.output/server/node_modules/zod/src/v4/index.ts +4 -0
  1786. package/.output/server/node_modules/zod/src/v4/locales/ar.ts +125 -0
  1787. package/.output/server/node_modules/zod/src/v4/locales/az.ts +121 -0
  1788. package/.output/server/node_modules/zod/src/v4/locales/be.ts +184 -0
  1789. package/.output/server/node_modules/zod/src/v4/locales/ca.ts +127 -0
  1790. package/.output/server/node_modules/zod/src/v4/locales/cs.ts +142 -0
  1791. package/.output/server/node_modules/zod/src/v4/locales/de.ts +124 -0
  1792. package/.output/server/node_modules/zod/src/v4/locales/en.ts +127 -0
  1793. package/.output/server/node_modules/zod/src/v4/locales/eo.ts +125 -0
  1794. package/.output/server/node_modules/zod/src/v4/locales/es.ts +125 -0
  1795. package/.output/server/node_modules/zod/src/v4/locales/fa.ts +134 -0
  1796. package/.output/server/node_modules/zod/src/v4/locales/fi.ts +131 -0
  1797. package/.output/server/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
  1798. package/.output/server/node_modules/zod/src/v4/locales/fr.ts +124 -0
  1799. package/.output/server/node_modules/zod/src/v4/locales/he.ts +125 -0
  1800. package/.output/server/node_modules/zod/src/v4/locales/hu.ts +126 -0
  1801. package/.output/server/node_modules/zod/src/v4/locales/id.ts +125 -0
  1802. package/.output/server/node_modules/zod/src/v4/locales/index.ts +39 -0
  1803. package/.output/server/node_modules/zod/src/v4/locales/it.ts +125 -0
  1804. package/.output/server/node_modules/zod/src/v4/locales/ja.ts +122 -0
  1805. package/.output/server/node_modules/zod/src/v4/locales/kh.ts +126 -0
  1806. package/.output/server/node_modules/zod/src/v4/locales/ko.ts +131 -0
  1807. package/.output/server/node_modules/zod/src/v4/locales/mk.ts +127 -0
  1808. package/.output/server/node_modules/zod/src/v4/locales/ms.ts +124 -0
  1809. package/.output/server/node_modules/zod/src/v4/locales/nl.ts +126 -0
  1810. package/.output/server/node_modules/zod/src/v4/locales/no.ts +124 -0
  1811. package/.output/server/node_modules/zod/src/v4/locales/ota.ts +125 -0
  1812. package/.output/server/node_modules/zod/src/v4/locales/pl.ts +126 -0
  1813. package/.output/server/node_modules/zod/src/v4/locales/ps.ts +133 -0
  1814. package/.output/server/node_modules/zod/src/v4/locales/pt.ts +123 -0
  1815. package/.output/server/node_modules/zod/src/v4/locales/ru.ts +184 -0
  1816. package/.output/server/node_modules/zod/src/v4/locales/sl.ts +126 -0
  1817. package/.output/server/node_modules/zod/src/v4/locales/sv.ts +127 -0
  1818. package/.output/server/node_modules/zod/src/v4/locales/ta.ts +125 -0
  1819. package/.output/server/node_modules/zod/src/v4/locales/th.ts +126 -0
  1820. package/.output/server/node_modules/zod/src/v4/locales/tr.ts +121 -0
  1821. package/.output/server/node_modules/zod/src/v4/locales/ua.ts +126 -0
  1822. package/.output/server/node_modules/zod/src/v4/locales/ur.ts +126 -0
  1823. package/.output/server/node_modules/zod/src/v4/locales/vi.ts +125 -0
  1824. package/.output/server/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
  1825. package/.output/server/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
  1826. package/.output/server/node_modules/zod/src/v4/mini/checks.ts +32 -0
  1827. package/.output/server/node_modules/zod/src/v4/mini/coerce.ts +22 -0
  1828. package/.output/server/node_modules/zod/src/v4/mini/external.ts +40 -0
  1829. package/.output/server/node_modules/zod/src/v4/mini/index.ts +3 -0
  1830. package/.output/server/node_modules/zod/src/v4/mini/iso.ts +62 -0
  1831. package/.output/server/node_modules/zod/src/v4/mini/parse.ts +1 -0
  1832. package/.output/server/node_modules/zod/src/v4/mini/schemas.ts +1579 -0
  1833. package/.output/server/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
  1834. package/.output/server/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
  1835. package/.output/server/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
  1836. package/.output/server/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
  1837. package/.output/server/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
  1838. package/.output/server/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
  1839. package/.output/server/node_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
  1840. package/.output/server/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
  1841. package/.output/server/node_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
  1842. package/.output/server/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  1843. package/.output/server/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
  1844. package/.output/server/node_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
  1845. package/.output/server/node_modules/zod/src/v4-mini/index.ts +1 -0
  1846. package/.output/server/node_modules/zod/v3/ZodError.cjs +138 -0
  1847. package/.output/server/node_modules/zod/v3/ZodError.d.cts +164 -0
  1848. package/.output/server/node_modules/zod/v3/ZodError.d.ts +164 -0
  1849. package/.output/server/node_modules/zod/v3/errors.cjs +17 -0
  1850. package/.output/server/node_modules/zod/v3/errors.d.cts +5 -0
  1851. package/.output/server/node_modules/zod/v3/errors.d.ts +5 -0
  1852. package/.output/server/node_modules/zod/v3/external.cjs +22 -0
  1853. package/.output/server/node_modules/zod/v3/external.d.cts +6 -0
  1854. package/.output/server/node_modules/zod/v3/external.d.ts +6 -0
  1855. package/.output/server/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
  1856. package/.output/server/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  1857. package/.output/server/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  1858. package/.output/server/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  1859. package/.output/server/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
  1860. package/.output/server/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  1861. package/.output/server/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  1862. package/.output/server/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
  1863. package/.output/server/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  1864. package/.output/server/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  1865. package/.output/server/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
  1866. package/.output/server/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  1867. package/.output/server/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  1868. package/.output/server/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  1869. package/.output/server/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
  1870. package/.output/server/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  1871. package/.output/server/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  1872. package/.output/server/node_modules/zod/v3/helpers/util.cjs +137 -0
  1873. package/.output/server/node_modules/zod/v3/helpers/util.d.cts +85 -0
  1874. package/.output/server/node_modules/zod/v3/helpers/util.d.ts +85 -0
  1875. package/.output/server/node_modules/zod/v3/index.cjs +33 -0
  1876. package/.output/server/node_modules/zod/v3/index.d.cts +4 -0
  1877. package/.output/server/node_modules/zod/v3/index.d.ts +4 -0
  1878. package/.output/server/node_modules/zod/v3/locales/en.cjs +111 -0
  1879. package/.output/server/node_modules/zod/v3/locales/en.d.cts +3 -0
  1880. package/.output/server/node_modules/zod/v3/locales/en.d.ts +3 -0
  1881. package/.output/server/node_modules/zod/v3/standard-schema.cjs +2 -0
  1882. package/.output/server/node_modules/zod/v3/standard-schema.d.cts +102 -0
  1883. package/.output/server/node_modules/zod/v3/standard-schema.d.ts +102 -0
  1884. package/.output/server/node_modules/zod/v3/standard-schema.js +1 -0
  1885. package/.output/server/node_modules/zod/v3/types.cjs +3775 -0
  1886. package/.output/server/node_modules/zod/v3/types.d.cts +1031 -0
  1887. package/.output/server/node_modules/zod/v3/types.d.ts +1031 -0
  1888. package/.output/server/node_modules/zod/v4/classic/checks.cjs +32 -0
  1889. package/.output/server/node_modules/zod/v4/classic/checks.d.cts +1 -0
  1890. package/.output/server/node_modules/zod/v4/classic/checks.d.ts +1 -0
  1891. package/.output/server/node_modules/zod/v4/classic/coerce.cjs +47 -0
  1892. package/.output/server/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  1893. package/.output/server/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  1894. package/.output/server/node_modules/zod/v4/classic/compat.cjs +57 -0
  1895. package/.output/server/node_modules/zod/v4/classic/compat.d.cts +46 -0
  1896. package/.output/server/node_modules/zod/v4/classic/compat.d.ts +46 -0
  1897. package/.output/server/node_modules/zod/v4/classic/errors.cjs +67 -0
  1898. package/.output/server/node_modules/zod/v4/classic/errors.d.cts +30 -0
  1899. package/.output/server/node_modules/zod/v4/classic/errors.d.ts +30 -0
  1900. package/.output/server/node_modules/zod/v4/classic/external.cjs +70 -0
  1901. package/.output/server/node_modules/zod/v4/classic/external.d.cts +13 -0
  1902. package/.output/server/node_modules/zod/v4/classic/external.d.ts +13 -0
  1903. package/.output/server/node_modules/zod/v4/classic/index.cjs +33 -0
  1904. package/.output/server/node_modules/zod/v4/classic/index.d.cts +4 -0
  1905. package/.output/server/node_modules/zod/v4/classic/index.d.ts +4 -0
  1906. package/.output/server/node_modules/zod/v4/classic/iso.cjs +60 -0
  1907. package/.output/server/node_modules/zod/v4/classic/iso.d.cts +22 -0
  1908. package/.output/server/node_modules/zod/v4/classic/iso.d.ts +22 -0
  1909. package/.output/server/node_modules/zod/v4/classic/parse.cjs +32 -0
  1910. package/.output/server/node_modules/zod/v4/classic/parse.d.cts +23 -0
  1911. package/.output/server/node_modules/zod/v4/classic/parse.d.ts +23 -0
  1912. package/.output/server/node_modules/zod/v4/classic/schemas.cjs +1109 -0
  1913. package/.output/server/node_modules/zod/v4/classic/schemas.d.cts +630 -0
  1914. package/.output/server/node_modules/zod/v4/classic/schemas.d.ts +630 -0
  1915. package/.output/server/node_modules/zod/v4/core/api.cjs +1039 -0
  1916. package/.output/server/node_modules/zod/v4/core/api.d.cts +284 -0
  1917. package/.output/server/node_modules/zod/v4/core/api.d.ts +284 -0
  1918. package/.output/server/node_modules/zod/v4/core/checks.cjs +591 -0
  1919. package/.output/server/node_modules/zod/v4/core/checks.d.cts +278 -0
  1920. package/.output/server/node_modules/zod/v4/core/checks.d.ts +278 -0
  1921. package/.output/server/node_modules/zod/v4/core/core.cjs +67 -0
  1922. package/.output/server/node_modules/zod/v4/core/core.d.cts +49 -0
  1923. package/.output/server/node_modules/zod/v4/core/core.d.ts +49 -0
  1924. package/.output/server/node_modules/zod/v4/core/doc.cjs +39 -0
  1925. package/.output/server/node_modules/zod/v4/core/doc.d.cts +14 -0
  1926. package/.output/server/node_modules/zod/v4/core/doc.d.ts +14 -0
  1927. package/.output/server/node_modules/zod/v4/core/errors.cjs +226 -0
  1928. package/.output/server/node_modules/zod/v4/core/errors.d.cts +208 -0
  1929. package/.output/server/node_modules/zod/v4/core/errors.d.ts +208 -0
  1930. package/.output/server/node_modules/zod/v4/core/function.cjs +102 -0
  1931. package/.output/server/node_modules/zod/v4/core/function.d.cts +52 -0
  1932. package/.output/server/node_modules/zod/v4/core/function.d.ts +52 -0
  1933. package/.output/server/node_modules/zod/v4/core/index.cjs +44 -0
  1934. package/.output/server/node_modules/zod/v4/core/index.d.cts +15 -0
  1935. package/.output/server/node_modules/zod/v4/core/index.d.ts +15 -0
  1936. package/.output/server/node_modules/zod/v4/core/json-schema.cjs +2 -0
  1937. package/.output/server/node_modules/zod/v4/core/json-schema.d.cts +87 -0
  1938. package/.output/server/node_modules/zod/v4/core/json-schema.d.ts +87 -0
  1939. package/.output/server/node_modules/zod/v4/core/parse.cjs +87 -0
  1940. package/.output/server/node_modules/zod/v4/core/parse.d.cts +25 -0
  1941. package/.output/server/node_modules/zod/v4/core/parse.d.ts +25 -0
  1942. package/.output/server/node_modules/zod/v4/core/regexes.cjs +103 -0
  1943. package/.output/server/node_modules/zod/v4/core/regexes.d.cts +62 -0
  1944. package/.output/server/node_modules/zod/v4/core/regexes.d.ts +62 -0
  1945. package/.output/server/node_modules/zod/v4/core/registries.cjs +56 -0
  1946. package/.output/server/node_modules/zod/v4/core/registries.d.cts +35 -0
  1947. package/.output/server/node_modules/zod/v4/core/registries.d.ts +35 -0
  1948. package/.output/server/node_modules/zod/v4/core/schemas.cjs +1748 -0
  1949. package/.output/server/node_modules/zod/v4/core/schemas.d.cts +1041 -0
  1950. package/.output/server/node_modules/zod/v4/core/schemas.d.ts +1041 -0
  1951. package/.output/server/node_modules/zod/v4/core/standard-schema.cjs +2 -0
  1952. package/.output/server/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
  1953. package/.output/server/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
  1954. package/.output/server/node_modules/zod/v4/core/standard-schema.js +1 -0
  1955. package/.output/server/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
  1956. package/.output/server/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
  1957. package/.output/server/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
  1958. package/.output/server/node_modules/zod/v4/core/util.cjs +539 -0
  1959. package/.output/server/node_modules/zod/v4/core/util.d.cts +183 -0
  1960. package/.output/server/node_modules/zod/v4/core/util.d.ts +183 -0
  1961. package/.output/server/node_modules/zod/v4/core/versions.cjs +8 -0
  1962. package/.output/server/node_modules/zod/v4/core/versions.d.cts +5 -0
  1963. package/.output/server/node_modules/zod/v4/core/versions.d.ts +5 -0
  1964. package/.output/server/node_modules/zod/v4/index.cjs +22 -0
  1965. package/.output/server/node_modules/zod/v4/index.d.cts +3 -0
  1966. package/.output/server/node_modules/zod/v4/index.d.ts +3 -0
  1967. package/.output/server/node_modules/zod/v4/locales/ar.cjs +142 -0
  1968. package/.output/server/node_modules/zod/v4/locales/ar.d.cts +4 -0
  1969. package/.output/server/node_modules/zod/v4/locales/ar.d.ts +4 -0
  1970. package/.output/server/node_modules/zod/v4/locales/az.cjs +141 -0
  1971. package/.output/server/node_modules/zod/v4/locales/az.d.cts +4 -0
  1972. package/.output/server/node_modules/zod/v4/locales/az.d.ts +4 -0
  1973. package/.output/server/node_modules/zod/v4/locales/be.cjs +190 -0
  1974. package/.output/server/node_modules/zod/v4/locales/be.d.cts +4 -0
  1975. package/.output/server/node_modules/zod/v4/locales/be.d.ts +4 -0
  1976. package/.output/server/node_modules/zod/v4/locales/ca.cjs +144 -0
  1977. package/.output/server/node_modules/zod/v4/locales/ca.d.cts +4 -0
  1978. package/.output/server/node_modules/zod/v4/locales/ca.d.ts +4 -0
  1979. package/.output/server/node_modules/zod/v4/locales/cs.cjs +161 -0
  1980. package/.output/server/node_modules/zod/v4/locales/cs.d.cts +4 -0
  1981. package/.output/server/node_modules/zod/v4/locales/cs.d.ts +4 -0
  1982. package/.output/server/node_modules/zod/v4/locales/de.cjs +142 -0
  1983. package/.output/server/node_modules/zod/v4/locales/de.d.cts +4 -0
  1984. package/.output/server/node_modules/zod/v4/locales/de.d.ts +4 -0
  1985. package/.output/server/node_modules/zod/v4/locales/en.cjs +145 -0
  1986. package/.output/server/node_modules/zod/v4/locales/en.d.cts +5 -0
  1987. package/.output/server/node_modules/zod/v4/locales/en.d.ts +5 -0
  1988. package/.output/server/node_modules/zod/v4/locales/eo.cjs +144 -0
  1989. package/.output/server/node_modules/zod/v4/locales/eo.d.cts +5 -0
  1990. package/.output/server/node_modules/zod/v4/locales/eo.d.ts +5 -0
  1991. package/.output/server/node_modules/zod/v4/locales/es.cjs +143 -0
  1992. package/.output/server/node_modules/zod/v4/locales/es.d.cts +4 -0
  1993. package/.output/server/node_modules/zod/v4/locales/es.d.ts +4 -0
  1994. package/.output/server/node_modules/zod/v4/locales/fa.cjs +148 -0
  1995. package/.output/server/node_modules/zod/v4/locales/fa.d.cts +4 -0
  1996. package/.output/server/node_modules/zod/v4/locales/fa.d.ts +4 -0
  1997. package/.output/server/node_modules/zod/v4/locales/fi.cjs +148 -0
  1998. package/.output/server/node_modules/zod/v4/locales/fi.d.cts +4 -0
  1999. package/.output/server/node_modules/zod/v4/locales/fi.d.ts +4 -0
  2000. package/.output/server/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
  2001. package/.output/server/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
  2002. package/.output/server/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  2003. package/.output/server/node_modules/zod/v4/locales/fr.cjs +142 -0
  2004. package/.output/server/node_modules/zod/v4/locales/fr.d.cts +4 -0
  2005. package/.output/server/node_modules/zod/v4/locales/fr.d.ts +4 -0
  2006. package/.output/server/node_modules/zod/v4/locales/he.cjs +143 -0
  2007. package/.output/server/node_modules/zod/v4/locales/he.d.cts +4 -0
  2008. package/.output/server/node_modules/zod/v4/locales/he.d.ts +4 -0
  2009. package/.output/server/node_modules/zod/v4/locales/hu.cjs +143 -0
  2010. package/.output/server/node_modules/zod/v4/locales/hu.d.cts +4 -0
  2011. package/.output/server/node_modules/zod/v4/locales/hu.d.ts +4 -0
  2012. package/.output/server/node_modules/zod/v4/locales/id.cjs +142 -0
  2013. package/.output/server/node_modules/zod/v4/locales/id.d.cts +4 -0
  2014. package/.output/server/node_modules/zod/v4/locales/id.d.ts +4 -0
  2015. package/.output/server/node_modules/zod/v4/locales/index.cjs +84 -0
  2016. package/.output/server/node_modules/zod/v4/locales/index.d.cts +39 -0
  2017. package/.output/server/node_modules/zod/v4/locales/index.d.ts +39 -0
  2018. package/.output/server/node_modules/zod/v4/locales/it.cjs +143 -0
  2019. package/.output/server/node_modules/zod/v4/locales/it.d.cts +4 -0
  2020. package/.output/server/node_modules/zod/v4/locales/it.d.ts +4 -0
  2021. package/.output/server/node_modules/zod/v4/locales/ja.cjs +141 -0
  2022. package/.output/server/node_modules/zod/v4/locales/ja.d.cts +4 -0
  2023. package/.output/server/node_modules/zod/v4/locales/ja.d.ts +4 -0
  2024. package/.output/server/node_modules/zod/v4/locales/kh.cjs +143 -0
  2025. package/.output/server/node_modules/zod/v4/locales/kh.d.cts +4 -0
  2026. package/.output/server/node_modules/zod/v4/locales/kh.d.ts +4 -0
  2027. package/.output/server/node_modules/zod/v4/locales/ko.cjs +147 -0
  2028. package/.output/server/node_modules/zod/v4/locales/ko.d.cts +4 -0
  2029. package/.output/server/node_modules/zod/v4/locales/ko.d.ts +4 -0
  2030. package/.output/server/node_modules/zod/v4/locales/mk.cjs +144 -0
  2031. package/.output/server/node_modules/zod/v4/locales/mk.d.cts +4 -0
  2032. package/.output/server/node_modules/zod/v4/locales/mk.d.ts +4 -0
  2033. package/.output/server/node_modules/zod/v4/locales/ms.cjs +142 -0
  2034. package/.output/server/node_modules/zod/v4/locales/ms.d.cts +4 -0
  2035. package/.output/server/node_modules/zod/v4/locales/ms.d.ts +4 -0
  2036. package/.output/server/node_modules/zod/v4/locales/nl.cjs +143 -0
  2037. package/.output/server/node_modules/zod/v4/locales/nl.d.cts +4 -0
  2038. package/.output/server/node_modules/zod/v4/locales/nl.d.ts +4 -0
  2039. package/.output/server/node_modules/zod/v4/locales/no.cjs +142 -0
  2040. package/.output/server/node_modules/zod/v4/locales/no.d.cts +4 -0
  2041. package/.output/server/node_modules/zod/v4/locales/no.d.ts +4 -0
  2042. package/.output/server/node_modules/zod/v4/locales/ota.cjs +143 -0
  2043. package/.output/server/node_modules/zod/v4/locales/ota.d.cts +4 -0
  2044. package/.output/server/node_modules/zod/v4/locales/ota.d.ts +4 -0
  2045. package/.output/server/node_modules/zod/v4/locales/pl.cjs +143 -0
  2046. package/.output/server/node_modules/zod/v4/locales/pl.d.cts +4 -0
  2047. package/.output/server/node_modules/zod/v4/locales/pl.d.ts +4 -0
  2048. package/.output/server/node_modules/zod/v4/locales/ps.cjs +148 -0
  2049. package/.output/server/node_modules/zod/v4/locales/ps.d.cts +4 -0
  2050. package/.output/server/node_modules/zod/v4/locales/ps.d.ts +4 -0
  2051. package/.output/server/node_modules/zod/v4/locales/pt.cjs +142 -0
  2052. package/.output/server/node_modules/zod/v4/locales/pt.d.cts +4 -0
  2053. package/.output/server/node_modules/zod/v4/locales/pt.d.ts +4 -0
  2054. package/.output/server/node_modules/zod/v4/locales/ru.cjs +190 -0
  2055. package/.output/server/node_modules/zod/v4/locales/ru.d.cts +4 -0
  2056. package/.output/server/node_modules/zod/v4/locales/ru.d.ts +4 -0
  2057. package/.output/server/node_modules/zod/v4/locales/sl.cjs +143 -0
  2058. package/.output/server/node_modules/zod/v4/locales/sl.d.cts +4 -0
  2059. package/.output/server/node_modules/zod/v4/locales/sl.d.ts +4 -0
  2060. package/.output/server/node_modules/zod/v4/locales/sv.cjs +144 -0
  2061. package/.output/server/node_modules/zod/v4/locales/sv.d.cts +4 -0
  2062. package/.output/server/node_modules/zod/v4/locales/sv.d.ts +4 -0
  2063. package/.output/server/node_modules/zod/v4/locales/ta.cjs +143 -0
  2064. package/.output/server/node_modules/zod/v4/locales/ta.d.cts +4 -0
  2065. package/.output/server/node_modules/zod/v4/locales/ta.d.ts +4 -0
  2066. package/.output/server/node_modules/zod/v4/locales/th.cjs +143 -0
  2067. package/.output/server/node_modules/zod/v4/locales/th.d.cts +4 -0
  2068. package/.output/server/node_modules/zod/v4/locales/th.d.ts +4 -0
  2069. package/.output/server/node_modules/zod/v4/locales/tr.cjs +143 -0
  2070. package/.output/server/node_modules/zod/v4/locales/tr.d.cts +5 -0
  2071. package/.output/server/node_modules/zod/v4/locales/tr.d.ts +5 -0
  2072. package/.output/server/node_modules/zod/v4/locales/ua.cjs +143 -0
  2073. package/.output/server/node_modules/zod/v4/locales/ua.d.cts +4 -0
  2074. package/.output/server/node_modules/zod/v4/locales/ua.d.ts +4 -0
  2075. package/.output/server/node_modules/zod/v4/locales/ur.cjs +143 -0
  2076. package/.output/server/node_modules/zod/v4/locales/ur.d.cts +4 -0
  2077. package/.output/server/node_modules/zod/v4/locales/ur.d.ts +4 -0
  2078. package/.output/server/node_modules/zod/v4/locales/vi.cjs +142 -0
  2079. package/.output/server/node_modules/zod/v4/locales/vi.d.cts +4 -0
  2080. package/.output/server/node_modules/zod/v4/locales/vi.d.ts +4 -0
  2081. package/.output/server/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
  2082. package/.output/server/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
  2083. package/.output/server/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  2084. package/.output/server/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
  2085. package/.output/server/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
  2086. package/.output/server/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  2087. package/.output/server/node_modules/zod/v4/mini/checks.cjs +34 -0
  2088. package/.output/server/node_modules/zod/v4/mini/checks.d.cts +1 -0
  2089. package/.output/server/node_modules/zod/v4/mini/checks.d.ts +1 -0
  2090. package/.output/server/node_modules/zod/v4/mini/coerce.cjs +47 -0
  2091. package/.output/server/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  2092. package/.output/server/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  2093. package/.output/server/node_modules/zod/v4/mini/external.cjs +62 -0
  2094. package/.output/server/node_modules/zod/v4/mini/external.d.cts +11 -0
  2095. package/.output/server/node_modules/zod/v4/mini/external.d.ts +11 -0
  2096. package/.output/server/node_modules/zod/v4/mini/index.cjs +32 -0
  2097. package/.output/server/node_modules/zod/v4/mini/index.d.cts +3 -0
  2098. package/.output/server/node_modules/zod/v4/mini/index.d.ts +3 -0
  2099. package/.output/server/node_modules/zod/v4/mini/iso.cjs +60 -0
  2100. package/.output/server/node_modules/zod/v4/mini/iso.d.cts +22 -0
  2101. package/.output/server/node_modules/zod/v4/mini/iso.d.ts +22 -0
  2102. package/.output/server/node_modules/zod/v4/mini/parse.cjs +8 -0
  2103. package/.output/server/node_modules/zod/v4/mini/parse.d.cts +1 -0
  2104. package/.output/server/node_modules/zod/v4/mini/parse.d.ts +1 -0
  2105. package/.output/server/node_modules/zod/v4/mini/schemas.cjs +839 -0
  2106. package/.output/server/node_modules/zod/v4/mini/schemas.d.cts +356 -0
  2107. package/.output/server/node_modules/zod/v4/mini/schemas.d.ts +356 -0
  2108. package/.output/server/node_modules/zod/v4-mini/index.cjs +17 -0
  2109. package/.output/server/node_modules/zod/v4-mini/index.d.cts +1 -0
  2110. package/.output/server/node_modules/zod/v4-mini/index.d.ts +1 -0
  2111. package/.output/server/package.json +6 -1
  2112. package/.output/skills/aw-doc-to-project/SKILL.md +127 -0
  2113. package/.output/skills/aw-line-onboarding/SKILL.md +212 -0
  2114. package/.output/skills/aw-live-acceptance-round/SKILL.md +127 -0
  2115. package/.output/skills/aw-node-bind/SKILL.md +111 -0
  2116. package/.output/skills/aw-opt-channel/SKILL.md +117 -0
  2117. package/.output/skills/aw-plc-sim-twin/SKILL.md +100 -0
  2118. package/.output/skills/aw-plugin-dev/SKILL.md +161 -0
  2119. package/.output/skills/aw-plugin-dev/references/daq-dcw-driver-contract.md +204 -0
  2120. package/.output/skills/aw-plugin-dev/references/plugin-ctx-api.md +119 -0
  2121. package/.output/skills/aw-plugin-dev/references/testing-and-acceptance.md +118 -0
  2122. package/.output/skills/aw-protocol-onboarding/SKILL.md +177 -0
  2123. package/.output/skills/aw-protocol-onboarding/references/plugin-fallback.md +124 -0
  2124. package/.output/skills/aw-protocol-onboarding/references/production-safety.md +113 -0
  2125. package/.output/skills/aw-protocol-onboarding/references/protocol-matrix.md +96 -0
  2126. package/.output/skills/aw-system-acceptance/SKILL.md +137 -0
  2127. package/README-zh.md +42 -8
  2128. package/README.md +41 -9
  2129. package/app/components/settings/AgentPrefabsPane.vue +753 -0
  2130. package/app/components/settings/McpServersPane.vue +462 -0
  2131. package/app/components/settings/SkillsPane.vue +376 -0
  2132. package/app/components/workshop/MemoryPanel.vue +81 -0
  2133. package/app/pages/settings.vue +24 -3
  2134. package/cli/commands/plugin.mjs +16 -0
  2135. package/cli/core/post-build.mjs +13 -1
  2136. package/config.yml +1 -1
  2137. package/docs/cli.en.md +1 -1
  2138. package/docs/cli.md +1 -1
  2139. package/docs/plugins.en.md +2 -2
  2140. package/docs/plugins.md +3 -3
  2141. package/docs/sdk.en.md +1 -1
  2142. package/docs/sdk.md +1 -1
  2143. package/i18n/locales/en.ts +101 -0
  2144. package/i18n/locales/zh-CN.ts +101 -0
  2145. package/package.json +3 -1
  2146. package/scripts/_audit/governed-learning-evidence.mjs +51 -0
  2147. package/scripts/_audit/governed-main-audit.mjs +60 -0
  2148. package/scripts/acceptance-governed-product-learning.mjs +110 -0
  2149. package/scripts/api-live-e2e.mjs +34 -3
  2150. package/scripts/experiments/gemma4-pipeline.mjs +808 -0
  2151. package/scripts/experiments/gemma4-supplement-fix.mjs +119 -0
  2152. package/scripts/experiments/gemma4-supplement.mjs +266 -0
  2153. package/scripts/experiments/prefab-acceptance.mjs +196 -0
  2154. package/scripts/experiments/tii-daq-repro.mjs +688 -0
  2155. package/scripts/experiments/tsa-phase-c.mjs +154 -0
  2156. package/scripts/experiments/tsa-phase-f.mjs +167 -0
  2157. package/scripts/experiments/tsa-phase-i.mjs +151 -0
  2158. package/scripts/experiments/tsa-phase-s.mjs +223 -0
  2159. package/scripts/experiments/tsa2-phase-c.mjs +259 -0
  2160. package/scripts/experiments/tsa2-phase-p.mjs +379 -0
  2161. package/scripts/experiments/tsa2-phase-p1.mjs +386 -0
  2162. package/scripts/experiments/tsa2-phase-s.mjs +224 -0
  2163. package/scripts/experiments/tsa3-phase-c.mjs +204 -0
  2164. package/scripts/experiments/tsa3-phase-s.mjs +119 -0
  2165. package/scripts/experiments/tsa3-planwatch.mjs +42 -0
  2166. package/scripts/experiments/tsa3-projectwatch.mjs +34 -0
  2167. package/scripts/experiments/tsa3-report-manifest.mjs +65 -0
  2168. package/scripts/experiments/tsa3-smoke.mjs +87 -0
  2169. package/scripts/experiments/tsa3-xchannel.mjs +62 -0
  2170. package/scripts/experiments/tsa4-aml.mjs +104 -0
  2171. package/scripts/experiments/tsa4-bench-gate.mjs +101 -0
  2172. package/scripts/experiments/tsa4-bench-hostgate.mjs +20 -0
  2173. package/scripts/experiments/tsa4-phase-c.mjs +193 -0
  2174. package/scripts/experiments/tsa4-phase-s.mjs +151 -0
  2175. package/scripts/experiments/tsa4-planwatch.mjs +42 -0
  2176. package/scripts/experiments/tsa4-project-dispatch.mjs +61 -0
  2177. package/scripts/experiments/tsa4-project-industrial.mjs +41 -0
  2178. package/scripts/experiments/tsa4-projectwatch.mjs +42 -0
  2179. package/scripts/experiments/tsa4-reconcile.mjs +46 -0
  2180. package/scripts/experiments/tsa4-report-manifest.mjs +63 -0
  2181. package/scripts/experiments/tsa4-rtu-probe.mjs +87 -0
  2182. package/scripts/experiments/tsa4-xchannel.mjs +62 -0
  2183. package/scripts/experiments/tsa5-aml.mjs +108 -0
  2184. package/scripts/experiments/tsa5-bench-gate.mjs +101 -0
  2185. package/scripts/experiments/tsa5-bench-hostgate.mjs +20 -0
  2186. package/scripts/experiments/tsa5-c23-override.mjs +99 -0
  2187. package/scripts/experiments/tsa5-phase-c.mjs +193 -0
  2188. package/scripts/experiments/tsa5-phase-s.mjs +161 -0
  2189. package/scripts/experiments/tsa5-planwatch.mjs +42 -0
  2190. package/scripts/experiments/tsa5-plugin-check.mjs +64 -0
  2191. package/scripts/experiments/tsa5-project-dispatch.mjs +71 -0
  2192. package/scripts/experiments/tsa5-projectwatch.mjs +42 -0
  2193. package/scripts/experiments/tsa5-r2-direct.mjs +65 -0
  2194. package/scripts/experiments/tsa5-reconcile.mjs +46 -0
  2195. package/scripts/experiments/tsa5-report-manifest.mjs +63 -0
  2196. package/scripts/experiments/tsa5-rtu-probe.mjs +87 -0
  2197. package/scripts/experiments/tsa5-smoke-direct.mjs +45 -0
  2198. package/scripts/experiments/tsa5-smoke.mjs +85 -0
  2199. package/scripts/experiments/tsa5-xchannel.mjs +62 -0
  2200. package/scripts/test-aw-skills.mjs +1 -1
  2201. package/sdk/examples/mes-tool-bridge/index.mjs +163 -0
  2202. package/server/api/mcp/workshop.ts +47 -9
  2203. package/server/api/system/mcp-servers/[id]/discover.post.ts +27 -0
  2204. package/server/api/system/mcp-servers/[id]/review.post.ts +38 -0
  2205. package/server/api/system/mcp-servers/[id].delete.ts +26 -0
  2206. package/server/api/system/mcp-servers/[id].get.ts +14 -0
  2207. package/server/api/system/mcp-servers/[id].patch.ts +40 -0
  2208. package/server/api/system/mcp-servers/index.get.ts +13 -0
  2209. package/server/api/system/mcp-servers/index.post.ts +39 -0
  2210. package/server/api/system/skills/[id]/file.get.ts +18 -0
  2211. package/server/api/system/skills/[id].delete.ts +28 -0
  2212. package/server/api/system/skills/[id].patch.ts +29 -0
  2213. package/server/api/system/skills/discover.get.ts +13 -0
  2214. package/server/api/system/skills/import.post.ts +30 -0
  2215. package/server/api/system/skills/index.get.ts +13 -0
  2216. package/server/api/workshop/agent-prefabs/[id]/publish.post.ts +27 -0
  2217. package/server/api/workshop/agent-prefabs/[id]/revisions/[revision].get.ts +29 -0
  2218. package/server/api/workshop/agent-prefabs/[id].get.ts +25 -0
  2219. package/server/api/workshop/agent-prefabs/[id].patch.ts +23 -0
  2220. package/server/api/workshop/agent-prefabs/catalog.get.ts +20 -0
  2221. package/server/api/workshop/agent-prefabs/index.get.ts +25 -0
  2222. package/server/api/workshop/agent-prefabs/index.post.ts +18 -0
  2223. package/server/api/workshop/channels/[id]/agents/[agentId]/prefab.patch.ts +44 -0
  2224. package/server/api/workshop/channels/[id]/memories/[memoryId]/experience.get.ts +32 -0
  2225. package/server/mcp/ingress-auth.ts +110 -0
  2226. package/server/mcp/workshop-server.ts +43 -8
  2227. package/server/services/workshop/agent-prefabs/prompt.ts +21 -0
  2228. package/server/services/workshop/agent-prefabs/registry.ts +92 -0
  2229. package/server/services/workshop/agent-prefabs/resolution.ts +208 -0
  2230. package/server/services/workshop/agent-prefabs/runtime.ts +103 -0
  2231. package/server/services/workshop/agent-prefabs/service.ts +287 -0
  2232. package/server/services/workshop/agent-prefabs/types.ts +136 -0
  2233. package/server/services/workshop/agents/adapters/omp-rpc-client/start.ts +82 -74
  2234. package/server/services/workshop/agents/agent-interface.ts +3 -0
  2235. package/server/services/workshop/agents/base-agent.ts +4 -0
  2236. package/server/services/workshop/agents/hitl-decision/reconcile.ts +12 -0
  2237. package/server/services/workshop/agents/host-tool-bridge/dispatch.ts +49 -0
  2238. package/server/services/workshop/agents/host-tool-bridge/per-agent.ts +44 -1
  2239. package/server/services/workshop/agents/host-tool-bridge/tools/skills.ts +54 -0
  2240. package/server/services/workshop/agents/session-clone.ts +10 -3
  2241. package/server/services/workshop/agents/task-channel.ts +16 -4
  2242. package/server/services/workshop/daq/batch-quality.ts +96 -0
  2243. package/server/services/workshop/db/agent-prefab.repo.ts +142 -0
  2244. package/server/services/workshop/db/channel-agent.repo.ts +12 -6
  2245. package/server/services/workshop/db/channel-session.repo.ts +10 -3
  2246. package/server/services/workshop/db/channel-template.repo.ts +4 -4
  2247. package/server/services/workshop/db/database/migrations-experience-versions.ts +92 -0
  2248. package/server/services/workshop/db/database/migrations-hitl-ref.ts +20 -0
  2249. package/server/services/workshop/db/database/migrations-prefab.ts +30 -0
  2250. package/server/services/workshop/db/database/open.ts +12 -2
  2251. package/server/services/workshop/db/database/rows.ts +2 -0
  2252. package/server/services/workshop/db/database/schema.ts +127 -1
  2253. package/server/services/workshop/db/memory.repo.ts +34 -0
  2254. package/server/services/workshop/db/project.repo.ts +15 -1
  2255. package/server/services/workshop/dcw/dcw-controller/actuation.ts +46 -0
  2256. package/server/services/workshop/dcw/write-attempt-ledger.ts +113 -0
  2257. package/server/services/workshop/experience/claim-cluster.ts +28 -0
  2258. package/server/services/workshop/experience/evaluation-run.ts +175 -0
  2259. package/server/services/workshop/experience/evidence-ledger.ts +69 -0
  2260. package/server/services/workshop/experience/gates.ts +14 -4
  2261. package/server/services/workshop/experience/ontology-proposals.ts +115 -0
  2262. package/server/services/workshop/experience/overlay.ts +7 -1
  2263. package/server/services/workshop/experience/promote.ts +7 -1
  2264. package/server/services/workshop/experience/reflection-effects.ts +155 -0
  2265. package/server/services/workshop/experience/release.ts +163 -0
  2266. package/server/services/workshop/experience/resolve.ts +142 -0
  2267. package/server/services/workshop/experience/trusted-context.ts +90 -0
  2268. package/server/services/workshop/experience/types.ts +168 -0
  2269. package/server/services/workshop/experience/versions.ts +188 -0
  2270. package/server/services/workshop/mcp-client/broker.ts +324 -0
  2271. package/server/services/workshop/mcp-client/client.ts +81 -0
  2272. package/server/services/workshop/mcp-client/config.ts +172 -0
  2273. package/server/services/workshop/mcp-client/egress.ts +182 -0
  2274. package/server/services/workshop/mcp-client/types.ts +96 -0
  2275. package/server/services/workshop/plugins/host/config.mjs +137 -135
  2276. package/server/services/workshop/projects/plan-progress.ts +140 -0
  2277. package/server/services/workshop/projects/service.ts +38 -0
  2278. package/server/services/workshop/rsi-adapter/experience.ts +3 -1
  2279. package/server/services/workshop/runtime/manager/admin-agents.ts +6 -1
  2280. package/server/services/workshop/runtime/manager/admin-channel.ts +2 -1
  2281. package/server/services/workshop/runtime/manager/channel-templates.ts +7 -6
  2282. package/server/services/workshop/runtime/manager/dependency-health.ts +68 -0
  2283. package/server/services/workshop/runtime/manager/helpers.ts +10 -0
  2284. package/server/services/workshop/runtime/manager/host-tools.ts +37 -0
  2285. package/server/services/workshop/runtime/manager/runtime-wiring.ts +22 -0
  2286. package/server/services/workshop/runtime/memory/state.ts +7 -1
  2287. package/server/services/workshop/skills/discovery.ts +327 -0
  2288. package/server/services/workshop/skills/frontmatter.ts +182 -0
  2289. package/server/services/workshop/skills/service.ts +71 -0
  2290. package/server/services/workshop/skills/store.ts +321 -0
  2291. package/server/services/workshop/skills/types.ts +93 -0
  2292. package/skills/aw-doc-to-project/SKILL.md +127 -0
  2293. package/skills/aw-line-onboarding/SKILL.md +212 -0
  2294. package/skills/aw-live-acceptance-round/SKILL.md +127 -0
  2295. package/skills/aw-node-bind/SKILL.md +111 -0
  2296. package/skills/aw-opt-channel/SKILL.md +117 -0
  2297. package/skills/aw-plc-sim-twin/SKILL.md +100 -0
  2298. package/skills/aw-plugin-dev/SKILL.md +161 -0
  2299. package/skills/aw-plugin-dev/references/daq-dcw-driver-contract.md +204 -0
  2300. package/skills/aw-plugin-dev/references/plugin-ctx-api.md +119 -0
  2301. package/skills/aw-plugin-dev/references/testing-and-acceptance.md +118 -0
  2302. package/skills/aw-protocol-onboarding/SKILL.md +177 -0
  2303. package/skills/aw-protocol-onboarding/references/plugin-fallback.md +124 -0
  2304. package/skills/aw-protocol-onboarding/references/production-safety.md +113 -0
  2305. package/skills/aw-protocol-onboarding/references/protocol-matrix.md +96 -0
  2306. package/skills/aw-system-acceptance/SKILL.md +137 -0
  2307. package/.output/public/_nuxt/B1StpOjn.js +0 -1
  2308. package/.output/public/_nuxt/BP9qUQA0.js +0 -1
  2309. package/.output/public/_nuxt/BPR97IgC2.js +0 -1
  2310. package/.output/public/_nuxt/BU-JxVjF.js +0 -1
  2311. package/.output/public/_nuxt/BiyBp4Lm.js +0 -1
  2312. package/.output/public/_nuxt/BmNTwsXr2.js +0 -1
  2313. package/.output/public/_nuxt/BnywPBgP.js +0 -1
  2314. package/.output/public/_nuxt/Bp3uXBpB.js +0 -1
  2315. package/.output/public/_nuxt/C-fZgAiU2.js +0 -1
  2316. package/.output/public/_nuxt/C3--I-an2.js +0 -1
  2317. package/.output/public/_nuxt/CFeYpumq2.js +0 -1
  2318. package/.output/public/_nuxt/CHdIms1f2.js +0 -1
  2319. package/.output/public/_nuxt/CJRdL5HV2.js +0 -1
  2320. package/.output/public/_nuxt/CS5UaQwl2.js +0 -1
  2321. package/.output/public/_nuxt/Cf_UsJwz.js +0 -1
  2322. package/.output/public/_nuxt/Co1Oqm4U.js +0 -1
  2323. package/.output/public/_nuxt/DFo96EtE.js +0 -1
  2324. package/.output/public/_nuxt/DJKjjGnC2.js +0 -1
  2325. package/.output/public/_nuxt/DUZYrBpC.js +0 -1
  2326. package/.output/public/_nuxt/DaHTeSTv.js +0 -1
  2327. package/.output/public/_nuxt/DaXOlXbH.js +0 -1
  2328. package/.output/public/_nuxt/Dasqfjig2.js +0 -1
  2329. package/.output/public/_nuxt/Dit6a9Bs.js +0 -1
  2330. package/.output/public/_nuxt/DkqV7BGi.js +0 -2
  2331. package/.output/public/_nuxt/Doq41eJy.js +0 -2
  2332. package/.output/public/_nuxt/Dpb7OXz6.js +0 -1
  2333. package/.output/public/_nuxt/DrqMMFbN.js +0 -1
  2334. package/.output/public/_nuxt/DuVKg1HC.js +0 -1
  2335. package/.output/public/_nuxt/DvsXN5k72.js +0 -1
  2336. package/.output/public/_nuxt/HSlNLQvi2.js +0 -2
  2337. package/.output/public/_nuxt/SmOmMhHD.js +0 -1
  2338. package/.output/public/_nuxt/builds/meta/2f96705b-cf57-4bde-87a4-1b818b268f0f.json +0 -1
  2339. package/.output/public/_nuxt/m90772tE.js +0 -1
  2340. package/.output/public/_nuxt/psToi-Y5.js +0 -1
  2341. package/.output/public/_nuxt/settings.NpUsT4m-.css +0 -1
  2342. package/.output/server/chunks/build/settings-CLIR9BQz.mjs +0 -1042
  2343. package/.output/server/chunks/build/settings-CLIR9BQz.mjs.map +0 -1
  2344. /package/.output/public/_nuxt/{BxHBIVAg2.js → BxHBIVAg.js} +0 -0
  2345. /package/.output/public/_nuxt/{CuOIxZ_Y.js → CuOIxZ_Y2.js} +0 -0
@@ -0,0 +1,4046 @@
1
+ import { $ as ProtocolErrorCode, At as OAuthProtectedResourceMetadataSchema, B as isJSONRPCResultResponse, Ct as checkResourceAllowed, D as buildMcpParamHeaders, Dt as OAuthClientInformationFullSchema, Ft as SdkHttpError, G as ListChangedOptionsBaseSchema, I as isJSONRPCErrorResponse, It as OAuthError, K as MODERN_WIRE_REVISION, Lt as OAuthErrorCode, Mt as OpenIdProviderDiscoveryMetadataSchema, Nt as SdkError, Ot as OAuthErrorResponseSchema, Pt as SdkErrorCode, R as isJSONRPCRequest, Rt as brandedHasInstance, S as resolveInputRequiredDriverConfig, T as HEADER_MISMATCH_ERROR_CODE, Tt as withoutIssuer, U as DiscoverResultSchema, Y as ProtocolError, Z as UnsupportedProtocolVersionError, _ as DEFAULT_REQUEST_TIMEOUT_MSEC, b as isSpecType, et as SUPPORTED_MODERN_PROTOCOL_VERSIONS, ft as LATEST_PROTOCOL_VERSION, g as runInputRequiredFlow, jt as OAuthTokensSchema, k as scanXMcpHeaderDeclarations, kt as OAuthMetadataSchema, nt as legacyProtocolVersions, q as codecForVersion, rt as modernProtocolVersions, s as fetchWithinOrigin, tt as isModernProtocolVersion, v as Protocol, vt as SERVER_INFO_META_KEY, w as parseSchema, wt as resourceUrlFromServerUrl, y as mergeCapabilities, yt as SUBSCRIPTION_ID_META_KEY, zt as stampErrorBrands } from "./src-CeKsbNLO.mjs";
2
+ import { CORS_IS_POSSIBLE, DefaultJsonSchemaValidator } from "@modelcontextprotocol/client/_shims";
3
+ import pkceChallenge from "pkce-challenge";
4
+
5
+ //#region src/client/authErrors.ts
6
+ /**
7
+ * Base class for the OAuth-client-flow error family. Concrete subclasses are
8
+ * added to this module alongside the SEP-2468/837/2207/2350/2352 behavior
9
+ * changes that throw them, so callers can catch the whole family with a single
10
+ * `instanceof OAuthClientFlowError` guard once those land.
11
+ *
12
+ * @remarks Nothing in the SDK throws this base class directly. In the release
13
+ * that introduces it no subclass exists yet — the guard is a forward-compat
14
+ * hook and will not match anything until the first behavior change ships.
15
+ */
16
+ var OAuthClientFlowError = class extends Error {
17
+ static {
18
+ Object.defineProperty(this, "mcpBrand", { value: "mcp.OAuthClientFlowError" });
19
+ }
20
+ static [Symbol.hasInstance](value) {
21
+ return brandedHasInstance(this, value);
22
+ }
23
+ /**
24
+ * Brand-based type guard: equivalent to `value instanceof this`, as an
25
+ * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
26
+ * the caller's own brand via `this`, so every branded subclass gets a
27
+ * correctly-scoped guard by inheritance. Must be invoked on the class —
28
+ * in callback position write `v => SdkError.isInstance(v)`, not
29
+ * `.filter(SdkError.isInstance)` (detached calls throw rather than
30
+ * silently matching nothing).
31
+ */
32
+ static isInstance(value) {
33
+ if (typeof this !== "function") throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
34
+ return brandedHasInstance(this, value);
35
+ }
36
+ constructor(message) {
37
+ super(message);
38
+ this.name = new.target.name;
39
+ stampErrorBrands(this, new.target);
40
+ }
41
+ };
42
+ /**
43
+ * Thrown when an authorization-server issuer identifier fails validation.
44
+ *
45
+ * Two checks raise this error, distinguished by {@linkcode IssuerMismatchError.kind | kind}:
46
+ * - `'metadata'` — the `issuer` in fetched authorization-server metadata does
47
+ * not match the issuer identifier the well-known URL was constructed from
48
+ * (RFC 8414 §3.3 / OpenID Connect Discovery §4.3).
49
+ * - `'authorization_response'` — the `iss` parameter on the authorization
50
+ * callback failed RFC 9207 §2.4 validation against the recorded issuer.
51
+ *
52
+ * Intentionally does **not** extend `OAuthError`: the `auth()`
53
+ * orchestrator's `OAuthError` retry block must not swallow this — a mix-up
54
+ * indication is fatal for the flow, not a retryable credential problem.
55
+ *
56
+ * On the `'authorization_response'` path the {@linkcode IssuerMismatchError.received | received}
57
+ * value is attacker-controllable in a mix-up attack; callers **MUST NOT** display
58
+ * it (or any `error`/`error_description`/`error_uri` from the same callback) to
59
+ * end users. The values are JSON-encoded in the message to neutralize log-injection.
60
+ */
61
+ var IssuerMismatchError = class extends OAuthClientFlowError {
62
+ static {
63
+ Object.defineProperty(this, "mcpBrand", { value: "mcp.IssuerMismatchError" });
64
+ }
65
+ /** Which check failed — metadata echo (RFC 8414 §3.3) or authorization-response `iss` (RFC 9207). */
66
+ kind;
67
+ /** The issuer the client expected (from validated metadata / discovery input). */
68
+ expected;
69
+ /** The issuer value that was received. Attacker-controllable on the `'authorization_response'` path. */
70
+ received;
71
+ constructor(kind, expected, received) {
72
+ super(`Issuer mismatch in ${kind === "metadata" ? "authorization server metadata (RFC 8414 §3.3)" : "authorization response (RFC 9207)"}: expected ${JSON.stringify(expected)}, received ${JSON.stringify(received)}`);
73
+ this.kind = kind;
74
+ this.expected = expected;
75
+ this.received = received;
76
+ }
77
+ };
78
+ /**
79
+ * Thrown by `registerClient()` when the authorization server rejects a
80
+ * Dynamic Client Registration request. Carries the HTTP status, the raw
81
+ * response body, and the metadata that was submitted, so callers can inspect
82
+ * the AS's `error` / `error_description` and retry with adjusted metadata
83
+ * (for example a different `application_type`) per SEP-837.
84
+ *
85
+ * The `body` is the raw RFC 7591 error JSON; compare `JSON.parse(body).error`
86
+ * against `OAuthErrorCode` (e.g. `OAuthErrorCode.InvalidRedirectUri`,
87
+ * `OAuthErrorCode.InvalidClientMetadata`).
88
+ *
89
+ * Intentionally does **not** extend `OAuthError`: registration rejection is
90
+ * not a recoverable-by-credential-invalidation condition, and staying outside
91
+ * that hierarchy keeps it from being caught by `auth()`'s `OAuthError` retry
92
+ * path.
93
+ */
94
+ var RegistrationRejectedError = class extends OAuthClientFlowError {
95
+ static {
96
+ Object.defineProperty(this, "mcpBrand", { value: "mcp.RegistrationRejectedError" });
97
+ }
98
+ /** HTTP status code returned by the registration endpoint. */
99
+ status;
100
+ /** Raw response body text (typically an RFC 7591 error JSON document). */
101
+ body;
102
+ /** The exact client metadata that was POSTed (after SDK defaults were applied). */
103
+ submittedMetadata;
104
+ constructor(args) {
105
+ super(`Dynamic Client Registration rejected (HTTP ${args.status}): ${args.body}`);
106
+ this.status = args.status;
107
+ this.body = args.body;
108
+ this.submittedMetadata = args.submittedMetadata;
109
+ }
110
+ };
111
+ /**
112
+ * Thrown by the token-exchange and refresh paths when the resolved token
113
+ * endpoint is not `https:` and is not a loopback host. The MCP authorization
114
+ * specification requires authorization server endpoints to use HTTPS; loopback
115
+ * hosts are exempt here for local development. This is a configuration error —
116
+ * re-authorizing cannot fix it — so it intentionally does **not** extend
117
+ * `OAuthError` and `auth()`'s refresh branch rethrows it instead of falling
118
+ * through to a fresh `/authorize` redirect.
119
+ */
120
+ var InsecureTokenEndpointError = class extends OAuthClientFlowError {
121
+ static {
122
+ Object.defineProperty(this, "mcpBrand", { value: "mcp.InsecureTokenEndpointError" });
123
+ }
124
+ /** The token endpoint URL that was rejected. */
125
+ tokenEndpoint;
126
+ constructor(tokenEndpoint) {
127
+ 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).`);
128
+ this.tokenEndpoint = tokenEndpoint;
129
+ }
130
+ };
131
+ /**
132
+ * Thrown by the HTTP client transport when the server responds with
133
+ * `403 Forbidden` and `WWW-Authenticate: Bearer error="insufficient_scope"`,
134
+ * and either (a) the transport's `onInsufficientScope` option is `'throw'`, or
135
+ * (b) `onInsufficientScope` is the default `'reauthorize'` but the transport
136
+ * has no {@linkcode index.OAuthClientProvider | OAuthClientProvider} to drive
137
+ * step-up (e.g. a minimal `AuthProvider`, `requestInit`-only headers, or no
138
+ * `authProvider`).
139
+ *
140
+ * Carries the challenge parameters so the host can decide whether to initiate
141
+ * step-up authorization itself (e.g., behind a UX gate) or surface the error.
142
+ *
143
+ * Does **not** extend `OAuthError`: that class represents OAuth protocol errors
144
+ * from the authorization server; this is a resource-server challenge surfaced
145
+ * at the transport layer.
146
+ *
147
+ * All fields originate from the resource server's `WWW-Authenticate` header;
148
+ * treat them as untrusted input when displaying or logging (this includes
149
+ * `requiredScope`, which appears in the error message).
150
+ */
151
+ /**
152
+ * Thrown by `auth()` and `fetchToken()` when the authorization server in use differs
153
+ * from the one a credential is bound to and the flow cannot simply start over:
154
+ *
155
+ * - on the authorization-code callback leg, when it differs from the one recorded
156
+ * in `discoveryState()` at redirect time — the `authorization_code` and PKCE
157
+ * `code_verifier` are bound to the AS that minted the code (RFC 7636);
158
+ * - for client information whose `issuer` stamp names a different authorization
159
+ * server on a provider that cannot re-register (no `saveClientInformation()`,
160
+ * e.g. the bundled static-credential providers); `fetchToken()` throws for any provider.
161
+ *
162
+ * Stored tokens and re-registrable client information are protected structurally
163
+ * by the `issuer` stamp instead (they read back as absent).
164
+ */
165
+ var AuthorizationServerMismatchError = class extends OAuthClientFlowError {
166
+ static {
167
+ Object.defineProperty(this, "mcpBrand", { value: "mcp.AuthorizationServerMismatchError" });
168
+ }
169
+ constructor(recordedIssuer, currentIssuer) {
170
+ 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`);
171
+ this.recordedIssuer = recordedIssuer;
172
+ this.currentIssuer = currentIssuer;
173
+ }
174
+ };
175
+ var InsufficientScopeError = class extends OAuthClientFlowError {
176
+ static {
177
+ Object.defineProperty(this, "mcpBrand", { value: "mcp.InsufficientScopeError" });
178
+ }
179
+ /** The `scope` value from the `WWW-Authenticate` challenge — the scopes the resource server says are required. */
180
+ requiredScope;
181
+ /** The `resource_metadata` URL from the `WWW-Authenticate` challenge, if present. */
182
+ resourceMetadataUrl;
183
+ /** The `error_description` from the `WWW-Authenticate` challenge, if present. */
184
+ errorDescription;
185
+ constructor(init) {
186
+ super(`Insufficient scope${init.requiredScope ? `: required "${init.requiredScope}"` : ""}`);
187
+ this.requiredScope = init.requiredScope;
188
+ this.resourceMetadataUrl = init.resourceMetadataUrl;
189
+ this.errorDescription = init.errorDescription;
190
+ }
191
+ };
192
+
193
+ //#endregion
194
+ //#region src/client/auth.ts
195
+ /**
196
+ * SEP-2352 stamp check: returns `stored` only when its `issuer` stamp matches the
197
+ * resolved authorization server. A stamp that names a *different* issuer reads back
198
+ * as `undefined`, so a credential issued by one authorization server is never reused
199
+ * at another — the flow falls through to re-registration / re-authorization exactly
200
+ * as if nothing were stored. An unstamped value (legacy provider or pre-SEP-2352
201
+ * storage) is returned as-is with a `console.warn`; {@linkcode auth} writes the
202
+ * stamp back on first use so the window closes after one call.
203
+ *
204
+ * {@linkcode auth} stamps every value it writes via `saveTokens` / `saveClientInformation`,
205
+ * so a provider that round-trips the stored object verbatim is protected with no extra
206
+ * code. Providers that hold credentials for multiple authorization servers key their
207
+ * storage on `ctx.issuer` instead.
208
+ *
209
+ * @param opts.canPersistStamp - When `false`, suppresses the unstamped-credential
210
+ * warning: the caller cannot back-stamp (no `saveClientInformation`), so the
211
+ * "binding on first use" claim would be false and would fire on every call.
212
+ */
213
+ function discardIfIssuerMismatch(stored, issuer, opts) {
214
+ if (!stored) return void 0;
215
+ if (typeof stored.issuer !== "string") {
216
+ 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.");
217
+ return stored.issuer === void 0 ? stored : {
218
+ ...stored,
219
+ issuer: void 0
220
+ };
221
+ }
222
+ return issuersMatch(stored.issuer, issuer) ? stored : void 0;
223
+ }
224
+ /**
225
+ * SEP-2352 issuer-identity comparison. Tolerates a single trailing `/` difference,
226
+ * mirroring the RFC 8414 §3.3 "one narrow tolerance" applied at metadata-echo
227
+ * validation in {@linkcode discoverAuthorizationServerMetadata}: when the SDK
228
+ * derives an issuer from `String(new URL(...))` (always slash-suffixed) and the AS
229
+ * publishes a slash-free `metadata.issuer`, the two name the same authorization
230
+ * server.
231
+ */
232
+ function issuersMatch(a, b) {
233
+ return a === b || a.endsWith("/") && a.slice(0, -1) === b || b.endsWith("/") && b.slice(0, -1) === a;
234
+ }
235
+ /**
236
+ * Type guard distinguishing `OAuthClientProvider` from a minimal `AuthProvider`.
237
+ * Transports use this at construction time to classify the `authProvider` option.
238
+ *
239
+ * Checks for `tokens()` + `clientInformation()` — two required `OAuthClientProvider`
240
+ * methods that a minimal `AuthProvider` `{ token: ... }` would never have.
241
+ */
242
+ function isOAuthClientProvider(provider) {
243
+ if (provider == null) return false;
244
+ const p = provider;
245
+ return typeof p.tokens === "function" && typeof p.clientInformation === "function";
246
+ }
247
+ /**
248
+ * Standard `onUnauthorized` behavior for OAuth providers: extracts
249
+ * `WWW-Authenticate` parameters from the 401 response and runs {@linkcode auth}.
250
+ * Used by {@linkcode adaptOAuthProvider} to bridge `OAuthClientProvider` to `AuthProvider`.
251
+ */
252
+ async function handleOAuthUnauthorized(provider, ctx, extraAuthOptions) {
253
+ const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(ctx.response);
254
+ if (await auth(provider, {
255
+ serverUrl: ctx.serverUrl,
256
+ resourceMetadataUrl,
257
+ scope,
258
+ fetchFn: ctx.fetchFn,
259
+ ...extraAuthOptions
260
+ }) !== "AUTHORIZED") throw new UnauthorizedError();
261
+ }
262
+ /**
263
+ * Adapts an `OAuthClientProvider` to the minimal `AuthProvider` interface that
264
+ * transports consume. Called once at transport construction — the transport stores
265
+ * the adapted provider for `_commonHeaders()` and 401 handling, while keeping the
266
+ * original `OAuthClientProvider` for OAuth-specific paths (`finishAuth()`, 403 `insufficient_scope` step-up).
267
+ *
268
+ * SEP-2352 note: `token()` here is the per-request `Authorization: Bearer …` read for
269
+ * the *resource server* (the MCP transport URL), not an authorization server. No OAuth
270
+ * discovery has run at this layer, so there is no `issuer` to pass as `ctx` and no
271
+ * {@linkcode discardIfIssuerMismatch} check to apply — the access token is sent only to
272
+ * the resource server, never to an AS, so the SEP-2352 cross-AS isolation invariant is
273
+ * not in scope. Providers that key storage on `ctx.issuer` MUST treat `ctx === undefined`
274
+ * as "return the most-recently-saved token set" (the only consumer is the resource server
275
+ * the token was minted for); providers that round-trip a single blob need no change.
276
+ *
277
+ * SEP-1932 (DPoP) note: DPoP request-signing is deliberately *not* done here. When the provider
278
+ * implements {@linkcode OAuthClientProvider.dpop | dpop()}, the transports wrap their
279
+ * resource-server `fetch` with {@linkcode withDpopFromProvider}, which upgrades the `Bearer` header
280
+ * this adapter produces to `DPoP` + proof for DPoP-bound tokens and handles nonce challenges — at
281
+ * the one layer that sees the real method, URL and response of every request.
282
+ */
283
+ function adaptOAuthProvider(provider, extraAuthOptions) {
284
+ return {
285
+ token: async () => {
286
+ return (await provider.tokens())?.access_token;
287
+ },
288
+ onUnauthorized: async (ctx) => handleOAuthUnauthorized(provider, ctx, extraAuthOptions)
289
+ };
290
+ }
291
+ var UnauthorizedError = class extends Error {
292
+ static {
293
+ Object.defineProperty(this, "mcpBrand", { value: "mcp.UnauthorizedError" });
294
+ }
295
+ static [Symbol.hasInstance](value) {
296
+ return brandedHasInstance(this, value);
297
+ }
298
+ /**
299
+ * Brand-based type guard: equivalent to `value instanceof this`, as an
300
+ * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads
301
+ * the caller's own brand via `this`, so every branded subclass gets a
302
+ * correctly-scoped guard by inheritance. Must be invoked on the class —
303
+ * in callback position write `v => SdkError.isInstance(v)`, not
304
+ * `.filter(SdkError.isInstance)` (detached calls throw rather than
305
+ * silently matching nothing).
306
+ */
307
+ static isInstance(value) {
308
+ if (typeof this !== "function") throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
309
+ return brandedHasInstance(this, value);
310
+ }
311
+ constructor(message) {
312
+ super(message ?? "Unauthorized");
313
+ this.name = "UnauthorizedError";
314
+ stampErrorBrands(this, new.target);
315
+ }
316
+ };
317
+ /**
318
+ * Validates the `iss` parameter from an authorization response against the
319
+ * issuer recorded from the authorization server's validated metadata, per
320
+ * RFC 9207 §2.4 and the MCP specification's four-row decision table.
321
+ *
322
+ * | `issParameterSupported` | `iss` | Action |
323
+ * | ----------------------- | ------- | ------------------------------------------------ |
324
+ * | `true` | present | compare; throw {@linkcode IssuerMismatchError} on mismatch |
325
+ * | `true` | absent | throw {@linkcode IssuerMismatchError} |
326
+ * | `false` | present | compare; throw {@linkcode IssuerMismatchError} on mismatch |
327
+ * | `false` | absent | proceed (no-op) |
328
+ *
329
+ * Comparison is **simple string equality** (RFC 3986 §6.2.1). Scheme/host case
330
+ * folding, default-port elision, trailing-slash, and percent-encoding
331
+ * normalization are explicitly **not** applied — any difference is a mismatch.
332
+ *
333
+ * When `expectedIssuer` is `undefined` (no validated metadata document exists),
334
+ * the check has no authentic baseline and degenerates to a no-op.
335
+ *
336
+ * @throws {IssuerMismatchError} with `kind: 'authorization_response'`
337
+ */
338
+ /**
339
+ * Reads RFC 9207's `authorization_response_iss_parameter_supported` from
340
+ * authorization-server metadata. Only a literal `true` counts as advertised;
341
+ * absent, `false`, or a non-boolean wire value (coerced to `undefined` by the
342
+ * schema) means not advertised.
343
+ */
344
+ function isIssParameterSupported(metadata) {
345
+ return metadata?.authorization_response_iss_parameter_supported === true;
346
+ }
347
+ function validateAuthorizationResponseIssuer({ iss, expectedIssuer, issParameterSupported }) {
348
+ if (expectedIssuer === void 0) return;
349
+ if (iss === void 0) {
350
+ if (issParameterSupported) throw new IssuerMismatchError("authorization_response", expectedIssuer, void 0);
351
+ return;
352
+ }
353
+ if (iss !== expectedIssuer) throw new IssuerMismatchError("authorization_response", expectedIssuer, iss);
354
+ }
355
+ /**
356
+ * Computes the union of one or more OAuth `scope` strings.
357
+ *
358
+ * Each argument is a space-delimited scope string per RFC 6749 §3.3, or
359
+ * `undefined`. The result is a single space-delimited string containing each
360
+ * distinct scope token exactly once, in first-seen order, or `undefined` if
361
+ * every input is empty/undefined.
362
+ *
363
+ * No hierarchical deduplication is performed: a union may contain semantically
364
+ * redundant entries (e.g., a broad scope alongside a narrower one it implies).
365
+ * Authorization servers normalize such redundancy during token issuance; the
366
+ * spec's step-up flow does not require clients to.
367
+ *
368
+ * Used by the transport's `403 insufficient_scope` step-up path to accumulate
369
+ * previously-requested scopes with newly-challenged scopes so re-authorization
370
+ * does not lose previously-granted permissions.
371
+ */
372
+ function computeScopeUnion(...scopes) {
373
+ const seen = /* @__PURE__ */ new Set();
374
+ for (const scope of scopes) {
375
+ if (!scope) continue;
376
+ for (const token of scope.split(/\s+/)) if (token) seen.add(token);
377
+ }
378
+ return seen.size > 0 ? [...seen].join(" ") : void 0;
379
+ }
380
+ /**
381
+ * Whether `union` contains at least one scope token not present in `current`.
382
+ * Both arguments are space-delimited scope strings per RFC 6749 §3.3.
383
+ *
384
+ * Used to gate the step-up refresh bypass: when the union of previously-requested
385
+ * and newly-challenged scopes is a strict superset of the current token's
386
+ * granted scope, refreshing cannot widen the grant (RFC 6749 §6), so the
387
+ * transport must force a fresh authorization request instead. When the current
388
+ * token already covers the union, refresh remains valid.
389
+ *
390
+ * An undefined or empty `current` is treated as the empty set, so any non-empty
391
+ * `union` is a strict superset. Note that per RFC 6749 §3.3 an authorization
392
+ * server MAY omit the token's `scope` field when it equals the requested scope;
393
+ * this helper is conservative and treats an absent token `scope` as empty, so
394
+ * step-up always forces a fresh authorization request in that case rather than
395
+ * risking a refresh that silently drops the widened scope.
396
+ */
397
+ function isStrictScopeSuperset(union, current) {
398
+ if (!union) return false;
399
+ const currentSet = new Set((current ?? "").split(/\s+/).filter(Boolean));
400
+ for (const token of union.split(/\s+/)) if (token && !currentSet.has(token)) return true;
401
+ return false;
402
+ }
403
+ /**
404
+ * Shared `finishAuth` resolver for the `(code, iss?)` and `(URLSearchParams)` overloads.
405
+ *
406
+ * For the `URLSearchParams` form, only `iss` and `code` are read up front. When a `code` is
407
+ * present the returned values flow into {@linkcode auth}, which runs
408
+ * {@linkcode validateAuthorizationResponseIssuer} against freshly-discovered metadata before
409
+ * the code is redeemed — so on mismatch the thrown {@linkcode IssuerMismatchError} carries no
410
+ * `error`/`error_description`/`error_uri` text from the callback (those are attacker-controlled
411
+ * in a mix-up). When no `code` is present (an error-shaped callback), `iss` is validated here
412
+ * against the provider's recorded discovery state — or, when the provider does not implement
413
+ * `discoveryState`, against freshly-discovered metadata mirroring what {@linkcode auth} does on
414
+ * the code-present path — **before** the callback's error parameters are read; only after that
415
+ * passes are they surfaced as an {@linkcode OAuthError}. When no issuer baseline can be
416
+ * obtained either way, a generic {@linkcode UnauthorizedError} is thrown without surfacing the
417
+ * callback's `error`/`error_description`/`error_uri`.
418
+ *
419
+ * @internal Exported for the transport `finishAuth` overloads; not part of the public barrel.
420
+ */
421
+ async function resolveAuthorizationCallbackParams(codeOrParams, iss, provider, serverUrl, opts) {
422
+ if (typeof codeOrParams === "string") return {
423
+ authorizationCode: codeOrParams,
424
+ iss
425
+ };
426
+ const issParam = codeOrParams.get("iss") ?? void 0;
427
+ const code = codeOrParams.get("code");
428
+ if (code) return {
429
+ authorizationCode: code,
430
+ iss: issParam
431
+ };
432
+ let metadata = (await provider.discoveryState?.())?.authorizationServerMetadata;
433
+ if (!metadata) try {
434
+ metadata = (await discoverOAuthServerInfo(serverUrl, opts)).authorizationServerMetadata;
435
+ } catch {
436
+ metadata = void 0;
437
+ }
438
+ if (!metadata) throw new UnauthorizedError("Authorization callback failed and the issuer could not be verified");
439
+ validateAuthorizationResponseIssuer({
440
+ iss: issParam,
441
+ expectedIssuer: metadata.issuer,
442
+ issParameterSupported: isIssParameterSupported(metadata)
443
+ });
444
+ const error = codeOrParams.get("error");
445
+ if (error) throw new OAuthError(error, codeOrParams.get("error_description") ?? error, codeOrParams.get("error_uri") ?? void 0);
446
+ throw new UnauthorizedError("Authorization callback contained neither `code` nor `error`");
447
+ }
448
+ function isClientAuthMethod(method) {
449
+ return [
450
+ "client_secret_basic",
451
+ "client_secret_post",
452
+ "none"
453
+ ].includes(method);
454
+ }
455
+ const AUTHORIZATION_CODE_RESPONSE_TYPE = "code";
456
+ const AUTHORIZATION_CODE_CHALLENGE_METHOD = "S256";
457
+ /**
458
+ * Determines the best client authentication method to use based on server support and client configuration.
459
+ *
460
+ * Priority order (highest to lowest):
461
+ * 1. `client_secret_basic` (if client secret is available)
462
+ * 2. `client_secret_post` (if client secret is available)
463
+ * 3. `none` (for public clients)
464
+ *
465
+ * @param clientInformation - OAuth client information containing credentials
466
+ * @param supportedMethods - Authentication methods supported by the authorization server
467
+ * @returns The selected authentication method
468
+ */
469
+ function selectClientAuthMethod(clientInformation, supportedMethods) {
470
+ const hasClientSecret = clientInformation.client_secret !== void 0;
471
+ if ("token_endpoint_auth_method" in clientInformation && clientInformation.token_endpoint_auth_method && isClientAuthMethod(clientInformation.token_endpoint_auth_method) && (supportedMethods.length === 0 || supportedMethods.includes(clientInformation.token_endpoint_auth_method))) return clientInformation.token_endpoint_auth_method;
472
+ if (supportedMethods.length === 0) return hasClientSecret ? "client_secret_basic" : "none";
473
+ if (hasClientSecret && supportedMethods.includes("client_secret_basic")) return "client_secret_basic";
474
+ if (hasClientSecret && supportedMethods.includes("client_secret_post")) return "client_secret_post";
475
+ if (supportedMethods.includes("none")) return "none";
476
+ return hasClientSecret ? "client_secret_post" : "none";
477
+ }
478
+ /**
479
+ * Applies client authentication to the request based on the specified method.
480
+ *
481
+ * Implements OAuth 2.1 client authentication methods:
482
+ * - `client_secret_basic`: HTTP Basic authentication (RFC 6749 Section 2.3.1)
483
+ * - `client_secret_post`: Credentials in request body (RFC 6749 Section 2.3.1)
484
+ * - `none`: Public client authentication (RFC 6749 Section 2.1)
485
+ *
486
+ * @param method - The authentication method to use
487
+ * @param clientInformation - OAuth client information containing credentials
488
+ * @param headers - HTTP headers object to modify
489
+ * @param params - URL search parameters to modify
490
+ * @throws {Error} When required credentials are missing
491
+ */
492
+ function applyClientAuthentication(method, clientInformation, headers, params) {
493
+ const { client_id, client_secret } = clientInformation;
494
+ switch (method) {
495
+ case "client_secret_basic":
496
+ applyBasicAuth(client_id, client_secret, headers);
497
+ return;
498
+ case "client_secret_post":
499
+ applyPostAuth(client_id, client_secret, params);
500
+ return;
501
+ case "none":
502
+ applyPublicAuth(client_id, params);
503
+ return;
504
+ default: throw new Error(`Unsupported client authentication method: ${method}`);
505
+ }
506
+ }
507
+ /**
508
+ * Applies HTTP Basic authentication (RFC 6749 Section 2.3.1)
509
+ */
510
+ function applyBasicAuth(clientId, clientSecret, headers) {
511
+ if (!clientSecret) throw new Error("client_secret_basic authentication requires a client_secret");
512
+ const credentials = btoa(`${clientId}:${clientSecret}`);
513
+ headers.set("Authorization", `Basic ${credentials}`);
514
+ }
515
+ /**
516
+ * Applies POST body authentication (RFC 6749 Section 2.3.1)
517
+ */
518
+ function applyPostAuth(clientId, clientSecret, params) {
519
+ params.set("client_id", clientId);
520
+ if (clientSecret) params.set("client_secret", clientSecret);
521
+ }
522
+ /**
523
+ * Applies public client authentication (RFC 6749 Section 2.1)
524
+ */
525
+ function applyPublicAuth(clientId, params) {
526
+ params.set("client_id", clientId);
527
+ }
528
+ /**
529
+ * Loopback hosts exempt from the in-transit `https:` requirement (RFC 8252 §7.3).
530
+ * Includes bare `localhost` and any name ending in `.localhost` (RFC 6761 §6.3).
531
+ */
532
+ function isLoopbackHost(hostname) {
533
+ return hostname === "localhost" || hostname.endsWith(".localhost") || hostname === "127.0.0.1" || hostname === "[::1]" || hostname === "::1";
534
+ }
535
+ /**
536
+ * Refuse to send credentials to a non-TLS token endpoint. The MCP authorization
537
+ * specification requires authorization server endpoints to use HTTPS. Loopback
538
+ * hosts are exempt here for local development.
539
+ *
540
+ * @throws {@linkcode InsecureTokenEndpointError} if the endpoint is insecure.
541
+ */
542
+ function assertSecureTokenEndpoint(tokenEndpoint) {
543
+ const url = new URL(String(tokenEndpoint));
544
+ if (url.protocol !== "https:" && !isLoopbackHost(url.hostname)) throw new InsecureTokenEndpointError(url.href);
545
+ return url;
546
+ }
547
+ /**
548
+ * Derives an OIDC `application_type` from a client's registered redirect URIs
549
+ * when the consumer has not set one explicitly (SEP-837). Loopback hosts and
550
+ * non-`http(s)` custom URI schemes indicate a native application (RFC 8252);
551
+ * everything else is treated as a web application. The result is a heuristic
552
+ * default — callers that know better should set `clientMetadata.application_type`
553
+ * themselves, which {@linkcode resolveClientMetadata} never overwrites.
554
+ *
555
+ * A mixed redirect set (for example a public `https:` URI alongside a loopback
556
+ * URI) is inherently ambiguous under OIDC DCR §2 — neither value satisfies the
557
+ * AS for both URIs — so consumers with mixed sets should set `application_type`
558
+ * explicitly rather than relying on this heuristic.
559
+ */
560
+ function deriveApplicationType(redirectUris) {
561
+ for (const raw of redirectUris ?? []) {
562
+ let url;
563
+ try {
564
+ url = new URL(raw);
565
+ } catch {
566
+ continue;
567
+ }
568
+ if (url.protocol !== "http:" && url.protocol !== "https:") return "native";
569
+ if (isLoopbackHost(url.hostname)) return "native";
570
+ }
571
+ return "web";
572
+ }
573
+ /**
574
+ * Reads {@linkcode OAuthClientProvider.clientMetadata | clientMetadata} from the
575
+ * provider and fills the SEP-837 / SEP-2207 defaults the SDK relies on, so
576
+ * {@linkcode registerClient} sees a consistent, fully-populated document.
577
+ *
578
+ * - `grant_types` defaults to `['authorization_code', 'refresh_token']` for
579
+ * interactive providers (those with a {@linkcode OAuthClientProvider.redirectUrl | redirectUrl})
580
+ * so authorization servers that gate refresh-token issuance on the registered
581
+ * grant types issue one (SEP-2207). Non-interactive providers (no
582
+ * `redirectUrl`) get no `grant_types` default. This default applies to the
583
+ * Dynamic Client Registration body only — it does **not** drive
584
+ * {@linkcode determineScope}'s `offline_access` augmentation.
585
+ * - `application_type` defaults from `redirect_uris`: loopback redirect hosts
586
+ * and custom URI schemes → `'native'`, otherwise `'web'` (SEP-837 / RFC 8252).
587
+ *
588
+ * A field the consumer set explicitly is **never** overwritten. {@linkcode auth}
589
+ * calls this once at the top of the flow; direct callers of
590
+ * {@linkcode registerClient} that want the same defaults should pass the result
591
+ * of this function as `clientMetadata`.
592
+ */
593
+ function resolveClientMetadata(provider) {
594
+ const clientMetadata = provider.clientMetadata;
595
+ return {
596
+ ...clientMetadata,
597
+ grant_types: clientMetadata.grant_types ?? (provider.redirectUrl === void 0 ? void 0 : ["authorization_code", "refresh_token"]),
598
+ application_type: clientMetadata.application_type ?? deriveApplicationType(clientMetadata.redirect_uris)
599
+ };
600
+ }
601
+ /**
602
+ * Parses an OAuth error response from a string or Response object.
603
+ *
604
+ * If the input is a standard OAuth2.0 error response, it will be parsed according to the spec
605
+ * and an {@linkcode OAuthError} will be returned with the appropriate error code.
606
+ * If parsing fails, it falls back to a generic {@linkcode OAuthErrorCode.ServerError | ServerError} that includes
607
+ * the response status (if available) and original content.
608
+ *
609
+ * @param input - A Response object or string containing the error response
610
+ * @returns A Promise that resolves to an {@linkcode OAuthError} instance
611
+ */
612
+ async function parseErrorResponse(input) {
613
+ const statusCode = input instanceof Response ? input.status : void 0;
614
+ const body = input instanceof Response ? await input.text() : input;
615
+ try {
616
+ const result = OAuthErrorResponseSchema.parse(JSON.parse(body));
617
+ return OAuthError.fromResponse(result);
618
+ } catch (error) {
619
+ const errorMessage = `${statusCode ? `HTTP ${statusCode}: ` : ""}Invalid OAuth error response: ${error}. Raw body: ${body}`;
620
+ return new OAuthError(OAuthErrorCode.ServerError, errorMessage);
621
+ }
622
+ }
623
+ /**
624
+ * Recovering from a recoverable OAuth error discards stored credentials and silently starts a
625
+ * fresh authorization. On a headless client whose `redirectToAuthorization()` is a no-op that
626
+ * recovery is indistinguishable from nothing happening at all, so name the cause. The most
627
+ * common case is `invalid_grant` — an expired, revoked, or rotation-reuse-detected refresh
628
+ * token. See issue #2034.
629
+ */
630
+ function warnCredentialInvalidation(provider, error, invalidated) {
631
+ const action = provider.invalidateCredentials === void 0 ? `retrying authorization without discarding the stored ${invalidated} (provider implements no invalidateCredentials())` : `invalidating the stored ${invalidated} and retrying authorization`;
632
+ console.warn(`[mcp-sdk] OAuth ${JSON.stringify(error.code)} — ${action}. Cause: ${JSON.stringify(error.message)}`);
633
+ }
634
+ /**
635
+ * Orchestrates the full auth flow with a server.
636
+ *
637
+ * This can be used as a single entry point for all authorization functionality,
638
+ * instead of linking together the other lower-level functions in this module.
639
+ */
640
+ async function auth(provider, options) {
641
+ try {
642
+ return await authInternal(provider, options);
643
+ } catch (error) {
644
+ if (error instanceof OAuthError) {
645
+ if (error.code === OAuthErrorCode.InvalidClient || error.code === OAuthErrorCode.UnauthorizedClient) {
646
+ warnCredentialInvalidation(provider, error, "client credentials and tokens");
647
+ await provider.invalidateCredentials?.("client");
648
+ await provider.invalidateCredentials?.("tokens");
649
+ return await authInternal(provider, options);
650
+ } else if (error.code === OAuthErrorCode.InvalidGrant || error.code === OAuthErrorCode.InvalidDpopProof) {
651
+ warnCredentialInvalidation(provider, error, "tokens");
652
+ await provider.invalidateCredentials?.("tokens");
653
+ return await authInternal(provider, options);
654
+ }
655
+ }
656
+ throw error;
657
+ }
658
+ }
659
+ /**
660
+ * Selects scopes per the MCP spec and augment for refresh token support.
661
+ */
662
+ function determineScope(options) {
663
+ const { requestedScope, resourceMetadata, authServerMetadata, clientMetadata } = options;
664
+ let effectiveScope = requestedScope || resourceMetadata?.scopes_supported?.join(" ") || clientMetadata.scope;
665
+ if (effectiveScope && authServerMetadata?.scopes_supported?.includes("offline_access") && !effectiveScope.split(" ").includes("offline_access") && clientMetadata.grant_types?.includes("refresh_token")) effectiveScope = `${effectiveScope} offline_access`;
666
+ return effectiveScope;
667
+ }
668
+ async function authInternal(provider, { serverUrl, authorizationCode, iss, scope, resourceMetadataUrl, fetchFn, skipIssuerMetadataValidation, forceReauthorization }) {
669
+ const clientMetadata = resolveClientMetadata(provider);
670
+ const cachedState = await provider.discoveryState?.();
671
+ let resourceMetadata;
672
+ let authorizationServerUrl;
673
+ let metadata;
674
+ let freshDiscoveryState;
675
+ let effectiveResourceMetadataUrl = resourceMetadataUrl;
676
+ if (!effectiveResourceMetadataUrl && cachedState?.resourceMetadataUrl) effectiveResourceMetadataUrl = new URL(cachedState.resourceMetadataUrl);
677
+ if (cachedState?.authorizationServerUrl) {
678
+ authorizationServerUrl = cachedState.authorizationServerUrl;
679
+ resourceMetadata = cachedState.resourceMetadata;
680
+ metadata = cachedState.authorizationServerMetadata ?? await discoverAuthorizationServerMetadata(authorizationServerUrl, {
681
+ fetchFn,
682
+ skipIssuerValidation: skipIssuerMetadataValidation
683
+ });
684
+ if (!resourceMetadata) try {
685
+ resourceMetadata = await discoverOAuthProtectedResourceMetadata(serverUrl, { resourceMetadataUrl: effectiveResourceMetadataUrl }, fetchFn);
686
+ } catch (error) {
687
+ if (error instanceof TypeError) throw error;
688
+ }
689
+ if (metadata !== cachedState.authorizationServerMetadata || resourceMetadata !== cachedState.resourceMetadata) await provider.saveDiscoveryState?.({
690
+ authorizationServerUrl: String(authorizationServerUrl),
691
+ resourceMetadataUrl: effectiveResourceMetadataUrl?.toString(),
692
+ resourceMetadata,
693
+ authorizationServerMetadata: metadata
694
+ });
695
+ } else {
696
+ const serverInfo = await discoverOAuthServerInfo(serverUrl, {
697
+ resourceMetadataUrl: effectiveResourceMetadataUrl,
698
+ fetchFn,
699
+ skipIssuerMetadataValidation
700
+ });
701
+ authorizationServerUrl = serverInfo.authorizationServerUrl;
702
+ metadata = serverInfo.authorizationServerMetadata;
703
+ resourceMetadata = serverInfo.resourceMetadata;
704
+ freshDiscoveryState = {
705
+ authorizationServerUrl: String(authorizationServerUrl),
706
+ resourceMetadataUrl: effectiveResourceMetadataUrl?.toString(),
707
+ resourceMetadata,
708
+ authorizationServerMetadata: metadata
709
+ };
710
+ }
711
+ const issuer = metadata?.issuer ?? String(authorizationServerUrl);
712
+ const infoCtx = { issuer };
713
+ await provider.saveAuthorizationServerUrl?.(issuer);
714
+ if (authorizationCode !== void 0) {
715
+ const recordedIssuer = cachedState?.authorizationServerMetadata?.issuer ?? cachedState?.authorizationServerUrl;
716
+ if (recordedIssuer === void 0) {
717
+ if (provider.saveDiscoveryState !== void 0) throw new AuthorizationServerMismatchError("discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier", issuer);
718
+ console.warn("[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md §SEP-2352.");
719
+ } else if (!issuersMatch(recordedIssuer, issuer)) throw new AuthorizationServerMismatchError(recordedIssuer, issuer);
720
+ }
721
+ if (freshDiscoveryState) await provider.saveDiscoveryState?.(freshDiscoveryState);
722
+ const selectedResource = await selectResourceURL(serverUrl, provider, resourceMetadata);
723
+ const resource = selectedResource && resourceMetadata && !provider.validateResourceURL ? resourceMetadata.resource : selectedResource;
724
+ if (resource) await provider.saveResourceUrl?.(resourceIndicatorToString(resource));
725
+ const resolvedScope = determineScope({
726
+ requestedScope: scope,
727
+ resourceMetadata,
728
+ authServerMetadata: metadata,
729
+ clientMetadata: provider.clientMetadata
730
+ });
731
+ const rawClientInfo = await Promise.resolve(provider.clientInformation(infoCtx));
732
+ let clientInformation = discardIfIssuerMismatch(rawClientInfo, issuer, { canPersistStamp: provider.saveClientInformation !== void 0 });
733
+ if (clientInformation === void 0 && rawClientInfo?.issuer && provider.saveClientInformation === void 0) throw new AuthorizationServerMismatchError(rawClientInfo.issuer, issuer);
734
+ if (clientInformation && clientInformation.issuer === void 0) {
735
+ clientInformation = {
736
+ ...clientInformation,
737
+ issuer
738
+ };
739
+ await provider.saveClientInformation?.(clientInformation, infoCtx);
740
+ }
741
+ if (!clientInformation) {
742
+ if (authorizationCode !== void 0) throw new Error("Existing OAuth client information is required when exchanging an authorization code");
743
+ const supportsUrlBasedClientId = metadata?.client_id_metadata_document_supported === true;
744
+ const clientMetadataUrl = provider.clientMetadataUrl;
745
+ if (clientMetadataUrl && !isHttpsUrl(clientMetadataUrl)) throw new OAuthError(OAuthErrorCode.InvalidClientMetadata, `clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${clientMetadataUrl}`);
746
+ if (supportsUrlBasedClientId && clientMetadataUrl) {
747
+ clientInformation = {
748
+ client_id: clientMetadataUrl,
749
+ issuer
750
+ };
751
+ await provider.saveClientInformation?.(clientInformation, infoCtx);
752
+ } else {
753
+ if (!provider.saveClientInformation) throw new Error("OAuth client information must be saveable for dynamic registration");
754
+ clientInformation = {
755
+ ...await registerClient(authorizationServerUrl, {
756
+ metadata,
757
+ clientMetadata,
758
+ scope: resolvedScope,
759
+ fetchFn
760
+ }),
761
+ issuer
762
+ };
763
+ await provider.saveClientInformation(clientInformation, infoCtx);
764
+ }
765
+ }
766
+ const nonInteractiveFlow = !provider.redirectUrl;
767
+ if (authorizationCode !== void 0 || nonInteractiveFlow) {
768
+ if (authorizationCode !== void 0) validateAuthorizationResponseIssuer({
769
+ iss,
770
+ expectedIssuer: metadata?.issuer,
771
+ issParameterSupported: isIssParameterSupported(metadata)
772
+ });
773
+ const tokens$1 = await fetchToken(provider, authorizationServerUrl, {
774
+ metadata,
775
+ resource,
776
+ authorizationCode,
777
+ iss,
778
+ scope: resolvedScope,
779
+ fetchFn
780
+ });
781
+ await provider.saveTokens({
782
+ ...tokens$1,
783
+ issuer
784
+ }, infoCtx);
785
+ return "AUTHORIZED";
786
+ }
787
+ let tokens = discardIfIssuerMismatch(await provider.tokens(infoCtx), issuer);
788
+ if (tokens && tokens.issuer === void 0) {
789
+ tokens = {
790
+ ...tokens,
791
+ issuer
792
+ };
793
+ await provider.saveTokens(tokens, infoCtx);
794
+ }
795
+ if (tokens?.refresh_token && !forceReauthorization) {
796
+ const refreshScope = await provider.scopeForRefresh?.(tokens);
797
+ let newTokens;
798
+ try {
799
+ newTokens = await refreshAuthorization(authorizationServerUrl, {
800
+ metadata,
801
+ clientInformation,
802
+ refreshToken: tokens.refresh_token,
803
+ scope: refreshScope,
804
+ resource,
805
+ addClientAuthentication: provider.addClientAuthentication,
806
+ dpop: await provider.dpop?.(),
807
+ fetchFn
808
+ });
809
+ } catch (error) {
810
+ if (error instanceof InsecureTokenEndpointError) throw error;
811
+ if (!(error instanceof OAuthError) || error.code === OAuthErrorCode.ServerError) console.warn(`[mcp-sdk] Could not refresh OAuth tokens; falling back to a new authorization request. Cause: ${JSON.stringify(error instanceof Error ? error.message : String(error))}`);
812
+ else throw error;
813
+ }
814
+ if (newTokens) {
815
+ await provider.saveTokens({
816
+ ...newTokens,
817
+ issuer
818
+ }, infoCtx);
819
+ return "AUTHORIZED";
820
+ }
821
+ }
822
+ const state = provider.state ? await provider.state() : void 0;
823
+ const { authorizationUrl, codeVerifier } = await startAuthorization(authorizationServerUrl, {
824
+ metadata,
825
+ clientInformation,
826
+ state,
827
+ redirectUrl: provider.redirectUrl,
828
+ scope: resolvedScope,
829
+ resource
830
+ });
831
+ await provider.saveCodeVerifier(codeVerifier);
832
+ await provider.redirectToAuthorization(authorizationUrl);
833
+ return "REDIRECT";
834
+ }
835
+ /**
836
+ * Validates that the given `clientMetadataUrl` is a valid HTTPS URL with a non-root pathname.
837
+ *
838
+ * No-op when `url` is `undefined` or empty (providers that do not use URL-based client IDs
839
+ * are unaffected). When the value is defined but invalid, throws an {@linkcode OAuthError}
840
+ * with code {@linkcode OAuthErrorCode.InvalidClientMetadata}.
841
+ *
842
+ * {@linkcode OAuthClientProvider} implementations that accept a `clientMetadataUrl` should
843
+ * call this in their constructors for early validation.
844
+ *
845
+ * @param url - The `clientMetadataUrl` value to validate (from `OAuthClientProvider.clientMetadataUrl`)
846
+ * @throws {OAuthError} When `url` is defined but is not a valid HTTPS URL with a non-root pathname
847
+ */
848
+ function validateClientMetadataUrl(url) {
849
+ if (url && !isHttpsUrl(url)) throw new OAuthError(OAuthErrorCode.InvalidClientMetadata, `clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${url}`);
850
+ }
851
+ /**
852
+ * SEP-991: URL-based Client IDs
853
+ * Validate that the `client_id` is a valid URL with `https` scheme
854
+ */
855
+ function isHttpsUrl(value) {
856
+ if (!value) return false;
857
+ try {
858
+ const url = new URL(value);
859
+ return url.protocol === "https:" && url.pathname !== "/";
860
+ } catch {
861
+ return false;
862
+ }
863
+ }
864
+ /**
865
+ * Selects the RFC 8707 resource indicator for an MCP server: the provider's
866
+ * {@linkcode OAuthClientProvider.validateResourceURL | validateResourceURL} result when
867
+ * implemented, otherwise the protected resource metadata's `resource` (checked against the
868
+ * server URL with `checkResourceAllowed`), or `undefined` when there is no metadata.
869
+ *
870
+ * The result is a parsed `URL`, so a pathless indicator such as `https://example.com` has
871
+ * the `href` `https://example.com/`. {@linkcode auth} therefore sends the metadata string
872
+ * verbatim instead of this URL's `href` (#1968); callers that emit the `resource`
873
+ * parameter themselves should do the same.
874
+ */
875
+ async function selectResourceURL(serverUrl, provider, resourceMetadata) {
876
+ const defaultResource = resourceUrlFromServerUrl(serverUrl);
877
+ if (provider.validateResourceURL) return await provider.validateResourceURL(defaultResource, resourceMetadata?.resource);
878
+ if (!resourceMetadata) return;
879
+ if (!checkResourceAllowed({
880
+ requestedResource: defaultResource,
881
+ configuredResource: resourceMetadata.resource
882
+ })) throw new Error(`Protected resource ${resourceMetadata.resource} does not match expected ${defaultResource} (or origin)`);
883
+ return new URL(resourceMetadata.resource);
884
+ }
885
+ /** Auth-scheme challenge tokens {@linkcode extractWWWAuthenticateParams} recognizes. */
886
+ const RECOGNIZED_CHALLENGE_SCHEMES = new Set(["bearer", "dpop"]);
887
+ /**
888
+ * Extract `resource_metadata`, `scope`, `error`, and `error_description` from a
889
+ * `WWW-Authenticate` header.
890
+ *
891
+ * Recognizes both the `Bearer` scheme (RFC 6750) and the `DPoP` scheme (RFC 9449 §7.1,
892
+ * SEP-1932) — a DPoP-protected resource's challenge carries the same parameters under `DPoP`
893
+ * instead of `Bearer`, and this must still surface `resource_metadata`/`scope` from it for
894
+ * discovery and SEP-2350 step-up to work against such a resource.
895
+ */
896
+ function extractWWWAuthenticateParams(res) {
897
+ const authenticateHeader = res.headers.get("WWW-Authenticate");
898
+ if (!authenticateHeader) return {};
899
+ const [type, scheme] = authenticateHeader.split(" ");
900
+ if (!type || !RECOGNIZED_CHALLENGE_SCHEMES.has(type.toLowerCase()) || !scheme) return {};
901
+ const resourceMetadataMatch = extractFieldFromWwwAuth(res, "resource_metadata") || void 0;
902
+ let resourceMetadataUrl;
903
+ if (resourceMetadataMatch) try {
904
+ resourceMetadataUrl = new URL(resourceMetadataMatch);
905
+ } catch {}
906
+ const scope = extractFieldFromWwwAuth(res, "scope") || void 0;
907
+ const error = extractFieldFromWwwAuth(res, "error") || void 0;
908
+ const errorDescription = extractFieldFromWwwAuth(res, "error_description") || void 0;
909
+ return {
910
+ resourceMetadataUrl,
911
+ scope,
912
+ error,
913
+ errorDescription
914
+ };
915
+ }
916
+ /**
917
+ * Extracts a specific field's value from the `WWW-Authenticate` header string.
918
+ *
919
+ * @param response The HTTP response object containing the headers.
920
+ * @param fieldName The name of the field to extract (e.g., `"realm"`, `"nonce"`).
921
+ * @returns The field value
922
+ */
923
+ function extractFieldFromWwwAuth(response, fieldName) {
924
+ const wwwAuthHeader = response.headers.get("WWW-Authenticate");
925
+ if (!wwwAuthHeader) return null;
926
+ const pattern = new RegExp(String.raw`${fieldName}=(?:"([^"]+)"|([^\s,]+))`);
927
+ const match = wwwAuthHeader.match(pattern);
928
+ if (match) {
929
+ const result = match[1] || match[2];
930
+ if (result) return result;
931
+ }
932
+ return null;
933
+ }
934
+ /**
935
+ * Extract `resource_metadata` from response header.
936
+ * @deprecated Use {@linkcode extractWWWAuthenticateParams} instead.
937
+ */
938
+ function extractResourceMetadataUrl(res) {
939
+ const authenticateHeader = res.headers.get("WWW-Authenticate");
940
+ if (!authenticateHeader) return;
941
+ const [type, scheme] = authenticateHeader.split(" ");
942
+ if (type?.toLowerCase() !== "bearer" || !scheme) return;
943
+ const match = /resource_metadata="([^"]*)"/.exec(authenticateHeader);
944
+ if (!match || !match[1]) return;
945
+ try {
946
+ return new URL(match[1]);
947
+ } catch {
948
+ return;
949
+ }
950
+ }
951
+ /**
952
+ * Looks up {@link https://datatracker.ietf.org/doc/html/rfc9728 | RFC 9728}
953
+ * OAuth 2.0 Protected Resource Metadata.
954
+ *
955
+ * If the server returns a 404 for the well-known endpoint, this function will
956
+ * return `undefined`. Any other errors will be thrown as exceptions.
957
+ */
958
+ async function discoverOAuthProtectedResourceMetadata(serverUrl, opts, fetchFn = fetch) {
959
+ const response = await discoverMetadataWithFallback(serverUrl, "oauth-protected-resource", fetchFn, {
960
+ protocolVersion: opts?.protocolVersion,
961
+ metadataUrl: opts?.resourceMetadataUrl
962
+ });
963
+ if (!response || response.status === 404) {
964
+ await response?.text?.().catch(() => {});
965
+ throw new Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);
966
+ }
967
+ if (!response.ok) {
968
+ await response.text?.().catch(() => {});
969
+ throw new Error(`HTTP ${response.status} trying to load well-known OAuth protected resource metadata.`);
970
+ }
971
+ return OAuthProtectedResourceMetadataSchema.parse(await response.json());
972
+ }
973
+ /**
974
+ * Fetch with a retry heuristic for CORS errors caused by custom headers.
975
+ *
976
+ * In browsers, adding a custom header (e.g. `MCP-Protocol-Version`) triggers a CORS preflight.
977
+ * If the server doesn't allow that header, the browser throws a `TypeError` before any response
978
+ * is received. Retrying without custom headers often succeeds because the request becomes
979
+ * "simple" (no preflight). If the server sends no CORS headers at all, the retry also fails
980
+ * with `TypeError` and we return `undefined` so callers can fall through to an alternate URL.
981
+ *
982
+ * However, `fetch()` also throws `TypeError` for non-CORS failures (DNS resolution, connection
983
+ * refused, invalid URL). Swallowing those and returning `undefined` masks real errors and can
984
+ * cause callers to silently fall through to a different discovery URL. CORS is a browser-only
985
+ * concept, so in non-browser runtimes (Node.js, Workers) a `TypeError` from `fetch` is never a
986
+ * CORS error — there we propagate the error instead of swallowing it.
987
+ *
988
+ * In browsers, we cannot reliably distinguish CORS `TypeError` from network `TypeError` from the
989
+ * error object alone, so the swallow-and-fallthrough heuristic is preserved there.
990
+ */
991
+ async function fetchWithCorsRetry(url, headers, fetchFn = fetch) {
992
+ const withinOrigin = fetchWithinOrigin(fetchFn);
993
+ try {
994
+ return await withinOrigin(url, { headers });
995
+ } catch (error) {
996
+ if (!(error instanceof TypeError) || !CORS_IS_POSSIBLE) throw error;
997
+ if (headers) try {
998
+ return await withinOrigin(url, {});
999
+ } catch (retryError) {
1000
+ if (!(retryError instanceof TypeError)) throw retryError;
1001
+ return;
1002
+ }
1003
+ return;
1004
+ }
1005
+ }
1006
+ /**
1007
+ * Constructs the well-known path for auth-related metadata discovery
1008
+ */
1009
+ function buildWellKnownPath(wellKnownPrefix, pathname = "", options = {}) {
1010
+ if (pathname.endsWith("/")) pathname = pathname.slice(0, -1);
1011
+ return options.prependPathname ? `${pathname}/.well-known/${wellKnownPrefix}` : `/.well-known/${wellKnownPrefix}${pathname}`;
1012
+ }
1013
+ /**
1014
+ * Tries to discover OAuth metadata at a specific URL
1015
+ */
1016
+ async function tryMetadataDiscovery(url, protocolVersion, fetchFn = fetch) {
1017
+ return await fetchWithCorsRetry(url, { "MCP-Protocol-Version": protocolVersion }, fetchFn);
1018
+ }
1019
+ /**
1020
+ * Determines if fallback to root discovery should be attempted
1021
+ */
1022
+ function shouldAttemptFallback(response, pathname) {
1023
+ if (!response) return true;
1024
+ if (pathname === "/") return false;
1025
+ return !response.ok && response.status < 500 || response.status === 502;
1026
+ }
1027
+ /**
1028
+ * Generic function for discovering OAuth metadata with fallback support
1029
+ */
1030
+ async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, opts) {
1031
+ const issuer = new URL(serverUrl);
1032
+ const protocolVersion = opts?.protocolVersion ?? LATEST_PROTOCOL_VERSION;
1033
+ let url;
1034
+ if (opts?.metadataUrl) url = new URL(opts.metadataUrl);
1035
+ else {
1036
+ const wellKnownPath = buildWellKnownPath(wellKnownType, issuer.pathname);
1037
+ url = new URL(wellKnownPath, opts?.metadataServerUrl ?? issuer);
1038
+ url.search = issuer.search;
1039
+ }
1040
+ let response = await tryMetadataDiscovery(url, protocolVersion, fetchFn);
1041
+ if (!opts?.metadataUrl && shouldAttemptFallback(response, issuer.pathname)) response = await tryMetadataDiscovery(new URL(`/.well-known/${wellKnownType}`, issuer), protocolVersion, fetchFn);
1042
+ return response;
1043
+ }
1044
+ /**
1045
+ * Looks up RFC 8414 OAuth 2.0 Authorization Server Metadata.
1046
+ *
1047
+ * If the server returns a 404 for the well-known endpoint, this function will
1048
+ * return `undefined`. Any other errors will be thrown as exceptions.
1049
+ *
1050
+ * @deprecated This function is deprecated in favor of {@linkcode discoverAuthorizationServerMetadata}.
1051
+ */
1052
+ async function discoverOAuthMetadata(issuer, { authorizationServerUrl, protocolVersion } = {}, fetchFn = fetch) {
1053
+ if (typeof issuer === "string") issuer = new URL(issuer);
1054
+ if (!authorizationServerUrl) authorizationServerUrl = issuer;
1055
+ if (typeof authorizationServerUrl === "string") authorizationServerUrl = new URL(authorizationServerUrl);
1056
+ protocolVersion ??= LATEST_PROTOCOL_VERSION;
1057
+ const response = await discoverMetadataWithFallback(authorizationServerUrl, "oauth-authorization-server", fetchFn, {
1058
+ protocolVersion,
1059
+ metadataServerUrl: authorizationServerUrl
1060
+ });
1061
+ if (!response || response.status === 404) {
1062
+ await response?.text?.().catch(() => {});
1063
+ return;
1064
+ }
1065
+ if (!response.ok) {
1066
+ await response.text?.().catch(() => {});
1067
+ throw new Error(`HTTP ${response.status} trying to load well-known OAuth metadata`);
1068
+ }
1069
+ return OAuthMetadataSchema.parse(await response.json());
1070
+ }
1071
+ /**
1072
+ * Builds a list of discovery URLs to try for authorization server metadata.
1073
+ * URLs are returned in priority order:
1074
+ * 1. OAuth metadata at the given URL
1075
+ * 2. OIDC metadata endpoints at the given URL
1076
+ */
1077
+ function buildDiscoveryUrls(authorizationServerUrl) {
1078
+ const url = typeof authorizationServerUrl === "string" ? new URL(authorizationServerUrl) : authorizationServerUrl;
1079
+ const hasPath = url.pathname !== "/";
1080
+ const urlsToTry = [];
1081
+ if (!hasPath) {
1082
+ urlsToTry.push({
1083
+ url: new URL("/.well-known/oauth-authorization-server", url.origin),
1084
+ type: "oauth"
1085
+ }, {
1086
+ url: new URL(`/.well-known/openid-configuration`, url.origin),
1087
+ type: "oidc"
1088
+ });
1089
+ return urlsToTry;
1090
+ }
1091
+ let pathname = url.pathname;
1092
+ if (pathname.endsWith("/")) pathname = pathname.slice(0, -1);
1093
+ urlsToTry.push({
1094
+ url: new URL(`/.well-known/oauth-authorization-server${pathname}`, url.origin),
1095
+ type: "oauth"
1096
+ }, {
1097
+ url: new URL(`/.well-known/openid-configuration${pathname}`, url.origin),
1098
+ type: "oidc"
1099
+ }, {
1100
+ url: new URL(`${pathname}/.well-known/openid-configuration`, url.origin),
1101
+ type: "oidc"
1102
+ });
1103
+ return urlsToTry;
1104
+ }
1105
+ /**
1106
+ * Discovers authorization server metadata with support for
1107
+ * {@link https://datatracker.ietf.org/doc/html/rfc8414 | RFC 8414} OAuth 2.0
1108
+ * Authorization Server Metadata and
1109
+ * {@link https://openid.net/specs/openid-connect-discovery-1_0.html | OpenID Connect Discovery 1.0}
1110
+ * specifications.
1111
+ *
1112
+ * This function implements a fallback strategy for authorization server discovery:
1113
+ * 1. Attempts RFC 8414 OAuth metadata discovery first
1114
+ * 2. If OAuth discovery fails, falls back to OpenID Connect Discovery
1115
+ *
1116
+ * @param authorizationServerUrl - The authorization server URL obtained from the MCP Server's
1117
+ * protected resource metadata, or the MCP server's URL if the
1118
+ * metadata was not found.
1119
+ * The returned metadata's `issuer` is validated against `authorizationServerUrl`
1120
+ * per RFC 8414 §3.3 (and OIDC Discovery §4.3): if they differ the metadata is
1121
+ * **rejected** with {@linkcode IssuerMismatchError} and not returned. Set
1122
+ * `skipIssuerValidation: true` to suppress this check — **security-weakening**,
1123
+ * intended only for known-misconfigured authorization servers.
1124
+ *
1125
+ * @param options - Configuration options
1126
+ * @param options.fetchFn - Optional fetch function for making HTTP requests, defaults to global fetch
1127
+ * @param options.protocolVersion - MCP protocol version to use, defaults to {@linkcode LATEST_PROTOCOL_VERSION}
1128
+ * @param options.skipIssuerValidation - Skip the RFC 8414 §3.3 `issuer` echo check. **Security-weakening.**
1129
+ * @returns Promise resolving to authorization server metadata, or undefined if discovery fails
1130
+ * @throws {IssuerMismatchError} when the metadata's `issuer` does not match `authorizationServerUrl`
1131
+ */
1132
+ async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn = fetch, protocolVersion = LATEST_PROTOCOL_VERSION, skipIssuerValidation = false } = {}) {
1133
+ const headers = {
1134
+ "MCP-Protocol-Version": protocolVersion,
1135
+ Accept: "application/json"
1136
+ };
1137
+ const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);
1138
+ for (const { url: endpointUrl, type } of urlsToTry) {
1139
+ const response = await fetchWithCorsRetry(endpointUrl, headers, fetchFn);
1140
+ if (!response)
1141
+ /**
1142
+ * CORS error occurred - don't throw as the endpoint may not allow CORS,
1143
+ * continue trying other possible endpoints
1144
+ */
1145
+ continue;
1146
+ if (!response.ok) {
1147
+ await response.text?.().catch(() => {});
1148
+ if (response.status < 500 || response.status === 502) continue;
1149
+ throw new Error(`HTTP ${response.status} trying to load ${type === "oauth" ? "OAuth" : "OpenID provider"} metadata from ${endpointUrl}`);
1150
+ }
1151
+ const parsed = type === "oauth" ? OAuthMetadataSchema.parse(await response.json()) : OpenIdProviderDiscoveryMetadataSchema.parse(await response.json());
1152
+ if (!skipIssuerValidation) {
1153
+ const expectedIssuer = typeof authorizationServerUrl === "string" ? authorizationServerUrl : authorizationServerUrl.href;
1154
+ if (!(parsed.issuer === expectedIssuer || expectedIssuer.endsWith("/") && parsed.issuer === expectedIssuer.slice(0, -1))) throw new IssuerMismatchError("metadata", expectedIssuer, parsed.issuer);
1155
+ }
1156
+ return parsed;
1157
+ }
1158
+ }
1159
+ /**
1160
+ * Discovers the authorization server for an MCP server following
1161
+ * {@link https://datatracker.ietf.org/doc/html/rfc9728 | RFC 9728} (OAuth 2.0 Protected
1162
+ * Resource Metadata), with fallback to treating the server URL as the
1163
+ * authorization server.
1164
+ *
1165
+ * This function combines two discovery steps into one call:
1166
+ * 1. Probes `/.well-known/oauth-protected-resource` on the MCP server to find the
1167
+ * authorization server URL (RFC 9728).
1168
+ * 2. Fetches authorization server metadata from that URL (RFC 8414 / OpenID Connect Discovery).
1169
+ *
1170
+ * Use this when you need the authorization server metadata for operations outside the
1171
+ * {@linkcode auth} orchestrator, such as token refresh or token revocation.
1172
+ *
1173
+ * @param serverUrl - The MCP resource server URL
1174
+ * @param opts - Optional configuration
1175
+ * @param opts.resourceMetadataUrl - Override URL for the protected resource metadata endpoint
1176
+ * @param opts.fetchFn - Custom fetch function for HTTP requests
1177
+ * @returns Authorization server URL, metadata, and resource metadata (if available)
1178
+ */
1179
+ async function discoverOAuthServerInfo(serverUrl, opts) {
1180
+ let resourceMetadata;
1181
+ let authorizationServerUrl;
1182
+ try {
1183
+ resourceMetadata = await discoverOAuthProtectedResourceMetadata(serverUrl, { resourceMetadataUrl: opts?.resourceMetadataUrl }, opts?.fetchFn);
1184
+ if (resourceMetadata.authorization_servers && resourceMetadata.authorization_servers.length > 0) authorizationServerUrl = resourceMetadata.authorization_servers[0];
1185
+ } catch (error) {
1186
+ if (error instanceof TypeError) throw error;
1187
+ }
1188
+ if (!authorizationServerUrl) authorizationServerUrl = String(new URL("/", serverUrl));
1189
+ const authorizationServerMetadata = await discoverAuthorizationServerMetadata(authorizationServerUrl, {
1190
+ fetchFn: opts?.fetchFn,
1191
+ skipIssuerValidation: opts?.skipIssuerMetadataValidation
1192
+ });
1193
+ return {
1194
+ authorizationServerUrl,
1195
+ authorizationServerMetadata,
1196
+ resourceMetadata
1197
+ };
1198
+ }
1199
+ function resourceIndicatorToString(resource) {
1200
+ return typeof resource === "string" ? resource : resource.href;
1201
+ }
1202
+ /**
1203
+ * Begins the authorization flow with the given server, by generating a PKCE challenge and constructing the authorization URL.
1204
+ */
1205
+ async function startAuthorization(authorizationServerUrl, { metadata, clientInformation, redirectUrl, scope, state, resource }) {
1206
+ let authorizationUrl;
1207
+ if (metadata) {
1208
+ authorizationUrl = new URL(metadata.authorization_endpoint);
1209
+ if (!metadata.response_types_supported.includes(AUTHORIZATION_CODE_RESPONSE_TYPE)) throw new Error(`Incompatible auth server: does not support response type ${AUTHORIZATION_CODE_RESPONSE_TYPE}`);
1210
+ if (metadata.code_challenge_methods_supported && !metadata.code_challenge_methods_supported.includes(AUTHORIZATION_CODE_CHALLENGE_METHOD)) throw new Error(`Incompatible auth server: does not support code challenge method ${AUTHORIZATION_CODE_CHALLENGE_METHOD}`);
1211
+ } else authorizationUrl = new URL("/authorize", authorizationServerUrl);
1212
+ const challenge = await pkceChallenge();
1213
+ const codeVerifier = challenge.code_verifier;
1214
+ const codeChallenge = challenge.code_challenge;
1215
+ authorizationUrl.searchParams.set("response_type", AUTHORIZATION_CODE_RESPONSE_TYPE);
1216
+ authorizationUrl.searchParams.set("client_id", clientInformation.client_id);
1217
+ authorizationUrl.searchParams.set("code_challenge", codeChallenge);
1218
+ authorizationUrl.searchParams.set("code_challenge_method", AUTHORIZATION_CODE_CHALLENGE_METHOD);
1219
+ authorizationUrl.searchParams.set("redirect_uri", String(redirectUrl));
1220
+ if (state) authorizationUrl.searchParams.set("state", state);
1221
+ if (scope) authorizationUrl.searchParams.set("scope", scope);
1222
+ if (scope?.split(" ").includes("offline_access")) authorizationUrl.searchParams.append("prompt", "consent");
1223
+ if (resource) authorizationUrl.searchParams.set("resource", resourceIndicatorToString(resource));
1224
+ return {
1225
+ authorizationUrl,
1226
+ codeVerifier
1227
+ };
1228
+ }
1229
+ /**
1230
+ * Prepares token request parameters for an authorization code exchange.
1231
+ *
1232
+ * This is the default implementation used by {@linkcode fetchToken} when the provider
1233
+ * doesn't implement {@linkcode OAuthClientProvider.prepareTokenRequest | prepareTokenRequest}.
1234
+ *
1235
+ * @param authorizationCode - The authorization code received from the authorization endpoint
1236
+ * @param codeVerifier - The PKCE code verifier
1237
+ * @param redirectUri - The redirect URI used in the authorization request
1238
+ * @returns URLSearchParams for the `authorization_code` grant
1239
+ */
1240
+ function prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, redirectUri) {
1241
+ return new URLSearchParams({
1242
+ grant_type: "authorization_code",
1243
+ code: authorizationCode,
1244
+ code_verifier: codeVerifier,
1245
+ redirect_uri: String(redirectUri)
1246
+ });
1247
+ }
1248
+ /**
1249
+ * Internal helper to execute a token request with the given parameters.
1250
+ * Used by {@linkcode exchangeAuthorization}, {@linkcode refreshAuthorization}, and {@linkcode fetchToken}.
1251
+ */
1252
+ async function executeTokenRequest(authorizationServerUrl, { metadata, tokenRequestParams, clientInformation, addClientAuthentication, resource, dpop, fetchFn }) {
1253
+ const tokenUrl = assertSecureTokenEndpoint(metadata?.token_endpoint ?? new URL("/token", authorizationServerUrl));
1254
+ const headers = new Headers({
1255
+ "Content-Type": "application/x-www-form-urlencoded",
1256
+ Accept: "application/json"
1257
+ });
1258
+ if (resource) tokenRequestParams.set("resource", resourceIndicatorToString(resource));
1259
+ if (!addClientAuthentication && clientInformation) applyClientAuthentication(selectClientAuthMethod(clientInformation, metadata?.token_endpoint_auth_methods_supported ?? []), clientInformation, headers, tokenRequestParams);
1260
+ const requestOnce = async () => {
1261
+ const requestHeaders = new Headers(headers);
1262
+ if (addClientAuthentication) await addClientAuthentication(requestHeaders, tokenRequestParams, tokenUrl, metadata);
1263
+ if (dpop) requestHeaders.set("DPoP", await dpop.buildProof({
1264
+ htm: "POST",
1265
+ htu: tokenUrl
1266
+ }));
1267
+ return fetchWithinOrigin(fetchFn ?? fetch)(tokenUrl, {
1268
+ method: "POST",
1269
+ headers: requestHeaders,
1270
+ body: tokenRequestParams
1271
+ });
1272
+ };
1273
+ let response = await requestOnce();
1274
+ if (dpop && response.status === 400) {
1275
+ if ((await response.clone().json().catch(() => {}))?.error === OAuthErrorCode.UseDpopNonce) {
1276
+ dpop.observeNonce(response, tokenUrl);
1277
+ response = await requestOnce();
1278
+ }
1279
+ }
1280
+ dpop?.observeNonce(response, tokenUrl);
1281
+ if (!response.ok) throw await parseErrorResponse(response);
1282
+ const json = await response.json();
1283
+ try {
1284
+ return OAuthTokensSchema.parse(withoutIssuer(json));
1285
+ } catch (parseError) {
1286
+ if (typeof json === "object" && json !== null && "error" in json) throw await parseErrorResponse(JSON.stringify(json));
1287
+ throw parseError;
1288
+ }
1289
+ }
1290
+ /**
1291
+ * Exchanges an authorization code for an access token with the given server.
1292
+ *
1293
+ * Supports multiple client authentication methods as specified in OAuth 2.1:
1294
+ * - Automatically selects the best authentication method based on server support
1295
+ * - Falls back to appropriate defaults when server metadata is unavailable
1296
+ *
1297
+ * @param authorizationServerUrl - The authorization server's base URL
1298
+ * @param options - Configuration object containing client info, auth code, etc.
1299
+ * @returns Promise resolving to OAuth tokens
1300
+ * @throws {Error} When token exchange fails or authentication is invalid
1301
+ */
1302
+ async function exchangeAuthorization(authorizationServerUrl, { metadata, clientInformation, authorizationCode, iss, codeVerifier, redirectUri, resource, addClientAuthentication, dpop, fetchFn }) {
1303
+ validateAuthorizationResponseIssuer({
1304
+ iss,
1305
+ expectedIssuer: metadata?.issuer,
1306
+ issParameterSupported: isIssParameterSupported(metadata)
1307
+ });
1308
+ return executeTokenRequest(authorizationServerUrl, {
1309
+ metadata,
1310
+ tokenRequestParams: prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, redirectUri),
1311
+ clientInformation,
1312
+ addClientAuthentication,
1313
+ resource,
1314
+ dpop,
1315
+ fetchFn
1316
+ });
1317
+ }
1318
+ /**
1319
+ * Exchange a refresh token for an updated access token.
1320
+ *
1321
+ * Supports multiple client authentication methods as specified in OAuth 2.1:
1322
+ * - Automatically selects the best authentication method based on server support
1323
+ * - Preserves the original refresh token if a new one is not returned
1324
+ *
1325
+ * @param authorizationServerUrl - The authorization server's base URL
1326
+ * @param options - Configuration object containing client info, refresh token, etc.
1327
+ * @returns Promise resolving to OAuth tokens (preserves original `refresh_token` if not replaced)
1328
+ * @throws {Error} When token refresh fails or authentication is invalid
1329
+ */
1330
+ async function refreshAuthorization(authorizationServerUrl, { metadata, clientInformation, refreshToken, scope, resource, addClientAuthentication, dpop, fetchFn }) {
1331
+ const tokenRequestParams = new URLSearchParams({
1332
+ grant_type: "refresh_token",
1333
+ refresh_token: refreshToken
1334
+ });
1335
+ if (scope) tokenRequestParams.set("scope", scope);
1336
+ const tokens = await executeTokenRequest(authorizationServerUrl, {
1337
+ metadata,
1338
+ tokenRequestParams,
1339
+ clientInformation,
1340
+ addClientAuthentication,
1341
+ resource,
1342
+ dpop,
1343
+ fetchFn
1344
+ });
1345
+ return {
1346
+ refresh_token: refreshToken,
1347
+ ...tokens,
1348
+ ...scope && !tokens.scope && { scope }
1349
+ };
1350
+ }
1351
+ /**
1352
+ * Unified token fetching that works with any grant type via {@linkcode OAuthClientProvider.prepareTokenRequest | prepareTokenRequest()}.
1353
+ *
1354
+ * This function provides a single entry point for obtaining tokens regardless of the
1355
+ * OAuth grant type. The provider's `prepareTokenRequest()` method determines which grant
1356
+ * to use and supplies the grant-specific parameters.
1357
+ *
1358
+ * @param provider - OAuth client provider that implements `prepareTokenRequest()`
1359
+ * @param authorizationServerUrl - The authorization server's base URL
1360
+ * @param options - Configuration for the token request
1361
+ * @returns Promise resolving to OAuth tokens
1362
+ * @throws {Error} When provider doesn't implement `prepareTokenRequest` or token fetch fails
1363
+ *
1364
+ * @example
1365
+ * ```ts source="./auth.examples.ts#fetchToken_clientCredentials"
1366
+ * // Provider for client_credentials:
1367
+ * class MyProvider extends MyProviderBase implements OAuthClientProvider {
1368
+ * prepareTokenRequest(scope?: string) {
1369
+ * const params = new URLSearchParams({ grant_type: 'client_credentials' });
1370
+ * if (scope) params.set('scope', scope);
1371
+ * return params;
1372
+ * }
1373
+ * }
1374
+ *
1375
+ * const tokens = await fetchToken(new MyProvider(), authServerUrl, { metadata });
1376
+ * ```
1377
+ */
1378
+ async function fetchToken(provider, authorizationServerUrl, { metadata, resource, authorizationCode, iss, scope, fetchFn } = {}) {
1379
+ if (authorizationCode !== void 0) validateAuthorizationResponseIssuer({
1380
+ iss,
1381
+ expectedIssuer: metadata?.issuer,
1382
+ issParameterSupported: isIssParameterSupported(metadata)
1383
+ });
1384
+ const issuer = metadata?.issuer ?? String(authorizationServerUrl);
1385
+ const readClientInformation = async () => {
1386
+ const rawClientInfo = await provider.clientInformation({ issuer });
1387
+ const checked = discardIfIssuerMismatch(rawClientInfo, issuer, { canPersistStamp: false });
1388
+ if (rawClientInfo && checked === void 0) throw new AuthorizationServerMismatchError(String(rawClientInfo.issuer), issuer);
1389
+ return checked;
1390
+ };
1391
+ let clientInformation = await readClientInformation();
1392
+ const effectiveScope = scope ?? provider.clientMetadata.scope;
1393
+ let tokenRequestParams;
1394
+ if (provider.prepareTokenRequest) tokenRequestParams = await provider.prepareTokenRequest(effectiveScope);
1395
+ if (!tokenRequestParams) {
1396
+ if (!authorizationCode) throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");
1397
+ if (!provider.redirectUrl) throw new Error("redirectUrl is required for authorization_code flow");
1398
+ tokenRequestParams = prepareAuthorizationCodeRequest(authorizationCode, await provider.codeVerifier(), provider.redirectUrl);
1399
+ }
1400
+ clientInformation ??= await readClientInformation();
1401
+ return executeTokenRequest(authorizationServerUrl, {
1402
+ metadata,
1403
+ tokenRequestParams,
1404
+ clientInformation,
1405
+ addClientAuthentication: provider.addClientAuthentication,
1406
+ resource,
1407
+ dpop: await provider.dpop?.(),
1408
+ fetchFn
1409
+ });
1410
+ }
1411
+ /**
1412
+ * Performs OAuth 2.0 Dynamic Client Registration according to
1413
+ * {@link https://datatracker.ietf.org/doc/html/rfc7591 | RFC 7591}.
1414
+ *
1415
+ * If `scope` is provided, it overrides `clientMetadata.scope` in the registration
1416
+ * request body. This allows callers to apply the Scope Selection Strategy (SEP-835)
1417
+ * consistently across both DCR and the subsequent authorization request.
1418
+ *
1419
+ * @deprecated Dynamic Client Registration is deprecated as of protocol version
1420
+ * 2026-07-28 in favor of Client ID Metadata Documents (SEP-991); the deprecation
1421
+ * landed via spec PR
1422
+ * {@link https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2858 | modelcontextprotocol#2858}
1423
+ * (SEP-2577 is the separate roots/sampling/logging deprecation). Remains
1424
+ * functional during the deprecation window — at least twelve months under the
1425
+ * feature lifecycle policy (SEP-2596), so 2027-07-28 is the earliest possible
1426
+ * removal date. Prefer a CIMD URL `client_id` when the authorization server
1427
+ * advertises `client_id_metadata_document_supported`: the built-in `auth()` flow
1428
+ * skips registration for you when that capability is advertised AND your
1429
+ * provider supplies `clientMetadataUrl`, but `registerClient` itself does not
1430
+ * gate — calling it directly always sends the registration request.
1431
+ */
1432
+ async function registerClient(authorizationServerUrl, { metadata, clientMetadata, scope, fetchFn }) {
1433
+ let registrationUrl;
1434
+ if (metadata) {
1435
+ if (!metadata.registration_endpoint) throw new Error("Incompatible auth server: does not support dynamic client registration");
1436
+ registrationUrl = new URL(metadata.registration_endpoint);
1437
+ } else registrationUrl = new URL("/register", authorizationServerUrl);
1438
+ const submittedMetadata = {
1439
+ ...clientMetadata,
1440
+ ...scope === void 0 ? {} : { scope }
1441
+ };
1442
+ const response = await fetchWithinOrigin(fetchFn ?? fetch)(registrationUrl, {
1443
+ method: "POST",
1444
+ headers: { "Content-Type": "application/json" },
1445
+ body: JSON.stringify(submittedMetadata)
1446
+ });
1447
+ if (!response.ok) throw new RegistrationRejectedError({
1448
+ status: response.status,
1449
+ body: await response.text(),
1450
+ submittedMetadata
1451
+ });
1452
+ return OAuthClientInformationFullSchema.parse(withoutIssuer(await response.json()));
1453
+ }
1454
+
1455
+ //#endregion
1456
+ //#region src/client/responseCache.ts
1457
+ /**
1458
+ * Methods whose entries are exempt from the
1459
+ * {@linkcode InMemoryResponseCacheStoreOptions.maxEntries} cap. Each holds at
1460
+ * most one entry per partition (a small bounded set) and the
1461
+ * `tools/list`-derived index depends on its entry surviving regardless of the
1462
+ * `resources/read` working-set size. Only `resources/read` keys count toward
1463
+ * the cap and are eligible for FIFO eviction.
1464
+ */
1465
+ const CAP_EXEMPT_METHODS = new Set([
1466
+ "tools/list",
1467
+ "prompts/list",
1468
+ "resources/list",
1469
+ "resources/templates/list",
1470
+ "server/discover"
1471
+ ]);
1472
+ /**
1473
+ * In-memory default. Bounded by an insertion-ordered size cap (default `512`;
1474
+ * see {@linkcode InMemoryResponseCacheStoreOptions.maxEntries}) on the
1475
+ * `resources/read` keyspace so an unbounded stream of distinct URIs cannot
1476
+ * grow it without limit; the list-singleton methods are exempt and never
1477
+ * evicted by the cap. `Map` preserves insertion order, so the oldest live
1478
+ * capped key is the first matching iteration entry.
1479
+ */
1480
+ var InMemoryResponseCacheStore = class {
1481
+ _entries = /* @__PURE__ */ new Map();
1482
+ _maxEntries;
1483
+ _stamp = 0;
1484
+ /** Count of held entries that are subject to the cap (i.e. not in {@linkcode CAP_EXEMPT_METHODS}). */
1485
+ _cappedSize = 0;
1486
+ constructor(options) {
1487
+ this._maxEntries = options?.maxEntries ?? 512;
1488
+ }
1489
+ /** Number of held entries (for diagnostics / bounding tests). */
1490
+ get size() {
1491
+ return this._entries.size;
1492
+ }
1493
+ get(key) {
1494
+ return this._entries.get(keyOf(key));
1495
+ }
1496
+ set(key, entry) {
1497
+ const k = keyOf(key);
1498
+ const exempt = CAP_EXEMPT_METHODS.has(key.method);
1499
+ const isNew = !this._entries.has(k);
1500
+ if (!exempt && isNew && this._maxEntries > 0 && this._cappedSize >= this._maxEntries) {
1501
+ for (const oldKey of this._entries.keys()) if (!CAP_EXEMPT_METHODS.has(oldKey.slice(0, oldKey.indexOf("\0")))) {
1502
+ this._entries.delete(oldKey);
1503
+ this._cappedSize--;
1504
+ break;
1505
+ }
1506
+ }
1507
+ const stamp = ++this._stamp;
1508
+ this._entries.set(k, {
1509
+ ...entry,
1510
+ stamp
1511
+ });
1512
+ if (isNew && !exempt) this._cappedSize++;
1513
+ return stamp;
1514
+ }
1515
+ delete(key) {
1516
+ if (this._entries.delete(keyOf(key)) && !CAP_EXEMPT_METHODS.has(key.method)) this._cappedSize--;
1517
+ }
1518
+ evict(method) {
1519
+ const prefix = `${method}\0`;
1520
+ const exempt = CAP_EXEMPT_METHODS.has(method);
1521
+ for (const k of this._entries.keys()) if (k.startsWith(prefix)) {
1522
+ this._entries.delete(k);
1523
+ if (!exempt) this._cappedSize--;
1524
+ }
1525
+ }
1526
+ clear() {
1527
+ this._entries.clear();
1528
+ this._cappedSize = 0;
1529
+ }
1530
+ };
1531
+ /**
1532
+ * Serialize a {@linkcode CacheKey} for the in-memory map. `method` is always
1533
+ * an SDK-set MCP method string (never contains a NUL), so the `\0` prefix
1534
+ * delimiter is safe and lets {@linkcode InMemoryResponseCacheStore.evict} do a
1535
+ * cheap prefix scan. `partition` (already a JSON-encoded
1536
+ * `[serverIdentity, principal]` pair) and `params` (a resource URI on the
1537
+ * `resources/read` path — caller-controlled) are JSON-array-encoded together,
1538
+ * which is collision-free regardless of any NUL or delimiter characters they
1539
+ * carry.
1540
+ */
1541
+ function keyOf(key) {
1542
+ return `${key.method}\0${JSON.stringify([key.partition ?? "", key.params ?? ""])}`;
1543
+ }
1544
+ /**
1545
+ * Serialize a `{method, params}` pair for the eviction-generation map. The
1546
+ * list singletons key on `method` alone (their {@linkcode ClientResponseCache.evict}
1547
+ * is whole-method); `resources/read` keys on `` `${method}\0${uri}` `` so
1548
+ * {@linkcode ClientResponseCache.evictKey} bumps a per-URI counter.
1549
+ */
1550
+ function genKey(method, params) {
1551
+ return params === void 0 ? method : `${method}\0${params}`;
1552
+ }
1553
+ /**
1554
+ * Upper bound on the server-supplied `ttlMs` honoured by
1555
+ * {@linkcode ClientResponseCache} (24h). A server cannot pin an entry
1556
+ * indefinitely.
1557
+ */
1558
+ const MAX_CACHE_TTL_MS = 864e5;
1559
+ /**
1560
+ * The `Client`'s cache-coordination collaborator.
1561
+ *
1562
+ * Owns the per-connection cache state that used to live as five private
1563
+ * fields on `Client` — the backing {@linkcode ResponseCacheStore}, the
1564
+ * per-method eviction-generation counter, the user-supplied/default flag, and
1565
+ * the stamp-memoized derived indices over the `tools/list` entry. `Client`
1566
+ * holds exactly one instance and never reaches past it to the store.
1567
+ *
1568
+ * Not exported from the package index — internal to the client package.
1569
+ *
1570
+ * @internal
1571
+ */
1572
+ var ClientResponseCache = class {
1573
+ /**
1574
+ * Per-logical-key eviction-generation counter. {@linkcode evict} (whole
1575
+ * method) and {@linkcode evictKey} (single `{method, params}`) bump it
1576
+ * before touching the store; {@linkcode captureGeneration} reads it before
1577
+ * the request; {@linkcode write} skips when it moved — so a `list_changed`
1578
+ * arriving mid-walk, or a `resources/updated` arriving while a
1579
+ * `readResource()` for the same URI is in flight, is not overwritten by
1580
+ * the in-flight request's stale write. The map key is `method` for the
1581
+ * list singletons and `` `${method}\0${params}` `` for per-URI keys.
1582
+ *
1583
+ * Growth is bounded by keys the CLIENT has issued a `captureGeneration`
1584
+ * for: {@linkcode captureGeneration} records the key (so an interleaved
1585
+ * {@linkcode evictKey} sees there is an in-flight write to suppress);
1586
+ * {@linkcode evictKey} only bumps a key that is already recorded — a
1587
+ * server streaming `notifications/resources/updated` for URIs the client
1588
+ * has never read therefore cannot grow this map.
1589
+ */
1590
+ _evictionGeneration = /* @__PURE__ */ new Map();
1591
+ /**
1592
+ * `name → Tool` index derived from the cached `tools/list` entry, memoized
1593
+ * against the entry's `stamp` so it re-derives only when the backing entry
1594
+ * changes (mcp.d's `cachedTool` pattern).
1595
+ */
1596
+ _toolIndex;
1597
+ /**
1598
+ * `name → compiled output-schema validator` derived from the cached
1599
+ * `tools/list` entry; same stamp-keyed memoization as `_toolIndex`. Typed
1600
+ * `unknown` so this class stays free of any validator-provider dependency
1601
+ * — the compile callback supplied to {@linkcode outputValidator} owns the
1602
+ * concrete type.
1603
+ */
1604
+ _toolOutputValidatorIndex;
1605
+ /**
1606
+ * The connected server's identity (`serverInfo.name@version`, the
1607
+ * transport's `sessionId`, or a client-generated per-connection
1608
+ * surrogate). Set by the `Client` immediately after a successful connect;
1609
+ * `''` is the pre-connect sentinel. Every storage partition is derived
1610
+ * from this (see `_partitionFor`), so two clients sharing one store but
1611
+ * connected to different servers never collide on `tools/list` and a
1612
+ * server cannot read another server's `'public'` entries.
1613
+ */
1614
+ _serverIdentity = "";
1615
+ constructor(_store, _isUserSupplied, _reportError = () => {}, _cachePartition = "", _now = Date.now) {
1616
+ this._store = _store;
1617
+ this._isUserSupplied = _isUserSupplied;
1618
+ this._reportError = _reportError;
1619
+ this._cachePartition = _cachePartition;
1620
+ this._now = _now;
1621
+ }
1622
+ /** The clock used for every freshness computation and check. */
1623
+ now() {
1624
+ return this._now();
1625
+ }
1626
+ /**
1627
+ * Record the connected server's identity. Called by `Client` immediately
1628
+ * after a successful connect: `serverInfo.name@version` when the server
1629
+ * identified itself, else the transport's `sessionId`, else a
1630
+ * client-generated per-connection surrogate (`serverInfo` is a spec
1631
+ * SHOULD on 2026-07-28, so anonymous servers exist). Surrogate-keyed
1632
+ * partitions are NOT stable across reconnects — no identity means no
1633
+ * cross-connection cache reuse, and a shared long-lived store should
1634
+ * bound its own size accordingly. Every partition derived after this
1635
+ * call is scoped to this identity; entries written under the pre-connect
1636
+ * `''` sentinel are no longer reachable.
1637
+ */
1638
+ setServerIdentity(identity) {
1639
+ this._serverIdentity = identity;
1640
+ }
1641
+ /**
1642
+ * Derive the storage partition for `scope`. The encoding is
1643
+ * `JSON.stringify([serverIdentity, principal])` — JSON escaping makes it
1644
+ * collision-free by construction: a malicious server cannot craft a
1645
+ * `serverInfo.name`/`version` whose concatenated form bleeds into another
1646
+ * server's namespace or another principal's slot, regardless of `@` / `|`
1647
+ * / `"` / NUL in the server-controlled strings. `'public'` →
1648
+ * `[serverIdentity, '']` (shared within this server); `'private'` →
1649
+ * `[serverIdentity, cachePartition]`. When `cachePartition` is `''` the
1650
+ * two coincide.
1651
+ */
1652
+ _partitionFor(scope) {
1653
+ return JSON.stringify([this._serverIdentity, scope === "public" ? "" : this._cachePartition]);
1654
+ }
1655
+ /**
1656
+ * Two-probe lookup: this client's own (private) partition first, then the
1657
+ * connected server's shared (public) partition. The shared probe is gated
1658
+ * on `entry.scope === 'public'` — a co-tenant client that omits
1659
+ * `cachePartition` writes its `'private'`-scoped entries at the public
1660
+ * partition, and serving those to a correctly-partitioned client would
1661
+ * leak private bodies (mcp.d's `cachedEntry` two-probe order; the scope
1662
+ * gate is defence-in-depth on top of the partition split). When
1663
+ * `cachePartition` is `''` the two partitions are identical and only one
1664
+ * probe is issued.
1665
+ */
1666
+ async _probe(method, params) {
1667
+ const key = {
1668
+ method,
1669
+ params: params ?? ""
1670
+ };
1671
+ const ownPartition = this._partitionFor("private");
1672
+ const own = await this._store.get({
1673
+ ...key,
1674
+ partition: ownPartition
1675
+ });
1676
+ if (own !== void 0) return own;
1677
+ const sharedPartition = this._partitionFor("public");
1678
+ if (sharedPartition === ownPartition) return void 0;
1679
+ const shared = await this._store.get({
1680
+ ...key,
1681
+ partition: sharedPartition
1682
+ });
1683
+ return shared?.scope === "public" ? shared : void 0;
1684
+ }
1685
+ /**
1686
+ * Bump the per-method generation (so an in-flight {@linkcode write} for the
1687
+ * same method becomes a no-op) and drop the connected server's two list
1688
+ * singletons (own + shared partition; `params: ''`). The generation bump
1689
+ * is unconditional and FIRST — the {@linkcode write} race guard relies on
1690
+ * the bump, not on the store's deletes completing.
1691
+ *
1692
+ * Eviction is scoped to this client's `[serverIdentity, principal]`
1693
+ * partitions (mirroring {@linkcode evictKey}) — the method-wide
1694
+ * `store.evict()` is NOT called, so on a shared store one server's
1695
+ * `list_changed` cannot wipe a co-tenant's entry. A custom store's
1696
+ * `delete()` may throw or reject; each partition is guarded
1697
+ * independently so a failure on one does not skip the other, the failure
1698
+ * is reported via the constructor's sink, and the call resolves so
1699
+ * dispatch proceeds.
1700
+ */
1701
+ async evict(method) {
1702
+ this._evictionGeneration.set(method, (this._evictionGeneration.get(method) ?? 0) + 1);
1703
+ await this._deleteBoth(method, "");
1704
+ }
1705
+ /**
1706
+ * Guarded two-partition delete of `{method, params}`: each partition's
1707
+ * `delete` is independently wrapped so a custom store's failure on one is
1708
+ * reported and does not skip the other, and the call always resolves.
1709
+ */
1710
+ async _deleteBoth(method, params) {
1711
+ const ownPartition = this._partitionFor("private");
1712
+ const sharedPartition = this._partitionFor("public");
1713
+ try {
1714
+ await this._store.delete({
1715
+ method,
1716
+ params,
1717
+ partition: ownPartition
1718
+ });
1719
+ } catch (error) {
1720
+ this._reportError(error);
1721
+ }
1722
+ if (sharedPartition !== ownPartition) try {
1723
+ await this._store.delete({
1724
+ method,
1725
+ params,
1726
+ partition: sharedPartition
1727
+ });
1728
+ } catch (error) {
1729
+ this._reportError(error);
1730
+ }
1731
+ }
1732
+ /**
1733
+ * Drop the single logical entry `{method, params}` from BOTH the private
1734
+ * and public partitions for this client's connected server (mcp.d's
1735
+ * `invalidateLogical`). Used for `notifications/resources/updated`'s
1736
+ * per-URI eviction. The per-key generation is bumped FIRST (so an
1737
+ * in-flight {@linkcode write} for the same `{method, params}` becomes a
1738
+ * no-op and cannot re-cache the now-stale body) but only when the key was
1739
+ * already recorded by {@linkcode captureGeneration} — bounding the map to
1740
+ * keys the client has actually read. A custom store's `delete()` may
1741
+ * throw or reject; each partition's delete is guarded independently so a
1742
+ * failure on one does not skip the other, and the call resolves so
1743
+ * dispatch proceeds.
1744
+ */
1745
+ async evictKey(method, params) {
1746
+ const gk = genKey(method, params);
1747
+ const current = this._evictionGeneration.get(gk);
1748
+ if (current !== void 0) this._evictionGeneration.set(gk, current + 1);
1749
+ await this._deleteBoth(method, params);
1750
+ }
1751
+ /**
1752
+ * Snapshot the eviction generation for `{method, params}` before issuing
1753
+ * the request (a list walk's page 1, or a `resources/read` for `params`).
1754
+ * Records the key so an interleaved {@linkcode evictKey} for the same
1755
+ * `{method, params}` knows there is an in-flight write to suppress and
1756
+ * bumps; without the record, `evictKey`'s recorded-only bump would skip
1757
+ * and the stale body would be cached.
1758
+ */
1759
+ captureGeneration(method, params) {
1760
+ const gk = genKey(method, params);
1761
+ const current = this._evictionGeneration.get(gk) ?? 0;
1762
+ this._evictionGeneration.set(gk, current);
1763
+ return current;
1764
+ }
1765
+ /**
1766
+ * Write `value` under `{method}` unless the per-method generation moved
1767
+ * since `capturedGen` was taken — a `list_changed` that landed mid-walk has
1768
+ * already invalidated the result the caller is about to write, and
1769
+ * overwriting the eviction with the stale aggregate would lose the
1770
+ * invalidation.
1771
+ *
1772
+ * The value is stored as its JSON-serialized document; serialization
1773
+ * doubles as the mutation barrier, so a caller mutating the returned
1774
+ * aggregate cannot reach the cache or its derived indices. A value that
1775
+ * is not JSON-serializable (reachable only via in-process transports)
1776
+ * fails the write loudly into the `reportError` sink. A custom store
1777
+ * whose `set()` throws or rejects is routed to the same sink and the
1778
+ * write resolves — cache bookkeeping never costs the caller a result it
1779
+ * already fetched.
1780
+ *
1781
+ * `freshness` carries the client-computed `expiresAt` (absolute ms epoch,
1782
+ * `now + ttlMs`) and the server-reported `cacheScope`. The storage
1783
+ * `partition` is derived from the scope via `_partitionFor`:
1784
+ * `'public'` → `[serverIdentity, '']` (shared within this server);
1785
+ * `'private'` → `[serverIdentity, cachePartition]` (so a shared store
1786
+ * never serves a private entry to another identity). Absent `freshness`
1787
+ * preserves the substrate write (no `expiresAt`, private partition) — the
1788
+ * `tools/list` retain-for-schema posture: never served by
1789
+ * {@linkcode read}'s freshness gate, always readable by
1790
+ * {@linkcode toolDefinition}.
1791
+ *
1792
+ * After storing under the derived partition, the same `{method, params}`
1793
+ * is deleted from the OPPOSITE partition (mirroring {@linkcode evictKey}'s
1794
+ * two-partition posture). A server that flips a result's `cacheScope` for
1795
+ * the same key would otherwise leave the previous entry in the other slot
1796
+ * — and since `_probe` checks own-partition first, a stale private entry
1797
+ * would shadow the fresh public one (or a stale public entry would keep
1798
+ * serving co-tenants). Both store calls are independently guarded so a
1799
+ * custom store's failure on one does not skip the other.
1800
+ */
1801
+ async write(method, value, capturedGen, freshness) {
1802
+ if ((this._evictionGeneration.get(genKey(method, freshness?.params)) ?? 0) !== capturedGen) return;
1803
+ const params = freshness?.params ?? "";
1804
+ const ownPartition = this._partitionFor("private");
1805
+ const sharedPartition = this._partitionFor("public");
1806
+ const partition = (freshness?.scope ?? "private") === "public" ? sharedPartition : ownPartition;
1807
+ try {
1808
+ await this._store.set({
1809
+ method,
1810
+ params,
1811
+ partition
1812
+ }, {
1813
+ value: encodeCacheValue(value),
1814
+ expiresAt: freshness?.expiresAt,
1815
+ scope: freshness?.scope
1816
+ });
1817
+ } catch (error) {
1818
+ this._reportError(error);
1819
+ }
1820
+ if (sharedPartition !== ownPartition) try {
1821
+ await this._store.delete({
1822
+ method,
1823
+ params,
1824
+ partition: partition === ownPartition ? sharedPartition : ownPartition
1825
+ });
1826
+ } catch (error) {
1827
+ this._reportError(error);
1828
+ }
1829
+ }
1830
+ /**
1831
+ * Serve the fresh cached result for `{method, params}`, or `undefined`.
1832
+ * Lookup is the two-probe order (own-partition then this server's shared
1833
+ * partition, gated on `scope === 'public'`); freshness is
1834
+ * `entry.expiresAt > now()` (a missing `expiresAt` is never fresh),
1835
+ * checked BEFORE decoding so stale entries cost no parse. Every hit is
1836
+ * freshly parsed, so the caller owns the value outright. An entry whose
1837
+ * document does not parse or is not an object (corrupted external
1838
+ * store) is reported,
1839
+ * deleted, and treated as a miss — deleted because a fresh-but-corrupt
1840
+ * entry would otherwise re-parse and re-report on every read until its
1841
+ * `expiresAt` passes.
1842
+ */
1843
+ async read(method, params) {
1844
+ const entry = await this._probe(method, params);
1845
+ if (entry?.expiresAt === void 0 || !(entry.expiresAt > this.now())) return void 0;
1846
+ try {
1847
+ const parsed = JSON.parse(entry.value);
1848
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) throw new TypeError("cached document is not an object");
1849
+ return { value: parsed };
1850
+ } catch (error) {
1851
+ this._reportError(error);
1852
+ await this._deleteBoth(method, params ?? "");
1853
+ return;
1854
+ }
1855
+ }
1856
+ /**
1857
+ * Connection reset. The per-instance default store IS cleared
1858
+ * (connection-scoped); a user-supplied store is NOT — that would defeat
1859
+ * the only reason to supply one. The generation map and every derived
1860
+ * index are dropped regardless: they are connection-scoped even when the
1861
+ * backing store survives, so the next read re-derives from whatever the
1862
+ * store still holds. The server identity returns to the pre-connect
1863
+ * sentinel. The default impl is synchronous, so the `MaybePromise<void>`
1864
+ * return is a plain void here and the caller need not await.
1865
+ */
1866
+ resetForReconnect() {
1867
+ if (!this._isUserSupplied) this._store.clear();
1868
+ this._evictionGeneration.clear();
1869
+ this._toolIndex = void 0;
1870
+ this._toolOutputValidatorIndex = void 0;
1871
+ this._serverIdentity = "";
1872
+ }
1873
+ /**
1874
+ * The descriptor for tool `name` taken from the cached `tools/list` entry.
1875
+ * The `name → Tool` index is memoized against the entry's `stamp` and
1876
+ * re-derived only when the backing entry changes (mcp.d's `cachedTool`).
1877
+ * Returns `undefined` only when no `tools/list` response is held at all,
1878
+ * or the held list does not contain `name`.
1879
+ *
1880
+ * Consumed by `callTool()`'s SEP-2243 `_resolveXMcpHeaderScan` (mirroring)
1881
+ * and, via {@linkcode outputValidator}, its output-schema validation.
1882
+ */
1883
+ async toolDefinition(name) {
1884
+ const entry = await this._probe("tools/list");
1885
+ if (entry === void 0) {
1886
+ this._toolIndex = void 0;
1887
+ return;
1888
+ }
1889
+ if (this._toolIndex?.stamp !== entry.stamp) {
1890
+ const list = this._decodeListTools(entry);
1891
+ const byName = /* @__PURE__ */ new Map();
1892
+ if (list !== void 0) for (const tool of list.tools) byName.set(tool.name, tool);
1893
+ this._toolIndex = {
1894
+ stamp: entry.stamp,
1895
+ byName
1896
+ };
1897
+ }
1898
+ return this._toolIndex.byName.get(name);
1899
+ }
1900
+ /**
1901
+ * The compiled output-schema validator for tool `name`, derived from the
1902
+ * cached `tools/list` entry — same source and same stamp-keyed
1903
+ * memoization as {@linkcode toolDefinition}. The `name → validator` index
1904
+ * re-derives only when the backing entry's stamp changes (a refetched
1905
+ * `tools/list` recompiles; a `list_changed` eviction drops it). Returns
1906
+ * `undefined` when no `tools/list` is held, the tool is absent, or it has
1907
+ * no `outputSchema`.
1908
+ *
1909
+ * `compile` is the caller-supplied validator-compile callback (the
1910
+ * `Client` passes its `_jsonSchemaValidator` wrapper) so this
1911
+ * class carries no validator-provider dependency. One tool's uncompilable
1912
+ * `outputSchema` (e.g. an invalid `pattern` regex or unresolvable `$ref`)
1913
+ * must not poison every other tool's `callTool` — the callback isolates
1914
+ * that compile error per tool by returning a per-tool error variant which
1915
+ * the index stores alongside the good ones, and `callTool` surfaces it as
1916
+ * a typed `InvalidParams` only for that name. Because the error is held on
1917
+ * this stamp-keyed substrate (not a parallel map), it inherits the
1918
+ * substrate's invalidation lifecycle: a `list_changed` eviction drops it,
1919
+ * a refetched `tools/list` re-derives it, and `resetForReconnect` clears
1920
+ * the lot.
1921
+ */
1922
+ async outputValidator(name, compile) {
1923
+ const entry = await this._probe("tools/list");
1924
+ if (entry === void 0) {
1925
+ this._toolOutputValidatorIndex = void 0;
1926
+ return;
1927
+ }
1928
+ if (this._toolOutputValidatorIndex?.stamp !== entry.stamp) {
1929
+ const list = this._decodeListTools(entry) ?? { tools: [] };
1930
+ const byName = /* @__PURE__ */ new Map();
1931
+ for (const tool of list.tools) {
1932
+ const compiled = compile(tool);
1933
+ if (compiled !== void 0) byName.set(tool.name, compiled);
1934
+ }
1935
+ this._toolOutputValidatorIndex = {
1936
+ stamp: entry.stamp,
1937
+ byName
1938
+ };
1939
+ }
1940
+ return this._toolOutputValidatorIndex.byName.get(name);
1941
+ }
1942
+ /** Parse a held `tools/list` document for the index builders; a document
1943
+ * that does not parse OR whose `tools` is not an array of objects
1944
+ * (both mean a corrupted external store) is reported and treated as if
1945
+ * nothing were held. Callers memoize the outcome against the entry's
1946
+ * stamp, so a corrupt document costs one parse + report per stamp, not
1947
+ * per lookup. */
1948
+ _decodeListTools(entry) {
1949
+ try {
1950
+ const parsed = JSON.parse(entry.value);
1951
+ if (!Array.isArray(parsed?.tools) || !parsed.tools.every((t) => t !== null && typeof t === "object")) throw new TypeError("cached tools/list document has a malformed tools array");
1952
+ return parsed;
1953
+ } catch (error) {
1954
+ this._reportError(error);
1955
+ return;
1956
+ }
1957
+ }
1958
+ };
1959
+ /**
1960
+ * Serialize a result for storage; throws TypeError for anything without a
1961
+ * JSON representation (legal wire results always have one). Two failure
1962
+ * modes need folding into that one throw: `JSON.stringify` throws on cycles
1963
+ * and BigInt, but silently returns `undefined` (not a string) for a
1964
+ * top-level function, symbol, or `undefined`.
1965
+ */
1966
+ function encodeCacheValue(value) {
1967
+ let json;
1968
+ try {
1969
+ json = JSON.stringify(value);
1970
+ } catch (error) {
1971
+ throw new TypeError(`cache value is not JSON-serializable: ${error instanceof Error ? error.message : String(error)}`);
1972
+ }
1973
+ if (typeof json !== "string") throw new TypeError("cache value is not JSON-serializable: it has no JSON representation");
1974
+ return json;
1975
+ }
1976
+
1977
+ //#endregion
1978
+ //#region src/client/authSeam.ts
1979
+ /**
1980
+ * Auth-seam provenance stamp (internal — not part of the public API).
1981
+ *
1982
+ * Errors escaping a transport auth seam — the `authProvider.token()` read,
1983
+ * an `onUnauthorized` invocation (SDK adapter or custom user callback), the
1984
+ * 403 step-up flow, the transport's own auth-failure constructions — are
1985
+ * stamped at the throw boundary. The version-negotiation probe routes stamped
1986
+ * errors as auth outcomes; provenance is recorded where it is known, never
1987
+ * reconstructed from error types downstream.
1988
+ *
1989
+ * `Symbol.for` uses the global symbol registry, so the stamp survives a
1990
+ * duplicated SDK copy in one process (bundler double-install, version skew)
1991
+ * by design: both copies resolve the same symbol.
1992
+ */
1993
+ const AUTH_SEAM = Symbol.for("mcp.authSeamEscape");
1994
+ /**
1995
+ * Stamp `error` as an auth-seam escape and return it — identity-preserving
1996
+ * (the same object flows on, `instanceof` and `.cause` chains intact). A
1997
+ * frozen/sealed object is returned unstamped rather than replaced: identity
1998
+ * outranks provenance. Primitive throws cannot carry the stamp.
1999
+ */
2000
+ function markAuthSeamEscape(error) {
2001
+ if (typeof error === "object" && error !== null || typeof error === "function") try {
2002
+ Object.defineProperty(error, AUTH_SEAM, {
2003
+ value: true,
2004
+ configurable: true
2005
+ });
2006
+ } catch {}
2007
+ return error;
2008
+ }
2009
+ /** Whether `error` escaped through a transport auth seam. */
2010
+ function isAuthSeamEscape(error) {
2011
+ return (typeof error === "object" && error !== null || typeof error === "function") && error[AUTH_SEAM] === true;
2012
+ }
2013
+
2014
+ //#endregion
2015
+ //#region src/client/probeClassifier.ts
2016
+ /** The `-32022` UnsupportedProtocolVersion protocol error code (negotiation-phase recognition). */
2017
+ const UNSUPPORTED_PROTOCOL_VERSION = -32022;
2018
+ /**
2019
+ * Deliberately not probe-recognized in either direction: deployed servers
2020
+ * overload `-32001` (the SDK-conventional `Session not found` body on a 2025
2021
+ * stateful server), and the spec-assigned `-32020` (`HeaderMismatch`) /
2022
+ * `-32021` (`MissingRequiredClientCapability`) are not era evidence — all
2023
+ * fall into the conservative legacy default.
2024
+ */
2025
+ const NOT_PROBE_RECOGNIZED = new Set([
2026
+ -32001,
2027
+ -32020,
2028
+ -32021
2029
+ ]);
2030
+ /**
2031
+ * Classify a single probe outcome. Pure: no I/O, no state — loop-guard and
2032
+ * retry state live in the caller.
2033
+ */
2034
+ function classifyProbeOutcome(outcome, context) {
2035
+ switch (outcome.kind) {
2036
+ case "result": return classifyResult(outcome.result, context);
2037
+ case "rpc-error": return classifyRpcError(outcome, context);
2038
+ case "http-error": return classifyHttpError(outcome, context);
2039
+ case "network-error": return classifyNetworkError(outcome.error, context);
2040
+ case "unusable-reply": return {
2041
+ kind: "error",
2042
+ 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 })
2043
+ };
2044
+ case "auth-required": return {
2045
+ kind: "error",
2046
+ error: outcome.error
2047
+ };
2048
+ case "closed":
2049
+ if (context.transportKind === "stdio") return { kind: "legacy" };
2050
+ return classifyNetworkError(/* @__PURE__ */ new Error("Connection closed during the version negotiation probe"), context);
2051
+ case "timeout":
2052
+ if (context.transportKind === "stdio") return { kind: "legacy" };
2053
+ return {
2054
+ kind: "error",
2055
+ error: new SdkError(SdkErrorCode.RequestTimeout, `Version negotiation probe timed out after ${outcome.timeoutMs}ms`, { timeout: outcome.timeoutMs })
2056
+ };
2057
+ }
2058
+ }
2059
+ function classifyResult(result, context) {
2060
+ const parsed = codecForVersion(MODERN_WIRE_REVISION).validateResult("server/discover", result);
2061
+ if (!parsed.ok) return { kind: "legacy" };
2062
+ const supportedVersions = parsed.value.supportedVersions;
2063
+ const overlap = context.clientModernVersions.find((version) => supportedVersions.includes(version));
2064
+ if (overlap !== void 0) return {
2065
+ kind: "modern",
2066
+ version: overlap,
2067
+ discover: parsed.value
2068
+ };
2069
+ if (context.fallbackAvailable) return { kind: "legacy" };
2070
+ return {
2071
+ kind: "error",
2072
+ error: new UnsupportedProtocolVersionError({
2073
+ supported: [...supportedVersions],
2074
+ requested: context.requestedVersion
2075
+ })
2076
+ };
2077
+ }
2078
+ function classifyRpcError(outcome, context) {
2079
+ const { code, message, data } = outcome;
2080
+ if (code === UNSUPPORTED_PROTOCOL_VERSION) {
2081
+ const supported = parseSupportedList(data);
2082
+ if (supported === void 0) return { kind: "legacy" };
2083
+ const error = new UnsupportedProtocolVersionError({
2084
+ supported,
2085
+ requested: parseRequested(data) ?? context.requestedVersion
2086
+ }, message);
2087
+ const supportedModern = modernProtocolVersions(supported);
2088
+ const mutual = context.clientModernVersions.find((version) => supportedModern.includes(version));
2089
+ if (mutual !== void 0) return {
2090
+ kind: "corrective",
2091
+ version: mutual,
2092
+ error
2093
+ };
2094
+ if (supportedModern.length > 0) return {
2095
+ kind: "error",
2096
+ error
2097
+ };
2098
+ return context.fallbackAvailable ? { kind: "legacy" } : {
2099
+ kind: "error",
2100
+ error
2101
+ };
2102
+ }
2103
+ if (NOT_PROBE_RECOGNIZED.has(code)) return { kind: "legacy" };
2104
+ return { kind: "legacy" };
2105
+ }
2106
+ function classifyHttpError(outcome, context) {
2107
+ if (outcome.status === 401 || outcome.status === 403) {
2108
+ const isDenial = outcome.status === 403;
2109
+ return {
2110
+ kind: "error",
2111
+ error: new SdkHttpError(isDenial ? SdkErrorCode.ClientHttpForbidden : SdkErrorCode.ClientHttpAuthentication, `Version negotiation failed: ${isDenial ? "the server denied access (HTTP 403)" : "the server requires authorization (HTTP 401)"}`, {
2112
+ status: outcome.status,
2113
+ statusText: outcome.statusText,
2114
+ text: outcome.body
2115
+ })
2116
+ };
2117
+ }
2118
+ if (outcome.status >= 500) return {
2119
+ kind: "error",
2120
+ error: new SdkHttpError(SdkErrorCode.EraNegotiationFailed, `Version negotiation failed: the server answered the probe with HTTP ${outcome.status}`, {
2121
+ status: outcome.status,
2122
+ statusText: outcome.statusText,
2123
+ text: outcome.body
2124
+ })
2125
+ };
2126
+ const rpcError = parseJsonRpcErrorBody(outcome.body);
2127
+ if (rpcError !== void 0) return classifyRpcError(rpcError, context);
2128
+ return { kind: "legacy" };
2129
+ }
2130
+ function classifyNetworkError(error, context) {
2131
+ if (context.environment === "browser" && isOpaqueFetchTypeError(error)) return { kind: "legacy" };
2132
+ return {
2133
+ kind: "error",
2134
+ error: new SdkError(SdkErrorCode.EraNegotiationFailed, `Version negotiation probe failed: ${describeError(error)}`, { cause: error }, { cause: error })
2135
+ };
2136
+ }
2137
+ function isOpaqueFetchTypeError(error) {
2138
+ return error instanceof TypeError || error instanceof Error && error.name === "TypeError";
2139
+ }
2140
+ function describeError(error) {
2141
+ return error instanceof Error ? error.message : String(error);
2142
+ }
2143
+ function parseSupportedList(data) {
2144
+ if (typeof data !== "object" || data === null) return void 0;
2145
+ const supported = data.supported;
2146
+ if (!Array.isArray(supported) || supported.length === 0 || !supported.every((v) => typeof v === "string")) return;
2147
+ return supported;
2148
+ }
2149
+ function parseRequested(data) {
2150
+ if (typeof data !== "object" || data === null) return void 0;
2151
+ const requested = data.requested;
2152
+ return typeof requested === "string" ? requested : void 0;
2153
+ }
2154
+ function parseJsonRpcErrorBody(body) {
2155
+ if (body === void 0 || body === "") return void 0;
2156
+ let parsed;
2157
+ try {
2158
+ parsed = JSON.parse(body);
2159
+ } catch {
2160
+ return;
2161
+ }
2162
+ if (typeof parsed !== "object" || parsed === null) return void 0;
2163
+ const error = parsed.error;
2164
+ if (typeof error !== "object" || error === null) return void 0;
2165
+ const { code, message, data } = error;
2166
+ if (typeof code !== "number") return void 0;
2167
+ return {
2168
+ code,
2169
+ message: typeof message === "string" ? message : "",
2170
+ data
2171
+ };
2172
+ }
2173
+
2174
+ //#endregion
2175
+ //#region src/client/versionNegotiation.ts
2176
+ /**
2177
+ * The default mode when `versionNegotiation` (or its `mode`) is absent;
2178
+ * changing the default later is a flip of this single line.
2179
+ */
2180
+ const DEFAULT_VERSION_NEGOTIATION_MODE = "legacy";
2181
+ /**
2182
+ * Resolve the negotiation options into a per-connect plan. The raw (not
2183
+ * defaulted) `supportedProtocolVersions` option supplies the modern offer list;
2184
+ * a list without any legacy version makes this a modern-only client (no fallback).
2185
+ */
2186
+ function resolveVersionNegotiation(options, supportedProtocolVersionsOption) {
2187
+ const mode = options?.mode ?? DEFAULT_VERSION_NEGOTIATION_MODE;
2188
+ if (mode === "legacy") return { kind: "legacy" };
2189
+ const probe = options?.probe ?? {};
2190
+ if (typeof mode === "object") {
2191
+ if (!isModernProtocolVersion(mode.pin)) throw new TypeError(`versionNegotiation: { pin: '${mode.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);
2192
+ return {
2193
+ kind: "pin",
2194
+ version: mode.pin,
2195
+ probe
2196
+ };
2197
+ }
2198
+ const explicitModern = supportedProtocolVersionsOption ? modernProtocolVersions(supportedProtocolVersionsOption) : [];
2199
+ return {
2200
+ kind: "auto",
2201
+ modernVersions: explicitModern.length > 0 ? explicitModern : [...SUPPORTED_MODERN_PROTOCOL_VERSIONS],
2202
+ fallbackAvailable: supportedProtocolVersionsOption ? legacyProtocolVersions(supportedProtocolVersionsOption).length > 0 : true,
2203
+ probe
2204
+ };
2205
+ }
2206
+ /** Detect the probe environment for the network-failure row — see {@linkcode ProbeEnvironment}. */
2207
+ function detectProbeEnvironment() {
2208
+ const g = globalThis;
2209
+ return g.window !== void 0 && g.document !== void 0 ? "browser" : "node";
2210
+ }
2211
+ /**
2212
+ * Detect the transport class for the transport-aware timeout and closed verdicts (see
2213
+ * {@linkcode ProbeTransportKind}). The stdio child-process transport is
2214
+ * recognized structurally (`stderr`/`pid` accessors, no `instanceof` — safe
2215
+ * across bundles); everything else is treated like HTTP.
2216
+ */
2217
+ function detectProbeTransportKind(transport) {
2218
+ return "stderr" in transport && "pid" in transport ? "stdio" : "http";
2219
+ }
2220
+ /**
2221
+ * Temporary ownership of a raw transport for the negotiation exchange, before
2222
+ * the Protocol machinery attaches. `open()` installs the window's handlers and
2223
+ * starts the transport; `release()` detaches them and arms a one-shot `start()`
2224
+ * pass-through so the subsequent Protocol connect (which always starts its
2225
+ * transport) takes over the already-started channel without a double-start error.
2226
+ *
2227
+ * Handlers a caller pre-set on the transport before `connect()` are saved on
2228
+ * open and restored on detach, so `Protocol.connect()` finds and chains them
2229
+ * exactly as it would on a plain (non-negotiating) connect. Error and close
2230
+ * events are forwarded to the saved handlers during the window, so negotiation
2231
+ * does not change what a pre-attached observer sees of the transport
2232
+ * lifecycle. (Inbound messages are deliberately NOT forwarded — the window's
2233
+ * drop-guard is a module invariant, and the probe reply has no plain-connect
2234
+ * counterpart; a pre-set `onmessage` is restored at detach and chained by
2235
+ * `Protocol.connect()` like the others.)
2236
+ */
2237
+ var ProbeWindow = class ProbeWindow {
2238
+ _pending;
2239
+ _probeCounter = 0;
2240
+ _savedOnMessage;
2241
+ _savedOnError;
2242
+ _savedOnClose;
2243
+ _closeDelivered = false;
2244
+ constructor(_transport) {
2245
+ this._transport = _transport;
2246
+ this._savedOnMessage = _transport.onmessage;
2247
+ this._savedOnError = _transport.onerror;
2248
+ this._savedOnClose = _transport.onclose;
2249
+ }
2250
+ static async open(transport) {
2251
+ const window = new ProbeWindow(transport);
2252
+ transport.onmessage = (message) => {
2253
+ const pending = window._pending;
2254
+ if (pending !== void 0 && (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) && message.id === pending.id) {
2255
+ window._pending = void 0;
2256
+ if (isJSONRPCResultResponse(message)) pending.resolve({
2257
+ kind: "response",
2258
+ result: message.result
2259
+ });
2260
+ else pending.resolve({
2261
+ kind: "response",
2262
+ error: message.error
2263
+ });
2264
+ return;
2265
+ }
2266
+ };
2267
+ transport.onerror = (error) => {
2268
+ window._savedOnError?.(error);
2269
+ };
2270
+ transport.onclose = () => {
2271
+ const pending = window._pending;
2272
+ if (pending !== void 0) {
2273
+ window._pending = void 0;
2274
+ pending.resolve({ kind: "closed" });
2275
+ }
2276
+ window._closeDelivered = true;
2277
+ window._savedOnClose?.();
2278
+ };
2279
+ try {
2280
+ await transport.start();
2281
+ } catch (error) {
2282
+ window.detach();
2283
+ throw error;
2284
+ }
2285
+ return window;
2286
+ }
2287
+ /**
2288
+ * Send one probe request and await its reply. Probe ids are strings, so they
2289
+ * never collide with Protocol's numeric ids (e.g. on a shared stdio pipe).
2290
+ */
2291
+ async exchange(buildRequest, timeoutMs) {
2292
+ const id = `server-discover-probe-${++this._probeCounter}`;
2293
+ return new Promise((resolve) => {
2294
+ let settled = false;
2295
+ const settle = (reply) => {
2296
+ if (settled) return;
2297
+ settled = true;
2298
+ clearTimeout(timer);
2299
+ if (this._pending?.id === id) this._pending = void 0;
2300
+ resolve(reply);
2301
+ };
2302
+ const timer = setTimeout(() => settle({ kind: "timeout" }), timeoutMs);
2303
+ this._pending = {
2304
+ id,
2305
+ resolve: settle
2306
+ };
2307
+ this._transport.send(buildRequest(id)).catch((error) => settle({
2308
+ kind: "send-error",
2309
+ error
2310
+ }));
2311
+ });
2312
+ }
2313
+ /** Detach the window's handlers, restoring any the caller pre-set, leaving the transport's own `start` untouched. */
2314
+ detach() {
2315
+ this._pending = void 0;
2316
+ this._transport.onmessage = this._savedOnMessage;
2317
+ this._transport.onerror = this._savedOnError;
2318
+ if (this._closeDelivered && this._savedOnClose !== void 0) {
2319
+ const saved = this._savedOnClose;
2320
+ const transport = this._transport;
2321
+ let spent = false;
2322
+ const wrapper = () => {
2323
+ if (!spent) {
2324
+ spent = true;
2325
+ return;
2326
+ }
2327
+ saved();
2328
+ };
2329
+ transport.onclose = wrapper;
2330
+ pendingSpentCloseGuards.set(transport, () => {
2331
+ if (transport.onclose === wrapper) transport.onclose = saved;
2332
+ });
2333
+ } else this._transport.onclose = this._savedOnClose;
2334
+ }
2335
+ /** Detach the handlers and arm the one-shot `start()` pass-through for the `Protocol.connect()` handover. */
2336
+ release() {
2337
+ this.detach();
2338
+ const transport = this._transport;
2339
+ const originalStart = transport.start;
2340
+ let armed = true;
2341
+ transport.start = async function() {
2342
+ if (armed) {
2343
+ armed = false;
2344
+ transport.start = originalStart;
2345
+ return;
2346
+ }
2347
+ return originalStart.call(transport);
2348
+ };
2349
+ }
2350
+ };
2351
+ /**
2352
+ * Spent-close guards from failed negotiations, pending disarm by the cleanup
2353
+ * site (keyed weakly — an abandoned transport carries its guard to GC).
2354
+ */
2355
+ const pendingSpentCloseGuards = /* @__PURE__ */ new WeakMap();
2356
+ /**
2357
+ * Disarm a failed negotiation's spent-close guard once the cleanup `close()`
2358
+ * has settled. Any re-delivery of the spent mid-window close happens DURING
2359
+ * that close (HTTP transports re-fire `onclose` there; stdio transports never
2360
+ * do — their close event already fired), so after it every close is genuine
2361
+ * and must reach the caller's pre-set observer.
2362
+ */
2363
+ function disarmSpentCloseGuard(transport) {
2364
+ const disarm = pendingSpentCloseGuards.get(transport);
2365
+ pendingSpentCloseGuards.delete(transport);
2366
+ disarm?.();
2367
+ }
2368
+ /** Build the probe request: `server/discover` carrying the full per-request `_meta` envelope. */
2369
+ function buildProbeRequest(id, protocolVersion, clientInfo, capabilities) {
2370
+ return {
2371
+ jsonrpc: "2.0",
2372
+ id,
2373
+ method: "server/discover",
2374
+ params: { _meta: codecForVersion(protocolVersion).outboundEnvelope({
2375
+ protocolVersion,
2376
+ clientInfo,
2377
+ clientCapabilities: capabilities
2378
+ }) }
2379
+ };
2380
+ }
2381
+ /** True for what the transport throws when the probe was answered 2xx without a usable reply. */
2382
+ function isUnusableReplyError(error) {
2383
+ if (error instanceof SdkError && error.code === SdkErrorCode.ClientHttpUnexpectedContent) return true;
2384
+ return error instanceof Error && error.name === "SyntaxError";
2385
+ }
2386
+ function normalizeReply(reply, timeoutMs) {
2387
+ switch (reply.kind) {
2388
+ case "response": return reply.error === void 0 ? {
2389
+ kind: "result",
2390
+ result: reply.result
2391
+ } : {
2392
+ kind: "rpc-error",
2393
+ ...reply.error
2394
+ };
2395
+ case "send-error": {
2396
+ const error = reply.error;
2397
+ if (isAuthSeamEscape(error) || error instanceof UnauthorizedError || error instanceof Error && error.name === "UnauthorizedError") return {
2398
+ kind: "auth-required",
2399
+ error
2400
+ };
2401
+ if (error instanceof SdkHttpError) {
2402
+ const text = error.data?.text;
2403
+ return {
2404
+ kind: "http-error",
2405
+ status: error.data.status,
2406
+ body: typeof text === "string" ? text : void 0,
2407
+ statusText: error.data.statusText
2408
+ };
2409
+ }
2410
+ if (isUnusableReplyError(error)) return {
2411
+ kind: "unusable-reply",
2412
+ error
2413
+ };
2414
+ return {
2415
+ kind: "network-error",
2416
+ error
2417
+ };
2418
+ }
2419
+ case "closed": return { kind: "closed" };
2420
+ case "timeout": return {
2421
+ kind: "timeout",
2422
+ timeoutMs
2423
+ };
2424
+ }
2425
+ }
2426
+ /**
2427
+ * Run the negotiation probe state machine on a raw (not yet Protocol-connected)
2428
+ * transport. Resolves with the negotiated era; throws typed connect errors. On
2429
+ * return the probe window has been released: the transport is started,
2430
+ * handler-free, and ready for `Protocol.connect()` handover. On throw the
2431
+ * window is detached and the transport's `start` is left untouched.
2432
+ */
2433
+ async function negotiateEra(negotiation, deps) {
2434
+ const timeoutMs = negotiation.probe.timeoutMs ?? deps.defaultTimeoutMs;
2435
+ const maxRetries = Math.max(0, negotiation.probe.maxRetries ?? 0);
2436
+ const clientModernVersions = negotiation.kind === "pin" ? [negotiation.version] : negotiation.modernVersions;
2437
+ const fallbackAvailable = negotiation.kind === "auto" && negotiation.fallbackAvailable;
2438
+ const window = await ProbeWindow.open(deps.transport);
2439
+ const probe = async () => {
2440
+ let requestedVersion = clientModernVersions[0];
2441
+ let correctiveUsed = false;
2442
+ let timeoutRetriesRemaining = maxRetries;
2443
+ for (;;) {
2444
+ const reply = await window.exchange((id) => buildProbeRequest(id, requestedVersion, deps.clientInfo, deps.capabilities), timeoutMs);
2445
+ if (reply.kind === "timeout" && timeoutRetriesRemaining > 0) {
2446
+ timeoutRetriesRemaining--;
2447
+ continue;
2448
+ }
2449
+ const outcome = normalizeReply(reply, timeoutMs);
2450
+ const verdict = classifyProbeOutcome(outcome, {
2451
+ clientModernVersions,
2452
+ requestedVersion,
2453
+ fallbackAvailable,
2454
+ environment: deps.environment,
2455
+ transportKind: deps.transportKind
2456
+ });
2457
+ switch (verdict.kind) {
2458
+ case "modern": return {
2459
+ era: "modern",
2460
+ version: verdict.version,
2461
+ discover: verdict.discover
2462
+ };
2463
+ case "corrective":
2464
+ if (correctiveUsed) throw verdict.error;
2465
+ correctiveUsed = true;
2466
+ requestedVersion = verdict.version;
2467
+ continue;
2468
+ case "legacy": {
2469
+ const closedCause = outcome.kind === "closed" ? "the connection closed during the server/discover probe" : void 0;
2470
+ if (negotiation.kind === "pin") throw new SdkError(SdkErrorCode.EraNegotiationFailed, closedCause === void 0 ? `Version negotiation failed: the server did not offer pinned protocol version ${negotiation.version} via server/discover (no fallback in pin mode)` : `Version negotiation failed: ${closedCause} before the server offered pinned protocol version ${negotiation.version} (no fallback in pin mode)`);
2471
+ if (!negotiation.fallbackAvailable) throw new SdkError(SdkErrorCode.EraNegotiationFailed, closedCause === void 0 ? "Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to" : `Version negotiation failed: ${closedCause} and this client supports no pre-2026-07-28 protocol version to fall back to`);
2472
+ if (closedCause !== void 0 && deps.disposableProbe !== true) throw new SdkError(SdkErrorCode.EraNegotiationFailed, `Version negotiation failed: ${closedCause} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);
2473
+ return { era: "legacy" };
2474
+ }
2475
+ case "error": throw verdict.error;
2476
+ }
2477
+ }
2478
+ };
2479
+ let result;
2480
+ try {
2481
+ result = await probe();
2482
+ } catch (error) {
2483
+ window.detach();
2484
+ throw error;
2485
+ }
2486
+ window.release();
2487
+ return result;
2488
+ }
2489
+ /**
2490
+ * Structural read of the SDK stdio transport's retained spawn parameters —
2491
+ * `undefined` for stdio-shaped transports that do not expose them, and for
2492
+ * SUBCLASSES of the SDK transport (those probe in place, where a mid-probe
2493
+ * close stays a typed connect error). The sibling path requires the transport
2494
+ * to be exactly the base class: a subclass cannot be faithfully cloned by
2495
+ * re-invoking its constructor with the retained params alone (extra ctor
2496
+ * arguments, transformed state, side effects). Exactness is checked without
2497
+ * importing the class (the negotiation graph must stay runtime-neutral): only
2498
+ * the base class's own prototype carries the internal `_dispose` reaper the
2499
+ * sibling flow depends on — a subclass's prototype does not own it.
2500
+ */
2501
+ function readStdioServerParams(transport) {
2502
+ const proto = Object.getPrototypeOf(transport);
2503
+ if (proto === null || !Object.prototype.hasOwnProperty.call(proto, "_dispose")) return;
2504
+ const params = transport._serverParams;
2505
+ return typeof params === "object" && params !== null && typeof params.command === "string" ? params : void 0;
2506
+ }
2507
+ /**
2508
+ * stdio era negotiation on a DISPOSABLE SIBLING: stdio servers built on SDKs
2509
+ * that terminate on any pre-`initialize` request exit when the probe arrives,
2510
+ * so the probe must not spend the caller's one process life. `server/discover`
2511
+ * runs on a short-lived sibling spawned from the same parameters; the caller's
2512
+ * transport starts exactly once, after the era is known. The sibling is
2513
+ * invisible infrastructure: its stderr is discarded, and it is reaped before
2514
+ * this resolves (signal escalation awaiting process exit — a helper holding
2515
+ * its pipes never blocks disposal). A caller `close()` on the session
2516
+ * transport during the probe aborts the connect with the typed negotiation
2517
+ * error, and the session transport is never started.
2518
+ */
2519
+ async function negotiateStdioViaSibling(negotiation, sessionTransport, params, deps) {
2520
+ const SiblingTransport = sessionTransport.constructor;
2521
+ const sibling = new SiblingTransport({
2522
+ ...params,
2523
+ stderr: "ignore"
2524
+ });
2525
+ const originalClose = sessionTransport.close;
2526
+ let callerClosed = false;
2527
+ let signalClosed;
2528
+ const closedSignal = new Promise((_, reject) => {
2529
+ signalClosed = () => reject(callerCloseAbortError());
2530
+ });
2531
+ sessionTransport.close = async function() {
2532
+ callerClosed = true;
2533
+ signalClosed?.();
2534
+ return originalClose.call(sessionTransport);
2535
+ };
2536
+ let result;
2537
+ try {
2538
+ const negotiated = negotiateEra(negotiation, {
2539
+ ...deps,
2540
+ transport: sibling,
2541
+ transportKind: "stdio",
2542
+ disposableProbe: true
2543
+ });
2544
+ negotiated.catch(() => {});
2545
+ result = await Promise.race([negotiated, closedSignal]);
2546
+ } finally {
2547
+ await disposeSibling(sibling);
2548
+ sessionTransport.close = originalClose;
2549
+ }
2550
+ if (callerClosed) throw callerCloseAbortError();
2551
+ return result;
2552
+ }
2553
+ /** The typed abort for a caller `close()` landing while the sibling probes. */
2554
+ function callerCloseAbortError() {
2555
+ return new SdkError(SdkErrorCode.EraNegotiationFailed, "Version negotiation failed: the transport was closed during the server/discover probe");
2556
+ }
2557
+ /** Reap a probe sibling — best-effort; a sibling that cannot be reaped must not turn a settled verdict into an error. */
2558
+ async function disposeSibling(sibling) {
2559
+ try {
2560
+ const dispose = sibling._dispose;
2561
+ await (typeof dispose === "function" ? dispose.call(sibling) : sibling.close());
2562
+ } catch {}
2563
+ }
2564
+
2565
+ //#endregion
2566
+ //#region src/client/client.ts
2567
+ /**
2568
+ * The server identity a `DiscoverResult` carries in
2569
+ * `_meta['io.modelcontextprotocol/serverInfo']` (a spec SHOULD — absent means
2570
+ * the server offered no identity). Runtime-validated with the spec-type
2571
+ * guard because `connect({ prior })` accepts caller-supplied values that
2572
+ * never saw a wire parse.
2573
+ */
2574
+ function serverInfoFromDiscover(discover) {
2575
+ const fromMeta = discover._meta?.[SERVER_INFO_META_KEY];
2576
+ return isSpecType.Implementation(fromMeta) ? fromMeta : void 0;
2577
+ }
2578
+ /**
2579
+ * Elicitation default application helper. Applies defaults to the `data` based on the `schema`.
2580
+ *
2581
+ * @param schema - The schema to apply defaults to.
2582
+ * @param data - The data to apply defaults to.
2583
+ */
2584
+ function applyElicitationDefaults(schema, data) {
2585
+ if (!schema || data === null || typeof data !== "object") return;
2586
+ if (schema.type === "object" && schema.properties && typeof schema.properties === "object") {
2587
+ const obj = data;
2588
+ const props = schema.properties;
2589
+ for (const key of Object.keys(props)) {
2590
+ const propSchema = props[key];
2591
+ if (obj[key] === void 0 && Object.prototype.hasOwnProperty.call(propSchema, "default")) obj[key] = propSchema.default;
2592
+ if (obj[key] !== void 0) applyElicitationDefaults(propSchema, obj[key]);
2593
+ }
2594
+ }
2595
+ if (Array.isArray(schema.anyOf)) {
2596
+ for (const sub of schema.anyOf) if (typeof sub !== "boolean") applyElicitationDefaults(sub, data);
2597
+ }
2598
+ if (Array.isArray(schema.oneOf)) {
2599
+ for (const sub of schema.oneOf) if (typeof sub !== "boolean") applyElicitationDefaults(sub, data);
2600
+ }
2601
+ }
2602
+ /**
2603
+ * Determines which elicitation modes are supported based on declared client capabilities.
2604
+ *
2605
+ * According to the spec:
2606
+ * - An empty elicitation capability object defaults to form mode support (backwards compatibility)
2607
+ * - URL mode is only supported if explicitly declared
2608
+ *
2609
+ * @param capabilities - The client's elicitation capabilities
2610
+ * @returns An object indicating which modes are supported
2611
+ */
2612
+ function getSupportedElicitationModes(capabilities) {
2613
+ if (!capabilities) return {
2614
+ supportsFormMode: false,
2615
+ supportsUrlMode: false
2616
+ };
2617
+ const hasFormCapability = capabilities.form !== void 0;
2618
+ const hasUrlCapability = capabilities.url !== void 0;
2619
+ return {
2620
+ supportsFormMode: hasFormCapability || !hasFormCapability && !hasUrlCapability,
2621
+ supportsUrlMode: hasUrlCapability
2622
+ };
2623
+ }
2624
+ /**
2625
+ * Rejects malformed persisted blobs with a typed `SdkError` before any state
2626
+ * change: unrecognized `kind`, a legacy verdict also carrying
2627
+ * DiscoverResult-shaped members (a corrupt blob must never era-choose), or a
2628
+ * modern `discover` payload failing the wire path's schema.
2629
+ */
2630
+ function validatePrior(prior) {
2631
+ if (typeof prior === "object" && prior !== null) {
2632
+ if (prior.kind === "legacy" && !("supportedVersions" in prior) && !("discover" in prior)) return prior;
2633
+ if (prior.kind === "modern" && DiscoverResultSchema.safeParse(prior.discover).success) return prior;
2634
+ }
2635
+ throw new SdkError(SdkErrorCode.EraNegotiationFailed, "connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }");
2636
+ }
2637
+ /**
2638
+ * `list_changed` notification → response-cache method(s) to evict. `resources`
2639
+ * covers both list verbs (the spec's "relevant notification ⇒ immediately
2640
+ * stale").
2641
+ */
2642
+ const LIST_CHANGED_EVICTIONS = {
2643
+ "notifications/tools/list_changed": ["tools/list"],
2644
+ "notifications/prompts/list_changed": ["prompts/list"],
2645
+ "notifications/resources/list_changed": ["resources/list", "resources/templates/list"]
2646
+ };
2647
+ const DEFAULT_LIST_MAX_PAGES = 64;
2648
+ const clientInternals = {};
2649
+ /**
2650
+ * An MCP client on top of a pluggable transport.
2651
+ *
2652
+ * The client will automatically begin the initialization flow with the server when {@linkcode connect} is called.
2653
+ *
2654
+ * To handle server-initiated requests (sampling, elicitation, roots), call {@linkcode setRequestHandler}.
2655
+ * The client must declare the corresponding capability for the handler to be accepted. For
2656
+ * `sampling/createMessage` and `elicitation/create`, the handler is automatically wrapped with
2657
+ * schema validation for both the incoming request and the returned result.
2658
+ *
2659
+ * Note: the `roots/list` and `sampling/createMessage` handler surfaces (and the corresponding
2660
+ * `roots` and `sampling` capabilities) are deprecated as of protocol version 2026-07-28
2661
+ * (SEP-2577). They remain functional during the deprecation window (at least twelve months).
2662
+ * Migrate sampling to calling LLM provider APIs directly, and roots to passing paths via tool
2663
+ * parameters, resource URIs, or configuration.
2664
+ *
2665
+ * @example Handling a sampling request
2666
+ * ```ts source="./client.examples.ts#Client_setRequestHandler_sampling"
2667
+ * client.setRequestHandler('sampling/createMessage', async request => {
2668
+ * const lastMessage = request.params.messages.at(-1);
2669
+ * console.log('Sampling request:', lastMessage);
2670
+ *
2671
+ * // In production, send messages to your LLM here
2672
+ * return {
2673
+ * model: 'my-model',
2674
+ * role: 'assistant' as const,
2675
+ * content: {
2676
+ * type: 'text' as const,
2677
+ * text: 'Response from the model'
2678
+ * }
2679
+ * };
2680
+ * });
2681
+ * ```
2682
+ */
2683
+ var Client = class extends Protocol {
2684
+ _serverCapabilities;
2685
+ _serverVersion;
2686
+ _capabilities;
2687
+ _instructions;
2688
+ _jsonSchemaValidator;
2689
+ /**
2690
+ * The response-cache substrate. Owns the backing store, the per-method
2691
+ * eviction-generation counter, the user-supplied/default flag, and the
2692
+ * stamp-memoized derived `name → Tool` / `name → output-validator`
2693
+ * indices — the cache-coordination state that used to live as separate
2694
+ * private fields here. The internal aggregating walk writes one entry per
2695
+ * list verb; `list_changed` evicts the matching method;
2696
+ * `_resetConnectionState` resets the lot. {@linkcode callTool}'s
2697
+ * output-schema validation reads the derived `outputValidator` index (the
2698
+ * substrate's first production caller); the stacked SEP-2243 PR wires
2699
+ * `Mcp-Param-*` mirroring through `toolDefinition` on top.
2700
+ */
2701
+ _cache;
2702
+ _defaultCacheTtlMs;
2703
+ _listMaxPages;
2704
+ _listChangedDebounceTimers = /* @__PURE__ */ new Map();
2705
+ /**
2706
+ * The constructor `listChanged` configuration. Durable across reconnects:
2707
+ * read fresh on every connect (legacy or modern), never consumed.
2708
+ */
2709
+ _listChangedConfig;
2710
+ _enforceStrictCapabilities;
2711
+ _versionNegotiation;
2712
+ _supportedProtocolVersionsOption;
2713
+ _inputRequiredDriverConfig;
2714
+ /**
2715
+ * Active subscriptions/listen state, keyed by subscription id (= the
2716
+ * listen request's JSON-RPC id verbatim). The id is a STRING from a
2717
+ * Client-owned counter (`'listen:' + N`) — JSON-RPC permits string ids,
2718
+ * and Protocol's numeric `_requestMessageId` counter only ever issues
2719
+ * numbers, so listen ids cannot collide with ordinary request ids.
2720
+ */
2721
+ _listenState = /* @__PURE__ */ new Map();
2722
+ _nextListenId = 0;
2723
+ /** The auto-opened subscription backing ClientOptions.listChanged on a modern connection. */
2724
+ _autoOpenedSubscription;
2725
+ /** Backing store for {@linkcode getDiscoverResult}. Per-connection. */
2726
+ _discoverResult;
2727
+ static {
2728
+ clientInternals.enforceStrictCapabilities = (client) => client._enforceStrictCapabilities;
2729
+ clientInternals.walkPages = (client, method, fetchPage, items) => client._walkPages(method, fetchPage, items);
2730
+ clientInternals.readResource = (client, params, options) => client._readResource(params, options);
2731
+ }
2732
+ /**
2733
+ * Clears every per-connection field in one place. Called at the start of
2734
+ * each fresh (non-resuming) connect and from `close()`, so a stale
2735
+ * negotiated era / server identity / auto-opened subscription cannot
2736
+ * survive a reconnect.
2737
+ */
2738
+ _resetConnectionState() {
2739
+ this._negotiatedProtocolVersion = void 0;
2740
+ this._serverCapabilities = void 0;
2741
+ this._serverVersion = void 0;
2742
+ this._instructions = void 0;
2743
+ this._discoverResult = void 0;
2744
+ this._autoOpenedSubscription = void 0;
2745
+ if (this._listenState.size > 0) {
2746
+ const reason = new SdkError(SdkErrorCode.ConnectionClosed, "subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset");
2747
+ for (const entry of this._listenState.values()) entry.settle({
2748
+ cause: "remote",
2749
+ error: reason
2750
+ });
2751
+ }
2752
+ this._listenState.clear();
2753
+ for (const timer of this._listChangedDebounceTimers.values()) clearTimeout(timer);
2754
+ this._listChangedDebounceTimers.clear();
2755
+ this._cache.resetForReconnect();
2756
+ }
2757
+ async close() {
2758
+ try {
2759
+ await super.close();
2760
+ } finally {
2761
+ this._resetConnectionState();
2762
+ }
2763
+ }
2764
+ /**
2765
+ * Initializes this client with the given name and version information.
2766
+ */
2767
+ constructor(_clientInfo, options) {
2768
+ super(options);
2769
+ this._clientInfo = _clientInfo;
2770
+ this._capabilities = options?.capabilities ? { ...options.capabilities } : {};
2771
+ this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new DefaultJsonSchemaValidator();
2772
+ this._enforceStrictCapabilities = options?.enforceStrictCapabilities ?? false;
2773
+ this._versionNegotiation = options?.versionNegotiation;
2774
+ this._supportedProtocolVersionsOption = options?.supportedProtocolVersions;
2775
+ this._inputRequiredDriverConfig = resolveInputRequiredDriverConfig(options?.inputRequired);
2776
+ this._cache = new ClientResponseCache(options?.responseCacheStore ?? new InMemoryResponseCacheStore(), options?.responseCacheStore !== void 0, (error) => this._reportStoreError(error), options?.cachePartition ?? "");
2777
+ this._defaultCacheTtlMs = options?.defaultCacheTtlMs ?? 0;
2778
+ this._listMaxPages = options?.listMaxPages ?? DEFAULT_LIST_MAX_PAGES;
2779
+ if (options?.listChanged) this._listChangedConfig = options.listChanged;
2780
+ }
2781
+ buildContext(ctx, _transportInfo) {
2782
+ return ctx;
2783
+ }
2784
+ /**
2785
+ * Era-keyed direction enforcement for inbound traffic on channels whose
2786
+ * transport does not classify (e.g. stdio): the 2026-07-28 era has no
2787
+ * server→client JSON-RPC request channel — server-to-client interactions
2788
+ * are carried in-band in `input_required` results — and on stdio the
2789
+ * client must never write JSON-RPC responses. An inbound request arriving
2790
+ * on a connection that negotiated a modern era is therefore dropped
2791
+ * (surfaced via `onerror`) rather than answered. Connections on a legacy
2792
+ * era — and all responses and notifications — keep today's dispatch path.
2793
+ */
2794
+ _shouldDropInbound(message) {
2795
+ if (this._negotiatedProtocolVersion !== void 0 && isModernProtocolVersion(this._negotiatedProtocolVersion) && isJSONRPCRequest(message)) return "drop";
2796
+ }
2797
+ /**
2798
+ * Per-request `_meta` envelope auto-emission (protocol revision 2026-07-28):
2799
+ * on a connection that negotiated a modern era — auto-negotiated or pinned —
2800
+ * every outgoing request and notification automatically carries the reserved
2801
+ * protocol-version / client-info / client-capabilities `_meta` keys (the
2802
+ * same envelope the connect-time `server/discover` probe sends).
2803
+ * User-supplied `_meta` keys take precedence over the auto-attached ones.
2804
+ *
2805
+ * Legacy-era connections return `undefined`: the envelope seam is a no-op
2806
+ * and outbound traffic is byte-identical to a 2025 client (the legacy
2807
+ * `'auto'` fallback included).
2808
+ */
2809
+ _outboundMetaEnvelope() {
2810
+ const version = this._negotiatedProtocolVersion;
2811
+ if (version === void 0) return void 0;
2812
+ return this._wireCodec().outboundEnvelope({
2813
+ protocolVersion: version,
2814
+ clientInfo: this._clientInfo,
2815
+ clientCapabilities: this._capabilities
2816
+ });
2817
+ }
2818
+ /**
2819
+ * Wires the multi-round-trip auto-fulfilment engine (protocol revision
2820
+ * 2026-07-28) into the response funnel: an `input_required` answer is
2821
+ * fulfilled through the registered elicitation/sampling/roots handlers
2822
+ * and the original request retried via `flow.retry`, up to
2823
+ * `inputRequired.maxRounds` rounds. With auto-fulfilment disabled the
2824
+ * response surfaces as a typed error steering to manual mode.
2825
+ */
2826
+ _resolveNonCompleteResult(decoded, flow) {
2827
+ if (!this._inputRequiredDriverConfig.autoFulfill) return Promise.reject(new SdkError(SdkErrorCode.UnsupportedResultType, `Unsupported result type 'input_required' for ${flow.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`, {
2828
+ resultType: "input_required",
2829
+ method: flow.request.method
2830
+ }));
2831
+ return runInputRequiredFlow({
2832
+ getRequestHandler: (method) => this._getRequestHandler(method),
2833
+ buildContext: (baseCtx) => this.buildContext(baseCtx, void 0),
2834
+ sessionId: this.transport?.sessionId
2835
+ }, this._inputRequiredDriverConfig, decoded, flow);
2836
+ }
2837
+ /**
2838
+ * Set up handlers for list changed notifications based on config and server capabilities.
2839
+ * This should only be called after initialization when server capabilities are known.
2840
+ * Handlers are silently skipped if the server doesn't advertise the corresponding listChanged capability.
2841
+ * @internal
2842
+ */
2843
+ _setupListChangedHandlers(config) {
2844
+ if (config.tools && this._serverCapabilities?.tools?.listChanged) this._setupListChangedHandler("tools", "notifications/tools/list_changed", config.tools, async () => {
2845
+ return (await this.listTools(void 0, { cacheMode: "refresh" })).tools;
2846
+ });
2847
+ if (config.prompts && this._serverCapabilities?.prompts?.listChanged) this._setupListChangedHandler("prompts", "notifications/prompts/list_changed", config.prompts, async () => {
2848
+ return (await this.listPrompts(void 0, { cacheMode: "refresh" })).prompts;
2849
+ });
2850
+ if (config.resources && this._serverCapabilities?.resources?.listChanged) this._setupListChangedHandler("resources", "notifications/resources/list_changed", config.resources, async () => {
2851
+ return (await this.listResources(void 0, { cacheMode: "refresh" })).resources;
2852
+ });
2853
+ }
2854
+ /**
2855
+ * Registers new capabilities. This can only be called before connecting to a transport.
2856
+ *
2857
+ * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
2858
+ */
2859
+ registerCapabilities(capabilities) {
2860
+ if (this.transport) throw new Error("Cannot register capabilities after connecting to transport");
2861
+ this._capabilities = mergeCapabilities(this._capabilities, capabilities);
2862
+ }
2863
+ /**
2864
+ * Configure protocol version negotiation before connecting (equivalent to
2865
+ * passing `versionNegotiation` at construction time). Can only be called
2866
+ * before connecting to a transport. Passing `undefined` clears a previously
2867
+ * configured negotiation, restoring the default `'legacy'` posture.
2868
+ *
2869
+ * See {@linkcode ClientOptions | ClientOptions.versionNegotiation} for the mode semantics.
2870
+ */
2871
+ setVersionNegotiation(options) {
2872
+ if (this.transport) throw new Error("Cannot configure version negotiation after connecting to transport");
2873
+ this._versionNegotiation = options;
2874
+ }
2875
+ /**
2876
+ * Enforces client-side validation for `elicitation/create` and `sampling/createMessage`
2877
+ * regardless of how the handler was registered.
2878
+ */
2879
+ _wrapHandler(method, handler) {
2880
+ if (method === "elicitation/create") return async (request, ctx) => {
2881
+ const codec = codecForVersion(this._negotiatedProtocolVersion);
2882
+ let validatedRequest = codec.validateRequest("elicitation/create", request);
2883
+ if (!validatedRequest.ok && validatedRequest.reason === "not-in-era") validatedRequest = codec.validateInputRequest("elicitation/create", request);
2884
+ if (!validatedRequest.ok) throw new ProtocolError(validatedRequest.reason === "not-in-era" ? ProtocolErrorCode.InternalError : ProtocolErrorCode.InvalidParams, validatedRequest.reason === "not-in-era" ? "No wire schema for elicitation/create in the resolved era" : `Invalid elicitation request: ${validatedRequest.message}`);
2885
+ const { params } = validatedRequest.value;
2886
+ params.mode = params.mode ?? "form";
2887
+ const { supportsFormMode, supportsUrlMode } = getSupportedElicitationModes(this._capabilities.elicitation);
2888
+ if (params.mode === "form" && !supportsFormMode) throw new ProtocolError(ProtocolErrorCode.InvalidParams, "Client does not support form-mode elicitation requests");
2889
+ if (params.mode === "url" && !supportsUrlMode) throw new ProtocolError(ProtocolErrorCode.InvalidParams, "Client does not support URL-mode elicitation requests");
2890
+ const result = await handler(request, ctx);
2891
+ let validationResult = codec.validateResult("elicitation/create", result);
2892
+ if (!validationResult.ok && validationResult.reason === "not-in-era") validationResult = codec.validateInputResponse("elicitation/create", result);
2893
+ if (!validationResult.ok) throw new ProtocolError(validationResult.reason === "not-in-era" ? ProtocolErrorCode.InternalError : ProtocolErrorCode.InvalidParams, validationResult.reason === "not-in-era" ? "No wire schema for elicitation/create in the resolved era" : `Invalid elicitation result: ${validationResult.message}`);
2894
+ const validatedResult = validationResult.value;
2895
+ const requestedSchema = params.mode === "form" ? params.requestedSchema : void 0;
2896
+ if (params.mode === "form" && validatedResult.action === "accept" && validatedResult.content && requestedSchema && this._capabilities.elicitation?.form?.applyDefaults) try {
2897
+ applyElicitationDefaults(requestedSchema, validatedResult.content);
2898
+ } catch {}
2899
+ return validatedResult;
2900
+ };
2901
+ if (method === "sampling/createMessage") return async (request, ctx) => {
2902
+ const codec = codecForVersion(this._negotiatedProtocolVersion);
2903
+ let validatedRequest = codec.validateRequest("sampling/createMessage", request);
2904
+ if (!validatedRequest.ok && validatedRequest.reason === "not-in-era") validatedRequest = codec.validateInputRequest("sampling/createMessage", request);
2905
+ if (!validatedRequest.ok) throw new ProtocolError(validatedRequest.reason === "not-in-era" ? ProtocolErrorCode.InternalError : ProtocolErrorCode.InvalidParams, validatedRequest.reason === "not-in-era" ? "No wire schema for sampling/createMessage in the resolved era" : `Invalid sampling request: ${validatedRequest.message}`);
2906
+ const { params } = validatedRequest.value;
2907
+ const result = await handler(request, ctx);
2908
+ const hasTools = Boolean(params.tools || params.toolChoice);
2909
+ let validatedResult = codec.samplingResultVariant(hasTools, result);
2910
+ if (!validatedResult.ok && validatedResult.reason === "not-in-era") validatedResult = codec.validateInputResponse("sampling/createMessage", result);
2911
+ if (!validatedResult.ok) throw new ProtocolError(validatedResult.reason === "not-in-era" ? ProtocolErrorCode.InternalError : ProtocolErrorCode.InvalidParams, validatedResult.reason === "not-in-era" ? "No result schema for sampling/createMessage in the resolved era" : `Invalid sampling result: ${validatedResult.message}`);
2912
+ return validatedResult.value;
2913
+ };
2914
+ return handler;
2915
+ }
2916
+ assertCapability(capability, method) {
2917
+ if (!this._serverCapabilities?.[capability]) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support ${capability} (required for ${method})`);
2918
+ }
2919
+ /**
2920
+ * Connects to a server via the given transport and performs the MCP initialization handshake.
2921
+ *
2922
+ * @example Basic usage (stdio)
2923
+ * ```ts source="./client.examples.ts#Client_connect_stdio"
2924
+ * const client = new Client({ name: 'my-client', version: '1.0.0' });
2925
+ * const transport = new StdioClientTransport({ command: 'my-mcp-server' });
2926
+ * await client.connect(transport);
2927
+ * ```
2928
+ *
2929
+ * @example Streamable HTTP with SSE fallback
2930
+ * ```ts source="./client.examples.ts#Client_connect_sseFallback"
2931
+ * const baseUrl = new URL(url);
2932
+ *
2933
+ * try {
2934
+ * // Try modern Streamable HTTP transport first
2935
+ * const client = new Client({ name: 'my-client', version: '1.0.0' });
2936
+ * const transport = new StreamableHTTPClientTransport(baseUrl);
2937
+ * await client.connect(transport);
2938
+ * return { client, transport };
2939
+ * } catch {
2940
+ * // Fall back to legacy SSE transport
2941
+ * const client = new Client({ name: 'my-client', version: '1.0.0' });
2942
+ * const transport = new SSEClientTransport(baseUrl);
2943
+ * await client.connect(transport);
2944
+ * return { client, transport };
2945
+ * }
2946
+ * ```
2947
+ */
2948
+ async connect(transport, options) {
2949
+ if (options?.prior != null) return this._connectFromPrior(transport, validatePrior(options.prior), options);
2950
+ const negotiation = resolveVersionNegotiation(this._versionNegotiation, this._supportedProtocolVersionsOption);
2951
+ if (negotiation.kind !== "legacy") return this._connectNegotiated(transport, negotiation, options);
2952
+ return this._connectPlainLegacy(transport, options);
2953
+ }
2954
+ /**
2955
+ * Plain legacy connect — the pinned 2025 sequence, byte-untouched. The
2956
+ * `mode: 'legacy'` connect body, shared with the `prior` legacy verdict.
2957
+ */
2958
+ async _connectPlainLegacy(transport, options) {
2959
+ await super.connect(transport);
2960
+ if (transport.sessionId !== void 0) {
2961
+ const negotiatedProtocolVersion = this._negotiatedProtocolVersion;
2962
+ if (negotiatedProtocolVersion !== void 0) transport.setProtocolVersion?.(negotiatedProtocolVersion);
2963
+ return;
2964
+ }
2965
+ this._resetConnectionState();
2966
+ await this._legacyHandshake(transport, options);
2967
+ }
2968
+ /**
2969
+ * The 2025 `initialize` handshake — the body of the plain legacy connect and
2970
+ * the `'auto'`-mode fallback path (same `initialize` body, zero 2026 headers;
2971
+ * on the stdio sibling path it opens the session child's fresh pipe, in the
2972
+ * in-place modes it rides the probed connection). Callers clear the negotiated protocol version before
2973
+ * the handshake; its completion sets the negotiated (legacy) version.
2974
+ */
2975
+ async _legacyHandshake(transport, options) {
2976
+ const legacyVersions = legacyProtocolVersions(this._supportedProtocolVersions);
2977
+ try {
2978
+ const offeredVersion = legacyVersions[0];
2979
+ if (offeredVersion === void 0) throw new SdkError(SdkErrorCode.EraNegotiationFailed, "Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version");
2980
+ const result = await this.request({
2981
+ method: "initialize",
2982
+ params: {
2983
+ protocolVersion: offeredVersion,
2984
+ capabilities: this._capabilities,
2985
+ clientInfo: this._clientInfo
2986
+ }
2987
+ }, options);
2988
+ if (result === void 0) throw new Error(`Server sent invalid initialize result: ${result}`);
2989
+ if (!legacyVersions.includes(result.protocolVersion)) throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`);
2990
+ this._serverCapabilities = result.capabilities;
2991
+ this._serverVersion = result.serverInfo;
2992
+ this._cache.setServerIdentity(this._deriveServerIdentity(transport));
2993
+ if (transport.setProtocolVersion) transport.setProtocolVersion(result.protocolVersion);
2994
+ this._instructions = result.instructions;
2995
+ await this.notification({ method: "notifications/initialized" });
2996
+ this._negotiatedProtocolVersion = result.protocolVersion;
2997
+ if (this._listChangedConfig) this._setupListChangedHandlers(this._listChangedConfig);
2998
+ } catch (error) {
2999
+ this.close();
3000
+ throw error;
3001
+ }
3002
+ }
3003
+ /**
3004
+ * Negotiated connect (mode `'auto'` or `{ pin }`): probe with `server/discover`
3005
+ * before the Protocol machinery attaches — on a disposable sibling process for
3006
+ * the SDK's stdio transport, in place otherwise — then either establish the
3007
+ * modern era or perform the plain legacy handshake.
3008
+ */
3009
+ async _connectNegotiated(transport, negotiation, options) {
3010
+ if (transport.sessionId !== void 0) {
3011
+ await super.connect(transport);
3012
+ const negotiatedProtocolVersion = this._negotiatedProtocolVersion;
3013
+ if (negotiatedProtocolVersion !== void 0 && transport.setProtocolVersion) transport.setProtocolVersion(negotiatedProtocolVersion);
3014
+ return;
3015
+ }
3016
+ this._resetConnectionState();
3017
+ let result;
3018
+ try {
3019
+ const transportKind = detectProbeTransportKind(transport);
3020
+ const baseDeps = {
3021
+ clientInfo: this._clientInfo,
3022
+ capabilities: this._capabilities,
3023
+ environment: detectProbeEnvironment(),
3024
+ defaultTimeoutMs: options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC
3025
+ };
3026
+ const stdioParams = transportKind === "stdio" ? readStdioServerParams(transport) : void 0;
3027
+ result = stdioParams === void 0 ? await negotiateEra(negotiation, {
3028
+ ...baseDeps,
3029
+ transport,
3030
+ transportKind
3031
+ }) : await negotiateStdioViaSibling(negotiation, transport, stdioParams, baseDeps);
3032
+ } catch (error) {
3033
+ await transport.close().catch(() => {});
3034
+ disarmSpentCloseGuard(transport);
3035
+ throw error;
3036
+ }
3037
+ disarmSpentCloseGuard(transport);
3038
+ await super.connect(transport);
3039
+ if (result.era === "legacy") {
3040
+ await this._legacyHandshake(transport, options);
3041
+ return;
3042
+ }
3043
+ this._serverCapabilities = result.discover.capabilities;
3044
+ this._serverVersion = serverInfoFromDiscover(result.discover);
3045
+ this._cache.setServerIdentity(this._deriveServerIdentity(transport));
3046
+ this._instructions = result.discover.instructions;
3047
+ this._discoverResult = result.discover;
3048
+ this._negotiatedProtocolVersion = result.version;
3049
+ if (transport.setProtocolVersion) transport.setProtocolVersion(result.version);
3050
+ if (this._listChangedConfig) {
3051
+ const config = this._listChangedConfig;
3052
+ const advertised = this._serverCapabilities;
3053
+ const effective = {
3054
+ ...config.tools && advertised?.tools?.listChanged && { tools: config.tools },
3055
+ ...config.prompts && advertised?.prompts?.listChanged && { prompts: config.prompts },
3056
+ ...config.resources && advertised?.resources?.listChanged && { resources: config.resources }
3057
+ };
3058
+ let handlersRegistered = true;
3059
+ try {
3060
+ this._setupListChangedHandlers(effective);
3061
+ } catch (error) {
3062
+ handlersRegistered = false;
3063
+ this.onerror?.(error instanceof Error ? error : new Error(String(error)));
3064
+ }
3065
+ const filter = handlersRegistered ? {
3066
+ ...effective.tools && { toolsListChanged: true },
3067
+ ...effective.prompts && { promptsListChanged: true },
3068
+ ...effective.resources && { resourcesListChanged: true }
3069
+ } : {};
3070
+ if (Object.keys(filter).length > 0) {
3071
+ const ackAbort = new AbortController();
3072
+ const onConnectAbort = () => ackAbort.abort(options?.signal?.reason);
3073
+ if (options?.signal?.aborted) onConnectAbort();
3074
+ options?.signal?.addEventListener("abort", onConnectAbort);
3075
+ try {
3076
+ this._autoOpenedSubscription = await this.listen(filter, {
3077
+ timeout: options?.timeout,
3078
+ signal: ackAbort.signal
3079
+ });
3080
+ } catch (error) {
3081
+ if (options?.signal?.aborted) {
3082
+ await this.close().catch(() => {});
3083
+ throw error;
3084
+ }
3085
+ this.onerror?.(error instanceof Error ? error : new Error(String(error)));
3086
+ } finally {
3087
+ options?.signal?.removeEventListener("abort", onConnectAbort);
3088
+ }
3089
+ }
3090
+ }
3091
+ }
3092
+ /**
3093
+ * Connect from a validated {@linkcode PriorDiscovery}: the modern arm
3094
+ * adopts the `DiscoverResult` (zero round trips; `EraNegotiationFailed`
3095
+ * on no 2026-07-28+ overlap), the legacy arm runs the plain legacy connect.
3096
+ */
3097
+ async _connectFromPrior(transport, prior, options) {
3098
+ if (prior.kind === "legacy") return this._connectPlainLegacy(transport, options);
3099
+ const discover = prior.discover;
3100
+ this._resetConnectionState();
3101
+ const explicit = this._supportedProtocolVersionsOption;
3102
+ const version = (explicit && modernProtocolVersions(explicit).length > 0 ? modernProtocolVersions(explicit) : SUPPORTED_MODERN_PROTOCOL_VERSIONS).find((v) => discover.supportedVersions.includes(v));
3103
+ if (version === void 0) throw new SdkError(SdkErrorCode.EraNegotiationFailed, "connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.");
3104
+ await super.connect(transport);
3105
+ this._discoverResult = discover;
3106
+ this._serverCapabilities = discover.capabilities;
3107
+ this._serverVersion = serverInfoFromDiscover(discover);
3108
+ this._cache.setServerIdentity(this._deriveServerIdentity(transport));
3109
+ this._instructions = discover.instructions;
3110
+ this._negotiatedProtocolVersion = version;
3111
+ transport.setProtocolVersion?.(version);
3112
+ if (this._listChangedConfig) try {
3113
+ this._setupListChangedHandlers(this._listChangedConfig);
3114
+ } catch (error) {
3115
+ this.onerror?.(error instanceof Error ? error : new Error(String(error)));
3116
+ }
3117
+ }
3118
+ /**
3119
+ * After initialization has completed, this will be populated with the server's reported capabilities.
3120
+ */
3121
+ getServerCapabilities() {
3122
+ return this._serverCapabilities;
3123
+ }
3124
+ /**
3125
+ * The connected server's self-reported name and version, when it
3126
+ * identified itself: required on the legacy `initialize` result; a spec
3127
+ * SHOULD in the discover result's `_meta` on 2026-07-28, so a successful
3128
+ * modern connect against an anonymous server leaves this `undefined`.
3129
+ */
3130
+ getServerVersion() {
3131
+ return this._serverVersion;
3132
+ }
3133
+ /**
3134
+ * The connected server's identity for response-cache partitioning. The
3135
+ * `serverInfo` `name@version` pair when available (required on
3136
+ * `initialize`; a SHOULD in the discover result's `_meta` since spec PR
3137
+ * #3002); falls back to the transport's `sessionId`, then to a
3138
+ * per-connection surrogate. The surrogate matters since #3002 made
3139
+ * identity optional: without it, two identity-less servers reached over
3140
+ * sessionId-less transports would share the cache's pre-connect `''`
3141
+ * partition and read each other's entries — no stable identity means no
3142
+ * cross-connection cache reuse. The value itself is server-controlled —
3143
+ * the collision-safety of the storage partition comes from
3144
+ * {@linkcode ClientResponseCache}'s JSON-array encoding around it, not
3145
+ * from any character it does or does not contain.
3146
+ */
3147
+ _deriveServerIdentity(transport) {
3148
+ const v = this._serverVersion;
3149
+ if (v !== void 0) return `${v.name}@${v.version}`;
3150
+ return transport.sessionId ?? `anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`;
3151
+ }
3152
+ /**
3153
+ * After initialization has completed, this will be populated with the protocol version negotiated
3154
+ * during the initialize handshake. When manually reconstructing a transport for reconnection, pass this
3155
+ * value to the new transport so it continues sending the required `mcp-protocol-version` header.
3156
+ */
3157
+ getNegotiatedProtocolVersion() {
3158
+ return this._negotiatedProtocolVersion;
3159
+ }
3160
+ /**
3161
+ * After initialization has completed, this returns the protocol era of the
3162
+ * connection: `'modern'` when the connection negotiated a 2026-07-28+
3163
+ * revision (via `server/discover`), `'legacy'` for the 2025-era
3164
+ * `initialize` handshake, or `undefined` before the connection is
3165
+ * established.
3166
+ */
3167
+ getProtocolEra() {
3168
+ const version = this._negotiatedProtocolVersion;
3169
+ if (version === void 0) return void 0;
3170
+ return isModernProtocolVersion(version) ? "modern" : "legacy";
3171
+ }
3172
+ /**
3173
+ * After initialization has completed, this may be populated with information about the server's instructions.
3174
+ */
3175
+ getInstructions() {
3176
+ return this._instructions;
3177
+ }
3178
+ /**
3179
+ * The {@linkcode DiscoverResult} from the last `'auto'`/pinned probe,
3180
+ * {@linkcode discover} call, or `connect({ prior })` that adopted a
3181
+ * modern verdict (a legacy verdict leaves this `undefined` — there is no
3182
+ * `DiscoverResult` on that path). Persistable via `JSON.stringify`; wrap
3183
+ * as `{ kind: 'modern', discover }` and feed to {@linkcode ConnectOptions}
3184
+ * `prior`.
3185
+ */
3186
+ getDiscoverResult() {
3187
+ return this._discoverResult;
3188
+ }
3189
+ assertCapabilityForMethod(method) {
3190
+ switch (method) {
3191
+ case "logging/setLevel":
3192
+ if (!this._serverCapabilities?.logging) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support logging (required for ${method})`);
3193
+ break;
3194
+ case "prompts/get":
3195
+ case "prompts/list":
3196
+ if (!this._serverCapabilities?.prompts) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support prompts (required for ${method})`);
3197
+ break;
3198
+ case "resources/list":
3199
+ case "resources/templates/list":
3200
+ case "resources/read":
3201
+ case "resources/subscribe":
3202
+ case "resources/unsubscribe":
3203
+ if (!this._serverCapabilities?.resources) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support resources (required for ${method})`);
3204
+ if (method === "resources/subscribe" && !this._serverCapabilities.resources.subscribe) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support resource subscriptions (required for ${method})`);
3205
+ break;
3206
+ case "tools/call":
3207
+ case "tools/list":
3208
+ if (!this._serverCapabilities?.tools) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support tools (required for ${method})`);
3209
+ break;
3210
+ case "completion/complete":
3211
+ if (!this._serverCapabilities?.completions) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Server does not support completions (required for ${method})`);
3212
+ break;
3213
+ case "initialize": break;
3214
+ case "server/discover": break;
3215
+ case "ping": break;
3216
+ }
3217
+ }
3218
+ assertNotificationCapability(method) {
3219
+ switch (method) {
3220
+ case "notifications/roots/list_changed":
3221
+ if (!this._capabilities.roots?.listChanged) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support roots list changed notifications (required for ${method})`);
3222
+ break;
3223
+ case "notifications/initialized": break;
3224
+ case "notifications/cancelled": break;
3225
+ case "notifications/progress": break;
3226
+ }
3227
+ }
3228
+ assertRequestHandlerCapability(method) {
3229
+ switch (method) {
3230
+ case "sampling/createMessage":
3231
+ if (!this._capabilities.sampling) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support sampling capability (required for ${method})`);
3232
+ break;
3233
+ case "elicitation/create":
3234
+ if (!this._capabilities.elicitation) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support elicitation capability (required for ${method})`);
3235
+ break;
3236
+ case "roots/list":
3237
+ if (!this._capabilities.roots) throw new SdkError(SdkErrorCode.CapabilityNotSupported, `Client does not support roots capability (required for ${method})`);
3238
+ break;
3239
+ case "ping": break;
3240
+ }
3241
+ }
3242
+ async ping(options) {
3243
+ return this.request({ method: "ping" }, options);
3244
+ }
3245
+ /**
3246
+ * Send `server/discover` (2026-07-28+) and record the result for
3247
+ * {@linkcode getDiscoverResult}.
3248
+ */
3249
+ async discover(options) {
3250
+ const result = await this._requestWithSchema({ method: "server/discover" }, DiscoverResultSchema, options);
3251
+ this._discoverResult = result;
3252
+ return result;
3253
+ }
3254
+ /** Requests argument autocompletion suggestions from the server for a prompt or resource. */
3255
+ async complete(params, options) {
3256
+ return this.request({
3257
+ method: "completion/complete",
3258
+ params
3259
+ }, options);
3260
+ }
3261
+ /**
3262
+ * Sets the minimum severity level for log messages sent by the server.
3263
+ *
3264
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
3265
+ * Remains functional during the deprecation window (at least twelve months).
3266
+ * Migrate to stderr logging (STDIO servers) or OpenTelemetry.
3267
+ */
3268
+ async setLoggingLevel(level, options) {
3269
+ return this.request({
3270
+ method: "logging/setLevel",
3271
+ params: { level }
3272
+ }, options);
3273
+ }
3274
+ /** Retrieves a prompt by name from the server, passing the given arguments for template substitution. */
3275
+ async getPrompt(params, options) {
3276
+ return this.request({
3277
+ method: "prompts/get",
3278
+ params
3279
+ }, options);
3280
+ }
3281
+ /**
3282
+ * Lists available prompts.
3283
+ *
3284
+ * Called without a `cursor` (the common case), this walks every page and
3285
+ * returns the complete aggregated list with no `nextCursor`; the
3286
+ * aggregate is also written to the {@linkcode ResponseCacheStore}. Pass an
3287
+ * explicit `{ cursor }` to fetch a single page and walk pagination
3288
+ * yourself — the per-page path returns the server's raw page (with
3289
+ * `nextCursor` for the next call) and does not write the response cache.
3290
+ * The auto-aggregate path is capped by
3291
+ * {@linkcode ClientOptions | ClientOptions.listMaxPages} (default 64); the per-page path
3292
+ * is not.
3293
+ *
3294
+ * Returns an empty list if the server does not advertise prompts capability
3295
+ * (or throws if {@linkcode ClientOptions.enforceStrictCapabilities} is enabled).
3296
+ *
3297
+ * @example
3298
+ * ```ts source="./client.examples.ts#Client_listPrompts_pagination"
3299
+ * // No cursor → all pages aggregated for you.
3300
+ * const { prompts } = await client.listPrompts();
3301
+ * console.log(
3302
+ * 'Available prompts:',
3303
+ * prompts.map(p => p.name)
3304
+ * );
3305
+ * ```
3306
+ */
3307
+ async listPrompts(params, options) {
3308
+ if (!this._serverCapabilities?.prompts && !this._enforceStrictCapabilities) {
3309
+ console.debug("Client.listPrompts() called but server does not advertise prompts capability - returning empty list");
3310
+ return { prompts: [] };
3311
+ }
3312
+ if (params?.cursor !== void 0) return this.request({
3313
+ method: "prompts/list",
3314
+ params
3315
+ }, options);
3316
+ const hit = await this._serveFromCache("prompts/list", void 0, options);
3317
+ if (hit !== void 0) return hit;
3318
+ return this._listAllPages("prompts/list", params, options, (r) => r.prompts);
3319
+ }
3320
+ /**
3321
+ * Lists available resources.
3322
+ *
3323
+ * Called without a `cursor` (the common case), this walks every page and
3324
+ * returns the complete aggregated list with no `nextCursor`; the
3325
+ * aggregate is also written to the {@linkcode ResponseCacheStore}. Pass an
3326
+ * explicit `{ cursor }` to fetch a single page and walk pagination
3327
+ * yourself — the per-page path returns the server's raw page (with
3328
+ * `nextCursor` for the next call) and does not write the response cache.
3329
+ * The auto-aggregate path is capped by
3330
+ * {@linkcode ClientOptions | ClientOptions.listMaxPages} (default 64); the per-page path
3331
+ * is not.
3332
+ *
3333
+ * Returns an empty list if the server does not advertise resources capability
3334
+ * (or throws if {@linkcode ClientOptions.enforceStrictCapabilities} is enabled).
3335
+ *
3336
+ * @example
3337
+ * ```ts source="./client.examples.ts#Client_listResources_pagination"
3338
+ * // No cursor → all pages aggregated for you.
3339
+ * const { resources } = await client.listResources();
3340
+ * console.log(
3341
+ * 'Available resources:',
3342
+ * resources.map(r => r.name)
3343
+ * );
3344
+ * ```
3345
+ */
3346
+ async listResources(params, options) {
3347
+ if (!this._serverCapabilities?.resources && !this._enforceStrictCapabilities) {
3348
+ console.debug("Client.listResources() called but server does not advertise resources capability - returning empty list");
3349
+ return { resources: [] };
3350
+ }
3351
+ if (params?.cursor !== void 0) return this.request({
3352
+ method: "resources/list",
3353
+ params
3354
+ }, options);
3355
+ const hit = await this._serveFromCache("resources/list", void 0, options);
3356
+ if (hit !== void 0) return hit;
3357
+ return this._listAllPages("resources/list", params, options, (r) => r.resources);
3358
+ }
3359
+ /**
3360
+ * Lists available resource URI templates for dynamic resources.
3361
+ *
3362
+ * Called without a `cursor`, this walks every page and returns the
3363
+ * complete aggregated list with no `nextCursor`; the aggregate is
3364
+ * also written to the {@linkcode ResponseCacheStore}. Pass an explicit
3365
+ * `{ cursor }` to fetch a single page — see
3366
+ * {@linkcode listResources | listResources()} for the per-page contract.
3367
+ *
3368
+ * Returns an empty list if the server does not advertise resources capability
3369
+ * (or throws if {@linkcode ClientOptions.enforceStrictCapabilities} is enabled).
3370
+ */
3371
+ async listResourceTemplates(params, options) {
3372
+ if (!this._serverCapabilities?.resources && !this._enforceStrictCapabilities) {
3373
+ console.debug("Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list");
3374
+ return { resourceTemplates: [] };
3375
+ }
3376
+ if (params?.cursor !== void 0) return this.request({
3377
+ method: "resources/templates/list",
3378
+ params
3379
+ }, options);
3380
+ const hit = await this._serveFromCache("resources/templates/list", void 0, options);
3381
+ if (hit !== void 0) return hit;
3382
+ return this._listAllPages("resources/templates/list", params, options, (r) => r.resourceTemplates);
3383
+ }
3384
+ /**
3385
+ * Walk every page of a paginated list verb, aggregate, and write ONE
3386
+ * entry to the response cache. Internal — backs the public `list*`
3387
+ * methods' no-`cursor` auto-aggregate path. Page 1's result object is
3388
+ * mutated in place (its items array is extended; `nextCursor` is
3389
+ * cleared); page-1 metadata (`ttlMs`, `cacheScope`, `_meta`) is preserved.
3390
+ * A page with the same items and `nextCursor` as the previous page ends the walk;
3391
+ * {@linkcode ClientOptions.listMaxPages} is a hard cap — hitting it
3392
+ * throws, so a partial aggregate is never cached. The
3393
+ * captured-generation guard skips the write when a `list_changed` landed
3394
+ * mid-walk, so the eviction is never overwritten by a stale aggregate.
3395
+ * `finalize` runs on the complete aggregate before the cache write — the
3396
+ * SEP-2243 invalid-`x-mcp-header` exclusion hooks here so the cached
3397
+ * `tools/list` entry is already filtered.
3398
+ *
3399
+ * The caller's `baseParams` (everything except `cursor`) is threaded into
3400
+ * every page request — page 1 sends `{...baseParams}`, later pages
3401
+ * `{...baseParams, cursor}` — so a typed, documented `_meta` (e.g. W3C
3402
+ * trace context) supplied to the public `list*()` reaches every wire
3403
+ * request the walk issues.
3404
+ */
3405
+ async _listAllPages(method, baseParams, options, items, finalize) {
3406
+ const bypass = options?.cacheMode === "bypass";
3407
+ const generation = this._cache.captureGeneration(method);
3408
+ const fetchPage = (cursor) => {
3409
+ const params = cursor === void 0 ? baseParams && { ...baseParams } : {
3410
+ ...baseParams,
3411
+ cursor
3412
+ };
3413
+ return this.request({
3414
+ method,
3415
+ ...params && { params }
3416
+ }, options);
3417
+ };
3418
+ const acc = await this._walkPages(method, fetchPage, items);
3419
+ delete acc.nextCursor;
3420
+ finalize?.(acc);
3421
+ if (bypass) return acc;
3422
+ await this._cache.write(method, acc, generation, this._freshness(acc));
3423
+ return acc;
3424
+ }
3425
+ async _walkPages(method, fetchPage, items) {
3426
+ const acc = await fetchPage(void 0);
3427
+ let cursor = acc.nextCursor;
3428
+ let previous = acc;
3429
+ let pages = 1;
3430
+ while (cursor !== void 0) {
3431
+ if (this._listMaxPages !== 0 && pages >= this._listMaxPages) throw new SdkError(SdkErrorCode.ListPaginationExceeded, `${method}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`, {
3432
+ method,
3433
+ listMaxPages: this._listMaxPages
3434
+ });
3435
+ const page = await fetchPage(cursor);
3436
+ if (page.nextCursor === cursor && JSON.stringify(items(page)) === JSON.stringify(items(previous))) break;
3437
+ items(acc).push(...items(page));
3438
+ previous = page;
3439
+ cursor = page.nextCursor;
3440
+ pages++;
3441
+ }
3442
+ return acc;
3443
+ }
3444
+ /**
3445
+ * Compute the {@linkcode ClientResponseCache.write} freshness payload from
3446
+ * a cacheable result body. The single seam through which the client reads
3447
+ * `ttlMs`/`cacheScope` (mcp.d's `cachedFetch` engine). The fields pass
3448
+ * through the loose result schema, so they are read off the runtime body;
3449
+ * a missing `ttlMs` falls back to
3450
+ * {@linkcode ClientOptions | ClientOptions.defaultCacheTtlMs}; an explicit server-sent
3451
+ * `ttlMs` (including `0` — the spec's "immediately stale") is honoured
3452
+ * as-is. The default of `0` means `expiresAt === now()` ⇒ never served,
3453
+ * only stored. A missing `cacheScope` is treated as `'private'` — the
3454
+ * spec's `'public'` grant ("any client … MAY serve to any user") is too
3455
+ * strong to infer by default, and matches this SDK's server-side stamp
3456
+ * default.
3457
+ */
3458
+ _freshness(result, params) {
3459
+ const body = result;
3460
+ const ttlMs = typeof body.ttlMs === "number" ? body.ttlMs : this._defaultCacheTtlMs;
3461
+ const scope = body.cacheScope === "public" ? "public" : "private";
3462
+ return {
3463
+ expiresAt: this._cache.now() + Math.min(Math.max(0, ttlMs), MAX_CACHE_TTL_MS),
3464
+ scope,
3465
+ params
3466
+ };
3467
+ }
3468
+ /**
3469
+ * The cache-serving front of every cacheable verb (mcp.d's `cachedFetch`
3470
+ * read half): under `cacheMode: 'use'` (the default), a fresh held entry
3471
+ * is served and the round trip is skipped. `'refresh'` and `'bypass'`
3472
+ * always fetch (the caller decides whether to write). Freshness and
3473
+ * decoding live in {@linkcode ClientResponseCache.read}; every hit is
3474
+ * freshly parsed, so the caller owns it outright. A custom store
3475
+ * whose `get()` rejects is routed to `onerror` and treated as a miss —
3476
+ * cache bookkeeping never blocks a request from reaching the wire.
3477
+ */
3478
+ async _serveFromCache(method, params, options) {
3479
+ if (options?.cacheMode === "bypass" || options?.cacheMode === "refresh") return void 0;
3480
+ const hit = await this._cache.read(method, params).catch((error) => void this._reportStoreError(error));
3481
+ if (hit !== void 0) {
3482
+ if (options?.signal?.aborted) {
3483
+ const reason = options.signal.reason;
3484
+ throw reason instanceof SdkError ? reason : new SdkError(SdkErrorCode.RequestTimeout, String(reason));
3485
+ }
3486
+ return hit.value;
3487
+ }
3488
+ }
3489
+ /** Route a custom-store failure to `onerror` without aborting the surrounding dispatch. */
3490
+ _reportStoreError(e) {
3491
+ this.onerror?.(e instanceof Error ? e : new Error(String(e)));
3492
+ }
3493
+ /**
3494
+ * Compile a single tool's `outputSchema`. Passed as the compile callback to
3495
+ * {@linkcode ClientResponseCache.outputValidator} so the cache class stays
3496
+ * free of any validator-provider dependency, and called directly for the
3497
+ * `options.toolDefinition` path of {@linkcode callTool} (a one-off
3498
+ * caller-supplied definition is compiled in isolation and never enters the
3499
+ * cache, so it cannot poison the listed tool of the same name).
3500
+ *
3501
+ * Returns `undefined` when the tool has no `outputSchema`, or a
3502
+ * discriminated `{ok}` result otherwise. SEP-2106: ANY throw from the
3503
+ * validator engine — unsupported `$schema` dialect, invalid `pattern`
3504
+ * regex, unresolvable `$ref`, or any other engine error — is captured as
3505
+ * `{ok: false, compileError}` so one bad schema does not poison the rest
3506
+ * of the listing; `callTool()` surfaces it as an `InvalidParams` error
3507
+ * before the request. The `{ok}` discriminator (not
3508
+ * `compileError !== undefined`) means a custom provider that does
3509
+ * `throw undefined` is still treated as a captured failure.
3510
+ */
3511
+ _compileOutputValidator(tool) {
3512
+ if (!tool.outputSchema) return void 0;
3513
+ try {
3514
+ return {
3515
+ ok: true,
3516
+ validator: this._jsonSchemaValidator.getValidator(tool.outputSchema)
3517
+ };
3518
+ } catch (error) {
3519
+ return {
3520
+ ok: false,
3521
+ compileError: error
3522
+ };
3523
+ }
3524
+ }
3525
+ /**
3526
+ * Resolve the SEP-2243 `x-mcp-header` declaration scan for a tool name.
3527
+ *
3528
+ * The caller-supplied `toolDefinition` escape hatch wins; otherwise the
3529
+ * cached `tools/list` entry (via the cache's `toolDefinition`) is the
3530
+ * source. Freshness is the response cache's lifecycle: `list_changed`
3531
+ * evicts, otherwise the held schema is the best information available
3532
+ * regardless of age, and a stale schema is recovered through the
3533
+ * `HEADER_MISMATCH` → evict-refetch-retry path in {@linkcode callTool}.
3534
+ * On a miss the call proceeds without `Mcp-Param-*` headers (the spec's
3535
+ * "client SHOULD send without custom headers" guidance) and relies on the
3536
+ * same recovery.
3537
+ */
3538
+ async _resolveXMcpHeaderScan(name, override) {
3539
+ const tool = override ?? await this._cache.toolDefinition(name);
3540
+ return tool === void 0 ? void 0 : scanXMcpHeaderDeclarations(tool.inputSchema);
3541
+ }
3542
+ /**
3543
+ * Reads the contents of a resource by URI.
3544
+ *
3545
+ * Honours the result's `ttlMs`/`cacheScope` (SEP-2549): a still-fresh
3546
+ * cached body for the same `uri` is returned without a round trip
3547
+ * (`cacheMode: 'use'`, the default). The cache key is `{method, uri}`
3548
+ * partitioned by the resolved scope — `'private'` (the default when the
3549
+ * server omits the field) is stored under this client's
3550
+ * {@linkcode ClientOptions | ClientOptions.cachePartition}, so a shared
3551
+ * store cannot serve one principal's resource body to another. Unlike the
3552
+ * list verbs, a result whose resolved TTL is ≤0 is **not** stored
3553
+ * (`resources/read` has no derived index and the URI keyspace is
3554
+ * unbounded).
3555
+ */
3556
+ async readResource(params, options) {
3557
+ const { result } = await this._readResource(params, options);
3558
+ return result;
3559
+ }
3560
+ async _readResource(params, options) {
3561
+ const hit = await this._serveFromCache("resources/read", params.uri, options);
3562
+ if (hit !== void 0) return {
3563
+ result: hit,
3564
+ cached: true
3565
+ };
3566
+ const generation = this._cache.captureGeneration("resources/read", params.uri);
3567
+ const result = await this.request({
3568
+ method: "resources/read",
3569
+ params
3570
+ }, options);
3571
+ if (options?.cacheMode !== "bypass") {
3572
+ const freshness = this._freshness(result, params.uri);
3573
+ if (freshness.expiresAt > this._cache.now()) await this._cache.write("resources/read", result, generation, freshness);
3574
+ else if (options?.cacheMode === "refresh") await this._cache.evictKey("resources/read", params.uri);
3575
+ }
3576
+ return {
3577
+ result,
3578
+ cached: false
3579
+ };
3580
+ }
3581
+ /** Subscribes to change notifications for a resource. The server must support resource subscriptions. */
3582
+ async subscribeResource(params, options) {
3583
+ return this.request({
3584
+ method: "resources/subscribe",
3585
+ params
3586
+ }, options);
3587
+ }
3588
+ /** Unsubscribes from change notifications for a resource. */
3589
+ async unsubscribeResource(params, options) {
3590
+ return this.request({
3591
+ method: "resources/unsubscribe",
3592
+ params
3593
+ }, options);
3594
+ }
3595
+ /**
3596
+ * Opens a `subscriptions/listen` stream (protocol revision 2026-07-28).
3597
+ *
3598
+ * Resolves once the server's `notifications/subscriptions/acknowledged`
3599
+ * arrives (the standard request timeout applies to this ack phase). Change
3600
+ * notifications delivered on the stream are dispatched to the existing
3601
+ * {@linkcode setNotificationHandler} registrations — the same handlers the
3602
+ * 2025-era unsolicited notifications fire on a legacy connection — so
3603
+ * `listen()` is era-transparent for consumers that already register those.
3604
+ *
3605
+ * `close()` tears the subscription down by aborting the listen request's
3606
+ * `requestSignal` (closes the SSE stream where the transport honors it)
3607
+ * AND sending `notifications/cancelled` referencing the listen request id
3608
+ * — both, unconditionally, so any spec-compliant server on any transport
3609
+ * sees the cancel. No automatic re-listen — call `listen()` again to
3610
+ * re-establish.
3611
+ *
3612
+ * On a 2025-era connection this throws a typed
3613
+ * {@linkcode SdkErrorCode.MethodNotSupportedByProtocolVersion} steering to
3614
+ * `resources/subscribe` and `ClientOptions.listChanged` (the legacy
3615
+ * unsolicited delivery model still applies there); no transparent shim.
3616
+ */
3617
+ async listen(filter, options) {
3618
+ if (this.transport === void 0) throw new SdkError(SdkErrorCode.NotConnected, "Not connected");
3619
+ const negotiated = this._negotiatedProtocolVersion;
3620
+ if (negotiated === void 0 || !isModernProtocolVersion(negotiated)) throw new SdkError(SdkErrorCode.MethodNotSupportedByProtocolVersion, `subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${negotiated ?? "none"}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`, {
3621
+ method: "subscriptions/listen",
3622
+ protocolVersion: negotiated
3623
+ });
3624
+ if (options?.signal?.aborted) {
3625
+ const reason = options.signal.reason;
3626
+ throw reason instanceof SdkError ? reason : new SdkError(SdkErrorCode.RequestTimeout, String(reason));
3627
+ }
3628
+ const requestAbort = new AbortController();
3629
+ const listenId = `listen:${this._nextListenId++}`;
3630
+ let state = "opening";
3631
+ let ackTimer;
3632
+ let onCallerAbort;
3633
+ let resolveOpening;
3634
+ let rejectOpening;
3635
+ const opening = new Promise((resolve, reject) => {
3636
+ resolveOpening = resolve;
3637
+ rejectOpening = reject;
3638
+ });
3639
+ let resolveClosed;
3640
+ const closed = new Promise((resolve) => {
3641
+ resolveClosed = resolve;
3642
+ });
3643
+ const settle = (outcome) => {
3644
+ if (state === "closed") return;
3645
+ const wasOpening = state === "opening";
3646
+ if (ackTimer !== void 0) {
3647
+ clearTimeout(ackTimer);
3648
+ ackTimer = void 0;
3649
+ }
3650
+ if ("ack" in outcome) {
3651
+ state = "open";
3652
+ resolveOpening(outcome.ack);
3653
+ return;
3654
+ }
3655
+ state = "closed";
3656
+ if (onCallerAbort !== void 0) options?.signal?.removeEventListener("abort", onCallerAbort);
3657
+ this._listenState.delete(listenId);
3658
+ requestAbort.abort();
3659
+ resolveClosed(outcome.cause);
3660
+ if (wasOpening) rejectOpening(outcome.error ?? new SdkError(SdkErrorCode.ConnectionClosed, "subscriptions/listen closed before the server acknowledged"));
3661
+ };
3662
+ const wireTeardown = async () => {
3663
+ requestAbort.abort();
3664
+ await this.notification({
3665
+ method: "notifications/cancelled",
3666
+ params: { requestId: listenId }
3667
+ }).catch(() => {});
3668
+ };
3669
+ const close = async () => {
3670
+ if (state === "closed") return;
3671
+ settle({ cause: "local" });
3672
+ await wireTeardown();
3673
+ };
3674
+ this._listenState.set(listenId, { settle });
3675
+ const ackTimeout = options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;
3676
+ ackTimer = setTimeout(() => {
3677
+ settle({
3678
+ cause: "remote",
3679
+ error: new SdkError(SdkErrorCode.RequestTimeout, "subscriptions/listen ack timed out", { timeout: ackTimeout })
3680
+ });
3681
+ wireTeardown().catch(() => {});
3682
+ }, ackTimeout);
3683
+ if (options?.signal) {
3684
+ const callerSignal = options.signal;
3685
+ onCallerAbort = () => {
3686
+ if (state === "closed") return;
3687
+ const reason = callerSignal.reason;
3688
+ settle({
3689
+ cause: "local",
3690
+ error: reason instanceof Error ? reason : new Error(String(reason ?? "Aborted"))
3691
+ });
3692
+ wireTeardown().catch(() => {});
3693
+ };
3694
+ callerSignal.addEventListener("abort", onCallerAbort, { once: true });
3695
+ }
3696
+ const jsonrpcRequest = {
3697
+ jsonrpc: "2.0",
3698
+ id: listenId,
3699
+ method: "subscriptions/listen",
3700
+ params: {
3701
+ _meta: { ...this._outboundMetaEnvelope() },
3702
+ notifications: filter
3703
+ }
3704
+ };
3705
+ const routeSendFailure = (error) => {
3706
+ settle({
3707
+ cause: "remote",
3708
+ error: error instanceof Error ? error : new Error(String(error))
3709
+ });
3710
+ };
3711
+ try {
3712
+ this.transport.send(jsonrpcRequest, {
3713
+ requestSignal: requestAbort.signal,
3714
+ onRequestStreamEnd: () => settle({
3715
+ cause: "remote",
3716
+ error: /* @__PURE__ */ new Error("subscriptions/listen: stream ended")
3717
+ })
3718
+ }).catch(routeSendFailure);
3719
+ } catch (error) {
3720
+ routeSendFailure(error);
3721
+ }
3722
+ return {
3723
+ honoredFilter: await opening,
3724
+ close,
3725
+ closed
3726
+ };
3727
+ }
3728
+ /**
3729
+ * The subscription auto-opened by `ClientOptions.listChanged` on a modern
3730
+ * connection — the listen filter is the intersection of the configured
3731
+ * sub-options and the server-advertised `listChanged` capabilities.
3732
+ * `undefined` on a legacy connection, before connect, or when that
3733
+ * intersection is empty (auto-open skipped). Exposed so the consumer can
3734
+ * `close()` it.
3735
+ */
3736
+ get autoOpenedSubscription() {
3737
+ return this._autoOpenedSubscription;
3738
+ }
3739
+ /**
3740
+ * Transport-level demux for `subscriptions/listen` notifications, before
3741
+ * any decoding/era-gating/handler dispatch. Consumes the leading
3742
+ * `notifications/subscriptions/acknowledged` referencing a live
3743
+ * subscription id (resolves the ack waiter) and an inbound
3744
+ * `notifications/cancelled` referencing a live string-typed subscription
3745
+ * id (server-side teardown on stdio). Change notifications carrying a
3746
+ * subscription id pass through to the existing registered handlers via
3747
+ * `super`. An unmatched ack/cancelled is NOT consumed: it reaches
3748
+ * `setNotificationHandler` / `fallbackNotificationHandler` instead of
3749
+ * being silently swallowed.
3750
+ */
3751
+ _onnotification(raw, extra) {
3752
+ const evicted = Object.hasOwn(LIST_CHANGED_EVICTIONS, raw.method) ? LIST_CHANGED_EVICTIONS[raw.method] : void 0;
3753
+ if (raw.method === "notifications/resources/updated") {
3754
+ const uri = raw.params?.uri;
3755
+ if (typeof uri === "string") this._cache.evictKey("resources/read", uri);
3756
+ } else if (evicted !== void 0) for (const method of evicted) this._cache.evict(method);
3757
+ if (raw.method === "notifications/subscriptions/acknowledged") {
3758
+ const subscriptionId = raw.params?._meta?.[SUBSCRIPTION_ID_META_KEY];
3759
+ const entry = typeof subscriptionId === "string" ? this._listenState.get(subscriptionId) : void 0;
3760
+ if (entry !== void 0) {
3761
+ const honored = this._wireCodec().validateNotification("notifications/subscriptions/acknowledged", raw);
3762
+ entry.settle({ ack: honored.ok ? honored.value.params.notifications : {} });
3763
+ return;
3764
+ }
3765
+ }
3766
+ if (raw.method === "notifications/cancelled") {
3767
+ const cancelledId = raw.params?.requestId;
3768
+ const entry = typeof cancelledId === "string" ? this._listenState.get(cancelledId) : void 0;
3769
+ if (entry !== void 0) {
3770
+ entry.settle({
3771
+ cause: "remote",
3772
+ error: /* @__PURE__ */ new Error("subscriptions/listen: server cancelled the subscription")
3773
+ });
3774
+ return;
3775
+ }
3776
+ }
3777
+ super._onnotification(raw, extra);
3778
+ }
3779
+ /**
3780
+ * Transport-level demux for `subscriptions/listen` responses. A JSON-RPC
3781
+ * ERROR for the listen id is the server's pre-ack capacity/params
3782
+ * rejection; a JSON-RPC RESULT for the listen id is the spec's
3783
+ * `SubscriptionsListenResult` — the server's GRACEFUL-close signal (sent
3784
+ * on shutdown). A string-id response that matches a live `_listenState`
3785
+ * entry is consumed here (Protocol's `_responseHandlers` map is keyed by
3786
+ * NUMBER and never holds a listen id, so passing a string-id response
3787
+ * through would surface as "unknown message ID" via `onerror`).
3788
+ */
3789
+ _onresponse(response) {
3790
+ const id = response.id;
3791
+ const entry = typeof id === "string" ? this._listenState.get(id) : void 0;
3792
+ if (entry !== void 0) {
3793
+ if (isJSONRPCErrorResponse(response)) entry.settle({
3794
+ cause: "remote",
3795
+ error: ProtocolError.fromError(response.error.code, response.error.message, response.error.data)
3796
+ });
3797
+ else entry.settle({
3798
+ cause: "graceful",
3799
+ error: new SdkError(SdkErrorCode.ConnectionClosed, "subscriptions/listen: server closed the subscription gracefully before acknowledging")
3800
+ });
3801
+ return;
3802
+ }
3803
+ super._onresponse(response);
3804
+ }
3805
+ /**
3806
+ * Settle every live per-listen state machine on a transport-initiated
3807
+ * close (the server dropping the connection on stdio/InMemory) before
3808
+ * Protocol's `_onclose` tears the transport down. The base
3809
+ * `_responseHandlers` settlement does not reach `_listenState` (listen
3810
+ * ids are never registered there), so without this override a remote
3811
+ * close would leave an in-flight `listen()` / open `McpSubscription`
3812
+ * hanging.
3813
+ */
3814
+ _onclose() {
3815
+ if (this._listenState.size > 0) {
3816
+ const reason = new SdkError(SdkErrorCode.ConnectionClosed, "Connection closed");
3817
+ for (const entry of this._listenState.values()) entry.settle({
3818
+ cause: "remote",
3819
+ error: reason
3820
+ });
3821
+ this._listenState.clear();
3822
+ }
3823
+ super._onclose();
3824
+ }
3825
+ /**
3826
+ * Calls a tool on the connected server and returns the result. Automatically validates structured output
3827
+ * if the tool has an `outputSchema`.
3828
+ *
3829
+ * Tool results have two error surfaces: `result.isError` for tool-level failures (the tool ran but reported
3830
+ * a problem), and thrown {@linkcode ProtocolError} for protocol-level failures or {@linkcode SdkError} for
3831
+ * SDK-level issues (timeouts, missing capabilities).
3832
+ *
3833
+ * @example Basic usage
3834
+ * ```ts source="./client.examples.ts#Client_callTool_basic"
3835
+ * const result = await client.callTool({
3836
+ * name: 'calculate-bmi',
3837
+ * arguments: { weightKg: 70, heightM: 1.75 }
3838
+ * });
3839
+ *
3840
+ * // Tool-level errors are returned in the result, not thrown
3841
+ * if (result.isError) {
3842
+ * console.error('Tool error:', result.content);
3843
+ * return;
3844
+ * }
3845
+ *
3846
+ * console.log(result.content);
3847
+ * ```
3848
+ *
3849
+ * @example Structured output
3850
+ * ```ts source="./client.examples.ts#Client_callTool_structuredOutput"
3851
+ * const result = await client.callTool({
3852
+ * name: 'calculate-bmi',
3853
+ * arguments: { weightKg: 70, heightM: 1.75 }
3854
+ * });
3855
+ *
3856
+ * // Machine-readable output for the client application. SEP-2106: structuredContent is
3857
+ * // `unknown` (any JSON value). Check for presence with `!== undefined` and narrow before use.
3858
+ * if (result.structuredContent !== undefined) {
3859
+ * const sc: unknown = result.structuredContent; // e.g. { bmi: 22.86 }
3860
+ * if (typeof sc === 'object' && sc !== null && 'bmi' in sc) {
3861
+ * console.log(sc.bmi);
3862
+ * }
3863
+ * }
3864
+ * ```
3865
+ */
3866
+ async callTool(params, options) {
3867
+ const mirroringActive = this.getProtocolEra() === "modern" && detectProbeEnvironment() !== "browser";
3868
+ const buildSendOptions = async () => {
3869
+ if (!mirroringActive) return options;
3870
+ let scan;
3871
+ try {
3872
+ scan = await this._resolveXMcpHeaderScan(params.name, options?.toolDefinition);
3873
+ } catch (error) {
3874
+ this._reportStoreError(error);
3875
+ }
3876
+ if (!scan?.valid || scan.declarations.length === 0) return options;
3877
+ const paramHeaders = buildMcpParamHeaders(scan.declarations, params.arguments);
3878
+ return Object.keys(paramHeaders).length === 0 ? options : {
3879
+ ...options,
3880
+ headers: {
3881
+ ...options?.headers,
3882
+ ...paramHeaders
3883
+ }
3884
+ };
3885
+ };
3886
+ let compiled = options?.toolDefinition === void 0 ? await this._cache.outputValidator(params.name, (tool) => this._compileOutputValidator(tool)).catch((error) => void this._reportStoreError(error)) : this._compileOutputValidator(options.toolDefinition);
3887
+ const assertCompiled = () => {
3888
+ if (compiled === void 0 || compiled.ok) return;
3889
+ const err = compiled.compileError;
3890
+ const message = (err instanceof Error ? err.message : String(err)).slice(0, 200);
3891
+ throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Tool '${params.name}' has an invalid outputSchema: ${message}`);
3892
+ };
3893
+ assertCompiled();
3894
+ let result;
3895
+ try {
3896
+ result = await this.request({
3897
+ method: "tools/call",
3898
+ params
3899
+ }, await buildSendOptions());
3900
+ } catch (error) {
3901
+ const isHeaderMismatch = error instanceof ProtocolError && error.code === HEADER_MISMATCH_ERROR_CODE;
3902
+ if (!mirroringActive || !isHeaderMismatch || options?.toolDefinition !== void 0) throw error;
3903
+ const refreshOptions = {
3904
+ signal: options?.signal,
3905
+ timeout: options?.timeout,
3906
+ cacheMode: "refresh"
3907
+ };
3908
+ await this._cache.evict("tools/list");
3909
+ await this.listTools(void 0, refreshOptions).catch((error_) => this._reportStoreError(error_));
3910
+ compiled = await this._cache.outputValidator(params.name, (tool) => this._compileOutputValidator(tool)).catch((error_) => void this._reportStoreError(error_));
3911
+ assertCompiled();
3912
+ result = await this.request({
3913
+ method: "tools/call",
3914
+ params
3915
+ }, await buildSendOptions());
3916
+ }
3917
+ const validator = compiled !== void 0 && compiled.ok ? compiled.validator : void 0;
3918
+ if (validator) {
3919
+ if (result.structuredContent === void 0 && !result.isError) throw new ProtocolError(ProtocolErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`);
3920
+ if (result.structuredContent !== void 0 && !result.isError) try {
3921
+ const validationResult = validator(result.structuredContent);
3922
+ if (!validationResult.valid) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`);
3923
+ } catch (error) {
3924
+ if (error instanceof ProtocolError) throw error;
3925
+ throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`);
3926
+ }
3927
+ }
3928
+ return result;
3929
+ }
3930
+ /**
3931
+ * Lists available tools.
3932
+ *
3933
+ * Called without a `cursor` (the common case), this walks every page and
3934
+ * returns the complete aggregated list with no `nextCursor`; the
3935
+ * aggregate is also written to the {@linkcode ResponseCacheStore} (the
3936
+ * source for {@linkcode callTool | callTool()}'s output-schema validation
3937
+ * and SEP-2243 `Mcp-Param-*` header mirroring). Pass an explicit
3938
+ * `{ cursor }` to fetch a single page and walk pagination yourself — the
3939
+ * per-page path returns the server's raw page (with `nextCursor` for the
3940
+ * next call) and does not write the response cache. The auto-aggregate
3941
+ * path is capped by {@linkcode ClientOptions | ClientOptions.listMaxPages} (default 64);
3942
+ * the per-page path is not.
3943
+ *
3944
+ * Returns an empty list if the server does not advertise tools capability
3945
+ * (or throws if {@linkcode ClientOptions.enforceStrictCapabilities} is enabled).
3946
+ *
3947
+ * @example
3948
+ * ```ts source="./client.examples.ts#Client_listTools_pagination"
3949
+ * // No cursor → all pages aggregated for you.
3950
+ * const { tools } = await client.listTools();
3951
+ * console.log(
3952
+ * 'Available tools:',
3953
+ * tools.map(t => t.name)
3954
+ * );
3955
+ * ```
3956
+ */
3957
+ async listTools(params, options) {
3958
+ if (!this._serverCapabilities?.tools && !this._enforceStrictCapabilities) {
3959
+ console.debug("Client.listTools() called but server does not advertise tools capability - returning empty list");
3960
+ return { tools: [] };
3961
+ }
3962
+ if (params?.cursor !== void 0) {
3963
+ const page = await this.request({
3964
+ method: "tools/list",
3965
+ params
3966
+ }, options);
3967
+ this._excludeInvalidXMcpHeaderTools(page);
3968
+ return page;
3969
+ }
3970
+ const hit = await this._serveFromCache("tools/list", void 0, options);
3971
+ if (hit !== void 0) return hit;
3972
+ return this._listAllPages("tools/list", params, options, (r) => r.tools, (acc) => this._excludeInvalidXMcpHeaderTools(acc));
3973
+ }
3974
+ /**
3975
+ * SEP-2243 (protocol revision 2026-07-28): a Streamable HTTP client MUST
3976
+ * exclude tool definitions whose `x-mcp-header` declarations violate the
3977
+ * constraints, and SHOULD log a warning naming the tool and the reason.
3978
+ * Applied to the CACHED aggregated `tools/list` result (so the entry
3979
+ * mirroring reads never holds an unmirrorable tool) AND to every public
3980
+ * per-page {@linkcode listTools | listTools()} return (the spec's MUST
3981
+ * has no carve-out for paginated reads). The gate is era-only on
3982
+ * non-stdio transports — `detectProbeTransportKind` cannot distinguish a
3983
+ * real HTTP transport from in-memory/custom transports (it only
3984
+ * positively recognizes stdio), and over-excluding on a non-HTTP modern
3985
+ * connection is harmless: those transports never carry per-request
3986
+ * headers, so an excluded tool would have been uncallable on a Streamable
3987
+ * HTTP arm of the same server. Mutates `result.tools` in place.
3988
+ */
3989
+ _excludeInvalidXMcpHeaderTools(result) {
3990
+ if (this.getProtocolEra() !== "modern" || !this.transport || detectProbeTransportKind(this.transport) === "stdio") return;
3991
+ const filtered = result.tools.filter((tool) => {
3992
+ const scan = scanXMcpHeaderDeclarations(tool.inputSchema);
3993
+ if (!scan.valid) {
3994
+ console.warn(`[mcp-sdk] excluding tool '${tool.name}' from tools/list: invalid x-mcp-header declaration — ${scan.reason}`);
3995
+ return false;
3996
+ }
3997
+ return true;
3998
+ });
3999
+ if (filtered.length !== result.tools.length) result.tools = filtered;
4000
+ }
4001
+ /**
4002
+ * Set up a single list changed handler.
4003
+ * @internal
4004
+ */
4005
+ _setupListChangedHandler(listType, notificationMethod, options, fetcher) {
4006
+ const parseResult = parseSchema(ListChangedOptionsBaseSchema, options);
4007
+ if (!parseResult.success) throw new Error(`Invalid ${listType} listChanged options: ${parseResult.error.message}`);
4008
+ if (typeof options.onChanged !== "function") throw new TypeError(`Invalid ${listType} listChanged options: onChanged must be a function`);
4009
+ const { autoRefresh, debounceMs } = parseResult.data;
4010
+ const { onChanged } = options;
4011
+ const refresh = async () => {
4012
+ if (!autoRefresh) {
4013
+ onChanged(null, null);
4014
+ return;
4015
+ }
4016
+ try {
4017
+ onChanged(null, await fetcher());
4018
+ } catch (error) {
4019
+ onChanged(error instanceof Error ? error : new Error(String(error)), null);
4020
+ }
4021
+ };
4022
+ const handler = () => {
4023
+ if (debounceMs) {
4024
+ const existingTimer = this._listChangedDebounceTimers.get(listType);
4025
+ if (existingTimer) clearTimeout(existingTimer);
4026
+ const timer = setTimeout(refresh, debounceMs);
4027
+ this._listChangedDebounceTimers.set(listType, timer);
4028
+ } else refresh();
4029
+ };
4030
+ this.setNotificationHandler(notificationMethod, handler);
4031
+ }
4032
+ /**
4033
+ * Notifies the server that the client's root list has changed. Requires the `roots.listChanged` capability.
4034
+ *
4035
+ * @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
4036
+ * Remains functional during the deprecation window (at least twelve months).
4037
+ * Migrate to passing paths via tool parameters, resource URIs, or configuration.
4038
+ */
4039
+ async sendRootsListChanged() {
4040
+ return this.notification({ method: "notifications/roots/list_changed" });
4041
+ }
4042
+ };
4043
+
4044
+ //#endregion
4045
+ export { resolveClientMetadata as A, OAuthClientFlowError as B, isOAuthClientProvider as C, refreshAuthorization as D, prepareAuthorizationCodeRequest as E, validateClientMetadataUrl as F, AuthorizationServerMismatchError as I, InsecureTokenEndpointError as L, selectResourceURL as M, startAuthorization as N, registerClient as O, validateAuthorizationResponseIssuer as P, InsufficientScopeError as R, isHttpsUrl as S, parseErrorResponse as T, RegistrationRejectedError as V, discoverOAuthServerInfo as _, InMemoryResponseCacheStore as a, extractWWWAuthenticateParams as b, adaptOAuthProvider as c, auth as d, buildDiscoveryUrls as f, discoverOAuthProtectedResourceMetadata as g, discoverOAuthMetadata as h, markAuthSeamEscape as i, selectClientAuthMethod as j, resolveAuthorizationCallbackParams as k, applyClientAuthentication as l, discoverAuthorizationServerMetadata as m, clientInternals as n, MAX_CACHE_TTL_MS as o, computeScopeUnion as p, getSupportedElicitationModes as r, UnauthorizedError as s, Client as t, assertSecureTokenEndpoint as u, exchangeAuthorization as v, isStrictScopeSuperset as w, fetchToken as x, extractResourceMetadataUrl as y, IssuerMismatchError as z };
4046
+ //# sourceMappingURL=public-CvV4ZHkX.mjs.map