@decocms/mesh 2.54.0 → 2.55.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.
Files changed (137) hide show
  1. package/dist/client/assets/{AlertCircle-BNrToYqt.js → AlertCircle-DnrpASG2.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-DVzawF9a.js → ArrowLeft-CkGaUN6o.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CQ6e-0Wq.js → ArrowUp-Cc09RZY4.js} +1 -1
  4. package/dist/client/assets/{Check-DMnBEe7d.js → Check-BYHlfTQr.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DYaI8r4n.js → ChevronDown-Cyh9WMp0.js} +1 -1
  6. package/dist/client/assets/{Code01-DZVRt5kV.js → Code01-B62YyryF.js} +1 -1
  7. package/dist/client/assets/{Copy01-BwkisDCV.js → Copy01-GHFquEvX.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-rOjdNukD.js → DotsHorizontal-C6El5T66.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-BGbgu7b2.js → DotsVertical-DtC1yLil.js} +1 -1
  10. package/dist/client/assets/{Download01-4jXVG4K4.js → Download01-C5tBRZHe.js} +1 -1
  11. package/dist/client/assets/{Edit01-wqwwGiYF.js → Edit01-CCTivbEj.js} +1 -1
  12. package/dist/client/assets/{File06-C6My3XVL.js → File06-CDFdF5Nr.js} +1 -1
  13. package/dist/client/assets/{FilterLines-Jj3LRK8W.js → FilterLines-4yPP_gAU.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-1lTXi-tI.js → FlipBackward-Bb3ib1Bh.js} +1 -1
  15. package/dist/client/assets/{Grid01-Bdj0DO95.js → Grid01-C4O4Aknh.js} +1 -1
  16. package/dist/client/assets/{Home02-C3qWN7FF.js → Home02-D2riSlnv.js} +1 -1
  17. package/dist/client/assets/{Image01-Dc_pe81m.js → Image01-CYRE6pGN.js} +1 -1
  18. package/dist/client/assets/{Inbox01-DN5qsZAf.js → Inbox01-CV_5S91p.js} +1 -1
  19. package/dist/client/assets/{InfoCircle-AjZVF2_p.js → InfoCircle-DnMMetUy.js} +1 -1
  20. package/dist/client/assets/{Key01-C8ywJvkf.js → Key01-CLADbyO4.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-CAKceOnP.js → LinkExternal01-DgcGDmdL.js} +1 -1
  22. package/dist/client/assets/{List-BS8tj6D9.js → List-Cai2-K9Z.js} +1 -1
  23. package/dist/client/assets/{Loading01-stdXpzCa.js → Loading01-B-TyaLAR.js} +1 -1
  24. package/dist/client/assets/{Lock01-BcNPPpBt.js → Lock01-Blk8_ONM.js} +1 -1
  25. package/dist/client/assets/{Pin01-D59W0yB2.js → Pin01-GbJJn2vw.js} +1 -1
  26. package/dist/client/assets/{Play-JAaq_Zok.js → Play-Bw-s0SW4.js} +1 -1
  27. package/dist/client/assets/{Plus-6TXXlKsg.js → Plus-Cxc7BtkQ.js} +1 -1
  28. package/dist/client/assets/{SearchMd-oyZamHNd.js → SearchMd-CpKLo2Zn.js} +1 -1
  29. package/dist/client/assets/{Share07-BCHzNeln.js → Share07-BB-7HQgT.js} +1 -1
  30. package/dist/client/assets/{Terminal-DpoB_Nnm.js → Terminal-DF70HZ2S.js} +1 -1
  31. package/dist/client/assets/{Trash01-DgWJSlUs.js → Trash01-BvwhK6Vg.js} +1 -1
  32. package/dist/client/assets/{Upload01-BjEM3By0.js → Upload01-B6Wi4Y6P.js} +1 -1
  33. package/dist/client/assets/{Users03-D06cOlD9.js → Users03-Ba_1xVKB.js} +1 -1
  34. package/dist/client/assets/{X-B3E_i9w8.js → X-CODbfs2H.js} +1 -1
  35. package/dist/client/assets/{XClose-DbQtCRTh.js → XClose-BaVIBBzB.js} +1 -1
  36. package/dist/client/assets/{agent-detail-BqLltO_D.js → agent-detail-BwU_iOlG.js} +1 -1
  37. package/dist/client/assets/{agents-EthPX2Sx.js → agents-BIH6gREs.js} +1 -1
  38. package/dist/client/assets/{alert-dialog-Bu0WgFow.js → alert-dialog-C_OXD-MA.js} +1 -1
  39. package/dist/client/assets/{auth-catchall-CiJ0m0PC.js → auth-catchall-BCQx1ruw.js} +1 -1
  40. package/dist/client/assets/{avatar-BB_rXRq3.js → avatar-D8AIxV6P.js} +1 -1
  41. package/dist/client/assets/{badge-CMjk7ZQl.js → badge-CpVCYFMG.js} +1 -1
  42. package/dist/client/assets/{binder-BtuXw41S.js → binder-BEyDSNRs.js} +1 -1
  43. package/dist/client/assets/{button-J3cF8gn2.js → button-B2KLvXEr.js} +1 -1
  44. package/dist/client/assets/{card-BEYPRwIW.js → card-DlXZ7U9Z.js} +1 -1
  45. package/dist/client/assets/{checkbox-CMebF7uB.js → checkbox-DaoCFuj8.js} +1 -1
  46. package/dist/client/assets/{circle-alert-B3wSJq8g.js → circle-alert-Bm5Q_veV.js} +1 -1
  47. package/dist/client/assets/{collection-detail-q4bdlu-Y.js → collection-detail-C1oHfNP9.js} +1 -1
  48. package/dist/client/assets/{collection-display-button-CIG4UlNd.js → collection-display-button-BTGoT8ci.js} +1 -1
  49. package/dist/client/assets/{collection-header-DZQxFlAZ.js → collection-header-Be7RY6CQ.js} +1 -1
  50. package/dist/client/assets/{collection-page--GkZ_yos.js → collection-page-RrsDnv83.js} +1 -1
  51. package/dist/client/assets/{collection-search-eDraKk_7.js → collection-search-DD9gszSV.js} +1 -1
  52. package/dist/client/assets/{collection-tab-CmWvDTYN.js → collection-tab-3ZZSVcZ8.js} +1 -1
  53. package/dist/client/assets/{collection-table-wrapper-Dj2d98zl.js → collection-table-wrapper-BSy03JYc.js} +1 -1
  54. package/dist/client/assets/connect-BXWPEVv8.js +1 -0
  55. package/dist/client/assets/{connection-card-Ccox5O3O.js → connection-card-BJ8nkB6q.js} +1 -1
  56. package/dist/client/assets/{connection-detail-CDIu0c_7.js → connection-detail-DVHoUY1Q.js} +1 -1
  57. package/dist/client/assets/{connections-DF2LtdfV.js → connections-B5_ch0b8.js} +1 -1
  58. package/dist/client/assets/{constants-BmqLVuWU.js → constants-BecaK2Q7.js} +1 -1
  59. package/dist/client/assets/constants-lBJFsDYc.js +1 -0
  60. package/dist/client/assets/{create-organization-dialog-DlH9L-XC.js → create-organization-dialog-kmOZjs4K.js} +1 -1
  61. package/dist/client/assets/{dialog-BV8KUT3e.js → dialog-cWpa0tjW.js} +1 -1
  62. package/dist/client/assets/{dropdown-menu-CU8uwIKK.js → dropdown-menu-DDACOXnG.js} +1 -1
  63. package/dist/client/assets/{dynamic-plugin-layout-DjpKl9Qr.js → dynamic-plugin-layout-nceYO9tV.js} +1 -1
  64. package/dist/client/assets/{empty-state-2Xn44rR5.js → empty-state-BRRevprM.js} +1 -1
  65. package/dist/client/assets/{empty-state-CfI4fWtm.js → empty-state-CysqrplM.js} +1 -1
  66. package/dist/client/assets/{env-vars-editor-DXXr0NVr.js → env-vars-editor-CyAPCgjC.js} +1 -1
  67. package/dist/client/assets/{error-boundary-CjvBdF4U.js → error-boundary-D2FqiSoM.js} +1 -1
  68. package/dist/client/assets/{extract-connection-data-D5joWUDQ.js → extract-connection-data-DG_diqa3.js} +1 -1
  69. package/dist/client/assets/{file-browser-BCPabXi1.js → file-browser-BbtVlE62.js} +2 -2
  70. package/dist/client/assets/{form-CSJH-qJ2.js → form-ChHRavtv.js} +1 -1
  71. package/dist/client/assets/{grid-view-FrpGmfU1.js → grid-view-BPn6qgmX.js} +1 -1
  72. package/dist/client/assets/{home-GDBp14_L.js → home-hstgKRny.js} +1 -1
  73. package/dist/client/assets/index-B5YD-rJR.js +1 -0
  74. package/dist/client/assets/{index-DMEXMtKl.js → index-CKyh6XBg.js} +1 -1
  75. package/dist/client/assets/{index-BqKCuZIu.js → index-DIxYn0kb.js} +69 -69
  76. package/dist/client/assets/{index-BArrD_jJ.js → index-DhY2K4tp.js} +12 -12
  77. package/dist/client/assets/{index-Bo2GtwUe.js → index-mQwl56Q0.js} +1 -1
  78. package/dist/client/assets/{index-BFVvPqrB.js → index-rms_W4V6.js} +31 -31
  79. package/dist/client/assets/{infiniteQueryObserver-Bg8GK9wP.js → infiniteQueryObserver-C_cEPa52.js} +1 -1
  80. package/dist/client/assets/{input-ChOg4EAJ.js → input-BkeUe06e.js} +1 -1
  81. package/dist/client/assets/{layout-BApDTXJO.js → layout-CdihDKq7.js} +1 -1
  82. package/dist/client/assets/{localstorage-keys-7ls-GwBJ.js → localstorage-keys-BkUFqNvo.js} +1 -1
  83. package/dist/client/assets/{login-BG_-CcHT.js → login-B4do1VXN.js} +1 -1
  84. package/dist/client/assets/mcp-oauth-Z4D16Uoq.js +1 -0
  85. package/dist/client/assets/{mcp-server-card-CSaO1GV2.js → mcp-server-card-ZLodfuxh.js} +1 -1
  86. package/dist/client/assets/{mcp-server-detail-Dwv3TVPW.js → mcp-server-detail-ChazypwB.js} +2 -2
  87. package/dist/client/assets/{members-CA_mYViu.js → members-DIUQDq49.js} +1 -1
  88. package/dist/client/assets/{monaco-editor-T1r-xUVG.js → monaco-editor-CF8xOd0f.js} +1 -1
  89. package/dist/client/assets/{monitoring-ZbdVzU24.js → monitoring-BXGU01Kc.js} +1 -1
  90. package/dist/client/assets/{oauth-callback-C5GT1qkE.js → oauth-callback-CqnMpdvf.js} +1 -1
  91. package/dist/client/assets/{page-0xoc5JHV.js → page-CLam7tfm.js} +1 -1
  92. package/dist/client/assets/{page-CinEAb4Z.js → page-DcHPZKZc.js} +1 -1
  93. package/dist/client/assets/{pin-to-sidebar-button-DLTYtFsW.js → pin-to-sidebar-button-xde8P8_T.js} +1 -1
  94. package/dist/client/assets/{plugin-empty-state-DEni7Z0l.js → plugin-empty-state-DBQd886H.js} +1 -1
  95. package/dist/client/assets/{plugin-header-CVeNptIv.js → plugin-header-BzN93bFk.js} +1 -1
  96. package/dist/client/assets/{plugins-DxBZdoQL.js → plugins-DTGBld4c.js} +1 -1
  97. package/dist/client/assets/{popover-DVcyGVQw.js → popover-BQ4fAaba.js} +1 -1
  98. package/dist/client/assets/{registry-utils-BSSRgtrE.js → registry-utils-CubAr1ep.js} +1 -1
  99. package/dist/client/assets/{resizable-CfLd1RnW.js → resizable-CBbQ2mtO.js} +1 -1
  100. package/dist/client/assets/{resource-tabs-COQr00qh.js → resource-tabs-PgIUUqJg.js} +1 -1
  101. package/dist/client/assets/{select-Cxe-DhFd.js → select-DtbOgYEp.js} +1 -1
  102. package/dist/client/assets/{settings-BTc-VJHJ.js → settings-Bpg3bFrL.js} +1 -1
  103. package/dist/client/assets/{shell-layout-BJz2y0e2.js → shell-layout-OPZoFrI9.js} +1 -1
  104. package/dist/client/assets/{spinner-CdqIEQLS.js → spinner-BtXJc_eZ.js} +1 -1
  105. package/dist/client/assets/{store-invite-B1qpOpl6.js → store-invite-BEl6VykZ.js} +1 -1
  106. package/dist/client/assets/{switch-E9hEMR25.js → switch-DsnDxQXG.js} +1 -1
  107. package/dist/client/assets/{textarea-rQSkT8jl.js → textarea-BANZCPie.js} +1 -1
  108. package/dist/client/assets/{tool-set-selector-DRq3-_sz.js → tool-set-selector-CqX9WN4g.js} +1 -1
  109. package/dist/client/assets/{tools-list-DPWtzoLD.js → tools-list-BRzmSp1i.js} +1 -1
  110. package/dist/client/assets/{tooltip-szRTVhw8.js → tooltip-Dwcc1k71.js} +1 -1
  111. package/dist/client/assets/{typewriter-title-kKqfL8ys.js → typewriter-title-Bay0uuB9.js} +1 -1
  112. package/dist/client/assets/{use-binding-VN4pkc08.js → use-binding--VZ7Y5Ef.js} +1 -1
  113. package/dist/client/assets/{use-collections-CBMJoxAu.js → use-collections-8Kj36wYP.js} +1 -1
  114. package/dist/client/assets/{use-connection-BMf45qiZ.js → use-connection-DfqjO6nz.js} +1 -1
  115. package/dist/client/assets/{use-create-virtual-mcp-oJMHb3Hn.js → use-create-virtual-mcp-lWx9_XWS.js} +1 -1
  116. package/dist/client/assets/{use-list-state-CuwcoaIK.js → use-list-state-vBhSzyur.js} +1 -1
  117. package/dist/client/assets/{use-mcp-prompts-Cz_r1vTs.js → use-mcp-prompts-DioGpWDr.js} +1 -1
  118. package/dist/client/assets/{use-members-CM_ggyW5.js → use-members-E4uqx9v1.js} +1 -1
  119. package/dist/client/assets/{use-mobile-cE30-TBn.js → use-mobile-C29nHXu6.js} +1 -1
  120. package/dist/client/assets/{use-organization-settings-BH51W5R9.js → use-organization-settings-BSUJceGn.js} +1 -1
  121. package/dist/client/assets/{use-virtual-mcp-CDl7hSS2.js → use-virtual-mcp-BsVUpxvH.js} +1 -1
  122. package/dist/client/assets/useInfiniteQuery-BTaBTa8y.js +1 -0
  123. package/dist/client/assets/{useMutation-7JLPlPaT.js → useMutation-5hMjZ_Ks.js} +1 -1
  124. package/dist/client/assets/useQuery-D0z2lKje.js +1 -0
  125. package/dist/client/assets/{view-mode-toggle-CDsgU6pG.js → view-mode-toggle-CLtTg2VY.js} +1 -1
  126. package/dist/client/assets/{workflow-Cl4tRrSd.js → workflow-Iz076qQ_.js} +1 -1
  127. package/dist/client/index.html +1 -1
  128. package/dist/server/cli.js +10 -10
  129. package/dist/server/migrate.js +5 -5
  130. package/dist/server/server.js +109 -109
  131. package/package.json +1 -1
  132. package/dist/client/assets/connect-DhcqxjCL.js +0 -1
  133. package/dist/client/assets/constants-BOzgaCbN.js +0 -1
  134. package/dist/client/assets/index-D6uekia5.js +0 -1
  135. package/dist/client/assets/mcp-oauth-3en47Te1.js +0 -1
  136. package/dist/client/assets/useInfiniteQuery-CAMkyTNk.js +0 -1
  137. package/dist/client/assets/useQuery-BjPTe_W-.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "2.54.0",
3
+ "version": "2.55.0",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{c as T,bx as M,j as e,by as P,Y as q,r as R,ab as h,a as O}from"./index-BFVvPqrB.js";import{u as A}from"./useQuery-BjPTe_W-.js";import{u as _}from"./useMutation-7JLPlPaT.js";import{B as y}from"./button-J3cF8gn2.js";import{C as N,a as v}from"./card-BEYPRwIW.js";import{i as L,a as U}from"./mcp-oauth-3en47Te1.js";import{c as C,C as K,a as k}from"./circle-alert-B3wSJq8g.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"}]],Y=C("refresh-cw",J),B=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(B,{}),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(Y,{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 +0,0 @@
1
- import{E as t,F as a}from"./index-BFVvPqrB.js";const e=t(a,{target:"draft-7"});export{e as B};
@@ -1 +0,0 @@
1
- import{C as r,L as i,O as l,P as u,V as C,i as c,p as P,u as m}from"./index-BFVvPqrB.js";import{u as M,a as g,b as f,c as x,d as L,e as S,f as d}from"./use-collections-CBMJoxAu.js";import{u as A,a as K,b as R}from"./use-connection-BMf45qiZ.js";import{S as s}from"./constants-BmqLVuWU.js";import{K as b,a as h,W,c as w,g as O,b as V,d as _,e as E,f as I,u as Q}from"./constants-BmqLVuWU.js";import{g as j,l as G,a as U,r as k,u as v,b as F,c as H}from"./use-mcp-prompts-Cz_r1vTs.js";import{u as N,a as Y,b as q}from"./use-virtual-mcp-CDl7hSS2.js";import{a as B,h as X,i as Z}from"./mcp-oauth-3en47Te1.js";import"./useMutation-7JLPlPaT.js";import"./useQuery-BjPTe_W-.js";export{r as ConnectionEntitySchema,b as KEYS,i as Locator,l as ORG_ADMIN_PROJECT_SLUG,u as ProjectContextProvider,h as SELF_MCP_ALIAS_ID,s as StreamableHTTPClientTransport,C as VirtualMCPEntitySchema,W as WellKnownOrgMCPId,B as authenticateMcp,w as createMCPClient,j as getPrompt,O as getWellKnownCommunityRegistryConnection,V as getWellKnownDecopilotAgent,_ as getWellKnownMcpStudioConnection,E as getWellKnownOpenRouterConnection,I as getWellKnownRegistryConnection,X as handleOAuthCallback,Z as isConnectionAuthenticated,c as isStdioParameters,G as listPrompts,U as listResources,P as parseVirtualUrl,k as readResource,M as useCollectionActions,g as useCollectionItem,f as useCollectionList,A as useConnection,K as useConnectionActions,R as useConnections,Q as useMCPClient,v as useMCPPromptsList,F as useMCPPromptsListQuery,H as useMCPResourcesListQuery,x as useMCPToolCall,L as useMCPToolCallMutation,S as useMCPToolCallQuery,d as useMCPToolsListQuery,m as useProjectContext,N as useVirtualMCP,Y as useVirtualMCPActions,q as useVirtualMCPs};
@@ -1 +0,0 @@
1
- import{a7 as R,a8 as P,a9 as $,aa as V}from"./index-BFVvPqrB.js";function b(n){let e=0;for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}const I=new Map,O="mcp:oauth:callback:";class x{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`,this._windowMode=e.windowMode??"popup";const t=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...t&&{scope:t}},I.set(b(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab")window.open(e.toString(),"_blank")||(window.location.href=e.toString());else{const o=window.screenX+(window.outerWidth-600)/2,a=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${o},top=${a},popup=yes`))throw new Error("OAuth popup was blocked. Please allow popups for this site and try again.")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){I.delete(b(this.serverUrl))}}async function D(n){const e=n.meshUrl??window.location.origin,t=new URL(`/mcp/${n.connectionId}`,e),r=new x({serverUrl:t.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope,windowMode:n.windowMode});try{const o=new Promise((s,u)=>{const _=n.timeout||12e4;let h,w=!1;const M=r.state(),m=`${O}${M}`,d=()=>{window.removeEventListener("message",S),window.removeEventListener("storage",y),clearTimeout(h);try{localStorage.removeItem(m)}catch{}},g=async l=>{if(w)return;if(w=!0,!l.success){d(),u(new Error(l.error||"OAuth authentication failed"));return}const{code:p,state:E}=l;if(!p){d(),u(new Error("Missing authorization code"));return}if(r.getStoredState()!==E){d(),u(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const v=(await R(t))?.authorization_servers?.[0]||t,U=await P(v),f=r.clientInformation();if(!f){d(),u(new Error("Client information not found"));return}const C=r.codeVerifier(),L=await $(v,{metadata:U,clientInformation:f,authorizationCode:p,codeVerifier:C,redirectUri:r.redirectUrl,resource:new URL(t)});d(),s({tokens:L,clientId:f.client_id??null,clientSecret:"client_secret"in f?f.client_secret:null,tokenEndpoint:U?.token_endpoint??null})}catch(A){d(),u(A)}},S=async l=>{l.origin===window.location.origin&&l.data?.type==="mcp:oauth:callback"&&await g(l.data)},y=async l=>{if(!(l.key!==m||!l.newValue))try{const p=JSON.parse(l.newValue);await g(p)}catch{}};window.addEventListener("message",S),window.addEventListener("storage",y),h=setTimeout(()=>{w||(w=!0,d(),u(new Error("OAuth authentication timeout")))},_)});if(await V(r,{serverUrl:t})==="REDIRECT"){const s=await o;return{token:s.tokens.access_token,tokenInfo:{accessToken:s.tokens.access_token,refreshToken:s.tokens.refresh_token??null,expiresIn:s.tokens.expires_in??null,scope:s.tokens.scope??null,clientId:s.clientId,clientSecret:s.clientSecret,tokenEndpoint:s.tokenEndpoint},error:null}}const c=r.tokens(),i=r.clientInformation();return{token:c?.access_token||null,tokenInfo:c?{accessToken:c.access_token,refreshToken:c.refresh_token??null,expiresIn:c.expires_in??null,scope:c.scope??null,clientId:i?.client_id??null,clientSecret:i&&"client_secret"in i?i.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{r.cleanup()}}function k(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${O}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function J(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const r=n.get("error"),o=n.get("error_description");let a=t;if(t)try{const i=atob(t),s=JSON.parse(i);s.clientState&&(a=s.clientState)}catch{}if(r){const i=o||r;return k({type:"mcp:oauth:callback",success:!1,error:i},a),{success:!1,error:i}}if(!e||!t){const i="Missing code or state parameter";return k({type:"mcp:oauth:callback",success:!1,error:i},a),{success:!1,error:i}}return t=a||t,k({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}function T(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function N(n){try{const e=T();return(e?new URL(n,e):new URL(n)).pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}async function z(n,e){try{const t=`/api/connections/${n}/oauth-token/status`,r=e?new URL(t,e).href:t,o=await fetch(r,{credentials:e?"omit":"include"});return o.ok?{hasToken:(await o.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function K({url:n,token:e,meshUrl:t}){try{const r=new Headers;r.set("Content-Type","application/json"),r.set("Accept","application/json, text/event-stream");const o=await fetch(n,{method:"POST",headers:r,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),a=N(n),c=T(),i=t??(c?new URL(n,c).origin:new URL(n).origin);if(o.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(a?await z(a,i):{hasToken:!1}).hasToken};let s;try{const h=await o.json();s=h.error||h.message}catch{}return o.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:s||`HTTP ${o.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!o.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:s||`HTTP ${o.status}`}}catch(r){return console.error("[isConnectionAuthenticated] Error:",r),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:r.message}}}export{D as a,J as h,K as i};
@@ -1 +0,0 @@
1
- import{I as u}from"./infiniteQueryObserver-Bg8GK9wP.js";import{a0 as i}from"./index-BFVvPqrB.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{a0 as u,a1 as s}from"./index-BFVvPqrB.js";function o(e,r){return u(e,s,r)}export{o as u};