@decocms/mesh 2.63.0 → 2.64.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-ByS2S7QG.js → AlertCircle-B7sqll3Z.js} +1 -1
- package/dist/client/assets/{ArrowUp-Pc2qwI_3.js → ArrowUp-D8YYlj5b.js} +1 -1
- package/dist/client/assets/{Calendar-MP2K9xOR.js → Calendar-Cn4v8JwE.js} +1 -1
- package/dist/client/assets/{Check-kOHUYBJY.js → Check-lN7sUZo8.js} +1 -1
- package/dist/client/assets/{ChevronDown-J2iKAqyZ.js → ChevronDown-En_P43wp.js} +1 -1
- package/dist/client/assets/{ChevronRight-Cua3_Oqd.js → ChevronRight-BB2YL4K4.js} +1 -1
- package/dist/client/assets/{Code01-DORFegNP.js → Code01-Dgx2dgXr.js} +1 -1
- package/dist/client/assets/{Copy01-U5Mrbyn4.js → Copy01-daHVbD8K.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-nhuBUuxR.js → DotsHorizontal-DT2O2EOj.js} +1 -1
- package/dist/client/assets/{DotsVertical-CDOXEsr8.js → DotsVertical-D1ZY49Um.js} +1 -1
- package/dist/client/assets/{Download01-jn6ziu2W.js → Download01-oP6u6TmF.js} +1 -1
- package/dist/client/assets/{Edit01-C_cfLeJc.js → Edit01-C_JM_ANM.js} +1 -1
- package/dist/client/assets/{File02-Gea-raGb.js → File02-DlRIy2xF.js} +1 -1
- package/dist/client/assets/{File06-DE5HPnG3.js → File06-2dtWfDa_.js} +1 -1
- package/dist/client/assets/{FilterLines-CeL96HHO.js → FilterLines-BCtAjuvO.js} +1 -1
- package/dist/client/assets/{Grid01-CkZU0tWV.js → Grid01-DHptyetH.js} +1 -1
- package/dist/client/assets/{Home02-BLvW9ZzY.js → Home02-CwpXJj-n.js} +1 -1
- package/dist/client/assets/{Image01-CIkj8y0a.js → Image01-CILGPgam.js} +1 -1
- package/dist/client/assets/{Inbox01-8S74uH1Z.js → Inbox01-BTvTBHN2.js} +1 -1
- package/dist/client/assets/{InfoCircle-BfJTzk81.js → InfoCircle-COTflZ7n.js} +1 -1
- package/dist/client/assets/{Key01-BFw74njR.js → Key01-DFKkR5uc.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BRD6ViRl.js → LinkExternal01-WHnCc-Ds.js} +1 -1
- package/dist/client/assets/{List-4IPwuAX9.js → List-Dl-Bi1Os.js} +1 -1
- package/dist/client/assets/{Loading01-CCSRv8tX.js → Loading01-D8raUT2q.js} +1 -1
- package/dist/client/assets/{Lock01-B367KJK-.js → Lock01-0pDC11sR.js} +1 -1
- package/dist/client/assets/{Pin01-dHyXwRhr.js → Pin01-C3nTzsY2.js} +1 -1
- package/dist/client/assets/{Play-DiP4pY8r.js → Play-B3d026b0.js} +1 -1
- package/dist/client/assets/{Plus-B5QrRvCn.js → Plus-BcqTpnxy.js} +1 -1
- package/dist/client/assets/{SearchMd-D2POsGFy.js → SearchMd-DVuLBPJW.js} +1 -1
- package/dist/client/assets/{Share07-CQptN91g.js → Share07-DW8M4mUv.js} +1 -1
- package/dist/client/assets/{Terminal-CsAynI3M.js → Terminal-BOgtpg9n.js} +1 -1
- package/dist/client/assets/{Tool01-DdjIy29J.js → Tool01-D95FDZLP.js} +1 -1
- package/dist/client/assets/{Trash01-BdLDRPDl.js → Trash01-CR6s5yrj.js} +1 -1
- package/dist/client/assets/{Upload01-BB9AN-C_.js → Upload01-CkSc1CyA.js} +1 -1
- package/dist/client/assets/{Users03-DPYHJvoT.js → Users03-CCWN1VQn.js} +1 -1
- package/dist/client/assets/{X-CVoqpcAx.js → X-BsLffR19.js} +1 -1
- package/dist/client/assets/{XClose-CqNB1Ju1.js → XClose-D9VL7Fhs.js} +1 -1
- package/dist/client/assets/{agent-detail-BA2oH52J.js → agent-detail-DEjCff0P.js} +1 -1
- package/dist/client/assets/{agents-CexpEqf3.js → agents-C0Oa7sFF.js} +1 -1
- package/dist/client/assets/{alert-dialog-9PxNij5-.js → alert-dialog-BYFUia7V.js} +1 -1
- package/dist/client/assets/{auth-catchall-UkCMdvlG.js → auth-catchall-B3lc_CZ9.js} +1 -1
- package/dist/client/assets/{avatar-Cr99ARr3.js → avatar-B6WhQiHI.js} +1 -1
- package/dist/client/assets/{badge-a9rJdKKG.js → badge-D19NcG12.js} +1 -1
- package/dist/client/assets/{binder-BHtkW0UD.js → binder-CwgOa4SG.js} +1 -1
- package/dist/client/assets/{breadcrumb-DBCyZqWb.js → breadcrumb-BuFIEIOz.js} +1 -1
- package/dist/client/assets/{button-BB_m2E67.js → button-BNRw8VbO.js} +1 -1
- package/dist/client/assets/{card-DQu0Qiy4.js → card-B2_21gZH.js} +1 -1
- package/dist/client/assets/{checkbox-BYeejX3s.js → checkbox-D0Zw7dGS.js} +1 -1
- package/dist/client/assets/{circle-alert-W5iOrtbw.js → circle-alert-DepalnIB.js} +1 -1
- package/dist/client/assets/{collapsible-Ce6mH95q.js → collapsible-Dg-5RnYq.js} +1 -1
- package/dist/client/assets/{collection-detail-Wj5M0Fmc.js → collection-detail-DFH_vpkO.js} +1 -1
- package/dist/client/assets/{collection-search-DozvRnxE.js → collection-search-D5gi0-bL.js} +1 -1
- package/dist/client/assets/{collection-tab-BRIJmTl-.js → collection-tab-DxItkIfa.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CTuXfFv4.js → collection-table-wrapper-igJ5OqPc.js} +1 -1
- package/dist/client/assets/{connect-DKTGUww4.js → connect-CtxQyDSW.js} +1 -1
- package/dist/client/assets/{connection-card-Bp0BNZom.js → connection-card-GHfjxhQ1.js} +1 -1
- package/dist/client/assets/{connection-detail-DdEzYohs.js → connection-detail-sqbtlWZ0.js} +1 -1
- package/dist/client/assets/{connections-C2ef7EGE.js → connections-DeNXDjso.js} +1 -1
- package/dist/client/assets/{constants-nQTTOIWL.js → constants-Cpe-c81c.js} +1 -1
- package/dist/client/assets/constants-gYpJq1UH.js +1 -0
- package/dist/client/assets/{create-organization-dialog-CgJo2N7J.js → create-organization-dialog-7bdcAksX.js} +1 -1
- package/dist/client/assets/{dialog-BPGYkE6E.js → dialog-Csoqe4hG.js} +1 -1
- package/dist/client/assets/{dropdown-menu-w3xNt286.js → dropdown-menu-CsYNL9oo.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DB7JIoTi.js → dynamic-plugin-layout-bKoth3Ne.js} +1 -1
- package/dist/client/assets/{empty-state-DI837doR.js → empty-state-Cn1CRUZO.js} +1 -1
- package/dist/client/assets/{empty-state-Cuxzpiqy.js → empty-state-CpRLw49r.js} +1 -1
- package/dist/client/assets/{env-vars-editor-dEtMntyA.js → env-vars-editor-0JsZHlg0.js} +1 -1
- package/dist/client/assets/{error-boundary-UVoBd-EX.js → error-boundary-DQ5uRgdY.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BkwH9UE5.js → extract-connection-data-B6LHMHtn.js} +1 -1
- package/dist/client/assets/{file-browser-DBtEgqmA.js → file-browser-xiIO0qLw.js} +2 -2
- package/dist/client/assets/{form-CFGJ-U5C.js → form-DAoJifFq.js} +1 -1
- package/dist/client/assets/{grid-view-BNbopqbx.js → grid-view-Bj9WDB_-.js} +1 -1
- package/dist/client/assets/{home-DzPPiX6r.js → home-BgLX6VJQ.js} +1 -1
- package/dist/client/assets/{index-CRFYi63w.js → index-BhNLW4h1.js} +1 -1
- package/dist/client/assets/{index-Cw0Cq7G5.js → index-Bos_CuhY.js} +2 -2
- package/dist/client/assets/index-CU94_QoM.css +1 -0
- package/dist/client/assets/{index-Cr1-k0ke.js → index-CsOz92iP.js} +1 -1
- package/dist/client/assets/{index-CERcQBYB.js → index-DJLvIq1X.js} +1 -1
- package/dist/client/assets/{index-DrbTAGPY.js → index-GUdoiFzV.js} +1 -1
- package/dist/client/assets/{index-BxQtX61C.js → index-P_cUV9l9.js} +1 -1
- package/dist/client/assets/{index-DVqIQLTS.js → index-yjsBu7QA.js} +2 -2
- package/dist/client/assets/{infiniteQueryObserver-qdoAkrLg.js → infiniteQueryObserver-D_8FFQdU.js} +1 -1
- package/dist/client/assets/{input-D53urYud.js → input-C-GM7dsu.js} +1 -1
- package/dist/client/assets/{layout-CvATyvqE.js → layout-D8G7uVC8.js} +1 -1
- package/dist/client/assets/{localstorage-keys-Dt0DQ7_M.js → localstorage-keys-C_mtBNzA.js} +1 -1
- package/dist/client/assets/{login-C_lPzYbi.js → login-FPJg9vSY.js} +1 -1
- package/dist/client/assets/{mcp-oauth-ALBEJIVW.js → mcp-oauth-l77m3IWF.js} +1 -1
- package/dist/client/assets/{mcp-server-card-BSDiwyMq.js → mcp-server-card-D5sj_LDb.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-hoJFp--l.js → mcp-server-detail-BFJxlaGZ.js} +2 -2
- package/dist/client/assets/{members-DhIxxmb-.js → members-D6XXyYMu.js} +1 -1
- package/dist/client/assets/{monaco-editor-Dv5Uv_CH.js → monaco-editor-p_EFt-aT.js} +1 -1
- package/dist/client/assets/{monitoring-CesgjcG6.js → monitoring-CFkcXam_.js} +1 -1
- package/dist/client/assets/{oauth-callback-D881LTdt.js → oauth-callback-DN_uk9hh.js} +1 -1
- package/dist/client/assets/{page-Bz36h7wn.js → page-BityQMBs.js} +1 -1
- package/dist/client/assets/{page-BINds3__.js → page-D2S0EYIA.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-VWxGEpa7.js → pin-to-sidebar-button-qPJJKT8U.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BKQ3hXbm.js → plugin-empty-state-CuuSx5zh.js} +1 -1
- package/dist/client/assets/{plugin-header-D2pQH9wJ.js → plugin-header-BpBy7iT0.js} +1 -1
- package/dist/client/assets/{plugins-BaoheFvZ.js → plugins-CEFWqcJY.js} +1 -1
- package/dist/client/assets/{popover-C9gpO_P1.js → popover-u_i609j_.js} +1 -1
- package/dist/client/assets/{registry-utils-COHLTguy.js → registry-utils-BNFgymSf.js} +1 -1
- package/dist/client/assets/{resizable-Dl3VUWr8.js → resizable-Bac7VXSC.js} +1 -1
- package/dist/client/assets/{resource-tabs-Ddi84XBD.js → resource-tabs-CE-63rPp.js} +1 -1
- package/dist/client/assets/{select-DsmrYLOe.js → select-B4SPtD5h.js} +1 -1
- package/dist/client/assets/{settings-Z2r51vE-.js → settings-CoEwEtT9.js} +1 -1
- package/dist/client/assets/shell-layout-BH2X3Yeb.js +12 -0
- package/dist/client/assets/{spinner-CaiollDD.js → spinner-Duo6KesX.js} +1 -1
- package/dist/client/assets/{store-invite-E7IkGyCx.js → store-invite-CyZGTGUz.js} +1 -1
- package/dist/client/assets/{switch-BRyOsD9X.js → switch-DBMrpKuB.js} +1 -1
- package/dist/client/assets/{table-By59ASmK.js → table-NP0FOAI5.js} +1 -1
- package/dist/client/assets/{textarea-BB8VII1W.js → textarea-ByvgxbRE.js} +1 -1
- package/dist/client/assets/{tools-list-DURWgp8a.js → tools-list-gkMtCYZf.js} +1 -1
- package/dist/client/assets/{typewriter-title-BTENJbqy.js → typewriter-title-CZvcEhZW.js} +1 -1
- package/dist/client/assets/{use-binding-BKAkfTQP.js → use-binding-CNR8kDE7.js} +1 -1
- package/dist/client/assets/{use-collections-CidxL5e8.js → use-collections-Hp9XPnUY.js} +1 -1
- package/dist/client/assets/{use-connection-nBbiimhv.js → use-connection-Dj100t8H.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CPQ3EWAe.js → use-create-virtual-mcp-B01dvSQa.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-CxrySluI.js → use-deco-chat-open-C4y7eW_U.js} +1 -1
- package/dist/client/assets/{use-list-state-DDhTHJ9V.js → use-list-state-DsM4HMGd.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-0zuoUwAA.js → use-mcp-prompts-SKr2e7l0.js} +1 -1
- package/dist/client/assets/{use-members-CVCClaOw.js → use-members-C8R91dOK.js} +1 -1
- package/dist/client/assets/{use-mobile-D3kiHSC9.js → use-mobile-CS2zVR4m.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bnh92zjq.js → use-organization-settings-ClYOYczD.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BzFn2znu.js → use-virtual-mcp-XGRCLjSr.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C34Ot4VI.js +1 -0
- package/dist/client/assets/{useMutation-DYyKBkRY.js → useMutation-VOj1VEf8.js} +1 -1
- package/dist/client/assets/useQuery-C5RIveiE.js +1 -0
- package/dist/client/assets/{view-mode-toggle-C2aKUr7i.js → view-mode-toggle-zGyN0eoT.js} +1 -1
- package/dist/client/assets/{workflow-DrGi1tqo.js → workflow-BRSWFGSV.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +82 -82
- package/dist/server/migrate.js +169 -169
- package/dist/server/server.js +62 -62
- package/package.json +1 -1
- package/dist/client/assets/constants-DuCds5dq.js +0 -1
- package/dist/client/assets/index-DTBzssSX.css +0 -1
- package/dist/client/assets/shell-layout-LyCgzjUJ.js +0 -12
- package/dist/client/assets/useInfiniteQuery-Cg3dUfja.js +0 -1
- package/dist/client/assets/useQuery-CC03be4X.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ne,j as t,u as Ve,K as rt,l as at,b6 as ct,g as dt,r as mt,v as ft}from"./index-DVqIQLTS.js";import{g as Ue}from"./generate-id-Dyweu44Y.js";import{a as ut,C as qe}from"./collection-table-wrapper-CTuXfFv4.js";import{C as pt}from"./collection-search-DozvRnxE.js";import{C as ht}from"./card-DQu0Qiy4.js";import{I as Ge,E as xt}from"./empty-state-Cuxzpiqy.js";import{D as We,a as He,b as Je,c as F}from"./dropdown-menu-w3xNt286.js";import{B as ke,c as Oe}from"./button-BB_m2E67.js";import{a as Qe}from"./Copy01-U5Mrbyn4.js";import{i as Ye}from"./DotsVertical-CDOXEsr8.js";import{i as Xe}from"./Edit01-C_cfLeJc.js";import{s as Ze,u as gt}from"./use-list-state-DDhTHJ9V.js";import{s as et}from"./Trash01-BdLDRPDl.js";import{E as Le}from"./empty-state-DI837doR.js";import{n as Be}from"./Inbox01-8S74uH1Z.js";import{A as Me}from"./avatar-Cr99ARr3.js";import{u as jt}from"./useQuery-CC03be4X.js";import{a as Ct,u as tt}from"./constants-nQTTOIWL.js";import{P as vt}from"./pin-to-sidebar-button-VWxGEpa7.js";import{u as bt,b as yt}from"./use-collections-CidxL5e8.js";import{u as Nt}from"./use-connection-nBbiimhv.js";import{B as wt}from"./constants-DuCds5dq.js";import{A as St,g as _t,c as Dt,b as At,d as It,e as Pt,a as Tt,f as $t}from"./alert-dialog-9PxNij5-.js";import{s as Et}from"./Plus-B5QrRvCn.js";import{V as zt}from"./layout-CvATyvqE.js";function Ot(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const c=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of c)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Mt(n){const e=ne.c(25),{item:s,schema:c,actions:o}=n;let l;e[0]!==s||e[1]!==c?(l=Ot(c,s),e[0]=s,e[1]=c,e[2]=l):l=e[2];const r=l,d=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==r||e[6]!==s.title?(u=t.jsx(Ge,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=u):u=e[7];let g;e[8]!==s.title?(g=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=g):g=e[9];const h=d||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==g||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,m]}),e[12]=g,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let v;e[18]!==o||e[19]!==i||e[20]!==s?(v=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ut,onMouseDown:Kt,children:t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ft,children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:kt,children:[o.open&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.open?.(s)},children:[t.jsx(Ze,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.edit?.(s)},children:[t.jsx(Xe,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:p=>{p.stopPropagation(),o.delete?.(s)},children:[t.jsx(et,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=v):v=e[21];let N;return e[22]!==y||e[23]!==v?(N=t.jsxs(ht,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,v]}),e[22]=y,e[23]=v,e[24]=N):N=e[24],N}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){return n.stopPropagation()}function Ut(n){return n.stopPropagation()}function Lt(n){const e=ne.c(11),{org:s}=Ve();let c;e[0]!==s.id?(c={connectionId:Ct,orgId:s.id},e[0]=s.id,e[1]=c):c=e[1];const o=tt(c);let l;e[2]!==n?(l=rt.user(n),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==o||e[5]!==n?(r=async()=>{const i=await o.callTool({name:"USER_GET",arguments:{id:n}});return(i.structuredContent??i).user},e[4]=o,e[5]=n,e[6]=r):r=e[6];const d=!!n;let f;return e[7]!==l||e[8]!==r||e[9]!==d?(f={queryKey:l,queryFn:r,staleTime:3e5,retry:1,enabled:d},e[7]=l,e[8]=r,e[9]=d,e[10]=f):f=e[10],jt(f)}function Bt(n){const e=ne.c(39),{id:s,size:c,showEmail:o,className:l}=n,r=c===void 0?"xs":c,d=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Lt(s);if(i){let p;e[0]!==l?(p=Oe("flex items-center gap-2",l),e[0]=l,e[1]=p):p=e[1];let a;e[2]!==r?(a=t.jsx(Me.Skeleton,{shape:"circle",size:r}),e[2]=r,e[3]=a):a=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=b):b=e[4];let j;e[5]!==d?(j=d&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=d,e[6]=j):j=e[6];let C;e[7]!==j?(C=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,j]}),e[7]=j,e[8]=C):C=e[8];let _;return e[9]!==p||e[10]!==a||e[11]!==C?(_=t.jsxs("div",{className:p,children:[a,C]}),e[9]=p,e[10]=a,e[11]=C,e[12]=_):_=e[12],_}if(u||!f){let p;e[13]!==l?(p=Oe("flex items-center gap-2",l),e[13]=l,e[14]=p):p=e[14];let a;e[15]!==r?(a=t.jsx(Me,{shape:"circle",size:r,fallback:"?",muted:!0}),e[15]=r,e[16]=a):a=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=b):b=e[17];let j;return e[18]!==p||e[19]!==a?(j=t.jsxs("div",{className:p,children:[a,b]}),e[18]=p,e[19]=a,e[20]=j):j=e[20],j}let g;e[21]!==l?(g=Oe("flex items-center gap-2",l),e[21]=l,e[22]=g):g=e[22];const h=f.image??void 0;let m;e[23]!==r||e[24]!==h||e[25]!==f.name?(m=t.jsx(Me,{shape:"circle",size:r,url:h,fallback:f.name}),e[23]=r,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==d||e[30]!==f.email?(y=d&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=d,e[30]=f.email,e[31]=y):y=e[31];let v;e[32]!==x||e[33]!==y?(v=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=v):v=e[34];let N;return e[35]!==g||e[36]!==m||e[37]!==v?(N=t.jsxs("div",{className:g,children:[m,v]}),e[35]=g,e[36]=m,e[37]=v,e[38]=N):N=e[38],N}const Rt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Vt(n){return Object.keys(n).find(e=>Rt.includes(e.toLowerCase()))}function st(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function qt(n){const e=ne.c(32),{data:s,schema:c,viewMode:o,onViewModeChange:l,search:r,sortKey:d,sortDirection:f,onSort:i,actions:u,onItemClick:g,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:v,sortableFields:N}=n,p=l===void 0?Qt:l,a=f===void 0?"asc":f,b=i===void 0?Jt:i;let j;e[0]!==u?(j=u===void 0?{}:u,e[0]=u,e[1]=j):j=e[1];const C=j,_=g===void 0?Ht:g,D=h===void 0?null:h,P=m===void 0?null:m,E=x===void 0?!1:x,A=y===void 0?void 0:y,I=v===void 0?!1:v,S=N===void 0?void 0:N;let M;e[2]!==A||e[3]!==c||e[4]!==S?(M=A?A.filter(Wt).filter(O=>!S||S.includes(O.id)).map(Gt):st(c,S),e[2]=A,e[3]=c,e[4]=S,e[5]=M):M=e[5];const k=M;let z;e[6]!==D||e[7]!==I||e[8]!==b||e[9]!==p||e[10]!==a||e[11]!==d||e[12]!==k||e[13]!==o?(z=!I&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{viewMode:o,onViewModeChange:p,sortKey:d,sortDirection:a,onSort:b,sortOptions:k})})]})}),e[6]=D,e[7]=I,e[8]=b,e[9]=p,e[10]=a,e[11]=d,e[12]=k,e[13]=o,e[14]=z):z=e[14];let T;e[15]!==C||e[16]!==A||e[17]!==s||e[18]!==P||e[19]!==_||e[20]!==b||e[21]!==E||e[22]!==c||e[23]!==r||e[24]!==a||e[25]!==d||e[26]!==S||e[27]!==o?(T=o==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>_?.(O),className:"cursor-pointer h-full",children:t.jsx(Mt,{item:O,schema:c,readOnly:E,actions:C})},O.id))})}):t.jsx(ut,{columns:Zt(A,c,S,C),data:s,sortKey:d,sortDirection:a,onSort:b,onRowClick:_,emptyState:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}),e[15]=C,e[16]=A,e[17]=s,e[18]=P,e[19]=_,e[20]=b,e[21]=E,e[22]=c,e[23]=r,e[24]=a,e[25]=d,e[26]=S,e[27]=o,e[28]=T):T=e[28];let $;return e[29]!==z||e[30]!==T?($=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[z,T]}),e[29]=z,e[30]=T,e[31]=$):$=e[31],$}function Gt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Wt(n){return n.sortable!==!1}function Ht(){}function Jt(){}function Qt(){}function Yt(n){return{id:"actions",header:"",render:e=>t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ze,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Xe,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(et,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function it(n){const e=n.type;return Array.isArray(e)?e.every(s=>it({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Xt(n,e){const s=n.properties||{},c=Object.keys(s).filter(i=>{const u=s[i];return u&&it(u)}),o=Vt(s),l=[],r=new Set;o&&c.includes(o)&&(l.push(o),r.add(o));const d=["title","description","updated_at","updated_by"];for(const i of d)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const f=c.filter(i=>!r.has(i)&&!Re.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),r.add(i);for(const i of Re)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const u=s[i],g=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(Ge,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:g,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Bt,{id:String(m),size:"xs"}):"—"},sortable:g,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:g,cellClassName:"max-w-[200px]"}})}function Zt(n,e,s,c){const o=n||Xt(e,s);return o.some(d=>d.id==="actions")?o:Object.keys(c).length>0?[...o,Yt(c)]:o}function _s(n){const e=ne.c(118),{connectionId:s,org:c,activeCollection:o}=n,l=o.name,r=o.schema??wt,d=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=at(),h=ct().location.href,{data:m}=dt.useSession(),x=m?.user?.id||"unknown",y=Nt(s),{org:v}=Ve();let N;e[0]!==s||e[1]!==v.id?(N={connectionId:s,orgId:v.id},e[0]=s,e[1]=v.id,e[2]=N):N=e[2];const p=tt(N),a=bt(s,l,p),b=`${s}-${l}`;let j;e[3]!==c||e[4]!==b?(j={namespace:c,resource:b,defaultSortKey:"updated_at"},e[3]=c,e[4]=b,e[5]=j):j=e[5];const{search:C,searchTerm:_,setSearch:D,viewMode:P,setViewMode:E,sortKey:A,sortDirection:I,handleSort:S}=gt(j);let M;e[6]!==_||e[7]!==I||e[8]!==A?(M={searchTerm:_,sortKey:A,sortDirection:I},e[6]=_,e[7]=I,e[8]=A,e[9]=M):M=e[9];const k=yt(s,l,p,M),z=!d&&!f&&!i;let T;e[10]!==l||e[11]!==s||e[12]!==u||e[13]!==c?(T=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:w.id}})},e[10]=l,e[11]=s,e[12]=u,e[13]=c,e[14]=T):T=e[14];const $=T;let O;e[15]!==a.create||e[16]!==x?(O=async w=>{const he=new Date().toISOString();await a.create.mutateAsync({...w,id:Ue("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[15]=a.create,e[16]=x,e[17]=O):O=e[17];const xe=O,[K,ge]=mt.useState(null);let le;e[18]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{ge(w)},e[18]=le):le=e[18];const ot=le;let U;e[19]!==$||e[20]!==f?(U=f&&{edit:$},e[19]=$,e[20]=f,e[21]=U):U=e[21];let L;e[22]!==xe||e[23]!==d?(L=d&&{duplicate:xe},e[22]=xe,e[23]=d,e[24]=L):L=e[24];let B;e[25]!==i?(B=i&&{delete:ot},e[25]=i,e[26]=B):B=e[26];let re;e[27]!==B||e[28]!==U||e[29]!==L?(re={...U,...L,...B},e[27]=B,e[28]=U,e[29]=L,e[30]=re):re=e[30];const je=re;let ae;e[31]!==a.delete||e[32]!==K?(ae=async()=>{K&&(await a.delete.mutateAsync(K.id),ge(null))},e[31]=a.delete,e[32]=K,e[33]=ae):ae=e[33];const Ce=ae;let ce;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==d||e[38]!==u||e[39]!==c||e[40]!==x?(ce=async()=>{if(!d){ft.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ue("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const ze=await a.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:ze.id}})}catch(ze){console.error("Failed to create item:",ze)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=d,e[38]=u,e[39]=c,e[40]=x,e[41]=ce):ce=e[41];const ve=ce;let de;e[42]!==r?(de=st(r),e[42]=r,e[43]=de):de=e[43];const be=de,Fe=(k?.length??0)>0,nt=d&&Fe,lt=d&&!Fe&&!C;let me;e[44]!==a.create||e[45]!==ve||e[46]!==d?(me=d?t.jsxs(ke,{onClick:ve,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=ve,e[46]=d,e[47]=me):me=e[47];const Ke=me,ye=A;let R;e[48]!==S||e[49]!==E||e[50]!==I||e[51]!==be||e[52]!==ye||e[53]!==P?(R=t.jsx(qe,{viewMode:P,onViewModeChange:E,sortKey:ye,sortDirection:I,onSort:S,sortOptions:be}),e[48]=S,e[49]=E,e[50]=I,e[51]=be,e[52]=ye,e[53]=P,e[54]=R):R=e[54];const Ne=`${l}s`,we=y?.icon??"grid_view";let V;e[55]!==Ne||e[56]!==we||e[57]!==h?(V=t.jsx(vt,{title:Ne,url:h,icon:we}),e[55]=Ne,e[56]=we,e[57]=h,e[58]=V):V=e[58];const Se=nt&&Ke;let q;e[59]!==R||e[60]!==V||e[61]!==Se?(q=t.jsxs(zt,{children:[R,V,Se]}),e[59]=R,e[60]=V,e[61]=Se,e[62]=q):q=e[62];const _e=`Search ${l}...`;let G;e[63]!==D?(G=w=>{w.key==="Escape"&&(D(""),w.target.blur())},e[63]=D,e[64]=G):G=e[64];let W;e[65]!==C||e[66]!==D||e[67]!==_e||e[68]!==G?(W=t.jsx(pt,{value:C,onChange:D,placeholder:_e,onKeyDown:G}),e[65]=C,e[66]=D,e[67]=_e,e[68]=G,e[69]=W):W=e[69];let H;e[70]!==k?(H=k??[],e[70]=k,e[71]=H):H=e[71];const De=A;let J;e[72]!==$?(J=w=>$(w),e[72]=$,e[73]=J):J=e[73];const Ae="No items found",Ie=C?"Try adjusting your search terms":"This collection doesn't have any items yet.",Pe=lt?Ke:void 0;let Q;e[74]!==Ae||e[75]!==Ie||e[76]!==Pe?(Q=t.jsx(xt,{image:null,title:Ae,description:Ie,actions:Pe}),e[74]=Ae,e[75]=Ie,e[76]=Pe,e[77]=Q):Q=e[77];let Y;e[78]!==S||e[79]!==z||e[80]!==je||e[81]!==r||e[82]!==C||e[83]!==D||e[84]!==E||e[85]!==I||e[86]!==H||e[87]!==De||e[88]!==J||e[89]!==Q||e[90]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(qt,{hideToolbar:!0,data:H,schema:r,viewMode:P,onViewModeChange:E,search:C,onSearchChange:D,sortKey:De,sortDirection:I,onSort:S,actions:je,onItemClick:J,readOnly:z,emptyState:Q})}),e[78]=S,e[79]=z,e[80]=je,e[81]=r,e[82]=C,e[83]=D,e[84]=E,e[85]=I,e[86]=H,e[87]=De,e[88]=J,e[89]=Q,e[90]=P,e[91]=Y):Y=e[91];let X;e[92]!==W||e[93]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[92]=W,e[93]=Y,e[94]=X):X=e[94];const Te=!!K;let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||ge(null)},e[95]=fe):fe=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Dt,{children:"Delete item?"}),e[96]=ue):ue=e[96];const $e=K?.title;let Z;e[97]!==$e?(Z=t.jsxs(At,{children:[ue,t.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[97]=$e,e[98]=Z):Z=e[98];let ee;e[99]!==a.delete.isPending?(ee=t.jsx(St,{disabled:a.delete.isPending,children:"Cancel"}),e[99]=a.delete.isPending,e[100]=ee):ee=e[100];const Ee=a.delete.isPending?"Deleting...":"Delete";let te;e[101]!==a.delete.isPending||e[102]!==Ce||e[103]!==Ee?(te=t.jsx(_t,{onClick:Ce,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[101]=a.delete.isPending,e[102]=Ce,e[103]=Ee,e[104]=te):te=e[104];let se;e[105]!==ee||e[106]!==te?(se=t.jsxs(Pt,{children:[ee,te]}),e[105]=ee,e[106]=te,e[107]=se):se=e[107];let ie;e[108]!==Z||e[109]!==se?(ie=t.jsxs(Tt,{children:[Z,se]}),e[108]=Z,e[109]=se,e[110]=ie):ie=e[110];let oe;e[111]!==Te||e[112]!==ie?(oe=t.jsx($t,{open:Te,onOpenChange:fe,children:ie}),e[111]=Te,e[112]=ie,e[113]=oe):oe=e[113];let pe;return e[114]!==q||e[115]!==X||e[116]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[114]=q,e[115]=X,e[116]=oe,e[117]=pe):pe=e[117],pe}export{_s as C};
|
|
1
|
+
import{c as ne,j as t,u as Ve,K as rt,l as at,b6 as ct,g as dt,r as mt,v as ft}from"./index-yjsBu7QA.js";import{g as Ue}from"./generate-id-Dyweu44Y.js";import{a as ut,C as qe}from"./collection-table-wrapper-igJ5OqPc.js";import{C as pt}from"./collection-search-D5gi0-bL.js";import{C as ht}from"./card-B2_21gZH.js";import{I as Ge,E as xt}from"./empty-state-CpRLw49r.js";import{D as We,a as He,b as Je,c as F}from"./dropdown-menu-CsYNL9oo.js";import{B as ke,c as Oe}from"./button-BNRw8VbO.js";import{a as Qe}from"./Copy01-daHVbD8K.js";import{i as Ye}from"./DotsVertical-D1ZY49Um.js";import{i as Xe}from"./Edit01-C_JM_ANM.js";import{s as Ze,u as gt}from"./use-list-state-DsM4HMGd.js";import{s as et}from"./Trash01-CR6s5yrj.js";import{E as Le}from"./empty-state-Cn1CRUZO.js";import{n as Be}from"./Inbox01-BTvTBHN2.js";import{A as Me}from"./avatar-B6WhQiHI.js";import{u as jt}from"./useQuery-C5RIveiE.js";import{a as Ct,u as tt}from"./constants-Cpe-c81c.js";import{P as vt}from"./pin-to-sidebar-button-qPJJKT8U.js";import{u as bt,b as yt}from"./use-collections-Hp9XPnUY.js";import{u as Nt}from"./use-connection-Dj100t8H.js";import{B as wt}from"./constants-gYpJq1UH.js";import{A as St,g as _t,c as Dt,b as At,d as It,e as Pt,a as Tt,f as $t}from"./alert-dialog-BYFUia7V.js";import{s as Et}from"./Plus-BcqTpnxy.js";import{V as zt}from"./layout-D8G7uVC8.js";function Ot(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const c=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of c)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Mt(n){const e=ne.c(25),{item:s,schema:c,actions:o}=n;let l;e[0]!==s||e[1]!==c?(l=Ot(c,s),e[0]=s,e[1]=c,e[2]=l):l=e[2];const r=l,d=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==r||e[6]!==s.title?(u=t.jsx(Ge,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=u):u=e[7];let g;e[8]!==s.title?(g=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=g):g=e[9];const h=d||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==g||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,m]}),e[12]=g,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let v;e[18]!==o||e[19]!==i||e[20]!==s?(v=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ut,onMouseDown:Kt,children:t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ft,children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:kt,children:[o.open&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.open?.(s)},children:[t.jsx(Ze,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.edit?.(s)},children:[t.jsx(Xe,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:p=>{p.stopPropagation(),o.delete?.(s)},children:[t.jsx(et,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=v):v=e[21];let N;return e[22]!==y||e[23]!==v?(N=t.jsxs(ht,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,v]}),e[22]=y,e[23]=v,e[24]=N):N=e[24],N}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){return n.stopPropagation()}function Ut(n){return n.stopPropagation()}function Lt(n){const e=ne.c(11),{org:s}=Ve();let c;e[0]!==s.id?(c={connectionId:Ct,orgId:s.id},e[0]=s.id,e[1]=c):c=e[1];const o=tt(c);let l;e[2]!==n?(l=rt.user(n),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==o||e[5]!==n?(r=async()=>{const i=await o.callTool({name:"USER_GET",arguments:{id:n}});return(i.structuredContent??i).user},e[4]=o,e[5]=n,e[6]=r):r=e[6];const d=!!n;let f;return e[7]!==l||e[8]!==r||e[9]!==d?(f={queryKey:l,queryFn:r,staleTime:3e5,retry:1,enabled:d},e[7]=l,e[8]=r,e[9]=d,e[10]=f):f=e[10],jt(f)}function Bt(n){const e=ne.c(39),{id:s,size:c,showEmail:o,className:l}=n,r=c===void 0?"xs":c,d=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Lt(s);if(i){let p;e[0]!==l?(p=Oe("flex items-center gap-2",l),e[0]=l,e[1]=p):p=e[1];let a;e[2]!==r?(a=t.jsx(Me.Skeleton,{shape:"circle",size:r}),e[2]=r,e[3]=a):a=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=b):b=e[4];let j;e[5]!==d?(j=d&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=d,e[6]=j):j=e[6];let C;e[7]!==j?(C=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,j]}),e[7]=j,e[8]=C):C=e[8];let _;return e[9]!==p||e[10]!==a||e[11]!==C?(_=t.jsxs("div",{className:p,children:[a,C]}),e[9]=p,e[10]=a,e[11]=C,e[12]=_):_=e[12],_}if(u||!f){let p;e[13]!==l?(p=Oe("flex items-center gap-2",l),e[13]=l,e[14]=p):p=e[14];let a;e[15]!==r?(a=t.jsx(Me,{shape:"circle",size:r,fallback:"?",muted:!0}),e[15]=r,e[16]=a):a=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=b):b=e[17];let j;return e[18]!==p||e[19]!==a?(j=t.jsxs("div",{className:p,children:[a,b]}),e[18]=p,e[19]=a,e[20]=j):j=e[20],j}let g;e[21]!==l?(g=Oe("flex items-center gap-2",l),e[21]=l,e[22]=g):g=e[22];const h=f.image??void 0;let m;e[23]!==r||e[24]!==h||e[25]!==f.name?(m=t.jsx(Me,{shape:"circle",size:r,url:h,fallback:f.name}),e[23]=r,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==d||e[30]!==f.email?(y=d&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=d,e[30]=f.email,e[31]=y):y=e[31];let v;e[32]!==x||e[33]!==y?(v=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=v):v=e[34];let N;return e[35]!==g||e[36]!==m||e[37]!==v?(N=t.jsxs("div",{className:g,children:[m,v]}),e[35]=g,e[36]=m,e[37]=v,e[38]=N):N=e[38],N}const Rt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Vt(n){return Object.keys(n).find(e=>Rt.includes(e.toLowerCase()))}function st(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function qt(n){const e=ne.c(32),{data:s,schema:c,viewMode:o,onViewModeChange:l,search:r,sortKey:d,sortDirection:f,onSort:i,actions:u,onItemClick:g,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:v,sortableFields:N}=n,p=l===void 0?Qt:l,a=f===void 0?"asc":f,b=i===void 0?Jt:i;let j;e[0]!==u?(j=u===void 0?{}:u,e[0]=u,e[1]=j):j=e[1];const C=j,_=g===void 0?Ht:g,D=h===void 0?null:h,P=m===void 0?null:m,E=x===void 0?!1:x,A=y===void 0?void 0:y,I=v===void 0?!1:v,S=N===void 0?void 0:N;let M;e[2]!==A||e[3]!==c||e[4]!==S?(M=A?A.filter(Wt).filter(O=>!S||S.includes(O.id)).map(Gt):st(c,S),e[2]=A,e[3]=c,e[4]=S,e[5]=M):M=e[5];const k=M;let z;e[6]!==D||e[7]!==I||e[8]!==b||e[9]!==p||e[10]!==a||e[11]!==d||e[12]!==k||e[13]!==o?(z=!I&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{viewMode:o,onViewModeChange:p,sortKey:d,sortDirection:a,onSort:b,sortOptions:k})})]})}),e[6]=D,e[7]=I,e[8]=b,e[9]=p,e[10]=a,e[11]=d,e[12]=k,e[13]=o,e[14]=z):z=e[14];let T;e[15]!==C||e[16]!==A||e[17]!==s||e[18]!==P||e[19]!==_||e[20]!==b||e[21]!==E||e[22]!==c||e[23]!==r||e[24]!==a||e[25]!==d||e[26]!==S||e[27]!==o?(T=o==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>_?.(O),className:"cursor-pointer h-full",children:t.jsx(Mt,{item:O,schema:c,readOnly:E,actions:C})},O.id))})}):t.jsx(ut,{columns:Zt(A,c,S,C),data:s,sortKey:d,sortDirection:a,onSort:b,onRowClick:_,emptyState:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}),e[15]=C,e[16]=A,e[17]=s,e[18]=P,e[19]=_,e[20]=b,e[21]=E,e[22]=c,e[23]=r,e[24]=a,e[25]=d,e[26]=S,e[27]=o,e[28]=T):T=e[28];let $;return e[29]!==z||e[30]!==T?($=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[z,T]}),e[29]=z,e[30]=T,e[31]=$):$=e[31],$}function Gt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Wt(n){return n.sortable!==!1}function Ht(){}function Jt(){}function Qt(){}function Yt(n){return{id:"actions",header:"",render:e=>t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ze,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Xe,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(et,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function it(n){const e=n.type;return Array.isArray(e)?e.every(s=>it({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Xt(n,e){const s=n.properties||{},c=Object.keys(s).filter(i=>{const u=s[i];return u&&it(u)}),o=Vt(s),l=[],r=new Set;o&&c.includes(o)&&(l.push(o),r.add(o));const d=["title","description","updated_at","updated_by"];for(const i of d)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const f=c.filter(i=>!r.has(i)&&!Re.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),r.add(i);for(const i of Re)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const u=s[i],g=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(Ge,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:g,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Bt,{id:String(m),size:"xs"}):"—"},sortable:g,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:g,cellClassName:"max-w-[200px]"}})}function Zt(n,e,s,c){const o=n||Xt(e,s);return o.some(d=>d.id==="actions")?o:Object.keys(c).length>0?[...o,Yt(c)]:o}function _s(n){const e=ne.c(118),{connectionId:s,org:c,activeCollection:o}=n,l=o.name,r=o.schema??wt,d=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=at(),h=ct().location.href,{data:m}=dt.useSession(),x=m?.user?.id||"unknown",y=Nt(s),{org:v}=Ve();let N;e[0]!==s||e[1]!==v.id?(N={connectionId:s,orgId:v.id},e[0]=s,e[1]=v.id,e[2]=N):N=e[2];const p=tt(N),a=bt(s,l,p),b=`${s}-${l}`;let j;e[3]!==c||e[4]!==b?(j={namespace:c,resource:b,defaultSortKey:"updated_at"},e[3]=c,e[4]=b,e[5]=j):j=e[5];const{search:C,searchTerm:_,setSearch:D,viewMode:P,setViewMode:E,sortKey:A,sortDirection:I,handleSort:S}=gt(j);let M;e[6]!==_||e[7]!==I||e[8]!==A?(M={searchTerm:_,sortKey:A,sortDirection:I},e[6]=_,e[7]=I,e[8]=A,e[9]=M):M=e[9];const k=yt(s,l,p,M),z=!d&&!f&&!i;let T;e[10]!==l||e[11]!==s||e[12]!==u||e[13]!==c?(T=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:w.id}})},e[10]=l,e[11]=s,e[12]=u,e[13]=c,e[14]=T):T=e[14];const $=T;let O;e[15]!==a.create||e[16]!==x?(O=async w=>{const he=new Date().toISOString();await a.create.mutateAsync({...w,id:Ue("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[15]=a.create,e[16]=x,e[17]=O):O=e[17];const xe=O,[K,ge]=mt.useState(null);let le;e[18]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{ge(w)},e[18]=le):le=e[18];const ot=le;let U;e[19]!==$||e[20]!==f?(U=f&&{edit:$},e[19]=$,e[20]=f,e[21]=U):U=e[21];let L;e[22]!==xe||e[23]!==d?(L=d&&{duplicate:xe},e[22]=xe,e[23]=d,e[24]=L):L=e[24];let B;e[25]!==i?(B=i&&{delete:ot},e[25]=i,e[26]=B):B=e[26];let re;e[27]!==B||e[28]!==U||e[29]!==L?(re={...U,...L,...B},e[27]=B,e[28]=U,e[29]=L,e[30]=re):re=e[30];const je=re;let ae;e[31]!==a.delete||e[32]!==K?(ae=async()=>{K&&(await a.delete.mutateAsync(K.id),ge(null))},e[31]=a.delete,e[32]=K,e[33]=ae):ae=e[33];const Ce=ae;let ce;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==d||e[38]!==u||e[39]!==c||e[40]!==x?(ce=async()=>{if(!d){ft.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ue("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const ze=await a.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:ze.id}})}catch(ze){console.error("Failed to create item:",ze)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=d,e[38]=u,e[39]=c,e[40]=x,e[41]=ce):ce=e[41];const ve=ce;let de;e[42]!==r?(de=st(r),e[42]=r,e[43]=de):de=e[43];const be=de,Fe=(k?.length??0)>0,nt=d&&Fe,lt=d&&!Fe&&!C;let me;e[44]!==a.create||e[45]!==ve||e[46]!==d?(me=d?t.jsxs(ke,{onClick:ve,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=ve,e[46]=d,e[47]=me):me=e[47];const Ke=me,ye=A;let R;e[48]!==S||e[49]!==E||e[50]!==I||e[51]!==be||e[52]!==ye||e[53]!==P?(R=t.jsx(qe,{viewMode:P,onViewModeChange:E,sortKey:ye,sortDirection:I,onSort:S,sortOptions:be}),e[48]=S,e[49]=E,e[50]=I,e[51]=be,e[52]=ye,e[53]=P,e[54]=R):R=e[54];const Ne=`${l}s`,we=y?.icon??"grid_view";let V;e[55]!==Ne||e[56]!==we||e[57]!==h?(V=t.jsx(vt,{title:Ne,url:h,icon:we}),e[55]=Ne,e[56]=we,e[57]=h,e[58]=V):V=e[58];const Se=nt&&Ke;let q;e[59]!==R||e[60]!==V||e[61]!==Se?(q=t.jsxs(zt,{children:[R,V,Se]}),e[59]=R,e[60]=V,e[61]=Se,e[62]=q):q=e[62];const _e=`Search ${l}...`;let G;e[63]!==D?(G=w=>{w.key==="Escape"&&(D(""),w.target.blur())},e[63]=D,e[64]=G):G=e[64];let W;e[65]!==C||e[66]!==D||e[67]!==_e||e[68]!==G?(W=t.jsx(pt,{value:C,onChange:D,placeholder:_e,onKeyDown:G}),e[65]=C,e[66]=D,e[67]=_e,e[68]=G,e[69]=W):W=e[69];let H;e[70]!==k?(H=k??[],e[70]=k,e[71]=H):H=e[71];const De=A;let J;e[72]!==$?(J=w=>$(w),e[72]=$,e[73]=J):J=e[73];const Ae="No items found",Ie=C?"Try adjusting your search terms":"This collection doesn't have any items yet.",Pe=lt?Ke:void 0;let Q;e[74]!==Ae||e[75]!==Ie||e[76]!==Pe?(Q=t.jsx(xt,{image:null,title:Ae,description:Ie,actions:Pe}),e[74]=Ae,e[75]=Ie,e[76]=Pe,e[77]=Q):Q=e[77];let Y;e[78]!==S||e[79]!==z||e[80]!==je||e[81]!==r||e[82]!==C||e[83]!==D||e[84]!==E||e[85]!==I||e[86]!==H||e[87]!==De||e[88]!==J||e[89]!==Q||e[90]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(qt,{hideToolbar:!0,data:H,schema:r,viewMode:P,onViewModeChange:E,search:C,onSearchChange:D,sortKey:De,sortDirection:I,onSort:S,actions:je,onItemClick:J,readOnly:z,emptyState:Q})}),e[78]=S,e[79]=z,e[80]=je,e[81]=r,e[82]=C,e[83]=D,e[84]=E,e[85]=I,e[86]=H,e[87]=De,e[88]=J,e[89]=Q,e[90]=P,e[91]=Y):Y=e[91];let X;e[92]!==W||e[93]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[92]=W,e[93]=Y,e[94]=X):X=e[94];const Te=!!K;let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||ge(null)},e[95]=fe):fe=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Dt,{children:"Delete item?"}),e[96]=ue):ue=e[96];const $e=K?.title;let Z;e[97]!==$e?(Z=t.jsxs(At,{children:[ue,t.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[97]=$e,e[98]=Z):Z=e[98];let ee;e[99]!==a.delete.isPending?(ee=t.jsx(St,{disabled:a.delete.isPending,children:"Cancel"}),e[99]=a.delete.isPending,e[100]=ee):ee=e[100];const Ee=a.delete.isPending?"Deleting...":"Delete";let te;e[101]!==a.delete.isPending||e[102]!==Ce||e[103]!==Ee?(te=t.jsx(_t,{onClick:Ce,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[101]=a.delete.isPending,e[102]=Ce,e[103]=Ee,e[104]=te):te=e[104];let se;e[105]!==ee||e[106]!==te?(se=t.jsxs(Pt,{children:[ee,te]}),e[105]=ee,e[106]=te,e[107]=se):se=e[107];let ie;e[108]!==Z||e[109]!==se?(ie=t.jsxs(Tt,{children:[Z,se]}),e[108]=Z,e[109]=se,e[110]=ie):ie=e[110];let oe;e[111]!==Te||e[112]!==ie?(oe=t.jsx($t,{open:Te,onOpenChange:fe,children:ie}),e[111]=Te,e[112]=ie,e[113]=oe):oe=e[113];let pe;return e[114]!==q||e[115]!==X||e[116]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[114]=q,e[115]=X,e[116]=oe,e[117]=pe):pe=e[117],pe}export{_s as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as k,c as T,j as t}from"./index-
|
|
1
|
+
import{r as k,c as T,j as t}from"./index-yjsBu7QA.js";import{c as y,B as L}from"./button-BNRw8VbO.js";import{c as E,a as V,D as B,b as $}from"./dropdown-menu-CsYNL9oo.js";import{i as D}from"./ArrowUp-D8YYlj5b.js";import{i as R}from"./Check-lN7sUZo8.js";import{c as H}from"./Grid01-DHptyetH.js";import{i as W}from"./List-Dl-Bi1Os.js";import{b as I,c as K,T as _,a as A}from"./empty-state-CpRLw49r.js";import{V as O}from"./view-mode-toggle-zGyN0eoT.js";import{T as P,a as q,b as z,c as F,d as G,e as J}from"./table-NP0FOAI5.js";const S=({size:p=24,color:e="currentColor",...s})=>k.createElement("svg",{viewBox:"0 0 24 24",width:p,height:p,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},k.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));S.displayName="ArrowDown";const M=({size:p=24,color:e="currentColor",...s})=>k.createElement("svg",{viewBox:"0 0 24 24",width:p,height:p,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},k.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));M.displayName="Sliders01";function ie(p){const e=T.c(16),{viewMode:s,onViewModeChange:x,sortKey:u,sortDirection:d,onSort:a,sortOptions:i}=p;let l;e[0]!==i?(l=i===void 0?[]:i,e[0]=i,e[1]=l):l=e[1];const m=l;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(I,{children:t.jsxs(K,{children:[t.jsx(_,{asChild:!0,children:t.jsx(V,{asChild:!0,children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(M,{size:16})})})}),t.jsx(A,{children:"Search filters"})]})}),e[2]=h):h=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c={value:"table",icon:t.jsx(W,{})},e[3]=c):c=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=[c,{value:"cards",icon:t.jsx(H,{})}],e[4]=r):r=e[4];let o;e[5]!==x||e[6]!==s?(o=t.jsx("div",{className:"p-2 border-b border-border",children:t.jsx(O,{value:s,onValueChange:x,fullWidth:!0,options:r})}),e[5]=x,e[6]=s,e[7]=o):o=e[7];let f;e[8]!==a||e[9]!==d||e[10]!==u||e[11]!==m?(f=m.length>0&&a&&t.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[t.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(j=>{const w=u===j.id;return t.jsx(E,{onClick:()=>a(j.id),className:y("h-8 px-2 py-0 cursor-pointer",w&&"bg-accent"),children:t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[w&&t.jsx(R,{size:16,className:"text-foreground shrink-0"}),!w&&t.jsx("div",{className:"w-4 shrink-0"}),t.jsx("span",{className:"text-sm text-foreground flex-1",children:j.label}),w&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-foreground shrink-0"}):t.jsx(S,{size:16,className:"text-foreground shrink-0"}))]})},j.id)})]}),e[8]=a,e[9]=d,e[10]=u,e[11]=m,e[12]=f):f=e[12];let g;return e[13]!==o||e[14]!==f?(g=t.jsxs(B,{children:[h,t.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,f]})]}),e[13]=o,e[14]=f,e[15]=g):g=e[15],g}function Q(p){const e=T.c(29),{columns:s,data:x,sortKey:u,sortDirection:d,onSort:a,onRowClick:i,rowClassName:l}=p;let m;e[0]!==d?(m=function(n,N){return t.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):t.jsx(S,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=d,e[1]=m):m=e[1];const h=m;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=c):c=e[2];const r=c;let o;if(e[3]!==s||e[4]!==a||e[5]!==h||e[6]!==u){let b;e[8]!==s.length||e[9]!==a||e[10]!==h||e[11]!==u?(b=(n,N)=>{const C=u===n.id;return t.jsx(P,{className:y(r(N,s.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&a?()=>a(n.id):void 0,children:t.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&h(n.id,C)]})},n.id)},e[8]=s.length,e[9]=a,e[10]=h,e[11]=u,e[12]=b):b=e[12],o=s.map(b),e[3]=s,e[4]=a,e[5]=h,e[6]=u,e[7]=o}else o=e[7];let f;e[13]!==o?(f=t.jsx(q,{className:"border-b-0",children:t.jsx(z,{className:"h-9 hover:bg-transparent border-b border-border",children:o})}),e[13]=o,e[14]=f):f=e[14];let g;if(e[15]!==s||e[16]!==x||e[17]!==i||e[18]!==l){let b;e[20]!==s||e[21]!==i||e[22]!==l?(b=(n,N)=>{const C=l?.(n);return t.jsx(z,{"data-row-index":N,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",i?"cursor-pointer":"",C),onClick:i?()=>i(n):void 0,children:s.map(v=>t.jsx(F,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",v.cellClassName,v.wrap?"whitespace-normal wrap-break-word":""),children:t.jsx("div",{className:y(v.wrap?"w-full":"min-w-0 w-full",!v.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:v.render?v.render(n):v.accessor?v.accessor(n):null})},v.id))},N)},e[20]=s,e[21]=i,e[22]=l,e[23]=b):b=e[23],g=x.map(b),e[15]=s,e[16]=x,e[17]=i,e[18]=l,e[19]=g}else g=e[19];let j;e[24]!==g?(j=t.jsx(G,{children:g}),e[24]=g,e[25]=j):j=e[25];let w;return e[26]!==f||e[27]!==j?(w=t.jsxs(J,{className:"w-full border-collapse",children:[f,j]}),e[26]=f,e[27]=j,e[28]=w):w=e[28],w}function ae(p){const e=T.c(12),{columns:s,data:x,isLoading:u,sortKey:d,sortDirection:a,onSort:i,onRowClick:l,emptyState:m}=p;if(u===void 0?!1:u){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=r):r=e[0],r}if(x.length===0){let r;e[1]!==m?(r=m||t.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=m,e[2]=r):r=e[2];let o;return e[3]!==r?(o=t.jsx("div",{className:"flex items-center justify-center h-full",children:r}),e[3]=r,e[4]=o):o=e[4],o}let c;return e[5]!==s||e[6]!==x||e[7]!==l||e[8]!==i||e[9]!==a||e[10]!==d?(c=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Q,{columns:s,data:x,sortKey:d,sortDirection:a,onSort:i,onRowClick:l})}),e[5]=s,e[6]=x,e[7]=l,e[8]=i,e[9]=a,e[10]=d,e[11]=c):c=e[11],c}export{ie as C,ae as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as T,bn as M,j as e,bo as P,a1 as q,r as R,v as h,a as O}from"./index-
|
|
1
|
+
import{c as T,bn as M,j as e,bo as P,a1 as q,r as R,v as h,a as O}from"./index-yjsBu7QA.js";import{u as A}from"./useQuery-C5RIveiE.js";import{u as _}from"./useMutation-VOj1VEf8.js";import{B as y}from"./button-BNRw8VbO.js";import{C as N,a as v}from"./card-B2_21gZH.js";import{i as L,a as U}from"./mcp-oauth-l77m3IWF.js";import{c as C,C as K,a as k}from"./circle-alert-DepalnIB.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(w,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(k,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,j as s}from"./index-
|
|
1
|
+
import{c as S,j as s}from"./index-yjsBu7QA.js";import{C as _}from"./card-B2_21gZH.js";import{c as j}from"./button-BNRw8VbO.js";import{I as A}from"./empty-state-CpRLw49r.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Q,j as o,l as Y,b6 as te,r as q,a as de,u as ue,f as pe,q as fe}from"./index-DVqIQLTS.js";import{E as H,I as oe}from"./empty-state-Cuxzpiqy.js";import{E as se}from"./error-boundary-UVoBd-EX.js";import{b as he}from"./use-binding-BKAkfTQP.js";import{u as xe,S as ge}from"./index-Cr1-k0ke.js";import{b as ee,c as be,d as je,e as ye,B as Se,a as Ce}from"./breadcrumb-DBCyZqWb.js";import{g as ve}from"./use-collections-CidxL5e8.js";import{u as Z,a as Ne}from"./use-connection-nBbiimhv.js";import{u as Te}from"./constants-nQTTOIWL.js";import{b as we,d as $e}from"./use-mcp-prompts-0zuoUwAA.js";import{B as Ie}from"./button-BB_m2E67.js";import{R as Le}from"./resource-tabs-Ddi84XBD.js";import{i as ne}from"./Loading01-CCSRv8tX.js";import{V as re,a as _e,b as ke}from"./layout-CvATyvqE.js";import{C as Re}from"./collection-tab-BRIJmTl-.js";import{a as ie,C as ce}from"./collection-table-wrapper-CTuXfFv4.js";import{C as ae}from"./collection-search-DozvRnxE.js";import{P as le}from"./pin-to-sidebar-button-VWxGEpa7.js";import{C as me}from"./card-DQu0Qiy4.js";import{R as Pe,T as Me}from"./tools-list-DURWgp8a.js";import"./binder-BHtkW0UD.js";import"./mcp-oauth-ALBEJIVW.js";import"./env-vars-editor-dEtMntyA.js";import"./input-D53urYud.js";import"./Plus-B5QrRvCn.js";import"./Trash01-BdLDRPDl.js";import"./File06-DE5HPnG3.js";import"./Key01-BFw74njR.js";import"./index-CRFYi63w.js";import"./badge-a9rJdKKG.js";import"./dropdown-menu-w3xNt286.js";import"./ChevronRight-Cua3_Oqd.js";import"./form-CFGJ-U5C.js";import"./select-DsmrYLOe.js";import"./Check-kOHUYBJY.js";import"./ChevronDown-J2iKAqyZ.js";import"./extract-connection-data-BkwH9UE5.js";import"./constants-DuCds5dq.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-COHLTguy.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-CsAynI3M.js";import"./Users03-DPYHJvoT.js";import"./use-virtual-mcp-BzFn2znu.js";import"./index-CERcQBYB.js";import"./circle-alert-W5iOrtbw.js";import"./index-Cw0Cq7G5.js";import"./X-CVoqpcAx.js";import"./collapsible-Ce6mH95q.js";import"./Code01-DORFegNP.js";import"./infiniteQueryObserver-qdoAkrLg.js";import"./localstorage-keys-Dt0DQ7_M.js";import"./useQuery-CC03be4X.js";import"./useMutation-DYyKBkRY.js";import"./popover-C9gpO_P1.js";import"./Grid01-CkZU0tWV.js";import"./Image01-CIkj8y0a.js";import"./SearchMd-D2POsGFy.js";import"./spinner-CaiollDD.js";import"./dialog-BPGYkE6E.js";import"./AlertCircle-ByS2S7QG.js";import"./ArrowUp-Pc2qwI_3.js";import"./Edit01-C_cfLeJc.js";import"./Copy01-U5Mrbyn4.js";import"./monaco-editor-Dv5Uv_CH.js";import"./use-create-virtual-mcp-CPQ3EWAe.js";import"./index-BxQtX61C.js";import"./DotsVertical-CDOXEsr8.js";import"./use-list-state-DDhTHJ9V.js";import"./use-mobile-D3kiHSC9.js";import"./empty-state-DI837doR.js";import"./Inbox01-8S74uH1Z.js";import"./avatar-Cr99ARr3.js";import"./alert-dialog-9PxNij5-.js";import"./List-4IPwuAX9.js";import"./view-mode-toggle-C2aKUr7i.js";import"./table-By59ASmK.js";import"./Pin01-dHyXwRhr.js";import"./use-organization-settings-Bnh92zjq.js";function Ve(t){const e=Q.c(42),{prompts:n,connectionId:s,org:r,connectionTitle:p,connectionIcon:d,onPromptClick:g,showToolbar:N,emptyMessage:A}=t,$=N===void 0?!0:N,I=A===void 0?"This connection doesn't have any prompts yet.":A,f=Y(),b=te().location.href,[x,a]=q.useState(""),[m,j]=q.useState("table"),[l,E]=q.useState("name"),[u,B]=q.useState("asc");let M;e[0]!==u||e[1]!==l?(M=h=>{l===h?(B(Oe),u==="desc"&&E(void 0)):(E(h),B("asc"))},e[0]=u,e[1]=l,e[2]=M):M=e[2];const S=M;let v;e[3]!==s||e[4]!==f||e[5]!==g||e[6]!==r?(v=h=>{g?g(h):s&&r&&f({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:s,collectionName:"prompts",itemId:encodeURIComponent(h.name)}})},e[3]=s,e[4]=f,e[5]=g,e[6]=r,e[7]=v):v=e[7];const L=v;let T;if(e[8]!==n||e[9]!==x||e[10]!==u||e[11]!==l){const h=!n||n.length===0?[]:x.trim()?(()=>{const z=x.toLowerCase();return n.filter(O=>O.name.toLowerCase().includes(z)||O.description&&O.description.toLowerCase().includes(z))})():n;T=!l||!u?h:[...h].sort((z,O)=>{const G=z[l]||"",W=O[l]||"",F=String(G).localeCompare(String(W));return u==="asc"?F:-F}),e[8]=n,e[9]=x,e[10]=u,e[11]=l,e[12]=T}else T=e[12];const _=T;let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=[{id:"name",header:"Name",render:De,sortable:!0},{id:"description",header:"Description",render:Be,cellClassName:"flex-1",sortable:!0}],e[13]=D):D=e[13];const c=D;let P;e[14]===Symbol.for("react.memo_cache_sentinel")?(P=c.filter(Ee).map(Ae),e[14]=P):P=e[14];const k=P;let y;e[15]!==d||e[16]!==p||e[17]!==S||e[18]!==$||e[19]!==u||e[20]!==l||e[21]!==b||e[22]!==m?(y=$&&o.jsxs(re,{children:[o.jsx(ce,{viewMode:m,onViewModeChange:j,sortKey:l,sortDirection:u,onSort:S,sortOptions:k}),o.jsx(le,{title:p?`${p}: Prompts`:"Prompts",url:b,icon:d??"description"})]}),e[15]=d,e[16]=p,e[17]=S,e[18]=$,e[19]=u,e[20]=l,e[21]=b,e[22]=m,e[23]=y):y=e[23];let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=h=>{h.key==="Escape"&&(a(""),h.target.blur())},e[24]=w):w=e[24];let C;e[25]!==x?(C=o.jsx(ae,{value:x,onChange:a,placeholder:"Search prompts...",onKeyDown:w}),e[25]=x,e[26]=C):C=e[26];let i;e[27]!==I||e[28]!==L||e[29]!==S||e[30]!==x||e[31]!==u||e[32]!==l||e[33]!==_||e[34]!==m?(i=m==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:_.length===0?o.jsx(H,{image:null,title:x?"No prompts found":"No prompts available",description:x?"Try adjusting your search terms":I}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:_.map(h=>o.jsx(me,{className:"cursor-pointer transition-colors",onClick:()=>L(h),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(oe,{icon:null,name:h.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h.description||"No description"})]})]})},h.name))})}):o.jsx(ie,{columns:c,data:_,isLoading:!1,sortKey:l,sortDirection:u,onSort:S,onRowClick:h=>L(h),emptyState:o.jsx(H,{image:null,title:x?"No prompts found":"No prompts available",description:x?"Try adjusting your search terms":I})}),e[27]=I,e[28]=L,e[29]=S,e[30]=x,e[31]=u,e[32]=l,e[33]=_,e[34]=m,e[35]=i):i=e[35];let V;e[36]!==C||e[37]!==i?(V=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[C,i]}),e[36]=C,e[37]=i,e[38]=V):V=e[38];let R;return e[39]!==V||e[40]!==y?(R=o.jsxs(o.Fragment,{children:[y,V]}),e[39]=V,e[40]=y,e[41]=R):R=e[41],R}function Ae(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ee(t){return t.sortable}function Be(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function De(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function Oe(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ue(t){const e=Q.c(6),{prompts:n,connectionId:s,org:r}=t,p=Z(s),d=p?.title,g=p?.icon;let N;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==d||e[4]!==g?(N=o.jsx(Ve,{prompts:n,connectionId:s,org:r,connectionTitle:d,connectionIcon:g}),e[0]=s,e[1]=r,e[2]=n,e[3]=d,e[4]=g,e[5]=N):N=e[5],N}function Ke(t){const e=Q.c(2),{repository:n}=t;let s;return e[0]!==n?(s=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Pe,{repository:n})}),e[0]=n,e[1]=s):s=e[1],s}function ze(t){const e=Q.c(39),{resources:n,connectionTitle:s,connectionIcon:r,onResourceClick:p,showToolbar:d,emptyMessage:g}=t,N=d===void 0?!0:d,A=g===void 0?"This connection doesn't have any resources yet.":g,I=te().location.href,[f,U]=q.useState(""),[b,x]=q.useState("table"),[a,m]=q.useState("name"),[j,l]=q.useState("asc");let E;e[0]!==j||e[1]!==a?(E=i=>{a===i?(l(Je),j==="desc"&&m(void 0)):(m(i),l("asc"))},e[0]=j,e[1]=a,e[2]=E):E=e[2];const u=E;let B;e[3]!==p?(B=i=>{p&&p(i)},e[3]=p,e[4]=B):B=e[4];const M=B;let S;if(e[5]!==n||e[6]!==f||e[7]!==j||e[8]!==a){const i=!n||n.length===0?[]:f.trim()?(()=>{const V=f.toLowerCase();return n.filter(R=>R.uri.toLowerCase().includes(V)||R.name&&R.name.toLowerCase().includes(V)||R.description&&R.description.toLowerCase().includes(V))})():n;S=!a||!j?i:[...i].sort((V,R)=>{const h=V[a]||"",z=R[a]||"",O=String(h).localeCompare(String(z));return j==="asc"?O:-O}),e[5]=n,e[6]=f,e[7]=j,e[8]=a,e[9]=S}else S=e[9];const v=S;let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=[{id:"name",header:"Name",render:He,sortable:!0},{id:"uri",header:"URI",render:Ge,sortable:!0},{id:"description",header:"Description",render:We,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Fe,sortable:!0}],e[10]=L):L=e[10];const T=L;let _;e[11]===Symbol.for("react.memo_cache_sentinel")?(_=T.filter(Qe).map(qe),e[11]=_):_=e[11];const D=_;let c;e[12]!==r||e[13]!==s||e[14]!==u||e[15]!==N||e[16]!==j||e[17]!==a||e[18]!==I||e[19]!==b?(c=N&&o.jsxs(re,{children:[o.jsx(ce,{viewMode:b,onViewModeChange:x,sortKey:a,sortDirection:j,onSort:u,sortOptions:D}),o.jsx(le,{title:s?`${s}: Resources`:"Resources",url:I,icon:r??"folder"})]}),e[12]=r,e[13]=s,e[14]=u,e[15]=N,e[16]=j,e[17]=a,e[18]=I,e[19]=b,e[20]=c):c=e[20];let P;e[21]===Symbol.for("react.memo_cache_sentinel")?(P=i=>{i.key==="Escape"&&(U(""),i.target.blur())},e[21]=P):P=e[21];let k;e[22]!==f?(k=o.jsx(ae,{value:f,onChange:U,placeholder:"Search resources...",onKeyDown:P}),e[22]=f,e[23]=k):k=e[23];let y;e[24]!==A||e[25]!==M||e[26]!==u||e[27]!==f||e[28]!==j||e[29]!==a||e[30]!==v||e[31]!==b?(y=b==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:v.length===0?o.jsx(H,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":A}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:v.map(i=>o.jsx(me,{className:"cursor-pointer transition-colors",onClick:()=>M(i),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(oe,{icon:null,name:i.name||i.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:i.name||i.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:i.uri}),i.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:i.description})]})]})},i.uri))})}):o.jsx(ie,{columns:T,data:v,isLoading:!1,sortKey:a,sortDirection:j,onSort:u,onRowClick:i=>M(i),emptyState:o.jsx(H,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":A})}),e[24]=A,e[25]=M,e[26]=u,e[27]=f,e[28]=j,e[29]=a,e[30]=v,e[31]=b,e[32]=y):y=e[32];let w;e[33]!==k||e[34]!==y?(w=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[k,y]}),e[33]=k,e[34]=y,e[35]=w):w=e[35];let C;return e[36]!==w||e[37]!==c?(C=o.jsxs(o.Fragment,{children:[c,w]}),e[36]=w,e[37]=c,e[38]=C):C=e[38],C}function qe(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Qe(t){return t.sortable}function Fe(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function We(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Ge(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function He(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Je(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Xe(t){const e=Q.c(6),{resources:n,connectionId:s,org:r}=t,p=Z(s),d=p?.title,g=p?.icon;let N;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==d||e[4]!==g?(N=o.jsx(ze,{resources:n,connectionId:s,org:r,connectionTitle:d,connectionIcon:g}),e[0]=s,e[1]=r,e[2]=n,e[3]=d,e[4]=g,e[5]=N):N=e[5],N}function Ye(t){const e=Q.c(5),{tools:n,connectionId:s,org:r,isLoading:p}=t;let d;return e[0]!==s||e[1]!==p||e[2]!==r||e[3]!==n?(d=o.jsx(Me,{tools:n,connectionId:s,org:r,isLoading:p}),e[0]=s,e[1]=p,e[2]=r,e[3]=n,e[4]=d):d=e[4],d}function Ze(t){const e=Q.c(72),{connection:n,connectionId:s,org:r,requestedTabId:p,collections:d,onUpdate:g,isUpdating:N,prompts:A,resources:$,tools:I,isLoadingTools:f}=t;let U;e[0]===Symbol.for("react.memo_cache_sentinel")?(U={from:"/$org/mcps/$connectionId"},e[0]=U):U=e[0];const b=Y(U);let x;e[1]!==s?(x={connectionId:s},e[1]=s,e[2]=x):x=e[2];const a=xe(x),m=a.isAuthenticated,j=n?.metadata?.repository,l=!!j?.url,E=I.length,u=A.length,B=$.length,M=E>0||f;let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S={id:"settings",label:"Settings"},e[3]=S):S=e[3];let v;e[4]!==f||e[5]!==m||e[6]!==M||e[7]!==E?(v=m&&M?[{id:"tools",label:"Tools",count:f?void 0:E}]:[],e[4]=f,e[5]=m,e[6]=M,e[7]=E,e[8]=v):v=e[8];let L;e[9]!==m||e[10]!==u?(L=m&&u>0?[{id:"prompts",label:"Prompts",count:u}]:[],e[9]=m,e[10]=u,e[11]=L):L=e[11];let T;e[12]!==m||e[13]!==B?(T=m&&B>0?[{id:"resources",label:"Resources",count:B}]:[],e[12]=m,e[13]=B,e[14]=T):T=e[14];let _;if(e[15]!==d||e[16]!==l||e[17]!==m||e[18]!==v||e[19]!==L||e[20]!==T){let K;e[22]!==l?(K=l?[{id:"readme",label:"README"}]:[],e[22]=l,e[23]=K):K=e[23],_=[S,...v,...L,...T,...m?(d||[]).map(et):[],...K],e[15]=d,e[16]=l,e[17]=m,e[18]=v,e[19]=L,e[20]=T,e[21]=_}else _=e[21];const D=_,c=D.some(K=>K.id===p)?p:"settings";let P;e[24]!==b?(P=K=>{b({search:X=>({...X,tab:K}),replace:!0})},e[24]=b,e[25]=P):P=e[25];const k=P;let y;e[26]!==d?(y=d||[],e[26]=d,e[27]=y):y=e[27];let w;if(e[28]!==c||e[29]!==y){let K;e[31]!==c?(K=X=>X.name===c,e[31]=c,e[32]=K):K=e[32],w=y.find(K),e[28]=c,e[29]=y,e[30]=w}else w=e[30];const C=w;let i;e[33]!==r?(i=o.jsx(ee,{children:o.jsx(je,{asChild:!0,children:o.jsx(fe,{to:"/$org/mcps",params:{org:r},children:"Connections"})})}),e[33]=r,e[34]=i):i=e[34];let V;e[35]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(ye,{}),e[35]=V):V=e[35];let R;e[36]!==n.title?(R=o.jsx(ee,{children:o.jsx(be,{children:n.title})}),e[36]=n.title,e[37]=R):R=e[37];let h;e[38]!==i||e[39]!==R?(h=o.jsx(Se,{children:o.jsxs(Ce,{children:[i,V,R]})}),e[38]=i,e[39]=R,e[40]=h):h=e[40];const z=h;let O;e[41]!==c||e[42]!==k||e[43]!==D?(O=o.jsx(_e,{children:o.jsx(Le,{tabs:D,activeTab:c,onTabChange:k})}),e[41]=c,e[42]=k,e[43]=D,e[44]=O):O=e[44];let G;e[45]===Symbol.for("react.memo_cache_sentinel")?(G=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ne,{size:32,className:"animate-spin text-muted-foreground"})}),e[45]=G):G=e[45];let W;e[46]!==C||e[47]!==c||e[48]!==a.hasOAuthToken||e[49]!==a.isServerError||e[50]!==a.supportsOAuth||e[51]!==n||e[52]!==s||e[53]!==k||e[54]!==l||e[55]!==f||e[56]!==m||e[57]!==N||e[58]!==g||e[59]!==r||e[60]!==A||e[61]!==j||e[62]!==$||e[63]!==I?(W=o.jsx(q.Suspense,{fallback:G,children:c==="tools"?o.jsx(Ye,{tools:I,connectionId:s,org:r,isLoading:f}):c==="prompts"?o.jsx(Ue,{prompts:A,connectionId:s,org:r}):c==="resources"?o.jsx(Xe,{resources:$,connectionId:s,org:r}):c==="settings"?o.jsx(ge,{connection:n,onUpdate:g,isUpdating:N,isMCPAuthenticated:m,supportsOAuth:a.supportsOAuth,hasOAuthToken:a.hasOAuthToken,isServerError:a.isServerError,onViewReadme:l?()=>k("readme"):void 0}):c==="readme"&&l?o.jsx(Ke,{repository:j}):C&&m?o.jsx(Re,{connectionId:s,org:r,activeCollection:C},c):o.jsx(H,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[46]=C,e[47]=c,e[48]=a.hasOAuthToken,e[49]=a.isServerError,e[50]=a.supportsOAuth,e[51]=n,e[52]=s,e[53]=k,e[54]=l,e[55]=f,e[56]=m,e[57]=N,e[58]=g,e[59]=r,e[60]=A,e[61]=j,e[62]=$,e[63]=I,e[64]=W):W=e[64];let F;e[65]!==c||e[66]!==W?(F=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(se,{children:W},c)})}),e[65]=c,e[66]=W,e[67]=F):F=e[67];let J;return e[68]!==z||e[69]!==O||e[70]!==F?(J=o.jsxs(ke,{breadcrumb:z,children:[O,F]}),e[68]=z,e[69]=O,e[70]=F,e[71]=J):J=e[71],J}function et(t){return{id:t.name,label:t.displayName}}function tt(){const t=Q.c(43);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const n=Y(e);let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId"},t[1]=s):s=t[1];const{connectionId:r,org:p}=de(s),{org:d}=ue();let g;t[2]===Symbol.for("react.memo_cache_sentinel")?(g={from:"/shell/$org/mcps/$connectionId"},t[2]=g):g=t[2];const A=pe(g).tab||"settings",$=Z(r),I=Ne(),f=he($??void 0);let U;t[3]!==r||t[4]!==d.id?(U={connectionId:r,orgId:d.id},t[3]=r,t[4]=d.id,t[5]=U):U=t[5];const b=Te(U);let x;t[6]!==b?(x={client:b},t[6]=b,t[7]=x):x=t[7];const{data:a}=we(x);let m;t[8]!==b?(m={client:b},t[8]=b,t[9]=m):m=t[9];const{data:j}=$e(m),l=$?.tools&&$.tools.length>0,E=!l;let u;t[10]!==b||t[11]!==E?(u={client:b,enabled:E},t[10]=b,t[11]=E,t[12]=u):u=t[12];const{data:B,isLoading:M}=ve(u);let S;t[13]!==a?.prompts?(S=a?.prompts??[],t[13]=a?.prompts,t[14]=S):S=t[14];let v;t[15]!==S?(v=S.map(nt),t[15]=S,t[16]=v):v=t[16];const L=v;let T;t[17]!==j?.resources?(T=j?.resources??[],t[17]=j?.resources,t[18]=T):T=t[18];let _;t[19]!==T?(_=T.map(st),t[19]=T,t[20]=_):_=t[20];const D=_;let c;t[21]!==$||t[22]!==l||t[23]!==B?.tools?(c=l?$.tools??[]:(B?.tools??[]).map(ot),t[21]=$,t[22]=l,t[23]=B?.tools,t[24]=c):c=t[24];const P=c;let k;t[25]!==I.update||t[26]!==r?(k=async C=>{await I.update.mutateAsync({id:r,data:C})},t[25]=I.update,t[26]=r,t[27]=k):k=t[27];const y=k;if(!$){let C;return t[28]!==n||t[29]!==p?(C=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(H,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(Ie,{variant:"outline",onClick:()=>n({to:"/$org/mcps",params:{org:p}}),children:"Back to connections"})})}),t[28]=n,t[29]=p,t[30]=C):C=t[30],C}let w;return t[31]!==I.update.isPending||t[32]!==f||t[33]!==$||t[34]!==r||t[35]!==y||t[36]!==M||t[37]!==p||t[38]!==L||t[39]!==A||t[40]!==D||t[41]!==P?(w=o.jsx(Ze,{org:p,connection:$,connectionId:r,requestedTabId:A,collections:f,onUpdate:y,isUpdating:I.update.isPending,prompts:L,resources:D,tools:P,isLoadingTools:M}),t[31]=I.update.isPending,t[32]=f,t[33]=$,t[34]=r,t[35]=y,t[36]=M,t[37]=p,t[38]=L,t[39]=A,t[40]=D,t[41]=P,t[42]=w):w=t[42],w}function ot(t){return{name:t.name,description:t.description,inputSchema:t.inputSchema}}function st(t){return{uri:t.uri,name:t.name,description:t.description}}function nt(t){return{name:t.name,description:t.description}}function rt(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(se,{children:o.jsx(q.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(ne,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(tt,{})})}),t[0]=e):e=t[0],e}function Ro(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(rt,{}),t[0]=e):e=t[0],e}export{Ro as default};
|
|
1
|
+
import{c as Q,j as o,l as Y,b6 as te,r as q,a as de,u as ue,f as pe,q as fe}from"./index-yjsBu7QA.js";import{E as H,I as oe}from"./empty-state-CpRLw49r.js";import{E as se}from"./error-boundary-DQ5uRgdY.js";import{b as he}from"./use-binding-CNR8kDE7.js";import{u as xe,S as ge}from"./index-CsOz92iP.js";import{b as ee,c as be,d as je,e as ye,B as Se,a as Ce}from"./breadcrumb-BuFIEIOz.js";import{g as ve}from"./use-collections-Hp9XPnUY.js";import{u as Z,a as Ne}from"./use-connection-Dj100t8H.js";import{u as Te}from"./constants-Cpe-c81c.js";import{b as we,d as $e}from"./use-mcp-prompts-SKr2e7l0.js";import{B as Ie}from"./button-BNRw8VbO.js";import{R as Le}from"./resource-tabs-CE-63rPp.js";import{i as ne}from"./Loading01-D8raUT2q.js";import{V as re,a as _e,b as ke}from"./layout-D8G7uVC8.js";import{C as Re}from"./collection-tab-DxItkIfa.js";import{a as ie,C as ce}from"./collection-table-wrapper-igJ5OqPc.js";import{C as ae}from"./collection-search-D5gi0-bL.js";import{P as le}from"./pin-to-sidebar-button-qPJJKT8U.js";import{C as me}from"./card-B2_21gZH.js";import{R as Pe,T as Me}from"./tools-list-gkMtCYZf.js";import"./binder-CwgOa4SG.js";import"./mcp-oauth-l77m3IWF.js";import"./env-vars-editor-0JsZHlg0.js";import"./input-C-GM7dsu.js";import"./Plus-BcqTpnxy.js";import"./Trash01-CR6s5yrj.js";import"./File06-2dtWfDa_.js";import"./Key01-DFKkR5uc.js";import"./index-BhNLW4h1.js";import"./badge-D19NcG12.js";import"./dropdown-menu-CsYNL9oo.js";import"./ChevronRight-BB2YL4K4.js";import"./form-DAoJifFq.js";import"./select-B4SPtD5h.js";import"./Check-lN7sUZo8.js";import"./ChevronDown-En_P43wp.js";import"./extract-connection-data-B6LHMHtn.js";import"./constants-gYpJq1UH.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-BNFgymSf.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-BOgtpg9n.js";import"./Users03-CCWN1VQn.js";import"./use-virtual-mcp-XGRCLjSr.js";import"./index-DJLvIq1X.js";import"./circle-alert-DepalnIB.js";import"./index-Bos_CuhY.js";import"./X-BsLffR19.js";import"./collapsible-Dg-5RnYq.js";import"./Code01-Dgx2dgXr.js";import"./infiniteQueryObserver-D_8FFQdU.js";import"./localstorage-keys-C_mtBNzA.js";import"./useQuery-C5RIveiE.js";import"./useMutation-VOj1VEf8.js";import"./popover-u_i609j_.js";import"./Grid01-DHptyetH.js";import"./Image01-CILGPgam.js";import"./SearchMd-DVuLBPJW.js";import"./spinner-Duo6KesX.js";import"./dialog-Csoqe4hG.js";import"./AlertCircle-B7sqll3Z.js";import"./ArrowUp-D8YYlj5b.js";import"./Edit01-C_JM_ANM.js";import"./Copy01-daHVbD8K.js";import"./monaco-editor-p_EFt-aT.js";import"./use-create-virtual-mcp-B01dvSQa.js";import"./index-P_cUV9l9.js";import"./DotsVertical-D1ZY49Um.js";import"./use-list-state-DsM4HMGd.js";import"./use-mobile-CS2zVR4m.js";import"./empty-state-Cn1CRUZO.js";import"./Inbox01-BTvTBHN2.js";import"./avatar-B6WhQiHI.js";import"./alert-dialog-BYFUia7V.js";import"./List-Dl-Bi1Os.js";import"./view-mode-toggle-zGyN0eoT.js";import"./table-NP0FOAI5.js";import"./Pin01-C3nTzsY2.js";import"./use-organization-settings-ClYOYczD.js";function Ve(t){const e=Q.c(42),{prompts:n,connectionId:s,org:r,connectionTitle:p,connectionIcon:d,onPromptClick:g,showToolbar:N,emptyMessage:A}=t,$=N===void 0?!0:N,I=A===void 0?"This connection doesn't have any prompts yet.":A,f=Y(),b=te().location.href,[x,a]=q.useState(""),[m,j]=q.useState("table"),[l,E]=q.useState("name"),[u,B]=q.useState("asc");let M;e[0]!==u||e[1]!==l?(M=h=>{l===h?(B(Oe),u==="desc"&&E(void 0)):(E(h),B("asc"))},e[0]=u,e[1]=l,e[2]=M):M=e[2];const S=M;let v;e[3]!==s||e[4]!==f||e[5]!==g||e[6]!==r?(v=h=>{g?g(h):s&&r&&f({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:s,collectionName:"prompts",itemId:encodeURIComponent(h.name)}})},e[3]=s,e[4]=f,e[5]=g,e[6]=r,e[7]=v):v=e[7];const L=v;let T;if(e[8]!==n||e[9]!==x||e[10]!==u||e[11]!==l){const h=!n||n.length===0?[]:x.trim()?(()=>{const z=x.toLowerCase();return n.filter(O=>O.name.toLowerCase().includes(z)||O.description&&O.description.toLowerCase().includes(z))})():n;T=!l||!u?h:[...h].sort((z,O)=>{const G=z[l]||"",W=O[l]||"",F=String(G).localeCompare(String(W));return u==="asc"?F:-F}),e[8]=n,e[9]=x,e[10]=u,e[11]=l,e[12]=T}else T=e[12];const _=T;let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=[{id:"name",header:"Name",render:De,sortable:!0},{id:"description",header:"Description",render:Be,cellClassName:"flex-1",sortable:!0}],e[13]=D):D=e[13];const c=D;let P;e[14]===Symbol.for("react.memo_cache_sentinel")?(P=c.filter(Ee).map(Ae),e[14]=P):P=e[14];const k=P;let y;e[15]!==d||e[16]!==p||e[17]!==S||e[18]!==$||e[19]!==u||e[20]!==l||e[21]!==b||e[22]!==m?(y=$&&o.jsxs(re,{children:[o.jsx(ce,{viewMode:m,onViewModeChange:j,sortKey:l,sortDirection:u,onSort:S,sortOptions:k}),o.jsx(le,{title:p?`${p}: Prompts`:"Prompts",url:b,icon:d??"description"})]}),e[15]=d,e[16]=p,e[17]=S,e[18]=$,e[19]=u,e[20]=l,e[21]=b,e[22]=m,e[23]=y):y=e[23];let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=h=>{h.key==="Escape"&&(a(""),h.target.blur())},e[24]=w):w=e[24];let C;e[25]!==x?(C=o.jsx(ae,{value:x,onChange:a,placeholder:"Search prompts...",onKeyDown:w}),e[25]=x,e[26]=C):C=e[26];let i;e[27]!==I||e[28]!==L||e[29]!==S||e[30]!==x||e[31]!==u||e[32]!==l||e[33]!==_||e[34]!==m?(i=m==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:_.length===0?o.jsx(H,{image:null,title:x?"No prompts found":"No prompts available",description:x?"Try adjusting your search terms":I}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:_.map(h=>o.jsx(me,{className:"cursor-pointer transition-colors",onClick:()=>L(h),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(oe,{icon:null,name:h.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h.description||"No description"})]})]})},h.name))})}):o.jsx(ie,{columns:c,data:_,isLoading:!1,sortKey:l,sortDirection:u,onSort:S,onRowClick:h=>L(h),emptyState:o.jsx(H,{image:null,title:x?"No prompts found":"No prompts available",description:x?"Try adjusting your search terms":I})}),e[27]=I,e[28]=L,e[29]=S,e[30]=x,e[31]=u,e[32]=l,e[33]=_,e[34]=m,e[35]=i):i=e[35];let V;e[36]!==C||e[37]!==i?(V=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[C,i]}),e[36]=C,e[37]=i,e[38]=V):V=e[38];let R;return e[39]!==V||e[40]!==y?(R=o.jsxs(o.Fragment,{children:[y,V]}),e[39]=V,e[40]=y,e[41]=R):R=e[41],R}function Ae(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ee(t){return t.sortable}function Be(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function De(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function Oe(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ue(t){const e=Q.c(6),{prompts:n,connectionId:s,org:r}=t,p=Z(s),d=p?.title,g=p?.icon;let N;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==d||e[4]!==g?(N=o.jsx(Ve,{prompts:n,connectionId:s,org:r,connectionTitle:d,connectionIcon:g}),e[0]=s,e[1]=r,e[2]=n,e[3]=d,e[4]=g,e[5]=N):N=e[5],N}function Ke(t){const e=Q.c(2),{repository:n}=t;let s;return e[0]!==n?(s=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Pe,{repository:n})}),e[0]=n,e[1]=s):s=e[1],s}function ze(t){const e=Q.c(39),{resources:n,connectionTitle:s,connectionIcon:r,onResourceClick:p,showToolbar:d,emptyMessage:g}=t,N=d===void 0?!0:d,A=g===void 0?"This connection doesn't have any resources yet.":g,I=te().location.href,[f,U]=q.useState(""),[b,x]=q.useState("table"),[a,m]=q.useState("name"),[j,l]=q.useState("asc");let E;e[0]!==j||e[1]!==a?(E=i=>{a===i?(l(Je),j==="desc"&&m(void 0)):(m(i),l("asc"))},e[0]=j,e[1]=a,e[2]=E):E=e[2];const u=E;let B;e[3]!==p?(B=i=>{p&&p(i)},e[3]=p,e[4]=B):B=e[4];const M=B;let S;if(e[5]!==n||e[6]!==f||e[7]!==j||e[8]!==a){const i=!n||n.length===0?[]:f.trim()?(()=>{const V=f.toLowerCase();return n.filter(R=>R.uri.toLowerCase().includes(V)||R.name&&R.name.toLowerCase().includes(V)||R.description&&R.description.toLowerCase().includes(V))})():n;S=!a||!j?i:[...i].sort((V,R)=>{const h=V[a]||"",z=R[a]||"",O=String(h).localeCompare(String(z));return j==="asc"?O:-O}),e[5]=n,e[6]=f,e[7]=j,e[8]=a,e[9]=S}else S=e[9];const v=S;let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=[{id:"name",header:"Name",render:He,sortable:!0},{id:"uri",header:"URI",render:Ge,sortable:!0},{id:"description",header:"Description",render:We,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Fe,sortable:!0}],e[10]=L):L=e[10];const T=L;let _;e[11]===Symbol.for("react.memo_cache_sentinel")?(_=T.filter(Qe).map(qe),e[11]=_):_=e[11];const D=_;let c;e[12]!==r||e[13]!==s||e[14]!==u||e[15]!==N||e[16]!==j||e[17]!==a||e[18]!==I||e[19]!==b?(c=N&&o.jsxs(re,{children:[o.jsx(ce,{viewMode:b,onViewModeChange:x,sortKey:a,sortDirection:j,onSort:u,sortOptions:D}),o.jsx(le,{title:s?`${s}: Resources`:"Resources",url:I,icon:r??"folder"})]}),e[12]=r,e[13]=s,e[14]=u,e[15]=N,e[16]=j,e[17]=a,e[18]=I,e[19]=b,e[20]=c):c=e[20];let P;e[21]===Symbol.for("react.memo_cache_sentinel")?(P=i=>{i.key==="Escape"&&(U(""),i.target.blur())},e[21]=P):P=e[21];let k;e[22]!==f?(k=o.jsx(ae,{value:f,onChange:U,placeholder:"Search resources...",onKeyDown:P}),e[22]=f,e[23]=k):k=e[23];let y;e[24]!==A||e[25]!==M||e[26]!==u||e[27]!==f||e[28]!==j||e[29]!==a||e[30]!==v||e[31]!==b?(y=b==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:v.length===0?o.jsx(H,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":A}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:v.map(i=>o.jsx(me,{className:"cursor-pointer transition-colors",onClick:()=>M(i),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(oe,{icon:null,name:i.name||i.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:i.name||i.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:i.uri}),i.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:i.description})]})]})},i.uri))})}):o.jsx(ie,{columns:T,data:v,isLoading:!1,sortKey:a,sortDirection:j,onSort:u,onRowClick:i=>M(i),emptyState:o.jsx(H,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":A})}),e[24]=A,e[25]=M,e[26]=u,e[27]=f,e[28]=j,e[29]=a,e[30]=v,e[31]=b,e[32]=y):y=e[32];let w;e[33]!==k||e[34]!==y?(w=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[k,y]}),e[33]=k,e[34]=y,e[35]=w):w=e[35];let C;return e[36]!==w||e[37]!==c?(C=o.jsxs(o.Fragment,{children:[c,w]}),e[36]=w,e[37]=c,e[38]=C):C=e[38],C}function qe(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Qe(t){return t.sortable}function Fe(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function We(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Ge(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function He(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Je(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Xe(t){const e=Q.c(6),{resources:n,connectionId:s,org:r}=t,p=Z(s),d=p?.title,g=p?.icon;let N;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==d||e[4]!==g?(N=o.jsx(ze,{resources:n,connectionId:s,org:r,connectionTitle:d,connectionIcon:g}),e[0]=s,e[1]=r,e[2]=n,e[3]=d,e[4]=g,e[5]=N):N=e[5],N}function Ye(t){const e=Q.c(5),{tools:n,connectionId:s,org:r,isLoading:p}=t;let d;return e[0]!==s||e[1]!==p||e[2]!==r||e[3]!==n?(d=o.jsx(Me,{tools:n,connectionId:s,org:r,isLoading:p}),e[0]=s,e[1]=p,e[2]=r,e[3]=n,e[4]=d):d=e[4],d}function Ze(t){const e=Q.c(72),{connection:n,connectionId:s,org:r,requestedTabId:p,collections:d,onUpdate:g,isUpdating:N,prompts:A,resources:$,tools:I,isLoadingTools:f}=t;let U;e[0]===Symbol.for("react.memo_cache_sentinel")?(U={from:"/$org/mcps/$connectionId"},e[0]=U):U=e[0];const b=Y(U);let x;e[1]!==s?(x={connectionId:s},e[1]=s,e[2]=x):x=e[2];const a=xe(x),m=a.isAuthenticated,j=n?.metadata?.repository,l=!!j?.url,E=I.length,u=A.length,B=$.length,M=E>0||f;let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S={id:"settings",label:"Settings"},e[3]=S):S=e[3];let v;e[4]!==f||e[5]!==m||e[6]!==M||e[7]!==E?(v=m&&M?[{id:"tools",label:"Tools",count:f?void 0:E}]:[],e[4]=f,e[5]=m,e[6]=M,e[7]=E,e[8]=v):v=e[8];let L;e[9]!==m||e[10]!==u?(L=m&&u>0?[{id:"prompts",label:"Prompts",count:u}]:[],e[9]=m,e[10]=u,e[11]=L):L=e[11];let T;e[12]!==m||e[13]!==B?(T=m&&B>0?[{id:"resources",label:"Resources",count:B}]:[],e[12]=m,e[13]=B,e[14]=T):T=e[14];let _;if(e[15]!==d||e[16]!==l||e[17]!==m||e[18]!==v||e[19]!==L||e[20]!==T){let K;e[22]!==l?(K=l?[{id:"readme",label:"README"}]:[],e[22]=l,e[23]=K):K=e[23],_=[S,...v,...L,...T,...m?(d||[]).map(et):[],...K],e[15]=d,e[16]=l,e[17]=m,e[18]=v,e[19]=L,e[20]=T,e[21]=_}else _=e[21];const D=_,c=D.some(K=>K.id===p)?p:"settings";let P;e[24]!==b?(P=K=>{b({search:X=>({...X,tab:K}),replace:!0})},e[24]=b,e[25]=P):P=e[25];const k=P;let y;e[26]!==d?(y=d||[],e[26]=d,e[27]=y):y=e[27];let w;if(e[28]!==c||e[29]!==y){let K;e[31]!==c?(K=X=>X.name===c,e[31]=c,e[32]=K):K=e[32],w=y.find(K),e[28]=c,e[29]=y,e[30]=w}else w=e[30];const C=w;let i;e[33]!==r?(i=o.jsx(ee,{children:o.jsx(je,{asChild:!0,children:o.jsx(fe,{to:"/$org/mcps",params:{org:r},children:"Connections"})})}),e[33]=r,e[34]=i):i=e[34];let V;e[35]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(ye,{}),e[35]=V):V=e[35];let R;e[36]!==n.title?(R=o.jsx(ee,{children:o.jsx(be,{children:n.title})}),e[36]=n.title,e[37]=R):R=e[37];let h;e[38]!==i||e[39]!==R?(h=o.jsx(Se,{children:o.jsxs(Ce,{children:[i,V,R]})}),e[38]=i,e[39]=R,e[40]=h):h=e[40];const z=h;let O;e[41]!==c||e[42]!==k||e[43]!==D?(O=o.jsx(_e,{children:o.jsx(Le,{tabs:D,activeTab:c,onTabChange:k})}),e[41]=c,e[42]=k,e[43]=D,e[44]=O):O=e[44];let G;e[45]===Symbol.for("react.memo_cache_sentinel")?(G=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ne,{size:32,className:"animate-spin text-muted-foreground"})}),e[45]=G):G=e[45];let W;e[46]!==C||e[47]!==c||e[48]!==a.hasOAuthToken||e[49]!==a.isServerError||e[50]!==a.supportsOAuth||e[51]!==n||e[52]!==s||e[53]!==k||e[54]!==l||e[55]!==f||e[56]!==m||e[57]!==N||e[58]!==g||e[59]!==r||e[60]!==A||e[61]!==j||e[62]!==$||e[63]!==I?(W=o.jsx(q.Suspense,{fallback:G,children:c==="tools"?o.jsx(Ye,{tools:I,connectionId:s,org:r,isLoading:f}):c==="prompts"?o.jsx(Ue,{prompts:A,connectionId:s,org:r}):c==="resources"?o.jsx(Xe,{resources:$,connectionId:s,org:r}):c==="settings"?o.jsx(ge,{connection:n,onUpdate:g,isUpdating:N,isMCPAuthenticated:m,supportsOAuth:a.supportsOAuth,hasOAuthToken:a.hasOAuthToken,isServerError:a.isServerError,onViewReadme:l?()=>k("readme"):void 0}):c==="readme"&&l?o.jsx(Ke,{repository:j}):C&&m?o.jsx(Re,{connectionId:s,org:r,activeCollection:C},c):o.jsx(H,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[46]=C,e[47]=c,e[48]=a.hasOAuthToken,e[49]=a.isServerError,e[50]=a.supportsOAuth,e[51]=n,e[52]=s,e[53]=k,e[54]=l,e[55]=f,e[56]=m,e[57]=N,e[58]=g,e[59]=r,e[60]=A,e[61]=j,e[62]=$,e[63]=I,e[64]=W):W=e[64];let F;e[65]!==c||e[66]!==W?(F=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(se,{children:W},c)})}),e[65]=c,e[66]=W,e[67]=F):F=e[67];let J;return e[68]!==z||e[69]!==O||e[70]!==F?(J=o.jsxs(ke,{breadcrumb:z,children:[O,F]}),e[68]=z,e[69]=O,e[70]=F,e[71]=J):J=e[71],J}function et(t){return{id:t.name,label:t.displayName}}function tt(){const t=Q.c(43);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const n=Y(e);let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId"},t[1]=s):s=t[1];const{connectionId:r,org:p}=de(s),{org:d}=ue();let g;t[2]===Symbol.for("react.memo_cache_sentinel")?(g={from:"/shell/$org/mcps/$connectionId"},t[2]=g):g=t[2];const A=pe(g).tab||"settings",$=Z(r),I=Ne(),f=he($??void 0);let U;t[3]!==r||t[4]!==d.id?(U={connectionId:r,orgId:d.id},t[3]=r,t[4]=d.id,t[5]=U):U=t[5];const b=Te(U);let x;t[6]!==b?(x={client:b},t[6]=b,t[7]=x):x=t[7];const{data:a}=we(x);let m;t[8]!==b?(m={client:b},t[8]=b,t[9]=m):m=t[9];const{data:j}=$e(m),l=$?.tools&&$.tools.length>0,E=!l;let u;t[10]!==b||t[11]!==E?(u={client:b,enabled:E},t[10]=b,t[11]=E,t[12]=u):u=t[12];const{data:B,isLoading:M}=ve(u);let S;t[13]!==a?.prompts?(S=a?.prompts??[],t[13]=a?.prompts,t[14]=S):S=t[14];let v;t[15]!==S?(v=S.map(nt),t[15]=S,t[16]=v):v=t[16];const L=v;let T;t[17]!==j?.resources?(T=j?.resources??[],t[17]=j?.resources,t[18]=T):T=t[18];let _;t[19]!==T?(_=T.map(st),t[19]=T,t[20]=_):_=t[20];const D=_;let c;t[21]!==$||t[22]!==l||t[23]!==B?.tools?(c=l?$.tools??[]:(B?.tools??[]).map(ot),t[21]=$,t[22]=l,t[23]=B?.tools,t[24]=c):c=t[24];const P=c;let k;t[25]!==I.update||t[26]!==r?(k=async C=>{await I.update.mutateAsync({id:r,data:C})},t[25]=I.update,t[26]=r,t[27]=k):k=t[27];const y=k;if(!$){let C;return t[28]!==n||t[29]!==p?(C=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(H,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(Ie,{variant:"outline",onClick:()=>n({to:"/$org/mcps",params:{org:p}}),children:"Back to connections"})})}),t[28]=n,t[29]=p,t[30]=C):C=t[30],C}let w;return t[31]!==I.update.isPending||t[32]!==f||t[33]!==$||t[34]!==r||t[35]!==y||t[36]!==M||t[37]!==p||t[38]!==L||t[39]!==A||t[40]!==D||t[41]!==P?(w=o.jsx(Ze,{org:p,connection:$,connectionId:r,requestedTabId:A,collections:f,onUpdate:y,isUpdating:I.update.isPending,prompts:L,resources:D,tools:P,isLoadingTools:M}),t[31]=I.update.isPending,t[32]=f,t[33]=$,t[34]=r,t[35]=y,t[36]=M,t[37]=p,t[38]=L,t[39]=A,t[40]=D,t[41]=P,t[42]=w):w=t[42],w}function ot(t){return{name:t.name,description:t.description,inputSchema:t.inputSchema}}function st(t){return{uri:t.uri,name:t.name,description:t.description}}function nt(t){return{name:t.name,description:t.description}}function rt(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(se,{children:o.jsx(q.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(ne,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(tt,{})})}),t[0]=e):e=t[0],e}function Ro(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(rt,{}),t[0]=e):e=t[0],e}export{Ro as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ge,j as e,r as z,u as je,l as fe,f as ye,g as ve,m as _e,k as Ce,h as ke,i as Ne,o as re,n as be,s as y,_ as Se}from"./index-DVqIQLTS.js";import{C as we,a as De}from"./collection-table-wrapper-CTuXfFv4.js";import{C as Pe}from"./collection-search-DozvRnxE.js";import{P as T}from"./index-BxQtX61C.js";import{B as Te,a as Ie,b as Ve,c as $e}from"./breadcrumb-DBCyZqWb.js";import{C as Ae}from"./connection-card-Bp0BNZom.js";import{n as H,E as O,I as Ee}from"./empty-state-Cuxzpiqy.js";import{E as Be}from"./error-boundary-UVoBd-EX.js";import{u as Fe}from"./use-binding-BKAkfTQP.js";import{u as He,s as J}from"./use-list-state-DDhTHJ9V.js";import{e as Oe}from"./use-collections-CidxL5e8.js";import{a as Me,b as ze}from"./use-connection-nBbiimhv.js";import{u as Re}from"./constants-nQTTOIWL.js";import{f as Ue,a as Le,b as Xe,c as We,d as Ke,e as Ge,A as qe,g as Ye}from"./alert-dialog-9PxNij5-.js";import{B as Qe}from"./badge-a9rJdKKG.js";import{B as _}from"./button-BB_m2E67.js";import{D as Je,a as Ze,b as et,c as tt,d as nt,e as st}from"./dialog-BPGYkE6E.js";import{D as Z,a as ee,b as te,c as A}from"./dropdown-menu-w3xNt286.js";import{a as ot,F as h,b as x,c as g,d as j,f}from"./form-CFGJ-U5C.js";import{i as ne}from"./DotsVertical-CDOXEsr8.js";import{f as rt,e as it,s as M}from"./registry-utils-COHLTguy.js";import{i as at}from"./Loading01-CCSRv8tX.js";import{i as ct}from"./Terminal-CsAynI3M.js";import{s as se}from"./Trash01-BdLDRPDl.js";import{I as k}from"./input-D53urYud.js";import{S as lt,a as dt,b as ut,c as mt,d as I}from"./select-DsmrYLOe.js";import{T as pt}from"./textarea-BB8VII1W.js";import{g as ht}from"./generate-id-Dyweu44Y.js";import{r as xt,E as gt,e as ie}from"./env-vars-editor-dEtMntyA.js";import"./ArrowUp-Pc2qwI_3.js";import"./Check-kOHUYBJY.js";import"./Grid01-CkZU0tWV.js";import"./List-4IPwuAX9.js";import"./view-mode-toggle-C2aKUr7i.js";import"./table-By59ASmK.js";import"./SearchMd-D2POsGFy.js";import"./ChevronRight-Cua3_Oqd.js";import"./card-DQu0Qiy4.js";import"./binder-BHtkW0UD.js";import"./use-mobile-D3kiHSC9.js";import"./useMutation-DYyKBkRY.js";import"./useQuery-CC03be4X.js";import"./X-CVoqpcAx.js";import"./ChevronDown-J2iKAqyZ.js";import"./Plus-B5QrRvCn.js";const jt=re({key:y(),value:y()}),ft=re({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:Se(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:be(jt).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 o=n.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function yt(n){const o=n.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const m=o.slice(1).find(a=>!a.startsWith("-"));return m?{packageName:m}:null}function E(n){const{uiType:o}=n,i=B(n.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="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 o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function oe(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const o=B(n.connectionUrl??"");if(!o)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>B(N.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",m=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:m}:null}function vt(n,o){const i={command:"npx",args:["-y",n]},d=ie(o);return Object.keys(d).length>0&&(i.envVars=d),i}function _t(n,o,i,d){const m={command:n};o.trim()&&(m.args=o.trim().split(/\s+/)),i?.trim()&&(m.cwd=i.trim());const a=ie(d);return Object.keys(a).length>0&&(m.envVars=a),m}function Ct(n){return n.command==="npx"}function kt(n){return n.args?.find(o=>!o.startsWith("-"))??""}function Nt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function bt(n,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"close":return{mode:"idle"}}}function St(){const{org:n}=je(),o=fe(),i=ye({strict:!1}),{data:d}=ve.useSession(),{stdioEnabled:m}=_e(),a=He({namespace:n.slug,resource:"connections"}),V=Me(),N=ze(a),[v,b]=z.useReducer(bt,{mode:"idle"}),R=Fe(N)[0],U=R?.id??"",L=rt(R?.tools),ae=Re({connectionId:U||null,orgId:n.id}),{data:ce}=Oe({client:ae,toolName:L,toolArguments:{limit:200},enabled:!!(U&&L),staleTime:3600*1e3,select:t=>t.structuredContent??t}),X=it(ce??[]),W=i.action==="create",le=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},K=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=Ce({resolver:ke(ft),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),G=r.watch("connection_url"),de=r.watch("npx_package"),D=E({uiType:u,connectionUrl:G??"",npxPackage:de??""})??oe({uiType:u,connectionUrl:G??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;z.useEffect(()=>{if(l){const t=Ne(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const s=xt(t.envVars);if(Ct(t)){const c=kt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const c=Nt(t);r.reset({title:l.title,description:l.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:s})}}else r.reset({title:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.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:[]})},[l,r]);const ue=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;b({type:"close"});try{await V.delete.mutateAsync(t)}catch{}},me=async t=>{let s,c=null,S=null,C=null;if(t.ui_type==="NPX"?(s="STDIO",c="",C=vt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(s="STDIO",c="",C=_t(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(s=t.ui_type,c=t.connection_url||"",S=t.connection_token||null),l){await V.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:s,connection_url:c,...S&&{connection_token:S},...C&&{connection_headers:C}}}),b({type:"close"}),r.reset();return}const w=ht("conn");await V.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:s,connection_url:c,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:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),K(),r.reset(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:w}})},q=t=>{t||(W?K():b({type:"close"}),r.reset())},$=t=>{const s=t.trim();if(!s)return;const c=!!r.formState.dirtyFields.title,S=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,w=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!S&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const Y=r.getValues("env_vars")??[],xe=new Set(Y.map(P=>P.key)),Q=p.envVarKeys.filter(P=>!xe.has(P));Q.length>0&&r.setValue("env_vars",[...Y,...Q.map(P=>({key:P,value:""}))],{shouldDirty:!0})}},F=yt(s);if(F&&m){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}),w(E({uiType:"NPX",npxPackage:F.packageName}));return}if(s.startsWith("http://")||s.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",s,{shouldDirty:!0}),w(E({uiType:p,connectionUrl:s})??oe({uiType:p,connectionUrl:s,registryItems:X}));return}u==="NPX"&&w(E({uiType:"NPX",npxPackage:s}))},pe=[{id:"icon",header:"",render:t=>e.jsx(Ee,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(H,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const s=t.connection_url??"",c=s.length>40?`${s.slice(0,40)}...`:s;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(Qe,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(Z,{children:[e.jsx(ee,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(ne,{size:20})})}),e.jsxs(te,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(A,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(J,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:s=>{s.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(se,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],he=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:le,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(T,{children:[e.jsx(Je,{open:W||v.mode==="editing",onOpenChange:q,children:e.jsxs(Ze,{className:"sm:max-w-[525px]",children:[e.jsxs(et,{children:[e.jsx(tt,{children:l?"Edit Connection":"Create Connection"}),e.jsx(nt,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ot,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(me),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(x,{children:[e.jsx(g,{children:"Type *"}),e.jsxs(lt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(dt,{children:e.jsx(ut,{})})}),e.jsxs(mt,{children:[e.jsx(I,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(I,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(I,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"Websocket"]})}),m&&e.jsxs(e.Fragment,{children:[e.jsx(I,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(I,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),$(c))},onBlur:s=>{$(s.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),u==="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(x,{children:[e.jsx(g,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Working Directory"}),e.jsx(j,{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(f,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(gt,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),$(c))},onBlur:s=>{$(s.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:D?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.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(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Description"}),e.jsx(j,{children:e.jsx(pt,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(st,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>q(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Ue,{open:v.mode==="deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(Le,{children:[e.jsxs(Xe,{children:[e.jsx(We,{children:"Delete Connection?"}),e.jsxs(Ke,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Ge,{children:[e.jsx(qe,{children:"Cancel"}),e.jsx(Ye,{onClick:ue,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsxs(T.Header,{children:[e.jsx(T.Header.Left,{children:e.jsx(Te,{children:e.jsx(Ie,{children:e.jsx(Ve,{children:e.jsx($e,{children:"Connections"})})})})}),e.jsxs(T.Header.Right,{children:[e.jsx(we,{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:"status",label:"Status"}]}),he]})]}),e.jsx(Pe,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),e.jsx(T.Content,{children:a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(O,{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(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),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(Ae,{connection:t,fallbackIcon:e.jsx(H,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(Z,{children:[e.jsx(ee,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(ne,{size:20})})}),e.jsxs(te,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(A,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(J,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:s=>{s.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(se,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx(De,{columns:pe,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(O,{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(O,{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(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})})})]})}function yn(){const n=ge.c(1);let o;return n[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(Be,{children:e.jsx(z.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(at,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(St,{})})}),n[0]=o):o=n[0],o}export{yn as default};
|
|
1
|
+
import{c as ge,j as e,r as z,u as je,l as fe,f as ye,g as ve,m as _e,k as Ce,h as ke,i as Ne,o as re,n as be,s as y,_ as Se}from"./index-yjsBu7QA.js";import{C as we,a as De}from"./collection-table-wrapper-igJ5OqPc.js";import{C as Pe}from"./collection-search-D5gi0-bL.js";import{P as T}from"./index-P_cUV9l9.js";import{B as Te,a as Ie,b as Ve,c as $e}from"./breadcrumb-BuFIEIOz.js";import{C as Ae}from"./connection-card-GHfjxhQ1.js";import{n as H,E as O,I as Ee}from"./empty-state-CpRLw49r.js";import{E as Be}from"./error-boundary-DQ5uRgdY.js";import{u as Fe}from"./use-binding-CNR8kDE7.js";import{u as He,s as J}from"./use-list-state-DsM4HMGd.js";import{e as Oe}from"./use-collections-Hp9XPnUY.js";import{a as Me,b as ze}from"./use-connection-Dj100t8H.js";import{u as Re}from"./constants-Cpe-c81c.js";import{f as Ue,a as Le,b as Xe,c as We,d as Ke,e as Ge,A as qe,g as Ye}from"./alert-dialog-BYFUia7V.js";import{B as Qe}from"./badge-D19NcG12.js";import{B as _}from"./button-BNRw8VbO.js";import{D as Je,a as Ze,b as et,c as tt,d as nt,e as st}from"./dialog-Csoqe4hG.js";import{D as Z,a as ee,b as te,c as A}from"./dropdown-menu-CsYNL9oo.js";import{a as ot,F as h,b as x,c as g,d as j,f}from"./form-DAoJifFq.js";import{i as ne}from"./DotsVertical-D1ZY49Um.js";import{f as rt,e as it,s as M}from"./registry-utils-BNFgymSf.js";import{i as at}from"./Loading01-D8raUT2q.js";import{i as ct}from"./Terminal-BOgtpg9n.js";import{s as se}from"./Trash01-CR6s5yrj.js";import{I as k}from"./input-C-GM7dsu.js";import{S as lt,a as dt,b as ut,c as mt,d as I}from"./select-B4SPtD5h.js";import{T as pt}from"./textarea-ByvgxbRE.js";import{g as ht}from"./generate-id-Dyweu44Y.js";import{r as xt,E as gt,e as ie}from"./env-vars-editor-0JsZHlg0.js";import"./ArrowUp-D8YYlj5b.js";import"./Check-lN7sUZo8.js";import"./Grid01-DHptyetH.js";import"./List-Dl-Bi1Os.js";import"./view-mode-toggle-zGyN0eoT.js";import"./table-NP0FOAI5.js";import"./SearchMd-DVuLBPJW.js";import"./ChevronRight-BB2YL4K4.js";import"./card-B2_21gZH.js";import"./binder-CwgOa4SG.js";import"./use-mobile-CS2zVR4m.js";import"./useMutation-VOj1VEf8.js";import"./useQuery-C5RIveiE.js";import"./X-BsLffR19.js";import"./ChevronDown-En_P43wp.js";import"./Plus-BcqTpnxy.js";const jt=re({key:y(),value:y()}),ft=re({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:Se(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:be(jt).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 o=n.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function yt(n){const o=n.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const m=o.slice(1).find(a=>!a.startsWith("-"));return m?{packageName:m}:null}function E(n){const{uiType:o}=n,i=B(n.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="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 o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function oe(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const o=B(n.connectionUrl??"");if(!o)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>B(N.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",m=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:m}:null}function vt(n,o){const i={command:"npx",args:["-y",n]},d=ie(o);return Object.keys(d).length>0&&(i.envVars=d),i}function _t(n,o,i,d){const m={command:n};o.trim()&&(m.args=o.trim().split(/\s+/)),i?.trim()&&(m.cwd=i.trim());const a=ie(d);return Object.keys(a).length>0&&(m.envVars=a),m}function Ct(n){return n.command==="npx"}function kt(n){return n.args?.find(o=>!o.startsWith("-"))??""}function Nt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function bt(n,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"close":return{mode:"idle"}}}function St(){const{org:n}=je(),o=fe(),i=ye({strict:!1}),{data:d}=ve.useSession(),{stdioEnabled:m}=_e(),a=He({namespace:n.slug,resource:"connections"}),V=Me(),N=ze(a),[v,b]=z.useReducer(bt,{mode:"idle"}),R=Fe(N)[0],U=R?.id??"",L=rt(R?.tools),ae=Re({connectionId:U||null,orgId:n.id}),{data:ce}=Oe({client:ae,toolName:L,toolArguments:{limit:200},enabled:!!(U&&L),staleTime:3600*1e3,select:t=>t.structuredContent??t}),X=it(ce??[]),W=i.action==="create",le=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},K=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=Ce({resolver:ke(ft),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),G=r.watch("connection_url"),de=r.watch("npx_package"),D=E({uiType:u,connectionUrl:G??"",npxPackage:de??""})??oe({uiType:u,connectionUrl:G??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;z.useEffect(()=>{if(l){const t=Ne(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const s=xt(t.envVars);if(Ct(t)){const c=kt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const c=Nt(t);r.reset({title:l.title,description:l.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:s})}}else r.reset({title:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.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:[]})},[l,r]);const ue=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;b({type:"close"});try{await V.delete.mutateAsync(t)}catch{}},me=async t=>{let s,c=null,S=null,C=null;if(t.ui_type==="NPX"?(s="STDIO",c="",C=vt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(s="STDIO",c="",C=_t(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(s=t.ui_type,c=t.connection_url||"",S=t.connection_token||null),l){await V.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:s,connection_url:c,...S&&{connection_token:S},...C&&{connection_headers:C}}}),b({type:"close"}),r.reset();return}const w=ht("conn");await V.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:s,connection_url:c,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:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),K(),r.reset(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:w}})},q=t=>{t||(W?K():b({type:"close"}),r.reset())},$=t=>{const s=t.trim();if(!s)return;const c=!!r.formState.dirtyFields.title,S=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,w=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!S&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const Y=r.getValues("env_vars")??[],xe=new Set(Y.map(P=>P.key)),Q=p.envVarKeys.filter(P=>!xe.has(P));Q.length>0&&r.setValue("env_vars",[...Y,...Q.map(P=>({key:P,value:""}))],{shouldDirty:!0})}},F=yt(s);if(F&&m){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}),w(E({uiType:"NPX",npxPackage:F.packageName}));return}if(s.startsWith("http://")||s.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",s,{shouldDirty:!0}),w(E({uiType:p,connectionUrl:s})??oe({uiType:p,connectionUrl:s,registryItems:X}));return}u==="NPX"&&w(E({uiType:"NPX",npxPackage:s}))},pe=[{id:"icon",header:"",render:t=>e.jsx(Ee,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(H,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const s=t.connection_url??"",c=s.length>40?`${s.slice(0,40)}...`:s;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(Qe,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(Z,{children:[e.jsx(ee,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(ne,{size:20})})}),e.jsxs(te,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(A,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(J,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:s=>{s.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(se,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],he=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:le,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(T,{children:[e.jsx(Je,{open:W||v.mode==="editing",onOpenChange:q,children:e.jsxs(Ze,{className:"sm:max-w-[525px]",children:[e.jsxs(et,{children:[e.jsx(tt,{children:l?"Edit Connection":"Create Connection"}),e.jsx(nt,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ot,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(me),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(x,{children:[e.jsx(g,{children:"Type *"}),e.jsxs(lt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(dt,{children:e.jsx(ut,{})})}),e.jsxs(mt,{children:[e.jsx(I,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(I,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(I,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-4 h-4"}),"Websocket"]})}),m&&e.jsxs(e.Fragment,{children:[e.jsx(I,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(I,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),$(c))},onBlur:s=>{$(s.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),u==="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(x,{children:[e.jsx(g,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Working Directory"}),e.jsx(j,{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(f,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(gt,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),$(c))},onBlur:s=>{$(s.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:D?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.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(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Description"}),e.jsx(j,{children:e.jsx(pt,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(st,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>q(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Ue,{open:v.mode==="deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(Le,{children:[e.jsxs(Xe,{children:[e.jsx(We,{children:"Delete Connection?"}),e.jsxs(Ke,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Ge,{children:[e.jsx(qe,{children:"Cancel"}),e.jsx(Ye,{onClick:ue,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsxs(T.Header,{children:[e.jsx(T.Header.Left,{children:e.jsx(Te,{children:e.jsx(Ie,{children:e.jsx(Ve,{children:e.jsx($e,{children:"Connections"})})})})}),e.jsxs(T.Header.Right,{children:[e.jsx(we,{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:"status",label:"Status"}]}),he]})]}),e.jsx(Pe,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),e.jsx(T.Content,{children:a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(O,{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(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),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(Ae,{connection:t,fallbackIcon:e.jsx(H,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(Z,{children:[e.jsx(ee,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(ne,{size:20})})}),e.jsxs(te,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(A,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(J,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:s=>{s.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(se,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx(De,{columns:pe,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(O,{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(O,{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(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})})})]})}function yn(){const n=ge.c(1);let o;return n[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(Be,{children:e.jsx(z.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(at,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(St,{})})}),n[0]=o):o=n[0],o}export{yn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b4 as d,c as g,x as f,b5 as h}from"./index-
|
|
1
|
+
import{b4 as d,c as g,x as f,b5 as h}from"./index-yjsBu7QA.js";const u={authConfig:()=>["authConfig"],threads:t=>["threads",t],virtualMcpThreads:(t,e)=>["threads",t,"virtual-mcp",e],thread:(t,e)=>["thread",t,e],threadMessages:(t,e)=>["thread-messages",t,e],messages:t=>["messages",t],organizations:()=>["organizations"],members:t=>[t,"members"],invitations:t=>[t,"invitations"],organizationRoles:t=>[t,"organization-roles"],connections:t=>[t,"connections"],connectionsByBinding:(t,e)=>[t,"connections",`binding:${e}`],connection:(t,e)=>[t,"connection",e],isMCPAuthenticated:(t,e)=>["is-mcp-authenticated",t,e],mcpTools:(t,e)=>["mcp","tools",t,e],mcpClient:(t,e,n,o)=>["mcp","client",t,e,n,o],mcpToolsList:t=>["mcp","client",t,"tools"],mcpResourcesList:t=>["mcp","client",t,"resources"],mcpPromptsList:t=>["mcp","client",t,"prompts"],mcpReadResource:(t,e)=>["mcp","client",t,"resource",e],mcpGetPrompt:(t,e,n)=>["mcp","client",t,"prompt",e,n],mcpToolCall:(t,e,n)=>["mcp","client",t,"tool-call",e,n],organizationSettings:t=>["organization-settings",t],activeOrganization:t=>["activeOrganization",t],modelsList:t=>["models-list",t],connectionCollections:t=>[t,"collections","discovery"],toolCall:(t,e,n)=>["tool-call",t,e,n],collectionItems:(t,e)=>["collection",t,e],collection:(t,e,n)=>[t,e,"collection",n],collectionItem:(t,e,n,o,i)=>[t,e,n,"collection",o,i],collectionList:(t,e,n,o,i)=>[t,e,n,"collection",o,"list",i],collectionListInfinite:(t,e,n,o,i)=>[t,e,n,"collection",o,"list-infinite",i],githubReadme:(t,e)=>["github-readme",t,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:t=>["monitoring","logs",t],monitoringLogsInfinite:(t,e)=>["monitoring","logs-infinite",t,e],virtualMcpPrompts:t=>["virtual-mcp",t,"prompts"],connectionPrompts:t=>["connection",t,"prompts"],connectionResources:t=>["connection",t,"resources"],user:t=>["user",t]};class _ extends d{constructor(e,n){super(e,n)}send(e,n){const o=y(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function y(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const n=e?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const b={name:"mesh-sdk",version:"1.0.0"};function C(t,e){const n=e??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=t?`/mcp/${t}`:"/mcp";return new URL(o,n).href}async function T({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=C(t,o),c=new h(b,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),s=new _(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":e,...n?{Authorization:`Bearer ${n}`}:{}}}});await c.connect(s);const r=u.mcpClient(e,t??"self",n??"",o??"");return c.toJSON=()=>`mcp-client:${r.join(":")}`,c}function S(t){const e=g.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let s;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(s=u.mcpClient(o,n??"",i??"",c??""),e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=s):s=e[4];const r=s;let a;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(a=()=>T({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=a):a=e[9];let l;e[10]!==r||e[11]!==a?(l={queryKey:r,queryFn:a,staleTime:1/0,gcTime:0},e[10]=r,e[11]=a,e[12]=l):l=e[12];const{data:m}=f(l);return m}const P={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},M="self";function R(t){return{id:P.REGISTRY(t),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function I(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function L(t={}){return{id:t.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://openrouter.ai/favicon.ico",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function D(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}function E(t){return{id:v(t),organization_id:t,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const p="decopilot_";function A(t){return!t||!t.startsWith(p)?null:t.slice(p.length)||null}function v(t){return`${p}${t}`}export{u as K,_ as S,P as W,M as a,I as b,T as c,E as d,D as e,L as f,v as g,R as h,A as i,S as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as t,J as a}from"./index-yjsBu7QA.js";const e=t(a,{target:"draft-7"});export{e as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as A,s as D,c as O,h as v,k as E,j as r,g as N}from"./index-
|
|
1
|
+
import{o as A,s as D,c as O,h as v,k as E,j as r,g as N}from"./index-yjsBu7QA.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as k}from"./alert-dialog-BYFUia7V.js";import{B}from"./button-BNRw8VbO.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-DAoJifFq.js";import{I as P}from"./input-C-GM7dsu.js";import{S as Q}from"./spinner-Duo6KesX.js";import{u as W}from"./useMutation-VOj1VEf8.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(B,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let h;e[26]!==d||e[27]!==g?(h=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=h):h=e[28];let S;e[29]!==h||e[30]!==n||e[31]!==m||e[32]!==c?(S=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,h]}),e[29]=h,e[30]=n,e[31]=m,e[32]=c,e[33]=S):S=e[33];let p;e[34]!==t||e[35]!==S?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:S})]}),e[34]=t,e[35]=S,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(k,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as i,R as u,z as m,T as x,D as j,B as N,E as D,F as b,G as g}from"./index-
|
|
1
|
+
import{c as n,j as i,R as u,z as m,T as x,D as j,B as N,E as D,F as b,G as g}from"./index-yjsBu7QA.js";import{i as h}from"./X-BsLffR19.js";import{c}from"./button-BNRw8VbO.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(D,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function R(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function F(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,R as a,B as b,F as c,O as d,E as e,w as f,T as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,j as i,M as p,Q as f,U as m,W as g,X as x,Y as v,Z as b,$ as w,a0 as h}from"./index-
|
|
1
|
+
import{c,j as i,M as p,Q as f,U as m,W as g,X as x,Y as v,Z as b,$ as w,a0 as h}from"./index-yjsBu7QA.js";import{i as j}from"./ChevronRight-BB2YL4K4.js";import{c as u}from"./button-BNRw8VbO.js";function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(v,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(b,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{M as D,S as a,$ as b,y as c,C as d,T as e,R as f,_ as g};
|
package/dist/client/assets/{dynamic-plugin-layout-DB7JIoTi.js → dynamic-plugin-layout-bKoth3Ne.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as _,a as S,g as E,j as t,aM as j,r as f,aN as b,c as L,t as P}from"./index-
|
|
1
|
+
import{u as _,a as S,g as E,j as t,aM as j,r as f,aN as b,c as L,t as P}from"./index-yjsBu7QA.js";import{i as x}from"./Loading01-D8raUT2q.js";import{c as I}from"./binder-CwgOa4SG.js";import{u as H,L as w}from"./localstorage-keys-C_mtBNzA.js";import{b as k}from"./use-connection-Dj100t8H.js";import{u as z}from"./constants-Cpe-c81c.js";import"./useQuery-C5RIveiE.js";import"./useMutation-VOj1VEf8.js";import"./use-collections-Hp9XPnUY.js";function B(e,r){return e?e.filter(a=>I(a,r)):[]}function y(e){return{id:e.id,title:e.title,icon:e.icon,description:e.description,app_name:e.app_name,app_id:e.app_id,tools:e.tools,metadata:e.metadata}}function M({binding:e,renderHeader:r,renderEmptyState:a}){const{org:s}=_(),{pluginId:n}=S({strict:!1}),d=k(),{data:o}=E.useSession(),l=B(d,e),[i,m]=H(w.pluginConnection(s.slug,n),c=>c??""),u=l.find(c=>c.id===i)??l[0]??null,p=o?.user?{user:{id:o.user.id,name:o.user.name,email:o.user.email,image:o.user.image}}:null,g={id:s.id,slug:s.slug,name:s.name};if(l.length===0||!u){const c={connectionId:null,connection:null,toolCaller:null,org:g,session:p};return t.jsx(j,{value:c,children:t.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:a()})})}const h=z({connectionId:u.id,orgId:s.id}),v={connectionId:u.id,connection:y(u),toolCaller:((c,N)=>h?h.callTool({name:c,arguments:N}).then(C=>C.structuredContent??C):Promise.reject(new Error("MCP client is not available"))),org:g,session:p};return t.jsx(j,{value:v,children:t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[r({connections:l.map(y),selectedConnectionId:u.id,onConnectionChange:m}),t.jsx("div",{className:"flex-1 overflow-hidden",children:t.jsx(f.Suspense,{fallback:t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(x,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:t.jsx(b,{})})})]})})}function F(){const e=L.c(12);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const{pluginId:a}=S(r);let s;e[1]!==a?(s=P.find(i=>i.id===a),e[1]=a,e[2]=s):s=e[2];const n=s;if(n?.renderHeader&&n?.renderEmptyState){let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(x,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=i):i=e[3];let m;return e[4]!==n.binding||e[5]!==n.renderEmptyState||e[6]!==n.renderHeader?(m=t.jsx(f.Suspense,{fallback:i,children:t.jsx(M,{binding:n.binding,renderHeader:n.renderHeader,renderEmptyState:n.renderEmptyState})}),e[4]=n.binding,e[5]=n.renderEmptyState,e[6]=n.renderHeader,e[7]=m):m=e[7],m}const d=n?.LayoutComponent;if(!d){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(b,{}),e[8]=i):i=e[8],i}let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(x,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[9]=o):o=e[9];let l;return e[10]!==d?(l=t.jsx(f.Suspense,{fallback:o,children:t.jsx(d,{})}),e[10]=d,e[11]=l):l=e[11],l}export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,j as t}from"./index-
|
|
1
|
+
import{c as p,j as t}from"./index-yjsBu7QA.js";import{B as j,c as b}from"./button-BNRw8VbO.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
|