PageSourceSearch

https://boundaryai.ai/assets/dashboard.adoption-DrhYEJTk.js

js boundaryai.ai collected 2026-10-05 13:58:24 UTC 42,722 bytes, 24 lines download raw bytes

1import{a as M,ae as V,b as z,r as j,f as L,E as B,a3 as ze,j as e,B as g,S as $e,t as x,I as ye,a5 as _e,C as Te,i as le,y as qe}from"./index-CYfa26JU.js";import{u as Q}from"./useMutation-Bf4zUOlf.js";import{D as Be,E as me,T as Fe,P as q,i as he,S as Pe,R as we,f as de}from"./DashboardShell-Cfr9PfYQ.js";import{P as T,D as Se,T as Ge,R as ke}from"./charts-CaVztRAM.js";import{d as Ee,p as Oe}from"./export-CPdgdjwx.js";import{c as ve,e as Ke}from"./engineAdmin-CFR2YO_U.js";import{B as U}from"./badge-CXhNEDHx.js";import{S as Ue}from"./switch-BkAmoihv.js";import{T as He}from"./textarea-Doiw-zt5.js";import{C as Ce}from"./checkbox-DUeu7RTS.js";import{T as Qe,a as We,b as ie,c as oe}from"./tabs-BSodea2u.js";import{S as W,a as Y,b as J,c as X,d as $}from"./select-BuJdnxg6.js";import{S as Ye,a as Je,b as Xe,c as Ze,d as es}from"./sheet-p0cRrSEl.js";import{D as ss,a as ts,b as as,c as ns,d as rs,e as ls}from"./dialog-BFAWnK7a.js";import{A as is,a as os,b as cs,c as ds,d as ms,e as hs,f as xs,g as us}from"./alert-dialog-B43Oo12y.js";import{D as ps,a as gs,b as fs,c as ge,d as js}from"./dropdown-menu-Cbw5_kA2.js";import{D as be}from"./download-BVDtQYKz.js";import{F as Le}from"./file-text-DfUjKJMp.js";import{A as De}from"./activity-DLjoFNWa.js";import{R as Z}from"./refresh-cw-DBw7pvJX.js";import{S as vs}from"./server-QtyMnU9w.js";import{R as bs,S as Ns}from"./sparkles-rKyhyxf2.js";import{B as ys}from"./bot-CmphiyPM.js";import{P as ws}from"./percent-DU0qyUih.js";import{M as Ne}from"./monitor-DvLLSQeH.js";import{L as Ss}from"./layers-BcyTjt38.js";import{C as xe}from"./cpu-Dg7bCJU-.js";import{G as ce}from"./gauge-B7MdF6hO.js";import{G as ks}from"./git-branch-qzfAVr34.js";import{F as Cs}from"./funnel-QHO0qSpK.js";import{S as Re}from"./shield-off-aoWvsNdX.js";import{C as Ds}from"./chevron-left-7eermQn-.js";import{C as As}from"./chevron-right-Dbyi0UyG.js";import{S as $s}from"./shield-CHrIB12_.js";import{T as Ts}from"./trash-2-h8csgnab.js";import{f as Ie}from"./format-CWd1zDtX.js";import{P as Fs}from"./plus-Csg8aJyS.js";import{T as Ps}from"./triangle-alert-BbQK1IRh.js";import{C as Es}from"./circle-check-C4_Ac_cp.js";import"./zap-Dd7ru-25.js";import"./wrench-DXXBsi3K.js";import"./users-Dpu3axcO.js";import"./shield-x-C8aC-kD3.js";import"./shield-alert-CzyQPunW.js";import"./network-CyY2qIJ7.js";import"./key-round-PrwJCIQY.js";import"./globe-DAiEboTv.js";import"./file-lock-Cy87Hx5b.js";import"./index-Bp1ChL9u.js";import"./index-PdFO3pZF.js";import"./index-BV-3pcbN.js";import"./check-pEZzqymH.js";import"./index-B6Du3M43.js";import"./index-C4MLugeQ.js";const Os=M({method:"GET"}).middleware([V("cost","govern")]).handler(z("aa402924da5b749f2b750fda73043ac1f33a2578eeb7561ebbb60b2cdc0dedd3")),Ls=M({method:"GET"}).middleware([V("cost","govern")]).handler(z("bdbe8f3fb6ad86b12d65f3a9c712d963d018e8625555e2ee2b7780559d61a094")),Rs=M({method:"GET"}).middleware([V("cost","govern")]).handler(z("cc040ac300e08b31b3920579e63eeff5dd90869a1c0be5413035458800effac4")),Is=M({method:"POST"}).middleware([V("cost","govern")]).handler(z("635af6638f065254d80bebb7f744cee5714d039f71a04bf0403d1c3ac8bc3748")),Ms=M({method:"POST"}).middleware([V("cost","govern")]).handler(z("27f64201f448772551e474ddfacea2f2a792e2d1f210418c8ac7f29a00200629")),Vs=M({method:"POST"}).middleware([V("cost","govern")]).handler(z("c28e29cab761af6eccfd127d1bc726395335dfdbca08bc755702b9eef69b48cc")),zs=M({method:"GET"}).middleware([V("cost","govern")]).handler(z("1d2949a277a352a55970e4652045851fb370de2d0990cae8f70850aef59434d3")),_s=M({method:"POST"}).middleware([V("cost","govern")]).handler(z("10e822b3e19e2b62d4c220c2555cd7b61a00295b7bdec52813beb790e8abf6a4")),qs=[{label:"24h",days:1},{label:"7d",days:7},{label:"30d",days:30},{label:"90d",days:90}],fe=25,Bs={active:"hsl(var(--success))",paused:"hsl(var(--warning))",archived:"hsl(var(--muted-foreground))"},I={online:"text-emerald-400 bg-emerald-500/10 ring-emerald-500/20",offline:"text-muted-foreground bg-muted ring-border",unknown:"text-muted-foreground bg-muted ring-border"},Me={stable:"text-emerald-400 bg-emerald-500/10 ring-emerald-500/20",beta:"text-amber-400 bg-amber-500/10 ring-amber-500/20",canary:"text-rose-400 bg-rose-500/10 ring-rose-500/30"},Gs={allow:"text-emerald-400 bg-emerald-500/10 ring-emerald-500/20",block:"text-rose-400 bg-rose-500/10 ring-rose-500/30",monitor:"text-amber-400 bg-amber-500/10 ring-amber-500/20"},Ae={critical:"text-rose-400 bg-rose-500/10 ring-rose-500/30",high:"text-orange-400 bg-orange-500/10 ring-orange-500/20",medium:"text-amber-400 bg-amber-500/10 ring-amber-500/20",low:"text-slate-300 bg-slate-500/10 ring-slate-500/20"},Ks={open:"text-rose-400 bg-rose-500/10 ring-rose-500/30",acknowledged:"text-amber-400 bg-amber-500/10 ring-amber-500/20",resolved:"text-emerald-400 bg-emerald-500/10 ring-emerald-500/20"},G=["hsl(var(--primary))","hsl(var(--primary-glow))","hsl(var(--secondary))","hsl(var(--success))","hsl(var(--warning))","hsl(var(--destructive))"],h=a=>
1Math.round(a).toLocaleString(),Ve={developer:"Developer tool (IDE, CLI)",agent:"AI agent (CrewAI, LangGraph)",service:"Background service / daemon",unknown:"Unknown / unclassified"};function Xt(){const[a,f]=j.useState(30),v=L(qe),{data:N}=B({queryKey:["me"],queryFn:()=>v()}),c=N?.activeOrg?.id;ze(c);const y=L(Os),k=L(Ls),C=L(Rs),D=L(zs),m=B({queryKey:["adoption","fleet",a],queryFn:()=>y({data:{windowDays:a}})}),d=B({queryKey:["adoption","devices"],queryFn:()=>k({data:{limit:2e3}}),placeholderData:s=>s}),u=B({queryKey:["adoption","ai-tools"],queryFn:()=>C()}),p=B({queryKey:["adoption","drift",a],queryFn:()=>D({data:{windowDays:a}})}),{data:l}=B({queryKey:["engine-reachable",c],queryFn:()=>Ke(c),enabled:!!c,staleTime:6e4}),i=m.data,n=i?.kpis,o=m.isLoading&&!i,_=i&&n?.total===0&&n?.totalDevices===0,w=n?.adoptionPct??0,F=(i?.status??[]).map(s=>({name:s.name,value:s.value,color:Bs[s.name]??"hsl(var(--muted-foreground))"})),b=(i?.byKind??[]).map((s,t)=>({name:s.name,value:s.value,color:G[t%G.length]})),P=(i?.versionDistribution??[]).map((s,t)=>({name:s.name,value:s.value,color:G[t%G.length]})),r=(i?.osDistribution??[]).map((s,t)=>({name:s.name,value:s.value,color:G[(t+2)%G.length]})),A=[{key:"cumulative",label:"Total fleet",color:"hsl(var(--primary))"},{key:"registered",label:"New",color:"hsl(var(--primary-glow))"}],ee=Q({mutationFn:()=>ve("/v1/admin/policies/refresh",{method:"POST",orgId:c}),onSuccess:()=>x.success("Policy refresh pushed to the enforcement layers"),onError:()=>x.message("Engine unreachable",{description:"The refresh applies to enforcement once an engine is pointed at this workspace."})}),ue=Q({mutationFn:()=>ve("/v1/admin/agents/sync",{method:"POST",orgId:c}),onSuccess:()=>{x.success("Fleet sync requested — agent registry will reconcile"),d.refetch(),m.refetch()},onError:()=>x.message("Engine unreachable",{description:"Fleet sync reconciles agent identities once the engine's admin plane is reachable again."})}),se=(s,t)=>{l?s.mutate():x.message("Engine unreachable",{description:t})},te=()=>{const s=[...(i?.versionDistribution??[]).map(t=>({metric:"version",key:t.name,count:t.value})),...(i?.rolloutChannels??[]).map(t=>({metric:"channel",key:t.name,count:t.value})),...(i?.osDistribution??[]).map(t=>({metric:"os",key:t.name,count:t.value}))];if(!s.length)return x.error("No fleet telemetry to export");Ee(s,`fleet-adoption-${new Date().toISOString().slice(0,10)}.csv`,[{key:"metric",label:"Metric"},{key:"key",label:"Value"},{key:"count",label:"Devices"}]),x.success("Fleet adoption exported to CSV")},pe=()=>{if(!n)return x.error("Nothing to report yet");const s=E=>String(E??"—").replace(/[&<>]/g,S=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[S]),t=(E,S)=>S.length?`<h2>${E}</h2><table><thead><tr><th>${E}</th><th>Devices</th></tr></thead><tbody>${S.map(re=>`<tr><td>${s(re.name)}</td><td>${re.value}</td></tr>`).join("")}</tbody></table>`:"";Oe("Fleet Adoption",`<h1>Fleet Adoption</h1>
2       <p class="muted">Window: last ${a===1?"24h":`${a} days`} · generated for the active workspace</p>
3       <h2>Headline</h2>
4       <p class="muted">
5         ${n.total} agents (${n.active} active, ${w}% adoption) ·
6         ${n.totalDevices} devices (${n.onlineDevices} online) ·
7         ${n.currentVersionPct}% on ${s(n.minCurrentVersion)}+ ·
8         ${n.mandatoryPct}% mandatory L5
9       </p>
10       ${t("Version distribution",i?.versionDistribution??[])}
11       ${t("Rollout channels",i?.rolloutChannels??[])}
12       ${t("Operating systems",i?.osDistribution??[])}`),x.success("Report opened — use Print → Save as PDF")},H=()=>{m.refetch(),d.refetch(),u.refetch(),p.refetch()},ae=p.data?.counts,ne=u.data?.rows.length??0;return e.jsxs(Be,{children:[e.jsxs("header",{className:"sticky top-0 z-10 border-b border-border/70 bg-background/80 backdrop-blur px-8 h-14 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-baseline gap-3 min-w-0",children:[e.jsx("h1",{className:"text-sm font-semibold shrink-0",children:"Fleet adoption"}),e.jsxs("span",{className:"hidden md:inline text-xs text-muted-foreground truncate",children:["last ",a===1?"24 hours":`${a} days`," · ",h(n?.totalDevices??0)," devices"]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"hidden sm:inline-flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-emerald-400/60 animate-ping"}),e.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-400"})]}),"live"]}),e.jsx("div",{className:"flex items-center rounded-lg border border-border bg-card/60 p-0.5",children:qs.map(s=>e.jsx("button",{onClick:()=>f(s.days),className:`px-2.5 py-1 text-xs rounded-md transition-colors ${a===s.days?"bg-primary text-primary-foreground font-medium shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s.label},s.days))}),e.jsxs(g,{variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:te,children:[e.jsx(be,{className:"w-3.5 h-3.5"})," CSV"]}),e.jsxs(g,{variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:pe,children:[e.jsx(Le,{className:"w-3.5 h-3.5"})," Report"]}),e.jsxs(ps,{children:[e.jsx(gs,{asChild:!0,children:e.jsxs(g,{variant:"outline",size:"sm",className:"h-8 gap-1.5",children:[e.jsx(De,{className:"w-3.5 h-3.5"})," Actions"]})}),e.jsxs(fs,{align:"end",children:[e.jsxs(ge,{onSelect:H,children:[e.jsx(Z,{className:"mr-2 h-3.5 w-3.5"})," Refresh all"]}),e.jsx(js,{}),e.jsxs(ge,{onSelect:()=>se(ue,"Fleet sync reconciles agent identities when the engine's admin plane is reachable."),children:[e.jsx(vs,{className:"mr-2 h-3.5 w-3.5"})," Sync fleet",!l&&e.jsx("span",{className:"ml-2 text-[10px] text-muted-foreground",children:"pending"})]}),e.jsxs(ge,{onSelect:()=>se(ee,"Policy refresh applies to enforcement when the engine's admin plane is reachable."),children:[e.jsx(bs,{className:"mr-2 h-3.5 w-3.5"})," Push policy refresh",!l&&e.jsx("span",{className:"ml-2 text-[10px] text-muted-foreground",children:"pending"})]})]})]}),e.jsx(g,{onClick:H,disabled:m.isFetching,variant:"outline",size:"sm",className:"h-8 w-8 p-0",children:e.jsx(Z,{className:`w-3.5 h-3.5 ${m.isFetching?"animate-spin":""}`})})]})]}),e.jsxs("div",{className:"flex-1 p-8 space-y-6",children:[e.jsx("section",{className:"flex items-end justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h2",{className:"font-display text-2xl font-bold tracking-tight",children:"Fleet adoption"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:_?"No agents or devices registered yet — register an agent or install BoundaryAI on an endpoint to populate the fleet.":`${h(n?.active??0)} of ${h(n?.total??0)} agents active · ${h(n?.onlineDevices??0)} of ${h(n?.totalDevices??0)} devices online.`})]})}),m.isError&&e.jsx(T,{accent:"hsl(var(--destructive))",children:e.jsx(me,{message:"The fleet adoption service didn't respond.",onRetry:()=>m.refetch()})}),e.jsxs("section",{className:"grid gap-4 grid-cols-2 lg:grid-cols-6",children:[e.jsx(O,{icon:e.jsx(ys,{className:"w-4 h-4"}),accent:"hsl(var(--primary))",label:"Total agents",value:h(n?.total??0),hint:"registered"}),e.jsx(O,{icon:e.jsx(De,{className:"w-4 h-4"}),accent:"hsl(var(--success))",label:"Active",value:h(n?.active??0),hint:`${h(n?.paused??0)} paused`}),e.jsx(O,{icon:e.jsx(ws,{className:"w-4 h-4"}),accent:"hsl(var(--primary-glow))",label:"Adoption",value:`${w}%`,gauge:w}),e.jsx(O,{icon:e.jsx(Ne,{className:"w-4 h-4"}),accent:"hsl(var(--secondary))",label:"Devices",value:h(n?.totalDevices??0),hint:`${h(n?.onlineDevices??0)} online`}),e.jsx(O,{icon:e.jsx(Fe,{className:"w-4 h-4"}),accent:"hsl(var(--primary))",label:`${n?.minCurrentVersion??"current"}+ rollout`,value:`${n?.currentVersionPct??0}%`,gauge:n?.currentVersionPct??0,hint:`${h(n?.currentVersionCount??0)} devices`}),e.jsx(O,{icon:e.jsx($e,{className:"w-4 h-4"}),accent:(n?.mandatoryPct??0)>=50?"hsl(var(--success))":"hsl(var(--warning))",label:"Mandatory L5",value:`${n?.mandatoryPct??0}%`,gauge:n?.mandatoryPct??0,hint:`${h(n?.mandatoryCount??0)} armed`})]}),e.jsxs(Qe,{defaultValue:"overview",children:[e.jsxs(We,{children:[e.jsxs(ie,{value:"overview",children:[e.jsx(Ss,{className:"mr-1.5 h-3.5 w-3.5"})," Overview"]}),e.jsxs(ie,{value:"devices",children:[e.jsx(Ne,{className:"mr-1.5 h-3.5 w-3.5"})," Devices",(n?.totalDevices??0)>0&&e.jsx(U,{variant:"outline",className:"ml-1.5 text-[10px] px-1.5 py-0",children:h(n?.totalDevices??0)})]}),e.jsxs(ie,{value:"tools",children:[e.jsx(xe,{className:"mr-1.5 h-3.5 w-3.5"})," AI Tools",ne>0&&e.jsx(U,{variant:"outline",className:"ml-1.5 text-[10px] px-1.5 py-0",children:ne})]}),e.jsxs(ie,{value:"drift",children:[e.jsx(ce,{className:"mr-1.5 h-3.5 w-3.5"})," Drift",(ae?.open??0)>0&&e.jsx(U,{className:"ml-1.5 text-[10px] px-1.5 py-0 bg-rose-500/15 text-rose-400 ring-1 ring-rose-500/30",children:ae?.open})]})]}),e.jsxs(oe,{value:"overview",className:"space-y-6 mt-6",children:[e.jsxs("section",{className:"grid gap-4 lg:grid-cols-3",children:[e.jsx(T,{title:"Adoption",subtitle:"Active share of the fleet",accent:"hsl(var(--primary-glow))",children:o?e.jsx(q,{height:220}):e.jsx(Js,{pct:w,active:n?.active??0,total:n?.total??0})}),e.jsx(T,{title:"Status mix",subtitle:"Active · paused · archived",accent:"hsl(var(--success))",children:o?e.jsx(q,{height:220}):F.some(s=>s.value>0)?e.jsxs(e.Fragment,{children:[e.jsx(Se,{data:F,centerLabel:"agents"}),e.jsx("div",{className:"mt-3 space-y-1.5",children:F.map(s=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:s.
12color}}),e.jsx("span",{className:"capitalize text-muted-foreground",children:s.name}),e.jsx("span",{className:"ml-auto tabular-nums font-medium",children:h(s.value)})]},s.name))})]}):e.jsx(K,{children:"No agents registered."})}),e.jsx(T,{title:"Registrations over time",subtitle:"Cumulative fleet growth",accent:"hsl(var(--primary))",action:e.jsx("div",{className:"hidden sm:flex items-center gap-3",children:A.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:s.color}})," ",s.label]},s.key))}),children:o?e.jsx(q,{height:224}):i?.trend?.length?e.jsx(Ge,{data:i.trend,series:A,height:224}):e.jsx(K,{children:"No registration history."})})]}),e.jsxs("section",{className:"grid gap-4 lg:grid-cols-3",children:[e.jsx(T,{title:"Version distribution",subtitle:"Agent builds across the fleet",accent:"hsl(var(--primary))",action:e.jsxs(U,{variant:"outline",className:"text-[10px]",children:[h(n?.totalDevices??0)," devices"]}),children:o?e.jsx(q,{height:220}):i?.hasFleetTelemetry?P.length?e.jsx(ke,{data:P}):e.jsx(K,{children:"No version telemetry yet."}):e.jsx(je,{})}),e.jsx(T,{title:"Rollout channels",subtitle:"Stable · beta · canary",accent:"hsl(var(--warning))",children:o?e.jsx(q,{height:220}):i?.hasFleetTelemetry?i?.rolloutChannels?.length?e.jsx("div",{className:"flex flex-col gap-2 pt-2",children:i.rolloutChannels.map(s=>{const t=n?.totalDevices||1,E=Math.round(s.value/t*100);return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-medium uppercase tracking-wider ring-1 w-16 text-center ${Me[s.name]??I.unknown}`,children:s.name}),e.jsx("div",{className:"flex-1 h-2 rounded-full bg-muted/40 overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${E}%`,background:s.name==="stable"?"hsl(var(--success))":s.name==="beta"?"hsl(var(--warning))":"hsl(var(--destructive))"}})}),e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-16 text-right",children:[h(s.value)," · ",E,"%"]})]},s.name)})}):e.jsx(K,{children:"No channel telemetry yet."}):e.jsx(je,{})}),e.jsx(T,{title:"Operating systems",subtitle:"OS distribution",accent:"hsl(var(--secondary))",children:o?e.jsx(q,{height:220}):i?.hasFleetTelemetry?r.length?e.jsxs(e.Fragment,{children:[e.jsx(Se,{data:r,height:200,centerLabel:"devices"}),e.jsx("div",{className:"mt-3 space-y-1.5",children:r.slice(0,5).map(s=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:s.color}}),e.jsx("span",{className:"capitalize text-muted-foreground truncate",children:s.name}),e.jsx("span",{className:"ml-auto tabular-nums font-medium",children:h(s.value)})]},s.name))})]}):e.jsx(K,{children:"No OS telemetry yet."}):e.jsx(je,{})})]}),e.jsx(T,{title:"By kind",subtitle:"Agents per kind",accent:"hsl(var(--secondary))",children:o?e.jsx(q,{height:200}):b.length?e.jsx(ke,{data:b,height:Math.max(140,b.length*30)}):e.jsx(K,{children:"No agents to rank."})})]}),e.jsx(oe,{value:"devices",className:"space-y-6 mt-6",children:e.jsx(Us,{data:d.data,loading:d.isLoading&&!d.data,isError:d.isError,isFetching:d.isFetching,onRetry:()=>d.refetch(),minVersion:n?.minCurrentVersion??"current"})}),e.jsx(oe,{value:"tools",className:"space-y-6 mt-6",children:e.jsx(Qs,{data:u.data,loading:u.isLoading&&!u.data,isError:u.isError,onRetry:()=>u.refetch(),engineUp:l??!1})}),e.jsx(oe,{value:"drift",className:"space-y-6 mt-6",children:e.jsx(Ys,{data:p.data,loading:p.isLoading&&!p.data,isError:p.isError,onRetry:()=>p.refetch(),days:a})})]})]})]})}function Us({data:a,loading:f,isError:v,isFetching:N,onRetry:c,minVersion:y}){const[k,C]=j.useState(""),[D,m]=j.useState("all"),[d,u]=j.useState("all"),[p,l]=j.useState(0),[i,n]=j.useState(new Set),[o,_]=j.useState(null),w=a?.rows??[],F=j.useMemo(()=>Array.from(new Set(w.map(s=>s.channel))).sort(),[w]),b=j.useMemo(()=>{const s=k.trim().toLowerCase();return w.filter(t=>D==="online"&&!t.online||D==="offline"&&t.online||d!=="all"&&t.channel!==d?!1:s?t.hostname.toLowerCase().includes(s)||(t.version??"").toLowerCase().includes(s)||(t.os??"").toLowerCase().includes(s)||t.channel.toLowerCase().includes(s)||t.id.toLowerCase().includes(s):!0)}
12,[w,k,D,d]),P=Math.max(1,Math.ceil(b.length/fe)),r=Math.min(p,P-1),A=b.slice(r*fe,(r+1)*fe),ee=A.length>0&&A.every(s=>i.has(s.id)),ue=()=>{const s=new Set(i);ee?A.forEach(t=>s.delete(t.id)):A.forEach(t=>s.add(t.id)),n(s)},se=s=>{const t=new Set(i);t.has(s)?t.delete(s):t.add(s),n(t)},te=j.useMemo(()=>b.filter(s=>i.has(s.id)),[b,i]),pe=s=>s.map(t=>({hostname:t.hostname,device_id:t.id,version:t.version??"",os:t.os??"",channel:t.channel,status:t.online?"online":"offline",risk:t.risk,mandatory_l5:t.mandatory?"yes":"no",current_version:t.isCurrent?"yes":"no",last_seen:t.lastSeenAt??"",registered:t.createdAt})),H=()=>{const s=i.size?te:b;if(!s.length)return x.error("No devices to export");Ee(pe(s),`fleet-devices-${new Date().toISOString().slice(0,10)}.csv`),x.success(`Exported ${s.length} ${i.size?"selected ":""}device(s) to CSV`)},ae=()=>{const s=i.size?te:b;if(!s.length)return x.error("No devices to export");const t=S=>String(S??"—").replace(/[&<>]/g,re=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[re]),E=s.slice(0,1500).map(S=>`<tr>
13        <td>${t(S.hostname)}</td>
14        <td>${t(S.version??"—")}</td>
15        <td>${t(S.os??"—")}</td>
16        <td><span class="badge">${t(S.channel)}</span></td>
17        <td>${S.online?"online":"offline"}</td>
18        <td>${S.mandatory?"yes":"no"}</td>
19        <td>${S.lastSeenAt?t(de(new Date(S.lastSeenAt),{addSuffix:!0})):"never"}</td>
20      </tr>`).join("");Oe("Fleet Devices",`<h1>Fleet Devices</h1>
21       <p class="muted">${s.length.toLocaleString()} device(s) · current build = ${t(y)}+</p>
22       <table><thead><tr>
23         <th>Host</th><th>Version</th><th>OS</th><th>Channel</th><th>Status</th><th>Mandatory L5</th><th>Last seen</th>
24       </tr></thead><tbody>${E}</tbody></table>`),x.success("Report opened — use Print → Save as PDF")},ne=()=>{C(""),m("all"),u("all"),l(0)};return e.jsxs(e.Fragment,{children:[e.jsxs(T,{className:"p-0",title:"Fleet devices",subtitle:"Click a row for full device telemetry",action:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"outline",size:"sm",className:"h-8",onClick:c,disabled:N,children:e.jsx(Z,{className:`w-3.5 h-3.5 ${N?"animate-spin":""}`})}),e.jsxs(g,{variant:"outline",size:"sm",className:"h-8",onClick:H,children:[e.jsx(be,{className:"mr-1.5 h-3.5 w-3.5"})," CSV"]}),e.jsxs(g,{variant:"outline",size:"sm",className:"h-8",onClick:ae,children:[e.jsx(Le,{className:"mr-1.5 h-3.5 w-3.5"})," PDF"]})]}),children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap p-4 border-t border-border/60",children:[e.jsxs("div",{className:"relative flex-1 min-w-[220px]",children:[e.jsx(Pe,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(ye,{value:k,onChange:s=>{C(s.target.value),l(0)},placeholder:"Search host, version, OS, channel…",className:"pl-8 h-9 text-sm"})]}),e.jsxs(W,{value:D,onValueChange:s=>{m(s),l(0)},children:[e.jsx(Y,{className:"w-32 h-9 text-sm",children:e.jsx(J,{placeholder:"Status"})}),e.jsxs(X,{children:[e.jsx($,{value:"all",children:"All status"}),e.jsx($,{value:"online",children:"Online"}),e.jsx($,{value:"offline",children:"Offline"})]})]}),e.jsxs(W,{value:d,onValueChange:s=>{u(s),l(0)},children:[e.jsx(Y,{className:"w-36 h-9 text-sm",children:e.jsx(J,{placeholder:"Channel"})}),e.jsxs(X,{children:[e.jsx($,{value:"all",children:"All channels"}),F.map(s=>e.jsx($,{value:s,className:"capitalize",children:s},s))]})]}),e.jsxs(g,{variant:"ghost",size:"sm",className:"h-9 text-xs text-muted-foreground",onClick:ne,children:[e.jsx(Cs,{className:"mr-1.5 h-3.5 w-3.5"})," Reset"]}),e.jsxs("span",{className:"ml-auto text-xs text-muted-foreground tabular-nums",children:[b.length.toLocaleString()," of ",w.length.toLocaleString()," shown",a?.truncated&&e.jsx("span",{className:"text-amber-400",children:" · capped"})]})]}),i.size>0&&e.jsxs("div",{className:"flex items-center gap-3 border-t border-border/70 bg-primary/5 px-4 py-2.5",children:[e.jsxs("span",{className:"text-xs font-medium",children:[i.size," selected"]}),e.jsxs(g,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:H,children:[e.jsx(be,{className:"mr-1.5 h-3 w-3"})," Export selected"]}),e.jsxs(g,{size:"sm",variant:"ghost",className:"h-7 text-xs text-muted-foreground",onClick:()=>n(new Set),children:[e.jsx(_e,{className:"mr-1.5 h-3 w-3"})," Clear"]})]}),f?e.jsx("div",{className:"px-5 py-4",children:e.jsx(we,{rows:10})}):v?e.jsx(me,{message:"The fleet devices service didn't respond.",onRetry:c}):b.length===0?e.jsx(he,{icon:e.jsx(Ne,{className:"w-6 h-6"}
24),title:w.length===0?"No devices reporting":"No devices match these filters",hint:w.length===0?"Install BoundaryAI on an endpoint — devices appear here within ~30 seconds of the daemon reporting in.":"Loosen the filters to see more endpoints."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto border-t border-border/60",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/40 text-[11px] uppercase tracking-wider text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2.5 w-9",children:e.jsx(Ce,{checked:ee,onCheckedChange:ue,"aria-label":"Select all on page"})}),e.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Host"}),e.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Version"}),e.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"OS"}),e.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Channel"}),e.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"L5"}),e.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Status"}),e.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Last seen"})]})}),e.jsx("tbody",{className:"divide-y divide-border/60",children:A.map(s=>e.jsxs("tr",{onClick:()=>_(s),className:"hover:bg-muted/30 transition-colors cursor-pointer",children:[e.jsx("td",{className:"px-3 py-2.5",onClick:t=>t.stopPropagation(),children:e.jsx(Ce,{checked:i.has(s.id),onCheckedChange:()=>se(s.id),"aria-label":"Select row"})}),e.jsxs("td",{className:"px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),e.jsx("span",{className:"font-medium truncate max-w-[180px]",children:s.hostname})]}),e.jsx("div",{className:"text-[11px] font-mono text-muted-foreground truncate max-w-[180px]",children:s.id})]}),e.jsxs("td",{className:"px-3 py-2.5",children:[e.jsx("span",{className:"font-mono text-xs",children:s.version??"—"}),s.isCurrent&&e.jsx(U,{variant:"outline",className:"ml-1.5 text-[9px] text-emerald-400",children:"current"})]}),e.jsx("td",{className:"px-3 py-2.5 text-muted-foreground",children:s.os??"—"}),e.jsx("td",{className:"px-3 py-2.5",children:e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-medium uppercase tracking-wider ring-1 ${Me[s.channel]??I.unknown}`,children:s.channel})}),e.jsx("td",{className:"px-3 py-2.5",children:s.mandatory?e.jsx($e,{className:"w-4 h-4 text-emerald-400"}):e.jsx(Re,{className:"w-4 h-4 text-muted-foreground/50"})}),e.jsx("td",{className:"px-3 py-2.5",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[10px] font-medium uppercase tracking-wider ring-1 ${s.online?I.online:I.offline}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${s.online?"bg-emerald-400":"bg-muted-foreground/50"}`}),s.online?"online":"offline"]})}),e.jsx("td",{className:"px-3 py-2.5 text-xs text-muted-foreground tabular-nums whitespace-nowrap",children:s.lastSeenAt?de(new Date(s.lastSeenAt),{addSuffix:!0}):"never"})]},s.id))})]})}),P>1&&e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border/70 px-4 py-3",children:[e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:["Page ",r+1," of ",P," · ",b.length.toLocaleString()," devices"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(g,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:r===0,onClick:()=>l(r-1),children:[e.jsx(Ds,{className:"mr-1 h-3.5 w-3.5"})," Prev"]}),e.jsxs(g,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:r>=P-1,onClick:()=>l(r+1),children:["Next ",e.jsx(As,{className:"ml-1 h-3.5 w-3.5"})]})]})]})]})]}),e.jsx(Hs,{device:o,onClose:()=>_(null)})]})}function Hs({device:a,onClose:f}){return e.jsx(Ye,{open:!!a,onOpenChange:v=>!v&&f(),children:e.jsx(Je,{className:"w-full sm:max-w-xl overflow-y-auto",children:a&&e.jsxs(e.Fragment,{children:[e.jsxs(Xe,{children:[e.jsxs(Ze,{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"truncate",children:a.hostname})]}),e.jsxs(es,{className:"flex items-center gap-2",children:[e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-1.5 py-0.5 rounded text-[10px] font-medium uppercase tracking-wider ring-1 ${a.online?I.online:I.offline}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${a.online?"bg-emerald-400":"bg-muted-foreground
24/50"}`}),a.online?"online":"offline"]}),e.jsx("span",{className:"font-mono text-xs break-all",children:a.id})]})]}),e.jsxs("div",{className:"mt-5 space-y-5 text-sm",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(R,{label:"Version",value:a.version??"—",mono:!0}),e.jsx(R,{label:"On current build",value:a.isCurrent?"Yes":"No"}),e.jsx(R,{label:"OS",value:a.os??"—"}),e.jsx(R,{label:"Channel",value:a.channel}),e.jsx(R,{label:"Risk",value:a.risk}),e.jsx(R,{label:"Mandatory L5",value:a.mandatory?"Armed":"Not armed"}),e.jsx(R,{label:"Last seen",value:a.lastSeenAt?de(new Date(a.lastSeenAt),{addSuffix:!0}):"never"}),e.jsx(R,{label:"Registered",value:Ie(new Date(a.createdAt),"PP")})]}),Object.keys(a.metadata).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wider text-muted-foreground mb-1",children:"Metadata"}),e.jsx("pre",{className:"p-2.5 rounded-lg bg-black/40 text-emerald-400 font-mono text-[11px] overflow-auto max-h-72 leading-relaxed",children:JSON.stringify(a.metadata,null,2)})]})]})]})})})}function Qs({data:a,loading:f,isError:v,onRetry:N,engineUp:c}){const y=Te(),[k,C]=j.useState(""),[D,m]=j.useState(!1),[d,u]=j.useState(null),p=L(Is),l=L(Ms),i=L(Vs),n=()=>y.invalidateQueries({queryKey:["adoption","ai-tools"]}),o=async()=>{try{await ve("/v1/admin/policies/refresh",{method:"POST"})}catch{}},_=Q({mutationFn:r=>l({data:{id:r.id,decision:r.enabled?"block":"allow"}}),onSuccess:async(r,A)=>{x.success(`${A.toolName} ${A.enabled?"disabled":"enabled"}`),n(),await o()},onError:r=>x.error(`Update failed: ${r?.message??"unknown error"}`)}),w=Q({mutationFn:r=>i({data:{id:r.id}}),onSuccess:async(r,A)=>{x.success(`${A.toolName} removed`),u(null),n(),await o()},onError:r=>x.error(`Delete failed: ${r?.message??"unknown error"}`)}),F=a?.rows??[],b=F.filter(r=>r.toolName.toLowerCase().includes(k.toLowerCase())),P=F.filter(r=>r.enabled).length;return e.jsxs(e.Fragment,{children:[e.jsxs(T,{title:"AI tool allowlist",subtitle:"Binaries the L5 kernel filter excludes from per-PID enforcement",accent:"hsl(var(--primary))",action:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"outline",size:"sm",className:"h-8",onClick:N,children:e.jsx(Z,{className:"w-3.5 h-3.5"})}),e.jsxs(g,{size:"sm",className:"h-8",onClick:()=>m(!0),children:[e.jsx(Fs,{className:"mr-1.5 h-3.5 w-3.5"})," Add tool"]})]}),children:[e.jsxs("div",{className:"flex items-center gap-3 pb-3",children:[e.jsxs("div",{className:"relative flex-1 max-w-sm",children:[e.jsx(Pe,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(ye,{value:k,onChange:r=>C(r.target.value),placeholder:"Filter by tool name…",className:"pl-8 h-9 text-sm"})]}),e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[b.length," of ",F.length," · ",P," enabled"]}),!c&&e.jsx(U,{variant:"outline",className:"text-[10px] text-muted-foreground",children:"engine unreachable — edits persist and propagate once it responds"})]}),f?e.jsx(we,{rows:5}):v?e.jsx(me,{message:"Couldn't load the allowlist.",onRetry:N}):b.length===0?e.jsx(he,{icon:e.jsx(xe,{className:"w-6 h-6"}),title:F.length===0?"No allowlisted AI tools":"No tools match",hint:F.length===0?"Add custom or internal AI tool binaries so the kernel filter excludes them from per-PID enforcement.":"Clear the filter to see all tools."}):e.jsx("div",{className:"grid gap-3",children:b.map(r=>e.jsxs("div",{className:`rounded-xl border border-border/70 bg-background/40 p-4 ${r.enabled?"":"opacity-60"}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.enabled?e.jsx($s,{className:"w-4 h-4 text-emerald-400 shrink-0"}):e.jsx(Re,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"text-sm font-mono truncate",children:r.toolName}),e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-medium uppercase tracking-wider ring-1 ${Gs[r.decision]??I.unknown}`,children:r.decision})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx(Ue,{checked:r.enabled,onCheckedChange:()=>_.mutate(r),disabled:_.isPending,"aria-label":"Toggle allow"}),e.jsx(g,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>u(r),title:"Remove from allowlist",children:e.jsx(Ts,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground space-y-0.5",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground
24/70",children:"Class:"})," ",Ve[r.category]??r.category]}),r.notes&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground/70",children:"Notes:"})," ",r.notes]}),e.jsxs("div",{className:"text-[11px] text-muted-foreground/70",children:["Added ",Ie(new Date(r.createdAt),"PP")]})]})]},r.id))})]}),e.jsx(Ws,{open:D,onClose:()=>m(!1),onAdded:async()=>{m(!1),n(),await o()},addFn:p}),e.jsx(is,{open:!!d,onOpenChange:r=>!r&&u(null),children:e.jsxs(os,{children:[e.jsxs(cs,{children:[e.jsx(ds,{children:"Remove AI tool?"}),e.jsxs(ms,{children:[e.jsx("code",{className:"font-mono",children:d?.toolName})," will be removed from the allowlist. The kernel filter will resume enforcing on its PIDs after the next policy refresh."]})]}),e.jsxs(hs,{children:[e.jsx(xs,{children:"Cancel"}),e.jsx(us,{onClick:()=>d&&w.mutate(d),disabled:w.isPending,children:"Remove"})]})]})})]})}function Ws({open:a,onClose:f,onAdded:v,addFn:N}){const[c,y]=j.useState(""),[k,C]=j.useState("developer"),[D,m]=j.useState("allow"),[d,u]=j.useState(""),[p,l]=j.useState(!1),i=()=>{y(""),C("developer"),m("allow"),u("")},n=async()=>{if(!c.trim()){x.error("Tool name is required");return}l(!0);try{await N({data:{toolName:c.trim(),category:k,decision:D,notes:d.trim()||null}}),x.success(`${c.trim()} added to allowlist`),i(),await v()}catch(o){x.error(`Insert failed: ${o?.message??"unknown error"}`)}finally{l(!1)}};return e.jsx(ss,{open:a,onOpenChange:o=>!o&&f(),children:e.jsxs(ts,{children:[e.jsxs(as,{children:[e.jsx(ns,{children:"Add AI tool to allowlist"}),e.jsx(rs,{children:"Case-insensitive binary name. The engine merges this with the hardcoded defaults (Claude / Cursor / VS Code / Aider / Cline / Windsurf)."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(le,{htmlFor:"tool",children:"Tool name"}),e.jsx(ye,{id:"tool",placeholder:"e.g. my-agent.exe",value:c,onChange:o=>y(o.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(le,{htmlFor:"cat",children:"Classification"}),e.jsxs(W,{value:k,onValueChange:o=>C(o),children:[e.jsx(Y,{id:"cat",children:e.jsx(J,{})}),e.jsx(X,{children:["developer","agent","service","unknown"].map(o=>e.jsx($,{value:o,children:Ve[o]},o))})]})]}),e.jsxs("div",{children:[e.jsx(le,{htmlFor:"dec",children:"Decision"}),e.jsxs(W,{value:D,onValueChange:o=>m(o),children:[e.jsx(Y,{id:"dec",children:e.jsx(J,{})}),e.jsxs(X,{children:[e.jsx($,{value:"allow",children:"Allow (exclude from enforcement)"}),e.jsx($,{value:"monitor",children:"Monitor only"}),e.jsx($,{value:"block",children:"Block"})]})]})]})]}),e.jsxs("div",{children:[e.jsx(le,{htmlFor:"notes",children:"Notes (optional)"}),e.jsx(He,{id:"notes",placeholder:"Internal AI orchestrator built on LangGraph",value:d,onChange:o=>u(o.target.value),rows:2})]})]}),e.jsxs(ls,{children:[e.jsx(g,{variant:"ghost",onClick:f,children:"Cancel"}),e.jsx(g,{onClick:n,disabled:p,children:p?"Adding…":"Add to allowlist"})]})]})})}function Ys({data:a,loading:f,isError:v,onRetry:N,days:c}){const y=Te(),k=L(_s),[C,D]=j.useState("all"),m=Q({mutationFn:l=>k({data:l}),onSuccess:(l,i)=>{x.success(`Drift event ${i.status}`),y.invalidateQueries({queryKey:["adoption","drift"]})},onError:l=>x.error(`Update failed: ${l?.message??"unknown error"}`)}),d=a?.events??[],u=C==="all"?d:d.filter(l=>l.status===C),p=a?.counts;return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"grid gap-4 grid-cols-2 lg:grid-cols-3",children:[e.jsx(O,{icon:e.jsx(ce,{className:"w-4 h-4"}),accent:"hsl(var(--primary))",label:"Drift events",value:h(p?.total??0),hint:`last ${c===1?"24h":`${c}d`}`}),e.jsx(O,{icon:e.jsx(Ps,{className:"w-4 h-4"}),accent:(p?.open??0)>0?"hsl(var(--destructive))":"hsl(var(--success))",label:"Open",value:h(p?.open??0),hint:"awaiting review"}),e.jsx(O,{icon:e.jsx(Fe,{className:"w-4 h-4"}),accent:(p?.high??0)>0?"hsl(var(--warning))":"hsl(var(--success))",label:"High severity",value:h(p?.high??0),hint:"high / critical"})]}),e.jsx(T,{title:"Drift vs. baseline",subtitle:"Configuration & behavioural drift detected across the fleet",accent:"hsl(var(--warning))",action:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(W,{value:C,onValueChange:D,children:[e.jsx(Y,{className:"w-36 h-8 text-xs",children:e.jsx(J,{placeholder:"Status"})}),e.jsxs(X,{children:[e.jsx($,{value:"all",children:"All status"}),e.jsx($,{value:"open",children:"Open"}),e.jsx($,{value:"acknowledged",children:"Acknowledged"}),e.jsx($,{value:"resolved",children:"Resolved"})]})]}),e.jsx(g,{variant:"outline",size:"sm",className:"h-8",onClick:N,children:e.jsx(Z,{className:"w-3.5 h-3.5"})})]}),children:f?e.jsx(we,{rows:5}):v?e.jsx(me,{message:"Couldn't load drift events.",onRetry:N}):u.length===0?e.jsx(he,{icon:e.jsx(ce,{className:"w-6 h-6"}
24),title:d.length===0?"No drift detected":"No events match",hint:d.length===0?"When a device or agent diverges from its locked baseline, the drift event appears here. The fleet is currently stable.":"Switch the status filter to see other drift events."}):e.jsx("div",{className:"space-y-2.5",children:u.map(l=>e.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-border/60 bg-background/40 px-4 py-3",children:[e.jsx("div",{className:"mt-0.5 inline-flex items-center justify-center w-8 h-8 rounded-lg shrink-0",style:{background:"color-mix(in oklab, hsl(var(--warning)) 14%, transparent)",color:"hsl(var(--warning))"},children:e.jsx(ce,{className:"w-4 h-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium capitalize",children:l.kind.replace(/_/g," ")}),e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-medium uppercase tracking-wider ring-1 ${Ae[l.severity]??Ae.low}`,children:l.severity}),e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-medium uppercase tracking-wider ring-1 ${Ks[l.status]??I.unknown}`,children:l.status})]}),(l.baseline||l.observed)&&e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground font-mono break-words",children:[l.baseline&&e.jsx("span",{className:"text-muted-foreground/70",children:"baseline:"})," ",l.baseline??"",l.observed&&e.jsxs(e.Fragment,{children:[" → ",e.jsx("span",{className:"text-amber-400",children:l.observed})]})]}),e.jsxs("div",{className:"mt-1 text-[11px] text-muted-foreground tabular-nums",children:[de(new Date(l.createdAt),{addSuffix:!0}),l.agentId&&e.jsxs("span",{className:"ml-2 font-mono",children:["agent ",l.agentId.slice(0,8)]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.status==="open"&&e.jsx(g,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>m.mutate({id:l.id,status:"acknowledged"}),disabled:m.isPending,children:"Ack"}),l.status!=="resolved"&&e.jsxs(g,{variant:"ghost",size:"sm",className:"h-7 text-xs text-emerald-400 hover:text-emerald-300",onClick:()=>m.mutate({id:l.id,status:"resolved"}),disabled:m.isPending,children:[e.jsx(Es,{className:"mr-1 h-3.5 w-3.5"})," Resolve"]})]})]},l.id))})})]})}function Js({pct:a,active:f,total:v}){const c=2*Math.PI*52,y=Math.min(100,Math.max(0,a))/100*c;return e.jsxs("div",{className:"flex flex-col items-center justify-center py-2",children:[e.jsxs("div",{className:"relative w-[148px] h-[148px]",children:[e.jsxs("svg",{viewBox:"0 0 148 148",className:"w-full h-full -rotate-90",children:[e.jsx("circle",{cx:"74",cy:"74",r:52,fill:"none",stroke:"hsl(var(--muted))",strokeWidth:"12"}),e.jsx("circle",{cx:"74",cy:"74",r:52,fill:"none",stroke:"hsl(var(--primary-glow))",strokeWidth:"12",strokeLinecap:"round",strokeDasharray:`${y} ${c}`})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsxs("div",{className:"text-3xl font-display font-bold tabular-nums",children:[Math.round(a),"%"]}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:"adoption"})]})]}),e.jsxs("div",{className:"mt-3 inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Ns,{className:"w-3 h-3 text-[hsl(var(--primary-glow))]"}),e.jsx("span",{className:"text-foreground font-medium tabular-nums",children:h(f)})," active of"," ",e.jsx("span",{className:"text-foreground font-medium tabular-nums",children:h(v)})]})]})}function O({icon:a,label:f,value:v,hint:N,accent:c,gauge:y}){return e.jsx(T,{className:"p-0",children:e.jsxs("div",{className:"relative p-5",children:[e.jsx("div",{className:"absolute inset-x-0 top-0 h-0.5",style:{background:c}}),e.jsx("div",{className:"flex items-start justify-between",children:e.jsx("div",{className:"inline-flex items-center justify-center w-8 h-8 rounded-lg",style:{background:`color-mix(in oklab, ${c} 14%, transparent)`,color:c},children:a})}),e.jsx("div",{className:"mt-3 text-[11px] uppercase tracking-wider text-muted-foreground font-medium truncate",children:f}),e.jsx("div",{className:"mt-1 text-3xl font-display font-bold tabular-nums",children:v}),N&&e.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:N}),y!=null&&e.jsx("div",{className:"mt-3 h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(100,y)}%`,background:c}})})]})})}function R({label:a,value:f,mono:v}){return e.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/40 px-2.5 py-2",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:a}),e.jsx("div",{className:`mt-0.5 truncate ${v?"font-mono":""}`,title:f,children:f})]})}function je(){return e.jsx(he,{icon:e.jsx(ks,{className:"w-5 h-5"}),title:"No fleet telemetry yet",hint:"Install BoundaryAI on an endpoint — version, channel, and mandatory-mode telemetry populate once devices report in."})}function K({children:a}){return e.jsx("div",{className:"h-40 flex items-center justify-center text-xs text-muted-foreground",children:a})}export{Xt as component};

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.