decocms 2.304.10 → 2.304.12

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 (413) hide show
  1. package/dist/client/assets/{AlertCircle-CjZpwsOG.js → AlertCircle-DykTdePm.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-DYvcqCDw.js → ArrowNarrowLeft-BSnqV9Qp.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-COD26E6f.js → ArrowUpRight-BbCrxIiB.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-CJDfHIIs.js → CheckCircle-dpfQl31_.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-2A70mOdX.js → ChevronDown-ChKIyEYX.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-BLFgqoQD.js → ChevronRight-CfxVPCJg.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CW7jO0Oa.js → ChevronUp-DrgxDzSb.js} +1 -1
  8. package/dist/client/assets/{Container-UVIOzZhY.js → Container-BmeFpotW.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-BKulvLoy.js → DotsVertical-Dpo2lfzf.js} +1 -1
  10. package/dist/client/assets/{LinkExternal01-8QSWs893.js → LinkExternal01-BFenb5P9.js} +1 -1
  11. package/dist/client/assets/{Lock01-ByEI8ntw.js → Lock01-D4wd-Mt0.js} +1 -1
  12. package/dist/client/assets/{Palette-MsdGyKno.js → Palette-DWycQqah.js} +1 -1
  13. package/dist/client/assets/{Play-B43xV17t.js → Play-3GU5tyK6.js} +1 -1
  14. package/dist/client/assets/{Plus-DdlE9ylC.js → Plus-DNS-JW4m.js} +1 -1
  15. package/dist/client/assets/{RefreshCcw01-CaYODjaH.js → RefreshCcw01-U2jJl9XZ.js} +1 -1
  16. package/dist/client/assets/{SearchMd-BiSKkSEC.js → SearchMd-CJRrkj_7.js} +1 -1
  17. package/dist/client/assets/{Settings02-WDv7ORkh.js → Settings02-BfZESxtt.js} +1 -1
  18. package/dist/client/assets/{Shield01-B1XU8jks.js → Shield01-CuEoE6Cq.js} +1 -1
  19. package/dist/client/assets/{Star01-tlbUowkj.js → Star01-BIiXL1NH.js} +1 -1
  20. package/dist/client/assets/{Sun-CWbOOQl7.js → Sun-DJvU306F.js} +1 -1
  21. package/dist/client/assets/{Tool01-D2ltJ3oZ.js → Tool01-B3jB5-GF.js} +1 -1
  22. package/dist/client/assets/{Trash01-5V2zml7z.js → Trash01-DygHC0Or.js} +1 -1
  23. package/dist/client/assets/{User01-DicXRAlc.js → User01-XcdTTiqO.js} +1 -1
  24. package/dist/client/assets/{Users03-CI-FUj0j.js → Users03-CdkPI2qt.js} +1 -1
  25. package/dist/client/assets/{X-7bL4i7ak.js → X-CaSicsGt.js} +1 -1
  26. package/dist/client/assets/{XCircle-DRwiT62A.js → XCircle-CAjnYXMv.js} +1 -1
  27. package/dist/client/assets/{XClose-cpPLXU9M.js → XClose-BD0-I41d.js} +1 -1
  28. package/dist/client/assets/{Zap-BEzJ7FXF.js → Zap-DSo0BijB.js} +1 -1
  29. package/dist/client/assets/{ZapSquare-Dc0--ocw.js → ZapSquare-DJjYeaGT.js} +1 -1
  30. package/dist/client/assets/{accordion-BFon3QKU.js → accordion-NFEtlqmu.js} +1 -1
  31. package/dist/client/assets/{agent-icon-BcY1J7IV.js → agent-icon-2WwvMIOR.js} +1 -1
  32. package/dist/client/assets/{agents-list-D3O8X25T.js → agents-list-B3NTdokI.js} +1 -1
  33. package/dist/client/assets/ai-providers-cvctUcOl.js +1 -0
  34. package/dist/client/assets/{alert-dialog-EwOCtYma.js → alert-dialog-CczJ0CiT.js} +1 -1
  35. package/dist/client/assets/{auth-catchall-0F1oGDvu.js → auth-catchall-D2VjSNCY.js} +1 -1
  36. package/dist/client/assets/{automation-list-row-Bee5Mxa9.js → automation-list-row-BM66xXdA.js} +1 -1
  37. package/dist/client/assets/{automations-BLTGSG_-.js → automations-CENOzqx0.js} +1 -1
  38. package/dist/client/assets/{avatar-ekdbwMb-.js → avatar-XLD41nT1.js} +1 -1
  39. package/dist/client/assets/{badge-BntPr7F5.js → badge-CqM8ft8a.js} +1 -1
  40. package/dist/client/assets/{brand-context-CJsw1pSv.js → brand-context-DawPDVwK.js} +1 -1
  41. package/dist/client/assets/{card-BmaLn_3f.js → card-BromnR4D.js} +1 -1
  42. package/dist/client/assets/{chat-context-Bb8SYeKr.js → chat-context-C1cX954x.js} +1 -1
  43. package/dist/client/assets/{checkbox-Cyu1qnuZ.js → checkbox-q02yCTCr.js} +1 -1
  44. package/dist/client/assets/{collection-detail-DWn0aW_r.js → collection-detail-CuW2SK0p.js} +1 -1
  45. package/dist/client/assets/{collection-display-button-gVF07lvH.js → collection-display-button-Cz_4oQot.js} +1 -1
  46. package/dist/client/assets/{collection-search-DYZQIylN.js → collection-search-BwqJnK6o.js} +1 -1
  47. package/dist/client/assets/{collection-search-DdAcsppy.js → collection-search-l5AWFuzp.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-CbD-SUn0.js → collection-table-wrapper-BlzCLLAo.js} +1 -1
  49. package/dist/client/assets/{collection-tabs-BGCfV8l9.js → collection-tabs-yGBJSAc8.js} +1 -1
  50. package/dist/client/assets/{collections-Bmez1LkJ.js → collections-Bdy_Kvem.js} +1 -1
  51. package/dist/client/assets/{command-CxmV3QY8.js → command-Dm5FUYzy.js} +1 -1
  52. package/dist/client/assets/{connection-card-DN5odoOb.js → connection-card-Bpj8ZSs7.js} +1 -1
  53. package/dist/client/assets/{connection-detail-DQx6QjuX.js → connection-detail-w6Hswx6I.js} +1 -1
  54. package/dist/client/assets/{connection-form-helpers-Bb3sx_dz.js → connection-form-helpers-_eiZ9Dyj.js} +1 -1
  55. package/dist/client/assets/{connections-BkyQQkqt.js → connections-ZzdUySRj.js} +1 -1
  56. package/dist/client/assets/{constants-BeUl-Cs3.js → constants-CqYb75aZ.js} +1 -1
  57. package/dist/client/assets/{constants-CBBJ_jDF.js → constants-DoDQutb_.js} +1 -1
  58. package/dist/client/assets/{dialog-CWRMmHKD.js → dialog-Cv4ROuD1.js} +1 -1
  59. package/dist/client/assets/{domain-settings-CAmsIuKF.js → domain-settings-CcBopmCQ.js} +1 -1
  60. package/dist/client/assets/{drawer-CNwIxQWf.js → drawer-BvCmaZEN.js} +1 -1
  61. package/dist/client/assets/{dropdown-menu-LcFaVXWW.js → dropdown-menu-CXpZ_ns-.js} +1 -1
  62. package/dist/client/assets/{dynamic-plugin-layout-BfEd5aHi.js → dynamic-plugin-layout-DQ5UtKMf.js} +1 -1
  63. package/dist/client/assets/{empty-state-C5PKMGQO.js → empty-state-BBjIyjuI.js} +1 -1
  64. package/dist/client/assets/{empty-state-BH9qLxZP.js → empty-state-BQm2cEn7.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-B39jPtC-.js → extract-connection-data-DRmUoKq6.js} +1 -1
  66. package/dist/client/assets/{features-CwDXw1Ew.js → features-BN-47yPZ.js} +1 -1
  67. package/dist/client/assets/{form-B6LAB-m_.js → form-vv7czlx-.js} +1 -1
  68. package/dist/client/assets/{general-BBq6muIT.js → general-GwVabcuc.js} +1 -1
  69. package/dist/client/assets/{index-DrOF58kq.js → index-BTPvxzW6.js} +1 -1
  70. package/dist/client/assets/{index-B-sloiGH.js → index-BizHATMB.js} +1 -1
  71. package/dist/client/assets/{index-mk6gx7es.js → index-Byh16eae.js} +2 -2
  72. package/dist/client/assets/{index-DqHLA0vr.js → index-C89IjMPF.js} +1 -1
  73. package/dist/client/assets/{index-CDSAg0No.js → index-CAszNWEi.js} +1 -1
  74. package/dist/client/assets/{index-C3bjqsvR.js → index-CO-xtUtF.js} +1 -1
  75. package/dist/client/assets/{index-UKKy1O7S.js → index-ChEPbjgU.js} +1 -1
  76. package/dist/client/assets/{index-Cx4wMtKt.js → index-D7GdEVK0.js} +1 -1
  77. package/dist/client/assets/{index-IC1oE4kJ.js → index-DAmwYTvH.js} +1 -1
  78. package/dist/client/assets/index-DEcDMso8.js +1 -0
  79. package/dist/client/assets/{index-HQ_0Qb6i.js → index-DHQaot3v.js} +1 -1
  80. package/dist/client/assets/{index-CYI_Zqko.js → index-DIMB4WE0.js} +1 -1
  81. package/dist/client/assets/{index-60PFhV_s.js → index-MijQYZKH.js} +3 -3
  82. package/dist/client/assets/{index-Dppfuq3M.js → index-Qw9LGy6b.js} +1 -1
  83. package/dist/client/assets/{index-B0J5U2hK.js → index-YHRzikDj.js} +1 -1
  84. package/dist/client/assets/{index-CUaQtIXP.js → index-ao7NoSNv.js} +1 -1
  85. package/dist/client/assets/{infiniteQueryObserver-D_1qV-y3.js → infiniteQueryObserver-CeXFUdTd.js} +1 -1
  86. package/dist/client/assets/{input-CrToyhgx.js → input-Vak5VRqX.js} +1 -1
  87. package/dist/client/assets/{integration-icon-DbHk1BBx.js → integration-icon-qqFh_bDX.js} +1 -1
  88. package/dist/client/assets/{label--BIpch6_.js → label-BNsXufvU.js} +1 -1
  89. package/dist/client/assets/{layout-C_atXwz3.js → layout-l92_NVlz.js} +1 -1
  90. package/dist/client/assets/{lean-canvas-recruit-modal-C3r5-HxJ.js → lean-canvas-recruit-modal-HYouwCHv.js} +1 -1
  91. package/dist/client/assets/{login-BQ9m3gfS.js → login-qRSyAZ_o.js} +1 -1
  92. package/dist/client/assets/{members-CIERDQQF.js → members-D4UY4ei6.js} +1 -1
  93. package/dist/client/assets/{monaco-editor-4k3ifvms.js → monaco-editor-BOg-v1iU.js} +1 -1
  94. package/dist/client/assets/{monitoring-stats-row-BZSwYPO7.js → monitoring-stats-row-xiPLeKvD.js} +1 -1
  95. package/dist/client/assets/{oauth-callback-D49_r6C_.js → oauth-callback-D2FTNcui.js} +1 -1
  96. package/dist/client/assets/{oauth-callback-ai-provider-BN-qhCGE.js → oauth-callback-ai-provider-Kb5ulQoF.js} +1 -1
  97. package/dist/client/assets/{onboarding-Bq3vKwC-.js → onboarding-D5RrB-Tz.js} +1 -1
  98. package/dist/client/assets/{org-layout-Depwgb9M.js → org-layout-WhfAqk0U.js} +1 -1
  99. package/dist/client/assets/{org-plugin-layout-D95k8tjt.js → org-plugin-layout-C70m9fD9.js} +1 -1
  100. package/dist/client/assets/{pair-lMYe4cme.js → pair-BozNTVaW.js} +1 -1
  101. package/dist/client/assets/{plugin-empty-state-BZ05BnAb.js → plugin-empty-state-BhaTB3gV.js} +1 -1
  102. package/dist/client/assets/{plugin-header-Dm9m4K3q.js → plugin-header-CCyEhf-g.js} +1 -1
  103. package/dist/client/assets/{plugin-layout-DUXQsbyK.js → plugin-layout-kiqmZ4Ty.js} +1 -1
  104. package/dist/client/assets/{popover-DlgSjBxW.js → popover-DsEUr0UP.js} +1 -1
  105. package/dist/client/assets/{profile-D81Ov5SL.js → profile-OzTBu6o-.js} +1 -1
  106. package/dist/client/assets/{project-app-view-DoUUEEnu.js → project-app-view-CbPm1ZuF.js} +1 -1
  107. package/dist/client/assets/registry-CsXSm8-9.js +2 -0
  108. package/dist/client/assets/{registry-layout-BMY_penr.js → registry-layout-BpFNGTYZ.js} +1 -1
  109. package/dist/client/assets/{required-auth-layout-DOoVy0oy.js → required-auth-layout-DHh0SFyh.js} +1 -1
  110. package/dist/client/assets/{reset-password-Cg9TA69q.js → reset-password-9vHhhDeq.js} +1 -1
  111. package/dist/client/assets/{roles-BmzcjVvr.js → roles-D3OPlwRQ.js} +1 -1
  112. package/dist/client/assets/{scroll-area-Dfuf05Gc.js → scroll-area-CSvHQmLp.js} +1 -1
  113. package/dist/client/assets/{search-input-cOqFo1qp.js → search-input-CQG6oP1I.js} +1 -1
  114. package/dist/client/assets/{select-DHxhHlTo.js → select-CBnW7xgF.js} +1 -1
  115. package/dist/client/assets/{select-model-BjaSdxZJ.js → select-model-CkVUDibB.js} +1 -1
  116. package/dist/client/assets/{settings-layout-CYcP5R2Q.js → settings-layout-D4i1woj8.js} +1 -1
  117. package/dist/client/assets/{settings-section-Y_wCb-Mr.js → settings-section-C2ru3Pcu.js} +1 -1
  118. package/dist/client/assets/{shell-layout-DEFQB1in.js → shell-layout-C--vXF8e.js} +1 -1
  119. package/dist/client/assets/{skeleton-BD0Xv1yd.js → skeleton-DZE_Durz.js} +1 -1
  120. package/dist/client/assets/{sso-2s3EmE41.js → sso-Dud_r3Fd.js} +1 -1
  121. package/dist/client/assets/{store-BQ3XKuS1.js → store-BxxFQfUe.js} +1 -1
  122. package/dist/client/assets/store-registry-c5WBQeKh.js +2 -0
  123. package/dist/client/assets/{switch-B0FJgiAO.js → switch-9ZAU9Wsd.js} +1 -1
  124. package/dist/client/assets/{table-D73iLzft.js → table-DMcPz0bN.js} +1 -1
  125. package/dist/client/assets/{tabs-DFh8a3-r.js → tabs-DMO0mB-I.js} +1 -1
  126. package/dist/client/assets/{task-status-Waiij_cS.js → task-status-DVZLBvKG.js} +1 -1
  127. package/dist/client/assets/{textarea-CWor3d17.js → textarea-BCuCo32x.js} +1 -1
  128. package/dist/client/assets/{toggle-group-7PLS3k3D.js → toggle-group-VxweZQrl.js} +1 -1
  129. package/dist/client/assets/{tools-list-B8DbFvmk.js → tools-list-DVh0mjAv.js} +1 -1
  130. package/dist/client/assets/{tooltip-CsjqH8MZ.js → tooltip-D6qvPlF4.js} +1 -1
  131. package/dist/client/assets/{types-6MZvaGCM.js → types-DCqv44Zz.js} +1 -1
  132. package/dist/client/assets/{use-ai-providers-Cbolk4HH.js → use-ai-providers-C0E0qH45.js} +1 -1
  133. package/dist/client/assets/{use-collections-C2mp1HBy.js → use-collections-BYyKflom.js} +1 -1
  134. package/dist/client/assets/{use-connection-C7WT3gSh.js → use-connection-kAb3_1aU.js} +1 -1
  135. package/dist/client/assets/{use-copy-CHwZtSPA.js → use-copy-Dr24Lx_X.js} +1 -1
  136. package/dist/client/assets/{use-create-virtual-mcp-B7_v59WJ.js → use-create-virtual-mcp-DL9XFAgg.js} +1 -1
  137. package/dist/client/assets/{use-decopilot-events-BMvaVEKg.js → use-decopilot-events-BA7vVAsF.js} +1 -1
  138. package/dist/client/assets/{use-delete-connection-BU1uYBu3.js → use-delete-connection-DOTVFlyu.js} +1 -1
  139. package/dist/client/assets/{use-infinite-scroll-CRyATMOI.js → use-infinite-scroll-CeNFrFZw.js} +1 -1
  140. package/dist/client/assets/{use-list-state-yZWKPNk6.js → use-list-state-ChPE6VX_.js} +1 -1
  141. package/dist/client/assets/{use-mcp-tools-DvhC9MfV.js → use-mcp-tools-Bbkq91Xc.js} +1 -1
  142. package/dist/client/assets/{use-members-BpjdXE5l.js → use-members-BbBWLiDA.js} +1 -1
  143. package/dist/client/assets/{use-navigate-to-agent-oaJqKBw4.js → use-navigate-to-agent-CiGytRqe.js} +1 -1
  144. package/dist/client/assets/{use-org-auth-client-SKwRWhT9.js → use-org-auth-client-Ctlksu1L.js} +1 -1
  145. package/dist/client/assets/{use-org-sso-C8gvxTtc.js → use-org-sso-Dtmr2O8h.js} +1 -1
  146. package/dist/client/assets/{use-organization-roles-BJp2KWQQ.js → use-organization-roles-CYz2FAFR.js} +1 -1
  147. package/dist/client/assets/{use-organization-settings-Ca3JWwFz.js → use-organization-settings-CffFj1WY.js} +1 -1
  148. package/dist/client/assets/{use-registry-connections-C-khMp_P.js → use-registry-connections-Br5-A4Q9.js} +1 -1
  149. package/dist/client/assets/{use-status-sounds-CPfqhfdN.js → use-status-sounds-C_N93Hgc.js} +1 -1
  150. package/dist/client/assets/{use-tasks-CfZED9Y3.js → use-tasks-UUjCH1vs.js} +1 -1
  151. package/dist/client/assets/{use-view-mode-ZkIRYTtf.js → use-view-mode-BqPySn5U.js} +1 -1
  152. package/dist/client/assets/{use-virtual-mcp-Bv1k9ExR.js → use-virtual-mcp-CriuigLx.js} +1 -1
  153. package/dist/client/assets/useInfiniteQuery-CXsqG0YB.js +1 -0
  154. package/dist/client/assets/useSuspenseInfiniteQuery-D0VeE26p.js +1 -0
  155. package/dist/client/assets/{user-DZaOGTTh.js → user-DfBEFCfL.js} +1 -1
  156. package/dist/client/assets/{view-mode-toggle-tZKajRjf.js → view-mode-toggle-YvwpFyqQ.js} +1 -1
  157. package/dist/client/assets/{workflow-DK-N3G_n.js → workflow-DjrE6MxM.js} +1 -1
  158. package/dist/client/assets/workflow-detail-COUbvzSr.js +1 -0
  159. package/dist/client/index.html +1 -1
  160. package/dist/server/cli.js +6 -4
  161. package/dist/server/node_modules/ink/build/ansi-tokenizer.d.ts +38 -0
  162. package/dist/server/node_modules/ink/build/ansi-tokenizer.js +316 -0
  163. package/dist/server/node_modules/ink/build/ansi-tokenizer.js.map +1 -0
  164. package/dist/server/node_modules/ink/build/apply-styles.js +175 -0
  165. package/dist/server/node_modules/ink/build/build-layout.js +77 -0
  166. package/dist/server/node_modules/ink/build/calculate-wrapped-text.js +53 -0
  167. package/dist/server/node_modules/ink/build/colorize.d.ts +3 -0
  168. package/dist/server/node_modules/ink/build/colorize.js +48 -0
  169. package/dist/server/node_modules/ink/build/colorize.js.map +1 -0
  170. package/dist/server/node_modules/ink/build/components/AccessibilityContext.d.ts +3 -0
  171. package/dist/server/node_modules/ink/build/components/AccessibilityContext.js +5 -0
  172. package/dist/server/node_modules/ink/build/components/AccessibilityContext.js.map +1 -0
  173. package/dist/server/node_modules/ink/build/components/App.d.ts +18 -0
  174. package/dist/server/node_modules/ink/build/components/App.js +351 -0
  175. package/dist/server/node_modules/ink/build/components/App.js.map +1 -0
  176. package/dist/server/node_modules/ink/build/components/AppContext.d.ts +15 -0
  177. package/dist/server/node_modules/ink/build/components/AppContext.js +11 -0
  178. package/dist/server/node_modules/ink/build/components/AppContext.js.map +1 -0
  179. package/dist/server/node_modules/ink/build/components/BackgroundContext.d.ts +4 -0
  180. package/dist/server/node_modules/ink/build/components/BackgroundContext.js +3 -0
  181. package/dist/server/node_modules/ink/build/components/BackgroundContext.js.map +1 -0
  182. package/dist/server/node_modules/ink/build/components/Box.d.ts +117 -0
  183. package/dist/server/node_modules/ink/build/components/Box.js +34 -0
  184. package/dist/server/node_modules/ink/build/components/Box.js.map +1 -0
  185. package/dist/server/node_modules/ink/build/components/Color.js +62 -0
  186. package/dist/server/node_modules/ink/build/components/Cursor.d.ts +83 -0
  187. package/dist/server/node_modules/ink/build/components/Cursor.js +53 -0
  188. package/dist/server/node_modules/ink/build/components/Cursor.js.map +1 -0
  189. package/dist/server/node_modules/ink/build/components/CursorContext.d.ts +11 -0
  190. package/dist/server/node_modules/ink/build/components/CursorContext.js +8 -0
  191. package/dist/server/node_modules/ink/build/components/CursorContext.js.map +1 -0
  192. package/dist/server/node_modules/ink/build/components/ErrorBoundary.d.ts +18 -0
  193. package/dist/server/node_modules/ink/build/components/ErrorBoundary.js +23 -0
  194. package/dist/server/node_modules/ink/build/components/ErrorBoundary.js.map +1 -0
  195. package/dist/server/node_modules/ink/build/components/ErrorOverview.d.ts +6 -0
  196. package/dist/server/node_modules/ink/build/components/ErrorOverview.js +84 -0
  197. package/dist/server/node_modules/ink/build/components/ErrorOverview.js.map +1 -0
  198. package/dist/server/node_modules/ink/build/components/FocusContext.d.ts +16 -0
  199. package/dist/server/node_modules/ink/build/components/FocusContext.js +17 -0
  200. package/dist/server/node_modules/ink/build/components/FocusContext.js.map +1 -0
  201. package/dist/server/node_modules/ink/build/components/Newline.d.ts +13 -0
  202. package/dist/server/node_modules/ink/build/components/Newline.js +8 -0
  203. package/dist/server/node_modules/ink/build/components/Newline.js.map +1 -0
  204. package/dist/server/node_modules/ink/build/components/Spacer.d.ts +7 -0
  205. package/dist/server/node_modules/ink/build/components/Spacer.js +11 -0
  206. package/dist/server/node_modules/ink/build/components/Spacer.js.map +1 -0
  207. package/dist/server/node_modules/ink/build/components/Static.d.ts +24 -0
  208. package/dist/server/node_modules/ink/build/components/Static.js +28 -0
  209. package/dist/server/node_modules/ink/build/components/Static.js.map +1 -0
  210. package/dist/server/node_modules/ink/build/components/StderrContext.d.ts +15 -0
  211. package/dist/server/node_modules/ink/build/components/StderrContext.js +13 -0
  212. package/dist/server/node_modules/ink/build/components/StderrContext.js.map +1 -0
  213. package/dist/server/node_modules/ink/build/components/StdinContext.d.ts +22 -0
  214. package/dist/server/node_modules/ink/build/components/StdinContext.js +19 -0
  215. package/dist/server/node_modules/ink/build/components/StdinContext.js.map +1 -0
  216. package/dist/server/node_modules/ink/build/components/StdoutContext.d.ts +15 -0
  217. package/dist/server/node_modules/ink/build/components/StdoutContext.js +13 -0
  218. package/dist/server/node_modules/ink/build/components/StdoutContext.js.map +1 -0
  219. package/dist/server/node_modules/ink/build/components/Text.d.ts +55 -0
  220. package/dist/server/node_modules/ink/build/components/Text.js +50 -0
  221. package/dist/server/node_modules/ink/build/components/Text.js.map +1 -0
  222. package/dist/server/node_modules/ink/build/components/Transform.d.ts +16 -0
  223. package/dist/server/node_modules/ink/build/components/Transform.js +15 -0
  224. package/dist/server/node_modules/ink/build/components/Transform.js.map +1 -0
  225. package/dist/server/node_modules/ink/build/cursor-helpers.d.ts +38 -0
  226. package/dist/server/node_modules/ink/build/cursor-helpers.js +56 -0
  227. package/dist/server/node_modules/ink/build/cursor-helpers.js.map +1 -0
  228. package/dist/server/node_modules/ink/build/devtools-window-polyfill.d.ts +1 -0
  229. package/dist/server/node_modules/ink/build/devtools-window-polyfill.js +65 -0
  230. package/dist/server/node_modules/ink/build/devtools-window-polyfill.js.map +1 -0
  231. package/dist/server/node_modules/ink/build/devtools.d.ts +1 -0
  232. package/dist/server/node_modules/ink/build/devtools.js +11 -0
  233. package/dist/server/node_modules/ink/build/devtools.js.map +1 -0
  234. package/dist/server/node_modules/ink/build/dom.d.ts +56 -0
  235. package/dist/server/node_modules/ink/build/dom.js +124 -0
  236. package/dist/server/node_modules/ink/build/dom.js.map +1 -0
  237. package/dist/server/node_modules/ink/build/experimental/apply-style.js +140 -0
  238. package/dist/server/node_modules/ink/build/experimental/dom.js +123 -0
  239. package/dist/server/node_modules/ink/build/experimental/output.js +91 -0
  240. package/dist/server/node_modules/ink/build/experimental/reconciler.js +141 -0
  241. package/dist/server/node_modules/ink/build/experimental/renderer.js +81 -0
  242. package/dist/server/node_modules/ink/build/get-max-width.d.ts +3 -0
  243. package/dist/server/node_modules/ink/build/get-max-width.js +10 -0
  244. package/dist/server/node_modules/ink/build/get-max-width.js.map +1 -0
  245. package/dist/server/node_modules/ink/build/hooks/use-app.d.ts +5 -0
  246. package/dist/server/node_modules/ink/build/hooks/use-app.js +8 -0
  247. package/dist/server/node_modules/ink/build/hooks/use-app.js.map +1 -0
  248. package/dist/server/node_modules/ink/build/hooks/use-cursor.d.ts +12 -0
  249. package/dist/server/node_modules/ink/build/hooks/use-cursor.js +29 -0
  250. package/dist/server/node_modules/ink/build/hooks/use-cursor.js.map +1 -0
  251. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.d.ts +28 -0
  252. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js +17 -0
  253. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js.map +1 -0
  254. package/dist/server/node_modules/ink/build/hooks/use-focus.d.ts +29 -0
  255. package/dist/server/node_modules/ink/build/hooks/use-focus.js +42 -0
  256. package/dist/server/node_modules/ink/build/hooks/use-focus.js.map +1 -0
  257. package/dist/server/node_modules/ink/build/hooks/use-input.d.ts +131 -0
  258. package/dist/server/node_modules/ink/build/hooks/use-input.js +124 -0
  259. package/dist/server/node_modules/ink/build/hooks/use-input.js.map +1 -0
  260. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.d.ts +5 -0
  261. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js +11 -0
  262. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js.map +1 -0
  263. package/dist/server/node_modules/ink/build/hooks/use-stderr.d.ts +5 -0
  264. package/dist/server/node_modules/ink/build/hooks/use-stderr.js +8 -0
  265. package/dist/server/node_modules/ink/build/hooks/use-stderr.js.map +1 -0
  266. package/dist/server/node_modules/ink/build/hooks/use-stdin.d.ts +5 -0
  267. package/dist/server/node_modules/ink/build/hooks/use-stdin.js +8 -0
  268. package/dist/server/node_modules/ink/build/hooks/use-stdin.js.map +1 -0
  269. package/dist/server/node_modules/ink/build/hooks/use-stdout.d.ts +5 -0
  270. package/dist/server/node_modules/ink/build/hooks/use-stdout.js +8 -0
  271. package/dist/server/node_modules/ink/build/hooks/use-stdout.js.map +1 -0
  272. package/dist/server/node_modules/ink/build/hooks/useInput.js +38 -0
  273. package/dist/server/node_modules/ink/build/index.d.ts +34 -0
  274. package/dist/server/node_modules/ink/build/index.js +20 -0
  275. package/dist/server/node_modules/ink/build/index.js.map +1 -0
  276. package/dist/server/node_modules/ink/build/ink.d.ts +90 -0
  277. package/dist/server/node_modules/ink/build/ink.js +637 -0
  278. package/dist/server/node_modules/ink/build/ink.js.map +1 -0
  279. package/dist/server/node_modules/ink/build/input-parser.d.ts +7 -0
  280. package/dist/server/node_modules/ink/build/input-parser.js +154 -0
  281. package/dist/server/node_modules/ink/build/input-parser.js.map +1 -0
  282. package/dist/server/node_modules/ink/build/instance.js +205 -0
  283. package/dist/server/node_modules/ink/build/instances.d.ts +3 -0
  284. package/dist/server/node_modules/ink/build/instances.js +8 -0
  285. package/dist/server/node_modules/ink/build/instances.js.map +1 -0
  286. package/dist/server/node_modules/ink/build/kitty-keyboard.d.ts +23 -0
  287. package/dist/server/node_modules/ink/build/kitty-keyboard.js +32 -0
  288. package/dist/server/node_modules/ink/build/kitty-keyboard.js.map +1 -0
  289. package/dist/server/node_modules/ink/build/layout.d.ts +7 -0
  290. package/dist/server/node_modules/ink/build/layout.js +33 -0
  291. package/dist/server/node_modules/ink/build/layout.js.map +1 -0
  292. package/dist/server/node_modules/ink/build/log-update.d.ts +19 -0
  293. package/dist/server/node_modules/ink/build/log-update.js +242 -0
  294. package/dist/server/node_modules/ink/build/log-update.js.map +1 -0
  295. package/dist/server/node_modules/ink/build/measure-element.d.ts +16 -0
  296. package/dist/server/node_modules/ink/build/measure-element.js +9 -0
  297. package/dist/server/node_modules/ink/build/measure-element.js.map +1 -0
  298. package/dist/server/node_modules/ink/build/measure-text.d.ts +6 -0
  299. package/dist/server/node_modules/ink/build/measure-text.js +21 -0
  300. package/dist/server/node_modules/ink/build/measure-text.js.map +1 -0
  301. package/dist/server/node_modules/ink/build/options.d.ts +52 -0
  302. package/dist/server/node_modules/ink/build/options.js +2 -0
  303. package/dist/server/node_modules/ink/build/options.js.map +1 -0
  304. package/dist/server/node_modules/ink/build/output.d.ts +35 -0
  305. package/dist/server/node_modules/ink/build/output.js +183 -0
  306. package/dist/server/node_modules/ink/build/output.js.map +1 -0
  307. package/dist/server/node_modules/ink/build/parse-keypress.d.ts +22 -0
  308. package/dist/server/node_modules/ink/build/parse-keypress.js +493 -0
  309. package/dist/server/node_modules/ink/build/parse-keypress.js.map +1 -0
  310. package/dist/server/node_modules/ink/build/reconciler.d.ts +4 -0
  311. package/dist/server/node_modules/ink/build/reconciler.js +274 -0
  312. package/dist/server/node_modules/ink/build/reconciler.js.map +1 -0
  313. package/dist/server/node_modules/ink/build/render-background.d.ts +4 -0
  314. package/dist/server/node_modules/ink/build/render-background.js +25 -0
  315. package/dist/server/node_modules/ink/build/render-background.js.map +1 -0
  316. package/dist/server/node_modules/ink/build/render-border.d.ts +4 -0
  317. package/dist/server/node_modules/ink/build/render-border.js +73 -0
  318. package/dist/server/node_modules/ink/build/render-border.js.map +1 -0
  319. package/dist/server/node_modules/ink/build/render-node-to-output.d.ts +14 -0
  320. package/dist/server/node_modules/ink/build/render-node-to-output.js +147 -0
  321. package/dist/server/node_modules/ink/build/render-node-to-output.js.map +1 -0
  322. package/dist/server/node_modules/ink/build/render-to-string.d.ts +38 -0
  323. package/dist/server/node_modules/ink/build/render-to-string.js +115 -0
  324. package/dist/server/node_modules/ink/build/render-to-string.js.map +1 -0
  325. package/dist/server/node_modules/ink/build/render.d.ts +121 -0
  326. package/dist/server/node_modules/ink/build/render.js +55 -0
  327. package/dist/server/node_modules/ink/build/render.js.map +1 -0
  328. package/dist/server/node_modules/ink/build/renderer.d.ts +8 -0
  329. package/dist/server/node_modules/ink/build/renderer.js +55 -0
  330. package/dist/server/node_modules/ink/build/renderer.js.map +1 -0
  331. package/dist/server/node_modules/ink/build/sanitize-ansi.d.ts +2 -0
  332. package/dist/server/node_modules/ink/build/sanitize-ansi.js +27 -0
  333. package/dist/server/node_modules/ink/build/sanitize-ansi.js.map +1 -0
  334. package/dist/server/node_modules/ink/build/screen-reader-update.d.ts +13 -0
  335. package/dist/server/node_modules/ink/build/screen-reader-update.js +38 -0
  336. package/dist/server/node_modules/ink/build/screen-reader-update.js.map +1 -0
  337. package/dist/server/node_modules/ink/build/squash-text-nodes.d.ts +3 -0
  338. package/dist/server/node_modules/ink/build/squash-text-nodes.js +36 -0
  339. package/dist/server/node_modules/ink/build/squash-text-nodes.js.map +1 -0
  340. package/dist/server/node_modules/ink/build/styles.d.ts +240 -0
  341. package/dist/server/node_modules/ink/build/styles.js +232 -0
  342. package/dist/server/node_modules/ink/build/styles.js.map +1 -0
  343. package/dist/server/node_modules/ink/build/utils.d.ts +2 -0
  344. package/dist/server/node_modules/ink/build/utils.js +4 -0
  345. package/dist/server/node_modules/ink/build/utils.js.map +1 -0
  346. package/dist/server/node_modules/ink/build/wrap-text.d.ts +3 -0
  347. package/dist/server/node_modules/ink/build/wrap-text.js +31 -0
  348. package/dist/server/node_modules/ink/build/wrap-text.js.map +1 -0
  349. package/dist/server/node_modules/ink/build/write-synchronized.d.ts +4 -0
  350. package/dist/server/node_modules/ink/build/write-synchronized.js +7 -0
  351. package/dist/server/node_modules/ink/build/write-synchronized.js.map +1 -0
  352. package/dist/server/node_modules/ink/license +10 -0
  353. package/dist/server/node_modules/ink/package.json +201 -0
  354. package/dist/server/node_modules/ink/readme.md +2636 -0
  355. package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
  356. package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
  357. package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
  358. package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
  359. package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
  360. package/dist/server/node_modules/mimic-fn/index.d.ts +54 -0
  361. package/dist/server/node_modules/mimic-fn/index.js +13 -0
  362. package/dist/server/node_modules/mimic-fn/license +9 -0
  363. package/dist/server/node_modules/mimic-fn/package.json +42 -0
  364. package/dist/server/node_modules/mimic-fn/readme.md +69 -0
  365. package/dist/server/node_modules/pg-int8/LICENSE +13 -0
  366. package/dist/server/node_modules/pg-int8/README.md +16 -0
  367. package/dist/server/node_modules/pg-int8/index.js +100 -0
  368. package/dist/server/node_modules/pg-int8/package.json +24 -0
  369. package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
  370. package/dist/server/node_modules/postgres-array/index.js +97 -0
  371. package/dist/server/node_modules/postgres-array/license +21 -0
  372. package/dist/server/node_modules/postgres-array/package.json +35 -0
  373. package/dist/server/node_modules/postgres-array/readme.md +43 -0
  374. package/dist/server/node_modules/postgres-bytea/index.js +33 -0
  375. package/dist/server/node_modules/postgres-bytea/license +21 -0
  376. package/dist/server/node_modules/postgres-bytea/package.json +34 -0
  377. package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
  378. package/dist/server/node_modules/postgres-date/index.js +116 -0
  379. package/dist/server/node_modules/postgres-date/license +21 -0
  380. package/dist/server/node_modules/postgres-date/package.json +33 -0
  381. package/dist/server/node_modules/postgres-date/readme.md +49 -0
  382. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  383. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  384. package/dist/server/node_modules/postgres-interval/license +21 -0
  385. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  386. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  387. package/dist/server/node_modules/restore-cursor/index.d.ts +11 -0
  388. package/dist/server/node_modules/restore-cursor/index.js +11 -0
  389. package/dist/server/node_modules/restore-cursor/license +9 -0
  390. package/dist/server/node_modules/restore-cursor/package.json +55 -0
  391. package/dist/server/node_modules/restore-cursor/readme.md +31 -0
  392. package/dist/server/node_modules/split2/LICENSE +13 -0
  393. package/dist/server/node_modules/split2/README.md +85 -0
  394. package/dist/server/node_modules/split2/bench.js +27 -0
  395. package/dist/server/node_modules/split2/index.js +141 -0
  396. package/dist/server/node_modules/split2/package.json +39 -0
  397. package/dist/server/node_modules/split2/test.js +409 -0
  398. package/dist/server/node_modules/xtend/.jshintrc +30 -0
  399. package/dist/server/node_modules/xtend/LICENSE +20 -0
  400. package/dist/server/node_modules/xtend/README.md +32 -0
  401. package/dist/server/node_modules/xtend/immutable.js +19 -0
  402. package/dist/server/node_modules/xtend/mutable.js +17 -0
  403. package/dist/server/node_modules/xtend/package.json +55 -0
  404. package/dist/server/node_modules/xtend/test.js +103 -0
  405. package/dist/server/server.js +5 -3
  406. package/package.json +1 -1
  407. package/dist/client/assets/ai-providers-BANrhLKX.js +0 -1
  408. package/dist/client/assets/index-CcvBX77O.js +0 -1
  409. package/dist/client/assets/registry-5S6FQTql.js +0 -2
  410. package/dist/client/assets/store-registry-DF30s7iU.js +0 -2
  411. package/dist/client/assets/useInfiniteQuery-Q9hSiQS7.js +0 -1
  412. package/dist/client/assets/useSuspenseInfiniteQuery-4qMm75IX.js +0 -1
  413. package/dist/client/assets/workflow-detail-BwRmOSLC.js +0 -1
@@ -1 +1 @@
1
- import{H as R,aI as V,aJ as A,J as a,aK as j,ap as z,e as K,j as u,B as C}from"./index-mk6gx7es.js";import{I as H}from"./input-CrToyhgx.js";import{s as L}from"./Plus-DdlE9ylC.js";import{s as W}from"./Trash01-5V2zml7z.js";const q=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(q).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=K.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(W,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(L,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function J(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Y(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,Y as a,Q as b,M as c,Z as d,J as i,F as p,D as r};
1
+ import{H as R,aI as V,aJ as A,J as a,aK as j,ap as z,e as K,j as u,B as C}from"./index-Byh16eae.js";import{I as H}from"./input-Vak5VRqX.js";import{s as L}from"./Plus-DNS-JW4m.js";import{s as W}from"./Trash01-DygHC0Or.js";const q=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(q).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=K.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(W,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(L,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function J(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Y(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,Y as a,Q as b,M as c,Z as d,J as i,F as p,D as r};
@@ -1 +1 @@
1
- import{e as ie,j as t,E as Ye,r as W,l as ce,s as _e,f as Se,d as Je,b as be,u as Ze,Q as et,R as tt,z as nt,C as st,B,t as te,o as ot,c as re,x as G,G as it,F as lt,K as ct}from"./index-mk6gx7es.js";import{g as rt}from"./constants-BeUl-Cs3.js";import{C as at}from"./collection-display-button-gVF07lvH.js";import{S as dt}from"./search-input-cOqFo1qp.js";import{C as mt}from"./collection-tabs-BGCfV8l9.js";import{u as ut,a as Ne,g as pt,C as fe}from"./connection-card-DN5odoOb.js";import{E as ht}from"./empty-state-C5PKMGQO.js";import{I as xt}from"./integration-icon-DbHk1BBx.js";import{P as de}from"./index-C3bjqsvR.js";import{u as gt,D as ft}from"./use-delete-connection-BU1uYBu3.js";import{u as jt}from"./use-infinite-scroll-CRyATMOI.js";import{u as yt}from"./use-list-state-yZWKPNk6.js";import{g as ke,a as Ct,e as vt}from"./extract-connection-data-B39jPtC-.js";import{g as ue}from"./connection-slug-eyAPH6o3.js";import{c as De,d as Ae,b as we,f as Te,e as Ie,g as Pe,a as Le,A as Oe}from"./alert-dialog-EwOCtYma.js";import{C as $e}from"./checkbox-Cyu1qnuZ.js";import{b as Ee,a as ze,c as Fe,d as Me,e as Ve,D as Be}from"./dialog-CWRMmHKD.js";import{b as _t,a as St,c as bt,D as Nt,d as kt,e as Dt,f as At}from"./drawer-CNwIxQWf.js";import{u as wt}from"./tooltip-CsjqH8MZ.js";import{D as Re,a as Ue,b as He,c as pe}from"./dropdown-menu-LcFaVXWW.js";import{F as Q,b as Y,c as J,d as Z,f as ee,a as Ce}from"./form-B6LAB-m_.js";import{I as oe}from"./input-CrToyhgx.js";import{S as Tt,a as It,b as Pt,c as Lt,d as le}from"./select-DHxhHlTo.js";import{T as Ot}from"./textarea-CWor3d17.js";import{b as Ke,u as $t}from"./use-connection-C7WT3gSh.js";import{u as Et,S as zt}from"./constants-CBBJ_jDF.js";import{b as Ft}from"./use-virtual-mcp-Bv1k9ExR.js";import{a as Mt,S as Vt}from"./agent-icon-BcY1J7IV.js";import{n as he}from"./Container-UVIOzZhY.js";import{i as We}from"./DotsVertical-BKulvLoy.js";import{s as Xe}from"./RefreshCcw01-CaYODjaH.js";import{s as ge}from"./Star01-tlbUowkj.js";import{s as qe}from"./Plus-DdlE9ylC.js";import{s as Ge}from"./Trash01-5V2zml7z.js";import{s as Qe}from"./XClose-cpPLXU9M.js";import{i as me,a as ve,E as Bt,c as Rt,p as Ut,b as Ht,d as Kt}from"./connection-form-helpers-Bb3sx_dz.js";import"./collections-Bmez1LkJ.js";import"./ChevronDown-2A70mOdX.js";import"./view-mode-toggle-tZKajRjf.js";import"./badge-BntPr7F5.js";import"./SearchMd-BiSKkSEC.js";import"./use-registry-connections-C-khMp_P.js";import"./use-organization-settings-Ca3JWwFz.js";import"./useInfiniteQuery-Q9hSiQS7.js";import"./infiniteQueryObserver-D_1qV-y3.js";import"./card-BmaLn_3f.js";import"./X-7bL4i7ak.js";import"./use-view-mode-ZkIRYTtf.js";import"./ChevronRight-BLFgqoQD.js";import"./label--BIpch6_.js";import"./ChevronUp-CW7jO0Oa.js";import"./use-collections-C2mp1HBy.js";import"./AlertCircle-CjZpwsOG.js";import"./Tool01-D2ltJ3oZ.js";import"./ArrowNarrowLeft-DYvcqCDw.js";import"./XCircle-DRwiT62A.js";import"./ArrowUpRight-COD26E6f.js";import"./ZapSquare-Dc0--ocw.js";import"./Users03-CI-FUj0j.js";import"./CheckCircle-CJDfHIIs.js";import"./Palette-MsdGyKno.js";import"./LinkExternal01-8QSWs893.js";import"./Lock01-ByEI8ntw.js";import"./Sun-CWbOOQl7.js";import"./Play-B43xV17t.js";import"./Settings02-WDv7ORkh.js";import"./Shield01-B1XU8jks.js";import"./User01-DicXRAlc.js";import"./Zap-BEzJ7FXF.js";function Wt(y){const e=ie.c(51),{group:n,onOpen:g,selectionMode:m,selectedIds:d,onToggleSelect:o}=y;let v;if(e[0]!==n.connections||e[1]!==d){let j;e[3]!==d?(j=R=>d.has(R.id),e[3]=d,e[4]=j):j=e[4],v=n.connections.every(j),e[0]=n.connections,e[1]=d,e[2]=v}else v=e[2];const h=v;let _;if(e[5]!==n.connections||e[6]!==d){let j;e[8]!==d?(j=R=>d.has(R.id),e[8]=d,e[9]=j):j=e[9],_=n.connections.some(j),e[5]=n.connections,e[6]=d,e[7]=_}else _=e[7];const u=_,S=`${n.connections.length} instances`;let x;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(x={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=x):x=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==g||e[17]!==o||e[18]!==d||e[19]!==m?(a=()=>m?(()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)})():g(),e[14]=h,e[15]=n.connections,e[16]=g,e[17]=o,e[18]=d,e[19]=m,e[20]=a):a=e[20];const p=m&&h&&"ring-2 ring-primary",f=m&&u&&!h&&"ring-1 ring-primary/50";let k;e[21]!==p||e[22]!==f?(k=re(p,f),e[21]=p,e[22]=f,e[23]=k):k=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(he,{}),e[24]=A):A=e[24];let N;e[25]!==h||e[26]!==n.connections||e[27]!==o||e[28]!==d||e[29]!==m||e[30]!==u?(N=m?t.jsx($e,{checked:h?!0:u?"indeterminate":!1,onCheckedChange:()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=o,e[28]=d,e[29]=m,e[30]=u,e[31]=N):N=e[31];const I=m?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[32]!==I?(s=re("overflow-hidden transition-all duration-150 ease-out",I),e[32]=I,e[33]=s):s=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(Ue,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qt,children:t.jsx(We,{size:20})})}),e[34]=D):D=e[34];let M;e[35]!==g?(M=j=>{j.stopPropagation(),g()},e[35]=g,e[36]=M):M=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Xe,{size:16}),e[37]=$):$=e[37];let P;e[38]!==M?(P=t.jsxs(Re,{children:[D,t.jsx(He,{align:"end",onClick:Xt,children:t.jsxs(pe,{onClick:M,children:[$,"Open"]})})]}),e[38]=M,e[39]=P):P=e[39];let T;e[40]!==s||e[41]!==P?(T=t.jsx("div",{className:s,children:P}),e[40]=s,e[41]=P,e[42]=T):T=e[42];let z;e[43]!==N||e[44]!==T?(z=t.jsxs("div",{className:"flex items-center gap-1",children:[N,T]}),e[43]=N,e[44]=T,e[45]=z):z=e[45];let F;return e[46]!==z||e[47]!==x||e[48]!==a||e[49]!==k?(F=t.jsx(t.Fragment,{children:t.jsx(fe,{connection:x,onClick:a,className:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:z})}),e[46]=z,e[47]=x,e[48]=a,e[49]=k,e[50]=F):F=e[50],F}function Xt(y){return y.stopPropagation()}function qt(y){return y.stopPropagation()}function Gt(y){const e=ie.c(28),{count:n,total:g,onSelectAll:m,onDeselectAll:d,onDelete:o,onAddToAgent:v,onToggleStatus:h,onCancel:_}=y;if(n===0)return null;let u;e[0]!==n?(u=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=u):u=e[1];let S;e[2]!==n||e[3]!==d||e[4]!==m||e[5]!==g?(S=n<g?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:["Select all (",g,")"]}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:"Clear selection"}),e[2]=n,e[3]=d,e[4]=m,e[5]=g,e[6]=S):S=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:13}),e[7]=x):x=e[7];let a;e[8]!==v?(a=t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:v,children:[x,"Add to Agent"]}),e[8]=v,e[9]=a):a=e[9];let p;e[10]!==h?(p=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("active"),children:"Enable"}),e[10]=h,e[11]=p):p=e[11];let f;e[12]!==h?(f=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("inactive"),children:"Disable"}),e[12]=h,e[13]=f):f=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ge,{size:13}),e[14]=k):k=e[14];let A;e[15]!==o?(A=t.jsxs(B,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:[k,"Delete"]}),e[15]=o,e[16]=A):A=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Qe,{size:13}),e[17]=N):N=e[17];let I;e[18]!==_?(I=t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:_,children:N}),e[18]=_,e[19]=I):I=e[19];let s;return e[20]!==u||e[21]!==I||e[22]!==S||e[23]!==a||e[24]!==p||e[25]!==f||e[26]!==A?(s=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[u,S,a,p,f,A,I]})}),e[20]=u,e[21]=I,e[22]=S,e[23]=a,e[24]=p,e[25]=f,e[26]=A,e[27]=s):s=e[27],s}function Qt(y){const e=ie.c(25),{open:n,onOpenChange:g,agents:m,onConfirm:d}=y,[o,v]=W.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Fe,{children:[t.jsx(Me,{children:"Add to Agent"}),t.jsx(Ve,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let _;e[1]!==m||e[2]!==o?(_=m.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):m.map(N=>t.jsxs("button",{type:"button",onClick:()=>v(N.id),className:re("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",o===N.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{icon:N.icon,name:N.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:N.title}),N.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.description})]})]},N.id)),e[1]=m,e[2]=o,e[3]=_):_=e[3];let u;e[4]!==_?(u=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:_}),e[4]=_,e[5]=u):u=e[5];let S;e[6]!==g?(S=t.jsx(B,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),e[6]=g,e[7]=S):S=e[7];const x=!o;let a;e[8]!==d||e[9]!==g||e[10]!==o?(a=()=>{o&&(d(o),g(!1),v(null))},e[8]=d,e[9]=g,e[10]=o,e[11]=a):a=e[11];let p;e[12]!==x||e[13]!==a?(p=t.jsx(B,{disabled:x,onClick:a,children:"Add"}),e[12]=x,e[13]=a,e[14]=p):p=e[14];let f;e[15]!==S||e[16]!==p?(f=t.jsxs(Be,{children:[S,p]}),e[15]=S,e[16]=p,e[17]=f):f=e[17];let k;e[18]!==u||e[19]!==f?(k=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,u,f]}),e[18]=u,e[19]=f,e[20]=k):k=e[20];let A;return e[21]!==g||e[22]!==n||e[23]!==k?(A=t.jsx(Ee,{open:n,onOpenChange:g,children:k}),e[21]=g,e[22]=n,e[23]=k,e[24]=A):A=e[24],A}function Yt(y){const e=ie.c(20),{open:n,onOpenChange:g,count:m,onConfirm:d}=y,o=m!==1?"s":"";let v;e[0]!==m||e[1]!==o?(v=t.jsxs(De,{children:["Delete ",m," connection",o,"?"]}),e[0]=m,e[1]=o,e[2]=v):v=e[2];const h=m!==1?"s":"";let _;e[3]!==h?(_=t.jsxs(Ae,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=_):_=e[4];let u;e[5]!==v||e[6]!==_?(u=t.jsxs(we,{children:[v,_]}),e[5]=v,e[6]=_,e[7]=u):u=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Te,{children:"Cancel"}),e[8]=S):S=e[8];const x=m!==1?"s":"";let a;e[9]!==m||e[10]!==d||e[11]!==x?(a=t.jsxs(Ie,{children:[S,t.jsxs(Pe,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",m," connection",x]})]}),e[9]=m,e[10]=d,e[11]=x,e[12]=a):a=e[12];let p;e[13]!==u||e[14]!==a?(p=t.jsxs(Le,{children:[u,a]}),e[13]=u,e[14]=a,e[15]=p):p=e[15];let f;return e[16]!==g||e[17]!==n||e[18]!==p?(f=t.jsx(Oe,{open:n,onOpenChange:g,children:p}),e[16]=g,e[17]=n,e[18]=p,e[19]=f):f=e[19],f}function Jt(y){return y._registryId?.includes("community-registry")===!0}function Zt(y){const e=ie.c(56),{item:n,allConnections:g,connectedAppNames:m,connectingItemId:d,onNavigateConnected:o,onConnect:v}=y,[h,_]=W.useState(!1),[u,S]=W.useState(null);let x,a;e[0]!==m||e[1]!==n?(x=ke(n)??"",a=m.has(x),e[0]=m,e[1]=n,e[2]=x,e[3]=a):(x=e[2],a=e[3]);const p=a,f=n._meta?.["mcp.mesh"],k=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",A=n.server?.description||n.description||null;let N;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(N=n.server?.icons?.[0]?.src||Ct(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=N):N=e[6];const I=N;let s;if(e[7]!==g||e[8]!==x){let b;e[10]!==x?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===x,e[10]=x,e[11]=b):b=e[11],s=g.filter(b),e[7]=g,e[8]=x,e[9]=s}else s=e[9];const D=s;let M;e[12]!==n?(M=Jt(n),e[12]=n,e[13]=M):M=e[13];const $=M;let P,T;e[14]!==D||e[15]!==$||e[16]!==p||e[17]!==n||e[18]!==v||e[19]!==o?(P=()=>{if(p){const b=D[0];b&&o(b);return}T()},T=()=>{$?(S("connect"),_(!0)):v(n)},e[14]=D,e[15]=$,e[16]=p,e[17]=n,e[18]=v,e[19]=o,e[20]=P,e[21]=T):(P=e[20],T=e[21]);let z;e[22]!==n||e[23]!==v||e[24]!==u?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),_(!1),u==="connect"&&v(n),S(null)},e[22]=n,e[23]=v,e[24]=u,e[25]=z):z=e[25];const F=z;let j;e[26]!==A||e[27]!==I||e[28]!==k?(j={title:k,description:A,icon:I},e[26]=A,e[27]=I,e[28]=k,e[29]=j):j=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(he,{}),e[30]=R):R=e[30];let U;e[31]!==$||e[32]!==n._sourceIcon?(U=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[31]=$,e[32]=n._sourceIcon,e[33]=U):U=e[33];let X;e[34]!==d||e[35]!==T||e[36]!==p||e[37]!==n.id?(X=p?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:d!==null,onClick:b=>{b.stopPropagation(),T()},children:d===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[34]=d,e[35]=T,e[36]=p,e[37]=n.id,e[38]=X):X=e[38];let i;e[39]!==U||e[40]!==X?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[U,X]}),e[39]=U,e[40]=X,e[41]=i):i=e[41];let C;e[42]!==P||e[43]!==i||e[44]!==j?(C=t.jsx(fe,{connection:j,fallbackIcon:R,onClick:P,headerActionsAlwaysVisible:!0,headerActions:i}),e[42]=P,e[43]=i,e[44]=j,e[45]=C):C=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(we,{children:[t.jsx(De,{children:"Community MCP Server"}),t.jsx(Ae,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[46]=V):V=e[46];let H;e[47]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Te,{children:"Cancel"}),e[47]=H):H=e[47];let E;e[48]!==F?(E=t.jsxs(Le,{children:[V,t.jsxs(Ie,{children:[H,t.jsx(Pe,{onClick:F,children:"Continue"})]})]}),e[48]=F,e[49]=E):E=e[49];let l;e[50]!==h||e[51]!==E?(l=t.jsx(Oe,{open:h,onOpenChange:_,children:E}),e[50]=h,e[51]=E,e[52]=l):l=e[52];let O;return e[53]!==C||e[54]!==l?(O=t.jsxs(t.Fragment,{children:[C,l]}),e[53]=C,e[54]=l,e[55]=O):O=e[55],O}function en({listState:y,activeTab:e,typeFilter:n,statusFilter:g,registryFilter:m,enabledRegistries:d}){const{org:o}=_e(),v=ot(),h=Se(),{data:_}=be.useSession(),u=Ke(),S=$t(y),x=gt(),[a,p]=W.useState(new Set),f=a.size>0,[k,A]=W.useState(!1),[N,I]=W.useState(!1),[s,D]=W.useState(null),M=Ft(),$=S.filter(c=>!(n!=="ALL"&&c.connection_type!==n||g!=="ALL"&&c.status!==g)),P=pt($),T=c=>{p(r=>{const w=new Set(r);return w.has(c)?w.delete(c):w.add(c),w})},z=()=>{p(new Set)},F=Ne(d,y.searchTerm),j=F.items,R=jt(F.loadMore,F.hasMore,F.isLoadingMore),U=new Set(S.filter(c=>c.app_name).map(c=>c.app_name)),X=m==="ALL"||d.some(c=>c.id===m)?m:"ALL",i=y.search.length>0,C=e==="all"||i?j.filter(c=>{if(X!=="ALL"&&c._registryId!==X)return!1;if(i){const r=ke(c);if(r&&U.has(r))return!1}return!0}):[],V=e==="connected"||i?P:[],H=async c=>{if(!(!o||!_?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:c.id,source:"connections_page"}),D(c.id);try{const r=vt(c,o.id,_.user.id,{remoteIndex:0}),w=r.connection_type==="STDIO",L=!!r.connection_url,q=w&&r.connection_headers&&typeof r.connection_headers=="object"&&"command"in r.connection_headers;if(!L&&!q){G.error("This MCP Server cannot be connected: no connection method available"),D(null);return}const{id:K}=await u.create.mutateAsync(r),je=new URL(`/api/${o.slug}/mcp/${K}`,window.location.origin),ye=await it({url:je.href,token:null,orgId:o.id});if(ye.supportsOAuth&&!ye.isAuthenticated){const{token:ae,tokenInfo:ne,error:xe}=await lt({connectionId:K,orgSlug:o.slug,scope:"offline_access"});if(xe||!ae){te("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:xe??"no_token"}),G.error(`Authentication failed: ${xe??"no token received"}`);return}else{if(te("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),ne)try{(await fetch(`/api/${o.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})})).ok?await u.update.mutateAsync({id:K,data:{}}):await u.update.mutateAsync({id:K,data:{connection_token:ae}})}catch{await u.update.mutateAsync({id:K,data:{connection_token:ae}})}else await u.update.mutateAsync({id:K,data:{connection_token:ae}});await v.invalidateQueries({queryKey:ct.isMCPAuthenticated(je.href,null)}),G.success("Authentication successful")}}G.success("Connected successfully")}catch(r){G.error(`Failed to connect: ${r instanceof Error?r.message:String(r)}`)}finally{D(null)}}},E=Et({connectionId:zt,orgId:o.id,orgSlug:o.slug}),l=()=>{v.invalidateQueries({predicate:c=>{const r=c.queryKey;return r[1]===o.id&&r[3]==="collection"&&r[4]==="CONNECTIONS"}})},O=async()=>{A(!1);const c=[...a];te("connections_bulk_delete",{count:c.length});let r=0;for(const w of c)try{(await E.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:w,force:!0}})).isError||r++}catch{}l(),G.success(`Deleted ${r} connection${r!==1?"s":""}`),z()},b=async c=>{const r=[...a];te("connections_bulk_status_toggled",{count:r.length,to_status:c});let w=0;for(const L of r)try{await u.update.mutateAsync({id:L,data:{status:c}}),w++}catch{}l(),G.success(`${c==="active"?"Enabled":"Disabled"} ${w} connection${w!==1?"s":""}`),z()},se=async c=>{const r=M.find(q=>q.id===c);if(!r||!E)return;te("connections_bulk_add_to_agent",{agent_id:c,count:a.size});const w=new Set(r.connections.map(q=>q.connection_id)),L=[...a].filter(q=>!w.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(L.length===0){G.info("All selected connections are already in that agent");return}try{await E.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{connections:[...r.connections,...L]}}}),v.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===o.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),G.success(`Added ${L.length} connection${L.length!==1?"s":""} to "${r.title}"`),z()}catch{G.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...x}),t.jsx(Yt,{open:k,onOpenChange:A,count:a.size,onConfirm:O}),t.jsx(Qt,{open:N,onOpenChange:I,agents:M,onConfirm:se}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(i?C.length===0&&$.length===0:e==="all"?C.length===0:$.length===0)?t.jsx(ht,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:y.search?`No Connections match "${y.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[V.map(c=>{if(c.type==="group")return t.jsx(Wt,{group:c,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:c.key}})},selectionMode:f,selectedIds:a,onToggleSelect:T},c.key);const r=c.connection,w=a.has(r.id);return t.jsx(fe,{connection:r,fallbackIcon:t.jsx(he,{}),onClick:()=>f?T(r.id):h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}}),className:re(w&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[f?t.jsx($e,{checked:w,onCheckedChange:()=>T(r.id),onClick:L=>L.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:re("overflow-hidden transition-all duration-150 ease-out",f?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Re,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:L=>L.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(He,{align:"end",onClick:L=>L.stopPropagation(),children:[t.jsxs(pe,{onClick:L=>{L.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}})},children:[t.jsx(Xe,{size:16}),"Open"]}),t.jsxs(pe,{onClick:L=>{L.stopPropagation(),T(r.id)},children:[t.jsx(Vt,{size:16}),"Select"]}),t.jsxs(pe,{variant:"destructive",onClick:L=>{L.stopPropagation(),x.requestDelete(r)},children:[t.jsx(Ge,{size:16}),"Delete"]})]})]})})]})},r.id)}),C.map(c=>t.jsx(Zt,{item:c,allConnections:S,connectedAppNames:U,connectingItemId:s,onNavigateConnected:r=>h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}}),onConnect:H},`catalog-${c._registryId}:${c.id}`)),(e==="all"||i)&&d.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||i)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),f&&t.jsx(Gt,{count:a.size,total:$.length,onSelectAll:()=>{p(new Set($.map(c=>c.id)))},onDeselectAll:()=>p(new Set),onDelete:()=>A(!0),onAddToAgent:()=>I(!0),onToggleStatus:b,onCancel:z})]})}function tn(){const{org:y}=_e(),e=Se(),n=Je({strict:!1}),{data:g}=be.useSession(),{stdioEnabled:m}=Ze(),d=wt(),o=yt({namespace:y.slug,resource:"connections"}),v=Ke(),[h,_]=et(tt.connectionsTab(y.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[u,S]=W.useState("ALL"),[x,a]=W.useState("ALL"),[p,f]=W.useState("ALL"),k=ut(),N=Ne(k,o.searchTerm).items,I=o.search!==o.searchTerm,s=nt({resolver:st(Rt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=s.watch("ui_type"),M=s.watch("connection_url"),$=s.watch("npx_package"),P=me({uiType:D,connectionUrl:M??"",npxPackage:$??""})??ve({uiType:D,connectionUrl:M??"",registryItems:N}),T=n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:y.slug},search:{action:"create"}})},F=()=>{e({to:"/$org/settings/connections",params:{org:y.slug},search:{}})},j=async i=>{let C,V=null,H=null,E=null;i.ui_type==="NPX"?(C="STDIO",V="",E=Ht(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(C="STDIO",V="",E=Kt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(C=i.ui_type,V=i.connection_url||"",H=i.connection_token||null);const l=rt("conn");te("connection_custom_created",{connection_type:C,ui_type:i.ui_type}),await v.create.mutateAsync({id:l,title:i.title,description:i.description||null,connection_type:C,connection_url:V,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:g?.user?.id||"system",organization_id:y.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),F(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:ue({app_name:null,connection_url:V,title:i.title,id:l})}})},R=i=>{i||(T&&F(),s.reset())},U=i=>{const C=i.trim();if(!C)return;const V=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,l=b=>{if(b&&(!V&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!E&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],c=new Set(se.map(w=>w.key)),r=b.envVarKeys.filter(w=>!c.has(w));r.length>0&&s.setValue("env_vars",[...se,...r.map(w=>({key:w,value:""}))],{shouldDirty:!0})}},O=Ut(C);if(O&&m){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",O.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),l(me({uiType:"NPX",npxPackage:O.packageName}));return}if(C.startsWith("http://")||C.startsWith("https://")){const b=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",C,{shouldDirty:!0}),l(me({uiType:b,connectionUrl:C})??ve({uiType:b,connectionUrl:C,registryItems:N}));return}D==="NPX"&&l(me({uiType:"NPX",npxPackage:C}))},X=t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(B,{variant:"outline",onClick:z,children:[t.jsx(qe,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})});return t.jsx(t.Fragment,{children:t.jsxs(de,{children:[(()=>{const i="Create Connection",C="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Type *"}),t.jsxs(Tt,{value:l.value,onValueChange:l.onChange,children:[t.jsx(Z,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Lt,{children:[t.jsx(le,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(le,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(le,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(le,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(le,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),U(b))},onBlur:O=>{U(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Command *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"node, bun, python...",...l,value:l.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"arg1 arg2 --flag value",...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"/path/to/project (optional)",...l,value:l.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:l.value??[],onChange:l.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"URL *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"https://example.com/mcp",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),U(b))},onBlur:O=>{U(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:P?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...l,value:l.value??""})}),P?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Name *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"My Connection",...l})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Description"}),t.jsx(Z,{children:t.jsx(Ot,{placeholder:"A brief description of this connection",rows:3,...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),E=T;return d?t.jsx(_t,{open:E,onOpenChange:R,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Nt,{children:i}),t.jsx(kt,{className:"mt-1",children:C})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Qe,{size:16})})})]})}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(At,{children:t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ee,{open:E,onOpenChange:R,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Fe,{children:[t.jsx(Me,{children:i}),t.jsx(Ve,{children:C})]}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Be,{children:[t.jsx(B,{type:"button",variant:"outline",onClick:()=>R(!1),children:"Cancel"}),t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(de.Content,{children:t.jsx(de.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(de.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(dt,{value:o.search,onChange:o.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(o.setSearch(""),i.target.blur())}}),t.jsx(at,{sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:u,onChange:i=>S(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:x,onChange:i=>a(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},...k.length>1?[{label:"Registry",value:p,onChange:i=>f(i||"ALL"),options:[{id:"ALL",label:"All registries"},...k.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),X]}),t.jsx(mt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:h,onTabChange:i=>{const C=i;C!==h&&te("connections_page_tab_changed",{to_tab:C}),_(C)}}),t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:I?.5:1,transition:I?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:I?"none":"auto"},children:t.jsx(en,{listState:o,activeTab:h,typeFilter:u,statusFilter:x,registryFilter:p,enabledRegistries:k})})})]})})})]})})}function ys(){const y=ie.c(1);let e;return y[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),y[0]=e):e=y[0],e}export{ys as default};
1
+ import{e as ie,j as t,E as Ye,r as W,l as ce,s as _e,f as Se,d as Je,b as be,u as Ze,Q as et,R as tt,z as nt,C as st,B,t as te,o as ot,c as re,x as G,G as it,F as lt,K as ct}from"./index-Byh16eae.js";import{g as rt}from"./constants-CqYb75aZ.js";import{C as at}from"./collection-display-button-Cz_4oQot.js";import{S as dt}from"./search-input-CQG6oP1I.js";import{C as mt}from"./collection-tabs-yGBJSAc8.js";import{u as ut,a as Ne,g as pt,C as fe}from"./connection-card-Bpj8ZSs7.js";import{E as ht}from"./empty-state-BBjIyjuI.js";import{I as xt}from"./integration-icon-qqFh_bDX.js";import{P as de}from"./index-CO-xtUtF.js";import{u as gt,D as ft}from"./use-delete-connection-DOTVFlyu.js";import{u as jt}from"./use-infinite-scroll-CeNFrFZw.js";import{u as yt}from"./use-list-state-ChPE6VX_.js";import{g as ke,a as Ct,e as vt}from"./extract-connection-data-DRmUoKq6.js";import{g as ue}from"./connection-slug-eyAPH6o3.js";import{c as De,d as Ae,b as we,f as Te,e as Ie,g as Pe,a as Le,A as Oe}from"./alert-dialog-CczJ0CiT.js";import{C as $e}from"./checkbox-q02yCTCr.js";import{b as Ee,a as ze,c as Fe,d as Me,e as Ve,D as Be}from"./dialog-Cv4ROuD1.js";import{b as _t,a as St,c as bt,D as Nt,d as kt,e as Dt,f as At}from"./drawer-BvCmaZEN.js";import{u as wt}from"./tooltip-D6qvPlF4.js";import{D as Re,a as Ue,b as He,c as pe}from"./dropdown-menu-CXpZ_ns-.js";import{F as Q,b as Y,c as J,d as Z,f as ee,a as Ce}from"./form-vv7czlx-.js";import{I as oe}from"./input-Vak5VRqX.js";import{S as Tt,a as It,b as Pt,c as Lt,d as le}from"./select-CBnW7xgF.js";import{T as Ot}from"./textarea-BCuCo32x.js";import{b as Ke,u as $t}from"./use-connection-kAb3_1aU.js";import{u as Et,S as zt}from"./constants-DoDQutb_.js";import{b as Ft}from"./use-virtual-mcp-CriuigLx.js";import{a as Mt,S as Vt}from"./agent-icon-2WwvMIOR.js";import{n as he}from"./Container-BmeFpotW.js";import{i as We}from"./DotsVertical-Dpo2lfzf.js";import{s as Xe}from"./RefreshCcw01-U2jJl9XZ.js";import{s as ge}from"./Star01-BIiXL1NH.js";import{s as qe}from"./Plus-DNS-JW4m.js";import{s as Ge}from"./Trash01-DygHC0Or.js";import{s as Qe}from"./XClose-BD0-I41d.js";import{i as me,a as ve,E as Bt,c as Rt,p as Ut,b as Ht,d as Kt}from"./connection-form-helpers-_eiZ9Dyj.js";import"./collections-Bdy_Kvem.js";import"./ChevronDown-ChKIyEYX.js";import"./view-mode-toggle-YvwpFyqQ.js";import"./badge-CqM8ft8a.js";import"./SearchMd-CJRrkj_7.js";import"./use-registry-connections-Br5-A4Q9.js";import"./use-organization-settings-CffFj1WY.js";import"./useInfiniteQuery-CXsqG0YB.js";import"./infiniteQueryObserver-CeXFUdTd.js";import"./card-BromnR4D.js";import"./X-CaSicsGt.js";import"./use-view-mode-BqPySn5U.js";import"./ChevronRight-CfxVPCJg.js";import"./label-BNsXufvU.js";import"./ChevronUp-DrgxDzSb.js";import"./use-collections-BYyKflom.js";import"./AlertCircle-DykTdePm.js";import"./Tool01-B3jB5-GF.js";import"./ArrowNarrowLeft-BSnqV9Qp.js";import"./XCircle-CAjnYXMv.js";import"./ArrowUpRight-BbCrxIiB.js";import"./ZapSquare-DJjYeaGT.js";import"./Users03-CdkPI2qt.js";import"./CheckCircle-dpfQl31_.js";import"./Palette-DWycQqah.js";import"./LinkExternal01-BFenb5P9.js";import"./Lock01-D4wd-Mt0.js";import"./Sun-DJvU306F.js";import"./Play-3GU5tyK6.js";import"./Settings02-BfZESxtt.js";import"./Shield01-CuEoE6Cq.js";import"./User01-XcdTTiqO.js";import"./Zap-DSo0BijB.js";function Wt(y){const e=ie.c(51),{group:n,onOpen:g,selectionMode:m,selectedIds:d,onToggleSelect:o}=y;let v;if(e[0]!==n.connections||e[1]!==d){let j;e[3]!==d?(j=R=>d.has(R.id),e[3]=d,e[4]=j):j=e[4],v=n.connections.every(j),e[0]=n.connections,e[1]=d,e[2]=v}else v=e[2];const h=v;let _;if(e[5]!==n.connections||e[6]!==d){let j;e[8]!==d?(j=R=>d.has(R.id),e[8]=d,e[9]=j):j=e[9],_=n.connections.some(j),e[5]=n.connections,e[6]=d,e[7]=_}else _=e[7];const u=_,S=`${n.connections.length} instances`;let x;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(x={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=x):x=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==g||e[17]!==o||e[18]!==d||e[19]!==m?(a=()=>m?(()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)})():g(),e[14]=h,e[15]=n.connections,e[16]=g,e[17]=o,e[18]=d,e[19]=m,e[20]=a):a=e[20];const p=m&&h&&"ring-2 ring-primary",f=m&&u&&!h&&"ring-1 ring-primary/50";let k;e[21]!==p||e[22]!==f?(k=re(p,f),e[21]=p,e[22]=f,e[23]=k):k=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(he,{}),e[24]=A):A=e[24];let N;e[25]!==h||e[26]!==n.connections||e[27]!==o||e[28]!==d||e[29]!==m||e[30]!==u?(N=m?t.jsx($e,{checked:h?!0:u?"indeterminate":!1,onCheckedChange:()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=o,e[28]=d,e[29]=m,e[30]=u,e[31]=N):N=e[31];const I=m?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[32]!==I?(s=re("overflow-hidden transition-all duration-150 ease-out",I),e[32]=I,e[33]=s):s=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(Ue,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qt,children:t.jsx(We,{size:20})})}),e[34]=D):D=e[34];let M;e[35]!==g?(M=j=>{j.stopPropagation(),g()},e[35]=g,e[36]=M):M=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Xe,{size:16}),e[37]=$):$=e[37];let P;e[38]!==M?(P=t.jsxs(Re,{children:[D,t.jsx(He,{align:"end",onClick:Xt,children:t.jsxs(pe,{onClick:M,children:[$,"Open"]})})]}),e[38]=M,e[39]=P):P=e[39];let T;e[40]!==s||e[41]!==P?(T=t.jsx("div",{className:s,children:P}),e[40]=s,e[41]=P,e[42]=T):T=e[42];let z;e[43]!==N||e[44]!==T?(z=t.jsxs("div",{className:"flex items-center gap-1",children:[N,T]}),e[43]=N,e[44]=T,e[45]=z):z=e[45];let F;return e[46]!==z||e[47]!==x||e[48]!==a||e[49]!==k?(F=t.jsx(t.Fragment,{children:t.jsx(fe,{connection:x,onClick:a,className:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:z})}),e[46]=z,e[47]=x,e[48]=a,e[49]=k,e[50]=F):F=e[50],F}function Xt(y){return y.stopPropagation()}function qt(y){return y.stopPropagation()}function Gt(y){const e=ie.c(28),{count:n,total:g,onSelectAll:m,onDeselectAll:d,onDelete:o,onAddToAgent:v,onToggleStatus:h,onCancel:_}=y;if(n===0)return null;let u;e[0]!==n?(u=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=u):u=e[1];let S;e[2]!==n||e[3]!==d||e[4]!==m||e[5]!==g?(S=n<g?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:["Select all (",g,")"]}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:"Clear selection"}),e[2]=n,e[3]=d,e[4]=m,e[5]=g,e[6]=S):S=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:13}),e[7]=x):x=e[7];let a;e[8]!==v?(a=t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:v,children:[x,"Add to Agent"]}),e[8]=v,e[9]=a):a=e[9];let p;e[10]!==h?(p=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("active"),children:"Enable"}),e[10]=h,e[11]=p):p=e[11];let f;e[12]!==h?(f=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("inactive"),children:"Disable"}),e[12]=h,e[13]=f):f=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ge,{size:13}),e[14]=k):k=e[14];let A;e[15]!==o?(A=t.jsxs(B,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:[k,"Delete"]}),e[15]=o,e[16]=A):A=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Qe,{size:13}),e[17]=N):N=e[17];let I;e[18]!==_?(I=t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:_,children:N}),e[18]=_,e[19]=I):I=e[19];let s;return e[20]!==u||e[21]!==I||e[22]!==S||e[23]!==a||e[24]!==p||e[25]!==f||e[26]!==A?(s=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[u,S,a,p,f,A,I]})}),e[20]=u,e[21]=I,e[22]=S,e[23]=a,e[24]=p,e[25]=f,e[26]=A,e[27]=s):s=e[27],s}function Qt(y){const e=ie.c(25),{open:n,onOpenChange:g,agents:m,onConfirm:d}=y,[o,v]=W.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Fe,{children:[t.jsx(Me,{children:"Add to Agent"}),t.jsx(Ve,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let _;e[1]!==m||e[2]!==o?(_=m.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):m.map(N=>t.jsxs("button",{type:"button",onClick:()=>v(N.id),className:re("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",o===N.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{icon:N.icon,name:N.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:N.title}),N.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.description})]})]},N.id)),e[1]=m,e[2]=o,e[3]=_):_=e[3];let u;e[4]!==_?(u=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:_}),e[4]=_,e[5]=u):u=e[5];let S;e[6]!==g?(S=t.jsx(B,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),e[6]=g,e[7]=S):S=e[7];const x=!o;let a;e[8]!==d||e[9]!==g||e[10]!==o?(a=()=>{o&&(d(o),g(!1),v(null))},e[8]=d,e[9]=g,e[10]=o,e[11]=a):a=e[11];let p;e[12]!==x||e[13]!==a?(p=t.jsx(B,{disabled:x,onClick:a,children:"Add"}),e[12]=x,e[13]=a,e[14]=p):p=e[14];let f;e[15]!==S||e[16]!==p?(f=t.jsxs(Be,{children:[S,p]}),e[15]=S,e[16]=p,e[17]=f):f=e[17];let k;e[18]!==u||e[19]!==f?(k=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,u,f]}),e[18]=u,e[19]=f,e[20]=k):k=e[20];let A;return e[21]!==g||e[22]!==n||e[23]!==k?(A=t.jsx(Ee,{open:n,onOpenChange:g,children:k}),e[21]=g,e[22]=n,e[23]=k,e[24]=A):A=e[24],A}function Yt(y){const e=ie.c(20),{open:n,onOpenChange:g,count:m,onConfirm:d}=y,o=m!==1?"s":"";let v;e[0]!==m||e[1]!==o?(v=t.jsxs(De,{children:["Delete ",m," connection",o,"?"]}),e[0]=m,e[1]=o,e[2]=v):v=e[2];const h=m!==1?"s":"";let _;e[3]!==h?(_=t.jsxs(Ae,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=_):_=e[4];let u;e[5]!==v||e[6]!==_?(u=t.jsxs(we,{children:[v,_]}),e[5]=v,e[6]=_,e[7]=u):u=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Te,{children:"Cancel"}),e[8]=S):S=e[8];const x=m!==1?"s":"";let a;e[9]!==m||e[10]!==d||e[11]!==x?(a=t.jsxs(Ie,{children:[S,t.jsxs(Pe,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",m," connection",x]})]}),e[9]=m,e[10]=d,e[11]=x,e[12]=a):a=e[12];let p;e[13]!==u||e[14]!==a?(p=t.jsxs(Le,{children:[u,a]}),e[13]=u,e[14]=a,e[15]=p):p=e[15];let f;return e[16]!==g||e[17]!==n||e[18]!==p?(f=t.jsx(Oe,{open:n,onOpenChange:g,children:p}),e[16]=g,e[17]=n,e[18]=p,e[19]=f):f=e[19],f}function Jt(y){return y._registryId?.includes("community-registry")===!0}function Zt(y){const e=ie.c(56),{item:n,allConnections:g,connectedAppNames:m,connectingItemId:d,onNavigateConnected:o,onConnect:v}=y,[h,_]=W.useState(!1),[u,S]=W.useState(null);let x,a;e[0]!==m||e[1]!==n?(x=ke(n)??"",a=m.has(x),e[0]=m,e[1]=n,e[2]=x,e[3]=a):(x=e[2],a=e[3]);const p=a,f=n._meta?.["mcp.mesh"],k=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",A=n.server?.description||n.description||null;let N;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(N=n.server?.icons?.[0]?.src||Ct(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=N):N=e[6];const I=N;let s;if(e[7]!==g||e[8]!==x){let b;e[10]!==x?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===x,e[10]=x,e[11]=b):b=e[11],s=g.filter(b),e[7]=g,e[8]=x,e[9]=s}else s=e[9];const D=s;let M;e[12]!==n?(M=Jt(n),e[12]=n,e[13]=M):M=e[13];const $=M;let P,T;e[14]!==D||e[15]!==$||e[16]!==p||e[17]!==n||e[18]!==v||e[19]!==o?(P=()=>{if(p){const b=D[0];b&&o(b);return}T()},T=()=>{$?(S("connect"),_(!0)):v(n)},e[14]=D,e[15]=$,e[16]=p,e[17]=n,e[18]=v,e[19]=o,e[20]=P,e[21]=T):(P=e[20],T=e[21]);let z;e[22]!==n||e[23]!==v||e[24]!==u?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),_(!1),u==="connect"&&v(n),S(null)},e[22]=n,e[23]=v,e[24]=u,e[25]=z):z=e[25];const F=z;let j;e[26]!==A||e[27]!==I||e[28]!==k?(j={title:k,description:A,icon:I},e[26]=A,e[27]=I,e[28]=k,e[29]=j):j=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(he,{}),e[30]=R):R=e[30];let U;e[31]!==$||e[32]!==n._sourceIcon?(U=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[31]=$,e[32]=n._sourceIcon,e[33]=U):U=e[33];let X;e[34]!==d||e[35]!==T||e[36]!==p||e[37]!==n.id?(X=p?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:d!==null,onClick:b=>{b.stopPropagation(),T()},children:d===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[34]=d,e[35]=T,e[36]=p,e[37]=n.id,e[38]=X):X=e[38];let i;e[39]!==U||e[40]!==X?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[U,X]}),e[39]=U,e[40]=X,e[41]=i):i=e[41];let C;e[42]!==P||e[43]!==i||e[44]!==j?(C=t.jsx(fe,{connection:j,fallbackIcon:R,onClick:P,headerActionsAlwaysVisible:!0,headerActions:i}),e[42]=P,e[43]=i,e[44]=j,e[45]=C):C=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(we,{children:[t.jsx(De,{children:"Community MCP Server"}),t.jsx(Ae,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[46]=V):V=e[46];let H;e[47]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Te,{children:"Cancel"}),e[47]=H):H=e[47];let E;e[48]!==F?(E=t.jsxs(Le,{children:[V,t.jsxs(Ie,{children:[H,t.jsx(Pe,{onClick:F,children:"Continue"})]})]}),e[48]=F,e[49]=E):E=e[49];let l;e[50]!==h||e[51]!==E?(l=t.jsx(Oe,{open:h,onOpenChange:_,children:E}),e[50]=h,e[51]=E,e[52]=l):l=e[52];let O;return e[53]!==C||e[54]!==l?(O=t.jsxs(t.Fragment,{children:[C,l]}),e[53]=C,e[54]=l,e[55]=O):O=e[55],O}function en({listState:y,activeTab:e,typeFilter:n,statusFilter:g,registryFilter:m,enabledRegistries:d}){const{org:o}=_e(),v=ot(),h=Se(),{data:_}=be.useSession(),u=Ke(),S=$t(y),x=gt(),[a,p]=W.useState(new Set),f=a.size>0,[k,A]=W.useState(!1),[N,I]=W.useState(!1),[s,D]=W.useState(null),M=Ft(),$=S.filter(c=>!(n!=="ALL"&&c.connection_type!==n||g!=="ALL"&&c.status!==g)),P=pt($),T=c=>{p(r=>{const w=new Set(r);return w.has(c)?w.delete(c):w.add(c),w})},z=()=>{p(new Set)},F=Ne(d,y.searchTerm),j=F.items,R=jt(F.loadMore,F.hasMore,F.isLoadingMore),U=new Set(S.filter(c=>c.app_name).map(c=>c.app_name)),X=m==="ALL"||d.some(c=>c.id===m)?m:"ALL",i=y.search.length>0,C=e==="all"||i?j.filter(c=>{if(X!=="ALL"&&c._registryId!==X)return!1;if(i){const r=ke(c);if(r&&U.has(r))return!1}return!0}):[],V=e==="connected"||i?P:[],H=async c=>{if(!(!o||!_?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:c.id,source:"connections_page"}),D(c.id);try{const r=vt(c,o.id,_.user.id,{remoteIndex:0}),w=r.connection_type==="STDIO",L=!!r.connection_url,q=w&&r.connection_headers&&typeof r.connection_headers=="object"&&"command"in r.connection_headers;if(!L&&!q){G.error("This MCP Server cannot be connected: no connection method available"),D(null);return}const{id:K}=await u.create.mutateAsync(r),je=new URL(`/api/${o.slug}/mcp/${K}`,window.location.origin),ye=await it({url:je.href,token:null,orgId:o.id});if(ye.supportsOAuth&&!ye.isAuthenticated){const{token:ae,tokenInfo:ne,error:xe}=await lt({connectionId:K,orgSlug:o.slug,scope:"offline_access"});if(xe||!ae){te("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:xe??"no_token"}),G.error(`Authentication failed: ${xe??"no token received"}`);return}else{if(te("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),ne)try{(await fetch(`/api/${o.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})})).ok?await u.update.mutateAsync({id:K,data:{}}):await u.update.mutateAsync({id:K,data:{connection_token:ae}})}catch{await u.update.mutateAsync({id:K,data:{connection_token:ae}})}else await u.update.mutateAsync({id:K,data:{connection_token:ae}});await v.invalidateQueries({queryKey:ct.isMCPAuthenticated(je.href,null)}),G.success("Authentication successful")}}G.success("Connected successfully")}catch(r){G.error(`Failed to connect: ${r instanceof Error?r.message:String(r)}`)}finally{D(null)}}},E=Et({connectionId:zt,orgId:o.id,orgSlug:o.slug}),l=()=>{v.invalidateQueries({predicate:c=>{const r=c.queryKey;return r[1]===o.id&&r[3]==="collection"&&r[4]==="CONNECTIONS"}})},O=async()=>{A(!1);const c=[...a];te("connections_bulk_delete",{count:c.length});let r=0;for(const w of c)try{(await E.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:w,force:!0}})).isError||r++}catch{}l(),G.success(`Deleted ${r} connection${r!==1?"s":""}`),z()},b=async c=>{const r=[...a];te("connections_bulk_status_toggled",{count:r.length,to_status:c});let w=0;for(const L of r)try{await u.update.mutateAsync({id:L,data:{status:c}}),w++}catch{}l(),G.success(`${c==="active"?"Enabled":"Disabled"} ${w} connection${w!==1?"s":""}`),z()},se=async c=>{const r=M.find(q=>q.id===c);if(!r||!E)return;te("connections_bulk_add_to_agent",{agent_id:c,count:a.size});const w=new Set(r.connections.map(q=>q.connection_id)),L=[...a].filter(q=>!w.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(L.length===0){G.info("All selected connections are already in that agent");return}try{await E.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{connections:[...r.connections,...L]}}}),v.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===o.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),G.success(`Added ${L.length} connection${L.length!==1?"s":""} to "${r.title}"`),z()}catch{G.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...x}),t.jsx(Yt,{open:k,onOpenChange:A,count:a.size,onConfirm:O}),t.jsx(Qt,{open:N,onOpenChange:I,agents:M,onConfirm:se}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(i?C.length===0&&$.length===0:e==="all"?C.length===0:$.length===0)?t.jsx(ht,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:y.search?`No Connections match "${y.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[V.map(c=>{if(c.type==="group")return t.jsx(Wt,{group:c,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:c.key}})},selectionMode:f,selectedIds:a,onToggleSelect:T},c.key);const r=c.connection,w=a.has(r.id);return t.jsx(fe,{connection:r,fallbackIcon:t.jsx(he,{}),onClick:()=>f?T(r.id):h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}}),className:re(w&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[f?t.jsx($e,{checked:w,onCheckedChange:()=>T(r.id),onClick:L=>L.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:re("overflow-hidden transition-all duration-150 ease-out",f?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Re,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:L=>L.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(He,{align:"end",onClick:L=>L.stopPropagation(),children:[t.jsxs(pe,{onClick:L=>{L.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}})},children:[t.jsx(Xe,{size:16}),"Open"]}),t.jsxs(pe,{onClick:L=>{L.stopPropagation(),T(r.id)},children:[t.jsx(Vt,{size:16}),"Select"]}),t.jsxs(pe,{variant:"destructive",onClick:L=>{L.stopPropagation(),x.requestDelete(r)},children:[t.jsx(Ge,{size:16}),"Delete"]})]})]})})]})},r.id)}),C.map(c=>t.jsx(Zt,{item:c,allConnections:S,connectedAppNames:U,connectingItemId:s,onNavigateConnected:r=>h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}}),onConnect:H},`catalog-${c._registryId}:${c.id}`)),(e==="all"||i)&&d.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||i)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),f&&t.jsx(Gt,{count:a.size,total:$.length,onSelectAll:()=>{p(new Set($.map(c=>c.id)))},onDeselectAll:()=>p(new Set),onDelete:()=>A(!0),onAddToAgent:()=>I(!0),onToggleStatus:b,onCancel:z})]})}function tn(){const{org:y}=_e(),e=Se(),n=Je({strict:!1}),{data:g}=be.useSession(),{stdioEnabled:m}=Ze(),d=wt(),o=yt({namespace:y.slug,resource:"connections"}),v=Ke(),[h,_]=et(tt.connectionsTab(y.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[u,S]=W.useState("ALL"),[x,a]=W.useState("ALL"),[p,f]=W.useState("ALL"),k=ut(),N=Ne(k,o.searchTerm).items,I=o.search!==o.searchTerm,s=nt({resolver:st(Rt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=s.watch("ui_type"),M=s.watch("connection_url"),$=s.watch("npx_package"),P=me({uiType:D,connectionUrl:M??"",npxPackage:$??""})??ve({uiType:D,connectionUrl:M??"",registryItems:N}),T=n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:y.slug},search:{action:"create"}})},F=()=>{e({to:"/$org/settings/connections",params:{org:y.slug},search:{}})},j=async i=>{let C,V=null,H=null,E=null;i.ui_type==="NPX"?(C="STDIO",V="",E=Ht(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(C="STDIO",V="",E=Kt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(C=i.ui_type,V=i.connection_url||"",H=i.connection_token||null);const l=rt("conn");te("connection_custom_created",{connection_type:C,ui_type:i.ui_type}),await v.create.mutateAsync({id:l,title:i.title,description:i.description||null,connection_type:C,connection_url:V,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:g?.user?.id||"system",organization_id:y.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),F(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:ue({app_name:null,connection_url:V,title:i.title,id:l})}})},R=i=>{i||(T&&F(),s.reset())},U=i=>{const C=i.trim();if(!C)return;const V=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,l=b=>{if(b&&(!V&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!E&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],c=new Set(se.map(w=>w.key)),r=b.envVarKeys.filter(w=>!c.has(w));r.length>0&&s.setValue("env_vars",[...se,...r.map(w=>({key:w,value:""}))],{shouldDirty:!0})}},O=Ut(C);if(O&&m){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",O.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),l(me({uiType:"NPX",npxPackage:O.packageName}));return}if(C.startsWith("http://")||C.startsWith("https://")){const b=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",C,{shouldDirty:!0}),l(me({uiType:b,connectionUrl:C})??ve({uiType:b,connectionUrl:C,registryItems:N}));return}D==="NPX"&&l(me({uiType:"NPX",npxPackage:C}))},X=t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(B,{variant:"outline",onClick:z,children:[t.jsx(qe,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})});return t.jsx(t.Fragment,{children:t.jsxs(de,{children:[(()=>{const i="Create Connection",C="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Type *"}),t.jsxs(Tt,{value:l.value,onValueChange:l.onChange,children:[t.jsx(Z,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Lt,{children:[t.jsx(le,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(le,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(le,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(le,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(le,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),U(b))},onBlur:O=>{U(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Command *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"node, bun, python...",...l,value:l.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"arg1 arg2 --flag value",...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"/path/to/project (optional)",...l,value:l.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:l.value??[],onChange:l.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"URL *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"https://example.com/mcp",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),U(b))},onBlur:O=>{U(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:P?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...l,value:l.value??""})}),P?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Name *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"My Connection",...l})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Description"}),t.jsx(Z,{children:t.jsx(Ot,{placeholder:"A brief description of this connection",rows:3,...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),E=T;return d?t.jsx(_t,{open:E,onOpenChange:R,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Nt,{children:i}),t.jsx(kt,{className:"mt-1",children:C})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Qe,{size:16})})})]})}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(At,{children:t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ee,{open:E,onOpenChange:R,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Fe,{children:[t.jsx(Me,{children:i}),t.jsx(Ve,{children:C})]}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Be,{children:[t.jsx(B,{type:"button",variant:"outline",onClick:()=>R(!1),children:"Cancel"}),t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(de.Content,{children:t.jsx(de.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(de.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(dt,{value:o.search,onChange:o.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(o.setSearch(""),i.target.blur())}}),t.jsx(at,{sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:u,onChange:i=>S(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:x,onChange:i=>a(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},...k.length>1?[{label:"Registry",value:p,onChange:i=>f(i||"ALL"),options:[{id:"ALL",label:"All registries"},...k.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),X]}),t.jsx(mt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:h,onTabChange:i=>{const C=i;C!==h&&te("connections_page_tab_changed",{to_tab:C}),_(C)}}),t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:I?.5:1,transition:I?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:I?"none":"auto"},children:t.jsx(en,{listState:o,activeTab:h,typeFilter:u,statusFilter:x,registryFilter:p,enabledRegistries:k})})})]})})})]})})}function ys(){const y=ie.c(1);let e;return y[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),y[0]=e):e=y[0],e}export{ys as default};
@@ -1 +1 @@
1
- import{B as r}from"./collections-Bmez1LkJ.js";import{bO as o}from"./index-mk6gx7es.js";let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",l=(t=21)=>{let e="",a=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=n[a[t]&63];return e};function m(t){return`${t}_${l()}`}const s=o(r,{target:"draft-7"});export{s as B,m as g};
1
+ import{B as r}from"./collections-Bdy_Kvem.js";import{bO as o}from"./index-Byh16eae.js";let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",l=(t=21)=>{let e="",a=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=n[a[t]&63];return e};function m(t){return`${t}_${l()}`}const s=o(r,{target:"draft-7"});export{s as B,m as g};
@@ -1,4 +1,4 @@
1
- import{cM as ce,cN as le,cO as ue,bw as de,cP as he,aO as p,aP as w,cQ as fe,cR as pe,cS as me,cT as A,cU as ge,cV as x,cW as _e,cX as q,cY as we,cZ as F,c_ as Te,c$ as ye,d0 as ve,d1 as W,bb as ke,cD as Se,d2 as be,br as ee,bE as Ce,bK as Re,bI as Ie,d3 as Ee,d4 as qe,d5 as Pe,d6 as $,d7 as Me,d8 as Ae,bJ as $e,bF as He,bG as Oe,bH as Ne,bD as Le,d9 as De,da as xe,db as Fe,by as Ue,dc as je,dd as Ve,cy as P,cz as H,cA as Q,de as ze,bL as L,e as te,w as se}from"./index-mk6gx7es.js";const V={authConfig:()=>["authConfig"],threads:s=>["threads",s],virtualMcpThreads:(s,e)=>["threads",s,"virtual-mcp",e],thread:(s,e)=>["thread",s,e],threadMessages:(s,e)=>["thread-messages",s,e],messages:s=>["messages",s],organizations:()=>["organizations"],members:s=>[s,"members"],invitations:s=>[s,"invitations"],organizationRoles:s=>[s,"organization-roles"],connections:s=>[s,"connections"],connectionsByBinding:(s,e)=>[s,"connections",`binding:${e}`],connection:(s,e)=>[s,"connection",e],isMCPAuthenticated:(s,e)=>["is-mcp-authenticated",s,e],mcpTools:(s,e)=>["mcp","tools",s,e],mcpClient:(s,e,t,r)=>["mcp","client",s,e,t,r],mcpToolsList:s=>["mcp","client",s,"tools"],mcpResourcesList:s=>["mcp","client",s,"resources"],mcpPromptsList:s=>["mcp","client",s,"prompts"],mcpReadResource:(s,e)=>["mcp","client",s,"resource",e],mcpGetPrompt:(s,e,t)=>["mcp","client",s,"prompt",e,t],mcpToolCall:(s,e,t)=>["mcp","client",s,"tool-call",e,t],organizationSettings:s=>["organization-settings",s],activeOrganization:s=>["activeOrganization",s],modelsList:s=>["models-list",s],connectionCollections:s=>[s,"collections","discovery"],toolCall:(s,e,t)=>["tool-call",s,e,t],collectionItems:(s,e)=>["collection",s,e],collection:(s,e,t)=>[s,e,"collection",t],collectionItem:(s,e,t,r,o)=>[s,e,t,"collection",r,o],collectionList:(s,e,t,r,o)=>[s,e,t,"collection",r,"list",o],collectionListInfinite:(s,e,t,r,o)=>[s,e,t,"collection",r,"list-infinite",o],githubReadme:(s,e)=>["github-readme",s,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:s=>["monitoring","logs",s],monitoringLogsInfinite:(s,e)=>["monitoring","logs-infinite",s,e],virtualMcpPrompts:s=>["virtual-mcp",s,"prompts"],connectionPrompts:s=>["connection",s,"prompts"],connectionResources:s=>["connection",s,"resources"],user:s=>["user",s],registryApp:(s,e)=>["registry-app",s,e]};function N(s){return!!s._zod}function C(s,e){return N(s)?ce(s,e):s.safeParse(e)}function re(s){if(!s)return;let e;if(N(s)?e=s._zod?.def?.shape:e=s.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function We(s){if(N(s)){const a=s._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}const t=s._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const r=s.value;if(r!==void 0)return r}function R(s){return s==="completed"||s==="failed"||s==="cancelled"}function G(s){const t=re(s)?.method;if(!t)throw new Error("Schema is missing a method literal");const r=We(t);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function K(s,e){const t=C(s,e);if(!t.success)throw t.error;return t.data}const Qe=6e4;class Ge{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,r)=>{const o=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!o)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(fe,async(t,r)=>{const o=async()=>{const a=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(a,r.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,f=u.id,l=this._requestResolvers.get(f);if(l)if(this._requestResolvers.delete(f),i.type==="response")l(u);else{const h=u,m=new p(h.error.code,h.error.message,h.error.data);l(m)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}continue}await this._transport?.send(i.message,{relatedRequestId:r.requestId})}}const n=await this._taskStore.getTask(a,r.sessionId);if(!n)throw new p(w.InvalidParams,`Task not found: ${a}`);if(!R(n.status))return await this._waitForTaskUpdate(a,r.signal),await o();if(R(n.status)){const i=await this._taskStore.getTaskResult(a,r.sessionId);return this._clearTaskQueue(a),{...i,_meta:{...i._meta,[q]:{taskId:a}}}}return await o()};return await o()}),this.setRequestHandler(pe,async(t,r)=>{try{const{tasks:o,nextCursor:a}=await this._taskStore.listTasks(t.params?.cursor,r.sessionId);return{tasks:o,nextCursor:a,_meta:{}}}catch(o){throw new p(w.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(me,async(t,r)=>{try{const o=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!o)throw new p(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(o.status))throw new p(w.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(t.params.taskId);const a=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!a)throw new p(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...a}}catch(o){throw o instanceof p?o:new p(w.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:a,onTimeout:o})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),p.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const r=this.transport?.onerror;this._transport.onerror=a=>{r?.(a),this._onerror(a)};const o=this._transport?.onmessage;this._transport.onmessage=(a,n)=>{o?.(a,n),A(a)||ge(a)?this._onresponse(a):x(a)?this._onrequest(a,n):_e(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const r of this._requestHandlerAbortControllers.values())r.abort();this._requestHandlerAbortControllers.clear();const t=p.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const r of e.values())r(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){const r=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,a=e.params?._meta?.[q]?.taskId;if(r===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:l,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=we(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,f={signal:n.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};a&&(h.relatedTask={taskId:a}),await this.notification(l,h)},sendRequest:async(l,h,m)=>{if(n.signal.aborted)throw new p(w.ConnectionClosed,"Request was cancelled");const _={...m,relatedRequestId:e.id};a&&!_.relatedTask&&(_.relatedTask={taskId:a});const y=_.relatedTask?.taskId??a;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,_)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:a,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>r(e,f)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...r}=e.params,o=Number(t),a=this._progressHandlers.get(o);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(o),i=this._timeoutInfo.get(o);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),n(u);return}a(r)}_onresponse(e){const t=Number(e.id),r=this._requestResolvers.get(t);if(r){if(this._requestResolvers.delete(t),A(e))r(e);else{const n=new p(e.error.code,e.error.message,e.error.data);r(n)}return}const o=this._responseHandlers.get(t);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let a=!1;if(A(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(a=!0,this._taskProgressTokens.set(i.taskId,t))}}if(a||this._progressHandlers.delete(t),A(e))o(e);else{const n=p.fromError(e.error.code,e.error.message,e.error.data);o(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,r){const{task:o}=r??{};if(!o){try{yield{type:"result",result:await this.request(e,t,r)}}catch(n){yield{type:"error",error:n instanceof p?n:new p(w.InternalError,String(n))}}return}let a;try{const n=await this.request(e,F,r);if(n.task)a=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new p(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:a},r);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},t,r)}:i.status==="failed"?yield{type:"error",error:new p(w.InternalError,`Task ${a} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new p(w.InternalError,`Task ${a} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},t,r)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(f=>setTimeout(f,u)),r?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof p?n:new p(w.InternalError,String(n))}}}request(e,t,r){const{relatedRequestId:o,resumptionToken:a,onresumptiontoken:n,task:i,relatedTask:u}=r??{};return new Promise((f,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}r?.signal?.throwIfAborted();const m=this._requestMessageId++,_={...e,jsonrpc:"2.0",id:m};r?.onprogress&&(this._progressHandlers.set(m,r.onprogress),_.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),i&&(_.params={..._.params,task:i}),u&&(_.params={..._.params,_meta:{..._.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(c)}},{relatedRequestId:o,resumptionToken:a,onresumptiontoken:n}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const g=c instanceof p?c:new p(w.RequestTimeout,String(c));l(g)};this._responseHandlers.set(m,c=>{if(!r?.signal?.aborted){if(c instanceof Error)return l(c);try{const g=C(t,c.result);g.success?f(g.data):l(g.error)}catch(g){l(g)}}}),r?.signal?.addEventListener("abort",()=>{y(r?.signal?.reason)});const T=r?.timeout??Qe,v=()=>y(p.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(m,T,r?.maxTotalTimeout,v,r?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=g=>{const k=this._responseHandlers.get(m);k?k(g):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,c),this._enqueueTaskMessage(d,{type:"request",message:_,timestamp:Date.now()}).catch(g=>{this._cleanupTimeout(m),l(g)})}else this._transport.send(_,{relatedRequestId:o,resumptionToken:a,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(m),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,r){return this.request({method:"tasks/result",params:e},t,r)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const r=t?.relatedTask?.taskId;if(r){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const r=G(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(o,a)=>{const n=K(e,o);return Promise.resolve(t(n,a))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const r=G(e);this._notificationHandlers.set(r,o=>{const a=K(e,o);return Promise.resolve(t(a))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,r){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,r,o)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const r=await this._taskMessageQueue.dequeueAll(e,t);for(const o of r)if(o.type==="request"&&x(o.message)){const a=o.message.id,n=this._requestResolvers.get(a);n?(n(new p(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let r=this._options?.defaultTaskPollInterval??1e3;try{const o=await this._taskStore?.getTask(e);o?.pollInterval&&(r=o.pollInterval)}catch{}return new Promise((o,a)=>{if(t.aborted){a(new p(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(o,r);t.addEventListener("abort",()=>{clearTimeout(n),a(new p(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const r=this._taskStore;if(!r)throw new Error("No task store configured");return{createTask:async o=>{if(!e)throw new Error("No request provided");return await r.createTask(o,e.id,{method:e.method,params:e.params},t)},getTask:async o=>{const a=await r.getTask(o,t);if(!a)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(o,a,n)=>{await r.storeTaskResult(o,a,n,t);const i=await r.getTask(o,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>r.getTaskResult(o,t),updateTaskStatus:async(o,a,n)=>{const i=await r.getTask(o,t);if(!i)throw new p(w.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(R(i.status))throw new p(w.InvalidParams,`Cannot update task "${o}" from terminal status "${i.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(o,a,n,t);const u=await r.getTask(o,t);if(u){const f=W.parse({method:"notifications/tasks/status",params:u});await this.notification(f),R(u.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>r.listTasks(o,t)}}}function J(s){return s!==null&&typeof s=="object"&&!Array.isArray(s)}function Ke(s,e){const t={...s};for(const r in e){const o=r,a=e[o];if(a===void 0)continue;const n=t[o];J(n)&&J(a)?t[o]={...n,...a}:t[o]=a}return t}var Je=Se();const Ze=ke(Je);function Be(){const s=new Ze({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(s),s}class Ye{constructor(e){this._ajv=e??Be()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return r=>t(r)?{valid:!0,data:r,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class Xe{constructor(e){this._client=e}async*callToolStream(e,t=ee,r){const o=this._client,a={...r,task:r?.task??(o.isToolTask(e.name)?{}:void 0)},n=o.requestStream({method:"tools/call",params:e},t,a),i=o.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const f=u.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const l=i(f.structuredContent);if(!l.valid){yield{type:"error",error:new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof p){yield{type:"error",error:l};return}yield{type:"error",error:new p(w.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,r){return this._client.getTaskResult({taskId:e},t,r)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,r){return this._client.requestStream(e,t,r)}}function et(s,e,t){if(!s)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!s.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function tt(s,e,t){if(!s)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!s.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!s.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(s,e){if(!(!s||e===null||typeof e!="object")){if(s.type==="object"&&s.properties&&typeof s.properties=="object"){const t=e,r=s.properties;for(const o of Object.keys(r)){const a=r[o];t[o]===void 0&&Object.prototype.hasOwnProperty.call(a,"default")&&(t[o]=a.default),t[o]!==void 0&&O(a,t[o])}}if(Array.isArray(s.anyOf))for(const t of s.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(s.oneOf))for(const t of s.oneOf)typeof t!="boolean"&&O(t,e)}}function st(s){if(!s)return{supportsFormMode:!1,supportsUrlMode:!1};const e=s.form!==void 0,t=s.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let rt=class extends Ge{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Ye,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ce,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Xe(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ke(this._capabilities,e)}setRequestHandler(e,t){const o=re(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let a;if(N(o)){const i=o;a=i._zod?.def?.value??i.value}else{const i=o;a=i._def?.value??i.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");const n=a;if(n==="elicitation/create"){const i=async(u,f)=>{const l=C(xe,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new p(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:m,supportsUrlMode:_}=st(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new p(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!_)throw new p(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,f));if(h.task){const c=C(F,y);if(!c.success){const g=c.error instanceof Error?c.error.message:String(c.error);throw new p(w.InvalidParams,`Invalid task creation result: ${g}`)}return c.data}const T=C(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid elicitation result: ${c}`)}const v=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&v.action==="accept"&&v.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,v.content)}catch{}return v};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,f)=>{const l=C(Ue,u);if(!l.success){const v=l.error instanceof Error?l.error.message:String(l.error);throw new p(w.InvalidParams,`Invalid sampling request: ${v}`)}const{params:h}=l.data,m=await Promise.resolve(t(u,f));if(h.task){const v=C(F,m);if(!v.success){const d=v.error instanceof Error?v.error.message:String(v.error);throw new p(w.InvalidParams,`Invalid task creation result: ${d}`)}return v.data}const y=h.tools||h.toolChoice?je:Ve,T=C(y,m);if(!T.success){const v=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid sampling result: ${v}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const r=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(r===void 0)throw new Error(`Server sent invalid initialize result: ${r}`);if(!Pe.includes(r.protocolVersion))throw new Error(`Server's protocol version is not supported: ${r.protocolVersion}`);this._serverCapabilities=r.capabilities,this._serverVersion=r.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(r.protocolVersion),this._instructions=r.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(r){throw this.close(),r}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){et(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&tt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},$,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Me,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},$,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ae,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},$e,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},$,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},$,t)}async callTool(e,t=ee,r){if(this.isToolTaskRequired(e.name))throw new p(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const o=await this.request({method:"tools/call",params:e},t,r),a=this.getToolOutputValidator(e.name);if(a){if(!o.structuredContent&&!o.isError)throw new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{const n=a(o.structuredContent);if(!n.valid)throw new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof p?n:new p(w.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return o}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const o=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,o)}const r=t.execution?.taskSupport;(r==="required"||r==="optional")&&this._cachedKnownTaskTools.add(t.name),r==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const r=await this.request({method:"tools/list",params:e},Le,t);return this.cacheToolMetadata(r.tools),r}_setupListChangedHandler(e,t,r,o){const a=De.safeParse(r);if(!a.success)throw new Error(`Invalid ${e} listChanged options: ${a.error.message}`);if(typeof r.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=a.data,{onChanged:u}=r,f=async()=>{if(!n){u(null,null);return}try{const h=await o();u(null,h)}catch(h){const m=h instanceof Error?h:new Error(String(h));u(m,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const m=setTimeout(f,i);this._listChangedDebounceTimers.set(e,m)}else f()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};function U(s){return s?s instanceof Headers?Object.fromEntries(s.entries()):Array.isArray(s)?Object.fromEntries(s):{...s}:{}}function ot(s=fetch,e){return e?async(t,r)=>{const o={...e,...r,headers:r?.headers?{...U(e.headers),...U(r.headers)}:e.headers};return s(t,o)}:s}class Z extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const B=10,at=13,I=32;function D(s){}function nt(s){if(typeof s=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=D,onError:t=D,onRetry:r=D,onComment:o}=s,a=[];let n=!0,i,u="",f=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),a.length===0){const k=m(d);k!==""&&a.push(k);return}if(d.indexOf(`
1
+ import{cM as ce,cN as le,cO as ue,bw as de,cP as he,aO as p,aP as w,cQ as fe,cR as pe,cS as me,cT as A,cU as ge,cV as x,cW as _e,cX as q,cY as we,cZ as F,c_ as Te,c$ as ye,d0 as ve,d1 as W,bb as ke,cD as Se,d2 as be,br as ee,bE as Ce,bK as Re,bI as Ie,d3 as Ee,d4 as qe,d5 as Pe,d6 as $,d7 as Me,d8 as Ae,bJ as $e,bF as He,bG as Oe,bH as Ne,bD as Le,d9 as De,da as xe,db as Fe,by as Ue,dc as je,dd as Ve,cy as P,cz as H,cA as Q,de as ze,bL as L,e as te,w as se}from"./index-Byh16eae.js";const V={authConfig:()=>["authConfig"],threads:s=>["threads",s],virtualMcpThreads:(s,e)=>["threads",s,"virtual-mcp",e],thread:(s,e)=>["thread",s,e],threadMessages:(s,e)=>["thread-messages",s,e],messages:s=>["messages",s],organizations:()=>["organizations"],members:s=>[s,"members"],invitations:s=>[s,"invitations"],organizationRoles:s=>[s,"organization-roles"],connections:s=>[s,"connections"],connectionsByBinding:(s,e)=>[s,"connections",`binding:${e}`],connection:(s,e)=>[s,"connection",e],isMCPAuthenticated:(s,e)=>["is-mcp-authenticated",s,e],mcpTools:(s,e)=>["mcp","tools",s,e],mcpClient:(s,e,t,r)=>["mcp","client",s,e,t,r],mcpToolsList:s=>["mcp","client",s,"tools"],mcpResourcesList:s=>["mcp","client",s,"resources"],mcpPromptsList:s=>["mcp","client",s,"prompts"],mcpReadResource:(s,e)=>["mcp","client",s,"resource",e],mcpGetPrompt:(s,e,t)=>["mcp","client",s,"prompt",e,t],mcpToolCall:(s,e,t)=>["mcp","client",s,"tool-call",e,t],organizationSettings:s=>["organization-settings",s],activeOrganization:s=>["activeOrganization",s],modelsList:s=>["models-list",s],connectionCollections:s=>[s,"collections","discovery"],toolCall:(s,e,t)=>["tool-call",s,e,t],collectionItems:(s,e)=>["collection",s,e],collection:(s,e,t)=>[s,e,"collection",t],collectionItem:(s,e,t,r,o)=>[s,e,t,"collection",r,o],collectionList:(s,e,t,r,o)=>[s,e,t,"collection",r,"list",o],collectionListInfinite:(s,e,t,r,o)=>[s,e,t,"collection",r,"list-infinite",o],githubReadme:(s,e)=>["github-readme",s,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:s=>["monitoring","logs",s],monitoringLogsInfinite:(s,e)=>["monitoring","logs-infinite",s,e],virtualMcpPrompts:s=>["virtual-mcp",s,"prompts"],connectionPrompts:s=>["connection",s,"prompts"],connectionResources:s=>["connection",s,"resources"],user:s=>["user",s],registryApp:(s,e)=>["registry-app",s,e]};function N(s){return!!s._zod}function C(s,e){return N(s)?ce(s,e):s.safeParse(e)}function re(s){if(!s)return;let e;if(N(s)?e=s._zod?.def?.shape:e=s.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function We(s){if(N(s)){const a=s._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}const t=s._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const r=s.value;if(r!==void 0)return r}function R(s){return s==="completed"||s==="failed"||s==="cancelled"}function G(s){const t=re(s)?.method;if(!t)throw new Error("Schema is missing a method literal");const r=We(t);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function K(s,e){const t=C(s,e);if(!t.success)throw t.error;return t.data}const Qe=6e4;class Ge{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,r)=>{const o=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!o)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(fe,async(t,r)=>{const o=async()=>{const a=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(a,r.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,f=u.id,l=this._requestResolvers.get(f);if(l)if(this._requestResolvers.delete(f),i.type==="response")l(u);else{const h=u,m=new p(h.error.code,h.error.message,h.error.data);l(m)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}continue}await this._transport?.send(i.message,{relatedRequestId:r.requestId})}}const n=await this._taskStore.getTask(a,r.sessionId);if(!n)throw new p(w.InvalidParams,`Task not found: ${a}`);if(!R(n.status))return await this._waitForTaskUpdate(a,r.signal),await o();if(R(n.status)){const i=await this._taskStore.getTaskResult(a,r.sessionId);return this._clearTaskQueue(a),{...i,_meta:{...i._meta,[q]:{taskId:a}}}}return await o()};return await o()}),this.setRequestHandler(pe,async(t,r)=>{try{const{tasks:o,nextCursor:a}=await this._taskStore.listTasks(t.params?.cursor,r.sessionId);return{tasks:o,nextCursor:a,_meta:{}}}catch(o){throw new p(w.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(me,async(t,r)=>{try{const o=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!o)throw new p(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(o.status))throw new p(w.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(t.params.taskId);const a=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!a)throw new p(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...a}}catch(o){throw o instanceof p?o:new p(w.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:a,onTimeout:o})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),p.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const r=this.transport?.onerror;this._transport.onerror=a=>{r?.(a),this._onerror(a)};const o=this._transport?.onmessage;this._transport.onmessage=(a,n)=>{o?.(a,n),A(a)||ge(a)?this._onresponse(a):x(a)?this._onrequest(a,n):_e(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const r of this._requestHandlerAbortControllers.values())r.abort();this._requestHandlerAbortControllers.clear();const t=p.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const r of e.values())r(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){const r=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,a=e.params?._meta?.[q]?.taskId;if(r===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:l,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=we(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,f={signal:n.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};a&&(h.relatedTask={taskId:a}),await this.notification(l,h)},sendRequest:async(l,h,m)=>{if(n.signal.aborted)throw new p(w.ConnectionClosed,"Request was cancelled");const _={...m,relatedRequestId:e.id};a&&!_.relatedTask&&(_.relatedTask={taskId:a});const y=_.relatedTask?.taskId??a;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,_)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:a,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>r(e,f)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...r}=e.params,o=Number(t),a=this._progressHandlers.get(o);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(o),i=this._timeoutInfo.get(o);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),n(u);return}a(r)}_onresponse(e){const t=Number(e.id),r=this._requestResolvers.get(t);if(r){if(this._requestResolvers.delete(t),A(e))r(e);else{const n=new p(e.error.code,e.error.message,e.error.data);r(n)}return}const o=this._responseHandlers.get(t);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let a=!1;if(A(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(a=!0,this._taskProgressTokens.set(i.taskId,t))}}if(a||this._progressHandlers.delete(t),A(e))o(e);else{const n=p.fromError(e.error.code,e.error.message,e.error.data);o(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,r){const{task:o}=r??{};if(!o){try{yield{type:"result",result:await this.request(e,t,r)}}catch(n){yield{type:"error",error:n instanceof p?n:new p(w.InternalError,String(n))}}return}let a;try{const n=await this.request(e,F,r);if(n.task)a=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new p(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:a},r);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},t,r)}:i.status==="failed"?yield{type:"error",error:new p(w.InternalError,`Task ${a} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new p(w.InternalError,`Task ${a} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},t,r)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(f=>setTimeout(f,u)),r?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof p?n:new p(w.InternalError,String(n))}}}request(e,t,r){const{relatedRequestId:o,resumptionToken:a,onresumptiontoken:n,task:i,relatedTask:u}=r??{};return new Promise((f,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}r?.signal?.throwIfAborted();const m=this._requestMessageId++,_={...e,jsonrpc:"2.0",id:m};r?.onprogress&&(this._progressHandlers.set(m,r.onprogress),_.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),i&&(_.params={..._.params,task:i}),u&&(_.params={..._.params,_meta:{..._.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(c)}},{relatedRequestId:o,resumptionToken:a,onresumptiontoken:n}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const g=c instanceof p?c:new p(w.RequestTimeout,String(c));l(g)};this._responseHandlers.set(m,c=>{if(!r?.signal?.aborted){if(c instanceof Error)return l(c);try{const g=C(t,c.result);g.success?f(g.data):l(g.error)}catch(g){l(g)}}}),r?.signal?.addEventListener("abort",()=>{y(r?.signal?.reason)});const T=r?.timeout??Qe,v=()=>y(p.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(m,T,r?.maxTotalTimeout,v,r?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=g=>{const k=this._responseHandlers.get(m);k?k(g):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,c),this._enqueueTaskMessage(d,{type:"request",message:_,timestamp:Date.now()}).catch(g=>{this._cleanupTimeout(m),l(g)})}else this._transport.send(_,{relatedRequestId:o,resumptionToken:a,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(m),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,r){return this.request({method:"tasks/result",params:e},t,r)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const r=t?.relatedTask?.taskId;if(r){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const r=G(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(o,a)=>{const n=K(e,o);return Promise.resolve(t(n,a))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const r=G(e);this._notificationHandlers.set(r,o=>{const a=K(e,o);return Promise.resolve(t(a))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,r){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,r,o)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const r=await this._taskMessageQueue.dequeueAll(e,t);for(const o of r)if(o.type==="request"&&x(o.message)){const a=o.message.id,n=this._requestResolvers.get(a);n?(n(new p(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let r=this._options?.defaultTaskPollInterval??1e3;try{const o=await this._taskStore?.getTask(e);o?.pollInterval&&(r=o.pollInterval)}catch{}return new Promise((o,a)=>{if(t.aborted){a(new p(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(o,r);t.addEventListener("abort",()=>{clearTimeout(n),a(new p(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const r=this._taskStore;if(!r)throw new Error("No task store configured");return{createTask:async o=>{if(!e)throw new Error("No request provided");return await r.createTask(o,e.id,{method:e.method,params:e.params},t)},getTask:async o=>{const a=await r.getTask(o,t);if(!a)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(o,a,n)=>{await r.storeTaskResult(o,a,n,t);const i=await r.getTask(o,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>r.getTaskResult(o,t),updateTaskStatus:async(o,a,n)=>{const i=await r.getTask(o,t);if(!i)throw new p(w.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(R(i.status))throw new p(w.InvalidParams,`Cannot update task "${o}" from terminal status "${i.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(o,a,n,t);const u=await r.getTask(o,t);if(u){const f=W.parse({method:"notifications/tasks/status",params:u});await this.notification(f),R(u.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>r.listTasks(o,t)}}}function J(s){return s!==null&&typeof s=="object"&&!Array.isArray(s)}function Ke(s,e){const t={...s};for(const r in e){const o=r,a=e[o];if(a===void 0)continue;const n=t[o];J(n)&&J(a)?t[o]={...n,...a}:t[o]=a}return t}var Je=Se();const Ze=ke(Je);function Be(){const s=new Ze({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(s),s}class Ye{constructor(e){this._ajv=e??Be()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return r=>t(r)?{valid:!0,data:r,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class Xe{constructor(e){this._client=e}async*callToolStream(e,t=ee,r){const o=this._client,a={...r,task:r?.task??(o.isToolTask(e.name)?{}:void 0)},n=o.requestStream({method:"tools/call",params:e},t,a),i=o.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const f=u.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const l=i(f.structuredContent);if(!l.valid){yield{type:"error",error:new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof p){yield{type:"error",error:l};return}yield{type:"error",error:new p(w.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,r){return this._client.getTaskResult({taskId:e},t,r)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,r){return this._client.requestStream(e,t,r)}}function et(s,e,t){if(!s)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!s.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function tt(s,e,t){if(!s)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!s.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!s.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(s,e){if(!(!s||e===null||typeof e!="object")){if(s.type==="object"&&s.properties&&typeof s.properties=="object"){const t=e,r=s.properties;for(const o of Object.keys(r)){const a=r[o];t[o]===void 0&&Object.prototype.hasOwnProperty.call(a,"default")&&(t[o]=a.default),t[o]!==void 0&&O(a,t[o])}}if(Array.isArray(s.anyOf))for(const t of s.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(s.oneOf))for(const t of s.oneOf)typeof t!="boolean"&&O(t,e)}}function st(s){if(!s)return{supportsFormMode:!1,supportsUrlMode:!1};const e=s.form!==void 0,t=s.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let rt=class extends Ge{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Ye,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ce,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Xe(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ke(this._capabilities,e)}setRequestHandler(e,t){const o=re(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let a;if(N(o)){const i=o;a=i._zod?.def?.value??i.value}else{const i=o;a=i._def?.value??i.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");const n=a;if(n==="elicitation/create"){const i=async(u,f)=>{const l=C(xe,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new p(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:m,supportsUrlMode:_}=st(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new p(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!_)throw new p(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,f));if(h.task){const c=C(F,y);if(!c.success){const g=c.error instanceof Error?c.error.message:String(c.error);throw new p(w.InvalidParams,`Invalid task creation result: ${g}`)}return c.data}const T=C(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid elicitation result: ${c}`)}const v=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&v.action==="accept"&&v.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,v.content)}catch{}return v};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,f)=>{const l=C(Ue,u);if(!l.success){const v=l.error instanceof Error?l.error.message:String(l.error);throw new p(w.InvalidParams,`Invalid sampling request: ${v}`)}const{params:h}=l.data,m=await Promise.resolve(t(u,f));if(h.task){const v=C(F,m);if(!v.success){const d=v.error instanceof Error?v.error.message:String(v.error);throw new p(w.InvalidParams,`Invalid task creation result: ${d}`)}return v.data}const y=h.tools||h.toolChoice?je:Ve,T=C(y,m);if(!T.success){const v=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid sampling result: ${v}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const r=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(r===void 0)throw new Error(`Server sent invalid initialize result: ${r}`);if(!Pe.includes(r.protocolVersion))throw new Error(`Server's protocol version is not supported: ${r.protocolVersion}`);this._serverCapabilities=r.capabilities,this._serverVersion=r.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(r.protocolVersion),this._instructions=r.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(r){throw this.close(),r}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){et(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&tt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},$,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Me,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},$,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ae,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},$e,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},$,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},$,t)}async callTool(e,t=ee,r){if(this.isToolTaskRequired(e.name))throw new p(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const o=await this.request({method:"tools/call",params:e},t,r),a=this.getToolOutputValidator(e.name);if(a){if(!o.structuredContent&&!o.isError)throw new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{const n=a(o.structuredContent);if(!n.valid)throw new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof p?n:new p(w.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return o}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const o=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,o)}const r=t.execution?.taskSupport;(r==="required"||r==="optional")&&this._cachedKnownTaskTools.add(t.name),r==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const r=await this.request({method:"tools/list",params:e},Le,t);return this.cacheToolMetadata(r.tools),r}_setupListChangedHandler(e,t,r,o){const a=De.safeParse(r);if(!a.success)throw new Error(`Invalid ${e} listChanged options: ${a.error.message}`);if(typeof r.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=a.data,{onChanged:u}=r,f=async()=>{if(!n){u(null,null);return}try{const h=await o();u(null,h)}catch(h){const m=h instanceof Error?h:new Error(String(h));u(m,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const m=setTimeout(f,i);this._listChangedDebounceTimers.set(e,m)}else f()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};function U(s){return s?s instanceof Headers?Object.fromEntries(s.entries()):Array.isArray(s)?Object.fromEntries(s):{...s}:{}}function ot(s=fetch,e){return e?async(t,r)=>{const o={...e,...r,headers:r?.headers?{...U(e.headers),...U(r.headers)}:e.headers};return s(t,o)}:s}class Z extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const B=10,at=13,I=32;function D(s){}function nt(s){if(typeof s=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=D,onError:t=D,onRetry:r=D,onComment:o}=s,a=[];let n=!0,i,u="",f=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),a.length===0){const k=m(d);k!==""&&a.push(k);return}if(d.indexOf(`
2
2
  `)===-1&&d.indexOf("\r")===-1){a.push(d);return}a.push(d);const c=a.join("");a.length=0;const g=m(c);g!==""&&a.push(g)}function m(d){let c=0;if(d.indexOf("\r")===-1){let g=d.indexOf(`
3
3
  `,c);for(;g!==-1;){if(c===g){f>0&&e({id:i,event:l,data:u}),i=void 0,u="",f=0,l=void 0,c=g+1,g=d.indexOf(`
4
4
  `,c);continue}const k=d.charCodeAt(c);if(Y(d,c,k)){const S=d.charCodeAt(c+5)===I?c+6:c+5,b=d.slice(S,g);if(f===0&&d.charCodeAt(g+1)===B){e({id:i,event:l,data:b}),i=void 0,u="",l=void 0,c=g+2,g=d.indexOf(`
@@ -1 +1 @@
1
- import{e as n,j as i,b_ as g,c,be as u,cI as m,cJ as x,b$ as b,c0 as j,cK as N,cL as h}from"./index-mk6gx7es.js";import{i as D}from"./X-7bL4i7ak.js";function C(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(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=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(D,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(h,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function w(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(u,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function T(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=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(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=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(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=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(m,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(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=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{R as D,w as a,C as b,T as c,B as d,E as e,v as f,y as g,k as h};
1
+ import{e as n,j as i,b_ as g,c,be as u,cI as m,cJ as x,b$ as b,c0 as j,cK as N,cL as h}from"./index-Byh16eae.js";import{i as D}from"./X-CaSicsGt.js";function C(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(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=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(D,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(h,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function w(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(u,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function T(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=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(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=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(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=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(m,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(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=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{R as D,w as a,C as b,T as c,B as d,E as e,v as f,y as g,k as h};
@@ -1 +1 @@
1
- import{e as B,s as U,b as $,o as Y,K as L,n as H,a as k,j as s,B as q,t as p,x as A}from"./index-mk6gx7es.js";import{u as M}from"./unwrap-tool-result-BYXdCQMg.js";import{S as V,u as W}from"./constants-CBBJ_jDF.js";import{S as X}from"./switch-B0FJgiAO.js";import{S as ii,a as G,b as P}from"./settings-section-Y_wCb-Mr.js";function si(){const i=B.c(62),{org:t}=U(),{data:K}=$.useSession(),R=Y();let z;i[0]!==t.id||i[1]!==t.slug?(z={connectionId:V,orgId:t.id,orgSlug:t.slug},i[0]=t.id,i[1]=t.slug,i[2]=z):z=i[2];const a=W(z);let r;i[3]!==t.id?(r=L.organizationDomain(t.id),i[3]=t.id,i[4]=r):r=i[4];let d;i[5]!==a?(d=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_GET",arguments:{}});return M(e)},i[5]=a,i[6]=d):d=i[6];let h;i[7]!==r||i[8]!==d?(h={queryKey:r,queryFn:d},i[7]=r,i[8]=d,i[9]=h):h=i[9];const{data:J,isPending:Z}=H(h),b=K?.user?.email??"";let x;i[10]!==b?(x=b.split("@")[1]?.toLowerCase()??"",i[10]=b,i[11]=x):x=i[11];const o=x,n=J?.domain??null,F=J?.autoJoinEnabled??!1,v=o&&o!==n;let I;i[12]!==t.id||i[13]!==R?(I=()=>R.invalidateQueries({queryKey:L.organizationDomain(t.id)}),i[12]=t.id,i[13]=R,i[14]=I):I=i[14];const l=I;let c;i[15]!==a||i[16]!==o?(c=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_SET",arguments:{domain:o,autoJoinEnabled:!1}});return M(e)},i[15]=a,i[16]=o,i[17]=c):c=i[17];let m;i[18]!==l||i[19]!==t.id||i[20]!==o?(m=()=>{p("organization_domain_claimed",{organization_id:t.id,email_domain:o}),l(),A.success("Domain claimed")},i[18]=l,i[19]=t.id,i[20]=o,i[21]=m):m=i[21];let u;i[22]!==t.id||i[23]!==o?(u=e=>{p("organization_domain_claim_failed",{organization_id:t.id,email_domain:o,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to claim domain")},i[22]=t.id,i[23]=o,i[24]=u):u=i[24];let D;i[25]!==c||i[26]!==m||i[27]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[25]=c,i[26]=m,i[27]=u,i[28]=D):D=i[28];const C=k(D);let g;i[29]!==a?(g=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_CLEAR",arguments:{}});return M(e)},i[29]=a,i[30]=g):g=i[30];let f;i[31]!==n||i[32]!==l||i[33]!==t.id?(f=()=>{p("organization_domain_cleared",{organization_id:t.id,email_domain:n}),l(),A.success("Domain removed")},i[31]=n,i[32]=l,i[33]=t.id,i[34]=f):f=i[34];let _;i[35]!==n||i[36]!==t.id?(_=e=>{p("organization_domain_clear_failed",{organization_id:t.id,email_domain:n,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to remove domain")},i[35]=n,i[36]=t.id,i[37]=_):_=i[37];let y;i[38]!==g||i[39]!==f||i[40]!==_?(y={mutationFn:g,onSuccess:f,onError:_},i[38]=g,i[39]=f,i[40]=_,i[41]=y):y=i[41];const N=k(y);let E;i[42]!==a||i[43]!==n||i[44]!==t.id?(E=async e=>{if(!n)return;p("organization_auto_join_toggled",{organization_id:t.id,enabled:e});const Q=await a.callTool({name:"ORGANIZATION_DOMAIN_UPDATE",arguments:{autoJoinEnabled:e}});return M(Q)},i[42]=a,i[43]=n,i[44]=t.id,i[45]=E):E=i[45];let S;i[46]!==l?(S=()=>{l(),A.success("Auto-join setting updated")},i[46]=l,i[47]=S):S=i[47];let j;i[48]!==t.id?(j=e=>{p("organization_auto_join_toggle_failed",{organization_id:t.id,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to update auto-join")},i[48]=t.id,i[49]=j):j=i[49];let w;i[50]!==E||i[51]!==S||i[52]!==j?(w={mutationFn:E,onSuccess:S,onError:j},i[50]=E,i[51]=S,i[52]=j,i[53]=w):w=i[53];const O=k(w);if(Z)return null;let T;return i[54]!==F||i[55]!==v||i[56]!==N||i[57]!==n||i[58]!==C||i[59]!==O||i[60]!==o?(T=s.jsx(ii,{title:"Email domain",children:n?s.jsxs(G,{children:[s.jsx(P,{title:n,description:"Claimed domain",action:s.jsx(q,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(P,{title:"Auto-join",description:`Users with @${n} emails will automatically join this organization on signup.`,action:s.jsx(X,{checked:F,onCheckedChange:e=>O.mutate(e),disabled:O.isPending})})]}):v?s.jsx(G,{children:s.jsx(P,{title:o,description:"Let new users with matching emails auto-join this org.",action:s.jsx(q,{size:"sm",onClick:()=>C.mutate(),disabled:C.isPending,children:C.isPending?"Claiming...":"Claim domain"})})}):s.jsx(G,{children:s.jsx(P,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[54]=F,i[55]=v,i[56]=N,i[57]=n,i[58]=C,i[59]=O,i[60]=o,i[61]=T):T=i[61],T}export{si as D};
1
+ import{e as B,s as U,b as $,o as Y,K as L,n as H,a as k,j as s,B as q,t as p,x as A}from"./index-Byh16eae.js";import{u as M}from"./unwrap-tool-result-BYXdCQMg.js";import{S as V,u as W}from"./constants-DoDQutb_.js";import{S as X}from"./switch-9ZAU9Wsd.js";import{S as ii,a as G,b as P}from"./settings-section-C2ru3Pcu.js";function si(){const i=B.c(62),{org:t}=U(),{data:K}=$.useSession(),R=Y();let z;i[0]!==t.id||i[1]!==t.slug?(z={connectionId:V,orgId:t.id,orgSlug:t.slug},i[0]=t.id,i[1]=t.slug,i[2]=z):z=i[2];const a=W(z);let r;i[3]!==t.id?(r=L.organizationDomain(t.id),i[3]=t.id,i[4]=r):r=i[4];let d;i[5]!==a?(d=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_GET",arguments:{}});return M(e)},i[5]=a,i[6]=d):d=i[6];let h;i[7]!==r||i[8]!==d?(h={queryKey:r,queryFn:d},i[7]=r,i[8]=d,i[9]=h):h=i[9];const{data:J,isPending:Z}=H(h),b=K?.user?.email??"";let x;i[10]!==b?(x=b.split("@")[1]?.toLowerCase()??"",i[10]=b,i[11]=x):x=i[11];const o=x,n=J?.domain??null,F=J?.autoJoinEnabled??!1,v=o&&o!==n;let I;i[12]!==t.id||i[13]!==R?(I=()=>R.invalidateQueries({queryKey:L.organizationDomain(t.id)}),i[12]=t.id,i[13]=R,i[14]=I):I=i[14];const l=I;let c;i[15]!==a||i[16]!==o?(c=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_SET",arguments:{domain:o,autoJoinEnabled:!1}});return M(e)},i[15]=a,i[16]=o,i[17]=c):c=i[17];let m;i[18]!==l||i[19]!==t.id||i[20]!==o?(m=()=>{p("organization_domain_claimed",{organization_id:t.id,email_domain:o}),l(),A.success("Domain claimed")},i[18]=l,i[19]=t.id,i[20]=o,i[21]=m):m=i[21];let u;i[22]!==t.id||i[23]!==o?(u=e=>{p("organization_domain_claim_failed",{organization_id:t.id,email_domain:o,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to claim domain")},i[22]=t.id,i[23]=o,i[24]=u):u=i[24];let D;i[25]!==c||i[26]!==m||i[27]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[25]=c,i[26]=m,i[27]=u,i[28]=D):D=i[28];const C=k(D);let g;i[29]!==a?(g=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_CLEAR",arguments:{}});return M(e)},i[29]=a,i[30]=g):g=i[30];let f;i[31]!==n||i[32]!==l||i[33]!==t.id?(f=()=>{p("organization_domain_cleared",{organization_id:t.id,email_domain:n}),l(),A.success("Domain removed")},i[31]=n,i[32]=l,i[33]=t.id,i[34]=f):f=i[34];let _;i[35]!==n||i[36]!==t.id?(_=e=>{p("organization_domain_clear_failed",{organization_id:t.id,email_domain:n,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to remove domain")},i[35]=n,i[36]=t.id,i[37]=_):_=i[37];let y;i[38]!==g||i[39]!==f||i[40]!==_?(y={mutationFn:g,onSuccess:f,onError:_},i[38]=g,i[39]=f,i[40]=_,i[41]=y):y=i[41];const N=k(y);let E;i[42]!==a||i[43]!==n||i[44]!==t.id?(E=async e=>{if(!n)return;p("organization_auto_join_toggled",{organization_id:t.id,enabled:e});const Q=await a.callTool({name:"ORGANIZATION_DOMAIN_UPDATE",arguments:{autoJoinEnabled:e}});return M(Q)},i[42]=a,i[43]=n,i[44]=t.id,i[45]=E):E=i[45];let S;i[46]!==l?(S=()=>{l(),A.success("Auto-join setting updated")},i[46]=l,i[47]=S):S=i[47];let j;i[48]!==t.id?(j=e=>{p("organization_auto_join_toggle_failed",{organization_id:t.id,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to update auto-join")},i[48]=t.id,i[49]=j):j=i[49];let w;i[50]!==E||i[51]!==S||i[52]!==j?(w={mutationFn:E,onSuccess:S,onError:j},i[50]=E,i[51]=S,i[52]=j,i[53]=w):w=i[53];const O=k(w);if(Z)return null;let T;return i[54]!==F||i[55]!==v||i[56]!==N||i[57]!==n||i[58]!==C||i[59]!==O||i[60]!==o?(T=s.jsx(ii,{title:"Email domain",children:n?s.jsxs(G,{children:[s.jsx(P,{title:n,description:"Claimed domain",action:s.jsx(q,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(P,{title:"Auto-join",description:`Users with @${n} emails will automatically join this organization on signup.`,action:s.jsx(X,{checked:F,onCheckedChange:e=>O.mutate(e),disabled:O.isPending})})]}):v?s.jsx(G,{children:s.jsx(P,{title:o,description:"Let new users with matching emails auto-join this org.",action:s.jsx(q,{size:"sm",onClick:()=>C.mutate(),disabled:C.isPending,children:C.isPending?"Claiming...":"Claim domain"})})}):s.jsx(G,{children:s.jsx(P,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[54]=F,i[55]=v,i[56]=N,i[57]=n,i[58]=C,i[59]=O,i[60]=o,i[61]=T):T=i[61],T}export{si as D};
@@ -1 +1 @@
1
- import{e as d,j as s,cH as i,c}from"./index-mk6gx7es.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{D,g as a,x as b,h as c,N as d,b as e,j as f,v as g};
1
+ import{e as d,j as s,cH as i,c}from"./index-Byh16eae.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{D,g as a,x as b,h as c,N as d,b as e,j as f,v as g};
@@ -1 +1 @@
1
- import{e as c,j as d,dg as f,dh as m,c as u,di as g,dj as x,dk as v,dl as b,dm as h,dn as w,dp as j,dq as N,dr as p,aF as z,ds as _,dt as y}from"./index-mk6gx7es.js";import{i as $}from"./ChevronDown-2A70mOdX.js";import{i as D}from"./ChevronRight-BLFgqoQD.js";import{a as M}from"./DotsVertical-BKulvLoy.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(y,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function q(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(_,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function F(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function P(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function A(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function B(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(z,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function H(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(N,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,B as d,A as e,H as f,q as g,O as h,P as i,F as j,L as k};
1
+ import{e as c,j as d,dg as f,dh as m,c as u,di as g,dj as x,dk as v,dl as b,dm as h,dn as w,dp as j,dq as N,dr as p,aF as z,ds as _,dt as y}from"./index-Byh16eae.js";import{i as $}from"./ChevronDown-ChKIyEYX.js";import{i as D}from"./ChevronRight-CfxVPCJg.js";import{a as M}from"./DotsVertical-Dpo2lfzf.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(y,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function q(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(_,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function F(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function P(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function A(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function B(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(z,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function H(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(N,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,B as d,A as e,H as f,q as g,O as h,P as i,F as j,L as k};
@@ -1 +1 @@
1
- import{e as d,g as l,bM as p,j as s,O as u}from"./index-mk6gx7es.js";import{P as c}from"./plugin-layout-DUXQsbyK.js";import"./use-connection-C7WT3gSh.js";import"./use-collections-C2mp1HBy.js";import"./constants-CBBJ_jDF.js";import"./Settings02-WDv7ORkh.js";import"./index-C3bjqsvR.js";import"./tooltip-CsjqH8MZ.js";import"./X-7bL4i7ak.js";function N(){const e=d.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:m}=l(n);let i;e[1]!==m?(i=p.find(r=>r.id===m),e[1]=m,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let a;return e[8]!==o?(a=s.jsx(o,{}),e[8]=o,e[9]=a):a=e[9],a}export{N as default};
1
+ import{e as d,g as l,bM as p,j as s,O as u}from"./index-Byh16eae.js";import{P as c}from"./plugin-layout-kiqmZ4Ty.js";import"./use-connection-kAb3_1aU.js";import"./use-collections-BYyKflom.js";import"./constants-DoDQutb_.js";import"./Settings02-BfZESxtt.js";import"./index-CO-xtUtF.js";import"./tooltip-D6qvPlF4.js";import"./X-CaSicsGt.js";function N(){const e=d.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:m}=l(n);let i;e[1]!==m?(i=p.find(r=>r.id===m),e[1]=m,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let a;return e[8]!==o?(a=s.jsx(o,{}),e[8]=o,e[9]=a):a=e[9],a}export{N as default};
@@ -1 +1 @@
1
- import{e as v,c as N,j as t}from"./index-mk6gx7es.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
1
+ import{e as v,c as N,j as t}from"./index-Byh16eae.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
@@ -1 +1 @@
1
- import{e as b,c as h,j as t,B as g}from"./index-mk6gx7es.js";function y(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
1
+ import{e as b,c as h,j as t,B as g}from"./index-Byh16eae.js";function y(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
@@ -1 +1 @@
1
- import{g as O}from"./constants-BeUl-Cs3.js";import"./index-mk6gx7es.js";import{d as T,c as x}from"./constants-CBBJ_jDF.js";function U(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function F(e,t){return U(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function q(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const H={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function L(e){return e?H[e]??e.toUpperCase():null}function B(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function J(e,t,n,a,r){const o=await x({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const Y="mcp.mesh";function D(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function G(e){const t=D(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function j(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function K(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function $(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Q(e,t,n,a){const r=e.server,o=e._meta?.[Y],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,C=r?.icons?.[0]?.src||G(r?.repository)||null,i=o?.oauth_config,R=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,P=o?.configuration_state,v=o?.configuration_scopes,w=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],A=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[A]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=L(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${$(c)})`:l&&N&&(g=` (${K(l)})`);const E=I+g;return{id:O("conn"),title:E,description:k,icon:C,app_name:j(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:R,configuration_state:P??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:w},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{G as a,B as b,J as c,Q as e,q as f,j as g,F as i};
1
+ import{g as O}from"./constants-CqYb75aZ.js";import"./index-Byh16eae.js";import{d as T,c as x}from"./constants-DoDQutb_.js";function U(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function F(e,t){return U(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function q(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const H={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function L(e){return e?H[e]??e.toUpperCase():null}function B(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function J(e,t,n,a,r){const o=await x({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const Y="mcp.mesh";function D(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function G(e){const t=D(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function j(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function K(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function $(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Q(e,t,n,a){const r=e.server,o=e._meta?.[Y],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,C=r?.icons?.[0]?.src||G(r?.repository)||null,i=o?.oauth_config,R=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,P=o?.configuration_state,v=o?.configuration_scopes,w=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],A=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[A]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=L(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${$(c)})`:l&&N&&(g=` (${K(l)})`);const E=I+g;return{id:O("conn"),title:E,description:k,icon:C,app_name:j(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:R,configuration_state:P??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:w},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{G as a,B as b,J as c,Q as e,q as f,j as g,F as i};