@decocms/mesh 2.74.0 → 2.76.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 (159) hide show
  1. package/dist/client/assets/{AlertCircle-C_hR5usO.js → AlertCircle-TbirTaeA.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-DnJUZ1OS.js → ArrowUp-DVhz9MPT.js} +1 -1
  3. package/dist/client/assets/{Calendar-Dnf0_EY9.js → Calendar-BhleOqT-.js} +1 -1
  4. package/dist/client/assets/{Check-Sa4xK5Hg.js → Check-BIlnRzi6.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-DRhauZbp.js → CheckCircle-CSYoAEm3.js} +1 -1
  6. package/dist/client/assets/{CheckDone01-I6GfoGdi.js → CheckDone01-gZo2F6uL.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-DmXLJeAy.js → ChevronDown-jAfIG9nZ.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-By4KEpZh.js → ChevronRight-CNYkXy1u.js} +1 -1
  9. package/dist/client/assets/{Code01-h_k8K-1e.js → Code01-DeVT5m93.js} +1 -1
  10. package/dist/client/assets/{Copy01-jvqvZrKj.js → Copy01-BJPi2nBZ.js} +1 -1
  11. package/dist/client/assets/{DotsHorizontal-CQJNqVgu.js → DotsHorizontal-CZIcl0Ye.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-gLXmVMYI.js → DotsVertical-CPJps54j.js} +1 -1
  13. package/dist/client/assets/{Download01-BKmVPJWY.js → Download01-BVA62GFI.js} +1 -1
  14. package/dist/client/assets/{Edit01-BT8zEtQL.js → Edit01-CLT1AKyh.js} +1 -1
  15. package/dist/client/assets/{File02-BNE7fmK0.js → File02-M7e4eeKQ.js} +1 -1
  16. package/dist/client/assets/{File06-WU23pV9H.js → File06-BUOJeS0C.js} +1 -1
  17. package/dist/client/assets/{FilterLines-DJEB3mgx.js → FilterLines-CDkZPaiO.js} +1 -1
  18. package/dist/client/assets/{Globe02-Dp5eUbS2.js → Globe02-CNtZ4Mz7.js} +1 -1
  19. package/dist/client/assets/{Grid01-CSAsqBFD.js → Grid01-BhCIE3UE.js} +1 -1
  20. package/dist/client/assets/{Home02-BUr926Eo.js → Home02-Zp_wVezk.js} +1 -1
  21. package/dist/client/assets/{Image01-BnbXZOf7.js → Image01-Bmljn0R6.js} +1 -1
  22. package/dist/client/assets/{Inbox01-XFeiQPbg.js → Inbox01-Bz-1SNbb.js} +1 -1
  23. package/dist/client/assets/{InfoCircle-5xWfOa8P.js → InfoCircle-DutDNmXq.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-BJLPX8tt.js → LinkExternal01-npl2D9IH.js} +1 -1
  25. package/dist/client/assets/{List-kXpaJIIp.js → List-B95opsr5.js} +1 -1
  26. package/dist/client/assets/{Loading01-D8zw0cyg.js → Loading01-CudhqwtJ.js} +1 -1
  27. package/dist/client/assets/{Lock01-DCDiY4HG.js → Lock01-C3j5poil.js} +1 -1
  28. package/dist/client/assets/{Pin01-DWsvacVo.js → Pin01-DpTwe7GO.js} +1 -1
  29. package/dist/client/assets/{Play-Yhg_pcqU.js → Play-BxFFyAEF.js} +1 -1
  30. package/dist/client/assets/{Plus-BBD2SckJ.js → Plus-BVPnBK8D.js} +1 -1
  31. package/dist/client/assets/RefreshCcw01-Dzlid7sh.js +1 -0
  32. package/dist/client/assets/{SearchMd-CGuwiAQe.js → SearchMd-yRVgOeax.js} +1 -1
  33. package/dist/client/assets/{Settings01-D7-sGWon.js → Settings01-DGIrqZBI.js} +1 -1
  34. package/dist/client/assets/Settings02-CW4MK9LY.js +1 -0
  35. package/dist/client/assets/{Share07-C8iek9k4.js → Share07-BKNvns4q.js} +1 -1
  36. package/dist/client/assets/{Terminal-CyioLjuI.js → Terminal-DV_yPRWa.js} +1 -1
  37. package/dist/client/assets/{Tool01-DF-lT9RC.js → Tool01-C0EKLKq5.js} +1 -1
  38. package/dist/client/assets/{Trash01-CLqhrRia.js → Trash01-py7ft8Od.js} +1 -1
  39. package/dist/client/assets/{Upload01-DrtXkSgF.js → Upload01-CCoXEdI4.js} +1 -1
  40. package/dist/client/assets/{Users03-oV4Gx6fu.js → Users03-D2F2bran.js} +1 -1
  41. package/dist/client/assets/{X-CuhyLwhM.js → X-CixxHrye.js} +1 -1
  42. package/dist/client/assets/{XClose-BFt2trBc.js → XClose-S1Me7eeg.js} +1 -1
  43. package/dist/client/assets/{agent-connections-preview-D4bn0NTx.js → agent-connections-preview-DZgc-mir.js} +1 -1
  44. package/dist/client/assets/agent-detail-DPLDxB9n.js +1 -0
  45. package/dist/client/assets/{agents-BMyluA59.js → agents-CynO2-IY.js} +1 -1
  46. package/dist/client/assets/{alert-dialog-BxcV0D_1.js → alert-dialog-B1nWkQHx.js} +1 -1
  47. package/dist/client/assets/{auth-catchall-DLJkIPQ0.js → auth-catchall-CJ49F7Eq.js} +1 -1
  48. package/dist/client/assets/{avatar-D3z5_V3I.js → avatar-BbH9O0kN.js} +1 -1
  49. package/dist/client/assets/{badge-BklHLRcK.js → badge-C898LHvV.js} +1 -1
  50. package/dist/client/assets/{binder-ak1AkjZY.js → binder-xcUkLvPC.js} +1 -1
  51. package/dist/client/assets/{breadcrumb-B_Yxwj4p.js → breadcrumb-t_Ccp20G.js} +1 -1
  52. package/dist/client/assets/{button-CcO5M7F7.js → button-C1iesapY.js} +1 -1
  53. package/dist/client/assets/{card-BNt4WjQv.js → card-DKzkS6ji.js} +1 -1
  54. package/dist/client/assets/{checkbox-CirsSPdM.js → checkbox-B82l7mBw.js} +1 -1
  55. package/dist/client/assets/{circle-alert-BcHtOytY.js → circle-alert-_5s_KbQk.js} +1 -1
  56. package/dist/client/assets/{collection-detail-iX-6m_0X.js → collection-detail-B-hnHfhu.js} +3 -3
  57. package/dist/client/assets/{collection-search-Cyt8_oQV.js → collection-search-D3a5_1zR.js} +1 -1
  58. package/dist/client/assets/{collection-tab-Cbay3Q2-.js → collection-tab-Y58MHDMK.js} +1 -1
  59. package/dist/client/assets/{collection-table-wrapper-CFNweZN1.js → collection-table-wrapper-B6XWzQ-4.js} +1 -1
  60. package/dist/client/assets/{collection-tabs-Dh2bhvAY.js → collection-tabs-BPHWDFL4.js} +1 -1
  61. package/dist/client/assets/{command-8Q_FGz0v.js → command-DepzRVHX.js} +1 -1
  62. package/dist/client/assets/{connect-1mhMrmD4.js → connect-OP0J5SPJ.js} +1 -1
  63. package/dist/client/assets/{connection-card-BGd7kcn-.js → connection-card-DkCny6Ez.js} +1 -1
  64. package/dist/client/assets/connection-detail-CdLleACg.js +1 -0
  65. package/dist/client/assets/{connections-DmGFiu1f.js → connections-BZUVvBGs.js} +1 -1
  66. package/dist/client/assets/{constants-DuSOM18S.js → constants-BEco_-y7.js} +1 -1
  67. package/dist/client/assets/constants-gwxE8_b0.js +1 -0
  68. package/dist/client/assets/{create-organization-dialog-j_P7xuhv.js → create-organization-dialog-58b_GUv7.js} +1 -1
  69. package/dist/client/assets/{create-project-dialog-C-mSn_Ux.js → create-project-dialog-C5GAJOOY.js} +1 -1
  70. package/dist/client/assets/{dialog-B_iTVR3h.js → dialog-CpkgwzHW.js} +1 -1
  71. package/dist/client/assets/{dropdown-menu-BTPpCOPE.js → dropdown-menu-D6YYwFq7.js} +1 -1
  72. package/dist/client/assets/dynamic-plugin-layout-BMgNBEQS.js +1 -0
  73. package/dist/client/assets/{empty-state-Ct1fZFlf.js → empty-state-BQPtoYZe.js} +1 -1
  74. package/dist/client/assets/{empty-state--JD6ZxUc.js → empty-state-CH3e4Xzf.js} +1 -1
  75. package/dist/client/assets/{env-vars-editor-B4EebJEK.js → env-vars-editor-Vpi1vdW2.js} +1 -1
  76. package/dist/client/assets/{error-boundary-DlgelpJG.js → error-boundary-BGFWaL1J.js} +1 -1
  77. package/dist/client/assets/{extract-connection-data-BM37afPK.js → extract-connection-data-CDmQ7rLP.js} +1 -1
  78. package/dist/client/assets/file-browser-DUDclrRh.js +2 -0
  79. package/dist/client/assets/{form-CSsv2IBt.js → form-NA0-x5iN.js} +1 -1
  80. package/dist/client/assets/grid-view-DbtTgaoS.js +1 -0
  81. package/dist/client/assets/{home-D16zlSya.js → home-DtmWz3MA.js} +1 -1
  82. package/dist/client/assets/{index-fr6MaGoE.js → index-43_iGxlN.js} +1 -1
  83. package/dist/client/assets/{index--g69ISoA.css → index-BEdPWc-P.css} +1 -1
  84. package/dist/client/assets/{index-DZ7G-bvr.js → index-ByJoFAq_.js} +1 -1
  85. package/dist/client/assets/{index-CZtqakWK.js → index-C9Dn0opW.js} +1 -1
  86. package/dist/client/assets/{index-CHcJPAjT.js → index-DlY6KFzI.js} +1 -1
  87. package/dist/client/assets/{index-DJCm-wAr.js → index-Dv4saiJc.js} +1 -1
  88. package/dist/client/assets/{index-a2nqbblp.js → index-GRocoNYa.js} +1 -1
  89. package/dist/client/assets/{index-Bn2rDd42.js → index-HxeE9C0A.js} +29 -29
  90. package/dist/client/assets/{index-Bo7hWTur.js → index-Kq8ytqk9.js} +1 -1
  91. package/dist/client/assets/{index-BHu7Lc_d.js → index-wUnd_o-U.js} +1 -1
  92. package/dist/client/assets/{infiniteQueryObserver-VnhrjjoH.js → infiniteQueryObserver-CSOdbqFL.js} +1 -1
  93. package/dist/client/assets/{input-DBvMwxwE.js → input-DBGu1Yhi.js} +1 -1
  94. package/dist/client/assets/{integration-icon-C8seGsuO.js → integration-icon-CmJggqPx.js} +1 -1
  95. package/dist/client/assets/{label-BjQxQJkg.js → label-11d5Pe_w.js} +1 -1
  96. package/dist/client/assets/{layout-ZTsfxACA.js → layout-BQSZy0Ao.js} +1 -1
  97. package/dist/client/assets/{localstorage-keys-BhunmwZg.js → localstorage-keys-BxVB7BFB.js} +1 -1
  98. package/dist/client/assets/{login-H0BwFxqL.js → login-CMpn2tdR.js} +1 -1
  99. package/dist/client/assets/{mcp-oauth-ZUujauBG.js → mcp-oauth-JrpxCLx4.js} +1 -1
  100. package/dist/client/assets/{mcp-server-card-KgRAONYw.js → mcp-server-card-8DET7nVd.js} +1 -1
  101. package/dist/client/assets/{mcp-server-detail-Ce9SGjoZ.js → mcp-server-detail-CMrzxsYv.js} +2 -2
  102. package/dist/client/assets/{members-C925BdC6.js → members-CUWgr5ku.js} +1 -1
  103. package/dist/client/assets/{monaco-editor-D7Ghoc8y.js → monaco-editor-DvJ6AQm-.js} +1 -1
  104. package/dist/client/assets/{monitoring-DI8QAuDx.js → monitoring-Db1K0NxK.js} +1 -1
  105. package/dist/client/assets/{oauth-callback-DqKFxIqr.js → oauth-callback-Bh-LWKIz.js} +1 -1
  106. package/dist/client/assets/page-79TZOOqo.js +1 -0
  107. package/dist/client/assets/{page-DCfXF14g.js → page-Bx3m0Nlj.js} +1 -1
  108. package/dist/client/assets/{plugin-empty-state-BYB8Yhjv.js → plugin-empty-state-34Wj3C93.js} +1 -1
  109. package/dist/client/assets/{plugin-header-CLRCQ1W3.js → plugin-header-KrvIXXbF.js} +1 -1
  110. package/dist/client/assets/{popover-BkKSdvGf.js → popover-BbAo_V3q.js} +1 -1
  111. package/dist/client/assets/{project-layout-DzX_Lv0I.js → project-layout-QE2hcM6x.js} +1 -1
  112. package/dist/client/assets/{project-settings-lapjGGi3.js → project-settings-2bxHgR8P.js} +1 -1
  113. package/dist/client/assets/{projects-list-DZgOrcLS.js → projects-list-CSrfAb2G.js} +1 -1
  114. package/dist/client/assets/{registry-utils-BsLp7zXK.js → registry-utils-CLfG2KJO.js} +1 -1
  115. package/dist/client/assets/{resizable-CdUSPFqv.js → resizable-D5fgPQWp.js} +1 -1
  116. package/dist/client/assets/{select-J2aavKNi.js → select-CnIfeZ9k.js} +1 -1
  117. package/dist/client/assets/shell-layout-DIuzNmm5.js +12 -0
  118. package/dist/client/assets/{spinner-Bn-tqgsf.js → spinner-BbdUl9_5.js} +1 -1
  119. package/dist/client/assets/{store-invite-C8stGp_k.js → store-invite-eQ6O_LcC.js} +1 -1
  120. package/dist/client/assets/{switch-CG0LWjwI.js → switch-7wa9WQCt.js} +1 -1
  121. package/dist/client/assets/{table-BNxQWMxG.js → table-F_F9uG31.js} +1 -1
  122. package/dist/client/assets/{tasks-C_RAoHGr.js → tasks-Bo849zPQ.js} +1 -1
  123. package/dist/client/assets/{textarea-CKlKOzV4.js → textarea-CX1AXmSo.js} +1 -1
  124. package/dist/client/assets/{tools-list-D0G5KWHg.js → tools-list-CeBZ5K9_.js} +1 -1
  125. package/dist/client/assets/topbar-portal-DTnSGvrH.js +1 -0
  126. package/dist/client/assets/{typewriter-title-BqfnndCW.js → typewriter-title-CydscG0b.js} +1 -1
  127. package/dist/client/assets/{use-binding-Dgjl_Htk.js → use-binding-BIvDtNoa.js} +1 -1
  128. package/dist/client/assets/{use-connection-CVk8Bzpz.js → use-connection-DWpxH8iy.js} +1 -1
  129. package/dist/client/assets/{use-create-virtual-mcp-BpXLuk-p.js → use-create-virtual-mcp-CMegJpH_.js} +1 -1
  130. package/dist/client/assets/{use-deco-chat-open-CfZI9mqc.js → use-deco-chat-open-DeBMXnMx.js} +7 -7
  131. package/dist/client/assets/{use-install-from-registry-5UUqPBO7.js → use-install-from-registry-CNdLBCwL.js} +1 -1
  132. package/dist/client/assets/{use-list-state-D_1V56-b.js → use-list-state-CqdwrHCA.js} +1 -1
  133. package/dist/client/assets/{use-llm-Ca3pgrIB.js → use-llm-B2BVGott.js} +1 -1
  134. package/dist/client/assets/{use-mcp-prompts-Cn7tm6ug.js → use-mcp-prompts-CUow6VVK.js} +1 -1
  135. package/dist/client/assets/{use-mcp-tools-Ddi2i1Nb.js → use-mcp-tools-DO_-llbI.js} +1 -1
  136. package/dist/client/assets/{use-mobile-p03CcGW0.js → use-mobile-CqANtQ4e.js} +1 -1
  137. package/dist/client/assets/{use-organization-settings-DHZKDAPt.js → use-organization-settings-ANLw4ex1.js} +1 -1
  138. package/dist/client/assets/{use-project-D-mK4K9b.js → use-project-C1G7xlcy.js} +1 -1
  139. package/dist/client/assets/{use-virtual-mcp-C83o4Rih.js → use-virtual-mcp-DaI2d98r.js} +1 -1
  140. package/dist/client/assets/useInfiniteQuery-CL3o6Gdm.js +1 -0
  141. package/dist/client/assets/{useMutation-CnTeRHmv.js → useMutation-M3-wug2Q.js} +1 -1
  142. package/dist/client/assets/useQuery-jRtVXI31.js +1 -0
  143. package/dist/client/assets/utils-D1Qd9-I_.js +1 -0
  144. package/dist/client/assets/{view-mode-toggle-CJkT6m07.js → view-mode-toggle-JVmuLwXe.js} +1 -1
  145. package/dist/client/assets/workflow-BKKAfuJP.js +1 -0
  146. package/dist/client/index.html +2 -2
  147. package/package.json +1 -1
  148. package/dist/client/assets/agent-detail-D8YR1Y7H.js +0 -1
  149. package/dist/client/assets/connection-detail-dEdcHJ4u.js +0 -1
  150. package/dist/client/assets/constants-QC26G_cT.js +0 -1
  151. package/dist/client/assets/dynamic-plugin-layout-BsqDni3U.js +0 -1
  152. package/dist/client/assets/file-browser-DQeqPq9E.js +0 -2
  153. package/dist/client/assets/grid-view-DBKftgaD.js +0 -1
  154. package/dist/client/assets/page-B2cjdb1f.js +0 -1
  155. package/dist/client/assets/shell-layout-DOBmQ9ah.js +0 -12
  156. package/dist/client/assets/useInfiniteQuery-DDUEUpOZ.js +0 -1
  157. package/dist/client/assets/useQuery-Ct96KcZp.js +0 -1
  158. package/dist/client/assets/utils-Ckc2UwOp.js +0 -1
  159. package/dist/client/assets/workflow-2rDY9uo2.js +0 -1
@@ -1 +1 @@
1
- import{u as g,g as y,t as e}from"./index-Bn2rDd42.js";import{u as C}from"./use-binding-Dgjl_Htk.js";import{g as S,h as v}from"./use-connection-CVk8Bzpz.js";import{e as B}from"./extract-connection-data-BM37afPK.js";import{f as I,c as P,e as _}from"./registry-utils-BsLp7zXK.js";function w(t){return t.startsWith("@")?t:`@${t}`}function F(){const{org:t}=g(),{data:s}=y.useSession(),i=S(),l=v(),u=C(l);return{installByBinding:async r=>{if(!t||!s?.user?.id){e.error("Not authenticated");return}const d=w(r),a=(await Promise.all(u.map(async o=>{const c=I(o.tools);if(!c)return null;try{const p=await P(o.id,t.id,c,{where:{appName:d}});return _(p??[])[0]??null}catch{return null}}))).find(o=>o!==null);if(!a){e.error(`MCP Server not found in registry: ${r}`);return}const n=B(a,t.id,s.user.id),m=n.connection_type==="STDIO",f=!!n.connection_url,h=m&&n.connection_headers&&typeof n.connection_headers=="object"&&"command"in n.connection_headers;if(!f&&!h){e.error("This MCP Server cannot be connected: no connection method available");return}return await i.create.mutateAsync(n),{id:n.id,connection:n}},isInstalling:i.create.isPending}}export{F as u};
1
+ import{u as g,g as y,t as e}from"./index-HxeE9C0A.js";import{u as C}from"./use-binding-BIvDtNoa.js";import{g as S,h as v}from"./use-connection-DWpxH8iy.js";import{e as B}from"./extract-connection-data-CDmQ7rLP.js";import{f as I,c as P,e as _}from"./registry-utils-CLfG2KJO.js";function w(t){return t.startsWith("@")?t:`@${t}`}function F(){const{org:t}=g(),{data:s}=y.useSession(),i=S(),l=v(),u=C(l);return{installByBinding:async r=>{if(!t||!s?.user?.id){e.error("Not authenticated");return}const d=w(r),a=(await Promise.all(u.map(async o=>{const c=I(o.tools);if(!c)return null;try{const p=await P(o.id,t.id,c,{where:{appName:d}});return _(p??[])[0]??null}catch{return null}}))).find(o=>o!==null);if(!a){e.error(`MCP Server not found in registry: ${r}`);return}const n=B(a,t.id,s.user.id),m=n.connection_type==="STDIO",f=!!n.connection_url,h=m&&n.connection_headers&&typeof n.connection_headers=="object"&&"command"in n.connection_headers;if(!f&&!h){e.error("This MCP Server cannot be connected: no connection method available");return}return await i.create.mutateAsync(n),{id:n.id,connection:n}},isInstalling:i.create.isPending}}export{F as u};
@@ -1 +1 @@
1
- import{r as b,c as N,u as B,K as I,j as x}from"./index-Bn2rDd42.js";import{A as _}from"./avatar-D3z5_V3I.js";import{c as C}from"./utils-Ckc2UwOp.js";import{u as L}from"./useQuery-Ct96KcZp.js";import{a as U,u as D}from"./constants-DuSOM18S.js";import{u as P}from"./use-mobile-p03CcGW0.js";const A=({size:i=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M2.42 12.713c-.136-.215-.204-.323-.242-.49a1.173 1.173 0 0 1 0-.446c.038-.167.106-.274.242-.49C3.546 9.505 6.895 5 12 5s8.455 4.505 9.58 6.287c.137.215.205.323.243.49.029.125.029.322 0 .446-.038.167-.106.274-.242.49C20.455 14.495 17.105 19 12 19c-5.106 0-8.455-4.505-9.58-6.287Z"}),b.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));A.displayName="Eye";function R(i){const e=N.c(11),{org:t}=B();let c;e[0]!==t.id?(c={connectionId:U,orgId:t.id},e[0]=t.id,e[1]=c):c=e[1];const r=D(c);let s;e[2]!==i?(s=I.user(i),e[2]=i,e[3]=s):s=e[3];let o;e[4]!==r||e[5]!==i?(o=async()=>{const p=await r.callTool({name:"USER_GET",arguments:{id:i}});return(p.structuredContent??p).user},e[4]=r,e[5]=i,e[6]=o):o=e[6];const a=!!i;let l;return e[7]!==s||e[8]!==o||e[9]!==a?(l={queryKey:s,queryFn:o,staleTime:3e5,retry:1,enabled:a},e[7]=s,e[8]=o,e[9]=a,e[10]=l):l=e[10],L(l)}function H(i){const e=N.c(39),{id:t,size:c,showEmail:r,className:s}=i,o=c===void 0?"xs":c,a=r===void 0?!1:r,{data:l,isLoading:p,isError:j}=R(t);if(p){let u;e[0]!==s?(u=C("flex items-center gap-2",s),e[0]=s,e[1]=u):u=e[1];let n;e[2]!==o?(n=x.jsx(_.Skeleton,{shape:"circle",size:o}),e[2]=o,e[3]=n):n=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=x.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=g):g=e[4];let h;e[5]!==a?(h=a&&x.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=a,e[6]=h):h=e[6];let w;e[7]!==h?(w=x.jsxs("div",{className:"flex flex-col gap-1",children:[g,h]}),e[7]=h,e[8]=w):w=e[8];let M;return e[9]!==u||e[10]!==n||e[11]!==w?(M=x.jsxs("div",{className:u,children:[n,w]}),e[9]=u,e[10]=n,e[11]=w,e[12]=M):M=e[12],M}if(j||!l){let u;e[13]!==s?(u=C("flex items-center gap-2",s),e[13]=s,e[14]=u):u=e[14];let n;e[15]!==o?(n=x.jsx(_,{shape:"circle",size:o,fallback:"?",muted:!0}),e[15]=o,e[16]=n):n=e[16];let g;e[17]===Symbol.for("react.memo_cache_sentinel")?(g=x.jsx("div",{className:"flex flex-col",children:x.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=g):g=e[17];let h;return e[18]!==u||e[19]!==n?(h=x.jsxs("div",{className:u,children:[n,g]}),e[18]=u,e[19]=n,e[20]=h):h=e[20],h}let v;e[21]!==s?(v=C("flex items-center gap-2",s),e[21]=s,e[22]=v):v=e[22];const y=l.image??void 0;let m;e[23]!==o||e[24]!==y||e[25]!==l.name?(m=x.jsx(_,{shape:"circle",size:o,url:y,fallback:l.name}),e[23]=o,e[24]=y,e[25]=l.name,e[26]=m):m=e[26];let d;e[27]!==l.name?(d=x.jsx("div",{className:"text-sm font-medium",children:l.name}),e[27]=l.name,e[28]=d):d=e[28];let f;e[29]!==a||e[30]!==l.email?(f=a&&x.jsx("div",{className:"text-xs text-muted-foreground",children:l.email}),e[29]=a,e[30]=l.email,e[31]=f):f=e[31];let S;e[32]!==d||e[33]!==f?(S=x.jsxs("div",{className:"flex flex-col",children:[d,f]}),e[32]=d,e[33]=f,e[34]=S):S=e[34];let E;return e[35]!==v||e[36]!==m||e[37]!==S?(E=x.jsxs("div",{className:v,children:[m,S]}),e[35]=v,e[36]=m,e[37]=S,e[38]=E):E=e[38],E}function W(i){const e=`deco-filters-${i}`,[t,c]=b.useState(()=>{try{const s=globalThis.localStorage?.getItem(e);if(s)return JSON.parse(s)}catch(s){console.error("Failed to parse stored filters:",s)}return[]});return[t,s=>{c(s);try{globalThis.localStorage?.setItem(e,JSON.stringify(s))}catch(o){console.error("Failed to save filters:",o)}}]}function z(i){const e=N.c(7),[t,c]=b.useState(i),[r,s]=b.useState(i?"desc":null);let o;e[0]!==r||e[1]!==t?(o=p=>{t!==p?(c(p),s("asc")):r==="asc"?s("desc"):r==="desc"&&(c(void 0),s(null))},e[0]=r,e[1]=t,e[2]=o):o=e[2];const a=o;let l;return e[3]!==a||e[4]!==r||e[5]!==t?(l={sortKey:t,sortDirection:r,handleSort:a},e[3]=a,e[4]=r,e[5]=t,e[6]=l):l=e[6],l}function q(i,e){const t=N.c(12),c=e===void 0?"cards":e,r=P(),s=b.useRef(r),o=i?`deco-view-mode-${i}`:"deco-view-mode";let a;t[0]!==c||t[1]!==o?(a=()=>{const f=globalThis.localStorage?.getItem(o);return f==="cards"||f==="table"?f:c},t[0]=c,t[1]=o,t[2]=a):a=t[2];const[l,p]=b.useState(a);let j;t[3]!==o?(j=f=>{p(f),globalThis.localStorage?.setItem(o,f)},t[3]=o,t[4]=j):j=t[4];const v=j;let y,m;t[5]!==r||t[6]!==l?(y=()=>{!s.current&&r&&l==="table"&&p("cards"),s.current=r},m=[r,l],t[5]=r,t[6]=l,t[7]=y,t[8]=m):(y=t[7],m=t[8]),b.useEffect(y,m);let d;return t[9]!==v||t[10]!==l?(d=[l,v],t[9]=v,t[10]=l,t[11]=d):d=t[11],d}function X(i){const e=N.c(20),{namespace:t,resource:c,defaultSortKey:r,defaultViewMode:s}=i,o=r===void 0?"title":r,a=s===void 0?"table":s,[l,p]=b.useState(""),j=b.useDeferredValue(l),v=`${t}-${c}`,[y,m]=W(v),d=`mesh-${c}-filter-visible-${t}`;let f;e[0]!==d?(f=()=>globalThis.localStorage?.getItem(d)==="true",e[0]=d,e[1]=f):f=e[1];const[S,E]=b.useState(f);let u;e[2]!==d?(u=T=>{E(T),globalThis.localStorage?.setItem(d,String(T))},e[2]=d,e[3]=u):u=e[3];const n=u;let g;e[4]!==S||e[5]!==n?(g=()=>{n(!S)},e[4]=S,e[5]=n,e[6]=g):g=e[6];const h=g,[w,M]=q(`mesh-${c}-${t}`,a),{sortKey:k,sortDirection:K,handleSort:F}=z(o),V=k;let $;return e[7]!==S||e[8]!==y||e[9]!==F||e[10]!==l||e[11]!==j||e[12]!==n||e[13]!==m||e[14]!==M||e[15]!==K||e[16]!==V||e[17]!==h||e[18]!==w?($={search:l,searchTerm:j,setSearch:p,filters:y,setFilters:m,filterBarVisible:S,setFilterBarVisible:n,toggleFilterBar:h,viewMode:w,setViewMode:M,sortKey:V,sortDirection:K,handleSort:F},e[7]=S,e[8]=y,e[9]=F,e[10]=l,e[11]=j,e[12]=n,e[13]=m,e[14]=M,e[15]=K,e[16]=V,e[17]=h,e[18]=w,e[19]=$):$=e[19],$}export{H as U,A as s,X as u};
1
+ import{r as b,c as N,u as B,K as I,j as x}from"./index-HxeE9C0A.js";import{A as _}from"./avatar-BbH9O0kN.js";import{c as C}from"./utils-D1Qd9-I_.js";import{u as L}from"./useQuery-jRtVXI31.js";import{a as U,u as D}from"./constants-BEco_-y7.js";import{u as P}from"./use-mobile-CqANtQ4e.js";const A=({size:i=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M2.42 12.713c-.136-.215-.204-.323-.242-.49a1.173 1.173 0 0 1 0-.446c.038-.167.106-.274.242-.49C3.546 9.505 6.895 5 12 5s8.455 4.505 9.58 6.287c.137.215.205.323.243.49.029.125.029.322 0 .446-.038.167-.106.274-.242.49C20.455 14.495 17.105 19 12 19c-5.106 0-8.455-4.505-9.58-6.287Z"}),b.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));A.displayName="Eye";function R(i){const e=N.c(11),{org:t}=B();let c;e[0]!==t.id?(c={connectionId:U,orgId:t.id},e[0]=t.id,e[1]=c):c=e[1];const r=D(c);let s;e[2]!==i?(s=I.user(i),e[2]=i,e[3]=s):s=e[3];let o;e[4]!==r||e[5]!==i?(o=async()=>{const p=await r.callTool({name:"USER_GET",arguments:{id:i}});return(p.structuredContent??p).user},e[4]=r,e[5]=i,e[6]=o):o=e[6];const a=!!i;let l;return e[7]!==s||e[8]!==o||e[9]!==a?(l={queryKey:s,queryFn:o,staleTime:3e5,retry:1,enabled:a},e[7]=s,e[8]=o,e[9]=a,e[10]=l):l=e[10],L(l)}function H(i){const e=N.c(39),{id:t,size:c,showEmail:r,className:s}=i,o=c===void 0?"xs":c,a=r===void 0?!1:r,{data:l,isLoading:p,isError:j}=R(t);if(p){let u;e[0]!==s?(u=C("flex items-center gap-2",s),e[0]=s,e[1]=u):u=e[1];let n;e[2]!==o?(n=x.jsx(_.Skeleton,{shape:"circle",size:o}),e[2]=o,e[3]=n):n=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=x.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=g):g=e[4];let h;e[5]!==a?(h=a&&x.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=a,e[6]=h):h=e[6];let w;e[7]!==h?(w=x.jsxs("div",{className:"flex flex-col gap-1",children:[g,h]}),e[7]=h,e[8]=w):w=e[8];let M;return e[9]!==u||e[10]!==n||e[11]!==w?(M=x.jsxs("div",{className:u,children:[n,w]}),e[9]=u,e[10]=n,e[11]=w,e[12]=M):M=e[12],M}if(j||!l){let u;e[13]!==s?(u=C("flex items-center gap-2",s),e[13]=s,e[14]=u):u=e[14];let n;e[15]!==o?(n=x.jsx(_,{shape:"circle",size:o,fallback:"?",muted:!0}),e[15]=o,e[16]=n):n=e[16];let g;e[17]===Symbol.for("react.memo_cache_sentinel")?(g=x.jsx("div",{className:"flex flex-col",children:x.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=g):g=e[17];let h;return e[18]!==u||e[19]!==n?(h=x.jsxs("div",{className:u,children:[n,g]}),e[18]=u,e[19]=n,e[20]=h):h=e[20],h}let v;e[21]!==s?(v=C("flex items-center gap-2",s),e[21]=s,e[22]=v):v=e[22];const y=l.image??void 0;let m;e[23]!==o||e[24]!==y||e[25]!==l.name?(m=x.jsx(_,{shape:"circle",size:o,url:y,fallback:l.name}),e[23]=o,e[24]=y,e[25]=l.name,e[26]=m):m=e[26];let d;e[27]!==l.name?(d=x.jsx("div",{className:"text-sm font-medium",children:l.name}),e[27]=l.name,e[28]=d):d=e[28];let f;e[29]!==a||e[30]!==l.email?(f=a&&x.jsx("div",{className:"text-xs text-muted-foreground",children:l.email}),e[29]=a,e[30]=l.email,e[31]=f):f=e[31];let S;e[32]!==d||e[33]!==f?(S=x.jsxs("div",{className:"flex flex-col",children:[d,f]}),e[32]=d,e[33]=f,e[34]=S):S=e[34];let E;return e[35]!==v||e[36]!==m||e[37]!==S?(E=x.jsxs("div",{className:v,children:[m,S]}),e[35]=v,e[36]=m,e[37]=S,e[38]=E):E=e[38],E}function W(i){const e=`deco-filters-${i}`,[t,c]=b.useState(()=>{try{const s=globalThis.localStorage?.getItem(e);if(s)return JSON.parse(s)}catch(s){console.error("Failed to parse stored filters:",s)}return[]});return[t,s=>{c(s);try{globalThis.localStorage?.setItem(e,JSON.stringify(s))}catch(o){console.error("Failed to save filters:",o)}}]}function z(i){const e=N.c(7),[t,c]=b.useState(i),[r,s]=b.useState(i?"desc":null);let o;e[0]!==r||e[1]!==t?(o=p=>{t!==p?(c(p),s("asc")):r==="asc"?s("desc"):r==="desc"&&(c(void 0),s(null))},e[0]=r,e[1]=t,e[2]=o):o=e[2];const a=o;let l;return e[3]!==a||e[4]!==r||e[5]!==t?(l={sortKey:t,sortDirection:r,handleSort:a},e[3]=a,e[4]=r,e[5]=t,e[6]=l):l=e[6],l}function q(i,e){const t=N.c(12),c=e===void 0?"cards":e,r=P(),s=b.useRef(r),o=i?`deco-view-mode-${i}`:"deco-view-mode";let a;t[0]!==c||t[1]!==o?(a=()=>{const f=globalThis.localStorage?.getItem(o);return f==="cards"||f==="table"?f:c},t[0]=c,t[1]=o,t[2]=a):a=t[2];const[l,p]=b.useState(a);let j;t[3]!==o?(j=f=>{p(f),globalThis.localStorage?.setItem(o,f)},t[3]=o,t[4]=j):j=t[4];const v=j;let y,m;t[5]!==r||t[6]!==l?(y=()=>{!s.current&&r&&l==="table"&&p("cards"),s.current=r},m=[r,l],t[5]=r,t[6]=l,t[7]=y,t[8]=m):(y=t[7],m=t[8]),b.useEffect(y,m);let d;return t[9]!==v||t[10]!==l?(d=[l,v],t[9]=v,t[10]=l,t[11]=d):d=t[11],d}function X(i){const e=N.c(20),{namespace:t,resource:c,defaultSortKey:r,defaultViewMode:s}=i,o=r===void 0?"title":r,a=s===void 0?"table":s,[l,p]=b.useState(""),j=b.useDeferredValue(l),v=`${t}-${c}`,[y,m]=W(v),d=`mesh-${c}-filter-visible-${t}`;let f;e[0]!==d?(f=()=>globalThis.localStorage?.getItem(d)==="true",e[0]=d,e[1]=f):f=e[1];const[S,E]=b.useState(f);let u;e[2]!==d?(u=T=>{E(T),globalThis.localStorage?.setItem(d,String(T))},e[2]=d,e[3]=u):u=e[3];const n=u;let g;e[4]!==S||e[5]!==n?(g=()=>{n(!S)},e[4]=S,e[5]=n,e[6]=g):g=e[6];const h=g,[w,M]=q(`mesh-${c}-${t}`,a),{sortKey:k,sortDirection:K,handleSort:F}=z(o),V=k;let $;return e[7]!==S||e[8]!==y||e[9]!==F||e[10]!==l||e[11]!==j||e[12]!==n||e[13]!==m||e[14]!==M||e[15]!==K||e[16]!==V||e[17]!==h||e[18]!==w?($={search:l,searchTerm:j,setSearch:p,filters:y,setFilters:m,filterBarVisible:S,setFilterBarVisible:n,toggleFilterBar:h,viewMode:w,setViewMode:M,sortKey:V,sortDirection:K,handleSort:F},e[7]=S,e[8]=y,e[9]=F,e[10]=l,e[11]=j,e[12]=n,e[13]=m,e[14]=M,e[15]=K,e[16]=V,e[17]=h,e[18]=w,e[19]=$):$=e[19],$}export{H as U,A as s,X as u};
@@ -1 +1 @@
1
- import{c,u}from"./index-Bn2rDd42.js";import{h as m,e as a}from"./use-connection-CVk8Bzpz.js";import{j as p}from"./constants-DuSOM18S.js";import{a as C}from"./use-binding-Dgjl_Htk.js";function x(n,s){const o=c.c(5);let e;o[0]!==s?(e=s===void 0?{}:s,o[0]=s,o[1]=e):e=o[1];const r=e,{org:i}=u();let t;o[2]!==n||o[3]!==i.id?(t={connectionId:n,orgId:i.id},o[2]=n,o[3]=i.id,o[4]=t):t=o[4];const l=p(t);return a(n??"no-connection","LLM",l,r)}function j(){const n=c.c(2),s=m();let o;return n[0]!==s?(o={connections:s,binding:"LLMS"},n[0]=s,n[1]=o):o=n[1],C(o)}export{x as a,j as u};
1
+ import{c,u}from"./index-HxeE9C0A.js";import{h as m,e as a}from"./use-connection-DWpxH8iy.js";import{j as p}from"./constants-BEco_-y7.js";import{a as C}from"./use-binding-BIvDtNoa.js";function x(n,s){const o=c.c(5);let e;o[0]!==s?(e=s===void 0?{}:s,o[0]=s,o[1]=e):e=o[1];const r=e,{org:i}=u();let t;o[2]!==n||o[3]!==i.id?(t={connectionId:n,orgId:i.id},o[2]=n,o[3]=i.id,o[4]=t):t=o[4];const l=p(t);return a(n??"no-connection","LLM",l,r)}function j(){const n=c.c(2),s=m();let o;return n[0]!==s?(o={connections:s,binding:"LLMS"},n[0]=s,n[1]=o):o=n[1],C(o)}export{x as a,j as u};
@@ -1 +1 @@
1
- import{c as u,y as c}from"./index-Bn2rDd42.js";import{u as p}from"./useQuery-Ct96KcZp.js";import{K as n}from"./constants-DuSOM18S.js";async function f(l){return l.getServerCapabilities()?.resources?await l.listResources():{resources:[]}}async function b(l,e){return await l.readResource({uri:e})}function R(l){const e=u.c(12);let t,s;e[0]!==l?({client:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n.mcpResourcesList(t),e[3]=t,e[4]=r):r=e[4];let i;e[5]!==t?(i=()=>f(t),e[5]=t,e[6]=i):i=e[6];const o=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==r||e[9]!==i||e[10]!==o?(a={...s,queryKey:r,queryFn:i,staleTime:o,retry:!1},e[7]=s,e[8]=r,e[9]=i,e[10]=o,e[11]=a):a=e[11],c(a)}function L(l){const e=u.c(12);let t,s;e[0]!==l?({client:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n.mcpResourcesList(t),e[3]=t,e[4]=r):r=e[4];let i;e[5]!==t?(i=()=>f(t),e[5]=t,e[6]=i):i=e[6];const o=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==r||e[9]!==i||e[10]!==o?(a={...s,queryKey:r,queryFn:i,staleTime:o,retry:!1},e[7]=s,e[8]=r,e[9]=i,e[10]=o,e[11]=a):a=e[11],p(a)}async function m(l){return l.getServerCapabilities()?.prompts?await l.listPrompts():{prompts:[]}}async function T(l,e,t){if(!l.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await l.getPrompt({name:e,arguments:t??{}})}function g(l){const e=u.c(12);let t,s;e[0]!==l?({client:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let i;e[5]!==t?(i=()=>m(t),e[5]=t,e[6]=i):i=e[6];const o=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==r||e[9]!==i||e[10]!==o?(a={...s,queryKey:r,queryFn:i,staleTime:o,retry:!1},e[7]=s,e[8]=r,e[9]=i,e[10]=o,e[11]=a):a=e[11],c(a)}function C(l){const e=u.c(12);let t,s;e[0]!==l?({client:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let i;e[5]!==t?(i=()=>m(t),e[5]=t,e[6]=i):i=e[6];const o=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==r||e[9]!==i||e[10]!==o?(a={...s,queryKey:r,queryFn:i,staleTime:o,retry:!1},e[7]=s,e[8]=r,e[9]=i,e[10]=o,e[11]=a):a=e[11],p(a)}export{f as a,C as b,R as c,L as d,T as g,m as l,b as r,g as u};
1
+ import{c as u,y as c}from"./index-HxeE9C0A.js";import{u as p}from"./useQuery-jRtVXI31.js";import{K as n}from"./constants-BEco_-y7.js";async function f(l){return l.getServerCapabilities()?.resources?await l.listResources():{resources:[]}}async function b(l,e){return await l.readResource({uri:e})}function R(l){const e=u.c(12);let t,s;e[0]!==l?({client:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n.mcpResourcesList(t),e[3]=t,e[4]=r):r=e[4];let i;e[5]!==t?(i=()=>f(t),e[5]=t,e[6]=i):i=e[6];const o=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==r||e[9]!==i||e[10]!==o?(a={...s,queryKey:r,queryFn:i,staleTime:o,retry:!1},e[7]=s,e[8]=r,e[9]=i,e[10]=o,e[11]=a):a=e[11],c(a)}function L(l){const e=u.c(12);let t,s;e[0]!==l?({client:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n.mcpResourcesList(t),e[3]=t,e[4]=r):r=e[4];let i;e[5]!==t?(i=()=>f(t),e[5]=t,e[6]=i):i=e[6];const o=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==r||e[9]!==i||e[10]!==o?(a={...s,queryKey:r,queryFn:i,staleTime:o,retry:!1},e[7]=s,e[8]=r,e[9]=i,e[10]=o,e[11]=a):a=e[11],p(a)}async function m(l){return l.getServerCapabilities()?.prompts?await l.listPrompts():{prompts:[]}}async function T(l,e,t){if(!l.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await l.getPrompt({name:e,arguments:t??{}})}function g(l){const e=u.c(12);let t,s;e[0]!==l?({client:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let i;e[5]!==t?(i=()=>m(t),e[5]=t,e[6]=i):i=e[6];const o=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==r||e[9]!==i||e[10]!==o?(a={...s,queryKey:r,queryFn:i,staleTime:o,retry:!1},e[7]=s,e[8]=r,e[9]=i,e[10]=o,e[11]=a):a=e[11],c(a)}function C(l){const e=u.c(12);let t,s;e[0]!==l?({client:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let i;e[5]!==t?(i=()=>m(t),e[5]=t,e[6]=i):i=e[6];const o=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==r||e[9]!==i||e[10]!==o?(a={...s,queryKey:r,queryFn:i,staleTime:o,retry:!1},e[7]=s,e[8]=r,e[9]=i,e[10]=o,e[11]=a):a=e[11],p(a)}export{f as a,C as b,R as c,L as d,T as g,m as l,b as r,g as u};
@@ -1 +1 @@
1
- import{c as m,y as p}from"./index-Bn2rDd42.js";import{u as q}from"./useQuery-Ct96KcZp.js";import{u as C}from"./useMutation-CnTeRHmv.js";import{K as T}from"./constants-DuSOM18S.js";function w(r){const e=m.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const i=s.staleTime??3e4;let n;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==i?(n={...s,queryKey:l,queryFn:o,staleTime:i,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=i,e[11]=n):n=e[11],p(n)}function F(r){const e=m.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const i=s.staleTime??3e4;let n;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==i?(n={...s,queryKey:l,queryFn:o,staleTime:i,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=i,e[11]=n):n=e[11],q(n)}function P(r){const e=m.c(21);let t,s,l,o;e[0]!==r?({client:t,toolName:o,toolArguments:l,...s}=r,e[0]=r,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let i,n,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const y=JSON.stringify(l??{});u=p,i=s,n=T.mcpToolCall(t,o,y),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=i,e[10]=n,e[11]=u}else i=e[9],n=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==o?(a=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=a):a=e[15];const f=s.staleTime??3e4;let c;return e[16]!==i||e[17]!==n||e[18]!==a||e[19]!==f?(c={...i,queryKey:n,queryFn:a,staleTime:f,retry:!1},e[16]=i,e[17]=n,e[18]=a,e[19]=f,e[20]=c):c=e[20],u(c)}function $(r){const e=m.c(21);let t,s,l,o;e[0]!==r?({client:t,toolName:o,toolArguments:l,...s}=r,e[0]=r,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let i,n,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const y=JSON.stringify(l??{});u=q,i=s,n=T.mcpToolCall(t,o,y),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=i,e[10]=n,e[11]=u}else i=e[9],n=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==o?(a=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=a):a=e[15];const f=s.staleTime??3e4;let c;return e[16]!==i||e[17]!==n||e[18]!==a||e[19]!==f?(c={...i,queryKey:n,queryFn:a,staleTime:f,retry:!1},e[16]=i,e[17]=n,e[18]=a,e[19]=f,e[20]=c):c=e[20],u(c)}function L(r){const e=m.c(8);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=async i=>await t.callTool(i),e[3]=t,e[4]=l):l=e[4];let o;return e[5]!==s||e[6]!==l?(o={...s,mutationFn:l},e[5]=s,e[6]=l,e[7]=o):o=e[7],C(o)}export{L as a,$ as b,w as c,F as d,P as u};
1
+ import{c as m,y as p}from"./index-HxeE9C0A.js";import{u as q}from"./useQuery-jRtVXI31.js";import{u as C}from"./useMutation-M3-wug2Q.js";import{K as T}from"./constants-BEco_-y7.js";function w(r){const e=m.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const i=s.staleTime??3e4;let n;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==i?(n={...s,queryKey:l,queryFn:o,staleTime:i,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=i,e[11]=n):n=e[11],p(n)}function F(r){const e=m.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const i=s.staleTime??3e4;let n;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==i?(n={...s,queryKey:l,queryFn:o,staleTime:i,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=i,e[11]=n):n=e[11],q(n)}function P(r){const e=m.c(21);let t,s,l,o;e[0]!==r?({client:t,toolName:o,toolArguments:l,...s}=r,e[0]=r,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let i,n,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const y=JSON.stringify(l??{});u=p,i=s,n=T.mcpToolCall(t,o,y),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=i,e[10]=n,e[11]=u}else i=e[9],n=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==o?(a=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=a):a=e[15];const f=s.staleTime??3e4;let c;return e[16]!==i||e[17]!==n||e[18]!==a||e[19]!==f?(c={...i,queryKey:n,queryFn:a,staleTime:f,retry:!1},e[16]=i,e[17]=n,e[18]=a,e[19]=f,e[20]=c):c=e[20],u(c)}function $(r){const e=m.c(21);let t,s,l,o;e[0]!==r?({client:t,toolName:o,toolArguments:l,...s}=r,e[0]=r,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let i,n,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const y=JSON.stringify(l??{});u=q,i=s,n=T.mcpToolCall(t,o,y),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=i,e[10]=n,e[11]=u}else i=e[9],n=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==o?(a=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=a):a=e[15];const f=s.staleTime??3e4;let c;return e[16]!==i||e[17]!==n||e[18]!==a||e[19]!==f?(c={...i,queryKey:n,queryFn:a,staleTime:f,retry:!1},e[16]=i,e[17]=n,e[18]=a,e[19]=f,e[20]=c):c=e[20],u(c)}function L(r){const e=m.c(8);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=async i=>await t.callTool(i),e[3]=t,e[4]=l):l=e[4];let o;return e[5]!==s||e[6]!==l?(o={...s,mutationFn:l},e[5]=s,e[6]=l,e[7]=o):o=e[7],C(o)}export{L as a,$ as b,w as c,F as d,P as u};
@@ -1 +1 @@
1
- import{c as m,r}from"./index-Bn2rDd42.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
1
+ import{c as m,r}from"./index-HxeE9C0A.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
@@ -1 +1 @@
1
- import{c as m,u as T,y as A,z as d,K as g}from"./index-Bn2rDd42.js";import{u as _}from"./useMutation-CnTeRHmv.js";import{a as p,u as y}from"./constants-DuSOM18S.js";function D(e){const t=m.c(10),{org:i}=T();let l;t[0]!==i.id?(l={connectionId:p,orgId:i.id},t[0]=i.id,t[1]=l):l=t[1];const c=y(l);let u;t[2]!==e?(u=g.organizationSettings(e),t[2]=e,t[3]=u):u=t[3];let s;t[4]!==c||t[5]!==e?(s=async()=>{const a=await c.callTool({name:"ORGANIZATION_SETTINGS_GET",arguments:{}}),r=a.structuredContent??a;return r||{organizationId:e,sidebar_items:null,enabled_plugins:null,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}},t[4]=c,t[5]=e,t[6]=s):s=t[6];let n;t[7]!==u||t[8]!==s?(n={queryKey:u,queryFn:s,staleTime:6e4},t[7]=u,t[8]=s,t[9]=n):n=t[9];const{data:o}=A(n);return o}function G(e){const t=m.c(13),i=d(),{org:l}=T();let c;t[0]!==l.id?(c={connectionId:p,orgId:l.id},t[0]=l.id,t[1]=c):c=t[1];const u=y(c);let s;t[2]!==u||t[3]!==e?(s=async S=>{const f=await u.callTool({name:"ORGANIZATION_SETTINGS_UPDATE",arguments:{organizationId:e,...S}});return f.structuredContent??f},t[2]=u,t[3]=e,t[4]=s):s=t[4];let n;t[5]!==e||t[6]!==i?(n=S=>{i.setQueryData(g.organizationSettings(e),S)},t[5]=e,t[6]=i,t[7]=n):n=t[7];let o;t[8]!==s||t[9]!==n?(o={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=o):o=t[10];const a=_(o);let r;return t[11]!==a?(r={update:a},t[11]=a,t[12]=r):r=t[12],r}export{G as a,D as u};
1
+ import{c as m,u as T,y as A,z as d,K as g}from"./index-HxeE9C0A.js";import{u as _}from"./useMutation-M3-wug2Q.js";import{a as p,u as y}from"./constants-BEco_-y7.js";function D(e){const t=m.c(10),{org:i}=T();let l;t[0]!==i.id?(l={connectionId:p,orgId:i.id},t[0]=i.id,t[1]=l):l=t[1];const c=y(l);let u;t[2]!==e?(u=g.organizationSettings(e),t[2]=e,t[3]=u):u=t[3];let s;t[4]!==c||t[5]!==e?(s=async()=>{const a=await c.callTool({name:"ORGANIZATION_SETTINGS_GET",arguments:{}}),r=a.structuredContent??a;return r||{organizationId:e,sidebar_items:null,enabled_plugins:null,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}},t[4]=c,t[5]=e,t[6]=s):s=t[6];let n;t[7]!==u||t[8]!==s?(n={queryKey:u,queryFn:s,staleTime:6e4},t[7]=u,t[8]=s,t[9]=n):n=t[9];const{data:o}=A(n);return o}function G(e){const t=m.c(13),i=d(),{org:l}=T();let c;t[0]!==l.id?(c={connectionId:p,orgId:l.id},t[0]=l.id,t[1]=c):c=t[1];const u=y(c);let s;t[2]!==u||t[3]!==e?(s=async S=>{const f=await u.callTool({name:"ORGANIZATION_SETTINGS_UPDATE",arguments:{organizationId:e,...S}});return f.structuredContent??f},t[2]=u,t[3]=e,t[4]=s):s=t[4];let n;t[5]!==e||t[6]!==i?(n=S=>{i.setQueryData(g.organizationSettings(e),S)},t[5]=e,t[6]=i,t[7]=n):n=t[7];let o;t[8]!==s||t[9]!==n?(o={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=o):o=t[10];const a=_(o);let r;return t[11]!==a?(r={update:a},t[11]=a,t[12]=r):r=t[12],r}export{G as a,D as u};
@@ -1 +1 @@
1
- import{K as m,c as C}from"./index-Bn2rDd42.js";import{u as y}from"./useQuery-Ct96KcZp.js";import{u as f,a}from"./constants-DuSOM18S.js";function q(t,s){const e=C.c(13);let l;e[0]!==t?(l={connectionId:a,orgId:t},e[0]=t,e[1]=l):l=e[1];const u=f(l);let r;e[2]!==t||e[3]!==s?(r=m.project(t,s),e[2]=t,e[3]=s,e[4]=r):r=e[4];let c;e[5]!==u||e[6]!==t||e[7]!==s?(c=async()=>{const p=await u.callTool({name:"PROJECT_GET",arguments:{organizationId:t,slug:s}});return(p.structuredContent??p).project},e[5]=u,e[6]=t,e[7]=s,e[8]=c):c=e[8];const n=!!t&&!!s;let o;return e[9]!==r||e[10]!==c||e[11]!==n?(o={queryKey:r,queryFn:c,enabled:n,staleTime:3e4},e[9]=r,e[10]=c,e[11]=n,e[12]=o):o=e[12],y(o)}function _(t,s){const e=f({connectionId:a,orgId:t}),l={queryKey:m.projects(t),queryFn:async()=>{const u=await e.callTool({name:"PROJECT_LIST",arguments:{organizationId:t}});return(u.structuredContent??u).projects.map(c=>({...c,organizationId:t}))},staleTime:3e4};return y({...l,enabled:!!t})}export{_ as a,q as u};
1
+ import{K as m,c as C}from"./index-HxeE9C0A.js";import{u as y}from"./useQuery-jRtVXI31.js";import{u as f,a}from"./constants-BEco_-y7.js";function q(t,s){const e=C.c(13);let l;e[0]!==t?(l={connectionId:a,orgId:t},e[0]=t,e[1]=l):l=e[1];const u=f(l);let r;e[2]!==t||e[3]!==s?(r=m.project(t,s),e[2]=t,e[3]=s,e[4]=r):r=e[4];let c;e[5]!==u||e[6]!==t||e[7]!==s?(c=async()=>{const p=await u.callTool({name:"PROJECT_GET",arguments:{organizationId:t,slug:s}});return(p.structuredContent??p).project},e[5]=u,e[6]=t,e[7]=s,e[8]=c):c=e[8];const n=!!t&&!!s;let o;return e[9]!==r||e[10]!==c||e[11]!==n?(o={queryKey:r,queryFn:c,enabled:n,staleTime:3e4},e[9]=r,e[10]=c,e[11]=n,e[12]=o):o=e[12],y(o)}function _(t,s){const e=f({connectionId:a,orgId:t}),l={queryKey:m.projects(t),queryFn:async()=>{const u=await e.callTool({name:"PROJECT_LIST",arguments:{organizationId:t}});return(u.structuredContent??u).projects.map(c=>({...c,organizationId:t}))},staleTime:3e4};return y({...l,enabled:!!t})}export{_ as a,q as u};
@@ -1 +1 @@
1
- import{c,u as r}from"./index-Bn2rDd42.js";import{e as a,u as C,d as I}from"./use-connection-CVk8Bzpz.js";import{a as l,u}from"./constants-DuSOM18S.js";function m(i){const t=c.c(4);let o;t[0]!==i?(o=i===void 0?{}:i,t[0]=i,t[1]=o):o=t[1];const n=o,{org:e}=r();let s;t[2]!==e.id?(s={connectionId:l,orgId:e.id},t[2]=e.id,t[3]=s):s=t[3];const d=u(s);return a(e.id,"VIRTUAL_MCP",d,n)}function V(i){const t=c.c(2),{org:o}=r();let n;t[0]!==o.id?(n={connectionId:l,orgId:o.id},t[0]=o.id,t[1]=n):n=t[1];const e=u(n);return I(o.id,"VIRTUAL_MCP",i??void 0,e)}function p(){const i=c.c(2),{org:t}=r();let o;i[0]!==t.id?(o={connectionId:l,orgId:t.id},i[0]=t.id,i[1]=o):o=i[1];const n=u(o);return C(t.id,"VIRTUAL_MCP",n)}export{p as a,m as b,V as u};
1
+ import{c,u as r}from"./index-HxeE9C0A.js";import{e as a,u as C,d as I}from"./use-connection-DWpxH8iy.js";import{a as l,u}from"./constants-BEco_-y7.js";function m(i){const t=c.c(4);let o;t[0]!==i?(o=i===void 0?{}:i,t[0]=i,t[1]=o):o=t[1];const n=o,{org:e}=r();let s;t[2]!==e.id?(s={connectionId:l,orgId:e.id},t[2]=e.id,t[3]=s):s=t[3];const d=u(s);return a(e.id,"VIRTUAL_MCP",d,n)}function V(i){const t=c.c(2),{org:o}=r();let n;t[0]!==o.id?(n={connectionId:l,orgId:o.id},t[0]=o.id,t[1]=n):n=t[1];const e=u(n);return I(o.id,"VIRTUAL_MCP",i??void 0,e)}function p(){const i=c.c(2),{org:t}=r();let o;i[0]!==t.id?(o={connectionId:l,orgId:t.id},i[0]=t.id,i[1]=o):o=i[1];const n=u(o);return C(t.id,"VIRTUAL_MCP",n)}export{p as a,m as b,V as u};
@@ -0,0 +1 @@
1
+ import{I as u}from"./infiniteQueryObserver-CSOdbqFL.js";import{a5 as i}from"./index-HxeE9C0A.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +1 @@
1
- import{aP as l,aQ as p,aR as n,aS as d,aT as h,z as b,r as o,aU as m,aV as f}from"./index-Bn2rDd42.js";var v=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),p(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&n(s.mutationKey)!==n(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??d();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,i=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#e.onSuccess?.(t.data,s,i,e),this.#e.onSettled?.(t.data,null,s,i,e)):t?.type==="error"&&(this.#e.onError?.(t.error,s,i,e),this.#e.onSettled?.(void 0,t.error,s,i,e))}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const i=b(s),[e]=o.useState(()=>new v(i,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const r=o.useSyncExternalStore(o.useCallback(a=>e.subscribe(h.batchCalls(a)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((a,c)=>{e.mutate(a,c).catch(m)},[e]);if(r.error&&f(e.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:u,mutateAsync:r.mutate}}export{O as u};
1
+ import{aO as l,aP as p,aQ as n,aR as d,aS as h,z as b,r as o,aT as m,aU as f}from"./index-HxeE9C0A.js";var v=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),p(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&n(s.mutationKey)!==n(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??d();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,i=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#e.onSuccess?.(t.data,s,i,e),this.#e.onSettled?.(t.data,null,s,i,e)):t?.type==="error"&&(this.#e.onError?.(t.error,s,i,e),this.#e.onSettled?.(void 0,t.error,s,i,e))}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const i=b(s),[e]=o.useState(()=>new v(i,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const r=o.useSyncExternalStore(o.useCallback(a=>e.subscribe(h.batchCalls(a)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((a,c)=>{e.mutate(a,c).catch(m)},[e]);if(r.error&&f(e.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:u,mutateAsync:r.mutate}}export{O as u};
@@ -0,0 +1 @@
1
+ import{a5 as u,a8 as s}from"./index-HxeE9C0A.js";function o(e,r){return u(e,s,r)}export{o as u};
@@ -0,0 +1 @@
1
+ import{ac as a,ad as c}from"./index-HxeE9C0A.js";function e(...r){return a(c(r))}export{e as c};
@@ -1 +1 @@
1
- import{c as Y,r as V,j as i}from"./index-Bn2rDd42.js";import{c as n}from"./utils-Ckc2UwOp.js";const Z={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function oe(J){const e=Y.c(66),{value:o,onValueChange:l,options:t,size:D,fullWidth:F,className:W}=J,K=D===void 0?"sm":D,w=F===void 0?!1:F,G=V.useRef(null),H=V.useRef(null);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={left:0,width:0,opacity:0},e[0]=R):R=e[0];const[N,O]=V.useState(R);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=S=>{if(!S.current)return;const{offsetLeft:U,offsetWidth:X}=S.current;O({left:U,width:X,opacity:1})},e[1]=_):_=e[1];const Q=_;let C;e[2]!==t[0].value||e[3]!==o?(C=()=>{const S=o===t[0].value?G:H;Q(S)},e[2]=t[0].value,e[3]=o,e[4]=C):C=e[4];let E;e[5]!==t||e[6]!==o?(E=[o,t],e[5]=t,e[6]=o,e[7]=E):E=e[7],V.useEffect(C,E);const s=Z[K];let a;e[8]!==W?(a=n("relative flex gap-0 bg-muted rounded-lg",W),e[8]=W,e[9]=a):a=e[9];let c;e[10]!==l||e[11]!==t[0].value?(c=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=c):c=e[12];const $=w?"flex-1 h-12 px-4":s.button,I=!w&&t[0].label?"px-3":"";let r;e[13]!==I||e[14]!==$?(r=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",$,I),e[13]=I,e[14]=$,e[15]=r):r=e[15];const P=o===t[0].value?"text-foreground":"text-muted-foreground";let u;e[16]!==s.icon||e[17]!==P?(u=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,P),e[16]=s.icon,e[17]=P,e[18]=u):u=e[18];let f;e[19]!==t[0].icon||e[20]!==u?(f=i.jsx("span",{className:u,children:t[0].icon}),e[19]=t[0].icon,e[20]=u,e[21]=f):f=e[21];let d;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(d=t[0].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=d):d=e[25];let m;e[26]!==r||e[27]!==f||e[28]!==d||e[29]!==c?(m=i.jsxs("button",{ref:G,type:"button",onClick:c,className:r,children:[f,d]}),e[26]=r,e[27]=f,e[28]=d,e[29]=c,e[30]=m):m=e[30];let x;e[31]!==l||e[32]!==t[1].value?(x=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=x):x=e[33];const L=w?"flex-1 h-12 px-4":s.button,M=!w&&t[1].label?"px-3":"";let p;e[34]!==L||e[35]!==M?(p=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",L,M),e[34]=L,e[35]=M,e[36]=p):p=e[36];const T=o===t[1].value?"text-foreground":"text-muted-foreground";let b;e[37]!==s.icon||e[38]!==T?(b=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,T),e[37]=s.icon,e[38]=T,e[39]=b):b=e[39];let v;e[40]!==t[1].icon||e[41]!==b?(v=i.jsx("span",{className:b,children:t[1].icon}),e[40]=t[1].icon,e[41]=b,e[42]=v):v=e[42];let g;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(g=t[1].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=g):g=e[46];let h;e[47]!==x||e[48]!==p||e[49]!==v||e[50]!==g?(h=i.jsxs("button",{ref:H,type:"button",onClick:x,className:p,children:[v,g]}),e[47]=x,e[48]=p,e[49]=v,e[50]=g,e[51]=h):h=e[51];const q=w?"h-12":s.button;let y;e[52]!==q?(y=n("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",q),e[52]=q,e[53]=y):y=e[53];const A=`${N.left}px`,B=`${N.width}px`;let j;e[54]!==N.opacity||e[55]!==A||e[56]!==B?(j={left:A,width:B,opacity:N.opacity},e[54]=N.opacity,e[55]=A,e[56]=B,e[57]=j):j=e[57];let z;e[58]!==y||e[59]!==j?(z=i.jsx("div",{className:y,style:j}),e[58]=y,e[59]=j,e[60]=z):z=e[60];let k;return e[61]!==m||e[62]!==h||e[63]!==z||e[64]!==a?(k=i.jsxs("div",{className:a,children:[m,h,z]}),e[61]=m,e[62]=h,e[63]=z,e[64]=a,e[65]=k):k=e[65],k}export{oe as V};
1
+ import{c as Y,r as V,j as i}from"./index-HxeE9C0A.js";import{c as n}from"./utils-D1Qd9-I_.js";const Z={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function oe(J){const e=Y.c(66),{value:o,onValueChange:l,options:t,size:D,fullWidth:F,className:W}=J,K=D===void 0?"sm":D,w=F===void 0?!1:F,G=V.useRef(null),H=V.useRef(null);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={left:0,width:0,opacity:0},e[0]=R):R=e[0];const[N,O]=V.useState(R);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=S=>{if(!S.current)return;const{offsetLeft:U,offsetWidth:X}=S.current;O({left:U,width:X,opacity:1})},e[1]=_):_=e[1];const Q=_;let C;e[2]!==t[0].value||e[3]!==o?(C=()=>{const S=o===t[0].value?G:H;Q(S)},e[2]=t[0].value,e[3]=o,e[4]=C):C=e[4];let E;e[5]!==t||e[6]!==o?(E=[o,t],e[5]=t,e[6]=o,e[7]=E):E=e[7],V.useEffect(C,E);const s=Z[K];let a;e[8]!==W?(a=n("relative flex gap-0 bg-muted rounded-lg",W),e[8]=W,e[9]=a):a=e[9];let c;e[10]!==l||e[11]!==t[0].value?(c=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=c):c=e[12];const $=w?"flex-1 h-12 px-4":s.button,I=!w&&t[0].label?"px-3":"";let r;e[13]!==I||e[14]!==$?(r=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",$,I),e[13]=I,e[14]=$,e[15]=r):r=e[15];const P=o===t[0].value?"text-foreground":"text-muted-foreground";let u;e[16]!==s.icon||e[17]!==P?(u=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,P),e[16]=s.icon,e[17]=P,e[18]=u):u=e[18];let f;e[19]!==t[0].icon||e[20]!==u?(f=i.jsx("span",{className:u,children:t[0].icon}),e[19]=t[0].icon,e[20]=u,e[21]=f):f=e[21];let d;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(d=t[0].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=d):d=e[25];let m;e[26]!==r||e[27]!==f||e[28]!==d||e[29]!==c?(m=i.jsxs("button",{ref:G,type:"button",onClick:c,className:r,children:[f,d]}),e[26]=r,e[27]=f,e[28]=d,e[29]=c,e[30]=m):m=e[30];let x;e[31]!==l||e[32]!==t[1].value?(x=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=x):x=e[33];const L=w?"flex-1 h-12 px-4":s.button,M=!w&&t[1].label?"px-3":"";let p;e[34]!==L||e[35]!==M?(p=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",L,M),e[34]=L,e[35]=M,e[36]=p):p=e[36];const T=o===t[1].value?"text-foreground":"text-muted-foreground";let b;e[37]!==s.icon||e[38]!==T?(b=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,T),e[37]=s.icon,e[38]=T,e[39]=b):b=e[39];let v;e[40]!==t[1].icon||e[41]!==b?(v=i.jsx("span",{className:b,children:t[1].icon}),e[40]=t[1].icon,e[41]=b,e[42]=v):v=e[42];let g;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(g=t[1].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=g):g=e[46];let h;e[47]!==x||e[48]!==p||e[49]!==v||e[50]!==g?(h=i.jsxs("button",{ref:H,type:"button",onClick:x,className:p,children:[v,g]}),e[47]=x,e[48]=p,e[49]=v,e[50]=g,e[51]=h):h=e[51];const q=w?"h-12":s.button;let y;e[52]!==q?(y=n("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",q),e[52]=q,e[53]=y):y=e[53];const A=`${N.left}px`,B=`${N.width}px`;let j;e[54]!==N.opacity||e[55]!==A||e[56]!==B?(j={left:A,width:B,opacity:N.opacity},e[54]=N.opacity,e[55]=A,e[56]=B,e[57]=j):j=e[57];let z;e[58]!==y||e[59]!==j?(z=i.jsx("div",{className:y,style:j}),e[58]=y,e[59]=j,e[60]=z):z=e[60];let k;return e[61]!==m||e[62]!==h||e[63]!==z||e[64]!==a?(k=i.jsxs("div",{className:a,children:[m,h,z]}),e[61]=m,e[62]=h,e[63]=z,e[64]=a,e[65]=k):k=e[65],k}export{oe as V};
@@ -0,0 +1 @@
1
+ import{u as P,g as z,m as M,r as E,j as t,O as L,c as _,aM as A}from"./index-HxeE9C0A.js";import{e as F}from"./constants-BEco_-y7.js";import{C as T}from"./collection-tab-Y58MHDMK.js";import{g as G,h as H}from"./use-connection-DWpxH8iy.js";import{B as w}from"./button-C1iesapY.js";import{E as U}from"./empty-state-CH3e4Xzf.js";import{E as D,i as J}from"./error-boundary-BGFWaL1J.js";import{P as y}from"./index-wUnd_o-U.js";import{B as V,a as q,b as Q,c as X}from"./breadcrumb-t_Ccp20G.js";import{a as Y,b as Z}from"./use-binding-BIvDtNoa.js";import{i as K}from"./Loading01-CudhqwtJ.js";import{s as ee}from"./RefreshCcw01-Dzlid7sh.js";import{a as te}from"./Settings02-CW4MK9LY.js";import"./generate-id-Dyweu44Y.js";import"./collection-table-wrapper-B6XWzQ-4.js";import"./dropdown-menu-D6YYwFq7.js";import"./ChevronRight-CNYkXy1u.js";import"./utils-D1Qd9-I_.js";import"./ArrowUp-DVhz9MPT.js";import"./Check-BIlnRzi6.js";import"./Grid01-BhCIE3UE.js";import"./List-B95opsr5.js";import"./integration-icon-CmJggqPx.js";import"./index-ByJoFAq_.js";import"./view-mode-toggle-JVmuLwXe.js";import"./table-F_F9uG31.js";import"./collection-search-D3a5_1zR.js";import"./SearchMd-yRVgOeax.js";import"./input-DBGu1Yhi.js";import"./card-DKzkS6ji.js";import"./Copy01-BJPi2nBZ.js";import"./DotsVertical-CPJps54j.js";import"./Edit01-CLT1AKyh.js";import"./use-list-state-CqdwrHCA.js";import"./avatar-BbH9O0kN.js";import"./useQuery-jRtVXI31.js";import"./use-mobile-CqANtQ4e.js";import"./Trash01-py7ft8Od.js";import"./empty-state-BQPtoYZe.js";import"./Inbox01-Bz-1SNbb.js";import"./constants-gwxE8_b0.js";import"./alert-dialog-B1nWkQHx.js";import"./Plus-BVPnBK8D.js";import"./layout-BQSZy0Ao.js";import"./useMutation-M3-wug2Q.js";import"./binder-xcUkLvPC.js";function se({title:n,description:e,wellKnownMcp:o,imageSrc:r,onConnected:i}){const c=G(),{org:{slug:p}}=P(),{data:a}=z.useSession(),u=M(),[m,k]=E.useState(!1),s=async()=>{if(!(!o||!a?.user?.id)){k(!0);try{const d=await c.create.mutateAsync(o);i?.(d.id),u({to:"/$org/$project/mcps/$connectionId",params:{org:p,project:L,connectionId:d.id}})}finally{k(!1)}}},N=()=>{u({to:"/$org/$project/mcps",params:{org:p,project:L},search:{action:"create"}})};return t.jsx(U,{image:r?t.jsx("img",{src:r,alt:n,width:336,height:320,className:"max-w-full h-auto"}):null,title:n,description:e,actions:t.jsxs(t.Fragment,{children:[t.jsxs(w,{variant:"outline",onClick:s,disabled:m||!o,children:[o?.icon&&t.jsx("img",{src:o.icon,alt:"",className:"size-4"}),m?"Installing...":`Install ${o?.title||"MCP"}`]}),t.jsx(w,{variant:"outline",onClick:N,children:"Custom Connection"})]})})}function ie(n){const e=_.c(35),{bindingName:o,collectionName:r,title:i,emptyState:c,wellKnownMcp:p}=n,{org:a}=P(),u=H();let m;e[0]!==u||e[1]!==o?(m={connections:u,binding:o},e[0]=u,e[1]=o,e[2]=m):m=e[2];const s=Y(m)[0],N=Z(s);let d;if(e[3]!==r||e[4]!==N){let l;e[6]!==r?(l=$=>$.name.toLowerCase()===r.toLowerCase(),e[6]=r,e[7]=l):l=e[7],d=N.find(l),e[3]=r,e[4]=N,e[5]=d}else d=e[5];const I=d,[W,O]=E.useState(null),B=s&&I&&(s.id||W);let f;e[8]!==i?(f=t.jsx(y.Header,{children:t.jsx(y.Header.Left,{children:t.jsx(V,{children:t.jsx(q,{children:t.jsx(Q,{children:t.jsx(X,{children:i})})})})})}),e[8]=i,e[9]=f):f=e[9];let x;e[10]!==s||e[11]!==a||e[12]!==i?(x=l=>{const{error:$,resetError:R}=l;return t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(J,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("h3",{className:"text-lg font-medium",children:["Failed to load ",i.toLowerCase()]}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:$?.message||"Unable to connect to the server. Please check that it is running and accessible."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(w,{variant:"outline",onClick:R,children:[t.jsx(ee,{className:"size-4"}),"Try again"]}),s&&t.jsx(w,{variant:"outline",asChild:!0,children:t.jsxs(A,{to:"/$org/$project/mcps/$connectionId",params:{org:a.slug,project:L,connectionId:s.id},search:{tab:"settings"},children:[t.jsx(te,{className:"size-4"}),"Connection Settings"]})})]})]})},e[10]=s,e[11]=a,e[12]=i,e[13]=x):x=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(K,{size:32,className:"animate-spin text-muted-foreground mb-4"}),e[14]=S):S=e[14];let g;e[15]!==i?(g=i.toLowerCase(),e[15]=i,e[16]=g):g=e[16];let h;e[17]!==g?(h=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[S,t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",g,"..."]})]}),e[17]=g,e[18]=h):h=e[18];let j;e[19]!==I||e[20]!==s||e[21]!==c||e[22]!==a||e[23]!==B||e[24]!==p?(j=B?t.jsx(T,{connectionId:s.id,org:a.slug,activeCollection:I}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(se,{title:c.title,description:c.description,wellKnownMcp:p,imageSrc:c.imageSrc,onConnected:l=>{O(l)}})}),e[19]=I,e[20]=s,e[21]=c,e[22]=a,e[23]=B,e[24]=p,e[25]=j):j=e[25];let C;e[26]!==h||e[27]!==j?(C=t.jsx(E.Suspense,{fallback:h,children:j}),e[26]=h,e[27]=j,e[28]=C):C=e[28];let b;e[29]!==x||e[30]!==C?(b=t.jsx(y.Content,{children:t.jsx(D,{fallback:x,children:C})}),e[29]=x,e[30]=C,e[31]=b):b=e[31];let v;return e[32]!==b||e[33]!==f?(v=t.jsxs(y,{children:[f,b]}),e[32]=b,e[33]=f,e[34]=v):v=e[34],v}function Xe(){const n=_.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Install MCP Studio to create and manage automated workflows with multiple steps and integrations."},wellKnownMcp:F()}),n[0]=e):e=n[0],e}export{Xe as default};
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <title>MCP Mesh</title>
5
5
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
- <script type="module" crossorigin src="/assets/index-Bn2rDd42.js"></script>
7
- <link rel="stylesheet" crossorigin href="/assets/index--g69ISoA.css">
6
+ <script type="module" crossorigin src="/assets/index-HxeE9C0A.js"></script>
7
+ <link rel="stylesheet" crossorigin href="/assets/index-BEdPWc-P.css">
8
8
  </head>
9
9
  <body>
10
10
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "2.74.0",
3
+ "version": "2.76.0",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{r as _,j as t,b7 as dt,a3 as xe,an as Ne,b6 as mt,av as ut,a$ as ft,am as pt,at as xt,b8 as Ue,aq as ht,c as T,u as he,V as gt,s as bt,t as Oe,m as jt,a as vt,O as He,bt as Nt,k as yt,h as Ct,aN as _t,n as Tt}from"./index-Bn2rDd42.js";import{i as St,a as wt,b as kt,u as It,C as Et,c as At}from"./use-deco-chat-open-CfZI9mqc.js";import{E as Ot}from"./empty-state--JD6ZxUc.js";import{E as pe,i as Dt}from"./error-boundary-DlgelpJG.js";import{I as ge,T as ce,c as ye,b as de,a as me}from"./integration-icon-C8seGsuO.js";import{I as $t,R as Rt,a as Lt,S as Pt,P as zt}from"./index-a2nqbblp.js";import{B as De}from"./badge-BklHLRcK.js";import{B as X}from"./button-CcO5M7F7.js";import{I as Me}from"./input-DBvMwxwE.js";import{S as Vt}from"./switch-CG0LWjwI.js";import{T as Mt}from"./textarea-CKlKOzV4.js";import{h as Ft,f as Bt}from"./use-connection-CVk8Bzpz.js";import{u as Gt,a as Ut}from"./use-virtual-mcp-C83o4Rih.js";import{i as We}from"./ChevronRight-By4KEpZh.js";import{n as Ht}from"./select-J2aavKNi.js";import{i as $e}from"./File02-BNE7fmK0.js";import{i as Ke}from"./Loading01-D8zw0cyg.js";import{i as Wt}from"./Play-Yhg_pcqU.js";import{s as Fe}from"./Plus-BBD2SckJ.js";import{i as Kt}from"./Share07-C8iek9k4.js";import{a as Re}from"./Tool01-DF-lT9RC.js";import{B as qt,a as Jt,b as Be,d as Yt,e as Zt,c as Qt}from"./breadcrumb-B_Yxwj4p.js";import{a as Xt,V as es}from"./layout-ZTsfxACA.js";import{C as ts}from"./collection-search-Cyt8_oQV.js";import{C as Le}from"./checkbox-CirsSPdM.js";import{e as ss,a as qe,D as Je,b as ls,c as os}from"./dialog-B_iTVR3h.js";import{c as J}from"./utils-Ckc2UwOp.js";import{u as Pe}from"./constants-DuSOM18S.js";import{c as ns}from"./use-mcp-tools-Ddi2i1Nb.js";import{c as rs,u as is}from"./use-mcp-prompts-Cn7tm6ug.js";import{s as Ye}from"./slugify-CEUa2lfQ.js";import{i as Ze}from"./Check-Sa4xK5Hg.js";import{i as as}from"./Code01-h_k8K-1e.js";import{a as cs}from"./Copy01-jvqvZrKj.js";import{i as Ce}from"./InfoCircle-5xWfOa8P.js";import{A as ds}from"./agent-connections-preview-D4bn0NTx.js";import"./use-llm-Ca3pgrIB.js";import"./use-binding-Dgjl_Htk.js";import"./binder-ak1AkjZY.js";import"./useQuery-Ct96KcZp.js";import"./localstorage-keys-BhunmwZg.js";import"./useMutation-CnTeRHmv.js";import"./popover-BkKSdvGf.js";import"./ChevronDown-DmXLJeAy.js";import"./File06-WU23pV9H.js";import"./Grid01-CSAsqBFD.js";import"./Image01-BnbXZOf7.js";import"./SearchMd-CGuwiAQe.js";import"./index-DZ7G-bvr.js";import"./Pin01-DWsvacVo.js";import"./use-organization-settings-DHZKDAPt.js";import"./index-BHu7Lc_d.js";import"./X-CuhyLwhM.js";import"./infiniteQueryObserver-VnhrjjoH.js";const Qe=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));Qe.displayName="Circle";const Xe=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"M9 2v3m6-3v3M9 19v3m6-3v3m4-13h3m-3 5h3M2 9h3m-3 5h3m4.8 5h4.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C19 16.72 19 15.88 19 14.2V9.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C16.72 5 15.88 5 14.2 5H9.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C5 7.28 5 8.12 5 9.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C7.28 19 8.12 19 9.8 19Z"}));Xe.displayName="CpuChip02";const be=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"m9.75 20.75 1.473.818c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l1.473-.818m-9-2.5-1.427-.793c-.3-.166-.45-.25-.558-.368a1 1 0 0 1-.215-.364C3 16.573 3 16.401 3 16.06V14.5m0-5V7.942c0-.343 0-.514.05-.667a1 1 0 0 1 .215-.364c.109-.119.258-.202.558-.368L5.25 5.75m4.5-2.5 1.473-.818c.284-.158.425-.237.576-.267a1 1 0 0 1 .402 0c.15.03.292.11.576.267l1.473.818m4.5 2.5 1.427.793c.3.166.45.25.558.368a1 1 0 0 1 .215.364c.05.153.05.324.05.667V9.5m0 5v1.559c0 .342 0 .514-.05.666a.999.999 0 0 1-.215.364c-.109.119-.258.202-.558.368l-1.427.793m-9-7.5L12 12m0 0 2.25-1.25M12 12v2.5M3 7l2.25 1.25m13.5 0L21 7m-9 12.5V22"}));be.displayName="CubeOutline";var je="Tabs",[ms]=ht(je,[Ue]),et=Ue(),[us,ze]=ms(je),tt=_.forwardRef((o,e)=>{const{__scopeTabs:s,value:r,onValueChange:l,defaultValue:n,orientation:c="horizontal",dir:i,activationMode:a="automatic",...m}=o,u=ft(i),[d,f]=pt({prop:r,onChange:l,defaultProp:n??"",caller:je});return t.jsx(us,{scope:s,baseId:xt(),value:d,onValueChange:f,orientation:c,dir:u,activationMode:a,children:t.jsx(xe.div,{dir:u,"data-orientation":c,...m,ref:e})})});tt.displayName=je;var st="TabsList",lt=_.forwardRef((o,e)=>{const{__scopeTabs:s,loop:r=!0,...l}=o,n=ze(st,s),c=et(s);return t.jsx(mt,{asChild:!0,...c,orientation:n.orientation,dir:n.dir,loop:r,children:t.jsx(xe.div,{role:"tablist","aria-orientation":n.orientation,...l,ref:e})})});lt.displayName=st;var ot="TabsTrigger",nt=_.forwardRef((o,e)=>{const{__scopeTabs:s,value:r,disabled:l=!1,...n}=o,c=ze(ot,s),i=et(s),a=at(c.baseId,r),m=ct(c.baseId,r),u=r===c.value;return t.jsx(dt,{asChild:!0,...i,focusable:!l,active:u,children:t.jsx(xe.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":m,"data-state":u?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:a,...n,ref:e,onMouseDown:Ne(o.onMouseDown,d=>{!l&&d.button===0&&d.ctrlKey===!1?c.onValueChange(r):d.preventDefault()}),onKeyDown:Ne(o.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&c.onValueChange(r)}),onFocus:Ne(o.onFocus,()=>{const d=c.activationMode!=="manual";!u&&!l&&d&&c.onValueChange(r)})})})});nt.displayName=ot;var rt="TabsContent",it=_.forwardRef((o,e)=>{const{__scopeTabs:s,value:r,forceMount:l,children:n,...c}=o,i=ze(rt,s),a=at(i.baseId,r),m=ct(i.baseId,r),u=r===i.value,d=_.useRef(u);return _.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),t.jsx(ut,{present:l||u,children:({present:f})=>t.jsx(xe.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":a,hidden:!f,id:m,tabIndex:0,...c,ref:e,style:{...o.style,animationDuration:d.current?"0s":void 0},children:f&&n})})});it.displayName=rt;function at(o,e){return`${o}-trigger-${e}`}function ct(o,e){return`${o}-content-${e}`}var fs=tt,ps=lt,xs=nt,hs=it;function gs(o){const e=T.c(10);let s,r,l;e[0]!==o?({className:s,variant:l,...r}=o,e[0]=o,e[1]=s,e[2]=r,e[3]=l):(s=e[1],r=e[2],l=e[3]);const n=l===void 0?"pill":l;let c;e[4]!==s?(c=J("flex flex-col gap-2",s),e[4]=s,e[5]=c):c=e[5];let i;return e[6]!==r||e[7]!==c||e[8]!==n?(i=t.jsx(fs,{"data-slot":"tabs","data-variant":n,className:c,...r}),e[6]=r,e[7]=c,e[8]=n,e[9]=i):i=e[9],i}function bs(o){const e=T.c(11);let s,r,l;e[0]!==o?({className:s,variant:l,...r}=o,e[0]=o,e[1]=s,e[2]=r,e[3]=l):(s=e[1],r=e[2],l=e[3]);const n=l||"pill",c=n==="underline"?"flex h-[52px] items-center border-b border-border":n==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==s||e[5]!==c?(i=J(c,s),e[4]=s,e[5]=c,e[6]=i):i=e[6];let a;return e[7]!==n||e[8]!==r||e[9]!==i?(a=t.jsx(ps,{"data-slot":"tabs-list","data-variant":n,className:i,...r}),e[7]=n,e[8]=r,e[9]=i,e[10]=a):a=e[10],a}function _e(o){const e=T.c(11);let s,r,l;e[0]!==o?({className:s,variant:l,...r}=o,e[0]=o,e[1]=s,e[2]=r,e[3]=l):(s=e[1],r=e[2],l=e[3]);const n=l||"pill",c=n==="underline"?"cursor-pointer flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-foreground disabled:pointer-events-none disabled:opacity-50":n==="canvas"?"cursor-pointer flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==s||e[5]!==c?(i=J(c,s),e[4]=s,e[5]=c,e[6]=i):i=e[6];let a;return e[7]!==n||e[8]!==r||e[9]!==i?(a=t.jsx(xs,{"data-slot":"tabs-trigger","data-variant":n,className:i,...r}),e[7]=n,e[8]=r,e[9]=i,e[10]=a):a=e[10],a}function Te(o){const e=T.c(8);let s,r;e[0]!==o?({className:s,...r}=o,e[0]=o,e[1]=s,e[2]=r):(s=e[1],r=e[2]);let l;e[3]!==s?(l=J("flex-1 outline-none h-full",s),e[3]=s,e[4]=l):l=e[4];let n;return e[5]!==r||e[6]!==l?(n=t.jsx(hs,{"data-slot":"tabs-content",className:l,...r}),e[5]=r,e[6]=l,e[7]=n):n=e[7],n}function Se(o){return o===null?"all":o?.length??0}function js(o,e){const s=o[e];if(!s)return"";const r=[];return s.tools===null?r.push("all tools"):s.tools&&s.tools.length>0&&r.push(`${s.tools.length} tools`),s.resources===null?r.push("all resources"):s.resources&&s.resources.length>0&&r.push(`${s.resources.length} resources`),s.prompts===null?r.push("all prompts"):s.prompts&&s.prompts.length>0&&r.push(`${s.prompts.length} prompts`),r.join(", ")}function vs(o,e){const s=o[e];return s?!((s.tools===void 0||s.tools!==null&&s.tools.length===0)&&(s.resources===void 0||s.resources!==null&&s.resources.length===0)&&(s.prompts===void 0||s.prompts!==null&&s.prompts.length===0)):!1}const Ns={tools:null,resources:null,prompts:null};function we(){const o=T.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(Ke,{className:"animate-spin text-muted-foreground",size:24})}),o[0]=e):e=o[0],e}function ke(o){return({error:e})=>e?.message?.includes("Method not found")||e?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:o})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Dt,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:e?.message?e.message.length>200?`${e.message.slice(0,200)}...`:e.message:"An unexpected error occurred"})]})]})}function ys(o){const e=T.c(18),{item:s,isSelected:r,onToggle:l,disabled:n}=o,c=n?"cursor-not-allowed opacity-50":"cursor-pointer",i=r?"bg-accent/25":"hover:bg-muted/50";let a;e[0]!==c||e[1]!==i?(a=J("flex items-start gap-3 p-4 rounded-lg transition-colors",c,i),e[0]=c,e[1]=i,e[2]=a):a=e[2];let m;e[3]!==s.name?(m=t.jsx("p",{className:"text-sm font-medium leading-none",children:s.name}),e[3]=s.name,e[4]=m):m=e[4];let u;e[5]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[5]=s.description,e[6]=u):u=e[6];let d;e[7]!==m||e[8]!==u?(d=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[7]=m,e[8]=u,e[9]=d):d=e[9];let f;e[10]!==n||e[11]!==r||e[12]!==l?(f=t.jsx(Le,{checked:r,onCheckedChange:l,disabled:n,className:"mt-0.5"}),e[10]=n,e[11]=r,e[12]=l,e[13]=f):f=e[13];let h;return e[14]!==a||e[15]!==d||e[16]!==f?(h=t.jsxs("label",{className:a,children:[d,f]}),e[14]=a,e[15]=d,e[16]=f,e[17]=h):h=e[17],h}function Ve(o){const e=T.c(32),{items:s,selections:r,onToggle:l,onToggleAll:n,emptyMessage:c,disabled:i}=o;let a,m,u,d,f;if(e[0]!==i||e[1]!==c||e[2]!==s||e[3]!==l||e[4]!==n||e[5]!==r){f=Symbol.for("react.early_return_sentinel");e:{const p=s.map(Cs);if(s.length===0){let C;e[11]!==c?(C=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:c})}),e[11]=c,e[12]=C):C=e[12],f=C;break e}u="flex flex-col h-full";const N=i?"cursor-not-allowed opacity-50":"cursor-pointer";let j;e[13]!==N?(j=J("flex items-start gap-3 p-4",N),e[13]=N,e[14]=j):j=e[14];let v;e[15]!==s.length?(v=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("span",{className:"text-sm font-medium",children:["Select All (",s.length,")"]})}),e[15]=s.length,e[16]=v):v=e[16];const g=r===null;let y;e[17]!==i||e[18]!==n||e[19]!==g?(y=t.jsx(Le,{checked:g,onCheckedChange:n,disabled:i,className:"mt-0.5"}),e[17]=i,e[18]=n,e[19]=g,e[20]=y):y=e[20],e[21]!==y||e[22]!==j||e[23]!==v?(d=t.jsx("div",{className:"px-4 border-b border-border shrink-0",children:t.jsxs("label",{className:j,children:[v,y]})}),e[21]=y,e[22]=j,e[23]=v,e[24]=d):d=e[24],a="flex-1 overflow-auto px-4 py-3 space-y-1",m=s.map(C=>t.jsx(ys,{item:C,isSelected:r===null||r?.includes(C.id),onToggle:()=>l(C.id,p),disabled:i},C.id))}e[0]=i,e[1]=c,e[2]=s,e[3]=l,e[4]=n,e[5]=r,e[6]=a,e[7]=m,e[8]=u,e[9]=d,e[10]=f}else a=e[6],m=e[7],u=e[8],d=e[9],f=e[10];if(f!==Symbol.for("react.early_return_sentinel"))return f;let h;e[25]!==a||e[26]!==m?(h=t.jsx("div",{className:a,children:m}),e[25]=a,e[26]=m,e[27]=h):h=e[27];let x;return e[28]!==u||e[29]!==d||e[30]!==h?(x=t.jsxs("div",{className:u,children:[d,h]}),e[28]=u,e[29]=d,e[30]=h,e[31]=x):x=e[31],x}function Cs(o){return o.id}function _s(o){const e=T.c(13),{connectionId:s,selections:r,onToggle:l,onToggleAll:n,disabled:c}=o,{org:i}=he();let a;e[0]!==s||e[1]!==i.id?(a={connectionId:s,orgId:i.id},e[0]=s,e[1]=i.id,e[2]=a):a=e[2];const m=Pe(a);let u;e[3]!==m?(u={client:m},e[3]=m,e[4]=u):u=e[4];const{data:d}=ns(u);let f;e[5]!==d.tools?(f=d.tools.map(Ts),e[5]=d.tools,e[6]=f):f=e[6];const h=f;let x;return e[7]!==c||e[8]!==h||e[9]!==l||e[10]!==n||e[11]!==r?(x=t.jsx(Ve,{items:h,selections:r,onToggle:l,onToggleAll:n,emptyMessage:"No tools available",disabled:c}),e[7]=c,e[8]=h,e[9]=l,e[10]=n,e[11]=r,e[12]=x):x=e[12],x}function Ts(o){return{id:o.name,name:o.name,description:o.description}}function Ss(o){const e=T.c(13),{connectionId:s,selections:r,onToggle:l,onToggleAll:n,disabled:c}=o,{org:i}=he();let a;e[0]!==s||e[1]!==i.id?(a={connectionId:s,orgId:i.id},e[0]=s,e[1]=i.id,e[2]=a):a=e[2];const m=Pe(a);let u;e[3]!==m?(u={client:m},e[3]=m,e[4]=u):u=e[4];const{data:d}=rs(u);let f;e[5]!==d.resources?(f=d.resources.map(ws),e[5]=d.resources,e[6]=f):f=e[6];const h=f;let x;return e[7]!==c||e[8]!==h||e[9]!==l||e[10]!==n||e[11]!==r?(x=t.jsx(Ve,{items:h,selections:r,onToggle:l,onToggleAll:n,emptyMessage:"No resources available",disabled:c}),e[7]=c,e[8]=h,e[9]=l,e[10]=n,e[11]=r,e[12]=x):x=e[12],x}function ws(o){return{id:o.name||o.uri,name:o.name||o.uri,description:o.description}}function ks(o){const e=T.c(13),{connectionId:s,selections:r,onToggle:l,onToggleAll:n,disabled:c}=o,{org:i}=he();let a;e[0]!==s||e[1]!==i.id?(a={connectionId:s,orgId:i.id},e[0]=s,e[1]=i.id,e[2]=a):a=e[2];const m=Pe(a);let u;e[3]!==m?(u={client:m},e[3]=m,e[4]=u):u=e[4];const{data:d}=is(u);let f;e[5]!==d.prompts?(f=d.prompts.map(Is),e[5]=d.prompts,e[6]=f):f=e[6];const h=f;let x;return e[7]!==c||e[8]!==h||e[9]!==l||e[10]!==n||e[11]!==r?(x=t.jsx(Ve,{items:h,selections:r,onToggle:l,onToggleAll:n,emptyMessage:"No prompts available",disabled:c}),e[7]=c,e[8]=h,e[9]=l,e[10]=n,e[11]=r,e[12]=x):x=e[12],x}function Is(o){return{id:o.name,name:o.name,description:o.description}}function Es(o){const e=T.c(24),{connection:s,isSelected:r,hasSelections:l,summary:n,onClick:c,onToggleAll:i,disabled:a}=o,m=a?"cursor-not-allowed opacity-50":"cursor-pointer",u=r?"bg-accent":"hover:bg-muted/50";let d;e[0]!==m||e[1]!==u?(d=J("flex items-center gap-2 p-2 h-12 rounded-lg transition-colors",m,u),e[0]=m,e[1]=u,e[2]=d):d=e[2];const f=a?void 0:c;let h;e[3]!==s.icon||e[4]!==s.title?(h=t.jsx(ge,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[3]=s.icon,e[4]=s.title,e[5]=h):h=e[5];let x;e[6]!==s.title?(x=t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[6]=s.title,e[7]=x):x=e[7];let p;e[8]!==l||e[9]!==n?(p=l&&n&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n}),e[8]=l,e[9]=n,e[10]=p):p=e[10];let N;e[11]!==x||e[12]!==p?(N=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[x,p]}),e[11]=x,e[12]=p,e[13]=N):N=e[13];let j;e[14]!==a||e[15]!==l||e[16]!==i?(j=t.jsx(Le,{checked:l,onCheckedChange:i,onClick:As,disabled:a,className:"shrink-0"}),e[14]=a,e[15]=l,e[16]=i,e[17]=j):j=e[17];let v;return e[18]!==d||e[19]!==f||e[20]!==h||e[21]!==N||e[22]!==j?(v=t.jsxs("div",{className:d,onClick:f,children:[h,N,j]}),e[18]=d,e[19]=f,e[20]=h,e[21]=N,e[22]=j,e[23]=v):v=e[23],v}function As(o){return o.stopPropagation()}function Os(o){const e=T.c(22),{allConnections:s,searchTerm:r,selectedId:l,hasSelections:n,getSelectionSummary:c,onConnectionClick:i,onToggleAll:a,disabled:m}=o;let u;e[0]!==s||e[1]!==r?(u=r?s.filter(x=>x.title.toLowerCase().includes(r.toLowerCase())||x.description?.toLowerCase().includes(r.toLowerCase())):s,e[0]=s,e[1]=r,e[2]=u):u=e[2];const d=u;if(d.length===0){const x=r?"No connections found":"No connections available";let p;return e[3]!==x?(p=t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground p-4",children:x}),e[3]=x,e[4]=p):p=e[4],p}let f;if(e[5]!==m||e[6]!==d||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==a||e[11]!==l){let x;e[13]!==m||e[14]!==c||e[15]!==n||e[16]!==i||e[17]!==a||e[18]!==l?(x=p=>t.jsx(Es,{connection:p,isSelected:l===p.id,hasSelections:n(p.id),summary:c(p.id),onClick:()=>i(p.id),onToggleAll:()=>a(p.id),disabled:m},p.id),e[13]=m,e[14]=c,e[15]=n,e[16]=i,e[17]=a,e[18]=l,e[19]=x):x=e[19],f=d.map(x),e[5]=m,e[6]=d,e[7]=c,e[8]=n,e[9]=i,e[10]=a,e[11]=l,e[12]=f}else f=e[12];let h;return e[20]!==f?(h=t.jsx("div",{className:"flex flex-col gap-0.5",children:f}),e[20]=f,e[21]=h):h=e[21],h}function Ds(o){const e=T.c(75),{currentConnection:s,activeTab:r,selectedId:l,formData:n,toggleTool:c,toggleResource:i,togglePrompt:a,toggleAllTools:m,toggleAllResources:u,toggleAllPrompts:d,onTabChange:f}=o;let h;e[0]!==s.icon||e[1]!==s.title?(h=t.jsx(ge,{icon:s.icon,name:s.title,size:"md",className:"shrink-0"}),e[0]=s.icon,e[1]=s.title,e[2]=h):h=e[2];let x;e[3]!==s.title?(x=t.jsx("h2",{className:"text-lg font-semibold truncate",children:s.title}),e[3]=s.title,e[4]=x):x=e[4];let p;e[5]!==s.description?(p=s.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s.description}),e[5]=s.description,e[6]=p):p=e[6];let N;e[7]!==x||e[8]!==p?(N=t.jsxs("div",{className:"flex-1 min-w-0",children:[x,p]}),e[7]=x,e[8]=p,e[9]=N):N=e[9];let j;e[10]!==h||e[11]!==N?(j=t.jsx("div",{className:"p-6 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[h,N]})}),e[10]=h,e[11]=N,e[12]=j):j=e[12];let v;e[13]!==f?(v=F=>f(F),e[13]=f,e[14]=v):v=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(_e,{value:"tools",variant:"underline",className:"gap-2",children:[t.jsx(Re,{size:16}),"Tools"]}),e[15]=g):g=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs(_e,{value:"resources",variant:"underline",className:"gap-2",children:[t.jsx(be,{size:16}),"Resources"]}),e[16]=y):y=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(bs,{variant:"underline",className:"shrink-0 px-6",children:[g,y,t.jsxs(_e,{value:"prompts",variant:"underline",className:"gap-2",children:[t.jsx($e,{size:16}),"Prompts"]})]}),e[17]=C):C=e[17];let z;e[18]===Symbol.for("react.memo_cache_sentinel")?(z=ke("Tools not supported by this server"),e[18]=z):z=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(we,{}),e[19]=w):w=e[19];let O;e[20]!==n||e[21]!==l?(O=n[l]?n[l].tools:[],e[20]=n,e[21]=l,e[22]=O):O=e[22];let S;e[23]!==l||e[24]!==c?(S=(F,Z)=>c(l,F,Z),e[23]=l,e[24]=c,e[25]=S):S=e[25];let k;e[26]!==l||e[27]!==m?(k=()=>m(l),e[26]=l,e[27]=m,e[28]=k):k=e[28];let E;e[29]!==l||e[30]!==O||e[31]!==S||e[32]!==k?(E=t.jsx(Te,{value:"tools",className:"flex-1 overflow-hidden mt-0",children:t.jsx(pe,{fallback:z,children:t.jsx(_.Suspense,{fallback:w,children:t.jsx(_s,{connectionId:l,selections:O,onToggle:S,onToggleAll:k})})})}),e[29]=l,e[30]=O,e[31]=S,e[32]=k,e[33]=E):E=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=ke("Resources not supported by this server"),e[34]=D):D=e[34];let L;e[35]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(we,{}),e[35]=L):L=e[35];let I;e[36]!==n||e[37]!==l?(I=n[l]?n[l].resources:[],e[36]=n,e[37]=l,e[38]=I):I=e[38];let A;e[39]!==l||e[40]!==i?(A=(F,Z)=>i(l,F,Z),e[39]=l,e[40]=i,e[41]=A):A=e[41];let $;e[42]!==l||e[43]!==u?($=()=>u(l),e[42]=l,e[43]=u,e[44]=$):$=e[44];let P;e[45]!==l||e[46]!==I||e[47]!==A||e[48]!==$?(P=t.jsx(Te,{value:"resources",className:"flex-1 overflow-hidden mt-0",children:t.jsx(pe,{fallback:D,children:t.jsx(_.Suspense,{fallback:L,children:t.jsx(Ss,{connectionId:l,selections:I,onToggle:A,onToggleAll:$})})})}),e[45]=l,e[46]=I,e[47]=A,e[48]=$,e[49]=P):P=e[49];let q;e[50]===Symbol.for("react.memo_cache_sentinel")?(q=ke("Prompts not supported by this server"),e[50]=q):q=e[50];let Y;e[51]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsx(we,{}),e[51]=Y):Y=e[51];let B;e[52]!==n||e[53]!==l?(B=n[l]?n[l].prompts:[],e[52]=n,e[53]=l,e[54]=B):B=e[54];let W;e[55]!==l||e[56]!==a?(W=(F,Z)=>a(l,F,Z),e[55]=l,e[56]=a,e[57]=W):W=e[57];let G;e[58]!==l||e[59]!==d?(G=()=>d(l),e[58]=l,e[59]=d,e[60]=G):G=e[60];let K;e[61]!==l||e[62]!==B||e[63]!==W||e[64]!==G?(K=t.jsx(Te,{value:"prompts",className:"flex-1 overflow-hidden mt-0",children:t.jsx(pe,{fallback:q,children:t.jsx(_.Suspense,{fallback:Y,children:t.jsx(ks,{connectionId:l,selections:B,onToggle:W,onToggleAll:G})})})}),e[61]=l,e[62]=B,e[63]=W,e[64]=G,e[65]=K):K=e[65];let U;e[66]!==r||e[67]!==E||e[68]!==P||e[69]!==K||e[70]!==v?(U=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:t.jsxs(gs,{value:r,onValueChange:v,variant:"underline",className:"flex-1 flex flex-col overflow-hidden",children:[C,E,P,K]})}),e[66]=r,e[67]=E,e[68]=P,e[69]=K,e[70]=v,e[71]=U):U=e[71];let H;return e[72]!==U||e[73]!==j?(H=t.jsxs(t.Fragment,{children:[j,U]}),e[72]=U,e[73]=j,e[74]=H):H=e[74],H}function $s(o){const e={};for(const s of o)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function Ie(o){return Object.entries(o).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function Rs(o,e){switch(e.type){case"SET_SEARCH_TERM":return{...o,searchTerm:e.payload};case"SET_SELECTED":return{...o,selectedId:e.payload};case"SET_ACTIVE_TAB":return{...o,activeTab:e.payload};case"RESET":return{searchTerm:"",selectedId:e.payload.selectedId??e.payload.firstConnectionId??null,activeTab:"tools"};case"SELECT_CONNECTION":return{...o,selectedId:e.payload,activeTab:"tools"};default:return o}}const Ge=(o,e)=>o.find(s=>s.id===e)??o[0];function Ls(o){const e=T.c(79),{open:s,onOpenChange:r,selectedId:l,form:n,connections:c}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const a=Ft(i);let m;e[1]!==a||e[2]!==l?(m=Ge(a,l)?.id??null,e[1]=a,e[2]=l,e[3]=m):m=e[3];let u;e[4]!==m?(u={activeTab:"tools",searchTerm:"",selectedId:m},e[4]=m,e[5]=u):u=e[5];const[d,f]=_.useReducer(Rs,u);let h;e[6]!==c?(h=c??[],e[6]=c,e[7]=h):h=e[7];let x;e[8]!==h?(x=$s(h),e[8]=h,e[9]=x):x=e[9];const p=x;let N;e[10]!==a||e[11]!==d.selectedId?(N=Ge(a,d.selectedId),e[10]=a,e[11]=d.selectedId,e[12]=N):N=e[12];const j=N;let v;e[13]!==p?(v=b=>vs(p,b),e[13]=p,e[14]=v):v=e[14];const g=v;let y;e[15]!==p?(y=b=>js(p,b),e[15]=p,e[16]=y):y=e[16];const C=y;let z;e[17]!==n||e[18]!==p?(z=(b,R,V,Q)=>{const ie=p[b]?.[R];let M;ie===null?M=Q.filter(ve=>ve!==V):ie?.includes(V)?M=ie.filter(ve=>ve!==V):(M=[...ie??[],V],M.length===Q.length&&(M=null));const ae={...p};ae[b]?ae[b]={...ae[b]}:ae[b]={tools:null,resources:null,prompts:null},ae[b][R]=M,n.setValue("connections",Ie(ae),{shouldDirty:!0,shouldTouch:!0})},e[17]=n,e[18]=p,e[19]=z):z=e[19];const w=z;let O;e[20]!==n||e[21]!==p?(O=(b,R)=>{const ie=p[b]?.[R]===null?[]:null,M={...p};M[b]?M[b]={...M[b]}:M[b]={tools:null,resources:null,prompts:null},M[b][R]=ie,n.setValue("connections",Ie(M),{shouldDirty:!0,shouldTouch:!0})},e[20]=n,e[21]=p,e[22]=O):O=e[22];const S=O;let k;e[23]!==w?(k=(b,R,V)=>w(b,"tools",R,V),e[23]=w,e[24]=k):k=e[24];const E=k;let D;e[25]!==w?(D=(b,R,V)=>w(b,"resources",R,V),e[25]=w,e[26]=D):D=e[26];const L=D;let I;e[27]!==w?(I=(b,R,V)=>w(b,"prompts",R,V),e[27]=w,e[28]=I):I=e[28];const A=I;let $;e[29]!==S?($=b=>S(b,"tools"),e[29]=S,e[30]=$):$=e[30];const P=$;let q;e[31]!==S?(q=b=>S(b,"resources"),e[31]=S,e[32]=q):q=e[32];const Y=q;let B;e[33]!==S?(B=b=>S(b,"prompts"),e[33]=S,e[34]=B):B=e[34];const W=B;let G;e[35]!==n||e[36]!==p?(G=b=>{const R=p[b],V=R&&R.tools===null&&R.resources===null&&R.prompts===null,Q={...p};V?delete Q[b]:Q[b]=Ns,n.setValue("connections",Ie(Q),{shouldDirty:!0,shouldTouch:!0})},e[35]=n,e[36]=p,e[37]=G):G=e[37];const K=G;let U;e[38]!==a||e[39]!==r||e[40]!==l?(U=b=>{b&&f({type:"RESET",payload:{selectedId:l,firstConnectionId:a[0]?.id??null}}),r(b)},e[38]=a,e[39]=r,e[40]=l,e[41]=U):U=e[41];const H=U;let F;e[42]===Symbol.for("react.memo_cache_sentinel")?(F=b=>{f({type:"SELECT_CONNECTION",payload:b})},e[42]=F):F=e[42];const Z=F;let ue;e[43]===Symbol.for("react.memo_cache_sentinel")?(ue=b=>f({type:"SET_SEARCH_TERM",payload:b}),e[43]=ue):ue=e[43];let ee;e[44]!==d.searchTerm?(ee=t.jsx(ts,{value:d.searchTerm,onChange:ue,placeholder:"Search connections..."}),e[44]=d.searchTerm,e[45]=ee):ee=e[45];let te;e[46]!==a||e[47]!==d.searchTerm||e[48]!==d.selectedId||e[49]!==C||e[50]!==g||e[51]!==K?(te=t.jsx("div",{className:"flex-1 overflow-auto p-2",children:t.jsx(Os,{allConnections:a,searchTerm:d.searchTerm,selectedId:d.selectedId,hasSelections:g,getSelectionSummary:C,onConnectionClick:Z,onToggleAll:K})}),e[46]=a,e[47]=d.searchTerm,e[48]=d.selectedId,e[49]=C,e[50]=g,e[51]=K,e[52]=te):te=e[52];let se;e[53]!==ee||e[54]!==te?(se=t.jsxs("div",{className:"w-full sm:w-72 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[ee,te]}),e[53]=ee,e[54]=te,e[55]=se):se=e[55];let le;e[56]!==j||e[57]!==d.activeTab||e[58]!==d.selectedId||e[59]!==p||e[60]!==W||e[61]!==Y||e[62]!==P||e[63]!==A||e[64]!==L||e[65]!==E?(le=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:j&&d.selectedId?t.jsx(Ds,{currentConnection:j,activeTab:d.activeTab,selectedId:d.selectedId,formData:p,toggleTool:E,toggleResource:L,togglePrompt:A,toggleAllTools:P,toggleAllResources:Y,toggleAllPrompts:W,onTabChange:b=>f({type:"SET_ACTIVE_TAB",payload:b})},d.selectedId):t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Select a connection to view its tools, resources, and prompts"})}),e[56]=j,e[57]=d.activeTab,e[58]=d.selectedId,e[59]=p,e[60]=W,e[61]=Y,e[62]=P,e[63]=A,e[64]=L,e[65]=E,e[66]=le):le=e[66];let oe;e[67]!==se||e[68]!==le?(oe=t.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[se,le]}),e[67]=se,e[68]=le,e[69]=oe):oe=e[69];let ne;e[70]!==H?(ne=t.jsx(ss,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(X,{variant:"outline",onClick:()=>H(!1),children:"Done"})}),e[70]=H,e[71]=ne):ne=e[71];let re;e[72]!==oe||e[73]!==ne?(re=t.jsxs(qe,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[oe,ne]}),e[72]=oe,e[73]=ne,e[74]=re):re=e[74];let fe;return e[75]!==H||e[76]!==s||e[77]!==re?(fe=t.jsx(Je,{open:s,onOpenChange:H,children:re}),e[75]=H,e[76]=s,e[77]=re,e[78]=fe):fe=e[78],fe}const Ps=gt.pick({title:!0,description:!0,status:!0,metadata:!0,connections:!0}).extend({title:bt().min(1,"Name is required").max(255)});function zs(o){const e=T.c(8);let s,r;e[0]!==o?({className:s,...r}=o,e[0]=o,e[1]=s,e[2]=r):(s=e[1],r=e[2]);let l;e[3]!==s?(l=J("grid gap-3",s),e[3]=s,e[4]=l):l=e[4];let n;return e[5]!==r||e[6]!==l?(n=t.jsx(Rt,{"data-slot":"radio-group",className:l,...r}),e[5]=r,e[6]=l,e[7]=n):n=e[7],n}function Ee(o){const e=T.c(9);let s,r;e[0]!==o?({className:s,...r}=o,e[0]=o,e[1]=s,e[2]=r):(s=e[1],r=e[2]);let l;e[3]!==s?(l=J("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Lt,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Qe,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=n):n=e[5];let c;return e[6]!==r||e[7]!==l?(c=t.jsx($t,{"data-slot":"radio-group-item",className:l,...r,children:n}),e[6]=r,e[7]=l,e[8]=c):c=e[8],c}function Vs(o){const s=new TextEncoder().encode(o),r=Array.from(s,l=>String.fromCharCode(l)).join("");return btoa(r)}function Ms(o){const e=T.c(10),{url:s}=o,[r,l]=_.useState(!1);let n;e[0]!==s?(n=async()=>{await navigator.clipboard.writeText(s),l(!0),Oe.success("Agent URL copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[0]=s,e[1]=n):n=e[1];const c=n;let i;e[2]!==r?(i=r?t.jsx(Ze,{size:20,className:"text-green-600"}):t.jsx(cs,{size:20}),e[2]=r,e[3]=i):i=e[3];const a=r?"Copied!":"Copy URL";let m;e[4]!==a?(m=t.jsx("span",{className:"text-xs font-medium",children:a}),e[4]=a,e[5]=m):m=e[5];let u;return e[6]!==c||e[7]!==i||e[8]!==m?(u=t.jsxs(X,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[i,m]}),e[6]=c,e[7]=i,e[8]=m,e[9]=u):u=e[9],u}function Fs(o){const e=T.c(7),{url:s,serverName:r}=o;let l;e[0]!==r||e[1]!==s?(l=()=>{const m=Ye(r),d=Vs(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),f=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(m)}&config=${encodeURIComponent(d)}`;window.open(f,"_blank"),Oe.success("Opening Cursor...")},e[0]=r,e[1]=s,e[2]=l):l=e[2];const n=l;let c,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),i=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=c,e[4]=i):(c=e[3],i=e[4]);let a;return e[5]!==n?(a=t.jsxs(X,{type:"button",variant:"outline",onClick:n,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,i]}),e[5]=n,e[6]=a):a=e[6],a}function Bs(o){const e=T.c(11),{url:s,serverName:r}=o,[l,n]=_.useState(!1);let c;e[0]!==r||e[1]!==s?(c=async()=>{const f=Ye(r),x=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),p=`claude mcp add-json "${f}" '${x.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(p),n(!0),Oe.success("Claude Code command copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=r,e[1]=s,e[2]=c):c=e[2];const i=c;let a;e[3]!==l?(a=l?t.jsx(Ze,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=l,e[4]=a):a=e[4];const m=l?"Copied!":"Install on Claude";let u;e[5]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let d;return e[7]!==i||e[8]!==a||e[9]!==u?(d=t.jsxs(X,{type:"button",variant:"outline",onClick:i,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,u]}),e[7]=i,e[8]=a,e[9]=u,e[10]=d):d=e[10],d}function Gs(o){const e=T.c(40),{open:s,onOpenChange:r,virtualMcp:l}=o,[n,c]=_.useState("code_execution");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=P=>{(P==="passthrough"||P==="smart_tool_selection"||P==="code_execution")&&c(P)},e[0]=i):i=e[0];const a=i;let m;e[1]!==n||e[2]!==l.id?(m=new URL(`/mcp/virtual-mcp/${l.id}`,window.location.origin),m.searchParams.set("mode",n),e[1]=n,e[2]=l.id,e[3]=m):m=e[3];let u;e[4]!==l.id||e[5]!==l.title?(u=l.title||`agent-${l.id?.slice(0,8)??"default"}`,e[4]=l.id,e[5]=l.title,e[6]=u):u=e[6];const d=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ls,{children:t.jsx(os,{children:"Share Agent"})}),e[7]=f):f=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=h):h=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(St,{className:"size-5 text-muted-foreground"})}),e[9]=x):x=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=p):p=e[10];let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ce,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[11]=N):N=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[x,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[p,t.jsx(ye,{children:t.jsxs(de,{children:[N,t.jsx(me,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Ee,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=j):j=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(wt,{className:"size-5 text-muted-foreground"})}),e[13]=v):v=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=g):g=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ce,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[15]=y):y=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[v,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[g,t.jsx(ye,{children:t.jsxs(de,{children:[y,t.jsx(me,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Ee,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=C):C=e[16];let z;e[17]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(as,{className:"size-5 text-muted-foreground"})}),e[17]=z):z=e[17];let w;e[18]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=w):w=e[18];let O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ce,{asChild:!0,children:t.jsx(Ce,{className:"size-3.5 text-muted-foreground"})}),e[19]=O):O=e[19];let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[z,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[w,t.jsx(ye,{children:t.jsxs(de,{children:[O,t.jsx(me,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Ee,{id:"mode-code",value:"code_execution"}),t.jsx(De,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=S):S=e[20];let k;e[21]!==n?(k=t.jsxs("div",{className:"flex flex-col gap-3",children:[h,t.jsxs(zs,{value:n,onValueChange:a,className:"flex flex-col gap-4.5",children:[j,C,S]})]}),e[21]=n,e[22]=k):k=e[22];let E;e[23]!==m.href?(E=t.jsx(Ms,{url:m.href}),e[23]=m.href,e[24]=E):E=e[24];let D,L;e[25]!==d||e[26]!==m.href?(D=t.jsx(Fs,{url:m.href,serverName:d}),L=t.jsx(Bs,{url:m.href,serverName:d}),e[25]=d,e[26]=m.href,e[27]=D,e[28]=L):(D=e[27],L=e[28]);let I;e[29]!==E||e[30]!==D||e[31]!==L?(I=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[E,D,L]})}),e[29]=E,e[30]=D,e[31]=L,e[32]=I):I=e[32];let A;e[33]!==k||e[34]!==I?(A=t.jsxs(qe,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[f,t.jsxs("div",{className:"flex flex-col gap-6",children:[k,I]})]}),e[33]=k,e[34]=I,e[35]=A):A=e[35];let $;return e[36]!==r||e[37]!==s||e[38]!==A?($=t.jsx(Je,{open:s,onOpenChange:r,children:A}),e[36]=r,e[37]=s,e[38]=A,e[39]=$):$=e[39],$}function Us(o,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...o,shareDialogOpen:e.payload};case"SET_CONNECTION_DIALOG_OPEN":return{...o,connectionDialogOpen:e.payload};case"SET_EDITING_CONNECTION_ID":return{...o,editingConnectionId:e.payload};case"SET_SKILLS_OPEN":return{...o,skillsOpen:e.payload};default:return o}}function Ae(o){const e=T.c(27),{connection_id:s,selected_tools:r,selected_resources:l,selected_prompts:n,onClick:c}=o,i=Bt(s);if(!i)return null;let a;e[0]!==r?(a=Se(r),e[0]=r,e[1]=a):a=e[1];const m=a;let u;e[2]!==l?(u=Se(l),e[2]=l,e[3]=u):u=e[3];const d=u;let f;e[4]!==n?(f=Se(n),e[4]=n,e[5]=f):f=e[5];const h=f;let x;e[6]!==i.icon||e[7]!==i.title?(x=t.jsx(ge,{icon:i.icon,name:i.title,size:"xs"}),e[6]=i.icon,e[7]=i.title,e[8]=x):x=e[8];let p;e[9]!==i.title?(p=t.jsx("p",{className:"flex-1 text-sm font-normal text-foreground truncate",children:i.title}),e[9]=i.title,e[10]=p):p=e[10];let N;e[11]!==m?(N=m!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:m==="all"?"all":m}),t.jsx(Re,{size:12})]}),e[11]=m,e[12]=N):N=e[12];let j;e[13]!==d?(j=d!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:d==="all"?"all":d}),t.jsx(be,{size:12})]}),e[13]=d,e[14]=j):j=e[14];let v;e[15]!==h?(v=h!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:h==="all"?"all":h}),t.jsx($e,{size:12})]}),e[15]=h,e[16]=v):v=e[16];let g;e[17]!==N||e[18]!==j||e[19]!==v?(g=t.jsxs(De,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[N,j,v]}),e[17]=N,e[18]=j,e[19]=v,e[20]=g):g=e[20];let y;e[21]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(We,{size:16,className:"text-muted-foreground shrink-0"}),e[21]=y):y=e[21];let C;return e[22]!==c||e[23]!==x||e[24]!==p||e[25]!==g?(C=t.jsxs("div",{onClick:c,className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border hover:bg-accent/50 transition-colors cursor-pointer",children:[x,p,g,y]}),e[22]=c,e[23]=x,e[24]=p,e[25]=g,e[26]=C):C=e[26],C}Ae.Fallback=function(){return t.jsxs("div",{className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border",children:[t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"flex-1 h-4 rounded bg-muted animate-pulse"}),t.jsxs(De,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(Re,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(be,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx($e,{size:12})]})]}),t.jsx(We,{size:16,className:"text-muted-foreground shrink-0"})]})};function Hs({virtualMcp:o}){const{org:e}=he(),r=Nt().location.href,l=Ut(),n=yt({resolver:Ct(Ps),defaultValues:o}),c=n.watch("connections"),[i,a]=_.useReducer(Us,{shareDialogOpen:!1,connectionDialogOpen:!1,editingConnectionId:null,skillsOpen:!1}),[,m]=kt(),{setVirtualMcpId:u}=It();_.useEffect(()=>{m(!0),u(o.id)},[o.id]);const d=()=>{u(o.id),m(!0)},f=n.formState.isDirty,h=async()=>{const g=n.getValues(),y=await l.update.mutateAsync({id:o.id,data:g});n.reset(y)},x=()=>{n.reset(o)},p=()=>{a({type:"SET_EDITING_CONNECTION_ID",payload:null}),a({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},N=g=>{a({type:"SET_EDITING_CONNECTION_ID",payload:g}),a({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},j=l.update.isPending,v=t.jsx(qt,{children:t.jsxs(Jt,{children:[t.jsx(Be,{children:t.jsx(Yt,{asChild:!0,children:t.jsx(_t,{to:"/$org/$project/agents",params:{org:e.slug,project:He},children:"Agents"})})}),t.jsx(Zt,{}),t.jsx(Be,{children:t.jsx(Qt,{children:o.title})})]})});return t.jsxs(Xt,{breadcrumb:v,children:[t.jsxs(es,{children:[t.jsx(Pt,{onSave:h,onUndo:x,isDirty:f,isSaving:j}),t.jsxs(de,{delayDuration:0,children:[t.jsx(ce,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsxs(X,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:d,"aria-label":"Test Agent",children:[t.jsx(Wt,{size:14}),"Test Agent"]})})}),t.jsx(me,{side:"bottom",children:"Test this agent in chat"})]}),t.jsxs(de,{delayDuration:0,children:[t.jsx(ce,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(X,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:()=>a({type:"SET_SHARE_DIALOG_OPEN",payload:!0}),"aria-label":"Share",children:t.jsx(Kt,{size:14})})})}),t.jsx(me,{side:"bottom",children:"Share"})]}),t.jsx(zt,{title:o.title,url:r,icon:o.icon??"cpu_chip"})]}),t.jsx("div",{className:"flex h-full w-full bg-background overflow-auto",children:t.jsxs("div",{className:"flex flex-col w-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4 p-6 shrink-0",children:[t.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[t.jsx(ge,{icon:o.icon,name:n.watch("title")||"Agent",size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(Xe,{})}),t.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[t.jsx(Me,{...n.register("title"),className:"h-auto py-0.5 text-lg! font-medium leading-7 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Agent Name"}),t.jsx(Me,{...n.register("description"),className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})]})]}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Vt,{checked:n.watch("status")==="active",onCheckedChange:g=>n.setValue("status",g?"active":"inactive",{shouldDirty:!0})})})]}),t.jsxs(Et,{open:i.skillsOpen,onOpenChange:g=>a({type:"SET_SKILLS_OPEN",payload:g}),className:"border-t border-border shrink-0 max-h-[400px] overflow-hidden flex flex-col",children:[c.length===0?t.jsxs("button",{type:"button",onClick:p,className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"h-7 px-2 inline-flex items-center justify-center gap-1 rounded-md text-sm text-muted-foreground",children:[t.jsx(Fe,{size:14}),"Add"]})]}):t.jsx(At,{asChild:!0,children:t.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"ease-(--ease-out-expo)",style:{width:i.skillsOpen?0:"auto",marginRight:i.skillsOpen?0:4,opacity:i.skillsOpen?0:1,pointerEvents:i.skillsOpen?"none":"auto",transitionProperty:"all",transitionDuration:i.skillsOpen?"0ms":"200ms"},children:t.jsx(ds,{connectionIds:c.map(g=>g.connection_id),maxVisibleIcons:2})}),t.jsxs("div",{role:"button",tabIndex:0,className:"h-7 inline-flex items-center justify-center rounded-md text-sm text-muted-foreground overflow-hidden transition-all duration-200 ease-(--ease-out-expo) hover:bg-accent hover:text-accent-foreground",style:{width:i.skillsOpen?"auto":28,paddingLeft:i.skillsOpen?8:0,paddingRight:i.skillsOpen?8:0,gap:i.skillsOpen?4:0},onPointerDown:g=>{g.stopPropagation()},onClick:g=>{g.stopPropagation(),g.preventDefault(),p()},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),p())},children:[t.jsx(Fe,{size:14,className:"shrink-0"}),t.jsx("span",{className:"overflow-hidden whitespace-nowrap transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?"auto":0,opacity:i.skillsOpen?1:0},children:"Add"})]}),t.jsx("div",{className:"h-7 inline-flex items-center justify-center overflow-hidden transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?28:0,opacity:i.skillsOpen?1:0},children:t.jsx(Ht,{size:16,className:"shrink-0"})})]})]})}),t.jsx("div",{className:"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-(--ease-out-expo)",style:{gridTemplateRows:i.skillsOpen?"1fr":"0fr"},children:t.jsx("div",{className:"min-h-0 overflow-hidden",children:t.jsx("div",{className:"overflow-y-auto max-h-[300px] mask-[linear-gradient(to_bottom,black_calc(100%-40px),transparent_100%)]",children:t.jsx("div",{className:"flex flex-col gap-2 px-6 pb-4 pt-2",children:c.map(g=>t.jsx(_.Suspense,{fallback:t.jsx(Ae.Fallback,{}),children:t.jsx(Ae,{connection_id:g.connection_id,selected_tools:g.selected_tools,selected_resources:g.selected_resources,selected_prompts:g.selected_prompts,onClick:()=>N(g.connection_id)})},g.connection_id))})})})})]}),t.jsxs("div",{className:"flex flex-col flex-1 p-6 border-t border-border overflow-auto",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Instructions"}),t.jsx(Tt,{name:"metadata.instructions",control:n.control,render:({field:g})=>t.jsx(Mt,{...g,value:g.value??"",placeholder:"Write instructions here...",className:"min-h-[200px] resize-none text-sm placeholder:text-muted-foreground/50 leading-relaxed border-0 rounded-none shadow-none px-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:border-0 bg-transparent"})})]})]})}),t.jsx(Ls,{open:i.connectionDialogOpen,onOpenChange:g=>a({type:"SET_CONNECTION_DIALOG_OPEN",payload:g}),selectedId:i.editingConnectionId,form:n,connections:c}),t.jsx(Gs,{open:i.shareDialogOpen,onOpenChange:g=>a({type:"SET_SHARE_DIALOG_OPEN",payload:g}),virtualMcp:o})]})}function Ws(){const o=T.c(6),e=jt();let s;o[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/$project/agents/$agentId"},o[0]=s):s=o[0];const r=vt(s),{org:l,agentId:n}=r,c=Gt(n);if(!c){let a;return o[1]!==e||o[2]!==l?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ot,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(X,{variant:"outline",onClick:()=>e({to:"/$org/$project/agents",params:{org:l,project:He}}),children:"Back to agents"})})}),o[1]=e,o[2]=l,o[3]=a):a=o[3],a}let i;return o[4]!==c?(i=t.jsx(Hs,{virtualMcp:c}),o[4]=c,o[5]=i):i=o[5],i}function Kl(){const o=T.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(pe,{children:t.jsx(_.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ke,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ws,{})})}),o[0]=e):e=o[0],e}export{Kl as default};
@@ -1 +0,0 @@
1
- import{c as X,j as t,m as Ee,O as Se,aN as ct,u as at,bu as Ge,ai as vt,p as Nt,bt as ze,r as Y,o as lt,ba as yt,bi as _t,s as W,aj as Je,ak as Ct,a as St,f as wt,z as Tt,h as kt,k as Pt,i as It,t as Ce,K as Ye}from"./index-Bn2rDd42.js";import{E as ye}from"./empty-state--JD6ZxUc.js";import{E as dt}from"./error-boundary-DlgelpJG.js";import{E as $t,r as At,e as mt}from"./env-vars-editor-B4EebJEK.js";import{P as Xe,S as Vt}from"./index-a2nqbblp.js";import{b as Mt,a as Dt}from"./use-binding-Dgjl_Htk.js";import{u as Ot,S as Rt}from"./index-DJCm-wAr.js";import{f as Ke,g as ut}from"./use-connection-CVk8Bzpz.js";import{u as Et}from"./constants-DuSOM18S.js";import{d as Lt}from"./use-mcp-tools-Ddi2i1Nb.js";import{b as Ut,d as Ft}from"./use-mcp-prompts-Cn7tm6ug.js";import{a as Bt}from"./mcp-oauth-ZUujauBG.js";import{b as Ze,c as zt,d as Xt,e as Kt,B as Wt,a as qt}from"./breadcrumb-B_Yxwj4p.js";import{B as Fe}from"./button-CcO5M7F7.js";import{C as Ht}from"./collection-tabs-Dh2bhvAY.js";import{i as Re}from"./Loading01-D8zw0cyg.js";import{V as We,a as Qt}from"./layout-ZTsfxACA.js";import{C as Gt}from"./collection-tab-Cbay3Q2-.js";import{I as qe,n as Jt}from"./integration-icon-C8seGsuO.js";import{B as Be}from"./badge-BklHLRcK.js";import{D as Yt,a as Zt,b as es,c as et}from"./dropdown-menu-BTPpCOPE.js";import{F as G,a as ts,b as J,d as q,f as Z,c as te,e as ss}from"./form-CSsv2IBt.js";import{I as ee}from"./input-DBvMwxwE.js";import{S as tt,a as st,b as nt,c as ot,d as Q}from"./select-J2aavKNi.js";import{i as pt}from"./CheckCircle-DRhauZbp.js";import{t as ns}from"./ChevronDown-DmXLJeAy.js";import{s as Oe}from"./Globe02-Dp5eUbS2.js";import{s as os}from"./use-deco-chat-open-CfZI9mqc.js";import{i as rs}from"./Terminal-CyioLjuI.js";import{s as is}from"./Trash01-CLqhrRia.js";import{t as He}from"./Users03-oV4Gx6fu.js";import{s as cs}from"./XClose-BFt2trBc.js";import{U as as}from"./use-list-state-D_1V56-b.js";import{b as ls,a as ds}from"./use-virtual-mcp-C83o4Rih.js";import{i as ms}from"./ChevronRight-By4KEpZh.js";import{s as us}from"./Plus-BBD2SckJ.js";import{f as ps}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as ft,C as xt}from"./collection-table-wrapper-CFNweZN1.js";import{C as ht}from"./collection-search-Cyt8_oQV.js";import{C as gt}from"./card-BNt4WjQv.js";import{R as fs,T as xs}from"./tools-list-D0G5KWHg.js";import"./utils-Ckc2UwOp.js";import"./Pin01-DWsvacVo.js";import"./use-organization-settings-DHZKDAPt.js";import"./useMutation-CnTeRHmv.js";import"./binder-ak1AkjZY.js";import"./File06-WU23pV9H.js";import"./index-CHcJPAjT.js";import"./constants-QC26G_cT.js";import"./registry-utils-BsLp7zXK.js";import"./extract-connection-data-BM37afPK.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-5UUqPBO7.js";import"./index-Bo7hWTur.js";import"./circle-alert-BcHtOytY.js";import"./index-CZtqakWK.js";import"./X-CuhyLwhM.js";import"./popover-BkKSdvGf.js";import"./spinner-Bn-tqgsf.js";import"./dialog-B_iTVR3h.js";import"./AlertCircle-C_hR5usO.js";import"./ArrowUp-DnJUZ1OS.js";import"./Edit01-BT8zEtQL.js";import"./Check-Sa4xK5Hg.js";import"./Copy01-jvqvZrKj.js";import"./monaco-editor-D7Ghoc8y.js";import"./localstorage-keys-BhunmwZg.js";import"./useQuery-Ct96KcZp.js";import"./SearchMd-CGuwiAQe.js";import"./Code01-h_k8K-1e.js";import"./infiniteQueryObserver-VnhrjjoH.js";import"./use-create-virtual-mcp-BpXLuk-p.js";import"./index-BHu7Lc_d.js";import"./DotsVertical-gLXmVMYI.js";import"./empty-state-Ct1fZFlf.js";import"./Inbox01-XFeiQPbg.js";import"./alert-dialog-BxcV0D_1.js";import"./index-DZ7G-bvr.js";import"./label-BjQxQJkg.js";import"./use-llm-Ca3pgrIB.js";import"./Grid01-CSAsqBFD.js";import"./Image01-BnbXZOf7.js";import"./avatar-D3z5_V3I.js";import"./use-mobile-p03CcGW0.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./List-kXpaJIIp.js";import"./view-mode-toggle-CJkT6m07.js";import"./table-BNxQWMxG.js";function hs(s){const e=X.c(13),{virtualMcp:n,org:o}=s;let r;e[0]!==o||e[1]!==n.id?(r={org:o,project:Se,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=r):r=e[2];let c;e[3]!==n.icon||e[4]!==n.title?(c=n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"w-5 h-5 rounded-md object-cover shrink-0"}):t.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:t.jsx(He,{size:16,className:"text-primary"})}),e[3]=n.icon,e[4]=n.title,e[5]=c):c=e[5];let a;e[6]!==n.title?(a=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[6]=n.title,e[7]=a):a=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ms,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[8]=f):f=e[8];let u;return e[9]!==r||e[10]!==c||e[11]!==a?(u=t.jsxs(ct,{to:"/$org/$project/agents/$agentId",params:r,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,a,f]}),e[9]=r,e[10]=c,e[11]=a,e[12]=u):u=e[12],u}function rt(s){const e=X.c(20),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a,hasExistingVirtualMcps:f}=s,u=Ee(),p=ds();let x;e[0]!==p.create||e[1]!==r||e[2]!==c||e[3]!==n||e[4]!==o||e[5]!==u||e[6]!==a?(x=async()=>{const d=await p.create.mutateAsync({title:`${o} Agent`,description:r??null,icon:c??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});u({to:"/$org/$project/agents/$agentId",params:{org:a,project:Se,agentId:d.id}})},e[0]=p.create,e[1]=r,e[2]=c,e[3]=n,e[4]=o,e[5]=u,e[6]=a,e[7]=x):x=e[7];const m=x;if(f){let d;e[8]!==p.create.isPending?(d=p.create.isPending?t.jsx(Re,{size:16,className:"animate-spin"}):t.jsx(us,{size:16}),e[8]=p.create.isPending,e[9]=d):d=e[9];let l;return e[10]!==p.create.isPending||e[11]!==m||e[12]!==d?(l=t.jsx(Fe,{variant:"ghost",className:"size-6 p-0",onClick:m,disabled:p.create.isPending,children:d}),e[10]=p.create.isPending,e[11]=m,e[12]=d,e[13]=l):l=e[13],l}let i;e[14]!==p.create.isPending?(i=p.create.isPending?t.jsx(Re,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=p.create.isPending,e[15]=i):i=e[15];let b;return e[16]!==p.create.isPending||e[17]!==m||e[18]!==i?(b=t.jsxs(Fe,{variant:"outline",size:"sm",onClick:m,disabled:p.create.isPending,children:[i,"Create an agent"]}),e[16]=p.create.isPending,e[17]=m,e[18]=i,e[19]=b):b=e[19],b}function gs(s){const e=X.c(26),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a}=s;let f;e[0]!==n?(f={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=f):f=e[1];const u=ls(f);if(!(u.length>0)){let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=l):l=e[2];let j;return e[3]!==r||e[4]!==c||e[5]!==n||e[6]!==o||e[7]!==a?(j=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[l,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a,hasExistingVirtualMcps:!1})]}),e[3]=r,e[4]=c,e[5]=n,e[6]=o,e[7]=a,e[8]=j):j=e[8],j}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let m;e[10]!==r||e[11]!==c||e[12]!==n||e[13]!==o||e[14]!==a?(m=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:a,hasExistingVirtualMcps:!0})]})}),e[10]=r,e[11]=c,e[12]=n,e[13]=o,e[14]=a,e[15]=m):m=e[15];let i;if(e[16]!==a||e[17]!==u){let l;e[19]!==a?(l=j=>t.jsx(hs,{virtualMcp:j,org:a},j.id),e[19]=a,e[20]=l):l=e[20],i=u.map(l),e[16]=a,e[17]=u,e[18]=i}else i=e[18];let b;e[21]!==i?(b=t.jsx("div",{className:"flex flex-col gap-2",children:i}),e[21]=i,e[22]=b):b=e[22];let d;return e[23]!==m||e[24]!==b?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[m,b]}),e[23]=m,e[24]=b,e[25]=d):d=e[25],d}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:r}){const c=Ge({control:s.control,name:"ui_type"}),a=Ge({control:s.control,name:"connection_url"}),{stdioEnabled:f}=vt(),u=(()=>{if(typeof a!="string"||!a)return!1;try{const i=new URL(a);return i.hostname==="api.githubcopilot.com"&&i.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),p=f||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",m=x?Nt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(He,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),m&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:m})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),c!=="NPX"&&c!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsxs(st,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(Oe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(nt,{})]})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:"HTTP"}),t.jsx(Q,{value:"SSE",children:"SSE"}),t.jsx(Q,{value:"Websocket",children:"Websocket"}),p&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:"NPX Package"}),t.jsx(Q,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:b})=>t.jsx(J,{className:"flex-1 min-w-0",children:t.jsx(q,{children:t.jsx(ee,{placeholder:"https://example.com/mcp",...b,value:b.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsx(st,{className:"h-10",children:t.jsx(nt,{})})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"Websocket"]})}),p&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Jt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(Q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(rs,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Z,{})]})}),c==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"@perplexity-ai/mcp-server",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),c==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"node, bun, python...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"arg1 arg2 --flag value",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"/path/to/project (optional)",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})})]}),(c==="NPX"||c==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(q,{children:t.jsx($t,{value:i.value??[],onChange:i.onChange})}),t.jsx(Z,{})]})}),c!=="NPX"&&c!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:u?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Yt,{children:[t.jsx(Zt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Be,{variant:"success",className:"gap-1.5",children:[t.jsx(pt,{size:12}),"Authenticated via OAuth",t.jsx(ns,{size:12})]})})}),t.jsxs(es,{align:"start",children:[t.jsxs(et,{onClick:o,children:[t.jsx(os,{size:16}),"Re-authenticate"]}),t.jsxs(et,{variant:"destructive",onClick:r,children:[t.jsx(is,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&i.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>i.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(cs,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(ee,{type:"password",placeholder:u?"Paste your GitHub PAT":"Enter access token...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),u&&t.jsxs(ss,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Z,{})]})})]})}function bs(s){const e=X.c(43),{form:n,connection:o,isMCPAuthenticated:r,hasOAuthToken:c,onReauthenticate:a,onRemoveOAuth:f}=s,{org:u}=at();let p;e[0]!==o.icon||e[1]!==o.title?(p=t.jsx(qe,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=p):p=e[2];let x;e[3]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(G,{control:n.control,name:"title",render:Ns}),t.jsx(G,{control:n.control,name:"description",render:vs})]}),e[3]=n.control,e[4]=x):x=e[4];let m;e[5]!==p||e[6]!==x?(m=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[p,x]}),e[5]=p,e[6]=x,e[7]=m):m=e[7];let i;e[8]!==o||e[9]!==n||e[10]!==c||e[11]!==a||e[12]!==f?(i=t.jsx(js,{form:n,connection:o,hasOAuthToken:c,onReauthenticate:a,onRemoveOAuth:f}),e[8]=o,e[9]=n,e[10]=c,e[11]=a,e[12]=f,e[13]=i):i=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=b):b=e[14];let d;e[15]!==r?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[b,r?t.jsxs(Be,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(pt,{size:12}),"Connected"]}):t.jsx(Be,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=r,e[16]=d):d=e[16];let l;e[17]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=l):l=e[17];let j;e[18]!==o.created_by?(j=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[l,t.jsx(as,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=j):j=e[19];let T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=T):T=e[20];let v;e[21]!==o.updated_at?(v=o.updated_at?ps(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=v):v=e[22];let y;e[23]!==v?(y=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[T,t.jsx("span",{className:"text-sm text-foreground",children:v})]}),e[23]=v,e[24]=y):y=e[24];let _;e[25]!==y||e[26]!==d||e[27]!==j?(_=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,j,y]}),e[25]=y,e[26]=d,e[27]=j,e[28]=_):_=e[28];let N;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==u.slug?(N=t.jsx(gs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:u.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=u.slug,e[34]=N):N=e[34];let h;e[35]!==_||e[36]!==N||e[37]!==m||e[38]!==i?(h=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[m,i,_,N]}),e[35]=_,e[36]=N,e[37]=m,e[38]=i,e[39]=h):h=e[39];let k;return e[40]!==n||e[41]!==h?(k=t.jsx(ts,{...n,children:h}),e[40]=n,e[41]=h,e[42]=k):k=e[42],k}function vs(s){const{field:e}=s;return t.jsxs(J,{className:"w-full space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Z,{})]})}function Ns(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1 space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(Z,{})]})}function ys(s){const e=X.c(42),{prompts:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:a,onPromptClick:f,showToolbar:u,emptyMessage:p}=s,x=u===void 0?!0:u,m=p===void 0?"This connection doesn't have any prompts yet.":p,i=Ee(),d=ze().location.href,[l,j]=Y.useState(""),[T,v]=Y.useState("table"),[y,_]=Y.useState("name"),[N,h]=Y.useState("asc");let k;e[0]!==N||e[1]!==y?(k=S=>{y===S?(h(Ts),N==="desc"&&_(void 0)):(_(S),h("asc"))},e[0]=N,e[1]=y,e[2]=k):k=e[2];const B=k;let $;e[3]!==o||e[4]!==i||e[5]!==f||e[6]!==r?($=S=>{f?f(S):o&&r&&i({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:Se,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(S.name)}})},e[3]=o,e[4]=i,e[5]=f,e[6]=r,e[7]=$):$=e[7];const M=$;let A;if(e[8]!==n||e[9]!==l||e[10]!==N||e[11]!==y){const S=!n||n.length===0?[]:l.trim()?(()=>{const H=l.toLowerCase();return n.filter(K=>K.name.toLowerCase().includes(H)||K.description&&K.description.toLowerCase().includes(H))})():n;A=!y||!N?S:[...S].sort((H,K)=>{const se=H[y]||"",ne=K[y]||"",oe=String(se).localeCompare(String(ne));return N==="asc"?oe:-oe}),e[8]=n,e[9]=l,e[10]=N,e[11]=y,e[12]=A}else A=e[12];const I=A;let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E=[{id:"name",header:"Name",render:ws,sortable:!0},{id:"description",header:"Description",render:Ss,cellClassName:"flex-1",sortable:!0}],e[13]=E):E=e[13];const L=E;let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=L.filter(Cs).map(_s),e[14]=C):C=e[14];const z=C;let P;e[15]!==a||e[16]!==c||e[17]!==B||e[18]!==x||e[19]!==N||e[20]!==y||e[21]!==d||e[22]!==T?(P=x&&t.jsxs(We,{children:[t.jsx(xt,{viewMode:T,onViewModeChange:v,sortKey:y,sortDirection:N,onSort:B,sortOptions:z}),t.jsx(Xe,{title:c?`${c}: Prompts`:"Prompts",url:d,icon:a??"description"})]}),e[15]=a,e[16]=c,e[17]=B,e[18]=x,e[19]=N,e[20]=y,e[21]=d,e[22]=T,e[23]=P):P=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=S=>{S.key==="Escape"&&(j(""),S.target.blur())},e[24]=D):D=e[24];let V;e[25]!==l?(V=t.jsx(ht,{value:l,onChange:j,placeholder:"Search prompts...",onKeyDown:D}),e[25]=l,e[26]=V):V=e[26];let g;e[27]!==m||e[28]!==M||e[29]!==B||e[30]!==l||e[31]!==N||e[32]!==y||e[33]!==I||e[34]!==T?(g=T==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?t.jsx(ye,{image:null,title:l?"No prompts found":"No prompts available",description:l?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:I.map(S=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>M(S),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(qe,{icon:null,name:S.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:S.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:S.description||"No description"})]})]})},S.name))})}):t.jsx(ft,{columns:L,data:I,isLoading:!1,sortKey:y,sortDirection:N,onSort:B,onRowClick:S=>M(S),emptyState:t.jsx(ye,{image:null,title:l?"No prompts found":"No prompts available",description:l?"Try adjusting your search terms":m})}),e[27]=m,e[28]=M,e[29]=B,e[30]=l,e[31]=N,e[32]=y,e[33]=I,e[34]=T,e[35]=g):g=e[35];let F;e[36]!==V||e[37]!==g?(F=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[V,g]}),e[36]=V,e[37]=g,e[38]=F):F=e[38];let O;return e[39]!==F||e[40]!==P?(O=t.jsxs(t.Fragment,{children:[P,F]}),e[39]=F,e[40]=P,e[41]=O):O=e[41],O}function _s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Cs(s){return s.sortable}function Ss(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function ws(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function Ts(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function ks(s){const e=X.c(6),{prompts:n,connectionId:o,org:r}=s,c=Ke(o),a=c?.title,f=c?.icon;let u;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==a||e[4]!==f?(u=t.jsx(ys,{prompts:n,connectionId:o,org:r,connectionTitle:a,connectionIcon:f}),e[0]=o,e[1]=r,e[2]=n,e[3]=a,e[4]=f,e[5]=u):u=e[5],u}function Ps(s){const e=X.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(fs,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Is(s){const e=X.c(39),{resources:n,connectionTitle:o,connectionIcon:r,onResourceClick:c,showToolbar:a,emptyMessage:f}=s,u=a===void 0?!0:a,p=f===void 0?"This connection doesn't have any resources yet.":f,m=ze().location.href,[i,b]=Y.useState(""),[d,l]=Y.useState("table"),[j,T]=Y.useState("name"),[v,y]=Y.useState("asc");let _;e[0]!==v||e[1]!==j?(_=g=>{j===g?(y(Rs),v==="desc"&&T(void 0)):(T(g),y("asc"))},e[0]=v,e[1]=j,e[2]=_):_=e[2];const N=_;let h;e[3]!==c?(h=g=>{c&&c(g)},e[3]=c,e[4]=h):h=e[4];const k=h;let B;if(e[5]!==n||e[6]!==i||e[7]!==v||e[8]!==j){const g=!n||n.length===0?[]:i.trim()?(()=>{const F=i.toLowerCase();return n.filter(O=>O.uri.toLowerCase().includes(F)||O.name&&O.name.toLowerCase().includes(F)||O.description&&O.description.toLowerCase().includes(F))})():n;B=!j||!v?g:[...g].sort((F,O)=>{const S=F[j]||"",H=O[j]||"",K=String(S).localeCompare(String(H));return v==="asc"?K:-K}),e[5]=n,e[6]=i,e[7]=v,e[8]=j,e[9]=B}else B=e[9];const $=B;let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=[{id:"name",header:"Name",render:Os,sortable:!0},{id:"uri",header:"URI",render:Ds,sortable:!0},{id:"description",header:"Description",render:Ms,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Vs,sortable:!0}],e[10]=M):M=e[10];const A=M;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=A.filter(As).map($s),e[11]=I):I=e[11];const E=I;let L;e[12]!==r||e[13]!==o||e[14]!==N||e[15]!==u||e[16]!==v||e[17]!==j||e[18]!==m||e[19]!==d?(L=u&&t.jsxs(We,{children:[t.jsx(xt,{viewMode:d,onViewModeChange:l,sortKey:j,sortDirection:v,onSort:N,sortOptions:E}),t.jsx(Xe,{title:o?`${o}: Resources`:"Resources",url:m,icon:r??"folder"})]}),e[12]=r,e[13]=o,e[14]=N,e[15]=u,e[16]=v,e[17]=j,e[18]=m,e[19]=d,e[20]=L):L=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=g=>{g.key==="Escape"&&(b(""),g.target.blur())},e[21]=C):C=e[21];let z;e[22]!==i?(z=t.jsx(ht,{value:i,onChange:b,placeholder:"Search resources...",onKeyDown:C}),e[22]=i,e[23]=z):z=e[23];let P;e[24]!==p||e[25]!==k||e[26]!==N||e[27]!==i||e[28]!==v||e[29]!==j||e[30]!==$||e[31]!==d?(P=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:$.length===0?t.jsx(ye,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":p}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:$.map(g=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>k(g),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(qe,{icon:null,name:g.name||g.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name||g.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:g.uri}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:g.description})]})]})},g.uri))})}):t.jsx(ft,{columns:A,data:$,isLoading:!1,sortKey:j,sortDirection:v,onSort:N,onRowClick:g=>k(g),emptyState:t.jsx(ye,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":p})}),e[24]=p,e[25]=k,e[26]=N,e[27]=i,e[28]=v,e[29]=j,e[30]=$,e[31]=d,e[32]=P):P=e[32];let D;e[33]!==z||e[34]!==P?(D=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[z,P]}),e[33]=z,e[34]=P,e[35]=D):D=e[35];let V;return e[36]!==D||e[37]!==L?(V=t.jsxs(t.Fragment,{children:[L,D]}),e[36]=D,e[37]=L,e[38]=V):V=e[38],V}function $s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function As(s){return s.sortable}function Vs(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ds(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Os(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Rs(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Es(s){const e=X.c(6),{resources:n,connectionId:o,org:r}=s,c=Ke(o),a=c?.title,f=c?.icon;let u;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==a||e[4]!==f?(u=t.jsx(Is,{resources:n,connectionId:o,org:r,connectionTitle:a,connectionIcon:f}),e[0]=o,e[1]=r,e[2]=n,e[3]=a,e[4]=f,e[5]=u):u=e[5],u}const Ls=lt({key:W().min(1,"Key is required"),value:W()}),Us=lt({title:W().min(1,"Name is required"),description:W().nullable().optional(),ui_type:Ct(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:W().optional(),connection_token:W().nullable().optional(),npx_package:W().optional(),stdio_command:W().optional(),stdio_args:W().optional(),stdio_cwd:W().optional(),env_vars:Je(Ls).optional(),configuration_scopes:Je(W()).nullable().optional(),configuration_state:yt(W(),_t()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Fs(s){const e=X.c(5),{tools:n,connectionId:o,org:r,isLoading:c}=s;let a;return e[0]!==o||e[1]!==c||e[2]!==r||e[3]!==n?(a=t.jsx(xs,{tools:n,connectionId:o,org:r,isLoading:c}),e[0]=o,e[1]=c,e[2]=r,e[3]=n,e[4]=a):a=e[4],a}function Bs(s){return s.command==="npx"}function zs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ks(s,e){const n={command:"npx",args:["-y",s]},o=mt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const r={command:s};e.trim()&&(r.args=e.trim().split(/\s+/)),n?.trim()&&(r.cwd=n.trim());const c=mt(o);return Object.keys(c).length>0&&(r.envVars=c),r}function it(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&It(s.connection_headers)){const o=s.connection_headers,r=At(o.envVars);if(Bs(o)){const a=zs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const c=Xs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Ks(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ws(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,connection_type:e,connection_url:n,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Hs(s){const e=X.c(117),{connection:n,connectionId:o,org:r,requestedTabId:c,collections:a,onUpdate:f,isUpdating:u,prompts:p,resources:x,tools:m,isLoadingTools:i}=s;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/$org/$project/mcps/$connectionId"},e[0]=b):b=e[0];const d=Ee(b),l=Tt(),T=ze().location.href,v=ut();let y;e[1]!==o?(y={connectionId:o},e[1]=o,e[2]=y):y=e[2];const _=Ot(y),h=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let k;e[3]!==n?(k={connections:[n],binding:"MCP"},e[3]=n,e[4]=k):k=e[4];const $=Dt(k).length>0,M=n?.metadata?.repository,A=!!M?.url;let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=kt(Us),e[5]=I):I=e[5];let E;e[6]!==n?(E=it(n),e[6]=n,e[7]=E):E=e[7];let L;e[8]!==E?(L={resolver:I,values:E},e[8]=E,e[9]=L):L=e[9];const C=Pt(L),z=C.formState.isDirty;let P;e[10]!==C||e[11]!==f?(P=async()=>{if(!await C.trigger())return;const U=C.getValues(),Ne=qs(U);await f(Ne),C.reset(U)},e[10]=C,e[11]=f,e[12]=P):P=e[12];const D=P;let V;e[13]!==n||e[14]!==C?(V=()=>{C.reset(it(n))},e[13]=n,e[14]=C,e[15]=V):V=e[15];const g=V;let F;e[16]!==n.id||e[17]!==v||e[18]!==l?(F=async()=>{const{token:w,tokenInfo:U,error:Ne}=await Bt({connectionId:n.id});if(Ne||!w){Ce.error(`Authentication failed: ${Ne}`);return}if(U)try{const De=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:U.accessToken,refreshToken:U.refreshToken,expiresIn:U.expiresIn,scope:U.scope,clientId:U.clientId,clientSecret:U.clientSecret,tokenEndpoint:U.tokenEndpoint})});if(!De.ok)console.error("Failed to save OAuth token:",await De.text()),await v.update.mutateAsync({id:n.id,data:{connection_token:w}});else try{await v.update.mutateAsync({id:n.id,data:{}})}catch(Qe){console.warn("Failed to refresh connection tools after OAuth:",Qe)}}catch(De){console.error("Error saving OAuth token:",De),await v.update.mutateAsync({id:n.id,data:{connection_token:w}})}else await v.update.mutateAsync({id:n.id,data:{connection_token:w}});const bt=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Ye.isMCPAuthenticated(bt.href,null)}),Ce.success("Authentication successful")},e[16]=n.id,e[17]=v,e[18]=l,e[19]=F):F=e[19];const O=F;let S;e[20]!==n.id||e[21]!==l?(S=async()=>{try{const w=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!w.ok){const Ne=await w.text();Ce.error(`Failed to remove OAuth: ${Ne}`);return}const U=new URL(`/mcp/${n.id}`,window.location.origin);await l.invalidateQueries({queryKey:Ye.isMCPAuthenticated(U.href,null)}),Ce.success("OAuth removed. You can now re-authenticate with a different account.")}catch(w){console.error("Error removing OAuth token:",w),Ce.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=l,e[22]=S):S=e[22];const H=S,K=m.length,se=p.length,ne=x.length,oe=K>0||i;let we;e[23]===Symbol.for("react.memo_cache_sentinel")?(we={id:"settings",label:"Settings"},e[23]=we):we=e[23];let re;e[24]!==i||e[25]!==h||e[26]!==oe||e[27]!==K?(re=h&&oe?[{id:"tools",label:"Tools",count:i?void 0:K}]:[],e[24]=i,e[25]=h,e[26]=oe,e[27]=K,e[28]=re):re=e[28];let ie;e[29]!==h||e[30]!==se?(ie=h&&se>0?[{id:"prompts",label:"Prompts",count:se}]:[],e[29]=h,e[30]=se,e[31]=ie):ie=e[31];let ce;e[32]!==h||e[33]!==ne?(ce=h&&ne>0?[{id:"resources",label:"Resources",count:ne}]:[],e[32]=h,e[33]=ne,e[34]=ce):ce=e[34];let Te;if(e[35]!==a||e[36]!==A||e[37]!==h||e[38]!==re||e[39]!==ie||e[40]!==ce){let w;e[42]!==A?(w=A?[{id:"readme",label:"README"}]:[],e[42]=A,e[43]=w):w=e[43],Te=[we,...re,...ie,...ce,...h?(a||[]).map(Gs):[],...w],e[35]=a,e[36]=A,e[37]=h,e[38]=re,e[39]=ie,e[40]=ce,e[41]=Te}else Te=e[41];const _e=Te,jt=h&&_e.some(Qs)?"tools":"settings",R=_e.some(w=>w.id===c)?c:jt;let ke;e[44]!==d?(ke=w=>{d({search:U=>({...U,tab:w}),replace:!0})},e[44]=d,e[45]=ke):ke=e[45];const ae=ke;let le;e[46]!==a?(le=a||[],e[46]=a,e[47]=le):le=e[47];let Pe;if(e[48]!==R||e[49]!==le){let w;e[51]!==R?(w=U=>U.name===R,e[51]=R,e[52]=w):w=e[52],Pe=le.find(w),e[48]=R,e[49]=le,e[50]=Pe}else Pe=e[50];const Ie=Pe;let de;e[53]!==r?(de=t.jsx(Ze,{children:t.jsx(Xt,{asChild:!0,children:t.jsx(ct,{to:"/$org/$project/mcps",params:{org:r,project:Se},children:"Connections"})})}),e[53]=r,e[54]=de):de=e[54];let $e;e[55]===Symbol.for("react.memo_cache_sentinel")?($e=t.jsx(Kt,{}),e[55]=$e):$e=e[55];let me;e[56]!==n.title?(me=t.jsx(Ze,{children:t.jsx(zt,{children:n.title})}),e[56]=n.title,e[57]=me):me=e[57];let Ae;e[58]!==de||e[59]!==me?(Ae=t.jsx(Wt,{children:t.jsxs(qt,{children:[de,$e,me]})}),e[58]=de,e[59]=me,e[60]=Ae):Ae=e[60];const Le=Ae;let ue;e[61]!==D||e[62]!==g||e[63]!==z||e[64]!==u?(ue=t.jsx(Vt,{onSave:D,onUndo:g,isDirty:z,isSaving:u}),e[61]=D,e[62]=g,e[63]=z,e[64]=u,e[65]=ue):ue=e[65];const Ue=n.icon??"settings";let pe;e[66]!==n.title||e[67]!==Ue||e[68]!==T?(pe=t.jsx(Xe,{title:n.title,url:T,icon:Ue}),e[66]=n.title,e[67]=Ue,e[68]=T,e[69]=pe):pe=e[69];let fe;e[70]!==ue||e[71]!==pe?(fe=t.jsxs(We,{children:[ue,pe]}),e[70]=ue,e[71]=pe,e[72]=fe):fe=e[72];let xe;e[73]!==_.hasOAuthToken||e[74]!==n||e[75]!==C||e[76]!==O||e[77]!==H||e[78]!==h?(xe=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(bs,{form:C,connection:n,isMCPAuthenticated:h,hasOAuthToken:_.hasOAuthToken,onReauthenticate:O,onRemoveOAuth:H})}),e[73]=_.hasOAuthToken,e[74]=n,e[75]=C,e[76]=O,e[77]=H,e[78]=h,e[79]=xe):xe=e[79];let he;e[80]!==R||e[81]!==ae||e[82]!==_e?(he=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Ht,{tabs:_e,activeTab:R,onTabChange:ae,className:"flex-1"})}),e[80]=R,e[81]=ae,e[82]=_e,e[83]=he):he=e[83];let Ve;e[84]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),e[84]=Ve):Ve=e[84];let ge;e[85]!==Ie||e[86]!==R||e[87]!==_.isServerError||e[88]!==_.supportsOAuth||e[89]!==n||e[90]!==o||e[91]!==C||e[92]!==O||e[93]!==ae||e[94]!==$||e[95]!==A||e[96]!==i||e[97]!==h||e[98]!==r||e[99]!==p||e[100]!==M||e[101]!==x||e[102]!==m?(ge=t.jsx(Y.Suspense,{fallback:Ve,children:R==="tools"?t.jsx(Fs,{tools:m,connectionId:o,org:r,isLoading:i}):R==="prompts"?t.jsx(ks,{prompts:p,connectionId:o,org:r}):R==="resources"?t.jsx(Es,{resources:x,connectionId:o,org:r}):R==="settings"?t.jsx(Rt,{connection:n,form:C,hasMcpBinding:$,isMCPAuthenticated:h,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:O,onViewReadme:A?()=>ae("readme"):void 0}):R==="readme"&&A?t.jsx(Ps,{repository:M}):Ie&&h?t.jsx(Gt,{connectionId:o,org:r,activeCollection:Ie},R):t.jsx(ye,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[85]=Ie,e[86]=R,e[87]=_.isServerError,e[88]=_.supportsOAuth,e[89]=n,e[90]=o,e[91]=C,e[92]=O,e[93]=ae,e[94]=$,e[95]=A,e[96]=i,e[97]=h,e[98]=r,e[99]=p,e[100]=M,e[101]=x,e[102]=m,e[103]=ge):ge=e[103];let je;e[104]!==R||e[105]!==ge?(je=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(dt,{children:ge},R)}),e[104]=R,e[105]=ge,e[106]=je):je=e[106];let be;e[107]!==he||e[108]!==je?(be=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[he,je]}),e[107]=he,e[108]=je,e[109]=be):be=e[109];let ve;e[110]!==xe||e[111]!==be?(ve=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[xe,be]}),e[110]=xe,e[111]=be,e[112]=ve):ve=e[112];let Me;return e[113]!==Le||e[114]!==fe||e[115]!==ve?(Me=t.jsxs(Qt,{breadcrumb:Le,children:[fe,ve]}),e[113]=Le,e[114]=fe,e[115]=ve,e[116]=Me):Me=e[116],Me}function Qs(s){return s.id==="tools"}function Gs(s){return{id:s.name,label:s.displayName}}function Js(){const s=X.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Ee(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:r,org:c}=St(o),{org:a}=at();let f;s[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=f):f=s[2];const p=wt(f).tab??"",x=Ke(r),m=ut(),i=Mt(x??void 0);let b;s[3]!==r||s[4]!==a.id?(b={connectionId:r,orgId:a.id},s[3]=r,s[4]=a.id,s[5]=b):b=s[5];const d=Et(b);let l;s[6]!==d?(l={client:d},s[6]=d,s[7]=l):l=s[7];const{data:j}=Ut(l);let T;s[8]!==d?(T={client:d},s[8]=d,s[9]=T):T=s[9];const{data:v}=Ft(T),_=!(x?.connection_type==="VIRTUAL")&&x?.tools&&x.tools.length>0,N=!_;let h;s[10]!==d||s[11]!==N?(h={client:d,enabled:N},s[10]=d,s[11]=N,s[12]=h):h=s[12];const{data:k,isLoading:B}=Lt(h);let $;s[13]!==j?.prompts?($=j?.prompts??[],s[13]=j?.prompts,s[14]=$):$=s[14];let M;s[15]!==$?(M=$.map(en),s[15]=$,s[16]=M):M=s[16];const A=M;let I;s[17]!==v?.resources?(I=v?.resources??[],s[17]=v?.resources,s[18]=I):I=s[18];let E;s[19]!==I?(E=I.map(Zs),s[19]=I,s[20]=E):E=s[20];const L=E;let C;s[21]!==x||s[22]!==_||s[23]!==k?.tools?(C=_?x.tools??[]:(k?.tools??[]).map(Ys),s[21]=x,s[22]=_,s[23]=k?.tools,s[24]=C):C=s[24];const z=C;let P;s[25]!==m.update||s[26]!==r?(P=async g=>{await m.update.mutateAsync({id:r,data:g})},s[25]=m.update,s[26]=r,s[27]=P):P=s[27];const D=P;if(!x){let g;return s[28]!==n||s[29]!==c?(g=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ye,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Fe,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:c,project:Se}}),children:"Back to connections"})})}),s[28]=n,s[29]=c,s[30]=g):g=s[30],g}let V;return s[31]!==m.update.isPending||s[32]!==i||s[33]!==x||s[34]!==r||s[35]!==D||s[36]!==B||s[37]!==c||s[38]!==A||s[39]!==p||s[40]!==L||s[41]!==z?(V=t.jsx(Hs,{org:c,connection:x,connectionId:r,requestedTabId:p,collections:i,onUpdate:D,isUpdating:m.update.isPending,prompts:A,resources:L,tools:z,isLoadingTools:B}),s[31]=m.update.isPending,s[32]=i,s[33]=x,s[34]=r,s[35]=D,s[36]=B,s[37]=c,s[38]=A,s[39]=p,s[40]=L,s[41]=z,s[42]=V):V=s[42],V}function Ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema}}function Zs(s){return{uri:s.uri,name:s.name,description:s.description}}function en(s){return{name:s.name,description:s.description}}function tn(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(dt,{children:t.jsx(Y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Js,{})})}),s[0]=e):e=s[0],e}function Uo(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tn,{}),s[0]=e):e=s[0],e}export{Uo as default};
@@ -1 +0,0 @@
1
- import{M as t,Q as a}from"./index-Bn2rDd42.js";const e=t(a,{target:"draft-7"});export{e as B};
@@ -1 +0,0 @@
1
- import{c as A,u as W,a as D,g as X,K as Z,j as n,aM as $,r as q,l as J,aN as ee,aO as te}from"./index-Bn2rDd42.js";import{i as v}from"./Loading01-D8zw0cyg.js";import{c as ne}from"./binder-ak1AkjZY.js";import{u as se}from"./useQuery-Ct96KcZp.js";import{h as ie}from"./use-connection-CVk8Bzpz.js";import{a as oe,u as le,j as re}from"./constants-DuSOM18S.js";import{t as ae}from"./Settings01-D7-sGWon.js";import{B as ce}from"./button-CcO5M7F7.js";import{P as E}from"./index-BHu7Lc_d.js";import"./useMutation-CnTeRHmv.js";import"./utils-Ckc2UwOp.js";function de(t,e){return t?t.filter(m=>ne(m,e)):[]}function R(t){return{id:t.id,title:t.title,icon:t.icon,description:t.description,app_name:t.app_name,app_id:t.app_id,tools:t.tools,metadata:t.metadata}}function me(t){const e=A.c(35),{binding:m,renderHeader:f,renderEmptyState:s}=t,{org:o,project:l}=W();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const{org:r,project:g,pluginId:u}=D(c),Q=ie(),{data:y}=X.useSession();let _;e[1]!==o.id?(_={connectionId:oe,orgId:o.id},e[1]=o.id,e[2]=_):_=e[2];const H=le(_);let x;e[3]!==u||e[4]!==l.id?(x=Z.projectPluginConfig(l.id??"",u),e[3]=u,e[4]=l.id,e[5]=x):x=e[5];let p;e[6]!==u||e[7]!==l.id||e[8]!==H?(p=async()=>{const i=await H.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:u}});return i.structuredContent??i},e[6]=u,e[7]=l.id,e[8]=H,e[9]=p):p=e[9];const T=!!l.id&&!!u;let b;e[10]!==x||e[11]!==p||e[12]!==T?(b={queryKey:x,queryFn:p,enabled:T},e[10]=x,e[11]=p,e[12]=T,e[13]=b):b=e[13];const{data:U,isLoading:Y}=se(b),F=de(Q,m),K=U?.config?.connectionId,j=K?F.find(i=>i.id===K):null,S=re({connectionId:j?.id,orgId:o.id}),w=y?.user?{user:{id:y.user.id,name:y.user.name,email:y.user.email,image:y.user.image}}:null,z={id:o.id,slug:o.slug,name:o.name};if(Y){let i;return e[14]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[14]=i):i=e[14],i}if(F.length===0){const i={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let a;e[15]!==s?(a=s(),e[15]=s,e[16]=a):a=e[16];let d;return e[17]!==a?(d=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:a}),e[17]=a,e[18]=d):d=e[18],n.jsx($,{value:i,children:d})}if(!j){const i={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let a;e[19]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[n.jsx(ae,{size:48,className:"text-muted-foreground mb-2"}),n.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[19]=a):a=e[19];const d=r??o.slug,k=g??l.slug??"";let L;return e[20]!==d||e[21]!==k?(L=n.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[a,n.jsx(ce,{asChild:!0,children:n.jsx(ee,{to:"/$org/$project/settings",params:{org:d,project:k},children:"Go to Project Settings"})})]}),e[20]=d,e[21]=k,e[22]=L):L=e[22],n.jsx($,{value:i,children:L})}let N;e[23]!==S?(N=(i,a)=>S?S.callTool({name:i,arguments:a}).then(fe):Promise.reject(new Error("MCP client is not available")),e[23]=S,e[24]=N):N=e[24];const V={connectionId:j.id,connection:R(j),toolCaller:N,org:z,session:w},B=E,G=E,M=E,O=f({connections:[R(j)],selectedConnectionId:j.id,onConnectionChange:ue});let h;e[25]!==O||e[26]!==M.Header.Left?(h=n.jsx(M.Header.Left,{children:O}),e[25]=O,e[26]=M.Header.Left,e[27]=h):h=e[27];let C;e[28]!==h||e[29]!==G.Header?(C=n.jsx(G.Header,{children:h}),e[28]=h,e[29]=G.Header,e[30]=C):C=e[30];let P;e[31]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(E.Content,{children:n.jsx(q.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(J,{})})}),e[31]=P):P=e[31];let I;return e[32]!==B||e[33]!==C?(I=n.jsxs(B,{children:[C,P]}),e[32]=B,e[33]=C,e[34]=I):I=e[34],n.jsx($,{value:V,children:I})}function ue(){}function fe(t){return t.structuredContent??t}function Pe(){const t=A.c(12);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{pluginId:m}=D(e);let f;t[1]!==m?(f=te.find(r=>r.id===m),t[1]=m,t[2]=f):f=t[2];const s=f;if(s?.renderHeader&&s?.renderEmptyState){let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[3]=r):r=t[3];let g;return t[4]!==s.binding||t[5]!==s.renderEmptyState||t[6]!==s.renderHeader?(g=n.jsx(q.Suspense,{fallback:r,children:n.jsx(me,{binding:s.binding,renderHeader:s.renderHeader,renderEmptyState:s.renderEmptyState})}),t[4]=s.binding,t[5]=s.renderEmptyState,t[6]=s.renderHeader,t[7]=g):g=t[7],g}const o=s?.LayoutComponent;if(!o){let r;return t[8]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(J,{}),t[8]=r):r=t[8],r}let l;t[9]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[9]=l):l=t[9];let c;return t[10]!==o?(c=n.jsx(q.Suspense,{fallback:l,children:n.jsx(o,{})}),t[10]=o,t[11]=c):c=t[11],c}export{Pe as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-DBKftgaD.js","assets/index-Bn2rDd42.js","assets/index--g69ISoA.css","assets/button-CcO5M7F7.js","assets/utils-Ckc2UwOp.js","assets/AlertCircle-C_hR5usO.js","assets/Download01-BKmVPJWY.js","assets/File02-BNE7fmK0.js","assets/File06-WU23pV9H.js","assets/Image01-BnbXZOf7.js","assets/Loading01-D8zw0cyg.js","assets/Trash01-CLqhrRia.js","assets/Upload01-DrtXkSgF.js","assets/useMutation-CnTeRHmv.js","assets/useQuery-Ct96KcZp.js","assets/useInfiniteQuery-DDUEUpOZ.js","assets/infiniteQueryObserver-VnhrjjoH.js","assets/checkbox-CirsSPdM.js","assets/Check-Sa4xK5Hg.js","assets/ChevronRight-By4KEpZh.js","assets/Grid01-CSAsqBFD.js","assets/Home02-BUr926Eo.js","assets/List-kXpaJIIp.js"])))=>i.map(i=>d[i]);
2
- import{r as M,c as K,bm as Q,bn as A,z as Y,j as t,t as D,bo as X,a4 as ee}from"./index-Bn2rDd42.js";import{u as te}from"./useInfiniteQuery-DDUEUpOZ.js";import{B as _}from"./button-CcO5M7F7.js";import{C as U}from"./checkbox-CirsSPdM.js";import{c as J}from"./utils-Ckc2UwOp.js";import{i as se}from"./AlertCircle-C_hR5usO.js";import{i as ae}from"./ChevronRight-By4KEpZh.js";import{n as ie}from"./Download01-BKmVPJWY.js";import{i as re}from"./File02-BNE7fmK0.js";import{c as G}from"./Grid01-CSAsqBFD.js";import{a as oe}from"./Home02-BUr926Eo.js";import{i as V}from"./List-kXpaJIIp.js";import{i as L}from"./Loading01-D8zw0cyg.js";import{s as W}from"./Trash01-CLqhrRia.js";import{i as $}from"./Upload01-DrtXkSgF.js";import{u as q}from"./useMutation-CnTeRHmv.js";const Z=({size:s=24,color:e="currentColor",...i})=>M.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},M.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));Z.displayName="FolderPlus";const R={objects:(s,e,i=!1,o=100)=>["object-storage","objects",s,e,{flat:i,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},ne=100;function le(s){const e=K.c(30);let i;e[0]!==s?(i=s===void 0?{}:s,e[0]=s,e[1]=i):i=e[1];const o=i,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?ne:d,{connectionId:b,toolCaller:S}=Q();let f;e[2]!==b||e[3]!==l||e[4]!==c||e[5]!==m?(f=R.objects(b,m,l,c),e[2]=b,e[3]=l,e[4]=c,e[5]=m,e[6]=f):f=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==m||e[10]!==S?(u=async a=>{const{pageParam:r}=a;return await S("LIST_OBJECTS",{prefix:m||void 0,maxKeys:c,continuationToken:r,delimiter:l?void 0:"/"})},e[7]=l,e[8]=c,e[9]=m,e[10]=S,e[11]=u):u=e[11];let E;e[12]!==f||e[13]!==u?(E={queryKey:f,queryFn:u,initialPageParam:void 0,getNextPageParam:ge,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:z,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:w}=te(E);let v;if(l){let a;e[15]!==p?.pages?(a=p?.pages.flatMap(he).filter(pe).map(xe)??[],e[15]=p?.pages,e[16]=a):a=e[16],v=a}else{let a;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(ue)??[],j=p?.pages.flatMap(de)??[];a=[...r.sort(ce),...j],e[17]=p?.pages,e[18]=a}else a=e[18];v=a}let N;e[19]!==h||e[20]!==y||e[21]!==g?(N=()=>{y&&!g&&h()},e[19]=h,e[20]=y,e[21]=g,e[22]=N):N=e[22];const C=N,F=y??!1,P=w;let k;return e[23]!==g||e[24]!==z||e[25]!==C||e[26]!==v||e[27]!==P||e[28]!==F?(k={objects:v,isLoading:z,isFetchingMore:g,hasMore:F,loadMore:C,error:P},e[23]=g,e[24]=z,e[25]=C,e[26]=v,e[27]=P,e[28]=F,e[29]=k):k=e[29],k}function ce(s,e){return s.key.localeCompare(e.key)}function de(s){return s.objects.filter(fe).map(me)}function me(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function fe(s){return!s.key.endsWith("/")}function ue(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function xe(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function pe(s){return!s.key.endsWith("/")}function he(s){return s.objects}function ge(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function je(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],i=1024,o=Math.floor(Math.log(s)/Math.log(i));return`${parseFloat((s/Math.pow(i,o)).toFixed(1))} ${e[o]}`}function ye(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ve(s){const e=[],i=s.split("/").filter(Boolean);let o="";for(const n of i)o+=n+"/",e.push({name:n,path:o});return e}function Ie(s,e){switch(s.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":case"png":case"gif":case"webp":case"svg":return"Image01";case"mp4":case"mov":case"avi":case"webm":return"VideoRecorder";case"mp3":case"wav":case"ogg":return"Music01";case"pdf":return"File06";case"zip":case"tar":case"gz":case"rar":return"File07";case"js":case"ts":case"tsx":case"jsx":case"json":case"html":case"css":return"FileCode01";case"md":case"txt":return"File04";default:return"File02"}}const Ne=M.lazy(()=>X(()=>import("./grid-view-DBKftgaD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22])));function be(s){const e=K.c(50),{item:i,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==i.key||e[1]!==c?(b=c?i.key:I(i.key),e[0]=i.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(U,{checked:o,onCheckedChange:x,className:"opacity-0 group-hover:opacity-100 focus:opacity-100 data-[state=checked]:opacity-100"}),e[3]=x,e[4]=o,e[5]=f):f=e[5];let u;e[6]!==i.isFolder||e[7]!==i.key||e[8]!==d?(u=()=>i.isFolder?d(i.key):void 0,e[6]=i.isFolder,e[7]=i.key,e[8]=d,e[9]=u):u=e[9];const E=i.isFolder&&"cursor-pointer hover:text-primary";let p;e[10]!==E?(p=J("flex items-center gap-2 flex-1 min-w-0 text-left",E),e[10]=E,e[11]=p):p=e[11];let z;e[12]!==i.isFolder?(z=i.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(re,{size:18,className:"text-muted-foreground shrink-0"}),e[12]=i.isFolder,e[13]=z):z=e[13];let g;e[14]!==S?(g=t.jsx("span",{className:"truncate",children:S}),e[14]=S,e[15]=g):g=e[15];let y;e[16]!==u||e[17]!==p||e[18]!==z||e[19]!==g?(y=t.jsxs("button",{type:"button",onClick:u,className:p,children:[z,g]}),e[16]=u,e[17]=p,e[18]=z,e[19]=g,e[20]=y):y=e[20];let h;e[21]!==i.isFolder||e[22]!==i.size?(h=i.isFolder?"-":je(i.size),e[21]=i.isFolder,e[22]=i.size,e[23]=h):h=e[23];let w;e[24]!==h?(w=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:h}),e[24]=h,e[25]=w):w=e[25];let v;e[26]!==i.isFolder||e[27]!==i.lastModified?(v=i.isFolder?"-":ye(i.lastModified),e[26]=i.isFolder,e[27]=i.lastModified,e[28]=v):v=e[28];let N;e[29]!==v?(N=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:v}),e[29]=v,e[30]=N):N=e[30];let C;e[31]!==i.isFolder||e[32]!==i.key||e[33]!==m?(C=!i.isFolder&&t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(i.key),children:t.jsx(ie,{size:14})}),e[31]=i.isFolder,e[32]=i.key,e[33]=m,e[34]=C):C=e[34];let F;e[35]!==i.key||e[36]!==l?(F=()=>l(i.key),e[35]=i.key,e[36]=l,e[37]=F):F=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(W,{size:14}),e[38]=P):P=e[38];let k;e[39]!==F?(k=t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F,children:P}),e[39]=F,e[40]=k):k=e[40];let a;e[41]!==C||e[42]!==k?(a=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[C,k]}),e[41]=C,e[42]=k,e[43]=a):a=e[43];let r;return e[44]!==w||e[45]!==N||e[46]!==a||e[47]!==f||e[48]!==y?(r=t.jsxs("div",{className:"group flex items-center gap-3 px-4 py-2 hover:bg-muted/50 border-b border-border last:border-b-0",children:[f,y,w,N,a]}),e[44]=w,e[45]=N,e[46]=a,e[47]=f,e[48]=y,e[49]=r):r=e[49],r}function H(s){const e=K.c(8),{prefix:i,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==i){const x=ve(i);let d;e[3]!==o?(d=()=>o(""),e[3]=o,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(oe,{size:16}),e[5]=m):m=e[5];let l;e[6]!==d?(l=t.jsx("button",{type:"button",onClick:d,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground",children:m}),e[6]=d,e[7]=l):l=e[7],n=t.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[l,x.map((c,b)=>t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ae,{size:14,className:"text-muted-foreground"}),t.jsx("button",{type:"button",onClick:()=>o(c.path),className:J("hover:text-primary",b===x.length-1?"font-medium text-foreground":"text-muted-foreground"),children:c.name})]},c.path))]}),e[0]=o,e[1]=i,e[2]=n}else n=e[2];return n}function ke(){const{path:s="",flat:e=!1,view:i="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=M.useState(new Set),d=a=>{x(new Set),o({to:"/",search:{path:a||void 0,flat:e,view:i}})},m=a=>{x(new Set),o({to:"/",search:{path:a?void 0:s||void 0,flat:a,view:i}})},l=a=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:a}})},c=M.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=Q(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:z,loadMore:g,error:y}=le({prefix:s,flat:e}),h=q({mutationFn:async a=>{const r=s+a.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:a.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:a,headers:{"Content-Type":a.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:a=>{D.success(`Uploaded ${I(a)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Upload failed: ${a.message}`)}}),w=q({mutationFn:async a=>a.length===1&&a[0]?f("DELETE_OBJECT",{key:a[0]}):f("DELETE_OBJECTS",{keys:a}),onSuccess:()=>{D.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Delete failed: ${a.message}`)}}),v=async a=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:a}),j=await fetch(r);if(!j.ok)throw new Error(`Failed to fetch file: ${j.statusText}`);const T=await j.blob(),O=URL.createObjectURL(T),B=document.createElement("a");B.href=O,B.download=I(a),document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(O)}catch(r){D.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=a=>{const r=a.target.files;if(r){for(const j of Array.from(r))h.mutate(j);a.target.value=""}},C=(a,r)=>{const j=new Set(n);r?j.add(a):j.delete(a),x(j)},F=a=>{x(a?new Set(u.map(r=>r.key)):new Set)},P=()=>{n.size!==0&&w.mutate(Array.from(n))},k=a=>{if(!z||p)return;const r=a.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<200&&g()};return y?t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(se,{size:48,className:"text-destructive mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),t.jsx("p",{className:"text-muted-foreground text-center",children:y.message})]}):i==="grid"?t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]}),t.jsx(M.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ne,{prefix:s,flat:e,onNavigate:d})})]}):t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[n.size>0&&t.jsxs(_,{variant:"outline",size:"sm",className:"text-destructive",onClick:P,disabled:w.isPending,children:[t.jsx(W,{size:14,className:"mr-1"}),"Delete (",n.size,")"]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border bg-muted/30 text-sm font-medium text-muted-foreground",children:[t.jsx(U,{checked:n.size>0&&n.size===u.length,onCheckedChange:F}),t.jsx("span",{className:"flex-1",children:"Name"}),t.jsx("span",{className:"w-20 text-right",children:"Size"}),t.jsx("span",{className:"w-28 text-right",children:"Modified"}),t.jsx("span",{className:"w-16"})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",onScroll:k,children:E?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx(L,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):u.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),t.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),t.jsxs(_,{variant:"outline",onClick:()=>c.current?.click(),children:[t.jsx($,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(a=>t.jsx(be,{item:a,selected:n.has(a.key),showFullPath:e,onSelect:r=>C(a.key,r),onNavigate:d,onDownload:v,onDelete:r=>w.mutate([r])},a.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx(L,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const Ke=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));export{R as K,Ie as a,Ke as b,je as f,I as g,Z as s,le as u};
@@ -1 +0,0 @@
1
- import{r as v,c as M,bm as D,j as s,z as q,t as w,a4 as H}from"./index-Bn2rDd42.js";import{K as L,u as Z,g as R,s as Q,a as W,f as U}from"./file-browser-DQeqPq9E.js";import{B as E}from"./button-CcO5M7F7.js";import{c as I}from"./utils-Ckc2UwOp.js";import{i as S}from"./AlertCircle-C_hR5usO.js";import{n as A}from"./Download01-BKmVPJWY.js";import{i as $}from"./File02-BNE7fmK0.js";import{i as J}from"./File06-WU23pV9H.js";import{a as P}from"./Image01-BnbXZOf7.js";import{i as T}from"./Loading01-D8zw0cyg.js";import{s as V}from"./Trash01-CLqhrRia.js";import{i as Y}from"./Upload01-DrtXkSgF.js";import{u as _}from"./useMutation-CnTeRHmv.js";import{u as X}from"./useQuery-Ct96KcZp.js";import"./useInfiniteQuery-DDUEUpOZ.js";import"./infiniteQueryObserver-VnhrjjoH.js";import"./checkbox-CirsSPdM.js";import"./Check-Sa4xK5Hg.js";import"./ChevronRight-By4KEpZh.js";import"./Grid01-CSAsqBFD.js";import"./Home02-BUr926Eo.js";import"./List-kXpaJIIp.js";const B=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File04";const G=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="File07";const K=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));K.displayName="FileCode01";const O=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));O.displayName="VideoRecorder";function ee(i){const e=M.c(5),[t,g]=v.useState(!1),c=v.useRef(null),d=v.useRef(!1);let n;e[0]!==i?(n=u=>{c.current&&(c.current.disconnect(),c.current=null),u&&!d.current&&(c.current=new IntersectionObserver(y=>{const[a]=y;a?.isIntersecting&&!d.current&&(d.current=!0,g(!0),c.current?.disconnect(),c.current=null)},i),c.current.observe(u))},e[0]=i,e[1]=n):n=e[1];const l=n;let h;return e[2]!==t||e[3]!==l?(h=[t,l],e[2]=t,e[3]=l,e[4]=h):h=e[4],h}function te(i){const e=M.c(24),{objectKey:t,alt:g,className:c}=i,d=c===void 0?"":c,{connectionId:n,toolCaller:l}=D();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={rootMargin:"100px",threshold:0},e[0]=h):h=e[0];const[u,y]=ee(h);let a;e[1]!==n||e[2]!==t?(a=L.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=a):a=e[3];let f;e[4]!==t||e[5]!==l?(f=async()=>{const{url:m}=await l("GET_PRESIGNED_URL",{key:t});return m},e[4]=t,e[5]=l,e[6]=f):f=e[6];let k;e[7]!==u||e[8]!==a||e[9]!==f?(k={queryKey:a,queryFn:f,enabled:u,staleTime:3e5,gcTime:6e5},e[7]=u,e[8]=a,e[9]=f,e[10]=k):k=e[10];const{data:b,isLoading:x,error:j}=X(k);let p;e[11]!==d?(p=I("relative w-full h-full flex items-center justify-center overflow-hidden",d),e[11]=d,e[12]=p):p=e[12];let r;e[13]!==g||e[14]!==j||e[15]!==b||e[16]!==x||e[17]!==u||e[18]!==t?(r=!u||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx(T,{size:24,className:"animate-spin"}):s.jsx(P,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(S,{size:24})}):b?s.jsx("img",{src:b,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[13]=g,e[14]=j,e[15]=b,e[16]=x,e[17]=u,e[18]=t,e[19]=r):r=e[19];let o;return e[20]!==y||e[21]!==p||e[22]!==r?(o=s.jsx("div",{ref:y,className:p,children:r}),e[20]=y,e[21]=p,e[22]=r,e[23]=o):o=e[23],o}const z=12,se={Image01:P,VideoRecorder:O,Music01:$,File02:$,File04:B,File06:J,File07:G,FileCode01:K,Folder:H};function re(i){const e=i.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function oe(i){const e=M.c(41),{item:t,onNavigate:g,onDownload:c,onDelete:d}=i;let n;e[0]!==t.key?(n=R(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,h=t.isFolder?"Folder":W(t.key),u=se[h]||$;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&re(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const a=y;let f;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(f=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=f):f=e[8];const k=!a&&"p-4",b=t.isFolder?"cursor-pointer":"cursor-default";let x;e[9]!==k||e[10]!==b?(x=I("flex flex-col items-center justify-center w-full h-full",k,b),e[9]=k,e[10]=b,e[11]=x):x=e[11];let j;e[12]!==u||e[13]!==a||e[14]!==t.isFolder||e[15]!==t.key||e[16]!==l?(j=a?s.jsx("div",{className:"absolute inset-0",children:s.jsx(te,{objectKey:t.key,alt:l})}):s.jsx(u,{size:48,className:I(t.isFolder?"text-amber-500":"text-muted-foreground")}),e[12]=u,e[13]=a,e[14]=t.isFolder,e[15]=t.key,e[16]=l,e[17]=j):j=e[17];let p;e[18]!==a||e[19]!==t.isFolder||e[20]!==t.size||e[21]!==l?(p=a?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:U(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:U(t.size)})]}),e[18]=a,e[19]=t.isFolder,e[20]=t.size,e[21]=l,e[22]=p):p=e[22];let r;e[23]!==f||e[24]!==x||e[25]!==j||e[26]!==p?(r=s.jsxs("button",{type:"button",onClick:f,className:x,children:[j,p]}),e[23]=f,e[24]=x,e[25]=j,e[26]=p,e[27]=r):r=e[27];let o;e[28]!==t.isFolder||e[29]!==t.key||e[30]!==d||e[31]!==c?(o=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:F=>{F.stopPropagation(),c(t.key)},children:s.jsx(A,{size:14})}),s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})]}),e[28]=t.isFolder,e[29]=t.key,e[30]=d,e[31]=c,e[32]=o):o=e[32];let m;e[33]!==t.isFolder||e[34]!==t.key||e[35]!==d?(m=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})}),e[33]=t.isFolder,e[34]=t.key,e[35]=d,e[36]=m):m=e[36];let N;return e[37]!==o||e[38]!==m||e[39]!==r?(N=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[r,o,m]}),e[37]=o,e[38]=m,e[39]=r,e[40]=N):N=e[40],N}function Ee({prefix:i,flat:e,onNavigate:t}){const g=v.useRef(null),c=q(),{connectionId:d,toolCaller:n}=D(),{objects:l,isLoading:h,isFetchingMore:u,hasMore:y,loadMore:a,error:f}=Z({prefix:i,flat:e,pageSize:z}),k=_({mutationFn:async r=>{const o=i+r.name,{url:m}=await n("PUT_PRESIGNED_URL",{key:o,contentType:r.type||"application/octet-stream"}),N=await fetch(m,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!N.ok)throw new Error(`Upload failed: ${N.statusText}`);return o},onSuccess:r=>{w.success(`Uploaded ${R(r)}`),c.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Upload failed: ${r.message}`)}}),b=_({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{w.success("Deleted successfully"),c.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:o}=await n("GET_PRESIGNED_URL",{key:r}),m=await fetch(o);if(!m.ok)throw new Error(`Failed to fetch file: ${m.statusText}`);const N=await m.blob(),F=URL.createObjectURL(N),C=document.createElement("a");C.href=F,C.download=R(r),document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(F)}catch(o){w.error(`Download failed: ${o instanceof Error?o.message:"Unknown error"}`)}},j=r=>{const o=r.target.files;if(o){for(const m of Array.from(o))k.mutate(m);r.target.value=""}},p=r=>{if(!y||u)return;const o=r.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<200&&a()};return f?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(S,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:f.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:p,children:h?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Q,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(E,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(Y,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(oe,{item:r,onNavigate:t,onDownload:x,onDelete:o=>b.mutate([o])},r.key))}),u&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(T,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{Ee as default};