decocms 3.35.7 → 3.35.8

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 (236) hide show
  1. package/dist/client/assets/{AlertCircle-BIYTfeei.js → AlertCircle-BhiQLzAa.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BGqBIDum.js → ArrowUpRight-zWQi9yeG.js} +1 -1
  3. package/dist/client/assets/{Check-LvE_sA_T.js → Check-BE5llaCo.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-B0oBxRpb.js → CheckCircle-BZzInqah.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DHa3IqAQ.js → ChevronDown-igtaXLHI.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-X1rMYFmV.js → ChevronLeft-D7ypV5AW.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-BpOFC9UY.js → ChevronRight-B2MPJG0Y.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-CLtd7-t0.js → ChevronUp-CEzo-UYH.js} +1 -1
  9. package/dist/client/assets/{Container-6Ia5IPn9.js → Container-DxPsYKnX.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CAhIPJgX.js → DotsVertical-Bqz0rpkg.js} +1 -1
  11. package/dist/client/assets/{Eye-efxxq50W.js → Eye-DeAUvKsB.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CKVrZUkw.js → FilterLines-LorPzSpm.js} +1 -1
  13. package/dist/client/assets/{Globe01-CjvlAfxx.js → Globe01-9a7DzMR4.js} +1 -1
  14. package/dist/client/assets/{HardDrive-C-TQ9655.js → HardDrive-D6xAeAT3.js} +1 -1
  15. package/dist/client/assets/{Key01-CM-woE_3.js → Key01-z4ZY9P3F.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-BmVC9DfI.js → LayoutLeft-BlcyI03M.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-G3vtJN4n.js → LinkExternal01-wGfNOyG-.js} +1 -1
  18. package/dist/client/assets/{Monitor01-DGw3VSEj.js → Monitor01-Bz9bsY6F.js} +1 -1
  19. package/dist/client/assets/{Palette-e1wrOTVP.js → Palette-cOZdFvCP.js} +1 -1
  20. package/dist/client/assets/{Play-DmzTJXzi.js → Play-DUFgIaEa.js} +1 -1
  21. package/dist/client/assets/{Plus-tVXcrY0B.js → Plus-C9BCwyU7.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-BY57sDsA.js → RefreshCcw01-DcRdM_Fc.js} +1 -1
  23. package/dist/client/assets/{SearchMd-Dnr7mDHJ.js → SearchMd-DL_JjGfK.js} +1 -1
  24. package/dist/client/assets/{Settings02-vpvzCEqI.js → Settings02-B67J_b-Z.js} +1 -1
  25. package/dist/client/assets/{Shield01-kHOUdgzv.js → Shield01-12NhwCwh.js} +1 -1
  26. package/dist/client/assets/{Star01-DJobPrMv.js → Star01-DVJ2VIkN.js} +1 -1
  27. package/dist/client/assets/{Stars01-C5oxzVSS.js → Stars01-Csutpvum.js} +1 -1
  28. package/dist/client/assets/{Stars02-Jq5Pm_Dt.js → Stars02-EFTlH55e.js} +1 -1
  29. package/dist/client/assets/{Sun-BxAwIgVe.js → Sun-C4ItnLzg.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-Bs5IR9Wx.js → SwitchHorizontal01-iSGzLP3G.js} +1 -1
  31. package/dist/client/assets/{Tool01-DF4tFmg4.js → Tool01-DnoUjwuW.js} +1 -1
  32. package/dist/client/assets/{Trash01-DqblPjZX.js → Trash01-HFZG34bv.js} +1 -1
  33. package/dist/client/assets/{Upload01-D7EnwNsF.js → Upload01-D0zblu1D.js} +1 -1
  34. package/dist/client/assets/{User01-CASt-NvR.js → User01-GmyJVsk_.js} +1 -1
  35. package/dist/client/assets/{Users01-DH1hmdgk.js → Users01-D_irbv8j.js} +1 -1
  36. package/dist/client/assets/{Users03-Bu2EMbkq.js → Users03-CsJCzoB9.js} +1 -1
  37. package/dist/client/assets/{X-CbJVsm7w.js → X-Dz8XfAUE.js} +1 -1
  38. package/dist/client/assets/{XCircle-B2BGaOFD.js → XCircle-THthyWG1.js} +1 -1
  39. package/dist/client/assets/{XClose-CCcsmvcf.js → XClose-9eaBHjn_.js} +1 -1
  40. package/dist/client/assets/{Zap-CR9V8BtC.js → Zap-4WoTcb5S.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-uGoXnGDV.js → ZapSquare-C-w_2LWP.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-v_pNeFH6.js → ZoomOut-DC7naWv-.js} +1 -1
  43. package/dist/client/assets/{access-gate-nK_lXbty.js → access-gate-XBdT3iPT.js} +1 -1
  44. package/dist/client/assets/{accordion-Cus64fCZ.js → accordion-B2o3m3ys.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-DITNxgbg.js → add-section-modal-BOfJx4s8.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-C3qeiPXc.js → agent-capabilities-CX7B9V1k.js} +1 -1
  47. package/dist/client/assets/{agent-icon-BfnzytvB.js → agent-icon-iCRxqonQ.js} +1 -1
  48. package/dist/client/assets/{agents-list-D9brrkMe.js → agents-list-Dddtvx5O.js} +1 -1
  49. package/dist/client/assets/{ai-providers-CRqSB3uJ.js → ai-providers-DOw3qbxO.js} +1 -1
  50. package/dist/client/assets/{alert-BDRU9ZC5.js → alert-Cb2hF1jc.js} +1 -1
  51. package/dist/client/assets/{alert-dialog-D1rj4aCK.js → alert-dialog-DQCfLTeL.js} +1 -1
  52. package/dist/client/assets/app-editor-CRIIKlDH.js +1 -0
  53. package/dist/client/assets/{auth-CoZ_uLWv.js → auth-BR3kunRm.js} +1 -1
  54. package/dist/client/assets/{auth-catchall-gtW4LUF8.js → auth-catchall-BMkEHnr7.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-ubD2g2LB.js → auth-split-layout-CKdvz2MS.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-BI0nMiQE.js → automation-list-row-D0LrxtQM.js} +1 -1
  57. package/dist/client/assets/{automation-runs-DkxIxGFl.js → automation-runs-sZhsYDdn.js} +1 -1
  58. package/dist/client/assets/{automations-P2Rmg-KW.js → automations-Cjr8mJZr.js} +1 -1
  59. package/dist/client/assets/{avatar-B9Rc9EUw.js → avatar-I3WwYEoT.js} +1 -1
  60. package/dist/client/assets/{badge-CHEpx28S.js → badge-B0F_sgaz.js} +1 -1
  61. package/dist/client/assets/{brand-context-CnXcQYQU.js → brand-context-AsrwXDeK.js} +1 -1
  62. package/dist/client/assets/{buckets-DDp0mVPy.js → buckets-D9xOFAgF.js} +1 -1
  63. package/dist/client/assets/{calendar-DghLpU44.js → calendar-5jwZC3XX.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-BHy5hyOG.js → capability-load-error-vjCbAJOq.js} +1 -1
  65. package/dist/client/assets/{card-Coyfi-jZ.js → card-BFRGLx6P.js} +1 -1
  66. package/dist/client/assets/{chat-context-DgDbSHT-.js → chat-context-DZNmbrat.js} +1 -1
  67. package/dist/client/assets/{checkbox-CUxwz-XI.js → checkbox-DInBbeSC.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BtcIy2e1.js → cli-auth-success-Cu93Pf3C.js} +1 -1
  69. package/dist/client/assets/{collection-detail-CwOqNemJ.js → collection-detail-BlvXfl8F.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-Bzvi-K9j.js → collection-display-button-CcexmhB5.js} +1 -1
  71. package/dist/client/assets/{collection-search-BOTBd9nH.js → collection-search-ykImYcNC.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-DFw9302z.js → collection-table-wrapper-ubGqDv-6.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-DutpbC-B.js → collection-tabs-BlMNH4hh.js} +1 -1
  74. package/dist/client/assets/{collections-B4qynpTl.js → collections-C6Af1Q9d.js} +1 -1
  75. package/dist/client/assets/{command-BV689sDo.js → command-CVb7Xyz-.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-Bt_ZSEjM.js → connect-desktop-dialog-BFdzqeA3.js} +1 -1
  77. package/dist/client/assets/{connection-card-BeSS5FDA.js → connection-card-Dpl0Au98.js} +1 -1
  78. package/dist/client/assets/{connection-detail-CpBssSKg.js → connection-detail-GZegjuob.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-DJLyD-fy.js → connection-form-helpers-CQ-0zB3Z.js} +1 -1
  80. package/dist/client/assets/{connections-CXNczWT3.js → connections-CLnO7l3E.js} +1 -1
  81. package/dist/client/assets/{decopilot-MIVpVAhi.js → decopilot-IEJmKYNS.js} +1 -1
  82. package/dist/client/assets/decopilot-sse-pool-BTIZKXdE.js +1 -0
  83. package/dist/client/assets/{dialog-DQXXelJD.js → dialog-BNTma1n7.js} +1 -1
  84. package/dist/client/assets/{domain-settings-Bfk16G5p.js → domain-settings-qDqN6DsU.js} +1 -1
  85. package/dist/client/assets/{drawer-DPsQ_RSi.js → drawer-BFu_Vykr.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-DE0jtqcA.js → dropdown-menu-BPajkRHT.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-B6SLKYUw.js → dynamic-plugin-layout-CxYTTzo3.js} +1 -1
  88. package/dist/client/assets/{empty-state-DkmJ5Aqv.js → empty-state-DQQwJkAH.js} +1 -1
  89. package/dist/client/assets/{empty-state-DjKgE-Pk.js → empty-state-pMCkbkbn.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-BlNJcpyN.js → extract-connection-data-EpMFgcjc.js} +1 -1
  91. package/dist/client/assets/{features-BLPRBAAS.js → features-BZKr28L7.js} +1 -1
  92. package/dist/client/assets/{file-explorer-BrHhoR9d.js → file-explorer-BuBL2stT.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-B4sc4oJu.js → file-type-icon-CjY-L87B.js} +1 -1
  94. package/dist/client/assets/{files-Bp-rzOpe.js → files-CgSwSC5P.js} +1 -1
  95. package/dist/client/assets/{form-544HFX7E.js → form-D08b7dFe.js} +1 -1
  96. package/dist/client/assets/{general-SURYQd03.js → general-HwaMhz2i.js} +1 -1
  97. package/dist/client/assets/{generate-id-DWTKLmsP.js → generate-id-BPoX5AZG.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-CAJFaa_5.js → github-repo-picker-Bv5u83FS.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-nXsETNd4.js → header-tab-button-DWUYKjvd.js} +1 -1
  100. package/dist/client/assets/{hover-card-CFl8ktry.js → hover-card-CM7471N3.js} +1 -1
  101. package/dist/client/assets/{image-field-BGI67qng.js → image-field-DRWjALOn.js} +1 -1
  102. package/dist/client/assets/{index-BJW2k06q.js → index-BCN4LBSr.js} +4 -4
  103. package/dist/client/assets/{index-C7hbEX42.js → index-Bu0ZznB2.js} +1 -1
  104. package/dist/client/assets/{index-TDcAzuSs.js → index-C2WXOm5m.js} +1 -1
  105. package/dist/client/assets/{index-La6GAxQQ.js → index-CRu4VNhf.js} +1 -1
  106. package/dist/client/assets/{index-bvkMWHxC.js → index-CYfMTPm6.js} +1 -1
  107. package/dist/client/assets/{index-yJUFKnzQ.js → index-C_5MF2Y3.js} +1 -1
  108. package/dist/client/assets/{index-BiPry9Eg.js → index-CxFf1mIw.js} +1 -1
  109. package/dist/client/assets/{index-CQPehUqM.js → index-D-XyK333.js} +1 -1
  110. package/dist/client/assets/{index-8tXBMeIK.js → index-DJxRbue6.js} +3 -3
  111. package/dist/client/assets/{index-CwhrOxXk.js → index-DcLhl-5Q.js} +1 -1
  112. package/dist/client/assets/{index-C1_XAkwo.js → index-SEyWzaM3.js} +1 -1
  113. package/dist/client/assets/{index-BRoAqb49.js → index-UEt8s5KD.js} +1 -1
  114. package/dist/client/assets/{index-NDFo3Mew.js → index-UuGgKIpr.js} +1 -1
  115. package/dist/client/assets/{index-BZA2K9l8.js → index-dgPRflW5.js} +1 -1
  116. package/dist/client/assets/{index-BWEcSbo6.js → index-qpz1aTWR.js} +1 -1
  117. package/dist/client/assets/{index-redirect-BYnxpCc2.js → index-redirect-Bgc0AzrY.js} +1 -1
  118. package/dist/client/assets/{input-C4KTJyA0.js → input-DrBjEN1K.js} +1 -1
  119. package/dist/client/assets/{integration-icon-BykvWwAZ.js → integration-icon-CBmdz72e.js} +1 -1
  120. package/dist/client/assets/{label-BHauIX0M.js → label-DPtACVyH.js} +1 -1
  121. package/dist/client/assets/{layout-lz847Nyb.js → layout-ChSwM-QK.js} +1 -1
  122. package/dist/client/assets/{login-CLS37Owv.js → login-lrwL4f_O.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-BOevDVjh.js → mcp-oauth-COFe1Qcp.js} +1 -1
  124. package/dist/client/assets/{members-CfcfbKhF.js → members-BaLik2bf.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-CthqrNYr.js → monaco-editor-D9q3BMcP.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-CqZVa71v.js → monitoring-stats-row-DK9_KPle.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-BZ0HY_I9.js → oauth-callback-D8hDCZsz.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-Cl1KMX--.js → oauth-callback-ai-provider-ClG2kZkP.js} +1 -1
  129. package/dist/client/assets/{onboarding-ruQ3ExNI.js → onboarding-D-nWMG3s.js} +1 -1
  130. package/dist/client/assets/{org-install-4mo6vwWZ.js → org-install-CSh2gL1g.js} +1 -1
  131. package/dist/client/assets/{org-layout-Bk_DX0xY.js → org-layout-BzdyjBgb.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-CtDHjWlv.js → org-plugin-layout-hz3PdzSx.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-BCeF78ys.js → page-seo-form-o10VY06i.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-DQlXJBao.js +1 -0
  135. package/dist/client/assets/{pair-C7vZKi4N.js → pair-B3JvusRD.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-B9oNmWVA.js → plugin-empty-state-qUc9EE_w.js} +1 -1
  137. package/dist/client/assets/{plugin-header-DLHKmNhY.js → plugin-header-Wee2-vBE.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-D6Br2fpA.js → plugin-layout-DQH5MxMz.js} +1 -1
  139. package/dist/client/assets/{popover-DJWCo8Vd.js → popover-CxSOgrnQ.js} +1 -1
  140. package/dist/client/assets/{post-editor-Dlsk3kzy.js → post-editor-49rnCC5W.js} +1 -1
  141. package/dist/client/assets/{primitives-HSATajDh.js → primitives-DIR4NDi7.js} +1 -1
  142. package/dist/client/assets/{profile-DqSdE9wJ.js → profile-CnzeSYsG.js} +1 -1
  143. package/dist/client/assets/project-app-view-D4KDZyfT.js +1 -0
  144. package/dist/client/assets/record-editor-U1lNDcKg.js +1 -0
  145. package/dist/client/assets/registry-C-XSpMct.js +2 -0
  146. package/dist/client/assets/{registry-layout-C4BBelJQ.js → registry-layout-BbZF87a1.js} +1 -1
  147. package/dist/client/assets/{require-capability-DmyLmLDX.js → require-capability-CP41TlGl.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-Dxuok_Oj.js → required-auth-layout-Bakgp2v2.js} +1 -1
  149. package/dist/client/assets/{reset-password-CV_mxpkk.js → reset-password-ZxK_LvZM.js} +1 -1
  150. package/dist/client/assets/{resizable-C7mpEwlp.js → resizable-C-hPk_F_.js} +1 -1
  151. package/dist/client/assets/{roles-oRuXLnwx.js → roles-D7m3YYSg.js} +1 -1
  152. package/dist/client/assets/save-referenced-block-DXNQX0iw.js +1 -0
  153. package/dist/client/assets/{save-status-BgSlaaCs.js → save-status-CLNRCBUu.js} +1 -1
  154. package/dist/client/assets/{schema-form-Da4995bk.js → schema-form-B2H-b_em.js} +1 -1
  155. package/dist/client/assets/{scroll-area-CmHcbXMX.js → scroll-area-KSI08Bdg.js} +1 -1
  156. package/dist/client/assets/{search-input-B9MwoGwA.js → search-input-LClJsC0R.js} +1 -1
  157. package/dist/client/assets/{secrets-BAMGlxeq.js → secrets-DakIQ3h4.js} +1 -1
  158. package/dist/client/assets/{sections-editor-D3ApReLv.js → sections-editor-BlwTeLMB.js} +1 -1
  159. package/dist/client/assets/{select-LnPBQlwq.js → select-BD3-KIUg.js} +1 -1
  160. package/dist/client/assets/{select-model-ePGHlOjM.js → select-model-Dbbl0Ax5.js} +1 -1
  161. package/dist/client/assets/{seo-editor-C6Dd35Oh.js → seo-editor-CRarakJm.js} +1 -1
  162. package/dist/client/assets/{settings-layout-mD1kpjDi.js → settings-layout-C6Td3mdo.js} +1 -1
  163. package/dist/client/assets/{settings-section-k7IrKbz0.js → settings-section-ooondd_C.js} +1 -1
  164. package/dist/client/assets/{sheet-Da8oGaXl.js → sheet-BB5BvZRD.js} +1 -1
  165. package/dist/client/assets/{shell-controls-Ce3YbGzv.js → shell-controls-BYqwKGk9.js} +1 -1
  166. package/dist/client/assets/{shell-layout-BppWbDed.js → shell-layout-C11kPZct.js} +1 -1
  167. package/dist/client/assets/{shell-route-loading-CHDF1PQc.js → shell-route-loading-D23tu6UU.js} +1 -1
  168. package/dist/client/assets/{sidebar-Dq7ywuwS.js → sidebar-DQGireBE.js} +1 -1
  169. package/dist/client/assets/{skeleton-Bs5gkyp5.js → skeleton-C_PdNCnO.js} +1 -1
  170. package/dist/client/assets/{sortable.esm-4vTXIsSP.js → sortable.esm-DATKg__i.js} +1 -1
  171. package/dist/client/assets/{spinner-X0P6H8XF.js → spinner-ph9V8K3G.js} +1 -1
  172. package/dist/client/assets/{sso-DAt1PrT3.js → sso-CVFsn2i8.js} +1 -1
  173. package/dist/client/assets/{store-CFDS2nCg.js → store-C6H7hDrQ.js} +1 -1
  174. package/dist/client/assets/store-registry-B9IEgjs2.js +2 -0
  175. package/dist/client/assets/{studio-tools-DA1cqt_R.js → studio-tools-CyXwEskA.js} +1 -1
  176. package/dist/client/assets/{switch-BfYG3ZgX.js → switch-BwW6aBRl.js} +1 -1
  177. package/dist/client/assets/{tab-id-D-V9CLoC.js → tab-id-DBFKLiy5.js} +1 -1
  178. package/dist/client/assets/{table-iiadVZtP.js → table-DRZq5QeC.js} +1 -1
  179. package/dist/client/assets/{tabs-C3ewzjce.js → tabs-DS796tVx.js} +1 -1
  180. package/dist/client/assets/{task-status-8O-9w38P.js → task-status-Rw4KZiD7.js} +1 -1
  181. package/dist/client/assets/{textarea-CSY57hUQ.js → textarea-H9HcvvO3.js} +1 -1
  182. package/dist/client/assets/{toggle-group-BMs6XIZt.js → toggle-group-DEp8BrmP.js} +1 -1
  183. package/dist/client/assets/{toolbar-RrHrj-wA.js → toolbar-CGZIlwHR.js} +1 -1
  184. package/dist/client/assets/{tools-list-BZ21f-qw.js → tools-list-2oZSXDvR.js} +1 -1
  185. package/dist/client/assets/{tooltip-C5K2_SxZ.js → tooltip-BsiBfMRx.js} +1 -1
  186. package/dist/client/assets/{types-By3Vc6ET.js → types-BDYvGU56.js} +1 -1
  187. package/dist/client/assets/{use-ai-providers-yQU6QFt7.js → use-ai-providers-CLGsHtDy.js} +1 -1
  188. package/dist/client/assets/{use-automations-EnJ_KtpR.js → use-automations-BFkAWLBs.js} +1 -1
  189. package/dist/client/assets/{use-capability-IPmcsvJ7.js → use-capability-BgmZSEFV.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick--JSADwca.js → use-clock-tick-CaCQW7f3.js} +1 -1
  191. package/dist/client/assets/{use-collections-gQX1aIBb.js → use-collections-LXN6LFio.js} +1 -1
  192. package/dist/client/assets/{use-connection-3AMSWY4d.js → use-connection-DBT-O2Ot.js} +1 -1
  193. package/dist/client/assets/{use-copy-BrRxB_CX.js → use-copy-Be1923zu.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-DbJaPibs.js → use-create-virtual-mcp-CUFB7E50.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-9Ai91Koh.js → use-debounced-autosave-Dl4w5-6p.js} +1 -1
  196. package/dist/client/assets/{use-delete-connection-DFI3Wjrd.js → use-delete-connection-BgQev1Df.js} +1 -1
  197. package/dist/client/assets/{use-file-configs-CgPTWHYk.js → use-file-configs-D8QyTqtG.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-BdWMzn-I.js → use-infinite-scroll-DmcTgb_Z.js} +1 -1
  199. package/dist/client/assets/{use-list-state-C_Png9rc.js → use-list-state-COdpgZQx.js} +1 -1
  200. package/dist/client/assets/{use-mcp-client-DNWGF-S6.js → use-mcp-client-DEVh0wrA.js} +1 -1
  201. package/dist/client/assets/{use-mcp-prompts-BFE67i8g.js → use-mcp-prompts-wVJtCACz.js} +1 -1
  202. package/dist/client/assets/{use-mcp-tools-DCnrwBcx.js → use-mcp-tools-Do5DPz0G.js} +1 -1
  203. package/dist/client/assets/{use-members-DdhBt1i2.js → use-members-Dyv5s6Ln.js} +1 -1
  204. package/dist/client/assets/{use-navigate-to-agent-BGaWNHVu.js → use-navigate-to-agent-em-bmKWL.js} +1 -1
  205. package/dist/client/assets/{use-org-auth-client-BKj503w6.js → use-org-auth-client-RfCN5nxl.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-DcIpAKt9.js → use-org-sso-Dn-IiDHF.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-mEVELLYq.js → use-organization-roles-BsAcGhUy.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-D-mp9Nom.js → use-organization-settings-BmyIHq31.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-UDMbBrhr.js → use-registry-connections-R7xxuxMJ.js} +1 -1
  210. package/dist/client/assets/{use-secrets-CCok2kdj.js → use-secrets-a1pHbRuq.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-C-cdLbOI.js → use-status-sounds-jx0BT_gy.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-DggEE1xi.js → use-view-mode-BORPaXws.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-C8Cvizcb.js → use-virtual-mcp-CsBEf_ak.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-e_b9pntx.js +1 -0
  215. package/dist/client/assets/{useRouterState-Bu9FaaK6.js → useRouterState-CpJi3eeH.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-CAwDmp_D.js +1 -0
  217. package/dist/client/assets/{user-vuU-47pc.js → user-CBCnDRYu.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-CSvU0t8g.js → view-mode-toggle-CI6odJEz.js} +1 -1
  219. package/dist/client/assets/{watch-sse-pool-CI_P_tLE.js → watch-sse-pool-LhxM1ddy.js} +1 -1
  220. package/dist/client/assets/{workflow-BRFJAXXv.js → workflow-BgPeOS0D.js} +1 -1
  221. package/dist/client/assets/workflow-detail-CWUm2dJS.js +1 -0
  222. package/dist/client/index.html +1 -1
  223. package/dist/server/cli.js +348 -348
  224. package/dist/server/server.js +233 -233
  225. package/package.json +1 -1
  226. package/dist/client/assets/app-editor-CIhW2hZX.js +0 -1
  227. package/dist/client/assets/decopilot-sse-pool-DysvnVnY.js +0 -1
  228. package/dist/client/assets/page-seo-sheet-DEGkKhJQ.js +0 -1
  229. package/dist/client/assets/project-app-view-C130Qk03.js +0 -1
  230. package/dist/client/assets/record-editor-ClcHc-Yc.js +0 -1
  231. package/dist/client/assets/registry-KKV5dp-0.js +0 -2
  232. package/dist/client/assets/save-referenced-block-C8W_58KS.js +0 -1
  233. package/dist/client/assets/store-registry-J5_Yu_3b.js +0 -2
  234. package/dist/client/assets/useInfiniteQuery-BxZ0ZIEY.js +0 -1
  235. package/dist/client/assets/useSuspenseInfiniteQuery-BaHJXY7X.js +0 -1
  236. package/dist/client/assets/workflow-detail-BV03DzYj.js +0 -1
@@ -1,4 +1,4 @@
1
- import{ed as se,e as I,j as o,B as te,l as Yt,b2 as Ae,ee as Gs,r as X,p as oe,c as $,g as Qs,F as Zt,ef as Nt,eg as es,n as Ys,s as Zs,eh as en,ei as tn}from"./index-8tXBMeIK.js";import{D as sn,F as nn,B as on}from"./index-BRoAqb49.js";import{h as De,i as rn,u as ae}from"./use-mcp-client-DNWGF-S6.js";import{a as ts}from"./use-virtual-mcp-C8Cvizcb.js";import{M as Oe}from"./monaco-editor-CthqrNYr.js";import{b as ln,R as zt,a as cn}from"./resizable-C7mpEwlp.js";import{B as le}from"./badge-CHEpx28S.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-LnPBQlwq.js";import{S as et}from"./spinner-X0P6H8XF.js";import{V as an}from"./view-mode-toggle-CSvU0t8g.js";import{ak as un,q as dn,i as fn,B as ss,al as mn,a5 as pn,v as xn,am as ns,ab as hn,O as os,an as gn,ao as bn,a7 as ft,ap as jn}from"./agent-icon-BfnzytvB.js";import{i as rs}from"./Play-DmzTJXzi.js";import{b as Sn,a as yn,V as Ge}from"./layout-lz847Nyb.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-C5K2_SxZ.js";import{u as wn,a as vn}from"./use-connection-3AMSWY4d.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-DCnrwBcx.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-DQXXelJD.js";import"./index-TDcAzuSs.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as An,e as At,d as Wn,q as Pn,S as Dn}from"./scroll-area-CmHcbXMX.js";import{S as Fn}from"./index-NDFo3Mew.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-CFl8ktry.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-DE0jtqcA.js";import{s as Un}from"./Plus-tVXcrY0B.js";import{b as ps}from"./Tool01-DF4tFmg4.js";import{i as Fe}from"./Check-LvE_sA_T.js";import{s as _t}from"./XClose-CCcsmvcf.js";import{I as Ct}from"./integration-icon-BykvWwAZ.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-Cus64fCZ.js";import"./index-yJUFKnzQ.js";import{i as xs}from"./X-CbJVsm7w.js";import{u as hs,a as Gn}from"./use-collections-gQX1aIBb.js";import{E as gs}from"./empty-state-DkmJ5Aqv.js";import{w as Qn}from"./watch-sse-pool-CI_P_tLE.js";import{I as Wt}from"./input-C4KTJyA0.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=Ae.useSyncExternalStore(t.subscribe,Ae.useCallback(()=>e(t.getState()),[t,e]),Ae.useCallback(()=>e(t.getInitialState()),[t,e]));return Ae.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return Ae.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
1
+ import{ed as se,e as I,j as o,B as te,l as Yt,b2 as Ae,ee as Gs,r as X,p as oe,c as $,g as Qs,F as Zt,ef as Nt,eg as es,n as Ys,s as Zs,eh as en,ei as tn}from"./index-DJxRbue6.js";import{D as sn,F as nn,B as on}from"./index-UEt8s5KD.js";import{h as De,i as rn,u as ae}from"./use-mcp-client-DEVh0wrA.js";import{a as ts}from"./use-virtual-mcp-CsBEf_ak.js";import{M as Oe}from"./monaco-editor-D9q3BMcP.js";import{b as ln,R as zt,a as cn}from"./resizable-C-hPk_F_.js";import{B as le}from"./badge-B0F_sgaz.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-BD3-KIUg.js";import{S as et}from"./spinner-ph9V8K3G.js";import{V as an}from"./view-mode-toggle-CI6odJEz.js";import{ak as un,q as dn,i as fn,B as ss,al as mn,a5 as pn,v as xn,am as ns,ab as hn,O as os,an as gn,ao as bn,a7 as ft,ap as jn}from"./agent-icon-iCRxqonQ.js";import{i as rs}from"./Play-DUFgIaEa.js";import{b as Sn,a as yn,V as Ge}from"./layout-ChSwM-QK.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-BsiBfMRx.js";import{u as wn,a as vn}from"./use-connection-DBT-O2Ot.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-Do5DPz0G.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-BNTma1n7.js";import"./index-C2WXOm5m.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as An,e as At,d as Wn,q as Pn,S as Dn}from"./scroll-area-KSI08Bdg.js";import{S as Fn}from"./index-UuGgKIpr.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-CM7471N3.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-BPajkRHT.js";import{s as Un}from"./Plus-C9BCwyU7.js";import{b as ps}from"./Tool01-DnoUjwuW.js";import{i as Fe}from"./Check-BE5llaCo.js";import{s as _t}from"./XClose-9eaBHjn_.js";import{I as Ct}from"./integration-icon-CBmdz72e.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-B2o3m3ys.js";import"./index-C_5MF2Y3.js";import{i as xs}from"./X-Dz8XfAUE.js";import{u as hs,a as Gn}from"./use-collections-LXN6LFio.js";import{E as gs}from"./empty-state-DQQwJkAH.js";import{w as Qn}from"./watch-sse-pool-LhxM1ddy.js";import{I as Wt}from"./input-DrBjEN1K.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=Ae.useSyncExternalStore(t.subscribe,Ae.useCallback(()=>e(t.getState()),[t,e]),Ae.useCallback(()=>e(t.getInitialState()),[t,e]));return Ae.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return Ae.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
2
  ${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
3
3
  `:""} ${u}${f}: ${n(d)};`}).join(`
4
4
  `)}
@@ -1 +1 @@
1
- import{e as k,j as o,o as T,r as N,O as D}from"./index-8tXBMeIK.js";import{u as z,S as E,a as I,b as L}from"./sidebar-Dq7ywuwS.js";import{T as M,a as O,b as A,u as P}from"./tooltip-C5K2_SxZ.js";import{S as $,a as W,b as B}from"./shell-route-loading-CHDF1PQc.js";import{u as X,C as H}from"./chat-context-DgDbSHT-.js";import{T as F}from"./tab-id-D-V9CLoC.js";import{i as q}from"./Monitor01-DGw3VSEj.js";import{v as G,C as K}from"./connect-desktop-dialog-Bt_ZSEjM.js";import{T as Y,a as b}from"./toolbar-RrHrj-wA.js";import{S as U,M as J}from"./shell-controls-Ce3YbGzv.js";import"./LayoutLeft-BmVC9DfI.js";import"./sheet-Da8oGaXl.js";import"./X-CbJVsm7w.js";import"./useRouterState-Bu9FaaK6.js";import"./ZoomOut-v_pNeFH6.js";import"./skeleton-Bs5gkyp5.js";import"./popover-DJWCo8Vd.js";import"./drawer-DPsQ_RSi.js";import"./SearchMd-Dnr7mDHJ.js";import"./Star01-DJobPrMv.js";import"./Plus-tVXcrY0B.js";import"./use-mcp-client-DNWGF-S6.js";import"./auth-CoZ_uLWv.js";import"./use-virtual-mcp-C8Cvizcb.js";import"./use-collections-gQX1aIBb.js";import"./use-create-virtual-mcp-DbJaPibs.js";import"./use-navigate-to-agent-BGaWNHVu.js";import"./github-repo-picker-CAJFaa_5.js";import"./use-connection-3AMSWY4d.js";import"./dialog-DQXXelJD.js";import"./RefreshCcw01-BY57sDsA.js";import"./collection-search-BOTBd9nH.js";import"./checkbox-CUxwz-XI.js";import"./Check-LvE_sA_T.js";import"./agent-icon-BfnzytvB.js";import"./AlertCircle-BIYTfeei.js";import"./Tool01-DF4tFmg4.js";import"./SwitchHorizontal01-Bs5IR9Wx.js";import"./XCircle-B2BGaOFD.js";import"./ArrowUpRight-BGqBIDum.js";import"./ZapSquare-uGoXnGDV.js";import"./Users03-Bu2EMbkq.js";import"./CheckCircle-B0oBxRpb.js";import"./ChevronDown-DHa3IqAQ.js";import"./ChevronLeft-X1rMYFmV.js";import"./ChevronRight-BpOFC9UY.js";import"./ChevronUp-CLtd7-t0.js";import"./DotsVertical-CAhIPJgX.js";import"./Container-6Ia5IPn9.js";import"./Eye-efxxq50W.js";import"./Globe01-CjvlAfxx.js";import"./FilterLines-CKVrZUkw.js";import"./Palette-e1wrOTVP.js";import"./HardDrive-C-TQ9655.js";import"./Stars02-Jq5Pm_Dt.js";import"./Key01-CM-woE_3.js";import"./LinkExternal01-G3vtJN4n.js";import"./Sun-BxAwIgVe.js";import"./Play-DmzTJXzi.js";import"./Settings02-vpvzCEqI.js";import"./Shield01-kHOUdgzv.js";import"./Stars01-C5oxzVSS.js";import"./Trash01-DqblPjZX.js";import"./Upload01-D7EnwNsF.js";import"./User01-CASt-NvR.js";import"./Users01-DH1hmdgk.js";import"./XClose-CCcsmvcf.js";import"./Zap-CR9V8BtC.js";import"./mcp-oauth-BOevDVjh.js";import"./use-mcp-tools-DCnrwBcx.js";import"./extract-connection-data-BlNJcpyN.js";import"./generate-id-DWTKLmsP.js";import"./collections-B4qynpTl.js";import"./shell-layout-BppWbDed.js";import"./avatar-B9Rc9EUw.js";import"./required-auth-layout-Dxuok_Oj.js";import"./use-organization-settings-D-mp9Nom.js";import"./use-org-sso-DcIpAKt9.js";import"./alert-dialog-D1rj4aCK.js";import"./form-544HFX7E.js";import"./label-BHauIX0M.js";import"./input-C4KTJyA0.js";import"./spinner-X0P6H8XF.js";import"./index-yJUFKnzQ.js";import"./sortable.esm-4vTXIsSP.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BeSS5FDA.js";import"./use-registry-connections-UDMbBrhr.js";import"./useInfiniteQuery-BxZ0ZIEY.js";import"./use-infinite-scroll-BdWMzn-I.js";import"./card-Coyfi-jZ.js";import"./integration-icon-BykvWwAZ.js";import"./collection-tabs-DutpbC-B.js";import"./badge-CHEpx28S.js";import"./select-LnPBQlwq.js";import"./textarea-CSY57hUQ.js";import"./connection-form-helpers-DJLyD-fy.js";import"./useSuspenseInfiniteQuery-BaHJXY7X.js";import"./studio-tools-DA1cqt_R.js";import"./use-ai-providers-yQU6QFt7.js";import"./command-BV689sDo.js";import"./index-BiPry9Eg.js";import"./use-org-auth-client-BKj503w6.js";import"./hover-card-CFl8ktry.js";import"./task-status-8O-9w38P.js";import"./use-clock-tick--JSADwca.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./watch-sse-pool-CI_P_tLE.js";import"./decopilot-sse-pool-DysvnVnY.js";function Q(e){const t=k.c(5),{onPointerDown:r,onDoubleClick:d}=e,{state:f,isMobile:u}=z();if(u||f==="collapsed")return null;let s,n;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={left:"var(--sidebar-width)"},n=o.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),t[0]=s,t[1]=n):(s=t[0],n=t[1]);let i;return t[2]!==d||t[3]!==r?(i=o.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:r,onDoubleClick:d,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:s,children:n}),t[2]=d,t[3]=r,t[4]=i):i=t[4],i}const R=240,V=400,Z="sidebar.width";function _(e){return Math.max(R,Math.min(V,e))}function ee(){const e=k.c(11),[t,r]=T(Z,te),d=N.useRef(null);let f;e[0]!==r||e[1]!==t?(f=a=>{a.preventDefault();const m=a.clientX,p=_(t),c=d.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),h=c?Array.from(c.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const x of h)x.style.transition="none";const j=x=>{const g=_(p+(x.clientX-m));c?.style.setProperty("--sidebar-width",`${g}px`)},S=x=>{const g=_(p+(x.clientX-m));r(g);for(const v of h)v.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",S)},e[0]=r,e[1]=t,e[2]=f):f=e[2];const u=f;let s;e[3]!==r?(s=()=>{r(R)},e[3]=r,e[4]=s):s=e[4];const n=s;let i;e[5]!==t?(i=_(t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==u||e[8]!==n||e[9]!==i?(l={width:i,wrapperRef:d,onStartResize:u,resetWidth:n},e[7]=u,e[8]=n,e[9]=i,e[10]=l):l=e[10],l}function te(e){return typeof e=="number"?_(e):R}function oe(){const e=k.c(22),t=X(),[r,d]=N.useState(!1);let f;if(e[0]!==t.capabilities||e[1]!==t.hostname||e[2]!==t.machineId||e[3]!==t.online){const j=G(t.capabilities);f=t.online?o.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[o.jsx("span",{className:"font-medium",children:t.hostname??t.machineId??"Desktop linked"}),o.jsx("span",{className:"text-muted-foreground",children:j.length>0?`Available: ${j.join(", ")}`:"No CLI agents detected"})]}):o.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=t.capabilities,e[1]=t.hostname,e[2]=t.machineId,e[3]=t.online,e[4]=f}else f=e[4];const u=f;let s;e[5]===Symbol.for("react.memo_cache_sentinel")?(s=()=>d(!0),e[5]=s):s=e[5];const n=t.online?"Desktop linked":"Connect your desktop";let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(q,{size:16}),e[6]=i):i=e[6];let l;e[7]!==t.online?(l=t.online&&o.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[7]=t.online,e[8]=l):l=e[8];let a;e[9]!==n||e[10]!==l?(a=o.jsx(M,{asChild:!0,children:o.jsxs(Y,{onClick:s,"aria-label":n,children:[i,l]})}),e[9]=n,e[10]=l,e[11]=a):a=e[11];let m;e[12]!==u?(m=o.jsx(O,{side:"bottom",children:u}),e[12]=u,e[13]=m):m=e[13];let p;e[14]!==a||e[15]!==m?(p=o.jsxs(A,{children:[a,m]}),e[14]=a,e[15]=m,e[16]=p):p=e[16];let c;e[17]!==r?(c=o.jsx(K,{open:r,onOpenChange:d}),e[17]=r,e[18]=c):c=e[18];let h;return e[19]!==p||e[20]!==c?(h=o.jsxs(o.Fragment,{children:[p,c]}),e[19]=p,e[20]=c,e[21]=h):h=e[21],h}const ie="sidebar.open";function re(){const e=k.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx(B,{}),e[0]=t):t=e[0],t}function lo(){const e=k.c(26),t=P(),[r,d]=T(ie,!1),{width:f,wrapperRef:u,onStartResize:s,resetWidth:n}=ee();let i,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(b.LogoLink,{}),l=o.jsx(U,{}),e[0]=i,e[1]=l):(i=e[0],l=e[1]);let a,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsxs(b.LeftColumn,{children:[i,l,o.jsx("span",{className:"hidden md:contents",children:o.jsx(b.Nav,{})}),o.jsx(b.TogglesSlot,{}),o.jsx(oe,{})]}),m=o.jsx(b.CenterSlot,{}),e[2]=a,e[3]=m):(a=e[2],m=e[3]);let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(b.Header,{children:[a,m,o.jsxs(b.RightColumn,{children:[o.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:o.jsx(b.TabsSlot,{})}),o.jsx(b.RightSlot,{})]})]}),e[4]=p):p=e[4];const c=`${f}px`;let h;e[5]!==c?(h={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},e[5]=c,e[6]=h):h=e[6];const j=h;let S;e[7]!==t||e[8]!==s||e[9]!==n?(S=!t&&o.jsxs(o.Fragment,{children:[o.jsx($,{}),o.jsx(Q,{onPointerDown:s,onDoubleClick:n})]}),e[7]=t,e[8]=s,e[9]=n,e[10]=S):S=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},e[11]=x):x=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(E,{className:"flex flex-col",style:x,children:o.jsx("div",{className:"flex flex-col h-full min-h-0",children:o.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:o.jsx(N.Suspense,{fallback:o.jsx(re,{}),children:o.jsx(D,{})})})})}),e[12]=g):g=e[12];let v;e[13]!==j||e[14]!==S||e[15]!==u?(v=o.jsxs(I,{ref:u,className:"flex-1 bg-sidebar relative min-h-0",style:j,children:[S,g]}),e[13]=j,e[14]=S,e[15]=u,e[16]=v):v=e[16];let y;e[17]!==t?(y=t&&o.jsx(J,{renderSidebar:se}),e[17]=t,e[18]=y):y=e[18];let w;e[19]!==v||e[20]!==y?(w=o.jsx(H,{children:o.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[p,v,y]})}),e[19]=v,e[20]=y,e[21]=w):w=e[21];let C;return e[22]!==d||e[23]!==r||e[24]!==w?(C=o.jsx(F,{children:o.jsx(b.Provider,{children:o.jsx(L,{open:r,onOpenChange:d,children:w})})}),e[22]=d,e[23]=r,e[24]=w,e[25]=C):C=e[25],C}function se(e){const{onClose:t}=e;return o.jsx("div",{className:"flex h-full",children:o.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:o.jsx(W,{onClose:t})})})}export{lo as default};
1
+ import{e as k,j as o,o as T,r as N,O as D}from"./index-DJxRbue6.js";import{u as z,S as E,a as I,b as L}from"./sidebar-DQGireBE.js";import{T as M,a as O,b as A,u as P}from"./tooltip-BsiBfMRx.js";import{S as $,a as W,b as B}from"./shell-route-loading-D23tu6UU.js";import{u as X,C as H}from"./chat-context-DZNmbrat.js";import{T as F}from"./tab-id-DBFKLiy5.js";import{i as q}from"./Monitor01-Bz9bsY6F.js";import{v as G,C as K}from"./connect-desktop-dialog-BFdzqeA3.js";import{T as Y,a as b}from"./toolbar-CGZIlwHR.js";import{S as U,M as J}from"./shell-controls-BYqwKGk9.js";import"./LayoutLeft-BlcyI03M.js";import"./sheet-BB5BvZRD.js";import"./X-Dz8XfAUE.js";import"./useRouterState-CpJi3eeH.js";import"./ZoomOut-DC7naWv-.js";import"./skeleton-C_PdNCnO.js";import"./popover-CxSOgrnQ.js";import"./drawer-BFu_Vykr.js";import"./SearchMd-DL_JjGfK.js";import"./Star01-DVJ2VIkN.js";import"./Plus-C9BCwyU7.js";import"./use-mcp-client-DEVh0wrA.js";import"./auth-BR3kunRm.js";import"./use-virtual-mcp-CsBEf_ak.js";import"./use-collections-LXN6LFio.js";import"./use-create-virtual-mcp-CUFB7E50.js";import"./use-navigate-to-agent-em-bmKWL.js";import"./github-repo-picker-Bv5u83FS.js";import"./use-connection-DBT-O2Ot.js";import"./dialog-BNTma1n7.js";import"./RefreshCcw01-DcRdM_Fc.js";import"./collection-search-ykImYcNC.js";import"./checkbox-DInBbeSC.js";import"./Check-BE5llaCo.js";import"./agent-icon-iCRxqonQ.js";import"./AlertCircle-BhiQLzAa.js";import"./Tool01-DnoUjwuW.js";import"./SwitchHorizontal01-iSGzLP3G.js";import"./XCircle-THthyWG1.js";import"./ArrowUpRight-zWQi9yeG.js";import"./ZapSquare-C-w_2LWP.js";import"./Users03-CsJCzoB9.js";import"./CheckCircle-BZzInqah.js";import"./ChevronDown-igtaXLHI.js";import"./ChevronLeft-D7ypV5AW.js";import"./ChevronRight-B2MPJG0Y.js";import"./ChevronUp-CEzo-UYH.js";import"./DotsVertical-Bqz0rpkg.js";import"./Container-DxPsYKnX.js";import"./Eye-DeAUvKsB.js";import"./Globe01-9a7DzMR4.js";import"./FilterLines-LorPzSpm.js";import"./Palette-cOZdFvCP.js";import"./HardDrive-D6xAeAT3.js";import"./Stars02-EFTlH55e.js";import"./Key01-z4ZY9P3F.js";import"./LinkExternal01-wGfNOyG-.js";import"./Sun-C4ItnLzg.js";import"./Play-DUFgIaEa.js";import"./Settings02-B67J_b-Z.js";import"./Shield01-12NhwCwh.js";import"./Stars01-Csutpvum.js";import"./Trash01-HFZG34bv.js";import"./Upload01-D0zblu1D.js";import"./User01-GmyJVsk_.js";import"./Users01-D_irbv8j.js";import"./XClose-9eaBHjn_.js";import"./Zap-4WoTcb5S.js";import"./mcp-oauth-COFe1Qcp.js";import"./use-mcp-tools-Do5DPz0G.js";import"./extract-connection-data-EpMFgcjc.js";import"./generate-id-BPoX5AZG.js";import"./collections-C6Af1Q9d.js";import"./shell-layout-C11kPZct.js";import"./avatar-I3WwYEoT.js";import"./required-auth-layout-Bakgp2v2.js";import"./use-organization-settings-BmyIHq31.js";import"./use-org-sso-Dn-IiDHF.js";import"./alert-dialog-DQCfLTeL.js";import"./form-D08b7dFe.js";import"./label-DPtACVyH.js";import"./input-DrBjEN1K.js";import"./spinner-ph9V8K3G.js";import"./index-C_5MF2Y3.js";import"./sortable.esm-DATKg__i.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dpl0Au98.js";import"./use-registry-connections-R7xxuxMJ.js";import"./useInfiniteQuery-e_b9pntx.js";import"./use-infinite-scroll-DmcTgb_Z.js";import"./card-BFRGLx6P.js";import"./integration-icon-CBmdz72e.js";import"./collection-tabs-BlMNH4hh.js";import"./badge-B0F_sgaz.js";import"./select-BD3-KIUg.js";import"./textarea-H9HcvvO3.js";import"./connection-form-helpers-CQ-0zB3Z.js";import"./useSuspenseInfiniteQuery-CAwDmp_D.js";import"./studio-tools-CyXwEskA.js";import"./use-ai-providers-CLGsHtDy.js";import"./command-CVb7Xyz-.js";import"./index-CxFf1mIw.js";import"./use-org-auth-client-RfCN5nxl.js";import"./hover-card-CM7471N3.js";import"./task-status-Rw4KZiD7.js";import"./use-clock-tick-CaCQW7f3.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./watch-sse-pool-LhxM1ddy.js";import"./decopilot-sse-pool-BTIZKXdE.js";function Q(e){const t=k.c(5),{onPointerDown:r,onDoubleClick:d}=e,{state:f,isMobile:u}=z();if(u||f==="collapsed")return null;let s,n;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={left:"var(--sidebar-width)"},n=o.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),t[0]=s,t[1]=n):(s=t[0],n=t[1]);let i;return t[2]!==d||t[3]!==r?(i=o.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:r,onDoubleClick:d,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:s,children:n}),t[2]=d,t[3]=r,t[4]=i):i=t[4],i}const R=240,V=400,Z="sidebar.width";function _(e){return Math.max(R,Math.min(V,e))}function ee(){const e=k.c(11),[t,r]=T(Z,te),d=N.useRef(null);let f;e[0]!==r||e[1]!==t?(f=a=>{a.preventDefault();const m=a.clientX,p=_(t),c=d.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),h=c?Array.from(c.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const x of h)x.style.transition="none";const j=x=>{const g=_(p+(x.clientX-m));c?.style.setProperty("--sidebar-width",`${g}px`)},S=x=>{const g=_(p+(x.clientX-m));r(g);for(const v of h)v.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",S)},e[0]=r,e[1]=t,e[2]=f):f=e[2];const u=f;let s;e[3]!==r?(s=()=>{r(R)},e[3]=r,e[4]=s):s=e[4];const n=s;let i;e[5]!==t?(i=_(t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==u||e[8]!==n||e[9]!==i?(l={width:i,wrapperRef:d,onStartResize:u,resetWidth:n},e[7]=u,e[8]=n,e[9]=i,e[10]=l):l=e[10],l}function te(e){return typeof e=="number"?_(e):R}function oe(){const e=k.c(22),t=X(),[r,d]=N.useState(!1);let f;if(e[0]!==t.capabilities||e[1]!==t.hostname||e[2]!==t.machineId||e[3]!==t.online){const j=G(t.capabilities);f=t.online?o.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[o.jsx("span",{className:"font-medium",children:t.hostname??t.machineId??"Desktop linked"}),o.jsx("span",{className:"text-muted-foreground",children:j.length>0?`Available: ${j.join(", ")}`:"No CLI agents detected"})]}):o.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=t.capabilities,e[1]=t.hostname,e[2]=t.machineId,e[3]=t.online,e[4]=f}else f=e[4];const u=f;let s;e[5]===Symbol.for("react.memo_cache_sentinel")?(s=()=>d(!0),e[5]=s):s=e[5];const n=t.online?"Desktop linked":"Connect your desktop";let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(q,{size:16}),e[6]=i):i=e[6];let l;e[7]!==t.online?(l=t.online&&o.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[7]=t.online,e[8]=l):l=e[8];let a;e[9]!==n||e[10]!==l?(a=o.jsx(M,{asChild:!0,children:o.jsxs(Y,{onClick:s,"aria-label":n,children:[i,l]})}),e[9]=n,e[10]=l,e[11]=a):a=e[11];let m;e[12]!==u?(m=o.jsx(O,{side:"bottom",children:u}),e[12]=u,e[13]=m):m=e[13];let p;e[14]!==a||e[15]!==m?(p=o.jsxs(A,{children:[a,m]}),e[14]=a,e[15]=m,e[16]=p):p=e[16];let c;e[17]!==r?(c=o.jsx(K,{open:r,onOpenChange:d}),e[17]=r,e[18]=c):c=e[18];let h;return e[19]!==p||e[20]!==c?(h=o.jsxs(o.Fragment,{children:[p,c]}),e[19]=p,e[20]=c,e[21]=h):h=e[21],h}const ie="sidebar.open";function re(){const e=k.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx(B,{}),e[0]=t):t=e[0],t}function lo(){const e=k.c(26),t=P(),[r,d]=T(ie,!1),{width:f,wrapperRef:u,onStartResize:s,resetWidth:n}=ee();let i,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(b.LogoLink,{}),l=o.jsx(U,{}),e[0]=i,e[1]=l):(i=e[0],l=e[1]);let a,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsxs(b.LeftColumn,{children:[i,l,o.jsx("span",{className:"hidden md:contents",children:o.jsx(b.Nav,{})}),o.jsx(b.TogglesSlot,{}),o.jsx(oe,{})]}),m=o.jsx(b.CenterSlot,{}),e[2]=a,e[3]=m):(a=e[2],m=e[3]);let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(b.Header,{children:[a,m,o.jsxs(b.RightColumn,{children:[o.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:o.jsx(b.TabsSlot,{})}),o.jsx(b.RightSlot,{})]})]}),e[4]=p):p=e[4];const c=`${f}px`;let h;e[5]!==c?(h={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},e[5]=c,e[6]=h):h=e[6];const j=h;let S;e[7]!==t||e[8]!==s||e[9]!==n?(S=!t&&o.jsxs(o.Fragment,{children:[o.jsx($,{}),o.jsx(Q,{onPointerDown:s,onDoubleClick:n})]}),e[7]=t,e[8]=s,e[9]=n,e[10]=S):S=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},e[11]=x):x=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(E,{className:"flex flex-col",style:x,children:o.jsx("div",{className:"flex flex-col h-full min-h-0",children:o.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:o.jsx(N.Suspense,{fallback:o.jsx(re,{}),children:o.jsx(D,{})})})})}),e[12]=g):g=e[12];let v;e[13]!==j||e[14]!==S||e[15]!==u?(v=o.jsxs(I,{ref:u,className:"flex-1 bg-sidebar relative min-h-0",style:j,children:[S,g]}),e[13]=j,e[14]=S,e[15]=u,e[16]=v):v=e[16];let y;e[17]!==t?(y=t&&o.jsx(J,{renderSidebar:se}),e[17]=t,e[18]=y):y=e[18];let w;e[19]!==v||e[20]!==y?(w=o.jsx(H,{children:o.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[p,v,y]})}),e[19]=v,e[20]=y,e[21]=w):w=e[21];let C;return e[22]!==d||e[23]!==r||e[24]!==w?(C=o.jsx(F,{children:o.jsx(b.Provider,{children:o.jsx(L,{open:r,onOpenChange:d,children:w})})}),e[22]=d,e[23]=r,e[24]=w,e[25]=C):C=e[25],C}function se(e){const{onClose:t}=e;return o.jsx("div",{className:"flex h-full",children:o.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:o.jsx(W,{onClose:t})})})}export{lo as default};
@@ -1,4 +1,4 @@
1
- import{da as tc,e2 as Fe,bU as Os,R as oe,Q as ge,aH as ti,cs as _i,aE as Ie,bS as mt,bm as Ve,aF as mr,e3 as rn,P as _e,e4 as Ii,e5 as ws,e6 as nc,cq as rc,e7 as ia,e8 as ic,e9 as sc,ea as oc,cg as sa,c8 as ac,b7 as ze,cr as lc,aG as On,bz as Ti,eb as cc,r as N,j as w,ec as oa,d9 as uc}from"./index-8tXBMeIK.js";import{A as aa,d as fc,e as dc,n as hc,f as pc,C as mc}from"./use-mcp-client-DNWGF-S6.js";import{U as fn,b as Cr,c as xs}from"./auth-CoZ_uLWv.js";import{B as Ci,c as Pi}from"./collections-B4qynpTl.js";import{R as Es}from"./index-TDcAzuSs.js";function yc(){const e=new aa({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0,code:{optimize:!1}});return tc(e),e}class gc{#e=yc();#t=new Map;#n=new WeakMap;getValidator(t){const n=this.#n.get(t);if(n)return n;const r=bc(t);let i=this.#t.get(r);i||(i=this.#e.compile(t),this.#t.set(r,i));const s=i,o=a=>s(a)?{valid:!0,data:a,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this.#e.errorsText(s.errors)};return this.#n.set(t,o),o}}function bc(e){return JSON.stringify(e,(t,n)=>n&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.keys(n).sort().map(r=>[r,n[r]])):n)}const Sc=new gc;var vc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},Oc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=Ve(n):typeof n=="number"?e.number=Ve(n):typeof n=="boolean"?e.boolean=Ve(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},wc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return Ve(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([Ve(n),Ve(r),...i.map(s=>Ve(s))])}return t==="boolean"?mt([Ve(!0),Ve(!1)]):!1}},xc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=oc();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Ec=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},Ac=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},_c=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},Ic=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},Tc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Cc=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Pc=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},Fc=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},jc=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},$c=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Dc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Nc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Rc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof nc){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},Mc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},Uc=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},kc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Lc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Bc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Cn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Cn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Cn(e[i],t[i]))}return!1}function Wc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Cn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Vc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},qc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Wc(),{message:"Array items must be unique"})}},Hc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Kc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Gc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},zc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Yc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof ic||e instanceof sc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Jc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Cn(r,i)),{message:"Value must match one of the enum values"})}},Zc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Cn(r,n),{message:"Value must equal the const value"})}},Xc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},Qc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},eu=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},tu=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},nu=[new Oc,new wc,new vc,new xc,new Ec,new $c,new kc,new Ac,new _c,new Ic,new Tc,new Cc,new Pc,new Fc,new jc,new Mc,new Dc,new Nc,new Rc,new Lc,new Bc,new Uc],ru=[new Qc,new Jc,new Zc,new Hc,new Kc,new Gc,new zc,new Yc,new eu,new Vc,new qc,new tu,new Xc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of nu)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=rc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of ru)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function iu(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var la=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||la("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?la("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Te,Et,kt,Qn,ur,wn,Vt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Te),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,Vt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Te)===this.CLOSED)return;he(this,Te,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,Vt,void 0),G(this,Te)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,su()));else throw new Error("Invalid URL")}catch{throw iu("An invalid or illegal string was specified")}he(this,Lt,fc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Te,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Te)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,Vt)&&clearTimeout(G(this,Vt)),G(this,Te)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Te,this.CLOSED),he(this,ct,void 0))}}Te=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,Vt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Te,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Te)!==this.CLOSED&&he(this,Te,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Te)===this.CLOSED)return;he(this,Te,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,Vt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function su(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class ou extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class au{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=dc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=hc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new ou(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Cr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const lu="mcp";class cu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,lu),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class uu extends pc{constructor(t,n){super(t,n)}send(t,n){const r=fu(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function fu(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class du extends mc{constructor(t,n){super(t,{jsonSchemaValidator:Sc,...n})}async listTools(t,n){return await this.request({method:"tools/list",params:t},ac,n)}}const hu=async(e,t,n)=>{const r=pu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new du({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},pu=(e,t,n)=>{if(e.type==="Websocket")return new cu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new au(new URL(e.url),s)}return new uu(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Ts=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Cs=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function mu(e){const t=n=>"connection"in e?hu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Ts(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Ts(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Cs(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Cs(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>yu({connection:n}):global[t]}});function yu(e){return mu(e)}const gu=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),bu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
1
+ import{da as tc,e2 as Fe,bU as Os,R as oe,Q as ge,aH as ti,cs as _i,aE as Ie,bS as mt,bm as Ve,aF as mr,e3 as rn,P as _e,e4 as Ii,e5 as ws,e6 as nc,cq as rc,e7 as ia,e8 as ic,e9 as sc,ea as oc,cg as sa,c8 as ac,b7 as ze,cr as lc,aG as On,bz as Ti,eb as cc,r as N,j as w,ec as oa,d9 as uc}from"./index-DJxRbue6.js";import{A as aa,d as fc,e as dc,n as hc,f as pc,C as mc}from"./use-mcp-client-DEVh0wrA.js";import{U as fn,b as Cr,c as xs}from"./auth-BR3kunRm.js";import{B as Ci,c as Pi}from"./collections-C6Af1Q9d.js";import{R as Es}from"./index-C2WXOm5m.js";function yc(){const e=new aa({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0,code:{optimize:!1}});return tc(e),e}class gc{#e=yc();#t=new Map;#n=new WeakMap;getValidator(t){const n=this.#n.get(t);if(n)return n;const r=bc(t);let i=this.#t.get(r);i||(i=this.#e.compile(t),this.#t.set(r,i));const s=i,o=a=>s(a)?{valid:!0,data:a,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this.#e.errorsText(s.errors)};return this.#n.set(t,o),o}}function bc(e){return JSON.stringify(e,(t,n)=>n&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.keys(n).sort().map(r=>[r,n[r]])):n)}const Sc=new gc;var vc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},Oc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=Ve(n):typeof n=="number"?e.number=Ve(n):typeof n=="boolean"?e.boolean=Ve(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},wc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return Ve(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([Ve(n),Ve(r),...i.map(s=>Ve(s))])}return t==="boolean"?mt([Ve(!0),Ve(!1)]):!1}},xc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=oc();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Ec=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},Ac=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},_c=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},Ic=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},Tc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Cc=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Pc=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},Fc=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},jc=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},$c=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Dc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Nc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Rc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof nc){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},Mc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},Uc=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},kc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Lc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Bc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Cn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Cn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Cn(e[i],t[i]))}return!1}function Wc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Cn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Vc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},qc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Wc(),{message:"Array items must be unique"})}},Hc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Kc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Gc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},zc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Yc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof ic||e instanceof sc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Jc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Cn(r,i)),{message:"Value must match one of the enum values"})}},Zc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Cn(r,n),{message:"Value must equal the const value"})}},Xc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},Qc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},eu=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},tu=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},nu=[new Oc,new wc,new vc,new xc,new Ec,new $c,new kc,new Ac,new _c,new Ic,new Tc,new Cc,new Pc,new Fc,new jc,new Mc,new Dc,new Nc,new Rc,new Lc,new Bc,new Uc],ru=[new Qc,new Jc,new Zc,new Hc,new Kc,new Gc,new zc,new Yc,new eu,new Vc,new qc,new tu,new Xc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of nu)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=rc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of ru)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function iu(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var la=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||la("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?la("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Te,Et,kt,Qn,ur,wn,Vt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Te),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,Vt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Te)===this.CLOSED)return;he(this,Te,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,Vt,void 0),G(this,Te)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,su()));else throw new Error("Invalid URL")}catch{throw iu("An invalid or illegal string was specified")}he(this,Lt,fc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Te,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Te)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,Vt)&&clearTimeout(G(this,Vt)),G(this,Te)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Te,this.CLOSED),he(this,ct,void 0))}}Te=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,Vt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Te,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Te)!==this.CLOSED&&he(this,Te,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Te)===this.CLOSED)return;he(this,Te,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,Vt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function su(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class ou extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class au{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=dc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=hc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new ou(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Cr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const lu="mcp";class cu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,lu),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class uu extends pc{constructor(t,n){super(t,n)}send(t,n){const r=fu(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function fu(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class du extends mc{constructor(t,n){super(t,{jsonSchemaValidator:Sc,...n})}async listTools(t,n){return await this.request({method:"tools/list",params:t},ac,n)}}const hu=async(e,t,n)=>{const r=pu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new du({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},pu=(e,t,n)=>{if(e.type==="Websocket")return new cu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new au(new URL(e.url),s)}return new uu(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Ts=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Cs=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function mu(e){const t=n=>"connection"in e?hu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Ts(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Ts(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Cs(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Cs(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>yu({connection:n}):global[t]}});function yu(e){return mu(e)}const gu=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),bu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
2
2
  The stepInput is the resolved value of the references in the input field. Example:
3
3
  {
4
4
  "input": {
@@ -1 +1 @@
1
- import{P as z,a as G,D as H,h as J,j as Q}from"./scroll-area-CmHcbXMX.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:v}=x,B=b&&!P,y=Q(D),F=new RegExp(`\\s${y}$`),h=j?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const K=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=K+u.index;let p=I+u[0].length;return B&&F.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:j=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:F="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:K=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,O=A||i&&R;if(!w&&!k&&!O)return;const $=O&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),O&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=K({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(F),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};
1
+ import{P as z,a as G,D as H,h as J,j as Q}from"./scroll-area-KSI08Bdg.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:v}=x,B=b&&!P,y=Q(D),F=new RegExp(`\\s${y}$`),h=j?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const K=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=K+u.index;let p=I+u[0].length;return B&&F.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:j=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:F="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:K=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,O=A||i&&R;if(!w&&!k&&!O)return;const $=O&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),O&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=K({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(F),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};
@@ -1,4 +1,4 @@
1
- import{e as le,r as K,f as bt,p as Be,j as t,B as Z,n as Ce,c as ce,K as it,m as yt,s as ss,d as rs,t as xt,E as ls}from"./index-8tXBMeIK.js";import{S as os}from"./search-input-B9MwoGwA.js";import{P as Me}from"./index-BWEcSbo6.js";import{E as wt}from"./empty-state-DjKgE-Pk.js";import{R as as}from"./require-capability-DmyLmLDX.js";import{o as kt}from"./pair-C7vZKi4N.js";import{B as rt}from"./badge-CHEpx28S.js";import{P as ct,a as dt,b as mt}from"./popover-DJWCo8Vd.js";import{b as Ze,T as et,a as tt}from"./tooltip-C5K2_SxZ.js";import{i as ft}from"./Check-LvE_sA_T.js";import{a as Xe}from"./Eye-efxxq50W.js";import{n as Tt}from"./Globe01-CjvlAfxx.js";import{i as Pt}from"./FilterLines-CKVrZUkw.js";import{i as ns}from"./Key01-CM-woE_3.js";import{i as is}from"./Play-DmzTJXzi.js";import{aa as cs,ab as ds,R as ms,G as us}from"./agent-icon-BfnzytvB.js";import{M as Mt}from"./monaco-editor-CthqrNYr.js";import{u as xs}from"./use-members-DdhBt1i2.js";import{u as _t}from"./use-connection-3AMSWY4d.js";import{a as fs,u as ps,W as hs}from"./use-mcp-client-DNWGF-S6.js";import{a as gs}from"./use-virtual-mcp-C8Cvizcb.js";import{n as Qe}from"./Container-6Ia5IPn9.js";import{c as js}from"./SwitchHorizontal01-Bs5IR9Wx.js";import{s as vs}from"./Plus-tVXcrY0B.js";import{s as Ns}from"./Trash01-DqblPjZX.js";import{I as Ge}from"./input-C4KTJyA0.js";import{g as bs,b as Dt,f as st,a as At,c as pt,d as ys,e as Lt,h as Vt,A as ws,T as Ss,i as Is,M as ht}from"./automation-runs-DkxIxGFl.js";import{S as lt,a as ot,b as at,c as Re,d as nt}from"./select-LnPBQlwq.js";import{S as Cs}from"./scroll-area-CmHcbXMX.js";import{t as Ut}from"./ChevronDown-DHa3IqAQ.js";import{C as ks}from"./calendar-DghLpU44.js";import{T as Ts}from"./textarea-CSY57hUQ.js";import{C as Kt}from"./collection-tabs-DutpbC-B.js";import{S as Ms}from"./switch-BfYG3ZgX.js";import{L as _s}from"./label-BHauIX0M.js";import{I as qe}from"./integration-icon-BykvWwAZ.js";import{A as qt}from"./avatar-B9Rc9EUw.js";import{A as Ds,a as Ls,b as Rs}from"./alert-BDRU9ZC5.js";import{C as Bt}from"./card-Coyfi-jZ.js";import{K as ke}from"./monitoring-stats-row-CqZVa71v.js";import{u as Ht}from"./studio-tools-DA1cqt_R.js";import{g as Fs}from"./connection-slug-eyAPH6o3.js";import{u as $s}from"./useSuspenseInfiniteQuery-BaHJXY7X.js";import{d as zs,S as Os,a as Es,b as Ps}from"./sheet-Da8oGaXl.js";import{T as De,a as ut,b as Jt,c as Gt,d as Qt,e as oe}from"./table-iiadVZtP.js";import{n as As}from"./ChevronUp-CLtd7-t0.js";import{u as Vs}from"./use-infinite-scroll-BdWMzn-I.js";import{c as Us,b as Ks}from"./use-automations-EnJ_KtpR.js";import"./SearchMd-Dnr7mDHJ.js";import"./sidebar-Dq7ywuwS.js";import"./LayoutLeft-BmVC9DfI.js";import"./use-capability-IPmcsvJ7.js";import"./access-gate-nK_lXbty.js";import"./capability-load-error-BHy5hyOG.js";import"./Stars01-C5oxzVSS.js";import"./XCircle-B2BGaOFD.js";import"./ChevronRight-BpOFC9UY.js";import"./use-clock-tick--JSADwca.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BrRxB_CX.js";import"./file-type-icon-B4sc4oJu.js";import"./dialog-DQXXelJD.js";import"./X-CbJVsm7w.js";import"./ZoomOut-v_pNeFH6.js";import"./content-blocks-o63cs2vh.js";import"./types-By3Vc6ET.js";import"./chat-context-DgDbSHT-.js";import"./tab-id-D-V9CLoC.js";import"./watch-sse-pool-CI_P_tLE.js";import"./decopilot-sse-pool-DysvnVnY.js";import"./use-ai-providers-yQU6QFt7.js";import"./use-organization-settings-D-mp9Nom.js";import"./AlertCircle-BIYTfeei.js";import"./Star01-DJobPrMv.js";import"./XClose-CCcsmvcf.js";import"./ZapSquare-uGoXnGDV.js";import"./Tool01-DF4tFmg4.js";import"./Monitor01-DGw3VSEj.js";import"./Upload01-D7EnwNsF.js";import"./shell-layout-BppWbDed.js";import"./Users03-Bu2EMbkq.js";import"./Stars02-Jq5Pm_Dt.js";import"./CheckCircle-B0oBxRpb.js";import"./Zap-CR9V8BtC.js";import"./required-auth-layout-Dxuok_Oj.js";import"./useRouterState-Bu9FaaK6.js";import"./use-org-sso-DcIpAKt9.js";import"./LinkExternal01-G3vtJN4n.js";import"./Palette-e1wrOTVP.js";import"./use-navigate-to-agent-BGaWNHVu.js";import"./use-mcp-prompts-BFE67i8g.js";import"./form-544HFX7E.js";import"./spinner-X0P6H8XF.js";import"./RefreshCcw01-BY57sDsA.js";import"./ArrowUpRight-BGqBIDum.js";import"./ChevronLeft-X1rMYFmV.js";import"./DotsVertical-CAhIPJgX.js";import"./HardDrive-C-TQ9655.js";import"./Sun-BxAwIgVe.js";import"./Settings02-vpvzCEqI.js";import"./Shield01-kHOUdgzv.js";import"./User01-CASt-NvR.js";import"./Users01-DH1hmdgk.js";import"./index-bvkMWHxC.js";import"./use-org-auth-client-BKj503w6.js";import"./use-collections-gQX1aIBb.js";import"./auth-CoZ_uLWv.js";import"./useInfiniteQuery-BxZ0ZIEY.js";import"./task-status-8O-9w38P.js";import"./checkbox-CUxwz-XI.js";import"./command-BV689sDo.js";import"./index-BiPry9Eg.js";import"./index-TDcAzuSs.js";const vt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Le(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{e as le,r as K,f as bt,p as Be,j as t,B as Z,n as Ce,c as ce,K as it,m as yt,s as ss,d as rs,t as xt,E as ls}from"./index-DJxRbue6.js";import{S as os}from"./search-input-LClJsC0R.js";import{P as Me}from"./index-qpz1aTWR.js";import{E as wt}from"./empty-state-pMCkbkbn.js";import{R as as}from"./require-capability-CP41TlGl.js";import{o as kt}from"./pair-B3JvusRD.js";import{B as rt}from"./badge-B0F_sgaz.js";import{P as ct,a as dt,b as mt}from"./popover-CxSOgrnQ.js";import{b as Ze,T as et,a as tt}from"./tooltip-BsiBfMRx.js";import{i as ft}from"./Check-BE5llaCo.js";import{a as Xe}from"./Eye-DeAUvKsB.js";import{n as Tt}from"./Globe01-9a7DzMR4.js";import{i as Pt}from"./FilterLines-LorPzSpm.js";import{i as ns}from"./Key01-z4ZY9P3F.js";import{i as is}from"./Play-DUFgIaEa.js";import{aa as cs,ab as ds,R as ms,G as us}from"./agent-icon-iCRxqonQ.js";import{M as Mt}from"./monaco-editor-D9q3BMcP.js";import{u as xs}from"./use-members-Dyv5s6Ln.js";import{u as _t}from"./use-connection-DBT-O2Ot.js";import{a as fs,u as ps,W as hs}from"./use-mcp-client-DEVh0wrA.js";import{a as gs}from"./use-virtual-mcp-CsBEf_ak.js";import{n as Qe}from"./Container-DxPsYKnX.js";import{c as js}from"./SwitchHorizontal01-iSGzLP3G.js";import{s as vs}from"./Plus-C9BCwyU7.js";import{s as Ns}from"./Trash01-HFZG34bv.js";import{I as Ge}from"./input-DrBjEN1K.js";import{g as bs,b as Dt,f as st,a as At,c as pt,d as ys,e as Lt,h as Vt,A as ws,T as Ss,i as Is,M as ht}from"./automation-runs-sZhsYDdn.js";import{S as lt,a as ot,b as at,c as Re,d as nt}from"./select-BD3-KIUg.js";import{S as Cs}from"./scroll-area-KSI08Bdg.js";import{t as Ut}from"./ChevronDown-igtaXLHI.js";import{C as ks}from"./calendar-5jwZC3XX.js";import{T as Ts}from"./textarea-H9HcvvO3.js";import{C as Kt}from"./collection-tabs-BlMNH4hh.js";import{S as Ms}from"./switch-BwW6aBRl.js";import{L as _s}from"./label-DPtACVyH.js";import{I as qe}from"./integration-icon-CBmdz72e.js";import{A as qt}from"./avatar-I3WwYEoT.js";import{A as Ds,a as Ls,b as Rs}from"./alert-Cb2hF1jc.js";import{C as Bt}from"./card-BFRGLx6P.js";import{K as ke}from"./monitoring-stats-row-DK9_KPle.js";import{u as Ht}from"./studio-tools-CyXwEskA.js";import{g as Fs}from"./connection-slug-eyAPH6o3.js";import{u as $s}from"./useSuspenseInfiniteQuery-CAwDmp_D.js";import{d as zs,S as Os,a as Es,b as Ps}from"./sheet-BB5BvZRD.js";import{T as De,a as ut,b as Jt,c as Gt,d as Qt,e as oe}from"./table-DRZq5QeC.js";import{n as As}from"./ChevronUp-CEzo-UYH.js";import{u as Vs}from"./use-infinite-scroll-DmcTgb_Z.js";import{c as Us,b as Ks}from"./use-automations-BFkAWLBs.js";import"./SearchMd-DL_JjGfK.js";import"./sidebar-DQGireBE.js";import"./LayoutLeft-BlcyI03M.js";import"./use-capability-BgmZSEFV.js";import"./access-gate-XBdT3iPT.js";import"./capability-load-error-vjCbAJOq.js";import"./Stars01-Csutpvum.js";import"./XCircle-THthyWG1.js";import"./ChevronRight-B2MPJG0Y.js";import"./use-clock-tick-CaCQW7f3.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Be1923zu.js";import"./file-type-icon-CjY-L87B.js";import"./dialog-BNTma1n7.js";import"./X-Dz8XfAUE.js";import"./ZoomOut-DC7naWv-.js";import"./content-blocks-o63cs2vh.js";import"./types-BDYvGU56.js";import"./chat-context-DZNmbrat.js";import"./tab-id-DBFKLiy5.js";import"./watch-sse-pool-LhxM1ddy.js";import"./decopilot-sse-pool-BTIZKXdE.js";import"./use-ai-providers-CLGsHtDy.js";import"./use-organization-settings-BmyIHq31.js";import"./AlertCircle-BhiQLzAa.js";import"./Star01-DVJ2VIkN.js";import"./XClose-9eaBHjn_.js";import"./ZapSquare-C-w_2LWP.js";import"./Tool01-DnoUjwuW.js";import"./Monitor01-Bz9bsY6F.js";import"./Upload01-D0zblu1D.js";import"./shell-layout-C11kPZct.js";import"./Users03-CsJCzoB9.js";import"./Stars02-EFTlH55e.js";import"./CheckCircle-BZzInqah.js";import"./Zap-4WoTcb5S.js";import"./required-auth-layout-Bakgp2v2.js";import"./useRouterState-CpJi3eeH.js";import"./use-org-sso-Dn-IiDHF.js";import"./LinkExternal01-wGfNOyG-.js";import"./Palette-cOZdFvCP.js";import"./use-navigate-to-agent-em-bmKWL.js";import"./use-mcp-prompts-wVJtCACz.js";import"./form-D08b7dFe.js";import"./spinner-ph9V8K3G.js";import"./RefreshCcw01-DcRdM_Fc.js";import"./ArrowUpRight-zWQi9yeG.js";import"./ChevronLeft-D7ypV5AW.js";import"./DotsVertical-Bqz0rpkg.js";import"./HardDrive-D6xAeAT3.js";import"./Sun-C4ItnLzg.js";import"./Settings02-B67J_b-Z.js";import"./Shield01-12NhwCwh.js";import"./User01-GmyJVsk_.js";import"./Users01-D_irbv8j.js";import"./index-CYfMTPm6.js";import"./use-org-auth-client-RfCN5nxl.js";import"./use-collections-LXN6LFio.js";import"./auth-BR3kunRm.js";import"./useInfiniteQuery-e_b9pntx.js";import"./task-status-Rw4KZiD7.js";import"./checkbox-DInBbeSC.js";import"./command-CVb7Xyz-.js";import"./index-CxFf1mIw.js";import"./index-C2WXOm5m.js";const vt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Le(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function Rt(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Ft(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=vt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,vt.maxJsonRenderSize)+`
4
4
 
@@ -1 +1 @@
1
- import{e as f,c as d,r as p,j as r}from"./index-8tXBMeIK.js";import{m as w}from"./sidebar-Dq7ywuwS.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};
1
+ import{e as f,c as d,r as p,j as r}from"./index-DJxRbue6.js";import{m as w}from"./sidebar-DQGireBE.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};
@@ -1 +1 @@
1
- import{e as c,g as p,j as s,l as u,N as a}from"./index-8tXBMeIK.js";import{a as x}from"./use-capability-IPmcsvJ7.js";import{C as j}from"./capability-load-error-BHy5hyOG.js";function v(){const t=c.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:f,error:g}=x();if(f){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(g){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
1
+ import{e as c,g as p,j as s,l as u,N as a}from"./index-DJxRbue6.js";import{a as x}from"./use-capability-BgmZSEFV.js";import{C as j}from"./capability-load-error-vjCbAJOq.js";function v(){const t=c.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:f,error:g}=x();if(f){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(g){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
@@ -1 +1 @@
1
- import{e as s,c as a,j as d}from"./index-8tXBMeIK.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
1
+ import{e as s,c as a,j as d}from"./index-DJxRbue6.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
@@ -1 +1 @@
1
- import{e as A,j as h,r as z,c as _}from"./index-8tXBMeIK.js";import{n as L}from"./Container-6Ia5IPn9.js";import{A as k}from"./agent-icon-BfnzytvB.js";const C={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},Z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},y={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},M={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function q(E){const e=A.c(12),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w;if(t?.startsWith("icon://")||t?.includes("#agentcolor=")){const r=M[n];let l;return e[0]!==o||e[1]!==t||e[2]!==s||e[3]!==r?(l=h.jsx(k,{icon:t,name:s,size:r,className:o}),e[0]=o,e[1]=t,e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const g=t??"no-icon";let i;return e[5]!==o||e[6]!==c||e[7]!==t||e[8]!==s||e[9]!==n||e[10]!==g?(i=h.jsx(R,{icon:t,name:s,size:n,className:o,fallbackIcon:c},g),e[5]=o,e[6]=c,e[7]=t,e[8]=s,e[9]=n,e[10]=g,e[11]=i):i=e[11],i}function R(E){const e=A.c(24),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w,[g,i]=z.useState(!1),r=!!t&&g,l=C[n],b=Z[n];let a;e[0]!==o||e[1]!==l||e[2]!==b?(a=_("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,b,o),e[0]=o,e[1]=l,e[2]=b,e[3]=a):a=e[3];const p=t||void 0,N=!r&&"hidden";let m;e[4]!==N?(m=_("h-full w-full object-cover",N),e[4]=N,e[5]=m):m=e[5];let I,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=()=>i(!1),S=()=>i(!0),e[6]=I,e[7]=S):(I=e[6],S=e[7]);let d;e[8]!==s||e[9]!==p||e[10]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:I,onLoad:S}),e[8]=s,e[9]=p,e[10]=m,e[11]=d):d=e[11];const v=r&&"hidden";let f;e[12]!==v?(f=_("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=f):f=e[13];let x;e[14]!==c||e[15]!==n?(x=c??h.jsx(L,{size:y[n],className:"text-muted-foreground"}),e[14]=c,e[15]=n,e[16]=x):x=e[16];let u;e[17]!==f||e[18]!==x?(u=h.jsx("div",{className:f,children:x}),e[17]=f,e[18]=x,e[19]=u):u=e[19];let j;return e[20]!==d||e[21]!==u||e[22]!==a?(j=h.jsxs("div",{className:a,children:[d,u]}),e[20]=d,e[21]=u,e[22]=a,e[23]=j):j=e[23],j}export{q as I};
1
+ import{e as A,j as h,r as z,c as _}from"./index-DJxRbue6.js";import{n as L}from"./Container-DxPsYKnX.js";import{A as k}from"./agent-icon-iCRxqonQ.js";const C={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},Z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},y={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},M={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function q(E){const e=A.c(12),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w;if(t?.startsWith("icon://")||t?.includes("#agentcolor=")){const r=M[n];let l;return e[0]!==o||e[1]!==t||e[2]!==s||e[3]!==r?(l=h.jsx(k,{icon:t,name:s,size:r,className:o}),e[0]=o,e[1]=t,e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const g=t??"no-icon";let i;return e[5]!==o||e[6]!==c||e[7]!==t||e[8]!==s||e[9]!==n||e[10]!==g?(i=h.jsx(R,{icon:t,name:s,size:n,className:o,fallbackIcon:c},g),e[5]=o,e[6]=c,e[7]=t,e[8]=s,e[9]=n,e[10]=g,e[11]=i):i=e[11],i}function R(E){const e=A.c(24),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w,[g,i]=z.useState(!1),r=!!t&&g,l=C[n],b=Z[n];let a;e[0]!==o||e[1]!==l||e[2]!==b?(a=_("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,b,o),e[0]=o,e[1]=l,e[2]=b,e[3]=a):a=e[3];const p=t||void 0,N=!r&&"hidden";let m;e[4]!==N?(m=_("h-full w-full object-cover",N),e[4]=N,e[5]=m):m=e[5];let I,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=()=>i(!1),S=()=>i(!0),e[6]=I,e[7]=S):(I=e[6],S=e[7]);let d;e[8]!==s||e[9]!==p||e[10]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:I,onLoad:S}),e[8]=s,e[9]=p,e[10]=m,e[11]=d):d=e[11];const v=r&&"hidden";let f;e[12]!==v?(f=_("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=f):f=e[13];let x;e[14]!==c||e[15]!==n?(x=c??h.jsx(L,{size:y[n],className:"text-muted-foreground"}),e[14]=c,e[15]=n,e[16]=x):x=e[16];let u;e[17]!==f||e[18]!==x?(u=h.jsx("div",{className:f,children:x}),e[17]=f,e[18]=x,e[19]=u):u=e[19];let j;return e[20]!==d||e[21]!==u||e[22]!==a?(j=h.jsxs("div",{className:a,children:[d,u]}),e[20]=d,e[21]=u,e[22]=a,e[23]=j):j=e[23],j}export{q as I};
@@ -1 +1 @@
1
- import{e as n,c as r,j as i,bt as p}from"./index-8tXBMeIK.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
1
+ import{e as n,c as r,j as i,bt as p}from"./index-DJxRbue6.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
@@ -1 +1 @@
1
- import{e as C,r as i,c as A,j as a,aR as V}from"./index-8tXBMeIK.js";import{P as E}from"./index-BWEcSbo6.js";const H=i.createContext(null);function z(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.tabsEl)return null;let c;return e[0]!==l||e[1]!==s.tabsEl?(c=V.createPortal(l,s.tabsEl),e[0]=l,e[1]=s.tabsEl,e[2]=c):c=e[2],c}function D(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.actionsEl)return null;let c;return e[0]!==l||e[1]!==s.actionsEl?(c=V.createPortal(l,s.actionsEl),e[0]=l,e[1]=s.actionsEl,e[2]=c):c=e[2],c}const B=D;function F(x){const e=C.c(21),{children:l,breadcrumb:s,hideHeader:c}=x;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={leftEl:null,tabsEl:null,actionsEl:null},e[0]=b):b=e[0];const[w,g]=i.useState(b),N=i.useRef(null),P=i.useRef(null),L=i.useRef(null);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=t=>{N.current=t,t&&g(n=>n.leftEl===t?n:{...n,leftEl:t})},e[1]=h):h=e[1];const $=h;let R;e[2]===Symbol.for("react.memo_cache_sentinel")?(R=t=>{P.current=t,t&&g(n=>n.tabsEl===t?n:{...n,tabsEl:t})},e[2]=R):R=e[2];const _=R;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t=>{L.current=t,t&&g(n=>n.actionsEl===t?n:{...n,actionsEl:t})},e[3]=d):d=e[3];const k=d,p=c&&"hidden";let o;e[4]!==p?(o=A(p),e[4]=p,e[5]=o):o=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx("div",{ref:$,className:"flex items-center gap-2 min-w-0"}),e[6]=j):j=e[6];let r;e[7]!==s?(r=a.jsxs(E.Header.Left,{children:[s,j]}),e[7]=s,e[8]=r):r=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs(E.Header.Right,{children:[a.jsx("div",{ref:_,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),a.jsx("div",{ref:k,className:"flex items-center gap-2 shrink-0"})]}),e[9]=y):y=e[9];let f;e[10]!==o||e[11]!==r?(f=a.jsxs(E.Header,{className:o,children:[r,y]}),e[10]=o,e[11]=r,e[12]=f):f=e[12];let m;e[13]!==l?(m=a.jsx(E.Content,{children:l}),e[13]=l,e[14]=m):m=e[14];let u;e[15]!==f||e[16]!==m?(u=a.jsxs(E,{children:[f,m]}),e[15]=f,e[16]=m,e[17]=u):u=e[17];let S;return e[18]!==w||e[19]!==u?(S=a.jsx(H,{value:w,children:u}),e[18]=w,e[19]=u,e[20]=S):S=e[20],S}export{F as V,B as a,z as b};
1
+ import{e as C,r as i,c as A,j as a,aR as V}from"./index-DJxRbue6.js";import{P as E}from"./index-qpz1aTWR.js";const H=i.createContext(null);function z(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.tabsEl)return null;let c;return e[0]!==l||e[1]!==s.tabsEl?(c=V.createPortal(l,s.tabsEl),e[0]=l,e[1]=s.tabsEl,e[2]=c):c=e[2],c}function D(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.actionsEl)return null;let c;return e[0]!==l||e[1]!==s.actionsEl?(c=V.createPortal(l,s.actionsEl),e[0]=l,e[1]=s.actionsEl,e[2]=c):c=e[2],c}const B=D;function F(x){const e=C.c(21),{children:l,breadcrumb:s,hideHeader:c}=x;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={leftEl:null,tabsEl:null,actionsEl:null},e[0]=b):b=e[0];const[w,g]=i.useState(b),N=i.useRef(null),P=i.useRef(null),L=i.useRef(null);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=t=>{N.current=t,t&&g(n=>n.leftEl===t?n:{...n,leftEl:t})},e[1]=h):h=e[1];const $=h;let R;e[2]===Symbol.for("react.memo_cache_sentinel")?(R=t=>{P.current=t,t&&g(n=>n.tabsEl===t?n:{...n,tabsEl:t})},e[2]=R):R=e[2];const _=R;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t=>{L.current=t,t&&g(n=>n.actionsEl===t?n:{...n,actionsEl:t})},e[3]=d):d=e[3];const k=d,p=c&&"hidden";let o;e[4]!==p?(o=A(p),e[4]=p,e[5]=o):o=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx("div",{ref:$,className:"flex items-center gap-2 min-w-0"}),e[6]=j):j=e[6];let r;e[7]!==s?(r=a.jsxs(E.Header.Left,{children:[s,j]}),e[7]=s,e[8]=r):r=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs(E.Header.Right,{children:[a.jsx("div",{ref:_,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),a.jsx("div",{ref:k,className:"flex items-center gap-2 shrink-0"})]}),e[9]=y):y=e[9];let f;e[10]!==o||e[11]!==r?(f=a.jsxs(E.Header,{className:o,children:[r,y]}),e[10]=o,e[11]=r,e[12]=f):f=e[12];let m;e[13]!==l?(m=a.jsx(E.Content,{children:l}),e[13]=l,e[14]=m):m=e[14];let u;e[15]!==f||e[16]!==m?(u=a.jsxs(E,{children:[f,m]}),e[15]=f,e[16]=m,e[17]=u):u=e[17];let S;return e[18]!==w||e[19]!==u?(S=a.jsx(H,{value:w,children:u}),e[18]=w,e[19]=u,e[20]=S):S=e[20],S}export{F as V,B as a,z as b};
@@ -1 +1 @@
1
- import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-8tXBMeIK.js";import{I}from"./input-C4KTJyA0.js";import{A as de}from"./auth-split-layout-ubD2g2LB.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
1
+ import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-DJxRbue6.js";import{I}from"./input-DrBjEN1K.js";import{A as de}from"./auth-split-layout-CKdvz2MS.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
@@ -1 +1 @@
1
- import{d as x,a as N,e as z,b as D}from"./auth-CoZ_uLWv.js";function E(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}function H(){return window.location.origin}function C(){try{const t=window.location.hostname;return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}const M=new Map,R="mcp:oauth:callback:";class W{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${H()}/oauth/callback`,this._windowMode=e.windowMode??"popup";const n=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...n&&{scope:n}},M.set(E(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab"){if(!window.open(e.toString(),"_blank"))throw new Error("Tab was blocked")}else{const o=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${o},top=${s},popup=yes`)&&!window.open(e.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){M.delete(E(this.serverUrl))}}async function G(t){const e=t.meshUrl??window.location.origin,n=t.orgSlug?`/api/${encodeURIComponent(t.orgSlug)}/mcp/${t.connectionId}`:`/mcp/${t.connectionId}`,r=new URL(n,e),o=new W({serverUrl:r.href,clientName:t.clientName,clientUri:t.clientUri,callbackUrl:t.callbackUrl,scope:t.scope,windowMode:t.windowMode}),s={fn:null};try{const i=new Promise((l,d)=>{const k=t.timeout||12e4;let b,p=!1;const L=o.state(),A=`${R}${L}`,h=()=>{window.removeEventListener("message",v),window.removeEventListener("storage",O),clearTimeout(b);try{localStorage.removeItem(A)}catch{}};s.fn=u=>{p||(p=!0,h(),d(u))};const U=async u=>{if(p)return;if(p=!0,!u.success){h(),d(new Error(u.error||"OAuth authentication failed"));return}const{code:m,state:$}=u;if(!m){h(),d(new Error("Missing authorization code"));return}if(o.getStoredState()!==$){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const T=(await x(r))?.authorization_servers?.[0]||r,S=await N(T),g=o.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const P=o.codeVerifier(),V=await z(T,{metadata:S,clientInformation:g,authorizationCode:m,codeVerifier:P,redirectUri:o.redirectUrl,resource:new URL(r)});h(),l({tokens:V,clientId:g.client_id??null,clientSecret:"client_secret"in g?g.client_secret:null,tokenEndpoint:S?.token_endpoint??null,userinfoEndpoint:S?.userinfo_endpoint??null})}catch(I){h(),d(I)}},v=async u=>{!C()&&u.origin!==window.location.origin||u.data?.type==="mcp:oauth:callback"&&await U(u.data)},O=async u=>{if(!(u.key!==A||!u.newValue))try{const m=JSON.parse(u.newValue);await U(m)}catch{}};window.addEventListener("message",v),window.addEventListener("storage",O),b=setTimeout(()=>{p||(p=!0,h(),d(new Error("OAuth authentication timeout")))},k)});if(i.catch(()=>{}),await D(o,{serverUrl:r})==="REDIRECT"){const l=await i,d=l.tokens;return{token:l.tokens.access_token,tokenInfo:{accessToken:l.tokens.access_token,refreshToken:l.tokens.refresh_token??null,expiresIn:l.tokens.expires_in??null,scope:l.tokens.scope??null,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint,userinfoEndpoint:l.userinfoEndpoint,idToken:typeof d.id_token=="string"?d.id_token:null},error:null}}const a=o.tokens(),w=o.clientInformation(),f=a;return{token:a?.access_token||null,tokenInfo:a?{accessToken:a.access_token,refreshToken:a.refresh_token??null,expiresIn:a.expires_in??null,scope:a.scope??null,clientId:w?.client_id??null,clientSecret:w&&"client_secret"in w?w.client_secret:null,tokenEndpoint:null,userinfoEndpoint:null,idToken:f&&typeof f.id_token=="string"?f.id_token:null}:null,error:null}}catch(i){return s.fn&&s.fn(i instanceof Error?i:new Error(String(i))),{token:null,tokenInfo:null,error:i instanceof Error?i.message:String(i)}}finally{o.cleanup()}}function y(t,e){if(window.opener&&!window.opener.closed){const n=C()?"*":window.location.origin;return window.opener.postMessage(t,n),!0}if(e)try{const n=`${R}${e}`;return localStorage.setItem(n,JSON.stringify(t)),!0}catch{}return!1}async function X(){const t=new URLSearchParams(window.location.search),e=t.get("code");let n=t.get("state");const r=t.get("error"),o=t.get("error_description");let s=n;if(n)try{const c=atob(n),a=JSON.parse(c);a.clientState&&(s=a.clientState)}catch{}if(r){const c=o||r;return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}if(!e||!n){const c="Missing code or state parameter";return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}return n=s||n,y({type:"mcp:oauth:callback",success:!0,code:e,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function j(t){try{const e=_(),n=e?new URL(t,e):new URL(t),r=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return r?r[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function J(t){try{const e=_();return(e?new URL(t,e):new URL(t)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function K(t,e,n){try{const r=`/api/${encodeURIComponent(e)}/connections/${t}/oauth-token/status`,o=n?new URL(r,n).href:r,s=_(),i=!n||new URL(n).origin===s,c=await fetch(o,{credentials:i?"include":"omit"});return c.ok?{hasToken:(await c.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function q({url:t,token:e,orgId:n,meshUrl:r}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const s=await fetch(t,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),i=j(t),c=J(t),a=_(),w=r??(a?new URL(t,a).origin:new URL(t).origin);if(s.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(i&&c?await K(i,c,w):{hasToken:!1}).hasToken};let f;try{const k=await s.json();f=k.error||k.message}catch{}return s.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:f||`HTTP ${s.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!s.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:f||`HTTP ${s.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o.message}}}export{G as a,X as h,q as i};
1
+ import{d as x,a as N,e as z,b as D}from"./auth-BR3kunRm.js";function E(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}function H(){return window.location.origin}function C(){try{const t=window.location.hostname;return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}const M=new Map,R="mcp:oauth:callback:";class W{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${H()}/oauth/callback`,this._windowMode=e.windowMode??"popup";const n=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...n&&{scope:n}},M.set(E(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab"){if(!window.open(e.toString(),"_blank"))throw new Error("Tab was blocked")}else{const o=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${o},top=${s},popup=yes`)&&!window.open(e.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){M.delete(E(this.serverUrl))}}async function G(t){const e=t.meshUrl??window.location.origin,n=t.orgSlug?`/api/${encodeURIComponent(t.orgSlug)}/mcp/${t.connectionId}`:`/mcp/${t.connectionId}`,r=new URL(n,e),o=new W({serverUrl:r.href,clientName:t.clientName,clientUri:t.clientUri,callbackUrl:t.callbackUrl,scope:t.scope,windowMode:t.windowMode}),s={fn:null};try{const i=new Promise((l,d)=>{const k=t.timeout||12e4;let b,p=!1;const L=o.state(),A=`${R}${L}`,h=()=>{window.removeEventListener("message",v),window.removeEventListener("storage",O),clearTimeout(b);try{localStorage.removeItem(A)}catch{}};s.fn=u=>{p||(p=!0,h(),d(u))};const U=async u=>{if(p)return;if(p=!0,!u.success){h(),d(new Error(u.error||"OAuth authentication failed"));return}const{code:m,state:$}=u;if(!m){h(),d(new Error("Missing authorization code"));return}if(o.getStoredState()!==$){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const T=(await x(r))?.authorization_servers?.[0]||r,S=await N(T),g=o.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const P=o.codeVerifier(),V=await z(T,{metadata:S,clientInformation:g,authorizationCode:m,codeVerifier:P,redirectUri:o.redirectUrl,resource:new URL(r)});h(),l({tokens:V,clientId:g.client_id??null,clientSecret:"client_secret"in g?g.client_secret:null,tokenEndpoint:S?.token_endpoint??null,userinfoEndpoint:S?.userinfo_endpoint??null})}catch(I){h(),d(I)}},v=async u=>{!C()&&u.origin!==window.location.origin||u.data?.type==="mcp:oauth:callback"&&await U(u.data)},O=async u=>{if(!(u.key!==A||!u.newValue))try{const m=JSON.parse(u.newValue);await U(m)}catch{}};window.addEventListener("message",v),window.addEventListener("storage",O),b=setTimeout(()=>{p||(p=!0,h(),d(new Error("OAuth authentication timeout")))},k)});if(i.catch(()=>{}),await D(o,{serverUrl:r})==="REDIRECT"){const l=await i,d=l.tokens;return{token:l.tokens.access_token,tokenInfo:{accessToken:l.tokens.access_token,refreshToken:l.tokens.refresh_token??null,expiresIn:l.tokens.expires_in??null,scope:l.tokens.scope??null,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint,userinfoEndpoint:l.userinfoEndpoint,idToken:typeof d.id_token=="string"?d.id_token:null},error:null}}const a=o.tokens(),w=o.clientInformation(),f=a;return{token:a?.access_token||null,tokenInfo:a?{accessToken:a.access_token,refreshToken:a.refresh_token??null,expiresIn:a.expires_in??null,scope:a.scope??null,clientId:w?.client_id??null,clientSecret:w&&"client_secret"in w?w.client_secret:null,tokenEndpoint:null,userinfoEndpoint:null,idToken:f&&typeof f.id_token=="string"?f.id_token:null}:null,error:null}}catch(i){return s.fn&&s.fn(i instanceof Error?i:new Error(String(i))),{token:null,tokenInfo:null,error:i instanceof Error?i.message:String(i)}}finally{o.cleanup()}}function y(t,e){if(window.opener&&!window.opener.closed){const n=C()?"*":window.location.origin;return window.opener.postMessage(t,n),!0}if(e)try{const n=`${R}${e}`;return localStorage.setItem(n,JSON.stringify(t)),!0}catch{}return!1}async function X(){const t=new URLSearchParams(window.location.search),e=t.get("code");let n=t.get("state");const r=t.get("error"),o=t.get("error_description");let s=n;if(n)try{const c=atob(n),a=JSON.parse(c);a.clientState&&(s=a.clientState)}catch{}if(r){const c=o||r;return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}if(!e||!n){const c="Missing code or state parameter";return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}return n=s||n,y({type:"mcp:oauth:callback",success:!0,code:e,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function j(t){try{const e=_(),n=e?new URL(t,e):new URL(t),r=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return r?r[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function J(t){try{const e=_();return(e?new URL(t,e):new URL(t)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function K(t,e,n){try{const r=`/api/${encodeURIComponent(e)}/connections/${t}/oauth-token/status`,o=n?new URL(r,n).href:r,s=_(),i=!n||new URL(n).origin===s,c=await fetch(o,{credentials:i?"include":"omit"});return c.ok?{hasToken:(await c.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function q({url:t,token:e,orgId:n,meshUrl:r}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const s=await fetch(t,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),i=j(t),c=J(t),a=_(),w=r??(a?new URL(t,a).origin:new URL(t).origin);if(s.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(i&&c?await K(i,c,w):{hasToken:!1}).hasToken};let f;try{const k=await s.json();f=k.error||k.message}catch{}return s.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:f||`HTTP ${s.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!s.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:f||`HTTP ${s.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o.message}}}export{G as a,X as h,q as i};