decocms 4.166.2 → 4.167.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/client/assets/{AlertCircle-DH3qtgBe.js → AlertCircle-B9QqDYpV.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CUxSq8CM.js → AreaChart-DbP5hfAi.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-Bw-aOPaU.js → ArrowUp-DWMmuZz_.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-Cc2KMNxL.js → ArrowUpRight-BWTRGGcn.js} +1 -1
  5. package/dist/client/assets/{Check-lBHxT1HX.js → Check-BVpJjApv.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-Cva3EkPV.js → CheckCircle-DqPpDLAb.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-QYK7Lenl.js → ChevronDown-DTyVSvpW.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CWURfvDb.js → ChevronRight-MVnPAPii.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BMvYccDe.js → ChevronUp-DNXgZ_10.js} +1 -1
  10. package/dist/client/assets/{Copy01-CAqSjpf_.js → Copy01-CKPJ5IhB.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-lsdcDtEC.js → CpuChip01-Du71UW4x.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-C58fabD-.js → DotsVertical-0qwliDrg.js} +1 -1
  13. package/dist/client/assets/{Eye-Dw90cLwR.js → Eye-DydEPicd.js} +1 -1
  14. package/dist/client/assets/{FilterLines-BafoDeSJ.js → FilterLines-BJV5RK1l.js} +1 -1
  15. package/dist/client/assets/{HardDrive-BuNe2d8F.js → HardDrive-CGeasvVZ.js} +1 -1
  16. package/dist/client/assets/{Key01-DSruLSCx.js → Key01-DuDppfi_.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-BV4kR0Cl.js → LayoutLeft-Ciwgy5UL.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-DltqAIeP.js → LinkExternal01--DLqIMAa.js} +1 -1
  19. package/dist/client/assets/{LogOut01-B1kROqne.js → LogOut01-DMqcCuTY.js} +1 -1
  20. package/dist/client/assets/{Monitor01-Ba7OYhMO.js → Monitor01-B6vkAJLy.js} +1 -1
  21. package/dist/client/assets/{Palette-CwJTW0Hm.js → Palette-BoJouFtF.js} +1 -1
  22. package/dist/client/assets/{Play-B47Q6pNp.js → Play-C5V2_mAu.js} +1 -1
  23. package/dist/client/assets/{Plus-Bi2kvuIY.js → Plus-hTCIWDtE.js} +1 -1
  24. package/dist/client/assets/{SearchLg-UBODIUpH.js → SearchLg-CEMI_Yu5.js} +1 -1
  25. package/dist/client/assets/{SearchMd-Swr0KhLg.js → SearchMd-CGs342fz.js} +1 -1
  26. package/dist/client/assets/{Settings02-Crp31NAs.js → Settings02-CzRrS-qR.js} +1 -1
  27. package/dist/client/assets/{Shield01-D6aMdI8b.js → Shield01-b0Ri5_gK.js} +1 -1
  28. package/dist/client/assets/{Star01-WZXTBc9P.js → Star01-BetPRMOP.js} +1 -1
  29. package/dist/client/assets/{Stars01-CbClslIT.js → Stars01-DQgIK8ZP.js} +1 -1
  30. package/dist/client/assets/{Stars02-D3Ts30Xu.js → Stars02-JSRi49Xl.js} +1 -1
  31. package/dist/client/assets/{Sun-DOEVL1Eu.js → Sun-OLuqlB9J.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-5PmCZ0_U.js → SwitchHorizontal01-GLaQT_tZ.js} +1 -1
  33. package/dist/client/assets/{Tool01-BgrN_XhB.js → Tool01-D_lBKESF.js} +1 -1
  34. package/dist/client/assets/{Tool02-C8_nzaSV.js → Tool02-BcNfyibb.js} +1 -1
  35. package/dist/client/assets/{Trash01-BB8WWZkr.js → Trash01--2hLWyEP.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-cPdEBjok.js → TrendUp01-4daEWKyg.js} +1 -1
  37. package/dist/client/assets/{Upload01-HoFghnaA.js → Upload01-CpoC4YD6.js} +1 -1
  38. package/dist/client/assets/{User01-CU43n4aC.js → User01-Ddv0yRQm.js} +1 -1
  39. package/dist/client/assets/{Users01-BfmGwOWr.js → Users01-B0XXonaO.js} +1 -1
  40. package/dist/client/assets/{Users03-BrSAA7CP.js → Users03-C-1TY48R.js} +1 -1
  41. package/dist/client/assets/{X-BW2EYO4B.js → X-BcM56kD2.js} +1 -1
  42. package/dist/client/assets/{XCircle-Mv4us9Z1.js → XCircle-B8N2lyCq.js} +1 -1
  43. package/dist/client/assets/{XClose-DCuiifka.js → XClose-BMHkS-kz.js} +1 -1
  44. package/dist/client/assets/{Zap-fP1c7xXe.js → Zap-0Vx8dn_e.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-DYA2y0UF.js → ZapSquare-Nv0rijSe.js} +1 -1
  46. package/dist/client/assets/{access-gate-BOsNScRg.js → access-gate-ClCWz49c.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-_WTg53uR.js → add-section-modal-J4MpuN5T.js} +1 -1
  48. package/dist/client/assets/{agent-icon-Dx4NCRpv.js → agent-icon-DvITB4KO.js} +1 -1
  49. package/dist/client/assets/{agents-list-B6Umsglt.js → agents-list-CplH0YOk.js} +1 -1
  50. package/dist/client/assets/ai-providers-EMQ_jn-r.js +1 -0
  51. package/dist/client/assets/{alert-NAuelKid.js → alert-B3oOnpj5.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-C9XbRCXw.js → alert-dialog-B9G0eJ9-.js} +3 -3
  53. package/dist/client/assets/{app-editor-9ydsOs0i.js → app-editor-yXBS1_dG.js} +1 -1
  54. package/dist/client/assets/{auth-B6HaqNKN.js → auth-C7EjAKuK.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-CgRGtxCe.js → auth-catchall-BfqFoMfa.js} +1 -1
  56. package/dist/client/assets/{auth-entry-iN06W9mE.js → auth-entry-BB2Zbbuo.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-CbLuIloM.js → auth-split-layout-DwqQL_lh.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-B4pAf04F.js → authenticate-and-persist-oauth-Drw6R7zD.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-BRUbqICU.js → automation-list-row-B6zoK1J4.js} +1 -1
  60. package/dist/client/assets/{automation-runs-BJxujaRz.js → automation-runs-CgyKaz2R.js} +1 -1
  61. package/dist/client/assets/{automations-DM2CfSl8.js → automations-Rl8s5Ge5.js} +1 -1
  62. package/dist/client/assets/{avatar-D9ru8t7J.js → avatar-BN0lsHoN.js} +1 -1
  63. package/dist/client/assets/{badge-DuDSo4B5.js → badge-ClnYkgjJ.js} +1 -1
  64. package/dist/client/assets/{block-document-Bj42QOMt.js → block-document-Cs_WYNJE.js} +1 -1
  65. package/dist/client/assets/{brand-context-BUhPcaYQ.js → brand-context-CtuFGog_.js} +1 -1
  66. package/dist/client/assets/{buckets-bVh7oMEv.js → buckets-CWde2N2a.js} +1 -1
  67. package/dist/client/assets/{bulk-category-panel-88hyriYd.js → bulk-category-panel-CGldf2S5.js} +1 -1
  68. package/dist/client/assets/{calendar-CyEY0jbs.js → calendar-CX7YfHEa.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-D5Gggd0Y.js → capability-load-error-D2CLFEVV.js} +1 -1
  70. package/dist/client/assets/{card-F2SMEUTI.js → card-Dwttk7rT.js} +1 -1
  71. package/dist/client/assets/{category-editor-DW9xGXQm.js → category-editor-Zu5hW0O8.js} +1 -1
  72. package/dist/client/assets/{chat-context-BPHBf2SD.js → chat-context-BbbE9k_D.js} +4 -4
  73. package/dist/client/assets/{checkbox-ttemAxHh.js → checkbox-CpYf9_vX.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-CqGPeKLM.js → cli-auth-success-D6c-aysX.js} +1 -1
  75. package/dist/client/assets/{collection-detail-Dfuq9bfs.js → collection-detail-D92VY8wh.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-BRJWc_xO.js → collection-display-button-DP3SA4GB.js} +1 -1
  77. package/dist/client/assets/{collection-search-C_lEkJSM.js → collection-search-Cz6kdWMP.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-CzY9tIKJ.js → collection-table-wrapper-D5y3-VS8.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-DKMXuAh7.js → collection-tabs-DySS3fYR.js} +1 -1
  80. package/dist/client/assets/{command-BaN3HpzD.js → command-CBET95DA.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-Cbx7Kx6o.js → commerce-onboarding-BeqUSNyL.js} +1 -1
  82. package/dist/client/assets/{companions-core-DBvnypYt.js → companions-core-DfxidC-a.js} +1 -1
  83. package/dist/client/assets/{connect-CsGthfpX.js → connect-BpZc7CVv.js} +1 -1
  84. package/dist/client/assets/{connection-D4s1OcN3.js → connection-_mzadKpF.js} +1 -1
  85. package/dist/client/assets/{connection-card-ClxMiq53.js → connection-card-DDBFrRVD.js} +1 -1
  86. package/dist/client/assets/{connection-detail-CD343aW8.js → connection-detail-CQnHH61z.js} +1 -1
  87. package/dist/client/assets/{connection-form-helpers-BL_ujE81.js → connection-form-helpers-B7chcMcT.js} +1 -1
  88. package/dist/client/assets/{connections-CUCSFMwK.js → connections-Ba0_1aAV.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-DvMExQy8.js → decopilot-sse-pool-C5huenWS.js} +1 -1
  90. package/dist/client/assets/{dialog-1l6V_AO-.js → dialog-BSwzm_xb.js} +1 -1
  91. package/dist/client/assets/{domain-settings-DNGGLfRt.js → domain-settings-BvGX-H5z.js} +1 -1
  92. package/dist/client/assets/{drawer-D_dlIrgq.js → drawer-Bs_TJ-Xq.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-BSq_T2rN.js → dropdown-menu-b_BfGjG2.js} +1 -1
  94. package/dist/client/assets/{empty-state-DbpV7XVc.js → empty-state-p3Rv7ykT.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-DsmAsG2q.js → extract-connection-data-CD7g_CXG.js} +1 -1
  96. package/dist/client/assets/{file-explorer-qDmxYOXW.js → file-explorer-wJZqCObJ.js} +2 -2
  97. package/dist/client/assets/{form-BBhau0Q4.js → form-DH41eKNk.js} +1 -1
  98. package/dist/client/assets/{general-DEP7lOkZ.js → general-CMWfkn6U.js} +1 -1
  99. package/dist/client/assets/github-repo-picker-B3yLKSRu.js +1 -0
  100. package/dist/client/assets/{hooks-D1TjgNd-.js → hooks-Bva17Au4.js} +5 -5
  101. package/dist/client/assets/{index-Bg79Fd9u.js → index-B3Lyzc7o.js} +5 -5
  102. package/dist/client/assets/{index-CiqXq-Gv.js → index-BXC1jJIv.js} +1 -1
  103. package/dist/client/assets/{index-B09P05BF.js → index-BuiYUoEr.js} +1 -1
  104. package/dist/client/assets/index-CHyu4u6F.js +1 -0
  105. package/dist/client/assets/{index-B1Tuj6zE.js → index-CMKFDBTg.js} +1 -1
  106. package/dist/client/assets/index-DnYz0HYp.js +1 -0
  107. package/dist/client/assets/{index-LnErdRrl.js → index-Pe4ypjX9.js} +18 -18
  108. package/dist/client/assets/{index-B1INhWoo.js → index-bSjz3FLt.js} +6 -6
  109. package/dist/client/assets/{index-C_7kU-Qk.js → index-kdXFHcLL.js} +1 -1
  110. package/dist/client/assets/{index-D8Oyc-Sj.js → index-m3kwuU8_.js} +1 -1
  111. package/dist/client/assets/{index-CtHwx2FP.js → index-r7ibRdki.js} +1 -1
  112. package/dist/client/assets/{index-redirect-CSLJ76k2.js → index-redirect-Dcp2bxDL.js} +1 -1
  113. package/dist/client/assets/{input-DkjdpI9N.js → input-mwCJa3UC.js} +1 -1
  114. package/dist/client/assets/{integration-icon-eRBxSPRX.js → integration-icon-Dw-S_xW-.js} +1 -1
  115. package/dist/client/assets/{invite-member-dialog-DW8BgMeK.js → invite-member-dialog-BmhAm9Lx.js} +1 -1
  116. package/dist/client/assets/{label-BxyuqrG3.js → label-BdYpUysi.js} +1 -1
  117. package/dist/client/assets/{layout-Cu8cokWN.js → layout-wXBYk3l6.js} +1 -1
  118. package/dist/client/assets/{login-cHpOzdtv.js → login-BT8Xsyxn.js} +1 -1
  119. package/dist/client/assets/{mcp-oauth-BWVH0_CJ.js → mcp-oauth-CFh8Fy0x.js} +1 -1
  120. package/dist/client/assets/{members-CywL8X1G.js → members-DkjeT3mE.js} +1 -1
  121. package/dist/client/assets/{monaco-editor-Mtdo8aZY.js → monaco-editor-DLbVfQ_7.js} +4 -4
  122. package/dist/client/assets/{monitoring-stats-row-je0A9zFO.js → monitoring-stats-row-B_q91RyA.js} +3 -3
  123. package/dist/client/assets/{multi-select-Cna0azbN.js → multi-select-ponRWmkh.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-ai-provider-Bz_8J_A5.js → oauth-callback-ai-provider-3M6tgaHM.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-DTQkysno.js → oauth-callback-qeybtKtJ.js} +1 -1
  126. package/dist/client/assets/{onboarding-CjSfkbXS.js → onboarding-DdiUwvH4.js} +1 -1
  127. package/dist/client/assets/{org-layout-BjpSi748.js → org-layout-BO_NrrDG.js} +1 -1
  128. package/dist/client/assets/{organization-choice-NAhiEtg0.js → organization-choice-BT4w0rse.js} +1 -1
  129. package/dist/client/assets/{orgs-CrVyQZvg.js → orgs-ChPD5qq-.js} +1 -1
  130. package/dist/client/assets/{page-seo-form-vyR-JMew.js → page-seo-form-CP8D3Ih-.js} +1 -1
  131. package/dist/client/assets/{popover-PONP-IrS.js → popover-NHkLoGwZ.js} +1 -1
  132. package/dist/client/assets/{post-editor-DAuwYe2r.js → post-editor-Cr2du04f.js} +1 -1
  133. package/dist/client/assets/{primitives-D8K2Kshy.js → primitives-2VpPQpUT.js} +1 -1
  134. package/dist/client/assets/{profile-YApiO9LU.js → profile-CGYeqX8p.js} +1 -1
  135. package/dist/client/assets/project-app-view-C9N2qA5x.js +1 -0
  136. package/dist/client/assets/record-editor-RMLYnDrn.js +1 -0
  137. package/dist/client/assets/{redirect-editor-BTed9W7Z.js → redirect-editor-ZxNWX7KV.js} +1 -1
  138. package/dist/client/assets/registry-7HcYvODq.js +2 -0
  139. package/dist/client/assets/{registry-layout-xuewIiFA.js → registry-layout-8gQg9AHQ.js} +1 -1
  140. package/dist/client/assets/{reports-CNXGX--9.js → reports-DuFKwYsN.js} +1 -1
  141. package/dist/client/assets/{require-capability-RQbEgO2R.js → require-capability-gdmir0q8.js} +1 -1
  142. package/dist/client/assets/{required-auth-layout-Cp2xOp41.js → required-auth-layout-DNnOiPNc.js} +1 -1
  143. package/dist/client/assets/{reset-password-DTmQ8ZLF.js → reset-password-B7ZF2KQd.js} +1 -1
  144. package/dist/client/assets/{roles-DteJLIyV.js → roles-DHyl-7I0.js} +1 -1
  145. package/dist/client/assets/{search-input-l0QwIQw1.js → search-input-D80HsBNG.js} +1 -1
  146. package/dist/client/assets/{secrets-4vWsgQBd.js → secrets-xULgdM9X.js} +1 -1
  147. package/dist/client/assets/{sections-editor-C_KhTOCu.js → sections-editor-EBt_1HWU.js} +1 -1
  148. package/dist/client/assets/{select-CzAV5CH5.js → select-C_F8-amA.js} +1 -1
  149. package/dist/client/assets/{select-model-CUI7TW7J.js → select-model-DQDGLP7u.js} +2 -2
  150. package/dist/client/assets/self-tool-result-C1Frg_4o.js +1 -0
  151. package/dist/client/assets/{seo-editor-Dd2fVK23.js → seo-editor-5b4Q7Rbq.js} +1 -1
  152. package/dist/client/assets/{settings-layout-DQBiJK3p.js → settings-layout-BmqyTuv_.js} +1 -1
  153. package/dist/client/assets/{settings-section-CoPqg6gm.js → settings-section-BgUHQSVM.js} +1 -1
  154. package/dist/client/assets/{shell-controls-DZPzbjgh.js → shell-controls-obP95UlH.js} +1 -1
  155. package/dist/client/assets/{shell-layout-BWjH-Sfe.js → shell-layout-nGpsxb9b.js} +1 -1
  156. package/dist/client/assets/{sidebar-DD3SRmGs.js → sidebar-ZY9Na73j.js} +1 -1
  157. package/dist/client/assets/{skeleton-ZVeLusnT.js → skeleton-CHQGQrAg.js} +1 -1
  158. package/dist/client/assets/{spinner-CeQixqey.js → spinner-CT6gj-U7.js} +1 -1
  159. package/dist/client/assets/{sso-ioZ6VXWU.js → sso-DMVK9tiq.js} +1 -1
  160. package/dist/client/assets/{store-DsMfvWEf.js → store-DSld3m2K.js} +1 -1
  161. package/dist/client/assets/store-registry-Cmahj97T.js +2 -0
  162. package/dist/client/assets/{studio-tools-QMuOj6-u.js → studio-tools-CnY1iRfX.js} +1 -1
  163. package/dist/client/assets/{switch-DvFygQiJ.js → switch-g5eZwQWn.js} +1 -1
  164. package/dist/client/assets/{tab-id-8wArXECU.js → tab-id-D_shElJ5.js} +1 -1
  165. package/dist/client/assets/{table-TbcMVTO8.js → table-DUzcE7pw.js} +1 -1
  166. package/dist/client/assets/{tabs-CFfkTu0X.js → tabs-CU_nfhem.js} +1 -1
  167. package/dist/client/assets/{textarea-DkC87OzG.js → textarea-BNXibmKi.js} +1 -1
  168. package/dist/client/assets/{toggle-group-CTKp_-5Y.js → toggle-group-DGoI3Yg0.js} +1 -1
  169. package/dist/client/assets/{toolbar-xTOW3jV5.js → toolbar-DI-Q6oWY.js} +1 -1
  170. package/dist/client/assets/{tooltip-DvQ0XsJD.js → tooltip-Bfr58shw.js} +1 -1
  171. package/dist/client/assets/{use-ai-providers-CXx6vxgf.js → use-ai-providers-b8vjAuOw.js} +1 -1
  172. package/dist/client/assets/{use-automations-CIRY26Sm.js → use-automations-D6FStJIQ.js} +1 -1
  173. package/dist/client/assets/{use-autosave-BFchLnE-.js → use-autosave-BU3YP_ga.js} +1 -1
  174. package/dist/client/assets/{use-capability-CbsdK6kc.js → use-capability-CamUh6kt.js} +1 -1
  175. package/dist/client/assets/{use-clock-tick-yxMgruH1.js → use-clock-tick-XnKcERte.js} +1 -1
  176. package/dist/client/assets/{use-connection-Crt7Wnf6.js → use-connection-BzH0Kdzc.js} +1 -1
  177. package/dist/client/assets/{use-copy-D8LT9wzj.js → use-copy-Bb3AUakA.js} +1 -1
  178. package/dist/client/assets/{use-create-virtual-mcp-CYPHz2tM.js → use-create-virtual-mcp-BwmEhwgt.js} +1 -1
  179. package/dist/client/assets/{use-debounced-autosave-Bk4kxnd7.js → use-debounced-autosave-D3rcIunV.js} +1 -1
  180. package/dist/client/assets/{use-debounced-value-C7ql9pQ9.js → use-debounced-value-GljL4VOJ.js} +1 -1
  181. package/dist/client/assets/{use-deco-credits-D09kZAP8.js → use-deco-credits-Ds-jb_dO.js} +1 -1
  182. package/dist/client/assets/{use-decopilot-events-C_3NeXEi.js → use-decopilot-events-D8GZCmLu.js} +1 -1
  183. package/dist/client/assets/{use-delete-connection-C37Wf7oV.js → use-delete-connection-CLOnrzoe.js} +1 -1
  184. package/dist/client/assets/{use-deployment-admin-s6rTcF1z.js → use-deployment-admin-BV4YO5qR.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-d0gxFXga.js → use-file-configs-Cyy8AsxM.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-GIf_V4mg.js → use-infinite-scroll-Cg9HfQoH.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-CTSz7464.js → use-join-requests-BlRZvCNl.js} +1 -1
  188. package/dist/client/assets/{use-mcp-auth-status-BXPNVCkT.js → use-mcp-auth-status-BqOdulae.js} +1 -1
  189. package/dist/client/assets/{use-mcp-client-Cpe5VVFd.js → use-mcp-client-BcyA1fq6.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-vrGNFP62.js → use-mcp-tools-Dsxlr_F7.js} +1 -1
  191. package/dist/client/assets/{use-members-Di-wqSFo.js → use-members-BPAn97Ac.js} +1 -1
  192. package/dist/client/assets/{use-mobile-BDpXfOGb.js → use-mobile-DtJ9mqo3.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-xBQA-nI3.js → use-navigate-to-agent-B56yEq2x.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-xlorPrK7.js → use-org-auth-client-BbxxaMLu.js} +1 -1
  195. package/dist/client/assets/{use-org-sso-BP9JFiDp.js → use-org-sso-9IKzvoT7.js} +1 -1
  196. package/dist/client/assets/{use-organization-roles-LBstF68U.js → use-organization-roles-ROrqTPFl.js} +1 -1
  197. package/dist/client/assets/{use-organization-settings-BxnffxCo.js → use-organization-settings-B7aJIu7V.js} +1 -1
  198. package/dist/client/assets/{use-registry-connections-CMbVPAo5.js → use-registry-connections-B--YAga1.js} +1 -1
  199. package/dist/client/assets/{use-secrets-BvEnn7fN.js → use-secrets-DWxO4tT-.js} +1 -1
  200. package/dist/client/assets/{use-status-sounds-Cuh2VhxF.js → use-status-sounds-DGy4iLtW.js} +1 -1
  201. package/dist/client/assets/{use-tags-Ro4HIuso.js → use-tags-CRJNGby7.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-BPzd0kmg.js → use-view-mode-CcQ20A8d.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-CRbRiAY-.js → use-virtual-mcp-Bujf-aIR.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-gU5karM4.js +1 -0
  205. package/dist/client/assets/{useQueries-D1qVck3-.js → useQueries-CC6kPLN8.js} +1 -1
  206. package/dist/client/assets/{useRouterState-BK4V-Kyf.js → useRouterState-wMiETB_2.js} +1 -1
  207. package/dist/client/assets/useSuspenseInfiniteQuery-DfcVoJ9U.js +1 -0
  208. package/dist/client/assets/{users-DG9dviv7.js → users-BG9VHnqD.js} +1 -1
  209. package/dist/client/assets/{variant-calendar-B31vNriY.js → variant-calendar-COmRMH0Y.js} +1 -1
  210. package/dist/client/assets/{view-mode-toggle-Ckvgwera.js → view-mode-toggle-C-PRhWQn.js} +1 -1
  211. package/dist/client/index.html +1 -1
  212. package/dist/server/cli.js +399 -399
  213. package/dist/server/server.js +265 -265
  214. package/package.json +1 -1
  215. package/dist/client/assets/ai-providers-B61Bdd0p.js +0 -1
  216. package/dist/client/assets/github-repo-picker-DZFkRYw0.js +0 -1
  217. package/dist/client/assets/index-D0yzSc_G.js +0 -1
  218. package/dist/client/assets/index-SpY-wt3w.js +0 -1
  219. package/dist/client/assets/project-app-view-ZWIwvBP5.js +0 -1
  220. package/dist/client/assets/record-editor-CzQMCL3u.js +0 -1
  221. package/dist/client/assets/registry-PrAxBk77.js +0 -2
  222. package/dist/client/assets/self-tool-result-CFJjEh0u.js +0 -1
  223. package/dist/client/assets/store-registry-eAQ_7jJi.js +0 -2
  224. package/dist/client/assets/useInfiniteQuery-C-RqwYQP.js +0 -1
  225. package/dist/client/assets/useSuspenseInfiniteQuery-QRgmbC8e.js +0 -1
@@ -1 +1 @@
1
- import{c as oe,b as le,j as n,F as se,o as ie,r as ce,t as Y,b9 as re,ba as ae}from"./index-B1INhWoo.js";import{c as z,d as G,b as V,f as X,g as Z,e as ee,a as te,A as ne}from"./alert-dialog-C9XbRCXw.js";import{u as de}from"./studio-tools-QMuOj6-u.js";function ue(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),w=s.mode==="deleting";let m;e[0]!==a?(m=W=>{W||a()},e[0]=a,e[1]=m):m=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(z,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const H=s.mode==="deleting"&&s.connection.title;let o;e[8]!==H?(o=n.jsx("span",{className:"font-medium text-foreground",children:H}),e[8]=H,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(G,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(V,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let f;e[16]!==t?(f=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=f):f=e[17];let r;e[18]!==f?(r=n.jsx(X,{children:f}),e[18]=f,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let p;e[31]!==w||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:w,onOpenChange:m,children:j}),e[31]=w,e[32]=j,e[33]=m,e[34]=p):p=e[34];const J=s.mode==="force-deleting";let N;e[35]!==a?(N=W=>{W||a()},e[35]=a,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let y;e[39]!==E?(y=n.jsx(z,{children:E}),e[39]=E,e[40]=y):y=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let v;e[43]!==M?(v=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=v):v=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==O||e[50]!==v||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[O," ",v," ",S," ",T,"."]}),e[49]=O,e[50]=v,e[51]=S,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let F;e[56]!==_?(F=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=F):F=e[57];let b;e[58]!==A||e[59]!==F?(b=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,F]})}),e[58]=A,e[59]=F,e[60]=b):b=e[60];let I;e[61]!==y||e[62]!==b?(I=n.jsxs(V,{children:[y,b]}),e[61]=y,e[62]=b,e[63]=I):I=e[63];let L;e[64]!==t?(L=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=L):L=e[65];let R;e[66]!==L?(R=n.jsx(X,{children:L}),e[66]=L,e[67]=R):R=e[67];let q;e[68]!==t?(q=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=q):q=e[69];let U;e[70]!==c||e[71]!==q?(U=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:q}),e[70]=c,e[71]=q,e[72]=U):U=e[72];let K;e[73]!==R||e[74]!==U?(K=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=K):K=e[75];let $;e[76]!==I||e[77]!==K?($=n.jsxs(te,{children:[I,K]}),e[76]=I,e[77]=K,e[78]=$):$=e[78];let k;e[79]!==J||e[80]!==N||e[81]!==$?(k=n.jsx(ne,{open:J,onOpenChange:N,children:$}),e[79]=J,e[80]=N,e[81]=$,e[82]=k):k=e[82];let Q;return e[83]!==p||e[84]!==k?(Q=n.jsxs(n.Fragment,{children:[p,k]}),e[83]=p,e[84]=k,e[85]=Q):Q=e[85],Q}function De({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=de(),[d,c]=ce.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},w=o=>{re(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===ae&&l.queryKey[3]===o})},m=o=>{t(),w(o),Y.success("Connection deleted successfully"),c({mode:"idle"}),B?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),m(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),f=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(f);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),m(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(`Failed to delete connection: ${i}`)}}}}export{ue as D,De as u};
1
+ import{c as oe,b as le,j as n,F as se,o as ie,r as ce,t as Y,ba as re,bb as ae}from"./index-bSjz3FLt.js";import{A as z,a as G,b as V,c as X,d as Z,e as ee,f as te,g as ne}from"./alert-dialog-B9G0eJ9-.js";import{u as de}from"./studio-tools-CnY1iRfX.js";function ue(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),w=s.mode==="deleting";let m;e[0]!==a?(m=W=>{W||a()},e[0]=a,e[1]=m):m=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(z,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const H=s.mode==="deleting"&&s.connection.title;let o;e[8]!==H?(o=n.jsx("span",{className:"font-medium text-foreground",children:H}),e[8]=H,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(G,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(V,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let f;e[16]!==t?(f=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=f):f=e[17];let r;e[18]!==f?(r=n.jsx(X,{children:f}),e[18]=f,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let p;e[31]!==w||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:w,onOpenChange:m,children:j}),e[31]=w,e[32]=j,e[33]=m,e[34]=p):p=e[34];const J=s.mode==="force-deleting";let N;e[35]!==a?(N=W=>{W||a()},e[35]=a,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let y;e[39]!==E?(y=n.jsx(z,{children:E}),e[39]=E,e[40]=y):y=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let v;e[43]!==M?(v=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=v):v=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==O||e[50]!==v||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[O," ",v," ",S," ",T,"."]}),e[49]=O,e[50]=v,e[51]=S,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let b;e[56]!==_?(b=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=b):b=e[57];let F;e[58]!==A||e[59]!==b?(F=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,b]})}),e[58]=A,e[59]=b,e[60]=F):F=e[60];let I;e[61]!==y||e[62]!==F?(I=n.jsxs(V,{children:[y,F]}),e[61]=y,e[62]=F,e[63]=I):I=e[63];let L;e[64]!==t?(L=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=L):L=e[65];let R;e[66]!==L?(R=n.jsx(X,{children:L}),e[66]=L,e[67]=R):R=e[67];let q;e[68]!==t?(q=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=q):q=e[69];let U;e[70]!==c||e[71]!==q?(U=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:q}),e[70]=c,e[71]=q,e[72]=U):U=e[72];let K;e[73]!==R||e[74]!==U?(K=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=K):K=e[75];let $;e[76]!==I||e[77]!==K?($=n.jsxs(te,{children:[I,K]}),e[76]=I,e[77]=K,e[78]=$):$=e[78];let k;e[79]!==J||e[80]!==N||e[81]!==$?(k=n.jsx(ne,{open:J,onOpenChange:N,children:$}),e[79]=J,e[80]=N,e[81]=$,e[82]=k):k=e[82];let Q;return e[83]!==p||e[84]!==k?(Q=n.jsxs(n.Fragment,{children:[p,k]}),e[83]=p,e[84]=k,e[85]=Q):Q=e[85],Q}function De({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=de(),[d,c]=ce.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},w=o=>{re(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===ae&&l.queryKey[3]===o})},m=o=>{t(),w(o),Y.success("Connection deleted successfully"),c({mode:"idle"}),B?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),m(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),f=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(f);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),m(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(`Failed to delete connection: ${i}`)}}}}export{ue as D,De as u};
@@ -1 +1 @@
1
- import{c as s,n as m,K as c}from"./index-B1INhWoo.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
1
+ import{c as s,n as m,K as c}from"./index-bSjz3FLt.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
@@ -1 +1 @@
1
- import{c as u,F as c,K as r,n as d,x as y,o as C,e as F}from"./index-B1INhWoo.js";import{u as f}from"./studio-tools-QMuOj6-u.js";function m(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],d(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],F(l)}function _(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],F(l)}export{I as a,q as b,_ as c,m as u};
1
+ import{c as u,F as c,K as r,n as d,x as y,o as C,e as F}from"./index-bSjz3FLt.js";import{u as f}from"./studio-tools-CnY1iRfX.js";function m(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],d(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],F(l)}function _(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],F(l)}export{I as a,q as b,_ as c,m as u};
@@ -1 +1 @@
1
- import{aL as l,e2 as d,e3 as v,r as i}from"./index-B1INhWoo.js";var p=class extends l{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,n.data),hasPreviousPage:d(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function b(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{p as I,b as u};
1
+ import{aM as l,e2 as d,e3 as v,r as i}from"./index-bSjz3FLt.js";var p=class extends l{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,n.data),hasPreviousPage:d(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function b(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{p as I,b as u};
@@ -1 +1 @@
1
- import{c as g,F as N,K as y,n as _,o as A,e as I,t as q}from"./index-B1INhWoo.js";import{a as S}from"./use-capability-CbsdK6kc.js";import{u as O}from"./studio-tools-QMuOj6-u.js";function b(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function K(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{K as a,b as u};
1
+ import{c as g,F as N,K as y,n as _,o as A,e as I,t as q}from"./index-bSjz3FLt.js";import{a as S}from"./use-capability-CamUh6kt.js";import{u as O}from"./studio-tools-CnY1iRfX.js";function b(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function K(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{K as a,b as u};
@@ -1 +1 @@
1
- import{r as R,aC as z,aA as V,j as a,bI as W,ax as x,aB as I,bJ as Y,aD as C,bK as w,bL as J,az as S,bH as Q,bG as X,c as A,b as Z,z as ee,av as oe,F as te,K as re,x as se}from"./index-B1INhWoo.js";import{B as _}from"./badge-DuDSo4B5.js";import{c as k,T as E,a as P,b as ae}from"./tooltip-DvQ0XsJD.js";import{g as ne}from"./index-CtHwx2FP.js";import{s as ie}from"./Eye-Dw90cLwR.js";import{s as ce}from"./Star01-WZXTBc9P.js";import{aL as le}from"./agent-icon-Dx4NCRpv.js";import{i as de}from"./mcp-oauth-BWVH0_CJ.js";var g="Radio",[ue,N]=S(g),[pe,fe]=ue(g),G=R.forwardRef((d,e)=>{const{__scopeRadio:t,name:n,checked:o=!1,required:r,disabled:s,value:i="on",onCheck:c,form:l,...f}=d,[u,v]=R.useState(null),p=I(e,y=>v(y)),m=R.useRef(!1),h=u?l||!!u.closest("form"):!0;return a.jsxs(pe,{scope:t,checked:o,disabled:s,children:[a.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":D(o),"data-disabled":s?"":void 0,disabled:s,value:i,...f,ref:p,onClick:C(d.onClick,y=>{o||c?.(),h&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),h&&a.jsx(K,{control:u,bubbles:!m.current,name:n,value:i,checked:o,required:r,disabled:s,form:l,style:{transform:"translateX(-100%)"}})]})});G.displayName=g;var T="RadioIndicator",L=R.forwardRef((d,e)=>{const{__scopeRadio:t,forceMount:n,...o}=d,r=fe(T,t);return a.jsx(J,{present:n||r.checked,children:a.jsx(x.span,{"data-state":D(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:e})})});L.displayName=T;var ve="RadioBubbleInput",K=R.forwardRef(({__scopeRadio:d,control:e,checked:t,bubbles:n=!0,...o},r)=>{const s=R.useRef(null),i=I(s,r),c=Q(t),l=X(e);return R.useEffect(()=>{const f=s.current;if(!f)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==t&&p){const m=new Event("click",{bubbles:n});p.call(f,t),f.dispatchEvent(m)}},[c,t,n]),a.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});K.displayName=ve;function D(d){return d?"checked":"unchecked"}var me=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b="RadioGroup",[Re]=S(b,[w,N]),O=w(),M=N(),[he,ye]=Re(b),B=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,name:n,defaultValue:o,value:r,required:s=!1,disabled:i=!1,orientation:c,dir:l,loop:f=!0,onValueChange:u,...v}=d,p=O(t),m=z(l),[h,y]=V({prop:r,defaultProp:o??null,onChange:u,caller:b});return a.jsx(he,{scope:t,name:n,required:s,disabled:i,value:h,onValueChange:y,children:a.jsx(W,{asChild:!0,...p,orientation:c,dir:m,loop:f,children:a.jsx(x.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":i?"":void 0,dir:m,...v,ref:e})})})});B.displayName=b;var U="RadioGroupItem",F=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,disabled:n,...o}=d,r=ye(U,t),s=r.disabled||n,i=O(t),c=M(t),l=R.useRef(null),f=I(e,l),u=r.value===o.value,v=R.useRef(!1);return R.useEffect(()=>{const p=h=>{me.includes(h.key)&&(v.current=!0)},m=()=>v.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),a.jsx(Y,{asChild:!0,...i,focusable:!s,active:u,children:a.jsx(G,{disabled:s,required:r.required,checked:u,...c,...o,name:r.name,ref:f,onCheck:()=>r.onValueChange(o.value),onKeyDown:C(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:C(o.onFocus,()=>{v.current&&l.current?.click()})})})});F.displayName=U;var xe="RadioGroupIndicator",H=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,...n}=d,o=M(t);return a.jsx(L,{...o,...n,ref:e})});H.displayName=xe;var we=B,Se=F,Ae=H;const be=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:ie,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:ee,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:oe,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:ce,variant:"outline"}];function Ne(d){const e=A.c(22),{annotations:t,_meta:n}=d,o=Z();let r;e[0]!==n?(r=ne(n),e[0]=n,e[1]=r):r=e[1];const s=!!r;let i,c,l,f,u;if(e[2]!==t||e[3]!==s||e[4]!==o){u=Symbol.for("react.early_return_sentinel");e:{const m=t?be.filter(y=>t[y.key]===!0):[];if(m.length===0&&!s){u=null;break e}i=ae,c="flex gap-1 flex-nowrap",e[10]!==s||e[11]!==o?(l=s&&a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:a.jsx(le,{})})}),a.jsx(P,{children:o("tools.toolsList.interactive")})]}),e[10]=s,e[11]=o,e[12]=l):l=e[12];let h;e[13]!==o?(h=y=>{const{labelKey:j,Icon:q,variant:$}=y;return a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:$,className:"size-6 p-1",children:a.jsx(q,{})})}),a.jsx(P,{children:o(j)})]},j)},e[13]=o,e[14]=h):h=e[14],f=m.map(h)}e[2]=t,e[3]=s,e[4]=o,e[5]=i,e[6]=c,e[7]=l,e[8]=f,e[9]=u}else i=e[5],c=e[6],l=e[7],f=e[8],u=e[9];if(u!==Symbol.for("react.early_return_sentinel"))return u;let v;e[15]!==c||e[16]!==l||e[17]!==f?(v=a.jsxs("div",{className:c,children:[l,f]}),e[15]=c,e[16]=l,e[17]=f,e[18]=v):v=e[18];let p;return e[19]!==i||e[20]!==v?(p=a.jsx(i,{children:v}),e[19]=i,e[20]=v,e[21]=p):p=e[21],p}function Ge(d){const e=A.c(11),{connectionId:t}=d,{org:n}=te();let o,r,s;e[0]!==t||e[1]!==n.slug?(o=new URL(`/api/${n.slug}/mcp/${t}`,window.location.origin),s=se,r=re.isMCPAuthenticated(o.href,null),e[0]=t,e[1]=n.slug,e[2]=o,e[3]=r,e[4]=s):(o=e[2],r=e[3],s=e[4]);let i;e[5]!==o||e[6]!==n.id?(i=()=>de({url:o.href,token:null,orgId:n.id}),e[5]=o,e[6]=n.id,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==i?(c={queryKey:r,queryFn:i},e[8]=r,e[9]=i,e[10]=c):c=e[10];const{data:l}=s(c);return l}export{Se as I,we as R,Ne as T,Ae as a,Ge as u};
1
+ import{r as R,aD as z,aB as V,j as a,bJ as W,ay as x,aC as I,bK as Y,aE as C,bL as P,bM as J,aA as S,bI as Q,bH as X,c as A,b as Z,z as ee,aw as oe,F as te,K as re,x as se}from"./index-bSjz3FLt.js";import{B as _}from"./badge-ClnYkgjJ.js";import{c as k,T as E,a as w,b as ae}from"./tooltip-Bfr58shw.js";import{g as ne}from"./index-r7ibRdki.js";import{s as ie}from"./Eye-DydEPicd.js";import{s as ce}from"./Star01-BetPRMOP.js";import{aL as le}from"./agent-icon-DvITB4KO.js";import{i as de}from"./mcp-oauth-CFh8Fy0x.js";var g="Radio",[ue,N]=S(g),[pe,fe]=ue(g),T=R.forwardRef((d,e)=>{const{__scopeRadio:t,name:n,checked:o=!1,required:r,disabled:s,value:i="on",onCheck:c,form:l,...f}=d,[u,v]=R.useState(null),p=I(e,h=>v(h)),m=R.useRef(!1),y=u?l||!!u.closest("form"):!0;return a.jsxs(pe,{scope:t,checked:o,disabled:s,children:[a.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":D(o),"data-disabled":s?"":void 0,disabled:s,value:i,...f,ref:p,onClick:C(d.onClick,h=>{o||c?.(),y&&(m.current=h.isPropagationStopped(),m.current||h.stopPropagation())})}),y&&a.jsx(K,{control:u,bubbles:!m.current,name:n,value:i,checked:o,required:r,disabled:s,form:l,style:{transform:"translateX(-100%)"}})]})});T.displayName=g;var G="RadioIndicator",L=R.forwardRef((d,e)=>{const{__scopeRadio:t,forceMount:n,...o}=d,r=fe(G,t);return a.jsx(J,{present:n||r.checked,children:a.jsx(x.span,{"data-state":D(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:e})})});L.displayName=G;var ve="RadioBubbleInput",K=R.forwardRef(({__scopeRadio:d,control:e,checked:t,bubbles:n=!0,...o},r)=>{const s=R.useRef(null),i=I(s,r),c=Q(t),l=X(e);return R.useEffect(()=>{const f=s.current;if(!f)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==t&&p){const m=new Event("click",{bubbles:n});p.call(f,t),f.dispatchEvent(m)}},[c,t,n]),a.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});K.displayName=ve;function D(d){return d?"checked":"unchecked"}var me=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b="RadioGroup",[Re]=S(b,[P,N]),M=P(),O=N(),[ye,he]=Re(b),B=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,name:n,defaultValue:o,value:r,required:s=!1,disabled:i=!1,orientation:c,dir:l,loop:f=!0,onValueChange:u,...v}=d,p=M(t),m=z(l),[y,h]=V({prop:r,defaultProp:o??null,onChange:u,caller:b});return a.jsx(ye,{scope:t,name:n,required:s,disabled:i,value:y,onValueChange:h,children:a.jsx(W,{asChild:!0,...p,orientation:c,dir:m,loop:f,children:a.jsx(x.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":i?"":void 0,dir:m,...v,ref:e})})})});B.displayName=b;var U="RadioGroupItem",F=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,disabled:n,...o}=d,r=he(U,t),s=r.disabled||n,i=M(t),c=O(t),l=R.useRef(null),f=I(e,l),u=r.value===o.value,v=R.useRef(!1);return R.useEffect(()=>{const p=y=>{me.includes(y.key)&&(v.current=!0)},m=()=>v.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),a.jsx(Y,{asChild:!0,...i,focusable:!s,active:u,children:a.jsx(T,{disabled:s,required:r.required,checked:u,...c,...o,name:r.name,ref:f,onCheck:()=>r.onValueChange(o.value),onKeyDown:C(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:C(o.onFocus,()=>{v.current&&l.current?.click()})})})});F.displayName=U;var xe="RadioGroupIndicator",H=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,...n}=d,o=O(t);return a.jsx(L,{...o,...n,ref:e})});H.displayName=xe;var Pe=B,Se=F,Ae=H;const be=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:ie,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:ee,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:oe,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:ce,variant:"outline"}];function Ne(d){const e=A.c(22),{annotations:t,_meta:n}=d,o=Z();let r;e[0]!==n?(r=ne(n),e[0]=n,e[1]=r):r=e[1];const s=!!r;let i,c,l,f,u;if(e[2]!==t||e[3]!==s||e[4]!==o){u=Symbol.for("react.early_return_sentinel");e:{const m=t?be.filter(h=>t[h.key]===!0):[];if(m.length===0&&!s){u=null;break e}i=ae,c="flex gap-1 flex-nowrap",e[10]!==s||e[11]!==o?(l=s&&a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:a.jsx(le,{})})}),a.jsx(w,{children:o("tools.toolsList.interactive")})]}),e[10]=s,e[11]=o,e[12]=l):l=e[12];let y;e[13]!==o?(y=h=>{const{labelKey:j,Icon:q,variant:$}=h;return a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:$,className:"size-6 p-1",children:a.jsx(q,{})})}),a.jsx(w,{children:o(j)})]},j)},e[13]=o,e[14]=y):y=e[14],f=m.map(y)}e[2]=t,e[3]=s,e[4]=o,e[5]=i,e[6]=c,e[7]=l,e[8]=f,e[9]=u}else i=e[5],c=e[6],l=e[7],f=e[8],u=e[9];if(u!==Symbol.for("react.early_return_sentinel"))return u;let v;e[15]!==c||e[16]!==l||e[17]!==f?(v=a.jsxs("div",{className:c,children:[l,f]}),e[15]=c,e[16]=l,e[17]=f,e[18]=v):v=e[18];let p;return e[19]!==i||e[20]!==v?(p=a.jsx(i,{children:v}),e[19]=i,e[20]=v,e[21]=p):p=e[21],p}function Te(d){const e=A.c(11),{connectionId:t}=d,{org:n}=te();let o,r,s;e[0]!==t||e[1]!==n.slug?(o=new URL(`/api/${n.slug}/mcp/${t}`,window.location.origin),s=se,r=re.isMCPAuthenticated(o.href,null),e[0]=t,e[1]=n.slug,e[2]=o,e[3]=r,e[4]=s):(o=e[2],r=e[3],s=e[4]);let i;e[5]!==o||e[6]!==n.id?(i=()=>de({url:o.href,token:null,orgId:n.id}),e[5]=o,e[6]=n.id,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==i?(c={queryKey:r,queryFn:i},e[8]=r,e[9]=i,e[10]=c):c=e[10];const{data:l}=s(c);return l}export{Se as I,Pe as R,Ne as T,Ae as a,Te as u};
@@ -1,4 +1,4 @@
1
- import{dd as fe,de as pe,df as me,cf as _e,dg as ge,bU as _,bV as w,dh as we,di as Te,dj as ye,dk as $,dl as ve,dm as V,dn as ke,dp as M,dq as Se,dr as G,ds as Re,dt as Ce,du as Ee,dv as W,bw as be,by as Ie,bt as Ae,ca as re,cm as qe,cs as Me,cq as Pe,cJ as Oe,dw as $e,dx as Ne,dy as N,dz as He,dA as Ue,cr as De,cn as xe,co as je,cp as Fe,bu as Le,dB as Ve,dC as Ge,dD as ze,ch as Qe,dE as Ke,dF as We,cF as D,dG as Je,bs as j,c as oe,x as ae,K as Q}from"./index-B1INhWoo.js";import{U as P,a as H,e as J}from"./auth-B6HaqNKN.js";const It={SELF:a=>`${a}_self`,REGISTRY:a=>`${a}_registry`,COMMUNITY_REGISTRY:a=>`${a}_community-registry`,DEV_ASSETS:a=>`${a}_dev-assets`,SITE_DIAGNOSTICS:a=>`site-diagnostics_${a}`,COMMERCE_DISCOVERY:a=>`${a}_commerce-discovery`},At="get_my_diagnostic",qt="https://github.com/decocms.png",Ye="self";function R(a){return{is(e){return!e||!e.startsWith(a)?null:e.slice(a.length)||null},get(e){return`${a}${e}`}}}function Be(a){return{id:a.id,organization_id:a.organizationId,title:a.title,description:a.description,icon:a.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:a.instructions??null,...a.ui?{ui:a.ui}:{}},pinned:!1,connections:[]}}const ne=R("decopilot_"),Mt=ne.is,Ze=ne.get,ie=R("dev_"),Pt=ie.get,Ot=ie.is,Xe="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",$t="https://api.iconify.design/lucide:shield-check.svg?color=%2316a34a",Nt="https://api.iconify.design/lucide:file-search.svg?color=%236366f1";function Ht(a){return Be({id:Ze(a),organizationId:a,title:"Super Agent",description:"Default agent that aggregates all organization connections",icon:Xe,ui:{layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}})}const et=R("commerce-discovery_"),Ut=et.get,C={AGENT_MANAGER:R("studio-agent-manager_"),AUTOMATION_MANAGER:R("studio-automation-manager_"),CONNECTION_MANAGER:R("studio-connection-manager_"),API_KEY_MANAGER:R("studio-api-key-manager_"),STORE_MANAGER:R("studio-store-manager_"),BRAND_MANAGER:R("studio-brand-manager_"),TASK_MANAGER:R("studio-task-manager_"),USAGE_MANAGER:R("studio-usage-manager_")},Dt={AGENT_MANAGER:C.AGENT_MANAGER.get,AUTOMATION_MANAGER:C.AUTOMATION_MANAGER.get,CONNECTION_MANAGER:C.CONNECTION_MANAGER.get,API_KEY_MANAGER:C.API_KEY_MANAGER.get,STORE_MANAGER:C.STORE_MANAGER.get,BRAND_MANAGER:C.BRAND_MANAGER.get,TASK_MANAGER:C.TASK_MANAGER.get,USAGE_MANAGER:C.USAGE_MANAGER.get};function xt(a){return a?Object.values(C).some(e=>e.is(a)!==null):!1}function x(a){return!!a._zod}function b(a,e){return x(a)?fe(a,e):a.safeParse(e)}function ce(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function tt(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function I(a){return a==="completed"||a==="failed"||a==="cancelled"}function Y(a){const t=ce(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=tt(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const st=6e4;class rt{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(pe,t=>{this._oncancel(t)}),this.setNotificationHandler(me,t=>{this._onprogress(t)}),this.setRequestHandler(_e,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(ge,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(we,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(w.InvalidParams,`Task not found: ${o}`);if(!I(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(I(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[M]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(Te,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(ye,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(I(r.status))throw new _(w.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(w.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),$(o)||ve(o)?this._onresponse(o):V(o)?this._onrequest(o,n):ke(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[M]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=Se(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(w.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),$(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if($(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),$(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(w.InternalError,String(n))}}return}let o;try{const n=await this.request(e,G,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},I(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(w.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(w.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[M]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const g=c instanceof _?c:new _(w.RequestTimeout,String(c));l(g)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const g=b(t,c.result);g.success?p(g.data):l(g.error)}catch(g){l(g)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??st,v=()=>T(_.fromError(w.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,v,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=g=>{const k=this._responseHandlers.get(f);k?k(g):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(g=>{this._cleanupTimeout(f),l(g)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Re,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},Ce,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Ee,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[M]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[M]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[M]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=Y(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=Y(e);this._notificationHandlers.set(s,r=>{const o=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&V(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(w.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),I(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(I(i.status))throw new _(w.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),I(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function ot(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var at=Ie();const nt=be(at);function it(){const a=new nt({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ae(a),a}class ct{constructor(e){this._ajv=e??it()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class lt{constructor(e){this._client=e}async*callToolStream(e,t=re,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(w.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ut(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function dt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function U(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&U(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&U(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&U(t,e)}}function ht(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let ft=class extends rt{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new ct,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",qe,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Me,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Pe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new lt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=ot(this._capabilities,e)}setRequestHandler(e,t){const r=ce(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(Ge,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=ht(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(w.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(w.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(G,T);if(!c.success){const g=c.error instanceof Error?c.error.message:String(c.error);throw new _(w.InvalidParams,`Invalid task creation result: ${g}`)}return c.data}const y=b(ze,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(w.InvalidParams,`Invalid elicitation result: ${c}`)}const v=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&v.action==="accept"&&v.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{U(h,v.content)}catch{}return v};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Qe,u);if(!l.success){const v=l.error instanceof Error?l.error.message:String(l.error);throw new _(w.InvalidParams,`Invalid sampling request: ${v}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const v=b(G,f);if(!v.success){const h=v.error instanceof Error?v.error.message:String(v.error);throw new _(w.InvalidParams,`Invalid task creation result: ${h}`)}return v.data}const T=d.tools||d.toolChoice?Ke:We,y=b(T,f);if(!y.success){const v=y.error instanceof Error?y.error.message:String(y.error);throw new _(w.InvalidParams,`Invalid sampling result: ${v}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Oe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Ne.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){ut(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&dt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},N,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},He,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},N,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ue,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},De,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},xe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},je,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Fe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},N,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},N,t)}async callTool(e,t=re,s){if(this.isToolTaskRequired(e.name))throw new _(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(w.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Le,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ve.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const F=a=>[{type:"text",text:a}];function pt(a){const e=D(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:F(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:F(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:F(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function z(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function mt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...z(e.headers),...z(s.headers)}:e.headers};return a(t,r)}:a}class X extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const ee=10,_t=13,A=32;function L(a){}function gt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=L,onError:t=L,onRetry:s=L,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const k=f(h);k!==""&&o.push(k);return}if(h.indexOf(`
1
+ import{dd as fe,de as pe,df as me,cf as _e,dg as ge,bU as _,bV as w,dh as we,di as Te,dj as ye,dk as $,dl as ve,dm as V,dn as ke,dp as M,dq as Se,dr as G,ds as Re,dt as Ce,du as Ee,dv as W,bx as be,bz as Ie,bu as Ae,ca as re,cm as qe,cs as Me,cq as Pe,cJ as Oe,dw as $e,dx as Ne,dy as N,dz as He,dA as Ue,cr as De,cn as xe,co as je,cp as Fe,bv as Le,dB as Ve,dC as Ge,dD as ze,ch as Qe,dE as Ke,dF as We,cF as D,dG as Je,bt as j,c as oe,x as ae,K as Q}from"./index-bSjz3FLt.js";import{U as P,a as H,e as J}from"./auth-C7EjAKuK.js";const It={SELF:a=>`${a}_self`,REGISTRY:a=>`${a}_registry`,COMMUNITY_REGISTRY:a=>`${a}_community-registry`,DEV_ASSETS:a=>`${a}_dev-assets`,SITE_DIAGNOSTICS:a=>`site-diagnostics_${a}`,COMMERCE_DISCOVERY:a=>`${a}_commerce-discovery`},At="get_my_diagnostic",qt="https://github.com/decocms.png",Ye="self";function R(a){return{is(e){return!e||!e.startsWith(a)?null:e.slice(a.length)||null},get(e){return`${a}${e}`}}}function Be(a){return{id:a.id,organization_id:a.organizationId,title:a.title,description:a.description,icon:a.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:a.instructions??null,...a.ui?{ui:a.ui}:{}},pinned:!1,connections:[]}}const ne=R("decopilot_"),Mt=ne.is,Ze=ne.get,ie=R("dev_"),Pt=ie.get,Ot=ie.is,Xe="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",$t="https://api.iconify.design/lucide:shield-check.svg?color=%2316a34a",Nt="https://api.iconify.design/lucide:file-search.svg?color=%236366f1";function Ht(a){return Be({id:Ze(a),organizationId:a,title:"Super Agent",description:"Default agent that aggregates all organization connections",icon:Xe,ui:{layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}})}const et=R("commerce-discovery_"),Ut=et.get,C={AGENT_MANAGER:R("studio-agent-manager_"),AUTOMATION_MANAGER:R("studio-automation-manager_"),CONNECTION_MANAGER:R("studio-connection-manager_"),API_KEY_MANAGER:R("studio-api-key-manager_"),STORE_MANAGER:R("studio-store-manager_"),BRAND_MANAGER:R("studio-brand-manager_"),TASK_MANAGER:R("studio-task-manager_"),USAGE_MANAGER:R("studio-usage-manager_")},Dt={AGENT_MANAGER:C.AGENT_MANAGER.get,AUTOMATION_MANAGER:C.AUTOMATION_MANAGER.get,CONNECTION_MANAGER:C.CONNECTION_MANAGER.get,API_KEY_MANAGER:C.API_KEY_MANAGER.get,STORE_MANAGER:C.STORE_MANAGER.get,BRAND_MANAGER:C.BRAND_MANAGER.get,TASK_MANAGER:C.TASK_MANAGER.get,USAGE_MANAGER:C.USAGE_MANAGER.get};function xt(a){return a?Object.values(C).some(e=>e.is(a)!==null):!1}function x(a){return!!a._zod}function b(a,e){return x(a)?fe(a,e):a.safeParse(e)}function ce(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function tt(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function I(a){return a==="completed"||a==="failed"||a==="cancelled"}function Y(a){const t=ce(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=tt(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const st=6e4;class rt{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(pe,t=>{this._oncancel(t)}),this.setNotificationHandler(me,t=>{this._onprogress(t)}),this.setRequestHandler(_e,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(ge,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(we,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new _(w.InvalidParams,`Task not found: ${o}`);if(!I(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(I(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[M]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(Te,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new _(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(ye,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(I(r.status))throw new _(w.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new _(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(w.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),$(o)||ve(o)?this._onresponse(o):V(o)?this._onrequest(o,n):ke(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[M]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=Se(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(w.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),$(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if($(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),$(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(w.InternalError,String(n))}}return}let o;try{const n=await this.request(e,G,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},I(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new _(w.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(w.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[M]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const g=c instanceof _?c:new _(w.RequestTimeout,String(c));l(g)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const g=b(t,c.result);g.success?p(g.data):l(g.error)}catch(g){l(g)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??st,v=()=>T(_.fromError(w.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,v,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=g=>{const k=this._responseHandlers.get(f);k?k(g):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(g=>{this._cleanupTimeout(f),l(g)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Re,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},Ce,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Ee,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[M]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[M]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[M]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=Y(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=Y(e);this._notificationHandlers.set(s,r=>{const o=B(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&V(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new _(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new _(w.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),I(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(I(i.status))throw new _(w.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),I(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function ot(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var at=Ie();const nt=be(at);function it(){const a=new nt({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ae(a),a}class ct{constructor(e){this._ajv=e??it()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class lt{constructor(e){this._client=e}async*callToolStream(e,t=re,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(w.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ut(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function dt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function U(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&U(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&U(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&U(t,e)}}function ht(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let ft=class extends rt{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new ct,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",qe,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Me,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Pe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new lt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=ot(this._capabilities,e)}setRequestHandler(e,t){const r=ce(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(Ge,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=ht(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(w.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(w.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(G,T);if(!c.success){const g=c.error instanceof Error?c.error.message:String(c.error);throw new _(w.InvalidParams,`Invalid task creation result: ${g}`)}return c.data}const y=b(ze,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(w.InvalidParams,`Invalid elicitation result: ${c}`)}const v=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&v.action==="accept"&&v.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{U(h,v.content)}catch{}return v};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Qe,u);if(!l.success){const v=l.error instanceof Error?l.error.message:String(l.error);throw new _(w.InvalidParams,`Invalid sampling request: ${v}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const v=b(G,f);if(!v.success){const h=v.error instanceof Error?v.error.message:String(v.error);throw new _(w.InvalidParams,`Invalid task creation result: ${h}`)}return v.data}const T=d.tools||d.toolChoice?Ke:We,y=b(T,f);if(!y.success){const v=y.error instanceof Error?y.error.message:String(y.error);throw new _(w.InvalidParams,`Invalid sampling result: ${v}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Oe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Ne.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){ut(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&dt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},N,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},He,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},N,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ue,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},De,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},xe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},je,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Fe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},N,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},N,t)}async callTool(e,t=re,s){if(this.isToolTaskRequired(e.name))throw new _(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new _(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new _(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(w.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Le,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ve.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const F=a=>[{type:"text",text:a}];function pt(a){const e=D(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:F(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:F(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:F(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function z(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function mt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...z(e.headers),...z(s.headers)}:e.headers};return a(t,r)}:a}class X extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const ee=10,_t=13,A=32;function L(a){}function gt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=L,onError:t=L,onRetry:s=L,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const k=f(h);k!==""&&o.push(k);return}if(h.indexOf(`
2
2
  `)===-1&&h.indexOf("\r")===-1){o.push(h);return}o.push(h);const c=o.join("");o.length=0;const g=f(c);g!==""&&o.push(g)}function f(h){let c=0;if(h.indexOf("\r")===-1){let g=h.indexOf(`
3
3
  `,c);for(;g!==-1;){if(c===g){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=g+1,g=h.indexOf(`
4
4
  `,c);continue}const k=h.charCodeAt(c);if(te(h,c,k)){const S=h.charCodeAt(c+5)===A?c+6:c+5,E=h.slice(S,g);if(p===0&&h.charCodeAt(g+1)===ee){e({id:i,event:l,data:E}),i=void 0,u="",l=void 0,c=g+2,g=h.indexOf(`
@@ -1 +1 @@
1
- import{c as m,n as p,x as q,K as T}from"./index-B1INhWoo.js";function C(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],q(i)}function K(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],p(i)}function O(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,w as u};
1
+ import{c as m,n as p,x as q,K as T}from"./index-bSjz3FLt.js";function C(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],q(i)}function K(r){const e=m.c(12);let t,o;e[0]!==r?({client:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const n=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==n?(i={...o,queryKey:l,queryFn:s,staleTime:n,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=n,e[11]=i):i=e[11],p(i)}function O(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(r){const e=m.c(21);let t,o,l,s;e[0]!==r?({client:t,toolName:s,toolArguments:l,...o}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let n,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,n=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==a||e[19]!==y?(c={...n,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,w as u};
@@ -1 +1 @@
1
- import{c,F as m,x as b,K as f,n as M}from"./index-B1INhWoo.js";import{u as y}from"./use-org-auth-client-xlorPrK7.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{q as a,d as u};
1
+ import{c,F as m,x as b,K as f,n as M}from"./index-bSjz3FLt.js";import{u as y}from"./use-org-auth-client-BbxxaMLu.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],b(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],M(l)}export{q as a,d as u};
@@ -1 +1 @@
1
- import{c as m,r}from"./index-B1INhWoo.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
1
+ import{c as m,r}from"./index-bSjz3FLt.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
@@ -1 +1 @@
1
- import{G as y,r as c,c as b,j as A,d as C,F as E,a as $}from"./index-B1INhWoo.js";import{a as _}from"./use-virtual-mcp-CRbRiAY-.js";import{c as G}from"./hooks-D1TjgNd-.js";import{f as P}from"./reusable-new-chat-CouMjkYR.js";const h=new Map;function I(e){return`${e.orgId}:${e.userId}`}function w(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(s=>typeof s=="string"):[]}catch{return[]}}function N(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function U(e){const t=I(e),r=h.get(t);if(r)return r;const s=y.sidebarGroupOrder(e.orgId,e.userId);let a=!1;try{a=localStorage.getItem(s)!==null}catch{}let o=O(s);if(!a&&o.length===0&&e.userId!=="anon"){const i=O(w(e.orgId));i.length>0&&(o=i)}return h.set(t,o),o}function T(e,t){const r=new Set(t);return U(e).filter(s=>!r.has(s))}function j(e,t){h.set(I(e),t),N(y.sidebarGroupOrder(e.orgId,e.userId),t)}function K(e,t,r=[]){if(r.includes(t))return;const s=T(e,r);s.includes(t)||j(e,[t,...s])}const S=c.createContext(null);function Q(e){const t=b.c(7),{children:r}=e,[s,a]=c.useState(!1),[o,i]=c.useState(0);let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>i(k),t[0]=d):d=t[0];const l=d;let n;t[1]!==s||t[2]!==o?(n={empty:s,setEmpty:a,orderRevision:o,bumpOrderRevision:l},t[1]=s,t[2]=o,t[3]=n):n=t[3];let u;return t[4]!==r||t[5]!==n?(u=A.jsx(S.Provider,{value:n,children:r}),t[4]=r,t[5]=n,t[6]=u):u=t[6],u}function k(e){return e+1}function W(){return c.useContext(S)?.empty??!1}function D(){return c.useContext(S)?.bumpOrderRevision??J}function J(){}const v=[],L=()=>()=>{};function B(e){return(e??[]).filter(t=>!!t.pinned).map(t=>t.id)}function X(){const e=b.c(15),t=C(),{org:r}=E(),s=_(),{data:a}=$.useSession(),o=a?.user?.id??"anon";let i;e[0]!==s?(i=B(s),e[0]=s,e[1]=i):i=e[1];const d=i,l=D(),n=G();let u;e[2]!==n?.threads.get?(u=n?.threads.get??H,e[2]=n?.threads.get,e[3]=u):u=e[3];let f;e[4]!==n?.threads.get?(f=n?.threads.get??F,e[4]=n?.threads.get,e[5]=f):f=e[5];const m=c.useSyncExternalStore(n?.threads.subscribe??L,u,f);let g;return e[6]!==l||e[7]!==t||e[8]!==r.id||e[9]!==r.slug||e[10]!==d||e[11]!==a?.user?.id||e[12]!==o||e[13]!==m?(g=(p,x)=>{K({orgId:r.id,userId:o},p,d),l();const R=P(m,p,a?.user?.id)?.id??crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:R},search:{...x?.search??{},virtualmcpid:p}})},e[6]=l,e[7]=t,e[8]=r.id,e[9]=r.slug,e[10]=d,e[11]=a?.user?.id,e[12]=o,e[13]=m,e[14]=g):g=e[14],g}function F(){return v}function H(){return v}export{Q as S,D as a,K as b,X as c,B as g,W as u};
1
+ import{G as y,r as c,c as b,j as A,d as C,F as E,a as $}from"./index-bSjz3FLt.js";import{a as _}from"./use-virtual-mcp-Bujf-aIR.js";import{c as G}from"./hooks-Bva17Au4.js";import{f as P}from"./reusable-new-chat-CouMjkYR.js";const h=new Map;function I(e){return`${e.orgId}:${e.userId}`}function w(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(s=>typeof s=="string"):[]}catch{return[]}}function N(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function U(e){const t=I(e),r=h.get(t);if(r)return r;const s=y.sidebarGroupOrder(e.orgId,e.userId);let a=!1;try{a=localStorage.getItem(s)!==null}catch{}let o=O(s);if(!a&&o.length===0&&e.userId!=="anon"){const i=O(w(e.orgId));i.length>0&&(o=i)}return h.set(t,o),o}function T(e,t){const r=new Set(t);return U(e).filter(s=>!r.has(s))}function j(e,t){h.set(I(e),t),N(y.sidebarGroupOrder(e.orgId,e.userId),t)}function K(e,t,r=[]){if(r.includes(t))return;const s=T(e,r);s.includes(t)||j(e,[t,...s])}const S=c.createContext(null);function Q(e){const t=b.c(7),{children:r}=e,[s,a]=c.useState(!1),[o,i]=c.useState(0);let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>i(k),t[0]=d):d=t[0];const l=d;let n;t[1]!==s||t[2]!==o?(n={empty:s,setEmpty:a,orderRevision:o,bumpOrderRevision:l},t[1]=s,t[2]=o,t[3]=n):n=t[3];let u;return t[4]!==r||t[5]!==n?(u=A.jsx(S.Provider,{value:n,children:r}),t[4]=r,t[5]=n,t[6]=u):u=t[6],u}function k(e){return e+1}function W(){return c.useContext(S)?.empty??!1}function D(){return c.useContext(S)?.bumpOrderRevision??J}function J(){}const v=[],L=()=>()=>{};function B(e){return(e??[]).filter(t=>!!t.pinned).map(t=>t.id)}function X(){const e=b.c(15),t=C(),{org:r}=E(),s=_(),{data:a}=$.useSession(),o=a?.user?.id??"anon";let i;e[0]!==s?(i=B(s),e[0]=s,e[1]=i):i=e[1];const d=i,l=D(),n=G();let u;e[2]!==n?.threads.get?(u=n?.threads.get??H,e[2]=n?.threads.get,e[3]=u):u=e[3];let f;e[4]!==n?.threads.get?(f=n?.threads.get??F,e[4]=n?.threads.get,e[5]=f):f=e[5];const m=c.useSyncExternalStore(n?.threads.subscribe??L,u,f);let g;return e[6]!==l||e[7]!==t||e[8]!==r.id||e[9]!==r.slug||e[10]!==d||e[11]!==a?.user?.id||e[12]!==o||e[13]!==m?(g=(p,x)=>{K({orgId:r.id,userId:o},p,d),l();const R=P(m,p,a?.user?.id)?.id??crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:R},search:{...x?.search??{},virtualmcpid:p}})},e[6]=l,e[7]=t,e[8]=r.id,e[9]=r.slug,e[10]=d,e[11]=a?.user?.id,e[12]=o,e[13]=m,e[14]=g):g=e[14],g}function F(){return v}function H(){return v}export{Q as S,D as a,K as b,X as c,B as g,W as u};
@@ -1 +1 @@
1
- import{c as x,F as j,a as i}from"./index-B1INhWoo.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
1
+ import{c as x,F as j,a as i}from"./index-bSjz3FLt.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
@@ -1 +1 @@
1
- import{c as u,n as S,o as r,e as y,K as c}from"./index-B1INhWoo.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function m(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{C as a,O as b,m as c,h as d,q as u};
1
+ import{c as u,n as S,o as r,e as y,K as c}from"./index-bSjz3FLt.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function m(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{C as a,O as b,m as c,h as d,q as u};
@@ -1 +1 @@
1
- import{u as R}from"./use-org-auth-client-xlorPrK7.js";import{F as b,n as P,K as y}from"./index-B1INhWoo.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
1
+ import{u as R}from"./use-org-auth-client-BbxxaMLu.js";import{F as b,n as P,K as y}from"./index-bSjz3FLt.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
@@ -1 +1 @@
1
- import{c as l,F as y,n as E,K as _,o as I,e as M,r as R}from"./index-B1INhWoo.js";import{W as D}from"./use-mcp-client-Cpe5VVFd.js";import{c as b,u as G}from"./studio-tools-QMuOj6-u.js";const O={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null,main_agent_id:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function $(t,e){return{queryKey:_.organizationSettings(e),queryFn:async()=>{try{return await b(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...O,organizationId:e}}},staleTime:6e4}}function m(t){const e=l.c(6),{org:s}=y();let n;e[0]!==s.id||e[1]!==s.slug?(n=$(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const i=t;let a;return e[3]!==n||e[4]!==i?(a={...n,select:i},e[3]=n,e[4]=i,e[5]=a):a=e[5],E(a)}function Z(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=$(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:i}=E(n);return i??null}function f(){const t=l.c(9),{org:e}=y(),s=G(),n=I();let i;t[0]!==e||t[1]!==s?(i=async r=>{const o=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...r});if(!o)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return o},t[0]=e,t[1]=s,t[2]=i):i=t[2];let a;t[3]!==e||t[4]!==n?(a=r=>{n.setQueryData(_.organizationSettings(e.id),o=>({...o??O,...r}))},t[3]=e,t[4]=n,t[5]=a):a=t[5];let u;return t[6]!==i||t[7]!==a?(u={mutationFn:i,onSuccess:a},t[6]=i,t[7]=a,t[8]=u):u=t[8],M(u)}function P(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:N}function j(){const{data:t}=m(Q);return t??N}function Q(t){return P(t.simple_mode)}function B(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({simple_mode:a},u),n=(a,u)=>e.mutateAsync({simple_mode:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function L(){return C("reports_only")}function C(t){const e=l.c(2);let s;e[0]!==t?(s=i=>i.flags?.[t]??!1,e[0]=t,e[1]=s):s=e[1];const{data:n}=m(s);return n??!1}function v(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u,r)=>e.mutate({flags:{[a]:u}},r),n=(a,u,r)=>e.mutateAsync({flags:{[a]:u}},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function k(){const{data:t}=m(x);return t??null}function x(t){return t.registry_config}function J(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({registry_config:a},u),n=(a,u)=>e.mutateAsync({registry_config:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function V(){const{data:t}=m(U);return t??null}function U(t){return t.default_home_agents}function q(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({default_home_agents:a},u),n=(a,u)=>e.mutateAsync({default_home_agents:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function X(){const t=l.c(14),{org:e}=y(),s=q(),n=I();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Promise.resolve(),t[0]=i):i=t[0];const a=R.useRef(i);let u;t[1]!==e.id?(u=_.organizationSettings(e.id),t[1]=e.id,t[2]=u):u=t[2];const r=u;let o;t[3]!==r||t[4]!==n?(o=()=>n.getQueryData(r)?.default_home_agents?.ids??[],t[3]=r,t[4]=n,t[5]=o):o=t[5];const p=o;let g;t[6]!==r||t[7]!==e.slug||t[8]!==n||t[9]!==s?(g=w=>{const S=a.current.then(async()=>{const T=n.getQueryData(r),A=w(T?.default_home_agents?.ids??[]);if(A!==null){n.setQueryData(r,c=>c&&{...c,default_home_agents:{ids:A}});try{await s.mutateAsync({ids:A}),await n.refetchQueries({queryKey:_.homeNextActions(e.slug),type:"active"})}catch(c){const z=c;throw n.setQueryData(r,T),z}}});return a.current=S.catch(F),S},t[6]=r,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=g):g=t[10];const h=g;let d;return t[11]!==h||t[12]!==p?(d={currentIds:p,apply:h},t[11]=h,t[12]=p,t[13]=d):d=t[13],d}function F(){}function tt(){const t=l.c(3),{data:e,isPending:s}=m(K),n=e??null;let i;return t[0]!==s||t[1]!==n?(i={mainAgentId:n,isPending:s},t[0]=s,t[1]=n,t[2]=i):i=t[2],i}function K(t){return t.main_agent_id??null}function et(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({main_agent_id:a},u),n=(a,u)=>e.mutateAsync({main_agent_id:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function nt(){const t=l.c(5),{org:e}=y(),s=k();let n;t[0]!==e.id?(n=D.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const i=n;let a;return t[2]!==i||t[3]!==s?(a=u=>{if(!s)return u===i;const r=s.registries[u];return r?r.enabled:u===i},t[2]=i,t[3]=s,t[4]=a):a=t[4],a}export{L as a,j as b,V as c,X as d,tt as e,nt as f,Z as g,et as h,v as i,B as j,k,J as l,C as u};
1
+ import{c as l,F as y,n as E,K as _,o as I,e as M,r as R}from"./index-bSjz3FLt.js";import{W as D}from"./use-mcp-client-BcyA1fq6.js";import{c as b,u as G}from"./studio-tools-CnY1iRfX.js";const O={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null,main_agent_id:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function $(t,e){return{queryKey:_.organizationSettings(e),queryFn:async()=>{try{return await b(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...O,organizationId:e}}},staleTime:6e4}}function m(t){const e=l.c(6),{org:s}=y();let n;e[0]!==s.id||e[1]!==s.slug?(n=$(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const i=t;let a;return e[3]!==n||e[4]!==i?(a={...n,select:i},e[3]=n,e[4]=i,e[5]=a):a=e[5],E(a)}function Z(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=$(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:i}=E(n);return i??null}function f(){const t=l.c(9),{org:e}=y(),s=G(),n=I();let i;t[0]!==e||t[1]!==s?(i=async r=>{const o=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...r});if(!o)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return o},t[0]=e,t[1]=s,t[2]=i):i=t[2];let a;t[3]!==e||t[4]!==n?(a=r=>{n.setQueryData(_.organizationSettings(e.id),o=>({...o??O,...r}))},t[3]=e,t[4]=n,t[5]=a):a=t[5];let u;return t[6]!==i||t[7]!==a?(u={mutationFn:i,onSuccess:a},t[6]=i,t[7]=a,t[8]=u):u=t[8],M(u)}function P(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:N}function j(){const{data:t}=m(Q);return t??N}function Q(t){return P(t.simple_mode)}function B(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({simple_mode:a},u),n=(a,u)=>e.mutateAsync({simple_mode:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function L(){return C("reports_only")}function C(t){const e=l.c(2);let s;e[0]!==t?(s=i=>i.flags?.[t]??!1,e[0]=t,e[1]=s):s=e[1];const{data:n}=m(s);return n??!1}function v(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u,r)=>e.mutate({flags:{[a]:u}},r),n=(a,u,r)=>e.mutateAsync({flags:{[a]:u}},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function k(){const{data:t}=m(x);return t??null}function x(t){return t.registry_config}function J(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({registry_config:a},u),n=(a,u)=>e.mutateAsync({registry_config:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function V(){const{data:t}=m(U);return t??null}function U(t){return t.default_home_agents}function q(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({default_home_agents:a},u),n=(a,u)=>e.mutateAsync({default_home_agents:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function X(){const t=l.c(14),{org:e}=y(),s=q(),n=I();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Promise.resolve(),t[0]=i):i=t[0];const a=R.useRef(i);let u;t[1]!==e.id?(u=_.organizationSettings(e.id),t[1]=e.id,t[2]=u):u=t[2];const r=u;let o;t[3]!==r||t[4]!==n?(o=()=>n.getQueryData(r)?.default_home_agents?.ids??[],t[3]=r,t[4]=n,t[5]=o):o=t[5];const p=o;let g;t[6]!==r||t[7]!==e.slug||t[8]!==n||t[9]!==s?(g=w=>{const S=a.current.then(async()=>{const T=n.getQueryData(r),A=w(T?.default_home_agents?.ids??[]);if(A!==null){n.setQueryData(r,c=>c&&{...c,default_home_agents:{ids:A}});try{await s.mutateAsync({ids:A}),await n.refetchQueries({queryKey:_.homeNextActions(e.slug),type:"active"})}catch(c){const z=c;throw n.setQueryData(r,T),z}}});return a.current=S.catch(F),S},t[6]=r,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=g):g=t[10];const h=g;let d;return t[11]!==h||t[12]!==p?(d={currentIds:p,apply:h},t[11]=h,t[12]=p,t[13]=d):d=t[13],d}function F(){}function tt(){const t=l.c(3),{data:e,isPending:s}=m(K),n=e??null;let i;return t[0]!==s||t[1]!==n?(i={mainAgentId:n,isPending:s},t[0]=s,t[1]=n,t[2]=i):i=t[2],i}function K(t){return t.main_agent_id??null}function et(){const t=l.c(7),e=f();let s,n;t[0]!==e?(s=(a,u)=>e.mutate({main_agent_id:a},u),n=(a,u)=>e.mutateAsync({main_agent_id:a},u),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let i;return t[3]!==e||t[4]!==s||t[5]!==n?(i={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=i):i=t[6],i}function nt(){const t=l.c(5),{org:e}=y(),s=k();let n;t[0]!==e.id?(n=D.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const i=n;let a;return t[2]!==i||t[3]!==s?(a=u=>{if(!s)return u===i;const r=s.registries[u];return r?r.enabled:u===i},t[2]=i,t[3]=s,t[4]=a):a=t[4],a}export{L as a,j as b,V as c,X as d,tt as e,nt as f,Z as g,et as h,v as i,B as j,k,J as l,C as u};
@@ -1 +1 @@
1
- import{c as C,F as R}from"./index-B1INhWoo.js";import{u as p}from"./use-connection-Crt7Wnf6.js";import{W as a}from"./use-mcp-client-Cpe5VVFd.js";import{k as y}from"./use-organization-settings-BxnffxCo.js";function M(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{M as u};
1
+ import{c as C,F as R}from"./index-bSjz3FLt.js";import{u as p}from"./use-connection-BzH0Kdzc.js";import{W as a}from"./use-mcp-client-BcyA1fq6.js";import{k as y}from"./use-organization-settings-B7aJIu7V.js";function M(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{M as u};
@@ -1 +1 @@
1
- import{c as r,F as a,K as c,x as y,o as d,e as S}from"./index-B1INhWoo.js";import{u as l}from"./studio-tools-QMuOj6-u.js";function C(){const e=r.c(7),{org:i}=a(),u=l();let o;e[0]!==i.id?(o=c.secrets(i.id),e[0]=i.id,e[1]=o):o=e[1];let t;e[2]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,e[3]=t):t=e[3];let s;e[4]!==o||e[5]!==t?(s={queryKey:o,staleTime:6e4,queryFn:t},e[4]=o,e[5]=t,e[6]=s):s=e[6];const{data:n}=y(s);return n.secrets}function p(){const e=r.c(8),{org:i}=a(),u=l(),o=d();let t;e[0]!==u?(t=async f=>await u.call("SECRET_CREATE",{...f}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==i||e[3]!==o?(s=()=>{o.invalidateQueries({queryKey:c.secrets(i.id)})},e[2]=i,e[3]=o,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{p as a,C as u};
1
+ import{c as r,F as a,K as c,x as y,o as d,e as S}from"./index-bSjz3FLt.js";import{u as l}from"./studio-tools-CnY1iRfX.js";function C(){const e=r.c(7),{org:i}=a(),u=l();let o;e[0]!==i.id?(o=c.secrets(i.id),e[0]=i.id,e[1]=o):o=e[1];let t;e[2]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,e[3]=t):t=e[3];let s;e[4]!==o||e[5]!==t?(s={queryKey:o,staleTime:6e4,queryFn:t},e[4]=o,e[5]=t,e[6]=s):s=e[6];const{data:n}=y(s);return n.secrets}function p(){const e=r.c(8),{org:i}=a(),u=l(),o=d();let t;e[0]!==u?(t=async f=>await u.call("SECRET_CREATE",{...f}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==i||e[3]!==o?(s=()=>{o.invalidateQueries({queryKey:c.secrets(i.id)})},e[2]=i,e[3]=o,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{p as a,C as u};
@@ -1 +1 @@
1
- import{c as r,v as u}from"./index-B1INhWoo.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-C_3NeXEi.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
1
+ import{c as r,v as u}from"./index-bSjz3FLt.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-D8GZCmLu.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
@@ -1 +1 @@
1
- import{c as u,F as f,n as E,o as g,e as T,K as l,t as m}from"./index-B1INhWoo.js";import{u as y}from"./studio-tools-QMuOj6-u.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],E(a)}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){m.error(e instanceof Error?e.message:"Failed to create tag")}function M(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){m.error(e instanceof Error?e.message:"Failed to delete tag")}function A(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],E(c)}function G(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){m.error(e instanceof Error?e.message:"Failed to update member tags")}export{C as a,M as b,A as c,G as d,K as u};
1
+ import{c as u,F as f,n as E,o as g,e as T,K as l,t as m}from"./index-bSjz3FLt.js";import{u as y}from"./studio-tools-CnY1iRfX.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],E(a)}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){m.error(e instanceof Error?e.message:"Failed to create tag")}function M(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){m.error(e instanceof Error?e.message:"Failed to delete tag")}function A(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],E(c)}function G(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){m.error(e instanceof Error?e.message:"Failed to update member tags")}export{C as a,M as b,A as c,G as d,K as u};
@@ -1 +1 @@
1
- import{c as p,r as f}from"./index-B1INhWoo.js";import{u as w}from"./use-mobile-BDpXfOGb.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
1
+ import{c as p,r as f}from"./index-bSjz3FLt.js";import{u as w}from"./use-mobile-DtJ9mqo3.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
@@ -1 +1 @@
1
- import{c as d,F as a,d_ as P,bc as L,K as S,bb as _,n as p}from"./index-B1INhWoo.js";import{S as g,u as C}from"./use-mcp-client-Cpe5VVFd.js";function b(e){const t=d.c(5);let s;t[0]!==e?(s=e===void 0?{}:e,t[0]=e,t[1]=s):s=t[1];const n=s,{org:i}=a();let o;t[2]!==i.id||t[3]!==i.slug?(o={connectionId:g,orgId:i.id,orgSlug:i.slug},t[2]=i.id,t[3]=i.slug,t[4]=o):o=t[4];const l=C(o);return P(i.id,"VIRTUAL_MCP",l,n)}function U(e){const t=d.c(3),{org:s}=a();let n;t[0]!==s.id||t[1]!==s.slug?(n={connectionId:g,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=n):n=t[2];const i=C(n);return _(s.id,"VIRTUAL_MCP",e??void 0,i)}function y(e){const t=d.c(15),{org:s}=a();let n;t[0]!==s.id||t[1]!==s.slug?(n={connectionId:g,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=n):n=t[2];const i=C(n);let o,l,u;t[3]!==e||t[4]!==s.id?(o=[...e].sort(),u=p,l=S.virtualMcpLastUsed(s.id,o),t[3]=e,t[4]=s.id,t[5]=o,t[6]=l,t[7]=u):(o=t[5],l=t[6],u=t[7]);const I=o.length>0;let c;t[8]!==i||t[9]!==o?(c=async()=>{const M=(await i.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},f=new Map;for(const m of M.items)f.set(m.id,m);return f},t[8]=i,t[9]=o,t[10]=c):c=t[10];let r;return t[11]!==l||t[12]!==I||t[13]!==c?(r={queryKey:l,enabled:I,staleTime:3e4,queryFn:c},t[11]=l,t[12]=I,t[13]=c,t[14]=r):r=t[14],u(r)}function R(){const e=d.c(3),{org:t}=a();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:g,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const n=C(s);return L(t.id,"VIRTUAL_MCP",n)}export{b as a,R as b,y as c,U as u};
1
+ import{c as d,F as a,d_ as P,bd as L,K as S,bc as _,n as p}from"./index-bSjz3FLt.js";import{S as g,u as C}from"./use-mcp-client-BcyA1fq6.js";function U(e){const t=d.c(5);let s;t[0]!==e?(s=e===void 0?{}:e,t[0]=e,t[1]=s):s=t[1];const n=s,{org:i}=a();let o;t[2]!==i.id||t[3]!==i.slug?(o={connectionId:g,orgId:i.id,orgSlug:i.slug},t[2]=i.id,t[3]=i.slug,t[4]=o):o=t[4];const l=C(o);return P(i.id,"VIRTUAL_MCP",l,n)}function b(e){const t=d.c(3),{org:s}=a();let n;t[0]!==s.id||t[1]!==s.slug?(n={connectionId:g,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=n):n=t[2];const i=C(n);return _(s.id,"VIRTUAL_MCP",e??void 0,i)}function y(e){const t=d.c(15),{org:s}=a();let n;t[0]!==s.id||t[1]!==s.slug?(n={connectionId:g,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=n):n=t[2];const i=C(n);let o,l,u;t[3]!==e||t[4]!==s.id?(o=[...e].sort(),u=p,l=S.virtualMcpLastUsed(s.id,o),t[3]=e,t[4]=s.id,t[5]=o,t[6]=l,t[7]=u):(o=t[5],l=t[6],u=t[7]);const I=o.length>0;let c;t[8]!==i||t[9]!==o?(c=async()=>{const M=(await i.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},f=new Map;for(const m of M.items)f.set(m.id,m);return f},t[8]=i,t[9]=o,t[10]=c):c=t[10];let r;return t[11]!==l||t[12]!==I||t[13]!==c?(r={queryKey:l,enabled:I,staleTime:3e4,queryFn:c},t[11]=l,t[12]=I,t[13]=c,t[14]=r):r=t[14],u(r)}function R(){const e=d.c(3),{org:t}=a();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:g,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const n=C(s);return L(t.id,"VIRTUAL_MCP",n)}export{U as a,R as b,y as c,b as u};
@@ -0,0 +1 @@
1
+ import{I as u}from"./use-infinite-scroll-Cg9HfQoH.js";import{e4 as i}from"./index-bSjz3FLt.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +1 @@
1
- import{aJ as E,a1 as y,aK as S,a0 as w,aL as Q,o as k,aM as M,aN as x,r as p,aO as q,aP as H,aQ as L,aR as P,aS as R,aT as B,aU as T}from"./index-B1INhWoo.js";function v(r,s){const e=new Set(s);return r.filter(t=>!e.has(t))}function A(r,s,e){const t=r.slice(0);return t[s]=e,t}var U=class extends E{#i;#s;#n;#r;#e;#t;#o;#u;#a;#h=[];constructor(r,s,e){super(),this.#i=r,this.#r=e,this.#n=[],this.#e=[],this.#s=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(r=>{r.subscribe(s=>{this.#d(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(r=>{r.destroy()})}setQueries(r,s){this.#n=r,this.#r=s,y.batch(()=>{const e=this.#e,t=this.#f(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=e.length!==i.length,c=i.some((o,d)=>o!==e[d]),f=u||c,b=f?!0:n.some((o,d)=>{const g=this.#s[d];return!g||!S(o,g)});!f&&!b||(f&&(this.#h=t,this.#e=i),this.#s=n,this.hasListeners()&&(f&&(v(e,i).forEach(o=>{o.destroy()}),v(i,e).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#s}getQueries(){return this.#e.map(r=>r.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(r,s){const e=this.#f(r),t=e.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=e.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,s,i),()=>this.#c(t,e)]}#c(r,s){return s.map((e,t)=>{const i=r[t];return e.defaultedQueryOptions.notifyOnChangeProps?i:e.observer.trackResult(i,n=>{s.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,s,e){if(s){const t=this.#a,i=e!==void 0&&t!==void 0&&(t.length!==e.length||e.some((n,u)=>n!==t[u]));return(!this.#t||this.#s!==this.#u||i||s!==this.#o)&&(this.#o=s,this.#u=this.#s,e!==void 0&&(this.#a=e),this.#t=w(this.#t,s(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#e.some((r,s)=>r.options.suspense&&this.#s[s]?.data===void 0)}#f(r){const s=new Map;this.#e.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=s.get(i);n?n.push(t):s.set(i,[t])});const e=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=s.get(i.queryHash)?.shift()??new Q(this.#i,i);e.push({defaultedQueryOptions:i,observer:u})}),e}#d(r,s){const e=this.#e.indexOf(r);e!==-1&&(this.#s=A(this.#s,e,s),this.#p())}#p(){if(this.hasListeners()){const r=this.#c(this.#s,this.#h),s=this.#b(),e=this.#t,t=s?e:this.#l(r,this.#r?.combine);(s||e!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#s)})})}}};function I({queries:r,...s},e){const t=k(e),i=M(),n=x(),u=p.useMemo(()=>r.map(a=>{const h=t.defaultQueryOptions(a);return h._optimisticResults=i?"isRestoring":"optimistic",h}),[r,t,i]);u.forEach(a=>{q(a);const h=t.getQueryCache().get(a.queryHash);H(a,n,h)}),L(n);const[c]=p.useState(()=>new U(t,u,s)),[f,b,o]=c.getOptimisticResult(u,s.combine),d=!i&&s.subscribed!==!1;p.useSyncExternalStore(p.useCallback(a=>d?c.subscribe(y.batchCalls(a)):P,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(u,s)},[u,s,c]);const m=f.some((a,h)=>R(u[h],a))?f.flatMap((a,h)=>{const l=u[h];if(l&&R(l,a)){const C=new Q(t,l);return B(l,C,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const O=f.find((a,h)=>{const l=u[h];return l&&T({result:a,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(O?.error)throw O.error;return b(o())}export{I as u};
1
+ import{aK as E,a2 as y,aL as S,a1 as w,aM as Q,o as k,aN as M,aO as x,r as p,aP as q,aQ as H,aR as L,aS as P,aT as R,aU as B,aV as T}from"./index-bSjz3FLt.js";function v(r,s){const e=new Set(s);return r.filter(t=>!e.has(t))}function A(r,s,e){const t=r.slice(0);return t[s]=e,t}var U=class extends E{#i;#s;#n;#r;#e;#t;#o;#u;#a;#h=[];constructor(r,s,e){super(),this.#i=r,this.#r=e,this.#n=[],this.#e=[],this.#s=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(r=>{r.subscribe(s=>{this.#d(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(r=>{r.destroy()})}setQueries(r,s){this.#n=r,this.#r=s,y.batch(()=>{const e=this.#e,t=this.#f(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=e.length!==i.length,c=i.some((o,d)=>o!==e[d]),f=u||c,b=f?!0:n.some((o,d)=>{const g=this.#s[d];return!g||!S(o,g)});!f&&!b||(f&&(this.#h=t,this.#e=i),this.#s=n,this.hasListeners()&&(f&&(v(e,i).forEach(o=>{o.destroy()}),v(i,e).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#s}getQueries(){return this.#e.map(r=>r.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(r,s){const e=this.#f(r),t=e.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=e.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,s,i),()=>this.#c(t,e)]}#c(r,s){return s.map((e,t)=>{const i=r[t];return e.defaultedQueryOptions.notifyOnChangeProps?i:e.observer.trackResult(i,n=>{s.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,s,e){if(s){const t=this.#a,i=e!==void 0&&t!==void 0&&(t.length!==e.length||e.some((n,u)=>n!==t[u]));return(!this.#t||this.#s!==this.#u||i||s!==this.#o)&&(this.#o=s,this.#u=this.#s,e!==void 0&&(this.#a=e),this.#t=w(this.#t,s(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#e.some((r,s)=>r.options.suspense&&this.#s[s]?.data===void 0)}#f(r){const s=new Map;this.#e.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=s.get(i);n?n.push(t):s.set(i,[t])});const e=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=s.get(i.queryHash)?.shift()??new Q(this.#i,i);e.push({defaultedQueryOptions:i,observer:u})}),e}#d(r,s){const e=this.#e.indexOf(r);e!==-1&&(this.#s=A(this.#s,e,s),this.#p())}#p(){if(this.hasListeners()){const r=this.#c(this.#s,this.#h),s=this.#b(),e=this.#t,t=s?e:this.#l(r,this.#r?.combine);(s||e!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#s)})})}}};function I({queries:r,...s},e){const t=k(e),i=M(),n=x(),u=p.useMemo(()=>r.map(a=>{const h=t.defaultQueryOptions(a);return h._optimisticResults=i?"isRestoring":"optimistic",h}),[r,t,i]);u.forEach(a=>{q(a);const h=t.getQueryCache().get(a.queryHash);H(a,n,h)}),L(n);const[c]=p.useState(()=>new U(t,u,s)),[f,b,o]=c.getOptimisticResult(u,s.combine),d=!i&&s.subscribed!==!1;p.useSyncExternalStore(p.useCallback(a=>d?c.subscribe(y.batchCalls(a)):P,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(u,s)},[u,s,c]);const m=f.some((a,h)=>R(u[h],a))?f.flatMap((a,h)=>{const l=u[h];if(l&&R(l,a)){const C=new Q(t,l);return B(l,C,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const O=f.find((a,h)=>{const l=u[h];return l&&T({result:a,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(O?.error)throw O.error;return b(o())}export{I as u};
@@ -1 +1 @@
1
- import{b2 as s,r as c,b3 as a,b4 as i}from"./index-B1INhWoo.js";function f(r){const n=s({warn:r?.router===void 0}),t=r?.router||n,u=c.useRef(void 0);return a(t.stores.__store,e=>{if(r?.select){if(r.structuralSharing??t.options.defaultStructuralSharing){const o=i(u.current,r.select(e));return u.current=o,o}return r.select(e)}return e})}export{f as u};
1
+ import{b3 as s,r as c,b4 as a,b5 as i}from"./index-bSjz3FLt.js";function f(r){const n=s({warn:r?.router===void 0}),t=r?.router||n,u=c.useRef(void 0);return a(t.stores.__store,e=>{if(r?.select){if(r.structuralSharing??t.options.defaultStructuralSharing){const o=i(u.current,r.select(e));return u.current=o,o}return r.select(e)}return e})}export{f as u};
@@ -0,0 +1 @@
1
+ import{I as s}from"./use-infinite-scroll-Cg9HfQoH.js";import{e4 as u,X as n}from"./index-bSjz3FLt.js";function a(e,r){return u({...e,enabled:!0,suspense:!0,throwOnError:n},s,r)}export{a as u};
@@ -1 +1 @@
1
- import{c as V,b as q,r as z,a as O,n as Y,e as $,j as t,K as J,t as Q,B as W}from"./index-B1INhWoo.js";import{P as I}from"./index-D8Oyc-Sj.js";import{C as G}from"./collection-table-wrapper-CzY9tIKJ.js";import{E as L}from"./empty-state-DbpV7XVc.js";import{S as H}from"./search-input-l0QwIQw1.js";import{A as X}from"./avatar-D9ru8t7J.js";import{B as D}from"./badge-DuDSo4B5.js";import{u as Z}from"./use-debounced-value-C7ql9pQ9.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BnbuEtat.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./sidebar-DD3SRmGs.js";import"./LayoutLeft-BV4kR0Cl.js";import"./use-mobile-BDpXfOGb.js";import"./X-BW2EYO4B.js";import"./tooltip-DvQ0XsJD.js";import"./table-TbcMVTO8.js";import"./ArrowUp-Bw-aOPaU.js";import"./SearchMd-Swr0KhLg.js";import"./User01-CU43n4aC.js";import"./differenceInSeconds-NQ4PDo0z.js";function be(){const e=V.c(58),s=q(),[a,M]=z.useState("");let N;e[0]!==a?(N=a.trim(),e[0]=a,e[1]=N):N=e[1];const r=Z(N,300),{data:R}=O.useSession(),P=R?.user?.id;let n;e[2]!==r?(n=J.deploymentAdminUsers(r),e[2]=r,e[3]=n):n=e[3];let l;e[4]!==r?(l=()=>{const i=new URLSearchParams({limit:"100"});return r&&i.set("searchValue",r),K(`/api/_admin/users?${i}`)},e[4]=r,e[5]=l):l=e[5];let y;e[6]!==n||e[7]!==l?(y={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=y):y=e[8];const{data:k,isLoading:_,isError:A}=Y(y);let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=ie,e[9]=C):C=e[9];let w;e[10]!==s?(w={mutationFn:re,onSuccess:C,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=w):w=e[11];const E=$(w);let b;e[12]!==k?.users?(b=k?.users??[],e[12]=k?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==P||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===P||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=P,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==a||e[44]!==j?(g=t.jsx(H,{value:a,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=a,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==r||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:r?s("admin.users.noUsersMatchSearch",{search:r}):s("admin.users.noUsersYet")}),e[46]=r,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function re(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{be as default};
1
+ import{c as V,b as q,r as z,a as O,n as Y,e as $,j as t,K as J,t as Q,B as W}from"./index-bSjz3FLt.js";import{P as I}from"./index-m3kwuU8_.js";import{C as G}from"./collection-table-wrapper-D5y3-VS8.js";import{E as L}from"./empty-state-p3Rv7ykT.js";import{S as H}from"./search-input-D80HsBNG.js";import{A as X}from"./avatar-BN0lsHoN.js";import{B as D}from"./badge-ClnYkgjJ.js";import{u as Z}from"./use-debounced-value-GljL4VOJ.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BnbuEtat.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./sidebar-ZY9Na73j.js";import"./LayoutLeft-Ciwgy5UL.js";import"./use-mobile-DtJ9mqo3.js";import"./X-BcM56kD2.js";import"./tooltip-Bfr58shw.js";import"./table-DUzcE7pw.js";import"./ArrowUp-DWMmuZz_.js";import"./SearchMd-CGs342fz.js";import"./User01-Ddv0yRQm.js";import"./differenceInSeconds-NQ4PDo0z.js";function be(){const e=V.c(58),s=q(),[a,M]=z.useState("");let N;e[0]!==a?(N=a.trim(),e[0]=a,e[1]=N):N=e[1];const r=Z(N,300),{data:R}=O.useSession(),P=R?.user?.id;let n;e[2]!==r?(n=J.deploymentAdminUsers(r),e[2]=r,e[3]=n):n=e[3];let l;e[4]!==r?(l=()=>{const i=new URLSearchParams({limit:"100"});return r&&i.set("searchValue",r),K(`/api/_admin/users?${i}`)},e[4]=r,e[5]=l):l=e[5];let y;e[6]!==n||e[7]!==l?(y={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=y):y=e[8];const{data:k,isLoading:_,isError:A}=Y(y);let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=ie,e[9]=C):C=e[9];let w;e[10]!==s?(w={mutationFn:re,onSuccess:C,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=w):w=e[11];const E=$(w);let b;e[12]!==k?.users?(b=k?.users??[],e[12]=k?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==P||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===P||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=P,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==a||e[44]!==j?(g=t.jsx(H,{value:a,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=a,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==r||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:r?s("admin.users.noUsersMatchSearch",{search:r}):s("admin.users.noUsersYet")}),e[46]=r,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function re(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{be as default};