1import{r as a,j as e,a as g}from"./index-tNhE6V5Q.js";import{L as f,S as j,a as n,C as v}from"./Dash-4uLE9yHf.js";function y(){const[t,o]=a.useState([]),[b,i]=a.useState(!0),[r,c]=a.useState(null),[x,u]=a.useState(null),m=()=>{i(!0),g.get("/v1/agent/admin/tools").then(s=>o(s.tools||[])).catch(()=>o([])).finally(()=>i(!1))};a.useEffect(m,[]);const h=async s=>{c(s.name),u(null);try{await g.post("/v1/agent/admin/tools/toggle",{name:s.name,enabled:!s.enabled}),m()}catch(l){u(l instanceof Error?l.message:"Failed to toggle")}finally{c(null)}},d=t.filter(s=>s.enabled).length,p=t.reduce((s,l)=>s+(l.usage_30d||0),0);return e.jsxs("div",{children:[e.jsx("p",{className:"text-[12.5px] text-[#8A93A2] mb-4",children:"What the agent can do. Turn any tool off instantly (enforced server-side, no redeploy). Usage = last 30 days."}),x&&e.jsx("div",{className:"mb-3 text-[12px] text-[#DC2626]",children:x}),b?e.jsx(f,{}):e.jsxs(e.Fragment,{children:[e.jsxs(j,{children:[e.jsx(n,{label:"Tools",value:t.length,sub:"registered"}),e.jsx(n,{label:"Enabled",value:d,sub:"live now",tone:"good"}),e.jsx(n,{label:"Disabled",value:t.length-d,sub:"switched off",tone:t.length-d>0?"warn":"default"}),e.jsx(n,{label:"Calls / 30d",value:p,sub:"all tools",tone:"accent"})]}),e.jsx(v,{title:"Tools & actions",sources:["enforced server-side"],children:t.length===0?e.jsx("div",{className:"text-[12px] text-[#8A93A2]",children:"No tools found."}):e.jsx("div",{className:"divide-y divide-[#EEF0F4]",children:t.map(s=>e.jsxs("div",{className:"flex items-center gap-4 py-2.5 first:pt-0 last:pb-0",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-[13px] font-semibold text-[#181B24]",children:s.name}),!s.enabled&&e.jsx("span",{className:"text-[10px] bg-[#EEF0F4] text-[#8A93A2] rounded px-1.5 py-0.5",children:"disabled"})]}),e.jsx("div",{className:"text-[12px] text-[#59616F] mt-0.5",children:s.description})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsx("div",{className:"text-[17px] font-bold tabular-nums text-[#181B24] leading-tight",children:s.usage_30d.toLocaleString("en-IN")}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[#8A93A2]",children:"calls / 30d"})]}),e.jsx("button",{onClick:()=>h(s),disabled:r===s.name,className:`text-[12px] rounded-full px-3 py-1.5 border w-16 shrink-0 ${s.enabled?"bg-[#ECFDF5] border-[#A7F3D0] text-[#0E9F6E]":"bg-[#F6F7F9] border-[#E5E8ED] text-[#8A93A2]"}`,children:r===s.name?"â¦":s.enabled?"On":"Off"})]},s.name))})})]})]})}export{y as default};
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.