@decocms/mesh 1.0.0-alpha.16 → 1.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/client/assets/{alert-dialog-CfsdbV8c.js → alert-dialog-CNm5ztkP.js} +3 -3
  2. package/dist/client/assets/{auth-CsOevbKn.js → auth-CyLHB7tB.js} +1 -1
  3. package/dist/client/assets/{auth-catchall-BMURI6L3.js → auth-catchall-Yv8rjuPd.js} +1 -1
  4. package/dist/client/assets/{avatar-Bn65M9_M.js → avatar-Cc4hE9Pf.js} +1 -1
  5. package/dist/client/assets/{badge-BTXir9uJ.js → badge-CGCqFQGe.js} +1 -1
  6. package/dist/client/assets/{button-B2BIOawN.js → button-B6JKXU7n.js} +1 -1
  7. package/dist/client/assets/{card-B24qMCfe.js → card-CZ94H_Vo.js} +1 -1
  8. package/dist/client/assets/{checkbox-CeN8Ys7n.js → checkbox-Cs0b7u0d.js} +1 -1
  9. package/dist/client/assets/{circle-alert-bANxza_Q.js → circle-alert-h5zNTCxs.js} +1 -1
  10. package/dist/client/assets/collection-detail-DV9iwQxu.js +1 -0
  11. package/dist/client/assets/{collection-display-button-DEnVk52I.js → collection-display-button-DHZpd1d4.js} +1 -1
  12. package/dist/client/assets/{collection-header-DZSYSGOn.js → collection-header-CnRjjcTE.js} +1 -1
  13. package/dist/client/assets/{collection-page-Cfda-vNl.js → collection-page-B8GsWMTT.js} +1 -1
  14. package/dist/client/assets/{collection-search-DxeL6Ufp.js → collection-search-I8oosBa6.js} +1 -1
  15. package/dist/client/assets/{collection-table-wrapper-D6eaPdiL.js → collection-table-wrapper-CoKzoKgE.js} +1 -1
  16. package/dist/client/assets/connection-card-BGK0XvaQ.js +1 -0
  17. package/dist/client/assets/connection-detail-C3jcmUc8.js +1 -0
  18. package/dist/client/assets/connections-BPvbyU6k.js +1 -0
  19. package/dist/client/assets/{create-organization-dialog-DZM9X3ft.js → create-organization-dialog-CSK3UUnh.js} +1 -1
  20. package/dist/client/assets/{dialog-BjdII1I-.js → dialog-BqH-v5-P.js} +1 -1
  21. package/dist/client/assets/{dropdown-menu-BT_X0ZTy.js → dropdown-menu-CKvU49DW.js} +1 -1
  22. package/dist/client/assets/{empty-state-CAhQEGD4.js → empty-state-DRf6tK44.js} +1 -1
  23. package/dist/client/assets/{error-boundary-CKkz6PFv.js → error-boundary-hm2OOL5w.js} +1 -1
  24. package/dist/client/assets/{extract-connection-data-BuUce3IM.js → extract-connection-data-DOlFw2eE.js} +1 -1
  25. package/dist/client/assets/{form-DYn0g3Xk.js → form-CRN1qyNq.js} +1 -1
  26. package/dist/client/assets/gateway-detail-BJcVq01x.js +1 -0
  27. package/dist/client/assets/gateways-Cx3Uu-9m.js +1 -0
  28. package/dist/client/assets/{home-owX9B5A1.js → home-BLBI4cvP.js} +1 -1
  29. package/dist/client/assets/{icon-B4prTi7A.js → icon-DbOxHq1f.js} +1 -1
  30. package/dist/client/assets/{index-BSJAakWI.js → index-BC-c9YPR.js} +1 -1
  31. package/dist/client/assets/index-Bvrhdkax.js +32 -0
  32. package/dist/client/assets/{index-DRfRtuak.js → index-CXipro-A.js} +2 -2
  33. package/dist/client/assets/index-XU02Lc4Q.css +1 -0
  34. package/dist/client/assets/{index-CJJcr20V.js → index-Z7YOF2J1.js} +1 -1
  35. package/dist/client/assets/{input-0KxSy7p5.js → input-BhdF1DOG.js} +1 -1
  36. package/dist/client/assets/layout-Mla6IQml.js +1 -0
  37. package/dist/client/assets/{lazy-highlighter-DNEByQ_q.js → lazy-highlighter-BI3RuuUh.js} +1 -1
  38. package/dist/client/assets/{localstorage-keys-C-_5_veF.js → localstorage-keys-mDtPD0-E.js} +1 -1
  39. package/dist/client/assets/{login-eNmXdIlx.js → login-BxCo6SQr.js} +1 -1
  40. package/dist/client/assets/{mcp-oauth-D4DQrKdX.js → mcp-oauth-D_Ipguxl.js} +1 -1
  41. package/dist/client/assets/members-ODuwLYee.js +1 -0
  42. package/dist/client/assets/monitoring-CwwxIUXX.js +1 -0
  43. package/dist/client/assets/{monitoring-stats-row-CDJOdEFs.js → monitoring-stats-row-RHfTv5A0.js} +1 -1
  44. package/dist/client/assets/{oauth-callback-B2eu3eq6.js → oauth-callback-_9Hvi16Z.js} +1 -1
  45. package/dist/client/assets/page-B2NLii9n.js +1 -0
  46. package/dist/client/assets/{popover-CXXilSJS.js → popover-CunHw-GF.js} +1 -1
  47. package/dist/client/assets/{prism-CqKQ-uUB.js → prism-bVP28Vef.js} +1 -1
  48. package/dist/client/assets/resource-tabs-CQdQmY74.js +1 -0
  49. package/dist/client/assets/{schema-DI-mC0WE.js → schema-D1WDjVUj.js} +1 -1
  50. package/dist/client/assets/{select-xvA0wpax.js → select-DBB13Fgn.js} +1 -1
  51. package/dist/client/assets/{settings-N1KHLSeV.js → settings-BEGeHPi1.js} +1 -1
  52. package/dist/client/assets/shell-layout-TR4EpBXt.js +124 -0
  53. package/dist/client/assets/{spinner-DknaoKT9.js → spinner-DISIVZmd.js} +1 -1
  54. package/dist/client/assets/store-app-detail-DPLPdJLB.js +1 -0
  55. package/dist/client/assets/store-kC_MacGX.js +1 -0
  56. package/dist/client/assets/{switch-C5HcbsY1.js → switch-74h4WLGn.js} +1 -1
  57. package/dist/client/assets/{textarea-DG6Oh4Et.js → textarea-BXmw3uJQ.js} +1 -1
  58. package/dist/client/assets/tool-set-selector-CzTKgY3M.js +1 -0
  59. package/dist/client/assets/{tooltip-7pBEiiqV.js → tooltip-DE0HjIXp.js} +1 -1
  60. package/dist/client/assets/{upload-6ljQ7Xvj.js → upload-CR8-kBb_.js} +1 -1
  61. package/dist/client/assets/{use-binding-QY8lUZ4l.js → use-binding-TgH1L02B.js} +2 -2
  62. package/dist/client/assets/{integration-icon-BOIQGbTx.js → use-connection-BzRUmR7q.js} +2 -2
  63. package/dist/client/assets/use-gateway-DOUIZKty.js +1 -0
  64. package/dist/client/assets/{use-list-state-C1uU-z8t.js → use-list-state-xIVOkH9e.js} +1 -1
  65. package/dist/client/assets/{use-mcp-BLvzQK7V.js → use-mcp-BXI4z5F9.js} +1 -1
  66. package/dist/client/assets/{use-members-BGTW4lDt.js → use-members-CA5QaQb4.js} +1 -1
  67. package/dist/client/assets/{use-mobile-qq-CGCwC.js → use-mobile-BxmFsDSk.js} +1 -1
  68. package/dist/client/assets/use-organization-settings-BSMVwaDu.js +1 -0
  69. package/dist/client/assets/{use-tool-call-Ct8SM41M.js → use-tool-call-DNGrXHE-.js} +1 -1
  70. package/dist/client/assets/useQuery-CP5mkTne.js +1 -0
  71. package/dist/client/assets/utils-CqRSS_0V.js +1 -0
  72. package/dist/client/index.html +2 -2
  73. package/dist/server/cli.js +188 -210
  74. package/dist/server/migrate.js +101 -101
  75. package/dist/server/server.js +185 -207
  76. package/package.json +5 -4
  77. package/dist/client/assets/collection-detail-Ca7tFfcv.js +0 -1
  78. package/dist/client/assets/connection-card-DBDfkDQH.js +0 -1
  79. package/dist/client/assets/connection-detail-DBMh3Kzg.js +0 -1
  80. package/dist/client/assets/connections-CdlDfWny.js +0 -1
  81. package/dist/client/assets/gateway-detail-CP1wU_gQ.js +0 -1
  82. package/dist/client/assets/gateways-CC9LsUii.js +0 -1
  83. package/dist/client/assets/index-CMNfZDn2.css +0 -1
  84. package/dist/client/assets/index-Dwwz-rb1.js +0 -32
  85. package/dist/client/assets/layout-erRxoybz.js +0 -1
  86. package/dist/client/assets/members-CqBq9Tqq.js +0 -1
  87. package/dist/client/assets/monitoring-RZzI7HX3.js +0 -1
  88. package/dist/client/assets/page-D6nvIccR.js +0 -1
  89. package/dist/client/assets/resource-tabs-BPbCYInc.js +0 -1
  90. package/dist/client/assets/shell-layout-DBeyfhU9.js +0 -124
  91. package/dist/client/assets/store-app-detail-BY8fKDCz.js +0 -1
  92. package/dist/client/assets/store-xSGmsPQe.js +0 -1
  93. package/dist/client/assets/tool-set-selector-1Cg6gjRw.js +0 -1
  94. package/dist/client/assets/use-gateway-D3gYh1VN.js +0 -1
  95. package/dist/client/assets/use-organization-settings-BppZIKRZ.js +0 -1
  96. package/dist/client/assets/useQuery-Dt7bC647.js +0 -1
  97. package/dist/client/assets/utils-DFmxvpl9.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.18",
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,13 @@
35
35
  "prepublishOnly": "bun run build:client && bun run build:server"
36
36
  },
37
37
  "dependencies": {
38
+ "@ai-sdk/mcp": "^1.0.0",
38
39
  "kysely": "^0.28.8",
39
40
  "kysely-bun-worker": "^0.6.0"
40
41
  },
41
42
  "devDependencies": {
42
- "@ai-sdk/provider": "^2.0.0",
43
- "@ai-sdk/react": "^2.0.59",
43
+ "@ai-sdk/provider": "^3.0.0",
44
+ "@ai-sdk/react": "^3.0.1",
44
45
  "@better-auth/sso": "1.4.1",
45
46
  "@daveyplate/better-auth-ui": "^3.2.7",
46
47
  "@deco/ui": "workspace:*",
@@ -79,7 +80,7 @@
79
80
  "@types/react-syntax-highlighter": "^15.5.13",
80
81
  "@vercel/nft": "^1.1.1",
81
82
  "@vitejs/plugin-react": "^5.1.0",
82
- "ai": "^5.0.101",
83
+ "ai": "^6.0.1",
83
84
  "babel-plugin-react-compiler": "^1.0.0",
84
85
  "better-auth": "1.4.5",
85
86
  "class-variance-authority": "^0.7.1",
@@ -1 +0,0 @@
1
- import{b9 as _,r as N,d as M,as as ee,j as t,c as S,af as te,a6 as se,b8 as W}from"./index-DRfRtuak.js";import{f as oe,c as D,U as B,a as ne,e as re}from"./integration-icon-BOIQGbTx.js";import{T as ae}from"./tool-set-selector-1Cg6gjRw.js";import{B as ie}from"./badge-BTXir9uJ.js";import{B as I}from"./button-B2BIOawN.js";import{I as z}from"./icon-B4prTi7A.js";import{I as U}from"./input-0KxSy7p5.js";import{S as le}from"./spinner-DknaoKT9.js";import{T as q}from"./textarea-DG6Oh4Et.js";import{c as k}from"./utils-DFmxvpl9.js";import{a as G,u as ce,O as de,P as me,E as ue}from"./index-Dwwz-rb1.js";import{b as Z,a as xe,V as H}from"./layout-erRxoybz.js";import{U as fe}from"./upload-6ljQ7Xvj.js";import{u as pe}from"./use-mcp-BLvzQK7V.js";import{C as he}from"./circle-alert-bANxza_Q.js";import{E as ge}from"./error-boundary-CKkz6PFv.js";import"./tooltip-7pBEiiqV.js";import"./checkbox-CeN8Ys7n.js";import"./select-xvA0wpax.js";import"./collection-search-DxeL6Ufp.js";import"./mcp-oauth-D4DQrKdX.js";import"./auth-CsOevbKn.js";import"./use-organization-settings-BppZIKRZ.js";import"./empty-state-CAhQEGD4.js";import"./use-binding-QY8lUZ4l.js";import"./use-tool-call-Ct8SM41M.js";import"./form-DYn0g3Xk.js";import"./use-gateway-D3gYh1VN.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./extract-connection-data-BuUce3IM.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-CJJcr20V.js";import"./index-BSJAakWI.js";import"./schema-DI-mC0WE.js";import"./useQuery-Dt7bC647.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:r,onChange:a,alt:n}=s,o=N.useRef(null);let i;e[0]!==a?(i=j=>{const w=j.target.files?.[0];if(w){const y=new FileReader;y.onloadend=()=>{const g=y.result;a(g)},y.readAsDataURL(w)}},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 p=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 x;e[5]!==n||e[6]!==r?(x=r?t.jsx("img",{src:r,alt:n||"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]=n,e[6]=r,e[7]=x):x=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=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]=f):f=e[8];let h;e[9]!==x?(h=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[x,f]}),e[9]=x,e[10]=h):h=e[10];let b;return e[11]!==c||e[12]!==h?(b=t.jsxs("div",{className:"relative h-14 w-14 shrink-0 cursor-pointer group",onClick:p,children:[c,h]}),e[11]=c,e[12]=h,e[13]=b):b=e[13],b}function Ae({itemId:s,onBack:e,onUpdate:r}){const[a,n]=N.useState(!1),[o,i]=N.useState("profile"),{connectionId:m}=M({from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"}),l=m??B,p=D(l),c=oe(l,"AGENT",s,p),{register:x,handleSubmit:f,reset:h,setValue:b,watch:j,formState:{isDirty:w}}=ee({defaultValues:{title:"",description:"",instructions:"",avatar:"",tool_set:{}}}),y=j("avatar"),g=j("tool_set")??{};N.useEffect(()=>{c&&h({title:c.title??"",description:c.description??"",instructions:c.instructions??"",avatar:c.avatar??"",tool_set:c.tool_set??{}})},[c,h]);const u=async $=>{n(!0);try{await r($)}finally{n(!1)}},O=$=>{b("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:f(u),disabled:!w||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:y,onChange:$=>b("avatar",$,{shouldDirty:!0}),alt:j("title")}),t.jsxs("div",{className:"space-y-3 pt-1 flex-1",children:[t.jsx(U,{...x("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(U,{...x("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,{...x("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:g,onToolSetChange:O}),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(le,{})})}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 Me(s){const e=S.c(10);let r,a,n;e[0]!==s?({className:r,variant:n,...a}=s,e[0]=s,e[1]=r,e[2]=a,e[3]=n):(r=e[1],a=e[2],n=e[3]);let o;e[4]!==r||e[5]!==n?(o=k(ze({variant:n}),r),e[4]=r,e[5]=n,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 Oe(s){const e=S.c(8);let r,a;e[0]!==s?({className:r,...a}=s,e[0]=s,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let n;e[3]!==r?(n=k("line-clamp-1 min-h-4 font-medium tracking-tight",r),e[3]=r,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=t.jsx("div",{"data-slot":"alert-title",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function Pe(s){const e=S.c(8);let r,a;e[0]!==s?({className:r,...a}=s,e[0]=s,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let n;e[3]!==r?(n=k("text-muted-foreground leading-relaxed",r),e[3]=r,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=t.jsx("div",{"data-slot":"alert-description",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}const Re=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ve(s){const e=S.c(12),{toolName:r,connectionId:a,onBack:n}=s,o=`/mcp/${a}`;let i;e[0]!==o?(i=new URL(o,window.location.origin),e[0]=o,e[1]=i):i=e[1];const m=i;let l;if(e[2]!==a?(l={connectionId:a},e[2]=a,e[3]=l):l=e[3],!ce(l)){let f;return e[4]!==n?(f=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{onAuthenticate:()=>n(),buttonText:"Go back"})}),e[4]=n,e[5]=f):f=e[5],f}const c=`${a}:${r}`;let x;return e[6]!==a||e[7]!==m||e[8]!==n||e[9]!==c||e[10]!==r?(x=t.jsx(Ue,{toolName:r,connectionId:a,mcpProxyUrl:m,onBack:n},c),e[6]=a,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=x):x=e[11],x}function Ue({toolName:s,connectionId:e,mcpProxyUrl:r,onBack:a}){const[n,o]=N.useState({}),[i,m]=N.useState("{}"),[l,p]=N.useState(null),[c,x]=N.useState(null),[f,h]=N.useState(!1),[b,j]=N.useState(null),[w,y]=N.useState("json"),g=pe({url:r.href});N.useEffect(()=>{g.error&&console.error("MCP Error:",g.error)},[g.error]);const u=g.tools?.find(d=>d.name===s),O=u?.inputSchema?.properties,$=O?Object.keys(O):[],A=$.length>0,P={};if(A&&u?.inputSchema?.properties)for(const d of $)P[d]=u.inputSchema.required?.includes(d)?"":void 0;const J=d=>Object.prototype.hasOwnProperty.call(n,d),Q=async()=>{h(!0),x(null),p(null),j(null);const d=performance.now(),C=D(e);try{const v=A?{...P,...n}:(()=>{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&&u?.inputSchema?.properties&&Object.entries(u.inputSchema.properties).forEach(([T,E])=>{if((E.type==="object"||E.type==="array")&&typeof v[T]=="string")try{v[T]=JSON.parse(v[T])}catch{}});const R=await C(s,v),V=performance.now(),X=Math.round(V-d);p(R);const Y=JSON.stringify(R),F=new TextEncoder().encode(Y).length;j({duration:`${X}ms`,bytes:`${F} bytes`,tokens:`~${Math.ceil(F/4)} tokens`,cost:"$0.0000"})}catch(v){const R=v instanceof Error?v.message:String(v);x(R||"Unknown error occurred");const V=performance.now();j({duration:`${Math.round(V-d)}ms`})}finally{h(!1)}},L=(d,C)=>{o(v=>({...v,[d]:C}))};return t.jsxs(Z,{onBack:a,children:[t.jsx(H,{children:t.jsx(G,{connectionId:e,title:u?.name??Re(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:u?.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:[g.state==="ready"?t.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"}):g.state==="connecting"?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:g.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:b?.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:b?.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:b?.bytes||"-"})]})]}),c&&t.jsxs(Me,{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(Oe,{children:"Execution Failed"}),t.jsx(Pe,{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:f,children:[f?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&&u?.inputSchema?.properties?Object.entries(u.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}),u.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)?n[d]??"":P[d]??"",onChange:v=>L(d,v.target.value),placeholder:`Enter ${d} as JSON...`}):t.jsx(U,{value:J(d)?n[d]??"":P[d]??"",onChange:v=>L(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):t.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."}),u?.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:()=>y("json"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all",w==="json"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"JSON"}),t.jsxs("button",{onClick:()=>y("view"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all flex items-center gap-1",w==="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 De(s){const e=S.c(7),{itemId:r,onBack:a}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const i=M(n).connectionId??B;if(!ne(i)){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 p;return e[3]!==i||e[4]!==a||e[5]!==r?(p=t.jsx(N.Suspense,{fallback:l,children:t.jsx(Ve,{toolName:r,connectionId:i,onBack:a})}),e[3]=i,e[4]=a,e[5]=r,e[6]=p):p=e[6],p}const Be={agent:Ae};function Je(){const s=S.c(6),e=W();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=r):r=s[0];const a=M(r),n=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=Le;let l;return s[3]!==i||s[4]!==n?(l=t.jsx(De,{itemId:n,onBack:i,onUpdate:m}),s[3]=i,s[4]=n,s[5]=l):l=s[5],l}async function Le(s){return Promise.resolve()}function Fe(){const s=S.c(17),e=W();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=r):r=s[0];const a=M(r),n=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,p=n??B;let c;s[3]!==p?(c=D(p),s[3]=p,s[4]=c):c=s[4];const f=re(p,o,c);let h;s[5]!==f||s[6]!==i?(h=async u=>{i&&await f.update.mutateAsync({id:i,data:u})},s[5]=f,s[6]=i,s[7]=h):h=s[7];const b=h;let j;s[8]!==o?(j=o?.toLowerCase(),s[8]=o,s[9]=j):j=s[9];const w=j,y=w&&Be[w];if(y){let u;return s[10]!==y||s[11]!==l||s[12]!==b||s[13]!==i?(u=t.jsx(y,{itemId:i,onBack:l,onUpdate:b}),s[10]=y,s[11]=l,s[12]=b,s[13]=i,s[14]=u):u=s[14],u}let g;return s[15]!==l?(g=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]=g):g=s[16],g}function Ke(){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 r=M(e);if(decodeURIComponent(r.collectionName)==="tools"){let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Je,{}),s[1]=i):i=s[1],i}let o;return s[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Fe,{}),s[2]=o):o=s[2],o}function It(){const s=S.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ge,{children:t.jsx(N.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(Ke,{})})}),s[0]=e):e=s[0],e}export{It as default};
@@ -1 +0,0 @@
1
- import{c as S,j as s}from"./index-DRfRtuak.js";import{B as _}from"./badge-BTXir9uJ.js";import{C as A}from"./card-B24qMCfe.js";import{c as j}from"./utils-DFmxvpl9.js";import{I as $}from"./integration-icon-BOIQGbTx.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 s,a5 as Oe,a as Ye,r as ze,a6 as Ze,d as et,b as tt,b8 as st}from"./index-DRfRtuak.js";import{E as Ee}from"./empty-state-CAhQEGD4.js";import{E as Fe}from"./error-boundary-CKkz6PFv.js";import{I as ot,a as Ke,e as nt,u as it,c as lt,d as at}from"./integration-icon-BOIQGbTx.js";import{b as rt}from"./use-binding-QY8lUZ4l.js";import{E as Ve,P as ct,a as dt,u as mt,S as ft}from"./index-Dwwz-rb1.js";import{B as ge}from"./button-B2BIOawN.js";import{I as M}from"./icon-B4prTi7A.js";import{a as ut,T as pt,R as ht}from"./resource-tabs-BPbCYInc.js";import{V as gt,a as xt,b as jt}from"./layout-erRxoybz.js";import{g as Be}from"./generate-id-Dyweu44Y.js";import{C as Le}from"./collection-display-button-DEnVk52I.js";import{C as bt}from"./collection-search-DxeL6Ufp.js";import{C as Ct}from"./card-B24qMCfe.js";import{b as We,D as qe,a as He,c as B}from"./dropdown-menu-BT_X0ZTy.js";import{C as vt}from"./collection-table-wrapper-D6eaPdiL.js";import{u as yt}from"./use-list-state-C1uU-z8t.js";import{B as wt}from"./extract-connection-data-BuUce3IM.js";import{A as _t,g as St,c as Nt,b as It,d as Tt,e as Dt,a as $t,f as At}from"./alert-dialog-CfsdbV8c.js";import"./utils-DFmxvpl9.js";import"./tooltip-7pBEiiqV.js";import"./auth-CsOevbKn.js";import"./mcp-oauth-D4DQrKdX.js";import"./use-organization-settings-BppZIKRZ.js";import"./use-tool-call-Ct8SM41M.js";import"./form-DYn0g3Xk.js";import"./input-0KxSy7p5.js";import"./select-xvA0wpax.js";import"./use-gateway-D3gYh1VN.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./registry-utils-ulDDT0d8.js";import"./index-CJJcr20V.js";import"./index-BSJAakWI.js";import"./schema-DI-mC0WE.js";import"./useQuery-Dt7bC647.js";import"./badge-BTXir9uJ.js";import"./use-mobile-qq-CGCwC.js";function Pt(t,e){const o=t.properties||{};for(const i in o){const a=o[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:o,schema:l,actions:i}=t;let a;e[0]!==o||e[1]!==l?(a=Pt(l,o),e[0]=o,e[1]=l,e[2]=a):a=e[2];const f=a,n=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let u;e[3]!==i?(u=i&&Object.keys(i).length>0,e[3]=i,e[4]=u):u=e[4];const g=u;let r;e[5]!==f||e[6]!==o.title?(r=s.jsx(ot,{icon:f,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=f,e[6]=o.title,e[7]=r):r=e[7];let d;e[8]!==o.title?(d=s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=d):d=e[9];const x=n||"No description";let h;e[10]!==x?(h=s.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=s.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=s.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]!==o?(c=g&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Mt,onMouseDown:Et,children:s.jsxs(We,{children:[s.jsx(qe,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:s.jsx(M,{name:"more_vert",size:20})})}),s.jsxs(He,{align:"end",onClick:Ot,children:[i.open&&s.jsxs(B,{onClick:C=>{C.stopPropagation(),i.open?.(o)},children:[s.jsx(M,{name:"visibility",size:16}),"Open"]}),i.edit&&s.jsxs(B,{onClick:C=>{C.stopPropagation(),i.edit?.(o)},children:[s.jsx(M,{name:"edit",size:16}),"Edit"]}),i.duplicate&&s.jsxs(B,{onClick:C=>{C.stopPropagation(),i.duplicate?.(o)},children:[s.jsx(M,{name:"content_copy",size:16}),"Duplicate"]}),i.delete&&s.jsxs(B,{variant:"destructive",onClick:C=>{C.stopPropagation(),i.delete?.(o)},children:[s.jsx(M,{name:"delete",size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=g,e[20]=o,e[21]=c):c=e[21];let N;return e[22]!==p||e[23]!==c?(N=s.jsxs(Ct,{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(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function Ut(t){const e=V.c(32),{data:o,schema:l,viewMode:i,onViewModeChange:a,search:f,sortKey:n,sortDirection:u,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=u===void 0?"asc":u,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,w=p===void 0?void 0:p,z=c===void 0?!1:c,_=N===void 0?void 0:N;let D;e[2]!==w||e[3]!==l||e[4]!==_?(D=w?w.filter(Bt).filter(U=>!_||_.includes(U.id)).map(Vt):Je(l,_),e[2]=w,e[3]=l,e[4]=_,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&&s.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:s.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:T}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.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]!==w||e[17]!==o||e[18]!==y||e[19]!==k||e[20]!==P||e[21]!==O||e[22]!==l||e[23]!==f||e[24]!==v||e[25]!==n||e[26]!==_||e[27]!==i?(b=i==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:y||s.jsx(Ve,{icon:"inbox",title:"No items found",description:f?"Try adjusting your search":"No items to display"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(U=>s.jsx("div",{onClick:()=>k?.(U),className:"cursor-pointer h-full",children:s.jsx(kt,{item:U,schema:l,readOnly:O,actions:I})},U.id))})}):s.jsx(vt,{columns:Ht(w,l,_,I),data:o,sortKey:n,sortDirection:v,onSort:P,onRowClick:k,emptyState:y||s.jsx(Ve,{icon:"inbox",title:"No items found",description:f?"Try adjusting your search":"No items to display"})}),e[15]=I,e[16]=w,e[17]=o,e[18]=y,e[19]=k,e[20]=P,e[21]=O,e[22]=l,e[23]=f,e[24]=v,e[25]=n,e[26]=_,e[27]=i,e[28]=b):b=e[28];let E;return e[29]!==$||e[30]!==b?(E=s.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=>s.jsxs(We,{children:[s.jsx(qe,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(M,{name:"more_vert",size:20})})}),s.jsxs(He,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(B,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(M,{name:"visibility",size:16}),"Open"]}),t.edit&&s.jsxs(B,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(M,{name:"edit",size:16}),"Edit"]}),t.duplicate&&s.jsxs(B,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(M,{name:"content_copy",size:16}),"Duplicate"]}),t.delete&&s.jsxs(B,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.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 o=t.properties||{},l=Object.keys(o).filter(n=>{const u=o[n];return u&&Wt(u)}),i=l.find(n=>{const u=o[n];return u&&Re(u)}),a=new Set;i&&a.add(i);const f=["title","description","updated_at","updated_by"];for(const n of f)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 u=o[n];if(!u)return{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d==null?"—":s.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 u.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?s.jsx("span",{className:"block truncate max-w-full",children:new Date(d).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:i===n&&Re(u)?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d?s.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?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:g,cellClassName:"max-w-[100px]"}})}function Ht(t,e,o,l){const i=t||qt(e,o);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:o,org:l,activeCollection:i}=t,a=i.name,f=i.schema??wt,n=i.hasCreateTool,u=i.hasUpdateTool,g=i.hasDeleteTool,r=Oe(),{data:d}=Ye.useSession(),x=d?.user?.id||"unknown",h=Ke(o);let j;e[0]!==o?(j=lt(o),e[0]=o,e[1]=j):j=e[1];const p=j,c=nt(o,a,p),N=`${o}-${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 w;e[5]!==P||e[6]!==y||e[7]!==T?(w={searchTerm:P,sortKey:T,sortDirection:y},e[5]=P,e[6]=y,e[7]=T,e[8]=w):w=e[8];const z=it(o,a,p,w),_=!n&&!u&&!g;let D;e[9]!==a||e[10]!==o||e[11]!==r||e[12]!==l?(D=A=>{r({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:a,itemId:A.id}})},e[9]=a,e[10]=o,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]!==u?(R=u&&{edit:S},e[18]=S,e[19]=u,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]!==o||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:o,collectionName:a,itemId:ke.id}})}catch(ke){console.error("Failed to create item:",ke)}},e[33]=c.create,e[34]=a,e[35]=o,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]!==f?(de=Je(f),e[41]=f,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?s.jsxs(ge,{onClick:be,size:"sm",disabled:c.create.isPending,className:"h-7",children:[s.jsx(ct,{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=s.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`,we=h?.icon??"grid_view";let W;e[54]!==o||e[55]!==ye||e[56]!==we?(W=s.jsx(dt,{connectionId:o,title:ye,icon:we}),e[54]=o,e[55]=ye,e[56]=we,e[57]=W):W=e[57];const _e=Qe&&Ue;let q;e[58]!==L||e[59]!==W||e[60]!==_e?(q=s.jsxs(gt,{children:[L,W,_e]}),e[58]=L,e[59]=W,e[60]=_e,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=s.jsx(bt,{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=s.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]!==_||e[79]!==xe||e[80]!==f||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=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Ut,{hideToolbar:!0,data:G,schema:f,viewMode:I,onViewModeChange:k,search:v,onSearchChange:m,sortKey:Ne,sortDirection:y,onSort:O,actions:xe,onItemClick:Q,readOnly:_,emptyState:X})}),e[77]=O,e[78]=_,e[79]=xe,e[80]=f,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=s.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 fe;e[94]===Symbol.for("react.memo_cache_sentinel")?(fe=A=>{A||U(null)},e[94]=fe):fe=e[94];let ue;e[95]===Symbol.for("react.memo_cache_sentinel")?(ue=s.jsx(Nt,{children:"Delete item?"}),e[95]=ue):ue=e[95];const Ae=E?.title;let ee;e[96]!==Ae?(ee=s.jsxs(It,{children:[ue,s.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=s.jsx(_t,{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 se;e[100]!==c.delete.isPending||e[101]!==je||e[102]!==Pe?(se=s.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]=se):se=e[103];let oe;e[104]!==te||e[105]!==se?(oe=s.jsxs(Dt,{children:[te,se]}),e[104]=te,e[105]=se,e[106]=oe):oe=e[106];let ne;e[107]!==ee||e[108]!==oe?(ne=s.jsxs($t,{children:[ee,oe]}),e[107]=ee,e[108]=oe,e[109]=ne):ne=e[109];let ie;e[110]!==$e||e[111]!==ne?(ie=s.jsx(At,{open:$e,onOpenChange:fe,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=s.jsxs(s.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:o}=t;let l;return e[0]!==o?(l=s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(ut,{repository:o})}),e[0]=o,e[1]=l):l=e[1],l}function Qt(t){const e=V.c(4),{tools:o,connectionId:l,org:i}=t;let a;return e[0]!==l||e[1]!==i||e[2]!==o?(a=s.jsx(pt,{tools:o,connectionId:l,org:i}),e[0]=l,e[1]=i,e[2]=o,e[3]=a):a=e[3],a}function Xt(t){const e=V.c(48),{connection:o,connectionId:l,org:i,requestedTabId:a,collections:f,onUpdate:n,isUpdating:u}=t,g=st();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]!==l?(x={connectionId:l},e[1]=l,e[2]=x):x=e[2];const h=mt(x),j=o?.metadata?.repository,p=!!j?.url,c=o?.tools?.length??0;let N;e[3]===Symbol.for("react.memo_cache_sentinel")?(N={id:"settings",label:"Settings"},e[3]=N):N=e[3];let C;e[4]!==h||e[5]!==c?(C=h&&c>0?[{id:"tools",label:"Tools",count:c}]:[],e[4]=h,e[5]=c,e[6]=C):C=e[6];let v;if(e[7]!==f||e[8]!==p||e[9]!==h||e[10]!==C){let b;e[12]!==p?(b=p?[{id:"readme",label:"README"}]:[],e[12]=p,e[13]=b):b=e[13],v=[N,...C,...h?(f||[]).map(Yt):[],...b],e[7]=f,e[8]=p,e[9]=h,e[10]=C,e[11]=v}else v=e[11];const P=v,m=P.some(b=>b.id===a)?a:"settings";let I;e[14]!==d?(I=b=>{d({search:E=>({...E,tab:b}),replace:!0})},e[14]=d,e[15]=I):I=e[15];const k=I;let T;e[16]!==f?(T=f||[],e[16]=f,e[17]=T):T=e[17];let y;if(e[18]!==m||e[19]!==T){let b;e[21]!==m?(b=E=>E.name===m,e[21]=m,e[22]=b):b=e[22],y=T.find(b),e[18]=m,e[19]=T,e[20]=y}else y=e[20];const O=y;let w;e[23]!==g.history?(w=()=>g.history.back(),e[23]=g.history,e[24]=w):w=e[24];let z;e[25]!==m||e[26]!==k||e[27]!==P?(z=s.jsx(xt,{children:s.jsx(ht,{tabs:P,activeTab:m,onTabChange:k})}),e[25]=m,e[26]=k,e[27]=P,e[28]=z):z=e[28];let _;e[29]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(M,{size:32,name:"progress_activity",className:"animate-spin text-muted-foreground"})}),e[29]=_):_=e[29];let D;e[30]!==O||e[31]!==m||e[32]!==o||e[33]!==l||e[34]!==p||e[35]!==h||e[36]!==u||e[37]!==n||e[38]!==i||e[39]!==j?(D=s.jsx(ze.Suspense,{fallback:_,children:m==="tools"?s.jsx(Qt,{tools:o.tools??void 0,connectionId:l,org:i}):m==="settings"?s.jsx(ft,{connection:o,onUpdate:n,isUpdating:u,isMCPAuthenticated:h}):m==="readme"&&p?s.jsx(Gt,{repository:j}):O&&h?s.jsx(Jt,{connectionId:l,org:i,activeCollection:O},m):s.jsx(Ee,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[30]=O,e[31]=m,e[32]=o,e[33]=l,e[34]=p,e[35]=h,e[36]=u,e[37]=n,e[38]=i,e[39]=j,e[40]=D):D=e[40];let S;e[41]!==m||e[42]!==D?(S=s.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:s.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:s.jsx(Fe,{children:D},m)})}),e[41]=m,e[42]=D,e[43]=S):S=e[43];let $;return e[44]!==z||e[45]!==S||e[46]!==w?($=s.jsxs(jt,{onBack:w,children:[z,S]}),e[44]=z,e[45]=S,e[46]=w,e[47]=$):$=e[47],$}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 o=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 f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/mcps/$connectionId"},t[2]=f):f=t[2];const u=tt(f).tab||"settings",g=Ke(i),r=at(),d=rt(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]!==o||t[7]!==a?(p=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(Ee,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:s.jsx(ge,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:a}}),children:"Back to connections"})})}),t[6]=o,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]!==u?(j=s.jsx(Xt,{org:a,connection:g,connectionId:i,requestedTabId:u,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]=u,t[16]=j):j=t[16],j}function es(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fe,{children:s.jsx(ze.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(M,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(Zt,{})})}),t[0]=e):e=t[0],e}function Vs(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(es,{}),t[0]=e):e=t[0],e}export{Vs 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-DRfRtuak.js";import{C as He}from"./schema-DI-mC0WE.js";import{C as Oe}from"./collection-header-DZSYSGOn.js";import{C as Re}from"./collection-page-Cfda-vNl.js";import{C as Ve}from"./collection-search-DxeL6Ufp.js";import{C as Le}from"./collection-table-wrapper-D6eaPdiL.js";import{C as Ue}from"./connection-card-DBDfkDQH.js";import{E as De}from"./empty-state-CAhQEGD4.js";import{E as We}from"./error-boundary-CKkz6PFv.js";import{d as qe,b as Ge,I as Je}from"./integration-icon-BOIQGbTx.js";import{u as Qe}from"./use-list-state-C1uU-z8t.js";import{u as Xe}from"./tooltip-7pBEiiqV.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-CfsdbV8c.js";import{B as rt}from"./badge-BTXir9uJ.js";import{B as E}from"./button-B2BIOawN.js";import{a as ct,b as lt,D as at,f as dt,c as mt,d as ut}from"./dialog-BjdII1I-.js";import{b as Me,D as Pe,a as Te,c as pe}from"./dropdown-menu-BT_X0ZTy.js";import{F,a as pt,b as K,c as B,d as H,f as O}from"./form-DYn0g3Xk.js";import{I as m}from"./icon-B4prTi7A.js";import{I as Ie}from"./input-0KxSy7p5.js";import{c as ht,a as ft,S as gt,b as xt,d as ke}from"./select-xvA0wpax.js";import{T as jt}from"./textarea-DG6Oh4Et.js";import{g as _t}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-DEnVk52I.js";import"./utils-DFmxvpl9.js";import"./card-B24qMCfe.js";import"./use-mobile-qq-CGCwC.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=qe(),z=Ge(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",wrap:!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(Je,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:"extension"})}function un(){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{un as default};
@@ -1 +0,0 @@
1
- import{c as X,j as t,r as Q,a5 as ke,d as Ie,ap as $e,bl as ue,aq as xe,b8 as Ee,ar as Fe,as as Ge,a6 as he}from"./index-DRfRtuak.js";import{E as Ae}from"./empty-state-CAhQEGD4.js";import{E as ge}from"./error-boundary-CKkz6PFv.js";import{b as De,I as Ve}from"./integration-icon-BOIQGbTx.js";import{T as ze}from"./tool-set-selector-1Cg6gjRw.js";import{b as Pe,a as Ue}from"./use-gateway-D3gYh1VN.js";import{B as L}from"./button-B2BIOawN.js";import{I as P}from"./icon-B4prTi7A.js";import{I as je}from"./input-0KxSy7p5.js";import{S as Re}from"./switch-C5HcbsY1.js";import{F as Z,a as Be,b as te,d as se,f as oe,c as ye}from"./form-DYn0g3Xk.js";import{c as _e,a as be,S as ve,b as we,d as ee}from"./select-xvA0wpax.js";import{d as M,b as q,a as H,T as K}from"./tooltip-7pBEiiqV.js";import{s as We}from"./slugify-CEUa2lfQ.js";import{V as Oe,b as Je}from"./layout-erRxoybz.js";import{f as Le}from"./formatDistanceToNow-Ctx6mZEP.js";import"./utils-DFmxvpl9.js";import"./checkbox-CeN8Ys7n.js";import"./collection-search-DxeL6Ufp.js";function pe(o){const s=new TextEncoder().encode(o),n=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(n)}function Me(o){const e=X.c(63),{serverName:s,gatewayUrl:n}=o,[a,c]=Q.useState(!1),[i,f]=Q.useState(null),l=We(s);let r,d,p,g,h;if(e[0]!==n||e[1]!==l){const ce={type:"http",url:n},de={[l]:ce};r=JSON.stringify(de,null,2);const fe=Te=>JSON.stringify({...ce,headers:{"x-mesh-client":Te}},null,2),Ce=pe(fe("Cursor"));d=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(l)}&config=${encodeURIComponent(Ce)}`;const Ne=pe(fe("Windsurf"));h=`windsurf://codeium.windsurf/mcp/install?name=${encodeURIComponent(l)}&config=${encodeURIComponent(Ne)}`;const Se=fe("Claude Code");p=l;let me;e[7]===Symbol.for("react.memo_cache_sentinel")?(me=/'/g,e[7]=me):me=e[7],g=Se.replace(me,"'\\''"),e[0]=n,e[1]=l,e[2]=r,e[3]=d,e[4]=p,e[5]=g,e[6]=h}else r=e[2],d=e[3],p=e[4],g=e[5],h=e[6];const x=`claude mcp add "${p}" --config '${g}'`;let j;e[8]!==r?(j=async()=>{await navigator.clipboard.writeText(r),c(!0),he.success("Configuration copied to clipboard"),setTimeout(()=>c(!1),2e3)},e[8]=r,e[9]=j):j=e[9];const u=j;let A;e[10]===Symbol.for("react.memo_cache_sentinel")?(A=async(ce,de)=>{await navigator.clipboard.writeText(ce),f(de),he.success(`${de} command copied`),setTimeout(()=>f(null),2e3)},e[10]=A):A=e[10];const Y=A,z=qe;let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[11]=y):y=e[11];const le=a?"check":"content_copy";let F;e[12]!==le?(F=t.jsx(P,{name:le,size:14}),e[12]=le,e[13]=F):F=e[13];let T;e[14]!==u||e[15]!==F?(T=t.jsx(H,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:u,children:F})}),e[14]=u,e[15]=F,e[16]=T):T=e[16];let D;e[17]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(K,{children:"Copy configuration"}),e[17]=D):D=e[17];let _;e[18]!==T?(_=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(M,{children:t.jsxs(q,{children:[T,D]})})}),e[18]=T,e[19]=_):_=e[19];let b;e[20]!==r||e[21]!==u?(b=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:u,children:r}),e[20]=r,e[21]=u,e[22]=b):b=e[22];let v;e[23]!==_||e[24]!==b?(v=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[_,b]}),e[23]=_,e[24]=b,e[25]=v):v=e[25];let w;e[26]!==d?(w=()=>z(d),e[26]=d,e[27]=w):w=e[27];let k,V;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%)"}}),V=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[28]=k,e[29]=V):(k=e[28],V=e[29]);let C;e[30]!==w?(C=t.jsx(H,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:w,children:[k,V]})}),e[30]=w,e[31]=C):C=e[31];let G;e[32]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(K,{children:"Add to Cursor"}),e[32]=G):G=e[32];let N;e[33]!==C?(N=t.jsx(M,{children:t.jsxs(q,{children:[C,G]})}),e[33]=C,e[34]=N):N=e[34];let S;e[35]!==x?(S=()=>Y(x,"Claude"),e[35]=x,e[36]=S):S=e[36];let I,$;e[37]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),$=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[37]=I,e[38]=$):(I=e[37],$=e[38]);let E;e[39]!==i?(E=i==="Claude"&&t.jsx(P,{name:"check",size:14,className:"ml-2 text-green-500"}),e[39]=i,e[40]=E):E=e[40];let m;e[41]!==S||e[42]!==E?(m=t.jsx(H,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:S,children:[I,$,E]})}),e[41]=S,e[42]=E,e[43]=m):m=e[43];let U;e[44]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(K,{children:"Add to Claude Code"}),e[44]=U):U=e[44];let R;e[45]!==m?(R=t.jsx(M,{children:t.jsxs(q,{children:[m,U]})}),e[45]=m,e[46]=R):R=e[46];let B;e[47]!==h?(B=()=>z(h),e[47]=h,e[48]=B):B=e[48];let ne,ae;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%)"}}),ae=t.jsx("span",{className:"text-sm font-medium",children:"Windsurf"}),e[49]=ne,e[50]=ae):(ne=e[49],ae=e[50]);let W;e[51]!==B?(W=t.jsx(H,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:B,children:[ne,ae]})}),e[51]=B,e[52]=W):W=e[52];let ie;e[53]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(K,{children:"Add to Windsurf"}),e[53]=ie):ie=e[53];let O;e[54]!==W?(O=t.jsx(M,{children:t.jsxs(q,{children:[W,ie]})}),e[54]=W,e[55]=O):O=e[55];let J;e[56]!==N||e[57]!==R||e[58]!==O?(J=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[N,R,O]}),e[56]=N,e[57]=R,e[58]=O,e[59]=J):J=e[59];let re;return e[60]!==v||e[61]!==J?(re=t.jsxs("div",{className:"flex flex-col gap-4",children:[y,v,J]}),e[60]=v,e[61]=J,e[62]=re):re=e[62],re}function qe(o){window.open(o,"_blank")}const He=$e({title:xe().min(1,"Name is required").max(255),description:xe().nullable(),status:ue(["active","inactive"]),tool_selection_mode:ue(["inclusion","exclusion"]),tool_selection_strategy:ue(["passthrough","smart_tool_selection","code_execution"])});function Ke(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 Qe(o,e){return Object.entries(o).map(([s,n])=>{const a=e.get(s)??[],c=a.length>0&&a.every(i=>n.includes(i));return{connection_id:s,selected_tools:c?null:n}})}function Xe(o){const e=X.c(28),{form:s,toolSet:n,onToolSetChange:a,icon:c}=o;let i;e[0]!==s?(i=s.watch("title")||"Gateway",e[0]=s,e[1]=i):i=e[1];let f;e[2]!==c||e[3]!==i?(f=t.jsx(Ve,{icon:c,name:i,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:"network_node"}),e[2]=c,e[3]=i,e[4]=f):f=e[4];let l;e[5]!==s.control?(l=t.jsx(Z,{control:s.control,name:"status",render:st}),e[5]=s.control,e[6]=l):l=e[6];let r;e[7]!==f||e[8]!==l?(r=t.jsxs("div",{className:"flex items-start justify-between",children:[f,l]}),e[7]=f,e[8]=l,e[9]=r):r=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:tt}),t.jsx(Z,{control:s.control,name:"description",render:et})]}),e[10]=s.control,e[11]=d):d=e[11];let p;e[12]!==r||e[13]!==d?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[r,d]}),e[12]=r,e[13]=d,e[14]=p):p=e[14];let g;e[15]!==s.control?(g=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:Ze}),t.jsx(Z,{control:s.control,name:"tool_selection_strategy",render:Ye})]}),e[15]=s.control,e[16]=g):g=e[16];let h;e[17]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center p-5",children:t.jsx(P,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),e[17]=h):h=e[17];let x;e[18]!==a||e[19]!==n?(x=t.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:t.jsx(ge,{children:t.jsx(Q.Suspense,{fallback:h,children:t.jsx(ze,{toolSet:n,onToolSetChange:a})})})}),e[18]=a,e[19]=n,e[20]=x):x=e[20];let j;e[21]!==p||e[22]!==g||e[23]!==x?(j=t.jsxs("div",{className:"flex flex-col h-full",children:[p,g,x]}),e[21]=p,e[22]=g,e[23]=x,e[24]=j):j=e[24];let u;return e[25]!==s||e[26]!==j?(u=t.jsx(Be,{...s,children:j}),e[25]=s,e[26]=j,e[27]=u):u=e[27],u}function Ye(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(ye,{className:"mb-0",children:"Gateway Strategy"}),t.jsx(M,{children:t.jsxs(q,{children:[t.jsx(H,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(P,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(K,{side:"right",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})})]}),t.jsxs(_e,{value:e.value,onValueChange:e.onChange,children:[t.jsx(se,{children:t.jsx(be,{className:"w-[180px]",children:t.jsx(ve,{})})}),t.jsxs(we,{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 Ze(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(ye,{className:"mb-0",children:"Tool Selection Mode"}),t.jsx(M,{children:t.jsxs(q,{children:[t.jsx(H,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(P,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(K,{side:"right",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected connections/tools are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All connections/tools except selected ones are exposed."]})]})})]})})]}),t.jsxs(_e,{value:e.value,onValueChange:e.onChange,children:[t.jsx(se,{children:t.jsx(be,{className:"w-[180px]",children:t.jsx(ve,{})})}),t.jsxs(we,{children:[t.jsx(ee,{value:"inclusion",children:"Include Selected"}),t.jsx(ee,{value:"exclusion",children:"Exclude Selected"})]})]})]}),t.jsx(oe,{})]})}function et(o){const{field:e}=o;return t.jsxs(te,{className:"w-full space-y-0",children:[t.jsx(se,{children:t.jsx(je,{...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 tt(o){const{field:e}=o;return t.jsxs(te,{className:"w-full space-y-0",children:[t.jsx(se,{children:t.jsx(je,{...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 st(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(Re,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(oe,{})]})}function ot(o){const e=X.c(53),{gateway:s,gatewayId:n}=o,a=Ee(),c=Ue();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const f=De(i);let l;if(e[1]!==f){l=new Map;for(const m of f)m.tools&&m.tools.length>0&&l.set(m.id,m.tools.map(lt));e[1]=f,e[2]=l}else l=e[2];let r;e[3]!==l||e[4]!==s?(r=()=>Ke(s,l),e[3]=l,e[4]=s,e[5]=r):r=e[5];const[d,p]=Q.useState(r),[g,h]=Q.useState(!1);let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=m=>{p(m),h(!0)},e[6]=x):x=e[6];const j=x;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=Fe(He),e[7]=u):u=e[7];const A=s.tool_selection_mode??"inclusion",Y=s.tool_selection_strategy??"passthrough";let z;e[8]!==s.description||e[9]!==s.status||e[10]!==s.title||e[11]!==A||e[12]!==Y?(z={resolver:u,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:A,tool_selection_strategy:Y}},e[8]=s.description,e[9]=s.status,e[10]=s.title,e[11]=A,e[12]=Y,e[13]=z):z=e[13];const y=Ge(z),F=y.formState.isDirty||g;let T;e[14]!==c.update||e[15]!==l||e[16]!==y||e[17]!==n||e[18]!==d?(T=async()=>{const m=y.getValues(),U=Qe(d,l);await c.update.mutateAsync({id:n,data:{title:m.title,description:m.description,status:m.status,tool_selection_mode:m.tool_selection_mode,tool_selection_strategy:m.tool_selection_strategy,connections:U}}),y.reset(m),h(!1)},e[14]=c.update,e[15]=l,e[16]=y,e[17]=n,e[18]=d,e[19]=T):T=e[19];const D=T;let _;e[20]!==a.history?(_=()=>a.history.back(),e[20]=a.history,e[21]=_):_=e[21];let b;e[22]!==c.update.isPending||e[23]!==D||e[24]!==F?(b=F&&t.jsxs(L,{onClick:D,disabled:c.update.isPending,size:"sm",className:"h-7",children:[c.update.isPending&&t.jsx(P,{name:"progress_activity",size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[22]=c.update.isPending,e[23]=D,e[24]=F,e[25]=b):b=e[25];let v;e[26]!==b?(v=t.jsx(Oe,{children:b}),e[26]=b,e[27]=v):v=e[27];let w;e[28]!==y||e[29]!==s.icon||e[30]!==d?(w=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(Xe,{form:y,toolSet:d,onToolSetChange:j,icon:s.icon})}),e[28]=y,e[29]=s.icon,e[30]=d,e[31]=w):w=e[31];let k;e[32]!==s.id||e[33]!==s.title?(k=s.title||`gateway-${s.id.slice(0,8)}`,e[32]=s.id,e[33]=s.title,e[34]=k):k=e[34];const V=`${window.location.origin}/mcp/gateway/${s.id}`;let C;e[35]!==k||e[36]!==V?(C=t.jsx("div",{className:"p-5",children:t.jsx(Me,{serverName:k,gatewayUrl:V})}),e[35]=k,e[36]=V,e[37]=C):C=e[37];let G;e[38]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[38]=G):G=e[38];let N;e[39]!==s.updated_at?(N=s.updated_at?Le(new Date(s.updated_at),{addSuffix:!1}):"Unknown",e[39]=s.updated_at,e[40]=N):N=e[40];let S;e[41]!==N?(S=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[G,t.jsx("span",{className:"font-mono text-sm uppercase text-muted-foreground",children:N})]}),e[41]=N,e[42]=S):S=e[42];let I;e[43]!==C||e[44]!==S?(I=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[C,S]}),e[43]=C,e[44]=S,e[45]=I):I=e[45];let $;e[46]!==w||e[47]!==I?($=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[w,I]}),e[46]=w,e[47]=I,e[48]=$):$=e[48];let E;return e[49]!==v||e[50]!==$||e[51]!==_?(E=t.jsxs(Je,{onBack:_,children:[v,$]}),e[49]=v,e[50]=$,e[51]=_,e[52]=E):E=e[52],E}function lt(o){return o.name}function nt(){const o=X.c(8);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=ke(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:c}=Ie(n),i=Pe(a);if(!i){let l;return o[2]!==s||o[3]!==c?(l=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(L,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:c}}),children:"Back to gateways"})})}),o[2]=s,o[3]=c,o[4]=l):l=o[4],l}let f;return o[5]!==i||o[6]!==a?(f=t.jsx(ot,{gateway:i,gatewayId:a}),o[5]=i,o[6]=a,o[7]=f):f=o[7],f}function at(){const o=X.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ge,{children:t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(P,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(nt,{})})}),o[0]=e):e=o[0],e}function St(){const o=X.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(at,{}),o[0]=e):e=o[0],e}export{St as default};
@@ -1 +0,0 @@
1
- import{c as Y,j as t,r as Z,a5 as te,a6 as se}from"./index-DRfRtuak.js";import{C as oe}from"./collection-header-DZSYSGOn.js";import{C as ae}from"./collection-page-Cfda-vNl.js";import{C as ne}from"./collection-search-DxeL6Ufp.js";import{C as re}from"./collection-table-wrapper-D6eaPdiL.js";import{C as ie}from"./connection-card-DBDfkDQH.js";import{E as q}from"./empty-state-CAhQEGD4.js";import{E as le}from"./error-boundary-CKkz6PFv.js";import{b as ce,I as de}from"./integration-icon-BOIQGbTx.js";import{a as me,u as ue}from"./use-gateway-D3gYh1VN.js";import{u as ge}from"./use-list-state-C1uU-z8t.js";import{u as pe}from"./tooltip-7pBEiiqV.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-CfsdbV8c.js";import{B as ee}from"./badge-BTXir9uJ.js";import{B as J}from"./button-B2BIOawN.js";import{b as Q,D as U,a as X,c as B}from"./dropdown-menu-BT_X0ZTy.js";import{I as i}from"./icon-B4prTi7A.js";import"./collection-display-button-DEnVk52I.js";import"./utils-DFmxvpl9.js";import"./input-0KxSy7p5.js";import"./card-B24qMCfe.js";import"./use-mobile-qq-CGCwC.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=me(),w=ue(s);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={},e[2]=j):j=e[2];const R=ce(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",wrap:!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(de,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:"network_node"})}function ot(){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{ot as default};