@decocms/mesh 1.0.0-alpha.35 → 1.0.0-alpha.37

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 (145) hide show
  1. package/dist/client/assets/{AlertCircle-VUVelpvY.js → AlertCircle-FgA4OE_Y.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-B4oC_h6K.js → ArrowLeft-DZ8Qhlyz.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DH6YWObN.js → CheckCircle-D9-mPjW-.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-CLC0yxsk.js → ChevronDown-CRpCA4eQ.js} +1 -1
  5. package/dist/client/assets/{Clock-CUnbQKPM.js → Clock-9Ud3hYi_.js} +1 -1
  6. package/dist/client/assets/{Copy01-vEIIJ5sE.js → Copy01-DGZy8_Wa.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-Ckd82HIH.js → CpuChip02-9xkDTOQm.js} +1 -1
  8. package/dist/client/assets/DotsVertical-7BehxNIr.js +1 -0
  9. package/dist/client/assets/{File06-sb4CceKn.js → File06-JZRzMAbM.js} +1 -1
  10. package/dist/client/assets/Grid01-CKvZ5Bgj.js +1 -0
  11. package/dist/client/assets/{Inbox01-CJr3WKtd.js → Inbox01-Q7OGuD8_.js} +1 -1
  12. package/dist/client/assets/{InfoCircle-BBnXokyi.js → InfoCircle-ZmqIswrk.js} +1 -1
  13. package/dist/client/assets/{Key01-BUTMet0-.js → Key01-Cc974JWF.js} +1 -1
  14. package/dist/client/assets/{LinkExternal01-jU0XrMVD.js → LinkExternal01-0ybSN01c.js} +1 -1
  15. package/dist/client/assets/{Loading01-Dp6sT3Mq.js → Loading01-BpGj_YCN.js} +1 -1
  16. package/dist/client/assets/{Plus-LcofPC9C.js → Plus-BS5hPXY3.js} +1 -1
  17. package/dist/client/assets/{SearchMd-3u9z3FIP.js → SearchMd-BbbPnMSd.js} +1 -1
  18. package/dist/client/assets/Trash01-DtIQgapG.js +1 -0
  19. package/dist/client/assets/{Upload01-Bxain8td.js → Upload01-Zx3GirGx.js} +1 -1
  20. package/dist/client/assets/{X-Bo13gg4P.js → X-CYjj99XI.js} +1 -1
  21. package/dist/client/assets/{ChevronRight-YHVS_LDJ.js → XClose-BDRe0Ozk.js} +1 -1
  22. package/dist/client/assets/{alert-dialog-yp0b0MDg.js → alert-dialog-Bj94Mg43.js} +3 -3
  23. package/dist/client/assets/auth-CbkV4JhC.js +1 -0
  24. package/dist/client/assets/{auth-catchall-VFRahgSj.js → auth-catchall-pG3jhayZ.js} +1 -1
  25. package/dist/client/assets/avatar-DQuAu06W.js +1 -0
  26. package/dist/client/assets/badge-B6NR5xty.js +1 -0
  27. package/dist/client/assets/button-WA21TIge.js +1 -0
  28. package/dist/client/assets/{card-BeaxjjFM.js → card-fnco2BKy.js} +1 -1
  29. package/dist/client/assets/{checkbox-BO8-3DdS.js → checkbox-Bq4Db1eq.js} +1 -1
  30. package/dist/client/assets/collection-detail-C45JavW1.js +1 -0
  31. package/dist/client/assets/collection-display-button-CJgVNUjG.js +1 -0
  32. package/dist/client/assets/{collection-header-LJs-cTFu.js → collection-header-COdYt0yo.js} +1 -1
  33. package/dist/client/assets/{collection-page-QhbCfH_v.js → collection-page-IZEjeZDJ.js} +1 -1
  34. package/dist/client/assets/collection-search-Dh2zcE6Z.js +1 -0
  35. package/dist/client/assets/collection-table-wrapper-DOiiwQBc.js +1 -0
  36. package/dist/client/assets/{connection-card-BQ92NHJ6.js → connection-card-P2DYTKtD.js} +1 -1
  37. package/dist/client/assets/connection-detail-2kY4jzvr.js +1 -0
  38. package/dist/client/assets/connections-CfReLX9R.js +1 -0
  39. package/dist/client/assets/{core-BUY47BFk.js → core-Bsa-CClQ.js} +1 -1
  40. package/dist/client/assets/create-organization-dialog-DjEf_yPL.js +1 -0
  41. package/dist/client/assets/deco-chat-skeleton-YKru_-uq.js +124 -0
  42. package/dist/client/assets/dialog-CzRcLMrO.js +1 -0
  43. package/dist/client/assets/dropdown-menu-lNp795nL.js +1 -0
  44. package/dist/client/assets/{error-boundary-CBpLdCwg.js → error-boundary-D10vdRO6.js} +1 -1
  45. package/dist/client/assets/{extract-connection-data-DNQ4aWdY.js → extract-connection-data-CnaW3oDd.js} +1 -1
  46. package/dist/client/assets/form-BUVsmabM.js +1 -0
  47. package/dist/client/assets/gateway-detail-DxVWCOGY.js +1 -0
  48. package/dist/client/assets/gateways-BDUTpLoJ.js +1 -0
  49. package/dist/client/assets/home-DcAStJkG.js +1 -0
  50. package/dist/client/assets/{index-CQXdtGjW.js → index-B3MiP_oE.js} +15 -15
  51. package/dist/client/assets/{index-Dbugj1Qf.js → index-BWMTgSpJ.js} +23 -23
  52. package/dist/client/assets/index-DXIf5jrv.js +1 -0
  53. package/dist/client/assets/index-DiIfEFEx.js +1 -0
  54. package/dist/client/assets/index-LtFisB9d.css +1 -0
  55. package/dist/client/assets/{input-BWvhkgtS.js → input-C8ckt9pD.js} +1 -1
  56. package/dist/client/assets/json-DgiEbznW.js +1 -0
  57. package/dist/client/assets/json-syntax-highlighter-DqTOcqS4.js +2 -0
  58. package/dist/client/assets/{layout-CX25ELhh.js → layout-Ddw5vi1_.js} +1 -1
  59. package/dist/client/assets/{lazy-highlighter-CYdbIXwO.js → lazy-highlighter-D0ldRF_z.js} +1 -1
  60. package/dist/client/assets/localstorage-keys-C__QKrnP.js +1 -0
  61. package/dist/client/assets/{login-BGPiojdD.js → login-Bfuntl4G.js} +1 -1
  62. package/dist/client/assets/{mcp-oauth-jtPwlXEu.js → mcp-oauth-BeGFsv5e.js} +1 -1
  63. package/dist/client/assets/members-DsJnPzlW.js +3 -0
  64. package/dist/client/assets/monitoring-C4ZUhICh.js +1 -0
  65. package/dist/client/assets/{oauth-callback-W0Zj4QZg.js → oauth-callback-rQDuS0Y4.js} +1 -1
  66. package/dist/client/assets/{page-B1COFi93.js → page-CEwSU962.js} +2 -2
  67. package/dist/client/assets/popover-BSAaObMv.js +1 -0
  68. package/dist/client/assets/prism-light-BGWrXuVI.js +1 -0
  69. package/dist/client/assets/resource-tabs-TaJMxN6_.js +1 -0
  70. package/dist/client/assets/schema-B3tkq8IT.js +1 -0
  71. package/dist/client/assets/select-DQatPXKJ.js +1 -0
  72. package/dist/client/assets/settings-DIHeOoHX.js +1 -0
  73. package/dist/client/assets/shell-layout-D1irgz1e.js +1 -0
  74. package/dist/client/assets/spinner-DD8NRDSP.js +1 -0
  75. package/dist/client/assets/store-BlitdGFv.js +1 -0
  76. package/dist/client/assets/store-app-detail-C3gtVQGX.js +1 -0
  77. package/dist/client/assets/switch-BLTM21B0.js +1 -0
  78. package/dist/client/assets/{textarea-GonRChaT.js → textarea-OUcFAiZD.js} +1 -1
  79. package/dist/client/assets/tooltip-Dy-DsVOX.js +1 -0
  80. package/dist/client/assets/types-Be8keXIM.js +44 -0
  81. package/dist/client/assets/use-binding-pAqGO8UI.js +5 -0
  82. package/dist/client/assets/use-connection-Lp9rwnx7.js +2 -0
  83. package/dist/client/assets/use-gateway-C0GNG4JP.js +1 -0
  84. package/dist/client/assets/{use-list-state-DTFI-io6.js → use-list-state-BxKaK11n.js} +1 -1
  85. package/dist/client/assets/use-mcp-ClY7_5dz.js +1 -0
  86. package/dist/client/assets/use-members-4V3USNhz.js +1 -0
  87. package/dist/client/assets/{use-mobile-BAgI68xi.js → use-mobile-k1X2THZ9.js} +1 -1
  88. package/dist/client/assets/use-organization-settings-CMytLZst.js +1 -0
  89. package/dist/client/assets/use-tool-call-z8Rn6Gss.js +1 -0
  90. package/dist/client/assets/useQuery-CdGzN_Sp.js +1 -0
  91. package/dist/client/assets/utils-CvrJmBA1.js +1 -0
  92. package/dist/client/assets/{well-known-mcp-D-VmC-4r.js → well-known-mcp-CjKrCZkD.js} +1 -1
  93. package/dist/client/index.html +2 -2
  94. package/dist/server/cli.js +242 -232
  95. package/dist/server/migrate.js +72 -72
  96. package/dist/server/server.js +198 -188
  97. package/package.json +4 -2
  98. package/dist/client/assets/Trash01-CNckizo2.js +0 -1
  99. package/dist/client/assets/auth-C8rltTUE.js +0 -1
  100. package/dist/client/assets/avatar-i3GM_9o4.js +0 -1
  101. package/dist/client/assets/badge-gmsvp75V.js +0 -1
  102. package/dist/client/assets/button-eIETQb0Y.js +0 -1
  103. package/dist/client/assets/collection-detail-B-fRum6Q.js +0 -1
  104. package/dist/client/assets/collection-display-button--hU2cKng.js +0 -1
  105. package/dist/client/assets/collection-search-uhjPIekp.js +0 -1
  106. package/dist/client/assets/collection-table-wrapper-DqGkk2i2.js +0 -1
  107. package/dist/client/assets/connection-detail-Doa-5y7y.js +0 -1
  108. package/dist/client/assets/connections-CKgEGrXv.js +0 -1
  109. package/dist/client/assets/create-organization-dialog-ELVAlnoy.js +0 -1
  110. package/dist/client/assets/dialog-BNPGtupv.js +0 -1
  111. package/dist/client/assets/dropdown-menu-DKiYuSii.js +0 -1
  112. package/dist/client/assets/form-B0VrU06h.js +0 -1
  113. package/dist/client/assets/gateway-detail-CHVOIkdN.js +0 -1
  114. package/dist/client/assets/gateways-CYwdvgYO.js +0 -1
  115. package/dist/client/assets/home-CEeMX4S7.js +0 -1
  116. package/dist/client/assets/index-BxZYaQlu.css +0 -1
  117. package/dist/client/assets/index-CF_OPzOB.js +0 -1
  118. package/dist/client/assets/index-qnfTBZZC.js +0 -1
  119. package/dist/client/assets/json-CdX173bs.js +0 -1
  120. package/dist/client/assets/localstorage-keys-7rhieZF2.js +0 -1
  121. package/dist/client/assets/members--_b0JG9-.js +0 -3
  122. package/dist/client/assets/monitoring-DQbjjkaJ.js +0 -1
  123. package/dist/client/assets/popover-Cyo3vdtr.js +0 -1
  124. package/dist/client/assets/prism-light-Dkb0faFA.js +0 -1
  125. package/dist/client/assets/resource-tabs-DMxDPvak.js +0 -1
  126. package/dist/client/assets/schema-CcVe4fys.js +0 -1
  127. package/dist/client/assets/select-BoIpHU2H.js +0 -1
  128. package/dist/client/assets/settings-DjDQwsDk.js +0 -1
  129. package/dist/client/assets/shell-layout-t3dkCYaC.js +0 -124
  130. package/dist/client/assets/spinner-BgLCN9p1.js +0 -1
  131. package/dist/client/assets/store-D8WGhqyG.js +0 -1
  132. package/dist/client/assets/store-app-detail-BaZsMlnc.js +0 -1
  133. package/dist/client/assets/switch-nOTvNKSU.js +0 -1
  134. package/dist/client/assets/tool-set-selector-BbP0pfb9.js +0 -1
  135. package/dist/client/assets/tooltip-C_Is8XE4.js +0 -1
  136. package/dist/client/assets/types-Kjt4sgIB.js +0 -45
  137. package/dist/client/assets/use-binding-FqyuxtmF.js +0 -5
  138. package/dist/client/assets/use-connection-BcR9UFbs.js +0 -2
  139. package/dist/client/assets/use-gateway-DARIvLcH.js +0 -1
  140. package/dist/client/assets/use-mcp-BHfi5-go.js +0 -1
  141. package/dist/client/assets/use-members-C4kUxhI6.js +0 -1
  142. package/dist/client/assets/use-organization-settings-Bdum0zz2.js +0 -1
  143. package/dist/client/assets/use-tool-call-rEALkXUX.js +0 -1
  144. package/dist/client/assets/useQuery-BrB4rOUi.js +0 -1
  145. package/dist/client/assets/utils-C9RgqtL7.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "1.0.0-alpha.35",
3
+ "version": "1.0.0-alpha.37",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "license": "MIT",
6
6
  "author": "Deco team",
@@ -37,9 +37,11 @@
37
37
  "dependencies": {
38
38
  "@ai-sdk/mcp": "^1.0.0",
39
39
  "@untitledui/icons": "^0.0.19",
40
+ "@jitl/quickjs-wasmfile-release-sync": "^0.31.0",
40
41
  "@xyflow/react": "^12.10.0",
41
42
  "kysely": "^0.28.8",
42
- "kysely-bun-worker": "^0.6.0"
43
+ "kysely-bun-worker": "^0.6.0",
44
+ "quickjs-emscripten-core": "^0.31.0"
43
45
  },
44
46
  "devDependencies": {
45
47
  "@ai-sdk/provider": "^3.0.0",
@@ -1 +0,0 @@
1
- import{r as t}from"./index-Dbugj1Qf.js";const a=({size:e=24,color:r="currentColor",...o})=>t.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},t.createElement("path",{d:"M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0-7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));a.displayName="DotsVertical";const i=({size:e=24,color:r="currentColor",...o})=>t.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},t.createElement("path",{d:"M16 6v-.8c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C14.48 2 13.92 2 12.8 2h-1.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C8 3.52 8 4.08 8 5.2V6m2 5.5v5m4-5v5M3 6h18m-2 0v11.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C16.72 22 15.88 22 14.2 22H9.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C5 19.72 5 18.88 5 17.2V6"}));i.displayName="Trash01";export{a as i,i as s};
@@ -1 +0,0 @@
1
- import{bF as y,aq as t,bG as f,ap as r,c4 as n,bC as u,bz as O,aE as i,aG as _,aF as I,by as k,c5 as $e,c6 as Ve,c7 as He,bE as De}from"./index-Dbugj1Qf.js";const ae="2025-06-18",xo=[ae,"2025-03-26","2024-11-05","2024-10-07"],$="2.0",fe=y([t(),f().int()]),we=t(),Je=r({progressToken:n(fe)}).passthrough(),x=r({_meta:n(Je)}).passthrough(),S=r({method:t(),params:n(x)}),q=r({_meta:n(r({}).passthrough())}).passthrough(),P=r({method:t(),params:n(q)}),C=r({_meta:n(r({}).passthrough())}).passthrough(),V=y([t(),f().int()]),Re=r({jsonrpc:u($),id:V}).merge(S).strict(),Co=e=>Re.safeParse(e).success,ye=r({jsonrpc:u($)}).merge(P).strict(),To=e=>ye.safeParse(e).success,Se=r({jsonrpc:u($),id:V,result:C}).strict(),Po=e=>Se.safeParse(e).success;var me;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"})(me||(me={}));const ve=r({jsonrpc:u($),id:V,error:r({code:f().int(),message:t(),data:n(O())})}).strict(),bo=e=>ve.safeParse(e).success,ko=y([Re,ye,Se,ve]),xe=C.strict(),Ce=P.extend({method:u("notifications/cancelled"),params:q.extend({requestId:V,reason:t().optional()})}),We=r({src:t(),mimeType:n(t()),sizes:n(i(t()))}).passthrough(),A=r({icons:i(We).optional()}).passthrough(),M=r({name:t(),title:n(t())}).passthrough(),Te=M.extend({version:t(),websiteUrl:n(t())}).merge(A),Be=r({experimental:n(r({}).passthrough()),sampling:n(r({}).passthrough()),elicitation:n(r({}).passthrough()),roots:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ge=S.extend({method:u("initialize"),params:x.extend({protocolVersion:t(),capabilities:Be,clientInfo:Te})}),Ze=r({experimental:n(r({}).passthrough()),logging:n(r({}).passthrough()),completions:n(r({}).passthrough()),prompts:n(r({listChanged:n(_())}).passthrough()),resources:n(r({subscribe:n(_()),listChanged:n(_())}).passthrough()),tools:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ye=C.extend({protocolVersion:t(),capabilities:Ze,serverInfo:Te,instructions:n(t())}),Pe=P.extend({method:u("notifications/initialized")}),Uo=e=>Pe.safeParse(e).success,be=S.extend({method:u("ping")}),Ke=r({progress:f(),total:n(f()),message:n(t())}).passthrough(),ke=P.extend({method:u("notifications/progress"),params:q.merge(Ke).extend({progressToken:fe})}),H=S.extend({params:x.extend({cursor:n(we)}).optional()}),D=C.extend({nextCursor:n(we)}),Ue=r({uri:t(),mimeType:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Le=Ue.extend({text:t()}),ie=t().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ee=Ue.extend({blob:ie}),Oe=M.extend({uri:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Qe=M.extend({uriTemplate:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Xe=H.extend({method:u("resources/list")}),Fe=D.extend({resources:i(Oe)}),et=H.extend({method:u("resources/templates/list")}),tt=D.extend({resourceTemplates:i(Qe)}),ot=S.extend({method:u("resources/read"),params:x.extend({uri:t()})}),nt=C.extend({contents:i(y([Le,Ee]))}),st=P.extend({method:u("notifications/resources/list_changed")}),rt=S.extend({method:u("resources/subscribe"),params:x.extend({uri:t()})}),at=S.extend({method:u("resources/unsubscribe"),params:x.extend({uri:t()})}),it=P.extend({method:u("notifications/resources/updated"),params:q.extend({uri:t()})}),ct=r({name:t(),description:n(t()),required:n(_())}).passthrough(),ut=M.extend({description:n(t()),arguments:n(i(ct)),_meta:n(r({}).passthrough())}).merge(A),lt=H.extend({method:u("prompts/list")}),pt=D.extend({prompts:i(ut)}),dt=S.extend({method:u("prompts/get"),params:x.extend({name:t(),arguments:n(I(t()))})}),ce=r({type:u("text"),text:t(),_meta:n(r({}).passthrough())}).passthrough(),ue=r({type:u("image"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),le=r({type:u("audio"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),ht=r({type:u("resource"),resource:y([Le,Ee]),_meta:n(r({}).passthrough())}).passthrough(),mt=Oe.extend({type:u("resource_link")}),Ie=y([ce,ue,le,mt,ht]),_t=r({role:k(["user","assistant"]),content:Ie}).passthrough(),gt=C.extend({description:n(t()),messages:i(_t)}),ft=P.extend({method:u("notifications/prompts/list_changed")}),wt=r({title:n(t()),readOnlyHint:n(_()),destructiveHint:n(_()),idempotentHint:n(_()),openWorldHint:n(_())}).passthrough(),Rt=M.extend({description:n(t()),inputSchema:r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough(),outputSchema:n(r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough()),annotations:n(wt),_meta:n(r({}).passthrough())}).merge(A),yt=H.extend({method:u("tools/list")}),St=D.extend({tools:i(Rt)}),qe=C.extend({content:i(Ie).default([]),structuredContent:r({}).passthrough().optional(),isError:n(_())});qe.or(C.extend({toolResult:O()}));const vt=S.extend({method:u("tools/call"),params:x.extend({name:t(),arguments:n(I(O()))})}),xt=P.extend({method:u("notifications/tools/list_changed")}),Ae=k(["debug","info","notice","warning","error","critical","alert","emergency"]),Ct=S.extend({method:u("logging/setLevel"),params:x.extend({level:Ae})}),Tt=P.extend({method:u("notifications/message"),params:q.extend({level:Ae,logger:n(t()),data:O()})}),Pt=r({name:t().optional()}).passthrough(),bt=r({hints:n(i(Pt)),costPriority:n(f().min(0).max(1)),speedPriority:n(f().min(0).max(1)),intelligencePriority:n(f().min(0).max(1))}).passthrough(),kt=r({role:k(["user","assistant"]),content:y([ce,ue,le])}).passthrough(),Ut=S.extend({method:u("sampling/createMessage"),params:x.extend({messages:i(kt),systemPrompt:n(t()),includeContext:n(k(["none","thisServer","allServers"])),temperature:n(f()),maxTokens:f().int(),stopSequences:n(i(t())),metadata:n(r({}).passthrough()),modelPreferences:n(bt)})}),Lt=C.extend({model:t(),stopReason:n(k(["endTurn","stopSequence","maxTokens"]).or(t())),role:k(["user","assistant"]),content:$e("type",[ce,ue,le])}),Et=r({type:u("boolean"),title:n(t()),description:n(t()),default:n(_())}).passthrough(),Ot=r({type:u("string"),title:n(t()),description:n(t()),minLength:n(f()),maxLength:n(f()),format:n(k(["email","uri","date","date-time"]))}).passthrough(),It=r({type:k(["number","integer"]),title:n(t()),description:n(t()),minimum:n(f()),maximum:n(f())}).passthrough(),qt=r({type:u("string"),title:n(t()),description:n(t()),enum:i(t()),enumNames:n(i(t()))}).passthrough(),At=y([Et,Ot,It,qt]),Mt=S.extend({method:u("elicitation/create"),params:x.extend({message:t(),requestedSchema:r({type:u("object"),properties:I(t(),At),required:n(i(t()))}).passthrough()})}),Nt=C.extend({action:k(["accept","decline","cancel"]),content:n(I(t(),O()))}),jt=r({type:u("ref/resource"),uri:t()}).passthrough(),zt=r({type:u("ref/prompt"),name:t()}).passthrough(),$t=S.extend({method:u("completion/complete"),params:x.extend({ref:y([zt,jt]),argument:r({name:t(),value:t()}).passthrough(),context:n(r({arguments:n(I(t(),t()))}))})}),Vt=C.extend({completion:r({values:i(t()).max(100),total:n(f().int()),hasMore:n(_())}).passthrough()}),Ht=r({uri:t().startsWith("file://"),name:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Dt=S.extend({method:u("roots/list")}),Jt=C.extend({roots:i(Ht)}),Wt=P.extend({method:u("notifications/roots/list_changed")});y([be,Ge,$t,Ct,dt,lt,Xe,et,ot,rt,at,vt,yt]);y([Ce,ke,Pe,Wt]);y([xe,Lt,Nt,Jt]);y([be,Ut,Mt,Dt]);y([Ce,ke,Tt,it,st,xt,ft]);y([xe,Ye,Vt,gt,pt,Fe,tt,nt,qe,St]);class Lo extends Error{constructor(o,a,s){super(`MCP error ${o}: ${a}`),this.code=o,this.data=s,this.name="McpError"}}let pe;pe=globalThis.crypto;async function Bt(e){return(await pe).getRandomValues(new Uint8Array(e))}async function Gt(e){const o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",a=Math.pow(2,8)-Math.pow(2,8)%o.length;let s="";for(;s.length<e;){const c=await Bt(e-s.length);for(const p of c)p<a&&(s+=o[p%o.length])}return s}async function Zt(e){return await Gt(e)}async function Yt(e){const o=await(await pe).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(o))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Kt(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const o=await Zt(e),a=await Yt(o);return{code_verifier:o,code_challenge:a}}const w=t().url().superRefine((e,o)=>{if(!URL.canParse(e))return o.addIssue({code:Ve.custom,message:"URL must be parseable",fatal:!0}),He}).refine(e=>{const o=new URL(e);return o.protocol!=="javascript:"&&o.protocol!=="data:"&&o.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Qt=r({resource:t().url(),authorization_servers:i(w).optional(),jwks_uri:t().url().optional(),scopes_supported:i(t()).optional(),bearer_methods_supported:i(t()).optional(),resource_signing_alg_values_supported:i(t()).optional(),resource_name:t().optional(),resource_documentation:t().optional(),resource_policy_uri:t().url().optional(),resource_tos_uri:t().url().optional(),tls_client_certificate_bound_access_tokens:_().optional(),authorization_details_types_supported:i(t()).optional(),dpop_signing_alg_values_supported:i(t()).optional(),dpop_bound_access_tokens_required:_().optional()}).passthrough(),Me=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),service_documentation:w.optional(),revocation_endpoint:w.optional(),revocation_endpoint_auth_methods_supported:i(t()).optional(),revocation_endpoint_auth_signing_alg_values_supported:i(t()).optional(),introspection_endpoint:t().optional(),introspection_endpoint_auth_methods_supported:i(t()).optional(),introspection_endpoint_auth_signing_alg_values_supported:i(t()).optional(),code_challenge_methods_supported:i(t()).optional()}).passthrough(),Xt=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,userinfo_endpoint:w.optional(),jwks_uri:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),acr_values_supported:i(t()).optional(),subject_types_supported:i(t()),id_token_signing_alg_values_supported:i(t()),id_token_encryption_alg_values_supported:i(t()).optional(),id_token_encryption_enc_values_supported:i(t()).optional(),userinfo_signing_alg_values_supported:i(t()).optional(),userinfo_encryption_alg_values_supported:i(t()).optional(),userinfo_encryption_enc_values_supported:i(t()).optional(),request_object_signing_alg_values_supported:i(t()).optional(),request_object_encryption_alg_values_supported:i(t()).optional(),request_object_encryption_enc_values_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),display_values_supported:i(t()).optional(),claim_types_supported:i(t()).optional(),claims_supported:i(t()).optional(),service_documentation:t().optional(),claims_locales_supported:i(t()).optional(),ui_locales_supported:i(t()).optional(),claims_parameter_supported:_().optional(),request_parameter_supported:_().optional(),request_uri_parameter_supported:_().optional(),require_request_uri_registration:_().optional(),op_policy_uri:w.optional(),op_tos_uri:w.optional()}).passthrough(),Ft=Xt.merge(Me.pick({code_challenge_methods_supported:!0})),Ne=r({access_token:t(),id_token:t().optional(),token_type:t(),expires_in:f().optional(),scope:t().optional(),refresh_token:t().optional()}).strip(),eo=r({error:t(),error_description:t().optional(),error_uri:t().optional()}),_e=w.optional().or(u("").transform(()=>{})),to=r({redirect_uris:i(w),token_endpoint_auth_method:t().optional(),grant_types:i(t()).optional(),response_types:i(t()).optional(),client_name:t().optional(),client_uri:w.optional(),logo_uri:_e,scope:t().optional(),contacts:i(t()).optional(),tos_uri:_e,policy_uri:t().optional(),jwks_uri:w.optional(),jwks:De().optional(),software_id:t().optional(),software_version:t().optional(),software_statement:t().optional()}).strip(),oo=r({client_id:t(),client_secret:t().optional(),client_id_issued_at:f().optional(),client_secret_expires_at:f().optional()}).strip(),no=to.merge(oo);r({error:t(),error_description:t().optional()}).strip();r({token:t(),token_type_hint:t().optional()}).strip();function so(e){const o=typeof e=="string"?new URL(e):new URL(e.href);return o.hash="",o}function ro({requestedResource:e,configuredResource:o}){const a=typeof e=="string"?new URL(e):new URL(e.href),s=typeof o=="string"?new URL(o):new URL(o.href);if(a.origin!==s.origin||a.pathname.length<s.pathname.length)return!1;const c=a.pathname.endsWith("/")?a.pathname:a.pathname+"/",p=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return c.startsWith(p)}class R extends Error{constructor(o,a){super(o),this.errorUri=a,this.name=this.constructor.name}toResponseObject(){const o={error:this.errorCode,error_description:this.message};return this.errorUri&&(o.error_uri=this.errorUri),o}get errorCode(){return this.constructor.errorCode}}class Z extends R{}Z.errorCode="invalid_request";class N extends R{}N.errorCode="invalid_client";class j extends R{}j.errorCode="invalid_grant";class z extends R{}z.errorCode="unauthorized_client";class Y extends R{}Y.errorCode="unsupported_grant_type";class K extends R{}K.errorCode="invalid_scope";class Q extends R{}Q.errorCode="access_denied";class E extends R{}E.errorCode="server_error";class X extends R{}X.errorCode="temporarily_unavailable";class F extends R{}F.errorCode="unsupported_response_type";class ee extends R{}ee.errorCode="unsupported_token_type";class te extends R{}te.errorCode="invalid_token";class oe extends R{}oe.errorCode="method_not_allowed";class ne extends R{}ne.errorCode="too_many_requests";class se extends R{}se.errorCode="invalid_client_metadata";class re extends R{}re.errorCode="insufficient_scope";const ao={[Z.errorCode]:Z,[N.errorCode]:N,[j.errorCode]:j,[z.errorCode]:z,[Y.errorCode]:Y,[K.errorCode]:K,[Q.errorCode]:Q,[E.errorCode]:E,[X.errorCode]:X,[F.errorCode]:F,[ee.errorCode]:ee,[te.errorCode]:te,[oe.errorCode]:oe,[ne.errorCode]:ne,[se.errorCode]:se,[re.errorCode]:re};class Eo extends Error{constructor(o){super(o??"Unauthorized")}}const W="code",B="S256";function je(e,o){const a=e.client_secret!==void 0;return o.length===0?a?"client_secret_post":"none":a&&o.includes("client_secret_basic")?"client_secret_basic":a&&o.includes("client_secret_post")?"client_secret_post":o.includes("none")?"none":a?"client_secret_post":"none"}function ze(e,o,a,s){const{client_id:c,client_secret:p}=o;switch(e){case"client_secret_basic":io(c,p,a);return;case"client_secret_post":co(c,p,s);return;case"none":uo(c,s);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function io(e,o,a){if(!o)throw new Error("client_secret_basic authentication requires a client_secret");const s=btoa(`${e}:${o}`);a.set("Authorization",`Basic ${s}`)}function co(e,o,a){a.set("client_id",e),o&&a.set("client_secret",o)}function uo(e,o){o.set("client_id",e)}async function de(e){const o=e instanceof Response?e.status:void 0,a=e instanceof Response?await e.text():e;try{const s=eo.parse(JSON.parse(a)),{error:c,error_description:p,error_uri:d}=s,l=ao[c]||E;return new l(p||"",d)}catch(s){const c=`${o?`HTTP ${o}: `:""}Invalid OAuth error response: ${s}. Raw body: ${a}`;return new E(c)}}async function Oo(e,o){var a,s;try{return await G(e,o)}catch(c){if(c instanceof N||c instanceof z)return await((a=e.invalidateCredentials)===null||a===void 0?void 0:a.call(e,"all")),await G(e,o);if(c instanceof j)return await((s=e.invalidateCredentials)===null||s===void 0?void 0:s.call(e,"tokens")),await G(e,o);throw c}}async function G(e,{serverUrl:o,authorizationCode:a,scope:s,resourceMetadataUrl:c,fetchFn:p}){let d,l;try{d=await po(o,{resourceMetadataUrl:c},p),d.authorization_servers&&d.authorization_servers.length>0&&(l=d.authorization_servers[0])}catch{}l||(l=o);const h=await lo(o,e,d),g=await fo(l,{fetchFn:p});let m=await Promise.resolve(e.clientInformation());if(!m){if(a!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const v=await So(l,{metadata:g,clientMetadata:e.clientMetadata,fetchFn:p});await e.saveClientInformation(v),m=v}if(a!==void 0){const v=await e.codeVerifier(),J=await Ro(l,{metadata:g,clientInformation:m,authorizationCode:a,codeVerifier:v,redirectUri:e.redirectUrl,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(J),"AUTHORIZED"}const T=await e.tokens();if(T?.refresh_token)try{const v=await yo(l,{metadata:g,clientInformation:m,refreshToken:T.refresh_token,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(v),"AUTHORIZED"}catch(v){if(!(!(v instanceof R)||v instanceof E))throw v}const b=e.state?await e.state():void 0,{authorizationUrl:U,codeVerifier:L}=await wo(l,{metadata:g,clientInformation:m,state:b,redirectUrl:e.redirectUrl,scope:s||e.clientMetadata.scope,resource:h});return await e.saveCodeVerifier(L),await e.redirectToAuthorization(U),"REDIRECT"}async function lo(e,o,a){const s=so(e);if(o.validateResourceURL)return await o.validateResourceURL(s,a?.resource);if(a){if(!ro({requestedResource:s,configuredResource:a.resource}))throw new Error(`Protected resource ${a.resource} does not match expected ${s} (or origin)`);return new URL(a.resource)}}function Io(e){const o=e.headers.get("WWW-Authenticate");if(!o)return;const[a,s]=o.split(" ");if(a.toLowerCase()!=="bearer"||!s)return;const p=/resource_metadata="([^"]*)"/.exec(o);if(p)try{return new URL(p[1])}catch{return}}async function po(e,o,a=fetch){const s=await _o(e,"oauth-protected-resource",a,{protocolVersion:o?.protocolVersion,metadataUrl:o?.resourceMetadataUrl});if(!s||s.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!s.ok)throw new Error(`HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`);return Qt.parse(await s.json())}async function he(e,o,a=fetch){try{return await a(e,{headers:o})}catch(s){if(s instanceof TypeError)return o?he(e,void 0,a):void 0;throw s}}function ho(e,o="",a={}){return o.endsWith("/")&&(o=o.slice(0,-1)),a.prependPathname?`${o}/.well-known/${e}`:`/.well-known/${e}${o}`}async function ge(e,o,a=fetch){return await he(e,{"MCP-Protocol-Version":o},a)}function mo(e,o){return!e||e.status>=400&&e.status<500&&o!=="/"}async function _o(e,o,a,s){var c,p;const d=new URL(e),l=(c=s?.protocolVersion)!==null&&c!==void 0?c:ae;let h;if(s?.metadataUrl)h=new URL(s.metadataUrl);else{const m=ho(o,d.pathname);h=new URL(m,(p=s?.metadataServerUrl)!==null&&p!==void 0?p:d),h.search=d.search}let g=await ge(h,l,a);if(!s?.metadataUrl&&mo(g,d.pathname)){const m=new URL(`/.well-known/${o}`,d);g=await ge(m,l,a)}return g}function go(e){const o=typeof e=="string"?new URL(e):e,a=o.pathname!=="/",s=[];if(!a)return s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/openid-configuration",o.origin),type:"oidc"}),s;let c=o.pathname;return c.endsWith("/")&&(c=c.slice(0,-1)),s.push({url:new URL(`/.well-known/oauth-authorization-server${c}`,o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL(`/.well-known/openid-configuration${c}`,o.origin),type:"oidc"}),s.push({url:new URL(`${c}/.well-known/openid-configuration`,o.origin),type:"oidc"}),s}async function fo(e,{fetchFn:o=fetch,protocolVersion:a=ae}={}){const s={"MCP-Protocol-Version":a,Accept:"application/json"},c=go(e);for(const{url:p,type:d}of c){const l=await he(p,s,o);if(l){if(!l.ok){if(l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${d==="oauth"?"OAuth":"OpenID provider"} metadata from ${p}`)}return d==="oauth"?Me.parse(await l.json()):Ft.parse(await l.json())}}}async function wo(e,{metadata:o,clientInformation:a,redirectUrl:s,scope:c,state:p,resource:d}){let l;if(o){if(l=new URL(o.authorization_endpoint),!o.response_types_supported.includes(W))throw new Error(`Incompatible auth server: does not support response type ${W}`);if(o.code_challenge_methods_supported&&!o.code_challenge_methods_supported.includes(B))throw new Error(`Incompatible auth server: does not support code challenge method ${B}`)}else l=new URL("/authorize",e);const h=await Kt(),g=h.code_verifier,m=h.code_challenge;return l.searchParams.set("response_type",W),l.searchParams.set("client_id",a.client_id),l.searchParams.set("code_challenge",m),l.searchParams.set("code_challenge_method",B),l.searchParams.set("redirect_uri",String(s)),p&&l.searchParams.set("state",p),c&&l.searchParams.set("scope",c),c?.includes("offline_access")&&l.searchParams.append("prompt","consent"),d&&l.searchParams.set("resource",d.href),{authorizationUrl:l,codeVerifier:g}}async function Ro(e,{metadata:o,clientInformation:a,authorizationCode:s,codeVerifier:c,redirectUri:p,resource:d,addClientAuthentication:l,fetchFn:h}){var g;const m="authorization_code",T=o?.token_endpoint?new URL(o.token_endpoint):new URL("/token",e);if(o?.grant_types_supported&&!o.grant_types_supported.includes(m))throw new Error(`Incompatible auth server: does not support grant type ${m}`);const b=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),U=new URLSearchParams({grant_type:m,code:s,code_verifier:c,redirect_uri:String(p)});if(l)l(b,U,e,o);else{const v=(g=o?.token_endpoint_auth_methods_supported)!==null&&g!==void 0?g:[],J=je(a,v);ze(J,a,b,U)}d&&U.set("resource",d.href);const L=await(h??fetch)(T,{method:"POST",headers:b,body:U});if(!L.ok)throw await de(L);return Ne.parse(await L.json())}async function yo(e,{metadata:o,clientInformation:a,refreshToken:s,resource:c,addClientAuthentication:p,fetchFn:d}){var l;const h="refresh_token";let g;if(o){if(g=new URL(o.token_endpoint),o.grant_types_supported&&!o.grant_types_supported.includes(h))throw new Error(`Incompatible auth server: does not support grant type ${h}`)}else g=new URL("/token",e);const m=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),T=new URLSearchParams({grant_type:h,refresh_token:s});if(p)p(m,T,e,o);else{const U=(l=o?.token_endpoint_auth_methods_supported)!==null&&l!==void 0?l:[],L=je(a,U);ze(L,a,m,T)}c&&T.set("resource",c.href);const b=await(d??fetch)(g,{method:"POST",headers:m,body:T});if(!b.ok)throw await de(b);return Ne.parse({refresh_token:s,...await b.json()})}async function So(e,{metadata:o,clientMetadata:a,fetchFn:s}){let c;if(o){if(!o.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");c=new URL(o.registration_endpoint)}else c=new URL("/register",e);const p=await(s??fetch)(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!p.ok)throw await de(p);return no.parse(await p.json())}export{Ce as C,me as E,gt as G,Ye as I,ko as J,ae as L,Lo as M,ke as P,nt as R,xo as S,Eo as U,be as a,bo as b,Co as c,To as d,xe as e,Vt as f,pt as g,Fe as h,Po as i,tt as j,qe as k,St as l,Oo as m,Io as n,Uo as o,po as p,fo as q,Ro as r};
@@ -1 +0,0 @@
1
- import{r as I,c as j,j as i,ae as S,aH as $,aI as L,aJ as M}from"./index-Dbugj1Qf.js";import{c as f}from"./utils-C9RgqtL7.js";const V=({size:a=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.createElement("path",{d:"M20 21c0-1.396 0-2.093-.172-2.661a4 4 0 0 0-2.667-2.667c-.568-.172-1.265-.172-2.661-.172h-5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C4 18.907 4 19.604 4 21M16.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));V.displayName="User01";function O(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(M,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function T(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function W(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(L,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}const R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],_="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function B(a){let e=0;for(let t=0;t<a.length;t++)e=a.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const U=S("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-xs font-semibold","2xs":"w-4 h-4 text-xs font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),D=S("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),H=a=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[a]||e.base};function J(a){const e=j.c(35);let s,t,o,r,n,d,g,l;e[0]!==a?({url:l,fallback:t,shape:r,size:n,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,[m,x]=I.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let z;e:{if(k){z=_;break e}if(typeof t=="string"){let c;e[11]!==t?(c=B(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=R[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=f(U({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==E||e[25]!==m||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",y),children:i.jsx(V,{size:H(h)})}):i.jsxs(i.Fragment,{children:[l&&!m&&i.jsx(T,{src:l,loading:"lazy",alt:"Avatar",className:f(D({objectFit:u})),onError:()=>x(!0)}),(!l||m)&&i.jsx(W,{className:f(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=E,e[25]=m,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(O,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function Z(a){const e=j.c(18);let s,t,o,r,n,d,g,l;e[0]!==a?({shape:r,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,m=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==k||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==m||e[16]!==l?(x=i.jsx(J,{shape:b,url:l,fallback:t,size:m,objectFit:u,className:s,muted:k,...o}),e[9]=s,e[10]=t,e[11]=k,e[12]=u,e[13]=o,e[14]=b,e[15]=m,e[16]=l,e[17]=x):x=e[17],x}Z.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(U({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{Z as A};
@@ -1 +0,0 @@
1
- import{c as d,ae as u,j as l,af as v}from"./index-Dbugj1Qf.js";import{c as g}from"./utils-C9RgqtL7.js";const f=u("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function m(o){const e=d.c(12);let r,s,i,t;e[0]!==o?({className:r,variant:t,asChild:i,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=t):(r=e[1],s=e[2],i=e[3],t=e[4]);const c=(i===void 0?!1:i)?v:"span";let a;e[5]!==r||e[6]!==t?(a=g(f({variant:t}),r),e[5]=r,e[6]=t,e[7]=a):a=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==a?(n=l.jsx(c,{"data-slot":"badge",className:a,...s}),e[8]=c,e[9]=s,e[10]=a,e[11]=n):n=e[11],n}export{m as B};
@@ -1 +0,0 @@
1
- import{bc as p,be as v,c1 as l,c2 as g,bd as b,a1 as f,r as u,bl as m,c3 as x,c as y,ae as O,j as k,af as C}from"./index-Dbugj1Qf.js";import{c as E}from"./utils-C9RgqtL7.js";var M=class extends p{#e;#i=void 0;#t;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),v(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),t?.mutationKey&&this.options.mutationKey&&l(t.mutationKey)!==l(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#n(e)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#n()}mutate(e,t){return this.#s=t,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#r(){const e=this.#t?.state??g();this.#i={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#n(e){b.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#i.variables,i=this.#i.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#s.onSuccess?.(e.data,t,i,s),this.#s.onSettled?.(e.data,null,t,i,s)):e?.type==="error"&&(this.#s.onError?.(e.error,t,i,s),this.#s.onSettled?.(void 0,e.error,t,i,s))}this.listeners.forEach(t=>{t(this.#i)})})}};function K(e,t){const i=f(t),[s]=u.useState(()=>new M(i,e));u.useEffect(()=>{s.setOptions(e)},[s,e]);const r=u.useSyncExternalStore(u.useCallback(n=>s.subscribe(b.batchCalls(n)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=u.useCallback((n,d)=>{s.mutate(n,d).catch(m)},[s]);if(r.error&&x(s.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:o,mutateAsync:r.mutate}}const S=O("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function z(e){const t=y.c(14);let i,s,r,o,n;t[0]!==e?({className:i,variant:n,size:r,asChild:o,...s}=e,t[0]=e,t[1]=i,t[2]=s,t[3]=r,t[4]=o,t[5]=n):(i=t[1],s=t[2],r=t[3],o=t[4],n=t[5]);const c=(o===void 0?!1:o)?C:"button";let a;t[6]!==i||t[7]!==r||t[8]!==n?(a=E(S({variant:n,size:r,className:i})),t[6]=i,t[7]=r,t[8]=n,t[9]=a):a=t[9];let h;return t[10]!==c||t[11]!==s||t[12]!==a?(h=k.jsx(c,{"data-slot":"button",className:a,...s}),t[10]=c,t[11]=s,t[12]=a,t[13]=h):h=t[13],h}export{z as B,S as b,K as u};
@@ -1 +0,0 @@
1
- import{r as m,d as R,as as se,j as t,c as S,ae as oe,a6 as re,bb as F}from"./index-Dbugj1Qf.js";import{f as ne,c as D,U as M,a as ae,e as ie,n as le}from"./use-connection-BcR9UFbs.js";import{T as ce}from"./tool-set-selector-BbP0pfb9.js";import{B as de}from"./badge-gmsvp75V.js";import{B as I}from"./button-eIETQb0Y.js";import{i as me}from"./InfoCircle-BBnXokyi.js";import{i as O}from"./Loading01-Dp6sT3Mq.js";import{i as ue}from"./Upload01-Bxain8td.js";import{I as L}from"./input-BWvhkgtS.js";import{S as xe}from"./spinner-BgLCN9p1.js";import{T as K}from"./textarea-GonRChaT.js";import{c as $}from"./utils-C9RgqtL7.js";import{P as q,u as fe,O as pe,M as he,E as ge}from"./index-CQXdtGjW.js";import{b as G,a as be,V as H}from"./layout-CX25ELhh.js";import{i as je}from"./AlertCircle-VUVelpvY.js";import{s as ve}from"./Clock-CUnbQKPM.js";import{a as Ne}from"./Copy01-vEIIJ5sE.js";import{s as we}from"./Plus-LcofPC9C.js";import{u as ye}from"./use-mcp-BHfi5-go.js";import{E as Ce}from"./error-boundary-CBpLdCwg.js";import"./tooltip-C_Is8XE4.js";import"./checkbox-BO8-3DdS.js";import"./ArrowLeft-B4oC_h6K.js";import"./collection-search-uhjPIekp.js";import"./SearchMd-3u9z3FIP.js";import"./mcp-oauth-jtPwlXEu.js";import"./auth-C8rltTUE.js";import"./use-organization-settings-Bdum0zz2.js";import"./use-binding-FqyuxtmF.js";import"./use-tool-call-rEALkXUX.js";import"./File06-sb4CceKn.js";import"./Key01-BUTMet0-.js";import"./form-B0VrU06h.js";import"./select-BoIpHU2H.js";import"./ChevronDown-CLC0yxsk.js";import"./use-gateway-DARIvLcH.js";import"./ChevronRight-YHVS_LDJ.js";import"./CpuChip02-Ckd82HIH.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./extract-connection-data-DNQ4aWdY.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-CF_OPzOB.js";import"./index-qnfTBZZC.js";import"./schema-CcVe4fys.js";import"./useQuery-BrB4rOUi.js";const Z=({size:s=24,color:e="currentColor",...o})=>m.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},m.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));Z.displayName="Box";const Q=({size:s=24,color:e="currentColor",...o})=>m.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},m.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));Q.displayName="Code01";const X=({size:s=24,color:e="currentColor",...o})=>m.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},m.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));X.displayName="Database01";const P=({size:s=24,color:e="currentColor",...o})=>m.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},m.createElement("path",{d:"M5 4.99c0-.972 0-1.457.202-1.725a1 1 0 0 1 .738-.395c.335-.02.74.25 1.548.788l10.515 7.01c.668.446 1.002.668 1.118.949a1 1 0 0 1 0 .766c-.116.28-.45.503-1.118.948l-10.515 7.01c-.809.54-1.213.809-1.548.789a1 1 0 0 1-.738-.395C5 20.467 5 19.98 5 19.01V4.99Z"}));P.displayName="Play";function Se(s){const e=S.c(14),{value:o,onChange:a,alt:n}=s,r=m.useRef(null);let i;e[0]!==a?(i=v=>{const C=v.target.files?.[0];if(C){const w=new FileReader;w.onloadend=()=>{const b=w.result;a(b)},w.readAsDataURL(C)}},e[0]=a,e[1]=i):i=e[1];const x=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{r.current?.click()},e[2]=l):l=e[2];const u=l;let c;e[3]!==x?(c=t.jsx("input",{type:"file",ref:r,className:"hidden",accept:"image/*",onChange:x}),e[3]=x,e[4]=c):c=e[4];let f;e[5]!==n||e[6]!==o?(f=o?t.jsx("img",{src:o,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]=o,e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=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(ue,{className:"h-5 w-5 text-white"})}),e[8]=p):p=e[8];let g;e[9]!==f?(g=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[f,p]}),e[9]=f,e[10]=g):g=e[10];let j;return e[11]!==c||e[12]!==g?(j=t.jsxs("div",{className:"relative h-14 w-14 shrink-0 cursor-pointer group",onClick:u,children:[c,g]}),e[11]=c,e[12]=g,e[13]=j):j=e[13],j}function ke({itemId:s,onBack:e,onUpdate:o}){const[a,n]=m.useState(!1),[r,i]=m.useState("profile"),{connectionId:x}=R({from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"}),l=x??M,u=D(l),c=ne(l,"AGENT",s,u),{register:f,handleSubmit:p,reset:g,setValue:j,watch:v,formState:{isDirty:C}}=se({defaultValues:{title:"",description:"",instructions:"",avatar:"",tool_set:{}}}),w=v("avatar"),b=v("tool_set")??{};m.useEffect(()=>{c&&g({title:c.title??"",description:c.description??"",instructions:c.instructions??"",avatar:c.avatar??"",tool_set:c.tool_set??{}})},[c,g]);const h=async E=>{n(!0);try{await o(E)}finally{n(!1)}},y=E=>{j("tool_set",E,{shouldDirty:!0})};return c?t.jsxs(G,{onBack:e,children:[t.jsxs(be,{children:[t.jsx(I,{variant:r==="profile"?"secondary":"ghost",size:"sm",className:$("h-7 font-normal",r==="profile"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("profile"),children:"Profile"}),t.jsx(I,{variant:r==="tools"?"secondary":"ghost",size:"sm",className:$("h-7 font-normal",r==="tools"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("tools"),children:"Tools"}),t.jsx(I,{variant:r==="triggers"?"secondary":"ghost",size:"sm",className:$("h-7 font-normal",r==="triggers"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("triggers"),disabled:!0,children:"Triggers"}),t.jsx(I,{variant:r==="advanced"?"secondary":"ghost",size:"sm",className:$("h-7 font-normal",r==="advanced"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("advanced"),disabled:!0,children:"Advanced"})]}),t.jsxs(H,{children:[t.jsx(q,{connectionId:x,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:p(h),disabled:!C||a,children:a?t.jsxs(t.Fragment,{children:[t.jsx(O,{size:12,className:"mr-2 animate-spin"}),"Saving..."]}):"Save changes"})]}),r==="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(Se,{value:w,onChange:E=>j("avatar",E,{shouldDirty:!0}),alt:v("title")}),t.jsxs("div",{className:"space-y-3 pt-1 flex-1",children:[t.jsx(L,{...f("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(L,{...f("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(de,{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(me,{className:"h-3.5 w-3.5"}),"Type @ to add tools and more"]}),t.jsx("div",{className:"relative",children:t.jsx(K,{...f("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..."})})]})]})}),r==="tools"&&t.jsx(ce,{toolSet:b,onToolSetChange:y}),r==="triggers"&&t.jsx("div",{className:"p-5",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Triggers tab coming soon"})}),r==="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(xe,{})})}const $e=oe("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 Ee(s){const e=S.c(10);let o,a,n;e[0]!==s?({className:o,variant:n,...a}=s,e[0]=s,e[1]=o,e[2]=a,e[3]=n):(o=e[1],a=e[2],n=e[3]);let r;e[4]!==o||e[5]!==n?(r=$($e({variant:n}),o),e[4]=o,e[5]=n,e[6]=r):r=e[6];let i;return e[7]!==a||e[8]!==r?(i=t.jsx("div",{"data-slot":"alert",role:"alert",className:r,...a}),e[7]=a,e[8]=r,e[9]=i):i=e[9],i}function Ie(s){const e=S.c(8);let o,a;e[0]!==s?({className:o,...a}=s,e[0]=s,e[1]=o,e[2]=a):(o=e[1],a=e[2]);let n;e[3]!==o?(n=$("line-clamp-1 min-h-4 font-medium tracking-tight",o),e[3]=o,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=t.jsx("div",{"data-slot":"alert-title",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}function Te(s){const e=S.c(8);let o,a;e[0]!==s?({className:o,...a}=s,e[0]=s,e[1]=o,e[2]=a):(o=e[1],a=e[2]);let n;e[3]!==o?(n=$("text-muted-foreground leading-relaxed",o),e[3]=o,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=t.jsx("div",{"data-slot":"alert-description",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}const ze=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ae(s){const e=S.c(13),{toolName:o,connectionId:a,onBack:n}=s,r=`/mcp/${a}`;let i;e[0]!==r?(i=new URL(r,window.location.origin),e[0]=r,e[1]=i):i=e[1];const x=i;let l;e[2]!==a?(l={connectionId:a},e[2]=a,e[3]=l):l=e[3];const u=fe(l);if(!u.isAuthenticated){let p;return e[4]!==u.supportsOAuth||e[5]!==n?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:u.supportsOAuth?t.jsx(pe,{onAuthenticate:()=>n(),buttonText:"Go back to authenticate"}):t.jsx(he,{hasReadme:!1})}),e[4]=u.supportsOAuth,e[5]=n,e[6]=p):p=e[6],p}const c=`${a}:${o}`;let f;return e[7]!==a||e[8]!==x||e[9]!==n||e[10]!==c||e[11]!==o?(f=t.jsx(Oe,{toolName:o,connectionId:a,mcpProxyUrl:x,onBack:n},c),e[7]=a,e[8]=x,e[9]=n,e[10]=c,e[11]=o,e[12]=f):f=e[12],f}function Oe({toolName:s,connectionId:e,mcpProxyUrl:o,onBack:a}){const[n,r]=m.useState({}),[i,x]=m.useState("{}"),[l,u]=m.useState(null),[c,f]=m.useState(null),[p,g]=m.useState(!1),[j,v]=m.useState(null),[C,w]=m.useState("json"),b=ye({url:o.href});m.useEffect(()=>{b.error&&console.error("MCP Error:",b.error)},[b.error]);const h=b.tools?.find(d=>d.name===s),y=h?.inputSchema?.properties,E=y?Object.keys(y):[],A=E.length>0,_={};if(A&&h?.inputSchema?.properties)for(const d of E)_[d]=h.inputSchema.required?.includes(d)?"":void 0;const U=d=>Object.prototype.hasOwnProperty.call(n,d),Y=async()=>{g(!0),f(null),u(null),v(null);const d=performance.now(),k=D(e);try{const N=A?{..._,...n}:(()=>{const T=i.trim();if(!T)return{};const z=JSON.parse(T);if(z&&typeof z=="object")return z;throw new Error("Raw JSON input must be an object.")})();A&&h?.inputSchema?.properties&&Object.entries(h.inputSchema.properties).forEach(([T,z])=>{if((z.type==="object"||z.type==="array")&&typeof N[T]=="string")try{N[T]=JSON.parse(N[T])}catch{}});const B=await k(s,N),V=performance.now(),ee=Math.round(V-d);u(B);const te=JSON.stringify(B),W=new TextEncoder().encode(te).length;v({duration:`${ee}ms`,bytes:`${W} bytes`,tokens:`~${Math.ceil(W/4)} tokens`,cost:"$0.0000"})}catch(N){const B=N instanceof Error?N.message:String(N);f(B||"Unknown error occurred");const V=performance.now();v({duration:`${Math.round(V-d)}ms`})}finally{g(!1)}},J=(d,k)=>{r(N=>({...N,[d]:k}))};return t.jsxs(G,{onBack:a,children:[t.jsx(H,{children:t.jsx(q,{connectionId:e,title:h?.name??ze(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:h?.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:[b.state==="ready"?t.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"}):b.state==="connecting"?t.jsx(O,{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:b.state.replace("_"," ")})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ve,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:j?.duration||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Z,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:j?.tokens||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(X,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:j?.bytes||"-"})]})]}),c&&t.jsxs(Ee,{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(je,{className:"h-4 w-4"}),t.jsx(Ie,{children:"Execution Failed"}),t.jsx(Te,{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(P,{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:Y,disabled:p,children:[p?t.jsx(O,{size:14,className:"animate-spin"}):t.jsx(P,{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&&h?.inputSchema?.properties?Object.entries(h.inputSchema.properties).map(([d,k])=>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}),h.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:k.type})]}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:k.description}),k.type==="object"||k.type==="array"?t.jsx(K,{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:U(d)?n[d]??"":_[d]??"",onChange:N=>J(d,N.target.value),placeholder:`Enter ${d} as JSON...`}):t.jsx(L,{value:U(d)?n[d]??"":_[d]??"",onChange:N=>J(d,N.target.value),placeholder:`Enter ${d}...`})]},d)):t.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."}),h?.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=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]})]})]}),t.jsxs("div",{className:"w-full bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[t.jsx("span",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Execution Result"}),t.jsxs("div",{className:"flex items-center bg-muted rounded-lg p-1 h-8",children:[t.jsx("button",{onClick:()=>w("json"),className:$("px-3 py-1 text-xs font-medium rounded-md transition-all",C==="json"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"JSON"}),t.jsxs("button",{onClick:()=>w("view"),className:$("px-3 py-1 text-xs font-medium rounded-md transition-all flex items-center gap-1",C==="view"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),disabled:!0,title:"Coming soon",children:["Create view",t.jsx(we,{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(Q,{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)),re.success("Copied to clipboard")},children:t.jsx(Ne,{className:"h-4 w-4"})})})]})]})]})]})]})}function Re(s){const e=S.c(7),{itemId:o,onBack:a}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const i=R(n).connectionId??M;if(!ae(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(O,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=l):l=e[2];let u;return e[3]!==i||e[4]!==a||e[5]!==o?(u=t.jsx(m.Suspense,{fallback:l,children:t.jsx(Ae,{toolName:o,connectionId:i,onBack:a})}),e[3]=i,e[4]=a,e[5]=o,e[6]=u):u=e[6],u}const _e={agent:ke};function Be(){const s=S.c(6),e=F();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=o):o=s[0];const a=R(o),n=decodeURIComponent(a.itemId);let r;s[1]!==e.history?(r=()=>{e.history.back()},s[1]=e.history,s[2]=r):r=s[2];const i=r,x=Ve;let l;return s[3]!==i||s[4]!==n?(l=t.jsx(Re,{itemId:n,onBack:i,onUpdate:x}),s[3]=i,s[4]=n,s[5]=l):l=s[5],l}async function Ve(s){return Promise.resolve()}function Le(){const s=S.c(18),e=F();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=o):o=s[0];const a=R(o),n=a.connectionId,r=decodeURIComponent(a.collectionName),i=decodeURIComponent(a.itemId);let x;s[1]!==e.history?(x=()=>{e.history.back()},s[1]=e.history,s[2]=x):x=s[2];const l=x,u=n??M;let c;s[3]!==u?(c=D(u),s[3]=u,s[4]=c):c=s[4];const p=ie(u,r,c);let g;s[5]!==p||s[6]!==i?(g=async y=>{i&&await p.update.mutateAsync({id:i,data:y})},s[5]=p,s[6]=i,s[7]=g):g=s[7];const j=g;let v;s[8]!==r?(v=r?.toLowerCase(),s[8]=r,s[9]=v):v=s[9];const C=v,w=C&&_e[C];if(w){let y;return s[10]!==w||s[11]!==l||s[12]!==j||s[13]!==i?(y=t.jsx(w,{itemId:i,onBack:l,onUpdate:j}),s[10]=w,s[11]=l,s[12]=j,s[13]=i,s[14]=y):y=s[14],y}let b;s[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(le,{size:36,className:"text-muted-foreground"}),s[15]=b):b=s[15];let h;return s[16]!==l?(h=t.jsx(ge,{icon:b,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:l,children:"Go back"}}),s[16]=l,s[17]=h):h=s[17],h}function Pe(){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 o=R(e);if(decodeURIComponent(o.collectionName)==="tools"){let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Be,{}),s[1]=i):i=s[1],i}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Le,{}),s[2]=r):r=s[2],r}function At(){const s=S.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ce,{children:t.jsx(m.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(O,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Pe,{})})}),s[0]=e):e=s[0],e}export{At as default};
@@ -1 +0,0 @@
1
- import{r as a,c as Q,j as s}from"./index-Dbugj1Qf.js";import{B as se}from"./button-eIETQb0Y.js";import{d as oe,i as ie,D as ne,c as le,b as re,a as ae}from"./dropdown-menu-DKiYuSii.js";import{i as ce,c as de,b as ue,T as fe,a as me}from"./tooltip-C_Is8XE4.js";import{c as m}from"./utils-C9RgqtL7.js";const U=({size:i=24,color:e="currentColor",...o})=>a.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},a.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));U.displayName="ArrowDown";const X=({size:i=24,color:e="currentColor",...o})=>a.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},a.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));X.displayName="List";const Y=({size:i=24,color:e="currentColor",...o})=>a.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},a.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));Y.displayName="Sliders01";const xe={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function he(i){const e=Q.c(66),{value:o,onValueChange:l,options:t,size:p,fullWidth:g,className:x}=i,j=p===void 0?"sm":p,r=g===void 0?!1:g,v=a.useRef(null),b=a.useRef(null);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={left:0,width:0,opacity:0},e[0]=c):c=e[0];const[n,h]=a.useState(c);let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=I=>{if(!I.current)return;const{offsetLeft:ee,offsetWidth:te}=I.current;h({left:ee,width:te,opacity:1})},e[1]=d):d=e[1];const w=d;let u;e[2]!==t[0].value||e[3]!==o?(u=()=>{const I=o===t[0].value?v:b;w(I)},e[2]=t[0].value,e[3]=o,e[4]=u):u=e[4];let R;e[5]!==t||e[6]!==o?(R=[o,t],e[5]=t,e[6]=o,e[7]=R):R=e[7],a.useEffect(u,R);const f=xe[j];let y;e[8]!==x?(y=m("relative flex gap-0 bg-muted rounded-lg",x),e[8]=x,e[9]=y):y=e[9];let N;e[10]!==l||e[11]!==t[0].value?(N=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=N):N=e[12];const P=r?"flex-1 h-12 px-4":f.button,Z=!r&&t[0].label?"px-3":"";let z;e[13]!==Z||e[14]!==P?(z=m("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",P,Z),e[13]=Z,e[14]=P,e[15]=z):z=e[15];const O=o===t[0].value?"text-foreground":"text-muted-foreground";let k;e[16]!==f.icon||e[17]!==O?(k=m("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",f.icon,O),e[16]=f.icon,e[17]=O,e[18]=k):k=e[18];let C;e[19]!==t[0].icon||e[20]!==k?(C=s.jsx("span",{className:k,children:t[0].icon}),e[19]=t[0].icon,e[20]=k,e[21]=C):C=e[21];let M;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(M=t[0].label&&s.jsx("span",{className:m("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=M):M=e[25];let S;e[26]!==z||e[27]!==C||e[28]!==M||e[29]!==N?(S=s.jsxs("button",{ref:v,type:"button",onClick:N,className:z,children:[C,M]}),e[26]=z,e[27]=C,e[28]=M,e[29]=N,e[30]=S):S=e[30];let _;e[31]!==l||e[32]!==t[1].value?(_=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=_):_=e[33];const A=r?"flex-1 h-12 px-4":f.button,K=!r&&t[1].label?"px-3":"";let E;e[34]!==A||e[35]!==K?(E=m("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",A,K),e[34]=A,e[35]=K,e[36]=E):E=e[36];const q=o===t[1].value?"text-foreground":"text-muted-foreground";let D;e[37]!==f.icon||e[38]!==q?(D=m("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",f.icon,q),e[37]=f.icon,e[38]=q,e[39]=D):D=e[39];let L;e[40]!==t[1].icon||e[41]!==D?(L=s.jsx("span",{className:D,children:t[1].icon}),e[40]=t[1].icon,e[41]=D,e[42]=L):L=e[42];let T;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(T=t[1].label&&s.jsx("span",{className:m("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=T):T=e[46];let V;e[47]!==_||e[48]!==E||e[49]!==L||e[50]!==T?(V=s.jsxs("button",{ref:b,type:"button",onClick:_,className:E,children:[L,T]}),e[47]=_,e[48]=E,e[49]=L,e[50]=T,e[51]=V):V=e[51];const F=r?"h-12":f.button;let W;e[52]!==F?(W=m("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",F),e[52]=F,e[53]=W):W=e[53];const G=`${n.left}px`,J=`${n.width}px`;let $;e[54]!==n.opacity||e[55]!==G||e[56]!==J?($={left:G,width:J,opacity:n.opacity},e[54]=n.opacity,e[55]=G,e[56]=J,e[57]=$):$=e[57];let B;e[58]!==W||e[59]!==$?(B=s.jsx("div",{className:W,style:$}),e[58]=W,e[59]=$,e[60]=B):B=e[60];let H;return e[61]!==S||e[62]!==V||e[63]!==B||e[64]!==y?(H=s.jsxs("div",{className:y,children:[S,V,B]}),e[61]=S,e[62]=V,e[63]=B,e[64]=y,e[65]=H):H=e[65],H}function we(i){const e=Q.c(16),{viewMode:o,onViewModeChange:l,sortKey:t,sortDirection:p,onSort:g,sortOptions:x}=i;let j;e[0]!==x?(j=x===void 0?[]:x,e[0]=x,e[1]=j):j=e[1];const r=j;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(de,{children:s.jsxs(ue,{children:[s.jsx(fe,{asChild:!0,children:s.jsx(ne,{asChild:!0,children:s.jsx(se,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(Y,{size:16})})})}),s.jsx(me,{children:"Search filters"})]})}),e[2]=v):v=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b={value:"table",icon:s.jsx(X,{})},e[3]=b):b=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=[b,{value:"cards",icon:s.jsx(le,{})}],e[4]=c):c=e[4];let n;e[5]!==l||e[6]!==o?(n=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(he,{value:o,onValueChange:l,fullWidth:!0,options:c})}),e[5]=l,e[6]=o,e[7]=n):n=e[7];let h;e[8]!==g||e[9]!==p||e[10]!==t||e[11]!==r?(h=r.length>0&&g&&s.jsxs("div",{className:"p-2",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),r.map(w=>{const u=t===w.id;return s.jsx(oe,{onClick:()=>g(w.id),className:m("h-8 px-2 py-0 cursor-pointer",u&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u&&s.jsx(ce,{size:16,className:"text-foreground shrink-0"}),!u&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:w.label}),u&&p&&(p==="asc"?s.jsx(ie,{size:16,className:"text-foreground shrink-0"}):s.jsx(U,{size:16,className:"text-foreground shrink-0"}))]})},w.id)})]}),e[8]=g,e[9]=p,e[10]=t,e[11]=r,e[12]=h):h=e[12];let d;return e[13]!==n||e[14]!==h?(d=s.jsxs(re,{children:[v,s.jsxs(ae,{align:"end",className:"w-[200px] p-0 gap-0",children:[n,h]})]}),e[13]=n,e[14]=h,e[15]=d):d=e[15],d}export{we as C,he as V,U as n};
@@ -1 +0,0 @@
1
- import{c as x,j as a}from"./index-Dbugj1Qf.js";import{i as u}from"./SearchMd-3u9z3FIP.js";import{I as b}from"./input-BWvhkgtS.js";import{c as g}from"./utils-C9RgqtL7.js";function w(h){const e=x.c(13),{value:n,onChange:i,placeholder:d,onKeyDown:c,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==i?(r=p=>i(p.target.value),e[3]=i,e[4]=r):r=e[4];let s;e[5]!==c||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:c,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=c,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
@@ -1 +0,0 @@
1
- import{c as g,j as o}from"./index-Dbugj1Qf.js";import{c as u}from"./utils-C9RgqtL7.js";import{n as T}from"./collection-display-button--hU2cKng.js";import{i as $}from"./dropdown-menu-DKiYuSii.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
@@ -1 +0,0 @@
1
- import{r as ie,c as U,j as s,a5 as Oe,a as nt,a6 as it,d as lt,b as rt,bb as at}from"./index-Dbugj1Qf.js";import{E as ze}from"./SearchMd-3u9z3FIP.js";import{E as Fe}from"./error-boundary-CBpLdCwg.js";import{I as ct,a as Ke,e as dt,u as mt,c as ut,d as pt}from"./use-connection-BcR9UFbs.js";import{b as ft}from"./use-binding-FqyuxtmF.js";import{E as Ve,P as ht,u as gt,S as xt}from"./index-CQXdtGjW.js";import{B as ge}from"./button-eIETQb0Y.js";import{i as We}from"./Loading01-Dp6sT3Mq.js";import{a as jt,T as bt,R as Ct}from"./resource-tabs-DMxDPvak.js";import{V as vt,a as yt,b as wt}from"./layout-CX25ELhh.js";import{g as Be}from"./generate-id-Dyweu44Y.js";import{C as qe}from"./collection-display-button--hU2cKng.js";import{C as Nt}from"./collection-search-uhjPIekp.js";import{C as St}from"./card-BeaxjjFM.js";import{b as He,D as Je,a as Ze,d as V}from"./dropdown-menu-DKiYuSii.js";import{a as Ge}from"./Copy01-vEIIJ5sE.js";import{i as Qe,s as Xe}from"./Trash01-CNckizo2.js";import{s as Ye,u as _t}from"./use-list-state-DTFI-io6.js";import{C as Tt}from"./collection-table-wrapper-DqGkk2i2.js";import{n as Le}from"./Inbox01-CJr3WKtd.js";import{B as $t}from"./extract-connection-data-DNQ4aWdY.js";import{A as At,g as It,c as Dt,b as Pt,d as kt,e as Ot,a as zt,f as Et}from"./alert-dialog-yp0b0MDg.js";import{s as Mt}from"./Plus-LcofPC9C.js";import"./utils-C9RgqtL7.js";import"./tooltip-C_Is8XE4.js";import"./auth-C8rltTUE.js";import"./mcp-oauth-jtPwlXEu.js";import"./use-organization-settings-Bdum0zz2.js";import"./use-tool-call-rEALkXUX.js";import"./File06-sb4CceKn.js";import"./Key01-BUTMet0-.js";import"./form-B0VrU06h.js";import"./input-BWvhkgtS.js";import"./select-BoIpHU2H.js";import"./ChevronDown-CLC0yxsk.js";import"./use-gateway-DARIvLcH.js";import"./ChevronRight-YHVS_LDJ.js";import"./CpuChip02-Ckd82HIH.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./registry-utils-ulDDT0d8.js";import"./index-CF_OPzOB.js";import"./index-qnfTBZZC.js";import"./schema-CcVe4fys.js";import"./useQuery-BrB4rOUi.js";import"./badge-gmsvp75V.js";import"./ArrowLeft-B4oC_h6K.js";import"./use-mobile-BAgI68xi.js";const Ee=({size:t=24,color:e="currentColor",...o})=>ie.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},ie.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));Ee.displayName="Edit01";function Ut(t,e){const o=t.properties||{};for(const i in o){const r=o[i];if(r&&r.type==="string"&&(r.format==="url"||r.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 Vt(t){const e=U.c(25),{item:o,schema:l,actions:i}=t;let r;e[0]!==o||e[1]!==l?(r=Ut(l,o),e[0]=o,e[1]=l,e[2]=r):r=e[2];const m=r,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 h=u;let c;e[5]!==m||e[6]!==o.title?(c=s.jsx(ct,{icon:m,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=m,e[6]=o.title,e[7]=c):c=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 g=n||"No description";let y;e[10]!==g?(y=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:g}),e[10]=g,e[11]=y):y=e[11];let p;e[12]!==d||e[13]!==y?(p=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[d,y]}),e[12]=d,e[13]=y,e[14]=p):p=e[14];let j;e[15]!==c||e[16]!==p?(j=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[c,p]}),e[15]=c,e[16]=p,e[17]=j):j=e[17];let a;e[18]!==i||e[19]!==h||e[20]!==o?(a=h&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ft,onMouseDown:Rt,children:s.jsxs(He,{children:[s.jsx(Je,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Lt,children:s.jsx(Qe,{size:20})})}),s.jsxs(Ze,{align:"end",onClick:Bt,children:[i.open&&s.jsxs(V,{onClick:C=>{C.stopPropagation(),i.open?.(o)},children:[s.jsx(Ye,{size:16}),"Open"]}),i.edit&&s.jsxs(V,{onClick:C=>{C.stopPropagation(),i.edit?.(o)},children:[s.jsx(Ee,{size:16}),"Edit"]}),i.duplicate&&s.jsxs(V,{onClick:C=>{C.stopPropagation(),i.duplicate?.(o)},children:[s.jsx(Ge,{size:16}),"Duplicate"]}),i.delete&&s.jsxs(V,{variant:"destructive",onClick:C=>{C.stopPropagation(),i.delete?.(o)},children:[s.jsx(Xe,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=h,e[20]=o,e[21]=a):a=e[21];let $;return e[22]!==j||e[23]!==a?($=s.jsxs(St,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[j,a]}),e[22]=j,e[23]=a,e[24]=$):$=e[24],$}function Bt(t){return t.stopPropagation()}function Lt(t){return t.stopPropagation()}function Rt(t){return t.stopPropagation()}function Ft(t){return t.stopPropagation()}function et(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 Kt(t){const e=U.c(32),{data:o,schema:l,viewMode:i,onViewModeChange:r,search:m,sortKey:n,sortDirection:u,onSort:h,actions:c,onItemClick:d,headerActions:g,emptyState:y,readOnly:p,columns:j,hideToolbar:a,sortableFields:$}=t,C=r===void 0?Zt:r,b=u===void 0?"asc":u,P=h===void 0?Jt:h;let w;e[0]!==c?(w=c===void 0?{}:c,e[0]=c,e[1]=w):w=e[1];const f=w,A=d===void 0?Ht:d,I=g===void 0?null:g,v=y===void 0?null:y,k=p===void 0?!1:p,_=j===void 0?void 0:j,O=a===void 0?!1:a,N=$===void 0?void 0:$;let E;e[2]!==_||e[3]!==l||e[4]!==N?(E=_?_.filter(qt).filter(M=>!N||N.includes(M.id)).map(Wt):et(l,N),e[2]=_,e[3]=l,e[4]=N,e[5]=E):E=e[5];const T=E;let S;e[6]!==I||e[7]!==O||e[8]!==P||e[9]!==C||e[10]!==b||e[11]!==n||e[12]!==T||e[13]!==i?(S=!O&&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:I}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(qe,{viewMode:i,onViewModeChange:C,sortKey:n,sortDirection:b,onSort:P,sortOptions:T})})]})}),e[6]=I,e[7]=O,e[8]=P,e[9]=C,e[10]=b,e[11]=n,e[12]=T,e[13]=i,e[14]=S):S=e[14];let z;e[15]!==f||e[16]!==_||e[17]!==o||e[18]!==v||e[19]!==A||e[20]!==P||e[21]!==k||e[22]!==l||e[23]!==m||e[24]!==b||e[25]!==n||e[26]!==N||e[27]!==i?(z=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:v||s.jsx(Ve,{icon:s.jsx(Le,{size:36,className:"text-muted-foreground"}),title:"No items found",description:m?"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(M=>s.jsx("div",{onClick:()=>A?.(M),className:"cursor-pointer h-full",children:s.jsx(Vt,{item:M,schema:l,readOnly:k,actions:f})},M.id))})}):s.jsx(Tt,{columns:Yt(_,l,N,f),data:o,sortKey:n,sortDirection:b,onSort:P,onRowClick:A,emptyState:v||s.jsx(Ve,{icon:s.jsx(Le,{size:36,className:"text-muted-foreground"}),title:"No items found",description:m?"Try adjusting your search":"No items to display"})}),e[15]=f,e[16]=_,e[17]=o,e[18]=v,e[19]=A,e[20]=P,e[21]=k,e[22]=l,e[23]=m,e[24]=b,e[25]=n,e[26]=N,e[27]=i,e[28]=z):z=e[28];let x;return e[29]!==S||e[30]!==z?(x=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[S,z]}),e[29]=S,e[30]=z,e[31]=x):x=e[31],x}function Wt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function qt(t){return t.sortable!==!1}function Ht(){}function Jt(){}function Zt(){}function Gt(t){return{id:"actions",header:"",render:e=>s.jsxs(He,{children:[s.jsx(Je,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(Qe,{size:20})})}),s.jsxs(Ze,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(V,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(Ye,{size:16}),"Open"]}),t.edit&&s.jsxs(V,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(Ee,{size:16}),"Edit"]}),t.duplicate&&s.jsxs(V,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(Ge,{size:16}),"Duplicate"]}),t.delete&&s.jsxs(V,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(Xe,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function Qt(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 Xt(t,e){const o=t.properties||{},l=Object.keys(o).filter(n=>{const u=o[n];return u&&Qt(u)}),i=l.find(n=>{const u=o[n];return u&&Re(u)}),r=new Set;i&&r.add(i);const m=["title","description","updated_at","updated_by"];for(const n of m)l.includes(n)&&i!==n&&!r.has(n)&&r.add(n);for(const n of l)r.has(n)||r.add(n);return[...r.values()].map(n=>{const u=o[n];if(!u)return{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[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 h=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:c=>{const d=c[n];return d?s.jsx("span",{className:"block truncate max-w-full",children:new Date(d).toLocaleDateString()}):"—"},sortable:h,cellClassName:"max-w-[200px]"}:i===n&&Re(u)?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d?s.jsx("img",{src:String(d),alt:n,className:"h-8 w-8 rounded object-cover"}):"—"},sortable:h,cellClassName:"max-w-[200px]"}:{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:h,cellClassName:"max-w-[100px]"}})}function Yt(t,e,o,l){const i=t||Xt(e,o);return i.some(n=>n.id==="actions")?i:Object.keys(l).length>0?[...i,Gt(l)]:i}function es(t){const e=U.c(117),{connectionId:o,org:l,activeCollection:i}=t,r=i.name,m=i.schema??$t,n=i.hasCreateTool,u=i.hasUpdateTool,h=i.hasDeleteTool,c=Oe(),{data:d}=nt.useSession(),g=d?.user?.id||"unknown",y=Ke(o);let p;e[0]!==o?(p=ut(o),e[0]=o,e[1]=p):p=e[1];const j=p,a=dt(o,r,j),$=`${o}-${r}`;let C;e[2]!==l||e[3]!==$?(C={namespace:l,resource:$,defaultSortKey:"updated_at"},e[2]=l,e[3]=$,e[4]=C):C=e[4];const{search:b,searchTerm:P,setSearch:w,viewMode:f,setViewMode:A,sortKey:I,sortDirection:v,handleSort:k}=_t(C);let _;e[5]!==P||e[6]!==v||e[7]!==I?(_={searchTerm:P,sortKey:I,sortDirection:v},e[5]=P,e[6]=v,e[7]=I,e[8]=_):_=e[8];const O=mt(o,r,j,_),N=!n&&!u&&!h;let E;e[9]!==r||e[10]!==o||e[11]!==c||e[12]!==l?(E=D=>{c({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:r,itemId:D.id}})},e[9]=r,e[10]=o,e[11]=c,e[12]=l,e[13]=E):E=e[13];const T=E;let S;e[14]!==a.create||e[15]!==g?(S=async D=>{const he=new Date().toISOString();await a.create.mutateAsync({...D,id:Be("conn"),title:`${D.title} (Copy)`,created_at:he,updated_at:he,created_by:g,updated_by:g})},e[14]=a.create,e[15]=g,e[16]=S):S=e[16];const z=S,[x,M]=ie.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=D=>{M(D)},e[17]=le):le=e[17];const tt=le;let B;e[18]!==T||e[19]!==u?(B=u&&{edit:T},e[18]=T,e[19]=u,e[20]=B):B=e[20];let L;e[21]!==z||e[22]!==n?(L=n&&{duplicate:z},e[21]=z,e[22]=n,e[23]=L):L=e[23];let R;e[24]!==h?(R=h&&{delete:tt},e[24]=h,e[25]=R):R=e[25];let re;e[26]!==R||e[27]!==B||e[28]!==L?(re={...B,...L,...R},e[26]=R,e[27]=B,e[28]=L,e[29]=re):re=e[29];const xe=re;let ae;e[30]!==a.delete||e[31]!==x?(ae=async()=>{x&&(await a.delete.mutateAsync(x.id),M(null))},e[30]=a.delete,e[31]=x,e[32]=ae):ae=e[32];const je=ae;let ce;e[33]!==a.create||e[34]!==r||e[35]!==o||e[36]!==n||e[37]!==c||e[38]!==l||e[39]!==g?(ce=async()=>{if(!n){it.error("Create operation is not available for this collection");return}const D=new Date().toISOString(),he={id:Be("conn"),title:"New Item",created_at:D,updated_at:D,created_by:g,updated_by:g};try{const ke=await a.create.mutateAsync(he);c({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:r,itemId:ke.id}})}catch(ke){console.error("Failed to create item:",ke)}},e[33]=a.create,e[34]=r,e[35]=o,e[36]=n,e[37]=c,e[38]=l,e[39]=g,e[40]=ce):ce=e[40];const be=ce;let de;e[41]!==m?(de=et(m),e[41]=m,e[42]=de):de=e[42];const Ce=de,Me=(O?.length??0)>0,st=n&&Me,ot=n&&!Me&&!b;let me;e[43]!==a.create||e[44]!==be||e[45]!==n?(me=n?s.jsxs(ge,{onClick:be,size:"sm",disabled:a.create.isPending,className:"h-7",children:[s.jsx(Mt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[43]=a.create,e[44]=be,e[45]=n,e[46]=me):me=e[46];const Ue=me,ve=I;let F;e[47]!==k||e[48]!==A||e[49]!==v||e[50]!==Ce||e[51]!==ve||e[52]!==f?(F=s.jsx(qe,{viewMode:f,onViewModeChange:A,sortKey:ve,sortDirection:v,onSort:k,sortOptions:Ce}),e[47]=k,e[48]=A,e[49]=v,e[50]=Ce,e[51]=ve,e[52]=f,e[53]=F):F=e[53];const ye=`${r}s`,we=y?.icon??"grid_view";let K;e[54]!==o||e[55]!==ye||e[56]!==we?(K=s.jsx(ht,{connectionId:o,title:ye,icon:we}),e[54]=o,e[55]=ye,e[56]=we,e[57]=K):K=e[57];const Ne=st&&Ue;let W;e[58]!==F||e[59]!==K||e[60]!==Ne?(W=s.jsxs(vt,{children:[F,K,Ne]}),e[58]=F,e[59]=K,e[60]=Ne,e[61]=W):W=e[61];const Se=`Search ${r}...`;let q;e[62]!==w?(q=D=>{D.key==="Escape"&&(w(""),D.target.blur())},e[62]=w,e[63]=q):q=e[63];let H;e[64]!==b||e[65]!==w||e[66]!==Se||e[67]!==q?(H=s.jsx(Nt,{value:b,onChange:w,placeholder:Se,onKeyDown:q}),e[64]=b,e[65]=w,e[66]=Se,e[67]=q,e[68]=H):H=e[68];let J;e[69]!==O?(J=O??[],e[69]=O,e[70]=J):J=e[70];const _e=I;let Z;e[71]!==T?(Z=D=>T(D),e[71]=T,e[72]=Z):Z=e[72];const Te="No items found",$e=b?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ae=ot?Ue:void 0;let G;e[73]!==Te||e[74]!==$e||e[75]!==Ae?(G=s.jsx(ze,{image:null,title:Te,description:$e,actions:Ae}),e[73]=Te,e[74]=$e,e[75]=Ae,e[76]=G):G=e[76];let Q;e[77]!==k||e[78]!==N||e[79]!==xe||e[80]!==m||e[81]!==b||e[82]!==w||e[83]!==A||e[84]!==v||e[85]!==J||e[86]!==_e||e[87]!==Z||e[88]!==G||e[89]!==f?(Q=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Kt,{hideToolbar:!0,data:J,schema:m,viewMode:f,onViewModeChange:A,search:b,onSearchChange:w,sortKey:_e,sortDirection:v,onSort:k,actions:xe,onItemClick:Z,readOnly:N,emptyState:G})}),e[77]=k,e[78]=N,e[79]=xe,e[80]=m,e[81]=b,e[82]=w,e[83]=A,e[84]=v,e[85]=J,e[86]=_e,e[87]=Z,e[88]=G,e[89]=f,e[90]=Q):Q=e[90];let X;e[91]!==H||e[92]!==Q?(X=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[H,Q]}),e[91]=H,e[92]=Q,e[93]=X):X=e[93];const Ie=!!x;let ue;e[94]===Symbol.for("react.memo_cache_sentinel")?(ue=D=>{D||M(null)},e[94]=ue):ue=e[94];let pe;e[95]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(Dt,{children:"Delete item?"}),e[95]=pe):pe=e[95];const De=x?.title;let Y;e[96]!==De?(Y=s.jsxs(Pt,{children:[pe,s.jsxs(kt,{children:['Are you sure you want to delete "',De,'"? This action cannot be undone.']})]}),e[96]=De,e[97]=Y):Y=e[97];let ee;e[98]!==a.delete.isPending?(ee=s.jsx(At,{disabled:a.delete.isPending,children:"Cancel"}),e[98]=a.delete.isPending,e[99]=ee):ee=e[99];const Pe=a.delete.isPending?"Deleting...":"Delete";let te;e[100]!==a.delete.isPending||e[101]!==je||e[102]!==Pe?(te=s.jsx(It,{onClick:je,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=a.delete.isPending,e[101]=je,e[102]=Pe,e[103]=te):te=e[103];let se;e[104]!==ee||e[105]!==te?(se=s.jsxs(Ot,{children:[ee,te]}),e[104]=ee,e[105]=te,e[106]=se):se=e[106];let oe;e[107]!==Y||e[108]!==se?(oe=s.jsxs(zt,{children:[Y,se]}),e[107]=Y,e[108]=se,e[109]=oe):oe=e[109];let ne;e[110]!==Ie||e[111]!==oe?(ne=s.jsx(Et,{open:Ie,onOpenChange:ue,children:oe}),e[110]=Ie,e[111]=oe,e[112]=ne):ne=e[112];let fe;return e[113]!==W||e[114]!==X||e[115]!==ne?(fe=s.jsxs(s.Fragment,{children:[W,X,ne]}),e[113]=W,e[114]=X,e[115]=ne,e[116]=fe):fe=e[116],fe}function ts(t){const e=U.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(jt,{repository:o})}),e[0]=o,e[1]=l):l=e[1],l}function ss(t){const e=U.c(4),{tools:o,connectionId:l,org:i}=t;let r;return e[0]!==l||e[1]!==i||e[2]!==o?(r=s.jsx(bt,{tools:o,connectionId:l,org:i}),e[0]=l,e[1]=i,e[2]=o,e[3]=r):r=e[3],r}function os(t){const e=U.c(50),{connection:o,connectionId:l,org:i,requestedTabId:r,collections:m,onUpdate:n,isUpdating:u}=t,h=at();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/mcps/$connectionId"},e[0]=c):c=e[0];const d=Oe(c);let g;e[1]!==l?(g={connectionId:l},e[1]=l,e[2]=g):g=e[2];const y=gt(g),p=y.isAuthenticated,j=o?.metadata?.repository,a=!!j?.url,$=o?.tools?.length??0;let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={id:"settings",label:"Settings"},e[3]=C):C=e[3];let b;e[4]!==p||e[5]!==$?(b=p&&$>0?[{id:"tools",label:"Tools",count:$}]:[],e[4]=p,e[5]=$,e[6]=b):b=e[6];let P;if(e[7]!==m||e[8]!==a||e[9]!==p||e[10]!==b){let x;e[12]!==a?(x=a?[{id:"readme",label:"README"}]:[],e[12]=a,e[13]=x):x=e[13],P=[C,...b,...p?(m||[]).map(ns):[],...x],e[7]=m,e[8]=a,e[9]=p,e[10]=b,e[11]=P}else P=e[11];const w=P,f=w.some(x=>x.id===r)?r:"settings";let A;e[14]!==d?(A=x=>{d({search:M=>({...M,tab:x}),replace:!0})},e[14]=d,e[15]=A):A=e[15];const I=A;let v;e[16]!==m?(v=m||[],e[16]=m,e[17]=v):v=e[17];let k;if(e[18]!==f||e[19]!==v){let x;e[21]!==f?(x=M=>M.name===f,e[21]=f,e[22]=x):x=e[22],k=v.find(x),e[18]=f,e[19]=v,e[20]=k}else k=e[20];const _=k;let O;e[23]!==h.history?(O=()=>h.history.back(),e[23]=h.history,e[24]=O):O=e[24];let N;e[25]!==f||e[26]!==I||e[27]!==w?(N=s.jsx(yt,{children:s.jsx(Ct,{tabs:w,activeTab:f,onTabChange:I})}),e[25]=f,e[26]=I,e[27]=w,e[28]=N):N=e[28];let E;e[29]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(We,{size:32,className:"animate-spin text-muted-foreground"})}),e[29]=E):E=e[29];let T;e[30]!==_||e[31]!==f||e[32]!==y.supportsOAuth||e[33]!==o||e[34]!==l||e[35]!==I||e[36]!==a||e[37]!==p||e[38]!==u||e[39]!==n||e[40]!==i||e[41]!==j?(T=s.jsx(ie.Suspense,{fallback:E,children:f==="tools"?s.jsx(ss,{tools:o.tools??void 0,connectionId:l,org:i}):f==="settings"?s.jsx(xt,{connection:o,onUpdate:n,isUpdating:u,isMCPAuthenticated:p,supportsOAuth:y.supportsOAuth,onViewReadme:a?()=>I("readme"):void 0}):f==="readme"&&a?s.jsx(ts,{repository:j}):_&&p?s.jsx(es,{connectionId:l,org:i,activeCollection:_},f):s.jsx(ze,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[30]=_,e[31]=f,e[32]=y.supportsOAuth,e[33]=o,e[34]=l,e[35]=I,e[36]=a,e[37]=p,e[38]=u,e[39]=n,e[40]=i,e[41]=j,e[42]=T):T=e[42];let S;e[43]!==f||e[44]!==T?(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:T},f)})}),e[43]=f,e[44]=T,e[45]=S):S=e[45];let z;return e[46]!==N||e[47]!==S||e[48]!==O?(z=s.jsxs(wt,{onBack:O,children:[N,S]}),e[46]=N,e[47]=S,e[48]=O,e[49]=z):z=e[49],z}function ns(t){return{id:t.name,label:t.displayName}}function is(){const t=U.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:r}=lt(l);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org/mcps/$connectionId"},t[2]=m):m=t[2];const u=rt(m).tab||"settings",h=Ke(i),c=pt(),d=ft(h??void 0);let g;t[3]!==c.update||t[4]!==i?(g=async j=>{await c.update.mutateAsync({id:i,data:j})},t[3]=c.update,t[4]=i,t[5]=g):g=t[5];const y=g;if(!h){let j;return t[6]!==o||t[7]!==r?(j=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(ze,{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:r}}),children:"Back to connections"})})}),t[6]=o,t[7]=r,t[8]=j):j=t[8],j}let p;return t[9]!==c.update.isPending||t[10]!==d||t[11]!==h||t[12]!==i||t[13]!==y||t[14]!==r||t[15]!==u?(p=s.jsx(os,{org:r,connection:h,connectionId:i,requestedTabId:u,collections:d,onUpdate:y,isUpdating:c.update.isPending}),t[9]=c.update.isPending,t[10]=d,t[11]=h,t[12]=i,t[13]=y,t[14]=r,t[15]=u,t[16]=p):p=t[16],p}function ls(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fe,{children:s.jsx(ie.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(We,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(is,{})})}),t[0]=e):e=t[0],e}function to(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ls,{}),t[0]=e):e=t[0],e}export{to as default};
@@ -1 +0,0 @@
1
- import{c as Fe,j as t,r as Me,a5 as He,b as Oe,a as Re,ar as Ve,as as Le}from"./index-Dbugj1Qf.js";import{C as Ue}from"./schema-CcVe4fys.js";import{C as We}from"./collection-header-LJs-cTFu.js";import{C as qe}from"./collection-page-QhbCfH_v.js";import{C as Ge}from"./collection-search-uhjPIekp.js";import{C as Je}from"./collection-table-wrapper-DqGkk2i2.js";import{C as Qe}from"./connection-card-BQ92NHJ6.js";import{E as ke}from"./SearchMd-3u9z3FIP.js";import{E as Xe}from"./error-boundary-CBpLdCwg.js";import{d as Ye,b as Ze,n as Ke,I as et}from"./use-connection-BcR9UFbs.js";import{u as tt,s as Pe}from"./use-list-state-DTFI-io6.js";import{u as nt}from"./tooltip-C_Is8XE4.js";import{c as ot,b as st,d as it,A as rt,e as lt,g as ct,a as at,f as dt}from"./alert-dialog-yp0b0MDg.js";import{B as mt}from"./badge-gmsvp75V.js";import{B as E}from"./button-eIETQb0Y.js";import{a as ut,b as pt,D as ht,f as ft,c as gt,d as xt}from"./dialog-BNPGtupv.js";import{b as Te,D as $e,a as Ae,d as he}from"./dropdown-menu-DKiYuSii.js";import{F as K,a as jt,b as B,c as H,d as O,f as R}from"./form-B0VrU06h.js";import{i as ze,s as Ee}from"./Trash01-CNckizo2.js";import{i as Ct}from"./Loading01-Dp6sT3Mq.js";import{I as Ie}from"./input-BWvhkgtS.js";import{c as _t,a as St,S as yt,b as vt,d as Ne}from"./select-BoIpHU2H.js";import{T as wt}from"./textarea-GonRChaT.js";import{g as bt}from"./generate-id-Dyweu44Y.js";import"./collection-display-button--hU2cKng.js";import"./utils-C9RgqtL7.js";import"./card-BeaxjjFM.js";import"./use-mobile-BAgI68xi.js";import"./X-Bo13gg4P.js";import"./ChevronRight-YHVS_LDJ.js";import"./ChevronDown-CLC0yxsk.js";const Dt=Ue.pick({title:!0,description:!0,connection_type:!0,connection_url:!0,connection_token:!0}).partial({description:!0,connection_token:!0});function kt(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 Nt(){const e=Fe.c(126),{org:n}=nt(),r=He();let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V={strict:!1},e[0]=V):V=e[0];const Be=Oe(V),{data:fe}=Re.useSession();let L;e[1]!==n.slug?(L={namespace:n.slug,resource:"connections"},e[1]=n.slug,e[2]=L):L=e[2];const o=tt(L),d=Ye(),F=Ze(o);let U;e[3]===Symbol.for("react.memo_cache_sentinel")?(U={mode:"idle"},e[3]=U):U=e[3];const[c,m]=Me.useReducer(kt,U),W=Be.action==="create";let q;e[4]!==r||e[5]!==n.slug?(q=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},e[4]=r,e[5]=n.slug,e[6]=q):q=e[6];const ge=q;let G;e[7]!==r||e[8]!==n.slug?(G=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{}})},e[7]=r,e[8]=n.slug,e[9]=G):G=e[9];const u=G;let J;e[10]===Symbol.for("react.memo_cache_sentinel")?(J={resolver:Ve(Dt),defaultValues:{title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null}},e[10]=J):J=e[10];const i=Le(J),l=c.mode==="editing"?c.connection:null;let Q,X;e[11]!==l||e[12]!==i?(Q=()=>{l?i.reset({title:l.title,description:l.description,connection_type:l.connection_type,connection_url:l.connection_url,connection_token:null}):i.reset({title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null})},X=[l,i],e[11]=l,e[12]=i,e[13]=Q,e[14]=X):(Q=e[13],X=e[14]),Me.useEffect(Q,X);let Y;e[15]!==d||e[16]!==c.connection||e[17]!==c.mode?(Y=async()=>{if(c.mode!=="deleting")return;const s=c.connection.id;m({type:"close"});try{await d.delete.mutateAsync(s)}catch{}},e[15]=d,e[16]=c.connection,e[17]=c.mode,e[18]=Y):Y=e[18];const xe=Y;let Z;e[19]!==d||e[20]!==u||e[21]!==l||e[22]!==i||e[23]!==r||e[24]!==n.id||e[25]!==n.slug||e[26]!==fe?.user?.id?(Z=async s=>{if(l){await d.update.mutateAsync({id:l.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}}}),m({type:"close"}),i.reset();return}const a=bt("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:fe?.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"}),u(),i.reset(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:a}})},e[19]=d,e[20]=u,e[21]=l,e[22]=i,e[23]=r,e[24]=n.id,e[25]=n.slug,e[26]=fe?.user?.id,e[27]=Z):Z=e[27];const je=Z;let ee;e[28]!==u||e[29]!==i||e[30]!==W?(ee=s=>{s||(W?u():m({type:"close"}),i.reset())},e[28]=u,e[29]=i,e[30]=W,e[31]=ee):ee=e[31];const p=ee;let te,ne,oe,se,ie,re;e[32]===Symbol.for("react.memo_cache_sentinel")?(te={id:"icon",header:"",render:Vt,cellClassName:"w-16 shrink-0",wrap:!0},ne={id:"title",header:"Name",render:Rt,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},oe={id:"description",header:"Description",render:Ot,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},se={id:"connection_type",header:"Type",accessor:Ht,cellClassName:"w-24 shrink-0",sortable:!0},ie={id:"connection_url",header:"URL",render:Bt,wrap:!0,cellClassName:"w-48 min-w-0 shrink-0"},re={id:"status",header:"Status",render:Kt,cellClassName:"w-24 shrink-0",sortable:!0},e[32]=te,e[33]=ne,e[34]=oe,e[35]=se,e[36]=ie,e[37]=re):(te=e[32],ne=e[33],oe=e[34],se=e[35],ie=e[36],re=e[37]);let le;e[38]!==r||e[39]!==n.slug?(le=[te,ne,oe,se,ie,re,{id:"actions",header:"",render:s=>t.jsxs(Te,{children:[t.jsx($e,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ft,children:t.jsx(ze,{size:20})})}),t.jsxs(Ae,{align:"end",onClick:Et,children:[t.jsxs(he,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(Pe,{size:16}),"Inspect"]}),t.jsxs(he,{variant:"destructive",onClick:a=>{a.stopPropagation(),m({type:"delete",connection:s})},children:[t.jsx(Ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[38]=r,e[39]=n.slug,e[40]=le):le=e[40];const Ce=le;let h;e[41]!==r||e[42]!==n.slug?(h=t.jsx(E,{variant:"outline",onClick:()=>r({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e[41]=r,e[42]=n.slug,e[43]=h):h=e[43];let f;e[44]!==ge?(f=t.jsx(E,{onClick:ge,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"}),e[44]=ge,e[45]=f):f=e[45];let ce;e[46]!==h||e[47]!==f?(ce=t.jsxs("div",{className:"flex items-center gap-2",children:[h,f]}),e[46]=h,e[47]=f,e[48]=ce):ce=e[48];const _e=ce,Se=W||c.mode==="editing",ye=l?"Edit Connection":"Create New Connection";let g;e[49]!==ye?(g=t.jsx(ut,{children:ye}),e[49]=ye,e[50]=g):g=e[50];const ve=l?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below.";let x;e[51]!==ve?(x=t.jsx(pt,{children:ve}),e[51]=ve,e[52]=x):x=e[52];let j;e[53]!==g||e[54]!==x?(j=t.jsxs(ht,{children:[g,x]}),e[53]=g,e[54]=x,e[55]=j):j=e[55];let C;e[56]!==i||e[57]!==je?(C=i.handleSubmit(je),e[56]=i,e[57]=je,e[58]=C):C=e[58];let _;e[59]!==i.control?(_=t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(K,{control:i.control,name:"title",render:zt}),t.jsx(K,{control:i.control,name:"description",render:At}),t.jsx(K,{control:i.control,name:"connection_type",render:$t}),t.jsx(K,{control:i.control,name:"connection_url",render:Tt}),t.jsx(K,{control:i.control,name:"connection_token",render:Pt})]}),e[59]=i.control,e[60]=_):_=e[60];let S;e[61]!==p?(S=t.jsx(E,{type:"button",variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[61]=p,e[62]=S):S=e[62];const we=i.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection";let y;e[63]!==i.formState.isSubmitting||e[64]!==we?(y=t.jsx(E,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:we}),e[63]=i.formState.isSubmitting,e[64]=we,e[65]=y):y=e[65];let v;e[66]!==S||e[67]!==y?(v=t.jsxs(ft,{children:[S,y]}),e[66]=S,e[67]=y,e[68]=v):v=e[68];let w;e[69]!==C||e[70]!==_||e[71]!==v?(w=t.jsxs("form",{onSubmit:C,children:[_,v]}),e[69]=C,e[70]=_,e[71]=v,e[72]=w):w=e[72];let b;e[73]!==i||e[74]!==w?(b=t.jsx(jt,{...i,children:w}),e[73]=i,e[74]=w,e[75]=b):b=e[75];let D;e[76]!==j||e[77]!==b?(D=t.jsxs(gt,{className:"sm:max-w-[525px]",children:[j,b]}),e[76]=j,e[77]=b,e[78]=D):D=e[78];let k;e[79]!==p||e[80]!==Se||e[81]!==D?(k=t.jsx(xt,{open:Se,onOpenChange:p,children:D}),e[79]=p,e[80]=Se,e[81]=D,e[82]=k):k=e[82];const be=c.mode==="deleting";let ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(ae=s=>!s&&m({type:"close"}),e[83]=ae):ae=e[83];let de;e[84]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(ot,{children:"Delete Connection?"}),e[84]=de):de=e[84];const De=c.mode==="deleting"&&c.connection.title;let N;e[85]!==De?(N=t.jsxs(st,{children:[de,t.jsxs(it,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:De}),"."]})]}),e[85]=De,e[86]=N):N=e[86];let me;e[87]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(rt,{children:"Cancel"}),e[87]=me):me=e[87];let M;e[88]!==xe?(M=t.jsxs(lt,{children:[me,t.jsx(ct,{onClick:xe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[88]=xe,e[89]=M):M=e[89];let I;e[90]!==N||e[91]!==M?(I=t.jsxs(at,{children:[N,M]}),e[90]=N,e[91]=M,e[92]=I):I=e[92];let P;e[93]!==be||e[94]!==I?(P=t.jsx(dt,{open:be,onOpenChange:ae,children:I}),e[93]=be,e[94]=I,e[95]=P):P=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],e[96]=ue):ue=e[96];let T;e[97]!==_e||e[98]!==o.handleSort||e[99]!==o.setViewMode||e[100]!==o.sortDirection||e[101]!==o.sortKey||e[102]!==o.viewMode?(T=t.jsx(We,{title:"MCP Servers",viewMode:o.viewMode,onViewModeChange:o.setViewMode,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,sortOptions:ue,ctaButton:_e}),e[97]=_e,e[98]=o.handleSort,e[99]=o.setViewMode,e[100]=o.sortDirection,e[101]=o.sortKey,e[102]=o.viewMode,e[103]=T):T=e[103];let $;e[104]!==o?($=s=>{s.key==="Escape"&&(o.setSearch(""),s.target.blur())},e[104]=o,e[105]=$):$=e[105];let A;e[106]!==o.search||e[107]!==o.setSearch||e[108]!==$?(A=t.jsx(Ge,{value:o.search,onChange:o.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:$}),e[106]=o.search,e[107]=o.setSearch,e[108]=$,e[109]=A):A=e[109];let z;e[110]!==Ce||e[111]!==F||e[112]!==o.handleSort||e[113]!==o.search||e[114]!==o.sortDirection||e[115]!==o.sortKey||e[116]!==o.viewMode||e[117]!==r||e[118]!==n.slug?(z=o.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:F.length===0?t.jsx(ke,{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:F.map(s=>t.jsx(Qe,{connection:s,fallbackIcon:t.jsx(Ke,{}),onClick:()=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),headerActions:t.jsxs(Te,{children:[t.jsx($e,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:It,children:t.jsx(ze,{size:20})})}),t.jsxs(Ae,{align:"end",onClick:Mt,children:[t.jsxs(he,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(Pe,{size:16}),"Inspect"]}),t.jsxs(he,{variant:"destructive",onClick:a=>{a.stopPropagation(),m({type:"delete",connection:s})},children:[t.jsx(Ee,{size:16}),"Delete"]})]})]})},s.id))})}):t.jsx(Je,{columns:Ce,data:F,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(ke,{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(ke,{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[110]=Ce,e[111]=F,e[112]=o.handleSort,e[113]=o.search,e[114]=o.sortDirection,e[115]=o.sortKey,e[116]=o.viewMode,e[117]=r,e[118]=n.slug,e[119]=z):z=e[119];let pe;return e[120]!==k||e[121]!==P||e[122]!==T||e[123]!==A||e[124]!==z?(pe=t.jsxs(qe,{children:[k,P,T,A,z]}),e[120]=k,e[121]=P,e[122]=T,e[123]=A,e[124]=z,e[125]=pe):pe=e[125],pe}function Mt(e){return e.stopPropagation()}function It(e){return e.stopPropagation()}function Pt(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Token (optional)"}),t.jsx(O,{children:t.jsx(Ie,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),t.jsx(R,{})]})}function Tt(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"URL *"}),t.jsx(O,{children:t.jsx(Ie,{placeholder:"https://example.com/mcp",...n})}),t.jsx(R,{})]})}function $t(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Type *"}),t.jsxs(_t,{value:n.value,onValueChange:n.onChange,children:[t.jsx(O,{children:t.jsx(St,{children:t.jsx(yt,{})})}),t.jsxs(vt,{children:[t.jsx(Ne,{value:"HTTP",children:"HTTP"}),t.jsx(Ne,{value:"SSE",children:"SSE"}),t.jsx(Ne,{value:"Websocket",children:"Websocket"})]})]}),t.jsx(R,{})]})}function At(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Description"}),t.jsx(O,{children:t.jsx(wt,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(R,{})]})}function zt(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Name *"}),t.jsx(O,{children:t.jsx(Ie,{placeholder:"My Connection",...n})}),t.jsx(R,{})]})}function Et(e){return e.stopPropagation()}function Ft(e){return e.stopPropagation()}function Kt(e){return t.jsx(mt,{variant:e.status==="active"?"success":"outline",children:e.status})}function Bt(e){return t.jsx("span",{className:"text-sm text-muted-foreground block truncate",children:e.connection_url})}function Ht(e){return t.jsx("span",{className:"text-sm font-medium",children:e.connection_type})}function Ot(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Rt(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Vt(e){return t.jsx(et,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(Ke,{})})}function yn(){const e=Fe.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Xe,{children:t.jsx(Me.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ct,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Nt,{})})}),e[0]=n):n=e[0],n}export{yn as default};
@@ -1 +0,0 @@
1
- import{ap as D,aq as O,c as _,a5 as N,ar as E,as as T,j as r,a as I}from"./index-Dbugj1Qf.js";import{A as M,a as L,b as R,c as $,d as q,e as B,f as V}from"./alert-dialog-yp0b0MDg.js";import{u as k,B as H}from"./button-eIETQb0Y.js";import{F as U,a as G,b as J,c as K,d as P,e as Q,f as W}from"./form-B0VrU06h.js";import{I as X}from"./input-BWvhkgtS.js";import{S as Y}from"./spinner-BgLCN9p1.js";function A(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Z=D({name:O().min(2,"Organization name is required")});function ne(n){const e=_.c(42),{open:o,onOpenChange:l}=n,y=N();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={resolver:E(Z),defaultValues:{name:""}},e[0]=b):b=e[0];const t=T(b);let z;e[1]!==y?(z={mutationFn:ee,onSuccess:i=>{const{orgSlug:s}=i;y({to:"/$org",params:{org:s}})}},e[1]=y,e[2]=z):z=e[2];const a=k(z),F=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsxs(R,{children:[r.jsx($,{children:"Create a new organization"}),r.jsx(q,{children:"Set up a new organization to collaborate with others."})]}),e[3]=C):C=e[3];let m;if(e[4]!==a||e[5]!==t){let i;e[7]!==a?(i=s=>a.mutateAsync(s),e[7]=a,e[8]=i):i=e[8],m=t.handleSubmit(i),e[4]=a,e[5]=t,e[6]=m}else m=e[6];let c;e[9]!==t.formState.isSubmitting?(c=i=>{const{field:s}=i;return r.jsxs(J,{children:[r.jsx(K,{children:"Organization Name"}),r.jsx(P,{children:r.jsx(X,{...s,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(Q,{children:"The name of your company or organization"}),s.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",A(s.value)]})]}),r.jsx(W,{})]})},e[9]=t.formState.isSubmitting,e[10]=c):c=e[10];let g;e[11]!==t.control||e[12]!==c?(g=r.jsx(U,{control:t.control,name:"name",render:c}),e[11]=t.control,e[12]=c,e[13]=g):g=e[13];let f;e[14]!==F?(f=F&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:F}),e[14]=F,e[15]=f):f=e[15];let u;e[16]!==a||e[17]!==t?(u=()=>{a.reset(),t.reset()},e[16]=a,e[17]=t,e[18]=u):u=e[18];let d;e[19]!==t.formState.isSubmitting||e[20]!==u?(d=r.jsx(M,{disabled:t.formState.isSubmitting,onClick:u,children:"Cancel"}),e[19]=t.formState.isSubmitting,e[20]=u,e[21]=d):d=e[21];const v=!t.formState.isValid||t.formState.isSubmitting;let p;e[22]!==t.formState.isSubmitting?(p=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Y,{size:"xs"})," Creating..."]}):"Create Organization",e[22]=t.formState.isSubmitting,e[23]=p):p=e[23];let S;e[24]!==v||e[25]!==p?(S=r.jsx(H,{type:"submit",variant:"default",disabled:v,children:p}),e[24]=v,e[25]=p,e[26]=S):S=e[26];let x;e[27]!==S||e[28]!==d?(x=r.jsxs(B,{children:[d,S]}),e[27]=S,e[28]=d,e[29]=x):x=e[29];let h;e[30]!==x||e[31]!==m||e[32]!==g||e[33]!==f?(h=r.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[g,f,x]}),e[30]=x,e[31]=m,e[32]=g,e[33]=f,e[34]=h):h=e[34];let j;e[35]!==t||e[36]!==h?(j=r.jsxs(L,{children:[C,r.jsx(G,{...t,children:h})]}),e[35]=t,e[36]=h,e[37]=j):j=e[37];let w;return e[38]!==l||e[39]!==o||e[40]!==j?(w=r.jsx(V,{open:o,onOpenChange:l,children:j}),e[38]=l,e[39]=o,e[40]=j,e[41]=w):w=e[41],w}async function ee(n){const e=A(n.name);if(!e)throw new Error("Organization slug is invalid");const o=await I.organization.create({name:n.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const l=o?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}export{ne as C};
@@ -1 +0,0 @@
1
- import{c as n,j as i,a7 as g,aK as m,aa as u,a8 as x,ab as j,a9 as N,ad as b,ac as D}from"./index-Dbugj1Qf.js";import{i as h}from"./X-Bo13gg4P.js";import{c}from"./utils-C9RgqtL7.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(D,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(u,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{R as D,E as a,O as b,T as c,k as d,w as e,B as f};
@@ -1 +0,0 @@
1
- import{r as p,c,j as d,bQ as m,bR as f,bS as g,bT as v,bU as x,bV as b,bW as h,bX as w,bY as C}from"./index-Dbugj1Qf.js";import{i as j}from"./ChevronRight-YHVS_LDJ.js";import{c as u}from"./utils-C9RgqtL7.js";const N=({size:a=24,color:e="currentColor",...t})=>p.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},p.createElement("path",{d:"M12 19V5m0 0-7 7m7-7 7 7"}));N.displayName="ArrowUp";const z=({size:a=24,color:e="currentColor",...t})=>p.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},p.createElement("path",{d:"M8.4 3H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 3.76 3 4.04 3 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 10 4.04 10 4.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 9.24 10 8.96 10 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 3 8.96 3 8.4 3Zm11 0h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 3.76 14 4.04 14 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 10 15.04 10 15.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 9.24 21 8.96 21 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 3 19.96 3 19.4 3Zm0 11h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 14.76 14 15.04 14 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 21 15.04 21 15.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 20.24 21 19.96 21 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 14 19.96 14 19.4 14Zm-11 0H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 14.76 3 15.04 3 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 20.24 10 19.96 10 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 14 8.96 14 8.4 14Z"}));z.displayName="Grid01";function D(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(m,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function y(a){const e=c.c(10);let t,o,s;e[0]!==a?({className:t,sideOffset:s,...o}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=s):(t=e[1],o=e[2],s=e[3]);const n=s===void 0?4:s;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==o||e[7]!==n||e[8]!==r?(i=d.jsx(g,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function E(a){const e=c.c(12);let t,o,s,n;e[0]!==a?({className:t,inset:o,variant:n,...s}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=s,e[4]=n):(t=e[1],o=e[2],s=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==s||e[9]!==i||e[10]!==r?(l=d.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:i,...s}),e[7]=o,e[8]=s,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function _(a){const e=c.c(8);let t,o;e[0]!==a?({className:t,...o}=a,e[0]=a,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let s;e[3]!==t?(s=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=s):s=e[4];let n;return e[5]!==o||e[6]!==s?(n=d.jsx(C,{"data-slot":"dropdown-menu-separator",className:s,...o}),e[5]=o,e[6]=s,e[7]=n):n=e[7],n}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(b,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function L(a){const e=c.c(13);let t,o,s,n;e[0]!==a?({className:o,inset:s,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=s,e[4]=n):(t=e[1],o=e[2],s=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(j,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-sub-trigger","data-inset":s,className:r,...n,children:[t,i]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(a){const e=c.c(8);let t,o;e[0]!==a?({className:t,...o}=a,e[0]=a,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let s;e[3]!==t?(s=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=s):s=e[4];let n;return e[5]!==o||e[6]!==s?(n=d.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:s,...o}),e[5]=o,e[6]=s,e[7]=n):n=e[7],n}export{$ as D,y as a,D as b,z as c,E as d,_ as e,T as f,L as g,R as h,N as i};
@@ -1 +0,0 @@
1
- import{c as d,j as m,bu as $,bZ as j,b_ as C,r as f,af as v,b$ as N,c0 as h}from"./index-Dbugj1Qf.js";import{c as u}from"./utils-C9RgqtL7.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,g=f.createContext({}),E=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(g.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext(I),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,b=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==b?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:b,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=b,t[12]=p):p=t[12],p},I=f.createContext({});function M(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function P(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function R(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function L(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function Z(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,D as a,M as b,P as c,R as d,L as e,Z as f};
@@ -1 +0,0 @@
1
- import{c as O,j as t,r as U,a5 as be,d as _e,ap as ve,by as oe,aq as ae,bb as we,ar as Ce,as as Ne,a6 as ie}from"./index-Dbugj1Qf.js";import{E as Se}from"./SearchMd-3u9z3FIP.js";import{E as ce}from"./error-boundary-CBpLdCwg.js";import{b as Te,I as ke}from"./use-connection-BcR9UFbs.js";import{T as Ie}from"./tool-set-selector-BbP0pfb9.js";import{b as $e,a as Ee}from"./use-gateway-DARIvLcH.js";import{B as L}from"./button-eIETQb0Y.js";import{c as M,b as q,T as W,a as H,i as re}from"./tooltip-C_Is8XE4.js";import{a as Fe}from"./Copy01-vEIIJ5sE.js";import{i as Ge}from"./CpuChip02-Ckd82HIH.js";import{i as de}from"./InfoCircle-BBnXokyi.js";import{i as le}from"./Loading01-Dp6sT3Mq.js";import{I as me}from"./input-BWvhkgtS.js";import{S as ze}from"./switch-nOTvNKSU.js";import{F as J,a as Ae,b as Q,d as X,f as Y,c as fe}from"./form-B0VrU06h.js";import{c as ue,a as xe,S as he,b as pe,d as K}from"./select-BoIpHU2H.js";import{s as Ve}from"./slugify-CEUa2lfQ.js";import{V as De,b as Pe}from"./layout-CX25ELhh.js";import{f as Be}from"./formatDistanceToNow-Ctx6mZEP.js";import"./utils-C9RgqtL7.js";import"./checkbox-BO8-3DdS.js";import"./ArrowLeft-B4oC_h6K.js";import"./collection-search-uhjPIekp.js";import"./ChevronDown-CLC0yxsk.js";function Ue(o){const s=new TextEncoder().encode(o),l=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(l)}function Oe(o){const e=O.c(52),{serverName:s,gatewayUrl:l}=o,[a,c]=U.useState(!1),[i,f]=U.useState(null),n=Ve(s);let r,d,g,j;if(e[0]!==l||e[1]!==n){const ee={type:"http",url:l},te={[n]:ee};r=JSON.stringify(te,null,2);const ne=ye=>JSON.stringify({...ee,headers:{"x-mesh-client":ye}},null,2),ge=Ue(ne("Cursor"));d=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(n)}&config=${encodeURIComponent(ge)}`;const je=ne("Claude Code");g=n;let se;e[6]===Symbol.for("react.memo_cache_sentinel")?(se=/'/g,e[6]=se):se=e[6],j=je.replace(se,"'\\''"),e[0]=l,e[1]=n,e[2]=r,e[3]=d,e[4]=g,e[5]=j}else r=e[2],d=e[3],g=e[4],j=e[5];const y=`claude mcp add "${g}" --config '${j}'`;let p;e[7]!==r?(p=async()=>{await navigator.clipboard.writeText(r),c(!0),ie.success("Configuration copied to clipboard"),setTimeout(()=>c(!1),2e3)},e[7]=r,e[8]=p):p=e[8];const x=p;let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=async(ee,te)=>{await navigator.clipboard.writeText(ee),f(te),ie.success(`${te} command copied`),setTimeout(()=>f(null),2e3)},e[9]=u):u=e[9];const F=u,R=Re;let z;e[10]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=z):z=e[10];let h;e[11]!==a?(h=a?t.jsx(re,{size:14}):t.jsx(Fe,{size:14}),e[11]=a,e[12]=h):h=e[12];let B;e[13]!==x||e[14]!==h?(B=t.jsx(W,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:x,children:h})}),e[13]=x,e[14]=h,e[15]=B):B=e[15];let V;e[16]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(H,{children:"Copy configuration"}),e[16]=V):V=e[16];let S;e[17]!==B?(S=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(M,{children:t.jsxs(q,{children:[B,V]})})}),e[17]=B,e[18]=S):S=e[18];let G;e[19]!==r||e[20]!==x?(G=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:x,children:r}),e[19]=r,e[20]=x,e[21]=G):G=e[21];let b;e[22]!==G||e[23]!==S?(b=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[S,G]}),e[22]=G,e[23]=S,e[24]=b):b=e[24];let _;e[25]!==d?(_=()=>R(d),e[25]=d,e[26]=_):_=e[26];let T,k;e[27]===Symbol.for("react.memo_cache_sentinel")?(T=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%)"}}),k=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=T,e[28]=k):(T=e[27],k=e[28]);let v;e[29]!==_?(v=t.jsx(W,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:_,children:[T,k]})}),e[29]=_,e[30]=v):v=e[30];let D;e[31]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(H,{children:"Add to Cursor"}),e[31]=D):D=e[31];let w;e[32]!==v?(w=t.jsx(M,{children:t.jsxs(q,{children:[v,D]})}),e[32]=v,e[33]=w):w=e[33];let I;e[34]!==y?(I=()=>F(y,"Claude"),e[34]=y,e[35]=I):I=e[35];let $,E;e[36]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),E=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=$,e[37]=E):($=e[36],E=e[37]);let C;e[38]!==i?(C=i==="Claude"&&t.jsx(re,{size:14,className:"ml-2 text-green-500"}),e[38]=i,e[39]=C):C=e[39];let N;e[40]!==I||e[41]!==C?(N=t.jsx(W,{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:I,children:[$,E,C]})}),e[40]=I,e[41]=C,e[42]=N):N=e[42];let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(H,{children:"Add to Claude Code"}),e[43]=A):A=e[43];let m;e[44]!==N?(m=t.jsx(M,{children:t.jsxs(q,{children:[N,A]})}),e[44]=N,e[45]=m):m=e[45];let P;e[46]!==w||e[47]!==m?(P=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[w,m]}),e[46]=w,e[47]=m,e[48]=P):P=e[48];let Z;return e[49]!==b||e[50]!==P?(Z=t.jsxs("div",{className:"flex flex-col gap-4",children:[z,b,P]}),e[49]=b,e[50]=P,e[51]=Z):Z=e[51],Z}function Re(o){window.open(o,"_blank")}const Je=ve({title:ae().min(1,"Name is required").max(255),description:ae().nullable(),status:oe(["active","inactive"]),tool_selection_mode:oe(["inclusion","exclusion"]),tool_selection_strategy:oe(["passthrough","smart_tool_selection","code_execution"])});function Le(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const a=e.get(l.connection_id)??[];a.length>0&&(s[l.connection_id]=a)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Me(o,e){return Object.entries(o).map(([s,l])=>{const a=e.get(s)??[],c=a.length>0&&a.every(i=>l.includes(i));return{connection_id:s,selected_tools:c?null:l}})}function qe(o){const e=O.c(29),{form:s,toolSet:l,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]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ge,{}),e[2]=f):f=e[2];let n;e[3]!==c||e[4]!==i?(n=t.jsx(ke,{icon:c,name:i,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=c,e[4]=i,e[5]=n):n=e[5];let r;e[6]!==s.control?(r=t.jsx(J,{control:s.control,name:"status",render:Xe}),e[6]=s.control,e[7]=r):r=e[7];let d;e[8]!==n||e[9]!==r?(d=t.jsxs("div",{className:"flex items-start justify-between",children:[n,r]}),e[8]=n,e[9]=r,e[10]=d):d=e[10];let g;e[11]!==s.control?(g=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(J,{control:s.control,name:"title",render:Qe}),t.jsx(J,{control:s.control,name:"description",render:Ke})]}),e[11]=s.control,e[12]=g):g=e[12];let j;e[13]!==d||e[14]!==g?(j=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[d,g]}),e[13]=d,e[14]=g,e[15]=j):j=e[15];let y;e[16]!==s.control?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(J,{control:s.control,name:"tool_selection_mode",render:He}),t.jsx(J,{control:s.control,name:"tool_selection_strategy",render:We})]}),e[16]=s.control,e[17]=y):y=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center p-5",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),e[18]=p):p=e[18];let x;e[19]!==a||e[20]!==l?(x=t.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:t.jsx(ce,{children:t.jsx(U.Suspense,{fallback:p,children:t.jsx(Ie,{toolSet:l,onToolSetChange:a})})})}),e[19]=a,e[20]=l,e[21]=x):x=e[21];let u;e[22]!==x||e[23]!==j||e[24]!==y?(u=t.jsxs("div",{className:"flex flex-col h-full",children:[j,y,x]}),e[22]=x,e[23]=j,e[24]=y,e[25]=u):u=e[25];let F;return e[26]!==s||e[27]!==u?(F=t.jsx(Ae,{...s,children:u}),e[26]=s,e[27]=u,e[28]=F):F=e[28],F}function We(o){const{field:e}=o;return t.jsxs(Q,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(fe,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(M,{children:t.jsxs(q,{children:[t.jsx(W,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(de,{size:14,className:"text-muted-foreground"})})}),t.jsx(H,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"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(ue,{value:e.value,onValueChange:e.onChange,children:[t.jsx(X,{children:t.jsx(xe,{className:"w-[180px]",children:t.jsx(he,{})})}),t.jsxs(pe,{children:[t.jsx(K,{value:"passthrough",children:"Passthrough"}),t.jsx(K,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(K,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(Y,{})]})}function He(o){const{field:e}=o;return t.jsxs(Q,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(fe,{className:"mb-0",children:"Tool Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(M,{children:t.jsxs(q,{children:[t.jsx(W,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(de,{size:14,className:"text-muted-foreground"})})}),t.jsx(H,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected connections/tools are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All connections/tools except selected ones are exposed."]})]})})]})}),t.jsxs(ue,{value:e.value,onValueChange:e.onChange,children:[t.jsx(X,{children:t.jsx(xe,{className:"w-[180px]",children:t.jsx(he,{})})}),t.jsxs(pe,{children:[t.jsx(K,{value:"inclusion",children:"Include Selected"}),t.jsx(K,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Y,{})]})}function Ke(o){const{field:e}=o;return t.jsxs(Q,{className:"w-full space-y-0",children:[t.jsx(X,{children:t.jsx(me,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Y,{})]})}function Qe(o){const{field:e}=o;return t.jsxs(Q,{className:"w-full space-y-0",children:[t.jsx(X,{children:t.jsx(me,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Gateway Name"})}),t.jsx(Y,{})]})}function Xe(o){const{field:e}=o;return t.jsxs(Q,{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(X,{children:t.jsx(ze,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Y,{})]})}function Ye(o){const e=O.c(53),{gateway:s,gatewayId:l}=o,a=we(),c=Ee();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const f=Te(i);let n;if(e[1]!==f){n=new Map;for(const m of f)m.tools&&m.tools.length>0&&n.set(m.id,m.tools.map(Ze));e[1]=f,e[2]=n}else n=e[2];let r;e[3]!==n||e[4]!==s?(r=()=>Le(s,n),e[3]=n,e[4]=s,e[5]=r):r=e[5];const[d,g]=U.useState(r),[j,y]=U.useState(!1);let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=m=>{g(m),y(!0)},e[6]=p):p=e[6];const x=p;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=Ce(Je),e[7]=u):u=e[7];const F=s.tool_selection_mode??"inclusion",R=s.tool_selection_strategy??"passthrough";let z;e[8]!==s.description||e[9]!==s.status||e[10]!==s.title||e[11]!==F||e[12]!==R?(z={resolver:u,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:F,tool_selection_strategy:R}},e[8]=s.description,e[9]=s.status,e[10]=s.title,e[11]=F,e[12]=R,e[13]=z):z=e[13];const h=Ne(z),V=h.formState.isDirty||j;let S;e[14]!==c.update||e[15]!==n||e[16]!==h||e[17]!==l||e[18]!==d?(S=async()=>{const m=h.getValues(),P=Me(d,n);await c.update.mutateAsync({id:l,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:P}}),h.reset(m),y(!1)},e[14]=c.update,e[15]=n,e[16]=h,e[17]=l,e[18]=d,e[19]=S):S=e[19];const G=S;let b;e[20]!==a.history?(b=()=>a.history.back(),e[20]=a.history,e[21]=b):b=e[21];let _;e[22]!==c.update.isPending||e[23]!==G||e[24]!==V?(_=V&&t.jsxs(L,{onClick:G,disabled:c.update.isPending,size:"sm",className:"h-7",children:[c.update.isPending&&t.jsx(le,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[22]=c.update.isPending,e[23]=G,e[24]=V,e[25]=_):_=e[25];let T;e[26]!==_?(T=t.jsx(De,{children:_}),e[26]=_,e[27]=T):T=e[27];let k;e[28]!==h||e[29]!==s.icon||e[30]!==d?(k=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(qe,{form:h,toolSet:d,onToolSetChange:x,icon:s.icon})}),e[28]=h,e[29]=s.icon,e[30]=d,e[31]=k):k=e[31];let v;e[32]!==s.id||e[33]!==s.title?(v=s.title||`gateway-${s.id.slice(0,8)}`,e[32]=s.id,e[33]=s.title,e[34]=v):v=e[34];const D=`${window.location.origin}/mcp/gateway/${s.id}`;let w;e[35]!==v||e[36]!==D?(w=t.jsx("div",{className:"p-5",children:t.jsx(Oe,{serverName:v,gatewayUrl:D})}),e[35]=v,e[36]=D,e[37]=w):w=e[37];let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[38]=I):I=e[38];let $;e[39]!==s.updated_at?($=s.updated_at?Be(new Date(s.updated_at),{addSuffix:!1}):"Unknown",e[39]=s.updated_at,e[40]=$):$=e[40];let E;e[41]!==$?(E=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[I,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:$})]}),e[41]=$,e[42]=E):E=e[42];let C;e[43]!==w||e[44]!==E?(C=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[w,E]}),e[43]=w,e[44]=E,e[45]=C):C=e[45];let N;e[46]!==k||e[47]!==C?(N=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[k,C]}),e[46]=k,e[47]=C,e[48]=N):N=e[48];let A;return e[49]!==T||e[50]!==N||e[51]!==b?(A=t.jsxs(Pe,{onBack:b,children:[T,N]}),e[49]=T,e[50]=N,e[51]=b,e[52]=A):A=e[52],A}function Ze(o){return o.name}function et(){const o=O.c(8);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=be(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},o[1]=l):l=o[1];const{gatewayId:a,org:c}=_e(l),i=$e(a);if(!i){let n;return o[2]!==s||o[3]!==c?(n=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Se,{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]=n):n=o[4],n}let f;return o[5]!==i||o[6]!==a?(f=t.jsx(Ye,{gateway:i,gatewayId:a}),o[5]=i,o[6]=a,o[7]=f):f=o[7],f}function tt(){const o=O.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ce,{children:t.jsx(U.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(et,{})})}),o[0]=e):e=o[0],e}function St(){const o=O.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{}),o[0]=e):e=o[0],e}export{St as default};
@@ -1 +0,0 @@
1
- import{c as te,j as t,r as se,a5 as ae,a6 as re}from"./index-Dbugj1Qf.js";import{C as ie}from"./collection-header-LJs-cTFu.js";import{C as ne}from"./collection-page-QhbCfH_v.js";import{C as le}from"./collection-search-uhjPIekp.js";import{C as ce}from"./collection-table-wrapper-DqGkk2i2.js";import{C as de}from"./connection-card-BQ92NHJ6.js";import{E as q}from"./SearchMd-3u9z3FIP.js";import{E as me}from"./error-boundary-CBpLdCwg.js";import{b as ue,I as ge}from"./use-connection-BcR9UFbs.js";import{a as pe,u as he}from"./use-gateway-DARIvLcH.js";import{u as fe,s as Q}from"./use-list-state-DTFI-io6.js";import{u as xe}from"./tooltip-C_Is8XE4.js";import{c as ye,b as we,d as je,A as Ce,e as Ne,g as De,a as Se,f as ve}from"./alert-dialog-yp0b0MDg.js";import{B as oe}from"./badge-gmsvp75V.js";import{B as J}from"./button-eIETQb0Y.js";import{b as U,D as X,a as Y,d as B}from"./dropdown-menu-DKiYuSii.js";import{i as y}from"./CpuChip02-Ckd82HIH.js";import{i as Z,s as ee}from"./Trash01-CNckizo2.js";import{i as be}from"./Loading01-Dp6sT3Mq.js";import"./collection-display-button--hU2cKng.js";import"./utils-C9RgqtL7.js";import"./input-BWvhkgtS.js";import"./card-BeaxjjFM.js";import"./use-mobile-BAgI68xi.js";import"./ChevronRight-YHVS_LDJ.js";function ke(e,a){switch(a.type){case"delete":return{mode:"deleting",gateway:a.gateway};case"close":return{mode:"idle"}}}function _e(){const e=te.c(68),{org:a}=xe(),r=ae();let w;e[0]!==a.slug?(w={namespace:a.slug,resource:"gateways"},e[0]=a.slug,e[1]=w):w=e[1];const s=fe(w),i=pe(),x=he(s);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={},e[2]=j):j=e[2];const R=ue(j);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[n,N]=se.useReducer(ke,C);let D;e[4]!==i.create||e[5]!==R.length||e[6]!==r||e[7]!==a.slug?(D=async()=>{if(R.length===0){re.error("Create at least one MCP connection first");return}const o=await i.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:[]});r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},e[4]=i.create,e[5]=R.length,e[6]=r,e[7]=a.slug,e[8]=D):D=e[8];const T=D;let S;e[9]!==i.delete||e[10]!==n.gateway||e[11]!==n.mode?(S=async()=>{if(n.mode!=="deleting")return;const o=n.gateway.id;N({type:"close"});try{await i.delete.mutateAsync(o)}catch{}},e[9]=i.delete,e[10]=n.gateway,e[11]=n.mode,e[12]=S):S=e[12];const O=S;let v,b,k,_,M,I;e[13]===Symbol.for("react.memo_cache_sentinel")?(b={id:"icon",header:"",render:Be,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:Ke,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_={id:"description",header:"Description",render:Ge,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},M={id:"mode",header:"Mode",accessor:Ee,cellClassName:"w-[100px]"},I={id:"connections",header:"Connections",render:Ae,cellClassName:"w-24 shrink-0"},v={id:"status",header:"Status",render:ze,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=v,e[14]=b,e[15]=k,e[16]=_,e[17]=M,e[18]=I):(v=e[13],b=e[14],k=e[15],_=e[16],M=e[17],I=e[18]);let P;e[19]!==r||e[20]!==a.slug?(P=[b,k,_,M,I,v,{id:"actions",header:"",render:o=>t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$e,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Pe,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=r,e[20]=a.slug,e[21]=P):P=e[21];const V=P,H=i.create.isPending?"Creating...":"Create MCP Gateway";let $;e[22]!==i.create.isPending||e[23]!==T||e[24]!==H?($=t.jsx(J,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i.create.isPending,children:H}),e[22]=i.create.isPending,e[23]=T,e[24]=H,e[25]=$):$=e[25];const L=$,F=n.mode==="deleting";let z;e[26]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[26]=z):z=e[26];let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ye,{children:"Delete Gateway?"}),e[27]=A):A=e[27];const W=n.mode==="deleting"&&n.gateway.title;let c;e[28]!==W?(c=t.jsxs(we,{children:[A,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=c):c=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[30]=E):E=e[30];let d;e[31]!==O?(d=t.jsxs(Ne,{children:[E,t.jsx(De,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=O,e[32]=d):d=e[32];let m;e[33]!==c||e[34]!==d?(m=t.jsxs(Se,{children:[c,d]}),e[33]=c,e[34]=d,e[35]=m):m=e[35];let u;e[36]!==F||e[37]!==m?(u=t.jsx(ve,{open:F,onOpenChange:z,children:m}),e[36]=F,e[37]=m,e[38]=u):u=e[38];let 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 g;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(g=t.jsx(ie,{title:"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]=g):g=e[46];let p;e[47]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=p):p=e[48];let h;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==p?(h=t.jsx(le,{value:s.search,onChange:s.setSearch,placeholder:"Search for a gateway...",onKeyDown:p}),e[49]=s.search,e[50]=s.setSearch,e[51]=p,e[52]=h):h=e[52];let f;e[53]!==V||e[54]!==x||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==r||e[61]!==a.slug?(f=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(q,{image:t.jsx(y,{size:36,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:x.map(o=>t.jsx(de,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(y,{}),onClick:()=>r({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(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Me,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ce,{columns:V,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways found",description:`No gateways match "${s.search}"`}):t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways yet",description:"Create a gateway to aggregate tools from multiple MCP connections."})}),e[53]=V,e[54]=x,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=r,e[61]=a.slug,e[62]=f):f=e[62];let K;return e[63]!==u||e[64]!==g||e[65]!==h||e[66]!==f?(K=t.jsxs(ne,{children:[u,g,h,f]}),e[63]=u,e[64]=g,e[65]=h,e[66]=f,e[67]=K):K=e[67],K}function Me(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function Pe(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function ze(e){return t.jsx(oe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Ae(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Ee(e){return t.jsx(oe,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ge(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Ke(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Be(e){return t.jsx(ge,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(y,{size:16})})}function dt(){const e=te.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(me,{children:t.jsx(se.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_e,{})})}),e[0]=a):a=e[0],a}export{dt as default};
@@ -1 +0,0 @@
1
- import{c as u,j as i,a as w,r as C,a5 as E}from"./index-Dbugj1Qf.js";import{C as _}from"./card-BeaxjjFM.js";import{c as v}from"./utils-C9RgqtL7.js";import{A as $}from"./avatar-i3GM_9o4.js";import{i as k}from"./AlertCircle-VUVelpvY.js";import{s as A}from"./Plus-LcofPC9C.js";import{B as O}from"./button-eIETQb0Y.js";import{I as L}from"./input-BWvhkgtS.js";import{C as D}from"./create-organization-dialog-ELVAlnoy.js";import"./alert-dialog-yp0b0MDg.js";import"./form-B0VrU06h.js";import"./spinner-BgLCN9p1.js";function F(t){const e=u.c(10),{children:n,className:l,onNavigate:s,showHoverRing:r}=t,x=r===void 0?!1:r;let a;e[0]!==s?(a=p=>{s&&s(p)},e[0]=s,e[1]=a):a=e[1];const d=a,m=s&&"cursor-pointer",o=x&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==m||e[4]!==o?(c=v("group transition-all flex flex-col gap-0",m,o,l),e[2]=l,e[3]=m,e[4]=o,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==d||e[8]!==c?(g=i.jsx(_,{className:c,onClick:d,children:n}),e[6]=n,e[7]=d,e[8]=c,e[9]=g):g=e[9],g}function H(t){const e=u.c(7),{url:n,fallback:l,shape:s,size:r,objectFit:x,className:a}=t,d=s===void 0?"square":s,m=r===void 0?"lg":r,o=x===void 0?"contain":x;let c;return e[0]!==a||e[1]!==l||e[2]!==o||e[3]!==d||e[4]!==m||e[5]!==n?(c=i.jsx($,{url:n,fallback:l,shape:d,size:m,objectFit:o,className:a}),e[0]=a,e[1]=l,e[2]=o,e[3]=d,e[4]=m,e[5]=n,e[6]=c):c=e[6],c}function R(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function B(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("font-medium truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("p",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function G(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("h3",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex flex-col gap-[2px]",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function I(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex justify-between items-start",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function M(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function Q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function T(){const t=u.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex justify-between items-start",children:i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-[2px]",children:[i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),i.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(_,{className:"group transition-colors flex flex-col",children:[n,i.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const b=Object.assign(F,{Avatar:H,AvatarSection:I,Header:R,Title:B,Subtitle:G,Content:q,Footer:M,Badge:Q,Skeleton:T}),P={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},V={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},X={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},J={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},K={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},U={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function z(t){const e=u.c(13),{children:n,columns:l,gap:s,className:r}=t;let x;e[0]!==l?(x=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=x):x=e[1];const a=x,m=P[s===void 0?4:s],o=a.sm&&V[a.sm],c=a.md&&X[a.md],g=a.lg&&J[a.lg],p=a.xl&&K[a.xl],j=a["2xl"]&&U[a["2xl"]];let h;e[2]!==r||e[3]!==m||e[4]!==o||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==j?(h=v("w-full grid",m,o,c,g,p,j,r),e[2]=r,e[3]=m,e[4]=o,e[5]=c,e[6]=g,e[7]=p,e[8]=j,e[9]=h):h=e[9];const N=h;let f;return e[10]!==n||e[11]!==N?(f=i.jsx("div",{className:N,children:n}),e[10]=n,e[11]=N,e[12]=f):f=e[12],f}function W(t){const e=u.c(9),{count:n,columns:l,gap:s,className:r}=t,x=n===void 0?8:n;let a;e[0]!==l?(a=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=a):a=e[1];const d=a,m=s===void 0?4:s;let o;e[2]!==x?(o=Array.from({length:x}).map(Y),e[2]=x,e[3]=o):o=e[3];let c;return e[4]!==r||e[5]!==d||e[6]!==m||e[7]!==o?(c=i.jsx(z,{columns:d,gap:m,className:r,children:o}),e[4]=r,e[5]=d,e[6]=m,e[7]=o,e[8]=c):c=e[8],c}function Y(t,e){return i.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),i.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const S=Object.assign(z,{Skeleton:W});function Z(t){const e=u.c(14),{query:n}=t,{data:l}=w.useListOrganizations(),s=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const o=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(o)||c.slug.toLowerCase().includes(o))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const x=r;if(!l||l.length===0){let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=o):o=e[3],o}if(x.length===0){let o;return e[4]!==n?(o=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=o):o=e[5],o}let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a={sm:2,md:3,lg:4},e[6]=a):a=e[6];let d;if(e[7]!==x||e[8]!==s){let o;e[10]!==s?(o=c=>i.jsxs(b,{onNavigate:()=>s({to:"/$org",params:{org:c.slug}}),children:[i.jsxs(b.Header,{children:[i.jsx(b.AvatarSection,{children:i.jsx(b.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),i.jsxs(b.Content,{children:[i.jsxs(b.Subtitle,{children:["@",c.slug]}),i.jsx(b.Title,{children:c.name})]})]}),i.jsx(b.Footer,{children:i.jsxs("div",{className:"text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=s,e[11]=o):o=e[11],d=x.map(o),e[7]=x,e[8]=s,e[9]=d}else d=e[9];let m;return e[12]!==d?(m=i.jsx(S,{columns:a,children:d}),e[12]=d,e[13]=m):m=e[13],m}function ee(t){const e=u.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(k,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let s;return e[1]!==n.message?(s=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:[l,i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=s):s=e[2],s}function te(){const t=u.c(20),{error:e,isPending:n}=w.useListOrganizations(),[l,s]=C.useState(""),[r,x]=C.useState(!1),a=C.useDeferredValue(l);if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex items-center justify-between mb-8",children:i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"})}),t[0]=f):f=t[0];let y;return t[1]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[f,i.jsx("div",{className:"@container",children:i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})]}),t[1]=y):y=t[1],y}if(e){let f;return t[2]!==e?(f=i.jsx(ee,{error:e}),t[2]=e,t[3]=f):f=t[3],f}let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"}),t[4]=d):d=t[4];let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=f=>s(f.target.value),t[5]=m):m=t[5];let o;t[6]!==l?(o=i.jsx(L,{className:"max-w-xs",placeholder:"Search",value:l,onChange:m}),t[6]=l,t[7]=o):o=t[7];let c;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsxs(O,{variant:"default",onClick:()=>x(!0),children:[i.jsx(A,{size:16}),i.jsx("span",{children:"New organization"})]}),t[8]=c):c=t[8];let g;t[9]!==o?(g=i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[d,i.jsxs("div",{className:"flex items-center gap-2",children:[o,c]})]}),t[9]=o,t[10]=g):g=t[10];let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[11]=p):p=t[11];let j;t[12]!==a?(j=i.jsx("div",{className:"@container",children:i.jsx(C.Suspense,{fallback:p,children:i.jsx(Z,{query:a})})}),t[12]=a,t[13]=j):j=t[13];let h;t[14]!==r?(h=i.jsx(D,{open:r,onOpenChange:x}),t[14]=r,t[15]=h):h=t[15];let N;return t[16]!==g||t[17]!==j||t[18]!==h?(N=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[g,j,h]}),t[16]=g,t[17]=j,t[18]=h,t[19]=N):N=t[19],N}function ue(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"min-h-full",children:i.jsx(te,{})}),t[0]=e):e=t[0],e}export{ue as default};