@decocms/mesh 2.87.0 → 2.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CMI4YiF8.js → AlertCircle-Cw9ihf9b.js} +1 -1
- package/dist/client/assets/{AlertOctagon-BGF96GWN.js → AlertOctagon-CHDm6gds.js} +1 -1
- package/dist/client/assets/{ArrowLeft-F0qy4hoF.js → ArrowLeft-Chs5GWbG.js} +1 -1
- package/dist/client/assets/{ArrowUp-Cr88yR39.js → ArrowUp-BOsWIVUL.js} +1 -1
- package/dist/client/assets/{Check-BVqX6VG5.js → Check-bBmR9GQH.js} +1 -1
- package/dist/client/assets/{CheckCircle-ByeMMv-P.js → CheckCircle-DJR7dvl_.js} +1 -1
- package/dist/client/assets/{CheckDone01-CPH_fc9F.js → CheckDone01-DyHo1ANl.js} +1 -1
- package/dist/client/assets/{ChevronDown-C753dD5M.js → ChevronDown-e8z1AHWa.js} +1 -1
- package/dist/client/assets/{ChevronRight-sGXl7Bvf.js → ChevronRight-mzsl79CI.js} +1 -1
- package/dist/client/assets/Clock-BqZfnvMs.js +1 -0
- package/dist/client/assets/{Code01-Cz0GM-Ln.js → Code01-BuvRIZNT.js} +1 -1
- package/dist/client/assets/{Copy01-Bl99tdzP.js → Copy01-BXs0w1_Z.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-CWs48tCN.js → DotsHorizontal-D05UvBC-.js} +1 -1
- package/dist/client/assets/{DotsVertical-CWQ3-YKt.js → DotsVertical-PFw1FUuL.js} +1 -1
- package/dist/client/assets/{Download01-CiBv1aKv.js → Download01-szewvS_J.js} +1 -1
- package/dist/client/assets/{Edit01-DkLw19ks.js → Edit01-DjLvyzaJ.js} +1 -1
- package/dist/client/assets/{Eye-BiLrFCnc.js → Eye-BTsTDMYp.js} +1 -1
- package/dist/client/assets/{File02-DvBeqAHS.js → File02-cZx3Nwh2.js} +1 -1
- package/dist/client/assets/{File06-qYvBtC4a.js → File06-DJ7PaUFD.js} +1 -1
- package/dist/client/assets/{FilterLines-BWCVYnM7.js → FilterLines-BtVwPogj.js} +1 -1
- package/dist/client/assets/{Grid01-BQKiQdYB.js → Grid01-nmhLSr_y.js} +1 -1
- package/dist/client/assets/{Home02-DUBJ2iBn.js → Home02-CXE0mN9_.js} +1 -1
- package/dist/client/assets/{Image01-BuH4rRqA.js → Image01-CvCm0AIo.js} +1 -1
- package/dist/client/assets/{Inbox01-D63wnQw5.js → Inbox01-DS2d-ggv.js} +1 -1
- package/dist/client/assets/{InfoCircle-DvVvj0EU.js → InfoCircle-DSAWIlto.js} +1 -1
- package/dist/client/assets/{LinkExternal01-qLFklxmU.js → LinkExternal01-kjhxmnSZ.js} +1 -1
- package/dist/client/assets/{List-DbyYoAK0.js → List-Bt7blnNW.js} +1 -1
- package/dist/client/assets/{Loading01-DislDZSB.js → Loading01-DzANV23U.js} +1 -1
- package/dist/client/assets/{Lock01-kQXkJGwl.js → Lock01-D0GsF_G5.js} +1 -1
- package/dist/client/assets/{Pin01-CWqaADuz.js → Pin01-BLxZyXIB.js} +1 -1
- package/dist/client/assets/{Play-whHXhfHd.js → Play-e2gPw7C5.js} +1 -1
- package/dist/client/assets/{Plus-B4n0HRX4.js → Plus-DVsqBc2O.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CDxZBXaR.js → RefreshCcw01-BnPnAVu5.js} +1 -1
- package/dist/client/assets/{SearchMd-BkDBIRnQ.js → SearchMd-4FuyiGD9.js} +1 -1
- package/dist/client/assets/{Settings01-CUwZ36an.js → Settings01-CKFpLFpy.js} +1 -1
- package/dist/client/assets/{Settings02-C3-5vMxP.js → Settings02-BcMSZBiS.js} +1 -1
- package/dist/client/assets/{Share07-DKYwpJPj.js → Share07-CxwZm_Fx.js} +1 -1
- package/dist/client/assets/Terminal-dAukTxLO.js +1 -0
- package/dist/client/assets/{Tool01-CFguOYlQ.js → Tool01-BWlhB1uG.js} +1 -1
- package/dist/client/assets/{Trash01-By04ijdF.js → Trash01-C--sdfEl.js} +1 -1
- package/dist/client/assets/{Upload01-fJcjR0fH.js → Upload01-CBpBX6RX.js} +1 -1
- package/dist/client/assets/{Users03-DItk6Nms.js → Users03-DCd0bNWV.js} +1 -1
- package/dist/client/assets/{X-r5buNXf-.js → X-CbFxRcRI.js} +1 -1
- package/dist/client/assets/{XClose-pySsKDwU.js → XClose-kwDKy1-G.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-BKCm87yT.js → agent-connections-preview-D4Gi0Un5.js} +1 -1
- package/dist/client/assets/agent-detail-J0eCb9Dh.js +1 -0
- package/dist/client/assets/{agents-BuaAs0iL.js → agents-Du1-pI67.js} +1 -1
- package/dist/client/assets/{alert-dialog-D0wLSh9n.js → alert-dialog-_6GYalnG.js} +1 -1
- package/dist/client/assets/{auth-catchall-CkUsUOEC.js → auth-catchall-yUFMQwKs.js} +1 -1
- package/dist/client/assets/{avatar-DZVTlnSA.js → avatar-5AcMFXtJ.js} +1 -1
- package/dist/client/assets/{badge-BfrnxbIP.js → badge-D4eulAEt.js} +1 -1
- package/dist/client/assets/{binder-B99OawxF.js → binder-BmTIjUvW.js} +1 -1
- package/dist/client/assets/{breadcrumb-2c6yAn4J.js → breadcrumb-DkJtDlCm.js} +1 -1
- package/dist/client/assets/{button-CsJ-BTyU.js → button-DEQGt3Mt.js} +1 -1
- package/dist/client/assets/{card-CzebRix7.js → card-D2BIckvB.js} +1 -1
- package/dist/client/assets/{checkbox-FhfzoNwb.js → checkbox-JkFmm-oF.js} +1 -1
- package/dist/client/assets/{circle-alert-4rPD_PO-.js → circle-alert-ChfPS6ZT.js} +1 -1
- package/dist/client/assets/{collection-detail-BrenkDdG.js → collection-detail-zx3CjDuf.js} +5 -5
- package/dist/client/assets/{collection-search-Yrefv2Yh.js → collection-search-BAHriX28.js} +1 -1
- package/dist/client/assets/{collection-tab-Dhc32y8D.js → collection-tab-C5eDvl4l.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D9zZsdiL.js → collection-table-wrapper-CffPVlju.js} +1 -1
- package/dist/client/assets/{collection-tabs-Q-Uo1s-L.js → collection-tabs-k1O5l5Tt.js} +1 -1
- package/dist/client/assets/{command-DAtVXyWP.js → command-igH3z6Dq.js} +1 -1
- package/dist/client/assets/{connect-CYIDebRt.js → connect-BxguVhSr.js} +1 -1
- package/dist/client/assets/{connection-card-D4lpnLQO.js → connection-card-Nyp0WXsm.js} +1 -1
- package/dist/client/assets/connection-detail-CR6ewFP6.js +1 -0
- package/dist/client/assets/connections-8L0t715b.js +1 -0
- package/dist/client/assets/{constants-CucT8Y-Y.js → constants-Bszkk2Rw.js} +1 -1
- package/dist/client/assets/constants-ClqDjxmj.js +1 -0
- package/dist/client/assets/{create-organization-dialog-DwKaHJep.js → create-organization-dialog-DtM6Lll9.js} +1 -1
- package/dist/client/assets/{create-project-dialog-C2-PEMvv.js → create-project-dialog-DnsCDrcn.js} +1 -1
- package/dist/client/assets/{dialog-3EB-J4B_.js → dialog-CpDI9kJ-.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Bshnl7f0.js → dropdown-menu-4rYu6wF8.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Drg1aSlq.js → dynamic-plugin-layout-BmWcd8V9.js} +1 -1
- package/dist/client/assets/{empty-state-1NB9yQ1t.js → empty-state-DmH-En3i.js} +1 -1
- package/dist/client/assets/{empty-state-Bi-BkSth.js → empty-state-DrzoS648.js} +1 -1
- package/dist/client/assets/{env-vars-editor-CbswziBn.js → env-vars-editor-C4g3zRD9.js} +1 -1
- package/dist/client/assets/{error-boundary-CaGh18_R.js → error-boundary-C7tDStz5.js} +1 -1
- package/dist/client/assets/{extract-connection-data-kKvsSLaN.js → extract-connection-data-COiR0Z5D.js} +1 -1
- package/dist/client/assets/{file-browser-BzKEwz78.js → file-browser-Ce1sqwf7.js} +2 -2
- package/dist/client/assets/{form-BlwP3Tk9.js → form-D2_xc7ex.js} +1 -1
- package/dist/client/assets/{grid-view-gsYISlPb.js → grid-view-QlX2--qg.js} +1 -1
- package/dist/client/assets/{home-DWWCnfpS.js → home-Dfe72Ojx.js} +1 -1
- package/dist/client/assets/{index-CA62CANi.js → index-0lR5vRMT.js} +1 -1
- package/dist/client/assets/{index-DW5LacML.js → index-8vKpXL36.js} +111 -96
- package/dist/client/assets/{index-BF7Y1e9M.js → index-BTkkv8YJ.js} +2 -2
- package/dist/client/assets/{index-DLNbywI1.js → index-CG_wt8-t.js} +1 -1
- package/dist/client/assets/{index-CNTzRs2a.js → index-CJcUchND.js} +1 -1
- package/dist/client/assets/{index-CgOYGmVd.js → index-CR6Erh7i.js} +1 -1
- package/dist/client/assets/index-Ce4voX8r.css +1 -0
- package/dist/client/assets/{index-DIQUoNYB.js → index-CirnkQgw.js} +1 -1
- package/dist/client/assets/{index-DwztszwS.js → index-DDumd-uN.js} +1 -1
- package/dist/client/assets/{index-DwiHvE3c.js → index-Emvu7sr8.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-AHDpBxLi.js → infiniteQueryObserver-DHT84YLi.js} +1 -1
- package/dist/client/assets/{input-Barosnhy.js → input-CA0mWas7.js} +1 -1
- package/dist/client/assets/{integration-icon-DL_7q6rJ.js → integration-icon-Cfwdxpxf.js} +1 -1
- package/dist/client/assets/{label-CsZ9MmGa.js → label-CdLiaX8k.js} +1 -1
- package/dist/client/assets/{layout-B0BvAjMd.js → layout-CfKE6VIM.js} +1 -1
- package/dist/client/assets/{localstorage-keys-amV_-5pn.js → localstorage-keys-BIGPrAKi.js} +1 -1
- package/dist/client/assets/{login-SfQqXsDc.js → login-4jSyNfIo.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BX6v5RXg.js → mcp-oauth-DHlPouJs.js} +1 -1
- package/dist/client/assets/mcp-server-card-XRir1Q0u.js +1 -0
- package/dist/client/assets/mcp-server-detail-B_5Ge6Jh.js +2 -0
- package/dist/client/assets/{members-SrNL520t.js → members-C3odz1vS.js} +1 -1
- package/dist/client/assets/{monaco-editor-HT_HkhlE.js → monaco-editor-6zkGnXCW.js} +4 -4
- package/dist/client/assets/{monitoring-YxclJtDc.js → monitoring-BGe_KL2N.js} +2 -2
- package/dist/client/assets/{oauth-callback-CgawdzC7.js → oauth-callback-C0py_uBz.js} +1 -1
- package/dist/client/assets/page-BSj9fyzn.js +1 -0
- package/dist/client/assets/page-CSJgkJtL.js +1 -0
- package/dist/client/assets/{plugin-empty-state-DmoMnSvF.js → plugin-empty-state-C-mLgC1_.js} +1 -1
- package/dist/client/assets/{plugin-header-DrwRXir0.js → plugin-header-DhRLRDLX.js} +1 -1
- package/dist/client/assets/{popover-Du0axOQk.js → popover-SUqUERtd.js} +1 -1
- package/dist/client/assets/{project-layout-CXHLC50z.js → project-layout-C0i7eGZ6.js} +1 -1
- package/dist/client/assets/{project-settings-BdUIjng2.js → project-settings-CxEvUbNx.js} +1 -1
- package/dist/client/assets/{projects-list-JxHyiVdW.js → projects-list-Cy20Y3XS.js} +1 -1
- package/dist/client/assets/{registry-utils-DHqoUP2c.js → registry-utils-CECb5GG7.js} +1 -1
- package/dist/client/assets/{resizable-DKYqWYE_.js → resizable-D-ryA_Dz.js} +1 -1
- package/dist/client/assets/{select-C2Pbxf7c.js → select-CmRIRAnt.js} +1 -1
- package/dist/client/assets/shell-layout-BLZIH3N-.js +12 -0
- package/dist/client/assets/{spinner-Bk2Kv7Is.js → spinner-CN0Z1P9W.js} +1 -1
- package/dist/client/assets/{store-invite-DoxlK9jX.js → store-invite-B_af0JeT.js} +1 -1
- package/dist/client/assets/{switch-pRBwY2MA.js → switch-CWppHfYo.js} +1 -1
- package/dist/client/assets/{table-Bgaai9wR.js → table-wjrWPdlP.js} +1 -1
- package/dist/client/assets/tasks-COSmcsVm.js +1 -0
- package/dist/client/assets/{textarea-CUDbyNiv.js → textarea-PR5eIWgT.js} +1 -1
- package/dist/client/assets/{tools-list-CjTy5P6D.js → tools-list-CpgFpsDV.js} +1 -1
- package/dist/client/assets/{topbar-portal-BJiAJ4h2.js → topbar-portal-Bn42xd4s.js} +1 -1
- package/dist/client/assets/{typewriter-title-CGvoRlOT.js → typewriter-title-hm5gyzMl.js} +1 -1
- package/dist/client/assets/{use-binding-ltfl3cPA.js → use-binding-Cu1RErmD.js} +1 -1
- package/dist/client/assets/{use-connection-_6bZJd3j.js → use-connection-6tA_D8-k.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CSiBFS-p.js → use-create-virtual-mcp-CXq19Kfz.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-CVTwRQoh.js → use-deco-chat-open-nEJZCNtN.js} +2 -2
- package/dist/client/assets/{use-install-from-registry-Box3PA1m.js → use-install-from-registry-YnLBWpQM.js} +1 -1
- package/dist/client/assets/{use-list-state-FXqJjHJh.js → use-list-state-C_fCtCmE.js} +1 -1
- package/dist/client/assets/{use-llm-CETK0xwr.js → use-llm-B3tqI25s.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DVE5aYwA.js → use-mcp-prompts-D3gk934n.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CERNk3IX.js → use-mcp-tools-CZlxkyzb.js} +1 -1
- package/dist/client/assets/{use-mobile-DgWdzZzh.js → use-mobile-DTsOXA-j.js} +1 -1
- package/dist/client/assets/{use-organization-settings-6lqaWqmf.js → use-organization-settings-BXqEHg_Q.js} +1 -1
- package/dist/client/assets/{use-project-CpFgjzox.js → use-project-hzw0geDy.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BaDN22Su.js → use-virtual-mcp-D3AA1MGF.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BeLX7smg.js +1 -0
- package/dist/client/assets/{useMutation-GLUqnj57.js → useMutation-DD2ow6ac.js} +1 -1
- package/dist/client/assets/useQuery-_U2H25qu.js +1 -0
- package/dist/client/assets/{view-mode-toggle-BiQRnCj0.js → view-mode-toggle-C-wNHGzC.js} +1 -1
- package/dist/client/assets/{workflow-B4shDfav.js → workflow-CZ24M6NN.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +178 -178
- package/dist/server/migrate.js +39 -39
- package/dist/server/server.js +160 -160
- package/package.json +1 -1
- package/dist/client/assets/Calendar-DedByLtP.js +0 -1
- package/dist/client/assets/Globe02-Dh-HvcG9.js +0 -1
- package/dist/client/assets/Terminal-rAB0v_E_.js +0 -1
- package/dist/client/assets/agent-detail-CZkw7Ahi.js +0 -1
- package/dist/client/assets/connection-detail-ClB2aBZr.js +0 -1
- package/dist/client/assets/connections-BfatqPWY.js +0 -1
- package/dist/client/assets/constants-BSCbneKJ.js +0 -1
- package/dist/client/assets/index-Cj8gXlq-.css +0 -1
- package/dist/client/assets/mcp-server-card-CFw7RlTN.js +0 -1
- package/dist/client/assets/mcp-server-detail-FV0O-BTM.js +0 -2
- package/dist/client/assets/page-BipGfR0N.js +0 -1
- package/dist/client/assets/page-CBPeBj68.js +0 -1
- package/dist/client/assets/shell-layout-DuY0czp2.js +0 -12
- package/dist/client/assets/tasks-CSRJCIUq.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DUcr56bw.js +0 -1
- package/dist/client/assets/useQuery-BS0MQvhs.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r}from"./index-BF7Y1e9M.js";const a=({size:e=24,color:t="currentColor",...o})=>r.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},r.createElement("path",{d:"M21 10H3m13-8v4M8 2v4m-.2 16h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 19.72 21 18.88 21 17.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 4 17.88 4 16.2 4H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 6.28 3 7.12 3 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 22 6.12 22 7.8 22Z"}));a.displayName="Calendar";export{a as n};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r}from"./index-BF7Y1e9M.js";const i=({size:e=24,color:t="currentColor",...o})=>r.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},r.createElement("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10m0-20C6.477 2 2 6.477 2 12s4.477 10 10 10m0-20c5.523 0 10 4.477 10 10s-4.477 10-10 10M2.5 9h19m-19 6h19"}));i.displayName="Globe02";export{i as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r}from"./index-BF7Y1e9M.js";const i=({size:e=24,color:t="currentColor",...o})=>r.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},r.createElement("path",{d:"m4 17 6-6-6-6m8 14h8"}));i.displayName="Terminal";export{i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as O,c as T,j as t,u as pe,V as Ke,s as Ye,t as Ee,m as Ze,a as Qe,O as Me,bt as Xe,k as et,h as tt,aK as st,q as lt}from"./index-BF7Y1e9M.js";import{T as be,a as ot,b as Ne,c as nt,i as it,d as rt,e as at,u as ct,C as dt,f as mt}from"./use-deco-chat-open-CVTwRQoh.js";import{E as ut}from"./empty-state-Bi-BkSth.js";import{E as xe,i as ft}from"./error-boundary-CaGh18_R.js";import{I as he,T as ae,c as ve,b as ce,a as de}from"./integration-icon-DL_7q6rJ.js";import{I as xt,R as pt,a as ht,S as gt,P as jt}from"./index-DIQUoNYB.js";import{B as Ie}from"./badge-BfrnxbIP.js";import{B as Q,c as me}from"./button-CsJ-BTyU.js";import{I as Re}from"./input-Barosnhy.js";import{S as bt}from"./switch-pRBwY2MA.js";import{T as Nt}from"./textarea-CUDbyNiv.js";import{h as vt,f as yt}from"./use-connection-_6bZJd3j.js";import{u as Ct,a as _t}from"./use-virtual-mcp-BaDN22Su.js";import{i as Be}from"./ChevronRight-sGXl7Bvf.js";import{n as St}from"./select-C2Pbxf7c.js";import{i as Oe}from"./File02-DvBeqAHS.js";import{i as Fe}from"./Loading01-DislDZSB.js";import{i as Tt}from"./Play-whHXhfHd.js";import{s as ze}from"./Plus-B4n0HRX4.js";import{i as kt}from"./Share07-DKYwpJPj.js";import{a as Ae}from"./Tool01-CFguOYlQ.js";import{B as wt,a as Et,b as Pe,d as It,e as Ot,c as At}from"./breadcrumb-2c6yAn4J.js";import{a as Dt,V as $t}from"./layout-B0BvAjMd.js";import{C as Lt}from"./collection-search-Yrefv2Yh.js";import{C as De}from"./checkbox-FhfzoNwb.js";import{e as Rt,a as Ge,D as Ue,b as zt,c as Pt}from"./dialog-3EB-J4B_.js";import{u as $e}from"./constants-CucT8Y-Y.js";import{c as Vt}from"./use-mcp-tools-CERNk3IX.js";import{c as Mt,u as Bt}from"./use-mcp-prompts-DVE5aYwA.js";import{s as He}from"./slugify-CEUa2lfQ.js";import{i as We}from"./Check-BVqX6VG5.js";import{i as Ft}from"./Code01-Cz0GM-Ln.js";import{a as Gt}from"./Copy01-Bl99tdzP.js";import{i as ye}from"./InfoCircle-DvVvj0EU.js";import{A as Ut}from"./agent-connections-preview-BKCm87yT.js";import"./use-llm-CETK0xwr.js";import"./use-binding-ltfl3cPA.js";import"./binder-B99OawxF.js";import"./useQuery-BS0MQvhs.js";import"./localstorage-keys-amV_-5pn.js";import"./useMutation-GLUqnj57.js";import"./popover-Du0axOQk.js";import"./ChevronDown-C753dD5M.js";import"./File06-qYvBtC4a.js";import"./Grid01-BQKiQdYB.js";import"./Image01-BuH4rRqA.js";import"./RefreshCcw01-CDxZBXaR.js";import"./SearchMd-BkDBIRnQ.js";import"./index-CA62CANi.js";import"./Pin01-CWqaADuz.js";import"./use-organization-settings-6lqaWqmf.js";import"./index-CNTzRs2a.js";import"./X-r5buNXf-.js";import"./infiniteQueryObserver-AHDpBxLi.js";const qe=({size:o=24,color:e="currentColor",...s})=>O.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},O.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));qe.displayName="Circle";const Je=({size:o=24,color:e="currentColor",...s})=>O.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},O.createElement("path",{d:"M9 2v3m6-3v3M9 19v3m6-3v3m4-13h3m-3 5h3M2 9h3m-3 5h3m4.8 5h4.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C19 16.72 19 15.88 19 14.2V9.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C16.72 5 15.88 5 14.2 5H9.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C5 7.28 5 8.12 5 9.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C7.28 19 8.12 19 9.8 19Z"}));Je.displayName="CpuChip02";const ge=({size:o=24,color:e="currentColor",...s})=>O.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},O.createElement("path",{d:"m9.75 20.75 1.473.818c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l1.473-.818m-9-2.5-1.427-.793c-.3-.166-.45-.25-.558-.368a1 1 0 0 1-.215-.364C3 16.573 3 16.401 3 16.06V14.5m0-5V7.942c0-.343 0-.514.05-.667a1 1 0 0 1 .215-.364c.109-.119.258-.202.558-.368L5.25 5.75m4.5-2.5 1.473-.818c.284-.158.425-.237.576-.267a1 1 0 0 1 .402 0c.15.03.292.11.576.267l1.473.818m4.5 2.5 1.427.793c.3.166.45.25.558.368a1 1 0 0 1 .215.364c.05.153.05.324.05.667V9.5m0 5v1.559c0 .342 0 .514-.05.666a.999.999 0 0 1-.215.364c-.109.119-.258.202-.558.368l-1.427.793m-9-7.5L12 12m0 0 2.25-1.25M12 12v2.5M3 7l2.25 1.25m13.5 0L21 7m-9 12.5V22"}));ge.displayName="CubeOutline";function Ce(o){return o===null?"all":o?.length??0}function Ht(o,e){const s=o[e];if(!s)return"";const a=[];return s.tools===null?a.push("all tools"):s.tools&&s.tools.length>0&&a.push(`${s.tools.length} tools`),s.resources===null?a.push("all resources"):s.resources&&s.resources.length>0&&a.push(`${s.resources.length} resources`),s.prompts===null?a.push("all prompts"):s.prompts&&s.prompts.length>0&&a.push(`${s.prompts.length} prompts`),a.join(", ")}function Wt(o,e){const s=o[e];return s?!((s.tools===void 0||s.tools!==null&&s.tools.length===0)&&(s.resources===void 0||s.resources!==null&&s.resources.length===0)&&(s.prompts===void 0||s.prompts!==null&&s.prompts.length===0)):!1}const qt={tools:null,resources:null,prompts:null};function _e(){const o=T.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(Fe,{className:"animate-spin text-muted-foreground",size:24})}),o[0]=e):e=o[0],e}function Se(o){return({error:e})=>e?.message?.includes("Method not found")||e?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:o})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ft,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:e?.message?e.message.length>200?`${e.message.slice(0,200)}...`:e.message:"An unexpected error occurred"})]})]})}function Jt(o){const e=T.c(18),{item:s,isSelected:a,onToggle:l,disabled:n}=o,m=n?"cursor-not-allowed opacity-50":"cursor-pointer",i=a?"bg-accent/25":"hover:bg-muted/50";let r;e[0]!==m||e[1]!==i?(r=me("flex items-start gap-3 p-4 rounded-lg transition-colors",m,i),e[0]=m,e[1]=i,e[2]=r):r=e[2];let d;e[3]!==s.name?(d=t.jsx("p",{className:"text-sm font-medium leading-none",children:s.name}),e[3]=s.name,e[4]=d):d=e[4];let u;e[5]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[5]=s.description,e[6]=u):u=e[6];let c;e[7]!==d||e[8]!==u?(c=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[d,u]}),e[7]=d,e[8]=u,e[9]=c):c=e[9];let p;e[10]!==n||e[11]!==a||e[12]!==l?(p=t.jsx(De,{checked:a,onCheckedChange:l,disabled:n,className:"mt-0.5"}),e[10]=n,e[11]=a,e[12]=l,e[13]=p):p=e[13];let h;return e[14]!==r||e[15]!==c||e[16]!==p?(h=t.jsxs("label",{className:r,children:[c,p]}),e[14]=r,e[15]=c,e[16]=p,e[17]=h):h=e[17],h}function Le(o){const e=T.c(32),{items:s,selections:a,onToggle:l,onToggleAll:n,emptyMessage:m,disabled:i}=o;let r,d,u,c,p;if(e[0]!==i||e[1]!==m||e[2]!==s||e[3]!==l||e[4]!==n||e[5]!==a){p=Symbol.for("react.early_return_sentinel");e:{const f=s.map(Kt);if(s.length===0){let C;e[11]!==m?(C=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:m})}),e[11]=m,e[12]=C):C=e[12],p=C;break e}u="flex flex-col h-full";const v=i?"cursor-not-allowed opacity-50":"cursor-pointer";let b;e[13]!==v?(b=me("flex items-start gap-3 p-4",v),e[13]=v,e[14]=b):b=e[14];let N;e[15]!==s.length?(N=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("span",{className:"text-sm font-medium",children:["Select All (",s.length,")"]})}),e[15]=s.length,e[16]=N):N=e[16];const g=a===null;let y;e[17]!==i||e[18]!==n||e[19]!==g?(y=t.jsx(De,{checked:g,onCheckedChange:n,disabled:i,className:"mt-0.5"}),e[17]=i,e[18]=n,e[19]=g,e[20]=y):y=e[20],e[21]!==y||e[22]!==b||e[23]!==N?(c=t.jsx("div",{className:"px-4 border-b border-border shrink-0",children:t.jsxs("label",{className:b,children:[N,y]})}),e[21]=y,e[22]=b,e[23]=N,e[24]=c):c=e[24],r="flex-1 overflow-auto px-4 py-3 space-y-1",d=s.map(C=>t.jsx(Jt,{item:C,isSelected:a===null||a?.includes(C.id),onToggle:()=>l(C.id,f),disabled:i},C.id))}e[0]=i,e[1]=m,e[2]=s,e[3]=l,e[4]=n,e[5]=a,e[6]=r,e[7]=d,e[8]=u,e[9]=c,e[10]=p}else r=e[6],d=e[7],u=e[8],c=e[9],p=e[10];if(p!==Symbol.for("react.early_return_sentinel"))return p;let h;e[25]!==r||e[26]!==d?(h=t.jsx("div",{className:r,children:d}),e[25]=r,e[26]=d,e[27]=h):h=e[27];let x;return e[28]!==u||e[29]!==c||e[30]!==h?(x=t.jsxs("div",{className:u,children:[c,h]}),e[28]=u,e[29]=c,e[30]=h,e[31]=x):x=e[31],x}function Kt(o){return o.id}function Yt(o){const e=T.c(13),{connectionId:s,selections:a,onToggle:l,onToggleAll:n,disabled:m}=o,{org:i}=pe();let r;e[0]!==s||e[1]!==i.id?(r={connectionId:s,orgId:i.id},e[0]=s,e[1]=i.id,e[2]=r):r=e[2];const d=$e(r);let u;e[3]!==d?(u={client:d},e[3]=d,e[4]=u):u=e[4];const{data:c}=Vt(u);let p;e[5]!==c.tools?(p=c.tools.map(Zt),e[5]=c.tools,e[6]=p):p=e[6];const h=p;let x;return e[7]!==m||e[8]!==h||e[9]!==l||e[10]!==n||e[11]!==a?(x=t.jsx(Le,{items:h,selections:a,onToggle:l,onToggleAll:n,emptyMessage:"No tools available",disabled:m}),e[7]=m,e[8]=h,e[9]=l,e[10]=n,e[11]=a,e[12]=x):x=e[12],x}function Zt(o){return{id:o.name,name:o.name,description:o.description}}function Qt(o){const e=T.c(13),{connectionId:s,selections:a,onToggle:l,onToggleAll:n,disabled:m}=o,{org:i}=pe();let r;e[0]!==s||e[1]!==i.id?(r={connectionId:s,orgId:i.id},e[0]=s,e[1]=i.id,e[2]=r):r=e[2];const d=$e(r);let u;e[3]!==d?(u={client:d},e[3]=d,e[4]=u):u=e[4];const{data:c}=Mt(u);let p;e[5]!==c.resources?(p=c.resources.map(Xt),e[5]=c.resources,e[6]=p):p=e[6];const h=p;let x;return e[7]!==m||e[8]!==h||e[9]!==l||e[10]!==n||e[11]!==a?(x=t.jsx(Le,{items:h,selections:a,onToggle:l,onToggleAll:n,emptyMessage:"No resources available",disabled:m}),e[7]=m,e[8]=h,e[9]=l,e[10]=n,e[11]=a,e[12]=x):x=e[12],x}function Xt(o){return{id:o.name||o.uri,name:o.name||o.uri,description:o.description}}function es(o){const e=T.c(13),{connectionId:s,selections:a,onToggle:l,onToggleAll:n,disabled:m}=o,{org:i}=pe();let r;e[0]!==s||e[1]!==i.id?(r={connectionId:s,orgId:i.id},e[0]=s,e[1]=i.id,e[2]=r):r=e[2];const d=$e(r);let u;e[3]!==d?(u={client:d},e[3]=d,e[4]=u):u=e[4];const{data:c}=Bt(u);let p;e[5]!==c.prompts?(p=c.prompts.map(ts),e[5]=c.prompts,e[6]=p):p=e[6];const h=p;let x;return e[7]!==m||e[8]!==h||e[9]!==l||e[10]!==n||e[11]!==a?(x=t.jsx(Le,{items:h,selections:a,onToggle:l,onToggleAll:n,emptyMessage:"No prompts available",disabled:m}),e[7]=m,e[8]=h,e[9]=l,e[10]=n,e[11]=a,e[12]=x):x=e[12],x}function ts(o){return{id:o.name,name:o.name,description:o.description}}function ss(o){const e=T.c(24),{connection:s,isSelected:a,hasSelections:l,summary:n,onClick:m,onToggleAll:i,disabled:r}=o,d=r?"cursor-not-allowed opacity-50":"cursor-pointer",u=a?"bg-accent":"hover:bg-muted/50";let c;e[0]!==d||e[1]!==u?(c=me("flex items-center gap-2 p-2 h-12 rounded-lg transition-colors",d,u),e[0]=d,e[1]=u,e[2]=c):c=e[2];const p=r?void 0:m;let h;e[3]!==s.icon||e[4]!==s.title?(h=t.jsx(he,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[3]=s.icon,e[4]=s.title,e[5]=h):h=e[5];let x;e[6]!==s.title?(x=t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[6]=s.title,e[7]=x):x=e[7];let f;e[8]!==l||e[9]!==n?(f=l&&n&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n}),e[8]=l,e[9]=n,e[10]=f):f=e[10];let v;e[11]!==x||e[12]!==f?(v=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[x,f]}),e[11]=x,e[12]=f,e[13]=v):v=e[13];let b;e[14]!==r||e[15]!==l||e[16]!==i?(b=t.jsx(De,{checked:l,onCheckedChange:i,onClick:ls,disabled:r,className:"shrink-0"}),e[14]=r,e[15]=l,e[16]=i,e[17]=b):b=e[17];let N;return e[18]!==c||e[19]!==p||e[20]!==h||e[21]!==v||e[22]!==b?(N=t.jsxs("div",{className:c,onClick:p,children:[h,v,b]}),e[18]=c,e[19]=p,e[20]=h,e[21]=v,e[22]=b,e[23]=N):N=e[23],N}function ls(o){return o.stopPropagation()}function os(o){const e=T.c(22),{allConnections:s,searchTerm:a,selectedId:l,hasSelections:n,getSelectionSummary:m,onConnectionClick:i,onToggleAll:r,disabled:d}=o;let u;e[0]!==s||e[1]!==a?(u=a?s.filter(x=>x.title.toLowerCase().includes(a.toLowerCase())||x.description?.toLowerCase().includes(a.toLowerCase())):s,e[0]=s,e[1]=a,e[2]=u):u=e[2];const c=u;if(c.length===0){const x=a?"No connections found":"No connections available";let f;return e[3]!==x?(f=t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground p-4",children:x}),e[3]=x,e[4]=f):f=e[4],f}let p;if(e[5]!==d||e[6]!==c||e[7]!==m||e[8]!==n||e[9]!==i||e[10]!==r||e[11]!==l){let x;e[13]!==d||e[14]!==m||e[15]!==n||e[16]!==i||e[17]!==r||e[18]!==l?(x=f=>t.jsx(ss,{connection:f,isSelected:l===f.id,hasSelections:n(f.id),summary:m(f.id),onClick:()=>i(f.id),onToggleAll:()=>r(f.id),disabled:d},f.id),e[13]=d,e[14]=m,e[15]=n,e[16]=i,e[17]=r,e[18]=l,e[19]=x):x=e[19],p=c.map(x),e[5]=d,e[6]=c,e[7]=m,e[8]=n,e[9]=i,e[10]=r,e[11]=l,e[12]=p}else p=e[12];let h;return e[20]!==p?(h=t.jsx("div",{className:"flex flex-col gap-0.5",children:p}),e[20]=p,e[21]=h):h=e[21],h}function ns(o){const e=T.c(75),{currentConnection:s,activeTab:a,selectedId:l,formData:n,toggleTool:m,toggleResource:i,togglePrompt:r,toggleAllTools:d,toggleAllResources:u,toggleAllPrompts:c,onTabChange:p}=o;let h;e[0]!==s.icon||e[1]!==s.title?(h=t.jsx(he,{icon:s.icon,name:s.title,size:"md",className:"shrink-0"}),e[0]=s.icon,e[1]=s.title,e[2]=h):h=e[2];let x;e[3]!==s.title?(x=t.jsx("h2",{className:"text-lg font-semibold truncate",children:s.title}),e[3]=s.title,e[4]=x):x=e[4];let f;e[5]!==s.description?(f=s.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s.description}),e[5]=s.description,e[6]=f):f=e[6];let v;e[7]!==x||e[8]!==f?(v=t.jsxs("div",{className:"flex-1 min-w-0",children:[x,f]}),e[7]=x,e[8]=f,e[9]=v):v=e[9];let b;e[10]!==h||e[11]!==v?(b=t.jsx("div",{className:"p-6 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[h,v]})}),e[10]=h,e[11]=v,e[12]=b):b=e[12];let N;e[13]!==p?(N=B=>p(B),e[13]=p,e[14]=N):N=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(be,{value:"tools",variant:"underline",className:"gap-2",children:[t.jsx(Ae,{size:16}),"Tools"]}),e[15]=g):g=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs(be,{value:"resources",variant:"underline",className:"gap-2",children:[t.jsx(ge,{size:16}),"Resources"]}),e[16]=y):y=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(ot,{variant:"underline",className:"shrink-0 px-6",children:[g,y,t.jsxs(be,{value:"prompts",variant:"underline",className:"gap-2",children:[t.jsx(Oe,{size:16}),"Prompts"]})]}),e[17]=C):C=e[17];let P;e[18]===Symbol.for("react.memo_cache_sentinel")?(P=Se("Tools not supported by this server"),e[18]=P):P=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(_e,{}),e[19]=S):S=e[19];let A;e[20]!==n||e[21]!==l?(A=n[l]?n[l].tools:[],e[20]=n,e[21]=l,e[22]=A):A=e[22];let _;e[23]!==l||e[24]!==m?(_=(B,Y)=>m(l,B,Y),e[23]=l,e[24]=m,e[25]=_):_=e[25];let k;e[26]!==l||e[27]!==d?(k=()=>d(l),e[26]=l,e[27]=d,e[28]=k):k=e[28];let E;e[29]!==l||e[30]!==A||e[31]!==_||e[32]!==k?(E=t.jsx(Ne,{value:"tools",className:"flex-1 overflow-hidden mt-0",children:t.jsx(xe,{fallback:P,children:t.jsx(O.Suspense,{fallback:S,children:t.jsx(Yt,{connectionId:l,selections:A,onToggle:_,onToggleAll:k})})})}),e[29]=l,e[30]=A,e[31]=_,e[32]=k,e[33]=E):E=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=Se("Resources not supported by this server"),e[34]=D):D=e[34];let R;e[35]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(_e,{}),e[35]=R):R=e[35];let w;e[36]!==n||e[37]!==l?(w=n[l]?n[l].resources:[],e[36]=n,e[37]=l,e[38]=w):w=e[38];let I;e[39]!==l||e[40]!==i?(I=(B,Y)=>i(l,B,Y),e[39]=l,e[40]=i,e[41]=I):I=e[41];let $;e[42]!==l||e[43]!==u?($=()=>u(l),e[42]=l,e[43]=u,e[44]=$):$=e[44];let z;e[45]!==l||e[46]!==w||e[47]!==I||e[48]!==$?(z=t.jsx(Ne,{value:"resources",className:"flex-1 overflow-hidden mt-0",children:t.jsx(xe,{fallback:D,children:t.jsx(O.Suspense,{fallback:R,children:t.jsx(Qt,{connectionId:l,selections:w,onToggle:I,onToggleAll:$})})})}),e[45]=l,e[46]=w,e[47]=I,e[48]=$,e[49]=z):z=e[49];let J;e[50]===Symbol.for("react.memo_cache_sentinel")?(J=Se("Prompts not supported by this server"),e[50]=J):J=e[50];let K;e[51]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(_e,{}),e[51]=K):K=e[51];let F;e[52]!==n||e[53]!==l?(F=n[l]?n[l].prompts:[],e[52]=n,e[53]=l,e[54]=F):F=e[54];let W;e[55]!==l||e[56]!==r?(W=(B,Y)=>r(l,B,Y),e[55]=l,e[56]=r,e[57]=W):W=e[57];let G;e[58]!==l||e[59]!==c?(G=()=>c(l),e[58]=l,e[59]=c,e[60]=G):G=e[60];let q;e[61]!==l||e[62]!==F||e[63]!==W||e[64]!==G?(q=t.jsx(Ne,{value:"prompts",className:"flex-1 overflow-hidden mt-0",children:t.jsx(xe,{fallback:J,children:t.jsx(O.Suspense,{fallback:K,children:t.jsx(es,{connectionId:l,selections:F,onToggle:W,onToggleAll:G})})})}),e[61]=l,e[62]=F,e[63]=W,e[64]=G,e[65]=q):q=e[65];let U;e[66]!==a||e[67]!==E||e[68]!==z||e[69]!==q||e[70]!==N?(U=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:t.jsxs(nt,{value:a,onValueChange:N,variant:"underline",className:"flex-1 flex flex-col overflow-hidden",children:[C,E,z,q]})}),e[66]=a,e[67]=E,e[68]=z,e[69]=q,e[70]=N,e[71]=U):U=e[71];let H;return e[72]!==U||e[73]!==b?(H=t.jsxs(t.Fragment,{children:[b,U]}),e[72]=U,e[73]=b,e[74]=H):H=e[74],H}function is(o){const e={};for(const s of o)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function Te(o){return Object.entries(o).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function rs(o,e){switch(e.type){case"SET_SEARCH_TERM":return{...o,searchTerm:e.payload};case"SET_SELECTED":return{...o,selectedId:e.payload};case"SET_ACTIVE_TAB":return{...o,activeTab:e.payload};case"RESET":return{searchTerm:"",selectedId:e.payload.selectedId??e.payload.firstConnectionId??null,activeTab:"tools"};case"SELECT_CONNECTION":return{...o,selectedId:e.payload,activeTab:"tools"};default:return o}}const Ve=(o,e)=>o.find(s=>s.id===e)??o[0];function as(o){const e=T.c(79),{open:s,onOpenChange:a,selectedId:l,form:n,connections:m}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const r=vt(i);let d;e[1]!==r||e[2]!==l?(d=Ve(r,l)?.id??null,e[1]=r,e[2]=l,e[3]=d):d=e[3];let u;e[4]!==d?(u={activeTab:"tools",searchTerm:"",selectedId:d},e[4]=d,e[5]=u):u=e[5];const[c,p]=O.useReducer(rs,u);let h;e[6]!==m?(h=m??[],e[6]=m,e[7]=h):h=e[7];let x;e[8]!==h?(x=is(h),e[8]=h,e[9]=x):x=e[9];const f=x;let v;e[10]!==r||e[11]!==c.selectedId?(v=Ve(r,c.selectedId),e[10]=r,e[11]=c.selectedId,e[12]=v):v=e[12];const b=v;let N;e[13]!==f?(N=j=>Wt(f,j),e[13]=f,e[14]=N):N=e[14];const g=N;let y;e[15]!==f?(y=j=>Ht(f,j),e[15]=f,e[16]=y):y=e[16];const C=y;let P;e[17]!==n||e[18]!==f?(P=(j,L,V,Z)=>{const ie=f[j]?.[L];let M;ie===null?M=Z.filter(je=>je!==V):ie?.includes(V)?M=ie.filter(je=>je!==V):(M=[...ie??[],V],M.length===Z.length&&(M=null));const re={...f};re[j]?re[j]={...re[j]}:re[j]={tools:null,resources:null,prompts:null},re[j][L]=M,n.setValue("connections",Te(re),{shouldDirty:!0,shouldTouch:!0})},e[17]=n,e[18]=f,e[19]=P):P=e[19];const S=P;let A;e[20]!==n||e[21]!==f?(A=(j,L)=>{const ie=f[j]?.[L]===null?[]:null,M={...f};M[j]?M[j]={...M[j]}:M[j]={tools:null,resources:null,prompts:null},M[j][L]=ie,n.setValue("connections",Te(M),{shouldDirty:!0,shouldTouch:!0})},e[20]=n,e[21]=f,e[22]=A):A=e[22];const _=A;let k;e[23]!==S?(k=(j,L,V)=>S(j,"tools",L,V),e[23]=S,e[24]=k):k=e[24];const E=k;let D;e[25]!==S?(D=(j,L,V)=>S(j,"resources",L,V),e[25]=S,e[26]=D):D=e[26];const R=D;let w;e[27]!==S?(w=(j,L,V)=>S(j,"prompts",L,V),e[27]=S,e[28]=w):w=e[28];const I=w;let $;e[29]!==_?($=j=>_(j,"tools"),e[29]=_,e[30]=$):$=e[30];const z=$;let J;e[31]!==_?(J=j=>_(j,"resources"),e[31]=_,e[32]=J):J=e[32];const K=J;let F;e[33]!==_?(F=j=>_(j,"prompts"),e[33]=_,e[34]=F):F=e[34];const W=F;let G;e[35]!==n||e[36]!==f?(G=j=>{const L=f[j],V=L&&L.tools===null&&L.resources===null&&L.prompts===null,Z={...f};V?delete Z[j]:Z[j]=qt,n.setValue("connections",Te(Z),{shouldDirty:!0,shouldTouch:!0})},e[35]=n,e[36]=f,e[37]=G):G=e[37];const q=G;let U;e[38]!==r||e[39]!==a||e[40]!==l?(U=j=>{j&&p({type:"RESET",payload:{selectedId:l,firstConnectionId:r[0]?.id??null}}),a(j)},e[38]=r,e[39]=a,e[40]=l,e[41]=U):U=e[41];const H=U;let B;e[42]===Symbol.for("react.memo_cache_sentinel")?(B=j=>{p({type:"SELECT_CONNECTION",payload:j})},e[42]=B):B=e[42];const Y=B;let ue;e[43]===Symbol.for("react.memo_cache_sentinel")?(ue=j=>p({type:"SET_SEARCH_TERM",payload:j}),e[43]=ue):ue=e[43];let X;e[44]!==c.searchTerm?(X=t.jsx(Lt,{value:c.searchTerm,onChange:ue,placeholder:"Search connections..."}),e[44]=c.searchTerm,e[45]=X):X=e[45];let ee;e[46]!==r||e[47]!==c.searchTerm||e[48]!==c.selectedId||e[49]!==C||e[50]!==g||e[51]!==q?(ee=t.jsx("div",{className:"flex-1 overflow-auto p-2",children:t.jsx(os,{allConnections:r,searchTerm:c.searchTerm,selectedId:c.selectedId,hasSelections:g,getSelectionSummary:C,onConnectionClick:Y,onToggleAll:q})}),e[46]=r,e[47]=c.searchTerm,e[48]=c.selectedId,e[49]=C,e[50]=g,e[51]=q,e[52]=ee):ee=e[52];let te;e[53]!==X||e[54]!==ee?(te=t.jsxs("div",{className:"w-full sm:w-72 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[X,ee]}),e[53]=X,e[54]=ee,e[55]=te):te=e[55];let se;e[56]!==b||e[57]!==c.activeTab||e[58]!==c.selectedId||e[59]!==f||e[60]!==W||e[61]!==K||e[62]!==z||e[63]!==I||e[64]!==R||e[65]!==E?(se=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:b&&c.selectedId?t.jsx(ns,{currentConnection:b,activeTab:c.activeTab,selectedId:c.selectedId,formData:f,toggleTool:E,toggleResource:R,togglePrompt:I,toggleAllTools:z,toggleAllResources:K,toggleAllPrompts:W,onTabChange:j=>p({type:"SET_ACTIVE_TAB",payload:j})},c.selectedId):t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Select a connection to view its tools, resources, and prompts"})}),e[56]=b,e[57]=c.activeTab,e[58]=c.selectedId,e[59]=f,e[60]=W,e[61]=K,e[62]=z,e[63]=I,e[64]=R,e[65]=E,e[66]=se):se=e[66];let le;e[67]!==te||e[68]!==se?(le=t.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[te,se]}),e[67]=te,e[68]=se,e[69]=le):le=e[69];let oe;e[70]!==H?(oe=t.jsx(Rt,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(Q,{variant:"outline",onClick:()=>H(!1),children:"Done"})}),e[70]=H,e[71]=oe):oe=e[71];let ne;e[72]!==le||e[73]!==oe?(ne=t.jsxs(Ge,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[le,oe]}),e[72]=le,e[73]=oe,e[74]=ne):ne=e[74];let fe;return e[75]!==H||e[76]!==s||e[77]!==ne?(fe=t.jsx(Ue,{open:s,onOpenChange:H,children:ne}),e[75]=H,e[76]=s,e[77]=ne,e[78]=fe):fe=e[78],fe}const cs=Ke.pick({title:!0,description:!0,status:!0,metadata:!0,connections:!0}).extend({title:Ye().min(1,"Name is required").max(255)});function ds(o){const e=T.c(8);let s,a;e[0]!==o?({className:s,...a}=o,e[0]=o,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=me("grid gap-3",s),e[3]=s,e[4]=l):l=e[4];let n;return e[5]!==a||e[6]!==l?(n=t.jsx(pt,{"data-slot":"radio-group",className:l,...a}),e[5]=a,e[6]=l,e[7]=n):n=e[7],n}function ke(o){const e=T.c(9);let s,a;e[0]!==o?({className:s,...a}=o,e[0]=o,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=me("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ht,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(qe,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=n):n=e[5];let m;return e[6]!==a||e[7]!==l?(m=t.jsx(xt,{"data-slot":"radio-group-item",className:l,...a,children:n}),e[6]=a,e[7]=l,e[8]=m):m=e[8],m}function ms(o){const s=new TextEncoder().encode(o),a=Array.from(s,l=>String.fromCharCode(l)).join("");return btoa(a)}function us(o){const e=T.c(10),{url:s}=o,[a,l]=O.useState(!1);let n;e[0]!==s?(n=async()=>{await navigator.clipboard.writeText(s),l(!0),Ee.success("Agent URL copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[0]=s,e[1]=n):n=e[1];const m=n;let i;e[2]!==a?(i=a?t.jsx(We,{size:20,className:"text-green-600"}):t.jsx(Gt,{size:20}),e[2]=a,e[3]=i):i=e[3];const r=a?"Copied!":"Copy URL";let d;e[4]!==r?(d=t.jsx("span",{className:"text-xs font-medium",children:r}),e[4]=r,e[5]=d):d=e[5];let u;return e[6]!==m||e[7]!==i||e[8]!==d?(u=t.jsxs(Q,{type:"button",variant:"outline",onClick:m,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[i,d]}),e[6]=m,e[7]=i,e[8]=d,e[9]=u):u=e[9],u}function fs(o){const e=T.c(7),{url:s,serverName:a}=o;let l;e[0]!==a||e[1]!==s?(l=()=>{const d=He(a),c=ms(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),p=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(d)}&config=${encodeURIComponent(c)}`;window.open(p,"_blank"),Ee.success("Opening Cursor...")},e[0]=a,e[1]=s,e[2]=l):l=e[2];const n=l;let m,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),i=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=m,e[4]=i):(m=e[3],i=e[4]);let r;return e[5]!==n?(r=t.jsxs(Q,{type:"button",variant:"outline",onClick:n,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,i]}),e[5]=n,e[6]=r):r=e[6],r}function xs(o){const e=T.c(11),{url:s,serverName:a}=o,[l,n]=O.useState(!1);let m;e[0]!==a||e[1]!==s?(m=async()=>{const p=He(a),x=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),f=`claude mcp add-json "${p}" '${x.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(f),n(!0),Ee.success("Claude Code command copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=a,e[1]=s,e[2]=m):m=e[2];const i=m;let r;e[3]!==l?(r=l?t.jsx(We,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=l,e[4]=r):r=e[4];const d=l?"Copied!":"Install on Claude";let u;e[5]!==d?(u=t.jsx("span",{className:"text-xs font-medium",children:d}),e[5]=d,e[6]=u):u=e[6];let c;return e[7]!==i||e[8]!==r||e[9]!==u?(c=t.jsxs(Q,{type:"button",variant:"outline",onClick:i,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[r,u]}),e[7]=i,e[8]=r,e[9]=u,e[10]=c):c=e[10],c}function ps(o){const e=T.c(40),{open:s,onOpenChange:a,virtualMcp:l}=o,[n,m]=O.useState("code_execution");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=z=>{(z==="passthrough"||z==="smart_tool_selection"||z==="code_execution")&&m(z)},e[0]=i):i=e[0];const r=i;let d;e[1]!==n||e[2]!==l.id?(d=new URL(`/mcp/virtual-mcp/${l.id}`,window.location.origin),d.searchParams.set("mode",n),e[1]=n,e[2]=l.id,e[3]=d):d=e[3];let u;e[4]!==l.id||e[5]!==l.title?(u=l.title||`agent-${l.id?.slice(0,8)??"default"}`,e[4]=l.id,e[5]=l.title,e[6]=u):u=e[6];const c=u;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(zt,{children:t.jsx(Pt,{children:"Share Agent"})}),e[7]=p):p=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=h):h=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(it,{className:"size-5 text-muted-foreground"})}),e[9]=x):x=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=f):f=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ae,{asChild:!0,children:t.jsx(ye,{className:"size-3.5 text-muted-foreground"})}),e[11]=v):v=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[x,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[f,t.jsx(ve,{children:t.jsxs(ce,{children:[v,t.jsx(de,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(ke,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=b):b=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(rt,{className:"size-5 text-muted-foreground"})}),e[13]=N):N=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=g):g=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ae,{asChild:!0,children:t.jsx(ye,{className:"size-3.5 text-muted-foreground"})}),e[15]=y):y=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[N,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[g,t.jsx(ve,{children:t.jsxs(ce,{children:[y,t.jsx(de,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(ke,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=C):C=e[16];let P;e[17]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Ft,{className:"size-5 text-muted-foreground"})}),e[17]=P):P=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=S):S=e[18];let A;e[19]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ae,{asChild:!0,children:t.jsx(ye,{className:"size-3.5 text-muted-foreground"})}),e[19]=A):A=e[19];let _;e[20]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[P,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[S,t.jsx(ve,{children:t.jsxs(ce,{children:[A,t.jsx(de,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(ke,{id:"mode-code",value:"code_execution"}),t.jsx(Ie,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=_):_=e[20];let k;e[21]!==n?(k=t.jsxs("div",{className:"flex flex-col gap-3",children:[h,t.jsxs(ds,{value:n,onValueChange:r,className:"flex flex-col gap-4.5",children:[b,C,_]})]}),e[21]=n,e[22]=k):k=e[22];let E;e[23]!==d.href?(E=t.jsx(us,{url:d.href}),e[23]=d.href,e[24]=E):E=e[24];let D,R;e[25]!==c||e[26]!==d.href?(D=t.jsx(fs,{url:d.href,serverName:c}),R=t.jsx(xs,{url:d.href,serverName:c}),e[25]=c,e[26]=d.href,e[27]=D,e[28]=R):(D=e[27],R=e[28]);let w;e[29]!==E||e[30]!==D||e[31]!==R?(w=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[E,D,R]})}),e[29]=E,e[30]=D,e[31]=R,e[32]=w):w=e[32];let I;e[33]!==k||e[34]!==w?(I=t.jsxs(Ge,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[p,t.jsxs("div",{className:"flex flex-col gap-6",children:[k,w]})]}),e[33]=k,e[34]=w,e[35]=I):I=e[35];let $;return e[36]!==a||e[37]!==s||e[38]!==I?($=t.jsx(Ue,{open:s,onOpenChange:a,children:I}),e[36]=a,e[37]=s,e[38]=I,e[39]=$):$=e[39],$}function hs(o,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...o,shareDialogOpen:e.payload};case"SET_CONNECTION_DIALOG_OPEN":return{...o,connectionDialogOpen:e.payload};case"SET_EDITING_CONNECTION_ID":return{...o,editingConnectionId:e.payload};case"SET_SKILLS_OPEN":return{...o,skillsOpen:e.payload};default:return o}}function we(o){const e=T.c(27),{connection_id:s,selected_tools:a,selected_resources:l,selected_prompts:n,onClick:m}=o,i=yt(s);if(!i)return null;let r;e[0]!==a?(r=Ce(a),e[0]=a,e[1]=r):r=e[1];const d=r;let u;e[2]!==l?(u=Ce(l),e[2]=l,e[3]=u):u=e[3];const c=u;let p;e[4]!==n?(p=Ce(n),e[4]=n,e[5]=p):p=e[5];const h=p;let x;e[6]!==i.icon||e[7]!==i.title?(x=t.jsx(he,{icon:i.icon,name:i.title,size:"xs"}),e[6]=i.icon,e[7]=i.title,e[8]=x):x=e[8];let f;e[9]!==i.title?(f=t.jsx("p",{className:"flex-1 text-sm font-normal text-foreground truncate",children:i.title}),e[9]=i.title,e[10]=f):f=e[10];let v;e[11]!==d?(v=d!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:d==="all"?"all":d}),t.jsx(Ae,{size:12})]}),e[11]=d,e[12]=v):v=e[12];let b;e[13]!==c?(b=c!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:c==="all"?"all":c}),t.jsx(ge,{size:12})]}),e[13]=c,e[14]=b):b=e[14];let N;e[15]!==h?(N=h!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:h==="all"?"all":h}),t.jsx(Oe,{size:12})]}),e[15]=h,e[16]=N):N=e[16];let g;e[17]!==v||e[18]!==b||e[19]!==N?(g=t.jsxs(Ie,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[v,b,N]}),e[17]=v,e[18]=b,e[19]=N,e[20]=g):g=e[20];let y;e[21]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Be,{size:16,className:"text-muted-foreground shrink-0"}),e[21]=y):y=e[21];let C;return e[22]!==m||e[23]!==x||e[24]!==f||e[25]!==g?(C=t.jsxs("div",{onClick:m,className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border hover:bg-accent/50 transition-colors cursor-pointer",children:[x,f,g,y]}),e[22]=m,e[23]=x,e[24]=f,e[25]=g,e[26]=C):C=e[26],C}we.Fallback=function(){return t.jsxs("div",{className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border",children:[t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"flex-1 h-4 rounded bg-muted animate-pulse"}),t.jsxs(Ie,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(Ae,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(ge,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(Oe,{size:12})]})]}),t.jsx(Be,{size:16,className:"text-muted-foreground shrink-0"})]})};function gs({virtualMcp:o}){const{org:e}=pe(),a=Xe().location.href,l=_t(),n=et({resolver:tt(cs),defaultValues:o}),m=n.watch("connections"),[i,r]=O.useReducer(hs,{shareDialogOpen:!1,connectionDialogOpen:!1,editingConnectionId:null,skillsOpen:!1}),[,d]=at(),{setVirtualMcpId:u}=ct();O.useEffect(()=>{d(!0),u(o.id)},[o.id]);const c=()=>{u(o.id),d(!0)},p=n.formState.isDirty,h=async()=>{const g=n.getValues(),y=await l.update.mutateAsync({id:o.id,data:g});n.reset(y)},x=()=>{n.reset(o)},f=()=>{r({type:"SET_EDITING_CONNECTION_ID",payload:null}),r({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},v=g=>{r({type:"SET_EDITING_CONNECTION_ID",payload:g}),r({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},b=l.update.isPending,N=t.jsx(wt,{children:t.jsxs(Et,{children:[t.jsx(Pe,{children:t.jsx(It,{asChild:!0,children:t.jsx(st,{to:"/$org/$project/agents",params:{org:e.slug,project:Me},children:"Agents"})})}),t.jsx(Ot,{}),t.jsx(Pe,{children:t.jsx(At,{children:o.title})})]})});return t.jsxs(Dt,{breadcrumb:N,children:[t.jsxs($t,{children:[t.jsx(gt,{onSave:h,onUndo:x,isDirty:p,isSaving:b}),t.jsxs(ce,{delayDuration:0,children:[t.jsx(ae,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsxs(Q,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:c,"aria-label":"Test Agent",children:[t.jsx(Tt,{size:14}),"Test Agent"]})})}),t.jsx(de,{side:"bottom",children:"Test this agent in chat"})]}),t.jsxs(ce,{delayDuration:0,children:[t.jsx(ae,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(Q,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:()=>r({type:"SET_SHARE_DIALOG_OPEN",payload:!0}),"aria-label":"Share",children:t.jsx(kt,{size:14})})})}),t.jsx(de,{side:"bottom",children:"Share"})]}),t.jsx(jt,{title:o.title,url:a,icon:o.icon??"cpu_chip"})]}),t.jsx("div",{className:"flex h-full w-full bg-background overflow-auto",children:t.jsxs("div",{className:"flex flex-col w-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4 p-6 shrink-0",children:[t.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[t.jsx(he,{icon:o.icon,name:n.watch("title")||"Agent",size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(Je,{})}),t.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[t.jsx(Re,{...n.register("title"),className:"h-auto py-0.5 text-lg! font-medium leading-7 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Agent Name"}),t.jsx(Re,{...n.register("description"),className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})]})]}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(bt,{checked:n.watch("status")==="active",onCheckedChange:g=>n.setValue("status",g?"active":"inactive",{shouldDirty:!0})})})]}),t.jsxs(dt,{open:i.skillsOpen,onOpenChange:g=>r({type:"SET_SKILLS_OPEN",payload:g}),className:"border-t border-border shrink-0 max-h-[400px] overflow-hidden flex flex-col",children:[m.length===0?t.jsxs("button",{type:"button",onClick:f,className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"h-7 px-2 inline-flex items-center justify-center gap-1 rounded-md text-sm text-muted-foreground",children:[t.jsx(ze,{size:14}),"Add"]})]}):t.jsx(mt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"ease-(--ease-out-expo)",style:{width:i.skillsOpen?0:"auto",marginRight:i.skillsOpen?0:4,opacity:i.skillsOpen?0:1,pointerEvents:i.skillsOpen?"none":"auto",transitionProperty:"all",transitionDuration:i.skillsOpen?"0ms":"200ms"},children:t.jsx(Ut,{connectionIds:m.map(g=>g.connection_id),maxVisibleIcons:2})}),t.jsxs("div",{role:"button",tabIndex:0,className:"h-7 inline-flex items-center justify-center rounded-md text-sm text-muted-foreground overflow-hidden transition-all duration-200 ease-(--ease-out-expo) hover:bg-accent hover:text-accent-foreground",style:{width:i.skillsOpen?"auto":28,paddingLeft:i.skillsOpen?8:0,paddingRight:i.skillsOpen?8:0,gap:i.skillsOpen?4:0},onPointerDown:g=>{g.stopPropagation()},onClick:g=>{g.stopPropagation(),g.preventDefault(),f()},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),f())},children:[t.jsx(ze,{size:14,className:"shrink-0"}),t.jsx("span",{className:"overflow-hidden whitespace-nowrap transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?"auto":0,opacity:i.skillsOpen?1:0},children:"Add"})]}),t.jsx("div",{className:"h-7 inline-flex items-center justify-center overflow-hidden transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?28:0,opacity:i.skillsOpen?1:0},children:t.jsx(St,{size:16,className:"shrink-0"})})]})]})}),t.jsx("div",{className:"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-(--ease-out-expo)",style:{gridTemplateRows:i.skillsOpen?"1fr":"0fr"},children:t.jsx("div",{className:"min-h-0 overflow-hidden",children:t.jsx("div",{className:"overflow-y-auto max-h-[300px] mask-[linear-gradient(to_bottom,black_calc(100%-40px),transparent_100%)]",children:t.jsx("div",{className:"flex flex-col gap-2 px-6 pb-4 pt-2",children:m.map(g=>t.jsx(O.Suspense,{fallback:t.jsx(we.Fallback,{}),children:t.jsx(we,{connection_id:g.connection_id,selected_tools:g.selected_tools,selected_resources:g.selected_resources,selected_prompts:g.selected_prompts,onClick:()=>v(g.connection_id)})},g.connection_id))})})})})]}),t.jsxs("div",{className:"flex flex-col flex-1 p-6 border-t border-border overflow-auto",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Instructions"}),t.jsx(lt,{name:"metadata.instructions",control:n.control,render:({field:g})=>t.jsx(Nt,{...g,value:g.value??"",placeholder:"Write instructions here...",className:"min-h-[200px] resize-none text-sm placeholder:text-muted-foreground/50 leading-relaxed border-0 rounded-none shadow-none px-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:border-0 bg-transparent"})})]})]})}),t.jsx(as,{open:i.connectionDialogOpen,onOpenChange:g=>r({type:"SET_CONNECTION_DIALOG_OPEN",payload:g}),selectedId:i.editingConnectionId,form:n,connections:m}),t.jsx(ps,{open:i.shareDialogOpen,onOpenChange:g=>r({type:"SET_SHARE_DIALOG_OPEN",payload:g}),virtualMcp:o})]})}function js(){const o=T.c(6),e=Ze();let s;o[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/$project/agents/$agentId"},o[0]=s):s=o[0];const a=Qe(s),{org:l,agentId:n}=a,m=Ct(n);if(!m){let r;return o[1]!==e||o[2]!==l?(r=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ut,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(Q,{variant:"outline",onClick:()=>e({to:"/$org/$project/agents",params:{org:l,project:Me}}),children:"Back to agents"})})}),o[1]=e,o[2]=l,o[3]=r):r=o[3],r}let i;return o[4]!==m?(i=t.jsx(gs,{virtualMcp:m}),o[4]=m,o[5]=i):i=o[5],i}function bl(){const o=T.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(xe,{children:t.jsx(O.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Fe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(js,{})})}),o[0]=e):e=o[0],e}export{bl as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as K,j as t,m as Ee,O as Se,aK as ct,u as at,bu as Ge,ag as vt,p as Nt,bt as ze,r as Y,o as lt,bb as yt,bj as _t,s as W,ah as Je,ai as Ct,a as St,f as wt,z as Tt,h as kt,k as Pt,i as It,t as Ce,K as Ye}from"./index-BF7Y1e9M.js";import{E as ye}from"./empty-state-Bi-BkSth.js";import{E as dt}from"./error-boundary-CaGh18_R.js";import{E as $t,r as At,e as mt}from"./env-vars-editor-CbswziBn.js";import{P as Ke,S as Vt}from"./index-DIQUoNYB.js";import{b as Mt,a as Dt}from"./use-binding-ltfl3cPA.js";import{u as Ot,S as Rt}from"./index-DLNbywI1.js";import{f as Xe,g as ut}from"./use-connection-_6bZJd3j.js";import{u as Et}from"./constants-CucT8Y-Y.js";import{d as Lt}from"./use-mcp-tools-CERNk3IX.js";import{b as Ut,d as Ft}from"./use-mcp-prompts-DVE5aYwA.js";import{a as Bt}from"./mcp-oauth-BX6v5RXg.js";import{b as Ze,c as zt,d as Kt,e as Xt,B as Wt,a as qt}from"./breadcrumb-2c6yAn4J.js";import{B as Fe}from"./button-CsJ-BTyU.js";import{C as Ht}from"./collection-tabs-Q-Uo1s-L.js";import{i as Re}from"./Loading01-DislDZSB.js";import{V as We,a as Qt}from"./layout-B0BvAjMd.js";import{C as Gt}from"./collection-tab-Dhc32y8D.js";import{I as qe,n as Jt}from"./integration-icon-DL_7q6rJ.js";import{B as Be}from"./badge-BfrnxbIP.js";import{D as Yt,a as Zt,b as es,c as et}from"./dropdown-menu-Bshnl7f0.js";import{F as G,a as ts,b as J,d as q,f as Z,c as te,e as ss}from"./form-BlwP3Tk9.js";import{I as ee}from"./input-Barosnhy.js";import{S as tt,a as st,b as nt,c as ot,d as Q}from"./select-C2Pbxf7c.js";import{i as pt}from"./CheckCircle-ByeMMv-P.js";import{t as ns}from"./ChevronDown-C753dD5M.js";import{s as Oe}from"./Globe02-Dh-HvcG9.js";import{s as os}from"./RefreshCcw01-CDxZBXaR.js";import{i as rs}from"./Terminal-rAB0v_E_.js";import{s as is}from"./Trash01-By04ijdF.js";import{t as He}from"./Users03-DItk6Nms.js";import{s as cs}from"./XClose-pySsKDwU.js";import{U as as}from"./use-list-state-FXqJjHJh.js";import{b as ls,a as ds}from"./use-virtual-mcp-BaDN22Su.js";import{i as ms}from"./ChevronRight-sGXl7Bvf.js";import{s as us}from"./Plus-B4n0HRX4.js";import{f as ps}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as ft,C as xt}from"./collection-table-wrapper-D9zZsdiL.js";import{C as ht}from"./collection-search-Yrefv2Yh.js";import{C as gt}from"./card-CzebRix7.js";import{R as fs,T as xs}from"./tools-list-CjTy5P6D.js";import"./Pin01-CWqaADuz.js";import"./use-organization-settings-6lqaWqmf.js";import"./useMutation-GLUqnj57.js";import"./binder-B99OawxF.js";import"./File06-qYvBtC4a.js";import"./index-CgOYGmVd.js";import"./constants-BSCbneKJ.js";import"./registry-utils-DHqoUP2c.js";import"./extract-connection-data-kKvsSLaN.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-Box3PA1m.js";import"./index-DwztszwS.js";import"./circle-alert-4rPD_PO-.js";import"./index-DW5LacML.js";import"./use-deco-chat-open-CVTwRQoh.js";import"./use-llm-CETK0xwr.js";import"./useQuery-BS0MQvhs.js";import"./localstorage-keys-amV_-5pn.js";import"./popover-Du0axOQk.js";import"./Grid01-BQKiQdYB.js";import"./Image01-BuH4rRqA.js";import"./SearchMd-BkDBIRnQ.js";import"./Code01-Cz0GM-Ln.js";import"./infiniteQueryObserver-AHDpBxLi.js";import"./spinner-Bk2Kv7Is.js";import"./dialog-3EB-J4B_.js";import"./X-r5buNXf-.js";import"./ArrowUp-Cr88yR39.js";import"./Edit01-DkLw19ks.js";import"./AlertCircle-CMI4YiF8.js";import"./ArrowLeft-F0qy4hoF.js";import"./Check-BVqX6VG5.js";import"./use-create-virtual-mcp-CSiBFS-p.js";import"./usage-B8eRkRZY.js";import"./Copy01-Bl99tdzP.js";import"./monaco-editor-HT_HkhlE.js";import"./index-CNTzRs2a.js";import"./DotsVertical-CWQ3-YKt.js";import"./Eye-BiLrFCnc.js";import"./empty-state-1NB9yQ1t.js";import"./Inbox01-D63wnQw5.js";import"./alert-dialog-D0wLSh9n.js";import"./index-CA62CANi.js";import"./label-CsZ9MmGa.js";import"./avatar-DZVTlnSA.js";import"./use-mobile-DgWdzZzh.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./List-DbyYoAK0.js";import"./view-mode-toggle-BiQRnCj0.js";import"./table-Bgaai9wR.js";function hs(s){const e=K.c(13),{virtualMcp:n,org:o}=s;let r;e[0]!==o||e[1]!==n.id?(r={org:o,project:Se,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=r):r=e[2];let c;e[3]!==n.icon||e[4]!==n.title?(c=n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"w-5 h-5 rounded-md object-cover shrink-0"}):t.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:t.jsx(He,{size:16,className:"text-primary"})}),e[3]=n.icon,e[4]=n.title,e[5]=c):c=e[5];let a;e[6]!==n.title?(a=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[6]=n.title,e[7]=a):a=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ms,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[8]=f):f=e[8];let u;return e[9]!==r||e[10]!==c||e[11]!==a?(u=t.jsxs(ct,{to:"/$org/$project/agents/$agentId",params:r,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,a,f]}),e[9]=r,e[10]=c,e[11]=a,e[12]=u):u=e[12],u}function rt(s){const e=K.c(20),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a,hasExistingVirtualMcps:f}=s,u=Ee(),p=ds();let x;e[0]!==p.create||e[1]!==r||e[2]!==c||e[3]!==n||e[4]!==o||e[5]!==u||e[6]!==a?(x=async()=>{const d=await p.create.mutateAsync({title:`${o} Agent`,description:r??null,icon:c??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});u({to:"/$org/$project/agents/$agentId",params:{org:a,project:Se,agentId:d.id}})},e[0]=p.create,e[1]=r,e[2]=c,e[3]=n,e[4]=o,e[5]=u,e[6]=a,e[7]=x):x=e[7];const m=x;if(f){let d;e[8]!==p.create.isPending?(d=p.create.isPending?t.jsx(Re,{size:16,className:"animate-spin"}):t.jsx(us,{size:16}),e[8]=p.create.isPending,e[9]=d):d=e[9];let l;return e[10]!==p.create.isPending||e[11]!==m||e[12]!==d?(l=t.jsx(Fe,{variant:"ghost",className:"size-6 p-0",onClick:m,disabled:p.create.isPending,children:d}),e[10]=p.create.isPending,e[11]=m,e[12]=d,e[13]=l):l=e[13],l}let i;e[14]!==p.create.isPending?(i=p.create.isPending?t.jsx(Re,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=p.create.isPending,e[15]=i):i=e[15];let b;return e[16]!==p.create.isPending||e[17]!==m||e[18]!==i?(b=t.jsxs(Fe,{variant:"outline",size:"sm",onClick:m,disabled:p.create.isPending,children:[i,"Create an agent"]}),e[16]=p.create.isPending,e[17]=m,e[18]=i,e[19]=b):b=e[19],b}function gs(s){const e=K.c(26),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a}=s;let f;e[0]!==n?(f={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=f):f=e[1];const u=ls(f);if(!(u.length>0)){let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=l):l=e[2];let j;return e[3]!==r||e[4]!==c||e[5]!==n||e[6]!==o||e[7]!==a?(j=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[l,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a,hasExistingVirtualMcps:!1})]}),e[3]=r,e[4]=c,e[5]=n,e[6]=o,e[7]=a,e[8]=j):j=e[8],j}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let m;e[10]!==r||e[11]!==c||e[12]!==n||e[13]!==o||e[14]!==a?(m=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a,hasExistingVirtualMcps:!0})]})}),e[10]=r,e[11]=c,e[12]=n,e[13]=o,e[14]=a,e[15]=m):m=e[15];let i;if(e[16]!==a||e[17]!==u){let l;e[19]!==a?(l=j=>t.jsx(hs,{virtualMcp:j,org:a},j.id),e[19]=a,e[20]=l):l=e[20],i=u.map(l),e[16]=a,e[17]=u,e[18]=i}else i=e[18];let b;e[21]!==i?(b=t.jsx("div",{className:"flex flex-col gap-2",children:i}),e[21]=i,e[22]=b):b=e[22];let d;return e[23]!==m||e[24]!==b?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[m,b]}),e[23]=m,e[24]=b,e[25]=d):d=e[25],d}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:r}){const c=Ge({control:s.control,name:"ui_type"}),a=Ge({control:s.control,name:"connection_url"}),{stdioEnabled:f}=vt(),u=(()=>{if(typeof a!="string"||!a)return!1;try{const i=new URL(a);return i.hostname==="api.githubcopilot.com"&&i.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),p=f||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",m=x?Nt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(He,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),m&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:m})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),c!=="NPX"&&c!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsxs(st,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(Oe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(nt,{})]})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:"HTTP"}),t.jsx(Q,{value:"SSE",children:"SSE"}),t.jsx(Q,{value:"Websocket",children:"Websocket"}),p&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:"NPX Package"}),t.jsx(Q,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:b})=>t.jsx(J,{className:"flex-1 min-w-0",children:t.jsx(q,{children:t.jsx(ee,{placeholder:"https://example.com/mcp",...b,value:b.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsx(st,{className:"h-10",children:t.jsx(nt,{})})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"Websocket"]})}),p&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Jt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(Q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(rs,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Z,{})]})}),c==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"@perplexity-ai/mcp-server",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),c==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"node, bun, python...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"arg1 arg2 --flag value",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"/path/to/project (optional)",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})})]}),(c==="NPX"||c==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(q,{children:t.jsx($t,{value:i.value??[],onChange:i.onChange})}),t.jsx(Z,{})]})}),c!=="NPX"&&c!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:u?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Yt,{children:[t.jsx(Zt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Be,{variant:"success",className:"gap-1.5",children:[t.jsx(pt,{size:12}),"Authenticated via OAuth",t.jsx(ns,{size:12})]})})}),t.jsxs(es,{align:"start",children:[t.jsxs(et,{onClick:o,children:[t.jsx(os,{size:16}),"Re-authenticate"]}),t.jsxs(et,{variant:"destructive",onClick:r,children:[t.jsx(is,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&i.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>i.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(cs,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(ee,{type:"password",placeholder:u?"Paste your GitHub PAT":"Enter access token...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),u&&t.jsxs(ss,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Z,{})]})})]})}function bs(s){const e=K.c(43),{form:n,connection:o,isMCPAuthenticated:r,hasOAuthToken:c,onReauthenticate:a,onRemoveOAuth:f}=s,{org:u}=at();let p;e[0]!==o.icon||e[1]!==o.title?(p=t.jsx(qe,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=p):p=e[2];let x;e[3]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(G,{control:n.control,name:"title",render:Ns}),t.jsx(G,{control:n.control,name:"description",render:vs})]}),e[3]=n.control,e[4]=x):x=e[4];let m;e[5]!==p||e[6]!==x?(m=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[p,x]}),e[5]=p,e[6]=x,e[7]=m):m=e[7];let i;e[8]!==o||e[9]!==n||e[10]!==c||e[11]!==a||e[12]!==f?(i=t.jsx(js,{form:n,connection:o,hasOAuthToken:c,onReauthenticate:a,onRemoveOAuth:f}),e[8]=o,e[9]=n,e[10]=c,e[11]=a,e[12]=f,e[13]=i):i=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=b):b=e[14];let d;e[15]!==r?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[b,r?t.jsxs(Be,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(pt,{size:12}),"Connected"]}):t.jsx(Be,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=r,e[16]=d):d=e[16];let l;e[17]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=l):l=e[17];let j;e[18]!==o.created_by?(j=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[l,t.jsx(as,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=j):j=e[19];let T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=T):T=e[20];let v;e[21]!==o.updated_at?(v=o.updated_at?ps(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=v):v=e[22];let y;e[23]!==v?(y=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[T,t.jsx("span",{className:"text-sm text-foreground",children:v})]}),e[23]=v,e[24]=y):y=e[24];let _;e[25]!==y||e[26]!==d||e[27]!==j?(_=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,j,y]}),e[25]=y,e[26]=d,e[27]=j,e[28]=_):_=e[28];let N;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==u.slug?(N=t.jsx(gs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:u.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=u.slug,e[34]=N):N=e[34];let h;e[35]!==_||e[36]!==N||e[37]!==m||e[38]!==i?(h=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[m,i,_,N]}),e[35]=_,e[36]=N,e[37]=m,e[38]=i,e[39]=h):h=e[39];let k;return e[40]!==n||e[41]!==h?(k=t.jsx(ts,{...n,children:h}),e[40]=n,e[41]=h,e[42]=k):k=e[42],k}function vs(s){const{field:e}=s;return t.jsxs(J,{className:"w-full space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Z,{})]})}function Ns(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1 space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(Z,{})]})}function ys(s){const e=K.c(42),{prompts:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:a,onPromptClick:f,showToolbar:u,emptyMessage:p}=s,x=u===void 0?!0:u,m=p===void 0?"This connection doesn't have any prompts yet.":p,i=Ee(),d=ze().location.href,[l,j]=Y.useState(""),[T,v]=Y.useState("table"),[y,_]=Y.useState("name"),[N,h]=Y.useState("asc");let k;e[0]!==N||e[1]!==y?(k=S=>{y===S?(h(Ts),N==="desc"&&_(void 0)):(_(S),h("asc"))},e[0]=N,e[1]=y,e[2]=k):k=e[2];const B=k;let $;e[3]!==o||e[4]!==i||e[5]!==f||e[6]!==r?($=S=>{f?f(S):o&&r&&i({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:Se,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(S.name)}})},e[3]=o,e[4]=i,e[5]=f,e[6]=r,e[7]=$):$=e[7];const M=$;let A;if(e[8]!==n||e[9]!==l||e[10]!==N||e[11]!==y){const S=!n||n.length===0?[]:l.trim()?(()=>{const H=l.toLowerCase();return n.filter(X=>X.name.toLowerCase().includes(H)||X.description&&X.description.toLowerCase().includes(H))})():n;A=!y||!N?S:[...S].sort((H,X)=>{const se=H[y]||"",ne=X[y]||"",oe=String(se).localeCompare(String(ne));return N==="asc"?oe:-oe}),e[8]=n,e[9]=l,e[10]=N,e[11]=y,e[12]=A}else A=e[12];const I=A;let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E=[{id:"name",header:"Name",render:ws,sortable:!0},{id:"description",header:"Description",render:Ss,cellClassName:"flex-1",sortable:!0}],e[13]=E):E=e[13];const L=E;let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=L.filter(Cs).map(_s),e[14]=C):C=e[14];const z=C;let P;e[15]!==a||e[16]!==c||e[17]!==B||e[18]!==x||e[19]!==N||e[20]!==y||e[21]!==d||e[22]!==T?(P=x&&t.jsxs(We,{children:[t.jsx(xt,{viewMode:T,onViewModeChange:v,sortKey:y,sortDirection:N,onSort:B,sortOptions:z}),t.jsx(Ke,{title:c?`${c}: Prompts`:"Prompts",url:d,icon:a??"description"})]}),e[15]=a,e[16]=c,e[17]=B,e[18]=x,e[19]=N,e[20]=y,e[21]=d,e[22]=T,e[23]=P):P=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=S=>{S.key==="Escape"&&(j(""),S.target.blur())},e[24]=D):D=e[24];let V;e[25]!==l?(V=t.jsx(ht,{value:l,onChange:j,placeholder:"Search prompts...",onKeyDown:D}),e[25]=l,e[26]=V):V=e[26];let g;e[27]!==m||e[28]!==M||e[29]!==B||e[30]!==l||e[31]!==N||e[32]!==y||e[33]!==I||e[34]!==T?(g=T==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?t.jsx(ye,{image:null,title:l?"No prompts found":"No prompts available",description:l?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:I.map(S=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>M(S),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(qe,{icon:null,name:S.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:S.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:S.description||"No description"})]})]})},S.name))})}):t.jsx(ft,{columns:L,data:I,isLoading:!1,sortKey:y,sortDirection:N,onSort:B,onRowClick:S=>M(S),emptyState:t.jsx(ye,{image:null,title:l?"No prompts found":"No prompts available",description:l?"Try adjusting your search terms":m})}),e[27]=m,e[28]=M,e[29]=B,e[30]=l,e[31]=N,e[32]=y,e[33]=I,e[34]=T,e[35]=g):g=e[35];let F;e[36]!==V||e[37]!==g?(F=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[V,g]}),e[36]=V,e[37]=g,e[38]=F):F=e[38];let O;return e[39]!==F||e[40]!==P?(O=t.jsxs(t.Fragment,{children:[P,F]}),e[39]=F,e[40]=P,e[41]=O):O=e[41],O}function _s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Cs(s){return s.sortable}function Ss(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function ws(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function Ts(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function ks(s){const e=K.c(6),{prompts:n,connectionId:o,org:r}=s,c=Xe(o),a=c?.title,f=c?.icon;let u;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==a||e[4]!==f?(u=t.jsx(ys,{prompts:n,connectionId:o,org:r,connectionTitle:a,connectionIcon:f}),e[0]=o,e[1]=r,e[2]=n,e[3]=a,e[4]=f,e[5]=u):u=e[5],u}function Ps(s){const e=K.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(fs,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Is(s){const e=K.c(39),{resources:n,connectionTitle:o,connectionIcon:r,onResourceClick:c,showToolbar:a,emptyMessage:f}=s,u=a===void 0?!0:a,p=f===void 0?"This connection doesn't have any resources yet.":f,m=ze().location.href,[i,b]=Y.useState(""),[d,l]=Y.useState("table"),[j,T]=Y.useState("name"),[v,y]=Y.useState("asc");let _;e[0]!==v||e[1]!==j?(_=g=>{j===g?(y(Rs),v==="desc"&&T(void 0)):(T(g),y("asc"))},e[0]=v,e[1]=j,e[2]=_):_=e[2];const N=_;let h;e[3]!==c?(h=g=>{c&&c(g)},e[3]=c,e[4]=h):h=e[4];const k=h;let B;if(e[5]!==n||e[6]!==i||e[7]!==v||e[8]!==j){const g=!n||n.length===0?[]:i.trim()?(()=>{const F=i.toLowerCase();return n.filter(O=>O.uri.toLowerCase().includes(F)||O.name&&O.name.toLowerCase().includes(F)||O.description&&O.description.toLowerCase().includes(F))})():n;B=!j||!v?g:[...g].sort((F,O)=>{const S=F[j]||"",H=O[j]||"",X=String(S).localeCompare(String(H));return v==="asc"?X:-X}),e[5]=n,e[6]=i,e[7]=v,e[8]=j,e[9]=B}else B=e[9];const $=B;let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=[{id:"name",header:"Name",render:Os,sortable:!0},{id:"uri",header:"URI",render:Ds,sortable:!0},{id:"description",header:"Description",render:Ms,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Vs,sortable:!0}],e[10]=M):M=e[10];const A=M;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=A.filter(As).map($s),e[11]=I):I=e[11];const E=I;let L;e[12]!==r||e[13]!==o||e[14]!==N||e[15]!==u||e[16]!==v||e[17]!==j||e[18]!==m||e[19]!==d?(L=u&&t.jsxs(We,{children:[t.jsx(xt,{viewMode:d,onViewModeChange:l,sortKey:j,sortDirection:v,onSort:N,sortOptions:E}),t.jsx(Ke,{title:o?`${o}: Resources`:"Resources",url:m,icon:r??"folder"})]}),e[12]=r,e[13]=o,e[14]=N,e[15]=u,e[16]=v,e[17]=j,e[18]=m,e[19]=d,e[20]=L):L=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=g=>{g.key==="Escape"&&(b(""),g.target.blur())},e[21]=C):C=e[21];let z;e[22]!==i?(z=t.jsx(ht,{value:i,onChange:b,placeholder:"Search resources...",onKeyDown:C}),e[22]=i,e[23]=z):z=e[23];let P;e[24]!==p||e[25]!==k||e[26]!==N||e[27]!==i||e[28]!==v||e[29]!==j||e[30]!==$||e[31]!==d?(P=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:$.length===0?t.jsx(ye,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":p}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:$.map(g=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>k(g),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(qe,{icon:null,name:g.name||g.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name||g.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:g.uri}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:g.description})]})]})},g.uri))})}):t.jsx(ft,{columns:A,data:$,isLoading:!1,sortKey:j,sortDirection:v,onSort:N,onRowClick:g=>k(g),emptyState:t.jsx(ye,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":p})}),e[24]=p,e[25]=k,e[26]=N,e[27]=i,e[28]=v,e[29]=j,e[30]=$,e[31]=d,e[32]=P):P=e[32];let D;e[33]!==z||e[34]!==P?(D=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[z,P]}),e[33]=z,e[34]=P,e[35]=D):D=e[35];let V;return e[36]!==D||e[37]!==L?(V=t.jsxs(t.Fragment,{children:[L,D]}),e[36]=D,e[37]=L,e[38]=V):V=e[38],V}function $s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function As(s){return s.sortable}function Vs(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ds(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Os(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Rs(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Es(s){const e=K.c(6),{resources:n,connectionId:o,org:r}=s,c=Xe(o),a=c?.title,f=c?.icon;let u;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==a||e[4]!==f?(u=t.jsx(Is,{resources:n,connectionId:o,org:r,connectionTitle:a,connectionIcon:f}),e[0]=o,e[1]=r,e[2]=n,e[3]=a,e[4]=f,e[5]=u):u=e[5],u}const Ls=lt({key:W().min(1,"Key is required"),value:W()}),Us=lt({title:W().min(1,"Name is required"),description:W().nullable().optional(),ui_type:Ct(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:W().optional(),connection_token:W().nullable().optional(),npx_package:W().optional(),stdio_command:W().optional(),stdio_args:W().optional(),stdio_cwd:W().optional(),env_vars:Je(Ls).optional(),configuration_scopes:Je(W()).nullable().optional(),configuration_state:yt(W(),_t()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Fs(s){const e=K.c(5),{tools:n,connectionId:o,org:r,isLoading:c}=s;let a;return e[0]!==o||e[1]!==c||e[2]!==r||e[3]!==n?(a=t.jsx(xs,{tools:n,connectionId:o,org:r,isLoading:c}),e[0]=o,e[1]=c,e[2]=r,e[3]=n,e[4]=a):a=e[4],a}function Bs(s){return s.command==="npx"}function zs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ks(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Xs(s,e){const n={command:"npx",args:["-y",s]},o=mt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const r={command:s};e.trim()&&(r.args=e.trim().split(/\s+/)),n?.trim()&&(r.cwd=n.trim());const c=mt(o);return Object.keys(c).length>0&&(r.envVars=c),r}function it(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&It(s.connection_headers)){const o=s.connection_headers,r=At(o.envVars);if(Bs(o)){const a=zs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const c=Ks(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xs(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ws(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,connection_type:e,connection_url:n,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Hs(s){const e=K.c(117),{connection:n,connectionId:o,org:r,requestedTabId:c,collections:a,onUpdate:f,isUpdating:u,prompts:p,resources:x,tools:m,isLoadingTools:i}=s;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/$org/$project/mcps/$connectionId"},e[0]=b):b=e[0];const d=Ee(b),l=Tt(),T=ze().location.href,v=ut();let y;e[1]!==o?(y={connectionId:o},e[1]=o,e[2]=y):y=e[2];const _=Ot(y),h=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let k;e[3]!==n?(k={connections:[n],binding:"MCP"},e[3]=n,e[4]=k):k=e[4];const $=Dt(k).length>0,M=n?.metadata?.repository,A=!!M?.url;let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=kt(Us),e[5]=I):I=e[5];let E;e[6]!==n?(E=it(n),e[6]=n,e[7]=E):E=e[7];let L;e[8]!==E?(L={resolver:I,values:E},e[8]=E,e[9]=L):L=e[9];const C=Pt(L),z=C.formState.isDirty;let P;e[10]!==C||e[11]!==f?(P=async()=>{if(!await C.trigger())return;const U=C.getValues(),Ne=qs(U);await f(Ne),C.reset(U)},e[10]=C,e[11]=f,e[12]=P):P=e[12];const D=P;let V;e[13]!==n||e[14]!==C?(V=()=>{C.reset(it(n))},e[13]=n,e[14]=C,e[15]=V):V=e[15];const g=V;let F;e[16]!==n.id||e[17]!==v||e[18]!==l?(F=async()=>{const{token:w,tokenInfo:U,error:Ne}=await Bt({connectionId:n.id});if(Ne||!w){Ce.error(`Authentication failed: ${Ne}`);return}if(U)try{const De=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:U.accessToken,refreshToken:U.refreshToken,expiresIn:U.expiresIn,scope:U.scope,clientId:U.clientId,clientSecret:U.clientSecret,tokenEndpoint:U.tokenEndpoint})});if(!De.ok)console.error("Failed to save OAuth token:",await De.text()),await v.update.mutateAsync({id:n.id,data:{connection_token:w}});else try{await v.update.mutateAsync({id:n.id,data:{}})}catch(Qe){console.warn("Failed to refresh connection tools after OAuth:",Qe)}}catch(De){console.error("Error saving OAuth token:",De),await v.update.mutateAsync({id:n.id,data:{connection_token:w}})}else await v.update.mutateAsync({id:n.id,data:{connection_token:w}});const bt=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Ye.isMCPAuthenticated(bt.href,null)}),Ce.success("Authentication successful")},e[16]=n.id,e[17]=v,e[18]=l,e[19]=F):F=e[19];const O=F;let S;e[20]!==n.id||e[21]!==l?(S=async()=>{try{const w=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!w.ok){const Ne=await w.text();Ce.error(`Failed to remove OAuth: ${Ne}`);return}const U=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Ye.isMCPAuthenticated(U.href,null)}),Ce.success("OAuth removed. You can now re-authenticate with a different account.")}catch(w){console.error("Error removing OAuth token:",w),Ce.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=l,e[22]=S):S=e[22];const H=S,X=m.length,se=p.length,ne=x.length,oe=X>0||i;let we;e[23]===Symbol.for("react.memo_cache_sentinel")?(we={id:"settings",label:"Settings"},e[23]=we):we=e[23];let re;e[24]!==i||e[25]!==h||e[26]!==oe||e[27]!==X?(re=h&&oe?[{id:"tools",label:"Tools",count:i?void 0:X}]:[],e[24]=i,e[25]=h,e[26]=oe,e[27]=X,e[28]=re):re=e[28];let ie;e[29]!==h||e[30]!==se?(ie=h&&se>0?[{id:"prompts",label:"Prompts",count:se}]:[],e[29]=h,e[30]=se,e[31]=ie):ie=e[31];let ce;e[32]!==h||e[33]!==ne?(ce=h&&ne>0?[{id:"resources",label:"Resources",count:ne}]:[],e[32]=h,e[33]=ne,e[34]=ce):ce=e[34];let Te;if(e[35]!==a||e[36]!==A||e[37]!==h||e[38]!==re||e[39]!==ie||e[40]!==ce){let w;e[42]!==A?(w=A?[{id:"readme",label:"README"}]:[],e[42]=A,e[43]=w):w=e[43],Te=[we,...re,...ie,...ce,...h?(a||[]).map(Gs):[],...w],e[35]=a,e[36]=A,e[37]=h,e[38]=re,e[39]=ie,e[40]=ce,e[41]=Te}else Te=e[41];const _e=Te,jt=h&&_e.some(Qs)?"tools":"settings",R=_e.some(w=>w.id===c)?c:jt;let ke;e[44]!==d?(ke=w=>{d({search:U=>({...U,tab:w}),replace:!0})},e[44]=d,e[45]=ke):ke=e[45];const ae=ke;let le;e[46]!==a?(le=a||[],e[46]=a,e[47]=le):le=e[47];let Pe;if(e[48]!==R||e[49]!==le){let w;e[51]!==R?(w=U=>U.name===R,e[51]=R,e[52]=w):w=e[52],Pe=le.find(w),e[48]=R,e[49]=le,e[50]=Pe}else Pe=e[50];const Ie=Pe;let de;e[53]!==r?(de=t.jsx(Ze,{children:t.jsx(Kt,{asChild:!0,children:t.jsx(ct,{to:"/$org/$project/mcps",params:{org:r,project:Se},children:"Connections"})})}),e[53]=r,e[54]=de):de=e[54];let $e;e[55]===Symbol.for("react.memo_cache_sentinel")?($e=t.jsx(Xt,{}),e[55]=$e):$e=e[55];let me;e[56]!==n.title?(me=t.jsx(Ze,{children:t.jsx(zt,{children:n.title})}),e[56]=n.title,e[57]=me):me=e[57];let Ae;e[58]!==de||e[59]!==me?(Ae=t.jsx(Wt,{children:t.jsxs(qt,{children:[de,$e,me]})}),e[58]=de,e[59]=me,e[60]=Ae):Ae=e[60];const Le=Ae;let ue;e[61]!==D||e[62]!==g||e[63]!==z||e[64]!==u?(ue=t.jsx(Vt,{onSave:D,onUndo:g,isDirty:z,isSaving:u}),e[61]=D,e[62]=g,e[63]=z,e[64]=u,e[65]=ue):ue=e[65];const Ue=n.icon??"settings";let pe;e[66]!==n.title||e[67]!==Ue||e[68]!==T?(pe=t.jsx(Ke,{title:n.title,url:T,icon:Ue}),e[66]=n.title,e[67]=Ue,e[68]=T,e[69]=pe):pe=e[69];let fe;e[70]!==ue||e[71]!==pe?(fe=t.jsxs(We,{children:[ue,pe]}),e[70]=ue,e[71]=pe,e[72]=fe):fe=e[72];let xe;e[73]!==_.hasOAuthToken||e[74]!==n||e[75]!==C||e[76]!==O||e[77]!==H||e[78]!==h?(xe=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(bs,{form:C,connection:n,isMCPAuthenticated:h,hasOAuthToken:_.hasOAuthToken,onReauthenticate:O,onRemoveOAuth:H})}),e[73]=_.hasOAuthToken,e[74]=n,e[75]=C,e[76]=O,e[77]=H,e[78]=h,e[79]=xe):xe=e[79];let he;e[80]!==R||e[81]!==ae||e[82]!==_e?(he=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Ht,{tabs:_e,activeTab:R,onTabChange:ae,className:"flex-1"})}),e[80]=R,e[81]=ae,e[82]=_e,e[83]=he):he=e[83];let Ve;e[84]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),e[84]=Ve):Ve=e[84];let ge;e[85]!==Ie||e[86]!==R||e[87]!==_.isServerError||e[88]!==_.supportsOAuth||e[89]!==n||e[90]!==o||e[91]!==C||e[92]!==O||e[93]!==ae||e[94]!==$||e[95]!==A||e[96]!==i||e[97]!==h||e[98]!==r||e[99]!==p||e[100]!==M||e[101]!==x||e[102]!==m?(ge=t.jsx(Y.Suspense,{fallback:Ve,children:R==="tools"?t.jsx(Fs,{tools:m,connectionId:o,org:r,isLoading:i}):R==="prompts"?t.jsx(ks,{prompts:p,connectionId:o,org:r}):R==="resources"?t.jsx(Es,{resources:x,connectionId:o,org:r}):R==="settings"?t.jsx(Rt,{connection:n,form:C,hasMcpBinding:$,isMCPAuthenticated:h,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:O,onViewReadme:A?()=>ae("readme"):void 0}):R==="readme"&&A?t.jsx(Ps,{repository:M}):Ie&&h?t.jsx(Gt,{connectionId:o,org:r,activeCollection:Ie},R):t.jsx(ye,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[85]=Ie,e[86]=R,e[87]=_.isServerError,e[88]=_.supportsOAuth,e[89]=n,e[90]=o,e[91]=C,e[92]=O,e[93]=ae,e[94]=$,e[95]=A,e[96]=i,e[97]=h,e[98]=r,e[99]=p,e[100]=M,e[101]=x,e[102]=m,e[103]=ge):ge=e[103];let je;e[104]!==R||e[105]!==ge?(je=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(dt,{children:ge},R)}),e[104]=R,e[105]=ge,e[106]=je):je=e[106];let be;e[107]!==he||e[108]!==je?(be=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[he,je]}),e[107]=he,e[108]=je,e[109]=be):be=e[109];let ve;e[110]!==xe||e[111]!==be?(ve=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[xe,be]}),e[110]=xe,e[111]=be,e[112]=ve):ve=e[112];let Me;return e[113]!==Le||e[114]!==fe||e[115]!==ve?(Me=t.jsxs(Qt,{breadcrumb:Le,children:[fe,ve]}),e[113]=Le,e[114]=fe,e[115]=ve,e[116]=Me):Me=e[116],Me}function Qs(s){return s.id==="tools"}function Gs(s){return{id:s.name,label:s.displayName}}function Js(){const s=K.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Ee(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:r,org:c}=St(o),{org:a}=at();let f;s[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=f):f=s[2];const p=wt(f).tab??"",x=Xe(r),m=ut(),i=Mt(x??void 0);let b;s[3]!==r||s[4]!==a.id?(b={connectionId:r,orgId:a.id},s[3]=r,s[4]=a.id,s[5]=b):b=s[5];const d=Et(b);let l;s[6]!==d?(l={client:d},s[6]=d,s[7]=l):l=s[7];const{data:j}=Ut(l);let T;s[8]!==d?(T={client:d},s[8]=d,s[9]=T):T=s[9];const{data:v}=Ft(T),_=!(x?.connection_type==="VIRTUAL")&&x?.tools&&x.tools.length>0,N=!_;let h;s[10]!==d||s[11]!==N?(h={client:d,enabled:N},s[10]=d,s[11]=N,s[12]=h):h=s[12];const{data:k,isLoading:B}=Lt(h);let $;s[13]!==j?.prompts?($=j?.prompts??[],s[13]=j?.prompts,s[14]=$):$=s[14];let M;s[15]!==$?(M=$.map(en),s[15]=$,s[16]=M):M=s[16];const A=M;let I;s[17]!==v?.resources?(I=v?.resources??[],s[17]=v?.resources,s[18]=I):I=s[18];let E;s[19]!==I?(E=I.map(Zs),s[19]=I,s[20]=E):E=s[20];const L=E;let C;s[21]!==x||s[22]!==_||s[23]!==k?.tools?(C=_?x.tools??[]:(k?.tools??[]).map(Ys),s[21]=x,s[22]=_,s[23]=k?.tools,s[24]=C):C=s[24];const z=C;let P;s[25]!==m.update||s[26]!==r?(P=async g=>{await m.update.mutateAsync({id:r,data:g})},s[25]=m.update,s[26]=r,s[27]=P):P=s[27];const D=P;if(!x){let g;return s[28]!==n||s[29]!==c?(g=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ye,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Fe,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:c,project:Se}}),children:"Back to connections"})})}),s[28]=n,s[29]=c,s[30]=g):g=s[30],g}let V;return s[31]!==m.update.isPending||s[32]!==i||s[33]!==x||s[34]!==r||s[35]!==D||s[36]!==B||s[37]!==c||s[38]!==A||s[39]!==p||s[40]!==L||s[41]!==z?(V=t.jsx(Hs,{org:c,connection:x,connectionId:r,requestedTabId:p,collections:i,onUpdate:D,isUpdating:m.update.isPending,prompts:A,resources:L,tools:z,isLoadingTools:B}),s[31]=m.update.isPending,s[32]=i,s[33]=x,s[34]=r,s[35]=D,s[36]=B,s[37]=c,s[38]=A,s[39]=p,s[40]=L,s[41]=z,s[42]=V):V=s[42],V}function Ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema}}function Zs(s){return{uri:s.uri,name:s.name,description:s.description}}function en(s){return{name:s.name,description:s.description}}function tn(){const s=K.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(dt,{children:t.jsx(Y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Js,{})})}),s[0]=e):e=s[0],e}function zo(){const s=K.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tn,{}),s[0]=e):e=s[0],e}export{zo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as de,j as e,r as R,u as Ce,m as be,f as ke,g as Ne,ag as we,k as Se,h as De,i as Pe,O as x,o as me,ah as Te,s as v,ai as Ie}from"./index-BF7Y1e9M.js";import{g as $e}from"./generate-id-Dyweu44Y.js";import{C as Ve,a as Ae}from"./collection-table-wrapper-D9zZsdiL.js";import{C as Ee}from"./collection-search-Yrefv2Yh.js";import{C as Oe}from"./connection-card-D4lpnLQO.js";import{B as H}from"./badge-BfrnxbIP.js";import{i as Be}from"./AlertCircle-CMI4YiF8.js";import{i as Fe}from"./CheckCircle-ByeMMv-P.js";import{E as z}from"./empty-state-Bi-BkSth.js";import{E as He}from"./error-boundary-CaGh18_R.js";import{n as U,I as ze}from"./integration-icon-DL_7q6rJ.js";import{P as I}from"./index-CNTzRs2a.js";import{u as Ue,U as ee}from"./use-list-state-FXqJjHJh.js";import{u as Me}from"./use-binding-ltfl3cPA.js";import{f as Re,e as Le}from"./registry-utils-DHqoUP2c.js";import{f as Xe,a as We,b as Ke,c as Ge,d as qe,e as Ye,A as Je,g as Qe}from"./alert-dialog-D0wLSh9n.js";import{B as Ze,a as et,b as tt,c as nt}from"./breadcrumb-2c6yAn4J.js";import{B as C}from"./button-CsJ-BTyU.js";import{D as st,a as ot,b as rt,c as it,d as at,e as ct}from"./dialog-3EB-J4B_.js";import{D as te,a as ne,b as se,c as E}from"./dropdown-menu-Bshnl7f0.js";import{a as lt,F as h,b as g,c as j,d as f,f as y}from"./form-BlwP3Tk9.js";import{I as k}from"./input-Barosnhy.js";import{S as dt,a as mt,b as pt,c as ut,d as $}from"./select-C2Pbxf7c.js";import{T as xt}from"./textarea-CUDbyNiv.js";import{g as ht,h as gt}from"./use-connection-_6bZJd3j.js";import{u as jt}from"./constants-CucT8Y-Y.js";import{b as ft}from"./use-mcp-tools-CERNk3IX.js";import{i as oe}from"./DotsVertical-CWQ3-YKt.js";import{s as re}from"./Eye-BiLrFCnc.js";import{s as M}from"./Globe02-Dh-HvcG9.js";import{i as yt}from"./Loading01-DislDZSB.js";import{i as vt}from"./Terminal-rAB0v_E_.js";import{s as ie}from"./Trash01-By04ijdF.js";import{f as ae}from"./format-time-CMKyl-GC.js";import{r as _t,E as Ct,e as pe}from"./env-vars-editor-CbswziBn.js";import"./ArrowUp-Cr88yR39.js";import"./Check-BVqX6VG5.js";import"./Grid01-BQKiQdYB.js";import"./List-DbyYoAK0.js";import"./view-mode-toggle-BiQRnCj0.js";import"./table-Bgaai9wR.js";import"./SearchMd-BkDBIRnQ.js";import"./card-CzebRix7.js";import"./index-CA62CANi.js";import"./avatar-DZVTlnSA.js";import"./useQuery-BS0MQvhs.js";import"./use-mobile-DgWdzZzh.js";import"./binder-B99OawxF.js";import"./ChevronRight-sGXl7Bvf.js";import"./X-r5buNXf-.js";import"./label-CsZ9MmGa.js";import"./ChevronDown-C753dD5M.js";import"./useMutation-GLUqnj57.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-B4n0HRX4.js";function ce(n){const s=de.c(3),{status:i}=n;if(i==="active"){let c;return s[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(H,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(Fe,{size:12}),"Active"]}),s[0]=c):c=s[0],c}if(i==="error"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(H,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(Be,{size:12}),"Error"]}),s[1]=c):c=s[1],c}let d;return s[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(H,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),s[2]=d):d=s[2],d}const bt=me({key:v(),value:v()}),kt=me({title:v().min(1,"Name is required"),description:v().nullable().optional(),ui_type:Ie(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:v().optional(),connection_token:v().nullable().optional(),npx_package:v().optional(),stdio_command:v().optional(),stdio_args:v().optional(),stdio_cwd:v().optional(),env_vars:Te(bt).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 B(n){const s=n.trim();if(!s)return"";try{const i=new URL(s),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return s.replace(/\/+$/,"")}}function Nt(n){const s=n.trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;const i=s[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=s.slice(1).find(a=>!a.startsWith("-"));return c?{packageName:c}:null}function O(n){const{uiType:s}=n,i=B(n.connectionUrl??"");if((s==="HTTP"||s==="SSE"||s==="Websocket")&&i===B("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 d=(n.npxPackage??"").trim();return s==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function le(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const s=B(n.connectionUrl??"");if(!s)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>B(N.url??"")===s));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function wt(n,s){const i={command:"npx",args:["-y",n]},d=pe(s);return Object.keys(d).length>0&&(i.envVars=d),i}function St(n,s,i,d){const c={command:n};s.trim()&&(c.args=s.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const a=pe(d);return Object.keys(a).length>0&&(c.envVars=a),c}function Dt(n){return n.command==="npx"}function Pt(n){return n.args?.find(s=>!s.startsWith("-"))??""}function Tt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function It(n,s){switch(s.type){case"edit":return{mode:"editing",connection:s.connection};case"delete":return{mode:"deleting",connection:s.connection};case"close":return{mode:"idle"}}}function $t(){const{org:n}=Ce(),s=be(),i=ke({strict:!1}),{data:d}=Ne.useSession(),{stdioEnabled:c}=we(),a=Ue({namespace:n.slug,resource:"connections"}),V=ht(),N=gt(a),[_,w]=R.useReducer(It,{mode:"idle"}),L=Me(N)[0],X=L?.id??"",W=Re(L?.tools),ue=jt({connectionId:X||null,orgId:n.id}),{data:xe}=ft({client:ue,toolName:W,toolArguments:{limit:200},enabled:!!(X&&W),staleTime:3600*1e3,select:t=>t.structuredContent??t}),K=Le(xe??[]),G=i.action==="create",he=()=>{s({to:"/$org/$project/mcps",params:{org:n.slug,project:x},search:{action:"create"}})},q=()=>{s({to:"/$org/$project/mcps",params:{org:n.slug,project:x},search:{}})},r=Se({resolver:De(kt),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=r.watch("ui_type"),Y=r.watch("connection_url"),ge=r.watch("npx_package"),P=O({uiType:p,connectionUrl:Y??"",npxPackage:ge??""})??le({uiType:p,connectionUrl:Y??"",registryItems:K}),m=_.mode==="editing"?_.connection:null;R.useEffect(()=>{if(m){const t=Pe(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const o=_t(t.envVars);if(Dt(t)){const l=Pt(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const l=Tt(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:l.command,stdio_args:l.args,stdio_cwd:l.cwd,env_vars:o})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const je=async()=>{if(_.mode!=="deleting")return;const t=_.connection.id;w({type:"close"});try{await V.delete.mutateAsync(t)}catch{}},fe=async t=>{let o,l=null,S=null,b=null;if(t.ui_type==="NPX"?(o="STDIO",l="",b=wt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",l="",b=St(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,l=t.connection_url||"",S=t.connection_token||null),m){await V.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:l,...S&&{connection_token:S},...b&&{connection_headers:b}}}),w({type:"close"}),r.reset();return}const D=$e("conn");await V.create.mutateAsync({id:D,title:t.title,description:t.description||null,connection_type:o,connection_url:l,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:b,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),q(),r.reset(),s({to:"/$org/$project/mcps/$connectionId",params:{org:n.slug,project:x,connectionId:D}})},J=t=>{t||(G?q():w({type:"close"}),r.reset())},A=t=>{const o=t.trim();if(!o)return;const l=!!r.formState.dirtyFields.title,S=!!r.formState.dirtyFields.description,b=!!r.formState.dirtyFields.env_vars,D=u=>{if(u&&(!l&&!r.getValues("title").trim()&&u.title&&r.setValue("title",u.title,{shouldDirty:!1}),!S&&!(r.getValues("description")??"").trim()&&u.description&&r.setValue("description",u.description,{shouldDirty:!1}),!b&&u.envVarKeys?.length)){const Q=r.getValues("env_vars")??[],_e=new Set(Q.map(T=>T.key)),Z=u.envVarKeys.filter(T=>!_e.has(T));Z.length>0&&r.setValue("env_vars",[...Q,...Z.map(T=>({key:T,value:""}))],{shouldDirty:!0})}},F=Nt(o);if(F&&c){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",F.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),D(O({uiType:"NPX",npxPackage:F.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const u=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";r.setValue("ui_type",u,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),D(O({uiType:u,connectionUrl:o})??le({uiType:u,connectionUrl:o,registryItems:K}));return}p==="NPX"&&D(O({uiType:"NPX",npxPackage:o}))},ye=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ze,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(U,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(ce,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(ee,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?ae(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(te,{children:[e.jsx(ne,{asChild:!0,children:e.jsx(C,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(oe,{size:20})})}),e.jsxs(se,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),s({to:"/$org/$project/mcps/$connectionId",params:{org:n.slug,project:x,connectionId:t.id}})},children:[e.jsx(re,{size:16}),"Open"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),w({type:"delete",connection:t})},children:[e.jsx(ie,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],ve=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"outline",onClick:()=>s({to:"/$org/$project/store",params:{org:n.slug,project:x}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(C,{onClick:he,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(I,{children:[e.jsx(st,{open:G||_.mode==="editing",onOpenChange:J,children:e.jsxs(ot,{className:"sm:max-w-[525px]",children:[e.jsxs(rt,{children:[e.jsx(it,{children:m?"Edit Connection":"Create Connection"}),e.jsx(at,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(lt,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(fe),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Type *"}),e.jsxs(dt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(f,{children:e.jsx(mt,{children:e.jsx(pt,{})})}),e.jsxs(ut,{children:[e.jsx($,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx($,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"SSE"]})}),e.jsx($,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"Websocket"]})}),c&&e.jsxs(e.Fragment,{children:[e.jsx($,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx($,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(vt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(y,{})]})}),p==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"NPM Package *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("npx_package",l.trim(),{shouldDirty:!0}),A(l))},onBlur:o=>{A(o.target.value),t.onBlur()}})}),e.jsx(y,{})]})})}),p==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Command *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(y,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Arguments"}),e.jsx(f,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(y,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Working Directory"}),e.jsx(f,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(y,{})]})})]}),(p==="NPX"||p==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Environment Variables"}),e.jsx(f,{children:e.jsx(Ct,{value:t.value??[],onChange:t.onChange})}),e.jsx(y,{})]})}),p!=="NPX"&&p!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"URL *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("connection_url",l.trim(),{shouldDirty:!0}),A(l))},onBlur:o=>{A(o.target.value),t.onBlur()}})}),e.jsx(y,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:P?.token?.label??"Token (optional)"}),e.jsx(f,{children:e.jsx(k,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),P?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.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"})]})]}),e.jsx(y,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Name *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(y,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Description"}),e.jsx(f,{children:e.jsx(xt,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(y,{})]})})]}),e.jsxs(ct,{children:[e.jsx(C,{type:"button",variant:"outline",onClick:()=>J(!1),children:"Cancel"}),e.jsx(C,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Xe,{open:_.mode==="deleting",onOpenChange:t=>!t&&w({type:"close"}),children:e.jsxs(We,{children:[e.jsxs(Ke,{children:[e.jsx(Ge,{children:"Delete Connection?"}),e.jsxs(qe,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:_.mode==="deleting"&&_.connection.title}),"."]})]}),e.jsxs(Ye,{children:[e.jsx(Je,{children:"Cancel"}),e.jsx(Qe,{onClick:je,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsxs(I.Header,{children:[e.jsx(I.Header.Left,{children:e.jsx(Ze,{children:e.jsx(et,{children:e.jsx(tt,{children:e.jsx(nt,{children:"Connections"})})})})}),e.jsxs(I.Header.Right,{children:[e.jsx(Ve,{viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.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"}]}),ve]})]}),e.jsx(Ee,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),e.jsx(I.Content,{children:a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(z,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(C,{variant:"outline",onClick:()=>s({to:"/$org/$project/store",params:{org:n.slug,project:x}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(Oe,{connection:t,fallbackIcon:e.jsx(U,{}),onClick:()=>s({to:"/$org/$project/mcps/$connectionId",params:{org:n.slug,project:x,connectionId:t.id}}),headerActions:e.jsxs(te,{children:[e.jsx(ne,{asChild:!0,children:e.jsx(C,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(oe,{size:20})})}),e.jsxs(se,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),s({to:"/$org/$project/mcps/$connectionId",params:{org:n.slug,project:x,connectionId:t.id}})},children:[e.jsx(re,{size:16}),"Open"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),w({type:"delete",connection:t})},children:[e.jsx(ie,{size:16}),"Delete"]})]})]}),body:e.jsx(ce,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(ee,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?ae(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Ae,{columns:ye,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>s({to:"/$org/$project/mcps/$connectionId",params:{org:n.slug,project:x,connectionId:t.id}}),emptyState:a.search?e.jsx(z,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(z,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(C,{variant:"outline",onClick:()=>s({to:"/$org/$project/store",params:{org:n.slug,project:x}}),children:"Browse Store"})})})})})})})]})}function En(){const n=de.c(1);let s;return n[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(He,{children:e.jsx(R.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(yt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx($t,{})})}),n[0]=s):s=n[0],s}export{En as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{M as t,Q as a}from"./index-BF7Y1e9M.js";const e=t(a,{target:"draft-7"});export{e as B};
|