@decocms/mesh 2.14.1 → 2.15.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 (147) hide show
  1. package/dist/client/assets/{AlertCircle-CMyS46jH.js → AlertCircle-CIFhWg2i.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-Dsh9IWd-.js → ArrowLeft-D0vIuW0V.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CXsDJznS.js → ArrowUp-MjJJcV-O.js} +1 -1
  4. package/dist/client/assets/{Check-BEhtk6Py.js → Check-LvJ1lSFr.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BRxtl0-A.js → ChevronDown-QF_Tgl2v.js} +1 -1
  6. package/dist/client/assets/{Clock-BSrN61cb.js → Clock-CiIkKpUg.js} +1 -1
  7. package/dist/client/assets/{Code01-Bu5zpyWd.js → Code01-Du8Lx-Uw.js} +1 -1
  8. package/dist/client/assets/{Copy01-B7vmVdHF.js → Copy01-CunLN8rc.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-B0iNa4YA.js → DotsHorizontal-WE50knOB.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CdUtOOoG.js → DotsVertical-CuQjcY-h.js} +1 -1
  11. package/dist/client/assets/{Download01-D1VGE3pA.js → Download01-syi4c4iH.js} +1 -1
  12. package/dist/client/assets/{Edit01-CGqnOdlK.js → Edit01-DVUwOcf8.js} +1 -1
  13. package/dist/client/assets/{File06-De52zO32.js → File06-BM3BX-NC.js} +1 -1
  14. package/dist/client/assets/{FilterLines-ClFUJXZP.js → FilterLines-DS1pmySA.js} +1 -1
  15. package/dist/client/assets/{FlipBackward-B4GimHkg.js → FlipBackward-BKppcJN9.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-B40VcD0l.js → GitBranch01-C3ShOPmQ.js} +1 -1
  17. package/dist/client/assets/{Grid01-CoHgfBeE.js → Grid01-DwtrqYPx.js} +1 -1
  18. package/dist/client/assets/{Home02-Dax6TXzJ.js → Home02-DlsAgg82.js} +1 -1
  19. package/dist/client/assets/{Image01-D_Oad7Fi.js → Image01-Bw2o5F05.js} +1 -1
  20. package/dist/client/assets/{Inbox01-DU8gyK-F.js → Inbox01-CSDhYGLL.js} +1 -1
  21. package/dist/client/assets/{InfoCircle-Na8jygcw.js → InfoCircle-xFKFZGrj.js} +1 -1
  22. package/dist/client/assets/{Key01-BbSMVBZS.js → Key01-S9eZFu7R.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-5OOaoko1.js → LinkExternal01-Dbxh7ZV2.js} +1 -1
  24. package/dist/client/assets/{List-BXC8ldIg.js → List-D2PJPXod.js} +1 -1
  25. package/dist/client/assets/{Loading01-DxDL3s7X.js → Loading01-BhuF3K1g.js} +1 -1
  26. package/dist/client/assets/{Lock01-C1zaHQP8.js → Lock01-jUZQmYfl.js} +1 -1
  27. package/dist/client/assets/{Play-ClPvjsPL.js → Play-BxDRmyN-.js} +1 -1
  28. package/dist/client/assets/{Plus-WrA7kzKa.js → Plus-DCVckKM0.js} +1 -1
  29. package/dist/client/assets/{SearchMd-JSFwoON0.js → SearchMd-tLR3QB8E.js} +1 -1
  30. package/dist/client/assets/{Terminal-BtV_FLPF.js → Terminal-DwE3k3eb.js} +1 -1
  31. package/dist/client/assets/{Trash01-MX6mkM7g.js → Trash01-Dg5Q9OUO.js} +1 -1
  32. package/dist/client/assets/{Upload01-BGvogcXt.js → Upload01-BJUxi5ck.js} +1 -1
  33. package/dist/client/assets/{X-q5bh176U.js → X-DKF1oh5v.js} +1 -1
  34. package/dist/client/assets/{XClose-D_dGSZ7W.js → XClose-BACMQGhN.js} +1 -1
  35. package/dist/client/assets/{alert-dialog-ocEz50Se.js → alert-dialog-BryTAX-J.js} +2 -2
  36. package/dist/client/assets/{auth-catchall-BJS8UgWt.js → auth-catchall-B3H5JOvc.js} +1 -1
  37. package/dist/client/assets/{avatar-Dtkx4Tl-.js → avatar-BtMYdv0U.js} +1 -1
  38. package/dist/client/assets/{badge-BkSn2oaB.js → badge-Do7WFlPI.js} +1 -1
  39. package/dist/client/assets/{binder-BVHRVoIY.js → binder-B3GXUIAu.js} +1 -1
  40. package/dist/client/assets/{button-CICpj3wE.js → button-ClkQLR3o.js} +1 -1
  41. package/dist/client/assets/{card-BMkFh6vi.js → card-CwMKn79y.js} +1 -1
  42. package/dist/client/assets/{checkbox-DTTIHxXg.js → checkbox-C6hBycBx.js} +1 -1
  43. package/dist/client/assets/{collection-detail-CDCE926k.js → collection-detail-C-m2H10s.js} +2 -2
  44. package/dist/client/assets/{collection-display-button-3hmFOeDC.js → collection-display-button-CdHXoeVD.js} +1 -1
  45. package/dist/client/assets/{collection-header-B6vJy14N.js → collection-header-CeBQhXWy.js} +1 -1
  46. package/dist/client/assets/{collection-page-Dt6I6Mr4.js → collection-page-pMUw63Yr.js} +1 -1
  47. package/dist/client/assets/{collection-search-ClK_cOgs.js → collection-search-CF1o4yO7.js} +1 -1
  48. package/dist/client/assets/{collection-tab-D8CKnWEB.js → collection-tab-ChPNT80-.js} +1 -1
  49. package/dist/client/assets/{collection-table-wrapper-CUsQQB3S.js → collection-table-wrapper-jfSAC6dF.js} +1 -1
  50. package/dist/client/assets/{connection-Mp3hTHGP.js → connection-BcYehfdK.js} +2 -2
  51. package/dist/client/assets/{connection-card-Cm6sQJt-.js → connection-card-DO3ahSdV.js} +1 -1
  52. package/dist/client/assets/connection-detail-i_lj-oMr.js +1 -0
  53. package/dist/client/assets/{connections-BXBUh1-5.js → connections-CMzrwOZS.js} +1 -1
  54. package/dist/client/assets/constants-BIwbIZhE.js +1 -0
  55. package/dist/client/assets/create-organization-dialog-BydMMM5g.js +1 -0
  56. package/dist/client/assets/{dialog-CuzZhGeu.js → dialog-Y0g8yyzz.js} +1 -1
  57. package/dist/client/assets/{dropdown-menu-D1uHrxpy.js → dropdown-menu-C4Ypstre.js} +1 -1
  58. package/dist/client/assets/{dynamic-plugin-layout-BWtm_52W.js → dynamic-plugin-layout-Cds2rM_Z.js} +1 -1
  59. package/dist/client/assets/{empty-state-B8LlErgw.js → empty-state-C0gi-aAx.js} +1 -1
  60. package/dist/client/assets/{empty-state-BhACvnGF.js → empty-state-Dx0NLAxy.js} +1 -1
  61. package/dist/client/assets/env-vars-editor-GTn7Eu5T.js +1 -0
  62. package/dist/client/assets/{error-boundary-u4ffWLYf.js → error-boundary-D2ZJQHnD.js} +1 -1
  63. package/dist/client/assets/{extract-connection-data-DSV8dsp9.js → extract-connection-data-nsOyk4eb.js} +1 -1
  64. package/dist/client/assets/{file-browser-CZ1PEthx.js → file-browser-s8pLbWaW.js} +2 -2
  65. package/dist/client/assets/{form-f0_t6ok_.js → form-DDdl0439.js} +1 -1
  66. package/dist/client/assets/{gateway-detail-D4FxMVxj.js → gateway-detail-NHGkjgTy.js} +1 -1
  67. package/dist/client/assets/{gateways-DjekxeB3.js → gateways-Bv1uyRdE.js} +1 -1
  68. package/dist/client/assets/{grid-view-BYe4Rwz4.js → grid-view-DNPq1Y__.js} +1 -1
  69. package/dist/client/assets/{home-C6GUJREk.js → home-9eTtEa0h.js} +1 -1
  70. package/dist/client/assets/{index-pvGhQBw9.js → index-C5FDJtAp.js} +2 -2
  71. package/dist/client/assets/{index-CFMXrMRQ.js → index-Cbsnfme0.js} +1 -1
  72. package/dist/client/assets/{index-DB3GMPX_.js → index-D6aVJNvm.js} +1 -1
  73. package/dist/client/assets/{index-BrOzWsZC.js → index-DqVdeyIE.js} +1 -1
  74. package/dist/client/assets/index-JAPwCHXJ.css +1 -0
  75. package/dist/client/assets/index-hEHbC4y4.js +88 -0
  76. package/dist/client/assets/{infiniteQueryObserver-DjOTL7tS.js → infiniteQueryObserver-BnxPLCEe.js} +1 -1
  77. package/dist/client/assets/{input-Chnnz9Uq.js → input-BbWUShhD.js} +1 -1
  78. package/dist/client/assets/{layout-CE7L7dZF.js → layout-BnqnCJOk.js} +1 -1
  79. package/dist/client/assets/{lazy-highlighter-HM0cmsZA.js → lazy-highlighter-BHJogLPz.js} +1 -1
  80. package/dist/client/assets/{localstorage-keys-CdhAbc7P.js → localstorage-keys-BZEjwsD0.js} +1 -1
  81. package/dist/client/assets/{login-D-qtMr1_.js → login-DGLLQl3L.js} +1 -1
  82. package/dist/client/assets/{mcp-oauth-Bkju1UsK.js → mcp-oauth-CkuEWYY4.js} +1 -1
  83. package/dist/client/assets/{mcp-server-card-CsdbMsCj.js → mcp-server-card-D4bCdTAY.js} +1 -1
  84. package/dist/client/assets/{mcp-server-detail-BI6WT6NT.js → mcp-server-detail-Cy2l0hPz.js} +1 -1
  85. package/dist/client/assets/{members-DIF2fQ00.js → members-CXuNIHGD.js} +2 -2
  86. package/dist/client/assets/{monaco-editor--HoIUuQe.js → monaco-editor-BnXEGbzY.js} +4 -4
  87. package/dist/client/assets/{monitoring-Gwgg901f.js → monitoring-vPlAvNfN.js} +2 -2
  88. package/dist/client/assets/{oauth-callback-C8OVySGi.js → oauth-callback-I_aRwsB5.js} +1 -1
  89. package/dist/client/assets/{page-rpmGCt1t.js → page-DPsdZaOi.js} +1 -1
  90. package/dist/client/assets/page-fWJ76jbj.js +35 -0
  91. package/dist/client/assets/{pin-to-sidebar-button--fqmK37a.js → pin-to-sidebar-button-DTR_Oj1s.js} +1 -1
  92. package/dist/client/assets/{plugin-empty-state-BPlieumE.js → plugin-empty-state-RYQHQ0B6.js} +1 -1
  93. package/dist/client/assets/{plugin-header-CcEHY2ra.js → plugin-header-BPW1tb_d.js} +1 -1
  94. package/dist/client/assets/{plugins-BR7M1iih.js → plugins-DN4-aMVD.js} +1 -1
  95. package/dist/client/assets/{popover-Cq8T_QGa.js → popover-DLFe45bO.js} +1 -1
  96. package/dist/client/assets/{project-context-provider-CUiGxKJp.js → project-context-provider-DH0iqA5D.js} +1 -1
  97. package/dist/client/assets/{registry-utils-h9Ud__h7.js → registry-utils-BPPApxjf.js} +1 -1
  98. package/dist/client/assets/{resizable-S6LzYu6C.js → resizable-C6uSLZAk.js} +1 -1
  99. package/dist/client/assets/{resource-tabs-Blq_ajNW.js → resource-tabs-CKatVKnl.js} +1 -1
  100. package/dist/client/assets/select-CSzUpxmC.js +1 -0
  101. package/dist/client/assets/{settings-C0Cv06sV.js → settings-Dk6-Mm8r.js} +1 -1
  102. package/dist/client/assets/shell-layout-P7XxC3ZF.js +3 -0
  103. package/dist/client/assets/{spinner-BSgPnpsR.js → spinner-CUAQv_4V.js} +1 -1
  104. package/dist/client/assets/{standalone-Cva4pL7v.js → standalone-Cutp_BhH.js} +1 -1
  105. package/dist/client/assets/{switch-CkVmNhCD.js → switch-ZAqg3LbP.js} +1 -1
  106. package/dist/client/assets/{textarea-BgUJNVXI.js → textarea-BDJhX5-9.js} +1 -1
  107. package/dist/client/assets/{tool-set-selector-BVPKiJOI.js → tool-set-selector-D26m7PpE.js} +1 -1
  108. package/dist/client/assets/{tools-list-DsOacuX3.js → tools-list-pl3Bsjpf.js} +1 -1
  109. package/dist/client/assets/{tooltip-DySBr2SY.js → tooltip-DXYcokUT.js} +1 -1
  110. package/dist/client/assets/use-binding-Cmi2FEqF.js +23 -0
  111. package/dist/client/assets/{use-collections-JQXbZBdV.js → use-collections-DxMxR_jZ.js} +1 -1
  112. package/dist/client/assets/{use-connection-BF1UFzlw.js → use-connection-ClVfoZWG.js} +1 -1
  113. package/dist/client/assets/{use-connection-resources-D5d-M6jn.js → use-connection-resources-nXRlJNhx.js} +1 -1
  114. package/dist/client/assets/{use-create-gateway-DLr-GNpv.js → use-create-gateway-UkmAQbcu.js} +1 -1
  115. package/dist/client/assets/{use-gateway-B5GGqvj7.js → use-gateway-D_zdUoI4.js} +1 -1
  116. package/dist/client/assets/{use-gateway-system-prompt-K6FCpGjs.js → use-gateway-system-prompt-CYi0Zo4K.js} +1 -1
  117. package/dist/client/assets/{use-list-state-BkPjBg3I.js → use-list-state-G6sniPDx.js} +1 -1
  118. package/dist/client/assets/{use-mcp-C-3NLCFo.js → use-mcp-hlkUt7pz.js} +1 -1
  119. package/dist/client/assets/{use-members-B9HW4lZd.js → use-members-3RqzErHO.js} +1 -1
  120. package/dist/client/assets/{use-mobile-zhrv6Pzr.js → use-mobile-DT1cwytU.js} +1 -1
  121. package/dist/client/assets/use-model-state-Bc4MpPVu.js +20 -0
  122. package/dist/client/assets/{use-organization-settings-DTSCQFPr.js → use-organization-settings-D46q7SyU.js} +1 -1
  123. package/dist/client/assets/{use-tool-call-BMUEJvVc.js → use-tool-call-BH-yOcTy.js} +1 -1
  124. package/dist/client/assets/useInfiniteQuery-Dl93eV8h.js +1 -0
  125. package/dist/client/assets/{useMutation-B64mCwly.js → useMutation-DEocBykZ.js} +1 -1
  126. package/dist/client/assets/useQuery-Dakt0IBq.js +1 -0
  127. package/dist/client/assets/{value-DvmerOpY.js → value-C9Bb1t7X.js} +1 -1
  128. package/dist/client/assets/{view-mode-toggle-DXknlAX3.js → view-mode-toggle-C5hz9T3M.js} +1 -1
  129. package/dist/client/assets/{workflow-Bi0pfrEf.js → workflow-BJoyVBBY.js} +1 -1
  130. package/dist/client/index.html +2 -2
  131. package/dist/server/cli.js +164 -157
  132. package/dist/server/migrate.js +130 -123
  133. package/dist/server/server.js +160 -153
  134. package/package.json +1 -1
  135. package/dist/client/assets/connection-detail-CS7YtOxG.js +0 -1
  136. package/dist/client/assets/constants-DsV2FGIq.js +0 -1
  137. package/dist/client/assets/create-organization-dialog-Kd2yuwpA.js +0 -1
  138. package/dist/client/assets/env-vars-editor-BSBPtnyc.js +0 -1
  139. package/dist/client/assets/index-BZk2eMPx.js +0 -88
  140. package/dist/client/assets/index-fFpUC2Bx.css +0 -1
  141. package/dist/client/assets/page-BthOOB1S.js +0 -35
  142. package/dist/client/assets/select-BOEg6aAK.js +0 -1
  143. package/dist/client/assets/shell-layout-BRSb3To9.js +0 -3
  144. package/dist/client/assets/thread-history-popover-SCaQRi-L.js +0 -20
  145. package/dist/client/assets/use-binding-s4bqKdJA.js +0 -23
  146. package/dist/client/assets/useInfiniteQuery-qVzxuL4i.js +0 -1
  147. package/dist/client/assets/useQuery-Dr4r_H_i.js +0 -1
@@ -1 +1 @@
1
- import{b4 as d,bM as f,bN as b,bO as v}from"./index-pvGhQBw9.js";var p=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:f()})}getOptimisticResult(e){return e.behavior=f(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:P,isError:c,isRefetchError:g}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:b(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:u,isRefetchError:g&&!h&&!n,isRefetching:P&&!o&&!u}}};export{p as I};
1
+ import{b3 as d,bL as f,bM as b,bN as v}from"./index-C5FDJtAp.js";var p=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:f()})}getOptimisticResult(e){return e.behavior=f(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:P,isError:c,isRefetchError:g}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:b(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:u,isRefetchError:g&&!h&&!n,isRefetching:P&&!o&&!u}}};export{p as I};
@@ -1 +1 @@
1
- import{c as s,j as a}from"./index-pvGhQBw9.js";import{c as d}from"./button-CICpj3wE.js";function p(l){const e=s.c(10);let i,r,t;e[0]!==l?({className:i,type:t,...r}=l,e[0]=l,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let n;e[4]!==i?(n=d("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-lg border bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] bg-background","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==n||e[8]!==t?(o=a.jsx("input",{type:t,"data-slot":"input",className:n,...r}),e[6]=r,e[7]=n,e[8]=t,e[9]=o):o=e[9],o}export{p as I};
1
+ import{c as s,j as a}from"./index-C5FDJtAp.js";import{c as d}from"./button-ClkQLR3o.js";function p(l){const e=s.c(10);let i,r,t;e[0]!==l?({className:i,type:t,...r}=l,e[0]=l,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let n;e[4]!==i?(n=d("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-lg border bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] bg-background","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==n||e[8]!==t?(o=a.jsx("input",{type:t,"data-slot":"input",className:n,...r}),e[6]=r,e[7]=n,e[8]=t,e[9]=o):o=e[9],o}export{p as I};
@@ -1 +1 @@
1
- import{c as E,r as f,aa as v,j as l}from"./index-pvGhQBw9.js";import{B as w}from"./button-CICpj3wE.js";import{i as k}from"./ArrowLeft-Dsh9IWd-.js";const j=f.createContext(null);function S(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.tabsEl)return null;let t;return e[0]!==r||e[1]!==s.tabsEl?(t=v.createPortal(r,s.tabsEl),e[0]=r,e[1]=s.tabsEl,e[2]=t):t=e[2],t}function _(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.actionsEl)return null;let t;return e[0]!==r||e[1]!==s.actionsEl?(t=v.createPortal(r,s.actionsEl),e[0]=r,e[1]=s.actionsEl,e[2]=t):t=e[2],t}function B(x){const e=E.c(20),{children:r,onBack:s,title:t}=x,[h,N]=f.useState(null),[p,g]=f.useState(null);let n;e[0]!==p||e[1]!==h?(n={tabsEl:h,actionsEl:p},e[0]=p,e[1]=h,e[2]=n):n=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(k,{}),e[3]=u):u=e[3];let i;e[4]!==s?(i=l.jsx("div",{className:"flex h-full px-2 border-r items-center",children:l.jsx(w,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:s,children:u})}),e[4]=s,e[5]=i):i=e[5];let c;e[6]!==t?(c=t&&l.jsx("div",{className:"flex items-center gap-2 px-2",children:l.jsx("p",{className:"text-sm font-medium",children:t})}),e[6]=t,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsxs("div",{className:"flex px-4 items-center gap-0 flex-1 min-w-0",children:[l.jsx("div",{ref:N,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),l.jsx("div",{ref:g,className:"flex items-center gap-2 ml-auto shrink-0 border-l border-border pl-4"})]}),e[8]=d):d=e[8];let o;e[9]!==i||e[10]!==c?(o=l.jsxs("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:[i,c,d]}),e[9]=i,e[10]=c,e[11]=o):o=e[11];let a;e[12]!==r?(a=l.jsx("div",{className:"flex-1 overflow-auto",children:r}),e[12]=r,e[13]=a):a=e[13];let m;e[14]!==o||e[15]!==a?(m=l.jsxs("div",{className:"flex flex-col h-full bg-background",children:[o,a]}),e[14]=o,e[15]=a,e[16]=m):m=e[16];let b;return e[17]!==n||e[18]!==m?(b=l.jsx(j,{value:n,children:m}),e[17]=n,e[18]=m,e[19]=b):b=e[19],b}export{_ as V,S as a,B as b};
1
+ import{c as E,r as f,ac as v,j as l}from"./index-C5FDJtAp.js";import{B as w}from"./button-ClkQLR3o.js";import{i as k}from"./ArrowLeft-D0vIuW0V.js";const j=f.createContext(null);function S(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.tabsEl)return null;let t;return e[0]!==r||e[1]!==s.tabsEl?(t=v.createPortal(r,s.tabsEl),e[0]=r,e[1]=s.tabsEl,e[2]=t):t=e[2],t}function _(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.actionsEl)return null;let t;return e[0]!==r||e[1]!==s.actionsEl?(t=v.createPortal(r,s.actionsEl),e[0]=r,e[1]=s.actionsEl,e[2]=t):t=e[2],t}function B(x){const e=E.c(20),{children:r,onBack:s,title:t}=x,[h,N]=f.useState(null),[p,g]=f.useState(null);let n;e[0]!==p||e[1]!==h?(n={tabsEl:h,actionsEl:p},e[0]=p,e[1]=h,e[2]=n):n=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(k,{}),e[3]=u):u=e[3];let c;e[4]!==s?(c=l.jsx("div",{className:"flex h-full px-2 border-r items-center",children:l.jsx(w,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:s,children:u})}),e[4]=s,e[5]=c):c=e[5];let i;e[6]!==t?(i=t&&l.jsx("div",{className:"flex items-center gap-2 px-2",children:l.jsx("p",{className:"text-sm font-medium",children:t})}),e[6]=t,e[7]=i):i=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsxs("div",{className:"flex px-4 items-center gap-0 flex-1 min-w-0",children:[l.jsx("div",{ref:N,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),l.jsx("div",{ref:g,className:"flex items-center gap-2 ml-auto shrink-0 border-l border-border pl-4"})]}),e[8]=d):d=e[8];let o;e[9]!==c||e[10]!==i?(o=l.jsxs("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:[c,i,d]}),e[9]=c,e[10]=i,e[11]=o):o=e[11];let a;e[12]!==r?(a=l.jsx("div",{className:"flex-1 overflow-auto",children:r}),e[12]=r,e[13]=a):a=e[13];let m;e[14]!==o||e[15]!==a?(m=l.jsxs("div",{className:"flex flex-col h-full bg-background",children:[o,a]}),e[14]=o,e[15]=a,e[16]=m):m=e[16];let b;return e[17]!==n||e[18]!==m?(b=l.jsx(j,{value:n,children:m}),e[17]=n,e[18]=m,e[19]=b):b=e[19],b}export{_ as V,S as a,B as b};
@@ -1,4 +1,4 @@
1
- import{E as ae,a7 as Ie,a2 as Xp,c as Zp,j as Qp}from"./index-pvGhQBw9.js";function To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},To.apply(null,arguments)}function Jp(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function eg(e,t){if(e==null)return{};var r,a,n=Jp(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ao(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}function tg(e){if(Array.isArray(e))return Ao(e)}function rg(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ag(e,t){if(e){if(typeof e=="string")return Ao(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ao(e,t):void 0}}function ng(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{H as ae,a9 as Ie,a4 as Xp,c as Zp,j as Qp}from"./index-C5FDJtAp.js";function To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},To.apply(null,arguments)}function Jp(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function eg(e,t){if(e==null)return{};var r,a,n=Jp(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ao(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}function tg(e){if(Array.isArray(e))return Ao(e)}function rg(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ag(e,t){if(e){if(typeof e=="string")return Ao(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ao(e,t):void 0}}function ng(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ro(e){return tg(e)||rg(e)||ag(e)||ng()}function Se(e){"@babel/helpers - typeof";return Se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(e)}function ig(e,t){if(Se(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Se(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function og(e){var t=ig(e,"string");return Se(t)=="symbol"?t:t+""}function kp(e,t,r){return(t=og(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Go(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,a)}return r}function me(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Go(Object(r),!0).forEach(function(a){kp(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Go(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function sg(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(t===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(t>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Ue={};function lg(e){if(e.length===0||e.length===1)return e;var t=e.join(".");return Ue[t]||(Ue[t]=sg(e)),Ue[t]}function ug(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,a=e.filter(function(i){return i!=="token"}),n=lg(a);return n.reduce(function(i,o){return me(me({},i),r[o])},t)}function $o(e){return e.join(" ")}function cg(e,t){var r=0;return function(a){return r+=1,a.map(function(n,i){return Cp({node:n,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(r,"-").concat(i)})})}}function Cp(e){var t=e.node,r=e.stylesheet,a=e.style,n=a===void 0?{}:a,i=e.useInlineStyles,o=e.key,s=t.properties,l=t.type,c=t.tagName,u=t.value;if(l==="text")return u;if(c){var p=cg(r,i),m;if(!i)m=me(me({},s),{},{className:$o(s.className)});else{var f=Object.keys(r).reduce(function(R,b){return b.split(".").forEach(function(g){R.includes(g)||R.push(g)}),R},[]),T=s.className&&s.className.includes("token")?["token"]:[],E=s.className&&T.concat(s.className.filter(function(R){return!f.includes(R)}));m=me(me({},s),{},{className:$o(E)||void 0,style:ug(s.className,Object.assign({},s.style,n),r)})}var A=p(t.children);return ae.createElement(c,To({key:o},m),A)}}const dg=(function(e,t){var r=e.listLanguages();return r.indexOf(t)!==-1});var pg=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Ho(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,a)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ho(Object(r),!0).forEach(function(a){kp(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ho(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var gg=/\n/g;function bg(e){return e.match(gg)}function mg(e){var t=e.lines,r=e.startingLineNumber,a=e.style;return t.map(function(n,i){var o=i+r;return ae.createElement("span",{key:"line-".concat(i),className:"react-syntax-highlighter-line-number",style:typeof a=="function"?a(o):a},"".concat(o,`
3
3
  `))})}function fg(e){var t=e.codeString,r=e.codeStyle,a=e.containerStyle,n=a===void 0?{float:"left",paddingRight:"10px"}:a,i=e.numberStyle,o=i===void 0?{}:i,s=e.startingLineNumber;return ae.createElement("code",{style:Object.assign({},r,n)},mg({lines:t.replace(/\n$/,"").split(`
4
4
  `),style:o,startingLineNumber:s}))}function hg(e){return"".concat(e.toString().length,".25em")}function Op(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Lp(e,t,r){var a={display:"inline-block",minWidth:hg(r),paddingRight:"1em",textAlign:"right",userSelect:"none"},n=typeof e=="function"?e(t):e,i=ne(ne({},a),n);return i}function _e(e){var t=e.children,r=e.lineNumber,a=e.lineNumberStyle,n=e.largestLineNumber,i=e.showInlineLineNumbers,o=e.lineProps,s=o===void 0?{}:o,l=e.className,c=l===void 0?[]:l,u=e.showLineNumbers,p=e.wrapLongLines,m=e.wrapLines,f=m===void 0?!1:m,T=f?ne({},typeof s=="function"?s(r):s):{};if(T.className=T.className?[].concat(Ro(T.className.trim().split(/\s+/)),Ro(c)):c,r&&i){var E=Lp(a,r,n);t.unshift(Op(r,E))}return p&u&&(T.style=ne({display:"flex"},T.style)),{type:"element",tagName:"span",properties:T,children:t}}function Dp(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=0;a<e.length;a++){var n=e[a];if(n.type==="text")r.push(_e({children:[n],className:Ro(new Set(t))}));else if(n.children){var i=t.concat(n.properties.className);Dp(n.children,i).forEach(function(o){return r.push(o)})}}return r}function Eg(e,t,r,a,n,i,o,s,l){var c,u=Dp(e.value),p=[],m=-1,f=0;function T(S,d){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return _e({children:S,lineNumber:d,lineNumberStyle:s,largestLineNumber:o,showInlineLineNumbers:n,lineProps:r,className:y,showLineNumbers:a,wrapLongLines:l,wrapLines:t})}function E(S,d){if(a&&d&&n){var y=Lp(s,d,o);S.unshift(Op(d,y))}return S}function A(S,d){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||y.length>0?T(S,d,y):E(S,d)}for(var R=function(){var d=u[f],y=d.children[0].value,_=bg(y);if(_){var v=y.split(`
@@ -1 +1 @@
1
- import{c as O,v as w}from"./index-pvGhQBw9.js";import{u as I}from"./useQuery-Dr4r_H_i.js";import{u as x}from"./useMutation-B64mCwly.js";function L(e){try{return JSON.parse(e)}catch{return}}function $(e,s){const t=localStorage.getItem(e),o=t?L(t):void 0,n=typeof s=="function"?s(o):o??s;if(o===void 0||n!==o)try{const a=JSON.stringify(n);localStorage.setItem(e,a)}catch{}return n}function q(e,s){const t=O.c(25),o=w();let n;t[0]!==e?(n=["localStorage",e],t[0]=e,t[1]=n):n=t[1];const a=n;let r,i;t[2]!==s||t[3]!==e?(r=()=>$(e,s),i=()=>$(e,s),t[2]=s,t[3]=e,t[4]=r,t[5]=i):(r=t[4],i=t[5]);let h;t[6]!==a||t[7]!==r||t[8]!==i?(h={queryKey:a,queryFn:r,initialData:i,staleTime:1/0,gcTime:1/0},t[6]=a,t[7]=r,t[8]=i,t[9]=h):h=t[9];const{data:v}=I(h);let l;t[10]!==e?(l=async c=>{const y=JSON.stringify(c);return localStorage.setItem(e,y),c},t[10]=e,t[11]=l):l=t[11];let m;t[12]!==o||t[13]!==a?(m=c=>{o.setQueryData(a,c)},t[12]=o,t[13]=a,t[14]=m):m=t[14];let u;t[15]!==l||t[16]!==m?(u={mutationFn:l,onSuccess:m},t[15]=l,t[16]=m,t[17]=u):u=t[17];const f=x(u);let d;t[18]!==f||t[19]!==o||t[20]!==a?(d=c=>{const y=o.getQueryData(a),C=typeof c=="function"?c(y):c;f.mutate(C)},t[18]=f,t[19]=o,t[20]=a,t[21]=d):d=t[21];const p=d,S=v;let g;return t[22]!==p||t[23]!==S?(g=[S,p],t[22]=p,t[23]=S,t[24]=g):g=t[24],g}const A={decoChatOpen:()=>"mesh:decochat:open",threadManagerState:e=>`mesh:thread-manager-state:${e}`,chatSelectedModel:e=>`mesh:chat:selectedModel:${e}`,assistantChatActiveThread:(e,s)=>`mesh:assistant-chat:active-thread:${e}:${s}`,gatewayChatActiveThread:(e,s)=>`mesh:gateway-chat:active-thread:${e}:${s}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:e=>`mesh:store:selected-registry:${e}`,orgHomeQuickstart:e=>`mesh:org-home:quickstart:${e}`,gatewaySystemPrompts:e=>`mesh:gateway:system-prompts:${e}`,storeShowStdio:()=>"mesh:store:show-stdio",developerMode:()=>"mesh:user:developer-mode",pluginConnection:(e,s)=>`mesh:plugin:connection:${e}:${s}`};export{A as L,q as u};
1
+ import{c as O,x as w}from"./index-C5FDJtAp.js";import{u as x}from"./useQuery-Dakt0IBq.js";import{u as I}from"./useMutation-DEocBykZ.js";function L(e){try{return JSON.parse(e)}catch{return}}function $(e,s){const t=localStorage.getItem(e),o=t?L(t):void 0,n=typeof s=="function"?s(o):o??s;if(o===void 0||n!==o)try{const a=JSON.stringify(n);localStorage.setItem(e,a)}catch{}return n}function q(e,s){const t=O.c(25),o=w();let n;t[0]!==e?(n=["localStorage",e],t[0]=e,t[1]=n):n=t[1];const a=n;let r,i;t[2]!==s||t[3]!==e?(r=()=>$(e,s),i=()=>$(e,s),t[2]=s,t[3]=e,t[4]=r,t[5]=i):(r=t[4],i=t[5]);let h;t[6]!==a||t[7]!==r||t[8]!==i?(h={queryKey:a,queryFn:r,initialData:i,staleTime:1/0,gcTime:1/0},t[6]=a,t[7]=r,t[8]=i,t[9]=h):h=t[9];const{data:v}=x(h);let l;t[10]!==e?(l=async c=>{const y=JSON.stringify(c);return localStorage.setItem(e,y),c},t[10]=e,t[11]=l):l=t[11];let m;t[12]!==o||t[13]!==a?(m=c=>{o.setQueryData(a,c)},t[12]=o,t[13]=a,t[14]=m):m=t[14];let u;t[15]!==l||t[16]!==m?(u={mutationFn:l,onSuccess:m},t[15]=l,t[16]=m,t[17]=u):u=t[17];const f=I(u);let d;t[18]!==f||t[19]!==o||t[20]!==a?(d=c=>{const y=o.getQueryData(a),C=typeof c=="function"?c(y):c;f.mutate(C)},t[18]=f,t[19]=o,t[20]=a,t[21]=d):d=t[21];const p=d,S=v;let g;return t[22]!==p||t[23]!==S?(g=[S,p],t[22]=p,t[23]=S,t[24]=g):g=t[24],g}const A={decoChatOpen:()=>"mesh:decochat:open",threadManagerState:e=>`mesh:thread-manager-state:${e}`,chatSelectedModel:e=>`mesh:chat:selectedModel:${e}`,assistantChatActiveThread:(e,s)=>`mesh:assistant-chat:active-thread:${e}:${s}`,gatewayChatActiveThread:(e,s)=>`mesh:gateway-chat:active-thread:${e}:${s}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:e=>`mesh:store:selected-registry:${e}`,orgHomeQuickstart:e=>`mesh:org-home:quickstart:${e}`,gatewaySystemPrompts:e=>`mesh:gateway:system-prompts:${e}`,storeShowStdio:()=>"mesh:store:show-stdio",developerMode:()=>"mesh:user:developer-mode",pluginConnection:(e,s)=>`mesh:plugin:connection:${e}:${s}`};export{A as L,q as u};
@@ -1 +1 @@
1
- import{u as k,r as p,a as j,j as e,b as z,S as L,N as R,c as U}from"./index-pvGhQBw9.js";import{u as T}from"./useMutation-B64mCwly.js";import{c as b,B as P}from"./button-CICpj3wE.js";import{I as E}from"./input-Chnnz9Uq.js";function B({redirectUrl:r}){const{emailAndPassword:t}=k(),[s,d]=p.useState(""),[o,u]=p.useState(""),[l,v]=p.useState(""),[i,N]=p.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"),[m,h]=p.useState(""),g=T({mutationFn:async({email:a,password:n,name:C})=>{try{if(i){const c=await j.signUp.email({email:a,password:n,name:C||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await j.signIn.email({email:a,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),r&&(window.location.href=r)}}),y=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),x=()=>{s.trim()&&!y(s)&&h("Invalid email address")},S=a=>{if(a.preventDefault(),!y(s)){h("Invalid email address");return}g.mutate({email:s,password:o,name:l})},_=a=>n=>{a(n.target.value),I&&g.reset(),a===d&&m&&h("")},f=g.isPending,I=g.error,w=i?s.trim()&&o.trim()&&l.trim():s.trim()&&o.trim(),A=a=>{if(!a)return null;const n=a.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":a.message||"An error occurred. Please try again."};return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:i?"Create your account":"Login or signup below"})}),I&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:A(I)}),t.enabled&&e.jsxs("form",{onSubmit:S,className:"grid gap-4",children:[e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:b("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(E,{type:"text",placeholder:"Your name",value:l,onChange:_(v),required:!0,disabled:f||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(E,{type:"email",placeholder:"you@example.com",value:s,onChange:_(d),onBlur:x,required:!0,disabled:f,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),e.jsx(E,{type:"password",placeholder:"••••••••",value:o,onChange:_(u),required:!0,disabled:f})]}),e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",w?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:b("p-1",!w&&"pointer-events-none"),children:e.jsx(P,{type:"submit",disabled:f||!w,className:b("w-full font-semibold"),size:"lg","aria-hidden":!w,children:f?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:e.jsx(P,{type:"button",variant:"link",onClick:()=>{N(!i),v(""),h(""),g.reset()},disabled:f,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function M(r){if(!r.client_id||r.response_type!=="code")return null;const t=new URLSearchParams;return r.client_id&&t.set("client_id",r.client_id),r.redirect_uri&&t.set("redirect_uri",r.redirect_uri),r.response_type&&t.set("response_type",r.response_type),r.state&&t.set("state",r.state),r.scope&&t.set("scope",r.scope),r.code_challenge&&t.set("code_challenge",r.code_challenge),r.code_challenge_method&&t.set("code_challenge_method",r.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function q(r){const t=U.c(5),{callbackURL:s,providerId:d}=r;let o,u;t[0]!==s||t[1]!==d?(o=()=>{(async()=>await j.signIn.sso({providerId:d,callbackURL:s}))()},u=[d,s],t[0]=s,t[1]=d,t[2]=o,t[3]=u):(o=t[2],u=t[3]),p.useEffect(o,u);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(L,{}),t[4]=l):l=t[4],l}function Y(){const r=j.useSession(),t=z({from:"/login"}),{next:s="/",client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}=t,{sso:m,emailAndPassword:h,magicLink:g,socialProviders:y}=k(),x=M({client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}),S=x||s;return r.data?x?(window.location.href=x,e.jsx(L,{})):e.jsx(R,{to:s}):m.enabled?e.jsx(q,{callbackURL:S,providerId:m.providerId}):h.enabled||g.enabled||y.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx(B,{redirectUrl:x})]})]}):e.jsx("div",{children:"No login options available"})}export{Y as default};
1
+ import{u as k,r as p,a as j,j as e,b as z,S as L,N as R,c as U}from"./index-C5FDJtAp.js";import{u as T}from"./useMutation-DEocBykZ.js";import{c as b,B as P}from"./button-ClkQLR3o.js";import{I as E}from"./input-BbWUShhD.js";function B({redirectUrl:r}){const{emailAndPassword:t}=k(),[s,d]=p.useState(""),[o,u]=p.useState(""),[l,v]=p.useState(""),[i,N]=p.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"),[m,h]=p.useState(""),g=T({mutationFn:async({email:a,password:n,name:C})=>{try{if(i){const c=await j.signUp.email({email:a,password:n,name:C||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await j.signIn.email({email:a,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),r&&(window.location.href=r)}}),y=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),x=()=>{s.trim()&&!y(s)&&h("Invalid email address")},S=a=>{if(a.preventDefault(),!y(s)){h("Invalid email address");return}g.mutate({email:s,password:o,name:l})},_=a=>n=>{a(n.target.value),I&&g.reset(),a===d&&m&&h("")},f=g.isPending,I=g.error,w=i?s.trim()&&o.trim()&&l.trim():s.trim()&&o.trim(),A=a=>{if(!a)return null;const n=a.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":a.message||"An error occurred. Please try again."};return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:i?"Create your account":"Login or signup below"})}),I&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:A(I)}),t.enabled&&e.jsxs("form",{onSubmit:S,className:"grid gap-4",children:[e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:b("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(E,{type:"text",placeholder:"Your name",value:l,onChange:_(v),required:!0,disabled:f||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(E,{type:"email",placeholder:"you@example.com",value:s,onChange:_(d),onBlur:x,required:!0,disabled:f,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),e.jsx(E,{type:"password",placeholder:"••••••••",value:o,onChange:_(u),required:!0,disabled:f})]}),e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",w?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:b("p-1",!w&&"pointer-events-none"),children:e.jsx(P,{type:"submit",disabled:f||!w,className:b("w-full font-semibold"),size:"lg","aria-hidden":!w,children:f?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:e.jsx(P,{type:"button",variant:"link",onClick:()=>{N(!i),v(""),h(""),g.reset()},disabled:f,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function M(r){if(!r.client_id||r.response_type!=="code")return null;const t=new URLSearchParams;return r.client_id&&t.set("client_id",r.client_id),r.redirect_uri&&t.set("redirect_uri",r.redirect_uri),r.response_type&&t.set("response_type",r.response_type),r.state&&t.set("state",r.state),r.scope&&t.set("scope",r.scope),r.code_challenge&&t.set("code_challenge",r.code_challenge),r.code_challenge_method&&t.set("code_challenge_method",r.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function q(r){const t=U.c(5),{callbackURL:s,providerId:d}=r;let o,u;t[0]!==s||t[1]!==d?(o=()=>{(async()=>await j.signIn.sso({providerId:d,callbackURL:s}))()},u=[d,s],t[0]=s,t[1]=d,t[2]=o,t[3]=u):(o=t[2],u=t[3]),p.useEffect(o,u);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(L,{}),t[4]=l):l=t[4],l}function Y(){const r=j.useSession(),t=z({from:"/login"}),{next:s="/",client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}=t,{sso:m,emailAndPassword:h,magicLink:g,socialProviders:y}=k(),x=M({client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}),S=x||s;return r.data?x?(window.location.href=x,e.jsx(L,{})):e.jsx(R,{to:s}):m.enabled?e.jsx(q,{callbackURL:S,providerId:m.providerId}):h.enabled||g.enabled||y.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx(B,{redirectUrl:x})]})]}):e.jsx("div",{children:"No login options available"})}export{Y as default};
@@ -1 +1 @@
1
- import{bF as T,bG as P,bH as V,bI as $}from"./index-pvGhQBw9.js";function A(n){let e=0;for(let t=0;t<n.length;t++){const o=n.charCodeAt(t);e=(e<<5)-e+o,e=e&e}return Math.abs(e).toString(16)}const U=new Map,I="mcp:oauth:callback:";class L{serverUrl;_clientMetadata;_redirectUrl;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`;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}},U.set(A(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){const a=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${a},top=${s},popup=yes`)}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(){U.delete(A(this.serverUrl))}}async function x(n){const e=new URL(`/mcp/${n.connectionId}`,window.location.origin),t=new L({serverUrl:e.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope});try{const o=new Promise((r,c)=>{const b=n.timeout||12e4;let w,h=!1;const E=t.state(),_=`${I}${E}`,l=()=>{window.removeEventListener("message",m),window.removeEventListener("storage",g),clearTimeout(w);try{localStorage.removeItem(_)}catch{}},k=async i=>{if(h)return;if(h=!0,!i.success){l(),c(new Error(i.error||"OAuth authentication failed"));return}const{code:f,state:C}=i;if(!f){l(),c(new Error("Missing authorization code"));return}if(t.getStoredState()!==C){l(),c(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const S=(await T(e))?.authorization_servers?.[0]||e,y=await P(S),d=t.clientInformation();if(!d){l(),c(new Error("Client information not found"));return}const M=t.codeVerifier(),O=await V(S,{metadata:y,clientInformation:d,authorizationCode:f,codeVerifier:M,redirectUri:t.redirectUrl,resource:new URL(e)});l(),r({tokens:O,clientId:d.client_id??null,clientSecret:"client_secret"in d?d.client_secret:null,tokenEndpoint:y?.token_endpoint??null})}catch(v){l(),c(v)}},m=async i=>{i.origin===window.location.origin&&i.data?.type==="mcp:oauth:callback"&&await k(i.data)},g=async i=>{if(!(i.key!==_||!i.newValue))try{const f=JSON.parse(i.newValue);await k(f)}catch{}};window.addEventListener("message",m),window.addEventListener("storage",g),w=setTimeout(()=>{h||(h=!0,l(),c(new Error("OAuth authentication timeout")))},b)});if(await $(t,{serverUrl:e})==="REDIRECT"){const r=await o;return{token:r.tokens.access_token,tokenInfo:{accessToken:r.tokens.access_token,refreshToken:r.tokens.refresh_token??null,expiresIn:r.tokens.expires_in??null,scope:r.tokens.scope??null,clientId:r.clientId,clientSecret:r.clientSecret,tokenEndpoint:r.tokenEndpoint},error:null}}const s=t.tokens(),u=t.clientInformation();return{token:s?.access_token||null,tokenInfo:s?{accessToken:s.access_token,refreshToken:s.refresh_token??null,expiresIn:s.expires_in??null,scope:s.scope??null,clientId:u?.client_id??null,clientSecret:u&&"client_secret"in u?u.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{t.cleanup()}}function p(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${I}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function N(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const o=n.get("error"),a=n.get("error_description");let s=t;if(t)try{const r=atob(t),c=JSON.parse(r);c.clientState&&(s=c.clientState)}catch{}if(o){const r=a||o;return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}if(!e||!t){const r="Missing code or state parameter";return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}return t=s||t,p({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}async function H({url:n,token:e}){try{const t=new Headers;t.set("Content-Type","application/json"),t.set("Accept","application/json, text/event-stream");const o=await fetch(n,{method:"POST",headers:t,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"}}})});if(o.ok)return{isAuthenticated:!0,supportsOAuth:!0};let a;try{const r=await o.json();a=r.error||r.message}catch{}return o.status>=500?{isAuthenticated:!1,supportsOAuth:!1,error:a||`HTTP ${o.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!o.headers.get("WWW-Authenticate"),error:a||`HTTP ${o.status}`}}catch(t){return console.error("[isConnectionAuthenticated] Error:",t),{isAuthenticated:!1,supportsOAuth:!1,error:t.message}}}export{x as a,N as h,H as i};
1
+ import{bE as T,bF as P,bG as V,bH as $}from"./index-C5FDJtAp.js";function A(n){let e=0;for(let t=0;t<n.length;t++){const o=n.charCodeAt(t);e=(e<<5)-e+o,e=e&e}return Math.abs(e).toString(16)}const U=new Map,I="mcp:oauth:callback:";class L{serverUrl;_clientMetadata;_redirectUrl;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`;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}},U.set(A(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){const a=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${a},top=${s},popup=yes`)}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(){U.delete(A(this.serverUrl))}}async function x(n){const e=new URL(`/mcp/${n.connectionId}`,window.location.origin),t=new L({serverUrl:e.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope});try{const o=new Promise((r,c)=>{const b=n.timeout||12e4;let w,h=!1;const E=t.state(),_=`${I}${E}`,l=()=>{window.removeEventListener("message",m),window.removeEventListener("storage",g),clearTimeout(w);try{localStorage.removeItem(_)}catch{}},k=async i=>{if(h)return;if(h=!0,!i.success){l(),c(new Error(i.error||"OAuth authentication failed"));return}const{code:f,state:C}=i;if(!f){l(),c(new Error("Missing authorization code"));return}if(t.getStoredState()!==C){l(),c(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const S=(await T(e))?.authorization_servers?.[0]||e,y=await P(S),d=t.clientInformation();if(!d){l(),c(new Error("Client information not found"));return}const M=t.codeVerifier(),O=await V(S,{metadata:y,clientInformation:d,authorizationCode:f,codeVerifier:M,redirectUri:t.redirectUrl,resource:new URL(e)});l(),r({tokens:O,clientId:d.client_id??null,clientSecret:"client_secret"in d?d.client_secret:null,tokenEndpoint:y?.token_endpoint??null})}catch(v){l(),c(v)}},m=async i=>{i.origin===window.location.origin&&i.data?.type==="mcp:oauth:callback"&&await k(i.data)},g=async i=>{if(!(i.key!==_||!i.newValue))try{const f=JSON.parse(i.newValue);await k(f)}catch{}};window.addEventListener("message",m),window.addEventListener("storage",g),w=setTimeout(()=>{h||(h=!0,l(),c(new Error("OAuth authentication timeout")))},b)});if(await $(t,{serverUrl:e})==="REDIRECT"){const r=await o;return{token:r.tokens.access_token,tokenInfo:{accessToken:r.tokens.access_token,refreshToken:r.tokens.refresh_token??null,expiresIn:r.tokens.expires_in??null,scope:r.tokens.scope??null,clientId:r.clientId,clientSecret:r.clientSecret,tokenEndpoint:r.tokenEndpoint},error:null}}const s=t.tokens(),u=t.clientInformation();return{token:s?.access_token||null,tokenInfo:s?{accessToken:s.access_token,refreshToken:s.refresh_token??null,expiresIn:s.expires_in??null,scope:s.scope??null,clientId:u?.client_id??null,clientSecret:u&&"client_secret"in u?u.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{t.cleanup()}}function p(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${I}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function N(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const o=n.get("error"),a=n.get("error_description");let s=t;if(t)try{const r=atob(t),c=JSON.parse(r);c.clientState&&(s=c.clientState)}catch{}if(o){const r=a||o;return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}if(!e||!t){const r="Missing code or state parameter";return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}return t=s||t,p({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}async function H({url:n,token:e}){try{const t=new Headers;t.set("Content-Type","application/json"),t.set("Accept","application/json, text/event-stream");const o=await fetch(n,{method:"POST",headers:t,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"}}})});if(o.ok)return{isAuthenticated:!0,supportsOAuth:!0};let a;try{const r=await o.json();a=r.error||r.message}catch{}return o.status>=500?{isAuthenticated:!1,supportsOAuth:!1,error:a||`HTTP ${o.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!o.headers.get("WWW-Authenticate"),error:a||`HTTP ${o.status}`}}catch(t){return console.error("[isConnectionAuthenticated] Error:",t),{isAuthenticated:!1,supportsOAuth:!1,error:t.message}}}export{x as a,N as h,H as i};
@@ -1 +1 @@
1
- import{r as B,c as V,j as a}from"./index-pvGhQBw9.js";import{b as O,T as q,c as J}from"./tooltip-DySBr2SY.js";import{c as M,B as K}from"./button-CICpj3wE.js";import{s as Q}from"./registry-utils-h9Ud__h7.js";import{i as X}from"./Lock01-C1zaHQP8.js";import{s as Y}from"./Plus-WrA7kzKa.js";import{i as ee}from"./Terminal-BtV_FLPF.js";import{C as te}from"./card-BMkFh6vi.js";import{I as se}from"./empty-state-B8LlErgw.js";import{g as le}from"./github-icon-Dp3wHhYE.js";const U=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";const W=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 10 4.08 10 5.2 10Zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 22 4.08 22 5.2 22Z"}));W.displayName="Server01";function ie(s){if(!s.includes("/"))return s;const e=s.split("/"),l=e[0],i=e[1];if(!l||!i)return s;if(l.includes(".")){const n=l.split("."),r=n[n.length-1]||l,o=i.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!o||o.length<2?r:o}return i}function ae(s){const e=V.c(2),{protocol:l,className:i}=s;let n;return e[0]!==i?(n={http:a.jsx(Q,{className:i}),sse:a.jsx(W,{className:i}),stdio:a.jsx(ee,{className:i})},e[0]=i,e[1]=n):n=e[1],n[l]}function ne(s){switch(s){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function re(s){const e=V.c(9),{protocol:l}=s;let i;e[0]!==l?(i=M("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[l]),e[0]=l,e[1]=i):i=e[1];let n,r;e[2]!==l?(n=a.jsx(ae,{protocol:l,className:"w-3 h-3"}),r=ne(l),e[2]=l,e[3]=n,e[4]=r):(n=e[3],r=e[4]);let o;return e[5]!==i||e[6]!==n||e[7]!==r?(o=a.jsxs("div",{className:i,children:[n,r]}),e[5]=i,e[6]=n,e[7]=r,e[8]=o):o=e[8],o}function oe(s){const e=V.c(68),{icon:l,displayName:i,description:n,onClick:r}=s,t=(s.variant??"store")==="server",f=t?s.hostname:null,m=t?s.protocol:null,c=t?s.isInstalling:!1,d=t?s.actionLabel:void 0,p=t?null:s.scopeName,_=t?!1:s.isVerified,x=t?!0:s.canInstall,H=t?"p-4":"p-6";let u;e[0]!==H?(u=M("cursor-pointer hover:bg-muted/50 transition-colors",H),e[0]=H,e[1]=u):u=e[1];const R=t?"gap-3":"gap-4";let h;e[2]!==R?(h=M("flex flex-col h-full relative",R),e[2]=R,e[3]=h):h=e[3];const Z=t?"sm":"md";let g;e[4]!==i||e[5]!==l||e[6]!==Z?(g=a.jsx(se,{icon:l,name:i,size:Z,className:"shadow-sm shrink-0"}),e[4]=i,e[5]=l,e[6]=Z,e[7]=g):g=e[7];const G=t?"text-sm":"text-base";let v;e[8]!==G?(v=M("flex items-center gap-2 font-medium min-w-0",G),e[8]=G,e[9]=v):v=e[9];let j;e[10]!==i?(j=a.jsx("span",{className:"truncate",children:i}),e[10]=i,e[11]=j):j=e[11];let N;e[12]!==t||e[13]!==_?(N=!t&&_&&a.jsx(U,{size:16,className:"text-success shrink-0"}),e[12]=t,e[13]=_,e[14]=N):N=e[14];let C;e[15]!==x||e[16]!==t?(C=!t&&!x&&a.jsx(X,{size:16,className:"text-muted-foreground shrink-0"}),e[15]=x,e[16]=t,e[17]=C):C=e[17];let k;e[18]!==t||e[19]!==m?(k=t&&m&&a.jsx(re,{protocol:m}),e[18]=t,e[19]=m,e[20]=k):k=e[20];let b;e[21]!==C||e[22]!==k||e[23]!==v||e[24]!==j||e[25]!==N?(b=a.jsx(O,{asChild:!0,children:a.jsxs("div",{className:v,children:[j,N,C,k]})}),e[21]=C,e[22]=k,e[23]=v,e[24]=j,e[25]=N,e[26]=b):b=e[26];let w;e[27]!==i?(w=a.jsx("p",{children:i}),e[27]=i,e[28]=w):w=e[28];let y;e[29]!==x||e[30]!==t?(y=!t&&!x&&a.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[29]=x,e[30]=t,e[31]=y):y=e[31];let I;e[32]!==w||e[33]!==y?(I=a.jsxs(q,{children:[w,y]}),e[32]=w,e[33]=y,e[34]=I):I=e[34];let $;e[35]!==b||e[36]!==I?($=a.jsxs(J,{children:[b,I]}),e[35]=b,e[36]=I,e[37]=$):$=e[37];let L;e[38]!==f||e[39]!==t||e[40]!==p?(L=(p||f)&&a.jsx("div",{className:M("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:p||f}),e[38]=f,e[39]=t,e[40]=p,e[41]=L):L=e[41];let P;e[42]!==$||e[43]!==L?(P=a.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[$,L]})}),e[42]=$,e[43]=L,e[44]=P):P=e[44];let S;e[45]!==P||e[46]!==g?(S=a.jsxs("div",{className:"flex gap-3",children:[g,P]}),e[45]=P,e[46]=g,e[47]=S):S=e[47];let T;e[48]!==n?(T=n&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:n}),e[48]=n,e[49]=T):T=e[49];let E;e[50]!==n||e[51]!==t?(E=!n&&!t&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[50]=n,e[51]=t,e[52]=E):E=e[52];let z;e[53]!==d||e[54]!==c||e[55]!==t||e[56]!==r?(z=t&&a.jsxs(K,{variant:"outline",size:"sm",onClick:F=>{F.stopPropagation(),r()},disabled:c,className:"w-full mt-auto cursor-pointer",children:[a.jsx(Y,{size:16}),c?"Connecting...":d||"Connect"]}),e[53]=d,e[54]=c,e[55]=t,e[56]=r,e[57]=z):z=e[57];let D;e[58]!==S||e[59]!==T||e[60]!==E||e[61]!==z||e[62]!==h?(D=a.jsxs("div",{className:h,children:[S,T,E,z]}),e[58]=S,e[59]=T,e[60]=E,e[61]=z,e[62]=h,e[63]=D):D=e[63];let A;return e[64]!==r||e[65]!==u||e[66]!==D?(A=a.jsx(te,{className:u,onClick:r,children:D}),e[64]=r,e[65]=u,e[66]=D,e[67]=A):A=e[67],A}function ce(s){const e=s.title||s.server.title||s.id||"Unnamed Item",l=s._meta?.["mcp.mesh"],i=l?.short_description||l?.mesh_description||s.server.description||null,n=s.server.icons?.[0]?.src||le(s.server.repository)||null,r=l?.verified??!1,o=(s.server.remotes?.length??0)>0,t=(s.server.packages?.length??0)>0,f=o||t;let m=e,c=null;if(e.includes("/")){const d=e.split("/");d.length>=2&&(c=d[0]||null,m=ie(e))}if(!c){const d=l?.scopeName,p=l?.appName;d&&p?c=`${d}/${p}`:d&&(c=d)}return l?.friendly_name&&(m=l.friendly_name),{icon:n,scopeName:c,displayName:m,description:i,isVerified:r,canInstall:f}}function Ne(s){const e=V.c(12),{items:l,title:i,onItemClick:n}=s;if(l.length===0)return null;let r;e[0]!==i?(r=i&&a.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:a.jsx("h2",{className:"text-lg font-medium",children:i})}),e[0]=i,e[1]=r):r=e[1];let o;if(e[2]!==l||e[3]!==n){let m;e[5]!==n?(m=c=>{const d=ce(c);return a.jsx(oe,{...d,onClick:()=>n(c)},c.id)},e[5]=n,e[6]=m):m=e[6],o=l.map(m),e[2]=l,e[3]=n,e[4]=o}else o=e[4];let t;e[7]!==o?(t=a.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=t):t=e[8];let f;return e[9]!==r||e[10]!==t?(f=a.jsxs("div",{className:"flex flex-col gap-4",children:[r,t]}),e[9]=r,e[10]=t,e[11]=f):f=e[11],f}export{Ne as M,oe as a,W as b,ie as e};
1
+ import{r as B,c as V,j as a}from"./index-C5FDJtAp.js";import{b as O,T as q,c as J}from"./tooltip-DXYcokUT.js";import{c as M,B as K}from"./button-ClkQLR3o.js";import{s as Q}from"./registry-utils-BPPApxjf.js";import{i as X}from"./Lock01-jUZQmYfl.js";import{s as Y}from"./Plus-DCVckKM0.js";import{i as ee}from"./Terminal-DwE3k3eb.js";import{C as te}from"./card-CwMKn79y.js";import{I as se}from"./empty-state-C0gi-aAx.js";import{g as le}from"./github-icon-Dp3wHhYE.js";const U=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";const W=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 10 4.08 10 5.2 10Zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 22 4.08 22 5.2 22Z"}));W.displayName="Server01";function ie(s){if(!s.includes("/"))return s;const e=s.split("/"),l=e[0],i=e[1];if(!l||!i)return s;if(l.includes(".")){const n=l.split("."),r=n[n.length-1]||l,o=i.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!o||o.length<2?r:o}return i}function ae(s){const e=V.c(2),{protocol:l,className:i}=s;let n;return e[0]!==i?(n={http:a.jsx(Q,{className:i}),sse:a.jsx(W,{className:i}),stdio:a.jsx(ee,{className:i})},e[0]=i,e[1]=n):n=e[1],n[l]}function ne(s){switch(s){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function re(s){const e=V.c(9),{protocol:l}=s;let i;e[0]!==l?(i=M("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[l]),e[0]=l,e[1]=i):i=e[1];let n,r;e[2]!==l?(n=a.jsx(ae,{protocol:l,className:"w-3 h-3"}),r=ne(l),e[2]=l,e[3]=n,e[4]=r):(n=e[3],r=e[4]);let o;return e[5]!==i||e[6]!==n||e[7]!==r?(o=a.jsxs("div",{className:i,children:[n,r]}),e[5]=i,e[6]=n,e[7]=r,e[8]=o):o=e[8],o}function oe(s){const e=V.c(68),{icon:l,displayName:i,description:n,onClick:r}=s,t=(s.variant??"store")==="server",f=t?s.hostname:null,m=t?s.protocol:null,c=t?s.isInstalling:!1,d=t?s.actionLabel:void 0,p=t?null:s.scopeName,_=t?!1:s.isVerified,x=t?!0:s.canInstall,H=t?"p-4":"p-6";let u;e[0]!==H?(u=M("cursor-pointer hover:bg-muted/50 transition-colors",H),e[0]=H,e[1]=u):u=e[1];const R=t?"gap-3":"gap-4";let h;e[2]!==R?(h=M("flex flex-col h-full relative",R),e[2]=R,e[3]=h):h=e[3];const Z=t?"sm":"md";let g;e[4]!==i||e[5]!==l||e[6]!==Z?(g=a.jsx(se,{icon:l,name:i,size:Z,className:"shadow-sm shrink-0"}),e[4]=i,e[5]=l,e[6]=Z,e[7]=g):g=e[7];const G=t?"text-sm":"text-base";let v;e[8]!==G?(v=M("flex items-center gap-2 font-medium min-w-0",G),e[8]=G,e[9]=v):v=e[9];let j;e[10]!==i?(j=a.jsx("span",{className:"truncate",children:i}),e[10]=i,e[11]=j):j=e[11];let N;e[12]!==t||e[13]!==_?(N=!t&&_&&a.jsx(U,{size:16,className:"text-success shrink-0"}),e[12]=t,e[13]=_,e[14]=N):N=e[14];let C;e[15]!==x||e[16]!==t?(C=!t&&!x&&a.jsx(X,{size:16,className:"text-muted-foreground shrink-0"}),e[15]=x,e[16]=t,e[17]=C):C=e[17];let k;e[18]!==t||e[19]!==m?(k=t&&m&&a.jsx(re,{protocol:m}),e[18]=t,e[19]=m,e[20]=k):k=e[20];let b;e[21]!==C||e[22]!==k||e[23]!==v||e[24]!==j||e[25]!==N?(b=a.jsx(O,{asChild:!0,children:a.jsxs("div",{className:v,children:[j,N,C,k]})}),e[21]=C,e[22]=k,e[23]=v,e[24]=j,e[25]=N,e[26]=b):b=e[26];let w;e[27]!==i?(w=a.jsx("p",{children:i}),e[27]=i,e[28]=w):w=e[28];let y;e[29]!==x||e[30]!==t?(y=!t&&!x&&a.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[29]=x,e[30]=t,e[31]=y):y=e[31];let I;e[32]!==w||e[33]!==y?(I=a.jsxs(q,{children:[w,y]}),e[32]=w,e[33]=y,e[34]=I):I=e[34];let $;e[35]!==b||e[36]!==I?($=a.jsxs(J,{children:[b,I]}),e[35]=b,e[36]=I,e[37]=$):$=e[37];let L;e[38]!==f||e[39]!==t||e[40]!==p?(L=(p||f)&&a.jsx("div",{className:M("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:p||f}),e[38]=f,e[39]=t,e[40]=p,e[41]=L):L=e[41];let P;e[42]!==$||e[43]!==L?(P=a.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[$,L]})}),e[42]=$,e[43]=L,e[44]=P):P=e[44];let S;e[45]!==P||e[46]!==g?(S=a.jsxs("div",{className:"flex gap-3",children:[g,P]}),e[45]=P,e[46]=g,e[47]=S):S=e[47];let T;e[48]!==n?(T=n&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:n}),e[48]=n,e[49]=T):T=e[49];let E;e[50]!==n||e[51]!==t?(E=!n&&!t&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[50]=n,e[51]=t,e[52]=E):E=e[52];let z;e[53]!==d||e[54]!==c||e[55]!==t||e[56]!==r?(z=t&&a.jsxs(K,{variant:"outline",size:"sm",onClick:F=>{F.stopPropagation(),r()},disabled:c,className:"w-full mt-auto cursor-pointer",children:[a.jsx(Y,{size:16}),c?"Connecting...":d||"Connect"]}),e[53]=d,e[54]=c,e[55]=t,e[56]=r,e[57]=z):z=e[57];let D;e[58]!==S||e[59]!==T||e[60]!==E||e[61]!==z||e[62]!==h?(D=a.jsxs("div",{className:h,children:[S,T,E,z]}),e[58]=S,e[59]=T,e[60]=E,e[61]=z,e[62]=h,e[63]=D):D=e[63];let A;return e[64]!==r||e[65]!==u||e[66]!==D?(A=a.jsx(te,{className:u,onClick:r,children:D}),e[64]=r,e[65]=u,e[66]=D,e[67]=A):A=e[67],A}function ce(s){const e=s.title||s.server.title||s.id||"Unnamed Item",l=s._meta?.["mcp.mesh"],i=l?.short_description||l?.mesh_description||s.server.description||null,n=s.server.icons?.[0]?.src||le(s.server.repository)||null,r=l?.verified??!1,o=(s.server.remotes?.length??0)>0,t=(s.server.packages?.length??0)>0,f=o||t;let m=e,c=null;if(e.includes("/")){const d=e.split("/");d.length>=2&&(c=d[0]||null,m=ie(e))}if(!c){const d=l?.scopeName,p=l?.appName;d&&p?c=`${d}/${p}`:d&&(c=d)}return l?.friendly_name&&(m=l.friendly_name),{icon:n,scopeName:c,displayName:m,description:i,isVerified:r,canInstall:f}}function Ne(s){const e=V.c(12),{items:l,title:i,onItemClick:n}=s;if(l.length===0)return null;let r;e[0]!==i?(r=i&&a.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:a.jsx("h2",{className:"text-lg font-medium",children:i})}),e[0]=i,e[1]=r):r=e[1];let o;if(e[2]!==l||e[3]!==n){let m;e[5]!==n?(m=c=>{const d=ce(c);return a.jsx(oe,{...d,onClick:()=>n(c)},c.id)},e[5]=n,e[6]=m):m=e[6],o=l.map(m),e[2]=l,e[3]=n,e[4]=o}else o=e[4];let t;e[7]!==o?(t=a.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=t):t=e[8];let f;return e[9]!==r||e[10]!==t?(f=a.jsxs("div",{className:"flex flex-col gap-4",children:[r,t]}),e[9]=r,e[10]=t,e[11]=f):f=e[11],f}export{Ne as M,oe as a,W as b,ie as e};
@@ -1 +1 @@
1
- import{r as q,c as R,j as s,f as $e,d as Qe,b as Xe,a as Ye,t as Le}from"./index-pvGhQBw9.js";import{i as Ze}from"./AlertCircle-CMyS46jH.js";import{i as De}from"./Loading01-DxDL3s7X.js";import{B as ae}from"./button-CICpj3wE.js";import{i as Je}from"./ArrowLeft-Dsh9IWd-.js";import{I as Re,E as et}from"./empty-state-B8LlErgw.js";import{i as tt,e as st}from"./extract-connection-data-DSV8dsp9.js";import{t as ot}from"./ChevronDown-BRxtl0-A.js";import{s as Pe}from"./Plus-WrA7kzKa.js";import{D as rt,c as nt,a as it,b as lt}from"./dropdown-menu-D1uHrxpy.js";import{n as Me}from"./LinkExternal01-5OOaoko1.js";import{T as at,R as ct}from"./tools-list-DsOacuX3.js";import{R as dt}from"./resource-tabs-Blq_ajNW.js";import{s as mt,f as ft,g as ut,c as pt}from"./registry-utils-h9Ud__h7.js";import{a as xt,b as ht,e as gt}from"./mcp-server-card-CsdbMsCj.js";import{i as vt}from"./Terminal-BtV_FLPF.js";import{a as bt,u as jt,b as yt}from"./use-connection-BF1UFzlw.js";import{a as Nt}from"./use-binding-s4bqKdJA.js";import{u as St}from"./use-tool-call-BMUEJvVc.js";import{u as Ct}from"./use-mcp-C-3NLCFo.js";import{u as wt,L as _t}from"./localstorage-keys-CdhAbc7P.js";import{u as Ee}from"./project-context-provider-CUiGxKJp.js";import{s as It}from"./slugify-CEUa2lfQ.js";import{e as kt,g as Tt}from"./github-icon-Dp3wHhYE.js";import{i as Lt}from"./InfoCircle-Na8jygcw.js";import{c as Pt}from"./connection-Mp3hTHGP.js";import"./constants-DsV2FGIq.js";import"./generate-id-Dyweu44Y.js";import"./Grid01-CoHgfBeE.js";import"./useQuery-Dr4r_H_i.js";import"./File06-De52zO32.js";import"./collection-display-button-3hmFOeDC.js";import"./ArrowUp-CXsDJznS.js";import"./Check-BEhtk6Py.js";import"./List-BXC8ldIg.js";import"./tooltip-DySBr2SY.js";import"./view-mode-toggle-DXknlAX3.js";import"./collection-search-ClK_cOgs.js";import"./SearchMd-JSFwoON0.js";import"./input-Chnnz9Uq.js";import"./collection-table-wrapper-CUsQQB3S.js";import"./card-BMkFh6vi.js";import"./layout-CE7L7dZF.js";import"./badge-BkSn2oaB.js";import"./Lock01-C1zaHQP8.js";import"./use-collections-JQXbZBdV.js";import"./useMutation-B64mCwly.js";import"./binder-BVHRVoIY.js";const Ae=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));Ae.displayName="SearchLg";function Mt(t){const e=R.c(3),{message:o}=t,r=o===void 0?"Loading MCP Server details...":o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(De,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==r?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,s.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[1]=r,e[2]=i):i=e[2],i}function Vt(t){const e=R.c(9),{error:o,onBack:r}=t,n=o instanceof Error?o.message:o;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ze,{size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==n?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==r?(l=s.jsx("button",{onClick:r,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=r,e[5]=l):l=e[5];let d;return e[6]!==c||e[7]!==l?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=d):d=e[8],d}function $t(t){const e=R.c(5),{onBack:o}=t;let r,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ae,{size:48,className:"text-muted-foreground mb-4"}),n=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=r,e[1]=n,e[2]=i):(r=e[0],n=e[1],i=e[2]);let a;return e[3]!==o?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,n,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=a):a=e[4],a}function Dt(t){const e=R.c(3),{onBack:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Je,{}),e[0]=r):r=e[0];let n;return e[1]!==o?(n=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ae,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:r})})}),e[1]=o,e[2]=n):n=e[2],n}function Ve(t){const e=R.c(26),{versions:o,selectedIndex:r,onSelect:n,isInstalling:i,variant:a,showLabel:c}=t,l=i===void 0?!1:i,d=a===void 0?"brand":a,w=c===void 0?!1:c,u=o[r],S=w?"sm":"default",v=d==="brand"?"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer":"shrink-0 cursor-pointer";let _;e[0]!==u?.server?.version||e[1]!==w?(_=w&&s.jsxs("span",{className:"mr-1",children:["v",u?.server?.version||"unknown"]}),e[0]=u?.server?.version,e[1]=w,e[2]=_):_=e[2];const p=w?14:20;let b;e[3]!==p?(b=s.jsx(ot,{size:p}),e[3]=p,e[4]=b):b=e[4];let m;e[5]!==l||e[6]!==S||e[7]!==v||e[8]!==_||e[9]!==b||e[10]!==d?(m=s.jsx(rt,{asChild:!0,children:s.jsxs(ae,{variant:d,disabled:l,size:S,className:v,children:[_,b]})}),e[5]=l,e[6]=S,e[7]=v,e[8]=_,e[9]=b,e[10]=d,e[11]=m):m=e[11];let g;if(e[12]!==l||e[13]!==n||e[14]!==r||e[15]!==o){let y;e[17]!==l||e[18]!==n||e[19]!==r?(y=(j,N)=>{const I=j._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(nt,{onClick:()=>n(N),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",j.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),N===r&&s.jsx(tt,{size:16,className:"text-muted-foreground shrink-0"})]})},N)},e[17]=l,e[18]=n,e[19]=r,e[20]=y):y=e[20],g=o.map(y),e[12]=l,e[13]=n,e[14]=r,e[15]=o,e[16]=g}else g=e[16];let x;e[21]!==g?(x=s.jsx(it,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:g}),e[21]=g,e[22]=x):x=e[22];let T;return e[23]!==x||e[24]!==m?(T=s.jsxs(lt,{children:[m,x]}),e[23]=x,e[24]=m,e[25]=T):T=e[25],T}function Rt(t){const e=R.c(46),{data:o,itemVersions:r,onInstall:n,canInstall:i,isInstalling:a,hideInstallControls:c,selectedVersionIndex:l,onVersionChange:d}=t,w=i===void 0?!0:i,u=a===void 0?!1:a,S=c===void 0?!1:c,[v,_]=q.useState(0),p=l??v;let b;e[0]!==d?(b=U=>{_(U),d?.(U)},e[0]=d,e[1]=b):b=e[1];const m=b,g=r[p]||r[0];let x;e[2]!==g?.server?.remotes?(x=g?.server?.remotes??[],e[2]=g?.server?.remotes,e[3]=x):x=e[3];const T=x;let y;e[4]!==g?.server?.packages?(y=g?.server?.packages??[],e[4]=g?.server?.packages,e[5]=y):y=e[5];const N=y.length>0,I=T.length>0,M=T.findIndex(At),h=M>=0?M:0;let K;e[6]!==h||e[7]!==N||e[8]!==I||e[9]!==n||e[10]!==p?(K=()=>{I?n(p,h,void 0):N&&n(p,void 0,0)},e[6]=h,e[7]=N,e[8]=I,e[9]=n,e[10]=p,e[11]=K):K=e[11];const E=K;let G;e[12]!==r||e[13]!==n||e[14]!==m?(G=U=>{m(U);const J=r[U],W=J?.server?.remotes??[],Q=J?.server?.packages??[];if(W.length>0){const X=W.findIndex(Et);n(U,X>=0?X:0,void 0)}else Q.length>0&&n(U,void 0,0)},e[12]=r,e[13]=n,e[14]=m,e[15]=G):G=e[15];const L=G;let V;e[16]!==o.icon||e[17]!==o.name?(V=s.jsx(Re,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=o.icon,e[17]=o.name,e[18]=V):V=e[18];let P;e[19]!==o.name?(P=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[19]=o.name,e[20]=P):P=e[20];let z;e[21]!==o.verified?(z=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=o.verified,e[22]=z):z=e[22];let O;e[23]!==P||e[24]!==z?(O=s.jsxs("div",{className:"flex items-center gap-2",children:[P,z]}),e[23]=P,e[24]=z,e[25]=O):O=e[25];let H;e[26]!==o.shortDescription?(H=o.shortDescription&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.shortDescription}),e[26]=o.shortDescription,e[27]=H):H=e[27];let $;e[28]!==O||e[29]!==H?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[O,H]}),e[28]=O,e[29]=H,e[30]=$):$=e[30];let A;e[31]!==w||e[32]!==E||e[33]!==L||e[34]!==S||e[35]!==u||e[36]!==r||e[37]!==p||e[38]!==m?(A=w&&!S?s.jsx("div",{className:"shrink-0 flex items-center gap-2",children:r.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ae,{variant:"brand",onClick:E,disabled:u,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(Pe,{size:20}),u?"Connecting...":"Connect"]}),s.jsx(Ve,{versions:r,selectedIndex:p,onSelect:L,isInstalling:u,variant:"brand"})]}):s.jsxs(ae,{variant:"brand",onClick:E,disabled:r.length===0||u,className:"shrink-0 cursor-pointer",children:[s.jsx(Pe,{size:20}),u?"Connecting...":"Connect"]})}):S?r.length>1?s.jsx("div",{className:"shrink-0",children:s.jsx(Ve,{versions:r,selectedIndex:p,onSelect:m,isInstalling:u,variant:"outline",showLabel:!0})}):null:s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=w,e[32]=E,e[33]=L,e[34]=S,e[35]=u,e[36]=r,e[37]=p,e[38]=m,e[39]=A):A=e[39];let C;e[40]!==$||e[41]!==A?(C=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[$,A]}),e[40]=$,e[41]=A,e[42]=C):C=e[42];let k;return e[43]!==C||e[44]!==V?(k=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[V,C]}),e[43]=C,e[44]=V,e[45]=k):k=e[45],k}function Et(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function At(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Ut(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function Bt(t){const e=R.c(47),{data:o,publisherInfo:r,selectedItem:n}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const a=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let c;e[2]!==r.logo||e[3]!==a?(c=s.jsx(Re,{icon:r.logo,name:a,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=r.logo,e[3]=a,e[4]=c):c=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let d;e[7]!==l?(d=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=d):d=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=w):w=e[9];let u;e[10]!==d?(u=s.jsxs("div",{children:[d,w]}),e[10]=d,e[11]=u):u=e[11];let S;e[12]!==c||e[13]!==u?(S=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,u]})}),e[12]=c,e[13]=u,e[14]=S):S=e[14];let v;e[15]!==o.version?(v=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[15]=o.version,e[16]=v):v=e[16];let _;e[17]!==o.tags?(_=o.tags&&o.tags.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.tags.map(Ot)})]}),e[17]=o.tags,e[18]=_):_=e[18];let p;e[19]!==o.categories?(p=o.categories&&o.categories.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.categories.map(zt)})]}),e[19]=o.categories,e[20]=p):p=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let m;e[23]!==o.schemaVersion?(m=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=m):m=e[24];let g;e[25]!==o.websiteUrl?(g=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(Me,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=g):g=e[26];let x;e[27]!==o.repository?(x=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(Me,{size:14})]})]}),e[27]=o.repository,e[28]=x):x=e[28];let T;e[29]!==_||e[30]!==p||e[31]!==b||e[32]!==m||e[33]!==g||e[34]!==x||e[35]!==v?(T=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[v,_,p,b,m,g,x]}),e[29]=_,e[30]=p,e[31]=b,e[32]=m,e[33]=g,e[34]=x,e[35]=v,e[36]=T):T=e[36];let y;e[37]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=y):y=e[37];let j;e[38]!==n.updated_at?(j=Ut(n.updated_at),e[38]=n.updated_at,e[39]=j):j=e[39];let N;e[40]!==j?(N=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[y,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:j})]}),e[40]=j,e[41]=N):N=e[41];let I;return e[42]!==i||e[43]!==T||e[44]!==N||e[45]!==S?(I=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,S,T,N]}),e[42]=i,e[43]=T,e[44]=N,e[45]=S,e[46]=I):I=e[46],I}function zt(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function Ot(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}const Ft=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],Gt={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Ht(t){if(!t)return"Local";try{return new URL(t).hostname}catch{return t}}function Wt(t){if(!t)return"local";try{const e=new URL(t).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function qt(t){const e=Gt[t.toLowerCase()];return e||t.replace(/[-_]/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function Kt(t){if(!t)return"http";const e=t.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function Qt(t){return t.map((e,o)=>{const r=Kt(e.type),n=Ht(e.url),i=Wt(e.url),a=e.title||e.name||qt(i);return{index:o,protocol:r,url:e.url,hostname:n,serviceName:i,displayName:a,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Xt(t){const e=R.c(2),{protocol:o,className:r}=t;let n;return e[0]!==r?(n={http:s.jsx(mt,{className:r}),sse:s.jsx(ht,{className:r}),stdio:s.jsx(vt,{className:r})},e[0]=r,e[1]=n):n=e[1],n[o]}function Yt(t){const e=R.c(10),{options:o,selected:r,onSelect:n}=t;if(o.length<=1)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=i):i=e[0];let a;if(e[1]!==n||e[2]!==o||e[3]!==r){let l;e[5]!==n||e[6]!==r?(l=d=>s.jsxs(ae,{variant:r===d.value?"default":"outline",size:"sm",onClick:()=>n(d.value),className:"cursor-pointer",children:[s.jsx(Xt,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=n,e[6]=r,e[7]=l):l=e[7],a=o.map(l),e[1]=n,e[2]=o,e[3]=r,e[4]=a}else a=e[4];let c;return e[8]!==a?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i,s.jsx("div",{className:"flex gap-1",children:a})]}),e[8]=a,e[9]=c):c=e[9],c}function Zt(t){const e=R.c(11),{servers:o,onInstall:r,isInstalling:n,icon:i,mcpName:a,showStdio:c}=t,l=n===void 0?!1:n,d=c===void 0?!1:c,w=d?o:o.filter(ss),u=Qt(w),S=u.length<13?"all":"http",[v,_]=q.useState(S);let p;e:{if(v==="all"){p="all";break e}let h;if(e[0]!==v?(h=E=>E.protocol===v,e[0]=v,e[1]=h):h=e[1],u.some(h)){p=v;break e}if(u.length<13){p="all";break e}p=u[0]?.protocol??"http"}const b=p,m=b==="all"?u:u.filter(h=>h.protocol===b),g=new Set(u.map(ts));let x=Ft.filter(h=>h.value==="all"||g.has(h.value));d||(x=x.filter(es));const T=g.size<=1?x.filter(Jt):x,y="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let j;e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==r?(j=h=>s.jsx(xt,{variant:"server",icon:i??null,displayName:h.displayName,description:h.description??null,hostname:h.hostname,protocol:h.protocol,isInstalling:l,onClick:()=>r({type:h.protocol,url:h.url,name:h.name,title:h.title,description:h.description,_type:h._type,_index:h._index})},`${h.hostname}-${h.protocol}-${h.index}`),e[2]=i,e[3]=l,e[4]=a,e[5]=r,e[6]=j):j=e[6];const N=m.map(j);let I;e[7]!==N?(I=s.jsx("div",{className:y,children:N}),e[7]=N,e[8]=I):I=e[8];let M;return e[9]!==m.length?(M=m.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=m.length,e[10]=M):M=e[10],s.jsxs("div",{className:"p-5",children:[s.jsx(Yt,{options:T,selected:b,onSelect:_}),I,M]})}function Jt(t){return t.value!=="all"}function es(t){return t.value!=="stdio"}function ts(t){return t.protocol}function ss(t){return t.type?.toLowerCase()!=="stdio"}function os(t){const e=R.c(29),{data:o,availableTabs:r,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:a,onTabChange:c,servers:l,onInstallServer:d,isInstalling:w,mcpIcon:u,mcpName:S,showStdio:v}=t,_=a===void 0?!1:a;let p;e[0]!==l?(p=l===void 0?[]:l,e[0]=l,e[1]=p):p=e[1];const b=p,m=w===void 0?!1:w,g=v===void 0?!1:v;let x;e[2]!==i?(x=i.map(rs),e[2]=i,e[3]=x):x=e[3];const T=x;let y;e[4]!==r||e[5]!==n||e[6]!==c?(y=r.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(dt,{tabs:r,activeTab:n,onTabChange:c})}),e[4]=r,e[5]=n,e[6]=c,e[7]=y):y=e[7];let j;e[8]!==n||e[9]!==m||e[10]!==u||e[11]!==S||e[12]!==d||e[13]!==b||e[14]!==g?(j=n==="servers"&&b.length>0&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Zt,{servers:b,onInstall:h=>d?.(h),isInstalling:m,icon:u,mcpName:S,showStdio:g})}),e[8]=n,e[9]=m,e[10]=u,e[11]=S,e[12]=d,e[13]=b,e[14]=g,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==i.length||e[18]!==_||e[19]!==T?(N=n==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:_?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(De,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(at,{tools:T,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):s.jsx(et,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[16]=n,e[17]=i.length,e[18]=_,e[19]=T,e[20]=N):N=e[20];let I;e[21]!==o?.repository||e[22]!==n?(I=n==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(ct,{repository:o?.repository})}),e[21]=o?.repository,e[22]=n,e[23]=I):I=e[23];let M;return e[24]!==I||e[25]!==y||e[26]!==j||e[27]!==N?(M=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[y,j,N,I]}),e[24]=I,e[25]=y,e[26]=j,e[27]=N,e[28]=M):M=e[28],M}function rs(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ns(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(r=>r.app_name?.toLowerCase()===o||r.app_id?.toLowerCase()===o||r.title.toLowerCase()===o)||t.find(r=>r.title.toLowerCase().includes(o))}function is(t,e,o,r,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:r?.icon||void 0,count:n??t.length};const i=e.toLowerCase(),a=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function ls(t){const e=t._meta?.["mcp.mesh"],o=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,n=ut(r.remotes?.[0]?.type),i=pt(r.$schema),a=o?"io.modelcontextprotocol.registry/official":t.publisher||e?.scopeName||"Unknown",c=Tt(r.repository),l=t.icon||t.image||t.logo||r.icons?.[0]?.src||c||null,d=t.name||t.title||t.server?.title||"Unnamed Item",w=gt(d),u=e?.friendly_name||w,S=e?.mesh_description||t.description||t.summary||r?.description||"",v=e?.short_description||null,_=e?.tags||[],p=e?.categories||[];return{name:u,description:S,shortDescription:v,icon:l,verified:t.verified||e?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:_,categories:p,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class as extends q.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store MCP server detail error:",e,o)}render(){return this.state.hasError?s.jsx(Vt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function cs(){const t=R.c(67),{org:e}=Ee(),o=$e();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{appName:n}=Qe(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c,stdio:l}=Xe(i);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=_t.storeShowStdio(),t[2]=d):d=t[2];const[w,u]=wt(d,js),S=l==="true"?!0:l==="false"?!1:w;l!==void 0&&l==="true"!==w&&u(l==="true");const[v,_]=q.useState(null),[p,b]=q.useState(null),m=bt(),g=jt(),{data:x}=Ye.useSession(),T=Nt(g),y=a||T[0]?.id||"",j=yt(y),N=ft(j?.tools),I=j?.tools&&j.tools.find(bs)?.name||"",M=j?.tools&&j.tools.find(vs)?.name||"",h=Pt(y),K=!!c;let E,G;K?(E=I||M,G={name:c}):(E=N,G={});const{data:L}=St({toolCaller:h,toolName:E,toolInputParams:G,scope:y});let V=[],P=[],z=null;if(L){if(Array.isArray(L))V=L;else if(typeof L=="object"&&L!==null)if("totalCount"in L&&typeof L.totalCount=="number"&&(z=L.totalCount),"item"in L&&L.item){const f=L.item,D=f.id||"",Z=f.server,le=f._meta;let B;t[3]!==f.title||t[4]!==D||t[5]!==Z||t[6]!==le?(B=[{id:D,title:f.title,server:Z,_meta:le}],t[3]=f.title,t[4]=D,t[5]=Z,t[6]=le,t[7]=B):B=t[7],V=B}else{let f;"versions"in L&&Array.isArray(L.versions)?f="versions":"servers"in L&&Array.isArray(L.servers)?f="servers":f=Object.keys(L).find(D=>Array.isArray(L[D])),f&&(V=L[f],(f==="versions"||E?.includes("VERSIONS"))&&(P=V))}}const O=P.findIndex(gs),H=O>=0?O:0,$=p??H;let A;t[8]!==n?(A=f=>{const D=f.name||f.title||f.server.title||"";return It(D)===n},t[8]=n,t[9]=A):A=t[9];let C=V.find(A);if(!C&&c){let f;t[10]!==c?(f=D=>D.server.name===c||D.name===c||D.title===c,t[10]=c,t[11]=f):f=t[11],C=V.find(f)}const k=C?ls(C):null,U=(k?.tools?.length||0)>0,J=C?.server?.remotes?.[0]?.url||null,W=!U&&!!J,Q=Ct({url:W?J:""}),ye=W&&Q.state==="connecting";let X;t[12]!==Q||t[13]!==W?(X=W&&Q.state==="ready"?(Q.tools||[]).map(hs):[],t[12]=Q,t[13]=W,t[14]=X):X=t[14];const Te=X,ce=U?k?.tools||[]:Te,Ue=ns(g,k?.publisher),Ne=k?is(V,k.publisher,Ue,j??null,z):{count:0},Be=k?.repository?kt(k.repository):null,ze=C?.server?.remotes??[],Oe=C?.server?.packages??[],Se=[...ze.map(xs),...Oe.map(ps)],de=S?Se:Se.filter(us),ee=de.length>1;let te;t[15]!==ee||t[16]!==de.length?(te={id:"servers",label:"Servers",count:de.length,visible:ee},t[15]=ee,t[16]=de.length,t[17]=te):te=t[17];const Ce=!!k?.repository&&!!Be;let se;t[18]!==Ce?(se={id:"readme",label:"README",visible:Ce},t[18]=Ce,t[19]=se):se=t[19];const we=U||Te.length>0||ye&&!!J;let oe;t[20]!==ce.length||t[21]!==we?(oe={id:"tools",label:"Tools",count:ce.length,visible:we},t[20]=ce.length,t[21]=we,t[22]=oe):oe=t[22];let me;t[23]!==te||t[24]!==se||t[25]!==oe?(me=[te,se,oe].filter(fs),t[23]=te,t[24]=se,t[25]=oe,t[26]=me):me=t[26];const F=me;let fe;t[27]!==F?(fe=F.find(ms)?.id||F.find(ds)?.id||F[0]?.id||"overview",t[27]=F,t[28]=fe):fe=t[28];const _e=fe;let ue;t[29]!==v||t[30]!==F||t[31]!==_e?(ue=v&&F.find(f=>f.id===v)?v:_e,t[29]=v,t[30]=F,t[31]=_e,t[32]=ue):ue=t[32];const Fe=ue;let pe;t[33]!==m||t[34]!==P||t[35]!==o||t[36]!==e||t[37]!==C||t[38]!==x?(pe=async(f,D,Z)=>{const le=P[f??0]||C;if(!le||!e||!x?.user?.id)return;const B=st(le,e.id,x.user.id,{remoteIndex:Z===void 0?D??0:void 0,packageIndex:Z}),We=B.connection_type==="STDIO",qe=!!B.connection_url,Ke=We&&B.connection_headers&&typeof B.connection_headers=="object"&&"command"in B.connection_headers;if(!qe&&!Ke){Le.error("This MCP Server cannot be connected: no connection method available");return}try{const{id:Ie}=await m.create.mutateAsync(B);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:Ie}})}catch(Ie){const ke=Ie;Le.error(`Failed to connect MCP Server: ${ke instanceof Error?ke.message:String(ke)}`)}},t[33]=m,t[34]=P,t[35]=o,t[36]=e,t[37]=C,t[38]=x,t[39]=pe):pe=t[39];const Y=pe;let xe;t[40]!==o||t[41]!==e.slug?(xe=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[40]=o,t[41]=e.slug,t[42]=xe):xe=t[42];const re=xe;if(!C){let f;return t[43]!==re?(f=s.jsx($t,{onBack:re}),t[43]=re,t[44]=f):f=t[44],f}if(!k)return null;const Ge=(C?.server?.remotes?.length??0)>0,He=(C?.server?.packages?.length??0)>0,ne=Ge||He;let he;t[45]!==re?(he=s.jsx(Dt,{onBack:re}),t[45]=re,t[46]=he):he=t[46];let ge;t[47]!==ne?(ge=!ne&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(Lt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[47]=ne,t[48]=ge):ge=t[48];let ie;t[49]!==P||t[50]!==C?(ie=P.length>0?P:[C],t[49]=P,t[50]=C,t[51]=ie):ie=t[51];let ve;t[52]!==m.create.isPending||t[53]!==ne||t[54]!==k||t[55]!==$||t[56]!==Y||t[57]!==ee||t[58]!==ie?(ve=s.jsx(Rt,{data:k,itemVersions:ie,onInstall:Y,canInstall:ne,isInstalling:m.create.isPending,hideInstallControls:ee,selectedVersionIndex:$,onVersionChange:b}),t[52]=m.create.isPending,t[53]=ne,t[54]=k,t[55]=$,t[56]=Y,t[57]=ee,t[58]=ie,t[59]=ve):ve=t[59];let be;t[60]!==k||t[61]!==Ne||t[62]!==C?(be=s.jsx(Bt,{data:k,publisherInfo:Ne,selectedItem:C}),t[60]=k,t[61]=Ne,t[62]=C,t[63]=be):be=t[63];let je;return t[64]!==$||t[65]!==Y?(je=f=>{f._type==="remote"?Y($,f._index,void 0):Y($,void 0,f._index)},t[64]=$,t[65]=Y,t[66]=je):je=t[66],s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[he,s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[ge,ve,s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[be,s.jsx(os,{data:k,availableTabs:F,effectiveActiveTabId:Fe,effectiveTools:ce,isLoadingTools:ye,onTabChange:_,servers:Se,onInstallServer:je,isInstalling:m.create.isPending,mcpIcon:k.icon,mcpName:k.name,showStdio:S})]})]})})})]})}function ds(t){return t.id==="readme"}function ms(t){return t.id==="servers"}function fs(t){return t.visible}function us(t){return t.type?.toLowerCase()!=="stdio"}function ps(t,e){return{type:"stdio",url:void 0,name:t.name||t.identifier,title:t.name||t.identifier?.replace(/^@[^/]+\//,""),description:t.environmentVariables?.length?`Requires ${t.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:e}}function xs(t,e){return{...t,_type:"remote",_index:e}}function hs(t){return{name:t.name,description:t.description}}function gs(t){return t._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0}function vs(t){return t.name.endsWith("_GET")}function bs(t){return t.name.endsWith("_VERSIONS")}function js(){return!1}function ho(){const t=R.c(6),{org:e}=Ee(),o=$e();let r;t[0]!==o||t[1]!==e.slug?(r=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=r):r=t[2];const n=r;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q.Suspense,{fallback:s.jsx(Mt,{}),children:s.jsx(cs,{})}),t[3]=i):i=t[3];let a;return t[4]!==n?(a=s.jsx(as,{onBack:n,children:i}),t[4]=n,t[5]=a):a=t[5],a}export{ho as default};
1
+ import{r as q,c as R,j as s,f as $e,d as Qe,b as Xe,a as Ye,t as Le}from"./index-C5FDJtAp.js";import{i as Ze}from"./AlertCircle-CIFhWg2i.js";import{i as De}from"./Loading01-BhuF3K1g.js";import{B as ae}from"./button-ClkQLR3o.js";import{i as Je}from"./ArrowLeft-D0vIuW0V.js";import{I as Re,E as et}from"./empty-state-C0gi-aAx.js";import{i as tt,e as st}from"./extract-connection-data-nsOyk4eb.js";import{t as ot}from"./ChevronDown-QF_Tgl2v.js";import{s as Pe}from"./Plus-DCVckKM0.js";import{D as rt,c as nt,a as it,b as lt}from"./dropdown-menu-C4Ypstre.js";import{n as Me}from"./LinkExternal01-Dbxh7ZV2.js";import{T as at,R as ct}from"./tools-list-pl3Bsjpf.js";import{R as dt}from"./resource-tabs-CKatVKnl.js";import{s as mt,f as ft,g as ut,c as pt}from"./registry-utils-BPPApxjf.js";import{a as xt,b as ht,e as gt}from"./mcp-server-card-D4bCdTAY.js";import{i as vt}from"./Terminal-DwE3k3eb.js";import{a as bt,u as jt,b as yt}from"./use-connection-ClVfoZWG.js";import{u as Nt}from"./use-binding-Cmi2FEqF.js";import{u as St}from"./use-tool-call-BH-yOcTy.js";import{u as Ct}from"./use-mcp-hlkUt7pz.js";import{u as wt,L as _t}from"./localstorage-keys-BZEjwsD0.js";import{u as Ee}from"./project-context-provider-DH0iqA5D.js";import{s as It}from"./slugify-CEUa2lfQ.js";import{e as kt,g as Tt}from"./github-icon-Dp3wHhYE.js";import{i as Lt}from"./InfoCircle-xFKFZGrj.js";import{c as Pt}from"./connection-BcYehfdK.js";import"./constants-BIwbIZhE.js";import"./generate-id-Dyweu44Y.js";import"./Grid01-DwtrqYPx.js";import"./useQuery-Dakt0IBq.js";import"./File06-BM3BX-NC.js";import"./collection-display-button-CdHXoeVD.js";import"./ArrowUp-MjJJcV-O.js";import"./Check-LvJ1lSFr.js";import"./List-D2PJPXod.js";import"./tooltip-DXYcokUT.js";import"./view-mode-toggle-C5hz9T3M.js";import"./collection-search-CF1o4yO7.js";import"./SearchMd-tLR3QB8E.js";import"./input-BbWUShhD.js";import"./collection-table-wrapper-jfSAC6dF.js";import"./card-CwMKn79y.js";import"./layout-BnqnCJOk.js";import"./badge-Do7WFlPI.js";import"./Lock01-jUZQmYfl.js";import"./use-collections-DxMxR_jZ.js";import"./useMutation-DEocBykZ.js";import"./binder-B3GXUIAu.js";const Ae=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));Ae.displayName="SearchLg";function Mt(t){const e=R.c(3),{message:o}=t,r=o===void 0?"Loading MCP Server details...":o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(De,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==r?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,s.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[1]=r,e[2]=i):i=e[2],i}function Vt(t){const e=R.c(9),{error:o,onBack:r}=t,n=o instanceof Error?o.message:o;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ze,{size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==n?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==r?(l=s.jsx("button",{onClick:r,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=r,e[5]=l):l=e[5];let d;return e[6]!==c||e[7]!==l?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=d):d=e[8],d}function $t(t){const e=R.c(5),{onBack:o}=t;let r,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ae,{size:48,className:"text-muted-foreground mb-4"}),n=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=r,e[1]=n,e[2]=i):(r=e[0],n=e[1],i=e[2]);let a;return e[3]!==o?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,n,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=a):a=e[4],a}function Dt(t){const e=R.c(3),{onBack:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Je,{}),e[0]=r):r=e[0];let n;return e[1]!==o?(n=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ae,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:r})})}),e[1]=o,e[2]=n):n=e[2],n}function Ve(t){const e=R.c(26),{versions:o,selectedIndex:r,onSelect:n,isInstalling:i,variant:a,showLabel:c}=t,l=i===void 0?!1:i,d=a===void 0?"brand":a,w=c===void 0?!1:c,u=o[r],S=w?"sm":"default",v=d==="brand"?"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer":"shrink-0 cursor-pointer";let _;e[0]!==u?.server?.version||e[1]!==w?(_=w&&s.jsxs("span",{className:"mr-1",children:["v",u?.server?.version||"unknown"]}),e[0]=u?.server?.version,e[1]=w,e[2]=_):_=e[2];const p=w?14:20;let b;e[3]!==p?(b=s.jsx(ot,{size:p}),e[3]=p,e[4]=b):b=e[4];let m;e[5]!==l||e[6]!==S||e[7]!==v||e[8]!==_||e[9]!==b||e[10]!==d?(m=s.jsx(rt,{asChild:!0,children:s.jsxs(ae,{variant:d,disabled:l,size:S,className:v,children:[_,b]})}),e[5]=l,e[6]=S,e[7]=v,e[8]=_,e[9]=b,e[10]=d,e[11]=m):m=e[11];let g;if(e[12]!==l||e[13]!==n||e[14]!==r||e[15]!==o){let y;e[17]!==l||e[18]!==n||e[19]!==r?(y=(j,N)=>{const I=j._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(nt,{onClick:()=>n(N),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",j.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),N===r&&s.jsx(tt,{size:16,className:"text-muted-foreground shrink-0"})]})},N)},e[17]=l,e[18]=n,e[19]=r,e[20]=y):y=e[20],g=o.map(y),e[12]=l,e[13]=n,e[14]=r,e[15]=o,e[16]=g}else g=e[16];let x;e[21]!==g?(x=s.jsx(it,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:g}),e[21]=g,e[22]=x):x=e[22];let T;return e[23]!==x||e[24]!==m?(T=s.jsxs(lt,{children:[m,x]}),e[23]=x,e[24]=m,e[25]=T):T=e[25],T}function Rt(t){const e=R.c(46),{data:o,itemVersions:r,onInstall:n,canInstall:i,isInstalling:a,hideInstallControls:c,selectedVersionIndex:l,onVersionChange:d}=t,w=i===void 0?!0:i,u=a===void 0?!1:a,S=c===void 0?!1:c,[v,_]=q.useState(0),p=l??v;let b;e[0]!==d?(b=U=>{_(U),d?.(U)},e[0]=d,e[1]=b):b=e[1];const m=b,g=r[p]||r[0];let x;e[2]!==g?.server?.remotes?(x=g?.server?.remotes??[],e[2]=g?.server?.remotes,e[3]=x):x=e[3];const T=x;let y;e[4]!==g?.server?.packages?(y=g?.server?.packages??[],e[4]=g?.server?.packages,e[5]=y):y=e[5];const N=y.length>0,I=T.length>0,M=T.findIndex(At),h=M>=0?M:0;let K;e[6]!==h||e[7]!==N||e[8]!==I||e[9]!==n||e[10]!==p?(K=()=>{I?n(p,h,void 0):N&&n(p,void 0,0)},e[6]=h,e[7]=N,e[8]=I,e[9]=n,e[10]=p,e[11]=K):K=e[11];const E=K;let G;e[12]!==r||e[13]!==n||e[14]!==m?(G=U=>{m(U);const J=r[U],W=J?.server?.remotes??[],Q=J?.server?.packages??[];if(W.length>0){const X=W.findIndex(Et);n(U,X>=0?X:0,void 0)}else Q.length>0&&n(U,void 0,0)},e[12]=r,e[13]=n,e[14]=m,e[15]=G):G=e[15];const L=G;let V;e[16]!==o.icon||e[17]!==o.name?(V=s.jsx(Re,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=o.icon,e[17]=o.name,e[18]=V):V=e[18];let P;e[19]!==o.name?(P=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[19]=o.name,e[20]=P):P=e[20];let z;e[21]!==o.verified?(z=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=o.verified,e[22]=z):z=e[22];let O;e[23]!==P||e[24]!==z?(O=s.jsxs("div",{className:"flex items-center gap-2",children:[P,z]}),e[23]=P,e[24]=z,e[25]=O):O=e[25];let H;e[26]!==o.shortDescription?(H=o.shortDescription&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.shortDescription}),e[26]=o.shortDescription,e[27]=H):H=e[27];let $;e[28]!==O||e[29]!==H?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[O,H]}),e[28]=O,e[29]=H,e[30]=$):$=e[30];let A;e[31]!==w||e[32]!==E||e[33]!==L||e[34]!==S||e[35]!==u||e[36]!==r||e[37]!==p||e[38]!==m?(A=w&&!S?s.jsx("div",{className:"shrink-0 flex items-center gap-2",children:r.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ae,{variant:"brand",onClick:E,disabled:u,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(Pe,{size:20}),u?"Connecting...":"Connect"]}),s.jsx(Ve,{versions:r,selectedIndex:p,onSelect:L,isInstalling:u,variant:"brand"})]}):s.jsxs(ae,{variant:"brand",onClick:E,disabled:r.length===0||u,className:"shrink-0 cursor-pointer",children:[s.jsx(Pe,{size:20}),u?"Connecting...":"Connect"]})}):S?r.length>1?s.jsx("div",{className:"shrink-0",children:s.jsx(Ve,{versions:r,selectedIndex:p,onSelect:m,isInstalling:u,variant:"outline",showLabel:!0})}):null:s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=w,e[32]=E,e[33]=L,e[34]=S,e[35]=u,e[36]=r,e[37]=p,e[38]=m,e[39]=A):A=e[39];let C;e[40]!==$||e[41]!==A?(C=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[$,A]}),e[40]=$,e[41]=A,e[42]=C):C=e[42];let k;return e[43]!==C||e[44]!==V?(k=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[V,C]}),e[43]=C,e[44]=V,e[45]=k):k=e[45],k}function Et(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function At(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Ut(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function Bt(t){const e=R.c(47),{data:o,publisherInfo:r,selectedItem:n}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const a=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let c;e[2]!==r.logo||e[3]!==a?(c=s.jsx(Re,{icon:r.logo,name:a,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=r.logo,e[3]=a,e[4]=c):c=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let d;e[7]!==l?(d=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=d):d=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=w):w=e[9];let u;e[10]!==d?(u=s.jsxs("div",{children:[d,w]}),e[10]=d,e[11]=u):u=e[11];let S;e[12]!==c||e[13]!==u?(S=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,u]})}),e[12]=c,e[13]=u,e[14]=S):S=e[14];let v;e[15]!==o.version?(v=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[15]=o.version,e[16]=v):v=e[16];let _;e[17]!==o.tags?(_=o.tags&&o.tags.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.tags.map(Ot)})]}),e[17]=o.tags,e[18]=_):_=e[18];let p;e[19]!==o.categories?(p=o.categories&&o.categories.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.categories.map(zt)})]}),e[19]=o.categories,e[20]=p):p=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let m;e[23]!==o.schemaVersion?(m=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=m):m=e[24];let g;e[25]!==o.websiteUrl?(g=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(Me,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=g):g=e[26];let x;e[27]!==o.repository?(x=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(Me,{size:14})]})]}),e[27]=o.repository,e[28]=x):x=e[28];let T;e[29]!==_||e[30]!==p||e[31]!==b||e[32]!==m||e[33]!==g||e[34]!==x||e[35]!==v?(T=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[v,_,p,b,m,g,x]}),e[29]=_,e[30]=p,e[31]=b,e[32]=m,e[33]=g,e[34]=x,e[35]=v,e[36]=T):T=e[36];let y;e[37]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=y):y=e[37];let j;e[38]!==n.updated_at?(j=Ut(n.updated_at),e[38]=n.updated_at,e[39]=j):j=e[39];let N;e[40]!==j?(N=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[y,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:j})]}),e[40]=j,e[41]=N):N=e[41];let I;return e[42]!==i||e[43]!==T||e[44]!==N||e[45]!==S?(I=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,S,T,N]}),e[42]=i,e[43]=T,e[44]=N,e[45]=S,e[46]=I):I=e[46],I}function zt(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function Ot(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}const Ft=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],Gt={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Ht(t){if(!t)return"Local";try{return new URL(t).hostname}catch{return t}}function Wt(t){if(!t)return"local";try{const e=new URL(t).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function qt(t){const e=Gt[t.toLowerCase()];return e||t.replace(/[-_]/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function Kt(t){if(!t)return"http";const e=t.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function Qt(t){return t.map((e,o)=>{const r=Kt(e.type),n=Ht(e.url),i=Wt(e.url),a=e.title||e.name||qt(i);return{index:o,protocol:r,url:e.url,hostname:n,serviceName:i,displayName:a,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Xt(t){const e=R.c(2),{protocol:o,className:r}=t;let n;return e[0]!==r?(n={http:s.jsx(mt,{className:r}),sse:s.jsx(ht,{className:r}),stdio:s.jsx(vt,{className:r})},e[0]=r,e[1]=n):n=e[1],n[o]}function Yt(t){const e=R.c(10),{options:o,selected:r,onSelect:n}=t;if(o.length<=1)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=i):i=e[0];let a;if(e[1]!==n||e[2]!==o||e[3]!==r){let l;e[5]!==n||e[6]!==r?(l=d=>s.jsxs(ae,{variant:r===d.value?"default":"outline",size:"sm",onClick:()=>n(d.value),className:"cursor-pointer",children:[s.jsx(Xt,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=n,e[6]=r,e[7]=l):l=e[7],a=o.map(l),e[1]=n,e[2]=o,e[3]=r,e[4]=a}else a=e[4];let c;return e[8]!==a?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i,s.jsx("div",{className:"flex gap-1",children:a})]}),e[8]=a,e[9]=c):c=e[9],c}function Zt(t){const e=R.c(11),{servers:o,onInstall:r,isInstalling:n,icon:i,mcpName:a,showStdio:c}=t,l=n===void 0?!1:n,d=c===void 0?!1:c,w=d?o:o.filter(ss),u=Qt(w),S=u.length<13?"all":"http",[v,_]=q.useState(S);let p;e:{if(v==="all"){p="all";break e}let h;if(e[0]!==v?(h=E=>E.protocol===v,e[0]=v,e[1]=h):h=e[1],u.some(h)){p=v;break e}if(u.length<13){p="all";break e}p=u[0]?.protocol??"http"}const b=p,m=b==="all"?u:u.filter(h=>h.protocol===b),g=new Set(u.map(ts));let x=Ft.filter(h=>h.value==="all"||g.has(h.value));d||(x=x.filter(es));const T=g.size<=1?x.filter(Jt):x,y="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let j;e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==r?(j=h=>s.jsx(xt,{variant:"server",icon:i??null,displayName:h.displayName,description:h.description??null,hostname:h.hostname,protocol:h.protocol,isInstalling:l,onClick:()=>r({type:h.protocol,url:h.url,name:h.name,title:h.title,description:h.description,_type:h._type,_index:h._index})},`${h.hostname}-${h.protocol}-${h.index}`),e[2]=i,e[3]=l,e[4]=a,e[5]=r,e[6]=j):j=e[6];const N=m.map(j);let I;e[7]!==N?(I=s.jsx("div",{className:y,children:N}),e[7]=N,e[8]=I):I=e[8];let M;return e[9]!==m.length?(M=m.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=m.length,e[10]=M):M=e[10],s.jsxs("div",{className:"p-5",children:[s.jsx(Yt,{options:T,selected:b,onSelect:_}),I,M]})}function Jt(t){return t.value!=="all"}function es(t){return t.value!=="stdio"}function ts(t){return t.protocol}function ss(t){return t.type?.toLowerCase()!=="stdio"}function os(t){const e=R.c(29),{data:o,availableTabs:r,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:a,onTabChange:c,servers:l,onInstallServer:d,isInstalling:w,mcpIcon:u,mcpName:S,showStdio:v}=t,_=a===void 0?!1:a;let p;e[0]!==l?(p=l===void 0?[]:l,e[0]=l,e[1]=p):p=e[1];const b=p,m=w===void 0?!1:w,g=v===void 0?!1:v;let x;e[2]!==i?(x=i.map(rs),e[2]=i,e[3]=x):x=e[3];const T=x;let y;e[4]!==r||e[5]!==n||e[6]!==c?(y=r.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(dt,{tabs:r,activeTab:n,onTabChange:c})}),e[4]=r,e[5]=n,e[6]=c,e[7]=y):y=e[7];let j;e[8]!==n||e[9]!==m||e[10]!==u||e[11]!==S||e[12]!==d||e[13]!==b||e[14]!==g?(j=n==="servers"&&b.length>0&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Zt,{servers:b,onInstall:h=>d?.(h),isInstalling:m,icon:u,mcpName:S,showStdio:g})}),e[8]=n,e[9]=m,e[10]=u,e[11]=S,e[12]=d,e[13]=b,e[14]=g,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==i.length||e[18]!==_||e[19]!==T?(N=n==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:_?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(De,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(at,{tools:T,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):s.jsx(et,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[16]=n,e[17]=i.length,e[18]=_,e[19]=T,e[20]=N):N=e[20];let I;e[21]!==o?.repository||e[22]!==n?(I=n==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(ct,{repository:o?.repository})}),e[21]=o?.repository,e[22]=n,e[23]=I):I=e[23];let M;return e[24]!==I||e[25]!==y||e[26]!==j||e[27]!==N?(M=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[y,j,N,I]}),e[24]=I,e[25]=y,e[26]=j,e[27]=N,e[28]=M):M=e[28],M}function rs(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ns(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(r=>r.app_name?.toLowerCase()===o||r.app_id?.toLowerCase()===o||r.title.toLowerCase()===o)||t.find(r=>r.title.toLowerCase().includes(o))}function is(t,e,o,r,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:r?.icon||void 0,count:n??t.length};const i=e.toLowerCase(),a=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function ls(t){const e=t._meta?.["mcp.mesh"],o=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,n=ut(r.remotes?.[0]?.type),i=pt(r.$schema),a=o?"io.modelcontextprotocol.registry/official":t.publisher||e?.scopeName||"Unknown",c=Tt(r.repository),l=t.icon||t.image||t.logo||r.icons?.[0]?.src||c||null,d=t.name||t.title||t.server?.title||"Unnamed Item",w=gt(d),u=e?.friendly_name||w,S=e?.mesh_description||t.description||t.summary||r?.description||"",v=e?.short_description||null,_=e?.tags||[],p=e?.categories||[];return{name:u,description:S,shortDescription:v,icon:l,verified:t.verified||e?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:_,categories:p,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class as extends q.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store MCP server detail error:",e,o)}render(){return this.state.hasError?s.jsx(Vt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function cs(){const t=R.c(67),{org:e}=Ee(),o=$e();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{appName:n}=Qe(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c,stdio:l}=Xe(i);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=_t.storeShowStdio(),t[2]=d):d=t[2];const[w,u]=wt(d,js),S=l==="true"?!0:l==="false"?!1:w;l!==void 0&&l==="true"!==w&&u(l==="true");const[v,_]=q.useState(null),[p,b]=q.useState(null),m=bt(),g=jt(),{data:x}=Ye.useSession(),T=Nt(g),y=a||T[0]?.id||"",j=yt(y),N=ft(j?.tools),I=j?.tools&&j.tools.find(bs)?.name||"",M=j?.tools&&j.tools.find(vs)?.name||"",h=Pt(y),K=!!c;let E,G;K?(E=I||M,G={name:c}):(E=N,G={});const{data:L}=St({toolCaller:h,toolName:E,toolInputParams:G,scope:y});let V=[],P=[],z=null;if(L){if(Array.isArray(L))V=L;else if(typeof L=="object"&&L!==null)if("totalCount"in L&&typeof L.totalCount=="number"&&(z=L.totalCount),"item"in L&&L.item){const f=L.item,D=f.id||"",Z=f.server,le=f._meta;let B;t[3]!==f.title||t[4]!==D||t[5]!==Z||t[6]!==le?(B=[{id:D,title:f.title,server:Z,_meta:le}],t[3]=f.title,t[4]=D,t[5]=Z,t[6]=le,t[7]=B):B=t[7],V=B}else{let f;"versions"in L&&Array.isArray(L.versions)?f="versions":"servers"in L&&Array.isArray(L.servers)?f="servers":f=Object.keys(L).find(D=>Array.isArray(L[D])),f&&(V=L[f],(f==="versions"||E?.includes("VERSIONS"))&&(P=V))}}const O=P.findIndex(gs),H=O>=0?O:0,$=p??H;let A;t[8]!==n?(A=f=>{const D=f.name||f.title||f.server.title||"";return It(D)===n},t[8]=n,t[9]=A):A=t[9];let C=V.find(A);if(!C&&c){let f;t[10]!==c?(f=D=>D.server.name===c||D.name===c||D.title===c,t[10]=c,t[11]=f):f=t[11],C=V.find(f)}const k=C?ls(C):null,U=(k?.tools?.length||0)>0,J=C?.server?.remotes?.[0]?.url||null,W=!U&&!!J,Q=Ct({url:W?J:""}),ye=W&&Q.state==="connecting";let X;t[12]!==Q||t[13]!==W?(X=W&&Q.state==="ready"?(Q.tools||[]).map(hs):[],t[12]=Q,t[13]=W,t[14]=X):X=t[14];const Te=X,ce=U?k?.tools||[]:Te,Ue=ns(g,k?.publisher),Ne=k?is(V,k.publisher,Ue,j??null,z):{count:0},Be=k?.repository?kt(k.repository):null,ze=C?.server?.remotes??[],Oe=C?.server?.packages??[],Se=[...ze.map(xs),...Oe.map(ps)],de=S?Se:Se.filter(us),ee=de.length>1;let te;t[15]!==ee||t[16]!==de.length?(te={id:"servers",label:"Servers",count:de.length,visible:ee},t[15]=ee,t[16]=de.length,t[17]=te):te=t[17];const Ce=!!k?.repository&&!!Be;let se;t[18]!==Ce?(se={id:"readme",label:"README",visible:Ce},t[18]=Ce,t[19]=se):se=t[19];const we=U||Te.length>0||ye&&!!J;let oe;t[20]!==ce.length||t[21]!==we?(oe={id:"tools",label:"Tools",count:ce.length,visible:we},t[20]=ce.length,t[21]=we,t[22]=oe):oe=t[22];let me;t[23]!==te||t[24]!==se||t[25]!==oe?(me=[te,se,oe].filter(fs),t[23]=te,t[24]=se,t[25]=oe,t[26]=me):me=t[26];const F=me;let fe;t[27]!==F?(fe=F.find(ms)?.id||F.find(ds)?.id||F[0]?.id||"overview",t[27]=F,t[28]=fe):fe=t[28];const _e=fe;let ue;t[29]!==v||t[30]!==F||t[31]!==_e?(ue=v&&F.find(f=>f.id===v)?v:_e,t[29]=v,t[30]=F,t[31]=_e,t[32]=ue):ue=t[32];const Fe=ue;let pe;t[33]!==m||t[34]!==P||t[35]!==o||t[36]!==e||t[37]!==C||t[38]!==x?(pe=async(f,D,Z)=>{const le=P[f??0]||C;if(!le||!e||!x?.user?.id)return;const B=st(le,e.id,x.user.id,{remoteIndex:Z===void 0?D??0:void 0,packageIndex:Z}),We=B.connection_type==="STDIO",qe=!!B.connection_url,Ke=We&&B.connection_headers&&typeof B.connection_headers=="object"&&"command"in B.connection_headers;if(!qe&&!Ke){Le.error("This MCP Server cannot be connected: no connection method available");return}try{const{id:Ie}=await m.create.mutateAsync(B);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:Ie}})}catch(Ie){const ke=Ie;Le.error(`Failed to connect MCP Server: ${ke instanceof Error?ke.message:String(ke)}`)}},t[33]=m,t[34]=P,t[35]=o,t[36]=e,t[37]=C,t[38]=x,t[39]=pe):pe=t[39];const Y=pe;let xe;t[40]!==o||t[41]!==e.slug?(xe=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[40]=o,t[41]=e.slug,t[42]=xe):xe=t[42];const re=xe;if(!C){let f;return t[43]!==re?(f=s.jsx($t,{onBack:re}),t[43]=re,t[44]=f):f=t[44],f}if(!k)return null;const Ge=(C?.server?.remotes?.length??0)>0,He=(C?.server?.packages?.length??0)>0,ne=Ge||He;let he;t[45]!==re?(he=s.jsx(Dt,{onBack:re}),t[45]=re,t[46]=he):he=t[46];let ge;t[47]!==ne?(ge=!ne&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(Lt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[47]=ne,t[48]=ge):ge=t[48];let ie;t[49]!==P||t[50]!==C?(ie=P.length>0?P:[C],t[49]=P,t[50]=C,t[51]=ie):ie=t[51];let ve;t[52]!==m.create.isPending||t[53]!==ne||t[54]!==k||t[55]!==$||t[56]!==Y||t[57]!==ee||t[58]!==ie?(ve=s.jsx(Rt,{data:k,itemVersions:ie,onInstall:Y,canInstall:ne,isInstalling:m.create.isPending,hideInstallControls:ee,selectedVersionIndex:$,onVersionChange:b}),t[52]=m.create.isPending,t[53]=ne,t[54]=k,t[55]=$,t[56]=Y,t[57]=ee,t[58]=ie,t[59]=ve):ve=t[59];let be;t[60]!==k||t[61]!==Ne||t[62]!==C?(be=s.jsx(Bt,{data:k,publisherInfo:Ne,selectedItem:C}),t[60]=k,t[61]=Ne,t[62]=C,t[63]=be):be=t[63];let je;return t[64]!==$||t[65]!==Y?(je=f=>{f._type==="remote"?Y($,f._index,void 0):Y($,void 0,f._index)},t[64]=$,t[65]=Y,t[66]=je):je=t[66],s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[he,s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[ge,ve,s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[be,s.jsx(os,{data:k,availableTabs:F,effectiveActiveTabId:Fe,effectiveTools:ce,isLoadingTools:ye,onTabChange:_,servers:Se,onInstallServer:je,isInstalling:m.create.isPending,mcpIcon:k.icon,mcpName:k.name,showStdio:S})]})]})})})]})}function ds(t){return t.id==="readme"}function ms(t){return t.id==="servers"}function fs(t){return t.visible}function us(t){return t.type?.toLowerCase()!=="stdio"}function ps(t,e){return{type:"stdio",url:void 0,name:t.name||t.identifier,title:t.name||t.identifier?.replace(/^@[^/]+\//,""),description:t.environmentVariables?.length?`Requires ${t.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:e}}function xs(t,e){return{...t,_type:"remote",_index:e}}function hs(t){return{name:t.name,description:t.description}}function gs(t){return t._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0}function vs(t){return t.name.endsWith("_GET")}function bs(t){return t.name.endsWith("_VERSIONS")}function js(){return!1}function ho(){const t=R.c(6),{org:e}=Ee(),o=$e();let r;t[0]!==o||t[1]!==e.slug?(r=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=r):r=t[2];const n=r;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q.Suspense,{fallback:s.jsx(Mt,{}),children:s.jsx(cs,{})}),t[3]=i):i=t[3];let a;return t[4]!==n?(a=s.jsx(as,{onBack:n,children:i}),t[4]=n,t[5]=a):a=t[5],a}export{ho as default};