1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5553],{18060:function(e,t,n){n.d(t,{V:function(){return useClipboard}});var i=n(67294);function useClipboard({timeout:e=2e3}={}){let[t,n]=(0,i.useState)(null),[r,l]=(0,i.useState)(!1),[s,o]=(0,i.useState)(null),handleCopyResult=t=>{clearTimeout(s),o(setTimeout(()=>l(!1),e)),l(t)};return{copy:e=>{"clipboard"in navigator?navigator.clipboard.writeText(e).then(()=>handleCopyResult(!0)).catch(e=>n(e)):n(Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{l(!1),n(null),clearTimeout(s)},error:t,copied:r}}},93625:function(e,t,n){n.d(t,{Z:function(){return i}});var i=(0,n(30853).Z)("copy","IconCopy",[["path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2",key:"svg-1"}]])},21942:function(e,t,n){n.d(t,{Z:function(){return i}});var i=(0,n(30853).Z)("edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]])},17010:function(e,t,n){n.d(t,{Z:function(){return i}});var i=(0,n(30853).Z)("info-circle","IconInfoCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 9h.01",key:"svg-1"}],["path",{d:"M11 12h1v4h1",key:"svg-2"}]])},1177:function(e,t,n){n.d(t,{Z:function(){return i}});var i=(0,n(30853).Z)("plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]])},40102:function(e,t,n){n.d(t,{v:function(){return CopyTextValue}});var i=n(85893),r=n(56817),l=n(58404),s=n(71298),o=n(64761),c=n(64523),a=n(95117),d=n(88393),u=n(49834),h=n(18060),p=n(88198),x=n(93625),C=n(54070),g=n(95427);let m=(0,r.k)((e,t)=>{let{expand:n,canHighlight:i,copied:r,iconAlignment:o,iconPosition:c,withBackground:a,fitContent:d,fontSize:u,label:h,variant:p,onlyOneLine:x}=t,m=C.xR.MainBackgroundColor,f=C.xR.MainTextColor,_=C.xR.ActionButtonColor;switch(p){case C.kI.Login:m=C.xR.LoginForegroundColor,f=C.xR.LoginForegroundTextColor,_=C.xR.LoginSuccessButtonColor;break;case C.kI.Sidebar:m=C.xR.SidebarBackgroundColor,f=C.xR.SidebarTextColor}return{root:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",width:d?"fit-content":"100%",maxWidth:"100%",...x&&{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},inner:{display:"flex",flexDirection:"row",alignItems:"top"===o?"flex-start":"center",justifyContent:"flex-start",width:"100%",cursor:i?"standard":"pointer",padding:a?e.spacing.md:0,paddingRight:a?"left"===c?e.spacing.lg:e.spacing.md:0,paddingLeft:a?"right"===c?e.spacing.lg:e.spacing.md:0,marginTop:a&&h?e.spacing.sm:0,border:a?"1px solid ".concat((0,g.tv)(e,p)):"none",borderRadius:e.radius.md,backgroundColor:a?e.colors[m][6]:"transparent","&:hover":{backgroundColor:a?i?e.colors[m][6]:e.fn.darken(e.colors[m][6],.1):"transparent"},["&:hover .".concat((0,l.A)("text"))]:{color:i||a?e.colors[f][6]:e.fn.lighten(e.colors[f][6],.4)},["&:hover .".concat((0,l.A)("icon"))]:{color:r?e.colors[_][6]:i||a?e.colors[f][6]:e.fn.lighten(e.colors[f][6],.4)}},label:{fontSize:e.fontSizes.sm,fontWeight:500,cursor:"default"},text:{ref:(0,l.A)("text"),fontSize:(0,s.px)(u),fontWeight:500,fontFamily:e.fontFamily,overflow:n?"visible":"hidden",overflowWrap:n?"anywhere":"normal",textOverflow:n?"visible":"ellipsis",width:"100%",cursor:i?"text":"pointer",color:e.colors[f][6]},icon:{ref:(0,l.A)("icon"),color:r?e.colors[_][6]:e.colors[f][6],backgroundColor:"transparent",marginRight:"left"===c&&i?e.spacing.md:e.spacing.sm,width:"fit-content","&:hover":{backgroundColor:i?a?e.fn.rgba(e.colors[m][6],.1):e.colors[m][6]:"transparent"}}}});function CopyTextValue(e){let{value:t,expand:n=!1,canHighlight:r=!1,iconAlignment:l="center",iconPosition:s="left",timeout:g=1e3,withBackground:f=!1,fitContent:_=!1,fontSize:j=16,label:v,variant:w=C.kI.Main,onlyOneLine:b=!1,...y}=e,M=(0,h.V)({timeout:g}),{classes:k}=m({expand:n,canHighlight:r,copied:M.copied,iconAlignment:l,iconPosition:s,withBackgroun
1d:f,fitContent:_,fontSize:j,label:v,variant:w,onlyOneLine:b}),S=(0,o.rZ)(),copyValue=()=>{M.copy(t),y.onCopy&&y.onCopy()},R=w===C.kI.Main?C.kI.Sidebar:w;return(0,i.jsxs)(c.x,{className:k.root,...y,children:[v&&(0,i.jsx)(a.x,{className:k.label,children:v}),(0,i.jsx)(d.u.Floating,{variant:R,label:M.copied?"Copied":"Copy",disabled:r,children:(0,i.jsxs)(c.x,{className:k.inner,onClick:()=>{r||copyValue()},children:["right"===s&&(0,i.jsx)(a.x,{className:"".concat(k.text," ph-no-capture"),children:t}),(0,i.jsx)(d.u.Floating,{variant:R,label:M.copied?"Copied":"Copy",disabled:!r,children:(0,i.jsx)(u.A,{className:k.icon,onClick:()=>{r&©Value()},children:M.copied?(0,i.jsx)(p.Z,{size:S.other.iconSizes.lg}):(0,i.jsx)(x.Z,{size:S.other.iconSizes.lg})})}),"left"===s&&(0,i.jsx)(a.x,{className:"".concat(k.text," ph-no-capture"),children:t})]})})]})}},55553:function(e,t,n){n.r(t),n.d(t,{__N_SSP:function(){return O},default:function(){return mcp_clients}});var i=n(85893),r=n(64761),l=n(97564),s=n(19236),o=n(95117),c=n(35886),a=n(20050),d=n(88393),u=n(64523),h=n(67841),p=n(66137),x=n(91759),C=n(1177),g=n(30202),m=n(78551),f=n(67294),_=n(1448);let apiFetchMcpClients=async e=>{let{page_number:t,page_size:n=10}=e;return(0,_.A_)("/api/fe/v3/mcp_client",{page_size:n.toString(),page_number:t.toString()}).then(e=>e.ok?e.json().then(e=>{let t={...e,clients:e.clients.map(e=>({...e,redirect_uris:e.redirect_uris.map(e=>e.startsWith("/")?"http://127.0.0.1".concat(e):e)}))};return{success:!0,data:t}}):404===e.status?{success:!1,error_type:"not_found"}:401===e.status?(0,_.Yg)():(0,_.xo)())},apiCreateMcpClient=async e=>(0,_.j0)("/api/fe/v3/mcp_client",e).then(e=>e.ok?e.json().then(e=>({success:!0,data:e})):401===e.status?(0,_.Yg)():(0,_.xo)()),apiUpdateMcpClient=async e=>(0,_.Ll)("/api/fe/v3/mcp_client",e).then(e=>e.ok?{success:!0}:401===e.status?(0,_.Yg)():(0,_.xo)()),apiDeleteMcpClient=async e=>{let{client_id:t}=e;return(0,_.Jl)("/api/fe/v3/mcp_client",{client_id:t}).then(e=>e.ok?{success:!0}:404===e.status?{success:!1,error_type:"not_found"}:401===e.status?(0,_.Yg)():(0,_.xo)())};var j=n(86093);let v=(0,f.createContext)(null),useMcpClients=()=>{let e=(0,f.useContext)(v);if(!e)throw Error("mcpClientsContext: No value provided");return e},McpClientsContextProvider=e=>{let{children:t,pageConfig:n}=e,r=(0,g.NL)(),[l,s]=(0,f.useState)(1),o={...n,mcp_redirect_uri_options:n.mcp_redirect_uri_options.map(e=>({...e,local_redirect_paths:e.local_redirect_paths.map(e=>e.startsWith("/")?"http://127.0.0.1".concat(e):e)}))},fetchClients=async()=>await apiFetchMcpClients({page_number:l-1}),refreshClients=async()=>{await r.refetchQueries({queryKey:["mcp-clients"]})},{data:c,isLoading:a,isError:d}=(0,m.a)({queryFn:fetchClients,queryKey:["mcp-clients",l],refetchOnWindowFocus:!1,gcTime:0});if((0,f.useEffect)(()=>{!a&&(null==c?void 0:c.success)&&0===c.data.clients.length&&l>1&&s(e=>e-1)},[a,c,l]),d)return(0,i.jsx)(j.Z,{children:"Failed to load MCP clients. Reload the page to try again."});let u=(null==c?void 0:c.success)===!0?c.data.clients:[],h=(null==c?void 0:c.success)===!0?c.data.total_count:0,p=(null==c?void 0:c.success)===!0&&l<Math.ceil(c.data.total_count/c.data.page_size);return(0,i.jsx)(v.Provider,{value:{isLoading:a,clients:u,totalClients:h,pageNumber:l,hasMoreResults:p,pageConfig:o,fns:{setPageNumber:s,refreshClients}},children:t})};var w=n(35864),b=n(10614),y=n(17010),M=n(21942),k=n(46562),S=n(54070),R=n(5757),z=n(20966),I=n(33575),Z=n(11163),mcp_clients_DeleteClientModal=e=>{let{client:t,...n}=e,{fns:{refreshClients:r}}=useMcpClients(),l=(0,Z.useRouter)(),[s,c]=(0,f.useState)(!1),deleteClient=async()=>{c(!0);let e=await apiDeleteMcpClient({client_id:t.client_id});e.success?(await r(),I.N9.show({title:"Success",message:"MCP client deleted",color:"actionButtonColor.6"}),n.onClose()):"not_found"===e.error_type?I.N9.show({title:"Failed to delete client",message:"Client not found",color:"errorButtonColor.6"}):"unauthorized"===e.error_type?(I.N9.show({title:"Error",message:"You must be logged in to perform this action. Redirecting to login...",color:"errorButtonColor.6"}
1),l.push("/login")):"unexpected_error"===e.error_type&&I.N9.show({title:"Error",message:_.aK,color:"errorButtonColor.6"}),c(!1)};return(0,i.jsxs)(R.u,{...n,title:"Delete MCP Client",children:[(0,i.jsxs)(o.x,{children:["Are you sure you want to delete this MCP client?"," ",(0,i.jsx)(o.x,{span:!0,fw:600,children:"This action cannot be undone."})]}),(0,i.jsx)(p.Z,{py:"lg",spacing:0,children:(0,i.jsxs)(o.x,{children:["Client Name: ",(0,i.jsx)(o.x,{span:!0,fw:600,children:t.client_name})]})}),(0,i.jsxs)(p.Z,{grow:!0,mt:"lg",children:[(0,i.jsx)(h.z,{variant:S.Bq.SidebarOutline,onClick:n.onClose,children:"Cancel"}),(0,i.jsx)(h.z,{variant:S.Bq.SidebarDangerSolid,onClick:deleteClient,children:s?(0,i.jsx)(z.a,{size:"sm"}):"Delete client"})]})]})},B=n(80061),N=n(28855),mcp_clients_UpdateClientModal=e=>{let{client:t,...n}=e,{pageConfig:r,fns:{refreshClients:s}}=useMcpClients(),c=(0,Z.useRouter)(),[a,u]=(0,f.useState)(!1),[x,C]=(0,f.useState)(t.client_name),[g,m]=(0,f.useState)([""]),j=(0,f.useMemo)(()=>r.mcp_redirect_uri_options.filter(e=>e.visible_to_users),[r.mcp_redirect_uri_options]),v=(0,f.useMemo)(()=>{let e=new Set;return j.forEach(t=>{t.remote_redirect_uris.forEach(t=>e.add(t)),t.local_redirect_paths.forEach(t=>{e.add(t)})}),Array.from(e).sort()},[j]),w=(0,f.useMemo)(()=>v.map(e=>({label:e,value:e})),[v]),b=(0,f.useCallback)(e=>{let t=g.filter((t,n)=>n!==e&&""!==t.trim());return w.filter(e=>!t.includes(e.value))},[w,g]);(0,f.useEffect)(()=>{if(0===t.redirect_uris.length){m([""]);return}m(t.redirect_uris.length>0?t.redirect_uris:[""])},[t.redirect_uris]);let handleRemoveUri=e=>{m(g.filter((t,n)=>n!==e))},handleOptionChange=(e,t)=>
1{let n=[...g];n[e]=t||"",m(n)},handleClose=()=>{C(t.client_name),m([""]),n.onClose()},y=(0,f.useCallback)(e=>e.filter(e=>""!==e.trim()),[]),M=(0,f.useMemo)(()=>{if(x.trim()!==t.client_name)return!0;let e=y(g);if(e.length!==t.redirect_uris.length)return!0;let n=new Set(e),i=new Set(t.redirect_uris),r=e.some(e=>!i.has(e));if(r)return!0;let l=t.redirect_uris.some(e=>!n.has(e));return!!l},[x,g,t,y]),k=(0,f.useMemo)(()=>{let e=g.filter(e=>""!==e.trim());return v.length>0&&e.length>=v.length},[g,v]),updateClient=async()=>{let e=y(g);u(!0);let n=await apiUpdateMcpClient({client_id:t.client_id,client_name:x.trim(),redirect_uris:e});n.success?(await s(),I.N9.show({title:"Success",message:"MCP client updated successfully",color:"actionButtonColor.6"}),handleClose()):"unauthorized"===n.error_type?(I.N9.show({title:"Error",message:"You must be logged in to perform this action. Redirecting to login...",color:"errorButtonColor.6"}),c.push("/login")):"unexpected_error"===n.error_type&&I.N9.show({title:"Error",message:_.aK,color:"errorButtonColor.6"}),u(!1)};return(0,i.jsxs)(R.u,{...n,title:"Update MCP Client",onClose:handleClose,children:[(0,i.jsxs)(l.K,{spacing:"lg",children:[(0,i.jsx)(o.x,{children:"Update the client name and redirect URIs for this MCP client."}),(0,i.jsxs)(l.K,{spacing:"xs",children:[(0,i.jsx)(o.x,{fw:600,children:"Client Name"}),(0,i.jsx)(B.o,{placeholder:"Enter client name",value:x,onChange:e=>C(e.currentTarget.value),required:!0})]}),(0,i.jsxs)(l.K,{spacing:"md",children:[(0,i.jsx)(o.x,{fw:600,children:"Redirect URIs"}),g.map((e,t)=>(0,i.jsxs)(p.Z,{spacing:"sm",children:[(0,i.jsx)(N.Ph,{placeholder:"Select a redirect URI",value:e||null,onChange:e=>handleOptionChange(t,e),data:b(t),style:{flex:1},searchable:!0}),g.length>1&&(0,i.jsx)(h.z,{variant:S.Bq.SidebarOutline,onClick:()=>handleRemoveUri(t),children:"Remove"})]},t)),(0,i.jsx)(d.u,{label:"All available redirect URIs have been selected",disabled:!k,position:"bottom",withArrow:!0,children:(0,i.jsx)(h.z,{variant:S.Bq.SidebarOutline,onClick:()=>{m([...g,""])},disabled:k,style:k?{pointerEvents:"auto"}:void 0,children:"Add URI"})})]})]}),(0,i.jsxs)(p.Z,{grow:!0,mt:"xl",children:[(0,i.jsx)(h.z,{variant:S.Bq.SidebarOutline,onClick:handleClose,children:"Cancel"}),(0,i.jsx)(h.z,{onClick:updateClient,disabled:!x.trim()||a||!M,children:a?(0,i.jsx)(z.a,{size:"sm"}):"Update client"})]})]})},mcp_clients_ViewClientInfoModal=e=>{let{client:t,...n}=e;return(0,i.jsxs)(R.u,{...n,title:"Client Information",size:"lg",children:[(0,i.jsxs)(l.K,{spacing:"lg",children:[(0,i.jsxs)(l.K,{spacing:"xs",children:[(0,i.jsx)(o.x,{children:"Client Name"}),(0,i.jsx)(o.x,{fw:600,children:t.client_name})]}),(0,i.jsxs)(l.K,{spacing:"xs",children:[(0,i.jsx)(o.x,{children:"Redirect URIs"}),t.redirect_uris.length>0?(0,i.jsx)(l.K,{spacing:"xs",children:t.redirect_uris.map((e,t)=>(0,i.jsx)(o.x,{fw:600,children:e},t))}):(0,i.jsx)(o.x,{c:"dimmed",size:"sm",children:"No redirect URIs configured"})]})]}),(0,i.jsx)(h.z,{mt:"xl",fullWidth:!0,variant:S.Bq.SidebarOutline,onClick:n.onClose,children:"Close"})]})},mcp_clients_ClientActionMenu=e=>{let{client:t}=e,n=(0,r.rZ)(),[l,{open:s,close:o}]=(0,x.q)(),[c,{open:a,close:d}]=(0,x.q)(),[u,{open:p,close:C}]=(0,x.q)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(w.v,{withinPortal:!0,position:"bottom-end",children:[(0,i.jsx)(w.v.Target,{children:(0,i.jsx)(h.z,{variant:S.Bq.Subtle,p:"md",children:(0,i.jsx)(b.Z,{})})}),(0,i.jsxs)(w.v.Dropdown,{children:[(0,i.jsx)(w.v.Item,{icon:(0,i.jsx)(y.Z,{size:n.other.iconSizes.lg}),onClick:s,children:"View details"}),(0,i.jsx)(w.v.Item,{icon:(0,i.jsx)(M.Z,{size:n.other.iconSizes.lg}),onClick:a,children:"Edit client"}),(0,i.jsx)(w.v.Item,{sx:{color:n.colors.errorButtonColor[6],"&:hover":{backgroundColor:n.fn.rgba(n.colors.errorButtonColor[6],.1)}},icon:(0,i.jsx)(k.Z,{size:n.other.iconSizes.lg}),onClick:p,children:"Delete client"})]})]}),(0,i.jsx)(mcp_clients_ViewClientInfoModal,{client:t,centered:!0,opened:l,onClose:o}),(0,i.jsx)(mcp_clients_UpdateClientModal,{client:t,centered:!0,opened:c,onClose:d,closeOnClickOutside:!1,closeOnEscape:!1,withCloseButton:!1}),(0,i.jsx)(mcp_clients_DeleteClientModal,{client:t,centered:!0,withCloseButton:!1,opened:u,onClose:C})]})},P=n(40102),mcp_clients_CreateClientModal=e=>{let{...t}=e,{pageConfig:n,fns:{refreshClients:r}}=useMcpClients(),s=(0,Z.useRouter)(),[c,a]=(0,f.useState)(!1),[d,u]=(0,f.useState)(""),[x,C]=(0,f.useState)(!1),[g,m]=(0,f.useState)(!1),[j,v]=(0,f.useState)([""]),[w,b]=(0,f.useState)(null),y=(0,f.useMemo)(()=>n.mcp_redirect_uri_options.filter(e=>e.visible_to_users),[n.mcp_redirect_uri_options]),M=(0,f.useMemo)(()=>y.map(e=>({label:e.name,value:e.name})),[y]),k=(0,f.useCallback)(e=>
1{let t=j.filter((t,n)=>n!==e&&""!==t.trim());return M.filter(e=>!t.includes(e.value))},[M,j]),handleRemoveUri=e=>{v(j.filter((t,n)=>n!==e))},handleOptionChange=(e,t)=>{let n=[...j];n[e]=t||"",v(n)},handleClose=()=>{u(""),v([""]),b(null),C(!1),m(!1),t.onClose()},flattenRedirectUris=e=>{let t=new Set;return e.forEach(e=>{let n=y.find(t=>t.name===e);n&&(n.remote_redirect_uris.forEach(e=>t.add(e)),n.local_redirect_paths.forEach(e=>{t.add(e)}))}),Array.from(t)},createClient=async()=>{let e=j.filter(e=>""!==e.trim()),t=flattenRedirectUris(e);a(!0);let n=await apiCreateMcpClient({client_name:d.trim(),redirect_uris:t});n.success?(b({client_id:n.data.client_id,client_secret:n.data.client_secret}),await r(),I.N9.show({title:"Success",message:"MCP client created successfully",color:"actionButtonColor.6"})):"unauthorized"===n.error_type?(I.N9.show({title:"Error",message:"You must be logged in to perform this action. Redirecting to login...",color:"errorButtonColor.6"}),s.push("/login")):"unexpected_error"===n.error_type&&I.N9.show({title:"Error",message:_.aK,color:"errorButtonColor.6"}),a(!1)};return w?(0,i.jsxs)(R.u,{...t,title:"Client Created",onClose:handleClose,children:[(0,i.jsxs)(l.K,{spacing:"lg",children:[(0,i.jsx)(o.x,{children:"Your MCP client has been created successfully. Please save these credentials securely - the client secret will not be shown again."}),(0,i.jsxs)(l.K,{my:"lg",spacing:0,children:[(0,i.jsx)(o.x,{children:"Client ID"}),(0,i.jsx)(P.v,{variant:S.kI.Sidebar,value:w.client_id,onCopy:()=>m(!0),children:(0,i.jsx)(o.x,{children:w.client_id})})]}),(0,i.jsxs)(l.K,{my:"lg",spacing:0,children:[(0,i.jsx)(o.x,{children:"Client Secret"}),x?(0,i.jsx)(p.Z,{w:"100%",children:(0,i.jsx)(o.x,{sx:{overflowWrap:"anywhere"},fw:600,children:w.client_secret})}):(0,i.jsx)(P.v,{variant:S.kI.Sidebar,value:w.client_secret,onCopy:()=>m(!0),children:(0,i.jsx)(o.x,{children:w.client_secret})})]})]}),(0,i.jsx)(h.z,{mt:"xl",fullWidth:!0,onClick:handleClose,disabled:!g&&!x,children:"Done"}),!x&&(0,i.jsx)(h.z,{mt:"md",fullWidth:!0,variant:S.Bq.SidebarSubtle,onClick:()=>C(!0),children:"Manually copy client secret"})]}):(0,i.jsxs)(R.u,{...t,title:"Create MCP Client",onClose:handleClose,children:[(0,i.jsxs)(l.K,{spacing:"lg",children:[(0,i.jsx)(o.x,{children:"Create a new MCP client by providing a client ID and selecting one or more redirect URI options."}),(0,i.jsxs)(l.K,{spacing:"xs",children:[(0,i.jsx)(o.x,{fw:600,children:"Client Name"}),(0,i.jsx)(B.o,{placeholder:"Enter client name",value:d,onChange:e=>u(e.currentTarget.value),required:!0})]}),(0,i.jsxs)(l.K,{spacing:"md",children:[(0,i.jsx)(o.x,{fw:600,children:"Redirect URI Options"}),j.map((e,t)=>(0,i.jsxs)(p.Z,{spacing:"sm",children:[(0,i.jsx)(N.Ph,{placeholder:"Select an option",value:e||null,onChange:e=>handleOptionChange(t,e),data:k(t),style:{flex:1},searchable:!0}),j.length>1&&(0,i.jsx)(h.z,{variant:S.Bq.SidebarOutline,onClick:()=>handleRemoveUri(t),children:"Remove"})]},t)),(0,i.jsx)(h.z,{variant:S.Bq.SidebarOutline,onClick:()=>{v([...j,""])},children:"Add option"})]})]}),(0,i.jsxs)(p.Z,{grow:!0,mt:"xl",children:[(0,i.jsx)(h.z,{variant:S.Bq.SidebarOutline,onClick:handleClose,children:"Cancel"}),(0,i.jsx)(h.z,{onClick:createClient,disabled:!d.trim()||c||!j.some(e=>""!==e.trim()),children:c?(0,i.jsx)(z.a,{size:"sm"}):"Create client"})]})]})},U=n(72908),mcp_clients_McpClientsTable=()=>{let{isLoading:e,clients:t,totalClients:n,hasMoreResults:s,pageNumber:c,pageConfig:g,fns:{setPageNumber:m}}=useMcpClients(),f=(0,r.rZ)(),[_,{open:j,close:v}]=(0,x.q)(),w=g.mcp_redirect_uri_options.length>0;return(0,i.jsxs)(l.K,{spacing:"lg",children:[(0,i.jsx)(a.r,{children:(0,i.jsx)(a.r.Col,{sm:4,md:2,children:(0,i.jsx)(d.u,{multiline:!0,maw:250,label:"No redirect URIs available. Please contact your administrator to configure redirect URI options.",disabled:w,withArrow:!0,children:(0,i.jsx)(u.x,{children:(0,i.jsx)(h.z,{leftIcon:(0,i.jsx)(C.Z,{size:f.other.iconSizes.lg}),onClick:j,disabled:!w,children:"Create client"})})})})}),(0,i.jsx)(U.Z,{data:t,totalDataRecords:n,hasMoreResults:s,dataPage:c,setDataPage:m,isLoading:e,noRecordsText:"No MCP clients found",columns:[{accessor:"client_name",title:"Client Name",render:e=>(0,i.jsx)(p.Z,{position:"left",ml:"lg",children:(0,i.jsx)(o.x,{children:e.client_name})}),width:"30%"}
1,{accessor:"client_id",title:"Client ID",render:e=>(0,i.jsx)(p.Z,{position:"left",children:(0,i.jsx)(o.x,{children:e.client_id})}),width:"40%"},{accessor:"redirect_uris",title:"Redirect URIs",render:e=>(0,i.jsx)(d.u,{label:e.redirect_uris.join(", "),multiline:!0,maw:400,withArrow:!0,children:(0,i.jsx)(o.x,{truncate:!0,sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.redirect_uris.join(", ")})}),width:"20%"},{accessor:"index",title:"",width:"10%",textAlignment:"right",render:e=>(0,i.jsx)(p.Z,{position:"right",mr:"md",children:(0,i.jsx)(mcp_clients_ClientActionMenu,{client:e})})}]}),(0,i.jsx)(mcp_clients_CreateClientModal,{opened:_,onClose:v,centered:!0,closeOnClickOutside:!1,closeOnEscape:!1,withCloseButton:!1})]})};let E="MCP Clients";var O=!0,mcp_clients=e=>{let{pageConfig:t}=e,n=(0,r.rZ)();return(0,i.jsx)(c.T,{pageConfig:t,pageTitle:E,showNavbar:t.theme.management_pages_theme.display_sidebar,children:(0,i.jsxs)(l.K,{spacing:n.spacing.xl,children:[(0,i.jsxs)(l.K,{spacing:n.spacing.md,children:[(0,i.jsx)(s.D,{order:1,children:E}),(0,i.jsx)(o.x,{children:"Manage your MCP (Model Context Protocol) clients. Create new clients and configure their redirect URIs."})]}),(0,i.jsx)(McpClientsContextProvider,{pageConfig:t,children:(0,i.jsx)(mcp_clients_McpClientsTable,{})})]})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.