@decocms/mesh 2.9.0 → 2.10.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 (118) hide show
  1. package/dist/client/assets/{AlertCircle-DST9a9vh.js → AlertCircle-BI-lv-P2.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-DPtymxR-.js → ArrowLeft-WX776rGw.js} +1 -1
  3. package/dist/client/assets/{Check-B3jZM0OP.js → Check-Dh23dmDM.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-Bi1kqv-9.js → ChevronDown-CQl6wdMq.js} +1 -1
  5. package/dist/client/assets/{Clock-BynE89Zl.js → Clock-C2L66fjj.js} +1 -1
  6. package/dist/client/assets/{Code01-BMUDEJ4t.js → Code01-BvYrq72o.js} +1 -1
  7. package/dist/client/assets/{Copy01-DUDgHeaT.js → Copy01-BX4_oHqx.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-DO21zZi8.js → DotsHorizontal-9lU8MC-X.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-DikAa5AR.js → DotsVertical-BBtotCm7.js} +1 -1
  10. package/dist/client/assets/{File06-7Osp6kua.js → File06-lv7rH_v1.js} +1 -1
  11. package/dist/client/assets/{FilterLines-DieVG1pT.js → FilterLines-WZSp93Oe.js} +1 -1
  12. package/dist/client/assets/{FlipBackward-U1Nw6QGY.js → FlipBackward-CqqvNJYu.js} +1 -1
  13. package/dist/client/assets/{GitBranch01-CTCXO68x.js → GitBranch01-DN-LFsG4.js} +1 -1
  14. package/dist/client/assets/{Grid01-DI-Q2VEp.js → Grid01-bigl9l-5.js} +1 -1
  15. package/dist/client/assets/{Inbox01-Cme2B_Za.js → Inbox01-BIZdM9VF.js} +1 -1
  16. package/dist/client/assets/{InfoCircle-Bz1TUoGx.js → InfoCircle-FggQ2WMl.js} +1 -1
  17. package/dist/client/assets/{Key01-COwuV6OE.js → Key01-BHIpjeh2.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-BaHJAM0O.js → LinkExternal01-YcVnQhq1.js} +1 -1
  19. package/dist/client/assets/{Loading01-C5e9Xing.js → Loading01-nz4zkIiQ.js} +1 -1
  20. package/dist/client/assets/{Lock01-BLY_4cHD.js → Lock01-DJbaRRVq.js} +1 -1
  21. package/dist/client/assets/{Play-BSr93GMI.js → Play-Dy3YBriV.js} +1 -1
  22. package/dist/client/assets/{Plus-pmQCIiux.js → Plus-DRzcJPy4.js} +1 -1
  23. package/dist/client/assets/{SearchMd-C8MbVAuA.js → SearchMd-CGgWiIHk.js} +1 -1
  24. package/dist/client/assets/{Terminal-BSyq_KGG.js → Terminal-DDxodu0O.js} +1 -1
  25. package/dist/client/assets/{Trash01-DqQrX192.js → Trash01-Nn4emH5w.js} +1 -1
  26. package/dist/client/assets/{X-CJAJyKbZ.js → X-CSDtf13Z.js} +1 -1
  27. package/dist/client/assets/{XClose-CF1lddkv.js → XClose-Da4Q_9Br.js} +1 -1
  28. package/dist/client/assets/{alert-dialog-BnwjYq4n.js → alert-dialog-BrdP9Xiy.js} +1 -1
  29. package/dist/client/assets/{auth-DhJcJDq8.js → auth-BkX07Kdp.js} +1 -1
  30. package/dist/client/assets/{auth-catchall-C2IFDAAQ.js → auth-catchall-CgZMKj4U.js} +1 -1
  31. package/dist/client/assets/{avatar-Cd72kdsa.js → avatar-DVkpHhcq.js} +1 -1
  32. package/dist/client/assets/{badge-iCoQ1dgD.js → badge-DZOpuutl.js} +1 -1
  33. package/dist/client/assets/{card-CjWJyjfT.js → card-VaGCmdRN.js} +1 -1
  34. package/dist/client/assets/{checkbox-5O25feEA.js → checkbox-B6_pb64c.js} +1 -1
  35. package/dist/client/assets/{collection-detail-BCydbsMr.js → collection-detail-BZTq36Jq.js} +2 -2
  36. package/dist/client/assets/{collection-display-button-D1R0tnBY.js → collection-display-button-0kCgwjcX.js} +1 -1
  37. package/dist/client/assets/{collection-header-0lxlEg2I.js → collection-header-C5jLEW4T.js} +1 -1
  38. package/dist/client/assets/{collection-page-s3MvuRc-.js → collection-page-BxN-pfZ4.js} +1 -1
  39. package/dist/client/assets/{collection-search-Btyw61UY.js → collection-search-DCk3URyd.js} +1 -1
  40. package/dist/client/assets/{collection-tab-DWktiPIU.js → collection-tab-BK4lXf-5.js} +1 -1
  41. package/dist/client/assets/{collection-table-wrapper-gfEw2g5n.js → collection-table-wrapper-DbtYisXO.js} +1 -1
  42. package/dist/client/assets/{connection-card-DfdBq4FD.js → connection-card-CtcQXchE.js} +1 -1
  43. package/dist/client/assets/connection-detail-Dtnc6jAX.js +1 -0
  44. package/dist/client/assets/{connections-B3fFvefT.js → connections-BkTTX2-6.js} +1 -1
  45. package/dist/client/assets/constants-D7HtiX2k.js +1 -0
  46. package/dist/client/assets/{create-organization-dialog-DWi5c4Eh.js → create-organization-dialog-BcohdvN6.js} +1 -1
  47. package/dist/client/assets/{dialog-D76JDRim.js → dialog-rGW8NOdv.js} +1 -1
  48. package/dist/client/assets/{dropdown-menu-BjkFG8SE.js → dropdown-menu-DEdU2p2E.js} +1 -1
  49. package/dist/client/assets/{empty-state-V7JRwEdF.js → empty-state-C6fFQCSt.js} +1 -1
  50. package/dist/client/assets/{env-vars-editor-BJ7tjYIq.js → env-vars-editor-DtIOMaFz.js} +1 -1
  51. package/dist/client/assets/{error-boundary-D0j0sONw.js → error-boundary-B28JvE1I.js} +1 -1
  52. package/dist/client/assets/{extract-connection-data-BrdC23jw.js → extract-connection-data-fJTZE6Hc.js} +1 -1
  53. package/dist/client/assets/{form-B8Xq72cU.js → form-CE1tfcze.js} +1 -1
  54. package/dist/client/assets/gateway-detail-DpvUxeca.js +1 -0
  55. package/dist/client/assets/gateways-DPTsKKk2.js +1 -0
  56. package/dist/client/assets/{home-nnEPBFaz.js → home-lONkAboE.js} +1 -1
  57. package/dist/client/assets/{index-Dv5zkaTK.js → index-B-_GLG4a.js} +1 -1
  58. package/dist/client/assets/{index-xkjtAq50.js → index-CGbuv4sL.js} +1 -1
  59. package/dist/client/assets/{index-DdOgSb-W.js → index-CJEYCkTv.js} +1 -1
  60. package/dist/client/assets/{index-Cqq-bHxo.js → index-Dc4mPG7D.js} +2 -2
  61. package/dist/client/assets/{index-B01CV87W.js → index-DjBifmxL.js} +31 -31
  62. package/dist/client/assets/{input-DJ7wqUvo.js → input-CLQFaB_P.js} +1 -1
  63. package/dist/client/assets/{layout-CfefGJu5.js → layout-D-qTqL0P.js} +1 -1
  64. package/dist/client/assets/{lazy-highlighter-CaSijfHb.js → lazy-highlighter-CM_r6Qg6.js} +1 -1
  65. package/dist/client/assets/{localstorage-keys-TnX0RxDe.js → localstorage-keys-Csxol0-8.js} +1 -1
  66. package/dist/client/assets/{login-CGyq3Vs1.js → login-CY0fBMtA.js} +1 -1
  67. package/dist/client/assets/{mcp-oauth-CJD4q5rM.js → mcp-oauth-DwoWo555.js} +1 -1
  68. package/dist/client/assets/{mcp-server-detail-CbOhDFHk.js → mcp-server-detail-BfkMNCXA.js} +1 -1
  69. package/dist/client/assets/{members-DLByeMDT.js → members-DlfrW4qm.js} +1 -1
  70. package/dist/client/assets/{monaco-editor-CoD_oW78.js → monaco-editor-CGmVJ7Sz.js} +1 -1
  71. package/dist/client/assets/{monitoring-5cDa-J-b.js → monitoring-8m7n1ABH.js} +5 -5
  72. package/dist/client/assets/{oauth-callback-Cgb1o01u.js → oauth-callback-C3UTt1IM.js} +1 -1
  73. package/dist/client/assets/{page-COBajbLE.js → page-CjTfwiJs.js} +1 -1
  74. package/dist/client/assets/page-Cm8i9onu.js +35 -0
  75. package/dist/client/assets/{pin-to-sidebar-button-Cp43fkli.js → pin-to-sidebar-button-DmlmCu_p.js} +1 -1
  76. package/dist/client/assets/{popover-mdWNDupQ.js → popover-Bt6Irkfs.js} +1 -1
  77. package/dist/client/assets/{project-context-provider-Gi9sytDH.js → project-context-provider-jIErvTKU.js} +1 -1
  78. package/dist/client/assets/{resizable-BdJcZRXn.js → resizable-BDACILOB.js} +1 -1
  79. package/dist/client/assets/{resource-tabs-DlB9LUax.js → resource-tabs-B9UXtdu9.js} +1 -1
  80. package/dist/client/assets/{select-B5Ou5lZC.js → select-CXOQrDyU.js} +1 -1
  81. package/dist/client/assets/{settings-CjdyGe2Y.js → settings-Cml1v0xs.js} +1 -1
  82. package/dist/client/assets/shell-layout-BC-hIRVP.js +3 -0
  83. package/dist/client/assets/{spinner-CchSlqhZ.js → spinner-C-rDsJGC.js} +1 -1
  84. package/dist/client/assets/{switch-17EJ9BZl.js → switch-C2oVrx7C.js} +1 -1
  85. package/dist/client/assets/{textarea-BngAuS5G.js → textarea-DxDFaLzd.js} +1 -1
  86. package/dist/client/assets/{thread-history-popover-BNoPu7hE.js → thread-history-popover-D_x2TXEl.js} +13 -13
  87. package/dist/client/assets/{tool-set-selector-ia7ItE5G.js → tool-set-selector-B03cDU_f.js} +1 -1
  88. package/dist/client/assets/{tools-list-HOpPAfsi.js → tools-list-CCvCpz3e.js} +1 -1
  89. package/dist/client/assets/{use-binding-iszUdbOZ.js → use-binding-C_WCv3Kw.js} +1 -1
  90. package/dist/client/assets/{use-connection-Dp5C8sLQ.js → use-connection-D1oWmd80.js} +1 -1
  91. package/dist/client/assets/{use-connection-resources-DU3H93Az.js → use-connection-resources-DAy5w-Ms.js} +1 -1
  92. package/dist/client/assets/use-gateway-DEBoqh3W.js +1 -0
  93. package/dist/client/assets/{use-gateway-system-prompt-BqldEOSK.js → use-gateway-system-prompt-B0FWJC8i.js} +1 -1
  94. package/dist/client/assets/{use-list-state-FSUrDOEN.js → use-list-state-D9IMsf4Z.js} +1 -1
  95. package/dist/client/assets/{use-mcp-D5TIO_2s.js → use-mcp-BSK2ddKq.js} +1 -1
  96. package/dist/client/assets/{use-members-DlA8UjAf.js → use-members-BrVgN1Nv.js} +1 -1
  97. package/dist/client/assets/{use-mobile-D6_iVdHq.js → use-mobile-BmTi-FB3.js} +1 -1
  98. package/dist/client/assets/{use-organization-settings-DVpbHPw1.js → use-organization-settings-DPGpmRIO.js} +1 -1
  99. package/dist/client/assets/{use-tool-call-DsLdhDUf.js → use-tool-call-B5UsmKnA.js} +1 -1
  100. package/dist/client/assets/useQuery-CjN7yze9.js +1 -0
  101. package/dist/client/assets/{value-Bc9uIuB3.js → value-Duay7dd7.js} +1 -1
  102. package/dist/client/assets/{view-mode-toggle-ljeOi0U5.js → view-mode-toggle-Q_4Hio7O.js} +1 -1
  103. package/dist/client/assets/well-known-mcp-7PcWXInp.js +1 -0
  104. package/dist/client/assets/{workflow-DOWIsfb9.js → workflow-C6xPZGlX.js} +1 -1
  105. package/dist/client/index.html +1 -1
  106. package/dist/server/cli.js +145 -145
  107. package/dist/server/migrate.js +129 -129
  108. package/dist/server/server.js +140 -140
  109. package/package.json +1 -1
  110. package/dist/client/assets/connection-detail--2aMjf2x.js +0 -1
  111. package/dist/client/assets/constants-CjRmBn5H.js +0 -1
  112. package/dist/client/assets/gateway-detail-5Qd5lfiW.js +0 -1
  113. package/dist/client/assets/gateways-CEtb1fnf.js +0 -1
  114. package/dist/client/assets/page-Dlp1hzYF.js +0 -35
  115. package/dist/client/assets/shell-layout-DftkJMI3.js +0 -3
  116. package/dist/client/assets/use-gateway-CSxRa3Bg.js +0 -1
  117. package/dist/client/assets/useQuery-UvQ_L9Pc.js +0 -1
  118. package/dist/client/assets/well-known-mcp-D13f-8h2.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{c as q,j as o,f as W,k as J,r as z,d as ce,b as le,aE as ae}from"./index-Cqq-bHxo.js";import{b as G,E as F,I as Q,a as me}from"./use-connection-Dp5C8sLQ.js";import{E as X}from"./error-boundary-D0j0sONw.js";import{b as de}from"./use-binding-iszUdbOZ.js";import{u as ue,S as pe}from"./index-Dv5zkaTK.js";import{u as fe,a as he}from"./use-connection-resources-DU3H93Az.js";import{B as xe}from"./input-DJ7wqUvo.js";import{i as Y}from"./Loading01-C5e9Xing.js";import{R as ge}from"./resource-tabs-DlB9LUax.js";import{V as Z,a as be,b as je}from"./layout-CfefGJu5.js";import{C as ye}from"./collection-tab-DWktiPIU.js";import{C as ee}from"./collection-display-button-D1R0tnBY.js";import{C as te}from"./collection-search-Btyw61UY.js";import{C as oe}from"./collection-table-wrapper-gfEw2g5n.js";import{P as se}from"./pin-to-sidebar-button-Cp43fkli.js";import{C as ne}from"./card-CjWJyjfT.js";import{R as Se,T as Ce}from"./tools-list-HOpPAfsi.js";import"./project-context-provider-Gi9sytDH.js";import"./auth-DhJcJDq8.js";import"./mcp-oauth-CJD4q5rM.js";import"./env-vars-editor-BJ7tjYIq.js";import"./Plus-pmQCIiux.js";import"./Trash01-DqQrX192.js";import"./use-tool-call-DsLdhDUf.js";import"./useQuery-UvQ_L9Pc.js";import"./File06-7Osp6kua.js";import"./Key01-COwuV6OE.js";import"./form-B8Xq72cU.js";import"./select-B5Ou5lZC.js";import"./Check-B3jZM0OP.js";import"./ChevronDown-Bi1kqv-9.js";import"./Terminal-BSyq_KGG.js";import"./use-gateway-CSxRa3Bg.js";import"./Grid01-DI-Q2VEp.js";import"./index-DdOgSb-W.js";import"./constants-CjRmBn5H.js";import"./registry-utils-B7t_ZBUi.js";import"./extract-connection-data-BrdC23jw.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./index-xkjtAq50.js";import"./index-B01CV87W.js";import"./SearchMd-C8MbVAuA.js";import"./AlertCircle-DST9a9vh.js";import"./X-CJAJyKbZ.js";import"./textarea-BngAuS5G.js";import"./localstorage-keys-TnX0RxDe.js";import"./Copy01-DUDgHeaT.js";import"./monaco-editor-CoD_oW78.js";import"./spinner-CchSlqhZ.js";import"./alert-dialog-BnwjYq4n.js";import"./use-mobile-D6_iVdHq.js";import"./InfoCircle-Bz1TUoGx.js";import"./badge-iCoQ1dgD.js";import"./ArrowLeft-DPtymxR-.js";import"./dropdown-menu-BjkFG8SE.js";import"./DotsVertical-DikAa5AR.js";import"./use-list-state-FSUrDOEN.js";import"./empty-state-V7JRwEdF.js";import"./Inbox01-Cme2B_Za.js";import"./avatar-Cd72kdsa.js";import"./view-mode-toggle-ljeOi0U5.js";import"./use-organization-settings-DVpbHPw1.js";function ve(t){const e=q.c(42),{prompts:r,connectionId:n,org:s,connectionTitle:l,connectionIcon:f,onPromptClick:j,showToolbar:g,emptyMessage:N}=t,V=g===void 0?!0:g,E=N===void 0?"This connection doesn't have any prompts yet.":N,u=W(),y=J().location.href,[p,i]=z.useState(""),[w,a]=z.useState("table"),[h,k]=z.useState("name"),[d,_]=z.useState("asc");let b;e[0]!==d||e[1]!==h?(b=x=>{h===x?(_(Ie),d==="desc"&&k(void 0)):(k(x),_("asc"))},e[0]=d,e[1]=h,e[2]=b):b=e[2];const T=b;let P;e[3]!==n||e[4]!==u||e[5]!==j||e[6]!==s?(P=x=>{j?j(x):n&&s&&u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:s,connectionId:n,collectionName:"prompts",itemId:encodeURIComponent(x.name)}})},e[3]=n,e[4]=u,e[5]=j,e[6]=s,e[7]=P):P=e[7];const A=P;let B;if(e[8]!==r||e[9]!==p||e[10]!==d||e[11]!==h){const x=!r||r.length===0?[]:p.trim()?(()=>{const S=p.toLowerCase();return r.filter(U=>U.name.toLowerCase().includes(S)||U.description&&U.description.toLowerCase().includes(S))})():r;B=!h||!d?x:[...x].sort((S,U)=>{const re=S[h]||"",ie=U[h]||"",H=String(re).localeCompare(String(ie));return d==="asc"?H:-H}),e[8]=r,e[9]=p,e[10]=d,e[11]=h,e[12]=B}else B=e[12];const m=B;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=[{id:"name",header:"Name",render:$e,sortable:!0},{id:"description",header:"Description",render:Te,cellClassName:"flex-1",sortable:!0}],e[13]=O):O=e[13];const L=O;let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=L.filter(we).map(Ne),e[14]=M):M=e[14];const D=M;let $;e[15]!==f||e[16]!==l||e[17]!==T||e[18]!==V||e[19]!==d||e[20]!==h||e[21]!==y||e[22]!==w?($=V&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:w,onViewModeChange:a,sortKey:h,sortDirection:d,onSort:T,sortOptions:D}),o.jsx(se,{title:l?`${l}: Prompts`:"Prompts",url:y,icon:f??"description"})]}),e[15]=f,e[16]=l,e[17]=T,e[18]=V,e[19]=d,e[20]=h,e[21]=y,e[22]=w,e[23]=$):$=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=x=>{x.key==="Escape"&&(i(""),x.target.blur())},e[24]=I):I=e[24];let R;e[25]!==p?(R=o.jsx(te,{value:p,onChange:i,placeholder:"Search prompts...",onKeyDown:I}),e[25]=p,e[26]=R):R=e[26];let c;e[27]!==E||e[28]!==A||e[29]!==T||e[30]!==p||e[31]!==d||e[32]!==h||e[33]!==m||e[34]!==w?(c=w==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:m.length===0?o.jsx(F,{image:null,title:p?"No prompts found":"No prompts available",description:p?"Try adjusting your search terms":E}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:m.map(x=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>A(x),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Q,{icon:null,name:x.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:x.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:x.description||"No description"})]})]})},x.name))})}):o.jsx(oe,{columns:L,data:m,isLoading:!1,sortKey:h,sortDirection:d,onSort:T,onRowClick:x=>A(x),emptyState:o.jsx(F,{image:null,title:p?"No prompts found":"No prompts available",description:p?"Try adjusting your search terms":E})}),e[27]=E,e[28]=A,e[29]=T,e[30]=p,e[31]=d,e[32]=h,e[33]=m,e[34]=w,e[35]=c):c=e[35];let C;e[36]!==R||e[37]!==c?(C=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[R,c]}),e[36]=R,e[37]=c,e[38]=C):C=e[38];let v;return e[39]!==C||e[40]!==$?(v=o.jsxs(o.Fragment,{children:[$,C]}),e[39]=C,e[40]=$,e[41]=v):v=e[41],v}function Ne(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function we(t){return t.sortable}function Te(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function $e(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function Ie(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Re(t){const e=q.c(6),{prompts:r,connectionId:n,org:s}=t,l=G(n),f=l?.title,j=l?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(ve,{prompts:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function ke(t){const e=q.c(2),{repository:r}=t;let n;return e[0]!==r?(n=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Se,{repository:r})}),e[0]=r,e[1]=n):n=e[1],n}function _e(t){const e=q.c(39),{resources:r,connectionTitle:n,connectionIcon:s,onResourceClick:l,showToolbar:f,emptyMessage:j}=t,g=f===void 0?!0:f,N=j===void 0?"This connection doesn't have any resources yet.":j,E=J().location.href,[u,K]=z.useState(""),[y,p]=z.useState("table"),[i,w]=z.useState("name"),[a,h]=z.useState("asc");let k;e[0]!==a||e[1]!==i?(k=c=>{i===c?(h(De),a==="desc"&&w(void 0)):(w(c),h("asc"))},e[0]=a,e[1]=i,e[2]=k):k=e[2];const d=k;let _;e[3]!==l?(_=c=>{l&&l(c)},e[3]=l,e[4]=_):_=e[4];const b=_;let T;if(e[5]!==r||e[6]!==u||e[7]!==a||e[8]!==i){const c=!r||r.length===0?[]:u.trim()?(()=>{const C=u.toLowerCase();return r.filter(v=>v.uri.toLowerCase().includes(C)||v.name&&v.name.toLowerCase().includes(C)||v.description&&v.description.toLowerCase().includes(C))})():r;T=!i||!a?c:[...c].sort((C,v)=>{const x=C[i]||"",S=v[i]||"",U=String(x).localeCompare(String(S));return a==="asc"?U:-U}),e[5]=r,e[6]=u,e[7]=a,e[8]=i,e[9]=T}else T=e[9];const P=T;let A;e[10]===Symbol.for("react.memo_cache_sentinel")?(A=[{id:"name",header:"Name",render:Ae,sortable:!0},{id:"uri",header:"URI",render:Me,sortable:!0},{id:"description",header:"Description",render:Le,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ee,sortable:!0}],e[10]=A):A=e[10];const B=A;let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=B.filter(Ve).map(Pe),e[11]=m):m=e[11];const O=m;let L;e[12]!==s||e[13]!==n||e[14]!==d||e[15]!==g||e[16]!==a||e[17]!==i||e[18]!==E||e[19]!==y?(L=g&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:y,onViewModeChange:p,sortKey:i,sortDirection:a,onSort:d,sortOptions:O}),o.jsx(se,{title:n?`${n}: Resources`:"Resources",url:E,icon:s??"folder"})]}),e[12]=s,e[13]=n,e[14]=d,e[15]=g,e[16]=a,e[17]=i,e[18]=E,e[19]=y,e[20]=L):L=e[20];let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=c=>{c.key==="Escape"&&(K(""),c.target.blur())},e[21]=M):M=e[21];let D;e[22]!==u?(D=o.jsx(te,{value:u,onChange:K,placeholder:"Search resources...",onKeyDown:M}),e[22]=u,e[23]=D):D=e[23];let $;e[24]!==N||e[25]!==b||e[26]!==d||e[27]!==u||e[28]!==a||e[29]!==i||e[30]!==P||e[31]!==y?($=y==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:P.length===0?o.jsx(F,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":N}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:P.map(c=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>b(c),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Q,{icon:null,name:c.name||c.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:c.name||c.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:c.uri}),c.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:c.description})]})]})},c.uri))})}):o.jsx(oe,{columns:B,data:P,isLoading:!1,sortKey:i,sortDirection:a,onSort:d,onRowClick:c=>b(c),emptyState:o.jsx(F,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":N})}),e[24]=N,e[25]=b,e[26]=d,e[27]=u,e[28]=a,e[29]=i,e[30]=P,e[31]=y,e[32]=$):$=e[32];let I;e[33]!==D||e[34]!==$?(I=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,$]}),e[33]=D,e[34]=$,e[35]=I):I=e[35];let R;return e[36]!==I||e[37]!==L?(R=o.jsxs(o.Fragment,{children:[L,I]}),e[36]=I,e[37]=L,e[38]=R):R=e[38],R}function Pe(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ve(t){return t.sortable}function Ee(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function Le(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Me(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Ae(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function De(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Be(t){const e=q.c(6),{resources:r,connectionId:n,org:s}=t,l=G(n),f=l?.title,j=l?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(_e,{resources:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function Ue(t){const e=q.c(4),{tools:r,connectionId:n,org:s}=t;let l;return e[0]!==n||e[1]!==s||e[2]!==r?(l=o.jsx(Ce,{tools:r,connectionId:n,org:s}),e[0]=n,e[1]=s,e[2]=r,e[3]=l):l=e[3],l}function Ke(t){const e=q.c(61),{connection:r,connectionId:n,org:s,requestedTabId:l,collections:f,onUpdate:j,isUpdating:g,prompts:N,resources:V}=t,E=ae();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/$org/mcps/$connectionId"},e[0]=u):u=e[0];const K=W(u);let y;e[1]!==n?(y={connectionId:n},e[1]=n,e[2]=y):y=e[2];const p=ue(y),i=p.isAuthenticated,w=r?.metadata?.repository,a=!!w?.url,h=r?.tools?.length??0,k=N.length,d=V.length;let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={id:"settings",label:"Settings"},e[3]=_):_=e[3];let b;e[4]!==i||e[5]!==h?(b=i&&h>0?[{id:"tools",label:"Tools",count:h}]:[],e[4]=i,e[5]=h,e[6]=b):b=e[6];let T;e[7]!==i||e[8]!==k?(T=i&&k>0?[{id:"prompts",label:"Prompts",count:k}]:[],e[7]=i,e[8]=k,e[9]=T):T=e[9];let P;e[10]!==i||e[11]!==d?(P=i&&d>0?[{id:"resources",label:"Resources",count:d}]:[],e[10]=i,e[11]=d,e[12]=P):P=e[12];let A;if(e[13]!==f||e[14]!==a||e[15]!==i||e[16]!==b||e[17]!==T||e[18]!==P){let S;e[20]!==a?(S=a?[{id:"readme",label:"README"}]:[],e[20]=a,e[21]=S):S=e[21],A=[_,...b,...T,...P,...i?(f||[]).map(Oe):[],...S],e[13]=f,e[14]=a,e[15]=i,e[16]=b,e[17]=T,e[18]=P,e[19]=A}else A=e[19];const B=A,m=B.some(S=>S.id===l)?l:"settings";let O;e[22]!==K?(O=S=>{K({search:U=>({...U,tab:S}),replace:!0})},e[22]=K,e[23]=O):O=e[23];const L=O;let M;e[24]!==f?(M=f||[],e[24]=f,e[25]=M):M=e[25];let D;if(e[26]!==m||e[27]!==M){let S;e[29]!==m?(S=U=>U.name===m,e[29]=m,e[30]=S):S=e[30],D=M.find(S),e[26]=m,e[27]=M,e[28]=D}else D=e[28];const $=D;let I;e[31]!==E.history?(I=()=>E.history.back(),e[31]=E.history,e[32]=I):I=e[32];let R;e[33]!==m||e[34]!==L||e[35]!==B?(R=o.jsx(be,{children:o.jsx(ge,{tabs:B,activeTab:m,onTabChange:L})}),e[33]=m,e[34]=L,e[35]=B,e[36]=R):R=e[36];let c;e[37]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=c):c=e[37];let C;e[38]!==$||e[39]!==m||e[40]!==p.isServerError||e[41]!==p.supportsOAuth||e[42]!==r||e[43]!==n||e[44]!==L||e[45]!==a||e[46]!==i||e[47]!==g||e[48]!==j||e[49]!==s||e[50]!==N||e[51]!==w||e[52]!==V?(C=o.jsx(z.Suspense,{fallback:c,children:m==="tools"?o.jsx(Ue,{tools:r.tools??void 0,connectionId:n,org:s}):m==="prompts"?o.jsx(Re,{prompts:N,connectionId:n,org:s}):m==="resources"?o.jsx(Be,{resources:V,connectionId:n,org:s}):m==="settings"?o.jsx(pe,{connection:r,onUpdate:j,isUpdating:g,isMCPAuthenticated:i,supportsOAuth:p.supportsOAuth,isServerError:p.isServerError,onViewReadme:a?()=>L("readme"):void 0}):m==="readme"&&a?o.jsx(ke,{repository:w}):$&&i?o.jsx(ye,{connectionId:n,org:s,activeCollection:$},m):o.jsx(F,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=$,e[39]=m,e[40]=p.isServerError,e[41]=p.supportsOAuth,e[42]=r,e[43]=n,e[44]=L,e[45]=a,e[46]=i,e[47]=g,e[48]=j,e[49]=s,e[50]=N,e[51]=w,e[52]=V,e[53]=C):C=e[53];let v;e[54]!==m||e[55]!==C?(v=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(X,{children:C},m)})}),e[54]=m,e[55]=C,e[56]=v):v=e[56];let x;return e[57]!==I||e[58]!==R||e[59]!==v?(x=o.jsxs(je,{onBack:I,children:[R,v]}),e[57]=I,e[58]=R,e[59]=v,e[60]=x):x=e[60],x}function Oe(t){return{id:t.name,label:t.displayName}}function ze(){const t=q.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const r=W(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId"},t[1]=n):n=t[1];const{connectionId:s,org:l}=ce(n);let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/mcps/$connectionId"},t[2]=f):f=t[2];const g=le(f).tab||"settings",N=G(s),V=me(),E=de(N??void 0);let u;t[3]!==s?(u=[s],t[3]=s,t[4]=u):u=t[4];const{promptsMap:K}=fe(u);let y;t[5]!==s?(y=[s],t[5]=s,t[6]=y):y=t[6];const{resourcesMap:p}=he(y);let i;t[7]!==s||t[8]!==K?(i=K.get(s)??[],t[7]=s,t[8]=K,t[9]=i):i=t[9];const w=i;let a;t[10]!==s||t[11]!==p?(a=p.get(s)??[],t[10]=s,t[11]=p,t[12]=a):a=t[12];const h=a;let k;t[13]!==V.update||t[14]!==s?(k=async b=>{await V.update.mutateAsync({id:s,data:b})},t[13]=V.update,t[14]=s,t[15]=k):k=t[15];const d=k;if(!N){let b;return t[16]!==r||t[17]!==l?(b=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(F,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(xe,{variant:"outline",onClick:()=>r({to:"/$org/mcps",params:{org:l}}),children:"Back to connections"})})}),t[16]=r,t[17]=l,t[18]=b):b=t[18],b}let _;return t[19]!==V.update.isPending||t[20]!==E||t[21]!==N||t[22]!==s||t[23]!==d||t[24]!==l||t[25]!==w||t[26]!==g||t[27]!==h?(_=o.jsx(Ke,{org:l,connection:N,connectionId:s,requestedTabId:g,collections:E,onUpdate:d,isUpdating:V.update.isPending,prompts:w,resources:h}),t[19]=V.update.isPending,t[20]=E,t[21]=N,t[22]=s,t[23]=d,t[24]=l,t[25]=w,t[26]=g,t[27]=h,t[28]=_):_=t[28],_}function qe(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(X,{children:o.jsx(z.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(ze,{})})}),t[0]=e):e=t[0],e}function eo(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(qe,{}),t[0]=e):e=t[0],e}export{eo as default};
@@ -1 +0,0 @@
1
- import{B as o}from"./use-binding-iszUdbOZ.js";import{F as t}from"./index-Cqq-bHxo.js";const s="mcp.mesh",m=t(o,{target:"draft-7"});export{m as B,s as M};
@@ -1 +0,0 @@
1
- import{r as S,$ as ye,v as re,V as O,w as _,Q as Ae,c as z,j as t,f as Fe,d as st,b as ot,k as lt,aE as nt,x as it,y as rt,t as Ee}from"./index-Cqq-bHxo.js";import{I as Pe,u as Ge,E as at}from"./use-connection-Dp5C8sLQ.js";import{E as We}from"./error-boundary-D0j0sONw.js";import{C as He}from"./checkbox-5O25feEA.js";import{c as H,B as F,I as Me}from"./input-DJ7wqUvo.js";import{i as ct}from"./ArrowLeft-DPtymxR-.js";import{C as dt}from"./collection-search-Btyw61UY.js";import{s as mt}from"./Plus-pmQCIiux.js";import{i as ut}from"./X-CJAJyKbZ.js";import{P as ft}from"./pin-to-sidebar-button-Cp43fkli.js";import{T as ht}from"./tool-set-selector-ia7ItE5G.js";import{b as xt,a as pt,i as gt}from"./use-gateway-CSxRa3Bg.js";import{u as bt,a as jt}from"./use-connection-resources-DU3H93Az.js";import{u as yt}from"./use-gateway-system-prompt-BqldEOSK.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{B as Ze}from"./badge-iCoQ1dgD.js";import{a as vt,D as St,c as Nt,d as _t}from"./dialog-D76JDRim.js";import{F as be,a as wt,b as ve,d as Se,f as Ne,c as Ct}from"./form-B8Xq72cU.js";import{I as kt,R as It,a as Tt}from"./index-DdOgSb-W.js";import{R as $t}from"./resource-tabs-DlB9LUax.js";import{S as zt,a as Rt,b as At,c as Et,d as Ue}from"./select-B5Ou5lZC.js";import{S as Pt}from"./switch-17EJ9BZl.js";import{T as Mt}from"./textarea-BngAuS5G.js";import{a as Z,c as Q,b as Y,T as J}from"./project-context-provider-Gi9sytDH.js";import{i as Qe}from"./Check-B3jZM0OP.js";import{i as Dt}from"./Code01-BMUDEJ4t.js";import{a as Ot}from"./Copy01-DUDgHeaT.js";import{i as Ut}from"./FlipBackward-U1Nw6QGY.js";import{i as je}from"./InfoCircle-Bz1TUoGx.js";import{i as Re}from"./Loading01-C5e9Xing.js";import{a as Lt,V as Bt,b as Vt}from"./layout-CfefGJu5.js";import"./SearchMd-C8MbVAuA.js";import"./use-organization-settings-DVpbHPw1.js";import"./localstorage-keys-TnX0RxDe.js";import"./useQuery-UvQ_L9Pc.js";import"./ChevronDown-Bi1kqv-9.js";const Ye=({size:o=24,color:e="currentColor",...s})=>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},S.createElement("path",{d:"M4 7h11m0 0-4 4m4-4-4-4M4 17h16m0 0-4 4m4-4-4-4"}));Ye.displayName="ArrowsRight";const Je=({size:o=24,color:e="currentColor",...s})=>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},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"}));Je.displayName="Circle";const Ke=({size:o=24,color:e="currentColor",...s})=>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},S.createElement("path",{d:"M10 17.659V20a2 2 0 1 0 4 0v-2.341M12 2v1m-9 9H2m3.5-6.5-.6-.6m13.6.6.6-.6M22 12h-1m-3 0a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"}));Ke.displayName="Lightbulb02";const Xe=({size:o=24,color:e="currentColor",...s})=>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},S.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Xe.displayName="Save01";const et=({size:o=24,color:e="currentColor",...s})=>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},S.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));et.displayName="Share07";const De=ye(["inclusion","exclusion"]).describe("Tool selection mode: 'inclusion' = include selected (default), 'exclusion' = exclude selected"),Ft=re({connection_id:_().describe("Connection ID"),selected_tools:O(_()).nullable().describe("Selected tool names. With 'inclusion' mode: null = all tools included. With 'exclusion' mode: null = entire connection excluded"),selected_resources:O(_()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. With 'inclusion' mode: null = all resources included."),selected_prompts:O(_()).nullable().describe("Selected prompt names. With 'inclusion' mode: null = all prompts included. With 'exclusion' mode: null = entire connection excluded.")}),Gt=re({id:_().describe("Unique identifier for the gateway"),title:_().describe("Human-readable name for the gateway"),description:_().nullable().describe("Description of the gateway"),icon:_().nullable().optional().describe("Icon URL for the gateway"),created_at:_().describe("When the gateway was created"),updated_at:_().describe("When the gateway was last updated"),created_by:_().describe("User ID who created the gateway"),updated_by:_().optional().describe("User ID who last updated the gateway"),organization_id:_().describe("Organization ID this gateway belongs to"),tool_selection_mode:De.describe("Tool selection mode: 'inclusion' = include selected, 'exclusion' = exclude selected"),status:ye(["active","inactive"]).describe("Current status"),is_default:Ae().describe("Whether this is the Organization Agent for the organization"),connections:O(Ft).describe("Connections with their selected tools (behavior depends on tool_selection_mode)")});re({title:_().min(1).max(255).describe("Name for the gateway"),description:_().nullable().optional().describe("Optional description"),tool_selection_mode:De.optional().default("inclusion").describe("Tool selection mode (defaults to 'inclusion')"),icon:_().nullable().optional().describe("Optional icon URL"),status:ye(["active","inactive"]).optional().default("active").describe("Initial status"),is_default:Ae().optional().default(!1).describe("Whether this is the Organization Agent for the organization"),connections:O(re({connection_id:_().describe("Connection ID"),selected_tools:O(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:O(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:O(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).describe("Connections to include/exclude (can be empty for exclusion mode)")});re({title:_().min(1).max(255).optional().describe("New name"),description:_().nullable().optional().describe("New description (null to clear)"),tool_selection_mode:De.optional().describe("New tool selection mode"),icon:_().nullable().optional().describe("New icon URL (null to clear)"),status:ye(["active","inactive"]).optional().describe("New status"),is_default:Ae().optional().describe("Set as Organization Agent for the organization"),connections:O(re({connection_id:_().describe("Connection ID"),selected_tools:O(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:O(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:O(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).optional().describe("New connections (replaces existing)")});const Wt=S.memo(function(e){const s=z.c(20),{connection:l,isSelected:i,hasItemsEnabled:n,activeItemsCount:a,totalItemsCount:c,onSelect:m,onToggle:r}=e,d=i?"bg-accent/50":"hover:bg-muted/50";let u;s[0]!==d?(u=H("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),s[0]=d,s[1]=u):u=s[1];let f;s[2]!==l.icon||s[3]!==l.title?(f=t.jsx(Pe,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=f):f=s[4];let p;s[5]!==l.title?(p=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=p):p=s[6];let x;s[7]!==m||s[8]!==f||s[9]!==p?(x=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[f,p]}),s[7]=m,s[8]=f,s[9]=p,s[10]=x):x=s[10];let g;s[11]!==a||s[12]!==n||s[13]!==r||s[14]!==c?(g=c>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[a,"/",c]}),t.jsx(He,{checked:n,onCheckedChange:r,onClick:qt})]}),s[11]=a,s[12]=n,s[13]=r,s[14]=c,s[15]=g):g=s[15];let y;return s[16]!==u||s[17]!==x||s[18]!==g?(y=t.jsxs("div",{className:u,children:[x,g]}),s[16]=u,s[17]=x,s[18]=g,s[19]=y):y=s[19],y}),Ht=S.memo(function(e){const s=z.c(18),{connectionId:l,item:i,isSelected:n,onToggle:a}=e,c=`item-${l}-${i.id}`,m=n?"text-foreground":"text-muted-foreground";let r;s[0]!==m?(r=H("text-sm font-medium",m),s[0]=m,s[1]=r):r=s[1];let d;s[2]!==i.name||s[3]!==r?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:r,children:i.name})}),s[2]=i.name,s[3]=r,s[4]=d):d=s[4];let u;s[5]!==i.description?(u=i.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:i.description}),s[5]=i.description,s[6]=u):u=s[6];let f;s[7]!==d||s[8]!==u?(f=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),s[7]=d,s[8]=u,s[9]=f):f=s[9];const p=`item-${l}-${i.id}`;let x;s[10]!==n||s[11]!==a||s[12]!==p?(x=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(He,{id:p,checked:n,onCheckedChange:a,onClick:Zt})}),s[10]=n,s[11]=a,s[12]=p,s[13]=x):x=s[13];let g;return s[14]!==c||s[15]!==f||s[16]!==x?(g=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[f,x]}),s[14]=c,s[15]=f,s[16]=x,s[17]=g):g=s[17],g});function tt({itemSet:o,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:i,extraContent:n}){const[a,c]=S.useState(""),m=S.useDeferredValue(a),[r,d]=S.useState("all"),[u,f]=S.useState(!1),p=S.useRef(new Set(Object.keys(o))),x=Ge({searchTerm:m.trim()||void 0}),g=p.current,y=[...g.values()].map(h=>x.find(N=>N.id===h)).filter(h=>h!==void 0),j=x.filter(h=>!g.has(h.id)),v=[...y,...j],b=h=>{const N=o[h];return N!==void 0&&N.length>0},w=v.filter(h=>{if(r==="all")return!0;const N=b(h.id);return r==="selected"?N:r==="unselected"?!N:!0}),[I,k]=S.useState(v[0]?.id??null),C=I?v.find(h=>h.id===I)??null:null,P=C?s(C):[],E=(h,N)=>o[h]?.includes(N)??!1,U=(h,N)=>{const R=o[h]??[],$=R.includes(N),G={...o};if($){const W=R.filter(q=>q!==N);W.length===0?delete G[h]:G[h]=W}else G[h]=[...R,N];e(G)},B=h=>{const N=v.find(V=>V.id===h);if(!N)return;const R=s(N);if(R.length===0)return;const $=o[h]??[],G=R.map(V=>V.id),W=$.length>0&&G.every(V=>$.includes(V)),q={...o};W?delete q[h]:(q[h]=G,k(h)),e(q)},A=h=>{k(h),f(!0)},M=()=>{f(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:H("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[t.jsx(dt,{value:a,onChange:c,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>d("all"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>d("selected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>d("unselected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:w.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:a?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:w.map(h=>{const R=s(h).length,$=o[h.id]?.length??0;return t.jsx(Wt,{connection:h,isSelected:I===h.id,hasItemsEnabled:b(h.id),activeItemsCount:$,totalItemsCount:R,onSelect:()=>A(h.id),onToggle:()=>B(h.id)},h.id)})})})]}),t.jsx("div",{className:H("flex-1 flex-col",u?"flex":"hidden md:flex"),children:C?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(F,{variant:"ghost",size:"sm",onClick:M,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(ct,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Pe,{icon:C.icon,name:C.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:C.description})]})]})]}),n,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:P.map(h=>t.jsx(Ht,{connectionId:C.id,item:h,isSelected:E(C.id,h.id),onToggle:()=>U(C.id,h.id)},h.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",l]})})})]})}function qt(o){return o.stopPropagation()}function Zt(o){return o.stopPropagation()}function Qt(o){const e=z.c(6),{promptSet:s,onPromptSetChange:l,connectionPrompts:i}=o;let n;e[0]!==i?(n=m=>(i.get(m.id)??[]).map(Yt),e[0]=i,e[1]=n):n=e[1];const a=n;let c;return e[2]!==a||e[3]!==l||e[4]!==s?(c=t.jsx(tt,{itemSet:s,onItemSetChange:l,getItems:a,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=a,e[3]=l,e[4]=s,e[5]=c):c=e[5],c}function Yt(o){return{id:o.name,name:o.name,description:o.description}}function Jt(o){return o.includes("*")}function Kt(o){const e=z.c(27),{patterns:s,onAddPattern:l,onRemovePattern:i}=o,[n,a]=S.useState("");let c;e[0]!==n||e[1]!==l||e[2]!==s?(c=()=>{const f=n.trim();f&&!s.includes(f)&&(l(f),a(""))},e[0]=n,e[1]=l,e[2]=s,e[3]=c):c=e[3];const m=c;let r;e[4]!==m?(r=f=>{f.key==="Enter"&&(f.preventDefault(),m())},e[4]=m,e[5]=r):r=e[5];const d=r;let u;if(e[6]!==m||e[7]!==d||e[8]!==n||e[9]!==i||e[10]!==s){const f=s.filter(Jt);let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("code",{children:"*"}),e[12]=p):p=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",p," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=x):x=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=k=>a(k.target.value),e[14]=g):g=e[14];let y;e[15]!==d||e[16]!==n?(y=t.jsx(Me,{value:n,onChange:g,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=n,e[17]=y):y=e[17];let j;e[18]!==n?(j=n.trim(),e[18]=n,e[19]=j):j=e[19];const v=!j;let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(mt,{size:16}),e[20]=b):b=e[20];let w;e[21]!==m||e[22]!==v?(w=t.jsx(F,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:v,children:b}),e[21]=m,e[22]=v,e[23]=w):w=e[23];let I;e[24]!==w||e[25]!==y?(I=t.jsxs("div",{className:"flex gap-2",children:[y,w]}),e[24]=w,e[25]=y,e[26]=I):I=e[26],u=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[x,I,f.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(k=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:k}),t.jsx("button",{type:"button",onClick:()=>i(k),className:"text-muted-foreground hover:text-foreground",children:t.jsx(ut,{size:12})})]},k))})]}),e[6]=m,e[7]=d,e[8]=n,e[9]=i,e[10]=s,e[11]=u}else u=e[11];return u}function Xt(o){const e=z.c(23),{resourceSet:s,onResourceSetChange:l,connectionResources:i}=o,[n]=S.useState(null);let a;e[0]!==i?(a=b=>(i.get(b.id)??[]).map(es),e[0]=i,e[1]=a):a=e[1];const c=a;let m;e[2]!==l||e[3]!==s?(m=(b,w)=>{const I=s[b]??[];I.includes(w)||l({...s,[b]:[...I,w]})},e[2]=l,e[3]=s,e[4]=m):m=e[4];const r=m;let d;e[5]!==l||e[6]!==s?(d=(b,w)=>{const k=(s[b]??[]).filter(C=>C!==w);if(k.length===0){const C={...s};delete C[b],l(C)}else l({...s,[b]:k})},e[5]=l,e[6]=s,e[7]=d):d=e[7];const u=d;let f;e[8]!==l?(f=b=>{l(b)},e[8]=l,e[9]=f):f=e[9];const p=f;let x;e[10]!==s||e[11]!==n?(x=n?s[n]??[]:[],e[10]=s,e[11]=n,e[12]=x):x=e[12];const g=x;let y;e[13]!==r||e[14]!==u||e[15]!==n||e[16]!==g?(y=n?t.jsx(Kt,{patterns:g,onAddPattern:b=>r(n,b),onRemovePattern:b=>u(n,b)}):null,e[13]=r,e[14]=u,e[15]=n,e[16]=g,e[17]=y):y=e[17];const j=y;let v;return e[18]!==j||e[19]!==c||e[20]!==p||e[21]!==s?(v=t.jsx("div",{className:"h-full",children:t.jsx(tt,{itemSet:s,onItemSetChange:p,getItems:c,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:j})}),e[18]=j,e[19]=c,e[20]=p,e[21]=s,e[22]=v):v=e[22],v}function es(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function ts(o){const e=z.c(8);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let i;e[3]!==s?(i=H("grid gap-3",s),e[3]=s,e[4]=i):i=e[4];let n;return e[5]!==l||e[6]!==i?(n=t.jsx(It,{"data-slot":"radio-group",className:i,...l}),e[5]=l,e[6]=i,e[7]=n):n=e[7],n}function ze(o){const e=z.c(9);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let i;e[3]!==s?(i=H("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]=i):i=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Tt,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Je,{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 a;return e[6]!==l||e[7]!==i?(a=t.jsx(kt,{"data-slot":"radio-group-item",className:i,...l,children:n}),e[6]=l,e[7]=i,e[8]=a):a=e[8],a}function ss(o){const s=new TextEncoder().encode(o),l=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(l)}const os=Gt.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0}).extend({title:_().min(1,"Name is required").max(255)});function Le(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const i=e.get(l.connection_id)??[];i.length>0&&(s[l.connection_id]=i)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Be(o){const e={};for(const s of o.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function Ve(o){const e={};for(const s of o.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function ls(o,e,s,l){const i=new Set([...Object.keys(o),...Object.keys(e),...Object.keys(s)]);return Array.from(i).map(n=>{const a=o[n]??[],c=l.get(n)??[],m=c.length>0&&c.every(r=>a.includes(r));return{connection_id:n,selected_tools:a.length===0||m?null:a,selected_resources:e[n]??null,selected_prompts:s[n]??null}})}function ns(o){const e=z.c(10),{gatewayUrl:s}=o,[l,i]=S.useState(!1);let n;e[0]!==s?(n=async()=>{await navigator.clipboard.writeText(s),i(!0),Ee.success("Agent URL copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[0]=s,e[1]=n):n=e[1];const a=n;let c;e[2]!==l?(c=l?t.jsx(Qe,{size:20,className:"text-green-600"}):t.jsx(Ot,{size:20}),e[2]=l,e[3]=c):c=e[3];const m=l?"Copied!":"Copy URL";let r;e[4]!==m?(r=t.jsx("span",{className:"text-xs font-medium",children:m}),e[4]=m,e[5]=r):r=e[5];let d;return e[6]!==a||e[7]!==c||e[8]!==r?(d=t.jsxs(F,{type:"button",variant:"outline",onClick:a,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,r]}),e[6]=a,e[7]=c,e[8]=r,e[9]=d):d=e[9],d}function is(o){const e=z.c(7),{gatewayUrl:s,serverName:l}=o;let i;e[0]!==s||e[1]!==l?(i=()=>{const r=qe(l),u=ss(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),f=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(r)}&config=${encodeURIComponent(u)}`;window.open(f,"_blank"),Ee.success("Opening Cursor...")},e[0]=s,e[1]=l,e[2]=i):i=e[2];const n=i;let a,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=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%)"}}),c=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=a,e[4]=c):(a=e[3],c=e[4]);let m;return e[5]!==n?(m=t.jsxs(F,{type:"button",variant:"outline",onClick:n,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,c]}),e[5]=n,e[6]=m):m=e[6],m}function rs(o){const e=z.c(11),{gatewayUrl:s,serverName:l}=o,[i,n]=S.useState(!1);let a;e[0]!==s||e[1]!==l?(a=async()=>{const f=qe(l),x=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),g=`claude mcp add "${f}" --config '${x.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(g),n(!0),Ee.success("Claude Code command copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=s,e[1]=l,e[2]=a):a=e[2];const c=a;let m;e[3]!==i?(m=i?t.jsx(Qe,{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]=i,e[4]=m):m=e[4];const r=i?"Copied!":"Install on Claude";let d;e[5]!==r?(d=t.jsx("span",{className:"text-xs font-medium",children:r}),e[5]=r,e[6]=d):d=e[6];let u;return e[7]!==c||e[8]!==m||e[9]!==d?(u=t.jsxs(F,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,d]}),e[7]=c,e[8]=m,e[9]=d,e[10]=u):u=e[10],u}function as(o){const e=z.c(40),{open:s,onOpenChange:l,gateway:i}=o,[n,a]=S.useState("code_execution");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=$=>{($==="passthrough"||$==="smart_tool_selection"||$==="code_execution")&&a($)},e[0]=c):c=e[0];const m=c;let r;e[1]!==i.id||e[2]!==n?(r=new URL(`/mcp/gateway/${i.id}`,window.location.origin),r.searchParams.set("mode",n),e[1]=i.id,e[2]=n,e[3]=r):r=e[3];let d;e[4]!==i.id||e[5]!==i.title?(d=i.title||`agent-${i.id.slice(0,8)}`,e[4]=i.id,e[5]=i.title,e[6]=d):d=e[6];const u=d;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(vt,{children:t.jsx(St,{children:"Share Agent"})}),e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=p):p=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(Ye,{className:"size-5 text-muted-foreground"})}),e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=g):g=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Y,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[11]=y):y=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:[g,t.jsx(Z,{children:t.jsxs(Q,{children:[y,t.jsx(J,{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(ze,{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(Ke,{className:"size-5 text-muted-foreground"})}),e[13]=v):v=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=b):b=e[14];let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Y,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[15]=w):w=e[15];let I;e[16]===Symbol.for("react.memo_cache_sentinel")?(I=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:[b,t.jsx(Z,{children:t.jsxs(Q,{children:[w,t.jsx(J,{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(ze,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=I):I=e[16];let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Dt,{className:"size-5 text-muted-foreground"})}),e[17]=k):k=e[17];let C;e[18]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=C):C=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Y,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[19]=P):P=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=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:[k,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[C,t.jsx(Z,{children:t.jsxs(Q,{children:[P,t.jsx(J,{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(ze,{id:"mode-code",value:"code_execution"}),t.jsx(Ze,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=E):E=e[20];let U;e[21]!==n?(U=t.jsxs("div",{className:"flex flex-col gap-3",children:[p,t.jsxs(ts,{value:n,onValueChange:m,className:"flex flex-col gap-4.5",children:[j,I,E]})]}),e[21]=n,e[22]=U):U=e[22];let B;e[23]!==r.href?(B=t.jsx(ns,{gatewayUrl:r.href}),e[23]=r.href,e[24]=B):B=e[24];let A,M;e[25]!==r.href||e[26]!==u?(A=t.jsx(is,{gatewayUrl:r.href,serverName:u}),M=t.jsx(rs,{gatewayUrl:r.href,serverName:u}),e[25]=r.href,e[26]=u,e[27]=A,e[28]=M):(A=e[27],M=e[28]);let h;e[29]!==B||e[30]!==A||e[31]!==M?(h=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[B,A,M]})}),e[29]=B,e[30]=A,e[31]=M,e[32]=h):h=e[32];let N;e[33]!==U||e[34]!==h?(N=t.jsxs(Nt,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[f,t.jsxs("div",{className:"flex flex-col gap-6",children:[U,h]})]}),e[33]=U,e[34]=h,e[35]=N):N=e[35];let R;return e[36]!==l||e[37]!==s||e[38]!==N?(R=t.jsx(_t,{open:s,onOpenChange:l,children:N}),e[36]=l,e[37]=s,e[38]=N,e[39]=R):R=e[39],R}function cs(o){const e=z.c(31),{form:s,icon:l,gatewayId:i}=o,[n,a]=yt(i);let c;e[0]!==s?(c=s.watch("title")||"Agent",e[0]=s,e[1]=c):c=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(gt,{}),e[2]=m):m=e[2];let r;e[3]!==l||e[4]!==c?(r=t.jsx(Pe,{icon:l,name:c,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=l,e[4]=c,e[5]=r):r=e[5];let d;e[6]!==s.control?(d=t.jsx(be,{control:s.control,name:"status",render:fs}),e[6]=s.control,e[7]=d):d=e[7];let u;e[8]!==r||e[9]!==d?(u=t.jsxs("div",{className:"flex items-start justify-between",children:[r,d]}),e[8]=r,e[9]=d,e[10]=u):u=e[10];let f;e[11]!==s.control?(f=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(be,{control:s.control,name:"title",render:us}),t.jsx(be,{control:s.control,name:"description",render:ms})]}),e[11]=s.control,e[12]=f):f=e[12];let p;e[13]!==u||e[14]!==f?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[u,f]}),e[13]=u,e[14]=f,e[15]=p):p=e[15];let x;e[16]!==s.control?(x=t.jsx("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:t.jsx(be,{control:s.control,name:"tool_selection_mode",render:ds})}),e[16]=s.control,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"System Prompt"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored locally for now"})]}),e[18]=g):g=e[18];let y;e[19]!==a?(y=w=>a(w.target.value),e[19]=a,e[20]=y):y=e[20];let j;e[21]!==n||e[22]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-3 p-5",children:[g,t.jsx(Mt,{value:n,onChange:y,placeholder:"Enter system prompt instructions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})]}),e[21]=n,e[22]=y,e[23]=j):j=e[23];let v;e[24]!==j||e[25]!==p||e[26]!==x?(v=t.jsxs("div",{className:"flex flex-col",children:[p,x,j]}),e[24]=j,e[25]=p,e[26]=x,e[27]=v):v=e[27];let b;return e[28]!==s||e[29]!==v?(b=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx(wt,{...s,children:v})}),e[28]=s,e[29]=v,e[30]=b):b=e[30],b}function ds(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Ct,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Z,{children:t.jsxs(Q,{children:[t.jsx(Y,{asChild:!0,children:t.jsx(F,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(je,{size:14,className:"text-muted-foreground"})})}),t.jsx(J,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs(zt,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Se,{children:t.jsx(Rt,{className:"w-[180px]",children:t.jsx(At,{})})}),t.jsxs(Et,{children:[t.jsx(Ue,{value:"inclusion",children:"Include Selected"}),t.jsx(Ue,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Ne,{})]})}function ms(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Me,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Ne,{})]})}function us(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Me,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Agent Name"})}),t.jsx(Ne,{})]})}function fs(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ze,{variant:e.value==="active"?"success":"outline",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Se,{children:t.jsx(Pt,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Ne,{})]})}function hs(o){const e=z.c(81),{gateway:s,gatewayId:l,requestedTabId:i}=o,a=lt().location.href,c=nt();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/gateways/$gatewayId"},e[0]=m):m=e[0];const r=Fe(m),d=pt();let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u={},e[1]=u):u=e[1];const f=Ge(u);let p;e[2]!==f?(p=f.map(ps),e[2]=f,e[3]=p):p=e[3];const x=p,{promptsMap:g}=bt(x),{resourcesMap:y}=jt(x);let j;if(e[4]!==f){j=new Map;for(const T of f)T.tools&&T.tools.length>0&&j.set(T.id,T.tools.map(xs));e[4]=f,e[5]=j}else j=e[5];let v;e[6]!==j||e[7]!==s?(v=()=>Le(s,j),e[6]=j,e[7]=s,e[8]=v):v=e[8];const[b,w]=S.useState(v);let I;e[9]!==s?(I=()=>Be(s),e[9]=s,e[10]=I):I=e[10];const[k,C]=S.useState(I);let P;e[11]!==s?(P=()=>Ve(s),e[11]=s,e[12]=P):P=e[12];const[E,U]=S.useState(P),[B,A]=S.useState(!1),[M,h]=S.useState(!1);let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=T=>{w(T),A(!0)},e[13]=N):N=e[13];const R=N;let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=T=>{C(T),A(!0)},e[14]=$):$=e[14];const G=$;let W;e[15]===Symbol.for("react.memo_cache_sentinel")?(W=T=>{U(T),A(!0)},e[15]=W):W=e[15];const q=W;let V;e[16]===Symbol.for("react.memo_cache_sentinel")?(V=it(os),e[16]=V):V=e[16];const _e=s.tool_selection_mode??"inclusion";let ce;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==_e?(ce={resolver:V,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:_e}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=_e,e[21]=ce):ce=e[21];const L=rt(ce),we=L.formState.isDirty||B;let de;e[22]!==d.update||e[23]!==j||e[24]!==L||e[25]!==l||e[26]!==E||e[27]!==k||e[28]!==b?(de=async()=>{const T=L.getValues(),$e=ls(b,k,E,j);await d.update.mutateAsync({id:l,data:{title:T.title,description:T.description,status:T.status,tool_selection_mode:T.tool_selection_mode,connections:$e}}),L.reset(T),A(!1)},e[22]=d.update,e[23]=j,e[24]=L,e[25]=l,e[26]=E,e[27]=k,e[28]=b,e[29]=de):de=e[29];const Ce=de;let me;e[30]!==j||e[31]!==L||e[32]!==s?(me=()=>{L.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion"}),w(Le(s,j)),C(Be(s)),U(Ve(s)),A(!1)},e[30]=j,e[31]=L,e[32]=s,e[33]=me):me=e[33];const ke=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[34]=ue):ue=e[34];const Oe=ue,D=Oe.some(T=>T.id===i)?i:"settings";let fe;e[35]!==r?(fe=T=>{r({search:$e=>({...$e,tab:T}),replace:!0})},e[35]=r,e[36]=fe):fe=e[36];const Ie=fe,ae=d.update.isPending;let K;e[37]!==c.history?(K=()=>c.history.back(),e[37]=c.history,e[38]=K):K=e[38];let X;e[39]!==D||e[40]!==Ie?(X=t.jsx(Lt,{children:t.jsx($t,{tabs:Oe,activeTab:D,onTabChange:Ie})}),e[39]=D,e[40]=Ie,e[41]=X):X=e[41];let ee;e[42]!==ke||e[43]!==Ce||e[44]!==we||e[45]!==ae?(ee=we&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{children:t.jsxs(Q,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(F,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ae,onClick:ke,"aria-label":"Cancel",children:t.jsx(Ut,{size:14})})})}),t.jsx(J,{side:"bottom",children:"Cancel"})]})}),t.jsx(Z,{children:t.jsxs(Q,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(F,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ae,onClick:Ce,"aria-label":"Save",children:ae?t.jsx(Re,{size:14,className:"animate-spin"}):t.jsx(Xe,{size:14})})})}),t.jsx(J,{side:"bottom",children:"Save"})]})})]}),e[42]=ke,e[43]=Ce,e[44]=we,e[45]=ae,e[46]=ee):ee=e[46];let he;e[47]===Symbol.for("react.memo_cache_sentinel")?(he=()=>h(!0),e[47]=he):he=e[47];let xe;e[48]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(Z,{children:t.jsxs(Q,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(F,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:he,"aria-label":"Share",children:t.jsx(et,{size:14})})})}),t.jsx(J,{side:"bottom",children:"Share"})]})}),e[48]=xe):xe=e[48];const Te=s.icon??"cpu_chip";let te;e[49]!==s.title||e[50]!==Te||e[51]!==a?(te=t.jsx(ft,{title:s.title,url:a,icon:Te}),e[49]=s.title,e[50]=Te,e[51]=a,e[52]=te):te=e[52];let se;e[53]!==ee||e[54]!==te?(se=t.jsxs(Bt,{children:[ee,xe,te]}),e[53]=ee,e[54]=te,e[55]=se):se=e[55];let pe;e[56]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),e[56]=pe):pe=e[56];let oe;e[57]!==D||e[58]!==g||e[59]!==y||e[60]!==L||e[61]!==s.icon||e[62]!==l||e[63]!==E||e[64]!==k||e[65]!==b?(oe=D==="settings"?t.jsx(cs,{form:L,icon:s.icon,gatewayId:l}):D==="tools"?t.jsx(ht,{toolSet:b,onToolSetChange:R}):D==="resources"?t.jsx(Xt,{resourceSet:k,onResourceSetChange:G,connectionResources:y}):D==="prompts"?t.jsx(Qt,{promptSet:E,onPromptSetChange:q,connectionPrompts:g}):null,e[57]=D,e[58]=g,e[59]=y,e[60]=L,e[61]=s.icon,e[62]=l,e[63]=E,e[64]=k,e[65]=b,e[66]=oe):oe=e[66];let le;e[67]!==oe?(le=t.jsx(S.Suspense,{fallback:pe,children:oe}),e[67]=oe,e[68]=le):le=e[68];let ne;e[69]!==D||e[70]!==le?(ne=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(We,{children:le},D)})})}),e[69]=D,e[70]=le,e[71]=ne):ne=e[71];let ie;e[72]!==s||e[73]!==M?(ie=t.jsx(as,{open:M,onOpenChange:h,gateway:s}),e[72]=s,e[73]=M,e[74]=ie):ie=e[74];let ge;return e[75]!==K||e[76]!==X||e[77]!==se||e[78]!==ne||e[79]!==ie?(ge=t.jsxs(Vt,{onBack:K,children:[X,se,ne,ie]}),e[75]=K,e[76]=X,e[77]=se,e[78]=ne,e[79]=ie,e[80]=ge):ge=e[80],ge}function xs(o){return o.name}function ps(o){return o.id}function gs(){const o=z.c(10);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=Fe(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},o[1]=l):l=o[1];const{gatewayId:i,org:n}=st(l);let a;o[2]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/gateways/$gatewayId"},o[2]=a):a=o[2];const m=ot(a).tab||"settings",r=xt(i);if(!r){let u;return o[3]!==s||o[4]!==n?(u=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(at,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(F,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:n}}),children:"Back to agents"})})}),o[3]=s,o[4]=n,o[5]=u):u=o[5],u}let d;return o[6]!==r||o[7]!==i||o[8]!==m?(d=t.jsx(hs,{gateway:r,gatewayId:i,requestedTabId:m}),o[6]=r,o[7]=i,o[8]=m,o[9]=d):d=o[9],d}function bs(){const o=z.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(We,{children:t.jsx(S.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(gs,{})})}),o[0]=e):e=o[0],e}function so(){const o=z.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(bs,{}),o[0]=e):e=o[0],e}export{so as default};
@@ -1 +0,0 @@
1
- import{c as te,j as t,r as se,f as ne,t as re}from"./index-Cqq-bHxo.js";import{C as ie}from"./collection-header-0lxlEg2I.js";import{C as ae}from"./collection-page-s3MvuRc-.js";import{C as le}from"./collection-search-Btyw61UY.js";import{C as ce}from"./collection-table-wrapper-gfEw2g5n.js";import{C as de}from"./connection-card-DfdBq4FD.js";import{u as me,E as q,I as ue}from"./use-connection-Dp5C8sLQ.js";import{E as ge}from"./error-boundary-D0j0sONw.js";import{a as pe,u as he,i as j}from"./use-gateway-CSxRa3Bg.js";import{u as fe,s as Q}from"./use-list-state-FSUrDOEN.js";import{u as xe}from"./project-context-provider-Gi9sytDH.js";import{c as je,b as we,d as ye,A as Ce,e as Ne,g as De,a as Se,f as ve}from"./alert-dialog-BnwjYq4n.js";import{B as oe}from"./badge-iCoQ1dgD.js";import{B as J}from"./input-DJ7wqUvo.js";import{b as U,D as X,a as Y,c as G}from"./dropdown-menu-BjkFG8SE.js";import{i as Z}from"./DotsVertical-DikAa5AR.js";import{i as be}from"./Loading01-C5e9Xing.js";import{s as ee}from"./Trash01-DqQrX192.js";import"./collection-display-button-D1R0tnBY.js";import"./Grid01-DI-Q2VEp.js";import"./Check-B3jZM0OP.js";import"./view-mode-toggle-ljeOi0U5.js";import"./SearchMd-C8MbVAuA.js";import"./card-CjWJyjfT.js";import"./use-mobile-D6_iVdHq.js";function ke(e,n){switch(n.type){case"delete":return{mode:"deleting",gateway:n.gateway};case"close":return{mode:"idle"}}}function Ie(){const e=te.c(68),{org:n}=xe(),r=ne();let w;e[0]!==n.slug?(w={namespace:n.slug,resource:"gateways"},e[0]=n.slug,e[1]=w):w=e[1];const s=fe(w),i=pe(),x=he(s);let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y={},e[2]=y):y=e[2];const R=me(y);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[a,N]=se.useReducer(ke,C);let D;e[4]!==i.create||e[5]!==R.length||e[6]!==r||e[7]!==n.slug?(D=async()=>{if(R.length===0){re.error("Create at least one Connection first");return}const o=await i.create.mutateAsync({title:"New Agent",description:"Agents let you securely expose integrated tools to the outside world.",status:"active",tool_selection_mode:"inclusion",connections:[]});r({to:"/$org/gateways/$gatewayId",params:{org:n.slug,gatewayId:o.id}})},e[4]=i.create,e[5]=R.length,e[6]=r,e[7]=n.slug,e[8]=D):D=e[8];const T=D;let S;e[9]!==i.delete||e[10]!==a.gateway||e[11]!==a.mode?(S=async()=>{if(a.mode!=="deleting")return;const o=a.gateway.id;N({type:"close"});try{await i.delete.mutateAsync(o)}catch{}},e[9]=i.delete,e[10]=a.gateway,e[11]=a.mode,e[12]=S):S=e[12];const O=S;let v,b,k,I,_,A;e[13]===Symbol.for("react.memo_cache_sentinel")?(b={id:"icon",header:"",render:Ge,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:Be,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},I={id:"description",header:"Description",render:Ke,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},_={id:"mode",header:"Mode",accessor:Ee,cellClassName:"w-[100px]"},A={id:"connections",header:"Connections",render:Pe,cellClassName:"w-24 shrink-0"},v={id:"status",header:"Status",render:ze,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=v,e[14]=b,e[15]=k,e[16]=I,e[17]=_,e[18]=A):(v=e[13],b=e[14],k=e[15],I=e[16],_=e[17],A=e[18]);let $;e[19]!==r||e[20]!==n.slug?($=[b,k,I,_,A,v,{id:"actions",header:"",render:o=>t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Me,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:$e,children:[t.jsxs(G,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:n.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(G,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=r,e[20]=n.slug,e[21]=$):$=e[21];const V=$,H=i.create.isPending?"Creating...":"Create Agent";let M;e[22]!==i.create.isPending||e[23]!==T||e[24]!==H?(M=t.jsx(J,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i.create.isPending,children:H}),e[22]=i.create.isPending,e[23]=T,e[24]=H,e[25]=M):M=e[25];const L=M,F=a.mode==="deleting";let z;e[26]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[26]=z):z=e[26];let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(je,{children:"Delete Agent?"}),e[27]=P):P=e[27];const W=a.mode==="deleting"&&a.gateway.title;let c;e[28]!==W?(c=t.jsxs(we,{children:[P,t.jsxs(ye,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=c):c=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[30]=E):E=e[30];let d;e[31]!==O?(d=t.jsxs(Ne,{children:[E,t.jsx(De,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=O,e[32]=d):d=e[32];let m;e[33]!==c||e[34]!==d?(m=t.jsxs(Se,{children:[c,d]}),e[33]=c,e[34]=d,e[35]=m):m=e[35];let u;e[36]!==F||e[37]!==m?(u=t.jsx(ve,{open:F,onOpenChange:z,children:m}),e[36]=F,e[37]=m,e[38]=u):u=e[38];let K;e[39]===Symbol.for("react.memo_cache_sentinel")?(K=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=K):K=e[39];let g;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(g=t.jsx(ie,{title:"Agents",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:K,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=g):g=e[46];let p;e[47]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=p):p=e[48];let h;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==p?(h=t.jsx(le,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:p}),e[49]=s.search,e[50]=s.setSearch,e[51]=p,e[52]=h):h=e[52];let f;e[53]!==V||e[54]!==x||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==r||e[61]!==n.slug?(f=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(q,{image:t.jsx(j,{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:x.map(o=>t.jsx(de,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(j,{}),onClick:()=>r({to:"/$org/gateways/$gatewayId",params:{org:n.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(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ae,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:_e,children:[t.jsxs(G,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:n.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(G,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ce,{columns:V,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>r({to:"/$org/gateways/$gatewayId",params:{org:n.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})}),e[53]=V,e[54]=x,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=r,e[61]=n.slug,e[62]=f):f=e[62];let B;return e[63]!==u||e[64]!==g||e[65]!==h||e[66]!==f?(B=t.jsxs(ae,{children:[u,g,h,f]}),e[63]=u,e[64]=g,e[65]=h,e[66]=f,e[67]=B):B=e[67],B}function _e(e){return e.stopPropagation()}function Ae(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function Me(e){return e.stopPropagation()}function ze(e){return t.jsx(oe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Pe(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Ee(e){return t.jsx(oe,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ke(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Be(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ge(e){return t.jsx(ue,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(j,{size:16})})}function dt(){const e=te.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ge,{children:t.jsx(se.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ie,{})})}),e[0]=n):n=e[0],n}export{dt as default};