@decocms/mesh 2.18.0 → 2.20.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.
- package/dist/client/assets/{AlertCircle-CahACZDg.js → AlertCircle-CkNvGXW2.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DlLOWSTj.js → ArrowLeft-BsUDOBX0.js} +1 -1
- package/dist/client/assets/{ArrowUp-Ck0taqJi.js → ArrowUp-Xq_0RBx_.js} +1 -1
- package/dist/client/assets/{Check-Cjgi2ZiG.js → Check-DijrPXQx.js} +1 -1
- package/dist/client/assets/{ChevronDown-BuVzyKHq.js → ChevronDown-DASi-DMo.js} +1 -1
- package/dist/client/assets/{Code01-XpAoNs3W.js → Code01-C0ZFF6Hl.js} +1 -1
- package/dist/client/assets/{Copy01-De4SwxDv.js → Copy01-BQZg7H8u.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-D-Bv2U6B.js → DotsHorizontal-CjU9uXdh.js} +1 -1
- package/dist/client/assets/{DotsVertical-BhTwPxq7.js → DotsVertical-D6TZm5RT.js} +1 -1
- package/dist/client/assets/{Download01-DhkFfGKV.js → Download01-BTR8eSV6.js} +1 -1
- package/dist/client/assets/{Edit01-DsRHb45T.js → Edit01-BsdLQ-QO.js} +1 -1
- package/dist/client/assets/{File06-BiIPMtEV.js → File06-Bm9rDm48.js} +1 -1
- package/dist/client/assets/{FilterLines-C_UJwG_t.js → FilterLines-Dg_ubOas.js} +1 -1
- package/dist/client/assets/{FlipBackward-CQnTJKeB.js → FlipBackward-BZkXBjUF.js} +1 -1
- package/dist/client/assets/{GitBranch01-ClS9Bk6n.js → GitBranch01-DYs19mSG.js} +1 -1
- package/dist/client/assets/{Grid01-CRALWbj6.js → Grid01-CTb93Z2I.js} +1 -1
- package/dist/client/assets/{Home02-ofwnyeoV.js → Home02-CAgSUdC-.js} +1 -1
- package/dist/client/assets/{Image01-Cb4gQMH4.js → Image01-CUinB3ac.js} +1 -1
- package/dist/client/assets/{Inbox01-CKGdnZFH.js → Inbox01-tMW4EgP4.js} +1 -1
- package/dist/client/assets/{InfoCircle-_4UsKVMw.js → InfoCircle-DqeM4n2r.js} +1 -1
- package/dist/client/assets/{Key01-BFJBGJng.js → Key01-BDVEoltU.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C1dAUI0b.js → LinkExternal01-C2ZOZHgx.js} +1 -1
- package/dist/client/assets/{List-DOmOO2Cw.js → List-jMJevXfS.js} +1 -1
- package/dist/client/assets/{Loading01-JwelopeC.js → Loading01-6JGza9Vp.js} +1 -1
- package/dist/client/assets/{Lock01-B7TIX2sZ.js → Lock01-DAc7yIAH.js} +1 -1
- package/dist/client/assets/{Play-CMKLF_6n.js → Play-BWxFDrEk.js} +1 -1
- package/dist/client/assets/{Plus-Df2M6Ns2.js → Plus-Dcgso5EP.js} +1 -1
- package/dist/client/assets/{SearchMd-Cgfgcbdz.js → SearchMd-CbnCIalV.js} +1 -1
- package/dist/client/assets/{Terminal-C8LHfiOW.js → Terminal-DNtUg1U7.js} +1 -1
- package/dist/client/assets/{Trash01-KvZ0cVo9.js → Trash01-CzA8mxf_.js} +1 -1
- package/dist/client/assets/{Upload01-TiwmYxO-.js → Upload01-BPJ4Vq2H.js} +1 -1
- package/dist/client/assets/{X-DhyaYbLb.js → X-C7-BOCtk.js} +1 -1
- package/dist/client/assets/{XClose-2bShEltc.js → XClose-COetRF8H.js} +1 -1
- package/dist/client/assets/{alert-dialog-gZhceV_v.js → alert-dialog-Mcf5ObRp.js} +1 -1
- package/dist/client/assets/{auth-catchall-Dz8qCpUP.js → auth-catchall-JCvomRO1.js} +1 -1
- package/dist/client/assets/{avatar-d8M8JpvZ.js → avatar-D0pQKePK.js} +1 -1
- package/dist/client/assets/{badge-CKe-ib_i.js → badge-9bzwrgbk.js} +1 -1
- package/dist/client/assets/{binder-iKe3ndXq.js → binder-B4r3FJOG.js} +1 -1
- package/dist/client/assets/{button-DXl1hVqx.js → button-C_Xg9B1B.js} +1 -1
- package/dist/client/assets/{card-D0GcpRPY.js → card-BXLd4InC.js} +1 -1
- package/dist/client/assets/{checkbox-D1tHbcIN.js → checkbox-z9w2qryt.js} +1 -1
- package/dist/client/assets/{collection-detail-BQkjgYb7.js → collection-detail-zSSQWfP2.js} +1 -1
- package/dist/client/assets/{collection-display-button-B_KC-ent.js → collection-display-button-DNzo_eaI.js} +1 -1
- package/dist/client/assets/{collection-header-BA9HTLmg.js → collection-header-DMI-enxo.js} +1 -1
- package/dist/client/assets/{collection-page-CDkTC45g.js → collection-page-CPVm36im.js} +1 -1
- package/dist/client/assets/{collection-search-pUdl1eNx.js → collection-search-NPXhv3P8.js} +1 -1
- package/dist/client/assets/collection-tab-DoDfK_be.js +1 -0
- package/dist/client/assets/{collection-table-wrapper-wARoPZXo.js → collection-table-wrapper-CH0cDKjW.js} +1 -1
- package/dist/client/assets/{connection-ByVJuREK.js → connection-DoXpv3Ov.js} +1 -1
- package/dist/client/assets/{connection-card-DjK0GZ2u.js → connection-card-zeRxy9uc.js} +1 -1
- package/dist/client/assets/{connection-detail-BGizcg4Z.js → connection-detail-vV4L4jYp.js} +1 -1
- package/dist/client/assets/{connections-B3vaIw3-.js → connections-DNpwgzUU.js} +1 -1
- package/dist/client/assets/constants-CBp9PjFO.js +1 -0
- package/dist/client/assets/{create-organization-dialog-DKwU0dfN.js → create-organization-dialog-Ro3igzlR.js} +1 -1
- package/dist/client/assets/{dialog-1B3YWWMu.js → dialog-C9Agm5JE.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Hp4qYTud.js → dropdown-menu-fQ8f1M5d.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-j2gEmQEr.js → dynamic-plugin-layout-B3cv12GM.js} +1 -1
- package/dist/client/assets/{empty-state-C7Gr5Tg2.js → empty-state-DBRX3hef.js} +1 -1
- package/dist/client/assets/{empty-state-D-JjObLi.js → empty-state-DdUozeuW.js} +1 -1
- package/dist/client/assets/{env-vars-editor-D4XTsyk0.js → env-vars-editor-BXw6d8cC.js} +1 -1
- package/dist/client/assets/{error-boundary-rr4tK3fB.js → error-boundary-yHT4ni_0.js} +1 -1
- package/dist/client/assets/{extract-connection-data-37AfzoCx.js → extract-connection-data-PVjaut0P.js} +1 -1
- package/dist/client/assets/file-browser-Bh7hl3h8.js +2 -0
- package/dist/client/assets/{form-BQupN7IV.js → form-D_wQlmgT.js} +1 -1
- package/dist/client/assets/gateway-detail-B6I6y-jz.js +1 -0
- package/dist/client/assets/{gateways-jpQl136Z.js → gateways-B0QSXg4v.js} +1 -1
- package/dist/client/assets/grid-view-BsHjiotE.js +1 -0
- package/dist/client/assets/{home-9vMYPTYi.js → home-m3uBo7L5.js} +1 -1
- package/dist/client/assets/{index-D0CzZUCs.js → index-3IJwc3nu.js} +12 -12
- package/dist/client/assets/{index-Bpy9plQL.js → index-Cg8UjPnN.js} +1 -1
- package/dist/client/assets/{index-DEuqpeVv.js → index-DZBCLPmz.js} +2 -2
- package/dist/client/assets/{index-u_K3efbu.js → index-DiisCGqz.js} +1 -1
- package/dist/client/assets/{index-DVolwMvn.js → index-QjJpaT60.js} +31 -31
- package/dist/client/assets/{infiniteQueryObserver-BXdaScti.js → infiniteQueryObserver-CB9iuYaY.js} +1 -1
- package/dist/client/assets/{input-CqqzkfyF.js → input-DrOaW48H.js} +1 -1
- package/dist/client/assets/{layout-D7T4rJzl.js → layout-B4oQiZN6.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-U-fd28FU.js → lazy-highlighter-CSmD3B45.js} +1 -1
- package/dist/client/assets/{localstorage-keys-kemGZMIp.js → localstorage-keys-ColTY5EO.js} +1 -1
- package/dist/client/assets/{login-AsctHrUh.js → login-BdRlUNll.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DqZqwRXe.js → mcp-oauth-CcVuDlog.js} +1 -1
- package/dist/client/assets/{mcp-server-card-DfoQ5M8z.js → mcp-server-card-BnclXini.js} +1 -1
- package/dist/client/assets/mcp-server-detail-DTSTQPDK.js +1 -0
- package/dist/client/assets/{members-eia2aN0I.js → members-BAse2YpR.js} +1 -1
- package/dist/client/assets/{monaco-editor-rl0nEzOU.js → monaco-editor-BtLswDg1.js} +1 -1
- package/dist/client/assets/{monitoring-DWEGkU9y.js → monitoring-FELvrXqN.js} +11 -11
- package/dist/client/assets/{oauth-callback-BFr0fBNT.js → oauth-callback-sXSk4y6N.js} +1 -1
- package/dist/client/assets/page-IVcVoGr6.js +1 -0
- package/dist/client/assets/{page-GoE2bJQh.js → page-c25MW39x.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-CrzVxc9I.js → pin-to-sidebar-button-D7zfHxC-.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CvQbqnfg.js → plugin-empty-state-DINK0udh.js} +1 -1
- package/dist/client/assets/{plugin-header-BaWUIpLx.js → plugin-header-BaOkI6uW.js} +1 -1
- package/dist/client/assets/{plugins-Q7uqmYFh.js → plugins-DU28fvG7.js} +1 -1
- package/dist/client/assets/{popover-BcOo6EXw.js → popover-DDq46px5.js} +1 -1
- package/dist/client/assets/{project-context-provider-Dn1-l4h2.js → project-context-provider-CwtkfEWe.js} +1 -1
- package/dist/client/assets/{registry-utils-85b65tFI.js → registry-utils-nz3H3-qh.js} +1 -1
- package/dist/client/assets/{resizable-DkFmgcsj.js → resizable-ZYLqRZrr.js} +1 -1
- package/dist/client/assets/{resource-tabs-DkDSMlFB.js → resource-tabs-Dv00g9SH.js} +1 -1
- package/dist/client/assets/{select-Bv7J3zlQ.js → select-Cgab7LNB.js} +1 -1
- package/dist/client/assets/{settings-BK8QvMDL.js → settings-CUngx_cw.js} +1 -1
- package/dist/client/assets/shell-layout-IdYGAQZJ.js +3 -0
- package/dist/client/assets/{spinner-D0hdWfev.js → spinner-ISlo4YZH.js} +1 -1
- package/dist/client/assets/{switch-ugX7u7WU.js → switch-BDCe2nGJ.js} +1 -1
- package/dist/client/assets/{textarea-BUrXtpl5.js → textarea-BL4bZEBo.js} +1 -1
- package/dist/client/assets/{tool-set-selector-a1uFioE0.js → tool-set-selector-CWxawPKU.js} +1 -1
- package/dist/client/assets/{tools-list-DpFBj-bw.js → tools-list-BAdvjUaK.js} +1 -1
- package/dist/client/assets/{tooltip-vUrxHIt0.js → tooltip-CpJ7mUzE.js} +1 -1
- package/dist/client/assets/{typewriter-title-7_SusDya.js → typewriter-title-vVGiDyZ3.js} +1 -1
- package/dist/client/assets/{use-binding-B0VMz_Ex.js → use-binding-DGnotkAI.js} +1 -1
- package/dist/client/assets/{use-collections-Cflasxiq.js → use-collections-BmF5uRR6.js} +1 -1
- package/dist/client/assets/{use-connection-DhRUkVvI.js → use-connection-CD3KQhdl.js} +1 -1
- package/dist/client/assets/{use-connection-resources-C-wyp48q.js → use-connection-resources-Bk8Paqb0.js} +1 -1
- package/dist/client/assets/{use-create-gateway-DMkdPgfy.js → use-create-gateway-Buvj1BPg.js} +1 -1
- package/dist/client/assets/{use-gateway-D5VVN1xE.js → use-gateway-HT97xIYl.js} +1 -1
- package/dist/client/assets/use-gateway-system-prompt-DPiQIOlu.js +1 -0
- package/dist/client/assets/{use-list-state-BYREPRxy.js → use-list-state-DceT21J-.js} +1 -1
- package/dist/client/assets/{use-mcp-CZeMxRgK.js → use-mcp-C2xjgZVM.js} +1 -1
- package/dist/client/assets/{use-members-Bi0eIvBO.js → use-members-D-h9QOxK.js} +1 -1
- package/dist/client/assets/{use-mobile-CI2w7svc.js → use-mobile-BH2x5CB1.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D0kNSjbq.js → use-organization-settings-BMsrsPvw.js} +1 -1
- package/dist/client/assets/{use-tool-call-CoI4ZCZe.js → use-tool-call-BmQnCqef.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-hrzJXDha.js +1 -0
- package/dist/client/assets/{useMutation-xcmVYLP7.js → useMutation-DV6K6Nze.js} +1 -1
- package/dist/client/assets/useQuery-mZS4-X0F.js +1 -0
- package/dist/client/assets/{value-C7rJ457O.js → value-BiYWDF0x.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CTWk8Dkt.js → view-mode-toggle-DPk8_aIn.js} +1 -1
- package/dist/client/assets/{workflow-ClKgdB2v.js → workflow-B_8Qc7GH.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +11 -11
- package/dist/server/server.js +11 -11
- package/package.json +2 -2
- package/dist/client/assets/collection-tab-BofyxU3Y.js +0 -1
- package/dist/client/assets/constants-DQVDVC-J.js +0 -1
- package/dist/client/assets/file-browser-BECnO7FM.js +0 -2
- package/dist/client/assets/gateway-detail-B1f7bt6s.js +0 -1
- package/dist/client/assets/grid-view-BwLKimb0.js +0 -1
- package/dist/client/assets/mcp-server-detail-GLsULv7B.js +0 -1
- package/dist/client/assets/page-BeG_Zpat.js +0 -1
- package/dist/client/assets/shell-layout-DImgzYtx.js +0 -3
- package/dist/client/assets/use-gateway-system-prompt-B3fSaA6r.js +0 -1
- package/dist/client/assets/useInfiniteQuery-ckN_t7ea.js +0 -1
- package/dist/client/assets/useQuery-BKyLWvSZ.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/mesh",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.20.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",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@decocms/runtime": "workspace:*",
|
|
55
55
|
"@decocms/vite-plugin": "workspace:*",
|
|
56
56
|
"@hookform/resolvers": "^5.2.2",
|
|
57
|
-
"@modelcontextprotocol/sdk": "1.25.
|
|
57
|
+
"@modelcontextprotocol/sdk": "1.25.2",
|
|
58
58
|
"@monaco-editor/react": "^4.7.0",
|
|
59
59
|
"@opentelemetry/api": "^1.9.0",
|
|
60
60
|
"@opentelemetry/exporter-prometheus": "^0.208.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ne,j as t,K as it,f as nt,k as lt,a as rt,r as at,t as ct}from"./index-DEuqpeVv.js";import{g as Ke}from"./generate-id-Dyweu44Y.js";import{c as Le}from"./connection-ByVJuREK.js";import{C as Re}from"./collection-display-button-B_KC-ent.js";import{C as dt}from"./collection-search-pUdl1eNx.js";import{C as mt}from"./card-D0GcpRPY.js";import{I as Ve,E as ft}from"./empty-state-C7Gr5Tg2.js";import{b as qe,D as Ge,a as We,c as F}from"./dropdown-menu-Hp4qYTud.js";import{B as Oe}from"./button-DXl1hVqx.js";import{a as He}from"./Copy01-De4SwxDv.js";import{i as Je}from"./DotsVertical-BhTwPxq7.js";import{i as Qe}from"./Edit01-DsRHb45T.js";import{s as Ye,u as ut}from"./use-list-state-BYREPRxy.js";import{s as Xe}from"./Trash01-KvZ0cVo9.js";import{C as pt}from"./collection-table-wrapper-wARoPZXo.js";import{E as Me}from"./empty-state-D-JjObLi.js";import{n as Ue}from"./Inbox01-CKGdnZFH.js";import{A as ze}from"./avatar-d8M8JpvZ.js";import{u as ht}from"./useQuery-BKyLWvSZ.js";import{P as xt}from"./pin-to-sidebar-button-CrzVxc9I.js";import{b as gt}from"./use-connection-DhRUkVvI.js";import{a as jt,b as Ct}from"./use-collections-Cflasxiq.js";import{B as vt}from"./constants-DQVDVC-J.js";import{A as bt,g as yt,c as Nt,b as wt,d as St,e as _t,a as Dt,f as At}from"./alert-dialog-gZhceV_v.js";import{s as Tt}from"./Plus-Df2M6Ns2.js";import{V as $t}from"./layout-D7T4rJzl.js";function It(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const d=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of d)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function Pt(n){const e=ne.c(25),{item:s,schema:d,actions:i}=n;let l;e[0]!==s||e[1]!==d?(l=It(d,s),e[0]=s,e[1]=d,e[2]=l):l=e[2];const a=l,c=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==i?(f=i&&Object.keys(i).length>0,e[3]=i,e[4]=f):f=e[4];const o=f;let u;e[5]!==a||e[6]!==s.title?(u=t.jsx(Ve,{icon:a,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=a,e[6]=s.title,e[7]=u):u=e[7];let v;e[8]!==s.title?(v=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=v):v=e[9];const h=c||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==v||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[v,m]}),e[12]=v,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let j;e[18]!==i||e[19]!==o||e[20]!==s?(j=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:kt,onMouseDown:Ot,children:t.jsxs(qe,{children:[t.jsx(Ge,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:t.jsx(Je,{size:20})})}),t.jsxs(We,{align:"end",onClick:Et,children:[i.open&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),i.open?.(s)},children:[t.jsx(Ye,{size:16}),"Open"]}),i.edit&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),i.edit?.(s)},children:[t.jsx(Qe,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(He,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(F,{variant:"destructive",onClick:r=>{r.stopPropagation(),i.delete?.(s)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=j):j=e[21];let S;return e[22]!==y||e[23]!==j?(S=t.jsxs(mt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,j]}),e[22]=y,e[23]=j,e[24]=S):S=e[24],S}function Et(n){return n.stopPropagation()}function zt(n){return n.stopPropagation()}function Ot(n){return n.stopPropagation()}function kt(n){return n.stopPropagation()}function Ft(n){const e=ne.c(9);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Le(),e[0]=s):s=e[0];const d=s;let i;e[1]!==n?(i=it.user(n),e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=async()=>(await d("USER_GET",{id:n})).user,e[3]=n,e[4]=l):l=e[4];const a=!!n;let c;return e[5]!==i||e[6]!==l||e[7]!==a?(c={queryKey:i,queryFn:l,staleTime:3e5,retry:1,enabled:a},e[5]=i,e[6]=l,e[7]=a,e[8]=c):c=e[8],ht(c)}function Kt(n){const e=ne.c(33),{id:s,size:d,showEmail:i,className:l}=n,a=d===void 0?"xs":d,c=i===void 0?!1:i,{data:f,isLoading:o,isError:u}=Ft(s);if(o){const r=`flex items-center gap-2 ${l||""}`;let g;e[0]!==a?(g=t.jsx(ze.Skeleton,{shape:"circle",size:a}),e[0]=a,e[1]=g):g=e[1];let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[2]=C):C=e[2];let p;e[3]!==c?(p=c&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[3]=c,e[4]=p):p=e[4];let _;e[5]!==p?(_=t.jsxs("div",{className:"flex flex-col gap-1",children:[C,p]}),e[5]=p,e[6]=_):_=e[6];let b;return e[7]!==r||e[8]!==g||e[9]!==_?(b=t.jsxs("div",{className:r,children:[g,_]}),e[7]=r,e[8]=g,e[9]=_,e[10]=b):b=e[10],b}if(u||!f){const r=`flex items-center gap-2 ${l||""}`;let g;e[11]!==a?(g=t.jsx(ze,{shape:"circle",size:a,fallback:"?",muted:!0}),e[11]=a,e[12]=g):g=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[13]=C):C=e[13];let p;return e[14]!==r||e[15]!==g?(p=t.jsxs("div",{className:r,children:[g,C]}),e[14]=r,e[15]=g,e[16]=p):p=e[16],p}const v=`flex items-center gap-2 ${l||""}`,h=f.image??void 0;let m;e[17]!==a||e[18]!==h||e[19]!==f.name?(m=t.jsx(ze,{shape:"circle",size:a,url:h,fallback:f.name}),e[17]=a,e[18]=h,e[19]=f.name,e[20]=m):m=e[20];let x;e[21]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[21]=f.name,e[22]=x):x=e[22];let y;e[23]!==c||e[24]!==f.email?(y=c&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[23]=c,e[24]=f.email,e[25]=y):y=e[25];let j;e[26]!==x||e[27]!==y?(j=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[26]=x,e[27]=y,e[28]=j):j=e[28];let S;return e[29]!==v||e[30]!==m||e[31]!==j?(S=t.jsxs("div",{className:v,children:[m,j]}),e[29]=v,e[30]=m,e[31]=j,e[32]=S):S=e[32],S}const Mt=["icon","avatar","logo"],Be=["created_at","created_by","id"];function Ut(n){return Object.keys(n).find(e=>Mt.includes(e.toLowerCase()))}function Ze(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Bt(n){const e=ne.c(32),{data:s,schema:d,viewMode:i,onViewModeChange:l,search:a,sortKey:c,sortDirection:f,onSort:o,actions:u,onItemClick:v,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:j,sortableFields:S}=n,r=l===void 0?Gt:l,g=f===void 0?"asc":f,C=o===void 0?qt:o;let p;e[0]!==u?(p=u===void 0?{}:u,e[0]=u,e[1]=p):p=e[1];const _=p,b=v===void 0?Vt:v,I=h===void 0?null:h,T=m===void 0?null:m,E=x===void 0?!1:x,N=y===void 0?void 0:y,P=j===void 0?!1:j,D=S===void 0?void 0:S;let z;e[2]!==N||e[3]!==d||e[4]!==D?(z=N?N.filter(Rt).filter(k=>!D||D.includes(k.id)).map(Lt):Ze(d,D),e[2]=N,e[3]=d,e[4]=D,e[5]=z):z=e[5];const K=z;let $;e[6]!==I||e[7]!==P||e[8]!==C||e[9]!==r||e[10]!==g||e[11]!==c||e[12]!==K||e[13]!==i?($=!P&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:I}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Re,{viewMode:i,onViewModeChange:r,sortKey:c,sortDirection:g,onSort:C,sortOptions:K})})]})}),e[6]=I,e[7]=P,e[8]=C,e[9]=r,e[10]=g,e[11]=c,e[12]=K,e[13]=i,e[14]=$):$=e[14];let A;e[15]!==_||e[16]!==N||e[17]!==s||e[18]!==T||e[19]!==b||e[20]!==C||e[21]!==E||e[22]!==d||e[23]!==a||e[24]!==g||e[25]!==c||e[26]!==D||e[27]!==i?(A=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:T||t.jsx(Me,{icon:t.jsx(Ue,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(k=>t.jsx("div",{onClick:()=>b?.(k),className:"cursor-pointer h-full",children:t.jsx(Pt,{item:k,schema:d,readOnly:E,actions:_})},k.id))})}):t.jsx(pt,{columns:Jt(N,d,D,_),data:s,sortKey:c,sortDirection:g,onSort:C,onRowClick:b,emptyState:T||t.jsx(Me,{icon:t.jsx(Ue,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=N,e[17]=s,e[18]=T,e[19]=b,e[20]=C,e[21]=E,e[22]=d,e[23]=a,e[24]=g,e[25]=c,e[26]=D,e[27]=i,e[28]=A):A=e[28];let O;return e[29]!==$||e[30]!==A?(O=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[$,A]}),e[29]=$,e[30]=A,e[31]=O):O=e[31],O}function Lt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Rt(n){return n.sortable!==!1}function Vt(){}function qt(){}function Gt(){}function Wt(n){return{id:"actions",header:"",render:e=>t.jsxs(qe,{children:[t.jsx(Ge,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Je,{size:20})})}),t.jsxs(We,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ye,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Qe,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(He,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function et(n){const e=n.type;return Array.isArray(e)?e.every(s=>et({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Ht(n,e){const s=n.properties||{},d=Object.keys(s).filter(o=>{const u=s[o];return u&&et(u)}),i=Ut(s),l=[],a=new Set;i&&d.includes(i)&&(l.push(i),a.add(i));const c=["title","description","updated_at","updated_by"];for(const o of c)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));const f=d.filter(o=>!a.has(o)&&!Be.includes(o)).sort((o,u)=>o.localeCompare(u));for(const o of f)l.push(o),a.add(o);for(const o of Be)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));return l.map(o=>{const u=s[o],v=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:h=>{const m=h[o];return t.jsx(Ve,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:v,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx(Kt,{id:String(m),size:"xs"}):"—"},sortable:v,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:v,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:v,cellClassName:"max-w-[200px]"}})}function Jt(n,e,s,d){const i=n||Ht(e,s);return i.some(c=>c.id==="actions")?i:Object.keys(d).length>0?[...i,Wt(d)]:i}function Ns(n){const e=ne.c(117),{connectionId:s,org:d,activeCollection:i}=n,l=i.name,a=i.schema??vt,c=i.hasCreateTool,f=i.hasUpdateTool,o=i.hasDeleteTool,u=nt(),h=lt().location.href,{data:m}=rt.useSession(),x=m?.user?.id||"unknown",y=gt(s);let j;e[0]!==s?(j=Le(s),e[0]=s,e[1]=j):j=e[1];const S=j,r=jt(s,l,S),g=`${s}-${l}`;let C;e[2]!==d||e[3]!==g?(C={namespace:d,resource:g,defaultSortKey:"updated_at"},e[2]=d,e[3]=g,e[4]=C):C=e[4];const{search:p,searchTerm:_,setSearch:b,viewMode:I,setViewMode:T,sortKey:E,sortDirection:N,handleSort:P}=ut(C);let D;e[5]!==_||e[6]!==N||e[7]!==E?(D={searchTerm:_,sortKey:E,sortDirection:N},e[5]=_,e[6]=N,e[7]=E,e[8]=D):D=e[8];const z=Ct(s,l,S,D),K=!c&&!f&&!o;let $;e[9]!==l||e[10]!==s||e[11]!==u||e[12]!==d?($=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:w.id}})},e[9]=l,e[10]=s,e[11]=u,e[12]=d,e[13]=$):$=e[13];const A=$;let O;e[14]!==r.create||e[15]!==x?(O=async w=>{const he=new Date().toISOString();await r.create.mutateAsync({...w,id:Ke("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[14]=r.create,e[15]=x,e[16]=O):O=e[16];const k=O,[M,xe]=at.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{xe(w)},e[17]=le):le=e[17];const tt=le;let U;e[18]!==A||e[19]!==f?(U=f&&{edit:A},e[18]=A,e[19]=f,e[20]=U):U=e[20];let B;e[21]!==k||e[22]!==c?(B=c&&{duplicate:k},e[21]=k,e[22]=c,e[23]=B):B=e[23];let L;e[24]!==o?(L=o&&{delete:tt},e[24]=o,e[25]=L):L=e[25];let re;e[26]!==L||e[27]!==U||e[28]!==B?(re={...U,...B,...L},e[26]=L,e[27]=U,e[28]=B,e[29]=re):re=e[29];const ge=re;let ae;e[30]!==r.delete||e[31]!==M?(ae=async()=>{M&&(await r.delete.mutateAsync(M.id),xe(null))},e[30]=r.delete,e[31]=M,e[32]=ae):ae=e[32];const je=ae;let ce;e[33]!==r.create||e[34]!==l||e[35]!==s||e[36]!==c||e[37]!==u||e[38]!==d||e[39]!==x?(ce=async()=>{if(!c){ct.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ke("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const Ee=await r.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:Ee.id}})}catch(Ee){console.error("Failed to create item:",Ee)}},e[33]=r.create,e[34]=l,e[35]=s,e[36]=c,e[37]=u,e[38]=d,e[39]=x,e[40]=ce):ce=e[40];const Ce=ce;let de;e[41]!==a?(de=Ze(a),e[41]=a,e[42]=de):de=e[42];const ve=de,ke=(z?.length??0)>0,st=c&&ke,ot=c&&!ke&&!p;let me;e[43]!==r.create||e[44]!==Ce||e[45]!==c?(me=c?t.jsxs(Oe,{onClick:Ce,size:"sm",disabled:r.create.isPending,className:"h-7",children:[t.jsx(Tt,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=Ce,e[45]=c,e[46]=me):me=e[46];const Fe=me,be=E;let R;e[47]!==P||e[48]!==T||e[49]!==N||e[50]!==ve||e[51]!==be||e[52]!==I?(R=t.jsx(Re,{viewMode:I,onViewModeChange:T,sortKey:be,sortDirection:N,onSort:P,sortOptions:ve}),e[47]=P,e[48]=T,e[49]=N,e[50]=ve,e[51]=be,e[52]=I,e[53]=R):R=e[53];const ye=`${l}s`,Ne=y?.icon??"grid_view";let V;e[54]!==ye||e[55]!==Ne||e[56]!==h?(V=t.jsx(xt,{title:ye,url:h,icon:Ne}),e[54]=ye,e[55]=Ne,e[56]=h,e[57]=V):V=e[57];const we=st&&Fe;let q;e[58]!==R||e[59]!==V||e[60]!==we?(q=t.jsxs($t,{children:[R,V,we]}),e[58]=R,e[59]=V,e[60]=we,e[61]=q):q=e[61];const Se=`Search ${l}...`;let G;e[62]!==b?(G=w=>{w.key==="Escape"&&(b(""),w.target.blur())},e[62]=b,e[63]=G):G=e[63];let W;e[64]!==p||e[65]!==b||e[66]!==Se||e[67]!==G?(W=t.jsx(dt,{value:p,onChange:b,placeholder:Se,onKeyDown:G}),e[64]=p,e[65]=b,e[66]=Se,e[67]=G,e[68]=W):W=e[68];let H;e[69]!==z?(H=z??[],e[69]=z,e[70]=H):H=e[70];const _e=E;let J;e[71]!==A?(J=w=>A(w),e[71]=A,e[72]=J):J=e[72];const De="No items found",Ae=p?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=ot?Fe:void 0;let Q;e[73]!==De||e[74]!==Ae||e[75]!==Te?(Q=t.jsx(ft,{image:null,title:De,description:Ae,actions:Te}),e[73]=De,e[74]=Ae,e[75]=Te,e[76]=Q):Q=e[76];let Y;e[77]!==P||e[78]!==K||e[79]!==ge||e[80]!==a||e[81]!==p||e[82]!==b||e[83]!==T||e[84]!==N||e[85]!==H||e[86]!==_e||e[87]!==J||e[88]!==Q||e[89]!==I?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Bt,{hideToolbar:!0,data:H,schema:a,viewMode:I,onViewModeChange:T,search:p,onSearchChange:b,sortKey:_e,sortDirection:N,onSort:P,actions:ge,onItemClick:J,readOnly:K,emptyState:Q})}),e[77]=P,e[78]=K,e[79]=ge,e[80]=a,e[81]=p,e[82]=b,e[83]=T,e[84]=N,e[85]=H,e[86]=_e,e[87]=J,e[88]=Q,e[89]=I,e[90]=Y):Y=e[90];let X;e[91]!==W||e[92]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[91]=W,e[92]=Y,e[93]=X):X=e[93];const $e=!!M;let fe;e[94]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||xe(null)},e[94]=fe):fe=e[94];let ue;e[95]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Nt,{children:"Delete item?"}),e[95]=ue):ue=e[95];const Ie=M?.title;let Z;e[96]!==Ie?(Z=t.jsxs(wt,{children:[ue,t.jsxs(St,{children:['Are you sure you want to delete "',Ie,'"? This action cannot be undone.']})]}),e[96]=Ie,e[97]=Z):Z=e[97];let ee;e[98]!==r.delete.isPending?(ee=t.jsx(bt,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=ee):ee=e[99];const Pe=r.delete.isPending?"Deleting...":"Delete";let te;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==Pe?(te=t.jsx(yt,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=r.delete.isPending,e[101]=je,e[102]=Pe,e[103]=te):te=e[103];let se;e[104]!==ee||e[105]!==te?(se=t.jsxs(_t,{children:[ee,te]}),e[104]=ee,e[105]=te,e[106]=se):se=e[106];let oe;e[107]!==Z||e[108]!==se?(oe=t.jsxs(Dt,{children:[Z,se]}),e[107]=Z,e[108]=se,e[109]=oe):oe=e[109];let ie;e[110]!==$e||e[111]!==oe?(ie=t.jsx(At,{open:$e,onOpenChange:fe,children:oe}),e[110]=$e,e[111]=oe,e[112]=ie):ie=e[112];let pe;return e[113]!==q||e[114]!==X||e[115]!==ie?(pe=t.jsxs(t.Fragment,{children:[q,X,ie]}),e[113]=q,e[114]=X,e[115]=ie,e[116]=pe):pe=e[116],pe}export{Ns as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aJ as a,bo as o}from"./index-DEuqpeVv.js";const e="mcp.mesh",s=a(o,{target:"draft-7"});export{s as B,e as M};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-BwLKimb0.js","assets/index-DEuqpeVv.js","assets/index-Dh9ePU0t.css","assets/button-DXl1hVqx.js","assets/AlertCircle-CahACZDg.js","assets/Download01-DhkFfGKV.js","assets/File06-BiIPMtEV.js","assets/Image01-Cb4gQMH4.js","assets/Loading01-JwelopeC.js","assets/Trash01-KvZ0cVo9.js","assets/Upload01-TiwmYxO-.js","assets/useMutation-xcmVYLP7.js","assets/useQuery-BKyLWvSZ.js","assets/useInfiniteQuery-ckN_t7ea.js","assets/infiniteQueryObserver-BXdaScti.js","assets/checkbox-D1tHbcIN.js","assets/Check-Cjgi2ZiG.js","assets/Grid01-CRALWbj6.js","assets/Home02-ofwnyeoV.js","assets/List-DOmOO2Cw.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as _,c as K,bM as Q,bN as A,x as Y,j as t,t as B,aV as X,bL as ee}from"./index-DEuqpeVv.js";import{u as te}from"./useInfiniteQuery-ckN_t7ea.js";import{B as M}from"./button-DXl1hVqx.js";import{C as D}from"./checkbox-D1tHbcIN.js";import{i as se}from"./AlertCircle-CahACZDg.js";import{c as H,i as ae}from"./Grid01-CRALWbj6.js";import{n as ie}from"./Download01-DhkFfGKV.js";import{a as re}from"./Home02-ofwnyeoV.js";import{i as V}from"./List-DOmOO2Cw.js";import{i as $}from"./Loading01-JwelopeC.js";import{s as W}from"./Trash01-KvZ0cVo9.js";import{i as U}from"./Upload01-TiwmYxO-.js";import{u as G}from"./useMutation-xcmVYLP7.js";const J=({size:s=24,color:e="currentColor",...a})=>_.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},_.createElement("path",{d:"M14 11H8m2 4H8m8-8H8m12-.2v10.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h6.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C20 4.28 20 5.12 20 6.8Z"}));J.displayName="File02";const Z=({size:s=24,color:e="currentColor",...a})=>_.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},_.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));Z.displayName="FolderPlus";const R={objects:(s,e,a=!1,o=100)=>["object-storage","objects",s,e,{flat:a,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},oe=100;function ne(s){const e=K.c(30);let a;e[0]!==s?(a=s===void 0?{}:s,e[0]=s,e[1]=a):a=e[1];const o=a,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?oe:d,{connectionId:b,toolCaller:S}=Q();let f;e[2]!==b||e[3]!==l||e[4]!==c||e[5]!==m?(f=R.objects(b,m,l,c),e[2]=b,e[3]=l,e[4]=c,e[5]=m,e[6]=f):f=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==m||e[10]!==S?(u=async i=>{const{pageParam:r}=i;return await S("LIST_OBJECTS",{prefix:m||void 0,maxKeys:c,continuationToken:r,delimiter:l?void 0:"/"})},e[7]=l,e[8]=c,e[9]=m,e[10]=S,e[11]=u):u=e[11];let E;e[12]!==f||e[13]!==u?(E={queryKey:f,queryFn:u,initialPageParam:void 0,getNextPageParam:he,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:w,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:z}=te(E);let v;if(l){let i;e[15]!==p?.pages?(i=p?.pages.flatMap(pe).filter(xe).map(ue)??[],e[15]=p?.pages,e[16]=i):i=e[16],v=i}else{let i;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(fe)??[],j=p?.pages.flatMap(ce)??[];i=[...r.sort(le),...j],e[17]=p?.pages,e[18]=i}else i=e[18];v=i}let N;e[19]!==h||e[20]!==y||e[21]!==g?(N=()=>{y&&!g&&h()},e[19]=h,e[20]=y,e[21]=g,e[22]=N):N=e[22];const C=N,P=y??!1,F=z;let k;return e[23]!==g||e[24]!==w||e[25]!==C||e[26]!==v||e[27]!==F||e[28]!==P?(k={objects:v,isLoading:w,isFetchingMore:g,hasMore:P,loadMore:C,error:F},e[23]=g,e[24]=w,e[25]=C,e[26]=v,e[27]=F,e[28]=P,e[29]=k):k=e[29],k}function le(s,e){return s.key.localeCompare(e.key)}function ce(s){return s.objects.filter(me).map(de)}function de(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function me(s){return!s.key.endsWith("/")}function fe(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function ue(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function xe(s){return!s.key.endsWith("/")}function pe(s){return s.objects}function he(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function ge(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],a=1024,o=Math.floor(Math.log(s)/Math.log(a));return`${parseFloat((s/Math.pow(a,o)).toFixed(1))} ${e[o]}`}function je(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ye(s){const e=[],a=s.split("/").filter(Boolean);let o="";for(const n of a)o+=n+"/",e.push({name:n,path:o});return e}function $e(s,e){switch(s.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":case"png":case"gif":case"webp":case"svg":return"Image01";case"mp4":case"mov":case"avi":case"webm":return"VideoRecorder";case"mp3":case"wav":case"ogg":return"Music01";case"pdf":return"File06";case"zip":case"tar":case"gz":case"rar":return"File07";case"js":case"ts":case"tsx":case"jsx":case"json":case"html":case"css":return"FileCode01";case"md":case"txt":return"File04";default:return"File02"}}const ve=_.lazy(()=>X(()=>import("./grid-view-BwLKimb0.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])));function Ne(s){const e=K.c(48),{item:a,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==a.key||e[1]!==c?(b=c?a.key:I(a.key),e[0]=a.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(D,{checked:o,onCheckedChange:x,className:"opacity-0 group-hover:opacity-100 focus:opacity-100 data-[state=checked]:opacity-100"}),e[3]=x,e[4]=o,e[5]=f):f=e[5];let u;e[6]!==a.isFolder||e[7]!==a.key||e[8]!==d?(u=()=>a.isFolder?d(a.key):void 0,e[6]=a.isFolder,e[7]=a.key,e[8]=d,e[9]=u):u=e[9];const E=`flex items-center gap-2 flex-1 min-w-0 text-left ${a.isFolder?"cursor-pointer hover:text-primary":""}`;let p;e[10]!==a.isFolder?(p=a.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(J,{size:18,className:"text-muted-foreground shrink-0"}),e[10]=a.isFolder,e[11]=p):p=e[11];let w;e[12]!==S?(w=t.jsx("span",{className:"truncate",children:S}),e[12]=S,e[13]=w):w=e[13];let g;e[14]!==u||e[15]!==E||e[16]!==p||e[17]!==w?(g=t.jsxs("button",{type:"button",onClick:u,className:E,children:[p,w]}),e[14]=u,e[15]=E,e[16]=p,e[17]=w,e[18]=g):g=e[18];let y;e[19]!==a.isFolder||e[20]!==a.size?(y=a.isFolder?"-":ge(a.size),e[19]=a.isFolder,e[20]=a.size,e[21]=y):y=e[21];let h;e[22]!==y?(h=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:y}),e[22]=y,e[23]=h):h=e[23];let z;e[24]!==a.isFolder||e[25]!==a.lastModified?(z=a.isFolder?"-":je(a.lastModified),e[24]=a.isFolder,e[25]=a.lastModified,e[26]=z):z=e[26];let v;e[27]!==z?(v=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:z}),e[27]=z,e[28]=v):v=e[28];let N;e[29]!==a.isFolder||e[30]!==a.key||e[31]!==m?(N=!a.isFolder&&t.jsx(M,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(a.key),children:t.jsx(ie,{size:14})}),e[29]=a.isFolder,e[30]=a.key,e[31]=m,e[32]=N):N=e[32];let C;e[33]!==a.key||e[34]!==l?(C=()=>l(a.key),e[33]=a.key,e[34]=l,e[35]=C):C=e[35];let P;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(W,{size:14}),e[36]=P):P=e[36];let F;e[37]!==C?(F=t.jsx(M,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:C,children:P}),e[37]=C,e[38]=F):F=e[38];let k;e[39]!==N||e[40]!==F?(k=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[N,F]}),e[39]=N,e[40]=F,e[41]=k):k=e[41];let i;return e[42]!==h||e[43]!==v||e[44]!==k||e[45]!==f||e[46]!==g?(i=t.jsxs("div",{className:"group flex items-center gap-3 px-4 py-2 hover:bg-muted/50 border-b border-border last:border-b-0",children:[f,g,h,v,k]}),e[42]=h,e[43]=v,e[44]=k,e[45]=f,e[46]=g,e[47]=i):i=e[47],i}function q(s){const e=K.c(8),{prefix:a,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==a){const x=ye(a);let d;e[3]!==o?(d=()=>o(""),e[3]=o,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(re,{size:16}),e[5]=m):m=e[5];let l;e[6]!==d?(l=t.jsx("button",{type:"button",onClick:d,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground",children:m}),e[6]=d,e[7]=l):l=e[7],n=t.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[l,x.map((c,b)=>t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ae,{size:14,className:"text-muted-foreground"}),t.jsx("button",{type:"button",onClick:()=>o(c.path),className:`hover:text-primary ${b===x.length-1?"font-medium text-foreground":"text-muted-foreground"}`,children:c.name})]},c.path))]}),e[0]=o,e[1]=a,e[2]=n}else n=e[2];return n}function be(){const{path:s="",flat:e=!1,view:a="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=_.useState(new Set),d=i=>{x(new Set),o({to:"/",search:{path:i||void 0,flat:e,view:a}})},m=i=>{x(new Set),o({to:"/",search:{path:i?void 0:s||void 0,flat:i,view:a}})},l=i=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:i}})},c=_.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=Q(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:w,loadMore:g,error:y}=ne({prefix:s,flat:e}),h=G({mutationFn:async i=>{const r=s+i.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:i.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:i,headers:{"Content-Type":i.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:i=>{B.success(`Uploaded ${I(i)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Upload failed: ${i.message}`)}}),z=G({mutationFn:async i=>i.length===1&&i[0]?f("DELETE_OBJECT",{key:i[0]}):f("DELETE_OBJECTS",{keys:i}),onSuccess:()=>{B.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Delete failed: ${i.message}`)}}),v=async i=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:i}),j=await fetch(r);if(!j.ok)throw new Error(`Failed to fetch file: ${j.statusText}`);const T=await j.blob(),O=URL.createObjectURL(T),L=document.createElement("a");L.href=O,L.download=I(i),document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(O)}catch(r){B.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=i=>{const r=i.target.files;if(r){for(const j of Array.from(r))h.mutate(j);i.target.value=""}},C=(i,r)=>{const j=new Set(n);r?j.add(i):j.delete(i),x(j)},P=i=>{x(i?new Set(u.map(r=>r.key)):new Set)},F=()=>{n.size!==0&&z.mutate(Array.from(n))},k=i=>{if(!w||p)return;const r=i.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<200&&g()};return y?t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(se,{size:48,className:"text-destructive mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),t.jsx("p",{className:"text-muted-foreground text-center",children:y.message})]}):a==="grid"?t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(q,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(M,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(M,{variant:a==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(M,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{size:14,className:"mr-1"}),"Upload"]})]})]}),t.jsx(_.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx($,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ve,{prefix:s,flat:e,onNavigate:d})})]}):t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(q,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(M,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(M,{variant:a==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[n.size>0&&t.jsxs(M,{variant:"outline",size:"sm",className:"text-destructive",onClick:F,disabled:z.isPending,children:[t.jsx(W,{size:14,className:"mr-1"}),"Delete (",n.size,")"]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(M,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{size:14,className:"mr-1"}),"Upload"]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border bg-muted/30 text-sm font-medium text-muted-foreground",children:[t.jsx(D,{checked:n.size>0&&n.size===u.length,onCheckedChange:P}),t.jsx("span",{className:"flex-1",children:"Name"}),t.jsx("span",{className:"w-20 text-right",children:"Size"}),t.jsx("span",{className:"w-28 text-right",children:"Modified"}),t.jsx("span",{className:"w-16"})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",onScroll:k,children:E?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx($,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):u.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),t.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),t.jsxs(M,{variant:"outline",onClick:()=>c.current?.click(),children:[t.jsx(U,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(i=>t.jsx(Ne,{item:i,selected:n.has(i.key),showFullPath:e,onSelect:r=>C(i.key,r),onNavigate:d,onDownload:v,onDelete:r=>z.mutate([r])},i.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx($,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const De=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"}));export{R as K,$e as a,De as b,ge as f,I as g,J as i,Z as s,ne as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as S,_ as ye,y as re,I as U,z as _,c as R,j as t,f as Fe,d as tt,b as st,k as ot,af as lt,B as nt,E as it,t as Ae}from"./index-DEuqpeVv.js";import{I as Ee,E as rt}from"./empty-state-C7Gr5Tg2.js";import{E as Ve}from"./error-boundary-rr4tK3fB.js";import{C as Ge}from"./checkbox-D1tHbcIN.js";import{c as H,B as V}from"./button-DXl1hVqx.js";import{i as at}from"./ArrowLeft-DlLOWSTj.js";import{u as We}from"./use-connection-DhRUkVvI.js";import{C as ct}from"./collection-search-pUdl1eNx.js";import{I as Pe}from"./input-CqqzkfyF.js";import{s as dt}from"./Plus-Df2M6Ns2.js";import{i as mt}from"./X-DhyaYbLb.js";import{P as ut}from"./pin-to-sidebar-button-CrzVxc9I.js";import{T as ft}from"./tool-set-selector-a1uFioE0.js";import{b as ht,a as xt,i as pt}from"./use-gateway-D5VVN1xE.js";import{u as gt,a as bt}from"./use-connection-resources-C-wyp48q.js";import{u as jt}from"./use-gateway-system-prompt-B3fSaA6r.js";import{s as He}from"./slugify-CEUa2lfQ.js";import{B as qe}from"./badge-CKe-ib_i.js";import{a as yt,D as vt,c as St,d as Nt}from"./dialog-1B3YWWMu.js";import{F as be,a as _t,b as ve,d as Se,f as Ne,c as wt}from"./form-BQupN7IV.js";import{I as Ct,R as kt,a as It}from"./index-u_K3efbu.js";import{R as Tt}from"./resource-tabs-DkDSMlFB.js";import{S as $t,a as Rt,b as zt,c as At,d as Ue}from"./select-Bv7J3zlQ.js";import{S as Et}from"./switch-ugX7u7WU.js";import{T as Pt}from"./textarea-BUrXtpl5.js";import{a as Z,c as Y,b as J,T as Q}from"./tooltip-vUrxHIt0.js";import{i as Ze}from"./Check-Cjgi2ZiG.js";import{i as Mt}from"./Code01-XpAoNs3W.js";import{a as Dt}from"./Copy01-De4SwxDv.js";import{i as Ut}from"./FlipBackward-CQnTJKeB.js";import{i as je}from"./InfoCircle-_4UsKVMw.js";import{i as ze}from"./Loading01-JwelopeC.js";import{a as Lt,V as Ot,b as Bt}from"./layout-D7T4rJzl.js";import"./connection-ByVJuREK.js";import"./project-context-provider-Dn1-l4h2.js";import"./use-collections-Cflasxiq.js";import"./useMutation-xcmVYLP7.js";import"./SearchMd-Cgfgcbdz.js";import"./use-organization-settings-D0kNSjbq.js";import"./localstorage-keys-kemGZMIp.js";import"./useQuery-BKyLWvSZ.js";import"./ChevronDown-BuVzyKHq.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 Qe=({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"}));Qe.displayName="Lightbulb02";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:"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"}));Ke.displayName="Save01";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:"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"}));Xe.displayName="Share07";const Me=ye(["inclusion","exclusion"]).describe("Tool selection mode: 'inclusion' = include selected (default), 'exclusion' = exclude selected"),Ft=re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().describe("Selected tool names. With 'inclusion' mode: null = all tools included. With 'exclusion' mode: null = entire connection excluded"),selected_resources:U(_()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. With 'inclusion' mode: null = all resources included."),selected_prompts:U(_()).nullable().describe("Selected prompt names. With 'inclusion' mode: null = all prompts included. With 'exclusion' mode: null = entire connection excluded.")}),Vt=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:Me.describe("Tool selection mode: 'inclusion' = include selected, 'exclusion' = exclude selected"),status:ye(["active","inactive"]).describe("Current status"),connections:U(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:Me.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"),connections:U(re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(_()).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:Me.optional().describe("New tool selection mode"),icon:_().nullable().optional().describe("New icon URL (null to clear)"),status:ye(["active","inactive"]).optional().describe("New status"),connections:U(re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).optional().describe("New connections (replaces existing)")});const Gt=S.memo(function(e){const s=R.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(Ee,{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(Ge,{checked:n,onCheckedChange:r,onClick:Ht})]}),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}),Wt=S.memo(function(e){const s=R.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(Ge,{id:p,checked:n,onCheckedChange:a,onClick:qt})}),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 et({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=We({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,L=(h,N)=>{const z=o[h]??[],$=z.includes(N),G={...o};if($){const W=z.filter(q=>q!==N);W.length===0?delete G[h]:G[h]=W}else G[h]=[...z,N];e(G)},B=h=>{const N=v.find(F=>F.id===h);if(!N)return;const z=s(N);if(z.length===0)return;const $=o[h]??[],G=z.map(F=>F.id),W=$.length>0&&G.every(F=>$.includes(F)),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(ct,{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 z=s(h).length,$=o[h.id]?.length??0;return t.jsx(Gt,{connection:h,isSelected:I===h.id,hasItemsEnabled:b(h.id),activeItemsCount:$,totalItemsCount:z,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(V,{variant:"ghost",size:"sm",onClick:M,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(at,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Ee,{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(Wt,{connectionId:C.id,item:h,isSelected:E(C.id,h.id),onToggle:()=>L(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 Ht(o){return o.stopPropagation()}function qt(o){return o.stopPropagation()}function Zt(o){const e=R.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(et,{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 Qt(o){const e=R.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(Pe,{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(dt,{size:16}),e[20]=b):b=e[20];let w;e[21]!==m||e[22]!==v?(w=t.jsx(V,{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(mt,{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 Kt(o){const e=R.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(Xt),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(Qt,{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(et,{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 Xt(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function es(o){const e=R.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(kt,{"data-slot":"radio-group",className:i,...l}),e[5]=l,e[6]=i,e[7]=n):n=e[7],n}function Re(o){const e=R.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(It,{"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(Ct,{"data-slot":"radio-group-item",className:i,...l,children:n}),e[6]=l,e[7]=i,e[8]=a):a=e[8],a}function ts(o){const s=new TextEncoder().encode(o),l=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(l)}const ss=Vt.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 Oe(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 Be(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 os(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 ls(o){const e=R.c(10),{gatewayUrl:s}=o,[l,i]=S.useState(!1);let n;e[0]!==s?(n=async()=>{await navigator.clipboard.writeText(s),i(!0),Ae.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(Ze,{size:20,className:"text-green-600"}):t.jsx(Dt,{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(V,{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 ns(o){const e=R.c(7),{gatewayUrl:s,serverName:l}=o;let i;e[0]!==s||e[1]!==l?(i=()=>{const r=He(l),u=ts(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"),Ae.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(V,{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 is(o){const e=R.c(11),{gatewayUrl:s,serverName:l}=o,[i,n]=S.useState(!1);let a;e[0]!==s||e[1]!==l?(a=async()=>{const f=He(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),Ae.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(Ze,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=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(V,{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 rs(o){const e=R.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(yt,{children:t.jsx(vt,{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(J,{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(Y,{children:[y,t.jsx(Q,{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(Re,{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(Qe,{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(J,{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(Y,{children:[w,t.jsx(Q,{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(Re,{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(Mt,{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(J,{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(Y,{children:[P,t.jsx(Q,{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(Re,{id:"mode-code",value:"code_execution"}),t.jsx(qe,{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 L;e[21]!==n?(L=t.jsxs("div",{className:"flex flex-col gap-3",children:[p,t.jsxs(es,{value:n,onValueChange:m,className:"flex flex-col gap-4.5",children:[j,I,E]})]}),e[21]=n,e[22]=L):L=e[22];let B;e[23]!==r.href?(B=t.jsx(ls,{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(ns,{gatewayUrl:r.href,serverName:u}),M=t.jsx(is,{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]!==L||e[34]!==h?(N=t.jsxs(St,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[f,t.jsxs("div",{className:"flex flex-col gap-6",children:[L,h]})]}),e[33]=L,e[34]=h,e[35]=N):N=e[35];let z;return e[36]!==l||e[37]!==s||e[38]!==N?(z=t.jsx(Nt,{open:s,onOpenChange:l,children:N}),e[36]=l,e[37]=s,e[38]=N,e[39]=z):z=e[39],z}function as(o){const e=R.c(31),{form:s,icon:l,gatewayId:i}=o,[n,a]=jt(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(pt,{}),e[2]=m):m=e[2];let r;e[3]!==l||e[4]!==c?(r=t.jsx(Ee,{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:us}),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:ms}),t.jsx(be,{control:s.control,name:"description",render:ds})]}),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:cs})}),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(Pt,{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(_t,{...s,children:v})}),e[28]=s,e[29]=v,e[30]=b):b=e[30],b}function cs(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(wt,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Z,{children:t.jsxs(Y,{children:[t.jsx(J,{asChild:!0,children:t.jsx(V,{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(Q,{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($t,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Se,{children:t.jsx(Rt,{className:"w-[180px]",children:t.jsx(zt,{})})}),t.jsxs(At,{children:[t.jsx(Ue,{value:"inclusion",children:"Include Selected"}),t.jsx(Ue,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Ne,{})]})}function ds(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Pe,{...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 ms(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Pe,{...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 us(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(qe,{variant:e.value==="active"?"success":"outline",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Se,{children:t.jsx(Et,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Ne,{})]})}function fs(o){const e=R.c(81),{gateway:s,gatewayId:l,requestedTabId:i}=o,a=ot().location.href,c=lt();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=xt();let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u={},e[1]=u):u=e[1];const f=We(u);let p;e[2]!==f?(p=f.map(xs),e[2]=f,e[3]=p):p=e[3];const x=p,{promptsMap:g}=gt(x),{resourcesMap:y}=bt(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(hs));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=()=>Oe(s),e[9]=s,e[10]=I):I=e[10];const[k,C]=S.useState(I);let P;e[11]!==s?(P=()=>Be(s),e[11]=s,e[12]=P):P=e[12];const[E,L]=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 z=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=>{L(T),A(!0)},e[15]=W):W=e[15];const q=W;let F;e[16]===Symbol.for("react.memo_cache_sentinel")?(F=nt(ss),e[16]=F):F=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:F,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 O=it(ce),we=O.formState.isDirty||B;let de;e[22]!==d.update||e[23]!==j||e[24]!==O||e[25]!==l||e[26]!==E||e[27]!==k||e[28]!==b?(de=async()=>{const T=O.getValues(),$e=os(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}}),O.reset(T),A(!1)},e[22]=d.update,e[23]=j,e[24]=O,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]!==O||e[32]!==s?(me=()=>{O.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion"}),w(Le(s,j)),C(Oe(s)),L(Be(s)),A(!1)},e[30]=j,e[31]=O,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 De=ue,D=De.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(Tt,{tabs:De,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(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{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(Q,{side:"bottom",children:"Cancel"})]})}),t.jsx(Z,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ae,onClick:Ce,"aria-label":"Save",children:ae?t.jsx(ze,{size:14,className:"animate-spin"}):t.jsx(Ke,{size:14})})})}),t.jsx(Q,{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(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:he,"aria-label":"Share",children:t.jsx(Xe,{size:14})})})}),t.jsx(Q,{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(ut,{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(Ot,{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(ze,{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]!==O||e[61]!==s.icon||e[62]!==l||e[63]!==E||e[64]!==k||e[65]!==b?(oe=D==="settings"?t.jsx(as,{form:O,icon:s.icon,gatewayId:l}):D==="tools"?t.jsx(ft,{toolSet:b,onToolSetChange:z}):D==="resources"?t.jsx(Kt,{resourceSet:k,onResourceSetChange:G,connectionResources:y}):D==="prompts"?t.jsx(Zt,{promptSet:E,onPromptSetChange:q,connectionPrompts:g}):null,e[57]=D,e[58]=g,e[59]=y,e[60]=O,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(Ve,{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(rs,{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(Bt,{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 hs(o){return o.name}function xs(o){return o.id}function ps(){const o=R.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}=tt(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=st(a).tab||"settings",r=ht(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(rt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(V,{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(fs,{gateway:r,gatewayId:i,requestedTabId:m}),o[6]=r,o[7]=i,o[8]=m,o[9]=d):d=o[9],d}function gs(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ve,{children:t.jsx(S.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ps,{})})}),o[0]=e):e=o[0],e}function ro(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(gs,{}),o[0]=e):e=o[0],e}export{ro as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as b,c as I,bM as _,j as s,x as O,t as F,bL as q}from"./index-DEuqpeVv.js";import{K as z,u as H,g as L,s as Z,a as Q,i as R,f as T}from"./file-browser-BECnO7FM.js";import{B as w}from"./button-DXl1hVqx.js";import{i as D}from"./AlertCircle-CahACZDg.js";import{n as W}from"./Download01-DhkFfGKV.js";import{i as A}from"./File06-BiIPMtEV.js";import{a as S}from"./Image01-Cb4gQMH4.js";import{i as $}from"./Loading01-JwelopeC.js";import{s as U}from"./Trash01-KvZ0cVo9.js";import{i as J}from"./Upload01-TiwmYxO-.js";import{u as V}from"./useMutation-xcmVYLP7.js";import{u as Y}from"./useQuery-BKyLWvSZ.js";import"./useInfiniteQuery-ckN_t7ea.js";import"./infiniteQueryObserver-BXdaScti.js";import"./checkbox-D1tHbcIN.js";import"./Check-Cjgi2ZiG.js";import"./Grid01-CRALWbj6.js";import"./Home02-ofwnyeoV.js";import"./List-DOmOO2Cw.js";const P=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));P.displayName="File04";const B=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File07";const G=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="FileCode01";const K=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));K.displayName="VideoRecorder";function X(o){const e=I.c(5),[t,g]=b.useState(!1),c=b.useRef(null),f=b.useRef(!1);let n;e[0]!==o?(n=d=>{c.current&&(c.current.disconnect(),c.current=null),d&&!f.current&&(c.current=new IntersectionObserver(y=>{const[a]=y;a?.isIntersecting&&!f.current&&(f.current=!0,g(!0),c.current?.disconnect(),c.current=null)},o),c.current.observe(d))},e[0]=o,e[1]=n):n=e[1];const l=n;let p;return e[2]!==t||e[3]!==l?(p=[t,l],e[2]=t,e[3]=l,e[4]=p):p=e[4],p}function ee(o){const e=I.c(22),{objectKey:t,alt:g,className:c}=o,f=c===void 0?"":c,{connectionId:n,toolCaller:l}=_();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={rootMargin:"100px",threshold:0},e[0]=p):p=e[0];const[d,y]=X(p);let a;e[1]!==n||e[2]!==t?(a=z.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=a):a=e[3];let m;e[4]!==t||e[5]!==l?(m=async()=>{const{url:u}=await l("GET_PRESIGNED_URL",{key:t});return u},e[4]=t,e[5]=l,e[6]=m):m=e[6];let k;e[7]!==d||e[8]!==a||e[9]!==m?(k={queryKey:a,queryFn:m,enabled:d,staleTime:3e5,gcTime:6e5},e[7]=d,e[8]=a,e[9]=m,e[10]=k):k=e[10];const{data:h,isLoading:x,error:j}=Y(k),v=`relative w-full h-full flex items-center justify-center overflow-hidden ${f}`;let r;e[11]!==g||e[12]!==j||e[13]!==h||e[14]!==x||e[15]!==d||e[16]!==t?(r=!d||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx($,{size:24,className:"animate-spin"}):s.jsx(S,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(D,{size:24})}):h?s.jsx("img",{src:h,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[11]=g,e[12]=j,e[13]=h,e[14]=x,e[15]=d,e[16]=t,e[17]=r):r=e[17];let i;return e[18]!==y||e[19]!==v||e[20]!==r?(i=s.jsx("div",{ref:y,className:v,children:r}),e[18]=y,e[19]=v,e[20]=r,e[21]=i):i=e[21],i}const E=12,te={Image01:S,VideoRecorder:K,Music01:R,File02:R,File04:P,File06:A,File07:B,FileCode01:G,Folder:q};function se(o){const e=o.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function re(o){const e=I.c(38),{item:t,onNavigate:g,onDownload:c,onDelete:f}=o;let n;e[0]!==t.key?(n=L(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,p=t.isFolder?"Folder":Q(t.key),d=te[p]||R;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&se(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const a=y;let m;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(m=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=m):m=e[8];const k=`flex flex-col items-center justify-center w-full h-full ${a?"":"p-4"} ${t.isFolder?"cursor-pointer":"cursor-default"}`;let h;e[9]!==d||e[10]!==a||e[11]!==t.isFolder||e[12]!==t.key||e[13]!==l?(h=a?s.jsx("div",{className:"absolute inset-0",children:s.jsx(ee,{objectKey:t.key,alt:l})}):s.jsx(d,{size:48,className:t.isFolder?"text-amber-500":"text-muted-foreground"}),e[9]=d,e[10]=a,e[11]=t.isFolder,e[12]=t.key,e[13]=l,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==t.isFolder||e[17]!==t.size||e[18]!==l?(x=a?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:T(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:T(t.size)})]}),e[15]=a,e[16]=t.isFolder,e[17]=t.size,e[18]=l,e[19]=x):x=e[19];let j;e[20]!==m||e[21]!==k||e[22]!==h||e[23]!==x?(j=s.jsxs("button",{type:"button",onClick:m,className:k,children:[h,x]}),e[20]=m,e[21]=k,e[22]=h,e[23]=x,e[24]=j):j=e[24];let v;e[25]!==t.isFolder||e[26]!==t.key||e[27]!==f||e[28]!==c?(v=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:u=>{u.stopPropagation(),c(t.key)},children:s.jsx(W,{size:14})}),s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:u=>{u.stopPropagation(),f(t.key)},children:s.jsx(U,{size:14})})]}),e[25]=t.isFolder,e[26]=t.key,e[27]=f,e[28]=c,e[29]=v):v=e[29];let r;e[30]!==t.isFolder||e[31]!==t.key||e[32]!==f?(r=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:u=>{u.stopPropagation(),f(t.key)},children:s.jsx(U,{size:14})})}),e[30]=t.isFolder,e[31]=t.key,e[32]=f,e[33]=r):r=e[33];let i;return e[34]!==j||e[35]!==v||e[36]!==r?(i=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[j,v,r]}),e[34]=j,e[35]=v,e[36]=r,e[37]=i):i=e[37],i}function Ne({prefix:o,flat:e,onNavigate:t}){const g=b.useRef(null),c=O(),{connectionId:f,toolCaller:n}=_(),{objects:l,isLoading:p,isFetchingMore:d,hasMore:y,loadMore:a,error:m}=H({prefix:o,flat:e,pageSize:E}),k=V({mutationFn:async r=>{const i=o+r.name,{url:u}=await n("PUT_PRESIGNED_URL",{key:i,contentType:r.type||"application/octet-stream"}),C=await fetch(u,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!C.ok)throw new Error(`Upload failed: ${C.statusText}`);return i},onSuccess:r=>{F.success(`Uploaded ${L(r)}`),c.invalidateQueries({queryKey:z.objects(f,o,e,E)})},onError:r=>{F.error(`Upload failed: ${r.message}`)}}),h=V({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{F.success("Deleted successfully"),c.invalidateQueries({queryKey:z.objects(f,o,e,E)})},onError:r=>{F.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:i}=await n("GET_PRESIGNED_URL",{key:r}),u=await fetch(i);if(!u.ok)throw new Error(`Failed to fetch file: ${u.statusText}`);const C=await u.blob(),M=URL.createObjectURL(C),N=document.createElement("a");N.href=M,N.download=L(r),document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(M)}catch(i){F.error(`Download failed: ${i instanceof Error?i.message:"Unknown error"}`)}},j=r=>{const i=r.target.files;if(i){for(const u of Array.from(i))k.mutate(u);r.target.value=""}},v=r=>{if(!y||d)return;const i=r.currentTarget;i.scrollHeight-i.scrollTop-i.clientHeight<200&&a()};return m?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(D,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:m.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:v,children:p?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx($,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(w,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(J,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(re,{item:r,onNavigate:t,onDownload:x,onDelete:i=>h.mutate([i])},r.key))}),d&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx($,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{Ne as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as q,c as R,j as s,f as $e,d as Qe,b as Xe,a as Ye,t as Le}from"./index-DEuqpeVv.js";import{i as Ze}from"./AlertCircle-CahACZDg.js";import{i as De}from"./Loading01-JwelopeC.js";import{B as ae}from"./button-DXl1hVqx.js";import{i as Je}from"./ArrowLeft-DlLOWSTj.js";import{I as Re,E as et}from"./empty-state-C7Gr5Tg2.js";import{i as tt,e as st}from"./extract-connection-data-37AfzoCx.js";import{t as ot}from"./ChevronDown-BuVzyKHq.js";import{s as Pe}from"./Plus-Df2M6Ns2.js";import{D as rt,c as nt,a as it,b as lt}from"./dropdown-menu-Hp4qYTud.js";import{n as Me}from"./LinkExternal01-C1dAUI0b.js";import{T as at,R as ct}from"./tools-list-DpFBj-bw.js";import{R as dt}from"./resource-tabs-DkDSMlFB.js";import{s as mt,f as ft,g as ut,c as pt}from"./registry-utils-85b65tFI.js";import{a as xt,b as ht,e as gt}from"./mcp-server-card-DfoQ5M8z.js";import{i as vt}from"./Terminal-C8LHfiOW.js";import{a as bt,u as jt,b as yt}from"./use-connection-DhRUkVvI.js";import{u as Nt}from"./use-binding-B0VMz_Ex.js";import{u as St}from"./use-tool-call-CoI4ZCZe.js";import{u as Ct}from"./use-mcp-CZeMxRgK.js";import{u as wt,L as _t}from"./localstorage-keys-kemGZMIp.js";import{u as Ee}from"./project-context-provider-Dn1-l4h2.js";import{s as It}from"./slugify-CEUa2lfQ.js";import{e as kt,g as Tt}from"./github-icon-Dp3wHhYE.js";import{i as Lt}from"./InfoCircle-_4UsKVMw.js";import{c as Pt}from"./connection-ByVJuREK.js";import"./constants-DQVDVC-J.js";import"./generate-id-Dyweu44Y.js";import"./Grid01-CRALWbj6.js";import"./useQuery-BKyLWvSZ.js";import"./File06-BiIPMtEV.js";import"./collection-display-button-B_KC-ent.js";import"./ArrowUp-Ck0taqJi.js";import"./Check-Cjgi2ZiG.js";import"./List-DOmOO2Cw.js";import"./tooltip-vUrxHIt0.js";import"./view-mode-toggle-CTWk8Dkt.js";import"./collection-search-pUdl1eNx.js";import"./SearchMd-Cgfgcbdz.js";import"./input-CqqzkfyF.js";import"./collection-table-wrapper-wARoPZXo.js";import"./card-D0GcpRPY.js";import"./layout-D7T4rJzl.js";import"./badge-CKe-ib_i.js";import"./Lock01-B7TIX2sZ.js";import"./use-collections-Cflasxiq.js";import"./useMutation-xcmVYLP7.js";import"./binder-iKe3ndXq.js";const Ae=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));Ae.displayName="SearchLg";function Mt(t){const e=R.c(3),{message:o}=t,r=o===void 0?"Loading MCP Server details...":o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(De,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==r?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,s.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[1]=r,e[2]=i):i=e[2],i}function Vt(t){const e=R.c(9),{error:o,onBack:r}=t,n=o instanceof Error?o.message:o;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ze,{size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==n?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==r?(l=s.jsx("button",{onClick:r,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=r,e[5]=l):l=e[5];let d;return e[6]!==c||e[7]!==l?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=d):d=e[8],d}function $t(t){const e=R.c(5),{onBack:o}=t;let r,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ae,{size:48,className:"text-muted-foreground mb-4"}),n=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=r,e[1]=n,e[2]=i):(r=e[0],n=e[1],i=e[2]);let a;return e[3]!==o?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,n,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=a):a=e[4],a}function Dt(t){const e=R.c(3),{onBack:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Je,{}),e[0]=r):r=e[0];let n;return e[1]!==o?(n=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ae,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:r})})}),e[1]=o,e[2]=n):n=e[2],n}function Ve(t){const e=R.c(26),{versions:o,selectedIndex:r,onSelect:n,isInstalling:i,variant:a,showLabel:c}=t,l=i===void 0?!1:i,d=a===void 0?"brand":a,w=c===void 0?!1:c,u=o[r],S=w?"sm":"default",v=d==="brand"?"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer":"shrink-0 cursor-pointer";let _;e[0]!==u?.server?.version||e[1]!==w?(_=w&&s.jsxs("span",{className:"mr-1",children:["v",u?.server?.version||"unknown"]}),e[0]=u?.server?.version,e[1]=w,e[2]=_):_=e[2];const p=w?14:20;let b;e[3]!==p?(b=s.jsx(ot,{size:p}),e[3]=p,e[4]=b):b=e[4];let m;e[5]!==l||e[6]!==S||e[7]!==v||e[8]!==_||e[9]!==b||e[10]!==d?(m=s.jsx(rt,{asChild:!0,children:s.jsxs(ae,{variant:d,disabled:l,size:S,className:v,children:[_,b]})}),e[5]=l,e[6]=S,e[7]=v,e[8]=_,e[9]=b,e[10]=d,e[11]=m):m=e[11];let g;if(e[12]!==l||e[13]!==n||e[14]!==r||e[15]!==o){let y;e[17]!==l||e[18]!==n||e[19]!==r?(y=(j,N)=>{const I=j._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(nt,{onClick:()=>n(N),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",j.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),N===r&&s.jsx(tt,{size:16,className:"text-muted-foreground shrink-0"})]})},N)},e[17]=l,e[18]=n,e[19]=r,e[20]=y):y=e[20],g=o.map(y),e[12]=l,e[13]=n,e[14]=r,e[15]=o,e[16]=g}else g=e[16];let x;e[21]!==g?(x=s.jsx(it,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:g}),e[21]=g,e[22]=x):x=e[22];let T;return e[23]!==x||e[24]!==m?(T=s.jsxs(lt,{children:[m,x]}),e[23]=x,e[24]=m,e[25]=T):T=e[25],T}function Rt(t){const e=R.c(46),{data:o,itemVersions:r,onInstall:n,canInstall:i,isInstalling:a,hideInstallControls:c,selectedVersionIndex:l,onVersionChange:d}=t,w=i===void 0?!0:i,u=a===void 0?!1:a,S=c===void 0?!1:c,[v,_]=q.useState(0),p=l??v;let b;e[0]!==d?(b=U=>{_(U),d?.(U)},e[0]=d,e[1]=b):b=e[1];const m=b,g=r[p]||r[0];let x;e[2]!==g?.server?.remotes?(x=g?.server?.remotes??[],e[2]=g?.server?.remotes,e[3]=x):x=e[3];const T=x;let y;e[4]!==g?.server?.packages?(y=g?.server?.packages??[],e[4]=g?.server?.packages,e[5]=y):y=e[5];const N=y.length>0,I=T.length>0,M=T.findIndex(At),h=M>=0?M:0;let K;e[6]!==h||e[7]!==N||e[8]!==I||e[9]!==n||e[10]!==p?(K=()=>{I?n(p,h,void 0):N&&n(p,void 0,0)},e[6]=h,e[7]=N,e[8]=I,e[9]=n,e[10]=p,e[11]=K):K=e[11];const E=K;let G;e[12]!==r||e[13]!==n||e[14]!==m?(G=U=>{m(U);const J=r[U],W=J?.server?.remotes??[],Q=J?.server?.packages??[];if(W.length>0){const X=W.findIndex(Et);n(U,X>=0?X:0,void 0)}else Q.length>0&&n(U,void 0,0)},e[12]=r,e[13]=n,e[14]=m,e[15]=G):G=e[15];const L=G;let V;e[16]!==o.icon||e[17]!==o.name?(V=s.jsx(Re,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=o.icon,e[17]=o.name,e[18]=V):V=e[18];let P;e[19]!==o.name?(P=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[19]=o.name,e[20]=P):P=e[20];let z;e[21]!==o.verified?(z=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=o.verified,e[22]=z):z=e[22];let O;e[23]!==P||e[24]!==z?(O=s.jsxs("div",{className:"flex items-center gap-2",children:[P,z]}),e[23]=P,e[24]=z,e[25]=O):O=e[25];let H;e[26]!==o.shortDescription?(H=o.shortDescription&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.shortDescription}),e[26]=o.shortDescription,e[27]=H):H=e[27];let $;e[28]!==O||e[29]!==H?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[O,H]}),e[28]=O,e[29]=H,e[30]=$):$=e[30];let A;e[31]!==w||e[32]!==E||e[33]!==L||e[34]!==S||e[35]!==u||e[36]!==r||e[37]!==p||e[38]!==m?(A=w&&!S?s.jsx("div",{className:"shrink-0 flex items-center gap-2",children:r.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ae,{variant:"brand",onClick:E,disabled:u,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(Pe,{size:20}),u?"Connecting...":"Connect"]}),s.jsx(Ve,{versions:r,selectedIndex:p,onSelect:L,isInstalling:u,variant:"brand"})]}):s.jsxs(ae,{variant:"brand",onClick:E,disabled:r.length===0||u,className:"shrink-0 cursor-pointer",children:[s.jsx(Pe,{size:20}),u?"Connecting...":"Connect"]})}):S?r.length>1?s.jsx("div",{className:"shrink-0",children:s.jsx(Ve,{versions:r,selectedIndex:p,onSelect:m,isInstalling:u,variant:"outline",showLabel:!0})}):null:s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=w,e[32]=E,e[33]=L,e[34]=S,e[35]=u,e[36]=r,e[37]=p,e[38]=m,e[39]=A):A=e[39];let C;e[40]!==$||e[41]!==A?(C=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[$,A]}),e[40]=$,e[41]=A,e[42]=C):C=e[42];let k;return e[43]!==C||e[44]!==V?(k=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[V,C]}),e[43]=C,e[44]=V,e[45]=k):k=e[45],k}function Et(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function At(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Ut(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function Bt(t){const e=R.c(47),{data:o,publisherInfo:r,selectedItem:n}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const a=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let c;e[2]!==r.logo||e[3]!==a?(c=s.jsx(Re,{icon:r.logo,name:a,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=r.logo,e[3]=a,e[4]=c):c=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let d;e[7]!==l?(d=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=d):d=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=w):w=e[9];let u;e[10]!==d?(u=s.jsxs("div",{children:[d,w]}),e[10]=d,e[11]=u):u=e[11];let S;e[12]!==c||e[13]!==u?(S=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,u]})}),e[12]=c,e[13]=u,e[14]=S):S=e[14];let v;e[15]!==o.version?(v=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[15]=o.version,e[16]=v):v=e[16];let _;e[17]!==o.tags?(_=o.tags&&o.tags.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.tags.map(Ot)})]}),e[17]=o.tags,e[18]=_):_=e[18];let p;e[19]!==o.categories?(p=o.categories&&o.categories.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.categories.map(zt)})]}),e[19]=o.categories,e[20]=p):p=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let m;e[23]!==o.schemaVersion?(m=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=m):m=e[24];let g;e[25]!==o.websiteUrl?(g=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(Me,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=g):g=e[26];let x;e[27]!==o.repository?(x=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(Me,{size:14})]})]}),e[27]=o.repository,e[28]=x):x=e[28];let T;e[29]!==_||e[30]!==p||e[31]!==b||e[32]!==m||e[33]!==g||e[34]!==x||e[35]!==v?(T=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[v,_,p,b,m,g,x]}),e[29]=_,e[30]=p,e[31]=b,e[32]=m,e[33]=g,e[34]=x,e[35]=v,e[36]=T):T=e[36];let y;e[37]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=y):y=e[37];let j;e[38]!==n.updated_at?(j=Ut(n.updated_at),e[38]=n.updated_at,e[39]=j):j=e[39];let N;e[40]!==j?(N=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[y,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:j})]}),e[40]=j,e[41]=N):N=e[41];let I;return e[42]!==i||e[43]!==T||e[44]!==N||e[45]!==S?(I=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,S,T,N]}),e[42]=i,e[43]=T,e[44]=N,e[45]=S,e[46]=I):I=e[46],I}function zt(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function Ot(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}const Ft=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],Gt={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Ht(t){if(!t)return"Local";try{return new URL(t).hostname}catch{return t}}function Wt(t){if(!t)return"local";try{const e=new URL(t).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function qt(t){const e=Gt[t.toLowerCase()];return e||t.replace(/[-_]/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function Kt(t){if(!t)return"http";const e=t.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function Qt(t){return t.map((e,o)=>{const r=Kt(e.type),n=Ht(e.url),i=Wt(e.url),a=e.title||e.name||qt(i);return{index:o,protocol:r,url:e.url,hostname:n,serviceName:i,displayName:a,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Xt(t){const e=R.c(2),{protocol:o,className:r}=t;let n;return e[0]!==r?(n={http:s.jsx(mt,{className:r}),sse:s.jsx(ht,{className:r}),stdio:s.jsx(vt,{className:r})},e[0]=r,e[1]=n):n=e[1],n[o]}function Yt(t){const e=R.c(10),{options:o,selected:r,onSelect:n}=t;if(o.length<=1)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=i):i=e[0];let a;if(e[1]!==n||e[2]!==o||e[3]!==r){let l;e[5]!==n||e[6]!==r?(l=d=>s.jsxs(ae,{variant:r===d.value?"default":"outline",size:"sm",onClick:()=>n(d.value),className:"cursor-pointer",children:[s.jsx(Xt,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=n,e[6]=r,e[7]=l):l=e[7],a=o.map(l),e[1]=n,e[2]=o,e[3]=r,e[4]=a}else a=e[4];let c;return e[8]!==a?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i,s.jsx("div",{className:"flex gap-1",children:a})]}),e[8]=a,e[9]=c):c=e[9],c}function Zt(t){const e=R.c(11),{servers:o,onInstall:r,isInstalling:n,icon:i,mcpName:a,showStdio:c}=t,l=n===void 0?!1:n,d=c===void 0?!1:c,w=d?o:o.filter(ss),u=Qt(w),S=u.length<13?"all":"http",[v,_]=q.useState(S);let p;e:{if(v==="all"){p="all";break e}let h;if(e[0]!==v?(h=E=>E.protocol===v,e[0]=v,e[1]=h):h=e[1],u.some(h)){p=v;break e}if(u.length<13){p="all";break e}p=u[0]?.protocol??"http"}const b=p,m=b==="all"?u:u.filter(h=>h.protocol===b),g=new Set(u.map(ts));let x=Ft.filter(h=>h.value==="all"||g.has(h.value));d||(x=x.filter(es));const T=g.size<=1?x.filter(Jt):x,y="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let j;e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==r?(j=h=>s.jsx(xt,{variant:"server",icon:i??null,displayName:h.displayName,description:h.description??null,hostname:h.hostname,protocol:h.protocol,isInstalling:l,onClick:()=>r({type:h.protocol,url:h.url,name:h.name,title:h.title,description:h.description,_type:h._type,_index:h._index})},`${h.hostname}-${h.protocol}-${h.index}`),e[2]=i,e[3]=l,e[4]=a,e[5]=r,e[6]=j):j=e[6];const N=m.map(j);let I;e[7]!==N?(I=s.jsx("div",{className:y,children:N}),e[7]=N,e[8]=I):I=e[8];let M;return e[9]!==m.length?(M=m.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=m.length,e[10]=M):M=e[10],s.jsxs("div",{className:"p-5",children:[s.jsx(Yt,{options:T,selected:b,onSelect:_}),I,M]})}function Jt(t){return t.value!=="all"}function es(t){return t.value!=="stdio"}function ts(t){return t.protocol}function ss(t){return t.type?.toLowerCase()!=="stdio"}function os(t){const e=R.c(29),{data:o,availableTabs:r,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:a,onTabChange:c,servers:l,onInstallServer:d,isInstalling:w,mcpIcon:u,mcpName:S,showStdio:v}=t,_=a===void 0?!1:a;let p;e[0]!==l?(p=l===void 0?[]:l,e[0]=l,e[1]=p):p=e[1];const b=p,m=w===void 0?!1:w,g=v===void 0?!1:v;let x;e[2]!==i?(x=i.map(rs),e[2]=i,e[3]=x):x=e[3];const T=x;let y;e[4]!==r||e[5]!==n||e[6]!==c?(y=r.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(dt,{tabs:r,activeTab:n,onTabChange:c})}),e[4]=r,e[5]=n,e[6]=c,e[7]=y):y=e[7];let j;e[8]!==n||e[9]!==m||e[10]!==u||e[11]!==S||e[12]!==d||e[13]!==b||e[14]!==g?(j=n==="servers"&&b.length>0&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Zt,{servers:b,onInstall:h=>d?.(h),isInstalling:m,icon:u,mcpName:S,showStdio:g})}),e[8]=n,e[9]=m,e[10]=u,e[11]=S,e[12]=d,e[13]=b,e[14]=g,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==i.length||e[18]!==_||e[19]!==T?(N=n==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:_?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(De,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(at,{tools:T,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):s.jsx(et,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[16]=n,e[17]=i.length,e[18]=_,e[19]=T,e[20]=N):N=e[20];let I;e[21]!==o?.repository||e[22]!==n?(I=n==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(ct,{repository:o?.repository})}),e[21]=o?.repository,e[22]=n,e[23]=I):I=e[23];let M;return e[24]!==I||e[25]!==y||e[26]!==j||e[27]!==N?(M=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[y,j,N,I]}),e[24]=I,e[25]=y,e[26]=j,e[27]=N,e[28]=M):M=e[28],M}function rs(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ns(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(r=>r.app_name?.toLowerCase()===o||r.app_id?.toLowerCase()===o||r.title.toLowerCase()===o)||t.find(r=>r.title.toLowerCase().includes(o))}function is(t,e,o,r,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:r?.icon||void 0,count:n??t.length};const i=e.toLowerCase(),a=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function ls(t){const e=t._meta?.["mcp.mesh"],o=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,n=ut(r.remotes?.[0]?.type),i=pt(r.$schema),a=o?"io.modelcontextprotocol.registry/official":t.publisher||e?.scopeName||"Unknown",c=Tt(r.repository),l=t.icon||t.image||t.logo||r.icons?.[0]?.src||c||null,d=t.name||t.title||t.server?.title||"Unnamed Item",w=gt(d),u=e?.friendly_name||w,S=e?.mesh_description||t.description||t.summary||r?.description||"",v=e?.short_description||null,_=e?.tags||[],p=e?.categories||[];return{name:u,description:S,shortDescription:v,icon:l,verified:t.verified||e?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:_,categories:p,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class as extends q.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store MCP server detail error:",e,o)}render(){return this.state.hasError?s.jsx(Vt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function cs(){const t=R.c(67),{org:e}=Ee(),o=$e();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{appName:n}=Qe(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c,stdio:l}=Xe(i);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=_t.storeShowStdio(),t[2]=d):d=t[2];const[w,u]=wt(d,js),S=l==="true"?!0:l==="false"?!1:w;l!==void 0&&l==="true"!==w&&u(l==="true");const[v,_]=q.useState(null),[p,b]=q.useState(null),m=bt(),g=jt(),{data:x}=Ye.useSession(),T=Nt(g),y=a||T[0]?.id||"",j=yt(y),N=ft(j?.tools),I=j?.tools&&j.tools.find(bs)?.name||"",M=j?.tools&&j.tools.find(vs)?.name||"",h=Pt(y),K=!!c;let E,G;K?(E=I||M,G={name:c}):(E=N,G={});const{data:L}=St({toolCaller:h,toolName:E,toolInputParams:G,scope:y});let V=[],P=[],z=null;if(L){if(Array.isArray(L))V=L;else if(typeof L=="object"&&L!==null)if("totalCount"in L&&typeof L.totalCount=="number"&&(z=L.totalCount),"item"in L&&L.item){const f=L.item,D=f.id||"",Z=f.server,le=f._meta;let B;t[3]!==f.title||t[4]!==D||t[5]!==Z||t[6]!==le?(B=[{id:D,title:f.title,server:Z,_meta:le}],t[3]=f.title,t[4]=D,t[5]=Z,t[6]=le,t[7]=B):B=t[7],V=B}else{let f;"versions"in L&&Array.isArray(L.versions)?f="versions":"servers"in L&&Array.isArray(L.servers)?f="servers":f=Object.keys(L).find(D=>Array.isArray(L[D])),f&&(V=L[f],(f==="versions"||E?.includes("VERSIONS"))&&(P=V))}}const O=P.findIndex(gs),H=O>=0?O:0,$=p??H;let A;t[8]!==n?(A=f=>{const D=f.name||f.title||f.server.title||"";return It(D)===n},t[8]=n,t[9]=A):A=t[9];let C=V.find(A);if(!C&&c){let f;t[10]!==c?(f=D=>D.server.name===c||D.name===c||D.title===c,t[10]=c,t[11]=f):f=t[11],C=V.find(f)}const k=C?ls(C):null,U=(k?.tools?.length||0)>0,J=C?.server?.remotes?.[0]?.url||null,W=!U&&!!J,Q=Ct({url:W?J:""}),ye=W&&Q.state==="connecting";let X;t[12]!==Q||t[13]!==W?(X=W&&Q.state==="ready"?(Q.tools||[]).map(hs):[],t[12]=Q,t[13]=W,t[14]=X):X=t[14];const Te=X,ce=U?k?.tools||[]:Te,Ue=ns(g,k?.publisher),Ne=k?is(V,k.publisher,Ue,j??null,z):{count:0},Be=k?.repository?kt(k.repository):null,ze=C?.server?.remotes??[],Oe=C?.server?.packages??[],Se=[...ze.map(xs),...Oe.map(ps)],de=S?Se:Se.filter(us),ee=de.length>1;let te;t[15]!==ee||t[16]!==de.length?(te={id:"servers",label:"Servers",count:de.length,visible:ee},t[15]=ee,t[16]=de.length,t[17]=te):te=t[17];const Ce=!!k?.repository&&!!Be;let se;t[18]!==Ce?(se={id:"readme",label:"README",visible:Ce},t[18]=Ce,t[19]=se):se=t[19];const we=U||Te.length>0||ye&&!!J;let oe;t[20]!==ce.length||t[21]!==we?(oe={id:"tools",label:"Tools",count:ce.length,visible:we},t[20]=ce.length,t[21]=we,t[22]=oe):oe=t[22];let me;t[23]!==te||t[24]!==se||t[25]!==oe?(me=[te,se,oe].filter(fs),t[23]=te,t[24]=se,t[25]=oe,t[26]=me):me=t[26];const F=me;let fe;t[27]!==F?(fe=F.find(ms)?.id||F.find(ds)?.id||F[0]?.id||"overview",t[27]=F,t[28]=fe):fe=t[28];const _e=fe;let ue;t[29]!==v||t[30]!==F||t[31]!==_e?(ue=v&&F.find(f=>f.id===v)?v:_e,t[29]=v,t[30]=F,t[31]=_e,t[32]=ue):ue=t[32];const Fe=ue;let pe;t[33]!==m||t[34]!==P||t[35]!==o||t[36]!==e||t[37]!==C||t[38]!==x?(pe=async(f,D,Z)=>{const le=P[f??0]||C;if(!le||!e||!x?.user?.id)return;const B=st(le,e.id,x.user.id,{remoteIndex:Z===void 0?D??0:void 0,packageIndex:Z}),We=B.connection_type==="STDIO",qe=!!B.connection_url,Ke=We&&B.connection_headers&&typeof B.connection_headers=="object"&&"command"in B.connection_headers;if(!qe&&!Ke){Le.error("This MCP Server cannot be connected: no connection method available");return}try{const{id:Ie}=await m.create.mutateAsync(B);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:Ie}})}catch(Ie){const ke=Ie;Le.error(`Failed to connect MCP Server: ${ke instanceof Error?ke.message:String(ke)}`)}},t[33]=m,t[34]=P,t[35]=o,t[36]=e,t[37]=C,t[38]=x,t[39]=pe):pe=t[39];const Y=pe;let xe;t[40]!==o||t[41]!==e.slug?(xe=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[40]=o,t[41]=e.slug,t[42]=xe):xe=t[42];const re=xe;if(!C){let f;return t[43]!==re?(f=s.jsx($t,{onBack:re}),t[43]=re,t[44]=f):f=t[44],f}if(!k)return null;const Ge=(C?.server?.remotes?.length??0)>0,He=(C?.server?.packages?.length??0)>0,ne=Ge||He;let he;t[45]!==re?(he=s.jsx(Dt,{onBack:re}),t[45]=re,t[46]=he):he=t[46];let ge;t[47]!==ne?(ge=!ne&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(Lt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[47]=ne,t[48]=ge):ge=t[48];let ie;t[49]!==P||t[50]!==C?(ie=P.length>0?P:[C],t[49]=P,t[50]=C,t[51]=ie):ie=t[51];let ve;t[52]!==m.create.isPending||t[53]!==ne||t[54]!==k||t[55]!==$||t[56]!==Y||t[57]!==ee||t[58]!==ie?(ve=s.jsx(Rt,{data:k,itemVersions:ie,onInstall:Y,canInstall:ne,isInstalling:m.create.isPending,hideInstallControls:ee,selectedVersionIndex:$,onVersionChange:b}),t[52]=m.create.isPending,t[53]=ne,t[54]=k,t[55]=$,t[56]=Y,t[57]=ee,t[58]=ie,t[59]=ve):ve=t[59];let be;t[60]!==k||t[61]!==Ne||t[62]!==C?(be=s.jsx(Bt,{data:k,publisherInfo:Ne,selectedItem:C}),t[60]=k,t[61]=Ne,t[62]=C,t[63]=be):be=t[63];let je;return t[64]!==$||t[65]!==Y?(je=f=>{f._type==="remote"?Y($,f._index,void 0):Y($,void 0,f._index)},t[64]=$,t[65]=Y,t[66]=je):je=t[66],s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[he,s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[ge,ve,s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[be,s.jsx(os,{data:k,availableTabs:F,effectiveActiveTabId:Fe,effectiveTools:ce,isLoadingTools:ye,onTabChange:_,servers:Se,onInstallServer:je,isInstalling:m.create.isPending,mcpIcon:k.icon,mcpName:k.name,showStdio:S})]})]})})})]})}function ds(t){return t.id==="readme"}function ms(t){return t.id==="servers"}function fs(t){return t.visible}function us(t){return t.type?.toLowerCase()!=="stdio"}function ps(t,e){return{type:"stdio",url:void 0,name:t.name||t.identifier,title:t.name||t.identifier?.replace(/^@[^/]+\//,""),description:t.environmentVariables?.length?`Requires ${t.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:e}}function xs(t,e){return{...t,_type:"remote",_index:e}}function hs(t){return{name:t.name,description:t.description}}function gs(t){return t._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0}function vs(t){return t.name.endsWith("_GET")}function bs(t){return t.name.endsWith("_VERSIONS")}function js(){return!1}function ho(){const t=R.c(6),{org:e}=Ee(),o=$e();let r;t[0]!==o||t[1]!==e.slug?(r=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=r):r=t[2];const n=r;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q.Suspense,{fallback:s.jsx(Mt,{}),children:s.jsx(cs,{})}),t[3]=i):i=t[3];let a;return t[4]!==n?(a=s.jsx(as,{onBack:n,children:i}),t[4]=n,t[5]=a):a=t[5],a}export{ho as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as _,r as D,v as ie,K as X,ae,j as s,f as se,a as ce,k as me,w as de}from"./index-DEuqpeVv.js";import{g as fe,a as ue}from"./well-known-mcp-DOEdYmKO.js";import{C as xe}from"./collection-header-BA9HTLmg.js";import{i as le}from"./FilterLines-C_UJwG_t.js";import{n as pe}from"./Inbox01-CKGdnZFH.js";import{i as Y}from"./Loading01-JwelopeC.js";import{i as re}from"./SearchMd-Cgfgcbdz.js";import{b as ge,a as oe,u as he}from"./use-connection-DhRUkVvI.js";import{u as je}from"./useInfiniteQuery-ckN_t7ea.js";import{c as ve}from"./connection-ByVJuREK.js";import{a as ye,f as Ne,b as Ce}from"./registry-utils-85b65tFI.js";import{u as J}from"./project-context-provider-Dn1-l4h2.js";import{s as be}from"./slugify-CEUa2lfQ.js";import{C as Se}from"./collection-search-pUdl1eNx.js";import{M as ee}from"./mcp-server-card-DfoQ5M8z.js";import{B as Q}from"./button-DXl1hVqx.js";import{I as we}from"./input-CqqzkfyF.js";import{P as Te,a as Ie,b as Re}from"./popover-BcOo6EXw.js";import{i as $e}from"./Check-Cjgi2ZiG.js";import{t as ke}from"./ChevronDown-BuVzyKHq.js";import{s as U}from"./XClose-2bShEltc.js";import{d as Pe,a as ze,b as Fe,c as Le,S as Ke}from"./select-Bv7J3zlQ.js";import{s as Ae}from"./Plus-Df2M6Ns2.js";import{E as Ee}from"./empty-state-C7Gr5Tg2.js";import{u as De}from"./use-binding-B0VMz_Ex.js";import{L as Me,u as Be}from"./localstorage-keys-kemGZMIp.js";import"./collection-display-button-B_KC-ent.js";import"./dropdown-menu-Hp4qYTud.js";import"./Grid01-CRALWbj6.js";import"./ArrowUp-Ck0taqJi.js";import"./List-DOmOO2Cw.js";import"./tooltip-vUrxHIt0.js";import"./view-mode-toggle-CTWk8Dkt.js";import"./use-collections-Cflasxiq.js";import"./useMutation-xcmVYLP7.js";import"./infiniteQueryObserver-BXdaScti.js";import"./Lock01-B7TIX2sZ.js";import"./Terminal-C8LHfiOW.js";import"./card-D0GcpRPY.js";import"./github-icon-Dp3wHhYE.js";import"./binder-iKe3ndXq.js";import"./useQuery-BKyLWvSZ.js";function Ve(t,e){const l=_.c(4),[o,c]=D.useState(t),r=D.useRef(null),i=D.useRef(!0);let n,g;return l[0]!==e||l[1]!==t?(n=()=>{if(i.current){i.current=!1;return}return r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{c(t)},e),()=>{r.current&&clearTimeout(r.current)}},g=[t,e],l[0]=e,l[1]=t,l[2]=n,l[3]=g):(n=l[2],g=l[3]),D.useEffect(n,g),o}function Oe(t){const e=_.c(14),l=D.useRef(null),o=`scroll-position:${t}`,c=D.useRef(null);let r;e[0]!==o?(r=()=>{l.current&&sessionStorage.setItem(o,String(l.current.scrollTop))},e[0]=o,e[1]=r):r=e[1];const i=r;let n;e[2]!==o?(n=()=>{if(c.current===o)return;const f=sessionStorage.getItem(o);if(f&&l.current){const y=Number.parseInt(f,10);l.current.scrollTop=y}c.current=o},e[2]=o,e[3]=n):n=e[3];const g=n;let j;e[4]!==g||e[5]!==o?(j=()=>{c.current!==o&&g()},e[4]=g,e[5]=o,e[6]=j):j=e[6];const u=j;let a;e[7]!==g||e[8]!==o?(a=f=>{l.current=f,f&&c.current!==o&&requestAnimationFrame(()=>{g()})},e[7]=g,e[8]=o,e[9]=a):a=e[9];const v=a;let d;return e[10]!==u||e[11]!==i||e[12]!==v?(d={scrollRef:v,saveScrollPosition:i,handleScroll:u},e[10]=u,e[11]=i,e[12]=v,e[13]=d):d=e[13],d}const We=24;function qe(t){const e=_.c(52),{registryId:l,listToolName:o,filtersToolName:c,search:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[n,g]=D.useState(i);let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=[],e[1]=j):j=e[1];const[u,a]=D.useState(j);let v;e[2]!==l?(v=ve(l),e[2]=l,e[3]=v):v=e[3];const d=v,f=!!c;let y;e[4]!==c||e[5]!==l?(y=X.toolCall(l,c||"no-filters","{}"),e[4]=c,e[5]=l,e[6]=y):y=e[6];let N;e[7]!==c||e[8]!==d?(N=async()=>c?await d(c,{}):{tags:[],categories:[]},e[7]=c,e[8]=d,e[9]=N):N=e[9];let S;e[10]!==y||e[11]!==N?(S={queryKey:y,queryFn:N,staleTime:36e5},e[10]=y,e[11]=N,e[12]=S):S=e[12];const{data:k}=ie(S);let $,w,b;if(e[13]!==o||e[14]!==l||e[15]!==r||e[16]!==u||e[17]!==n){const O=r?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:r},{field:["title"],operator:"contains",value:r},{field:["description"],operator:"contains",value:r}]}:void 0;$={limit:We,...n.length>0&&{tags:n},...u.length>0&&{categories:u},...O&&{where:O}},b=je,w=X.toolCall(l,o,JSON.stringify($)),e[13]=o,e[14]=l,e[15]=r,e[16]=u,e[17]=n,e[18]=$,e[19]=w,e[20]=b}else $=e[18],w=e[19],b=e[20];let C;e[21]!==$||e[22]!==o||e[23]!==d?(C=async O=>{const{pageParam:Z}=O,ne=Z?{...$,cursor:Z}:$;return await d(o,ne)},e[21]=$,e[22]=o,e[23]=d,e[24]=C):C=e[24];let T;e[25]!==w||e[26]!==C?(T={queryKey:w,queryFn:C,initialPageParam:void 0,getNextPageParam:_e,staleTime:36e5,placeholderData:ae},e[25]=w,e[26]=C,e[27]=T):T=e[27];const{data:P,fetchNextPage:z,hasNextPage:L,isFetchingNextPage:I,isFetching:m,isLoading:x}=b(T);let h;e:{if(!P?.pages||P.pages.length===0){h=null;break e}const O=P.pages[0];if(typeof O=="object"&&O!==null&&"totalCount"in O&&typeof O.totalCount=="number"){h=O.totalCount;break e}h=null}const R=h,F=P?.pages;let p;e[28]!==F?(p=ye(F),e[28]=F,e[29]=p):p=e[29];const K=p;let A;e[30]!==r||e[31]!==u.length||e[32]!==n.length?(A=n.length>0||u.length>0||!!r?.trim(),e[30]=r,e[31]=u.length,e[32]=n.length,e[33]=A):A=e[33];const E=A,W=m&&!I&&!x&&E;let B;e[34]!==z||e[35]!==L||e[36]!==I?(B=()=>{L&&!I&&z()},e[34]=z,e[35]=L,e[36]=I,e[37]=B):B=e[37];const q=B,G=L??!1,M=f?k?.tags:void 0,V=f?k?.categories:void 0;let H;return e[38]!==E||e[39]!==m||e[40]!==I||e[41]!==W||e[42]!==x||e[43]!==K||e[44]!==q||e[45]!==u||e[46]!==n||e[47]!==G||e[48]!==M||e[49]!==V||e[50]!==R?(H={items:K,totalCount:R,hasMore:G,isLoadingMore:I,isFiltering:W,isInitialLoading:x,isFetching:m,loadMore:q,availableTags:M,availableCategories:V,selectedTags:n,selectedCategories:u,setSelectedTags:g,setSelectedCategories:a,hasActiveFilters:E},e[38]=E,e[39]=m,e[40]=I,e[41]=W,e[42]=x,e[43]=K,e[44]=q,e[45]=u,e[46]=n,e[47]=G,e[48]=M,e[49]=V,e[50]=R,e[51]=H):H=e[51],H}function _e(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function Ge(t,e){return[...t].sort((l,o)=>o.count-l.count).slice(0,e)}function te(t){const e=_.c(52),{label:l,items:o,selectedItems:c,onToggle:r,onClear:i}=t,[n,g]=D.useState(""),[j,u]=D.useState(!1);let a,v,d,f,y,N,S,k,$,w,b;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==j||e[4]!==n||e[5]!==c){const I=[...n?o.filter(A=>A.value.toLowerCase().includes(n.toLowerCase())):o].sort(He);d=c.length,v=Te,$=j,w=u;let m;e[17]!==l?(m=s.jsx("span",{children:l}),e[17]=l,e[18]=m):m=e[18];let x;e[19]!==d?(x=d>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:d}),e[19]=d,e[20]=x):x=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ke,{size:14,className:"opacity-50"}),e[21]=h):h=e[21],e[22]!==x||e[23]!==m?(b=s.jsx(Ie,{asChild:!0,children:s.jsxs(Q,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[m,x,h]})}),e[22]=x,e[23]=m,e[24]=b):b=e[24],a=Re,N="w-64 p-0",S="start";let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(re,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=R):R=e[25];let F;e[26]!==l?(F=l.toLowerCase(),e[26]=l,e[27]=F):F=e[27];const p=`Search ${F}...`;let K;e[28]===Symbol.for("react.memo_cache_sentinel")?(K=A=>g(A.target.value),e[28]=K):K=e[28],e[29]!==n||e[30]!==p?(k=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[R,s.jsx(we,{type:"text",placeholder:p,value:n,onChange:K,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=n,e[30]=p,e[31]=k):k=e[31],f="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",y=I.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):I.map(A=>{const E=c.includes(A.value);return s.jsxs("button",{onClick:()=>r(A.value),className:`w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors ${E?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"}`,children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[E&&s.jsx($e,{size:16,className:"text-muted-foreground shrink-0"}),A.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:A.count})]},A.value)}),e[0]=o,e[1]=l,e[2]=r,e[3]=j,e[4]=n,e[5]=c,e[6]=a,e[7]=v,e[8]=d,e[9]=f,e[10]=y,e[11]=N,e[12]=S,e[13]=k,e[14]=$,e[15]=w,e[16]=b}else a=e[6],v=e[7],d=e[8],f=e[9],y=e[10],N=e[11],S=e[12],k=e[13],$=e[14],w=e[15],b=e[16];let C;e[32]!==f||e[33]!==y?(C=s.jsx("div",{className:f,children:y}),e[32]=f,e[33]=y,e[34]=C):C=e[34];let T;e[35]!==l||e[36]!==i||e[37]!==d?(T=d>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(Q,{variant:"ghost",size:"sm",onClick:i,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",l.toLowerCase()]})}),e[35]=l,e[36]=i,e[37]=d,e[38]=T):T=e[38];let P;e[39]!==a||e[40]!==T||e[41]!==N||e[42]!==S||e[43]!==k||e[44]!==C?(P=s.jsxs(a,{className:N,align:S,children:[k,C,T]}),e[39]=a,e[40]=T,e[41]=N,e[42]=S,e[43]=k,e[44]=C,e[45]=P):P=e[45];let z;return e[46]!==v||e[47]!==P||e[48]!==$||e[49]!==w||e[50]!==b?(z=s.jsxs(v,{open:$,onOpenChange:w,children:[b,P]}),e[46]=v,e[47]=P,e[48]=$,e[49]=w,e[50]=b,e[51]=z):z=e[51],z}function He(t,e){return e.count-t.count}function Qe(t){const e=_.c(67),{availableTags:l,availableCategories:o,selectedTags:c,selectedCategories:r,onTagChange:i,onCategoryChange:n}=t,g=l&&l.length>0||o&&o.length>0,j=c.length>0||r.length>0;if(!g)return null;let u;e[0]!==i||e[1]!==c?(u=m=>{c.includes(m)?i(c.filter(x=>x!==m)):i([...c,m])},e[0]=i,e[1]=c,e[2]=u):u=e[2];const a=u;let v;e[3]!==n||e[4]!==r?(v=m=>{r.includes(m)?n(r.filter(x=>x!==m)):n([...r,m])},e[3]=n,e[4]=r,e[5]=v):v=e[5];const d=v;let f;e[6]!==n||e[7]!==i?(f=()=>{i([]),n([])},e[6]=n,e[7]=i,e[8]=f):f=e[8];const y=f;let N,S,k,$,w,b,C;if(e[9]!==o||e[10]!==l||e[11]!==n||e[12]!==i||e[13]!==r||e[14]!==c||e[15]!==d||e[16]!==a){const m=o?Ge(o,6):[];N=r,S=c,C=new Set(m.map(Ue)),w="flex items-center border-b border-border";let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(le,{size:16})}),e[24]=x):x=e[24];let h;e[25]!==o||e[26]!==n||e[27]!==r||e[28]!==d?(h=o&&o.length>0&&s.jsx(te,{label:"Categories",items:o,selectedItems:r,onToggle:d,onClear:()=>n([])}),e[25]=o,e[26]=n,e[27]=r,e[28]=d,e[29]=h):h=e[29];let R;e[30]!==l||e[31]!==i||e[32]!==c||e[33]!==a?(R=l&&l.length>0&&s.jsx(te,{label:"Tags",items:l,selectedItems:c,onToggle:a,onClear:()=>i([])}),e[30]=l,e[31]=i,e[32]=c,e[33]=a,e[34]=R):R=e[34],e[35]!==R||e[36]!==h?(b=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[x,h,R]}),e[35]=R,e[36]=h,e[37]=b):b=e[37],k="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==r||e[39]!==d?(F=p=>{const K=r.includes(p.value);return s.jsxs("div",{onClick:()=>d(p.value),className:`inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer ${K?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"}`,children:[s.jsx("span",{children:p.value}),K&&s.jsx("span",{onClick:A=>{A.stopPropagation(),d(p.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(U,{size:12})})]},p.value)},e[38]=r,e[39]=d,e[40]=F):F=e[40],$=m.map(F),e[9]=o,e[10]=l,e[11]=n,e[12]=i,e[13]=r,e[14]=c,e[15]=d,e[16]=a,e[17]=N,e[18]=S,e[19]=k,e[20]=$,e[21]=w,e[22]=b,e[23]=C}else N=e[17],S=e[18],k=e[19],$=e[20],w=e[21],b=e[22],C=e[23];let T;if(e[41]!==N||e[42]!==d||e[43]!==C){let m;e[45]!==C?(m=h=>!C.has(h),e[45]=C,e[46]=m):m=e[46];let x;e[47]!==d?(x=h=>s.jsxs("div",{onClick:()=>d(h),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:h}),s.jsx("span",{onClick:R=>{R.stopPropagation(),d(h)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(U,{size:12})})]},`cat-${h}`),e[47]=d,e[48]=x):x=e[48],T=N.filter(m).map(x),e[41]=N,e[42]=d,e[43]=C,e[44]=T}else T=e[44];let P;if(e[49]!==S||e[50]!==a){let m;e[52]!==a?(m=x=>s.jsxs("div",{onClick:()=>a(x),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:x}),s.jsx("span",{onClick:h=>{h.stopPropagation(),a(x)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(U,{size:12})})]},`tag-${x}`),e[52]=a,e[53]=m):m=e[53],P=S.map(m),e[49]=S,e[50]=a,e[51]=P}else P=e[51];let z;e[54]!==y||e[55]!==j?(z=j&&s.jsxs(Q,{variant:"ghost",size:"sm",onClick:y,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(U,{size:14}),"Clear all"]}),e[54]=y,e[55]=j,e[56]=z):z=e[56];let L;e[57]!==z||e[58]!==k||e[59]!==$||e[60]!==T||e[61]!==P?(L=s.jsxs("div",{className:k,children:[$,T,P,z]}),e[57]=z,e[58]=k,e[59]=$,e[60]=T,e[61]=P,e[62]=L):L=e[62];let I;return e[63]!==L||e[64]!==w||e[65]!==b?(I=s.jsxs("div",{className:w,children:[b,L]}),e[63]=L,e[64]=w,e[65]=b,e[66]=I):I=e[66],I}function Ue(t){return t.value}function Ye(t,e){if(!e)return t;const l=e.toLowerCase();return t.filter(o=>(o.name||o.title||"").toLowerCase().includes(l)||(o.description||o.server.description||"").toLowerCase().includes(l))}function Je(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function Ze(t){const e=_.c(54),{registryId:l,listToolName:o,filtersToolName:c}=t,[r,i]=D.useState(""),n=Ve(r,300),g=se(),{org:j}=J(),{scrollRef:u,saveScrollPosition:a,handleScroll:v}=Oe(`store-discovery:${l}`);let d;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==l?(d={registryId:l,listToolName:o,filtersToolName:c,search:n},e[0]=n,e[1]=c,e[2]=o,e[3]=l,e[4]=d):d=e[4];const{items:f,hasMore:y,isLoadingMore:N,isInitialLoading:S,isFetching:k,loadMore:$,availableTags:w,availableCategories:b,selectedTags:C,selectedCategories:T,setSelectedTags:P,setSelectedCategories:z,hasActiveFilters:L}=qe(d);let I,m,x,h;e[5]!==n||e[6]!==k||e[7]!==S||e[8]!==f||e[9]!==r?(I=r?Ye(f,r):f,m=(r!==n||k)&&!S&&!!r,h=I.filter(Je),x=I.filter(M=>!h.find(V=>V.id===M.id)),e[5]=n,e[6]=k,e[7]=S,e[8]=f,e[9]=r,e[10]=I,e[11]=m,e[12]=x,e[13]=h):(I=e[10],m=e[11],x=e[12],h=e[13]);const R=x;let F;e[14]!==g||e[15]!==j.slug||e[16]!==l||e[17]!==a?(F=M=>{a();const V=be(M.name||M.title||M.server.title||""),H=M.server.name;g({to:"/$org/store/$appName",params:{org:j.slug,appName:V},search:{registryId:l,serverName:H}})},e[14]=g,e[15]=j.slug,e[16]=l,e[17]=a,e[18]=F):F=e[18];const p=F;let K;e[19]!==v||e[20]!==y||e[21]!==N||e[22]!==$?(K=M=>{if(v(),!y||N)return;const V=M.currentTarget;V.scrollHeight-V.scrollTop-V.clientHeight<200&&$()},e[19]=v,e[20]=y,e[21]=N,e[22]=$,e[23]=K):K=e[23];const A=K;let E;e[24]!==m||e[25]!==r?(E=s.jsx(Se,{value:r,onChange:i,placeholder:"Search for an MCP Server...",isSearching:m}),e[24]=m,e[25]=r,e[26]=E):E=e[26];let W;e[27]!==b||e[28]!==w||e[29]!==T||e[30]!==C||e[31]!==z||e[32]!==P?(W=s.jsx(Qe,{availableTags:w,availableCategories:b,selectedTags:C,selectedCategories:T,onTagChange:P,onCategoryChange:z}),e[27]=b,e[28]=w,e[29]=T,e[30]=C,e[31]=z,e[32]=P,e[33]=W):W=e[33];let B;e[34]!==R||e[35]!==I||e[36]!==p||e[37]!==L||e[38]!==y||e[39]!==S||e[40]!==N||e[41]!==m||e[42]!==f||e[43]!==r||e[44]!==h?(B=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:S?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Y,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):f.length===0&&!L?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(pe,{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."})]}):f.length===0&&L&&!r?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(le,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):r&&I.length===0&&!m?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(re,{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:[m&&I.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Y,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),h.length>0&&s.jsx(ee,{items:h,title:"Verified",onItemClick:p}),R.length>0&&s.jsx(ee,{items:R,title:h.length>0?"All":"",onItemClick:p}),y&&N&&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(Y,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=R,e[35]=I,e[36]=p,e[37]=L,e[38]=y,e[39]=S,e[40]=N,e[41]=m,e[42]=f,e[43]=r,e[44]=h,e[45]=B):B=e[45];let q;e[46]!==A||e[47]!==u||e[48]!==B?(q=s.jsx("div",{ref:u,className:"flex-1 overflow-y-auto",onScroll:A,children:B}),e[46]=A,e[47]=u,e[48]=B,e[49]=q):q=e[49];let G;return e[50]!==E||e[51]!==W||e[52]!==q?(G=s.jsxs("div",{className:"flex flex-col h-full",children:[E,W,q]}),e[50]=E,e[51]=W,e[52]=q,e[53]=G):G=e[53],G}function Xe(t){const e=_.c(8),{registryId:l}=t,o=ge(l),c=o?.tools;let r;e[0]!==c?(r=Ne(c),e[0]=c,e[1]=r):r=e[1];const i=r;if(!i)throw new Error("This registry does not support listing store items.");const n=o?.tools;let g;e[2]!==n?(g=Ce(n),e[2]=n,e[3]=g):g=e[3];const u=g||void 0;let a;return e[4]!==i||e[5]!==l||e[6]!==u?(a=s.jsx(Ze,{registryId:l,listToolName:i,filtersToolName:u}),e[4]=i,e[5]=l,e[6]=u,e[7]=a):a=e[7],a}function et(t){const e=_.c(15),{registries:l,value:o,onValueChange:c,onAddWellKnown:r,wellKnownRegistries:i,placeholder:n}=t,g=n===void 0?"Select a registry...":n;let j;e[0]!==g?(j=s.jsx(ze,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Fe,{placeholder:g})}),e[0]=g,e[1]=j):j=e[1];let u;e[2]!==l?(u=l.map(tt),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==r||e[5]!==i?(a=i.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"}),i.map(f=>s.jsxs("button",{onClick:y=>{y.preventDefault(),y.stopPropagation(),r(f)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg 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:[f.icon?s.jsx("img",{src:f.icon,alt:f.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:f.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:f.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(Ae,{size:16})})]},f.id??f.title))]}),e[4]=r,e[5]=i,e[6]=a):a=e[6];let v;e[7]!==u||e[8]!==a?(v=s.jsxs(Le,{children:[u,a]}),e[7]=u,e[8]=a,e[9]=v):v=e[9];let d;return e[10]!==c||e[11]!==j||e[12]!==v||e[13]!==o?(d=s.jsxs(Ke,{value:o,onValueChange:c,children:[j,v]}),e[10]=c,e[11]=j,e[12]=v,e[13]=o,e[14]=d):d=e[14],d}function tt(t){return s.jsx(Pe,{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 st({registries:t,onConnected:e}){const l=oe(),{org:{slug:o}}=J(),{data:c}=ce.useSession(),r=se(),[i,n]=D.useState(!1),g=t[0],j=async()=>{if(!(!g||!c?.user?.id)){n(!0);try{const a=await l.create.mutateAsync(g);e?.(a.id)}finally{n(!1)}}},u=()=>{r({to:"/$org/mcps",params:{org:o},search:{action:"create"}})};return s.jsx(Ee,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(Q,{variant:"outline",onClick:j,disabled:i||!g,children:[g?.icon&&s.jsx("img",{src:g.icon,alt:"",className:"size-4"}),i?"Installing...":"Install Registry"]}),s.jsx(Q,{variant:"outline",onClick:u,children:"Custom Connection"})]})})}function Ut(){const t=_.c(41),{org:e}=J(),l=he(),o=oe(),c=me(),r=c.location.pathname.includes("/store/")&&c.location.pathname.split("/").length>3,i=De(l);let n;t[0]!==i?(n=i.map(ot),t[0]=i,t[1]=n):n=t[1];const g=n;let j;t[2]!==e.slug?(j=Me.selectedRegistry(e.slug),t[2]=e.slug,t[3]=j):j=t[3];const[u,a]=Be(j,rt);let v;if(t[4]!==i||t[5]!==u){let p;t[7]!==u?(p=K=>K.id===u,t[7]=u,t[8]=p):p=t[8],v=i.find(p),t[4]=i,t[5]=u,t[6]=v}else v=t[6];const f=v?.id||i[0]?.id||"";let y;t[9]!==e.id?(y=fe(e.id),t[9]=e.id,t[10]=y):y=t[10];let N;t[11]!==y?(N=[y],t[11]=y,t[12]=N):N=t[12];const S=N;let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k=[ue()],t[13]=k):k=t[13];const $=k;let w;t[14]!==o.create||t[15]!==a?(w=async p=>{const K=await o.create.mutateAsync(p);a(K.id)},t[14]=o.create,t[15]=a,t[16]=w):w=t[16];const b=w;let C;t[17]!==i?(C=new Set(i.map(lt)),t[17]=i,t[18]=C):C=t[18];const T=C;let P;t[19]!==T||t[20]!==S?(P=S.filter(p=>p.id&&!T.has(p.id)),t[19]=T,t[20]=S,t[21]=P):P=t[21];const z=P;let L;t[22]!==T?(L=$.filter(p=>p.id&&!T.has(p.id)),t[22]=T,t[23]=L):L=t[23];const I=L;if(r){let p;return t[24]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(de,{}),t[24]=p):p=t[24],p}let m;t[25]!==b?(m=async p=>b(p),t[25]=b,t[26]=m):m=t[26];let x;t[27]!==z||t[28]!==f||t[29]!==g||t[30]!==a||t[31]!==m?(x=s.jsx(xe,{title:"Store",ctaButton:s.jsx(et,{wellKnownRegistries:z,registries:g,value:f,onValueChange:a,onAddWellKnown:m,placeholder:"Select store..."})}),t[27]=z,t[28]=f,t[29]=g,t[30]=a,t[31]=m,t[32]=x):x=t[32];let h;t[33]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(Y,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=h):h=t[33];let R;t[34]!==I||t[35]!==f||t[36]!==a?(R=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(D.Suspense,{fallback:h,children:f?s.jsx(Xe,{registryId:f}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(st,{registries:I,onConnected:p=>{a(p)}})})})}),t[34]=I,t[35]=f,t[36]=a,t[37]=R):R=t[37];let F;return t[38]!==x||t[39]!==R?(F=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[x,R]}),t[38]=x,t[39]=R,t[40]=F):F=t[40],F}function lt(t){return t.id}function rt(t){return t??""}function ot(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{Ut as default};
|