@swestash/agent-lens 0.17.4 → 0.17.6
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.
- package/dist/agent-lens.js +22 -32
- package/dist/agent-lens.js.map +1 -1
- package/package.json +1 -1
- package/web/404.html +2 -2
- package/web/assets/{AboutView-tTOWbdtR.js → AboutView-DE58gn6y.js} +1 -1
- package/web/assets/{Dashboard-C3qXLVs0.js → Dashboard-DNVg4C8Q.js} +2 -2
- package/web/assets/{FileView-DMUoh5N2.js → FileView-Bp1FQn6s.js} +1 -1
- package/web/assets/{FilesView-CDA5f05Z.js → FilesView-CVZN72Gq.js} +1 -1
- package/web/assets/{SecurityView-DXDnsRCb.js → SecurityView-WfNKjnOq.js} +1 -1
- package/web/assets/{SessionView-Cb_Q-gSc.js → SessionView-MC9E6Co7.js} +12 -12
- package/web/assets/{SkillView-AX-xMPdI.js → SkillView-BYDmKcd1.js} +1 -1
- package/web/assets/{SkillsView-BwUdENAc.js → SkillsView-B8WjUwoi.js} +1 -1
- package/web/assets/{WorkflowView-C-39SjGW.js → WorkflowView-9UxUoXwT.js} +1 -1
- package/web/assets/{index-CtNviuC1.js → index-CSQQtD7p.js} +1 -1
- package/web/assets/{index-7p3QjWYa.css → index-CZlMEmLZ.css} +1 -1
- package/web/assets/{index-DiDvUUQ7.js → index-Yyr3A1Uv.js} +2 -2
- package/web/assets/{jsonish-DDjKYx9o.js → jsonish-BeB9o74x.js} +1 -1
- package/web/assets/{theme-BMrL_mzt.js → theme-B5typivv.js} +1 -1
- package/web/assets/{useResetOn-D_B_9yU4.js → useResetOn-BFLXE-9_.js} +1 -1
- package/web/index.html +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-DNVg4C8Q.js","assets/theme-B5typivv.js","assets/SessionView-MC9E6Co7.js","assets/jsonish-BeB9o74x.js","assets/useResetOn-BFLXE-9_.js","assets/index-CSQQtD7p.js","assets/WorkflowView-9UxUoXwT.js","assets/SkillView-BYDmKcd1.js","assets/FileView-Bp1FQn6s.js","assets/FilesView-CVZN72Gq.js","assets/SecurityView-WfNKjnOq.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var ep=Object.defineProperty;var tp=(i,a,u)=>a in i?ep(i,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[a]=u;var cc=(i,a,u)=>tp(i,typeof a!="symbol"?a+"":a,u);function np(i,a){for(var u=0;u<a.length;u++){const c=a[u];if(typeof c!="string"&&!Array.isArray(c)){for(const d in c)if(d!=="default"&&!(d in i)){const m=Object.getOwnPropertyDescriptor(c,d);m&&Object.defineProperty(i,d,m.get?m:{enumerable:!0,get:()=>c[d]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const g of m.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&c(g)}).observe(document,{childList:!0,subtree:!0});function u(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function c(d){if(d.ep)return;d.ep=!0;const m=u(d);fetch(d.href,m)}})();const rp="modulepreload",lp=function(i){return"/"+i},fc={},zt=function(a,u,c){let d=Promise.resolve();if(u&&u.length>0){let g=function(P){return Promise.all(P.map(R=>Promise.resolve(R).then(E=>({status:"fulfilled",value:E}),E=>({status:"rejected",reason:E}))))};document.getElementsByTagName("link");const x=document.querySelector("meta[property=csp-nonce]"),_=(x==null?void 0:x.nonce)||(x==null?void 0:x.getAttribute("nonce"));d=g(u.map(P=>{if(P=lp(P),P in fc)return;fc[P]=!0;const R=P.endsWith(".css"),E=R?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${P}"]${E}`))return;const O=document.createElement("link");if(O.rel=R?"stylesheet":rp,R||(O.as="script"),O.crossOrigin="",O.href=P,_&&O.setAttribute("nonce",_),document.head.appendChild(O),R)return new Promise((Q,V)=>{O.addEventListener("load",Q),O.addEventListener("error",()=>V(new Error(`Unable to preload CSS for ${P}`)))})}))}function m(g){const x=new Event("vite:preloadError",{cancelable:!0});if(x.payload=g,window.dispatchEvent(x),!x.defaultPrevented)throw g}return d.then(g=>{for(const x of g||[])x.status==="rejected"&&m(x.reason);return a().catch(m)})};var gm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function op(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ji={exports:{}},Lr={},Zi={exports:{}},ee={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -66,4 +66,4 @@ Error generating stack: `+o.message+`
|
|
|
66
66
|
*
|
|
67
67
|
* @license MIT
|
|
68
68
|
*/function Jl(){return Jl=Object.assign?Object.assign.bind():function(i){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var c in u)({}).hasOwnProperty.call(u,c)&&(i[c]=u[c])}return i},Jl.apply(null,arguments)}function Kc(i,a){if(i==null)return{};var u={};for(var c in i)if({}.hasOwnProperty.call(i,c)){if(a.indexOf(c)!==-1)continue;u[c]=i[c]}return u}function sh(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function ah(i,a){return i.button===0&&(!a||a==="_self")&&!sh(i)}function su(i){return i===void 0&&(i=""),new URLSearchParams(typeof i=="string"||Array.isArray(i)||i instanceof URLSearchParams?i:Object.keys(i).reduce((a,u)=>{let c=i[u];return a.concat(Array.isArray(c)?c.map(d=>[u,d]):[[u,c]])},[]))}function ch(i,a){let u=su(i);return a&&a.forEach((c,d)=>{u.has(d)||a.getAll(d).forEach(m=>{u.append(d,m)})}),u}const fh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],dh=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],ph="6";try{window.__reactRouterVersion=ph}catch{}const hh=C.createContext({isTransitioning:!1}),mh="startTransition",Nc=ap[mh];function vh(i){let{basename:a,children:u,future:c,window:d}=i,m=C.useRef();m.current==null&&(m.current=mp({window:d,v5Compat:!0}));let g=m.current,[x,_]=C.useState({action:g.action,location:g.location}),{v7_startTransition:P}=c||{},R=C.useCallback(E=>{P&&Nc?Nc(()=>_(E)):_(E)},[_,P]);return C.useLayoutEffect(()=>g.listen(R),[g,R]),C.useEffect(()=>lh(c),[c]),C.createElement(ih,{basename:a,children:u,location:x.location,navigationType:x.action,navigator:g,future:c})}const gh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",yh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Zl=C.forwardRef(function(a,u){let{onClick:c,relative:d,reloadDocument:m,replace:g,state:x,target:_,to:P,preventScrollReset:R,viewTransition:E}=a,O=Kc(a,fh),{basename:Q}=C.useContext(tn),V,B=!1;if(typeof P=="string"&&yh.test(P)&&(V=P,gh))try{let D=new URL(window.location.href),Y=P.startsWith("//")?new URL(D.protocol+P):new URL(P),ae=Wn(Y.pathname,Q);Y.origin===D.origin&&ae!=null?P=ae+Y.search+Y.hash:B=!0}catch{}let N=Vp(P,{relative:d}),ne=Sh(P,{replace:g,state:x,target:_,preventScrollReset:R,relative:d,viewTransition:E});function q(D){c&&c(D),D.defaultPrevented||ne(D)}return C.createElement("a",Jl({},O,{href:V||N,onClick:B||m?c:q,ref:u,target:_}))}),Tr=C.forwardRef(function(a,u){let{"aria-current":c="page",caseSensitive:d=!1,className:m="",end:g=!1,style:x,to:_,viewTransition:P,children:R}=a,E=Kc(a,dh),O=eo(_,{relative:E.relative}),Q=gn(),V=C.useContext($c),{navigator:B,basename:N}=C.useContext(tn),ne=V!=null&&xh(O)&&P===!0,q=B.encodeLocation?B.encodeLocation(O).pathname:O.pathname,D=Q.pathname,Y=V&&V.navigation&&V.navigation.location?V.navigation.location.pathname:null;d||(D=D.toLowerCase(),Y=Y?Y.toLowerCase():null,q=q.toLowerCase()),Y&&N&&(Y=Wn(Y,N)||Y);const ae=q!=="/"&&q.endsWith("/")?q.length-1:q.length;let ke=D===q||!g&&D.startsWith(q)&&D.charAt(ae)==="/",Pe=Y!=null&&(Y===q||!g&&Y.startsWith(q)&&Y.charAt(q.length)==="/"),Ne={isActive:ke,isPending:Pe,isTransitioning:ne},U=ke?c:void 0,Ce;typeof m=="function"?Ce=m(Ne):Ce=[m,ke?"active":null,Pe?"pending":null,ne?"transitioning":null].filter(Boolean).join(" ");let at=typeof x=="function"?x(Ne):x;return C.createElement(Zl,Jl({},E,{"aria-current":U,className:Ce,ref:u,style:at,to:_,viewTransition:P}),typeof R=="function"?R(Ne):R)});var au;(function(i){i.UseScrollRestoration="useScrollRestoration",i.UseSubmit="useSubmit",i.UseSubmitFetcher="useSubmitFetcher",i.UseFetcher="useFetcher",i.useViewTransitionState="useViewTransitionState"})(au||(au={}));var jc;(function(i){i.UseFetcher="useFetcher",i.UseFetchers="useFetchers",i.UseScrollRestoration="useScrollRestoration"})(jc||(jc={}));function wh(i){let a=C.useContext(ql);return a||Se(!1),a}function Sh(i,a){let{target:u,replace:c,state:d,preventScrollReset:m,relative:g,viewTransition:x}=a===void 0?{}:a,_=Bc(),P=gn(),R=eo(i,{relative:g});return C.useCallback(E=>{if(ah(E,u)){E.preventDefault();let O=c!==void 0?c:Xl(P)===Xl(R);_(i,{replace:O,state:d,preventScrollReset:m,relative:g,viewTransition:x})}},[P,_,R,c,d,u,i,m,g,x])}function kh(i){let a=C.useRef(su(i)),u=C.useRef(!1),c=gn(),d=C.useMemo(()=>ch(c.search,u.current?null:a.current),[c.search]),m=Bc(),g=C.useCallback((x,_)=>{const P=su(typeof x=="function"?x(d):x);u.current=!0,m("?"+P,_)},[m,d]);return[d,g]}function xh(i,a){a===void 0&&(a={});let u=C.useContext(hh);u==null&&Se(!1);let{basename:c}=wh(au.useViewTransitionState),d=eo(i,{relative:a.relative});if(!u.isTransitioning)return!1;let m=Wn(u.currentLocation.pathname,c)||u.currentLocation.pathname,g=Wn(u.nextLocation.pathname,c)||u.nextLocation.pathname;return iu(d.pathname,g)!=null||iu(d.pathname,m)!=null}const Eh=700;function Ch(){const[i,a]=C.useState(!1);if(C.useEffect(()=>{const c=()=>a(window.scrollY>Eh);return c(),window.addEventListener("scroll",c,{passive:!0}),()=>window.removeEventListener("scroll",c)},[]),!i)return null;const u=()=>{var d,m;const c=((d=window.matchMedia)==null?void 0:d.call(window,"(prefers-reduced-motion: reduce)").matches)??!1;window.scrollTo({top:0,behavior:c?"auto":"smooth"}),(m=document.getElementById("main"))==null||m.focus({preventScroll:!0})};return v.jsxs("button",{type:"button",className:"to-top",onClick:u,"data-tip":"Back to top",children:[v.jsx("span",{"aria-hidden":"true",children:"↑"}),v.jsx("span",{className:"sr-only",children:"Back to top"})]})}const _h=350,nu=8,Yl=8;function Ph(){const[i,a]=C.useState(null),u=C.useRef(null),c=C.useRef(null),d=C.useRef(null);return C.useEffect(()=>{const m=()=>{d.current!==null&&window.clearTimeout(d.current),d.current=null},g=()=>{m();const E=c.current;E&&E.getAttribute("aria-describedby")==="app-tooltip"&&E.removeAttribute("aria-describedby"),c.current=null,a(null)},x=(E,O)=>{const Q=E.getAttribute("data-tip");if(!Q||c.current===E)return;g(),c.current=E;const V=()=>{E.setAttribute("aria-describedby","app-tooltip");const B=E.getBoundingClientRect();a({text:Q,x:B.left+B.width/2,y:B.top,placed:!1})};O?V():d.current=window.setTimeout(V,_h)},_=E=>{var Q,V;const O=(V=(Q=E.target)==null?void 0:Q.closest)==null?void 0:V.call(Q,"[data-tip]");O?x(O,!1):c.current&&g()},P=E=>{var Q,V;const O=(V=(Q=E.target)==null?void 0:Q.closest)==null?void 0:V.call(Q,"[data-tip]");O&&x(O,!0)},R=E=>E.key==="Escape"&&g();return document.addEventListener("mouseover",_),document.addEventListener("focusin",P),document.addEventListener("focusout",g),document.addEventListener("keydown",R),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),()=>{document.removeEventListener("mouseover",_),document.removeEventListener("focusin",P),document.removeEventListener("focusout",g),document.removeEventListener("keydown",R),window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),m()}},[]),C.useEffect(()=>{const m=u.current,g=c.current;if(!i||i.placed||!m||!g)return;const x=g.getBoundingClientRect(),_=m.offsetWidth,P=m.offsetHeight,R=x.top-P-nu<Yl?x.bottom+nu:x.top-P-nu,E=Math.min(Math.max(x.left+x.width/2-_/2,Yl),Math.max(Yl,window.innerWidth-_-Yl));a({...i,x:E,y:R,placed:!0})},[i]),i?v.jsx("div",{id:"app-tooltip",role:"tooltip",ref:u,className:"app-tip",style:{left:i.x,top:i.y,visibility:i.placed?"visible":"hidden"},children:i.text}):null}const Nh="/assets/logo-Cd7Wsq5o.png",ru={},vn=(ru==null?void 0:ru.VITE_SNAPSHOT)==="1",cu="/";function jh(i){if(!vn)return"/api"+i;const[a,u]=i.split("?"),c=a.replace(/^\//,"");if(c==="file"){const d=new URLSearchParams(u??"");return`${cu}snapshot/file/${Rh(d.get("path")??"",d.get("project"))}.json`}return`${cu}snapshot/${c}.json`}function Rh(i,a){const u=`${a??""}
|
|
69
|
-
${i}`;let c=3735928559,d=1103547991;for(let m=0;m<u.length;m++){const g=u.charCodeAt(m);c=Math.imul(c^g,2654435761),d=Math.imul(d^g,1597334677)}return c=Math.imul(c^c>>>16,2246822507)^Math.imul(d^d>>>13,3266489909),d=Math.imul(d^d>>>16,2246822507)^Math.imul(c^c>>>13,3266489909),(4294967296*(2097151&d)+(c>>>0)).toString(36)}function Sm(i,a){return vn?`${cu}snapshot/sessions/${i}.export.md`:`/api/sessions/${i}/export.md${a?`?redact=${a}`:""}`}async function to(i){const a=await fetch(jh(i));if(!a.ok)throw new Error(`${a.status} ${await a.text()}`);return a.json()}async function Lh(i,a){const u=await fetch("/api"+i,{method:"POST",...a!==void 0?{headers:{"content-type":"application/json"},body:JSON.stringify(a)}:{}});if(!u.ok)throw new Error(`${u.status} ${await u.text()}`);return u.json()}const Yc="agentlens.theme";function Th(){if(typeof document<"u"){const i=document.documentElement.dataset.theme;if(i==="light"||i==="dark")return i}try{const i=localStorage.getItem(Yc);if(i==="light"||i==="dark")return i}catch{}return"dark"}const Gc=C.createContext({theme:"dark",toggle:()=>{}});function zh({children:i}){const[a,u]=C.useState(Th);typeof document<"u"&&(document.documentElement.dataset.theme=a),C.useEffect(()=>{try{localStorage.setItem(Yc,a)}catch{}},[a]);const c=()=>u(d=>d==="dark"?"light":"dark");return v.jsx(Gc.Provider,{value:{theme:a,toggle:c},children:i})}function Oh(){return C.useContext(Gc)}function Ih(i){const a=Math.round((Date.now()-new Date(i).getTime())/1e3);if(a<45)return"just now";const u=Math.round(a/60);if(u<60)return`${u}m ago`;const c=Math.round(u/60);return c<24?`${c}h ago`:`${Math.round(c/24)}d ago`}function Dh(){const{theme:i,toggle:a}=Oh(),[u,c]=C.useState(null),[d,m]=C.useState(!1),[g,x]=C.useState(null),_=C.useCallback(()=>{to("/health").then(N=>{c(N.last_ingested??null),m(!!N.schema_stale),x(N.version??null)}).catch(()=>{})},[]);C.useEffect(()=>{_();const N=setInterval(_,6e4);return()=>clearInterval(N)},[_]);const[P,R]=C.useState(!1),[E,O]=C.useState(null),Q=C.useCallback(async()=>{R(!0),O(null);try{await Lh("/refresh"),window.location.reload()}catch(N){O(String((N==null?void 0:N.message)??N).slice(0,200)),R(!1)}},[]),{pathname:V}=gn(),B=V==="/dashboard"||V==="/security"||V.startsWith("/skill/")||V==="/file";return v.jsxs("div",{className:"app",children:[v.jsx(Ph,{}),v.jsx("a",{className:"skip-link",href:"#main",children:"Skip to content"}),v.jsxs("header",{className:"topbar",children:[v.jsxs(Zl,{to:"/",className:"brand",children:[v.jsx("img",{src:Nh,alt:"",className:"brand-logo"})," Agent Lens"]}),g&&(vn?v.jsx("span",{className:"version-badge","data-tip":`Agent Lens ${g}`,children:g}):v.jsx(Zl,{to:"/about",className:"version-badge","data-tip":`Agent Lens ${g} — open diagnostics`,children:g})),v.jsxs("nav",{className:"nav",children:[v.jsx(Tr,{to:"/",end:!0,className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Sessions"}),v.jsx(Tr,{to:"/files",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Files"}),v.jsx(Tr,{to:"/skills",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Skills"}),v.jsx(Tr,{to:"/security",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Security"}),v.jsx(Tr,{to:"/dashboard",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Dashboard"})]}),u?v.jsxs("span",{className:"tagline","data-tip":`Data last ingested ${new Date(u).toLocaleString()}`,children:["updated ",Ih(u)]}):v.jsx("span",{className:"tagline",children:"local agent session explorer"}),v.jsxs("div",{className:"topbar-actions",children:[!vn&&v.jsxs("button",{type:"button",className:"ghost refresh-btn",onClick:Q,disabled:P,"aria-label":"Refresh data — collect new transcripts and rebuild","data-tip":E?`Refresh failed: ${E}`:"Collect new transcripts and rebuild the data (runs on the host)",children:[v.jsx("span",{className:P?"refresh-icon spinning":"refresh-icon","aria-hidden":"true",children:"⟳"})," ",P?"Refreshing…":E?"Retry":"Refresh"]}),v.jsx("button",{type:"button",className:"ghost theme-toggle",onClick:a,"aria-label":"Toggle light or dark theme","aria-pressed":i==="light","data-tip":i==="dark"?"Switch to light theme":"Switch to dark theme",children:i==="dark"?"☀":"☾"})]})]}),d&&v.jsxs("div",{className:"schema-banner",role:"status",children:["⚠ Data schema is out of date — run ",v.jsx("code",{children:"agent-lens ingest --full"})," on the host to rebuild. The ",v.jsx("em",{children:"Refresh"})," button only does an incremental ingest and won't fix this."]}),v.jsx("main",{className:"content"+(B?" wide":""),id:"main",tabIndex:-1,children:v.jsx(oh,{})}),v.jsx(Ch,{})]})}function Xc(i,a,u={}){const[c,d]=C.useState({data:null,loading:!0,error:null});return C.useEffect(()=>{const m=i();if(!m){d(x=>({...x,loading:!1,error:null}));return}d(x=>({data:u.reset?null:x.data,loading:!0,error:null}));let g=!1;return m.then(x=>!g&&d({data:x,loading:!1,error:null}),x=>!g&&d(_=>({data:_.data,loading:!1,error:String(x)}))),()=>{g=!0}},a),c}function Mh(i,a){return Xc(()=>i===null?null:to(i),[i,...(a==null?void 0:a.deps)??[]],a)}function lu(i,a,u=[]){const[c]=C.useState(a),{data:d}=Xc(()=>i===null?null:to(i),[i,...u]);return d??c}function Fh(i=[]){const[a,u]=kh(),c=i.join(","),d=C.useCallback((_,P="")=>a.get(_)??P,[a]),m=C.useCallback((_,P)=>{const R=new URLSearchParams(a);for(const[E,O]of Object.entries(_))O?R.set(E,O):R.delete(E);for(const E of c?c.split(","):[])E in _||R.delete(E);u(R,P!=null&&P.replace?{replace:!0}:void 0)},[a,u,c]),g=C.useCallback(_=>{const P=new URLSearchParams;for(const R of _){const E=a.get(R);E&&P.set(R,E)}return P},[a]),x=C.useCallback(()=>u(new URLSearchParams),[u]);return{params:a,get:d,set:m,pick:g,clear:x}}function st(){return v.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"})}function Jc({error:i}){return i?v.jsx("div",{className:"error",role:"alert",children:i}):null}function km({state:i,empty:a,children:u}){return i.error?v.jsx(Jc,{error:i.error}):i.loading?v.jsx(st,{}):i.data?v.jsx(v.Fragment,{children:u(i.data)}):v.jsx(v.Fragment,{children:a??v.jsx(st,{})})}function Zc(i,a=!0){const u=C.useRef(null),c=C.useRef(i);return c.current=i,C.useEffect(()=>{if(!a)return;const d=m=>{const g=u.current;g&&!g.contains(m.target)&&c.current()};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[a]),u}function qc(){const i=Zc(()=>{var a;(a=i.current)!=null&&a.open&&(i.current.open=!1)});return i}const Uh={label:"clear",to:[]},$h=(i,a)=>i.length===a.length&&a.every(u=>i.includes(u));function Rc({label:i,options:a,selected:u,onChange:c,reset:d=Uh,disabled:m,tip:g}){function x(E,O){const Q=new Set(u);O?Q.add(E):Q.delete(E),c(a.map(V=>V.value).filter(V=>Q.has(V)))}const _=qc(),P=$h(u,d.to),R=E=>u.length===1&&u[0]===E&&d.to.length>0;return v.jsxs("details",{className:"multi-select",ref:_,"data-tip":g,children:[v.jsxs("summary",{"aria-label":i,children:[i,P?"":` (${u.length})`," ▾"]}),v.jsxs("div",{className:"col-menu",role:"group","aria-label":i,children:[a.map(E=>v.jsxs("label",{children:[v.jsx("input",{type:"checkbox",checked:u.includes(E.value),disabled:m||R(E.value),onChange:O=>x(E.value,O.target.checked)}),E.label]},E.value)),!P&&v.jsx("button",{type:"button",className:"ghost small ms-clear",onClick:()=>c(d.to),children:d.label})]})]})}function Ah(i){if(!i||i<0)return"—";const a=Math.round(i/1e3);if(a<60)return`${a}s`;const u=Math.round(a/60);return u<60?`${u}m`:`${Math.floor(u/60)}h ${u%60}m`}function zr(i){return i>=1e9?(i/1e9).toFixed(1)+"B":i>=1e6?(i/1e6).toFixed(1)+"M":i>=1e3?(i/1e3).toFixed(1)+"k":String(i)}function Vh(i){return i>=.01?"$"+i.toFixed(2):i>0?"<$0.01":"$0"}const Bh="Estimated at API list prices (cache-aware)";function Wh(i){return i!=null&&i.length?`No list price for ${i.join(", ")} — this total is incomplete. Add rates under "pricing" in agent-lens.config.json, or upgrade for an updated table.`:Bh}function Hh(i){return i?`input ${zr(i.input)} · output ${zr(i.output)} · cache-write ${zr(i.cache_creation)} · cache-read ${zr(i.cache_read)}`:""}function xm(i){return i?i.input+i.output+i.cache_creation:0}function Em(i){return new Date(i).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function Qh(i){if(!i)return"—";const a=new Date(i);return isNaN(a.getTime())?i:a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function bc(i){return i?i==="<synthetic>"?"local":i.replace(/^claude-/,"").replace(/-\d{8}$/,""):""}function Kh({value:i,options:a,onChange:u,ariaLabel:c,searchPlaceholder:d="Filter…"}){const[m,g]=C.useState(!1),[x,_]=C.useState(""),[P,R]=C.useState(0),E=Zc(()=>g(!1),m),O=C.useRef(null),Q=C.useId(),V=D=>`${Q}-opt-${D}`,B=a.find(D=>D.value===i)??a[0]??{value:"",label:""},N=C.useMemo(()=>{const D=x.trim().toLowerCase();return D?a.filter(Y=>Y.label.toLowerCase().includes(D)):a},[a,x]);C.useEffect(()=>{var Y;if(!m)return;_(""),(Y=O.current)==null||Y.focus();const D=N.findIndex(ae=>ae.value===i);R(D>=0?D:0)},[m]),C.useEffect(()=>{R(D=>Math.min(D,Math.max(0,N.length-1)))},[N.length]);function ne(D){D&&(u(D.value),g(!1))}function q(D){if(D.key==="ArrowDown"){if(D.preventDefault(),!m)return g(!0);R(Y=>Math.min(Y+1,N.length-1))}else D.key==="ArrowUp"?(D.preventDefault(),R(Y=>Math.max(Y-1,0))):D.key==="Enter"?(D.preventDefault(),ne(N[P])):D.key==="Escape"&&(D.preventDefault(),g(!1))}return v.jsxs("div",{className:"filter-select",ref:E,children:[v.jsxs("button",{type:"button",className:"filter-select-btn","aria-label":c,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(D=>!D),children:[v.jsx("span",{className:"filter-select-value"+(B.value?"":" muted"),children:B.label}),v.jsx("span",{className:"chev","aria-hidden":"true",children:"▾"})]}),m&&v.jsxs("div",{className:"filter-select-pop",children:[v.jsx("input",{ref:O,type:"text",role:"combobox","aria-expanded":"true","aria-controls":Q,"aria-activedescendant":N.length?V(P):void 0,"aria-label":c,className:"filter-select-search",placeholder:d,value:x,onChange:D=>_(D.target.value),onKeyDown:q}),v.jsx("ul",{className:"filter-select-list",role:"listbox",id:Q,"aria-label":c,children:N.length===0?v.jsx("li",{className:"filter-select-empty muted",role:"presentation",children:"No matches"}):N.map((D,Y)=>v.jsx("li",{id:V(Y),role:"option","aria-selected":D.value===i,className:"filter-select-opt"+(Y===P?" is-active":"")+(D.value===i?" is-selected":""),onMouseEnter:()=>R(Y),onMouseDown:ae=>{ae.preventDefault(),ne(D)},children:D.value?D.label:v.jsx("span",{className:"muted",children:D.label})},D.value||"__all__"))})]})]})}function Yh({page:i,pages:a,total:u,unit:c,onPage:d}){return v.jsxs("div",{className:"pager",children:[v.jsx("button",{disabled:i<=1,onClick:()=>d(i-1),children:"← Prev"}),v.jsxs("span",{className:"muted",children:["page ",i," / ",a," · ",u," ",c]}),v.jsx("button",{disabled:i>=a,onClick:()=>d(i+1),children:"Next →"}),a>1&&v.jsxs("label",{className:"page-jump",children:[v.jsx("span",{className:"sr-only",children:"Jump to page"}),v.jsx("select",{value:i,onChange:m=>d(Number(m.target.value)),children:Array.from({length:a},(m,g)=>g+1).map(m=>v.jsxs("option",{value:m,children:["page ",m," / ",a]},m))})]})]})}function Cm(i,a,u){const c=u==="asc"?1:-1;return i.map((d,m)=>({row:d,i:m})).sort((d,m)=>{const g=a(d.row),x=a(m.row);if(g==null&&x==null)return d.i-m.i;if(g==null)return 1;if(x==null)return-1;const _=typeof g=="number"&&typeof x=="number"?g-x:String(g).localeCompare(String(x),void 0,{numeric:!0,sensitivity:"base"});return _!==0?_*c:d.i-m.i}).map(d=>d.row)}function _m(i,a){const[u,c]=C.useState({key:i,dir:a});return{sort:u,toggle:(m,g="desc")=>c(x=>x.key===m?{key:m,dir:x.dir==="asc"?"desc":"asc"}:{key:m,dir:g})}}function Gh({label:i,sortKey:a,active:u,dir:c,onSort:d,defaultDir:m="desc",className:g}){const x=u===a;return v.jsx("th",{className:g,"aria-sort":x?c==="asc"?"ascending":"descending":"none",children:v.jsxs("button",{type:"button",className:"sort-th"+(x?" is-active":""),onClick:()=>d(a,m),children:[v.jsx("span",{children:i}),v.jsx("span",{className:"sort-ind","aria-hidden":"true",children:x?c==="asc"?"▲":"▼":"↕"})]})})}const ef="agentlens.";function Xh(i,a){try{const u=localStorage.getItem(ef+i);return u==null?a:JSON.parse(u)}catch{return a}}async function Jh(i){if(vn)return null;try{return(await to(`/prefs/${encodeURIComponent(i)}`)).value??null}catch{return null}}function Zh(i,a){try{localStorage.setItem(ef+i,JSON.stringify(a))}catch{}vn||fetch(`/api/prefs/${encodeURIComponent(i)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:a})}).catch(()=>{})}const tf=[{id:"session",label:"Session",toggleable:!1,defaultVisible:!0,sortKey:"title",sortDefaultDir:"asc",cell:(i,a)=>v.jsxs("td",{children:[v.jsx(Zl,{to:`/session/${i.id}${a?`?q=${encodeURIComponent(a)}`:""}`,className:"title",children:i.title||v.jsx("span",{className:"muted",children:i.id.slice(0,12)})}),v.jsxs("div",{className:"sub",children:[i.is_sidechain?v.jsx("span",{className:"tag subagent",children:"subagent"}):null,(i.models??"").split(",").filter(Boolean).slice(0,3).map(u=>v.jsx("span",{className:"tag",children:bc(u)},u))]})]})},{id:"source",label:"Source",toggleable:!0,defaultVisible:!0,cell:i=>v.jsx("td",{children:i.source_id})},{id:"project",label:"Project",toggleable:!0,defaultVisible:!0,cell:i=>{var a;return v.jsx("td",{className:"path",children:((a=i.project_path)==null?void 0:a.replace(/^.*\//,""))??"—"})}},{id:"turns",label:"Turns",toggleable:!0,defaultVisible:!0,sortKey:"turns",thClassName:"num",cell:i=>v.jsx("td",{className:"num",children:i.turn_count})},{id:"tokens",label:"Tokens",toggleable:!0,defaultVisible:!0,sortKey:"tokens",thClassName:"num",cell:i=>v.jsx("td",{className:"num","data-tip":Hh(i.token_split),children:zr(i.tokens)})},{id:"security",label:"Security",toggleable:!0,defaultVisible:!0,sortKey:"security",thClassName:"num",cell:i=>v.jsx("td",{className:"num",children:i.finding_count>0&&i.worst_severity?v.jsxs("span",{className:"sec-count","aria-label":`${i.finding_count} finding${i.finding_count===1?"":"s"}, highest severity ${i.worst_severity}`,"data-tip":`${i.finding_count} finding${i.finding_count===1?"":"s"} · highest severity: ${i.worst_severity}`,children:[v.jsx("span",{className:"sev-dot sev-"+i.worst_severity,"aria-hidden":"true"}),i.finding_count]}):v.jsx("span",{className:"muted",children:"—"})})},{id:"errors",label:"Errors",toggleable:!0,defaultVisible:!0,sortKey:"errors",thClassName:"num",cell:i=>v.jsx("td",{className:"num","data-tip":i.tool_call_count>0?`${i.tool_error_count}/${i.tool_call_count} tool calls returned an error (includes user-rejected/guardrail-blocked; see the session for the failure vs declined split)`:"no tool calls",children:i.tool_error_count>0?v.jsx("span",{className:"tool-err-stat",children:i.tool_error_count}):v.jsx("span",{className:"muted",children:"—"})})},{id:"duration",label:"Duration",toggleable:!0,defaultVisible:!0,sortKey:"duration",thClassName:"num",cell:i=>v.jsx("td",{className:"num",children:Ah(i.duration_ms)})},{id:"cost",label:"Cost",toggleable:!0,defaultVisible:!1,sortKey:"cost",thClassName:"num",cell:i=>{var a;return v.jsxs("td",{className:"num","data-tip":Wh(i.unpriced_models),children:[Vh(i.cost),(a=i.unpriced_models)!=null&&a.length?v.jsx("span",{className:"warn-tag",children:" ⚠"}):null]})}},{id:"started",label:"Started",toggleable:!0,defaultVisible:!0,sortKey:"started",cell:i=>v.jsx("td",{children:Qh(i.started_at)})}],fu=tf.filter(i=>i.toggleable),du="sessions.columns";function nf(i){if(!Array.isArray(i))return new Set(fu.filter(u=>u.defaultVisible).map(u=>u.id));const a=new Set(fu.map(u=>u.id));return new Set(i.filter(u=>typeof u=="string"&&a.has(u)))}function qh(){return nf(Xh(du,null))}const Gl=50,bh={total:0,sessions:[]},em=[{value:"critical",label:"critical"},{value:"high",label:"high"},{value:"medium",label:"medium"},{value:"low",label:"low"},{value:"info",label:"info"}],tm=[{value:"command-failed",label:"command failed"},{value:"file-state",label:"file state"},{value:"string-not-found",label:"string not found"},{value:"token-limit",label:"token limit"},{value:"other",label:"other"},{value:"user-rejected",label:"user rejected"},{value:"guardrail-blocked",label:"guardrail blocked"}];function nm({visible:i,onToggle:a}){const u=qc();return v.jsxs("details",{className:"col-customizer",ref:u,children:[v.jsx("summary",{"aria-label":"Show or hide columns","data-tip":"Show/hide columns",children:"⚙"}),v.jsx("div",{className:"col-menu",role:"group","aria-label":"Toggle columns",children:fu.map(c=>v.jsxs("label",{children:[v.jsx("input",{type:"checkbox",checked:i.has(c.id),onChange:d=>a(c.id,d.target.checked)}),c.label]},c.id))})]})}function rm(){const{get:i,set:a,pick:u}=Fh(["offset"]),c=lu("/sources",[]),d=lu("/projects",[]),m=lu("/models",[]),[g,x]=C.useState(i("q")),[_,P]=C.useState(qh),R=Number(i("offset","0"));C.useEffect(()=>{Jh(du).then(U=>U!=null&&P(nf(U)))},[]);const E=u(["source","project","model","q","sort","dir","severity","error_type"]);E.set("kind",i("kind")||"main"),E.set("limit",String(Gl)),E.set("offset",String(R));const{data:O,loading:Q,error:V}=Mh("/sessions?"+E.toString()),{total:B,sessions:N}=O??bh;function ne(U){U.preventDefault(),a({q:g.trim()})}function q(U,Ce){P(at=>{const $e=new Set(at);return Ce?$e.add(U):$e.delete(U),Zh(du,[...$e]),$e})}const D=i("sort","started"),Y=i("dir")==="asc"?"asc":"desc";function ae(U,Ce){a({sort:U,dir:D===U?Y==="asc"?"desc":"asc":Ce})}const ke=Math.floor(R/Gl)+1,Pe=Math.max(1,Math.ceil(B/Gl)),Ne=tf.filter(U=>!U.toggleable||_.has(U.id));return v.jsxs("div",{children:[v.jsx("h1",{className:"sr-only",children:"Sessions"}),v.jsxs("div",{className:"filters",children:[v.jsxs("form",{onSubmit:ne,className:"search",role:"search",children:[v.jsx("input",{type:"search","aria-label":"Search session names, projects and transcripts",placeholder:"Search names, projects & transcripts…",value:g,onChange:U=>x(U.target.value)}),v.jsx("button",{type:"submit",children:"Search"}),i("q")&&v.jsx("button",{type:"button",className:"ghost",onClick:()=>(x(""),a({q:""})),children:"clear"})]}),v.jsxs("select",{"aria-label":"Filter by source",value:i("source"),onChange:U=>a({source:U.target.value}),children:[v.jsx("option",{value:"",children:"all sources"}),c.map(U=>v.jsxs("option",{value:U.id,children:[U.label," (",U.session_count,")"]},U.id))]}),v.jsx(Kh,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:i("project"),onChange:U=>a({project:U}),options:[{value:"",label:"all projects"},...d.map(U=>({value:U.id,label:`${U.path.replace(/^.*\//,"")} (${U.session_count})`}))]}),v.jsxs("select",{"aria-label":"Filter by model",value:i("model"),onChange:U=>a({model:U.target.value}),children:[v.jsx("option",{value:"",children:"all models"}),m.map(U=>v.jsx("option",{value:U,children:bc(U)},U))]}),v.jsxs("select",{"aria-label":"Filter by kind",value:i("kind")||"main",onChange:U=>a({kind:U.target.value}),children:[v.jsx("option",{value:"main",children:"main only"}),v.jsx("option",{value:"all",children:"main + subagents"}),v.jsx("option",{value:"subagent",children:"subagents only"})]}),v.jsx(Rc,{label:"Security",options:em,selected:i("severity").split(",").filter(Boolean),onChange:U=>a({severity:U.join(",")})}),v.jsx(Rc,{label:"Errors",options:tm,selected:i("error_type").split(",").filter(Boolean),onChange:U=>a({error_type:U.join(",")})})]}),v.jsx(Jc,{error:V}),Q?v.jsx(st,{}):N.length===0?v.jsx("div",{className:"muted pad",role:"status",children:"No sessions match."}):v.jsxs("table",{className:"sessions",children:[v.jsx("thead",{children:v.jsxs("tr",{children:[Ne.map(U=>U.sortKey?v.jsx(Gh,{label:U.label,sortKey:U.sortKey,active:D,dir:Y,onSort:ae,defaultDir:U.sortDefaultDir??"desc",className:U.thClassName},U.id):v.jsx("th",{className:U.thClassName,children:U.label},U.id)),v.jsx("th",{className:"col-th","aria-label":"Columns",children:v.jsx(nm,{visible:_,onToggle:q})})]})}),v.jsx("tbody",{children:N.map(U=>v.jsxs("tr",{children:[Ne.map(Ce=>v.jsx(C.Fragment,{children:Ce.cell(U,i("q"))},Ce.id)),v.jsx("td",{className:"col-td"})]},U.id))})]}),v.jsx(Yh,{page:ke,pages:Pe,total:B,unit:"sessions",onPage:U=>a({offset:String((U-1)*Gl)})})]})}function Lc(i){const a=String((i==null?void 0:i.message)??i??"");return/dynamically imported module/i.test(a)||/Importing a module script failed/i.test(a)||/Failed to load module script/i.test(a)}const Tc="agent-lens:stale-chunk-reload";function lm(){try{const i=Number(sessionStorage.getItem(Tc));return i&&Date.now()-i<6e4?!1:(sessionStorage.setItem(Tc,String(Date.now())),!0)}catch{return!1}}class om extends hu.Component{constructor(){super(...arguments);cc(this,"state",{error:null,stale:!1})}static getDerivedStateFromError(u){return{error:u,stale:Lc(u)}}componentDidCatch(u){Lc(u)&&lm()&&window.location.reload()}render(){const{error:u,stale:c}=this.state;return u?v.jsxs("div",{className:"pad",role:"alert",children:[v.jsx("div",{className:"error",children:c?"This page was loaded from an older build of Agent Lens and part of it is no longer on the server.":`Something went wrong rendering this view: ${u.message}`}),v.jsx("button",{type:"button",className:"ghost",onClick:()=>window.location.reload(),children:"Reload"})]}):this.props.children}}const im=C.lazy(()=>zt(()=>import("./Dashboard-C3qXLVs0.js"),__vite__mapDeps([0,1]))),um=C.lazy(()=>zt(()=>import("./SessionView-Cb_Q-gSc.js"),__vite__mapDeps([2,3,4,5,1]))),sm=C.lazy(()=>zt(()=>import("./WorkflowView-C-39SjGW.js"),__vite__mapDeps([6,3,5]))),am=C.lazy(()=>zt(()=>import("./SkillsView-BwUdENAc.js"),[])),cm=C.lazy(()=>zt(()=>import("./SkillView-AX-xMPdI.js"),__vite__mapDeps([7,5]))),fm=C.lazy(()=>zt(()=>import("./FilesView-CDA5f05Z.js"),[])),dm=C.lazy(()=>zt(()=>import("./FileView-DMUoh5N2.js"),__vite__mapDeps([8,9]))),pm=C.lazy(()=>zt(()=>import("./SecurityView-DXDnsRCb.js"),__vite__mapDeps([10,4]))),hm=C.lazy(()=>zt(()=>import("./AboutView-tTOWbdtR.js"),[])),mm="/".replace(/\/$/,"");hp.createRoot(document.getElementById("root")).render(v.jsx(hu.StrictMode,{children:v.jsx(zh,{children:v.jsx(om,{children:v.jsx(vh,{basename:mm,children:v.jsx(uh,{children:v.jsxs(ut,{path:"/",element:v.jsx(Dh,{}),children:[v.jsx(ut,{index:!0,element:v.jsx(rm,{})}),v.jsx(ut,{path:"dashboard",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(im,{})})}),v.jsx(ut,{path:"session/:id",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(um,{})})}),v.jsx(ut,{path:"workflow/:run_id",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(sm,{})})}),v.jsx(ut,{path:"files",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(fm,{})})}),v.jsx(ut,{path:"file",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(dm,{})})}),v.jsx(ut,{path:"skills",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(am,{})})}),v.jsx(ut,{path:"skill/:name",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(cm,{})})}),v.jsx(ut,{path:"security",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(pm,{})})}),!vn&&v.jsx(ut,{path:"about",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(hm,{})})})]})})})})})}));export{Em as A,ym as B,Oh as C,km as D,Jc as E,_m as F,Cm as G,Kh as H,Gh as I,kh as J,Lh as K,Zl as L,Rc as M,Yh as P,hu as R,vn as S,Vh as a,Ah as b,gm as c,qc as d,Jh as e,zr as f,op as g,Zh as h,Fh as i,v as j,lu as k,Xh as l,Xc as m,st as n,to as o,Mh as p,Sm as q,C as r,bc as s,Hh as t,Bc as u,Wh as v,Qh as w,xm as x,wm as y,gn as z};
|
|
69
|
+
${i}`;let c=3735928559,d=1103547991;for(let m=0;m<u.length;m++){const g=u.charCodeAt(m);c=Math.imul(c^g,2654435761),d=Math.imul(d^g,1597334677)}return c=Math.imul(c^c>>>16,2246822507)^Math.imul(d^d>>>13,3266489909),d=Math.imul(d^d>>>16,2246822507)^Math.imul(c^c>>>13,3266489909),(4294967296*(2097151&d)+(c>>>0)).toString(36)}function Sm(i,a){return vn?`${cu}snapshot/sessions/${i}.export.md`:`/api/sessions/${i}/export.md${a?`?redact=${a}`:""}`}async function to(i){const a=await fetch(jh(i));if(!a.ok)throw new Error(`${a.status} ${await a.text()}`);return a.json()}async function Lh(i,a){const u=await fetch("/api"+i,{method:"POST",...a!==void 0?{headers:{"content-type":"application/json"},body:JSON.stringify(a)}:{}});if(!u.ok)throw new Error(`${u.status} ${await u.text()}`);return u.json()}const Yc="agentlens.theme";function Th(){if(typeof document<"u"){const i=document.documentElement.dataset.theme;if(i==="light"||i==="dark")return i}try{const i=localStorage.getItem(Yc);if(i==="light"||i==="dark")return i}catch{}return"dark"}const Gc=C.createContext({theme:"dark",toggle:()=>{}});function zh({children:i}){const[a,u]=C.useState(Th);typeof document<"u"&&(document.documentElement.dataset.theme=a),C.useEffect(()=>{try{localStorage.setItem(Yc,a)}catch{}},[a]);const c=()=>u(d=>d==="dark"?"light":"dark");return v.jsx(Gc.Provider,{value:{theme:a,toggle:c},children:i})}function Oh(){return C.useContext(Gc)}function Ih(i){const a=Math.round((Date.now()-new Date(i).getTime())/1e3);if(a<45)return"just now";const u=Math.round(a/60);if(u<60)return`${u}m ago`;const c=Math.round(u/60);return c<24?`${c}h ago`:`${Math.round(c/24)}d ago`}function Dh(){const{theme:i,toggle:a}=Oh(),[u,c]=C.useState(null),[d,m]=C.useState(!1),[g,x]=C.useState(null),_=C.useCallback(()=>{to("/health").then(N=>{c(N.last_ingested??null),m(!!N.schema_stale),x(N.version??null)}).catch(()=>{})},[]);C.useEffect(()=>{_();const N=setInterval(_,6e4);return()=>clearInterval(N)},[_]);const[P,R]=C.useState(!1),[E,O]=C.useState(null),Q=C.useCallback(async()=>{R(!0),O(null);try{await Lh("/refresh"),window.location.reload()}catch(N){O(String((N==null?void 0:N.message)??N).slice(0,200)),R(!1)}},[]),{pathname:V}=gn(),B=V==="/dashboard"||V==="/security"||V.startsWith("/skill/")||V==="/file";return v.jsxs("div",{className:"app",children:[v.jsx(Ph,{}),v.jsx("a",{className:"skip-link",href:"#main",children:"Skip to content"}),v.jsxs("header",{className:"topbar",children:[v.jsxs(Zl,{to:"/",className:"brand",children:[v.jsx("img",{src:Nh,alt:"",className:"brand-logo"})," Agent Lens"]}),g&&(vn?v.jsx("span",{className:"version-badge","data-tip":`Agent Lens ${g}`,children:g}):v.jsx(Zl,{to:"/about",className:"version-badge","data-tip":`Agent Lens ${g} — open diagnostics`,children:g})),v.jsxs("nav",{className:"nav",children:[v.jsx(Tr,{to:"/",end:!0,className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Sessions"}),v.jsx(Tr,{to:"/files",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Files"}),v.jsx(Tr,{to:"/skills",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Skills"}),v.jsx(Tr,{to:"/security",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Security"}),v.jsx(Tr,{to:"/dashboard",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Dashboard"})]}),u?v.jsxs("span",{className:"tagline","data-tip":`Data last ingested ${new Date(u).toLocaleString()}`,children:["updated ",Ih(u)]}):v.jsx("span",{className:"tagline",children:"local agent session explorer"}),v.jsxs("div",{className:"topbar-actions",children:[!vn&&v.jsxs("button",{type:"button",className:"ghost refresh-btn",onClick:Q,disabled:P,"aria-label":"Refresh data — collect new transcripts and rebuild","data-tip":E?`Refresh failed: ${E}`:"Collect new transcripts and rebuild the data (runs on the host)",children:[v.jsx("span",{className:P?"refresh-icon spinning":"refresh-icon","aria-hidden":"true",children:"⟳"})," ",P?"Refreshing…":E?"Retry":"Refresh"]}),v.jsx("button",{type:"button",className:"ghost theme-toggle",onClick:a,"aria-label":"Toggle light or dark theme","aria-pressed":i==="light","data-tip":i==="dark"?"Switch to light theme":"Switch to dark theme",children:i==="dark"?"☀":"☾"})]})]}),d&&v.jsxs("div",{className:"schema-banner",role:"status",children:["⚠ Data schema is out of date — run ",v.jsx("code",{children:"agent-lens ingest --full"})," on the host to rebuild. The ",v.jsx("em",{children:"Refresh"})," button only does an incremental ingest and won't fix this."]}),v.jsx("main",{className:"content"+(B?" wide":""),id:"main",tabIndex:-1,children:v.jsx(oh,{})}),v.jsx(Ch,{})]})}function Xc(i,a,u={}){const[c,d]=C.useState({data:null,loading:!0,error:null});return C.useEffect(()=>{const m=i();if(!m){d(x=>({...x,loading:!1,error:null}));return}d(x=>({data:u.reset?null:x.data,loading:!0,error:null}));let g=!1;return m.then(x=>!g&&d({data:x,loading:!1,error:null}),x=>!g&&d(_=>({data:_.data,loading:!1,error:String(x)}))),()=>{g=!0}},a),c}function Mh(i,a){return Xc(()=>i===null?null:to(i),[i,...(a==null?void 0:a.deps)??[]],a)}function lu(i,a,u=[]){const[c]=C.useState(a),{data:d}=Xc(()=>i===null?null:to(i),[i,...u]);return d??c}function Fh(i=[]){const[a,u]=kh(),c=i.join(","),d=C.useCallback((_,P="")=>a.get(_)??P,[a]),m=C.useCallback((_,P)=>{const R=new URLSearchParams(a);for(const[E,O]of Object.entries(_))O?R.set(E,O):R.delete(E);for(const E of c?c.split(","):[])E in _||R.delete(E);u(R,P!=null&&P.replace?{replace:!0}:void 0)},[a,u,c]),g=C.useCallback(_=>{const P=new URLSearchParams;for(const R of _){const E=a.get(R);E&&P.set(R,E)}return P},[a]),x=C.useCallback(()=>u(new URLSearchParams),[u]);return{params:a,get:d,set:m,pick:g,clear:x}}function st(){return v.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"})}function Jc({error:i}){return i?v.jsx("div",{className:"error",role:"alert",children:i}):null}function km({state:i,empty:a,children:u}){return i.error?v.jsx(Jc,{error:i.error}):i.loading?v.jsx(st,{}):i.data?v.jsx(v.Fragment,{children:u(i.data)}):v.jsx(v.Fragment,{children:a??v.jsx(st,{})})}function Zc(i,a=!0){const u=C.useRef(null),c=C.useRef(i);return c.current=i,C.useEffect(()=>{if(!a)return;const d=m=>{const g=u.current;g&&!g.contains(m.target)&&c.current()};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[a]),u}function qc(){const i=Zc(()=>{var a;(a=i.current)!=null&&a.open&&(i.current.open=!1)});return i}const Uh={label:"clear",to:[]},$h=(i,a)=>i.length===a.length&&a.every(u=>i.includes(u));function Rc({label:i,options:a,selected:u,onChange:c,reset:d=Uh,disabled:m,tip:g}){function x(E,O){const Q=new Set(u);O?Q.add(E):Q.delete(E),c(a.map(V=>V.value).filter(V=>Q.has(V)))}const _=qc(),P=$h(u,d.to),R=E=>u.length===1&&u[0]===E&&d.to.length>0;return v.jsxs("details",{className:"multi-select",ref:_,"data-tip":g,children:[v.jsxs("summary",{"aria-label":i,children:[i,P?"":` (${u.length})`," ▾"]}),v.jsxs("div",{className:"col-menu",role:"group","aria-label":i,children:[a.map(E=>v.jsxs("label",{children:[v.jsx("input",{type:"checkbox",checked:u.includes(E.value),disabled:m||R(E.value),onChange:O=>x(E.value,O.target.checked)}),E.label]},E.value)),!P&&v.jsx("button",{type:"button",className:"ghost small ms-clear",onClick:()=>c(d.to),children:d.label})]})]})}function Ah(i){if(!i||i<0)return"—";const a=Math.round(i/1e3);if(a<60)return`${a}s`;const u=Math.round(a/60);return u<60?`${u}m`:`${Math.floor(u/60)}h ${u%60}m`}function zr(i){return i>=1e9?(i/1e9).toFixed(1)+"B":i>=1e6?(i/1e6).toFixed(1)+"M":i>=1e3?(i/1e3).toFixed(1)+"k":String(i)}function Vh(i){return i>=.01?"$"+i.toFixed(2):i>0?"<$0.01":"$0"}const Bh="Estimated at API list prices (cache-aware)";function Wh(i){return i!=null&&i.length?`No list price for ${i.join(", ")} — this total is incomplete. Add rates under "pricing" in agent-lens.config.json, or upgrade for an updated table.`:Bh}function Hh(i){return i?`input ${zr(i.input)} · output ${zr(i.output)} · cache-write ${zr(i.cache_creation)} · cache-read ${zr(i.cache_read)}`:""}function xm(i){return i?i.input+i.output+i.cache_creation:0}function Em(i){return new Date(i).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function Qh(i){if(!i)return"—";const a=new Date(i);return isNaN(a.getTime())?i:a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function bc(i){return i?i==="<synthetic>"?"local":i.replace(/^claude-/,"").replace(/-\d{8}$/,""):""}function Kh({value:i,options:a,onChange:u,ariaLabel:c,searchPlaceholder:d="Filter…"}){const[m,g]=C.useState(!1),[x,_]=C.useState(""),[P,R]=C.useState(0),E=Zc(()=>g(!1),m),O=C.useRef(null),Q=C.useId(),V=D=>`${Q}-opt-${D}`,B=a.find(D=>D.value===i)??a[0]??{value:"",label:""},N=C.useMemo(()=>{const D=x.trim().toLowerCase();return D?a.filter(Y=>Y.label.toLowerCase().includes(D)):a},[a,x]);C.useEffect(()=>{var Y;if(!m)return;_(""),(Y=O.current)==null||Y.focus();const D=N.findIndex(ae=>ae.value===i);R(D>=0?D:0)},[m]),C.useEffect(()=>{R(D=>Math.min(D,Math.max(0,N.length-1)))},[N.length]);function ne(D){D&&(u(D.value),g(!1))}function q(D){if(D.key==="ArrowDown"){if(D.preventDefault(),!m)return g(!0);R(Y=>Math.min(Y+1,N.length-1))}else D.key==="ArrowUp"?(D.preventDefault(),R(Y=>Math.max(Y-1,0))):D.key==="Enter"?(D.preventDefault(),ne(N[P])):D.key==="Escape"&&(D.preventDefault(),g(!1))}return v.jsxs("div",{className:"filter-select",ref:E,children:[v.jsxs("button",{type:"button",className:"filter-select-btn","aria-label":c,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(D=>!D),children:[v.jsx("span",{className:"filter-select-value"+(B.value?"":" muted"),children:B.label}),v.jsx("span",{className:"chev","aria-hidden":"true",children:"▾"})]}),m&&v.jsxs("div",{className:"filter-select-pop",children:[v.jsx("input",{ref:O,type:"text",role:"combobox","aria-expanded":"true","aria-controls":Q,"aria-activedescendant":N.length?V(P):void 0,"aria-label":c,className:"filter-select-search",placeholder:d,value:x,onChange:D=>_(D.target.value),onKeyDown:q}),v.jsx("ul",{className:"filter-select-list",role:"listbox",id:Q,"aria-label":c,children:N.length===0?v.jsx("li",{className:"filter-select-empty muted",role:"presentation",children:"No matches"}):N.map((D,Y)=>v.jsx("li",{id:V(Y),role:"option","aria-selected":D.value===i,className:"filter-select-opt"+(Y===P?" is-active":"")+(D.value===i?" is-selected":""),onMouseEnter:()=>R(Y),onMouseDown:ae=>{ae.preventDefault(),ne(D)},children:D.value?D.label:v.jsx("span",{className:"muted",children:D.label})},D.value||"__all__"))})]})]})}function Yh({page:i,pages:a,total:u,unit:c,onPage:d}){return v.jsxs("div",{className:"pager",children:[v.jsx("button",{disabled:i<=1,onClick:()=>d(i-1),children:"← Prev"}),v.jsxs("span",{className:"muted",children:["page ",i," / ",a," · ",u," ",c]}),v.jsx("button",{disabled:i>=a,onClick:()=>d(i+1),children:"Next →"}),a>1&&v.jsxs("label",{className:"page-jump",children:[v.jsx("span",{className:"sr-only",children:"Jump to page"}),v.jsx("select",{value:i,onChange:m=>d(Number(m.target.value)),children:Array.from({length:a},(m,g)=>g+1).map(m=>v.jsxs("option",{value:m,children:["page ",m," / ",a]},m))})]})]})}function Cm(i,a,u){const c=u==="asc"?1:-1;return i.map((d,m)=>({row:d,i:m})).sort((d,m)=>{const g=a(d.row),x=a(m.row);if(g==null&&x==null)return d.i-m.i;if(g==null)return 1;if(x==null)return-1;const _=typeof g=="number"&&typeof x=="number"?g-x:String(g).localeCompare(String(x),void 0,{numeric:!0,sensitivity:"base"});return _!==0?_*c:d.i-m.i}).map(d=>d.row)}function _m(i,a){const[u,c]=C.useState({key:i,dir:a});return{sort:u,toggle:(m,g="desc")=>c(x=>x.key===m?{key:m,dir:x.dir==="asc"?"desc":"asc"}:{key:m,dir:g})}}function Gh({label:i,sortKey:a,active:u,dir:c,onSort:d,defaultDir:m="desc",className:g}){const x=u===a;return v.jsx("th",{className:g,"aria-sort":x?c==="asc"?"ascending":"descending":"none",children:v.jsxs("button",{type:"button",className:"sort-th"+(x?" is-active":""),onClick:()=>d(a,m),children:[v.jsx("span",{children:i}),v.jsx("span",{className:"sort-ind","aria-hidden":"true",children:x?c==="asc"?"▲":"▼":"↕"})]})})}const ef="agentlens.";function Xh(i,a){try{const u=localStorage.getItem(ef+i);return u==null?a:JSON.parse(u)}catch{return a}}async function Jh(i){if(vn)return null;try{return(await to(`/prefs/${encodeURIComponent(i)}`)).value??null}catch{return null}}function Zh(i,a){try{localStorage.setItem(ef+i,JSON.stringify(a))}catch{}vn||fetch(`/api/prefs/${encodeURIComponent(i)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:a})}).catch(()=>{})}const tf=[{id:"session",label:"Session",toggleable:!1,defaultVisible:!0,sortKey:"title",sortDefaultDir:"asc",cell:(i,a)=>v.jsxs("td",{children:[v.jsx(Zl,{to:`/session/${i.id}${a?`?q=${encodeURIComponent(a)}`:""}`,className:"title",children:i.title||v.jsx("span",{className:"muted",children:i.id.slice(0,12)})}),v.jsxs("div",{className:"sub",children:[i.is_sidechain?v.jsx("span",{className:"tag subagent",children:"subagent"}):null,(i.models??"").split(",").filter(Boolean).slice(0,3).map(u=>v.jsx("span",{className:"tag",children:bc(u)},u))]})]})},{id:"source",label:"Source",toggleable:!0,defaultVisible:!0,cell:i=>v.jsx("td",{children:i.source_id})},{id:"project",label:"Project",toggleable:!0,defaultVisible:!0,cell:i=>{var a;return v.jsx("td",{className:"path",children:((a=i.project_path)==null?void 0:a.replace(/^.*\//,""))??"—"})}},{id:"turns",label:"Turns",toggleable:!0,defaultVisible:!0,sortKey:"turns",thClassName:"num",cell:i=>v.jsx("td",{className:"num",children:i.turn_count})},{id:"tokens",label:"Tokens",toggleable:!0,defaultVisible:!0,sortKey:"tokens",thClassName:"num",cell:i=>v.jsx("td",{className:"num","data-tip":Hh(i.token_split),children:zr(i.tokens)})},{id:"security",label:"Security",toggleable:!0,defaultVisible:!0,sortKey:"security",thClassName:"num",cell:i=>v.jsx("td",{className:"num",children:i.finding_count>0&&i.worst_severity?v.jsxs("span",{className:"sec-count","aria-label":`${i.finding_count} finding${i.finding_count===1?"":"s"}, highest severity ${i.worst_severity}`,"data-tip":`${i.finding_count} finding${i.finding_count===1?"":"s"} · highest severity: ${i.worst_severity}`,children:[v.jsx("span",{className:"sev-dot sev-"+i.worst_severity,"aria-hidden":"true"}),i.finding_count]}):v.jsx("span",{className:"muted",children:"—"})})},{id:"errors",label:"Errors",toggleable:!0,defaultVisible:!0,sortKey:"errors",thClassName:"num",cell:i=>v.jsx("td",{className:"num","data-tip":i.tool_call_count>0?`${i.tool_error_count}/${i.tool_call_count} tool calls returned an error (includes user-rejected/guardrail-blocked; see the session for the failure vs declined split)`:"no tool calls",children:i.tool_error_count>0?v.jsx("span",{className:"tool-err-stat",children:i.tool_error_count}):v.jsx("span",{className:"muted",children:"—"})})},{id:"duration",label:"Duration",toggleable:!0,defaultVisible:!0,sortKey:"duration",thClassName:"num",cell:i=>v.jsx("td",{className:"num",children:Ah(i.duration_ms)})},{id:"cost",label:"Cost",toggleable:!0,defaultVisible:!1,sortKey:"cost",thClassName:"num",cell:i=>{var a;return v.jsxs("td",{className:"num","data-tip":Wh(i.unpriced_models),children:[Vh(i.cost),(a=i.unpriced_models)!=null&&a.length?v.jsx("span",{className:"warn-tag",children:" ⚠"}):null]})}},{id:"started",label:"Started",toggleable:!0,defaultVisible:!0,sortKey:"started",cell:i=>v.jsx("td",{children:Qh(i.started_at)})}],fu=tf.filter(i=>i.toggleable),du="sessions.columns";function nf(i){if(!Array.isArray(i))return new Set(fu.filter(u=>u.defaultVisible).map(u=>u.id));const a=new Set(fu.map(u=>u.id));return new Set(i.filter(u=>typeof u=="string"&&a.has(u)))}function qh(){return nf(Xh(du,null))}const Gl=50,bh={total:0,sessions:[]},em=[{value:"critical",label:"critical"},{value:"high",label:"high"},{value:"medium",label:"medium"},{value:"low",label:"low"},{value:"info",label:"info"}],tm=[{value:"command-failed",label:"command failed"},{value:"file-state",label:"file state"},{value:"string-not-found",label:"string not found"},{value:"token-limit",label:"token limit"},{value:"other",label:"other"},{value:"user-rejected",label:"user rejected"},{value:"guardrail-blocked",label:"guardrail blocked"}];function nm({visible:i,onToggle:a}){const u=qc();return v.jsxs("details",{className:"col-customizer",ref:u,children:[v.jsx("summary",{"aria-label":"Show or hide columns","data-tip":"Show/hide columns",children:"⚙"}),v.jsx("div",{className:"col-menu",role:"group","aria-label":"Toggle columns",children:fu.map(c=>v.jsxs("label",{children:[v.jsx("input",{type:"checkbox",checked:i.has(c.id),onChange:d=>a(c.id,d.target.checked)}),c.label]},c.id))})]})}function rm(){const{get:i,set:a,pick:u}=Fh(["offset"]),c=lu("/sources",[]),d=lu("/projects",[]),m=lu("/models",[]),[g,x]=C.useState(i("q")),[_,P]=C.useState(qh),R=Number(i("offset","0"));C.useEffect(()=>{Jh(du).then(U=>U!=null&&P(nf(U)))},[]);const E=u(["source","project","model","q","sort","dir","severity","error_type"]);E.set("kind",i("kind")||"main"),E.set("limit",String(Gl)),E.set("offset",String(R));const{data:O,loading:Q,error:V}=Mh("/sessions?"+E.toString()),{total:B,sessions:N}=O??bh;function ne(U){U.preventDefault(),a({q:g.trim()})}function q(U,Ce){P(at=>{const $e=new Set(at);return Ce?$e.add(U):$e.delete(U),Zh(du,[...$e]),$e})}const D=i("sort","started"),Y=i("dir")==="asc"?"asc":"desc";function ae(U,Ce){a({sort:U,dir:D===U?Y==="asc"?"desc":"asc":Ce})}const ke=Math.floor(R/Gl)+1,Pe=Math.max(1,Math.ceil(B/Gl)),Ne=tf.filter(U=>!U.toggleable||_.has(U.id));return v.jsxs("div",{children:[v.jsx("h1",{className:"sr-only",children:"Sessions"}),v.jsxs("div",{className:"filters",children:[v.jsxs("form",{onSubmit:ne,className:"search",role:"search",children:[v.jsx("input",{type:"search","aria-label":"Search session names, projects and transcripts",placeholder:"Search names, projects & transcripts…",value:g,onChange:U=>x(U.target.value)}),v.jsx("button",{type:"submit",children:"Search"}),i("q")&&v.jsx("button",{type:"button",className:"ghost",onClick:()=>(x(""),a({q:""})),children:"clear"})]}),v.jsxs("select",{"aria-label":"Filter by source",value:i("source"),onChange:U=>a({source:U.target.value}),children:[v.jsx("option",{value:"",children:"all sources"}),c.map(U=>v.jsxs("option",{value:U.id,children:[U.label," (",U.session_count,")"]},U.id))]}),v.jsx(Kh,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:i("project"),onChange:U=>a({project:U}),options:[{value:"",label:"all projects"},...d.map(U=>({value:U.id,label:`${U.path.replace(/^.*\//,"")} (${U.session_count})`}))]}),v.jsxs("select",{"aria-label":"Filter by model",value:i("model"),onChange:U=>a({model:U.target.value}),children:[v.jsx("option",{value:"",children:"all models"}),m.map(U=>v.jsx("option",{value:U,children:bc(U)},U))]}),v.jsxs("select",{"aria-label":"Filter by kind",value:i("kind")||"main",onChange:U=>a({kind:U.target.value}),children:[v.jsx("option",{value:"main",children:"main only"}),v.jsx("option",{value:"all",children:"main + subagents"}),v.jsx("option",{value:"subagent",children:"subagents only"})]}),v.jsx(Rc,{label:"Security",options:em,selected:i("severity").split(",").filter(Boolean),onChange:U=>a({severity:U.join(",")})}),v.jsx(Rc,{label:"Errors",options:tm,selected:i("error_type").split(",").filter(Boolean),onChange:U=>a({error_type:U.join(",")})})]}),v.jsx(Jc,{error:V}),Q?v.jsx(st,{}):N.length===0?v.jsx("div",{className:"muted pad",role:"status",children:"No sessions match."}):v.jsxs("table",{className:"sessions",children:[v.jsx("thead",{children:v.jsxs("tr",{children:[Ne.map(U=>U.sortKey?v.jsx(Gh,{label:U.label,sortKey:U.sortKey,active:D,dir:Y,onSort:ae,defaultDir:U.sortDefaultDir??"desc",className:U.thClassName},U.id):v.jsx("th",{className:U.thClassName,children:U.label},U.id)),v.jsx("th",{className:"col-th","aria-label":"Columns",children:v.jsx(nm,{visible:_,onToggle:q})})]})}),v.jsx("tbody",{children:N.map(U=>v.jsxs("tr",{children:[Ne.map(Ce=>v.jsx(C.Fragment,{children:Ce.cell(U,i("q"))},Ce.id)),v.jsx("td",{className:"col-td"})]},U.id))})]}),v.jsx(Yh,{page:ke,pages:Pe,total:B,unit:"sessions",onPage:U=>a({offset:String((U-1)*Gl)})})]})}function Lc(i){const a=String((i==null?void 0:i.message)??i??"");return/dynamically imported module/i.test(a)||/Importing a module script failed/i.test(a)||/Failed to load module script/i.test(a)}const Tc="agent-lens:stale-chunk-reload";function lm(){try{const i=Number(sessionStorage.getItem(Tc));return i&&Date.now()-i<6e4?!1:(sessionStorage.setItem(Tc,String(Date.now())),!0)}catch{return!1}}class om extends hu.Component{constructor(){super(...arguments);cc(this,"state",{error:null,stale:!1})}static getDerivedStateFromError(u){return{error:u,stale:Lc(u)}}componentDidCatch(u){Lc(u)&&lm()&&window.location.reload()}render(){const{error:u,stale:c}=this.state;return u?v.jsxs("div",{className:"pad",role:"alert",children:[v.jsx("div",{className:"error",children:c?"This page was loaded from an older build of Agent Lens and part of it is no longer on the server.":`Something went wrong rendering this view: ${u.message}`}),v.jsx("button",{type:"button",className:"ghost",onClick:()=>window.location.reload(),children:"Reload"})]}):this.props.children}}const im=C.lazy(()=>zt(()=>import("./Dashboard-DNVg4C8Q.js"),__vite__mapDeps([0,1]))),um=C.lazy(()=>zt(()=>import("./SessionView-MC9E6Co7.js"),__vite__mapDeps([2,3,4,5,1]))),sm=C.lazy(()=>zt(()=>import("./WorkflowView-9UxUoXwT.js"),__vite__mapDeps([6,3,5]))),am=C.lazy(()=>zt(()=>import("./SkillsView-B8WjUwoi.js"),[])),cm=C.lazy(()=>zt(()=>import("./SkillView-BYDmKcd1.js"),__vite__mapDeps([7,5]))),fm=C.lazy(()=>zt(()=>import("./FilesView-CVZN72Gq.js"),[])),dm=C.lazy(()=>zt(()=>import("./FileView-Bp1FQn6s.js"),__vite__mapDeps([8,9]))),pm=C.lazy(()=>zt(()=>import("./SecurityView-WfNKjnOq.js"),__vite__mapDeps([10,4]))),hm=C.lazy(()=>zt(()=>import("./AboutView-DE58gn6y.js"),[])),mm="/".replace(/\/$/,"");hp.createRoot(document.getElementById("root")).render(v.jsx(hu.StrictMode,{children:v.jsx(zh,{children:v.jsx(om,{children:v.jsx(vh,{basename:mm,children:v.jsx(uh,{children:v.jsxs(ut,{path:"/",element:v.jsx(Dh,{}),children:[v.jsx(ut,{index:!0,element:v.jsx(rm,{})}),v.jsx(ut,{path:"dashboard",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(im,{})})}),v.jsx(ut,{path:"session/:id",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(um,{})})}),v.jsx(ut,{path:"workflow/:run_id",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(sm,{})})}),v.jsx(ut,{path:"files",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(fm,{})})}),v.jsx(ut,{path:"file",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(dm,{})})}),v.jsx(ut,{path:"skills",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(am,{})})}),v.jsx(ut,{path:"skill/:name",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(cm,{})})}),v.jsx(ut,{path:"security",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(pm,{})})}),!vn&&v.jsx(ut,{path:"about",element:v.jsx(C.Suspense,{fallback:v.jsx(st,{}),children:v.jsx(hm,{})})})]})})})})})}));export{Em as A,ym as B,Oh as C,km as D,Jc as E,_m as F,Cm as G,Kh as H,Gh as I,kh as J,Lh as K,Zl as L,Rc as M,Yh as P,hu as R,vn as S,Vh as a,Ah as b,gm as c,qc as d,Jh as e,zr as f,op as g,Zh as h,Fh as i,v as j,lu as k,Xh as l,Xc as m,st as n,to as o,Mh as p,Sm as q,C as r,bc as s,Hh as t,Bc as u,Wh as v,Qh as w,xm as x,wm as y,gn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as o,s as d,L as f,f as m,a as h,b as y}from"./index-
|
|
1
|
+
import{r as u,j as o,s as d,L as f,f as m,a as h,b as y}from"./index-Yyr3A1Uv.js";function x({text:e,label:t,title:n="Copy to clipboard",tip:r,className:i=""}){const[l,c]=u.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(e)}catch{const s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();try{document.execCommand("copy")}catch{}s.remove()}c(!0),window.setTimeout(()=>c(!1),1200)};return o.jsxs("button",{type:"button",className:"ghost small copy-btn "+i,onClick:a,"aria-label":n,"data-tip":r??n,children:[l?"✓ Copied":"⧉",t?" "+t:""]})}function j({a:e}){const t=e.agent_description||e.title||e.id.slice(0,12),n=(e.models??"").split(",").filter(Boolean).map(d).join(", ");return o.jsxs("li",{children:[o.jsx(f,{to:`/session/${e.id}`,children:t}),e.agent_type&&o.jsx("span",{className:"tag subagent meta-type",children:e.agent_type}),e.spawn_depth!=null&&e.spawn_depth>1&&o.jsxs("span",{className:"tag meta-depth","data-tip":`nested ${e.spawn_depth} levels deep`,children:["↳",e.spawn_depth]}),o.jsxs("span",{className:"muted",children:[" ","· ",n||"—"," · ",m(e.tokens)," tok · ",h(e.cost),e.duration_ms!=null?` · ${y(e.duration_ms)}`:""]})]})}function k(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/?9;|'/g,"'").replace(/&/g,"&")}function b(e){const t=e.match(/\s*\(\s*truncated[^)]*\)\s*$/i);return!t||t.index==null?{body:e,note:null}:{body:e.slice(0,t.index).trimEnd(),note:t[0].trim()}}function w(e){try{return{value:JSON.parse(e),repaired:!1}}catch{}const t=[];let n=!1,r=!1,i=-1,l=[];for(let a=0;a<e.length;a++){const s=e[a];if(n){r?r=!1:s==="\\"?r=!0:s==='"'&&(n=!1);continue}s==='"'?n=!0:s==="{"||s==="["?t.push(s==="{"?"}":"]"):s==="}"||s==="]"?(t.pop(),i=a+1,l=[...t]):s===","&&(i=a,l=[...t])}if(i<0)return{value:void 0,repaired:!1};const c=e.slice(0,i)+l.reverse().join("");try{return{value:JSON.parse(c),repaired:!0}}catch{return{value:void 0,repaired:!1}}}function p(e){if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return p(JSON.parse(t))}catch{return e}return e}if(Array.isArray(e))return e.map(p);if(e&&typeof e=="object"){const t={};for(const[n,r]of Object.entries(e))t[n]=p(r);return t}return e}function C(e,t=2e4){try{return JSON.stringify(JSON.parse(e),null,2).slice(0,t)}catch{return e.slice(0,t)}}export{j as A,x as C,p as a,k as d,w as l,C as p,b as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,B as x,j as a,C as b}from"./index-
|
|
1
|
+
import{r as p,B as x,j as a,C as b}from"./index-Yyr3A1Uv.js";const f='a[href], button:not([disabled]), input, select, textarea, summary, [tabindex]:not([tabindex="-1"])';function v({title:n,labelId:l,onClose:e,children:t}){const d=p.useRef(null),m=p.useRef(null);p.useEffect(()=>{var c;const s=document.activeElement;(c=m.current)==null||c.focus();const r=document.getElementById("root");r==null||r.setAttribute("inert","");const{overflow:o}=document.body.style;return document.body.style.overflow="hidden",()=>{var u;r==null||r.removeAttribute("inert"),document.body.style.overflow=o,(u=s==null?void 0:s.focus)==null||u.call(s)}},[]);const i=s=>{var c;if(s.key==="Escape"){s.stopPropagation(),e();return}if(s.key!=="Tab")return;const r=[...((c=d.current)==null?void 0:c.querySelectorAll(f))??[]];if(!r.length)return;const o=s.shiftKey?r[0]:r[r.length-1];document.activeElement===o&&(s.preventDefault(),(s.shiftKey?r[r.length-1]:r[0]).focus())};return x.createPortal(a.jsx("div",{className:"chart-modal-backdrop",onMouseDown:s=>s.target===s.currentTarget&&e(),children:a.jsxs("div",{className:"chart-modal",role:"dialog","aria-modal":"true","aria-labelledby":l,ref:d,onKeyDown:i,children:[t,a.jsx("button",{type:"button",className:"chart-modal-close",ref:m,onClick:e,"aria-label":`Close "${n}"`,children:"✕"})]})}),document.body)}function y(){const{theme:n}=b();return p.useMemo(()=>{const l=getComputedStyle(document.documentElement),e=h=>l.getPropertyValue(h).trim(),t={bg:e("--bg"),panel:e("--panel"),panel2:e("--panel2"),border:e("--border"),text:e("--text"),muted:e("--muted"),accent:e("--accent"),green:e("--user"),gold:e("--gold"),red:e("--err"),violet:e("--violet"),teal:e("--teal")},d={user:e("--tl-user"),assistant:e("--tl-assistant"),thinking:e("--tl-thinking"),tool:e("--tl-tool"),toolError:t.red},m=[e("--burn-1"),e("--burn-2"),e("--burn-3"),e("--burn-4"),e("--burn-5"),e("--burn-6"),e("--burn-7")],i={critical:e("--sev-c-critical"),high:e("--sev-c-high"),medium:e("--sev-c-medium"),low:e("--sev-c-low"),info:t.muted},s={input:t.green,output:t.accent,cache_creation:t.gold,cache_read:t.muted},r=[t.accent,t.green,t.gold,t.violet,t.teal,t.red,t.muted,"#d98c5f","#5f9ed9"],o={stroke:t.muted,tick:{fill:t.muted,fontSize:11},tickLine:!1},c={stroke:t.border,strokeDasharray:"3 3",vertical:!1},u={contentStyle:{background:t.panel2,border:`1px solid ${t.border}`,borderRadius:6,boxShadow:"0 6px 18px rgb(0 0 0 / 35%)",padding:"5px 8px",fontSize:12,lineHeight:1.45},labelStyle:{color:t.text},itemStyle:{color:t.text}};return{C:t,TOKEN_COLORS:s,TIMELINE_COLORS:d,SEVERITY_COLORS:i,BURN_RAMP:m,PALETTE:r,axisProps:o,gridProps:c,tooltipStyle:u}},[n])}function j({title:n,hint:l,guide:e,actions:t,bodyHeight:d,hidden:m,children:i}){const[s,r]=p.useState(!1),o=p.useId();if(m)return null;const c=h=>typeof i=="function"?i(h):i,u=h=>a.jsxs("div",{className:"card-head",children:[a.jsx("h3",{id:h?o:void 0,children:n}),e&&a.jsxs("details",{className:"card-guide",children:[a.jsx("summary",{"aria-label":`How to read "${n}"`,"data-tip":"How to read this chart",children:"ⓘ"}),a.jsx("div",{className:"card-guide-body",children:e})]}),l&&a.jsx("span",{className:"card-hint",children:l}),a.jsxs("span",{className:"card-actions",children:[t,!h&&a.jsx("button",{type:"button",className:"card-expand",onClick:()=>r(!0),"aria-label":`Expand "${n}"`,"data-tip":"Expand this chart",children:"⤢"})]})]});return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"card",children:[u(!1),a.jsx("div",{className:"chart-body",style:d!=null?{height:d}:void 0,children:s?a.jsx("div",{className:"chart-moved",children:"Open in the expanded view."}):c(!1)})]}),s&&a.jsx(v,{title:n,labelId:o,onClose:()=>r(!1),children:a.jsxs("div",{className:"card",children:[u(!0),a.jsx("div",{className:"chart-body chart-body-lg",children:c(!0)})]})})]})}function E({label:n,value:l,sub:e,tip:t}){return a.jsxs("div",{className:"kpi","data-tip":t,children:[a.jsx("div",{className:"kpi-label",children:n}),a.jsx("div",{className:"kpi-value",children:l}),e!=null&&a.jsx("div",{className:"kpi-sub",children:e})]})}export{j as C,E as K,y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,r as a}from"./index-
|
|
1
|
+
import{j as o,r as a}from"./index-Yyr3A1Uv.js";const i=["critical","high","medium","low","info"];function l({severity:e,count:s}){return o.jsxs("span",{className:"tag sev sev-"+e,children:[e,s!=null?` ${s}`:""]})}function m(e,s){const[r,t]=a.useState(s),[n,u]=a.useState(e);return n!==e&&(u(e),t(s)),[r,t]}export{i as S,l as a,m as u};
|
package/web/index.html
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
document.documentElement.dataset.theme = "dark";
|
|
17
17
|
}
|
|
18
18
|
</script>
|
|
19
|
-
<script type="module" crossorigin src="/assets/index-
|
|
20
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-Yyr3A1Uv.js"></script>
|
|
20
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CZlMEmLZ.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
23
|
<div id="root"></div>
|