module.exports=[455425,525782,a=>{"use strict";var b=a.i(542082),c=a.i(417998);a.i(562366);var d=a.i(766522),e=a.i(284141),f=a.i(225526),g=a.i(995209),h=a.i(952313),i=a.i(178880),j=a.i(661264),k=a.i(872166),l=a.i(888890),m=a.i(924031),n=a.i(535567),o=a.i(910436),p=a.i(759713),q=a.i(27545),r=a.i(943370),s=a.i(713116);let t=(0,s.createServerReference)("709889e65eed14090c29f49adf8b1dcb51792e43e1",s.callServer,void 0,s.findSourceMapURL,"createToolAction");var u=a.i(402823);let v=(0,s.createServerReference)("401be4fb702cfbb30e68870f7e45d6e1158b45620d",s.callServer,void 0,s.findSourceMapURL,"detectOAuthServerAction"),w=(0,s.createServerReference)("78fc2fa8ef27860723462bb410e58d4c7aee918e2d",s.callServer,void 0,s.findSourceMapURL,"updateToolAction");var x=a.i(132337),y=a.i(167418),z=a.i(765351),A=a.i(794459),B=a.i(613430),C=a.i(213923),D=a.i(157544);a.i(179564);var E=a.i(125597);let F=`{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "The search query"
    },
    "limit": {
      "type": "number",
      "description": "Maximum number of results"
    }
  },
  "required": ["query"]
}`,G=D.z.object({displayName:D.z.string().max(100,"Display name must be less than 100 characters").refine(a=>!a.trim()||/^[a-zA-Z0-9_-]+$/.test(a.trim()),{message:"Display name can only contain letters, numbers, hyphens, and underscores"}).optional().or(D.z.literal("")),description:D.z.string().max(1e3,"Description must be less than 1000 characters").optional().or(D.z.literal("")),schema:D.z.string().refine(a=>{if(!a.trim())return!0;try{let b=JSON.parse(a);if("object"!=typeof b||null===b||b.type&&!["string","number","boolean","object","array"].includes(b.type))return!1;return!0}catch{return!1}},{message:"Schema must be a valid JSON object with a valid type"}).optional().or(D.z.literal(""))}),H=a=>({displayName:a?.displayName||"",description:a?.description||"",schema:a?.schema?JSON.stringify(a.schema,null,2):""});function I({isOpen:a,onOpenChange:d,toolName:e,override:h,onSave:j,originalTool:m}){let o=(0,g.useForm)({resolver:(0,c.zodResolver)(G),defaultValues:H(h)});(0,f.useEffect)(()=>{a&&o.reset(H(h))},[a]);let{isSubmitting:q}=o.formState,r=a=>{j({...a.displayName?.trim()&&{displayName:a.displayName.trim()},...a.description?.trim()&&{description:a.description.trim()},...a.schema?.trim()&&{schema:(()=>{try{return JSON.parse(a.schema)}catch{return a.schema}})()},...h?.transformation&&{transformation:h.transformation}}),d(!1)},{control:s}=o,[t,u,v]=(0,g.useWatch)({control:s,name:["displayName","description","schema"]}),w=t?.trim()||u?.trim()||v?.trim();return(0,b.jsx)(n.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(n.DialogContent,{className:"w-[90vw]! max-w-6xl! max-h-[90vh] overflow-y-auto h-auto!",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsxs)(n.DialogTitle,{children:["Override Tool: ",e]}),(0,b.jsx)(n.DialogDescription,{children:"Customize how this tool appears and behaves in your agent."})]}),(0,b.jsx)(p.Form,{...o,children:(0,b.jsxs)("form",{onSubmit:a=>{a.stopPropagation(),o.handleSubmit(r)(a)},className:"space-y-8",children:[(0,b.jsx)(i.GenericInput,{control:s,name:"displayName",label:"Display Name",placeholder:m?.name||e,description:"Override the tool name shown to the agent"}),(0,b.jsx)(k.GenericTextarea,{control:s,name:"description",label:"Description",description:"Override the tool description shown to the agent",placeholder:m?.description||"Enter a custom description..."}),(0,b.jsx)(E.GenericJsonSchemaEditor,{control:s,name:"schema",label:"Schema Override",description:"Define simplified input parameters for the tool",customTemplate:F}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(l.Button,{type:"button",variant:"outline",onClick:()=>d(!1),children:"Cancel"}),(0,b.jsx)(l.Button,{type:"submit",disabled:!w||q,children:"Save Override"})]})]})})]})})}var J=a.i(883710),J=J,K=a.i(714427),L=a.i(228592),M=a.i(755070),M=M,N=a.i(161315),O=a.i(726464),P=a.i(845310),Q=a.i(313718),R=a.i(744589);function S({label:a,hasChange:c=!1,originalContent:d,modifiedContent:e}){return(0,b.jsxs)("div",{className:"rounded-xl border border-border overflow-hidden",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-foreground",children:a}),c&&(0,b.jsx)(C.Badge,{variant:"violet",className:"uppercase",children:"Modified"})]}),(0,b.jsxs)("div",{className:"grid md:grid-cols-2 divide-y md:divide-y-0 md:divide-x divide-border",children:[(0,b.jsxs)("div",{className:"p-4",children:[(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2 block font-mono",children:"Original"}),d]}),(0,b.jsxs)("div",{className:"p-4 bg-muted/40 dark:bg-white/5",children:[(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2 block font-mono",children:"Modified"}),e]})]})]})}function T({value:a,isCode:c=!1}){return a?c?(0,b.jsx)("code",{className:"text-sm font-mono bg-muted/80 px-2 py-1 border rounded-sm inline-block",children:a}):(0,b.jsx)("p",{className:"text-sm text-foreground/80 break-words",children:a}):(0,b.jsx)("span",{className:"text-sm text-muted-foreground italic",children:"Empty"})}function U({isOpen:a,setIsOpen:c,override:d,originalTool:e}){let{name:f,description:g,inputSchema:h}=e,{displayName:i,description:j,schema:k}=d,l=h?(0,Q.parseMCPInputSchema)(h):null,m=k?(0,Q.parseMCPInputSchema)(k):null,o=!!i&&i!==f,p=!!j&&j!==g;return(0,b.jsx)(n.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(n.DialogContent,{className:"max-w-6xl!",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:"Compare"}),(0,b.jsx)(n.DialogDescription,{children:"Compare the original tool with the modified tool."})]}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(S,{label:"Name",hasChange:o,originalContent:(0,b.jsx)(T,{value:f||null,isCode:!0}),modifiedContent:(0,b.jsx)(T,{value:i||f||null,isCode:!0})}),(0,b.jsx)(S,{label:"Description",hasChange:p,originalContent:(0,b.jsx)(T,{value:g||null}),modifiedContent:(0,b.jsx)(T,{value:j||g||null})}),(0,b.jsx)(S,{label:"Parameters",hasChange:null!=k,originalContent:(0,b.jsxs)("div",{className:"space-y-2",children:[l?.properties.map(a=>(0,b.jsx)(R.PropertyDisplay,{property:a,level:0},`original-${a.name}`)),!l?.hasProperties&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground italic",children:"No parameters"})]}),modifiedContent:(0,b.jsxs)("div",{className:"space-y-2",children:[(m||l)?.properties.map(a=>(0,b.jsx)(R.PropertyDisplay,{property:a,level:0},`modified-${a.name}`)),!(m||l)?.hasProperties&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground italic",children:"No parameters"})]})})]})]})})}function V({toolName:a,override:c,originalTool:d,displayName:e,description:g,isChecked:h,disabled:i,hasOverride:j,onToggle:k,onEdit:m,onRemoveOverride:n}){let[o,p]=(0,f.useState)(!1);return(0,b.jsxs)("div",{className:"border-b last:border-b-0",children:[(0,b.jsxs)("div",{className:"flex items-start gap-4 py-4 px-6",children:[(0,b.jsx)("div",{className:"flex items-center h-[22px] relative",children:(0,b.jsx)(N.Checkbox,{checked:h,disabled:i,className:"mb-0",onClick:()=>!i&&k(a,!h)})}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col gap-2 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 justify-between min-w-0",children:[(0,b.jsx)(C.Badge,{variant:h?"primary":"code",className:`font-mono font-medium text-xs cursor-pointer rounded-sm transition-colors truncate inline-block min-w-0 shrink ${i?"opacity-50 cursor-not-allowed":""}`,onClick:()=>!i&&k(a,!h),children:e}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[j&&(0,b.jsx)(C.Badge,{variant:"violet",className:"uppercase",children:"Modified"}),(0,b.jsxs)(O.DropdownMenu,{children:[(0,b.jsx)(O.DropdownMenuTrigger,{asChild:!0,children:(0,b.jsx)(l.Button,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 p-0",type:"button",children:(0,b.jsx)(K.MoreVertical,{className:"h-4 w-4"})})}),(0,b.jsxs)(O.DropdownMenuContent,{align:"end",children:[(0,b.jsxs)(O.DropdownMenuItem,{onClick:()=>m(a),children:[(0,b.jsx)(L.Pencil,{className:"size-4"}),"Edit"]}),j&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(O.DropdownMenuItem,{onClick:()=>p(!0),children:[(0,b.jsx)(J.default,{className:"size-4"}),"Compare to original"]}),(0,b.jsxs)(O.DropdownMenuItem,{variant:"destructive",onClick:()=>n(a),children:[(0,b.jsx)(M.default,{className:"size-4"}),"Reset to original"]})]})]})]})]})]}),(0,b.jsxs)(P.Tooltip,{delayDuration:800,children:[(0,b.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-1",children:g})}),(0,b.jsx)(P.TooltipContent,{side:"bottom",align:"start",children:g})]})]})]}),o&&c&&(0,b.jsx)(U,{override:c,originalTool:d,isOpen:o,setIsOpen:p})]})}function W({control:a,name:c,label:d,availableTools:e=[],description:h,disabled:i=!1,toolOverrides:j={},onToolOverrideChange:k}){let[m,n]=(0,f.useState)(null),{field:{value:p,onChange:q},fieldState:{error:r}}=(0,g.useController)({name:c,control:a}),s="object"==typeof p&&null!==p&&"type"in p?"all"===p.type?{type:"all"}:"selective"===p.type&&Array.isArray(p.tools)?{type:"selective",tools:p.tools}:{type:"selective",tools:[]}:{type:"selective",tools:[]},t=()=>{q({type:"all"})},u=()=>{q({type:"selective",tools:[]})};function v(a,b){if("all"===s.type){let c=e.map(a=>a.name).filter(b=>b!==a);q({type:"selective",tools:b?[...c,a]:c})}else q({type:"selective",tools:b?[...s.tools.filter(b=>b!==a),a]:s.tools.filter(b=>b!==a)})}function w(a){k?.(a,{})}let x=()=>{switch(s.type){case"all":return e.length;case"selective":return s.tools.filter(a=>e.some(b=>b.name===a)).length;default:return 0}},y=x()===e.length;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o.FormField,{control:a,name:c,render:()=>(0,b.jsxs)(o.FormItem,{children:[(0,b.jsxs)(o.FormLabel,{children:[d,(0,b.jsx)(C.Badge,{variant:"count",children:x()})]}),h&&(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h}),(0,b.jsxs)("div",{className:"mt-2 min-w-0",children:[0===e.length&&(0,b.jsx)("div",{className:"text-sm text-muted-foreground border rounded-md p-3 py-2 bg-gray-100/80 dark:bg-sidebar",children:"No tools available from this server"}),e.length>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 justify-between py-3 px-6 rounded-t-lg border border-b-0",children:[(0,b.jsxs)("div",{className:"text-sm",children:[x()," ",(0,b.jsxs)("span",{className:"text-gray-400 dark:text-white/40",children:["/ ",e.length," tool",1===e.length?"":"s"]})]}),y?(0,b.jsxs)(l.Button,{type:"button",variant:"outline",size:"sm",onClick:u,disabled:i,children:[(0,b.jsx)(B.X,{className:"w-4 h-4 text-muted-foreground"}),"Deselect all"]}):(0,b.jsxs)(l.Button,{type:"button",variant:"outline",size:"sm",onClick:t,disabled:i,children:[(0,b.jsx)(A.Check,{className:"w-4 h-4 text-muted-foreground"}),"Select all"]})]}),(0,b.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg rounded-t-none scrollbar-thin scrollbar-thumb-muted-foreground/30 dark:scrollbar-thumb-muted-foreground/50 scrollbar-track-transparent",children:e.map(a=>{let c=(a=>{switch(s.type){case"all":return e.some(b=>b.name===a);case"selective":return s.tools.includes(a)&&e.some(b=>b.name===a);default:return!1}})(a.name),d=j[a.name],f=d?.displayName||a.name,g=d?.description||a.description;return(0,b.jsx)(V,{toolName:a.name,override:d,originalTool:a,displayName:f,description:g,isChecked:c,disabled:i,hasOverride:!!d,onToggle:v,onEdit:n,onRemoveOverride:w},a.name)})})]})]}),(0,b.jsx)(o.FormMessage,{children:r?.message})]})}),m&&(0,b.jsx)(I,{isOpen:!0,onOpenChange:a=>!a&&n(null),toolName:m,override:j[m],originalTool:e.find(a=>a.name===m),onSave:a=>{k&&k(m,a),n(null)}})]})}let X=D.z.discriminatedUnion("type",[D.z.object({type:D.z.literal("all")}),D.z.object({type:D.z.literal("selective"),tools:D.z.array(D.z.string())})]),Y={project:"project",user:"user"},Z=[/\$\{.*\}/,/eval\s*\(/i,/function\s*\(/i,/constructor/i,/prototype/i,/__proto__/i],$=D.z.object({name:D.z.string().min(1,"Name is required."),config:D.z.object({type:D.z.literal("mcp"),mcp:D.z.object({server:D.z.object({url:D.z.string().url("Must be a valid URL.").refine(a=>{try{let b=new URL(a);return["http:","https:","ws:","wss:"].includes(b.protocol)}catch{return!1}},{message:"URL must use http, https, ws, or wss protocol."})}),transport:D.z.object({type:D.z.nativeEnum(d.MCPTransportType)}),toolsConfig:X.default({type:"all"}),toolOverrides:D.z.record(D.z.string().min(1,"Tool name cannot be empty."),D.z.object({displayName:D.z.string().max(100,"Display name must be less than 100 characters.").regex(/^[a-zA-Z0-9_-]+$/,"Display name can only contain letters, numbers, hyphens, and underscores.").optional(),description:D.z.string().max(1e3,"Description must be less than 1000 characters.").optional(),schema:D.z.any().refine(a=>{if(!a)return!0;try{if("string"==typeof a){let b=JSON.parse(a);return"object"==typeof b&&null!==b}return"object"==typeof a&&null!==a}catch{return!1}},{message:"Schema must be a valid JSON object."}).optional(),transformation:D.z.union([D.z.string().max(500,"JMESPath expression must be less than 500 characters.").refine(a=>!Z.some(b=>b.test(a)),{message:"Transformation contains potentially dangerous patterns."}),D.z.record(D.z.string(),D.z.string()).refine(a=>{if("string"==typeof a)return!(a.length>500)&&!Z.some(b=>b.test(a));if("object"==typeof a&&null!==a){for(let[b,c]of Object.entries(a))if("string"!=typeof b||"string"!=typeof c||!b.trim()||!c.trim()||c.length>200||Z.some(a=>a.test(c)))return!1;return!0}return!1},{message:"Invalid object transformation mapping."})]).optional()})).optional(),prompt:D.z.string().max(2e3,"Prompt must be less than 2000 characters.").optional()})}),credentialReferenceId:D.z.string().nullish(),credentialScope:D.z.enum(Y).default("project"),imageUrl:D.z.string().optional().refine(a=>!a||""===a.trim()||D.z.string().url().safeParse(a).success,{message:"Image URL must be a valid URL."})});a.s(["CredentialScopeEnum",0,Y,"mcpToolSchema",0,$],525782);let _={name:"",config:{type:"mcp",mcp:{server:{url:""},transport:{type:d.MCPTransportType.streamableHttp},toolsConfig:{type:"all"},toolOverrides:{},prompt:""}},imageUrl:"",credentialReferenceId:"oauth",credentialScope:Y.project};a.s(["MCPServerForm",0,function({initialData:a,className:o,tool:s,credentials:A,tenantId:B,projectId:C}){let D=(0,e.useRouter)(),[E,F]=(0,f.useState)(!1),[G,H]=(0,f.useTransition)(),I=(0,g.useForm)({resolver:(0,c.zodResolver)($),defaultValues:{..._,...a}}),{handleOAuthLogin:J}=(0,r.useOAuthLogin)({tenantId:B,projectId:C}),K=(0,x.useMcpToolInvalidation)(B,C),{isSubmitting:L}=I.formState,{control:M}=I,[N,O={}]=(0,g.useWatch)({control:M,name:["credentialScope","config.mcp.toolOverrides"]}),P=I.handleSubmit(async a=>{let b=s?"update":"create";try{let c=a.name;if(a.credentialScope===Y.user&&"create"===b){let b={id:(0,z.generateId)(),name:c,config:{type:"mcp",mcp:{server:{url:a.config.mcp.server.url},transport:{type:a.config.mcp.transport.type},prompt:a.config.mcp.prompt}},credentialReferenceId:null,credentialScope:Y.user,imageUrl:a.imageUrl},d=await t(B,C,b);if(!d.success||!d.data)return void h.toast.error(d.error||"Failed to create MCP server.");await K(),h.toast.success("MCP server created. Users can connect their own accounts from the detail page."),D.push(`/${B}/projects/${C}/mcp-servers/${d.data.id}`);return}if("oauth"===a.credentialReferenceId&&"create"===b){let b=await v(a.config.mcp.server.url);if(!b.success)return void h.toast.error(b.error||"Failed to detect OAuth support");if(!b.data)return void h.toast.error("This MCP server does not support OAuth authentication. Please select a different credential.");let d={id:(0,z.generateId)(),name:c,config:{type:"mcp",mcp:{server:{url:a.config.mcp.server.url},transport:{type:a.config.mcp.transport.type},prompt:a.config.mcp.prompt}},credentialReferenceId:null,credentialScope:Y.project,imageUrl:a.imageUrl},e=await t(B,C,d);if(!e.success||!e.data)return void h.toast.error(e.error||"Failed to create MCP server.");await K(),J({toolId:e.data.id,mcpServerUrl:a.config.mcp.server.url,toolName:c,credentialScope:a.credentialScope});return}let d={...a,name:c,credentialReferenceId:"none"===a.credentialReferenceId?null:a.credentialReferenceId,credentialScope:a.credentialScope,config:{...a.config,mcp:{...a.config.mcp,activeTools:(a=>{if("all"===a.type)return;let b=s?.availableTools?.map(a=>a.name)||[];return a.tools.filter(a=>b.includes(a))})(a.config.mcp.toolsConfig)}}};if(s){let a=await w(B,C,s.id,d);if(!a.success)return void h.toast.error(a.error||"Failed to update MCP server.");await K(s.id),h.toast.success("MCP server updated successfully"),D.push(`/${B}/projects/${C}/mcp-servers/${s.id}`)}else{let a=await t(B,C,{...d,id:(0,z.generateId)()});if(!a.success||!a.data)return void h.toast.error(a.error||"Failed to create MCP server.");await K(),h.toast.success("MCP server created successfully"),D.push(`/${B}/projects/${C}/mcp-servers/${a.data.id}`)}}catch(a){console.error(`Failed to ${b} MCP tool:`,a),h.toast.error(`Failed to ${b} MCP server. Please try again.`)}});return(0,b.jsxs)(n.Dialog,{open:E,onOpenChange:F,children:[(0,b.jsx)(p.Form,{...I,children:(0,b.jsxs)("form",{onSubmit:P,className:(0,y.cn)("space-y-8",o),children:[(0,b.jsx)(i.GenericInput,{control:M,name:"name",label:"Name",placeholder:"MCP server",isRequired:!0}),(0,b.jsx)(i.GenericInput,{control:M,name:"config.mcp.server.url",label:"URL",placeholder:"https://api.example.com/mcp",isRequired:!0,disabled:s?.isWorkApp}),(0,b.jsx)(j.GenericSelect,{control:M,selectTriggerClassName:"w-full",name:"config.mcp.transport.type",label:"Transport type",placeholder:"Select transport type",options:[{value:d.MCPTransportType.streamableHttp,label:"Streamable HTTP"},{value:d.MCPTransportType.sse,label:"Server-Sent Events (SSE)"}]}),(0,b.jsx)(i.GenericInput,{control:M,name:"imageUrl",label:"Image URL (optional)",placeholder:"https://example.com/icon.png or data:image/png;base64,..."}),(0,b.jsx)(k.GenericTextarea,{control:M,name:"config.mcp.prompt",label:"Prompt (optional)",placeholder:s?.capabilities?.serverInstructions?`Leave empty to use server default: "${s.capabilities.serverInstructions.slice(0,100)}${s.capabilities.serverInstructions.length>100?"...":""}"`:"Override the instructions sent by the MCP server..."}),!s?.isWorkApp&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)(j.GenericSelect,{control:M,selectTriggerClassName:"w-full",name:"credentialScope",label:"Credential Scope",placeholder:"Select credential scope",disabled:!!s,options:[{value:Y.project,label:"Project (shared team credential)"},{value:Y.user,label:"User (each user connects their own)"}]}),(0,b.jsx)(q.InfoCard,{title:"Credential Scope",children:(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("p",{children:[(0,b.jsx)("strong",{children:"Project:"})," One shared credential for the entire team. You'll connect an OAuth account now that everyone will use."]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("strong",{children:"User:"})," Each team member connects their own account. No OAuth required during setup — users connect later from the detail page."]})]})})]}),N===Y.project&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)(j.GenericSelect,{control:M,selectTriggerClassName:"w-full",name:"credentialReferenceId",label:"Credential",placeholder:"Select a credential",options:[{value:"oauth",label:"OAuth"},{value:"none",label:"No Authentication"},...A.map(a=>{let b=a.name||a.id,c=A.some(b=>b.id!==a.id&&b.name===a.name);return{value:a.id,label:c||!a.name?`${b} (${a.id.slice(0,8)})`:a.name}})]}),(0,b.jsx)(q.InfoCard,{title:"How this works",children:(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("p",{children:["Select"," ",(0,b.jsx)("code",{className:"bg-background px-1.5 py-0.5 rounded border",children:"OAuth"}),' to authenticate with the MCP server\'s OAuth flow, which will start after you click "Create".']}),(0,b.jsxs)("p",{children:["Select"," ",(0,b.jsx)("code",{className:"bg-background px-1.5 py-0.5 rounded border",children:"No Authentication"})," ","to skip authentication (i.e. none required or add a credential later)."]}),(0,b.jsx)("p",{children:"Or select from the existing credentials you have already created."})]})})]})]}),s&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(W,{control:M,name:"config.mcp.toolsConfig",label:"Tools",availableTools:s?.availableTools||[],description:"Select which tools should be enabled for this MCP server",toolOverrides:O,onToolOverrideChange:(a,b)=>{let c={...O};0===Object.keys(b).length?delete c[a]:c[a]=b,I.setValue("config.mcp.toolOverrides",c,{shouldDirty:!0,shouldValidate:!0})}})}),(0,b.jsxs)("div",{className:"flex w-full justify-between",children:[(0,b.jsx)(l.Button,{type:"submit",disabled:L,children:s?"Save":"Create"}),s&&(0,b.jsx)(n.DialogTrigger,{asChild:!0,children:(0,b.jsx)(l.Button,{type:"button",variant:"destructive-outline",children:"Delete Server"})})]})]})}),E&&s&&(0,b.jsx)(m.DeleteConfirmation,{itemName:s.name||"this MCP server",isSubmitting:G,onDelete:function(){s&&H(async()=>{let a=await (0,u.deleteToolAction)(B,C,s.id,!1);a.success?(F(!1),h.toast.success("MCP server deleted."),D.push(`/${B}/projects/${C}/mcp-servers`)):h.toast.error(a.error||"Failed to delete MCP server.")})}})]})}],455425)}];

//# sourceMappingURL=agents-manage-ui_src_components_mcp-servers_form_mcp-server-form_tsx_0qa0xjl._.js.map