@decocms/mesh 1.0.0-alpha.3 → 1.0.0-alpha.31
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/README.md +287 -0
- package/dist/client/assets/{alert-dialog-Caf0mgW9.js → alert-dialog-lT7fjsnS.js} +3 -3
- package/dist/client/assets/app-name-gTETL9So.js +1 -0
- package/dist/client/assets/{auth-CGqqbEan.js → auth-B4DV4YJb.js} +1 -1
- package/dist/client/assets/{auth-catchall-Bw-KJI1v.js → auth-catchall-BXXli3-E.js} +1 -1
- package/dist/client/assets/{avatar-CdPaDOIs.js → avatar-DrbrX3Fb.js} +1 -1
- package/dist/client/assets/{badge-j-myHF25.js → badge-Sw-5Fjm_.js} +1 -1
- package/dist/client/assets/{button-DnKGwZ1P.js → button-De8TtfIc.js} +1 -1
- package/dist/client/assets/{card-I0CWqn2J.js → card-Clgs1Ler.js} +1 -1
- package/dist/client/assets/{checkbox-v3iP8MNg.js → checkbox-BZTG8MjG.js} +1 -1
- package/dist/client/assets/{circle-alert-CpqBZI3V.js → circle-alert-Bo6PdNJA.js} +1 -1
- package/dist/client/assets/collection-detail-bCm7IhzQ.js +1 -0
- package/dist/client/assets/collection-display-button-CANVxM78.js +1 -0
- package/dist/client/assets/collection-header-DWpT3ZvE.js +1 -0
- package/dist/client/assets/{collection-page-CkAonVNX.js → collection-page-BDYpmZx2.js} +1 -1
- package/dist/client/assets/{collection-search-Bd4XQ4_K.js → collection-search-7dvS8CPU.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dv4rgxdy.js → collection-table-wrapper-DFImlrAn.js} +1 -1
- package/dist/client/assets/connection-card-Dgd2qOAx.js +1 -0
- package/dist/client/assets/connection-detail-B5XIo4jJ.js +1 -0
- package/dist/client/assets/connections-DgVq2Zi4.js +1 -0
- package/dist/client/assets/core-6UZH86ZU.js +6 -0
- package/dist/client/assets/{create-organization-dialog-CWgFMDXV.js → create-organization-dialog-DpintAfW.js} +1 -1
- package/dist/client/assets/dialog-CcWkQ3-q.js +1 -0
- package/dist/client/assets/{dropdown-menu-BIeRR6rM.js → dropdown-menu-BMBTO1aI.js} +1 -1
- package/dist/client/assets/{empty-state-DV83eIhT.js → empty-state-WuOT2hFn.js} +1 -1
- package/dist/client/assets/{error-boundary-qOVcoWbq.js → error-boundary-Sj1-czrQ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DzgXoQyz.js → extract-connection-data-q7cQAIMM.js} +1 -1
- package/dist/client/assets/{form-0C1lYHJ2.js → form-CTTDgzck.js} +1 -1
- package/dist/client/assets/gateway-detail-DrTM5RUx.js +1 -0
- package/dist/client/assets/gateways-C0TCQRt5.js +1 -0
- package/dist/client/assets/{home-B1IT0slW.js → home-Dy-_EeTf.js} +1 -1
- package/dist/client/assets/{icon-C1glN-Ga.js → icon-Dk9j-Z4d.js} +1 -1
- package/dist/client/assets/index-BMLzl8gY.css +1 -0
- package/dist/client/assets/index-BSuuYE7a.js +32 -0
- package/dist/client/assets/index-DIXLDBVl.js +118 -0
- package/dist/client/assets/{index-Chpp7zg0.js → index-Dss36SHE.js} +1 -1
- package/dist/client/assets/{index-D2ODleHN.js → index-GY3GXADp.js} +1 -1
- package/dist/client/assets/{input-DpAKmHHm.js → input-ByJBGfq3.js} +1 -1
- package/dist/client/assets/json-B2EH3aa6.js +1 -0
- package/dist/client/assets/json-BESjz4hO.js +1 -0
- package/dist/client/assets/layout-DRBUzMK7.js +1 -0
- package/dist/client/assets/lazy-highlighter-BZ3JTPPT.js +4 -0
- package/dist/client/assets/{localstorage-keys-DC7ymQmZ.js → localstorage-keys-CrXjwcSZ.js} +1 -1
- package/dist/client/assets/login-baVguqcM.js +1 -0
- package/dist/client/assets/mcp-oauth-Chn8Vl6o.js +1 -0
- package/dist/client/assets/members-BL6-e_ID.js +3 -0
- package/dist/client/assets/monitoring-DSGI33MK.js +1 -0
- package/dist/client/assets/oauth-callback-BxWJgxm-.js +1 -0
- package/dist/client/assets/page-BZV40eAE.css +1 -0
- package/dist/client/assets/page-D0r-m9VX.js +21 -0
- package/dist/client/assets/{popover-TCQphQTw.js → popover-C_H6Z3YS.js} +1 -1
- package/dist/client/assets/prism-light-CKU-zSUS.js +1 -0
- package/dist/client/assets/resource-tabs-Dptn276z.js +1 -0
- package/dist/client/assets/{schema-BLzWyGtx.js → schema-iWDGcZfv.js} +1 -1
- package/dist/client/assets/{select-fvQCifl4.js → select-KKeuY_8A.js} +1 -1
- package/dist/client/assets/settings-DOQRUeGN.js +1 -0
- package/dist/client/assets/shell-layout-DxFvs5RE.js +124 -0
- package/dist/client/assets/slugify-CEUa2lfQ.js +1 -0
- package/dist/client/assets/{spinner-Cck765yW.js → spinner-C5mTiECQ.js} +1 -1
- package/dist/client/assets/store-BsHJOv3r.js +1 -0
- package/dist/client/assets/store-app-detail-D8K1UJ66.js +1 -0
- package/dist/client/assets/switch-BN3gNP3v.js +1 -0
- package/dist/client/assets/{textarea--4iImQiq.js → textarea-DYrEFGVo.js} +1 -1
- package/dist/client/assets/tool-set-selector-BU0xXwDF.js +1 -0
- package/dist/client/assets/{tooltip-DjXyjtiH.js → tooltip-ZzCYSPeH.js} +1 -1
- package/dist/client/assets/types-DndJPAWa.js +45 -0
- package/dist/client/assets/{upload-DkfUhTLj.js → upload-CsXE0eHm.js} +1 -1
- package/dist/client/assets/{use-binding-BLIUV5ER.js → use-binding-CIVQUW9t.js} +2 -2
- package/dist/client/assets/use-connection-CgusccPZ.js +2 -0
- package/dist/client/assets/use-gateway-iwW9W997.js +1 -0
- package/dist/client/assets/{use-list-state-Bas0EIwN.js → use-list-state-B2svGg01.js} +1 -1
- package/dist/client/assets/use-mcp-ByPLvFZj.js +1 -0
- package/dist/client/assets/use-members-dzf6tzsH.js +1 -0
- package/dist/client/assets/{use-mobile-CxX0wu31.js → use-mobile-BqnROvZt.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CpvpbwdB.js → use-organization-settings-DYa2j-qu.js} +1 -1
- package/dist/client/assets/{use-tool-call-p0lqBezD.js → use-tool-call-CFjw03Kh.js} +1 -1
- package/dist/client/assets/useQuery-B5H-PpIX.js +1 -0
- package/dist/client/assets/utils-Ny57I_y6.js +1 -0
- package/dist/client/assets/well-known-mcp-Dg77mwx9.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +191 -211
- package/dist/server/migrate.js +204 -204
- package/dist/server/server.js +245 -267
- package/package.json +7 -5
- package/dist/client/assets/app-name-DQPOjnhR.js +0 -1
- package/dist/client/assets/chunk-2RRQPJJO-DGhxLrrR.js +0 -1
- package/dist/client/assets/collection-detail-BSfYYwzG.js +0 -1
- package/dist/client/assets/collection-display-button-Cws3c2TG.js +0 -1
- package/dist/client/assets/collection-header-CJC3zXGa.js +0 -1
- package/dist/client/assets/connection-card-CgJm9r5i.js +0 -1
- package/dist/client/assets/connection-detail-HAGAOVY9.js +0 -1
- package/dist/client/assets/connections-C8Z338-P.js +0 -1
- package/dist/client/assets/dialog-Qusr5Dgc.js +0 -1
- package/dist/client/assets/gateway-detail-mD14k5vr.js +0 -1
- package/dist/client/assets/gateways-BSGLH5Mc.js +0 -1
- package/dist/client/assets/index-B5e6fytH.js +0 -118
- package/dist/client/assets/index-C1xA8jg5.js +0 -1
- package/dist/client/assets/index-DqmRoUE9.js +0 -32
- package/dist/client/assets/index-feMggVqN.css +0 -1
- package/dist/client/assets/integration-icon-C_Dk6BbN.js +0 -1
- package/dist/client/assets/layout-BMHVtK0w.js +0 -1
- package/dist/client/assets/lazy-highlighter-9rAB2zZq.js +0 -1
- package/dist/client/assets/login-BMjQy3tL.js +0 -1
- package/dist/client/assets/members-k_V-Gxfi.js +0 -1
- package/dist/client/assets/monitoring-BG-rBDyv.js +0 -1
- package/dist/client/assets/monitoring-stats-row-PYfuhQHX.js +0 -42
- package/dist/client/assets/oauth-callback-CQ4D18kW.js +0 -10
- package/dist/client/assets/page-h-kmS-QS.js +0 -1
- package/dist/client/assets/prism-CcSucC56.js +0 -9
- package/dist/client/assets/resource-tabs-E4yf0eYT.js +0 -1
- package/dist/client/assets/settings-Bjk195Z6.js +0 -1
- package/dist/client/assets/shell-layout-B8oNCzSa.js +0 -124
- package/dist/client/assets/store-DD1aCoWU.js +0 -1
- package/dist/client/assets/store-app-detail-DZvzqAVf.js +0 -1
- package/dist/client/assets/tool-set-selector-Fu1vBXWK.js +0 -1
- package/dist/client/assets/use-connection-IMyxygAc.js +0 -2
- package/dist/client/assets/use-gateway-CuMrhcvh.js +0 -1
- package/dist/client/assets/use-members-DHcrnzKP.js +0 -1
- package/dist/client/assets/useQuery-BO2jzwkw.js +0 -1
- package/dist/client/assets/utils-BLBjpUfr.js +0 -1
- package/dist/client/assets/well-known-mcp-Dq2j3ucM.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/mesh",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.31",
|
|
4
4
|
"description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Deco team",
|
|
@@ -35,12 +35,14 @@
|
|
|
35
35
|
"prepublishOnly": "bun run build:client && bun run build:server"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
+
"@ai-sdk/mcp": "^1.0.0",
|
|
39
|
+
"@xyflow/react": "^12.10.0",
|
|
38
40
|
"kysely": "^0.28.8",
|
|
39
41
|
"kysely-bun-worker": "^0.6.0"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
|
-
"@ai-sdk/provider": "^
|
|
43
|
-
"@ai-sdk/react": "^
|
|
44
|
+
"@ai-sdk/provider": "^3.0.0",
|
|
45
|
+
"@ai-sdk/react": "^3.0.1",
|
|
44
46
|
"@better-auth/sso": "1.4.1",
|
|
45
47
|
"@daveyplate/better-auth-ui": "^3.2.7",
|
|
46
48
|
"@deco/ui": "workspace:*",
|
|
@@ -79,7 +81,8 @@
|
|
|
79
81
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
80
82
|
"@vercel/nft": "^1.1.1",
|
|
81
83
|
"@vitejs/plugin-react": "^5.1.0",
|
|
82
|
-
"
|
|
84
|
+
"@xyflow/react": "^12.10.0",
|
|
85
|
+
"ai": "^6.0.1",
|
|
83
86
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
84
87
|
"better-auth": "1.4.5",
|
|
85
88
|
"class-variance-authority": "^0.7.1",
|
|
@@ -105,7 +108,6 @@
|
|
|
105
108
|
"tailwind-merge": "^3.3.1",
|
|
106
109
|
"tailwindcss": "^4.1.17",
|
|
107
110
|
"typescript": "^5.9.3",
|
|
108
|
-
"use-mcp": "^0.0.21",
|
|
109
111
|
"vite": "^7.2.1",
|
|
110
112
|
"vite-tsconfig-paths": "^5.1.4",
|
|
111
113
|
"zod": "^3.25.76",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function p(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function i(e){if(!e.includes("/"))return e;const a=e.split("/"),r=a[0],t=a[1];if(!r||!t)return e;if(r.includes(".")){const s=r.split("."),c=s[s.length-1]||r,n=t.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!n||n.length<2?c:n}return t}export{i as e,p as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(r){const e=()=>{throw new Error(`Invalid url to pass to open(): ${r}`)};let t;try{t=new URL(r)}catch{e()}return t.protocol!=="https:"&&t.protocol!=="http:"&&e(),t.hostname!==encodeURIComponent(t.hostname)&&e(),t.username&&(t.username=encodeURIComponent(t.username)),t.password&&(t.password=encodeURIComponent(t.password)),t.pathname=t.pathname.slice(0,1)+encodeURIComponent(t.pathname.slice(1)).replace(/%2f/ig,"/"),t.search=t.search.slice(0,1)+Array.from(t.searchParams.entries()).map(l).join("&"),t.hash=t.hash.slice(0,1)+encodeURIComponent(t.hash.slice(1)),t.href}function l([r,e]){return`${encodeURIComponent(r)}${e.length>0?`=${encodeURIComponent(e)}`:""}`}var u=class{serverUrl;storageKeyPrefix;serverUrlHash;clientName;clientUri;callbackUrl;preventAutoAuth;onPopupWindow;constructor(r,e={}){this.serverUrl=r,this.storageKeyPrefix=e.storageKeyPrefix||"mcp:auth",this.serverUrlHash=this.hashString(r),this.clientName=e.clientName||"MCP Browser Client",this.clientUri=e.clientUri||(typeof window<"u"?window.location.origin:""),this.callbackUrl=n(e.callbackUrl||(typeof window<"u"?new URL("/oauth/callback",window.location.origin).toString():"/oauth/callback")),this.preventAutoAuth=e.preventAutoAuth,this.onPopupWindow=e.onPopupWindow}get redirectUrl(){return n(this.callbackUrl)}get clientMetadata(){return{redirect_uris:[this.redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:this.clientName,client_uri:this.clientUri}}async clientInformation(){const r=this.getKey("client_info"),e=localStorage.getItem(r);if(e)try{return JSON.parse(e)}catch(t){console.warn(`[${this.storageKeyPrefix}] Failed to parse client information:`,t),localStorage.removeItem(r);return}}async saveClientInformation(r){const e=this.getKey("client_info");localStorage.setItem(e,JSON.stringify(r))}async tokens(){const r=this.getKey("tokens"),e=localStorage.getItem(r);if(e)try{return JSON.parse(e)}catch(t){console.warn(`[${this.storageKeyPrefix}] Failed to parse tokens:`,t),localStorage.removeItem(r);return}}async saveTokens(r){const e=this.getKey("tokens");localStorage.setItem(e,JSON.stringify(r)),localStorage.removeItem(this.getKey("code_verifier")),localStorage.removeItem(this.getKey("last_auth_url"))}async saveCodeVerifier(r){const e=this.getKey("code_verifier");localStorage.setItem(e,r)}async codeVerifier(){const r=this.getKey("code_verifier"),e=localStorage.getItem(r);if(!e)throw new Error(`[${this.storageKeyPrefix}] Code verifier not found in storage for key ${r}. Auth flow likely corrupted or timed out.`);return e}async prepareAuthorizationUrl(r){const e=crypto.randomUUID(),t=`${this.storageKeyPrefix}:state_${e}`,o={serverUrlHash:this.serverUrlHash,expiry:Date.now()+1e3*60*10,providerOptions:{serverUrl:this.serverUrl,storageKeyPrefix:this.storageKeyPrefix,clientName:this.clientName,clientUri:this.clientUri,callbackUrl:this.callbackUrl}};localStorage.setItem(t,JSON.stringify(o)),r.searchParams.set("state",e);const c=r.toString(),s=n(c);return localStorage.setItem(this.getKey("last_auth_url"),s),s}async redirectToAuthorization(r){if(this.preventAutoAuth)return;const e=await this.prepareAuthorizationUrl(r),t="width=600,height=700,resizable=yes,scrollbars=yes,status=yes";try{const o=window.open(e,`mcp_auth_${this.serverUrlHash}`,t);this.onPopupWindow&&this.onPopupWindow(e,t,o),!o||o.closed||typeof o.closed>"u"?console.warn(`[${this.storageKeyPrefix}] Popup likely blocked by browser. Manual navigation might be required using the stored URL.`):(o.focus(),console.info(`[${this.storageKeyPrefix}] Redirecting to authorization URL in popup.`))}catch(o){console.error(`[${this.storageKeyPrefix}] Error opening popup window:`,o)}}getLastAttemptedAuthUrl(){const r=localStorage.getItem(this.getKey("last_auth_url"));return r?n(r):null}clearStorage(){const r=`${this.storageKeyPrefix}_${this.serverUrlHash}_`,e=`${this.storageKeyPrefix}:state_`,t=[];let o=0;for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);if(i){if(i.startsWith(r))t.push(i);else if(i.startsWith(e))try{const a=localStorage.getItem(i);a&&JSON.parse(a).serverUrlHash===this.serverUrlHash&&t.push(i)}catch(a){console.warn(`[${this.storageKeyPrefix}] Error parsing state key ${i} during clearStorage:`,a)}}}return[...new Set(t)].forEach(s=>{localStorage.removeItem(s),o++}),o}hashString(r){let e=0;for(let t=0;t<r.length;t++){const o=r.charCodeAt(t);e=(e<<5)-e+o,e=e&e}return Math.abs(e).toString(16)}getKey(r){return`${this.storageKeyPrefix}_${this.serverUrlHash}_${r}`}};export{u as B,n as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b6 as _,r as y,d as R,as as ee,j as t,c as S,af as te,a6 as se,b5 as W}from"./index-B5e6fytH.js";import{f as oe,c as D,U as B,a as ne,e as re}from"./use-connection-IMyxygAc.js";import{T as ae}from"./tool-set-selector-Fu1vBXWK.js";import{B as ie}from"./badge-j-myHF25.js";import{B as I}from"./button-DnKGwZ1P.js";import{I as z}from"./icon-C1glN-Ga.js";import{I as V}from"./input-DpAKmHHm.js";import{S as ce}from"./spinner-Cck765yW.js";import{T as q}from"./textarea--4iImQiq.js";import{c as k}from"./utils-BLBjpUfr.js";import{a as G,u as le,O as de,P as me,E as ue}from"./index-DqmRoUE9.js";import{b as Z,a as xe,V as H}from"./layout-BMHVtK0w.js";import{U as fe}from"./upload-DkfUhTLj.js";import{u as pe}from"./index-C1xA8jg5.js";import{C as he}from"./circle-alert-CpqBZI3V.js";import{E as ge}from"./error-boundary-qOVcoWbq.js";import"./tooltip-DjXyjtiH.js";import"./integration-icon-C_Dk6BbN.js";import"./checkbox-v3iP8MNg.js";import"./select-fvQCifl4.js";import"./collection-search-Bd4XQ4_K.js";import"./use-organization-settings-CpvpbwdB.js";import"./empty-state-DV83eIhT.js";import"./use-binding-BLIUV5ER.js";import"./auth-CGqqbEan.js";import"./use-tool-call-p0lqBezD.js";import"./chunk-2RRQPJJO-DGhxLrrR.js";import"./form-0C1lYHJ2.js";import"./use-gateway-CuMrhcvh.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./extract-connection-data-DzgXoQyz.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-Chpp7zg0.js";import"./index-D2ODleHN.js";import"./schema-BLzWyGtx.js";const be=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],je=_("box",be);const ve=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ne=_("clock",ve);const ye=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],we=_("code",ye);const Se=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ce=_("copy",Se);const ke=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],$e=_("database",ke);const Ie=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],_e=_("info",Ie);const Te=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],K=_("play",Te);function Ee(s){const e=S.c(14),{value:n,onChange:a,alt:r}=s,o=y.useRef(null);let i;e[0]!==a?(i=p=>{const v=p.target.files?.[0];if(v){const w=new FileReader;w.onloadend=()=>{const j=w.result;a(j)},w.readAsDataURL(v)}},e[0]=a,e[1]=i):i=e[1];const m=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},e[2]=l):l=e[2];const u=l;let c;e[3]!==m?(c=t.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:m}),e[3]=m,e[4]=c):c=e[4];let h;e[5]!==r||e[6]!==n?(h=n?t.jsx("img",{src:n,alt:r||"Avatar",className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center text-2xl",children:"🤖"}),e[5]=r,e[6]=n,e[7]=h):h=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:t.jsx(fe,{className:"h-5 w-5 text-white"})}),e[8]=g):g=e[8];let b;e[9]!==h?(b=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[h,g]}),e[9]=h,e[10]=b):b=e[10];let f;return e[11]!==c||e[12]!==b?(f=t.jsxs("div",{className:"relative h-14 w-14 shrink-0 cursor-pointer group",onClick:u,children:[c,b]}),e[11]=c,e[12]=b,e[13]=f):f=e[13],f}function Ae({itemId:s,onBack:e,onUpdate:n}){const[a,r]=y.useState(!1),[o,i]=y.useState("profile"),{connectionId:m}=R({from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"}),l=m??B,u=D(l),c=oe(l,"AGENT",s,u),{register:h,handleSubmit:g,reset:b,setValue:f,watch:p,formState:{isDirty:v}}=ee({defaultValues:{title:"",description:"",instructions:"",avatar:"",tool_set:{}}}),w=p("avatar"),j=p("tool_set")??{};y.useEffect(()=>{c&&b({title:c.title??"",description:c.description??"",instructions:c.instructions??"",avatar:c.avatar??"",tool_set:c.tool_set??{}})},[c,b]);const x=async $=>{r(!0);try{await n($)}finally{r(!1)}},M=$=>{f("tool_set",$,{shouldDirty:!0})};return c?t.jsxs(Z,{onBack:e,children:[t.jsxs(xe,{children:[t.jsx(I,{variant:o==="profile"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="profile"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("profile"),children:"Profile"}),t.jsx(I,{variant:o==="tools"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="tools"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("tools"),children:"Tools"}),t.jsx(I,{variant:o==="triggers"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="triggers"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("triggers"),disabled:!0,children:"Triggers"}),t.jsx(I,{variant:o==="advanced"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="advanced"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("advanced"),disabled:!0,children:"Advanced"})]}),t.jsxs(H,{children:[t.jsx(G,{connectionId:m,title:c.title,icon:c.avatar??"smart_toy"}),t.jsx(I,{className:"bg-[#d0ec1a] text-[#07401a] hover:bg-[#d0ec1a]/90 h-7 text-xs font-medium",onClick:g(x),disabled:!v||a,children:a?t.jsxs(t.Fragment,{children:[t.jsx(z,{name:"progress_activity",size:12,className:"mr-2 animate-spin"}),"Saving..."]}):"Save changes"})]}),o==="profile"&&t.jsx("div",{className:"p-5",children:t.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[t.jsxs("div",{className:"flex gap-4 items-start",children:[t.jsx(Ee,{value:w,onChange:$=>f("avatar",$,{shouldDirty:!0}),alt:p("title")}),t.jsxs("div",{className:"space-y-3 pt-1 flex-1",children:[t.jsx(V,{...h("title"),className:"text-2xl font-medium text-foreground border-transparent hover:border-input focus:border-input px-0 h-auto bg-transparent shadow-none",placeholder:"Agent Name"}),t.jsx(V,{...h("description"),className:"text-sm text-muted-foreground border-transparent hover:border-input focus:border-input px-0 h-auto bg-transparent shadow-none",placeholder:"Brief description"})]})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(ie,{variant:"secondary",className:"px-2 py-0.5 h-6 gap-1.5 bg-secondary/50 text-muted-foreground font-normal text-xs hover:bg-secondary/50",children:[t.jsx(_e,{className:"h-3.5 w-3.5"}),"Type @ to add tools and more"]}),t.jsx("div",{className:"relative",children:t.jsx(q,{...h("instructions"),className:"min-h-[400px] resize-none text-sm leading-relaxed font-normal border-0 focus-visible:ring-0 px-0 py-0 shadow-none",placeholder:"Enter agent instructions..."})})]})]})}),o==="tools"&&t.jsx(ae,{toolSet:j,onToolSetChange:M}),o==="triggers"&&t.jsx("div",{className:"p-5",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Triggers tab coming soon"})}),o==="advanced"&&t.jsx("div",{className:"p-5",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Advanced tab coming soon"})})]}):t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{})})}const ze=te("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/10 text-destructive border-destructive [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Re(s){const e=S.c(10);let n,a,r;e[0]!==s?({className:n,variant:r,...a}=s,e[0]=s,e[1]=n,e[2]=a,e[3]=r):(n=e[1],a=e[2],r=e[3]);let o;e[4]!==n||e[5]!==r?(o=k(ze({variant:r}),n),e[4]=n,e[5]=r,e[6]=o):o=e[6];let i;return e[7]!==a||e[8]!==o?(i=t.jsx("div",{"data-slot":"alert",role:"alert",className:o,...a}),e[7]=a,e[8]=o,e[9]=i):i=e[9],i}function Me(s){const e=S.c(8);let n,a;e[0]!==s?({className:n,...a}=s,e[0]=s,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let r;e[3]!==n?(r=k("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=t.jsx("div",{"data-slot":"alert-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function Oe(s){const e=S.c(8);let n,a;e[0]!==s?({className:n,...a}=s,e[0]=s,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let r;e[3]!==n?(r=k("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=t.jsx("div",{"data-slot":"alert-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function Pe(s){try{const e=new URL(s);return e.pathname=e.pathname.replace(/\/i:([a-f0-9-]+)/gi,"/$1"),e.toString()}catch{return s}}const Ue=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ve(s){const e=S.c(15),{toolName:n,connectionId:a,connection:r,onBack:o}=s;let i;e[0]!==r.connection_url?(i=Pe(r.connection_url),e[0]=r.connection_url,e[1]=i):i=e[1];const m=i,l=`/mcp/${a}`;let u;e[2]!==l?(u=new URL(l,window.location.origin),e[2]=l,e[3]=u):u=e[3];const c=u,h=r.connection_token??null;let g;if(e[4]!==m||e[5]!==h?(g={url:m,token:h},e[4]=m,e[5]=h,e[6]=g):g=e[6],!le(g)){let v;return e[7]!==o?(v=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{onAuthenticate:()=>o(),buttonText:"Go back"})}),e[7]=o,e[8]=v):v=e[8],v}const f=`${a}:${n}`;let p;return e[9]!==a||e[10]!==c||e[11]!==o||e[12]!==f||e[13]!==n?(p=t.jsx(De,{toolName:n,connectionId:a,mcpProxyUrl:c,onBack:o},f),e[9]=a,e[10]=c,e[11]=o,e[12]=f,e[13]=n,e[14]=p):p=e[14],p}function De({toolName:s,connectionId:e,mcpProxyUrl:n,onBack:a}){const[r,o]=y.useState({}),[i,m]=y.useState("{}"),[l,u]=y.useState(null),[c,h]=y.useState(null),[g,b]=y.useState(!1),[f,p]=y.useState(null),[v,w]=y.useState("json"),j=pe({url:n.href,clientName:"MCP Tool Inspector",clientUri:window.location.origin,autoReconnect:!1});y.useEffect(()=>{j.error&&console.error("MCP Error:",j.error)},[j.error]);const x=j.tools?.find(d=>d.name===s),M=x?.inputSchema?.properties,$=M?Object.keys(M):[],A=$.length>0,O={};if(A&&x?.inputSchema?.properties)for(const d of $)O[d]=x.inputSchema.required?.includes(d)?"":void 0;const J=d=>Object.prototype.hasOwnProperty.call(r,d),Q=async()=>{b(!0),h(null),u(null),p(null);const d=performance.now(),C=D(e);try{const N=A?{...O,...r}:(()=>{const T=i.trim();if(!T)return{};const E=JSON.parse(T);if(E&&typeof E=="object")return E;throw new Error("Raw JSON input must be an object.")})();A&&x?.inputSchema?.properties&&Object.entries(x.inputSchema.properties).forEach(([T,E])=>{if((E.type==="object"||E.type==="array")&&typeof N[T]=="string")try{N[T]=JSON.parse(N[T])}catch{}});const P=await C(s,N),U=performance.now(),X=Math.round(U-d);u(P);const Y=JSON.stringify(P),F=new TextEncoder().encode(Y).length;p({duration:`${X}ms`,bytes:`${F} bytes`,tokens:`~${Math.ceil(F/4)} tokens`,cost:"$0.0000"})}catch(N){const P=N instanceof Error?N.message:String(N);h(P||"Unknown error occurred");const U=performance.now();p({duration:`${Math.round(U-d)}ms`})}finally{b(!1)}},L=(d,C)=>{o(N=>({...N,[d]:C}))};return t.jsxs(Z,{onBack:a,children:[t.jsx(H,{children:t.jsx(G,{connectionId:e,title:x?.title??Ue(s),icon:"build"})}),t.jsxs("div",{className:"flex flex-col items-center w-full max-w-[1500px] mx-auto p-10 gap-4",children:[t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h1",{className:"text-2xl font-medium text-foreground",children:s}),t.jsx("p",{className:"text-muted-foreground text-base",children:x?.description||"No description available"})]}),t.jsxs("div",{className:"flex items-center gap-4 py-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[j.state==="ready"?t.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"}):j.state==="connecting"||j.state==="authenticating"?t.jsx(z,{name:"progress_activity",size:12,className:"animate-spin text-yellow-500"}):t.jsx("div",{className:"h-2 w-2 rounded-full bg-red-500"}),t.jsx("span",{className:"font-mono text-sm capitalize text-muted-foreground",children:j.state.replace("_"," ")})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ne,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.duration||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.tokens||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($e,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.bytes||"-"})]})]}),c&&t.jsxs(Re,{variant:"destructive",className:"max-w-[800px] w-full bg-red-50 dark:bg-red-900/10 border-red-200 dark:border-red-900",children:[t.jsx(he,{className:"h-4 w-4"}),t.jsx(Me,{children:"Execution Failed"}),t.jsx(Oe,{children:c})]}),t.jsxs("div",{className:"flex flex-col gap-4 w-full max-w-[800px] items-center",children:[t.jsxs("div",{className:"w-full bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-4 w-4 rounded-sm bg-primary/10 flex items-center justify-center",children:t.jsx(K,{className:"h-3 w-3 text-primary"})}),t.jsx("span",{className:"font-medium text-sm",children:"Input"})]}),t.jsxs(I,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Q,disabled:g,children:[g?t.jsx(z,{name:"progress_activity",size:14,className:"animate-spin"}):t.jsx(K,{className:"h-3.5 w-3.5 fill-current"}),"Execute tool"]})]}),t.jsxs("div",{className:"p-4 space-y-4",children:[t.jsx("div",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Arguments"}),A&&x?.inputSchema?.properties?Object.entries(x.inputSchema.properties).map(([d,C])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:d}),x.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"}),t.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:C.type})]}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:C.description}),C.type==="object"||C.type==="array"?t.jsx(q,{className:"flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 font-mono",value:J(d)?r[d]??"":O[d]??"",onChange:N=>L(d,N.target.value),placeholder:`Enter ${d} as JSON...`}):t.jsx(V,{value:J(d)?r[d]??"":O[d]??"",onChange:N=>L(d,N.target.value),placeholder:`Enter ${d}...`})]},d)):t.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."}),x?.inputSchema&&!A&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx("textarea",{className:"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",value:i,onChange:d=>m(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]})]})]}),t.jsxs("div",{className:"w-full bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[t.jsx("span",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Execution Result"}),t.jsxs("div",{className:"flex items-center bg-muted rounded-lg p-1 h-8",children:[t.jsx("button",{onClick:()=>w("json"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all",v==="json"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"JSON"}),t.jsxs("button",{onClick:()=>w("view"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all flex items-center gap-1",v==="view"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),disabled:!0,title:"Coming soon",children:["Create view",t.jsx(me,{className:"h-3 w-3"})]})]})]}),t.jsxs("div",{className:"relative min-h-[200px] max-h-[500px] overflow-auto bg-zinc-950 text-zinc-50 p-4 font-mono text-xs",children:[l?t.jsx("pre",{className:"whitespace-pre-wrap break-all",children:JSON.stringify(l,null,2)}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-zinc-700",children:[t.jsx(we,{className:"h-8 w-8 mb-2 opacity-50"}),t.jsx("p",{children:"Run the tool to see results"})]}),l&&t.jsx("div",{className:"absolute top-4 right-4 flex gap-2",children:t.jsx(I,{size:"icon",variant:"secondary",className:"h-8 w-8 bg-zinc-800 text-zinc-400 hover:text-white hover:bg-zinc-700 border-zinc-700",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(l,null,2)),se.success("Copied to clipboard")},children:t.jsx(Ce,{className:"h-4 w-4"})})})]})]})]})]})]})}function Be(s){const e=S.c(8),{itemId:n,onBack:a}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=R(r).connectionId??B,m=ne(i);if(!m){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=c):c=e[1],c}let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(z,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),e[2]=l):l=e[2];let u;return e[3]!==m||e[4]!==i||e[5]!==a||e[6]!==n?(u=t.jsx(y.Suspense,{fallback:l,children:t.jsx(Ve,{toolName:n,connectionId:i,connection:m,onBack:a})}),e[3]=m,e[4]=i,e[5]=a,e[6]=n,e[7]=u):u=e[7],u}const Je={agent:Ae};function Le(){const s=S.c(6),e=W();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const a=R(n),r=decodeURIComponent(a.itemId);let o;s[1]!==e.history?(o=()=>{e.history.back()},s[1]=e.history,s[2]=o):o=s[2];const i=o,m=Fe;let l;return s[3]!==i||s[4]!==r?(l=t.jsx(Be,{itemId:r,onBack:i,onUpdate:m}),s[3]=i,s[4]=r,s[5]=l):l=s[5],l}async function Fe(s){return Promise.resolve()}function Ke(){const s=S.c(17),e=W();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const a=R(n),r=a.connectionId,o=decodeURIComponent(a.collectionName),i=decodeURIComponent(a.itemId);let m;s[1]!==e.history?(m=()=>{e.history.back()},s[1]=e.history,s[2]=m):m=s[2];const l=m,u=r??B;let c;s[3]!==u?(c=D(u),s[3]=u,s[4]=c):c=s[4];const g=re(u,o,c);let b;s[5]!==g||s[6]!==i?(b=async x=>{i&&await g.update.mutateAsync({id:i,data:x})},s[5]=g,s[6]=i,s[7]=b):b=s[7];const f=b;let p;s[8]!==o?(p=o?.toLowerCase(),s[8]=o,s[9]=p):p=s[9];const v=p,w=v&&Je[v];if(w){let x;return s[10]!==w||s[11]!==l||s[12]!==f||s[13]!==i?(x=t.jsx(w,{itemId:i,onBack:l,onUpdate:f}),s[10]=w,s[11]=l,s[12]=f,s[13]=i,s[14]=x):x=s[14],x}let j;return s[15]!==l?(j=t.jsx(ue,{icon:"extension",title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:l,children:"Go back"}}),s[15]=l,s[16]=j):j=s[16],j}function We(){const s=S.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=e):e=s[0];const n=R(e);if(decodeURIComponent(n.collectionName)==="tools"){let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Le,{}),s[1]=i):i=s[1],i}let o;return s[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Ke,{}),s[2]=o):o=s[2],o}function _t(){const s=S.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ge,{children:t.jsx(y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(z,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(We,{})})}),s[0]=e):e=s[0],e}export{_t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as F,r as R,j as t}from"./index-B5e6fytH.js";import{B as G}from"./button-DnKGwZ1P.js";import{c as H,D as J,a as Q,b as U}from"./dropdown-menu-BIeRR6rM.js";import{I as w}from"./icon-C1glN-Ga.js";import{d as X,b as Y,a as Z,T as ee}from"./tooltip-DjXyjtiH.js";import{c as L}from"./utils-BLBjpUfr.js";function ne(W){const e=F.c(47),{viewMode:r,onViewModeChange:i,sortKey:I,sortDirection:y,onSort:N,sortOptions:v}=W;let _;e[0]!==v?(_=v===void 0?[]:v,e[0]=v,e[1]=_):_=e[1];const C=_,E=R.useRef(null),B=R.useRef(null);let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z={left:0,width:0,opacity:0},e[2]=z):z=e[2];const[j,q]=R.useState(z);let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k=s=>{if(!s.current)return;const{offsetLeft:o,offsetWidth:A}=s.current;q({left:o,width:A,opacity:1})},e[3]=k):k=e[3];const V=k;let S,T;e[4]!==r?(S=()=>{V(r==="table"?E:B)},T=[r],e[4]=r,e[5]=S,e[6]=T):(S=e[5],T=e[6]),R.useEffect(S,T);let l;e[7]!==r?(l=s=>{s&&setTimeout(()=>{V(r==="table"?E:B)},0)},e[7]=r,e[8]=l):l=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X,{children:t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(J,{asChild:!0,children:t.jsx(G,{variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(w,{name:"tune",size:16})})})}),t.jsx(ee,{children:"Search filters"})]})}),e[9]=D):D=e[9];let n;e[10]!==i?(n=()=>{i("table")},e[10]=i,e[11]=n):n=e[11];const O=r==="table"?"text-foreground":"text-muted-foreground";let a;e[12]!==O?(a=L("transition-colors ease-out duration-200",O),e[12]=O,e[13]=a):a=e[13];let c;e[14]!==a?(c=t.jsx(w,{name:"table_rows",size:16,className:a}),e[14]=a,e[15]=c):c=e[15];let d;e[16]!==c||e[17]!==n?(d=t.jsx("button",{ref:E,type:"button",onClick:n,className:"relative z-10 flex-1 flex items-center justify-center gap-2 h-12 px-4 rounded-lg",children:c}),e[16]=c,e[17]=n,e[18]=d):d=e[18];let f;e[19]!==i?(f=()=>{i("cards")},e[19]=i,e[20]=f):f=e[20];const P=r==="cards"?"text-foreground":"text-muted-foreground";let u;e[21]!==P?(u=L("transition-colors ease-out duration-200",P),e[21]=P,e[22]=u):u=e[22];let m;e[23]!==u?(m=t.jsx(w,{name:"grid_view",size:16,className:u}),e[23]=u,e[24]=m):m=e[24];let x;e[25]!==f||e[26]!==m?(x=t.jsx("button",{ref:B,type:"button",onClick:f,className:"relative z-10 flex-1 flex items-center justify-center gap-2 h-12 px-4 rounded-lg",children:m}),e[25]=f,e[26]=m,e[27]=x):x=e[27];const $=`${j.left}px`,K=`${j.width}px`;let p;e[28]!==j.opacity||e[29]!==$||e[30]!==K?(p=t.jsx("div",{className:"absolute z-0 h-12 bg-background border border-border rounded-lg transition-all ease-out duration-200",style:{left:$,width:K,opacity:j.opacity}}),e[28]=j.opacity,e[29]=$,e[30]=K,e[31]=p):p=e[31];let h;e[32]!==d||e[33]!==x||e[34]!==p?(h=t.jsx("div",{className:"p-2 border-b border-border",children:t.jsx("div",{className:"relative bg-muted rounded-lg p-1",children:t.jsxs("div",{className:"relative flex gap-0",children:[d,x,p]})})}),e[32]=d,e[33]=x,e[34]=p,e[35]=h):h=e[35];let b;e[36]!==N||e[37]!==y||e[38]!==I||e[39]!==C?(b=C.length>0&&N&&t.jsxs("div",{className:"p-2",children:[t.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),C.map(s=>{const o=I===s.id;return t.jsx(H,{onClick:()=>N(s.id),className:L("h-8 px-2 py-0 cursor-pointer",o&&"bg-accent"),children:t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[o&&t.jsx(w,{name:"check",size:16,className:"text-foreground shrink-0"}),!o&&t.jsx("div",{className:"w-4 shrink-0"}),t.jsx("span",{className:"text-sm text-foreground flex-1",children:s.label}),o&&y&&t.jsx(w,{name:y==="asc"?"arrow_upward":"arrow_downward",size:16,className:"text-foreground shrink-0"})]})},s.id)})]}),e[36]=N,e[37]=y,e[38]=I,e[39]=C,e[40]=b):b=e[40];let g;e[41]!==h||e[42]!==b?(g=t.jsxs(Q,{align:"end",className:"w-[200px] p-0 gap-0",children:[h,b]}),e[41]=h,e[42]=b,e[43]=g):g=e[43];let M;return e[44]!==g||e[45]!==l?(M=t.jsxs(U,{onOpenChange:l,children:[D,g]}),e[44]=g,e[45]=l,e[46]=M):M=e[46],M}export{ne as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as j,j as i}from"./index-B5e6fytH.js";import{C as b}from"./collection-display-button-Cws3c2TG.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-base font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as S,j as s}from"./index-B5e6fytH.js";import{B as _}from"./badge-j-myHF25.js";import{C as A}from"./card-I0CWqn2J.js";import{c as j}from"./utils-BLBjpUfr.js";import{I as $}from"./integration-icon-C_Dk6BbN.js";function L(v){const t=S.c(44),{connection:e,onClick:N,headerActions:i,footer:C,className:b,size:R,fallbackIcon:k}=v,z=R===void 0?"md":R,I=z==="sm"?"p-4":"p-6",w=z==="sm"?"text-sm":"text-base",B=z==="sm"?"text-xs":"text-base",E=N&&"hover:bg-muted/50";let o;t[0]!==b||t[1]!==E?(o=j("cursor-pointer transition-colors group",E,b),t[0]=b,t[1]=E,t[2]=o):o=t[2];let l;t[3]!==I?(l=j("flex flex-col gap-4 relative",I),t[3]=I,t[4]=l):l=t[4];let a;t[5]!==e.icon||t[6]!==e.title||t[7]!==k?(a=s.jsx($,{icon:e.icon,name:e.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:k}),t[5]=e.icon,t[6]=e.title,t[7]=k,t[8]=a):a=t[8];let n;t[9]!==e.status||t[10]!==i?(n=e.status&&s.jsx(_,{variant:e.status==="active"?"default":"outline",className:j("text-xs transition-opacity",i&&"opacity-100 group-hover:opacity-0"),children:e.status}),t[9]=e.status,t[10]=i,t[11]=n):n=t[11];let c;t[12]!==i?(c=i&&s.jsx("div",{className:j("absolute top-0 right-0 transition-opacity","opacity-0 group-hover:opacity-100"),onClick:D,children:i}),t[12]=i,t[13]=c):c=t[13];let r;t[14]!==n||t[15]!==c?(r=s.jsxs("div",{className:"relative",children:[n,c]}),t[14]=n,t[15]=c,t[16]=r):r=t[16];let m;t[17]!==a||t[18]!==r?(m=s.jsxs("div",{className:"flex items-start justify-between",children:[a,r]}),t[17]=a,t[18]=r,t[19]=m):m=t[19];let p;t[20]!==w?(p=j("font-medium text-foreground truncate",w),t[20]=w,t[21]=p):p=t[21];let d;t[22]!==e.title||t[23]!==p?(d=s.jsx("h3",{className:p,children:e.title}),t[22]=e.title,t[23]=p,t[24]=d):d=t[24];let f;t[25]!==B?(f=j("text-muted-foreground line-clamp-2",B),t[25]=B,t[26]=f):f=t[26];const P=e.description||"No description";let x;t[27]!==f||t[28]!==P?(x=s.jsx("p",{className:f,children:P}),t[27]=f,t[28]=P,t[29]=x):x=t[29];let u;t[30]!==d||t[31]!==x?(u=s.jsxs("div",{className:"flex flex-col gap-0",children:[d,x]}),t[30]=d,t[31]=x,t[32]=u):u=t[32];let h;t[33]!==C?(h=C&&s.jsx("div",{onClick:q,children:C}),t[33]=C,t[34]=h):h=t[34];let g;t[35]!==u||t[36]!==h||t[37]!==l||t[38]!==m?(g=s.jsxs("div",{className:l,children:[m,u,h]}),t[35]=u,t[36]=h,t[37]=l,t[38]=m,t[39]=g):g=t[39];let y;return t[40]!==N||t[41]!==g||t[42]!==o?(y=s.jsx(A,{className:o,onClick:N,children:g}),t[40]=N,t[41]=g,t[42]=o,t[43]=y):y=t[43],y}function q(v){return v.stopPropagation()}function D(v){return v.stopPropagation()}export{L as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as V,j as o,a5 as Oe,a as Ye,r as ze,a6 as Ze,d as et,b as tt,b5 as ot}from"./index-B5e6fytH.js";import{E as Ee}from"./empty-state-DV83eIhT.js";import{E as Fe}from"./error-boundary-qOVcoWbq.js";import{a as Ke,e as st,u as nt,c as it,d as lt}from"./use-connection-IMyxygAc.js";import{b as at}from"./use-binding-BLIUV5ER.js";import{E as Ve,P as rt,a as ct,u as dt,S as mt}from"./index-DqmRoUE9.js";import{B as ge}from"./button-DnKGwZ1P.js";import{I as M}from"./icon-C1glN-Ga.js";import{a as ut,T as ft,R as pt}from"./resource-tabs-E4yf0eYT.js";import{V as ht,a as gt,b as xt}from"./layout-BMHVtK0w.js";import{g as Be}from"./generate-id-Dyweu44Y.js";import{C as Le}from"./collection-display-button-Cws3c2TG.js";import{C as jt}from"./collection-search-Bd4XQ4_K.js";import{C as bt}from"./card-I0CWqn2J.js";import{I as Ct}from"./integration-icon-C_Dk6BbN.js";import{b as We,D as qe,a as He,c as B}from"./dropdown-menu-BIeRR6rM.js";import{C as vt}from"./collection-table-wrapper-Dv4rgxdy.js";import{u as yt}from"./use-list-state-Bas0EIwN.js";import{B as _t}from"./extract-connection-data-DzgXoQyz.js";import{A as wt,g as St,c as Nt,b as It,d as Tt,e as Dt,a as $t,f as At}from"./alert-dialog-Caf0mgW9.js";import"./utils-BLBjpUfr.js";import"./tooltip-DjXyjtiH.js";import"./auth-CGqqbEan.js";import"./use-organization-settings-CpvpbwdB.js";import"./use-tool-call-p0lqBezD.js";import"./chunk-2RRQPJJO-DGhxLrrR.js";import"./form-0C1lYHJ2.js";import"./input-DpAKmHHm.js";import"./select-fvQCifl4.js";import"./use-gateway-CuMrhcvh.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./registry-utils-ulDDT0d8.js";import"./index-Chpp7zg0.js";import"./index-D2ODleHN.js";import"./schema-BLzWyGtx.js";import"./useQuery-BO2jzwkw.js";import"./badge-j-myHF25.js";import"./use-mobile-CxX0wu31.js";function Pt(t,e){const s=t.properties||{};for(const i in s){const a=s[i];if(a&&a.type==="string"&&(a.format==="url"||a.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const l=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of l)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function kt(t){const e=V.c(25),{item:s,schema:l,actions:i}=t;let a;e[0]!==s||e[1]!==l?(a=Pt(l,s),e[0]=s,e[1]=l,e[2]=a):a=e[2];const u=a,n=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 g=f;let r;e[5]!==u||e[6]!==s.title?(r=o.jsx(Ct,{icon:u,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=s.title,e[7]=r):r=e[7];let d;e[8]!==s.title?(d=o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=d):d=e[9];const x=n||"No description";let h;e[10]!==x?(h=o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:x}),e[10]=x,e[11]=h):h=e[11];let j;e[12]!==d||e[13]!==h?(j=o.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[d,h]}),e[12]=d,e[13]=h,e[14]=j):j=e[14];let p;e[15]!==r||e[16]!==j?(p=o.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[r,j]}),e[15]=r,e[16]=j,e[17]=p):p=e[17];let c;e[18]!==i||e[19]!==g||e[20]!==s?(c=g&&o.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Mt,onMouseDown:Et,children:o.jsxs(We,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:o.jsx(M,{name:"more_vert",size:20})})}),o.jsxs(He,{align:"end",onClick:Ot,children:[i.open&&o.jsxs(B,{onClick:C=>{C.stopPropagation(),i.open?.(s)},children:[o.jsx(M,{name:"visibility",size:16}),"Open"]}),i.edit&&o.jsxs(B,{onClick:C=>{C.stopPropagation(),i.edit?.(s)},children:[o.jsx(M,{name:"edit",size:16}),"Edit"]}),i.duplicate&&o.jsxs(B,{onClick:C=>{C.stopPropagation(),i.duplicate?.(s)},children:[o.jsx(M,{name:"content_copy",size:16}),"Duplicate"]}),i.delete&&o.jsxs(B,{variant:"destructive",onClick:C=>{C.stopPropagation(),i.delete?.(s)},children:[o.jsx(M,{name:"delete",size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=g,e[20]=s,e[21]=c):c=e[21];let N;return e[22]!==p||e[23]!==c?(N=o.jsxs(bt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[p,c]}),e[22]=p,e[23]=c,e[24]=N):N=e[24],N}function Ot(t){return t.stopPropagation()}function zt(t){return t.stopPropagation()}function Et(t){return t.stopPropagation()}function Mt(t){return t.stopPropagation()}function Je(t,e){return Object.keys(t.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 Ut(t){const e=V.c(32),{data:s,schema:l,viewMode:i,onViewModeChange:a,search:u,sortKey:n,sortDirection:f,onSort:g,actions:r,onItemClick:d,headerActions:x,emptyState:h,readOnly:j,columns:p,hideToolbar:c,sortableFields:N}=t,C=a===void 0?Kt:a,v=f===void 0?"asc":f,P=g===void 0?Ft:g;let m;e[0]!==r?(m=r===void 0?{}:r,e[0]=r,e[1]=m):m=e[1];const I=m,k=d===void 0?Rt:d,T=x===void 0?null:x,y=h===void 0?null:h,O=j===void 0?!1:j,_=p===void 0?void 0:p,z=c===void 0?!1:c,w=N===void 0?void 0:N;let D;e[2]!==_||e[3]!==l||e[4]!==w?(D=_?_.filter(Bt).filter(U=>!w||w.includes(U.id)).map(Vt):Je(l,w),e[2]=_,e[3]=l,e[4]=w,e[5]=D):D=e[5];const S=D;let $;e[6]!==T||e[7]!==z||e[8]!==P||e[9]!==C||e[10]!==v||e[11]!==n||e[12]!==S||e[13]!==i?($=!z&&o.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:o.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[o.jsx("div",{className:"flex items-center gap-2 flex-1",children:T}),o.jsx("div",{className:"flex items-center gap-2 shrink-0",children:o.jsx(Le,{viewMode:i,onViewModeChange:C,sortKey:n,sortDirection:v,onSort:P,sortOptions:S})})]})}),e[6]=T,e[7]=z,e[8]=P,e[9]=C,e[10]=v,e[11]=n,e[12]=S,e[13]=i,e[14]=$):$=e[14];let b;e[15]!==I||e[16]!==_||e[17]!==s||e[18]!==y||e[19]!==k||e[20]!==P||e[21]!==O||e[22]!==l||e[23]!==u||e[24]!==v||e[25]!==n||e[26]!==w||e[27]!==i?(b=i==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?o.jsx("div",{className:"flex items-center justify-center h-full",children:y||o.jsx(Ve,{icon:"inbox",title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(U=>o.jsx("div",{onClick:()=>k?.(U),className:"cursor-pointer h-full",children:o.jsx(kt,{item:U,schema:l,readOnly:O,actions:I})},U.id))})}):o.jsx(vt,{columns:Ht(_,l,w,I),data:s,sortKey:n,sortDirection:v,onSort:P,onRowClick:k,emptyState:y||o.jsx(Ve,{icon:"inbox",title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=I,e[16]=_,e[17]=s,e[18]=y,e[19]=k,e[20]=P,e[21]=O,e[22]=l,e[23]=u,e[24]=v,e[25]=n,e[26]=w,e[27]=i,e[28]=b):b=e[28];let E;return e[29]!==$||e[30]!==b?(E=o.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[$,b]}),e[29]=$,e[30]=b,e[31]=E):E=e[31],E}function Vt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Bt(t){return t.sortable!==!1}function Rt(){}function Ft(){}function Kt(){}function Lt(t){return{id:"actions",header:"",render:e=>o.jsxs(We,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:o.jsx(M,{name:"more_vert",size:20})})}),o.jsxs(He,{align:"end",onClick:s=>s.stopPropagation(),children:[t.open&&o.jsxs(B,{onClick:s=>{s.stopPropagation(),t.open?.(e)},children:[o.jsx(M,{name:"visibility",size:16}),"Open"]}),t.edit&&o.jsxs(B,{onClick:s=>{s.stopPropagation(),t.edit?.(e)},children:[o.jsx(M,{name:"edit",size:16}),"Edit"]}),t.duplicate&&o.jsxs(B,{onClick:s=>{s.stopPropagation(),t.duplicate?.(e)},children:[o.jsx(M,{name:"content_copy",size:16}),"Duplicate"]}),t.delete&&o.jsxs(B,{variant:"destructive",onClick:s=>{s.stopPropagation(),t.delete?.(e)},children:[o.jsx(M,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function Wt(t){const e=t.type;return e==="string"||e==="number"||e==="integer"||e==="boolean"}function Re(t){return t.type==="string"&&(t.format==="url"||t.format==="uri")}function qt(t,e){const s=t.properties||{},l=Object.keys(s).filter(n=>{const f=s[n];return f&&Wt(f)}),i=l.find(n=>{const f=s[n];return f&&Re(f)}),a=new Set;i&&a.add(i);const u=["title","description","updated_at","updated_by"];for(const n of u)l.includes(n)&&i!==n&&!a.has(n)&&a.add(n);for(const n of l)a.has(n)||a.add(n);return[...a.values()].map(n=>{const f=s[n];if(!f)return{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d==null?"—":o.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:e?e.includes(n):!["id"].includes(n),cellClassName:"max-w-[200px]"};const g=e?e.includes(n):!["id"].includes(n);return f.format==="date-time"||n.endsWith("_at")?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d?o.jsx("span",{className:"block truncate max-w-full",children:new Date(d).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:i===n&&Re(f)?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d?o.jsx("img",{src:String(d),alt:n,className:"h-8 w-8 rounded object-cover"}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d==null?"—":o.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:g,cellClassName:"max-w-[100px]"}})}function Ht(t,e,s,l){const i=t||qt(e,s);return i.some(n=>n.id==="actions")?i:Object.keys(l).length>0?[...i,Lt(l)]:i}function Jt(t){const e=V.c(117),{connectionId:s,org:l,activeCollection:i}=t,a=i.name,u=i.schema??_t,n=i.hasCreateTool,f=i.hasUpdateTool,g=i.hasDeleteTool,r=Oe(),{data:d}=Ye.useSession(),x=d?.user?.id||"unknown",h=Ke(s);let j;e[0]!==s?(j=it(s),e[0]=s,e[1]=j):j=e[1];const p=j,c=st(s,a,p),N=`${s}-${a}`;let C;e[2]!==l||e[3]!==N?(C={namespace:l,resource:N,defaultSortKey:"updated_at"},e[2]=l,e[3]=N,e[4]=C):C=e[4];const{search:v,searchTerm:P,setSearch:m,viewMode:I,setViewMode:k,sortKey:T,sortDirection:y,handleSort:O}=yt(C);let _;e[5]!==P||e[6]!==y||e[7]!==T?(_={searchTerm:P,sortKey:T,sortDirection:y},e[5]=P,e[6]=y,e[7]=T,e[8]=_):_=e[8];const z=nt(s,a,p,_),w=!n&&!f&&!g;let D;e[9]!==a||e[10]!==s||e[11]!==r||e[12]!==l?(D=A=>{r({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:s,collectionName:a,itemId:A.id}})},e[9]=a,e[10]=s,e[11]=r,e[12]=l,e[13]=D):D=e[13];const S=D;let $;e[14]!==c.create||e[15]!==x?($=async A=>{const he=new Date().toISOString();await c.create.mutateAsync({...A,id:Be("conn"),title:`${A.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[14]=c.create,e[15]=x,e[16]=$):$=e[16];const b=$,[E,U]=ze.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=A=>{U(A)},e[17]=le):le=e[17];const Ge=le;let R;e[18]!==S||e[19]!==f?(R=f&&{edit:S},e[18]=S,e[19]=f,e[20]=R):R=e[20];let F;e[21]!==b||e[22]!==n?(F=n&&{duplicate:b},e[21]=b,e[22]=n,e[23]=F):F=e[23];let K;e[24]!==g?(K=g&&{delete:Ge},e[24]=g,e[25]=K):K=e[25];let ae;e[26]!==K||e[27]!==R||e[28]!==F?(ae={...R,...F,...K},e[26]=K,e[27]=R,e[28]=F,e[29]=ae):ae=e[29];const xe=ae;let re;e[30]!==c.delete||e[31]!==E?(re=async()=>{E&&(await c.delete.mutateAsync(E.id),U(null))},e[30]=c.delete,e[31]=E,e[32]=re):re=e[32];const je=re;let ce;e[33]!==c.create||e[34]!==a||e[35]!==s||e[36]!==n||e[37]!==r||e[38]!==l||e[39]!==x?(ce=async()=>{if(!n){Ze.error("Create operation is not available for this collection");return}const A=new Date().toISOString(),he={id:Be("conn"),title:"New Item",created_at:A,updated_at:A,created_by:x,updated_by:x};try{const ke=await c.create.mutateAsync(he);r({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:s,collectionName:a,itemId:ke.id}})}catch(ke){console.error("Failed to create item:",ke)}},e[33]=c.create,e[34]=a,e[35]=s,e[36]=n,e[37]=r,e[38]=l,e[39]=x,e[40]=ce):ce=e[40];const be=ce;let de;e[41]!==u?(de=Je(u),e[41]=u,e[42]=de):de=e[42];const Ce=de,Me=(z?.length??0)>0,Qe=n&&Me,Xe=n&&!Me&&!v;let me;e[43]!==c.create||e[44]!==be||e[45]!==n?(me=n?o.jsxs(ge,{onClick:be,size:"sm",disabled:c.create.isPending,className:"h-7",children:[o.jsx(rt,{className:"mr-2 h-4 w-4"}),c.create.isPending?"Creating...":"Create"]}):null,e[43]=c.create,e[44]=be,e[45]=n,e[46]=me):me=e[46];const Ue=me,ve=T;let L;e[47]!==O||e[48]!==k||e[49]!==y||e[50]!==Ce||e[51]!==ve||e[52]!==I?(L=o.jsx(Le,{viewMode:I,onViewModeChange:k,sortKey:ve,sortDirection:y,onSort:O,sortOptions:Ce}),e[47]=O,e[48]=k,e[49]=y,e[50]=Ce,e[51]=ve,e[52]=I,e[53]=L):L=e[53];const ye=`${a}s`,_e=h?.icon??"grid_view";let W;e[54]!==s||e[55]!==ye||e[56]!==_e?(W=o.jsx(ct,{connectionId:s,title:ye,icon:_e}),e[54]=s,e[55]=ye,e[56]=_e,e[57]=W):W=e[57];const we=Qe&&Ue;let q;e[58]!==L||e[59]!==W||e[60]!==we?(q=o.jsxs(ht,{children:[L,W,we]}),e[58]=L,e[59]=W,e[60]=we,e[61]=q):q=e[61];const Se=`Search ${a}...`;let H;e[62]!==m?(H=A=>{A.key==="Escape"&&(m(""),A.target.blur())},e[62]=m,e[63]=H):H=e[63];let J;e[64]!==v||e[65]!==m||e[66]!==Se||e[67]!==H?(J=o.jsx(jt,{value:v,onChange:m,placeholder:Se,onKeyDown:H}),e[64]=v,e[65]=m,e[66]=Se,e[67]=H,e[68]=J):J=e[68];let G;e[69]!==z?(G=z??[],e[69]=z,e[70]=G):G=e[70];const Ne=T;let Q;e[71]!==S?(Q=A=>S(A),e[71]=S,e[72]=Q):Q=e[72];const Ie="No items found",Te=v?"Try adjusting your search terms":"This collection doesn't have any items yet.",De=Xe?Ue:void 0;let X;e[73]!==Ie||e[74]!==Te||e[75]!==De?(X=o.jsx(Ee,{image:null,title:Ie,description:Te,actions:De}),e[73]=Ie,e[74]=Te,e[75]=De,e[76]=X):X=e[76];let Y;e[77]!==O||e[78]!==w||e[79]!==xe||e[80]!==u||e[81]!==v||e[82]!==m||e[83]!==k||e[84]!==y||e[85]!==G||e[86]!==Ne||e[87]!==Q||e[88]!==X||e[89]!==I?(Y=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(Ut,{hideToolbar:!0,data:G,schema:u,viewMode:I,onViewModeChange:k,search:v,onSearchChange:m,sortKey:Ne,sortDirection:y,onSort:O,actions:xe,onItemClick:Q,readOnly:w,emptyState:X})}),e[77]=O,e[78]=w,e[79]=xe,e[80]=u,e[81]=v,e[82]=m,e[83]=k,e[84]=y,e[85]=G,e[86]=Ne,e[87]=Q,e[88]=X,e[89]=I,e[90]=Y):Y=e[90];let Z;e[91]!==J||e[92]!==Y?(Z=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[J,Y]}),e[91]=J,e[92]=Y,e[93]=Z):Z=e[93];const $e=!!E;let ue;e[94]===Symbol.for("react.memo_cache_sentinel")?(ue=A=>{A||U(null)},e[94]=ue):ue=e[94];let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=o.jsx(Nt,{children:"Delete item?"}),e[95]=fe):fe=e[95];const Ae=E?.title;let ee;e[96]!==Ae?(ee=o.jsxs(It,{children:[fe,o.jsxs(Tt,{children:['Are you sure you want to delete "',Ae,'"? This action cannot be undone.']})]}),e[96]=Ae,e[97]=ee):ee=e[97];let te;e[98]!==c.delete.isPending?(te=o.jsx(wt,{disabled:c.delete.isPending,children:"Cancel"}),e[98]=c.delete.isPending,e[99]=te):te=e[99];const Pe=c.delete.isPending?"Deleting...":"Delete";let oe;e[100]!==c.delete.isPending||e[101]!==je||e[102]!==Pe?(oe=o.jsx(St,{onClick:je,disabled:c.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=c.delete.isPending,e[101]=je,e[102]=Pe,e[103]=oe):oe=e[103];let se;e[104]!==te||e[105]!==oe?(se=o.jsxs(Dt,{children:[te,oe]}),e[104]=te,e[105]=oe,e[106]=se):se=e[106];let ne;e[107]!==ee||e[108]!==se?(ne=o.jsxs($t,{children:[ee,se]}),e[107]=ee,e[108]=se,e[109]=ne):ne=e[109];let ie;e[110]!==$e||e[111]!==ne?(ie=o.jsx(At,{open:$e,onOpenChange:ue,children:ne}),e[110]=$e,e[111]=ne,e[112]=ie):ie=e[112];let pe;return e[113]!==q||e[114]!==Z||e[115]!==ie?(pe=o.jsxs(o.Fragment,{children:[q,Z,ie]}),e[113]=q,e[114]=Z,e[115]=ie,e[116]=pe):pe=e[116],pe}function Gt(t){const e=V.c(2),{repository:s}=t;let l;return e[0]!==s?(l=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(ut,{repository:s})}),e[0]=s,e[1]=l):l=e[1],l}function Qt(t){const e=V.c(4),{tools:s,connectionId:l,org:i}=t;let a;return e[0]!==l||e[1]!==i||e[2]!==s?(a=o.jsx(ft,{tools:s,connectionId:l,org:i}),e[0]=l,e[1]=i,e[2]=s,e[3]=a):a=e[3],a}function Xt(t){const e=V.c(49),{connection:s,connectionId:l,org:i,requestedTabId:a,collections:u,onUpdate:n,isUpdating:f}=t,g=ot();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/$org/mcps/$connectionId"},e[0]=r):r=e[0];const d=Oe(r);let x;e[1]!==s.connection_token||e[2]!==s.connection_url?(x={url:s.connection_url,token:s.connection_token},e[1]=s.connection_token,e[2]=s.connection_url,e[3]=x):x=e[3];const h=dt(x),j=s?.metadata?.repository,p=!!j?.url,c=s?.tools?.length??0;let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N={id:"settings",label:"Settings"},e[4]=N):N=e[4];let C;e[5]!==h||e[6]!==c?(C=h&&c>0?[{id:"tools",label:"Tools",count:c}]:[],e[5]=h,e[6]=c,e[7]=C):C=e[7];let v;if(e[8]!==u||e[9]!==p||e[10]!==h||e[11]!==C){let b;e[13]!==p?(b=p?[{id:"readme",label:"README"}]:[],e[13]=p,e[14]=b):b=e[14],v=[N,...C,...h?(u||[]).map(Yt):[],...b],e[8]=u,e[9]=p,e[10]=h,e[11]=C,e[12]=v}else v=e[12];const P=v,m=P.some(b=>b.id===a)?a:"settings";let I;e[15]!==d?(I=b=>{d({search:E=>({...E,tab:b}),replace:!0})},e[15]=d,e[16]=I):I=e[16];const k=I;let T;e[17]!==u?(T=u||[],e[17]=u,e[18]=T):T=e[18];let y;if(e[19]!==m||e[20]!==T){let b;e[22]!==m?(b=E=>E.name===m,e[22]=m,e[23]=b):b=e[23],y=T.find(b),e[19]=m,e[20]=T,e[21]=y}else y=e[21];const O=y;let _;e[24]!==g.history?(_=()=>g.history.back(),e[24]=g.history,e[25]=_):_=e[25];let z;e[26]!==m||e[27]!==k||e[28]!==P?(z=o.jsx(gt,{children:o.jsx(pt,{tabs:P,activeTab:m,onTabChange:k})}),e[26]=m,e[27]=k,e[28]=P,e[29]=z):z=e[29];let w;e[30]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(M,{size:32,name:"progress_activity",className:"animate-spin text-muted-foreground"})}),e[30]=w):w=e[30];let D;e[31]!==O||e[32]!==m||e[33]!==s||e[34]!==l||e[35]!==p||e[36]!==h||e[37]!==f||e[38]!==n||e[39]!==i||e[40]!==j?(D=o.jsx(ze.Suspense,{fallback:w,children:m==="tools"?o.jsx(Qt,{tools:s.tools??void 0,connectionId:l,org:i}):m==="settings"?o.jsx(mt,{connection:s,onUpdate:n,isUpdating:f,isMCPAuthenticated:h}):m==="readme"&&p?o.jsx(Gt,{repository:j}):O&&h?o.jsx(Jt,{connectionId:l,org:i,activeCollection:O},m):o.jsx(Ee,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[31]=O,e[32]=m,e[33]=s,e[34]=l,e[35]=p,e[36]=h,e[37]=f,e[38]=n,e[39]=i,e[40]=j,e[41]=D):D=e[41];let S;e[42]!==m||e[43]!==D?(S=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(Fe,{children:D},m)})}),e[42]=m,e[43]=D,e[44]=S):S=e[44];let $;return e[45]!==z||e[46]!==S||e[47]!==_?($=o.jsxs(xt,{onBack:_,children:[z,S]}),e[45]=z,e[46]=S,e[47]=_,e[48]=$):$=e[48],$}function Yt(t){return{id:t.name,label:t.displayName}}function Zt(){const t=V.c(17);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const s=Oe(e);let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/mcps/$connectionId"},t[1]=l):l=t[1];const{connectionId:i,org:a}=et(l);let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/shell/$org/mcps/$connectionId"},t[2]=u):u=t[2];const f=tt(u).tab||"settings",g=Ke(i),r=lt(),d=at(g??void 0);let x;t[3]!==r.update||t[4]!==i?(x=async p=>{await r.update.mutateAsync({id:i,data:p})},t[3]=r.update,t[4]=i,t[5]=x):x=t[5];const h=x;if(!g){let p;return t[6]!==s||t[7]!==a?(p=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Ee,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(ge,{variant:"outline",onClick:()=>s({to:"/$org/mcps",params:{org:a}}),children:"Back to connections"})})}),t[6]=s,t[7]=a,t[8]=p):p=t[8],p}let j;return t[9]!==r.update.isPending||t[10]!==d||t[11]!==g||t[12]!==i||t[13]!==h||t[14]!==a||t[15]!==f?(j=o.jsx(Xt,{org:a,connection:g,connectionId:i,requestedTabId:f,collections:d,onUpdate:h,isUpdating:r.update.isPending}),t[9]=r.update.isPending,t[10]=d,t[11]=g,t[12]=i,t[13]=h,t[14]=a,t[15]=f,t[16]=j):j=t[16],j}function eo(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Fe,{children:o.jsx(ze.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(M,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Zt,{})})}),t[0]=e):e=t[0],e}function Ro(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(eo,{}),t[0]=e):e=t[0],e}export{Ro as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Ae,j as t,r as Ne,a5 as ze,b as Ee,a as Fe,ar as Ke,as as Be}from"./index-B5e6fytH.js";import{C as He}from"./schema-BLzWyGtx.js";import{C as Oe}from"./collection-header-CJC3zXGa.js";import{C as Re}from"./collection-page-CkAonVNX.js";import{C as Ve}from"./collection-search-Bd4XQ4_K.js";import{C as Le}from"./collection-table-wrapper-Dv4rgxdy.js";import{C as Ue}from"./connection-card-CgJm9r5i.js";import{E as De}from"./empty-state-DV83eIhT.js";import{E as We}from"./error-boundary-qOVcoWbq.js";import{I as qe}from"./integration-icon-C_Dk6BbN.js";import{d as Ge,b as Je}from"./use-connection-IMyxygAc.js";import{u as Qe}from"./use-list-state-Bas0EIwN.js";import{u as Xe}from"./tooltip-DjXyjtiH.js";import{c as Ye,b as Ze,d as et,A as tt,e as nt,g as ot,a as st,f as it}from"./alert-dialog-Caf0mgW9.js";import{B as rt}from"./badge-j-myHF25.js";import{B as E}from"./button-DnKGwZ1P.js";import{a as ct,b as lt,D as at,f as dt,c as mt,d as ut}from"./dialog-Qusr5Dgc.js";import{b as Me,D as Pe,a as Te,c as pe}from"./dropdown-menu-BIeRR6rM.js";import{F,a as pt,b as K,c as B,d as H,f as O}from"./form-0C1lYHJ2.js";import{I as m}from"./icon-C1glN-Ga.js";import{I as Ie}from"./input-DpAKmHHm.js";import{c as ht,a as ft,S as gt,b as xt,d as ke}from"./select-fvQCifl4.js";import{T as jt}from"./textarea--4iImQiq.js";import{g as _t}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-Cws3c2TG.js";import"./utils-BLBjpUfr.js";import"./card-I0CWqn2J.js";import"./use-mobile-CxX0wu31.js";const Ct=He.pick({title:!0,description:!0,connection_type:!0,connection_url:!0,connection_token:!0}).partial({description:!0,connection_token:!0});function St(e,n){switch(n.type){case"edit":return{mode:"editing",connection:n.connection};case"delete":return{mode:"deleting",connection:n.connection};case"close":return{mode:"idle"}}}function yt(){const e=Ae.c(120),{org:n}=Xe(),r=ze();let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={strict:!1},e[0]=R):R=e[0];const $e=Ee(R),{data:he}=Fe.useSession();let V;e[1]!==n.slug?(V={namespace:n.slug,resource:"connections"},e[1]=n.slug,e[2]=V):V=e[2];const o=Qe(V),d=Ge(),z=Je(o);let L;e[3]===Symbol.for("react.memo_cache_sentinel")?(L={mode:"idle"},e[3]=L):L=e[3];const[l,u]=Ne.useReducer(St,L),U=$e.action==="create";let W;e[4]!==r||e[5]!==n.slug?(W=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},e[4]=r,e[5]=n.slug,e[6]=W):W=e[6];const fe=W;let q;e[7]!==r||e[8]!==n.slug?(q=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{}})},e[7]=r,e[8]=n.slug,e[9]=q):q=e[9];const p=q;let G;e[10]===Symbol.for("react.memo_cache_sentinel")?(G={resolver:Ke(Ct),defaultValues:{title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null}},e[10]=G):G=e[10];const i=Be(G),c=l.mode==="editing"?l.connection:null;let J,Q;e[11]!==c||e[12]!==i?(J=()=>{c?i.reset({title:c.title,description:c.description,connection_type:c.connection_type,connection_url:c.connection_url,connection_token:null}):i.reset({title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null})},Q=[c,i],e[11]=c,e[12]=i,e[13]=J,e[14]=Q):(J=e[13],Q=e[14]),Ne.useEffect(J,Q);let X;e[15]!==d||e[16]!==l.connection||e[17]!==l.mode?(X=async()=>{if(l.mode!=="deleting")return;const s=l.connection.id;u({type:"close"});try{await d.delete.mutateAsync(s)}catch{}},e[15]=d,e[16]=l.connection,e[17]=l.mode,e[18]=X):X=e[18];const ge=X;let Y;e[19]!==d||e[20]!==p||e[21]!==c||e[22]!==i||e[23]!==r||e[24]!==n.id||e[25]!==n.slug||e[26]!==he?.user?.id?(Y=async s=>{if(c){await d.update.mutateAsync({id:c.id,data:{title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,...s.connection_token&&{connection_token:s.connection_token}}}),u({type:"close"}),i.reset();return}const a=_t("conn");await d.create.mutateAsync({id:a,title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,connection_token:s.connection_token||null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:he?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:null,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),p(),i.reset(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:a}})},e[19]=d,e[20]=p,e[21]=c,e[22]=i,e[23]=r,e[24]=n.id,e[25]=n.slug,e[26]=he?.user?.id,e[27]=Y):Y=e[27];const xe=Y;let Z;e[28]!==p||e[29]!==i||e[30]!==U?(Z=s=>{s||(U?p():u({type:"close"}),i.reset())},e[28]=p,e[29]=i,e[30]=U,e[31]=Z):Z=e[31];const h=Z;let ee,te,ne,oe,se,ie;e[32]===Symbol.for("react.memo_cache_sentinel")?(ee={id:"icon",header:"",render:Ft,cellClassName:"w-16 shrink-0"},te={id:"title",header:"Name",render:Et,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},ne={id:"description",header:"Description",render:zt,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},oe={id:"connection_type",header:"Type",accessor:$t,cellClassName:"w-24 shrink-0",sortable:!0},se={id:"connection_url",header:"URL",render:At,wrap:!0,cellClassName:"w-48 min-w-0 shrink-0"},ie={id:"status",header:"Status",render:Tt,cellClassName:"w-24 shrink-0",sortable:!0},e[32]=ee,e[33]=te,e[34]=ne,e[35]=oe,e[36]=se,e[37]=ie):(ee=e[32],te=e[33],ne=e[34],oe=e[35],se=e[36],ie=e[37]);let re;e[38]!==r||e[39]!==n.slug?(re=[ee,te,ne,oe,se,ie,{id:"actions",header:"",render:s=>t.jsxs(Me,{children:[t.jsx(Pe,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Pt,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs(Te,{align:"end",onClick:Mt,children:[t.jsxs(pe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(pe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[38]=r,e[39]=n.slug,e[40]=re):re=e[40];const je=re;let ce;e[41]!==fe?(ce=t.jsx(E,{onClick:fe,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"}),e[41]=fe,e[42]=ce):ce=e[42];const _e=ce,Ce=U||l.mode==="editing",Se=c?"Edit Connection":"Create New Connection";let f;e[43]!==Se?(f=t.jsx(ct,{children:Se}),e[43]=Se,e[44]=f):f=e[44];const ye=c?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below.";let g;e[45]!==ye?(g=t.jsx(lt,{children:ye}),e[45]=ye,e[46]=g):g=e[46];let x;e[47]!==f||e[48]!==g?(x=t.jsxs(at,{children:[f,g]}),e[47]=f,e[48]=g,e[49]=x):x=e[49];let j;e[50]!==i||e[51]!==xe?(j=i.handleSubmit(xe),e[50]=i,e[51]=xe,e[52]=j):j=e[52];let _;e[53]!==i.control?(_=t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(F,{control:i.control,name:"title",render:It}),t.jsx(F,{control:i.control,name:"description",render:Nt}),t.jsx(F,{control:i.control,name:"connection_type",render:kt}),t.jsx(F,{control:i.control,name:"connection_url",render:Dt}),t.jsx(F,{control:i.control,name:"connection_token",render:wt})]}),e[53]=i.control,e[54]=_):_=e[54];let C;e[55]!==h?(C=t.jsx(E,{type:"button",variant:"outline",onClick:()=>h(!1),children:"Cancel"}),e[55]=h,e[56]=C):C=e[56];const ve=i.formState.isSubmitting?"Saving...":c?"Update Connection":"Create Connection";let S;e[57]!==i.formState.isSubmitting||e[58]!==ve?(S=t.jsx(E,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:ve}),e[57]=i.formState.isSubmitting,e[58]=ve,e[59]=S):S=e[59];let y;e[60]!==C||e[61]!==S?(y=t.jsxs(dt,{children:[C,S]}),e[60]=C,e[61]=S,e[62]=y):y=e[62];let v;e[63]!==j||e[64]!==_||e[65]!==y?(v=t.jsxs("form",{onSubmit:j,children:[_,y]}),e[63]=j,e[64]=_,e[65]=y,e[66]=v):v=e[66];let b;e[67]!==i||e[68]!==v?(b=t.jsx(pt,{...i,children:v}),e[67]=i,e[68]=v,e[69]=b):b=e[69];let w;e[70]!==x||e[71]!==b?(w=t.jsxs(mt,{className:"sm:max-w-[525px]",children:[x,b]}),e[70]=x,e[71]=b,e[72]=w):w=e[72];let D;e[73]!==h||e[74]!==Ce||e[75]!==w?(D=t.jsx(ut,{open:Ce,onOpenChange:h,children:w}),e[73]=h,e[74]=Ce,e[75]=w,e[76]=D):D=e[76];const be=l.mode==="deleting";let le;e[77]===Symbol.for("react.memo_cache_sentinel")?(le=s=>!s&&u({type:"close"}),e[77]=le):le=e[77];let ae;e[78]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx(Ye,{children:"Delete Connection?"}),e[78]=ae):ae=e[78];const we=l.mode==="deleting"&&l.connection.title;let k;e[79]!==we?(k=t.jsxs(Ze,{children:[ae,t.jsxs(et,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:we}),"."]})]}),e[79]=we,e[80]=k):k=e[80];let de;e[81]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(tt,{children:"Cancel"}),e[81]=de):de=e[81];let N;e[82]!==ge?(N=t.jsxs(nt,{children:[de,t.jsx(ot,{onClick:ge,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[82]=ge,e[83]=N):N=e[83];let I;e[84]!==k||e[85]!==N?(I=t.jsxs(st,{children:[k,N]}),e[84]=k,e[85]=N,e[86]=I):I=e[86];let M;e[87]!==be||e[88]!==I?(M=t.jsx(it,{open:be,onOpenChange:le,children:I}),e[87]=be,e[88]=I,e[89]=M):M=e[89];let me;e[90]===Symbol.for("react.memo_cache_sentinel")?(me=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],e[90]=me):me=e[90];let P;e[91]!==_e||e[92]!==o.handleSort||e[93]!==o.setViewMode||e[94]!==o.sortDirection||e[95]!==o.sortKey||e[96]!==o.viewMode?(P=t.jsx(Oe,{title:"MCP Servers",viewMode:o.viewMode,onViewModeChange:o.setViewMode,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,sortOptions:me,ctaButton:_e}),e[91]=_e,e[92]=o.handleSort,e[93]=o.setViewMode,e[94]=o.sortDirection,e[95]=o.sortKey,e[96]=o.viewMode,e[97]=P):P=e[97];let T;e[98]!==o?(T=s=>{s.key==="Escape"&&(o.setSearch(""),s.target.blur())},e[98]=o,e[99]=T):T=e[99];let A;e[100]!==o.search||e[101]!==o.setSearch||e[102]!==T?(A=t.jsx(Ve,{value:o.search,onChange:o.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:T}),e[100]=o.search,e[101]=o.setSearch,e[102]=T,e[103]=A):A=e[103];let $;e[104]!==je||e[105]!==z||e[106]!==o.handleSort||e[107]!==o.search||e[108]!==o.sortDirection||e[109]!==o.sortKey||e[110]!==o.viewMode||e[111]!==r||e[112]!==n.slug?($=o.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:z.length===0?t.jsx(De,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:(o.search,"No MCP Servers found"),description:o.search?`No MCP Servers match "${o.search}"`:"Create a connection to get started."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:z.map(s=>t.jsx(Ue,{connection:s,fallbackIcon:"extension",onClick:()=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),headerActions:t.jsxs(Me,{children:[t.jsx(Pe,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:bt,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs(Te,{align:"end",onClick:vt,children:[t.jsxs(pe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(pe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]})},s.id))})}):t.jsx(Le,{columns:je,data:z,isLoading:!1,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,onRowClick:s=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),emptyState:o.search?t.jsx(De,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${o.search}"`}):t.jsx(De,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started."})}),e[104]=je,e[105]=z,e[106]=o.handleSort,e[107]=o.search,e[108]=o.sortDirection,e[109]=o.sortKey,e[110]=o.viewMode,e[111]=r,e[112]=n.slug,e[113]=$):$=e[113];let ue;return e[114]!==D||e[115]!==M||e[116]!==P||e[117]!==A||e[118]!==$?(ue=t.jsxs(Re,{children:[D,M,P,A,$]}),e[114]=D,e[115]=M,e[116]=P,e[117]=A,e[118]=$,e[119]=ue):ue=e[119],ue}function vt(e){return e.stopPropagation()}function bt(e){return e.stopPropagation()}function wt(e){const{field:n}=e;return t.jsxs(K,{children:[t.jsx(B,{children:"Token (optional)"}),t.jsx(H,{children:t.jsx(Ie,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),t.jsx(O,{})]})}function Dt(e){const{field:n}=e;return t.jsxs(K,{children:[t.jsx(B,{children:"URL *"}),t.jsx(H,{children:t.jsx(Ie,{placeholder:"https://example.com/mcp",...n})}),t.jsx(O,{})]})}function kt(e){const{field:n}=e;return t.jsxs(K,{children:[t.jsx(B,{children:"Type *"}),t.jsxs(ht,{value:n.value,onValueChange:n.onChange,children:[t.jsx(H,{children:t.jsx(ft,{children:t.jsx(gt,{})})}),t.jsxs(xt,{children:[t.jsx(ke,{value:"HTTP",children:"HTTP"}),t.jsx(ke,{value:"SSE",children:"SSE"}),t.jsx(ke,{value:"Websocket",children:"Websocket"})]})]}),t.jsx(O,{})]})}function Nt(e){const{field:n}=e;return t.jsxs(K,{children:[t.jsx(B,{children:"Description"}),t.jsx(H,{children:t.jsx(jt,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(O,{})]})}function It(e){const{field:n}=e;return t.jsxs(K,{children:[t.jsx(B,{children:"Name *"}),t.jsx(H,{children:t.jsx(Ie,{placeholder:"My Connection",...n})}),t.jsx(O,{})]})}function Mt(e){return e.stopPropagation()}function Pt(e){return e.stopPropagation()}function Tt(e){return t.jsx(rt,{variant:e.status==="active"?"default":"outline",children:e.status})}function At(e){return t.jsx("span",{className:"text-sm text-muted-foreground block truncate",children:e.connection_url})}function $t(e){return t.jsx("span",{className:"text-sm font-medium",children:e.connection_type})}function zt(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Et(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ft(e){return t.jsx(qe,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:"extension"})}function pn(){const e=Ae.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(We,{children:t.jsx(Ne.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(m,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(yt,{})})}),e[0]=n):n=e[0],n}export{pn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as n,j as i,a8 as m,ax as g,ab as u,a9 as x,aa as j,ac as N,ae as h,ad as b}from"./index-B5e6fytH.js";import{c}from"./utils-BLBjpUfr.js";import{c as D}from"./tooltip-DjXyjtiH.js";const v=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],y=D("x",v);function T(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function _(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(h,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function k(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(y,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(b,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function B(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(_,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-lg duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx(k,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs($,{"data-slot":"dialog-portal",children:[r,i.jsxs(u,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function S(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{E as D,y as X,P as a,S as b,B as c,T as d,R as e,O as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as N,aB as Be,j as t,aC as je,az as be,aO as Fe,aE as Ge,bf as De,bg as Ue,c as O,a5 as Ve,d as Me,ap as Oe,bi as fe,aq as he,b5 as We,ar as Le,as as qe,a6 as xe}from"./index-B5e6fytH.js";import{E as He}from"./empty-state-DV83eIhT.js";import{E as ye}from"./error-boundary-qOVcoWbq.js";import{I as Je}from"./integration-icon-C_Dk6BbN.js";import{T as Xe}from"./tool-set-selector-Fu1vBXWK.js";import{b as Ke,a as Qe}from"./use-gateway-CuMrhcvh.js";import{b as Ye}from"./use-connection-IMyxygAc.js";import{B as J}from"./button-DnKGwZ1P.js";import{I as M}from"./icon-C1glN-Ga.js";import{I as ve}from"./input-DpAKmHHm.js";import{c as pe}from"./utils-BLBjpUfr.js";import{F as Z,a as Ze,b as te,d as se,f as oe,c as _e}from"./form-0C1lYHJ2.js";import{c as we,a as Ce,S as Se,b as Ne,d as ee}from"./select-fvQCifl4.js";import{d as X,b as K,a as Q,T as Y}from"./tooltip-DjXyjtiH.js";import{V as et,b as tt}from"./layout-BMHVtK0w.js";import{f as st}from"./formatDistanceToNow-Ctx6mZEP.js";import"./checkbox-v3iP8MNg.js";import"./collection-search-Bd4XQ4_K.js";var me="Switch",[ot]=Be(me),[nt,lt]=ot(me),ke=N.forwardRef((o,e)=>{const{__scopeSwitch:s,name:n,checked:a,defaultChecked:r,required:i,disabled:c,value:l="on",onCheckedChange:m,form:d,...p}=o,[u,j]=N.useState(null),f=be(e,b=>j(b)),h=N.useRef(!1),g=u?d||!!u.closest("form"):!0,[A,D]=Fe({prop:a,defaultProp:r??!1,onChange:m,caller:me});return t.jsxs(nt,{scope:s,checked:A,disabled:c,children:[t.jsx(je.button,{type:"button",role:"switch","aria-checked":A,"aria-required":i,"data-state":$e(A),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:f,onClick:Ge(o.onClick,b=>{D(y=>!y),g&&(h.current=b.isPropagationStopped(),h.current||b.stopPropagation())})}),g&&t.jsx(Ee,{control:u,bubbles:!h.current,name:n,value:l,checked:A,required:i,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});ke.displayName=me;var Te="SwitchThumb",Ie=N.forwardRef((o,e)=>{const{__scopeSwitch:s,...n}=o,a=lt(Te,s);return t.jsx(je.span,{"data-state":$e(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:e})});Ie.displayName=Te;var at="SwitchBubbleInput",Ee=N.forwardRef(({__scopeSwitch:o,control:e,checked:s,bubbles:n=!0,...a},r)=>{const i=N.useRef(null),c=be(i,r),l=De(s),m=Ue(e);return N.useEffect(()=>{const d=i.current;if(!d)return;const p=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(p,"checked").set;if(l!==s&&j){const f=new Event("click",{bubbles:n});j.call(d,s),d.dispatchEvent(f)}},[l,s,n]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...a,tabIndex:-1,ref:c,style:{...a.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ee.displayName=at;function $e(o){return o?"checked":"unchecked"}var it=ke,rt=Ie;function ct(o){const e=O.c(9);let s,n;e[0]!==o?({className:s,...n}=o,e[0]=o,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let a;e[3]!==s?(a=pe("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=a):a=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(rt,{"data-slot":"switch-thumb",className:pe("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=r):r=e[5];let i;return e[6]!==n||e[7]!==a?(i=t.jsx(it,{"data-slot":"switch",className:a,...n,children:r}),e[6]=n,e[7]=a,e[8]=i):i=e[8],i}function ge(o){const s=new TextEncoder().encode(o),n=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(n)}function dt(o){const e=O.c(63),{serverName:s,gatewayUrl:n}=o,[a,r]=N.useState(!1),[i,c]=N.useState(null);let l,m,d,p,u;if(e[0]!==n||e[1]!==s){const re={type:"http",url:n},ce={[s]:re};l=JSON.stringify(ce,null,2);const ue=ze=>JSON.stringify({...re,headers:{"x-mesh-client":ze}},null,2),Pe=ge(ue("Cursor"));m=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(s)}&config=${encodeURIComponent(Pe)}`;const Re=ge(ue("Windsurf"));u=`windsurf://codeium.windsurf/mcp/install?name=${encodeURIComponent(s)}&config=${encodeURIComponent(Re)}`;const Ae=ue("Claude Code");d=s;let de;e[7]===Symbol.for("react.memo_cache_sentinel")?(de=/'/g,e[7]=de):de=e[7],p=Ae.replace(de,"'\\''"),e[0]=n,e[1]=s,e[2]=l,e[3]=m,e[4]=d,e[5]=p,e[6]=u}else l=e[2],m=e[3],d=e[4],p=e[5],u=e[6];const j=`claude mcp add "${d}" --config '${p}'`;let f;e[8]!==l?(f=async()=>{await navigator.clipboard.writeText(l),r(!0),xe.success("Configuration copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[8]=l,e[9]=f):f=e[9];const h=f;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=async(re,ce)=>{await navigator.clipboard.writeText(re),c(ce),xe.success(`${ce} command copied`),setTimeout(()=>c(null),2e3)},e[10]=g):g=e[10];const A=g,D=mt;let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[11]=b):b=e[11];const y=a?"check":"content_copy";let V;e[12]!==y?(V=t.jsx(M,{name:y,size:14}),e[12]=y,e[13]=V):V=e[13];let z;e[14]!==h||e[15]!==V?(z=t.jsx(Q,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:h,children:V})}),e[14]=h,e[15]=V,e[16]=z):z=e[16];let G;e[17]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Y,{children:"Copy configuration"}),e[17]=G):G=e[17];let B;e[18]!==z?(B=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(X,{children:t.jsxs(K,{children:[z,G]})})}),e[18]=z,e[19]=B):B=e[19];let v;e[20]!==l||e[21]!==h?(v=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:h,children:l}),e[20]=l,e[21]=h,e[22]=v):v=e[22];let _;e[23]!==B||e[24]!==v?(_=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[B,v]}),e[23]=B,e[24]=v,e[25]=_):_=e[25];let w;e[26]!==m?(w=()=>D(m),e[26]=m,e[27]=w):w=e[27];let k,T;e[28]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),T=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[28]=k,e[29]=T):(k=e[28],T=e[29]);let F;e[30]!==w?(F=t.jsx(Q,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:w,children:[k,T]})}),e[30]=w,e[31]=F):F=e[31];let I;e[32]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Y,{children:"Add to Cursor"}),e[32]=I):I=e[32];let E;e[33]!==F?(E=t.jsx(X,{children:t.jsxs(K,{children:[F,I]})}),e[33]=F,e[34]=E):E=e[34];let C;e[35]!==j?(C=()=>A(j,"Claude"),e[35]=j,e[36]=C):C=e[36];let $,P;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),P=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[37]=$,e[38]=P):($=e[37],P=e[38]);let S;e[39]!==i?(S=i==="Claude"&&t.jsx(M,{name:"check",size:14,className:"ml-2 text-green-500"}),e[39]=i,e[40]=S):S=e[40];let R;e[41]!==C||e[42]!==S?(R=t.jsx(Q,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:C,children:[$,P,S]})}),e[41]=C,e[42]=S,e[43]=R):R=e[43];let x;e[44]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Y,{children:"Add to Claude Code"}),e[44]=x):x=e[44];let U;e[45]!==R?(U=t.jsx(X,{children:t.jsxs(K,{children:[R,x]})}),e[45]=R,e[46]=U):U=e[46];let W;e[47]!==u?(W=()=>D(u),e[47]=u,e[48]=W):W=e[48];let ne,le;e[49]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx("img",{src:"/logos/Windsurf.svg",alt:"Windsurf",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(6%) sepia(68%) saturate(3620%) hue-rotate(204deg) brightness(92%) contrast(103%)"}}),le=t.jsx("span",{className:"text-sm font-medium",children:"Windsurf"}),e[49]=ne,e[50]=le):(ne=e[49],le=e[50]);let L;e[51]!==W?(L=t.jsx(Q,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:W,children:[ne,le]})}),e[51]=W,e[52]=L):L=e[52];let ae;e[53]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx(Y,{children:"Add to Windsurf"}),e[53]=ae):ae=e[53];let q;e[54]!==L?(q=t.jsx(X,{children:t.jsxs(K,{children:[L,ae]})}),e[54]=L,e[55]=q):q=e[55];let H;e[56]!==E||e[57]!==U||e[58]!==q?(H=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[E,U,q]}),e[56]=E,e[57]=U,e[58]=q,e[59]=H):H=e[59];let ie;return e[60]!==_||e[61]!==H?(ie=t.jsxs("div",{className:"flex flex-col gap-4",children:[b,_,H]}),e[60]=_,e[61]=H,e[62]=ie):ie=e[62],ie}function mt(o){window.open(o,"_blank")}const ut=Oe({title:he().min(1,"Name is required").max(255),description:he().nullable(),status:fe(["active","inactive"]),tool_selection_mode:fe(["inclusion","exclusion"]),tool_selection_strategy:fe(["passthrough","smart_tool_selection","code_execution"])});function ft(o,e){const s={};for(const n of o.connections)if(n.selected_tools===null){const a=e.get(n.connection_id)??[];a.length>0&&(s[n.connection_id]=a)}else n.selected_tools.length>0&&(s[n.connection_id]=n.selected_tools);return s}function ht(o,e){return Object.entries(o).map(([s,n])=>{const a=e.get(s)??[],r=a.length>0&&a.every(i=>n.includes(i));return{connection_id:s,selected_tools:r?null:n}})}function xt(o){const e=O.c(28),{form:s,toolSet:n,onToolSetChange:a,icon:r}=o;let i;e[0]!==s?(i=s.watch("title")||"Gateway",e[0]=s,e[1]=i):i=e[1];let c;e[2]!==r||e[3]!==i?(c=t.jsx(Je,{icon:r,name:i,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:"network_node"}),e[2]=r,e[3]=i,e[4]=c):c=e[4];let l;e[5]!==s.control?(l=t.jsx(Z,{control:s.control,name:"status",render:yt}),e[5]=s.control,e[6]=l):l=e[6];let m;e[7]!==c||e[8]!==l?(m=t.jsxs("div",{className:"flex items-start justify-between",children:[c,l]}),e[7]=c,e[8]=l,e[9]=m):m=e[9];let d;e[10]!==s.control?(d=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(Z,{control:s.control,name:"title",render:bt}),t.jsx(Z,{control:s.control,name:"description",render:jt})]}),e[10]=s.control,e[11]=d):d=e[11];let p;e[12]!==m||e[13]!==d?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,d]}),e[12]=m,e[13]=d,e[14]=p):p=e[14];let u;e[15]!==s.control?(u=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(Z,{control:s.control,name:"tool_selection_mode",render:gt}),t.jsx(Z,{control:s.control,name:"tool_selection_strategy",render:pt})]}),e[15]=s.control,e[16]=u):u=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center p-5",children:t.jsx(M,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),e[17]=j):j=e[17];let f;e[18]!==a||e[19]!==n?(f=t.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:t.jsx(ye,{children:t.jsx(N.Suspense,{fallback:j,children:t.jsx(Xe,{toolSet:n,onToolSetChange:a})})})}),e[18]=a,e[19]=n,e[20]=f):f=e[20];let h;e[21]!==p||e[22]!==u||e[23]!==f?(h=t.jsxs("div",{className:"flex flex-col h-full",children:[p,u,f]}),e[21]=p,e[22]=u,e[23]=f,e[24]=h):h=e[24];let g;return e[25]!==s||e[26]!==h?(g=t.jsx(Ze,{...s,children:h}),e[25]=s,e[26]=h,e[27]=g):g=e[27],g}function pt(o){const{field:e}=o;return t.jsxs(te,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(_e,{className:"mb-0",children:"Gateway Strategy"}),t.jsx(X,{children:t.jsxs(K,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(M,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(Y,{side:"right",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})})]}),t.jsxs(we,{value:e.value,onValueChange:e.onChange,children:[t.jsx(se,{children:t.jsx(Ce,{className:"w-[180px]",children:t.jsx(Se,{})})}),t.jsxs(Ne,{children:[t.jsx(ee,{value:"passthrough",children:"Passthrough"}),t.jsx(ee,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(ee,{value:"code_execution",children:"Code Execution"})]})]})]}),t.jsx(oe,{})]})}function gt(o){const{field:e}=o;return t.jsxs(te,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(_e,{className:"mb-0",children:"Tool Selection Mode"}),t.jsx(X,{children:t.jsxs(K,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(M,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(Y,{side:"right",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected connections/tools are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All connections/tools except selected ones are exposed."]})]})})]})})]}),t.jsxs(we,{value:e.value,onValueChange:e.onChange,children:[t.jsx(se,{children:t.jsx(Ce,{className:"w-[180px]",children:t.jsx(Se,{})})}),t.jsxs(Ne,{children:[t.jsx(ee,{value:"inclusion",children:"Include Selected"}),t.jsx(ee,{value:"exclusion",children:"Exclude Selected"})]})]})]}),t.jsx(oe,{})]})}function jt(o){const{field:e}=o;return t.jsxs(te,{className:"w-full space-y-0",children:[t.jsx(se,{children:t.jsx(ve,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(oe,{})]})}function bt(o){const{field:e}=o;return t.jsxs(te,{className:"w-full space-y-0",children:[t.jsx(se,{children:t.jsx(ve,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Gateway Name"})}),t.jsx(oe,{})]})}function yt(o){const{field:e}=o;return t.jsxs(te,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(se,{children:t.jsx(ct,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(oe,{})]})}function vt(o){const e=O.c(53),{gateway:s,gatewayId:n}=o,a=We(),r=Qe();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const c=Ye(i);let l;if(e[1]!==c){l=new Map;for(const x of c)x.tools&&x.tools.length>0&&l.set(x.id,x.tools.map(_t));e[1]=c,e[2]=l}else l=e[2];let m;e[3]!==l||e[4]!==s?(m=()=>ft(s,l),e[3]=l,e[4]=s,e[5]=m):m=e[5];const[d,p]=N.useState(m),[u,j]=N.useState(!1);let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{p(x),j(!0)},e[6]=f):f=e[6];const h=f;let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=Le(ut),e[7]=g):g=e[7];const A=s.tool_selection_mode??"inclusion",D=s.tool_selection_strategy??"passthrough";let b;e[8]!==s.description||e[9]!==s.status||e[10]!==s.title||e[11]!==A||e[12]!==D?(b={resolver:g,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:A,tool_selection_strategy:D}},e[8]=s.description,e[9]=s.status,e[10]=s.title,e[11]=A,e[12]=D,e[13]=b):b=e[13];const y=qe(b),z=y.formState.isDirty||u;let G;e[14]!==r.update||e[15]!==l||e[16]!==y||e[17]!==n||e[18]!==d?(G=async()=>{const x=y.getValues(),U=ht(d,l);await r.update.mutateAsync({id:n,data:{title:x.title,description:x.description,status:x.status,tool_selection_mode:x.tool_selection_mode,tool_selection_strategy:x.tool_selection_strategy,connections:U}}),y.reset(x),j(!1)},e[14]=r.update,e[15]=l,e[16]=y,e[17]=n,e[18]=d,e[19]=G):G=e[19];const B=G;let v;e[20]!==a.history?(v=()=>a.history.back(),e[20]=a.history,e[21]=v):v=e[21];let _;e[22]!==r.update.isPending||e[23]!==B||e[24]!==z?(_=z&&t.jsxs(J,{onClick:B,disabled:r.update.isPending,size:"sm",className:"h-7",children:[r.update.isPending&&t.jsx(M,{name:"progress_activity",size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[22]=r.update.isPending,e[23]=B,e[24]=z,e[25]=_):_=e[25];let w;e[26]!==_?(w=t.jsx(et,{children:_}),e[26]=_,e[27]=w):w=e[27];let k;e[28]!==y||e[29]!==s.icon||e[30]!==d?(k=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(xt,{form:y,toolSet:d,onToolSetChange:h,icon:s.icon})}),e[28]=y,e[29]=s.icon,e[30]=d,e[31]=k):k=e[31];let T;e[32]!==s.id||e[33]!==s.title?(T=s.title||`gateway-${s.id.slice(0,8)}`,e[32]=s.id,e[33]=s.title,e[34]=T):T=e[34];const F=`${window.location.origin}/mcp/gateway/${s.id}`;let I;e[35]!==T||e[36]!==F?(I=t.jsx("div",{className:"p-5",children:t.jsx(dt,{serverName:T,gatewayUrl:F})}),e[35]=T,e[36]=F,e[37]=I):I=e[37];let E;e[38]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[38]=E):E=e[38];let C;e[39]!==s.updated_at?(C=s.updated_at?st(new Date(s.updated_at),{addSuffix:!1}):"Unknown",e[39]=s.updated_at,e[40]=C):C=e[40];let $;e[41]!==C?($=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[E,t.jsx("span",{className:"font-mono text-sm uppercase text-muted-foreground",children:C})]}),e[41]=C,e[42]=$):$=e[42];let P;e[43]!==I||e[44]!==$?(P=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[I,$]}),e[43]=I,e[44]=$,e[45]=P):P=e[45];let S;e[46]!==k||e[47]!==P?(S=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[k,P]}),e[46]=k,e[47]=P,e[48]=S):S=e[48];let R;return e[49]!==w||e[50]!==S||e[51]!==v?(R=t.jsxs(tt,{onBack:v,children:[w,S]}),e[49]=w,e[50]=S,e[51]=v,e[52]=R):R=e[52],R}function _t(o){return o.name}function wt(){const o=O.c(8);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=Ve(e);let n;o[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/gateways/$gatewayId"},o[1]=n):n=o[1];const{gatewayId:a,org:r}=Me(n),i=Ke(a);if(!i){let l;return o[2]!==s||o[3]!==r?(l=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(He,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(J,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:r}}),children:"Back to gateways"})})}),o[2]=s,o[3]=r,o[4]=l):l=o[4],l}let c;return o[5]!==i||o[6]!==a?(c=t.jsx(vt,{gateway:i,gatewayId:a}),o[5]=i,o[6]=a,o[7]=c):c=o[7],c}function Ct(){const o=O.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ye,{children:t.jsx(N.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(M,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(wt,{})})}),o[0]=e):e=o[0],e}function Ot(){const o=O.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ct,{}),o[0]=e):e=o[0],e}export{Ot as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Y,j as t,r as Z,a5 as te,a6 as se}from"./index-B5e6fytH.js";import{C as oe}from"./collection-header-CJC3zXGa.js";import{C as ae}from"./collection-page-CkAonVNX.js";import{C as ne}from"./collection-search-Bd4XQ4_K.js";import{C as re}from"./collection-table-wrapper-Dv4rgxdy.js";import{C as ie}from"./connection-card-CgJm9r5i.js";import{E as q}from"./empty-state-DV83eIhT.js";import{E as le}from"./error-boundary-qOVcoWbq.js";import{I as ce}from"./integration-icon-C_Dk6BbN.js";import{a as de,u as me}from"./use-gateway-CuMrhcvh.js";import{b as ue}from"./use-connection-IMyxygAc.js";import{u as ge}from"./use-list-state-Bas0EIwN.js";import{u as pe}from"./tooltip-DjXyjtiH.js";import{c as he,b as fe,d as xe,A as we,e as ye,g as je,a as Ce,f as Ne}from"./alert-dialog-Caf0mgW9.js";import{B as ee}from"./badge-j-myHF25.js";import{B as J}from"./button-DnKGwZ1P.js";import{b as Q,D as U,a as X,c as B}from"./dropdown-menu-BIeRR6rM.js";import{I as i}from"./icon-C1glN-Ga.js";import"./collection-display-button-Cws3c2TG.js";import"./utils-BLBjpUfr.js";import"./input-DpAKmHHm.js";import"./card-I0CWqn2J.js";import"./use-mobile-CxX0wu31.js";function ve(e,a){switch(a.type){case"delete":return{mode:"deleting",gateway:a.gateway};case"close":return{mode:"idle"}}}function De(){const e=Y.c(68),{org:a}=pe(),n=te();let y;e[0]!==a.slug?(y={namespace:a.slug,resource:"gateways"},e[0]=a.slug,e[1]=y):y=e[1];const s=ge(y),r=de(),w=me(s);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={},e[2]=j):j=e[2];const R=ue(j);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[l,N]=Z.useReducer(ve,C);let v;e[4]!==r.create||e[5]!==R.length||e[6]!==n||e[7]!==a.slug?(v=async()=>{if(R.length===0){se.error("Create at least one MCP connection first");return}const o=await r.create.mutateAsync({title:"New Gateway",description:"Gateways let you securely expose integrated tools to the outside world.",status:"active",tool_selection_strategy:"passthrough",tool_selection_mode:"inclusion",connections:[]});n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},e[4]=r.create,e[5]=R.length,e[6]=n,e[7]=a.slug,e[8]=v):v=e[8];const T=v;let D;e[9]!==r.delete||e[10]!==l.gateway||e[11]!==l.mode?(D=async()=>{if(l.mode!=="deleting")return;const o=l.gateway.id;N({type:"close"});try{await r.delete.mutateAsync(o)}catch{}},e[9]=r.delete,e[10]=l.gateway,e[11]=l.mode,e[12]=D):D=e[12];const O=D;let S,_,b,k,I,M;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={id:"icon",header:"",render:$e,cellClassName:"w-16 shrink-0"},b={id:"title",header:"Name",render:Ae,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},k={id:"description",header:"Description",render:ze,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},I={id:"mode",header:"Mode",accessor:Pe,cellClassName:"w-[100px]"},M={id:"connections",header:"Connections",render:Me,cellClassName:"w-24 shrink-0"},S={id:"status",header:"Status",render:Ie,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=S,e[14]=_,e[15]=b,e[16]=k,e[17]=I,e[18]=M):(S=e[13],_=e[14],b=e[15],k=e[16],I=e[17],M=e[18]);let P;e[19]!==n||e[20]!==a.slug?(P=[_,b,k,I,M,S,{id:"actions",header:"",render:o=>t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ke,children:t.jsx(i,{name:"more_vert",size:20})})}),t.jsxs(X,{align:"end",onClick:be,children:[t.jsxs(B,{onClick:c=>{c.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(i,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:c=>{c.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(i,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=n,e[20]=a.slug,e[21]=P):P=e[21];const V=P,H=r.create.isPending?"Creating...":"Create MCP Gateway";let z;e[22]!==r.create.isPending||e[23]!==T||e[24]!==H?(z=t.jsx(J,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:r.create.isPending,children:H}),e[22]=r.create.isPending,e[23]=T,e[24]=H,e[25]=z):z=e[25];const L=z,F=l.mode==="deleting";let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=o=>!o&&N({type:"close"}),e[26]=A):A=e[26];let $;e[27]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(he,{children:"Delete Gateway?"}),e[27]=$):$=e[27];const W=l.mode==="deleting"&&l.gateway.title;let d;e[28]!==W?(d=t.jsxs(fe,{children:[$,t.jsxs(xe,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=d):d=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(we,{children:"Cancel"}),e[30]=E):E=e[30];let m;e[31]!==O?(m=t.jsxs(ye,{children:[E,t.jsx(je,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=O,e[32]=m):m=e[32];let u;e[33]!==d||e[34]!==m?(u=t.jsxs(Ce,{children:[d,m]}),e[33]=d,e[34]=m,e[35]=u):u=e[35];let g;e[36]!==F||e[37]!==u?(g=t.jsx(Ne,{open:F,onOpenChange:A,children:u}),e[36]=F,e[37]=u,e[38]=g):g=e[38];let G;e[39]===Symbol.for("react.memo_cache_sentinel")?(G=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=G):G=e[39];let p;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(p=t.jsx(oe,{title:"MCP Gateways",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:G,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=p):p=e[46];let h;e[47]!==s?(h=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=h):h=e[48];let f;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==h?(f=t.jsx(ne,{value:s.search,onChange:s.setSearch,placeholder:"Search for a gateway...",onKeyDown:h}),e[49]=s.search,e[50]=s.setSearch,e[51]=h,e[52]=f):f=e[52];let x;e[53]!==V||e[54]!==w||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==n||e[61]!==a.slug?(x=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:w.length===0?t.jsx(q,{image:t.jsx(i,{name:"network_node",size:48,className:"text-muted-foreground"}),title:s.search?"No gateways found":"No gateways yet",description:s.search?`No gateways match "${s.search}"`:"Create a gateway to aggregate tools from multiple MCP connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:w.map(o=>t.jsx(ie,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:"network_node",onClick:()=>n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:_e,children:t.jsx(i,{name:"more_vert",size:20})})}),t.jsxs(X,{align:"end",onClick:Se,children:[t.jsxs(B,{onClick:c=>{c.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(i,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:c=>{c.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(i,{name:"delete",size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(re,{columns:V,data:w,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(i,{name:"network_node",size:48,className:"text-muted-foreground"}),title:"No gateways found",description:`No gateways match "${s.search}"`}):t.jsx(q,{image:t.jsx(i,{name:"network_node",size:48,className:"text-muted-foreground"}),title:"No gateways yet",description:"Create a gateway to aggregate tools from multiple MCP connections."})}),e[53]=V,e[54]=w,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=n,e[61]=a.slug,e[62]=x):x=e[62];let K;return e[63]!==g||e[64]!==p||e[65]!==f||e[66]!==x?(K=t.jsxs(ae,{children:[g,p,f,x]}),e[63]=g,e[64]=p,e[65]=f,e[66]=x,e[67]=K):K=e[67],K}function Se(e){return e.stopPropagation()}function _e(e){return e.stopPropagation()}function be(e){return e.stopPropagation()}function ke(e){return e.stopPropagation()}function Ie(e){return t.jsx(ee,{variant:e.status==="active"?"default":"outline",children:e.status})}function Me(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Pe(e){return t.jsx(ee,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function ze(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Ae(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function $e(e){return t.jsx(ce,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:"network_node"})}function at(){const e=Y.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(le,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(i,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(De,{})})}),e[0]=a):a=e[0],a}export{at as default};
|