@decocms/mesh 2.17.1 → 2.18.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 (139) hide show
  1. package/dist/client/assets/{AlertCircle-rclbzics.js → AlertCircle-CahACZDg.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-ClViT7Hc.js → ArrowLeft-DlLOWSTj.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-BsQNKzS-.js → ArrowUp-Ck0taqJi.js} +1 -1
  4. package/dist/client/assets/{Check-C2R_Lcai.js → Check-Cjgi2ZiG.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CGAmRXVd.js → ChevronDown-BuVzyKHq.js} +1 -1
  6. package/dist/client/assets/{Code01-CVOtW_Yi.js → Code01-XpAoNs3W.js} +1 -1
  7. package/dist/client/assets/{Copy01-BvrgG3_u.js → Copy01-De4SwxDv.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-D-_ECokQ.js → DotsHorizontal-D-Bv2U6B.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-BeOWu8ww.js → DotsVertical-BhTwPxq7.js} +1 -1
  10. package/dist/client/assets/{Download01-C4VXJ4rj.js → Download01-DhkFfGKV.js} +1 -1
  11. package/dist/client/assets/{Edit01-CkDEl3XN.js → Edit01-DsRHb45T.js} +1 -1
  12. package/dist/client/assets/{File06-DcfM98WM.js → File06-BiIPMtEV.js} +1 -1
  13. package/dist/client/assets/{FilterLines-BFhYlm1G.js → FilterLines-C_UJwG_t.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-Bz0fRANc.js → FlipBackward-CQnTJKeB.js} +1 -1
  15. package/dist/client/assets/{GitBranch01-Bc0tKWvO.js → GitBranch01-ClS9Bk6n.js} +1 -1
  16. package/dist/client/assets/{Grid01-SL4tYH2-.js → Grid01-CRALWbj6.js} +1 -1
  17. package/dist/client/assets/{Home02-C2IjHPBI.js → Home02-ofwnyeoV.js} +1 -1
  18. package/dist/client/assets/{Image01-BQtv4av4.js → Image01-Cb4gQMH4.js} +1 -1
  19. package/dist/client/assets/{Inbox01-Dq00_28Z.js → Inbox01-CKGdnZFH.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-Cr1Ezl_g.js → InfoCircle-_4UsKVMw.js} +1 -1
  21. package/dist/client/assets/{Key01-nM2KN2wI.js → Key01-BFJBGJng.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-Cek4l5LT.js → LinkExternal01-C1dAUI0b.js} +1 -1
  23. package/dist/client/assets/{List-DhHX60HN.js → List-DOmOO2Cw.js} +1 -1
  24. package/dist/client/assets/{Loading01-CpEccvEO.js → Loading01-JwelopeC.js} +1 -1
  25. package/dist/client/assets/{Lock01-DkAqto6l.js → Lock01-B7TIX2sZ.js} +1 -1
  26. package/dist/client/assets/{Play-gy0OXoTQ.js → Play-CMKLF_6n.js} +1 -1
  27. package/dist/client/assets/{Plus-DjzFfDDP.js → Plus-Df2M6Ns2.js} +1 -1
  28. package/dist/client/assets/{SearchMd-Cg2el-z8.js → SearchMd-Cgfgcbdz.js} +1 -1
  29. package/dist/client/assets/{Terminal-Kg8grfTZ.js → Terminal-C8LHfiOW.js} +1 -1
  30. package/dist/client/assets/{Trash01-BnAfsqRe.js → Trash01-KvZ0cVo9.js} +1 -1
  31. package/dist/client/assets/{Upload01-DRgz8NgE.js → Upload01-TiwmYxO-.js} +1 -1
  32. package/dist/client/assets/{X-CBga9b95.js → X-DhyaYbLb.js} +1 -1
  33. package/dist/client/assets/{XClose-DEljIF8n.js → XClose-2bShEltc.js} +1 -1
  34. package/dist/client/assets/{alert-dialog-BNxiLvEc.js → alert-dialog-gZhceV_v.js} +2 -2
  35. package/dist/client/assets/{auth-catchall-DeehfEMz.js → auth-catchall-Dz8qCpUP.js} +1 -1
  36. package/dist/client/assets/{avatar-BXyXgGjh.js → avatar-d8M8JpvZ.js} +1 -1
  37. package/dist/client/assets/{badge-Ctdv4gxt.js → badge-CKe-ib_i.js} +1 -1
  38. package/dist/client/assets/{binder-BxrAqFdA.js → binder-iKe3ndXq.js} +1 -1
  39. package/dist/client/assets/{button-C0pnkZlC.js → button-DXl1hVqx.js} +1 -1
  40. package/dist/client/assets/{card-DUUk5B6T.js → card-D0GcpRPY.js} +1 -1
  41. package/dist/client/assets/{checkbox-DSzJrlMA.js → checkbox-D1tHbcIN.js} +1 -1
  42. package/dist/client/assets/{collection-detail-iIrZ-zZ-.js → collection-detail-BQkjgYb7.js} +1 -1
  43. package/dist/client/assets/{collection-display-button-DDxBelrQ.js → collection-display-button-B_KC-ent.js} +1 -1
  44. package/dist/client/assets/{collection-header-d89fPnWN.js → collection-header-BA9HTLmg.js} +1 -1
  45. package/dist/client/assets/{collection-page-DvY1awQQ.js → collection-page-CDkTC45g.js} +1 -1
  46. package/dist/client/assets/{collection-search-DFSn4A42.js → collection-search-pUdl1eNx.js} +1 -1
  47. package/dist/client/assets/{collection-tab-J4NMpB8P.js → collection-tab-BofyxU3Y.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-CB1f1HNV.js → collection-table-wrapper-wARoPZXo.js} +1 -1
  49. package/dist/client/assets/{connection-CMutAR-q.js → connection-ByVJuREK.js} +1 -1
  50. package/dist/client/assets/{connection-card-DJA7LSPP.js → connection-card-DjK0GZ2u.js} +1 -1
  51. package/dist/client/assets/{connection-detail-AyiveTST.js → connection-detail-BGizcg4Z.js} +1 -1
  52. package/dist/client/assets/connections-B3vaIw3-.js +1 -0
  53. package/dist/client/assets/constants-DQVDVC-J.js +1 -0
  54. package/dist/client/assets/{create-organization-dialog-FpknJphA.js → create-organization-dialog-DKwU0dfN.js} +1 -1
  55. package/dist/client/assets/{dialog-DGipxHKv.js → dialog-1B3YWWMu.js} +1 -1
  56. package/dist/client/assets/{dropdown-menu-DXIsFCVQ.js → dropdown-menu-Hp4qYTud.js} +1 -1
  57. package/dist/client/assets/{dynamic-plugin-layout-p6uYyMI7.js → dynamic-plugin-layout-j2gEmQEr.js} +1 -1
  58. package/dist/client/assets/{empty-state-BOQ8a8rM.js → empty-state-C7Gr5Tg2.js} +1 -1
  59. package/dist/client/assets/{empty-state-CsVvxFp9.js → empty-state-D-JjObLi.js} +1 -1
  60. package/dist/client/assets/{env-vars-editor-DsDwdS2I.js → env-vars-editor-D4XTsyk0.js} +1 -1
  61. package/dist/client/assets/{error-boundary-CiihS5J_.js → error-boundary-rr4tK3fB.js} +1 -1
  62. package/dist/client/assets/{extract-connection-data-CZNqSTSO.js → extract-connection-data-37AfzoCx.js} +1 -1
  63. package/dist/client/assets/{file-browser-DtPxgmLq.js → file-browser-BECnO7FM.js} +2 -2
  64. package/dist/client/assets/{form-Cq3oH5p8.js → form-BQupN7IV.js} +1 -1
  65. package/dist/client/assets/{gateway-detail-Ds9jNsAy.js → gateway-detail-B1f7bt6s.js} +1 -1
  66. package/dist/client/assets/gateways-jpQl136Z.js +1 -0
  67. package/dist/client/assets/{grid-view-DCCLpGyL.js → grid-view-BwLKimb0.js} +1 -1
  68. package/dist/client/assets/{home-C6YGDrtN.js → home-9vMYPTYi.js} +1 -1
  69. package/dist/client/assets/{index-Ct-XKtSm.js → index-Bpy9plQL.js} +1 -1
  70. package/dist/client/assets/{index-sjg7ALLH.js → index-D0CzZUCs.js} +1 -1
  71. package/dist/client/assets/{index-lLPOJwFP.js → index-DEuqpeVv.js} +2 -2
  72. package/dist/client/assets/index-DVolwMvn.js +107 -0
  73. package/dist/client/assets/index-Dh9ePU0t.css +1 -0
  74. package/dist/client/assets/{index-BPAz_Wmi.js → index-u_K3efbu.js} +1 -1
  75. package/dist/client/assets/{infiniteQueryObserver-Cg5Uwm-m.js → infiniteQueryObserver-BXdaScti.js} +1 -1
  76. package/dist/client/assets/{input-BtvEWyY7.js → input-CqqzkfyF.js} +1 -1
  77. package/dist/client/assets/{layout-D_5LiG9u.js → layout-D7T4rJzl.js} +1 -1
  78. package/dist/client/assets/{lazy-highlighter-D262jDd3.js → lazy-highlighter-U-fd28FU.js} +1 -1
  79. package/dist/client/assets/{localstorage-keys-CrsmSVIa.js → localstorage-keys-kemGZMIp.js} +1 -1
  80. package/dist/client/assets/{login-D-eNDgSJ.js → login-AsctHrUh.js} +1 -1
  81. package/dist/client/assets/{mcp-oauth-BlRDBNPG.js → mcp-oauth-DqZqwRXe.js} +1 -1
  82. package/dist/client/assets/{mcp-server-card-h4-acR5C.js → mcp-server-card-DfoQ5M8z.js} +1 -1
  83. package/dist/client/assets/{mcp-server-detail-BIJFOf-1.js → mcp-server-detail-GLsULv7B.js} +1 -1
  84. package/dist/client/assets/{members-JDeSn8de.js → members-eia2aN0I.js} +1 -1
  85. package/dist/client/assets/{monaco-editor-h8_XpHnI.js → monaco-editor-rl0nEzOU.js} +1 -1
  86. package/dist/client/assets/{monitoring-B5veKGER.js → monitoring-DWEGkU9y.js} +1 -1
  87. package/dist/client/assets/{oauth-callback-B7GGjmT2.js → oauth-callback-BFr0fBNT.js} +1 -1
  88. package/dist/client/assets/{page-DRfRpAk9.js → page-BeG_Zpat.js} +1 -1
  89. package/dist/client/assets/page-GoE2bJQh.js +21 -0
  90. package/dist/client/assets/{pin-to-sidebar-button-DNtnmSb8.js → pin-to-sidebar-button-CrzVxc9I.js} +1 -1
  91. package/dist/client/assets/{plugin-empty-state-DrcgOOcq.js → plugin-empty-state-CvQbqnfg.js} +1 -1
  92. package/dist/client/assets/{plugin-header-riFgGbiI.js → plugin-header-BaWUIpLx.js} +1 -1
  93. package/dist/client/assets/{plugins-DoB7Ko8p.js → plugins-Q7uqmYFh.js} +1 -1
  94. package/dist/client/assets/{popover-pNwa1deQ.js → popover-BcOo6EXw.js} +1 -1
  95. package/dist/client/assets/{project-context-provider-BMHXD39x.js → project-context-provider-Dn1-l4h2.js} +1 -1
  96. package/dist/client/assets/{registry-utils-BkBVcE6w.js → registry-utils-85b65tFI.js} +1 -1
  97. package/dist/client/assets/{resizable-jz1SBMEc.js → resizable-DkFmgcsj.js} +1 -1
  98. package/dist/client/assets/{resource-tabs-DqRWX41r.js → resource-tabs-DkDSMlFB.js} +1 -1
  99. package/dist/client/assets/{select-COJ5S7Rq.js → select-Bv7J3zlQ.js} +1 -1
  100. package/dist/client/assets/{settings-CmNkIvY0.js → settings-BK8QvMDL.js} +1 -1
  101. package/dist/client/assets/shell-layout-DImgzYtx.js +3 -0
  102. package/dist/client/assets/{spinner-Deoz6N0J.js → spinner-D0hdWfev.js} +1 -1
  103. package/dist/client/assets/{switch-Z2NGTQao.js → switch-ugX7u7WU.js} +1 -1
  104. package/dist/client/assets/{textarea-fD103gtG.js → textarea-BUrXtpl5.js} +1 -1
  105. package/dist/client/assets/{tool-set-selector-SxQbDynN.js → tool-set-selector-a1uFioE0.js} +1 -1
  106. package/dist/client/assets/{tools-list-9lgpWeKJ.js → tools-list-DpFBj-bw.js} +1 -1
  107. package/dist/client/assets/{tooltip-D0yN_jPS.js → tooltip-vUrxHIt0.js} +1 -1
  108. package/dist/client/assets/typewriter-title-7_SusDya.js +16 -0
  109. package/dist/client/assets/{use-binding-bdIG4ysm.js → use-binding-B0VMz_Ex.js} +1 -1
  110. package/dist/client/assets/{use-collections-DiH8BH96.js → use-collections-Cflasxiq.js} +1 -1
  111. package/dist/client/assets/{use-connection-BvgGy_ae.js → use-connection-DhRUkVvI.js} +1 -1
  112. package/dist/client/assets/{use-connection-resources-CazBLQYp.js → use-connection-resources-C-wyp48q.js} +1 -1
  113. package/dist/client/assets/{use-create-gateway-DWTCcW8J.js → use-create-gateway-DMkdPgfy.js} +1 -1
  114. package/dist/client/assets/{use-gateway-Blme6XE1.js → use-gateway-D5VVN1xE.js} +1 -1
  115. package/dist/client/assets/{use-gateway-system-prompt-DfRYNjlK.js → use-gateway-system-prompt-B3fSaA6r.js} +1 -1
  116. package/dist/client/assets/{use-list-state-C9VeGRXh.js → use-list-state-BYREPRxy.js} +1 -1
  117. package/dist/client/assets/{use-mcp-ByUu9rNa.js → use-mcp-CZeMxRgK.js} +1 -1
  118. package/dist/client/assets/{use-members-A4eH5Mug.js → use-members-Bi0eIvBO.js} +1 -1
  119. package/dist/client/assets/{use-mobile-DQFSnNx5.js → use-mobile-CI2w7svc.js} +1 -1
  120. package/dist/client/assets/{use-organization-settings-CFfwAQvt.js → use-organization-settings-D0kNSjbq.js} +1 -1
  121. package/dist/client/assets/{use-tool-call-q6DaczOv.js → use-tool-call-CoI4ZCZe.js} +1 -1
  122. package/dist/client/assets/useInfiniteQuery-ckN_t7ea.js +1 -0
  123. package/dist/client/assets/{useMutation-8xrpFP-l.js → useMutation-xcmVYLP7.js} +1 -1
  124. package/dist/client/assets/useQuery-BKyLWvSZ.js +1 -0
  125. package/dist/client/assets/{value-_3bvT1Yq.js → value-C7rJ457O.js} +1 -1
  126. package/dist/client/assets/{view-mode-toggle-C7lGZNG7.js → view-mode-toggle-CTWk8Dkt.js} +1 -1
  127. package/dist/client/assets/{workflow-DBXd52Rn.js → workflow-ClKgdB2v.js} +1 -1
  128. package/dist/client/index.html +2 -2
  129. package/package.json +1 -1
  130. package/dist/client/assets/MessageChatSquare-B8VNN8W_.js +0 -1
  131. package/dist/client/assets/connections-B5sVjhUZ.js +0 -1
  132. package/dist/client/assets/constants-Bx2xP4ra.js +0 -1
  133. package/dist/client/assets/gateways--0F8usoj.js +0 -1
  134. package/dist/client/assets/index-BEGxRCwV.js +0 -107
  135. package/dist/client/assets/index-CCciYu2S.css +0 -1
  136. package/dist/client/assets/page-JPTyFV98.js +0 -35
  137. package/dist/client/assets/shell-layout-B43W-k9I.js +0 -17
  138. package/dist/client/assets/useInfiniteQuery-c0A7IUcG.js +0 -1
  139. package/dist/client/assets/useQuery-CLJFoOtO.js +0 -1
@@ -1 +0,0 @@
1
- import{c as ge,j as e,r as M,f as xe,b as je,a as fe,u as ye,E as ve,B as _e,y as se,I as Ce,z as y,_ as ke}from"./index-lLPOJwFP.js";import{C as Ne}from"./collection-header-d89fPnWN.js";import{C as Se}from"./collection-page-DvY1awQQ.js";import{C as Te}from"./collection-search-DFSn4A42.js";import{C as we}from"./collection-table-wrapper-CB1f1HNV.js";import{C as De}from"./connection-card-DJA7LSPP.js";import{n as O,E as B,I as be}from"./empty-state-BOQ8a8rM.js";import{E as Pe}from"./error-boundary-CiihS5J_.js";import{a as Ie,u as Ve}from"./use-connection-BvgGy_ae.js";import{u as Ee}from"./use-binding-bdIG4ysm.js";import{u as $e,s as Q}from"./use-list-state-C9VeGRXh.js";import{u as Ae}from"./project-context-provider-BMHXD39x.js";import{f as Fe,a as He,b as Oe,c as Be,d as ze,e as Me,A as Re,g as Ue}from"./alert-dialog-BNxiLvEc.js";import{B as Xe}from"./badge-Ctdv4gxt.js";import{B as _}from"./button-C0pnkZlC.js";import{d as Le,c as We,a as Ke,D as Ge,g as qe,f as Ye}from"./dialog-DGipxHKv.js";import{b as J,D as Z,a as ee,c as E}from"./dropdown-menu-DXIsFCVQ.js";import{a as Qe,F as h,b as g,c as x,d as j,f}from"./form-Cq3oH5p8.js";import{i as te}from"./DotsVertical-BeOWu8ww.js";import{f as Je,e as Ze,s as z}from"./registry-utils-BkBVcE6w.js";import{i as et}from"./Loading01-CpEccvEO.js";import{i as tt}from"./Terminal-Kg8grfTZ.js";import{s as ne}from"./Trash01-BnAfsqRe.js";import{I as k}from"./input-BtvEWyY7.js";import{S as nt,a as ot,b as st,c as rt,d as P}from"./select-COJ5S7Rq.js";import{T as it}from"./textarea-fD103gtG.js";import{g as at}from"./generate-id-Dyweu44Y.js";import{a as ct}from"./use-tool-call-q6DaczOv.js";import{c as lt}from"./connection-CMutAR-q.js";import{i as dt,r as mt,E as ut,e as re}from"./env-vars-editor-DsDwdS2I.js";import"./collection-display-button-DDxBelrQ.js";import"./ArrowUp-BsQNKzS-.js";import"./Check-C2R_Lcai.js";import"./Grid01-SL4tYH2-.js";import"./List-DhHX60HN.js";import"./tooltip-D0yN_jPS.js";import"./view-mode-toggle-C7lGZNG7.js";import"./SearchMd-Cg2el-z8.js";import"./card-DUUk5B6T.js";import"./use-collections-DiH8BH96.js";import"./useMutation-8xrpFP-l.js";import"./binder-BxrAqFdA.js";import"./use-mobile-DQFSnNx5.js";import"./X-CBga9b95.js";import"./ChevronDown-CGAmRXVd.js";import"./useQuery-CLJFoOtO.js";import"./Plus-DjzFfDDP.js";const pt=se({key:y(),value:y()}),ht=se({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:ke(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:Ce(pt).optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function A(n){const s=n.trim();if(!s)return"";try{const i=new URL(s),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return s.replace(/\/+$/,"")}}function gt(n){const s=n.trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;const i=s[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const u=s.slice(1).find(a=>!a.startsWith("-"));return u?{packageName:u}:null}function $(n){const{uiType:s}=n,i=A(n.connectionUrl??"");if((s==="HTTP"||s==="SSE"||s==="Websocket")&&i===A("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(n.npxPackage??"").trim();return s==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function oe(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const s=A(n.connectionUrl??"");if(!s)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>A(N.url??"")===s));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",u=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:u}:null}function xt(n,s){const i={command:"npx",args:["-y",n]},d=re(s);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,s,i,d){const u={command:n};s.trim()&&(u.args=s.trim().split(/\s+/)),i?.trim()&&(u.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(u.envVars=a),u}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(s=>!s.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,s){switch(s.type){case"edit":return{mode:"editing",connection:s.connection};case"delete":return{mode:"deleting",connection:s.connection};case"close":return{mode:"idle"}}}function Ct(){const{org:n}=Ae(),s=xe(),i=je({strict:!1}),{data:d}=fe.useSession(),{stdioEnabled:u}=ye(),a=$e({namespace:n.slug,resource:"connections"}),I=Ie(),N=Ve(a),[v,S]=M.useReducer(_t,{mode:"idle"}),R=Ee(N)[0],F=R?.id??"",U=Je(R?.tools),ie=lt(F||void 0),{data:ae}=ct({toolCaller:ie,toolName:U,toolInputParams:{limit:200},scope:F,enabled:!!(F&&U),staleTime:3600*1e3}),X=Ze(ae??[]),L=i.action==="create",ce=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},W=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=ve({resolver:_e(ht),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),m=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),D=$({uiType:m,connectionUrl:K??"",npxPackage:le??""})??oe({uiType:m,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;M.useEffect(()=>{if(l){const t=dt(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const o=mt(t.envVars);if(ft(t)){const c=yt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const c=vt(t);r.reset({title:l.title,description:l.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:o})}}else r.reset({title:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[l,r]);const de=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;S({type:"close"});try{await I.delete.mutateAsync(t)}catch{}},me=async t=>{let o,c=null,T=null,C=null;if(t.ui_type==="NPX"?(o="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,c=t.connection_url||"",T=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:c,...T&&{connection_token:T},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const w=at("conn");await I.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:o,connection_url:c,connection_token:T,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),W(),r.reset(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:w}})},G=t=>{t||(L?W():S({type:"close"}),r.reset())},V=t=>{const o=t.trim();if(!o)return;const c=!!r.formState.dirtyFields.title,T=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,w=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!T&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const q=r.getValues("env_vars")??[],he=new Set(q.map(b=>b.key)),Y=p.envVarKeys.filter(b=>!he.has(b));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(b=>({key:b,value:""}))],{shouldDirty:!0})}},H=gt(o);if(H&&u){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w($({uiType:"NPX",npxPackage:H.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=m==="HTTP"||m==="SSE"||m==="Websocket"?m:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),w($({uiType:p,connectionUrl:o})??oe({uiType:p,connectionUrl:o,registryItems:X}));return}m==="NPX"&&w($({uiType:"NPX",npxPackage:o}))},ue=[{id:"icon",header:"",render:t=>e.jsx(be,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(O,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const o=t.connection_url??"",c=o.length>40?`${o.slice(0,40)}...`:o;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(Xe,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],pe=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:ce,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(Se,{children:[e.jsx(Le,{open:L||v.mode==="editing",onOpenChange:G,children:e.jsxs(We,{className:"sm:max-w-[525px]",children:[e.jsxs(Ke,{children:[e.jsx(Ge,{children:l?"Edit Connection":"Create Connection"}),e.jsx(qe,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Qe,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(me),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Type *"}),e.jsxs(nt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(ot,{children:e.jsx(st,{})})}),e.jsxs(rt,{children:[e.jsx(P,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(P,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(P,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Websocket"]})}),u&&e.jsxs(e.Fragment,{children:[e.jsx(P,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(P,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),m==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),m==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Working Directory"}),e.jsx(j,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(f,{})]})})]}),(m==="NPX"||m==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(ut,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),m!=="NPX"&&m!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:D?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Description"}),e.jsx(j,{children:e.jsx(it,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Ye,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Fe,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(He,{children:[e.jsxs(Oe,{children:[e.jsx(Be,{children:"Delete Connection?"}),e.jsxs(ze,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Me,{children:[e.jsx(Re,{children:"Cancel"}),e.jsx(Ue,{onClick:de,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(Ne,{title:"Connections",viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:pe}),e.jsx(Te,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(De,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(we,{columns:ue,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function jn(){const n=ge.c(1);let s;return n[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(Pe,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(et,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=s):s=n[0],s}export{jn as default};
@@ -1 +0,0 @@
1
- import{aJ as a,bm as t}from"./index-lLPOJwFP.js";const e="mcp.mesh",s=a(t,{target:"draft-7"});export{s as B,e as M};
@@ -1 +0,0 @@
1
- import{c as ee,j as t,r as te,f as oe}from"./index-lLPOJwFP.js";import{C as re}from"./collection-header-d89fPnWN.js";import{C as ie}from"./collection-page-DvY1awQQ.js";import{C as ne}from"./collection-search-DFSn4A42.js";import{C as ae}from"./collection-table-wrapper-CB1f1HNV.js";import{C as le}from"./connection-card-DJA7LSPP.js";import{E as W,I as ce}from"./empty-state-BOQ8a8rM.js";import{E as de}from"./error-boundary-CiihS5J_.js";import{u as me,a as ue,i as x}from"./use-gateway-Blme6XE1.js";import{u as pe,s as J}from"./use-list-state-C9VeGRXh.js";import{u as ge}from"./use-create-gateway-DWTCcW8J.js";import{u as he}from"./project-context-provider-BMHXD39x.js";import{c as fe,b as xe,d as je,A as Ce,e as we,g as ye,a as Ne,f as De}from"./alert-dialog-BNxiLvEc.js";import{B as se}from"./badge-Ctdv4gxt.js";import{B as q}from"./button-C0pnkZlC.js";import{b as Q,D as U,a as X,c as B}from"./dropdown-menu-DXIsFCVQ.js";import{i as Y}from"./DotsVertical-BeOWu8ww.js";import{i as Se}from"./Loading01-CpEccvEO.js";import{s as Z}from"./Trash01-BnAfsqRe.js";import"./collection-display-button-DDxBelrQ.js";import"./ArrowUp-BsQNKzS-.js";import"./Check-C2R_Lcai.js";import"./Grid01-SL4tYH2-.js";import"./List-DhHX60HN.js";import"./tooltip-D0yN_jPS.js";import"./view-mode-toggle-C7lGZNG7.js";import"./SearchMd-Cg2el-z8.js";import"./input-BtvEWyY7.js";import"./card-DUUk5B6T.js";import"./connection-CMutAR-q.js";import"./use-collections-DiH8BH96.js";import"./useMutation-8xrpFP-l.js";import"./use-mobile-DQFSnNx5.js";function ve(e,r){switch(r.type){case"delete":return{mode:"deleting",gateway:r.gateway};case"close":return{mode:"idle"}}}function be(){const e=ee.c(63),{org:r}=he(),n=oe();let j;e[0]!==r.slug?(j={namespace:r.slug,resource:"gateways"},e[0]=r.slug,e[1]=j):j=e[1];const s=pe(j),f=me(s);let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},e[2]=C):C=e[2];const{createGateway:G,isCreating:w}=ge(C),O=ue();let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y={mode:"idle"},e[3]=y):y=e[3];const[i,N]=te.useReducer(ve,y);let D;e[4]!==O||e[5]!==i.gateway||e[6]!==i.mode?(D=async()=>{if(i.mode!=="deleting")return;const o=i.gateway.id;N({type:"close"});try{await O.delete.mutateAsync(o)}catch{}},e[4]=O,e[5]=i.gateway,e[6]=i.mode,e[7]=D):D=e[7];const R=D;let S,v,b,k,I,_;e[8]===Symbol.for("react.memo_cache_sentinel")?(S={id:"icon",header:"",render:Ke,cellClassName:"w-16 shrink-0",wrap:!0},v={id:"title",header:"Name",render:Pe,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},b={id:"description",header:"Description",render:Ee,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},k={id:"mode",header:"Mode",accessor:$e,cellClassName:"w-[100px]"},I={id:"connections",header:"Connections",render:ze,cellClassName:"w-24 shrink-0"},_={id:"status",header:"Status",render:Me,cellClassName:"w-24 shrink-0",sortable:!0},e[8]=S,e[9]=v,e[10]=b,e[11]=k,e[12]=I,e[13]=_):(S=e[8],v=e[9],b=e[10],k=e[11],I=e[12],_=e[13]);let A;e[14]!==n||e[15]!==r.slug?(A=[S,v,b,k,I,_,{id:"actions",header:"",render:o=>t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ae,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:_e,children:[t.jsxs(B,{onClick:a=>{a.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(J,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[14]=n,e[15]=r.slug,e[16]=A):A=e[16];const T=A,V=w?"Creating...":"Create Agent";let M;e[17]!==G||e[18]!==w||e[19]!==V?(M=t.jsx(q,{onClick:G,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:w,children:V}),e[17]=G,e[18]=w,e[19]=V,e[20]=M):M=e[20];const H=M,L=i.mode==="deleting";let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[21]=z):z=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(fe,{children:"Delete Agent?"}),e[22]=$):$=e[22];const F=i.mode==="deleting"&&i.gateway.title;let l;e[23]!==F?(l=t.jsxs(xe,{children:[$,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:F}),"."]})]}),e[23]=F,e[24]=l):l=e[24];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[25]=E):E=e[25];let c;e[26]!==R?(c=t.jsxs(we,{children:[E,t.jsx(ye,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[26]=R,e[27]=c):c=e[27];let d;e[28]!==l||e[29]!==c?(d=t.jsxs(Ne,{children:[l,c]}),e[28]=l,e[29]=c,e[30]=d):d=e[30];let m;e[31]!==L||e[32]!==d?(m=t.jsx(De,{open:L,onOpenChange:z,children:d}),e[31]=L,e[32]=d,e[33]=m):m=e[33];let P;e[34]===Symbol.for("react.memo_cache_sentinel")?(P=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[34]=P):P=e[34];let u;e[35]!==H||e[36]!==s.handleSort||e[37]!==s.setViewMode||e[38]!==s.sortDirection||e[39]!==s.sortKey||e[40]!==s.viewMode?(u=t.jsx(re,{title:"Agents",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:P,ctaButton:H}),e[35]=H,e[36]=s.handleSort,e[37]=s.setViewMode,e[38]=s.sortDirection,e[39]=s.sortKey,e[40]=s.viewMode,e[41]=u):u=e[41];let p;e[42]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[42]=s,e[43]=p):p=e[43];let g;e[44]!==s.search||e[45]!==s.setSearch||e[46]!==p?(g=t.jsx(ne,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:p}),e[44]=s.search,e[45]=s.setSearch,e[46]=p,e[47]=g):g=e[47];let h;e[48]!==T||e[49]!==f||e[50]!==s.handleSort||e[51]!==s.search||e[52]!==s.sortDirection||e[53]!==s.sortKey||e[54]!==s.viewMode||e[55]!==n||e[56]!==r.slug?(h=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:f.length===0?t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:s.search?"No agents found":"No agents yet",description:s.search?`No agents match "${s.search}"`:"Create an agent to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:f.map(o=>t.jsx(le,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(x,{}),onClick:()=>n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:ke,children:[t.jsxs(B,{onClick:a=>{a.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(J,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ae,{columns:T,data:f,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})}),e[48]=T,e[49]=f,e[50]=s.handleSort,e[51]=s.search,e[52]=s.sortDirection,e[53]=s.sortKey,e[54]=s.viewMode,e[55]=n,e[56]=r.slug,e[57]=h):h=e[57];let K;return e[58]!==m||e[59]!==u||e[60]!==g||e[61]!==h?(K=t.jsxs(ie,{children:[m,u,g,h]}),e[58]=m,e[59]=u,e[60]=g,e[61]=h,e[62]=K):K=e[62],K}function ke(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function _e(e){return e.stopPropagation()}function Ae(e){return e.stopPropagation()}function Me(e){return t.jsx(se,{variant:e.status==="active"?"default":"outline",children:e.status})}function ze(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function $e(e){return t.jsx(se,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ee(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Pe(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ke(e){return t.jsx(ce,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(x,{size:16})})}function ft(){const e=ee.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(de,{children:t.jsx(te.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Se,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(be,{})})}),e[0]=r):r=e[0],r}export{ft as default};