@mastra/server 1.36.0-alpha.1 → 1.36.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/dist/{api-schema-manifest-EMKHNXSD.cjs → api-schema-manifest-CF2WPQBA.cjs} +6 -6
  3. package/dist/{api-schema-manifest-EMKHNXSD.cjs.map → api-schema-manifest-CF2WPQBA.cjs.map} +1 -1
  4. package/dist/{api-schema-manifest-EJXNYOFH.js → api-schema-manifest-YS3FEIFG.js} +4 -4
  5. package/dist/{api-schema-manifest-EJXNYOFH.js.map → api-schema-manifest-YS3FEIFG.js.map} +1 -1
  6. package/dist/{chunk-YARY4I5U.js → chunk-23S37FLK.js} +9 -3
  7. package/dist/chunk-23S37FLK.js.map +1 -0
  8. package/dist/{chunk-NG62OLVA.js → chunk-2JXX4IPC.js} +3 -3
  9. package/dist/{chunk-NG62OLVA.js.map → chunk-2JXX4IPC.js.map} +1 -1
  10. package/dist/{chunk-6IUJAAQ2.js → chunk-2SMGXJZJ.js} +42 -8
  11. package/dist/chunk-2SMGXJZJ.js.map +1 -0
  12. package/dist/{chunk-PQDYNK4J.cjs → chunk-3AKG5KEE.cjs} +45 -37
  13. package/dist/chunk-3AKG5KEE.cjs.map +1 -0
  14. package/dist/{chunk-Y6CAJLYX.js → chunk-3FLL7GNJ.js} +6 -6
  15. package/dist/{chunk-Y6CAJLYX.js.map → chunk-3FLL7GNJ.js.map} +1 -1
  16. package/dist/chunk-3ZWALPHI.cjs +101 -0
  17. package/dist/chunk-3ZWALPHI.cjs.map +1 -0
  18. package/dist/{chunk-Y5LNMKEY.cjs → chunk-43KD3CRE.cjs} +21 -7
  19. package/dist/chunk-43KD3CRE.cjs.map +1 -0
  20. package/dist/{chunk-3NA22RQ5.cjs → chunk-4BLUIUHS.cjs} +5 -5
  21. package/dist/{chunk-3NA22RQ5.cjs.map → chunk-4BLUIUHS.cjs.map} +1 -1
  22. package/dist/{chunk-FRFWWBSS.js → chunk-4DUHTOLC.js} +4 -4
  23. package/dist/{chunk-FRFWWBSS.js.map → chunk-4DUHTOLC.js.map} +1 -1
  24. package/dist/chunk-4G7S52U3.cjs +356 -0
  25. package/dist/chunk-4G7S52U3.cjs.map +1 -0
  26. package/dist/{chunk-XHA6OBT3.cjs → chunk-4UFLVROK.cjs} +13 -13
  27. package/dist/{chunk-XHA6OBT3.cjs.map → chunk-4UFLVROK.cjs.map} +1 -1
  28. package/dist/{chunk-YHRGDSTK.js → chunk-4XSWMZTL.js} +40 -3
  29. package/dist/chunk-4XSWMZTL.js.map +1 -0
  30. package/dist/{chunk-MHQFFRA2.cjs → chunk-4Z24UGLY.cjs} +26 -26
  31. package/dist/{chunk-MHQFFRA2.cjs.map → chunk-4Z24UGLY.cjs.map} +1 -1
  32. package/dist/{chunk-GPLCXP3B.cjs → chunk-5GI232FP.cjs} +8 -8
  33. package/dist/{chunk-GPLCXP3B.cjs.map → chunk-5GI232FP.cjs.map} +1 -1
  34. package/dist/{chunk-5XW4MKE6.cjs → chunk-65T6KVYX.cjs} +11 -2
  35. package/dist/chunk-65T6KVYX.cjs.map +1 -0
  36. package/dist/{chunk-W32BPAIP.js → chunk-664F5XOW.js} +7 -7
  37. package/dist/{chunk-W32BPAIP.js.map → chunk-664F5XOW.js.map} +1 -1
  38. package/dist/{chunk-N44OOOAL.js → chunk-6GMGCV74.js} +5 -5
  39. package/dist/{chunk-N44OOOAL.js.map → chunk-6GMGCV74.js.map} +1 -1
  40. package/dist/chunk-6JCLSYOU.js +351 -0
  41. package/dist/chunk-6JCLSYOU.js.map +1 -0
  42. package/dist/{chunk-HT4KV7V5.js → chunk-6NIQROP2.js} +23 -13
  43. package/dist/chunk-6NIQROP2.js.map +1 -0
  44. package/dist/chunk-753JFAF2.js +134 -0
  45. package/dist/chunk-753JFAF2.js.map +1 -0
  46. package/dist/{chunk-7BM2AIKU.js → chunk-7BZ2N56X.js} +5 -5
  47. package/dist/{chunk-7BM2AIKU.js.map → chunk-7BZ2N56X.js.map} +1 -1
  48. package/dist/{chunk-LQRPDQCE.js → chunk-7EDTSUCY.js} +4 -4
  49. package/dist/{chunk-LQRPDQCE.js.map → chunk-7EDTSUCY.js.map} +1 -1
  50. package/dist/chunk-7U7OWTR2.js +149 -0
  51. package/dist/chunk-7U7OWTR2.js.map +1 -0
  52. package/dist/{chunk-SR6QNILC.cjs → chunk-A4FTF4A7.cjs} +55 -55
  53. package/dist/{chunk-SR6QNILC.cjs.map → chunk-A4FTF4A7.cjs.map} +1 -1
  54. package/dist/{chunk-7YV7MYOP.js → chunk-AAZDGIDJ.js} +22 -12
  55. package/dist/chunk-AAZDGIDJ.js.map +1 -0
  56. package/dist/chunk-AR7VSXHH.cjs +143 -0
  57. package/dist/chunk-AR7VSXHH.cjs.map +1 -0
  58. package/dist/{chunk-JRFHBWKQ.cjs → chunk-AY3ZP465.cjs} +36 -26
  59. package/dist/chunk-AY3ZP465.cjs.map +1 -0
  60. package/dist/{chunk-YLJ5EVO3.js → chunk-BWNJBSXL.js} +3 -3
  61. package/dist/{chunk-YLJ5EVO3.js.map → chunk-BWNJBSXL.js.map} +1 -1
  62. package/dist/{chunk-JBAQMT4Y.cjs → chunk-CBHBMWZ2.cjs} +12 -12
  63. package/dist/{chunk-JBAQMT4Y.cjs.map → chunk-CBHBMWZ2.cjs.map} +1 -1
  64. package/dist/{chunk-JW4P6OFG.js → chunk-CCL4C2ZO.js} +4 -4
  65. package/dist/{chunk-JW4P6OFG.js.map → chunk-CCL4C2ZO.js.map} +1 -1
  66. package/dist/{chunk-7LBBDT4S.js → chunk-CGB327L6.js} +3 -3
  67. package/dist/{chunk-7LBBDT4S.js.map → chunk-CGB327L6.js.map} +1 -1
  68. package/dist/{chunk-WP67ASKV.js → chunk-CKCZVUUB.js} +7 -7
  69. package/dist/{chunk-WP67ASKV.js.map → chunk-CKCZVUUB.js.map} +1 -1
  70. package/dist/chunk-CM2C2H2Y.cjs +101 -0
  71. package/dist/chunk-CM2C2H2Y.cjs.map +1 -0
  72. package/dist/{chunk-RGUKCKGB.cjs → chunk-CODPCBGN.cjs} +22 -22
  73. package/dist/{chunk-RGUKCKGB.cjs.map → chunk-CODPCBGN.cjs.map} +1 -1
  74. package/dist/chunk-CRTDKNOZ.cjs +654 -0
  75. package/dist/chunk-CRTDKNOZ.cjs.map +1 -0
  76. package/dist/{chunk-OS2636MU.js → chunk-D4HVKF56.js} +5 -5
  77. package/dist/{chunk-OS2636MU.js.map → chunk-D4HVKF56.js.map} +1 -1
  78. package/dist/{chunk-73MISLDN.cjs → chunk-D774EZRN.cjs} +16 -16
  79. package/dist/{chunk-73MISLDN.cjs.map → chunk-D774EZRN.cjs.map} +1 -1
  80. package/dist/{chunk-L3WM4IWR.cjs → chunk-DYXX34YU.cjs} +56 -21
  81. package/dist/chunk-DYXX34YU.cjs.map +1 -0
  82. package/dist/{chunk-DZWFQD53.cjs → chunk-EAPGRYRG.cjs} +6 -6
  83. package/dist/{chunk-DZWFQD53.cjs.map → chunk-EAPGRYRG.cjs.map} +1 -1
  84. package/dist/{chunk-R4IYXUNR.cjs → chunk-ESZN7NKS.cjs} +34 -26
  85. package/dist/chunk-ESZN7NKS.cjs.map +1 -0
  86. package/dist/{chunk-XZT7USLH.js → chunk-EX3XD2F5.js} +79 -40
  87. package/dist/chunk-EX3XD2F5.js.map +1 -0
  88. package/dist/{chunk-E53AJNZB.js → chunk-F2FAL5CZ.js} +2 -2
  89. package/dist/{chunk-E53AJNZB.js.map → chunk-F2FAL5CZ.js.map} +1 -1
  90. package/dist/chunk-G5LQCOFZ.js +292 -0
  91. package/dist/chunk-G5LQCOFZ.js.map +1 -0
  92. package/dist/chunk-GA4BG5JK.js +46 -0
  93. package/dist/chunk-GA4BG5JK.js.map +1 -0
  94. package/dist/{chunk-YPXOTWND.js → chunk-GAGC4WDU.js} +3 -3
  95. package/dist/{chunk-YPXOTWND.js.map → chunk-GAGC4WDU.js.map} +1 -1
  96. package/dist/{chunk-T6QQYYPA.cjs → chunk-GAL7C4Y5.cjs} +36 -26
  97. package/dist/chunk-GAL7C4Y5.cjs.map +1 -0
  98. package/dist/{chunk-GTYVB2TS.js → chunk-GFZR6THV.js} +3 -3
  99. package/dist/{chunk-GTYVB2TS.js.map → chunk-GFZR6THV.js.map} +1 -1
  100. package/dist/{chunk-Q7LA2XMK.js → chunk-GW6T4HLN.js} +9 -9
  101. package/dist/{chunk-Q7LA2XMK.js.map → chunk-GW6T4HLN.js.map} +1 -1
  102. package/dist/{chunk-OOEYTKTC.js → chunk-HGRG2WVX.js} +35 -18
  103. package/dist/chunk-HGRG2WVX.js.map +1 -0
  104. package/dist/chunk-HMJL3C3H.js +36 -0
  105. package/dist/chunk-HMJL3C3H.js.map +1 -0
  106. package/dist/{chunk-X7ZNZFHV.js → chunk-HNGYUI5N.js} +23 -15
  107. package/dist/chunk-HNGYUI5N.js.map +1 -0
  108. package/dist/{chunk-7R7WT24X.cjs → chunk-HWT5YD7H.cjs} +17 -17
  109. package/dist/{chunk-7R7WT24X.cjs.map → chunk-HWT5YD7H.cjs.map} +1 -1
  110. package/dist/{chunk-PM6YRFZW.cjs → chunk-HXEMVATM.cjs} +8 -8
  111. package/dist/{chunk-PM6YRFZW.cjs.map → chunk-HXEMVATM.cjs.map} +1 -1
  112. package/dist/{chunk-R3R6VJRM.cjs → chunk-HZNJ4B7D.cjs} +32 -32
  113. package/dist/{chunk-R3R6VJRM.cjs.map → chunk-HZNJ4B7D.cjs.map} +1 -1
  114. package/dist/{chunk-XGNMFTYF.js → chunk-I3RWQGD7.js} +9 -9
  115. package/dist/{chunk-XGNMFTYF.js.map → chunk-I3RWQGD7.js.map} +1 -1
  116. package/dist/{chunk-UQ2H32RT.cjs → chunk-I6WBJDRP.cjs} +10 -10
  117. package/dist/{chunk-UQ2H32RT.cjs.map → chunk-I6WBJDRP.cjs.map} +1 -1
  118. package/dist/{chunk-T3PECMPO.js → chunk-IRJQQYII.js} +7 -7
  119. package/dist/{chunk-T3PECMPO.js.map → chunk-IRJQQYII.js.map} +1 -1
  120. package/dist/{chunk-4YSEVAAS.cjs → chunk-J6IRCLC6.cjs} +31 -31
  121. package/dist/{chunk-4YSEVAAS.cjs.map → chunk-J6IRCLC6.cjs.map} +1 -1
  122. package/dist/chunk-JUYUBEMU.js +28 -0
  123. package/dist/chunk-JUYUBEMU.js.map +1 -0
  124. package/dist/chunk-K6AEVBZQ.js +98 -0
  125. package/dist/chunk-K6AEVBZQ.js.map +1 -0
  126. package/dist/{chunk-B3UPXBHD.js → chunk-K74VFJKF.js} +227 -41
  127. package/dist/chunk-K74VFJKF.js.map +1 -0
  128. package/dist/{chunk-MEYWNCUV.cjs → chunk-KE4V4LJE.cjs} +7 -7
  129. package/dist/{chunk-MEYWNCUV.cjs.map → chunk-KE4V4LJE.cjs.map} +1 -1
  130. package/dist/{chunk-DYN7KSCZ.js → chunk-KTOJ2F6V.js} +5 -5
  131. package/dist/{chunk-DYN7KSCZ.js.map → chunk-KTOJ2F6V.js.map} +1 -1
  132. package/dist/{chunk-ES23WZRF.cjs → chunk-LEIV627E.cjs} +15 -15
  133. package/dist/{chunk-ES23WZRF.cjs.map → chunk-LEIV627E.cjs.map} +1 -1
  134. package/dist/chunk-LG57RYYL.cjs +551 -0
  135. package/dist/chunk-LG57RYYL.cjs.map +1 -0
  136. package/dist/{chunk-AIRSK4QU.js → chunk-LH5Y7AJF.js} +46 -7
  137. package/dist/chunk-LH5Y7AJF.js.map +1 -0
  138. package/dist/{chunk-5TTCUSSA.js → chunk-LPFE6YTG.js} +3 -3
  139. package/dist/{chunk-5TTCUSSA.js.map → chunk-LPFE6YTG.js.map} +1 -1
  140. package/dist/{chunk-WYLVJSGR.cjs → chunk-LTRLD33R.cjs} +47 -8
  141. package/dist/chunk-LTRLD33R.cjs.map +1 -0
  142. package/dist/{chunk-UH3MHVDF.cjs → chunk-M4B42JGO.cjs} +6 -3
  143. package/dist/chunk-M4B42JGO.cjs.map +1 -0
  144. package/dist/{chunk-QWPEAC7I.cjs → chunk-MERLF4UP.cjs} +94 -94
  145. package/dist/{chunk-QWPEAC7I.cjs.map → chunk-MERLF4UP.cjs.map} +1 -1
  146. package/dist/chunk-MXMOHULN.js +497 -0
  147. package/dist/chunk-MXMOHULN.js.map +1 -0
  148. package/dist/{chunk-CIPZ4VOZ.cjs → chunk-N6RQC4Z3.cjs} +4 -4
  149. package/dist/{chunk-CIPZ4VOZ.cjs.map → chunk-N6RQC4Z3.cjs.map} +1 -1
  150. package/dist/{chunk-DM6UW5RD.js → chunk-N7CG7MFQ.js} +8 -8
  151. package/dist/{chunk-DM6UW5RD.js.map → chunk-N7CG7MFQ.js.map} +1 -1
  152. package/dist/chunk-NRRAME2S.js +98 -0
  153. package/dist/chunk-NRRAME2S.js.map +1 -0
  154. package/dist/chunk-O4O2EJF7.cjs +13 -0
  155. package/dist/chunk-O4O2EJF7.cjs.map +1 -0
  156. package/dist/{chunk-H3RUJBEL.cjs → chunk-O7B3P2AT.cjs} +57 -40
  157. package/dist/chunk-O7B3P2AT.cjs.map +1 -0
  158. package/dist/{chunk-L2RZNUOW.js → chunk-OGYYXNGI.js} +4 -4
  159. package/dist/{chunk-L2RZNUOW.js.map → chunk-OGYYXNGI.js.map} +1 -1
  160. package/dist/{chunk-M7DF3D2M.js → chunk-OJNVSXOF.js} +19 -5
  161. package/dist/chunk-OJNVSXOF.js.map +1 -0
  162. package/dist/{chunk-KGK2LCZ4.js → chunk-OKKJPM5N.js} +21 -14
  163. package/dist/chunk-OKKJPM5N.js.map +1 -0
  164. package/dist/{chunk-Z6C7SDXA.js → chunk-ONCDLJUQ.js} +6 -3
  165. package/dist/chunk-ONCDLJUQ.js.map +1 -0
  166. package/dist/{chunk-M7CTMLXS.js → chunk-OSN3DL34.js} +4 -4
  167. package/dist/{chunk-M7CTMLXS.js.map → chunk-OSN3DL34.js.map} +1 -1
  168. package/dist/chunk-OXSAN74Y.cjs +504 -0
  169. package/dist/chunk-OXSAN74Y.cjs.map +1 -0
  170. package/dist/{chunk-ZIR2AE52.js → chunk-P5ZWPVC2.js} +4 -4
  171. package/dist/{chunk-ZIR2AE52.js.map → chunk-P5ZWPVC2.js.map} +1 -1
  172. package/dist/{chunk-BBD7VAAR.js → chunk-PQ37PNAE.js} +22 -12
  173. package/dist/chunk-PQ37PNAE.js.map +1 -0
  174. package/dist/{chunk-DRNCUSSM.cjs → chunk-PWGPLCL4.cjs} +5 -5
  175. package/dist/{chunk-DRNCUSSM.cjs.map → chunk-PWGPLCL4.cjs.map} +1 -1
  176. package/dist/{chunk-NPMJ6FRL.cjs → chunk-QGPIJ3KB.cjs} +67 -67
  177. package/dist/{chunk-NPMJ6FRL.cjs.map → chunk-QGPIJ3KB.cjs.map} +1 -1
  178. package/dist/chunk-QJU62KP2.cjs +298 -0
  179. package/dist/chunk-QJU62KP2.cjs.map +1 -0
  180. package/dist/{chunk-AY5TY4EN.js → chunk-QKAIQUSC.js} +4 -4
  181. package/dist/{chunk-AY5TY4EN.js.map → chunk-QKAIQUSC.js.map} +1 -1
  182. package/dist/{chunk-NDMG7SUN.js → chunk-QLX34MAR.js} +8 -8
  183. package/dist/{chunk-NDMG7SUN.js.map → chunk-QLX34MAR.js.map} +1 -1
  184. package/dist/{chunk-LTYRUL3Q.cjs → chunk-QZ6UFQ7V.cjs} +42 -2
  185. package/dist/chunk-QZ6UFQ7V.cjs.map +1 -0
  186. package/dist/{chunk-IVFIYTLD.cjs → chunk-RJF75FEP.cjs} +26 -26
  187. package/dist/{chunk-IVFIYTLD.cjs.map → chunk-RJF75FEP.cjs.map} +1 -1
  188. package/dist/{chunk-M4MNMBQF.cjs → chunk-RYPLQO4Z.cjs} +32 -25
  189. package/dist/chunk-RYPLQO4Z.cjs.map +1 -0
  190. package/dist/chunk-SFPN7SHZ.js +11 -0
  191. package/dist/chunk-SFPN7SHZ.js.map +1 -0
  192. package/dist/{chunk-BBB4NKZZ.cjs → chunk-SKLREO5Z.cjs} +82 -82
  193. package/dist/{chunk-BBB4NKZZ.cjs.map → chunk-SKLREO5Z.cjs.map} +1 -1
  194. package/dist/{chunk-LBEQ4EE4.js → chunk-SPGVPADY.js} +3 -3
  195. package/dist/{chunk-LBEQ4EE4.js.map → chunk-SPGVPADY.js.map} +1 -1
  196. package/dist/{chunk-Q2B7W7GA.cjs → chunk-T3C54LPX.cjs} +57 -5
  197. package/dist/chunk-T3C54LPX.cjs.map +1 -0
  198. package/dist/{chunk-DGJSHUP4.cjs → chunk-U6QDJKSZ.cjs} +105 -105
  199. package/dist/{chunk-DGJSHUP4.cjs.map → chunk-U6QDJKSZ.cjs.map} +1 -1
  200. package/dist/{chunk-DZXHO72E.cjs → chunk-UBYGPC2S.cjs} +12 -12
  201. package/dist/{chunk-DZXHO72E.cjs.map → chunk-UBYGPC2S.cjs.map} +1 -1
  202. package/dist/{chunk-IDUFQ5HG.js → chunk-UCKK7LPQ.js} +3 -3
  203. package/dist/{chunk-IDUFQ5HG.js.map → chunk-UCKK7LPQ.js.map} +1 -1
  204. package/dist/{chunk-JX4UGU4A.cjs → chunk-UGJBURIS.cjs} +12 -12
  205. package/dist/{chunk-JX4UGU4A.cjs.map → chunk-UGJBURIS.cjs.map} +1 -1
  206. package/dist/{chunk-PDHGJ7GP.js → chunk-UIRQU4GW.js} +54 -6
  207. package/dist/chunk-UIRQU4GW.js.map +1 -0
  208. package/dist/chunk-V4ATNZXG.cjs +31 -0
  209. package/dist/chunk-V4ATNZXG.cjs.map +1 -0
  210. package/dist/chunk-VX3MJR4P.cjs +161 -0
  211. package/dist/chunk-VX3MJR4P.cjs.map +1 -0
  212. package/dist/{chunk-YE3LMHL3.js → chunk-WD2L3ZU3.js} +5 -5
  213. package/dist/{chunk-YE3LMHL3.js.map → chunk-WD2L3ZU3.js.map} +1 -1
  214. package/dist/{chunk-QTPAVOG2.cjs → chunk-WLGC3IWY.cjs} +49 -39
  215. package/dist/chunk-WLGC3IWY.cjs.map +1 -0
  216. package/dist/{chunk-MXGCIYNM.js → chunk-XI3XH4G7.js} +22 -12
  217. package/dist/chunk-XI3XH4G7.js.map +1 -0
  218. package/dist/{chunk-PYZAUXQX.cjs → chunk-XNR667MS.cjs} +27 -27
  219. package/dist/{chunk-PYZAUXQX.cjs.map → chunk-XNR667MS.cjs.map} +1 -1
  220. package/dist/{chunk-Y6MWNLAA.cjs → chunk-XR3CGVKU.cjs} +8 -8
  221. package/dist/{chunk-Y6MWNLAA.cjs.map → chunk-XR3CGVKU.cjs.map} +1 -1
  222. package/dist/{chunk-AZORAK4H.cjs → chunk-XTFWFQZ7.cjs} +2 -2
  223. package/dist/{chunk-AZORAK4H.cjs.map → chunk-XTFWFQZ7.cjs.map} +1 -1
  224. package/dist/{chunk-ELWN7ZXR.js → chunk-Y3KIKJW6.js} +6 -6
  225. package/dist/{chunk-ELWN7ZXR.js.map → chunk-Y3KIKJW6.js.map} +1 -1
  226. package/dist/{chunk-3BL73LS3.cjs → chunk-YETIPEQM.cjs} +40 -40
  227. package/dist/{chunk-3BL73LS3.cjs.map → chunk-YETIPEQM.cjs.map} +1 -1
  228. package/dist/{chunk-B34S64RC.cjs → chunk-YNSUYESL.cjs} +23 -3
  229. package/dist/chunk-YNSUYESL.cjs.map +1 -0
  230. package/dist/{chunk-3PQSHLG7.cjs → chunk-YQYYIRDS.cjs} +164 -164
  231. package/dist/{chunk-3PQSHLG7.cjs.map → chunk-YQYYIRDS.cjs.map} +1 -1
  232. package/dist/{chunk-JRZZN55Y.cjs → chunk-Z772ZUYH.cjs} +53 -43
  233. package/dist/chunk-Z772ZUYH.cjs.map +1 -0
  234. package/dist/chunk-ZCX2J552.cjs +38 -0
  235. package/dist/chunk-ZCX2J552.cjs.map +1 -0
  236. package/dist/{chunk-OULCMO5R.js → chunk-ZHS2QDGO.js} +23 -15
  237. package/dist/chunk-ZHS2QDGO.js.map +1 -0
  238. package/dist/docs/SKILL.md +1 -1
  239. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  240. package/dist/server/auth/helpers.d.ts +3 -0
  241. package/dist/server/auth/helpers.d.ts.map +1 -1
  242. package/dist/server/auth/index.cjs +28 -15
  243. package/dist/server/auth/index.js +2 -1
  244. package/dist/server/browser-stream/types.d.ts +9 -0
  245. package/dist/server/browser-stream/types.d.ts.map +1 -1
  246. package/dist/server/constants.d.ts +3 -0
  247. package/dist/server/constants.d.ts.map +1 -1
  248. package/dist/server/handlers/a2a.cjs +14 -14
  249. package/dist/server/handlers/a2a.js +1 -1
  250. package/dist/server/handlers/agent-builder.cjs +16 -16
  251. package/dist/server/handlers/agent-builder.js +1 -1
  252. package/dist/server/handlers/agent-versions.cjs +8 -8
  253. package/dist/server/handlers/agent-versions.d.ts.map +1 -1
  254. package/dist/server/handlers/agent-versions.js +1 -1
  255. package/dist/server/handlers/agents.cjs +41 -41
  256. package/dist/server/handlers/agents.d.ts +185 -0
  257. package/dist/server/handlers/agents.d.ts.map +1 -1
  258. package/dist/server/handlers/agents.js +1 -1
  259. package/dist/server/handlers/auth.cjs +15 -11
  260. package/dist/server/handlers/auth.d.ts +168 -146
  261. package/dist/server/handlers/auth.d.ts.map +1 -1
  262. package/dist/server/handlers/auth.js +1 -1
  263. package/dist/server/handlers/authorship.cjs +52 -0
  264. package/dist/server/handlers/authorship.cjs.map +1 -0
  265. package/dist/server/handlers/authorship.d.ts +176 -0
  266. package/dist/server/handlers/authorship.d.ts.map +1 -0
  267. package/dist/server/handlers/authorship.js +3 -0
  268. package/dist/server/handlers/authorship.js.map +1 -0
  269. package/dist/server/handlers/background-tasks.cjs +4 -4
  270. package/dist/server/handlers/background-tasks.js +1 -1
  271. package/dist/server/handlers/builder-registry.cjs +28 -0
  272. package/dist/server/handlers/builder-registry.cjs.map +1 -0
  273. package/dist/server/handlers/builder-registry.d.ts +170 -0
  274. package/dist/server/handlers/builder-registry.d.ts.map +1 -0
  275. package/dist/server/handlers/builder-registry.js +3 -0
  276. package/dist/server/handlers/builder-registry.js.map +1 -0
  277. package/dist/server/handlers/channels.cjs +5 -5
  278. package/dist/server/handlers/channels.js +1 -1
  279. package/dist/server/handlers/conversations.cjs +5 -5
  280. package/dist/server/handlers/conversations.js +1 -1
  281. package/dist/server/handlers/datasets.cjs +26 -26
  282. package/dist/server/handlers/datasets.js +1 -1
  283. package/dist/server/handlers/editor-builder.cjs +24 -0
  284. package/dist/server/handlers/editor-builder.cjs.map +1 -0
  285. package/dist/server/handlers/editor-builder.d.ts +259 -0
  286. package/dist/server/handlers/editor-builder.d.ts.map +1 -0
  287. package/dist/server/handlers/editor-builder.js +3 -0
  288. package/dist/server/handlers/editor-builder.js.map +1 -0
  289. package/dist/server/handlers/error.cjs +3 -3
  290. package/dist/server/handlers/error.d.ts.map +1 -1
  291. package/dist/server/handlers/error.js +1 -1
  292. package/dist/server/handlers/favorites-enrichment.cjs +16 -0
  293. package/dist/server/handlers/favorites-enrichment.cjs.map +1 -0
  294. package/dist/server/handlers/favorites-enrichment.d.ts +27 -0
  295. package/dist/server/handlers/favorites-enrichment.d.ts.map +1 -0
  296. package/dist/server/handlers/favorites-enrichment.js +3 -0
  297. package/dist/server/handlers/favorites-enrichment.js.map +1 -0
  298. package/dist/server/handlers/logs.cjs +4 -4
  299. package/dist/server/handlers/logs.js +1 -1
  300. package/dist/server/handlers/mcp-client-versions.cjs +8 -8
  301. package/dist/server/handlers/mcp-client-versions.d.ts.map +1 -1
  302. package/dist/server/handlers/mcp-client-versions.js +1 -1
  303. package/dist/server/handlers/mcp.cjs +11 -11
  304. package/dist/server/handlers/mcp.js +1 -1
  305. package/dist/server/handlers/memory.cjs +27 -27
  306. package/dist/server/handlers/memory.js +1 -1
  307. package/dist/server/handlers/observability-new-endpoints.cjs +28 -28
  308. package/dist/server/handlers/observability-new-endpoints.js +1 -1
  309. package/dist/server/handlers/observability.cjs +39 -39
  310. package/dist/server/handlers/observability.js +2 -2
  311. package/dist/server/handlers/processor-providers.cjs +3 -3
  312. package/dist/server/handlers/processor-providers.js +1 -1
  313. package/dist/server/handlers/processors.cjs +4 -4
  314. package/dist/server/handlers/processors.js +1 -1
  315. package/dist/server/handlers/prompt-block-versions.cjs +8 -8
  316. package/dist/server/handlers/prompt-block-versions.d.ts.map +1 -1
  317. package/dist/server/handlers/prompt-block-versions.js +1 -1
  318. package/dist/server/handlers/responses.cjs +4 -4
  319. package/dist/server/handlers/responses.js +1 -1
  320. package/dist/server/handlers/responses.storage.cjs +8 -8
  321. package/dist/server/handlers/responses.storage.js +1 -1
  322. package/dist/server/handlers/schedules.cjs +6 -6
  323. package/dist/server/handlers/schedules.js +1 -1
  324. package/dist/server/handlers/scorer-versions.cjs +8 -8
  325. package/dist/server/handlers/scorer-versions.d.ts.map +1 -1
  326. package/dist/server/handlers/scorer-versions.js +1 -1
  327. package/dist/server/handlers/scores.cjs +7 -7
  328. package/dist/server/handlers/scores.js +1 -1
  329. package/dist/server/handlers/skills-sh-shared.cjs +40 -0
  330. package/dist/server/handlers/skills-sh-shared.cjs.map +1 -0
  331. package/dist/server/handlers/skills-sh-shared.d.ts +89 -0
  332. package/dist/server/handlers/skills-sh-shared.d.ts.map +1 -0
  333. package/dist/server/handlers/skills-sh-shared.js +3 -0
  334. package/dist/server/handlers/skills-sh-shared.js.map +1 -0
  335. package/dist/server/handlers/stored-agent-favorites.cjs +16 -0
  336. package/dist/server/handlers/stored-agent-favorites.cjs.map +1 -0
  337. package/dist/server/handlers/stored-agent-favorites.d.ts +29 -0
  338. package/dist/server/handlers/stored-agent-favorites.d.ts.map +1 -0
  339. package/dist/server/handlers/stored-agent-favorites.js +3 -0
  340. package/dist/server/handlers/stored-agent-favorites.js.map +1 -0
  341. package/dist/server/handlers/stored-agents.cjs +7 -7
  342. package/dist/server/handlers/stored-agents.d.ts +390 -0
  343. package/dist/server/handlers/stored-agents.d.ts.map +1 -1
  344. package/dist/server/handlers/stored-agents.js +1 -1
  345. package/dist/server/handlers/stored-mcp-clients.cjs +6 -6
  346. package/dist/server/handlers/stored-mcp-clients.d.ts.map +1 -1
  347. package/dist/server/handlers/stored-mcp-clients.js +1 -1
  348. package/dist/server/handlers/stored-prompt-blocks.cjs +6 -6
  349. package/dist/server/handlers/stored-prompt-blocks.d.ts.map +1 -1
  350. package/dist/server/handlers/stored-prompt-blocks.js +1 -1
  351. package/dist/server/handlers/stored-scorers.cjs +6 -6
  352. package/dist/server/handlers/stored-scorers.d.ts.map +1 -1
  353. package/dist/server/handlers/stored-scorers.js +1 -1
  354. package/dist/server/handlers/stored-skill-favorites.cjs +16 -0
  355. package/dist/server/handlers/stored-skill-favorites.cjs.map +1 -0
  356. package/dist/server/handlers/stored-skill-favorites.d.ts +29 -0
  357. package/dist/server/handlers/stored-skill-favorites.d.ts.map +1 -0
  358. package/dist/server/handlers/stored-skill-favorites.js +3 -0
  359. package/dist/server/handlers/stored-skill-favorites.js.map +1 -0
  360. package/dist/server/handlers/stored-skills.cjs +7 -7
  361. package/dist/server/handlers/stored-skills.d.ts +117 -0
  362. package/dist/server/handlers/stored-skills.d.ts.map +1 -1
  363. package/dist/server/handlers/stored-skills.js +1 -1
  364. package/dist/server/handlers/stored-workspaces.cjs +6 -6
  365. package/dist/server/handlers/stored-workspaces.d.ts +2 -0
  366. package/dist/server/handlers/stored-workspaces.d.ts.map +1 -1
  367. package/dist/server/handlers/stored-workspaces.js +1 -1
  368. package/dist/server/handlers/system.cjs +3 -3
  369. package/dist/server/handlers/system.js +1 -1
  370. package/dist/server/handlers/tool-providers.cjs +5 -5
  371. package/dist/server/handlers/tool-providers.js +1 -1
  372. package/dist/server/handlers/tools.cjs +6 -6
  373. package/dist/server/handlers/tools.js +1 -1
  374. package/dist/server/handlers/utils.cjs +10 -10
  375. package/dist/server/handlers/utils.d.ts +1 -1
  376. package/dist/server/handlers/utils.js +1 -1
  377. package/dist/server/handlers/validate-avatar.cjs +12 -0
  378. package/dist/server/handlers/validate-avatar.cjs.map +1 -0
  379. package/dist/server/handlers/validate-avatar.d.ts +7 -0
  380. package/dist/server/handlers/validate-avatar.d.ts.map +1 -0
  381. package/dist/server/handlers/validate-avatar.js +3 -0
  382. package/dist/server/handlers/validate-avatar.js.map +1 -0
  383. package/dist/server/handlers/vector.cjs +16 -16
  384. package/dist/server/handlers/vector.js +1 -1
  385. package/dist/server/handlers/voice.cjs +8 -8
  386. package/dist/server/handlers/voice.js +1 -1
  387. package/dist/server/handlers/workflows.cjs +26 -26
  388. package/dist/server/handlers/workflows.js +1 -1
  389. package/dist/server/handlers/workspace.cjs +26 -26
  390. package/dist/server/handlers/workspace.js +1 -1
  391. package/dist/server/handlers.cjs +38 -38
  392. package/dist/server/handlers.js +16 -16
  393. package/dist/server/schemas/builder-registry.d.ts +73 -0
  394. package/dist/server/schemas/builder-registry.d.ts.map +1 -0
  395. package/dist/server/schemas/editor-builder.d.ts +288 -0
  396. package/dist/server/schemas/editor-builder.d.ts.map +1 -0
  397. package/dist/server/schemas/favorites.d.ts +9 -0
  398. package/dist/server/schemas/favorites.d.ts.map +1 -0
  399. package/dist/server/schemas/index.cjs +400 -384
  400. package/dist/server/schemas/index.js +9 -9
  401. package/dist/server/schemas/stored-agents.d.ts +1066 -94
  402. package/dist/server/schemas/stored-agents.d.ts.map +1 -1
  403. package/dist/server/schemas/stored-skills.d.ts +111 -0
  404. package/dist/server/schemas/stored-skills.d.ts.map +1 -1
  405. package/dist/server/schemas/stored-workspaces.d.ts +1 -0
  406. package/dist/server/schemas/stored-workspaces.d.ts.map +1 -1
  407. package/dist/server/server-adapter/index.cjs +200 -124
  408. package/dist/server/server-adapter/index.cjs.map +1 -1
  409. package/dist/server/server-adapter/index.d.ts +9 -1
  410. package/dist/server/server-adapter/index.d.ts.map +1 -1
  411. package/dist/server/server-adapter/index.js +174 -98
  412. package/dist/server/server-adapter/index.js.map +1 -1
  413. package/dist/server/server-adapter/routes/editor-builder.d.ts +353 -0
  414. package/dist/server/server-adapter/routes/editor-builder.d.ts.map +1 -0
  415. package/dist/server/server-adapter/routes/fga-manifest.d.ts +4 -0
  416. package/dist/server/server-adapter/routes/fga-manifest.d.ts.map +1 -0
  417. package/dist/server/server-adapter/routes/index.d.ts +7 -1
  418. package/dist/server/server-adapter/routes/index.d.ts.map +1 -1
  419. package/dist/server/server-adapter/routes/permissions.d.ts +8 -3
  420. package/dist/server/server-adapter/routes/permissions.d.ts.map +1 -1
  421. package/dist/server/server-adapter/routes/route-builder.d.ts +3 -1
  422. package/dist/server/server-adapter/routes/route-builder.d.ts.map +1 -1
  423. package/dist/server/server-adapter/routes/stored-agents.d.ts +4 -1
  424. package/dist/server/server-adapter/routes/stored-agents.d.ts.map +1 -1
  425. package/dist/server/server-adapter/routes/stored-skills.d.ts +138 -1
  426. package/dist/server/server-adapter/routes/stored-skills.d.ts.map +1 -1
  427. package/dist/server/server-adapter/routes/stored-workspaces.d.ts +2 -0
  428. package/dist/server/server-adapter/routes/stored-workspaces.d.ts.map +1 -1
  429. package/dist/server/utils/resolve-builder-model-policy.d.ts +17 -0
  430. package/dist/server/utils/resolve-builder-model-policy.d.ts.map +1 -0
  431. package/dist/server/utils.d.ts +11 -0
  432. package/dist/server/utils.d.ts.map +1 -1
  433. package/package.json +4 -4
  434. package/dist/chunk-5XW4MKE6.cjs.map +0 -1
  435. package/dist/chunk-6IUJAAQ2.js.map +0 -1
  436. package/dist/chunk-7YV7MYOP.js.map +0 -1
  437. package/dist/chunk-AIRSK4QU.js.map +0 -1
  438. package/dist/chunk-B34S64RC.cjs.map +0 -1
  439. package/dist/chunk-B3UPXBHD.js.map +0 -1
  440. package/dist/chunk-BBD7VAAR.js.map +0 -1
  441. package/dist/chunk-DRTUU5WC.cjs +0 -365
  442. package/dist/chunk-DRTUU5WC.cjs.map +0 -1
  443. package/dist/chunk-H3RUJBEL.cjs.map +0 -1
  444. package/dist/chunk-HT4KV7V5.js.map +0 -1
  445. package/dist/chunk-JRFHBWKQ.cjs.map +0 -1
  446. package/dist/chunk-JRZZN55Y.cjs.map +0 -1
  447. package/dist/chunk-KGK2LCZ4.js.map +0 -1
  448. package/dist/chunk-L3WM4IWR.cjs.map +0 -1
  449. package/dist/chunk-LTYRUL3Q.cjs.map +0 -1
  450. package/dist/chunk-M4MNMBQF.cjs.map +0 -1
  451. package/dist/chunk-M7DF3D2M.js.map +0 -1
  452. package/dist/chunk-MXGCIYNM.js.map +0 -1
  453. package/dist/chunk-OMLB6EMJ.cjs +0 -313
  454. package/dist/chunk-OMLB6EMJ.cjs.map +0 -1
  455. package/dist/chunk-OOEYTKTC.js.map +0 -1
  456. package/dist/chunk-OULCMO5R.js.map +0 -1
  457. package/dist/chunk-P23KBWKB.js +0 -26
  458. package/dist/chunk-P23KBWKB.js.map +0 -1
  459. package/dist/chunk-PDHGJ7GP.js.map +0 -1
  460. package/dist/chunk-PQDYNK4J.cjs.map +0 -1
  461. package/dist/chunk-Q2B7W7GA.cjs.map +0 -1
  462. package/dist/chunk-QTPAVOG2.cjs.map +0 -1
  463. package/dist/chunk-R4IYXUNR.cjs.map +0 -1
  464. package/dist/chunk-T6QQYYPA.cjs.map +0 -1
  465. package/dist/chunk-UH3MHVDF.cjs.map +0 -1
  466. package/dist/chunk-WNIL6DVE.cjs +0 -615
  467. package/dist/chunk-WNIL6DVE.cjs.map +0 -1
  468. package/dist/chunk-WYLVJSGR.cjs.map +0 -1
  469. package/dist/chunk-X7ZNZFHV.js.map +0 -1
  470. package/dist/chunk-XT5ZVU5J.js +0 -306
  471. package/dist/chunk-XT5ZVU5J.js.map +0 -1
  472. package/dist/chunk-XZT7USLH.js.map +0 -1
  473. package/dist/chunk-Y5LNMKEY.cjs.map +0 -1
  474. package/dist/chunk-YARY4I5U.js.map +0 -1
  475. package/dist/chunk-YHRGDSTK.js.map +0 -1
  476. package/dist/chunk-Z6C7SDXA.js.map +0 -1
@@ -11,8 +11,18 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
11
11
  DESC: "DESC";
12
12
  }>>;
13
13
  }, import("zod/v4/core").$strip>>;
14
+ status: import("zod").ZodOptional<import("zod").ZodEnum<{
15
+ draft: "draft";
16
+ published: "published";
17
+ archived: "archived";
18
+ }>>;
14
19
  authorId: import("zod").ZodOptional<import("zod").ZodString>;
20
+ visibility: import("zod").ZodOptional<import("zod").ZodEnum<{
21
+ public: "public";
22
+ }>>;
15
23
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
24
+ favoritedOnly: import("zod").ZodOptional<import("zod").ZodCodec<import("zod").ZodString, import("zod").ZodBoolean>>;
25
+ pinFavoritedFor: import("zod").ZodOptional<import("zod").ZodString>;
16
26
  }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
17
27
  perPage: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
18
28
  page: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
@@ -26,8 +36,18 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
26
36
  DESC: "DESC";
27
37
  }>>;
28
38
  }, import("zod/v4/core").$strip>>;
39
+ status: import("zod").ZodOptional<import("zod").ZodEnum<{
40
+ draft: "draft";
41
+ published: "published";
42
+ archived: "archived";
43
+ }>>;
29
44
  authorId: import("zod").ZodOptional<import("zod").ZodString>;
45
+ visibility: import("zod").ZodOptional<import("zod").ZodEnum<{
46
+ public: "public";
47
+ }>>;
30
48
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
49
+ favoritedOnly: import("zod").ZodOptional<import("zod").ZodCodec<import("zod").ZodString, import("zod").ZodBoolean>>;
50
+ pinFavoritedFor: import("zod").ZodOptional<import("zod").ZodString>;
31
51
  }, import("zod/v4/core").$strip>, undefined>, {
32
52
  total: number;
33
53
  page: number;
@@ -43,6 +63,9 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
43
63
  instructions: string;
44
64
  activeVersionId?: string | undefined;
45
65
  authorId?: string | undefined;
66
+ visibility?: "public" | "private" | undefined;
67
+ favoriteCount?: number | undefined;
68
+ isFavorited?: boolean | undefined;
46
69
  license?: string | undefined;
47
70
  compatibility?: unknown;
48
71
  source?: {
@@ -58,6 +81,7 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
58
81
  references?: string[] | undefined;
59
82
  scripts?: string[] | undefined;
60
83
  assets?: string[] | undefined;
84
+ files?: import("../../schemas").FileNode[] | undefined;
61
85
  metadata?: Record<string, unknown> | undefined;
62
86
  }[];
63
87
  }, "json", import(".").RouteSchemas<undefined, import("zod").ZodObject<{
@@ -73,8 +97,18 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
73
97
  DESC: "DESC";
74
98
  }>>;
75
99
  }, import("zod/v4/core").$strip>>;
100
+ status: import("zod").ZodOptional<import("zod").ZodEnum<{
101
+ draft: "draft";
102
+ published: "published";
103
+ archived: "archived";
104
+ }>>;
76
105
  authorId: import("zod").ZodOptional<import("zod").ZodString>;
106
+ visibility: import("zod").ZodOptional<import("zod").ZodEnum<{
107
+ public: "public";
108
+ }>>;
77
109
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
110
+ favoritedOnly: import("zod").ZodOptional<import("zod").ZodCodec<import("zod").ZodString, import("zod").ZodBoolean>>;
111
+ pinFavoritedFor: import("zod").ZodOptional<import("zod").ZodString>;
78
112
  }, import("zod/v4/core").$strip> | import("zod").ZodObject<{
79
113
  perPage: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
80
114
  page: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
@@ -88,8 +122,18 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
88
122
  DESC: "DESC";
89
123
  }>>;
90
124
  }, import("zod/v4/core").$strip>>;
125
+ status: import("zod").ZodOptional<import("zod").ZodEnum<{
126
+ draft: "draft";
127
+ published: "published";
128
+ archived: "archived";
129
+ }>>;
91
130
  authorId: import("zod").ZodOptional<import("zod").ZodString>;
131
+ visibility: import("zod").ZodOptional<import("zod").ZodEnum<{
132
+ public: "public";
133
+ }>>;
92
134
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
135
+ favoritedOnly: import("zod").ZodOptional<import("zod").ZodCodec<import("zod").ZodString, import("zod").ZodBoolean>>;
136
+ pinFavoritedFor: import("zod").ZodOptional<import("zod").ZodString>;
93
137
  }, import("zod/v4/core").$strip>, undefined, import("zod").ZodObject<{
94
138
  total: import("zod").ZodNumber;
95
139
  page: import("zod").ZodNumber;
@@ -100,6 +144,12 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
100
144
  status: import("zod").ZodString;
101
145
  activeVersionId: import("zod").ZodOptional<import("zod").ZodString>;
102
146
  authorId: import("zod").ZodOptional<import("zod").ZodString>;
147
+ visibility: import("zod").ZodOptional<import("zod").ZodEnum<{
148
+ public: "public";
149
+ private: "private";
150
+ }>>;
151
+ favoriteCount: import("zod").ZodOptional<import("zod").ZodNumber>;
152
+ isFavorited: import("zod").ZodOptional<import("zod").ZodBoolean>;
103
153
  createdAt: import("zod").ZodCoercedDate<unknown>;
104
154
  updatedAt: import("zod").ZodCoercedDate<unknown>;
105
155
  name: import("zod").ZodString;
@@ -120,6 +170,7 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
120
170
  references: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
121
171
  scripts: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
122
172
  assets: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
173
+ files: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodType<import("../../schemas").FileNode, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../schemas").FileNode, unknown>>>>;
123
174
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
124
175
  }, import("zod/v4/core").$strip>>;
125
176
  }, import("zod/v4/core").$strip>>, "GET", "/stored/skills">, import(".").ServerRoute<{
@@ -134,6 +185,9 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
134
185
  instructions: string;
135
186
  activeVersionId?: string | undefined;
136
187
  authorId?: string | undefined;
188
+ visibility?: "public" | "private" | undefined;
189
+ favoriteCount?: number | undefined;
190
+ isFavorited?: boolean | undefined;
137
191
  license?: string | undefined;
138
192
  compatibility?: unknown;
139
193
  source?: {
@@ -149,6 +203,7 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
149
203
  references?: string[] | undefined;
150
204
  scripts?: string[] | undefined;
151
205
  assets?: string[] | undefined;
206
+ files?: import("../../schemas").FileNode[] | undefined;
152
207
  metadata?: Record<string, unknown> | undefined;
153
208
  }, "json", import(".").RouteSchemas<import("zod").ZodObject<{
154
209
  storedSkillId: import("zod").ZodString;
@@ -157,6 +212,12 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
157
212
  status: import("zod").ZodString;
158
213
  activeVersionId: import("zod").ZodOptional<import("zod").ZodString>;
159
214
  authorId: import("zod").ZodOptional<import("zod").ZodString>;
215
+ visibility: import("zod").ZodOptional<import("zod").ZodEnum<{
216
+ public: "public";
217
+ private: "private";
218
+ }>>;
219
+ favoriteCount: import("zod").ZodOptional<import("zod").ZodNumber>;
220
+ isFavorited: import("zod").ZodOptional<import("zod").ZodBoolean>;
160
221
  createdAt: import("zod").ZodCoercedDate<unknown>;
161
222
  updatedAt: import("zod").ZodCoercedDate<unknown>;
162
223
  name: import("zod").ZodString;
@@ -177,6 +238,7 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
177
238
  references: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
178
239
  scripts: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
179
240
  assets: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
241
+ files: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodType<import("../../schemas").FileNode, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../schemas").FileNode, unknown>>>>;
180
242
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
181
243
  }, import("zod/v4/core").$strip>>, "GET", "/stored/skills/:storedSkillId">, import(".").ServerRoute<{
182
244
  name: string;
@@ -184,6 +246,7 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
184
246
  instructions: string;
185
247
  id?: string | undefined;
186
248
  authorId?: string | undefined;
249
+ visibility?: "public" | "private" | undefined;
187
250
  license?: string | undefined;
188
251
  compatibility?: unknown;
189
252
  source?: {
@@ -199,6 +262,7 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
199
262
  references?: string[] | undefined;
200
263
  scripts?: string[] | undefined;
201
264
  assets?: string[] | undefined;
265
+ files?: import("../../schemas").FileNode[] | undefined;
202
266
  metadata?: Record<string, unknown> | undefined;
203
267
  }, {
204
268
  id: string;
@@ -210,6 +274,9 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
210
274
  instructions: string;
211
275
  activeVersionId?: string | undefined;
212
276
  authorId?: string | undefined;
277
+ visibility?: "public" | "private" | undefined;
278
+ favoriteCount?: number | undefined;
279
+ isFavorited?: boolean | undefined;
213
280
  license?: string | undefined;
214
281
  compatibility?: unknown;
215
282
  source?: {
@@ -225,10 +292,15 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
225
292
  references?: string[] | undefined;
226
293
  scripts?: string[] | undefined;
227
294
  assets?: string[] | undefined;
295
+ files?: import("../../schemas").FileNode[] | undefined;
228
296
  metadata?: Record<string, unknown> | undefined;
229
297
  }, "json", import(".").RouteSchemas<undefined, undefined, import("zod").ZodObject<{
230
298
  id: import("zod").ZodOptional<import("zod").ZodString>;
231
299
  authorId: import("zod").ZodOptional<import("zod").ZodString>;
300
+ visibility: import("zod").ZodOptional<import("zod").ZodEnum<{
301
+ public: "public";
302
+ private: "private";
303
+ }>>;
232
304
  name: import("zod").ZodString;
233
305
  description: import("zod").ZodString;
234
306
  instructions: import("zod").ZodString;
@@ -247,12 +319,19 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
247
319
  references: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
248
320
  scripts: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
249
321
  assets: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
322
+ files: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodType<import("../../schemas").FileNode, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../schemas").FileNode, unknown>>>>;
250
323
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
251
324
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
252
325
  id: import("zod").ZodString;
253
326
  status: import("zod").ZodString;
254
327
  activeVersionId: import("zod").ZodOptional<import("zod").ZodString>;
255
328
  authorId: import("zod").ZodOptional<import("zod").ZodString>;
329
+ visibility: import("zod").ZodOptional<import("zod").ZodEnum<{
330
+ public: "public";
331
+ private: "private";
332
+ }>>;
333
+ favoriteCount: import("zod").ZodOptional<import("zod").ZodNumber>;
334
+ isFavorited: import("zod").ZodOptional<import("zod").ZodBoolean>;
256
335
  createdAt: import("zod").ZodCoercedDate<unknown>;
257
336
  updatedAt: import("zod").ZodCoercedDate<unknown>;
258
337
  name: import("zod").ZodString;
@@ -273,11 +352,16 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
273
352
  references: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
274
353
  scripts: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
275
354
  assets: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
355
+ files: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodType<import("../../schemas").FileNode, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../schemas").FileNode, unknown>>>>;
276
356
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
277
357
  }, import("zod/v4/core").$strip>>, "POST", "/stored/skills">, import(".").ServerRoute<import(".").InferParams<import("zod").ZodObject<{
278
358
  storedSkillId: import("zod").ZodString;
279
359
  }, import("zod/v4/core").$strip>, undefined, import("zod").ZodObject<{
280
360
  authorId: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
361
+ visibility: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodEnum<{
362
+ public: "public";
363
+ private: "private";
364
+ }>>>;
281
365
  name: import("zod").ZodOptional<import("zod").ZodString>;
282
366
  description: import("zod").ZodOptional<import("zod").ZodString>;
283
367
  instructions: import("zod").ZodOptional<import("zod").ZodString>;
@@ -296,6 +380,7 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
296
380
  references: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
297
381
  scripts: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
298
382
  assets: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
383
+ files: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodType<import("../../schemas").FileNode, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../schemas").FileNode, unknown>>>>>;
299
384
  metadata: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
300
385
  }, import("zod/v4/core").$strip>>, {
301
386
  id: string;
@@ -307,6 +392,9 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
307
392
  instructions: string;
308
393
  activeVersionId?: string | undefined;
309
394
  authorId?: string | undefined;
395
+ visibility?: "public" | "private" | undefined;
396
+ favoriteCount?: number | undefined;
397
+ isFavorited?: boolean | undefined;
310
398
  license?: string | undefined;
311
399
  compatibility?: unknown;
312
400
  source?: {
@@ -322,6 +410,7 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
322
410
  references?: string[] | undefined;
323
411
  scripts?: string[] | undefined;
324
412
  assets?: string[] | undefined;
413
+ files?: import("../../schemas").FileNode[] | undefined;
325
414
  metadata?: Record<string, unknown> | undefined;
326
415
  } | {
327
416
  id: string;
@@ -330,10 +419,15 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
330
419
  updatedAt: Date;
331
420
  activeVersionId?: string | undefined;
332
421
  authorId?: string | undefined;
422
+ visibility?: "public" | "private" | undefined;
333
423
  }, "json", import(".").RouteSchemas<import("zod").ZodObject<{
334
424
  storedSkillId: import("zod").ZodString;
335
425
  }, import("zod/v4/core").$strip>, undefined, import("zod").ZodObject<{
336
426
  authorId: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
427
+ visibility: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodEnum<{
428
+ public: "public";
429
+ private: "private";
430
+ }>>>;
337
431
  name: import("zod").ZodOptional<import("zod").ZodString>;
338
432
  description: import("zod").ZodOptional<import("zod").ZodString>;
339
433
  instructions: import("zod").ZodOptional<import("zod").ZodString>;
@@ -352,12 +446,17 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
352
446
  references: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
353
447
  scripts: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
354
448
  assets: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
449
+ files: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodType<import("../../schemas").FileNode, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../schemas").FileNode, unknown>>>>>;
355
450
  metadata: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
356
451
  }, import("zod/v4/core").$strip>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
357
452
  id: import("zod").ZodString;
358
453
  status: import("zod").ZodString;
359
454
  activeVersionId: import("zod").ZodOptional<import("zod").ZodString>;
360
455
  authorId: import("zod").ZodOptional<import("zod").ZodString>;
456
+ visibility: import("zod").ZodOptional<import("zod").ZodEnum<{
457
+ public: "public";
458
+ private: "private";
459
+ }>>;
361
460
  createdAt: import("zod").ZodCoercedDate<unknown>;
362
461
  updatedAt: import("zod").ZodCoercedDate<unknown>;
363
462
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -365,6 +464,12 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
365
464
  status: import("zod").ZodString;
366
465
  activeVersionId: import("zod").ZodOptional<import("zod").ZodString>;
367
466
  authorId: import("zod").ZodOptional<import("zod").ZodString>;
467
+ visibility: import("zod").ZodOptional<import("zod").ZodEnum<{
468
+ public: "public";
469
+ private: "private";
470
+ }>>;
471
+ favoriteCount: import("zod").ZodOptional<import("zod").ZodNumber>;
472
+ isFavorited: import("zod").ZodOptional<import("zod").ZodBoolean>;
368
473
  createdAt: import("zod").ZodCoercedDate<unknown>;
369
474
  updatedAt: import("zod").ZodCoercedDate<unknown>;
370
475
  name: import("zod").ZodString;
@@ -385,6 +490,7 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
385
490
  references: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
386
491
  scripts: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
387
492
  assets: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
493
+ files: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodType<import("../../schemas").FileNode, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../schemas").FileNode, unknown>>>>;
388
494
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
389
495
  }, import("zod/v4/core").$strip>]>>, "PATCH", "/stored/skills/:storedSkillId">, import(".").ServerRoute<{
390
496
  storedSkillId: string;
@@ -410,6 +516,9 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
410
516
  instructions: string;
411
517
  activeVersionId?: string | undefined;
412
518
  authorId?: string | undefined;
519
+ visibility?: "public" | "private" | undefined;
520
+ favoriteCount?: number | undefined;
521
+ isFavorited?: boolean | undefined;
413
522
  license?: string | undefined;
414
523
  compatibility?: unknown;
415
524
  source?: {
@@ -425,6 +534,7 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
425
534
  references?: string[] | undefined;
426
535
  scripts?: string[] | undefined;
427
536
  assets?: string[] | undefined;
537
+ files?: import("../../schemas").FileNode[] | undefined;
428
538
  metadata?: Record<string, unknown> | undefined;
429
539
  }, "json", import(".").RouteSchemas<import("zod").ZodObject<{
430
540
  storedSkillId: import("zod").ZodString;
@@ -435,6 +545,12 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
435
545
  status: import("zod").ZodString;
436
546
  activeVersionId: import("zod").ZodOptional<import("zod").ZodString>;
437
547
  authorId: import("zod").ZodOptional<import("zod").ZodString>;
548
+ visibility: import("zod").ZodOptional<import("zod").ZodEnum<{
549
+ public: "public";
550
+ private: "private";
551
+ }>>;
552
+ favoriteCount: import("zod").ZodOptional<import("zod").ZodNumber>;
553
+ isFavorited: import("zod").ZodOptional<import("zod").ZodBoolean>;
438
554
  createdAt: import("zod").ZodCoercedDate<unknown>;
439
555
  updatedAt: import("zod").ZodCoercedDate<unknown>;
440
556
  name: import("zod").ZodString;
@@ -455,6 +571,27 @@ export declare const STORED_SKILLS_ROUTES: readonly [import(".").ServerRoute<imp
455
571
  references: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
456
572
  scripts: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
457
573
  assets: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
574
+ files: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodType<import("../../schemas").FileNode, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../schemas").FileNode, unknown>>>>;
458
575
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
459
- }, import("zod/v4/core").$strip>>, "POST", "/stored/skills/:storedSkillId/publish">];
576
+ }, import("zod/v4/core").$strip>>, "POST", "/stored/skills/:storedSkillId/publish">, import(".").ServerRoute<{
577
+ storedSkillId: string;
578
+ }, {
579
+ favorited: boolean;
580
+ favoriteCount: number;
581
+ }, "json", import(".").RouteSchemas<import("zod").ZodObject<{
582
+ storedSkillId: import("zod").ZodString;
583
+ }, import("zod/v4/core").$strip>, undefined, undefined, import("zod").ZodObject<{
584
+ favorited: import("zod").ZodBoolean;
585
+ favoriteCount: import("zod").ZodNumber;
586
+ }, import("zod/v4/core").$strip>>, "PUT", "/stored/skills/:storedSkillId/favorite">, import(".").ServerRoute<{
587
+ storedSkillId: string;
588
+ }, {
589
+ favorited: boolean;
590
+ favoriteCount: number;
591
+ }, "json", import(".").RouteSchemas<import("zod").ZodObject<{
592
+ storedSkillId: import("zod").ZodString;
593
+ }, import("zod/v4/core").$strip>, undefined, undefined, import("zod").ZodObject<{
594
+ favorited: import("zod").ZodBoolean;
595
+ favoriteCount: import("zod").ZodNumber;
596
+ }, import("zod/v4/core").$strip>>, "DELETE", "/stored/skills/:storedSkillId/favorite">];
460
597
  //# sourceMappingURL=stored-skills.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stored-skills.d.ts","sourceRoot":"","sources":["../../../../src/server/server-adapter/routes/stored-skills.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,oBAAo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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uFAYvB,CAAC"}
@@ -80,6 +80,7 @@ export declare const STORED_WORKSPACES_ROUTES: readonly [import(".").ServerRoute
80
80
  } | undefined;
81
81
  autoSync?: boolean | undefined;
82
82
  operationTimeout?: number | undefined;
83
+ runtimeRegistered?: boolean | undefined;
83
84
  }[];
84
85
  }, "json", import(".").RouteSchemas<undefined, import("zod").ZodObject<{
85
86
  perPage: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
@@ -163,6 +164,7 @@ export declare const STORED_WORKSPACES_ROUTES: readonly [import(".").ServerRoute
163
164
  }, import("zod/v4/core").$strip>>;
164
165
  autoSync: import("zod").ZodOptional<import("zod").ZodBoolean>;
165
166
  operationTimeout: import("zod").ZodOptional<import("zod").ZodNumber>;
167
+ runtimeRegistered: import("zod").ZodOptional<import("zod").ZodBoolean>;
166
168
  }, import("zod/v4/core").$strip>>;
167
169
  }, import("zod/v4/core").$strip>>, "GET", "/stored/workspaces">, import(".").ServerRoute<{
168
170
  storedWorkspaceId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"stored-workspaces.d.ts","sourceRoot":"","sources":["../../../../src/server/server-adapter/routes/stored-workspaces.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sFAO3B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { BuilderModelPolicy } from '@mastra/core/agent-builder/ee';
2
+ import type { IMastraEditor } from '@mastra/core/editor';
3
+ /**
4
+ * Server-side wrapper around `builderToModelPolicy`.
5
+ *
6
+ * Handles the optional `IMastraEditor` builder API surface (older / OSS editors
7
+ * may not implement `hasEnabledBuilderConfig` / `resolveBuilder`) and returns
8
+ * a uniform `BuilderModelPolicy` to every call site.
9
+ *
10
+ * Returns `{ active: false }` whenever:
11
+ * - no editor is configured,
12
+ * - the editor doesn't expose builder methods,
13
+ * - the builder config is disabled, or
14
+ * - resolving the builder fails / yields nothing.
15
+ */
16
+ export declare function resolveBuilderModelPolicy(editor: IMastraEditor | undefined): Promise<BuilderModelPolicy>;
17
+ //# sourceMappingURL=resolve-builder-model-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-builder-model-policy.d.ts","sourceRoot":"","sources":["../../../src/server/utils/resolve-builder-model-policy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAgB9G"}
@@ -1,4 +1,5 @@
1
1
  import type { Mastra } from '@mastra/core';
2
+ import type { RequestContext } from '@mastra/core/di';
2
3
  import type { SystemMessage } from '@mastra/core/llm';
3
4
  import type { Workflow, WorkflowInfo } from '@mastra/core/workflows';
4
5
  /**
@@ -14,6 +15,16 @@ import type { Workflow, WorkflowInfo } from '@mastra/core/workflows';
14
15
  * @throws Error if path contains invalid characters
15
16
  */
16
17
  export declare function normalizeRoutePath(path: string): string;
18
+ export type StoredResourceScope = {
19
+ metadataKey: string;
20
+ value: string;
21
+ };
22
+ export type StoredResourceLike = {
23
+ metadata?: Record<string, unknown> | null;
24
+ };
25
+ export declare function getStoredResourceScope(mastra: Pick<Mastra, 'getServer'>, requestContext: RequestContext | undefined): Promise<StoredResourceScope | undefined>;
26
+ export declare function scopeStoredResourceMetadata(metadata: Record<string, unknown> | undefined, scope: StoredResourceScope | undefined): Record<string, unknown> | undefined;
27
+ export declare function assertStoredResourceScope(resource: StoredResourceLike | null | undefined, scope: StoredResourceScope | undefined): void;
17
28
  export declare function getWorkflowInfo(workflow: Workflow, partial?: boolean): WorkflowInfo;
18
29
  /**
19
30
  * Workflow Registry for temporarily registering additional workflows
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/server/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAqB,QAAQ,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAkBxF;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAgBvD;AAiED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,GAAE,OAAe,GAAG,YAAY,CAgD1F;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAgC;IAElE;;OAEG;IACH,MAAM,CAAC,yBAAyB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAItE;;OAEG;IACH,MAAM,CAAC,0BAA0B,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AAC,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAI5D;;OAEG;IACH,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC;IAIlD;;OAEG;IACH,MAAM,CAAC,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAGzD;;OAEG;IACH,MAAM,CAAC,OAAO,IAAI,IAAI;IAKtB;;OAEG;IACH,MAAM,CAAC,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAI1D;;OAEG;IACH,MAAM,CAAC,wBAAwB,IAAI,MAAM,EAAE;CAG5C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAK5C;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAwB1E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/server",
3
- "version": "1.36.0-alpha.1",
3
+ "version": "1.36.0-alpha.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -97,7 +97,7 @@
97
97
  "author": "",
98
98
  "license": "Apache-2.0",
99
99
  "peerDependencies": {
100
- "@mastra/core": ">=1.32.0-0 <2.0.0-0",
100
+ "@mastra/core": ">=1.34.0-0 <2.0.0-0",
101
101
  "zod": "^3.25.0 || ^4.0.0"
102
102
  },
103
103
  "devDependencies": {
@@ -114,13 +114,13 @@
114
114
  "vitest": "4.1.5",
115
115
  "zod": "^4.3.6",
116
116
  "zod-to-ts": "^2.0.0",
117
- "@internal/core": "0.0.0",
118
117
  "@internal/lint": "0.0.96",
118
+ "@internal/core": "0.0.0",
119
119
  "@internal/storage-test-utils": "0.0.92",
120
120
  "@internal/test-utils": "0.0.32",
121
121
  "@internal/types-builder": "0.0.71",
122
122
  "@mastra/agent-builder": "1.0.37-alpha.0",
123
- "@mastra/core": "1.36.0-alpha.1",
123
+ "@mastra/core": "1.36.0-alpha.2",
124
124
  "@mastra/schema-compat": "1.2.10"
125
125
  },
126
126
  "homepage": "https://mastra.ai",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/server/constants.ts"],"names":[],"mappings":";;;AAQO,IAAM,sBAAA,GAAyB;AAE/B,IAAM,oBAAA,GAAuB;AAE7B,IAAM,qBAAA,GAAwB;AAE9B,IAAM,oBAAA,GAAuB;AAE7B,IAAM,yBAAA,GAA4B;AAElC,IAAM,yBAAA,GAA4B;AAEzC,IAAM,qBAAA,uBAA4B,GAAA,CAAI;AAAA,EACpC,sBAAA;AAAA,EACA,oBAAA;AAAA,EACA,qBAAA;AAAA,EACA;AACF,CAAC,CAAA;AAEM,SAAS,4BAA4B,GAAA,EAAsB;AAChE,EAAA,OAAO,qBAAA,CAAsB,IAAI,GAAG,CAAA;AACtC;AAEO,SAAS,yBAAyB,KAAA,EAAoC;AAC3E,EAAA,OAAO,KAAA,EAAO,aAAY,KAAM,yBAAA;AAClC;AAEO,IAAM,sBAAA,GAAyB,kBAAA;AAE/B,IAAM,eAAA,GAAkB;AAAA,EAC7B,UAAA,EAAY;AAAA,IACV,SAAA,EAAW,GAAG,sBAAsB,CAAA,UAAA,CAAA;AAAA,IACpC,UAAA,EAAY,GAAG,sBAAsB,CAAA,WAAA,CAAA;AAAA,IACrC,SAAA,EAAW,GAAG,sBAAsB,CAAA,UAAA,CAAA;AAAA,IACpC,UAAA,EAAY,GAAG,sBAAsB,CAAA,WAAA,CAAA;AAAA,IACrC,MAAA,EAAQ,GAAG,sBAAsB,CAAA,OAAA,CAAA;AAAA,IACjC,SAAA,EAAW,GAAG,sBAAsB,CAAA,UAAA,CAAA;AAAA,IACpC,KAAA,EAAO,GAAG,sBAAsB,CAAA,MAAA,CAAA;AAAA,IAChC,IAAA,EAAM,GAAG,sBAAsB,CAAA,KAAA;AAAA,GACjC;AAAA,EACA,OAAA,EAAS;AAAA,IACP,eAAA,EAAiB,GAAG,sBAAsB,CAAA,g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Ac,eAAA;AAAA,MAClC;AACA,MAAA,IAAI,aAAA,CAAc,2BAA2B,MAAA,EAAW;AACtD,QAAA,sBAAA,GAAyB,aAAA,CAAc,sBAAA;AAAA,MACzC;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,MAAM,mBAAA,CAAoB,OAAA,EAAS,SAAS,KAAK,CAAA;AAAA,IAC1D,eAAA,EAAiB,MAAM,mBAAA,CAAoB,eAAA,EAAiB,SAAS,IAAI,CAAA;AAAA,IACzE,sBAAA,EACE,2BAA2B,MAAA,GACvB,MAAM,oBAAoB,sBAAA,EAAwB,OAAA,EAAS,IAAI,CAAA,GAC/D;AAAA,GACR;AACF","file":"chunk-5XW4MKE6.cjs","sourcesContent":["/**\n * Constants inlined from @mastra/core to avoid import compatibility\n * issues with older core versions that don't export them yet.\n *\n * - Reserved RequestContext keys are inlined from @mastra/core/request-context.\n * - Workspace tool constants are inlined from @mastra/core/workspace.\n */\n\nexport const MASTRA_RESOURCE_ID_KEY = 'mastra__resourceId';\n\nexport const MASTRA_THREAD_ID_KEY = 'mastra__threadId';\n\nexport const MASTRA_AUTH_TOKEN_KEY = 'mastra__authToken';\n\nexport const MASTRA_IS_STUDIO_KEY = 'mastra__isStudio';\n\nexport const MASTRA_CLIENT_TYPE_HEADER = 'x-mastra-client-type';\n\nexport const MASTRA_STUDIO_CLIENT_TYPE = 'studio';\n\nconst RESERVED_CONTEXT_KEYS = new Set([\n MASTRA_RESOURCE_ID_KEY,\n MASTRA_THREAD_ID_KEY,\n MASTRA_AUTH_TOKEN_KEY,\n MASTRA_IS_STUDIO_KEY,\n]);\n\nexport function isReservedRequestContextKey(key: string): boolean {\n return RESERVED_CONTEXT_KEYS.has(key);\n}\n\nexport function isStudioClientTypeHeader(value: string | undefined): boolean {\n return value?.toLowerCase() === MASTRA_STUDIO_CLIENT_TYPE;\n}\n\nexport const WORKSPACE_TOOLS_PREFIX = 'mastra_workspace' as const;\n\nexport const WORKSPACE_TOOLS = {\n FILESYSTEM: {\n READ_FILE: `${WORKSPACE_TOOLS_PREFIX}_read_file` as const,\n WRITE_FILE: `${WORKSPACE_TOOLS_PREFIX}_write_file` as const,\n EDIT_FILE: `${WORKSPACE_TOOLS_PREFIX}_edit_file` as const,\n LIST_FILES: `${WORKSPACE_TOOLS_PREFIX}_list_files` as const,\n DELETE: `${WORKSPACE_TOOLS_PREFIX}_delete` as const,\n FILE_STAT: `${WORKSPACE_TOOLS_PREFIX}_file_stat` as const,\n MKDIR: `${WORKSPACE_TOOLS_PREFIX}_mkdir` as const,\n GREP: `${WORKSPACE_TOOLS_PREFIX}_grep` as const,\n },\n SANDBOX: {\n EXECUTE_COMMAND: `${WORKSPACE_TOOLS_PREFIX}_execute_command` as const,\n },\n SEARCH: {\n SEARCH: `${WORKSPACE_TOOLS_PREFIX}_search` as const,\n INDEX: `${WORKSPACE_TOOLS_PREFIX}_index` as const,\n },\n} as const;\n\nexport type WorkspaceToolName =\n | (typeof WORKSPACE_TOOLS.FILESYSTEM)[keyof typeof WORKSPACE_TOOLS.FILESYSTEM]\n | (typeof WORKSPACE_TOOLS.SEARCH)[keyof typeof WORKSPACE_TOOLS.SEARCH]\n | (typeof WORKSPACE_TOOLS.SANDBOX)[keyof typeof WORKSPACE_TOOLS.SANDBOX];\n\n/**\n * A tool config value that may be a static boolean or a dynamic function.\n * Inlined from @mastra/core/workspace for compatibility.\n *\n * Uses `(...args: any[]) => any` for the function branch so it stays\n * assignable from all core context variants (ToolConfigContext,\n * ToolConfigWithArgsContext) without importing them.\n */\n\ntype DynamicToolConfigValue = boolean | ((...args: any[]) => any);\n\n/**\n * Configuration for a single workspace tool.\n */\nexport interface WorkspaceToolConfig {\n enabled?: DynamicToolConfigValue;\n requireApproval?: DynamicToolConfigValue;\n requireReadBeforeWrite?: DynamicToolConfigValue;\n}\n\n/**\n * Configuration for workspace tools.\n */\nexport type WorkspaceToolsConfig = {\n enabled?: DynamicToolConfigValue;\n requireApproval?: DynamicToolConfigValue;\n} & Partial<Record<WorkspaceToolName, WorkspaceToolConfig>>;\n\n/**\n * Safely resolve a dynamic config value (boolean or async function) to a boolean.\n * Falls back to `safeDefault` when no context is available or the function throws.\n */\nasync function resolveDynamicValue(\n value: DynamicToolConfigValue | undefined,\n context: { workspace: object; requestContext: Record<string, unknown> } | undefined,\n safeDefault: boolean,\n): Promise<boolean> {\n if (value === undefined) return safeDefault;\n if (typeof value === 'boolean') return value;\n if (!context) return safeDefault;\n try {\n return await value(context);\n } catch (error) {\n console.warn('[Workspace Tools] Dynamic config function threw, using safe default:', error);\n return safeDefault;\n }\n}\n\n/**\n * Resolve the effective configuration for a workspace tool.\n * Inlined from @mastra/core/workspace for compatibility.\n *\n * Dynamic function values are resolved by calling them with the provided\n * workspace and requestContext. If a function throws, safe defaults are used\n * (enabled → false, requireApproval → true, requireReadBeforeWrite → true).\n */\nexport async function resolveToolConfig(\n toolsConfig: WorkspaceToolsConfig | undefined,\n toolName: WorkspaceToolName,\n context?: { workspace: object; requestContext: Record<string, unknown> },\n): Promise<{ enabled: boolean; requireApproval: boolean; requireReadBeforeWrite?: boolean }> {\n let enabled: DynamicToolConfigValue = true;\n let requireApproval: DynamicToolConfigValue = false;\n let requireReadBeforeWrite: DynamicToolConfigValue | undefined;\n\n if (toolsConfig) {\n if (toolsConfig.enabled !== undefined) {\n enabled = toolsConfig.enabled;\n }\n if (toolsConfig.requireApproval !== undefined) {\n requireApproval = toolsConfig.requireApproval;\n }\n\n const perToolConfig = toolsConfig[toolName];\n if (perToolConfig) {\n if (perToolConfig.enabled !== undefined) {\n enabled = perToolConfig.enabled;\n }\n if (perToolConfig.requireApproval !== undefined) {\n requireApproval = perToolConfig.requireApproval;\n }\n if (perToolConfig.requireReadBeforeWrite !== undefined) {\n requireReadBeforeWrite = perToolConfig.requireReadBeforeWrite;\n }\n }\n }\n\n return {\n enabled: await resolveDynamicValue(enabled, context, false),\n requireApproval: await resolveDynamicValue(requireApproval, context, true),\n requireReadBeforeWrite:\n requireReadBeforeWrite !== undefined\n ? await resolveDynamicValue(requireReadBeforeWrite, context, true)\n : undefined,\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/server/handlers/auth.ts"],"names":["mastra"],"mappings":";;;;;;;AAuCA,IAAI,yBAAA;AACJ,SAAS,qBAAA,GAAkE;AACzE,EAAA,IAAI,CAAC,yBAAA,EAA2B;AAC9B,IAAA,yBAAA,GAA4B,OAAO,sBAAsB,CAAA,CACtD,IAAA,CAAK,OAAK,CAAA,CAAE,iBAAwC,CAAA,CACpD,KAAA,CAAM,MAAM;AACX,MAAA,OAAA,CAAQ,KAAA;AAAA,QACN;AAAA,OACF;AACA,MAAA,OAAO,MAAA;AAAA,IACT,CAAC,CAAA;AAAA,EACL;AACA,EAAA,OAAO,yBAAA;AACT;AAKA,SAAS,gBAAgB,MAAA,EAAwC;AAC/D,EAAA,MAAM,YAAA,GAAe,OAAO,SAAA,IAAY;AACxC,EAAA,IAAI,CAAC,YAAA,EAAc,IAAA,EAAM,OAAO,IAAA;AAIhC,EAAA,IAAI,OAAO,YAAA,CAAa,IAAA,CAAK,iBAAA,KAAsB,UAAA,EAAY;AAC7D,IAAA,OAAO,YAAA,CAAa,IAAA;AAAA,EACtB;AAEA,EAAA,OAAO,IAAA;AACT;AAoBO,SAAS,gBAAgB,OAAA,EAA0B;AACxD,EAAA,MAAM,aAAA,GAAgB,OAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,kBAAkB,CAAA,EAAG,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA,EAAG,IAAA,EAAK;AACnF,EAAA,IAAI,aAAA,EAAe;AACjB,IAAA,OAAO,WAAW,aAAa,CAAA,CAAA;AAAA,EACjC;AAEA,EAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,MAAM,CAAA;AACvC,EAAA,IAAI,IAAA,EAAM;AACR,IAAA,MAAM,cAAA,GAAiB,OAAA,CAAQ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AAA,OACjB,CAAA;AAGD,MAAA,IAAI,MAAA,CAAO,SAAS,MAAA,EAAQ;AAC1B,QAAA,KAAA,MAAW,MAAA,IAAU,OAAO,OAAA,EAAS;AACnC,UAAA,OAAA,CAAQ,MAAA,CAAO,cAAc,MAAM,CAAA;AAAA,QACrC;AAAA,MACF;AAEA,MAAA,OAAO,IAAI,QAAA,CAAS,YAAA,EAAc,EAAE,MAAA,EAAQ,GAAA,EAAK,SAAS,CAAA;AAAA,IAC5D,SAAS,KAAA,EAAO;AACd,MAAA,IAAI,KAAA,YAAiB,eAAe,MAAM,KAAA;AAC1C,MAAA,MAAMA,UAAU,GAAA,CAAY,MAAA;AAC5B,MAAAA,OAAAA,EAAQ,SAAA,IAAY,EAAG,KAAA,CAAM,eAAA,EAAiB;AAAA,QAC5C,KAAA,EAAO,KAAA,YAAiB,KAAA,GAAQ,EAAE,OAAA,EAAS,MAAM,OAAA,EAAS,KAAA,EAAO,KAAA,CAAM,KAAA,EAAM,GAAI;AAAA,OAClF,CAAA;AACD,MAAA,MAAM,IAAI,aAAA,CAAc,GAAA,EAAK,EAAE,OAAA,EAAS,4BAA4B,CAAA;AAAA,IACtE;AAAA,EACF;AACF,CAAC;AAMM,IAAM,WAAA,GAAc;AAAA,EACzB,2BAAA;AAAA,EACA,sBAAA;AAAA,EACA,mBAAA;AAAA,EACA,sBAAA;AAAA,EACA,iBAAA;AAAA,EACA,kBAAA;AAAA,EACA,8BAAA;AAAA,EACA;AACF","file":"chunk-6IUJAAQ2.js","sourcesContent":["/**\n * Auth handlers for EE authentication capabilities.\n *\n * These routes enable Studio to:\n * - Detect available auth capabilities\n * - Initiate SSO login flows\n * - Handle OAuth callbacks\n * - Logout users\n */\n\nimport type {\n IUserProvider,\n ISessionProvider,\n ISSOProvider,\n ICredentialsProvider,\n SSOCallbackResult,\n} from '@mastra/core/auth';\nimport type { IRBACProvider, IFGAProvider, EEUser } from '@mastra/core/auth/ee';\nimport type { MastraAuthProvider } from '@mastra/core/server';\n\nimport { supportsSessionRefresh } from '../auth/helpers';\nimport { HTTPException } from '../http-exception';\nimport {\n capabilitiesResponseSchema,\n ssoLoginQuerySchema,\n ssoCallbackQuerySchema,\n currentUserResponseSchema,\n credentialsSignInBodySchema,\n credentialsSignUpBodySchema,\n refreshResponseSchema,\n} from '../schemas/auth';\nimport { createPublicRoute } from '../server-adapter/routes/route-builder';\nimport { handleError } from './error';\n\ntype BuildCapabilitiesFn = (\n auth: any,\n request: Request,\n options?: { rbac?: any; fga?: any; apiPrefix?: string },\n) => Promise<any>;\nlet _buildCapabilitiesPromise: Promise<BuildCapabilitiesFn | undefined> | undefined;\nfunction loadBuildCapabilities(): Promise<BuildCapabilitiesFn | undefined> {\n if (!_buildCapabilitiesPromise) {\n _buildCapabilitiesPromise = import('@mastra/core/auth/ee')\n .then(m => m.buildCapabilities as BuildCapabilitiesFn)\n .catch(() => {\n console.error(\n '[@mastra/server] EE auth features require @mastra/core >= 1.6.0. Please upgrade: npm install @mastra/core@latest',\n );\n return undefined;\n });\n }\n return _buildCapabilitiesPromise;\n}\n\n/**\n * Helper to get auth provider from Mastra instance.\n */\nfunction getAuthProvider(mastra: any): MastraAuthProvider | null {\n const serverConfig = mastra.getServer?.();\n if (!serverConfig?.auth) return null;\n\n // Auth can be either MastraAuthConfig or MastraAuthProvider\n // If it has authenticateToken method, it's a provider\n if (typeof serverConfig.auth.authenticateToken === 'function') {\n return serverConfig.auth as MastraAuthProvider;\n }\n\n return null;\n}\n\n/**\n * Get the public-facing origin from a request, respecting reverse proxy headers.\n * Behind a proxy (e.g. edge router), request.url contains the internal hostname,\n * so we rely on forwarded headers to reconstruct the real public origin.\n *\n * Assumes the server is behind a trusted proxy (or running locally). When\n * exposed directly to untrusted clients, the Host header is attacker-controlled\n * and must be validated upstream.\n *\n * Priority:\n * 1. X-Forwarded-Host (traditional reverse proxy) → always HTTPS. Knative's\n * queue-proxy overwrites X-Forwarded-Proto based on the internal HTTP\n * connection, so X-Forwarded-Proto is ignored here.\n * 2. Host header with X-Forwarded-Proto (AWS ALB, some proxies) → respect proto.\n * 3. Host header alone → use the scheme from request.url (covers both direct\n * HTTP access and proxies that preserve Host but don't set a proto header).\n * 4. No Host header → fall back to request.url.origin (local dev / direct access).\n */\nexport function getPublicOrigin(request: Request): string {\n const forwardedHost = request.headers.get('x-forwarded-host')?.split(',')[0]?.trim();\n if (forwardedHost) {\n return `https://${forwardedHost}`;\n }\n\n const host = request.headers.get('host');\n if (host) {\n const forwardedProto = request.headers.get('x-forwarded-proto')?.split(',')[0]?.trim();\n const proto = forwardedProto || new URL(request.url).protocol.replace(':', '');\n return `${proto}://${host}`;\n }\n\n return new URL(request.url).origin;\n}\n\n/**\n * Helper to get RBAC provider from Mastra server config.\n */\nfunction getRBACProvider(mastra: any): IRBACProvider<EEUser> | undefined {\n const serverConfig = mastra.getServer?.();\n return serverConfig?.rbac as IRBACProvider<EEUser> | undefined;\n}\n\n/**\n * Helper to get FGA provider from Mastra server config.\n */\nfunction getFGAProvider(mastra: any): IFGAProvider<EEUser> | undefined {\n const serverConfig = mastra.getServer?.();\n return serverConfig?.fga as IFGAProvider<EEUser> | undefined;\n}\n\n/**\n * Type guard to check if auth provider implements an interface.\n */\nfunction implementsInterface<T>(auth: unknown, method: keyof T): auth is T {\n return auth !== null && typeof auth === 'object' && typeof (auth as any)[method] === 'function';\n}\n\n// ============================================================================\n// GET /auth/capabilities\n// ============================================================================\n\nexport const GET_AUTH_CAPABILITIES_ROUTE = createPublicRoute({\n method: 'GET',\n path: '/auth/capabilities',\n responseType: 'json',\n responseSchema: capabilitiesResponseSchema,\n summary: 'Get auth capabilities',\n description:\n 'Returns authentication capabilities and current user info. Used by Studio to determine available features and user state.',\n tags: ['Auth'],\n handler: async ctx => {\n try {\n const { mastra, request, routePrefix } = ctx as any;\n\n const auth = getAuthProvider(mastra);\n\n if (!auth) {\n return { enabled: false, login: null };\n }\n\n const rbac = getRBACProvider(mastra);\n const fga = getFGAProvider(mastra);\n\n const buildCapabilities = await loadBuildCapabilities();\n if (!buildCapabilities) {\n return { enabled: false, login: null };\n }\n const capabilities = await buildCapabilities(auth, request, { rbac, fga, apiPrefix: routePrefix });\n\n // If capabilities came back without a user, the session may have expired.\n // Attempt a transparent refresh (same logic as coreAuthMiddleware) and retry.\n if (!('user' in capabilities) && supportsSessionRefresh(auth)) {\n try {\n const sessionId = await auth.getSessionIdFromRequest(request);\n if (sessionId) {\n const refreshedSession = await auth.refreshSession(sessionId);\n if (refreshedSession) {\n const sessionHeaders = await auth.getSessionHeaders(refreshedSession);\n const cookieValue = extractCookieFromHeaders(sessionHeaders);\n if (cookieValue) {\n // Rebuild capabilities with the refreshed cookie\n const refreshedRequest = new Request(request.url, {\n method: request.method,\n headers: new Headers(request.headers),\n });\n refreshedRequest.headers.set('Cookie', cookieValue);\n const refreshedCapabilities = await buildCapabilities(auth, refreshedRequest, {\n rbac,\n apiPrefix: routePrefix,\n });\n\n // Attach refresh headers so the adapter can set the new cookie\n if ('user' in refreshedCapabilities) {\n (refreshedCapabilities as any).__refreshHeaders = sessionHeaders;\n }\n return refreshedCapabilities;\n }\n }\n }\n } catch {\n // Refresh failed — return original unauthenticated capabilities\n }\n }\n\n return capabilities;\n } catch (error) {\n return handleError(error, 'Error getting auth capabilities');\n }\n },\n});\n\n/**\n * Extract a full cookie string from session headers (e.g. Set-Cookie → Cookie).\n */\nfunction extractCookieFromHeaders(headers: Record<string, string>): string | null {\n const setCookie = headers['Set-Cookie'] || headers['set-cookie'];\n if (!setCookie) return null;\n // Set-Cookie value is \"name=value; Path=/; ...\" — extract \"name=value\"\n const match = setCookie.match(/^([^;]+)/);\n return match ? (match[1] ?? null) : null;\n}\n\n// ============================================================================\n// GET /auth/me\n// ============================================================================\n\nexport const GET_CURRENT_USER_ROUTE = createPublicRoute({\n method: 'GET',\n path: '/auth/me',\n responseType: 'json',\n responseSchema: currentUserResponseSchema,\n summary: 'Get current user',\n description: 'Returns the currently authenticated user, or null if not authenticated.',\n tags: ['Auth'],\n handler: async ctx => {\n try {\n const { mastra, request } = ctx as any;\n const auth = getAuthProvider(mastra);\n const rbac = getRBACProvider(mastra);\n\n if (!auth || !implementsInterface<IUserProvider>(auth, 'getCurrentUser')) {\n return null;\n }\n\n const user = await auth.getCurrentUser(request);\n if (!user) return null;\n\n // Get roles/permissions from RBAC provider if available\n let roles: string[] | undefined;\n let permissions: string[] | undefined;\n\n if (rbac) {\n try {\n roles = await rbac.getRoles(user);\n permissions = await rbac.getPermissions(user);\n } catch {\n // RBAC not available or failed\n }\n }\n\n return {\n id: user.id,\n email: user.email,\n name: user.name,\n avatarUrl: user.avatarUrl,\n roles,\n permissions,\n };\n } catch (error) {\n return handleError(error, 'Error getting current user');\n }\n },\n});\n\n// ============================================================================\n// GET /auth/sso/login\n// ============================================================================\n\nexport const GET_SSO_LOGIN_ROUTE = createPublicRoute({\n method: 'GET',\n path: '/auth/sso/login',\n responseType: 'datastream-response',\n queryParamSchema: ssoLoginQuerySchema,\n summary: 'Initiate SSO login',\n description: 'Returns the SSO login URL and sets PKCE cookies if needed.',\n tags: ['Auth'],\n handler: async ctx => {\n try {\n const { mastra, redirect_uri, request, routePrefix } = ctx as any;\n const auth = getAuthProvider(mastra);\n\n if (!auth || !implementsInterface<ISSOProvider>(auth, 'getLoginUrl')) {\n throw new HTTPException(404, { message: 'SSO not configured' });\n }\n\n // Build OAuth callback URI using the configured route prefix\n const origin = getPublicOrigin(request);\n const raw = ((routePrefix as string) || '/api').trim();\n const withSlash = raw.startsWith('/') ? raw : `/${raw}`;\n const prefix = withSlash.endsWith('/') ? withSlash.slice(0, -1) : withSlash;\n const oauthCallbackUri = `${origin}${prefix}/auth/sso/callback`;\n\n // Encode the post-login redirect in state (where user goes after auth completes)\n // State format: uuid|postLoginRedirect\n // Validate redirect_uri to prevent open-redirect attacks: allow relative paths,\n // same-origin URLs, and localhost URLs (for dev setups where Studio runs on a\n // different port).\n let postLoginRedirect = '/';\n if (redirect_uri) {\n if (!redirect_uri.startsWith('http')) {\n // Relative path — always safe\n postLoginRedirect = redirect_uri;\n } else {\n try {\n const redirectUrl = new URL(redirect_uri);\n const requestOrigin = new URL(origin);\n const isHttps = redirectUrl.protocol === 'http:' || redirectUrl.protocol === 'https:';\n const isSameOrigin = redirectUrl.origin === requestOrigin.origin;\n const isLocalhost =\n redirectUrl.hostname === 'localhost' ||\n redirectUrl.hostname === '127.0.0.1' ||\n redirectUrl.hostname === '[::1]';\n if (isHttps && (isSameOrigin || isLocalhost)) {\n postLoginRedirect = redirect_uri;\n }\n } catch {\n // Malformed URL — fall back to /\n }\n }\n }\n const stateId = crypto.randomUUID();\n const state = `${stateId}|${encodeURIComponent(postLoginRedirect)}`;\n\n const loginUrl = auth.getLoginUrl(oauthCallbackUri, state);\n\n // Build response with optional PKCE cookies\n const headers = new Headers({ 'Content-Type': 'application/json' });\n\n // Check for PKCE cookies (e.g., MastraCloudAuthProvider)\n if (implementsInterface<ISSOProvider>(auth, 'getLoginCookies') && auth.getLoginCookies) {\n const cookies = auth.getLoginCookies(oauthCallbackUri, state);\n if (cookies?.length) {\n // PKCE cookies set for SSO state management\n for (const cookie of cookies) {\n headers.append('Set-Cookie', cookie);\n }\n }\n }\n\n return new Response(JSON.stringify({ url: loginUrl }), { status: 200, headers });\n } catch (error) {\n return handleError(error, 'Error initiating SSO login');\n }\n },\n});\n\n// ============================================================================\n// GET /auth/sso/callback\n// ============================================================================\n\nexport const GET_SSO_CALLBACK_ROUTE = createPublicRoute({\n method: 'GET',\n path: '/auth/sso/callback',\n responseType: 'datastream-response',\n queryParamSchema: ssoCallbackQuerySchema,\n summary: 'Handle SSO callback',\n description: 'Handles the OAuth callback, exchanges code for session, and redirects to the app.',\n tags: ['Auth'],\n handler: async ctx => {\n const { mastra, code, state, request } = ctx as any;\n\n // Build base URL for redirects (Response.redirect requires absolute URL)\n const baseUrl = getPublicOrigin(request);\n\n // Extract post-login redirect from state (format: uuid|encodedRedirect)\n let redirectTo = '/';\n let stateId = state || '';\n if (state && state.includes('|')) {\n const [id, encodedRedirect] = state.split('|', 2);\n stateId = id;\n try {\n redirectTo = decodeURIComponent(encodedRedirect);\n } catch {\n redirectTo = '/';\n }\n }\n\n // Build absolute redirect URL.\n // The redirect_uri was validated at the login endpoint (same-origin or localhost\n // only), so the state should only contain safe URLs. We still apply defense-in-depth\n // checks here: allow http(s) same-origin or localhost, reject everything else.\n let absoluteRedirect: string;\n if (redirectTo.startsWith('http')) {\n try {\n const parsed = new URL(redirectTo);\n const baseOrigin = new URL(baseUrl);\n const isHttps = parsed.protocol === 'http:' || parsed.protocol === 'https:';\n const isSameOrigin = parsed.origin === baseOrigin.origin;\n const isLocalhost =\n parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1' || parsed.hostname === '[::1]';\n absoluteRedirect = isHttps && (isSameOrigin || isLocalhost) ? redirectTo : `${baseUrl}/`;\n } catch {\n absoluteRedirect = `${baseUrl}/`;\n }\n } else {\n absoluteRedirect = `${baseUrl}${redirectTo}`;\n }\n\n try {\n const auth = getAuthProvider(mastra);\n\n if (!auth || !implementsInterface<ISSOProvider>(auth, 'handleCallback')) {\n return Response.redirect(`${absoluteRedirect}?error=sso_not_configured`, 302);\n }\n\n // Pass cookie header to provider for PKCE validation (if supported)\n const reqCookieHeader = request.headers.get('cookie');\n if (typeof (auth as any).setCallbackCookieHeader === 'function') {\n (auth as any).setCallbackCookieHeader(reqCookieHeader);\n }\n\n const result = (await auth.handleCallback(code, stateId)) as SSOCallbackResult<EEUser>;\n const user = result.user as EEUser;\n\n // Build response headers (session cookies, etc.)\n const headers = new Headers();\n headers.set('Location', absoluteRedirect);\n\n // Set session cookies from the SSO result\n if (result.cookies?.length) {\n for (const cookie of result.cookies) {\n headers.append('Set-Cookie', cookie);\n }\n } else if (implementsInterface<ISessionProvider>(auth, 'createSession') && result.tokens) {\n // Fallback: Create session manually for providers without cookie support\n const session = await auth.createSession(user.id, {\n accessToken: result.tokens.accessToken,\n refreshToken: result.tokens.refreshToken,\n expiresAt: result.tokens.expiresAt,\n organizationId: (user as any).organizationId,\n });\n const sessionHeaders = auth.getSessionHeaders(session);\n for (const [key, value] of Object.entries(sessionHeaders)) {\n headers.append(key, value);\n }\n }\n\n return new Response(null, {\n status: 302,\n headers,\n });\n } catch (error) {\n // Redirect with error (use absolute URL)\n const errorMessage = encodeURIComponent(error instanceof Error ? error.message : 'Unknown error');\n return Response.redirect(`${absoluteRedirect}?error=${errorMessage}`, 302);\n }\n },\n});\n\n// ============================================================================\n// POST /auth/logout\n// ============================================================================\n\nexport const POST_LOGOUT_ROUTE = createPublicRoute({\n method: 'POST',\n path: '/auth/logout',\n responseType: 'datastream-response',\n summary: 'Logout',\n description: 'Destroys the current session and returns logout redirect URL if available.',\n tags: ['Auth'],\n handler: async ctx => {\n const { mastra, request } = ctx as any;\n\n try {\n const auth = getAuthProvider(mastra);\n\n if (!auth) {\n return new Response(JSON.stringify({ success: true }), {\n status: 200,\n headers: { 'Content-Type': 'application/json' },\n });\n }\n\n // Get session ID and destroy it\n if (implementsInterface<ISessionProvider>(auth, 'getSessionIdFromRequest')) {\n const sessionId = auth.getSessionIdFromRequest(request);\n if (sessionId && implementsInterface<ISessionProvider>(auth, 'destroySession')) {\n await auth.destroySession(sessionId);\n }\n }\n\n // Get logout URL if available\n let redirectTo: string | undefined;\n if (implementsInterface<ISSOProvider>(auth, 'getLogoutUrl') && auth.getLogoutUrl) {\n // Use public origin (respects X-Forwarded-Host behind reverse proxy)\n const origin = getPublicOrigin(request);\n const logoutUrl = await auth.getLogoutUrl(origin, request);\n redirectTo = logoutUrl ?? undefined;\n }\n\n // Build response with session clearing headers\n const headers = new Headers({ 'Content-Type': 'application/json' });\n\n // Clear session cookie\n if (implementsInterface<ISessionProvider>(auth, 'getClearSessionHeaders')) {\n const clearHeaders = auth.getClearSessionHeaders();\n for (const [key, value] of Object.entries(clearHeaders)) {\n headers.append(key, value);\n }\n }\n\n return new Response(JSON.stringify({ success: true, redirectTo }), {\n status: 200,\n headers,\n });\n } catch (error) {\n return handleError(error, 'Error logging out');\n }\n },\n});\n\n// ============================================================================\n// POST /auth/refresh\n// ============================================================================\n\nexport const POST_REFRESH_ROUTE = createPublicRoute({\n method: 'POST',\n path: '/auth/refresh',\n responseType: 'datastream-response',\n responseSchema: refreshResponseSchema,\n summary: 'Refresh session',\n description: 'Refreshes the current session, extending its expiry. Sets a new session cookie on success.',\n tags: ['Auth'],\n handler: async ctx => {\n const { mastra, request } = ctx as any;\n\n try {\n const auth = getAuthProvider(mastra);\n\n if (\n !auth ||\n !implementsInterface<ISessionProvider>(auth, 'refreshSession') ||\n !implementsInterface<ISessionProvider>(auth, 'getSessionIdFromRequest')\n ) {\n throw new HTTPException(404, { message: 'Session refresh not configured' });\n }\n\n // Get session ID from request\n const sessionId = auth.getSessionIdFromRequest(request);\n if (!sessionId) {\n throw new HTTPException(401, { message: 'No session' });\n }\n\n // Refresh the session\n const newSession = await auth.refreshSession(sessionId);\n if (!newSession) {\n throw new HTTPException(401, { message: 'Session expired' });\n }\n\n // Build response with new session headers\n const headers = new Headers({ 'Content-Type': 'application/json' });\n if (implementsInterface<ISessionProvider>(auth, 'getSessionHeaders')) {\n const sessionHeaders = auth.getSessionHeaders(newSession);\n for (const [key, value] of Object.entries(sessionHeaders)) {\n headers.append(key, value);\n }\n }\n\n return new Response(JSON.stringify({ success: true }), {\n status: 200,\n headers,\n });\n } catch (error) {\n if (error instanceof HTTPException) throw error;\n return handleError(error, 'Error refreshing session');\n }\n },\n});\n\n// ============================================================================\n// POST /auth/credentials/sign-in\n// ============================================================================\n\nexport const POST_CREDENTIALS_SIGN_IN_ROUTE = createPublicRoute({\n method: 'POST',\n path: '/auth/credentials/sign-in',\n responseType: 'datastream-response',\n bodySchema: credentialsSignInBodySchema,\n summary: 'Sign in with credentials',\n description: 'Authenticates a user with email and password.',\n tags: ['Auth'],\n handler: async ctx => {\n const { mastra, request, email, password } = ctx as any;\n\n try {\n const auth = getAuthProvider(mastra);\n\n if (!auth || !implementsInterface<ICredentialsProvider>(auth, 'signIn')) {\n throw new HTTPException(404, { message: 'Credentials authentication not configured' });\n }\n\n const result = await auth.signIn(email, password, request);\n const user = result.user as EEUser;\n\n const responseBody = JSON.stringify({\n user: {\n id: user.id,\n email: user.email,\n name: user.name,\n avatarUrl: user.avatarUrl,\n },\n token: result.token,\n });\n\n // Build response headers, including cookies from the auth provider\n const headers = new Headers({\n 'Content-Type': 'application/json',\n });\n\n // Forward session cookies from the auth provider\n if (result.cookies?.length) {\n for (const cookie of result.cookies) {\n headers.append('Set-Cookie', cookie);\n }\n }\n\n return new Response(responseBody, { status: 200, headers });\n } catch (error) {\n if (error instanceof HTTPException) throw error;\n // Return a generic error for auth failures to avoid leaking info\n throw new HTTPException(401, { message: 'Invalid email or password' });\n }\n },\n});\n\n// ============================================================================\n// POST /auth/credentials/sign-up\n// ============================================================================\n\nexport const POST_CREDENTIALS_SIGN_UP_ROUTE = createPublicRoute({\n method: 'POST',\n path: '/auth/credentials/sign-up',\n responseType: 'datastream-response',\n bodySchema: credentialsSignUpBodySchema,\n summary: 'Sign up with credentials',\n description: 'Creates a new user account with email and password.',\n tags: ['Auth'],\n handler: async ctx => {\n const { mastra, request, email, password, name } = ctx as any;\n\n try {\n const auth = getAuthProvider(mastra);\n\n if (!auth || !implementsInterface<ICredentialsProvider>(auth, 'signUp')) {\n throw new HTTPException(404, { message: 'Credentials authentication not configured' });\n }\n\n const result = await auth.signUp(email, password, name, request);\n const user = result.user as EEUser;\n\n const responseBody = JSON.stringify({\n user: {\n id: user.id,\n email: user.email,\n name: user.name,\n avatarUrl: user.avatarUrl,\n },\n token: result.token,\n });\n\n // Build response headers, including cookies from the auth provider\n const headers = new Headers({\n 'Content-Type': 'application/json',\n });\n\n // Forward session cookies from the auth provider\n if (result.cookies?.length) {\n for (const cookie of result.cookies) {\n headers.append('Set-Cookie', cookie);\n }\n }\n\n return new Response(responseBody, { status: 200, headers });\n } catch (error) {\n if (error instanceof HTTPException) throw error;\n const mastra = (ctx as any).mastra;\n mastra?.getLogger?.()?.error('Sign-up error', {\n error: error instanceof Error ? { message: error.message, stack: error.stack } : error,\n });\n throw new HTTPException(400, { message: 'Failed to create account' });\n }\n },\n});\n\n// ============================================================================\n// Export all auth routes\n// ============================================================================\n\nexport const AUTH_ROUTES = [\n GET_AUTH_CAPABILITIES_ROUTE,\n GET_CURRENT_USER_ROUTE,\n GET_SSO_LOGIN_ROUTE,\n GET_SSO_CALLBACK_ROUTE,\n POST_LOGOUT_ROUTE,\n POST_REFRESH_ROUTE,\n POST_CREDENTIALS_SIGN_IN_ROUTE,\n POST_CREDENTIALS_SIGN_UP_ROUTE,\n] as const;\n"]}