@decocms/mesh 1.0.0-alpha.15 → 1.0.0-alpha.17

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 (82) hide show
  1. package/dist/client/assets/{alert-dialog-Hgs2tcw0.js → alert-dialog-CfsdbV8c.js} +1 -1
  2. package/dist/client/assets/app-name-gTETL9So.js +1 -0
  3. package/dist/client/assets/{auth-Dfo88onv.js → auth-CsOevbKn.js} +1 -1
  4. package/dist/client/assets/{auth-catchall-pzDMkYZ_.js → auth-catchall-BMURI6L3.js} +1 -1
  5. package/dist/client/assets/{avatar-Dw1KHXJf.js → avatar-Bn65M9_M.js} +1 -1
  6. package/dist/client/assets/{badge-C29ypR-2.js → badge-BTXir9uJ.js} +1 -1
  7. package/dist/client/assets/{button-Cv1rgJOF.js → button-B2BIOawN.js} +1 -1
  8. package/dist/client/assets/{card-BggFBtGd.js → card-B24qMCfe.js} +1 -1
  9. package/dist/client/assets/{checkbox-Ay9B68Cb.js → checkbox-CeN8Ys7n.js} +1 -1
  10. package/dist/client/assets/{circle-alert-C3-3ZyHM.js → circle-alert-bANxza_Q.js} +1 -1
  11. package/dist/client/assets/{collection-detail-BihTkJuQ.js → collection-detail-Ca7tFfcv.js} +1 -1
  12. package/dist/client/assets/{collection-display-button-grM851Xd.js → collection-display-button-DEnVk52I.js} +1 -1
  13. package/dist/client/assets/{collection-header-DsMf-88h.js → collection-header-DZSYSGOn.js} +1 -1
  14. package/dist/client/assets/{collection-page-C6Lt30BH.js → collection-page-Cfda-vNl.js} +1 -1
  15. package/dist/client/assets/{collection-search-CXcLRFBk.js → collection-search-DxeL6Ufp.js} +1 -1
  16. package/dist/client/assets/{collection-table-wrapper-DIAaiM6K.js → collection-table-wrapper-D6eaPdiL.js} +1 -1
  17. package/dist/client/assets/{connection-card-BSv7-QCW.js → connection-card-DBDfkDQH.js} +1 -1
  18. package/dist/client/assets/{connection-detail-B1R8nv6U.js → connection-detail-DBMh3Kzg.js} +1 -1
  19. package/dist/client/assets/{connections-hz-ahAKO.js → connections-CdlDfWny.js} +1 -1
  20. package/dist/client/assets/{create-organization-dialog-Bvkdjwsj.js → create-organization-dialog-DZM9X3ft.js} +1 -1
  21. package/dist/client/assets/{dialog-rRH3MQkl.js → dialog-BjdII1I-.js} +1 -1
  22. package/dist/client/assets/{dropdown-menu-dUgjswGX.js → dropdown-menu-BT_X0ZTy.js} +1 -1
  23. package/dist/client/assets/{empty-state-CCq1QaCi.js → empty-state-CAhQEGD4.js} +1 -1
  24. package/dist/client/assets/{error-boundary-COxhsLlB.js → error-boundary-CKkz6PFv.js} +1 -1
  25. package/dist/client/assets/{extract-connection-data-DyKjnzFA.js → extract-connection-data-BuUce3IM.js} +1 -1
  26. package/dist/client/assets/{form-xpLXXjk9.js → form-DYn0g3Xk.js} +1 -1
  27. package/dist/client/assets/gateway-detail-CP1wU_gQ.js +1 -0
  28. package/dist/client/assets/{gateways-BEpD9ssC.js → gateways-CC9LsUii.js} +1 -1
  29. package/dist/client/assets/{home-BP87nVNG.js → home-owX9B5A1.js} +1 -1
  30. package/dist/client/assets/{icon-KZI-tyY2.js → icon-B4prTi7A.js} +1 -1
  31. package/dist/client/assets/{index-C3w_QZu6.js → index-BSJAakWI.js} +1 -1
  32. package/dist/client/assets/{index-B6JW-QRO.js → index-CJJcr20V.js} +1 -1
  33. package/dist/client/assets/{index-kuMaGV9U.js → index-DRfRtuak.js} +2 -2
  34. package/dist/client/assets/{index-3kbMatbv.js → index-Dwwz-rb1.js} +1 -1
  35. package/dist/client/assets/{input-C0U94pom.js → input-0KxSy7p5.js} +1 -1
  36. package/dist/client/assets/{integration-icon-Dv-2D552.js → integration-icon-BOIQGbTx.js} +1 -1
  37. package/dist/client/assets/{layout-B4csW0zk.js → layout-erRxoybz.js} +1 -1
  38. package/dist/client/assets/{lazy-highlighter-BeM-KnKF.js → lazy-highlighter-DNEByQ_q.js} +1 -1
  39. package/dist/client/assets/{localstorage-keys-BY-fTuiw.js → localstorage-keys-C-_5_veF.js} +1 -1
  40. package/dist/client/assets/{login-Dl_POp8A.js → login-eNmXdIlx.js} +1 -1
  41. package/dist/client/assets/{mcp-oauth-C8lkjJJ-.js → mcp-oauth-D4DQrKdX.js} +1 -1
  42. package/dist/client/assets/{members-sRtGjt4B.js → members-CqBq9Tqq.js} +1 -1
  43. package/dist/client/assets/{monitoring-wqV_ck_J.js → monitoring-RZzI7HX3.js} +1 -1
  44. package/dist/client/assets/{monitoring-stats-row-Bmw8lKAo.js → monitoring-stats-row-CDJOdEFs.js} +1 -1
  45. package/dist/client/assets/{oauth-callback-D4bjzxVG.js → oauth-callback-B2eu3eq6.js} +1 -1
  46. package/dist/client/assets/{page-Dm4c28Rt.js → page-D6nvIccR.js} +1 -1
  47. package/dist/client/assets/{popover-BLX5hifQ.js → popover-CXXilSJS.js} +1 -1
  48. package/dist/client/assets/{prism-a2E9dRRh.js → prism-CqKQ-uUB.js} +1 -1
  49. package/dist/client/assets/{resource-tabs-C2-m37Rp.js → resource-tabs-BPbCYInc.js} +1 -1
  50. package/dist/client/assets/{schema-DLIeWQJ0.js → schema-DI-mC0WE.js} +1 -1
  51. package/dist/client/assets/{select-BFyzpZOm.js → select-xvA0wpax.js} +1 -1
  52. package/dist/client/assets/{settings-KJAP4FWc.js → settings-N1KHLSeV.js} +1 -1
  53. package/dist/client/assets/{shell-layout-DqWy6R9v.js → shell-layout-DBeyfhU9.js} +3 -3
  54. package/dist/client/assets/slugify-CEUa2lfQ.js +1 -0
  55. package/dist/client/assets/{spinner-CYHX4tj_.js → spinner-DknaoKT9.js} +1 -1
  56. package/dist/client/assets/store-app-detail-BY8fKDCz.js +1 -0
  57. package/dist/client/assets/store-xSGmsPQe.js +1 -0
  58. package/dist/client/assets/{switch-B0GAK0hk.js → switch-C5HcbsY1.js} +1 -1
  59. package/dist/client/assets/{textarea-7TwZjOJN.js → textarea-DG6Oh4Et.js} +1 -1
  60. package/dist/client/assets/{tool-set-selector-BxJYXzYX.js → tool-set-selector-1Cg6gjRw.js} +1 -1
  61. package/dist/client/assets/{tooltip-CyTpNpEt.js → tooltip-7pBEiiqV.js} +1 -1
  62. package/dist/client/assets/{upload-CedwcKCT.js → upload-6ljQ7Xvj.js} +1 -1
  63. package/dist/client/assets/{use-binding-Dlf98XSv.js → use-binding-QY8lUZ4l.js} +1 -1
  64. package/dist/client/assets/{use-gateway-C6ADI4VP.js → use-gateway-D3gYh1VN.js} +1 -1
  65. package/dist/client/assets/{use-list-state-Cu8fsSjR.js → use-list-state-C1uU-z8t.js} +1 -1
  66. package/dist/client/assets/{use-mcp-Z1amXXTK.js → use-mcp-BLvzQK7V.js} +1 -1
  67. package/dist/client/assets/{use-members-dDzJ30ii.js → use-members-BGTW4lDt.js} +1 -1
  68. package/dist/client/assets/{use-mobile-Ct-F04sM.js → use-mobile-qq-CGCwC.js} +1 -1
  69. package/dist/client/assets/{use-organization-settings-D7E3skEu.js → use-organization-settings-BppZIKRZ.js} +1 -1
  70. package/dist/client/assets/{use-tool-call-DSlbFKjt.js → use-tool-call-Ct8SM41M.js} +1 -1
  71. package/dist/client/assets/useQuery-Dt7bC647.js +1 -0
  72. package/dist/client/assets/utils-DFmxvpl9.js +1 -0
  73. package/dist/client/index.html +1 -1
  74. package/dist/server/cli.js +151 -151
  75. package/dist/server/server.js +147 -147
  76. package/package.json +1 -1
  77. package/dist/client/assets/app-name-DQPOjnhR.js +0 -1
  78. package/dist/client/assets/gateway-detail-DIqZF9Yz.js +0 -1
  79. package/dist/client/assets/store-DoIp_x0L.js +0 -1
  80. package/dist/client/assets/store-app-detail-CkhxmJHm.js +0 -1
  81. package/dist/client/assets/useQuery-DJ7WNdWe.js +0 -1
  82. package/dist/client/assets/utils-dJ2GyoL3.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "1.0.0-alpha.15",
3
+ "version": "1.0.0-alpha.17",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "license": "MIT",
6
6
  "author": "Deco team",
@@ -1 +0,0 @@
1
- function p(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function i(e){if(!e.includes("/"))return e;const a=e.split("/"),r=a[0],t=a[1];if(!r||!t)return e;if(r.includes(".")){const s=r.split("."),c=s[s.length-1]||r,n=t.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!n||n.length<2?c:n}return t}export{i as e,p as s};
@@ -1 +0,0 @@
1
- import{c as X,j as t,r as Q,a5 as Te,d as ke,ap as Ie,bl as fe,aq as ue,b8 as $e,ar as Ee,as as Fe,a6 as xe}from"./index-kuMaGV9U.js";import{E as Ge}from"./empty-state-CCq1QaCi.js";import{E as pe}from"./error-boundary-COxhsLlB.js";import{b as Ae,I as De}from"./integration-icon-Dv-2D552.js";import{T as Ve}from"./tool-set-selector-BxJYXzYX.js";import{b as ze,a as Pe}from"./use-gateway-C6ADI4VP.js";import{B as L}from"./button-Cv1rgJOF.js";import{I as U}from"./icon-KZI-tyY2.js";import{I as ge}from"./input-C0U94pom.js";import{S as Ue}from"./switch-B0GAK0hk.js";import{F as Z,a as Re,b as te,d as se,f as oe,c as je}from"./form-xpLXXjk9.js";import{c as ye,a as _e,S as be,b as ve,d as ee}from"./select-BFyzpZOm.js";import{d as M,b as q,a as H,T as K}from"./tooltip-CyTpNpEt.js";import{V as Be,b as We}from"./layout-B4csW0zk.js";import{f as Oe}from"./formatDistanceToNow-Ctx6mZEP.js";import"./utils-dJ2GyoL3.js";import"./checkbox-Ay9B68Cb.js";import"./collection-search-CXcLRFBk.js";function he(o){const s=new TextEncoder().encode(o),n=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(n)}function Je(o){const e=X.c(63),{serverName:s,gatewayUrl:n}=o,[a,r]=Q.useState(!1),[i,c]=Q.useState(null);let l,d,m,g,x;if(e[0]!==n||e[1]!==s){const re={type:"http",url:n},ce={[s]:re};l=JSON.stringify(ce,null,2);const me=Se=>JSON.stringify({...re,headers:{"x-mesh-client":Se}},null,2),we=he(me("Cursor"));d=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(s)}&config=${encodeURIComponent(we)}`;const Ce=he(me("Windsurf"));x=`windsurf://codeium.windsurf/mcp/install?name=${encodeURIComponent(s)}&config=${encodeURIComponent(Ce)}`;const Ne=me("Claude Code");m=s;let de;e[7]===Symbol.for("react.memo_cache_sentinel")?(de=/'/g,e[7]=de):de=e[7],g=Ne.replace(de,"'\\''"),e[0]=n,e[1]=s,e[2]=l,e[3]=d,e[4]=m,e[5]=g,e[6]=x}else l=e[2],d=e[3],m=e[4],g=e[5],x=e[6];const C=`claude mcp add "${m}" --config '${g}'`;let u;e[8]!==l?(u=async()=>{await navigator.clipboard.writeText(l),r(!0),xe.success("Configuration copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[8]=l,e[9]=u):u=e[9];const h=u;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=async(re,ce)=>{await navigator.clipboard.writeText(re),c(ce),xe.success(`${ce} command copied`),setTimeout(()=>c(null),2e3)},e[10]=p):p=e[10];const Y=p,R=Le;let D;e[11]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[11]=D):D=e[11];const w=a?"check":"content_copy";let P;e[12]!==w?(P=t.jsx(U,{name:w,size:14}),e[12]=w,e[13]=P):P=e[13];let F;e[14]!==h||e[15]!==P?(F=t.jsx(H,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:h,children:P})}),e[14]=h,e[15]=P,e[16]=F):F=e[16];let V;e[17]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(K,{children:"Copy configuration"}),e[17]=V):V=e[17];let G;e[18]!==F?(G=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(M,{children:t.jsxs(q,{children:[F,V]})})}),e[18]=F,e[19]=G):G=e[19];let j;e[20]!==l||e[21]!==h?(j=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:h,children:l}),e[20]=l,e[21]=h,e[22]=j):j=e[22];let y;e[23]!==G||e[24]!==j?(y=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[G,j]}),e[23]=G,e[24]=j,e[25]=y):y=e[25];let _;e[26]!==d?(_=()=>R(d),e[26]=d,e[27]=_):_=e[27];let N,S;e[28]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),S=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[28]=N,e[29]=S):(N=e[28],S=e[29]);let A;e[30]!==_?(A=t.jsx(H,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:_,children:[N,S]})}),e[30]=_,e[31]=A):A=e[31];let T;e[32]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(K,{children:"Add to Cursor"}),e[32]=T):T=e[32];let k;e[33]!==A?(k=t.jsx(M,{children:t.jsxs(q,{children:[A,T]})}),e[33]=A,e[34]=k):k=e[34];let b;e[35]!==C?(b=()=>Y(C,"Claude"),e[35]=C,e[36]=b):b=e[36];let I,$;e[37]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),$=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[37]=I,e[38]=$):(I=e[37],$=e[38]);let v;e[39]!==i?(v=i==="Claude"&&t.jsx(U,{name:"check",size:14,className:"ml-2 text-green-500"}),e[39]=i,e[40]=v):v=e[40];let E;e[41]!==b||e[42]!==v?(E=t.jsx(H,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:b,children:[I,$,v]})}),e[41]=b,e[42]=v,e[43]=E):E=e[43];let f;e[44]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(K,{children:"Add to Claude Code"}),e[44]=f):f=e[44];let z;e[45]!==E?(z=t.jsx(M,{children:t.jsxs(q,{children:[E,f]})}),e[45]=E,e[46]=z):z=e[46];let B;e[47]!==x?(B=()=>R(x),e[47]=x,e[48]=B):B=e[48];let le,ne;e[49]===Symbol.for("react.memo_cache_sentinel")?(le=t.jsx("img",{src:"/logos/Windsurf.svg",alt:"Windsurf",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(6%) sepia(68%) saturate(3620%) hue-rotate(204deg) brightness(92%) contrast(103%)"}}),ne=t.jsx("span",{className:"text-sm font-medium",children:"Windsurf"}),e[49]=le,e[50]=ne):(le=e[49],ne=e[50]);let W;e[51]!==B?(W=t.jsx(H,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:B,children:[le,ne]})}),e[51]=B,e[52]=W):W=e[52];let ae;e[53]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx(K,{children:"Add to Windsurf"}),e[53]=ae):ae=e[53];let O;e[54]!==W?(O=t.jsx(M,{children:t.jsxs(q,{children:[W,ae]})}),e[54]=W,e[55]=O):O=e[55];let J;e[56]!==k||e[57]!==z||e[58]!==O?(J=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[k,z,O]}),e[56]=k,e[57]=z,e[58]=O,e[59]=J):J=e[59];let ie;return e[60]!==y||e[61]!==J?(ie=t.jsxs("div",{className:"flex flex-col gap-4",children:[D,y,J]}),e[60]=y,e[61]=J,e[62]=ie):ie=e[62],ie}function Le(o){window.open(o,"_blank")}const Me=Ie({title:ue().min(1,"Name is required").max(255),description:ue().nullable(),status:fe(["active","inactive"]),tool_selection_mode:fe(["inclusion","exclusion"]),tool_selection_strategy:fe(["passthrough","smart_tool_selection","code_execution"])});function qe(o,e){const s={};for(const n of o.connections)if(n.selected_tools===null){const a=e.get(n.connection_id)??[];a.length>0&&(s[n.connection_id]=a)}else n.selected_tools.length>0&&(s[n.connection_id]=n.selected_tools);return s}function He(o,e){return Object.entries(o).map(([s,n])=>{const a=e.get(s)??[],r=a.length>0&&a.every(i=>n.includes(i));return{connection_id:s,selected_tools:r?null:n}})}function Ke(o){const e=X.c(28),{form:s,toolSet:n,onToolSetChange:a,icon:r}=o;let i;e[0]!==s?(i=s.watch("title")||"Gateway",e[0]=s,e[1]=i):i=e[1];let c;e[2]!==r||e[3]!==i?(c=t.jsx(De,{icon:r,name:i,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:"network_node"}),e[2]=r,e[3]=i,e[4]=c):c=e[4];let l;e[5]!==s.control?(l=t.jsx(Z,{control:s.control,name:"status",render:et}),e[5]=s.control,e[6]=l):l=e[6];let d;e[7]!==c||e[8]!==l?(d=t.jsxs("div",{className:"flex items-start justify-between",children:[c,l]}),e[7]=c,e[8]=l,e[9]=d):d=e[9];let m;e[10]!==s.control?(m=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(Z,{control:s.control,name:"title",render:Ze}),t.jsx(Z,{control:s.control,name:"description",render:Ye})]}),e[10]=s.control,e[11]=m):m=e[11];let g;e[12]!==d||e[13]!==m?(g=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[d,m]}),e[12]=d,e[13]=m,e[14]=g):g=e[14];let x;e[15]!==s.control?(x=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(Z,{control:s.control,name:"tool_selection_mode",render:Xe}),t.jsx(Z,{control:s.control,name:"tool_selection_strategy",render:Qe})]}),e[15]=s.control,e[16]=x):x=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex-1 flex items-center justify-center p-5",children:t.jsx(U,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),e[17]=C):C=e[17];let u;e[18]!==a||e[19]!==n?(u=t.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:t.jsx(pe,{children:t.jsx(Q.Suspense,{fallback:C,children:t.jsx(Ve,{toolSet:n,onToolSetChange:a})})})}),e[18]=a,e[19]=n,e[20]=u):u=e[20];let h;e[21]!==g||e[22]!==x||e[23]!==u?(h=t.jsxs("div",{className:"flex flex-col h-full",children:[g,x,u]}),e[21]=g,e[22]=x,e[23]=u,e[24]=h):h=e[24];let p;return e[25]!==s||e[26]!==h?(p=t.jsx(Re,{...s,children:h}),e[25]=s,e[26]=h,e[27]=p):p=e[27],p}function Qe(o){const{field:e}=o;return t.jsxs(te,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(je,{className:"mb-0",children:"Gateway Strategy"}),t.jsx(M,{children:t.jsxs(q,{children:[t.jsx(H,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(U,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(K,{side:"right",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})})]}),t.jsxs(ye,{value:e.value,onValueChange:e.onChange,children:[t.jsx(se,{children:t.jsx(_e,{className:"w-[180px]",children:t.jsx(be,{})})}),t.jsxs(ve,{children:[t.jsx(ee,{value:"passthrough",children:"Passthrough"}),t.jsx(ee,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(ee,{value:"code_execution",children:"Code Execution"})]})]})]}),t.jsx(oe,{})]})}function Xe(o){const{field:e}=o;return t.jsxs(te,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(je,{className:"mb-0",children:"Tool Selection Mode"}),t.jsx(M,{children:t.jsxs(q,{children:[t.jsx(H,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(U,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(K,{side:"right",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 connections/tools are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All connections/tools except selected ones are exposed."]})]})})]})})]}),t.jsxs(ye,{value:e.value,onValueChange:e.onChange,children:[t.jsx(se,{children:t.jsx(_e,{className:"w-[180px]",children:t.jsx(be,{})})}),t.jsxs(ve,{children:[t.jsx(ee,{value:"inclusion",children:"Include Selected"}),t.jsx(ee,{value:"exclusion",children:"Exclude Selected"})]})]})]}),t.jsx(oe,{})]})}function Ye(o){const{field:e}=o;return t.jsxs(te,{className:"w-full space-y-0",children:[t.jsx(se,{children:t.jsx(ge,{...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(oe,{})]})}function Ze(o){const{field:e}=o;return t.jsxs(te,{className:"w-full space-y-0",children:[t.jsx(se,{children:t.jsx(ge,{...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:"Gateway Name"})}),t.jsx(oe,{})]})}function et(o){const{field:e}=o;return t.jsxs(te,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(se,{children:t.jsx(Ue,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(oe,{})]})}function tt(o){const e=X.c(53),{gateway:s,gatewayId:n}=o,a=$e(),r=Pe();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const c=Ae(i);let l;if(e[1]!==c){l=new Map;for(const f of c)f.tools&&f.tools.length>0&&l.set(f.id,f.tools.map(st));e[1]=c,e[2]=l}else l=e[2];let d;e[3]!==l||e[4]!==s?(d=()=>qe(s,l),e[3]=l,e[4]=s,e[5]=d):d=e[5];const[m,g]=Q.useState(d),[x,C]=Q.useState(!1);let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=f=>{g(f),C(!0)},e[6]=u):u=e[6];const h=u;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=Ee(Me),e[7]=p):p=e[7];const Y=s.tool_selection_mode??"inclusion",R=s.tool_selection_strategy??"passthrough";let D;e[8]!==s.description||e[9]!==s.status||e[10]!==s.title||e[11]!==Y||e[12]!==R?(D={resolver:p,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:Y,tool_selection_strategy:R}},e[8]=s.description,e[9]=s.status,e[10]=s.title,e[11]=Y,e[12]=R,e[13]=D):D=e[13];const w=Fe(D),F=w.formState.isDirty||x;let V;e[14]!==r.update||e[15]!==l||e[16]!==w||e[17]!==n||e[18]!==m?(V=async()=>{const f=w.getValues(),z=He(m,l);await r.update.mutateAsync({id:n,data:{title:f.title,description:f.description,status:f.status,tool_selection_mode:f.tool_selection_mode,tool_selection_strategy:f.tool_selection_strategy,connections:z}}),w.reset(f),C(!1)},e[14]=r.update,e[15]=l,e[16]=w,e[17]=n,e[18]=m,e[19]=V):V=e[19];const G=V;let j;e[20]!==a.history?(j=()=>a.history.back(),e[20]=a.history,e[21]=j):j=e[21];let y;e[22]!==r.update.isPending||e[23]!==G||e[24]!==F?(y=F&&t.jsxs(L,{onClick:G,disabled:r.update.isPending,size:"sm",className:"h-7",children:[r.update.isPending&&t.jsx(U,{name:"progress_activity",size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[22]=r.update.isPending,e[23]=G,e[24]=F,e[25]=y):y=e[25];let _;e[26]!==y?(_=t.jsx(Be,{children:y}),e[26]=y,e[27]=_):_=e[27];let N;e[28]!==w||e[29]!==s.icon||e[30]!==m?(N=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(Ke,{form:w,toolSet:m,onToolSetChange:h,icon:s.icon})}),e[28]=w,e[29]=s.icon,e[30]=m,e[31]=N):N=e[31];let S;e[32]!==s.id||e[33]!==s.title?(S=s.title||`gateway-${s.id.slice(0,8)}`,e[32]=s.id,e[33]=s.title,e[34]=S):S=e[34];const A=`${window.location.origin}/mcp/gateway/${s.id}`;let T;e[35]!==S||e[36]!==A?(T=t.jsx("div",{className:"p-5",children:t.jsx(Je,{serverName:S,gatewayUrl:A})}),e[35]=S,e[36]=A,e[37]=T):T=e[37];let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[38]=k):k=e[38];let b;e[39]!==s.updated_at?(b=s.updated_at?Oe(new Date(s.updated_at),{addSuffix:!1}):"Unknown",e[39]=s.updated_at,e[40]=b):b=e[40];let I;e[41]!==b?(I=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[k,t.jsx("span",{className:"font-mono text-sm uppercase text-muted-foreground",children:b})]}),e[41]=b,e[42]=I):I=e[42];let $;e[43]!==T||e[44]!==I?($=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[T,I]}),e[43]=T,e[44]=I,e[45]=$):$=e[45];let v;e[46]!==N||e[47]!==$?(v=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[N,$]}),e[46]=N,e[47]=$,e[48]=v):v=e[48];let E;return e[49]!==_||e[50]!==v||e[51]!==j?(E=t.jsxs(We,{onBack:j,children:[_,v]}),e[49]=_,e[50]=v,e[51]=j,e[52]=E):E=e[52],E}function st(o){return o.name}function ot(){const o=X.c(8);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=Te(e);let n;o[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/gateways/$gatewayId"},o[1]=n):n=o[1];const{gatewayId:a,org:r}=ke(n),i=ze(a);if(!i){let l;return o[2]!==s||o[3]!==r?(l=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ge,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(L,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:r}}),children:"Back to gateways"})})}),o[2]=s,o[3]=r,o[4]=l):l=o[4],l}let c;return o[5]!==i||o[6]!==a?(c=t.jsx(tt,{gateway:i,gatewayId:a}),o[5]=i,o[6]=a,o[7]=c):c=o[7],c}function lt(){const o=X.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(pe,{children:t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(U,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ot,{})})}),o[0]=e):e=o[0],e}function wt(){const o=X.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(lt,{}),o[0]=e):e=o[0],e}export{wt as default};
@@ -1 +0,0 @@
1
- import{b1 as V,b2 as D,b3 as W,b4 as Q,b5 as U,b6 as H,c as M,j as s,r as O,a5 as G,a2 as Y,a as q,b7 as J,ao as Z}from"./index-kuMaGV9U.js";import{g as X,a as ee}from"./well-known-mcp-Dq2j3ucM.js";import{C as te}from"./collection-header-DsMf-88h.js";import{I as se,a as ie,c as ne,d as B,b as le}from"./integration-icon-Dv-2D552.js";import{a as re,T as oe,b as ae,u as A}from"./tooltip-CyTpNpEt.js";import{e as ce,s as de}from"./app-name-DQPOjnhR.js";import{I as T}from"./icon-KZI-tyY2.js";import{C as me}from"./collection-search-CXcLRFBk.js";import{C as fe}from"./card-BggFBtGd.js";import{g as ue,f as he,a as xe}from"./registry-utils-ulDDT0d8.js";import{d as ge,a as pe,S as ve,b as je,c as Ne}from"./select-BFyzpZOm.js";import{C as ye}from"./connection-card-BSv7-QCW.js";import{B as Ce}from"./button-Cv1rgJOF.js";import{E as we}from"./empty-state-CCq1QaCi.js";import{a as be}from"./use-binding-Dlf98XSv.js";import{L as Se,u as Pe}from"./localstorage-keys-BY-fTuiw.js";import"./collection-display-button-grM851Xd.js";import"./dropdown-menu-dUgjswGX.js";import"./utils-dJ2GyoL3.js";import"./input-C0U94pom.js";import"./badge-C29ypR-2.js";import"./auth-Dfo88onv.js";import"./useQuery-DJ7WNdWe.js";var Re=class extends V{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:D()})}getOptimisticResult(t){return t.behavior=D(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:n}=t,c=super.createResult(t,e),{isFetching:r,isRefetching:h,isError:d,isRefetchError:m}=c,a=n.fetchMeta?.fetchMore?.direction,i=d&&a==="forward",l=r&&a==="forward",o=d&&a==="backward",f=r&&a==="backward";return{...c,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Q(e,n.data),hasPreviousPage:W(e,n.data),isFetchNextPageError:i,isFetchingNextPage:l,isFetchPreviousPageError:o,isFetchingPreviousPage:f,isRefetchError:m&&!i&&!o,isRefetching:h&&!l&&!f}}};function Ie(t,e){return U({...t,enabled:!0,suspense:!0,throwOnError:H},Re,e)}function Ee(t){const e=t.title||t.server.title||t.id||"Unnamed Item",n=t.server.description||null,c=t.server.icons?.[0]?.src||ue(t.server.repository)||null,r=t._meta?.["mcp.mesh"]?.verified??!1,h=t.server.version,m=(t.server.remotes?.length??0)>0;let a=e,i=null;if(e.includes("/")){const l=e.split("/");l.length>=2&&(i=l[0]||null,a=ce(e))}if(!i){const l=t._meta?.["mcp.mesh"]?.scopeName,o=t._meta?.["mcp.mesh"]?.appName;l&&o?i=`${l}/${o}`:l&&(i=l)}return{icon:c,scopeName:i,displayName:a,description:n,version:h||null,isVerified:r,canInstall:m}}function ke(t){const e=M.c(45),{icon:n,scopeName:c,displayName:r,description:h,version:d,isVerified:m,canInstall:a,onClick:i}=t;let l;e[0]!==r||e[1]!==n?(l=s.jsx(se,{icon:n,name:r,size:"md",className:"shadow-sm"}),e[0]=r,e[1]=n,e[2]=l):l=e[2];let o;e[3]!==r?(o=s.jsx("span",{className:"truncate",children:r}),e[3]=r,e[4]=o):o=e[4];let f;e[5]!==m?(f=m&&s.jsx(T,{name:"verified",size:16,className:"text-success shrink-0"}),e[5]=m,e[6]=f):f=e[6];let g;e[7]!==a?(g=!a&&s.jsx(T,{name:"lock",size:16,className:"text-muted-foreground shrink-0",title:"This MCP Server cannot be connected"}),e[7]=a,e[8]=g):g=e[8];let u;e[9]!==o||e[10]!==f||e[11]!==g?(u=s.jsx(re,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-2 text-base font-semibold min-w-0",children:[o,f,g]})}),e[9]=o,e[10]=f,e[11]=g,e[12]=u):u=e[12];let p;e[13]!==r?(p=s.jsx("p",{children:r}),e[13]=r,e[14]=p):p=e[14];let N;e[15]!==a?(N=!a&&s.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[15]=a,e[16]=N):N=e[16];let y;e[17]!==p||e[18]!==N?(y=s.jsxs(oe,{children:[p,N]}),e[17]=p,e[18]=N,e[19]=y):y=e[19];let R;e[20]!==u||e[21]!==y?(R=s.jsxs(ae,{children:[u,y]}),e[20]=u,e[21]=y,e[22]=R):R=e[22];let C;e[23]!==c?(C=c&&s.jsx("span",{className:"truncate",children:c}),e[23]=c,e[24]=C):C=e[24];let b;e[25]!==c||e[26]!==d?(b=d&&s.jsxs(s.Fragment,{children:[c&&s.jsx("span",{children:"•"}),s.jsxs("span",{className:"shrink-0",children:["v",d]})]}),e[25]=c,e[26]=d,e[27]=b):b=e[27];let S;e[28]!==C||e[29]!==b?(S=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[C,b]}),e[28]=C,e[29]=b,e[30]=S):S=e[30];let v;e[31]!==S||e[32]!==R?(v=s.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:s.jsxs("div",{className:"min-w-0 flex-1",children:[R,S]})}),e[31]=S,e[32]=R,e[33]=v):v=e[33];let x;e[34]!==l||e[35]!==v?(x=s.jsxs("div",{className:"flex gap-3",children:[l,v]}),e[34]=l,e[35]=v,e[36]=x):x=e[36];const I=h||"No description available";let P;e[37]!==I?(P=s.jsx("div",{className:"grid grid-cols-1 gap-1 min-w-0",children:s.jsx("div",{className:"text-base text-muted-foreground line-clamp-2",children:I})}),e[37]=I,e[38]=P):P=e[38];let E;e[39]!==x||e[40]!==P?(E=s.jsxs("div",{className:"flex flex-col gap-4 h-full relative",children:[x,P]}),e[39]=x,e[40]=P,e[41]=E):E=e[41];let j;return e[42]!==i||e[43]!==E?(j=s.jsx(fe,{className:"p-6 cursor-pointer hover:shadow-md transition-shadow",onClick:i,children:E}),e[42]=i,e[43]=E,e[44]=j):j=e[44],j}function z(t){const e=M.c(12),{items:n,title:c,onItemClick:r}=t;if(n.length===0)return null;let h;e[0]!==c?(h=c&&s.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:s.jsx("h2",{className:"text-lg font-medium",children:c})}),e[0]=c,e[1]=h):h=e[1];let d;if(e[2]!==n||e[3]!==r){let i;e[5]!==r?(i=l=>{const o=Ee(l);return s.jsx(ke,{...o,onClick:()=>r(l)},l.id)},e[5]=r,e[6]=i):i=e[6],d=n.map(i),e[2]=n,e[3]=r,e[4]=d}else d=e[4];let m;e[7]!==d?(m=s.jsx("div",{className:"grid grid-cols-4 gap-4",children:d}),e[7]=d,e[8]=m):m=e[8];let a;return e[9]!==h||e[10]!==m?(a=s.jsxs("div",{className:"flex flex-col gap-4",children:[h,m]}),e[9]=h,e[10]=m,e[11]=a):a=e[11],a}function Te(t,e){if(!e)return t;const n=e.toLowerCase();return t.filter(c=>(c.name||c.title||"").toLowerCase().includes(n)||(c.description||c.server.description||"").toLowerCase().includes(n))}function Me(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0||t.server._meta?.["mcp.mesh"]?.verified===!0}function Le(t){const e=M.c(32),{items:n,isLoadingMore:c,registryId:r,hasMore:h,onLoadMore:d}=t,m=c===void 0?!1:c,a=h===void 0?!1:h,[i,l]=O.useState(""),o=G(),{org:f}=A(),g=O.useRef(null);let u,p,N;e[0]!==n||e[1]!==i?(u=Te(n,i),N=u.filter(Me),p=u.filter(j=>!N.find(k=>k.id===j.id)),e[0]=n,e[1]=i,e[2]=u,e[3]=p,e[4]=N):(u=e[2],p=e[3],N=e[4]);const y=p;let R;e[5]!==o||e[6]!==f.slug||e[7]!==r?(R=j=>{const k=de(j.name||j.title||j.server.title||""),L=j.server.name;o({to:"/$org/store/$appName",params:{org:f.slug,appName:k},search:{registryId:r,serverName:L}})},e[5]=o,e[6]=f.slug,e[7]=r,e[8]=R):R=e[8];const C=R;let b;e[9]!==a||e[10]!==m||e[11]!==d||e[12]!==i?(b=j=>{if(!a||!d||i||m)return;const k=j.currentTarget;k.scrollHeight-k.scrollTop-k.clientHeight<200&&d()},e[9]=a,e[10]=m,e[11]=d,e[12]=i,e[13]=b):b=e[13];const S=b;let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=j=>{j.key==="Enter"&&l(j.currentTarget.value)},e[14]=v):v=e[14];let x;e[15]!==i?(x=s.jsx(me,{value:i,onChange:l,placeholder:"Search for an MCP Server...",onKeyDown:v}),e[15]=i,e[16]=x):x=e[16];let I;e[17]!==y||e[18]!==u||e[19]!==C||e[20]!==a||e[21]!==m||e[22]!==n.length||e[23]!==i||e[24]!==N?(I=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:n.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(T,{name:"inbox",size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):i&&u.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(T,{name:"search",size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[N.length>0&&s.jsx(z,{items:N,title:"Verified",onItemClick:C}),y.length>0&&s.jsx(z,{items:y,title:N.length>0?"All":"",onItemClick:C}),a&&!i&&m&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(T,{name:"progress_activity",size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[17]=y,e[18]=u,e[19]=C,e[20]=a,e[21]=m,e[22]=n.length,e[23]=i,e[24]=N,e[25]=I):I=e[25];let P;e[26]!==S||e[27]!==I?(P=s.jsx("div",{ref:g,className:"flex-1 overflow-y-auto",onScroll:S,children:I}),e[26]=S,e[27]=I,e[28]=P):P=e[28];let E;return e[29]!==x||e[30]!==P?(E=s.jsxs("div",{className:"flex flex-col h-full",children:[x,P]}),e[29]=x,e[30]=P,e[31]=E):E=e[31],E}const F=24;function $e(t){const e=M.c(27),{registryId:n}=t,c=ie(n);let r,h,d,m;if(e[0]!==c?.tools||e[1]!==n){if(r=he(c?.tools),!r)throw new Error("This registry does not support listing store items.");let x;e[6]!==n?(x=ne(n),e[6]=n,e[7]=x):x=e[7],m=x,d=Ie,h=Y.toolCall(n,r,JSON.stringify({limit:F})),e[0]=c?.tools,e[1]=n,e[2]=r,e[3]=h,e[4]=d,e[5]=m}else r=e[2],h=e[3],d=e[4],m=e[5];let a;e[8]!==r||e[9]!==m?(a=async x=>{const{pageParam:I}=x;return await m(r,I?{cursor:I,limit:F}:{limit:F})},e[8]=r,e[9]=m,e[10]=a):a=e[10];let i;e[11]!==h||e[12]!==a?(i={queryKey:h,queryFn:a,initialPageParam:void 0,getNextPageParam:Ke,staleTime:36e5},e[11]=h,e[12]=a,e[13]=i):i=e[13];const{data:l,fetchNextPage:o,hasNextPage:f,isFetchingNextPage:g}=d(i);let u;e:{if(!l?.pages||l.pages.length===0){u=null;break e}const x=l.pages[0];if(typeof x=="object"&&x!==null&&"totalCount"in x&&typeof x.totalCount=="number"){u=x.totalCount;break e}u=null}const p=u,N=l?.pages;let y;e[14]!==N?(y=xe(N),e[14]=N,e[15]=y):y=e[15];const R=y;let C;e[16]!==o||e[17]!==f||e[18]!==g?(C=()=>{f&&!g&&o()},e[16]=o,e[17]=f,e[18]=g,e[19]=C):C=e[19];const b=C,S=f??!1;let v;return e[20]!==R||e[21]!==b||e[22]!==g||e[23]!==n||e[24]!==S||e[25]!==p?(v=s.jsx(Le,{items:R,isLoadingMore:g,registryId:n,hasMore:S,onLoadMore:b,totalCount:p}),e[20]=R,e[21]=b,e[22]=g,e[23]=n,e[24]=S,e[25]=p,e[26]=v):v=e[26],v}function Ke(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function _e(t){const e=M.c(15),{registries:n,value:c,onValueChange:r,onAddWellKnown:h,wellKnownRegistries:d,placeholder:m}=t,a=m===void 0?"Select a registry...":m;let i;e[0]!==a?(i=s.jsx(pe,{className:"w-[200px] h-8!",children:s.jsx(ve,{placeholder:a})}),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==n?(l=n.map(Fe),e[2]=n,e[3]=l):l=e[3];let o;e[4]!==h||e[5]!==d?(o=d.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),d.map(u=>s.jsxs("button",{onClick:p=>{p.preventDefault(),p.stopPropagation(),h(u)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[u.icon?s.jsx("img",{src:u.icon,alt:u.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:u.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:u.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(T,{name:"add",size:16})})]},u.id??u.title))]}),e[4]=h,e[5]=d,e[6]=o):o=e[6];let f;e[7]!==l||e[8]!==o?(f=s.jsxs(je,{children:[l,o]}),e[7]=l,e[8]=o,e[9]=f):f=e[9];let g;return e[10]!==r||e[11]!==i||e[12]!==f||e[13]!==c?(g=s.jsxs(Ne,{value:c,onValueChange:r,children:[i,f]}),e[10]=r,e[11]=i,e[12]=f,e[13]=c,e[14]=g):g=e[14],g}function Fe(t){return s.jsx(ge,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function Oe(t){const e=M.c(13),{registries:n,onConnected:c}=t,r=n.length===1;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:423,height:279,className:"max-w-full h-auto"}),e[0]=h):h=e[0];const d=r?"Connect to registry":"Connect to a store",m=r?"Connect to discover and use MCP Servers from the community.":"Choose a registry to discover and connect MCP Servers from the community.",a=`grid gap-4 w-full ${r?"grid-cols-1 justify-items-center":"grid-cols-1 md:grid-cols-2"}`;let i;if(e[1]!==c||e[2]!==n){let f;e[4]!==c?(f=(g,u)=>{const p=g.id??`registry-${u}`;return s.jsx(Ae,{registry:{...g,id:p},onConnected:c},p)},e[4]=c,e[5]=f):f=e[5],i=n.map(f),e[1]=c,e[2]=n,e[3]=i}else i=e[3];let l;e[6]!==a||e[7]!==i?(l=s.jsx("div",{className:a,children:i}),e[6]=a,e[7]=i,e[8]=l):l=e[8];let o;return e[9]!==d||e[10]!==m||e[11]!==l?(o=s.jsx(we,{image:h,title:d,description:m,descriptionClassName:"max-w-[500px]",actionsClassName:"w-full max-w-2xl",actions:l}),e[9]=d,e[10]=m,e[11]=l,e[12]=o):o=e[12],o}function Ae(t){const e=M.c(15),{registry:n,onConnected:c}=t,r=B(),{org:h}=A(),{data:d}=q.useSession(),m=!!h&&!!d?.user?.id;let a;e[0]!==r.create||e[1]!==m||e[2]!==c||e[3]!==n?(a=async()=>{if(!m)return;const u=await r.create.mutateAsync(n);c?.(u.id)},e[0]=r.create,e[1]=m,e[2]=c,e[3]=n,e[4]=a):a=e[4];const i=a,l=!m||r.create.isPending;let o;e[5]!==r.create.isPending?(o=r.create.isPending?s.jsxs(s.Fragment,{children:[s.jsx(T,{name:"progress_activity",className:"animate-spin"}),"Connecting..."]}):s.jsxs(s.Fragment,{children:[s.jsx(T,{name:"add"}),"Connect"]}),e[5]=r.create.isPending,e[6]=o):o=e[6];let f;e[7]!==i||e[8]!==l||e[9]!==o?(f=s.jsx(Ce,{variant:"outline",className:"w-full",disabled:l,onClick:i,children:o}),e[7]=i,e[8]=l,e[9]=o,e[10]=f):f=e[10];let g;return e[11]!==i||e[12]!==n||e[13]!==f?(g=s.jsx(ye,{connection:n,onClick:i,footer:f,className:"transition-all hover:border-primary/50 hover:shadow-md"}),e[11]=i,e[12]=n,e[13]=f,e[14]=g):g=e[14],g}function ft(){const t=M.c(37),{org:e}=A(),n=le(),c=B(),r=J(),h=r.location.pathname.includes("/store/")&&r.location.pathname.split("/").length>3,d=be(n);let m;t[0]!==d?(m=d.map(Be),t[0]=d,t[1]=m):m=t[1];const a=m;let i;t[2]!==e.slug?(i=Se.selectedRegistry(e.slug),t[2]=e.slug,t[3]=i):i=t[3];const[l,o]=Pe(i,ze);let f;if(t[4]!==d||t[5]!==l){let w;t[7]!==l?(w=_=>_.id===l,t[7]=l,t[8]=w):w=t[8],f=d.find(w),t[4]=d,t[5]=l,t[6]=f}else f=t[6];const u=f?.id||d[0]?.id||"";let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=[X()],t[9]=p):p=t[9];const N=p;let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y=[ee()],t[10]=y):y=t[10];const R=y;let C;t[11]!==c.create||t[12]!==o?(C=async w=>{const _=await c.create.mutateAsync(w);o(_.id)},t[11]=c.create,t[12]=o,t[13]=C):C=t[13];const b=C;let S;t[14]!==d?(S=new Set(d.map(De)),t[14]=d,t[15]=S):S=t[15];const v=S;let x;t[16]!==v?(x=N.filter(w=>w.id&&!v.has(w.id)),t[16]=v,t[17]=x):x=t[17];const I=x;let P;t[18]!==v?(P=R.filter(w=>w.id&&!v.has(w.id)),t[18]=v,t[19]=P):P=t[19];const E=P;if(h){let w;return t[20]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Z,{}),t[20]=w):w=t[20],w}let j;t[21]!==b?(j=async w=>b(w),t[21]=b,t[22]=j):j=t[22];let k;t[23]!==I||t[24]!==u||t[25]!==a||t[26]!==o||t[27]!==j?(k=s.jsx(te,{title:"Store",ctaButton:s.jsx(_e,{wellKnownRegistries:I,registries:a,value:u,onValueChange:o,onAddWellKnown:j,placeholder:"Select store..."})}),t[23]=I,t[24]=u,t[25]=a,t[26]=o,t[27]=j,t[28]=k):k=t[28];let L;t[29]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(T,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[29]=L):L=t[29];let $;t[30]!==E||t[31]!==u||t[32]!==o?($=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(O.Suspense,{fallback:L,children:u?s.jsx($e,{registryId:u}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(Oe,{registries:E,onConnected:w=>{o(w)}})})})}),t[30]=E,t[31]=u,t[32]=o,t[33]=$):$=t[33];let K;return t[34]!==k||t[35]!==$?(K=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[k,$]}),t[34]=k,t[35]=$,t[36]=K):K=t[36],K}function De(t){return t.id}function ze(){return""}function Be(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{ft as default};
@@ -1 +0,0 @@
1
- import{c as E,j as s,r as le,a5 as be,d as Ne,b as we,a as Ce,a6 as ge}from"./index-kuMaGV9U.js";import{I as L}from"./icon-KZI-tyY2.js";import{B as xe}from"./button-Cv1rgJOF.js";import{b as Te,D as _e,a as ke,c as Se}from"./dropdown-menu-dUgjswGX.js";import{E as Ie}from"./empty-state-CCq1QaCi.js";import{R as Ae,T as Le,a as Ee}from"./resource-tabs-C2-m37Rp.js";import{d as Ue,b as De,a as Me,c as Ve}from"./integration-icon-Dv-2D552.js";import{a as Pe}from"./use-binding-Dlf98XSv.js";import{u as Re}from"./use-tool-call-DSlbFKjt.js";import{u as Be}from"./use-mcp-Z1amXXTK.js";import{u as ve}from"./tooltip-CyTpNpEt.js";import{e as $e}from"./extract-connection-data-DyKjnzFA.js";import{e as ze,s as Oe}from"./app-name-DQPOjnhR.js";import{f as He,e as Fe,b as Ge,c as We,g as Ke}from"./registry-utils-ulDDT0d8.js";import"./utils-dJ2GyoL3.js";import"./useQuery-DJ7WNdWe.js";import"./collection-display-button-grM851Xd.js";import"./collection-search-CXcLRFBk.js";import"./input-C0U94pom.js";import"./collection-table-wrapper-DIAaiM6K.js";import"./card-BggFBtGd.js";import"./layout-B4csW0zk.js";import"./badge-C29ypR-2.js";import"./auth-Dfo88onv.js";import"./generate-id-Dyweu44Y.js";function qe(t){const e=E.c(3),{message:r}=t,n=r===void 0?"Loading app details...":r;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(L,{name:"progress_activity",size:48,className:"animate-spin mb-4"}),e[0]=o):o=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[o,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function Je(t){const e=E.c(9),{error:r,onBack:n}=t,o=r instanceof Error?r.message:r;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(L,{name:"error",size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==o?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:o}),e[2]=o,e[3]=c):c=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=l):l=e[5];let f;return e[6]!==c||e[7]!==l?(f=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=f):f=e[8],f}function Qe(t){const e=E.c(5),{onBack:r}=t;let n,o,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(L,{name:"search_off",size:48,className:"text-muted-foreground mb-4"}),o=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=o,e[2]=i):(n=e[0],o=e[1],i=e[2]);let a;return e[3]!==r?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,o,i,s.jsx("button",{onClick:r,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=r,e[4]=a):a=e[4],a}function Xe(t){const e=E.c(3),{onBack:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(L,{name:"arrow_back",size:20}),e[0]=n):n=e[0];let o;return e[1]!==r?(o=s.jsx("div",{className:"shrink-0 bg-background border-b border-border px-4 py-3",children:s.jsx("div",{className:"max-w-7xl mx-auto",children:s.jsxs("button",{onClick:r,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[n,"Back"]})})}),e[1]=r,e[2]=o):o=e[2],o}function Ye(t){const e=E.c(32),{data:r,itemVersions:n,onInstall:o,canInstall:i,isInstalling:a}=t,c=i===void 0?!0:i,l=a===void 0?!1:a,[f,u]=le.useState(0);let x;e[0]!==o?(x=d=>{u(d),o(d)},e[0]=o,e[1]=x):x=e[1];const p=x;let h;e[2]!==r.icon||e[3]!==r.name?(h=r.icon?s.jsx("img",{src:r.icon,alt:r.name,crossOrigin:"anonymous",referrerPolicy:"no-referrer",onError:d=>{const v=d.target;v.style.display="none";const I=v.parentElement;I&&(I.innerHTML=r.name.substring(0,2).toUpperCase())},className:"w-full h-full object-cover rounded-2xl"}):r.name.substring(0,2).toUpperCase(),e[2]=r.icon,e[3]=r.name,e[4]=h):h=e[4];let g;e[5]!==h?(g=s.jsx("div",{className:"shrink-0 w-16 h-16 rounded-2xl bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-3xl font-bold text-primary overflow-hidden",children:h}),e[5]=h,e[6]=g):g=e[6];let b;e[7]!==r.name?(b=s.jsx("h1",{className:"text-3xl font-bold",children:r.name}),e[7]=r.name,e[8]=b):b=e[8];let w;e[9]!==r.verified?(w=r.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[9]=r.verified,e[10]=w):w=e[10];let C;e[11]!==b||e[12]!==w?(C=s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b,w]}),e[11]=b,e[12]=w,e[13]=C):C=e[13];let T;e[14]!==r.description?(T=r.description&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:r.description}),e[14]=r.description,e[15]=T):T=e[15];let _;e[16]!==C||e[17]!==T?(_=s.jsxs("div",{className:"flex-1 min-w-0",children:[C,T]}),e[16]=C,e[17]=T,e[18]=_):_=e[18];let k;e[19]!==c||e[20]!==p||e[21]!==l||e[22]!==n||e[23]!==o||e[24]!==f?(k=c?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(xe,{variant:"brand",onClick:()=>p(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(L,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs(Te,{children:[s.jsx(_e,{asChild:!0,children:s.jsx(xe,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(L,{name:"expand_more",size:20})})}),s.jsx(ke,{align:"end",className:"w-56",children:n.map((d,v)=>{const I=d._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Se,{onClick:()=>p(v),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-start justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",d.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-primary font-semibold mt-1",children:"LATEST"})]}),v===f&&s.jsx(L,{name:"check_circle",size:16,className:"text-primary shrink-0 mt-1"})]})},v)})})]})]}):s.jsxs(xe,{variant:"brand",onClick:()=>o(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(L,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[19]=c,e[20]=p,e[21]=l,e[22]=n,e[23]=o,e[24]=f,e[25]=k):k=e[25];let N;e[26]!==_||e[27]!==k?(N=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[_,k]}),e[26]=_,e[27]=k,e[28]=N):N=e[28];let S;return e[29]!==N||e[30]!==g?(S=s.jsxs("div",{className:"pl-10 flex items-start gap-6 pb-12 pr-10 border-b border-border",children:[g,N]}),e[29]=N,e[30]=g,e[31]=S):S=e[31],S}function Ze(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function et(t){const e=E.c(48),{data:r,publisherInfo:n,selectedItem:o}=t;let i;e[0]!==r.description?(i=r.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-lg font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed",children:r.description})]}),e[0]=r.description,e[1]=i):i=e[1];let a;e[2]!==r.publisher||e[3]!==n.logo?(a=n.logo?s.jsx("img",{src:n.logo,alt:r.publisher,crossOrigin:"anonymous",referrerPolicy:"no-referrer",onError:I=>{const X=I.target;X.style.display="none";const M=X.parentElement;if(M){const y=r.publisher==="io.modelcontextprotocol.registry/official"?"OR":r.publisher.substring(0,2).toUpperCase();M.innerHTML=y}},className:"w-full h-full object-cover"}):r.publisher==="io.modelcontextprotocol.registry/official"?"OR":r.publisher.substring(0,2).toUpperCase(),e[2]=r.publisher,e[3]=n.logo,e[4]=a):a=e[4];let c;e[5]!==a?(c=s.jsx("div",{className:"w-12 h-12 rounded-lg bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-sm font-semibold text-primary shrink-0 overflow-hidden",children:a}),e[5]=a,e[6]=c):c=e[6];let l;e[7]!==r.publisher?(l=r.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":r.publisher.charAt(0).toUpperCase()+r.publisher.slice(1),e[7]=r.publisher,e[8]=l):l=e[8];let f;e[9]!==l?(f=s.jsx("div",{className:"font-medium",children:l}),e[9]=l,e[10]=f):f=e[10];let u;e[11]!==n.count?(u=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[11]=n.count,e[12]=u):u=e[12];let x;e[13]!==u?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:u}),e[13]=u,e[14]=x):x=e[14];let p;e[15]!==f||e[16]!==x?(p=s.jsxs("div",{children:[f,x]}),e[15]=f,e[16]=x,e[17]=p):p=e[17];let h;e[18]!==c||e[19]!==p?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,p]})}),e[18]=c,e[19]=p,e[20]=h):h=e[20];let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("h2",{className:"text-lg font-medium mb-3",children:"Technical Details"}),e[21]=g):g=e[21];let b;e[22]!==r.version?(b=r.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Version"}),s.jsxs("span",{className:"text-foreground font-medium",children:["v",r.version]})]}),e[22]=r.version,e[23]=b):b=e[23];let w;e[24]!==r.connectionType?(w=r.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Connection Type"}),s.jsx("span",{className:"text-foreground font-medium",children:r.connectionType})]}),e[24]=r.connectionType,e[25]=w):w=e[25];let C;e[26]!==r.schemaVersion?(C=r.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Schema Version"}),s.jsx("span",{className:"text-foreground font-medium",children:r.schemaVersion})]}),e[26]=r.schemaVersion,e[27]=C):C=e[27];let T;e[28]!==r.websiteUrl?(T=r.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Website"}),s.jsxs("a",{href:r.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:[s.jsx("span",{children:"Visit"}),s.jsx(L,{name:"open_in_new",size:14})]})]}),e[28]=r.websiteUrl,e[29]=T):T=e[29];let _;e[30]!==r.repository?(_=r.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Source"}),s.jsxs("a",{href:r.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:[s.jsx("span",{children:"GitHub"}),s.jsx(L,{name:"open_in_new",size:14})]})]}),e[30]=r.repository,e[31]=_):_=e[31];let k;e[32]!==b||e[33]!==w||e[34]!==C||e[35]!==T||e[36]!==_?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,w,C,T,_]}),e[32]=b,e[33]=w,e[34]=C,e[35]=T,e[36]=_,e[37]=k):k=e[37];let N;e[38]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[38]=N):N=e[38];let S;e[39]!==o.updated_at?(S=Ze(o.updated_at),e[39]=o.updated_at,e[40]=S):S=e[40];let d;e[41]!==S?(d=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[N,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:S})]}),e[41]=S,e[42]=d):d=e[42];let v;return e[43]!==i||e[44]!==k||e[45]!==d||e[46]!==h?(v=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,k,d]}),e[43]=i,e[44]=k,e[45]=d,e[46]=h,e[47]=v):v=e[47],v}function tt(t){const e=E.c(18),{data:r,availableTabs:n,effectiveActiveTabId:o,effectiveTools:i,isLoadingTools:a,onTabChange:c}=t,l=a===void 0?!1:a;let f;e[0]!==i?(f=i.map(st),e[0]=i,e[1]=f):f=e[1];const u=f;let x;e[2]!==n||e[3]!==o||e[4]!==c?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Ae,{tabs:n,activeTab:o,onTabChange:c})}),e[2]=n,e[3]=o,e[4]=c,e[5]=x):x=e[5];let p;e[6]!==o||e[7]!==i.length||e[8]!==l||e[9]!==u?(p=o==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(L,{name:"progress_activity",size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Le,{tools:u,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Ie,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=o,e[7]=i.length,e[8]=l,e[9]=u,e[10]=p):p=e[10];let h;e[11]!==r?.repository||e[12]!==o?(h=o==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Ee,{repository:r?.repository})}),e[11]=r?.repository,e[12]=o,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==p||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,p,h]}),e[14]=x,e[15]=p,e[16]=h,e[17]=g):g=e[17],g}function st(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function rt(t,e){if(!t||!e)return;const r=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===r||n.app_id?.toLowerCase()===r||n.title.toLowerCase()===r)||t.find(n=>n.title.toLowerCase().includes(r))}function ot(t,e,r,n,o){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:o??t.length};const i=e.toLowerCase(),a=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:r?.icon||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function nt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],r=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],o=t.server,i=Ge(o.remotes?.[0]?.type),a=We(o.$schema),c=n?"io.modelcontextprotocol.registry/official":t.publisher||r?.scopeName||"Unknown",l=Ke(o.repository),f=t.icon||t.image||t.logo||o.icons?.[0]?.src||l||null,u=t.name||t.title||t.server?.title||"Unnamed Item";return{name:ze(u),description:t.description||t.summary||t.server?.description||"",icon:f,verified:t.verified||r?.verified,publisher:c,version:o.version||null,websiteUrl:o.websiteUrl||null,repository:o.repository||null,schemaVersion:a??null,connectionType:i,connectionUrl:null,remoteUrl:null,tools:t.tools||o.tools||e?.tools||[],models:t.models||o.models||e?.models||[],emails:t.emails||o.emails||e?.emails||[],analytics:t.analytics||o.analytics||e?.analytics,cdn:t.cdn||o.cdn||e?.cdn}}class it extends le.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("Store app detail error:",e,r)}render(){return this.state.hasError?s.jsx(Je,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function lt(){const t=E.c(70),{org:e}=ve(),r=be();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:o}=Ne(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c}=we(i),[l,f]=le.useState("readme"),u=Ue(),x=De(),{data:p}=Ce.useSession(),h=Pe(x),g=a||h[0]?.id||"",b=Me(g),w=He(b?.tools),C=b?.tools&&b.tools.find(ft)?.name||"",T=b?.tools&&b.tools.find(mt)?.name||"",_=Ve(g),k=!!c;let N,S;k?(N=C||T,S={name:c}):(N=w,S={});const{data:d}=Re({toolCaller:_,toolName:N,toolInputParams:S,scope:g});let v=[],I=[],X=null;if(d){if(Array.isArray(d))v=d;else if(typeof d=="object"&&d!==null)if("totalCount"in d&&typeof d.totalCount=="number"&&(X=d.totalCount),"item"in d&&d.item){const m=d.item,A=m.id||"",V=m.server,P=m._meta;let D;t[2]!==m.title||t[3]!==A||t[4]!==V||t[5]!==P?(D=[{id:A,title:m.title,server:V,_meta:P}],t[2]=m.title,t[3]=A,t[4]=V,t[5]=P,t[6]=D):D=t[6],v=D}else{let m;"versions"in d&&Array.isArray(d.versions)?m="versions":"servers"in d&&Array.isArray(d.servers)?m="servers":m=Object.keys(d).find(A=>Array.isArray(d[A])),m&&(v=d[m],(m==="versions"||N?.includes("VERSIONS"))&&(I=v))}}let M;t[7]!==o?(M=m=>{const A=m.name||m.title||m.server.title||"";return Oe(A)===o},t[7]=o,t[8]=M):M=t[8];let y=v.find(M);if(!y&&c){let m;t[9]!==c?(m=A=>A.server.name===c||A.name===c||A.title===c,t[9]=c,t[10]=m):m=t[10],y=v.find(m)}const j=y?nt(y):null,ae=(j?.tools?.length||0)>0,ce=y?.server?.remotes?.[0]?.url||null,Y=!ae&&!!ce,Z=Be({url:Y?ce:""}),ee=Y&&Z.state==="connecting";let te;t[11]!==Z||t[12]!==Y?(te=Y&&Z.state==="ready"?(Z.tools||[]).map(dt):[],t[11]=Z,t[12]=Y,t[13]=te):te=t[13];const he=te,R=ae?j?.tools||[]:he,ye=rt(x,j?.publisher),de=j?ot(v,j.publisher,ye,b??null,X):{count:0},je=j?.repository?Fe(j.repository):null,me=!!j?.repository&&!!je;let B;t[14]!==me?(B={id:"readme",label:"README",visible:me},t[14]=me,t[15]=B):B=t[15];const fe=ae||he.length>0||ee&&!!ce;let $;t[16]!==R.length||t[17]!==fe?($={id:"tools",label:"Tools",count:R.length,visible:fe},t[16]=R.length,t[17]=fe,t[18]=$):$=t[18];let se;t[19]!==B||t[20]!==$?(se=[B,$].filter(ct),t[19]=B,t[20]=$,t[21]=se):se=t[21];const U=se;let re;t[22]!==l||t[23]!==U?(re=U.find(m=>m.id===l)?l:U.find(at)?.id||U[0]?.id||"overview",t[22]=l,t[23]=U,t[24]=re):re=t[24];const pe=re;let oe;t[25]!==u||t[26]!==I||t[27]!==r||t[28]!==e||t[29]!==y||t[30]!==p?(oe=async m=>{const A=I[m??0]||y;if(!A||!e||!p?.user?.id)return;const V=$e(A,e.id,p.user.id);if(!V.connection_url){ge.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:P}=await u.create.mutateAsync(V);r({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:P}})}catch(P){const D=P;ge.error(`Failed to connect MCP Server: ${D instanceof Error?D.message:String(D)}`)}},t[25]=u,t[26]=I,t[27]=r,t[28]=e,t[29]=y,t[30]=p,t[31]=oe):oe=t[31];const ue=oe;let ne;t[32]!==r||t[33]!==e.slug?(ne=()=>{r({to:"/$org/store",params:{org:e.slug}})},t[32]=r,t[33]=e.slug,t[34]=ne):ne=t[34];const z=ne;if(!y){let m;return t[35]!==z?(m=s.jsx(Qe,{onBack:z}),t[35]=z,t[36]=m):m=t[36],m}if(!j)return null;const O=(y?.server?.remotes?.length??0)>0;let H;t[37]!==z?(H=s.jsx(Xe,{onBack:z}),t[37]=z,t[38]=H):H=t[38];let F;t[39]!==O?(F=!O&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(L,{name:"info",size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=O,t[40]=F):F=t[40];let G;t[41]!==I||t[42]!==y?(G=I.length>0?I:[y],t[41]=I,t[42]=y,t[43]=G):G=t[43];let W;t[44]!==u.create.isPending||t[45]!==O||t[46]!==j||t[47]!==ue||t[48]!==G?(W=s.jsx(Ye,{data:j,itemVersions:G,onInstall:ue,canInstall:O,isInstalling:u.create.isPending}),t[44]=u.create.isPending,t[45]=O,t[46]=j,t[47]=ue,t[48]=G,t[49]=W):W=t[49];let K;t[50]!==j||t[51]!==de||t[52]!==y?(K=s.jsx(et,{data:j,publisherInfo:de,selectedItem:y}),t[50]=j,t[51]=de,t[52]=y,t[53]=K):K=t[53];let q;t[54]!==U||t[55]!==j||t[56]!==pe||t[57]!==R||t[58]!==ee?(q=s.jsx(tt,{data:j,availableTabs:U,effectiveActiveTabId:pe,effectiveTools:R,isLoadingTools:ee,onTabChange:f}),t[54]=U,t[55]=j,t[56]=pe,t[57]=R,t[58]=ee,t[59]=q):q=t[59];let J;t[60]!==K||t[61]!==q?(J=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[K,q]}),t[60]=K,t[61]=q,t[62]=J):J=t[62];let Q;t[63]!==F||t[64]!==W||t[65]!==J?(Q=s.jsx("div",{className:"flex-1 overflow-y-auto pt-10 h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"max-w-7xl mx-auto h-full",children:[F,W,J]})})}),t[63]=F,t[64]=W,t[65]=J,t[66]=Q):Q=t[66];let ie;return t[67]!==H||t[68]!==Q?(ie=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[H,Q]}),t[67]=H,t[68]=Q,t[69]=ie):ie=t[69],ie}function at(t){return t.id==="readme"}function ct(t){return t.visible}function dt(t){return{name:t.name,description:t.description}}function mt(t){return t.name.endsWith("_GET")}function ft(t){return t.name.endsWith("_VERSIONS")}function Rt(){const t=E.c(6),{org:e}=ve(),r=be();let n;t[0]!==r||t[1]!==e.slug?(n=()=>{r({to:"/$org/store",params:{org:e.slug}})},t[0]=r,t[1]=e.slug,t[2]=n):n=t[2];const o=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(le.Suspense,{fallback:s.jsx(qe,{}),children:s.jsx(lt,{})}),t[3]=i):i=t[3];let a;return t[4]!==o?(a=s.jsx(it,{onBack:o,children:i}),t[4]=o,t[5]=a):a=t[5],a}export{Rt as default};
@@ -1 +0,0 @@
1
- import{b5 as u,b1 as s}from"./index-kuMaGV9U.js";function o(e,r){return u(e,s,r)}export{o as u};
@@ -1 +0,0 @@
1
- import{bb as t,at as a}from"./index-kuMaGV9U.js";function e(...r){return t(a(r))}export{e as c};