@swestash/agent-lens 0.11.1 → 0.13.0

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.
@@ -1 +1 @@
1
- import{D as d,x as h,j as e,A as o,L as r,w as t}from"./index-0iQ2t2WR.js";import{relPath as m,LinesDelta as p}from"./FilesView-CMwzNpYU.js";function v(){const[i]=d(),l=i.get("path")??"",a=i.get("project")??"",n=new URLSearchParams({path:l});a&&n.set("project",a);const s=h(l?"/file?"+n.toString():null);return e.jsx(o,{state:s,empty:e.jsx("div",{className:"muted pad",children:"Not found."}),children:c=>e.jsx(j,{data:c})})}function j({data:i}){return e.jsxs("div",{className:"file-view",children:[e.jsx(r,{to:"/files",className:"back",children:"← all files"}),e.jsxs("header",{className:"skill-head",children:[e.jsxs("h1",{children:["📄 ",m(i.file_path,i.project_path)]}),e.jsxs("div",{className:"skill-head-meta muted",children:[e.jsx("span",{title:i.file_path,children:i.file_path}),i.project_path?e.jsxs(e.Fragment,{children:[" · in ",i.project_path.replace(/^.*\//,"")]}):null]})]}),e.jsxs("div",{className:"kpis",children:[e.jsxs("div",{className:"kpi",children:[e.jsx("div",{className:"kpi-label",children:"sessions"}),e.jsx("div",{className:"kpi-value",children:i.sessions_count.toLocaleString()})]}),e.jsxs("div",{className:"kpi",children:[e.jsx("div",{className:"kpi-label",children:"changes"}),e.jsx("div",{className:"kpi-value",children:i.changes_count.toLocaleString()})]}),e.jsxs("div",{className:"kpi",children:[e.jsx("div",{className:"kpi-label",children:"lines + / −"}),e.jsxs("div",{className:"kpi-value",children:["+",i.lines_added.toLocaleString()," −",i.lines_removed.toLocaleString()]})]}),e.jsxs("div",{className:"kpi",children:[e.jsx("div",{className:"kpi-label",children:"first · last touched"}),e.jsxs("div",{className:"kpi-value kpi-sub",children:[t(i.first_ts)," · ",t(i.last_ts)]})]})]}),i.sessions.map(l=>{var n;const a=(n=l.changes.find(s=>s.event_uuid))==null?void 0:n.event_uuid;return e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:e.jsx(r,{to:`/session/${l.session_id}${a?`#ev-${a}`:""}`,className:"title",title:a?"Open the session at this file's first change":void 0,children:l.title||e.jsx("span",{className:"muted",children:l.session_id.slice(0,12)})})}),e.jsxs("span",{className:"card-hint",children:[l.category&&e.jsx("span",{className:`tag cat-${l.category}`,children:l.category}),l.source_id&&e.jsx("span",{className:"tag",children:l.source_id})," ",t(l.started_at)]})]}),e.jsxs("table",{className:"sessions",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Turn"}),e.jsx("th",{children:"Tool"}),e.jsx("th",{className:"num",children:"+ / −"}),e.jsx("th",{children:"Prompt"}),e.jsx("th",{children:"When"})]})}),e.jsx("tbody",{children:l.changes.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:s.event_uuid?e.jsxs(r,{to:`/session/${l.session_id}#ev-${s.event_uuid}`,className:"title",title:"Jump to this change in the transcript",children:["turn ",s.turn_seq!=null?s.turn_seq+1:"?"]}):e.jsxs("span",{className:"muted",children:["turn ",s.turn_seq!=null?s.turn_seq+1:"?"]})}),e.jsx("td",{children:e.jsx("span",{className:"tag",children:s.tool_name})}),e.jsx("td",{className:"num",children:e.jsx(p,{added:s.lines_added,removed:s.lines_removed})}),e.jsx("td",{className:"muted",title:s.prompt_preview??void 0,children:s.prompt_preview?s.prompt_preview.length>80?s.prompt_preview.slice(0,79)+"…":s.prompt_preview:"—"}),e.jsx("td",{children:t(s.timestamp)})]},s.id))})]})]},l.session_id)}),e.jsx("p",{className:"muted pad",children:"Tracked from Edit/Write tool calls — changes made via shell commands or outside sessions aren’t captured."})]})}export{v as default};
1
+ import{D as d,x as h,j as e,A as o,L as r,w as t}from"./index-BEJAVOfs.js";import{relPath as m,LinesDelta as p}from"./FilesView-BkE8JdcH.js";function v(){const[i]=d(),l=i.get("path")??"",a=i.get("project")??"",n=new URLSearchParams({path:l});a&&n.set("project",a);const s=h(l?"/file?"+n.toString():null);return e.jsx(o,{state:s,empty:e.jsx("div",{className:"muted pad",children:"Not found."}),children:c=>e.jsx(j,{data:c})})}function j({data:i}){return e.jsxs("div",{className:"file-view",children:[e.jsx(r,{to:"/files",className:"back",children:"← all files"}),e.jsxs("header",{className:"skill-head",children:[e.jsxs("h1",{children:["📄 ",m(i.file_path,i.project_path)]}),e.jsxs("div",{className:"skill-head-meta muted",children:[e.jsx("span",{title:i.file_path,children:i.file_path}),i.project_path?e.jsxs(e.Fragment,{children:[" · in ",i.project_path.replace(/^.*\//,"")]}):null]})]}),e.jsxs("div",{className:"kpis",children:[e.jsxs("div",{className:"kpi",children:[e.jsx("div",{className:"kpi-label",children:"sessions"}),e.jsx("div",{className:"kpi-value",children:i.sessions_count.toLocaleString()})]}),e.jsxs("div",{className:"kpi",children:[e.jsx("div",{className:"kpi-label",children:"changes"}),e.jsx("div",{className:"kpi-value",children:i.changes_count.toLocaleString()})]}),e.jsxs("div",{className:"kpi",children:[e.jsx("div",{className:"kpi-label",children:"lines + / −"}),e.jsxs("div",{className:"kpi-value",children:["+",i.lines_added.toLocaleString()," −",i.lines_removed.toLocaleString()]})]}),e.jsxs("div",{className:"kpi",children:[e.jsx("div",{className:"kpi-label",children:"first · last touched"}),e.jsxs("div",{className:"kpi-value kpi-sub",children:[t(i.first_ts)," · ",t(i.last_ts)]})]})]}),i.sessions.map(l=>{var n;const a=(n=l.changes.find(s=>s.event_uuid))==null?void 0:n.event_uuid;return e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:e.jsx(r,{to:`/session/${l.session_id}${a?`#ev-${a}`:""}`,className:"title",title:a?"Open the session at this file's first change":void 0,children:l.title||e.jsx("span",{className:"muted",children:l.session_id.slice(0,12)})})}),e.jsxs("span",{className:"card-hint",children:[l.category&&e.jsx("span",{className:`tag cat-${l.category}`,children:l.category}),l.source_id&&e.jsx("span",{className:"tag",children:l.source_id})," ",t(l.started_at)]})]}),e.jsxs("table",{className:"sessions",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Turn"}),e.jsx("th",{children:"Tool"}),e.jsx("th",{className:"num",children:"+ / −"}),e.jsx("th",{children:"Prompt"}),e.jsx("th",{children:"When"})]})}),e.jsx("tbody",{children:l.changes.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:s.event_uuid?e.jsxs(r,{to:`/session/${l.session_id}#ev-${s.event_uuid}`,className:"title",title:"Jump to this change in the transcript",children:["turn ",s.turn_seq!=null?s.turn_seq+1:"?"]}):e.jsxs("span",{className:"muted",children:["turn ",s.turn_seq!=null?s.turn_seq+1:"?"]})}),e.jsx("td",{children:e.jsx("span",{className:"tag",children:s.tool_name})}),e.jsx("td",{className:"num",children:e.jsx(p,{added:s.lines_added,removed:s.lines_removed})}),e.jsx("td",{className:"muted",title:s.prompt_preview??void 0,children:s.prompt_preview?s.prompt_preview.length>80?s.prompt_preview.slice(0,79)+"…":s.prompt_preview:"—"}),e.jsx("td",{children:t(s.timestamp)})]},s.id))})]})]},l.session_id)}),e.jsx("p",{className:"muted pad",children:"Tracked from Edit/Write tool calls — changes made via shell commands or outside sessions aren’t captured."})]})}export{v as default};
@@ -1 +1 @@
1
- import{e as q,h as x,r as E,x as C,j as e,F as P,E as D,m as K,S as n,L as $,w as k,P as I}from"./index-0iQ2t2WR.js";const i=50,M={total:0,files:[]};function A(t,a){return a&&t.startsWith(a.replace(/\/$/,"")+"/")?t.slice(a.replace(/\/$/,"").length+1):t}function R({added:t,removed:a}){return t==null&&a==null?e.jsx("span",{className:"muted",children:"—"}):e.jsxs("span",{className:"sub",children:[t!=null&&e.jsxs("span",{className:"tag",children:["+",t.toLocaleString()]}),a!=null&&e.jsxs("span",{className:"tag",children:["−",a.toLocaleString()]})]})}function G(){const{get:t,set:a,pick:g}=q(["offset"]),f=x("/sources",[]),b=x("/projects",[]),[h,u]=E.useState(t("q")),p=Number(t("offset","0")),o=g(["source","project","q","sort","dir"]);o.set("limit",String(i)),o.set("offset",String(p));const{data:N,loading:j,error:S}=C("/files?"+o.toString()),{total:d,files:m}=N??M;function v(s){s.preventDefault(),a({q:h.trim()})}const l=t("sort","last_ts"),r=t("dir")==="asc"?"asc":"desc";function c(s,F){a({sort:s,dir:l===s?r==="asc"?"desc":"asc":F})}const _=Math.floor(p/i)+1,y=Math.max(1,Math.ceil(d/i)),L=!!(t("q")||t("source")||t("project"));return e.jsxs("div",{children:[e.jsx("h1",{className:"sr-only",children:"Files"}),e.jsxs("div",{className:"filters",children:[e.jsxs("form",{onSubmit:v,className:"search",role:"search",children:[e.jsx("input",{type:"search","aria-label":"Search files by path",placeholder:"Search file paths…",value:h,onChange:s=>u(s.target.value)}),e.jsx("button",{type:"submit",children:"Search"}),t("q")&&e.jsx("button",{type:"button",className:"ghost",onClick:()=>(u(""),a({q:""})),children:"clear"})]}),e.jsxs("select",{"aria-label":"Filter by source",value:t("source"),onChange:s=>a({source:s.target.value}),children:[e.jsx("option",{value:"",children:"all sources"}),f.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))]}),e.jsx(P,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:t("project"),onChange:s=>a({project:s}),options:[{value:"",label:"all projects"},...b.map(s=>({value:s.id,label:s.path.replace(/^.*\//,"")}))]})]}),e.jsx(D,{error:S}),j?e.jsx(K,{}):m.length===0?e.jsx("div",{className:"muted pad",role:"status",children:L?"No files match the filter.":"No file changes ingested yet — run agent-lens refresh (or ingest) first."}):e.jsxs("table",{className:"sessions",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(n,{label:"File",sortKey:"path",active:l,dir:r,onSort:c,defaultDir:"asc"}),e.jsx("th",{children:"Project"}),e.jsx(n,{label:"Sessions",sortKey:"sessions",active:l,dir:r,onSort:c,className:"num"}),e.jsx(n,{label:"Changes",sortKey:"changes",active:l,dir:r,onSort:c,className:"num"}),e.jsx("th",{className:"num",children:"+ / −"}),e.jsx(n,{label:"Last touched",sortKey:"last_ts",active:l,dir:r,onSort:c})]})}),e.jsx("tbody",{children:m.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx($,{to:`/file?path=${encodeURIComponent(s.file_path)}${s.project_id?`&project=${encodeURIComponent(s.project_id)}`:""}`,className:"title",title:s.file_path,children:A(s.file_path,s.project_path)})}),e.jsx("td",{children:s.project_path?e.jsx("span",{className:"tag",title:s.project_path,children:s.project_path.replace(/^.*\//,"")}):e.jsx("span",{className:"muted",children:"—"})}),e.jsx("td",{className:"num",children:s.sessions.toLocaleString()}),e.jsx("td",{className:"num",children:s.changes.toLocaleString()}),e.jsx("td",{className:"num",children:e.jsx(R,{added:s.lines_added,removed:s.lines_removed})}),e.jsx("td",{children:k(s.last_ts)})]},(s.project_id??"")+"\0"+s.file_path))})]}),!j&&d>0&&e.jsx(I,{page:_,pages:y,total:d,unit:"files",onPage:s=>a({offset:String((s-1)*i)})}),e.jsx("p",{className:"muted pad",children:"Tracked from Edit/Write tool calls — changes made via shell commands or outside sessions aren’t captured."})]})}export{R as LinesDelta,G as default,A as relPath};
1
+ import{k as q,m as x,r as E,x as C,j as e,F as P,E as k,o as D,S as n,L as K,w as $,P as I}from"./index-BEJAVOfs.js";const i=50,M={total:0,files:[]};function A(t,a){return a&&t.startsWith(a.replace(/\/$/,"")+"/")?t.slice(a.replace(/\/$/,"").length+1):t}function R({added:t,removed:a}){return t==null&&a==null?e.jsx("span",{className:"muted",children:"—"}):e.jsxs("span",{className:"sub",children:[t!=null&&e.jsxs("span",{className:"tag",children:["+",t.toLocaleString()]}),a!=null&&e.jsxs("span",{className:"tag",children:["−",a.toLocaleString()]})]})}function G(){const{get:t,set:a,pick:g}=q(["offset"]),f=x("/sources",[]),b=x("/projects",[]),[h,u]=E.useState(t("q")),p=Number(t("offset","0")),o=g(["source","project","q","sort","dir"]);o.set("limit",String(i)),o.set("offset",String(p));const{data:N,loading:j,error:S}=C("/files?"+o.toString()),{total:d,files:m}=N??M;function v(s){s.preventDefault(),a({q:h.trim()})}const l=t("sort","last_ts"),r=t("dir")==="asc"?"asc":"desc";function c(s,F){a({sort:s,dir:l===s?r==="asc"?"desc":"asc":F})}const _=Math.floor(p/i)+1,y=Math.max(1,Math.ceil(d/i)),L=!!(t("q")||t("source")||t("project"));return e.jsxs("div",{children:[e.jsx("h1",{className:"sr-only",children:"Files"}),e.jsxs("div",{className:"filters",children:[e.jsxs("form",{onSubmit:v,className:"search",role:"search",children:[e.jsx("input",{type:"search","aria-label":"Search files by path",placeholder:"Search file paths…",value:h,onChange:s=>u(s.target.value)}),e.jsx("button",{type:"submit",children:"Search"}),t("q")&&e.jsx("button",{type:"button",className:"ghost",onClick:()=>(u(""),a({q:""})),children:"clear"})]}),e.jsxs("select",{"aria-label":"Filter by source",value:t("source"),onChange:s=>a({source:s.target.value}),children:[e.jsx("option",{value:"",children:"all sources"}),f.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))]}),e.jsx(P,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:t("project"),onChange:s=>a({project:s}),options:[{value:"",label:"all projects"},...b.map(s=>({value:s.id,label:s.path.replace(/^.*\//,"")}))]})]}),e.jsx(k,{error:S}),j?e.jsx(D,{}):m.length===0?e.jsx("div",{className:"muted pad",role:"status",children:L?"No files match the filter.":"No file changes ingested yet — run agent-lens refresh (or ingest) first."}):e.jsxs("table",{className:"sessions",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(n,{label:"File",sortKey:"path",active:l,dir:r,onSort:c,defaultDir:"asc"}),e.jsx("th",{children:"Project"}),e.jsx(n,{label:"Sessions",sortKey:"sessions",active:l,dir:r,onSort:c,className:"num"}),e.jsx(n,{label:"Changes",sortKey:"changes",active:l,dir:r,onSort:c,className:"num"}),e.jsx("th",{className:"num",children:"+ / −"}),e.jsx(n,{label:"Last touched",sortKey:"last_ts",active:l,dir:r,onSort:c})]})}),e.jsx("tbody",{children:m.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(K,{to:`/file?path=${encodeURIComponent(s.file_path)}${s.project_id?`&project=${encodeURIComponent(s.project_id)}`:""}`,className:"title",title:s.file_path,children:A(s.file_path,s.project_path)})}),e.jsx("td",{children:s.project_path?e.jsx("span",{className:"tag",title:s.project_path,children:s.project_path.replace(/^.*\//,"")}):e.jsx("span",{className:"muted",children:"—"})}),e.jsx("td",{className:"num",children:s.sessions.toLocaleString()}),e.jsx("td",{className:"num",children:s.changes.toLocaleString()}),e.jsx("td",{className:"num",children:e.jsx(R,{added:s.lines_added,removed:s.lines_removed})}),e.jsx("td",{children:$(s.last_ts)})]},(s.project_id??"")+"\0"+s.file_path))})]}),!j&&d>0&&e.jsx(I,{page:_,pages:y,total:d,unit:"files",onPage:s=>a({offset:String((s-1)*i)})}),e.jsx("p",{className:"muted pad",children:"Tracked from Edit/Write tool calls — changes made via shell commands or outside sessions aren’t captured."})]})}export{R as LinesDelta,G as default,A as relPath};
@@ -0,0 +1 @@
1
+ import{k as ie,m as E,r as k,B as ae,x as ne,j as e,G as h,F as le,H as x,E as re,o as ce,S as $,P as oe,w as de,L as ue}from"./index-BEJAVOfs.js";import{u as W,S as he,a as me}from"./useResetOn-Qq0cEkL8.js";const P=50,pe={total:0,findings:[]},je=new Set;function ke(){const{get:t,set:a,clear:l}=ie(),n=E("/sources",[]),M=E("/projects",[]),[m,f]=k.useState(!1),[p,Q]=k.useState(0),{sort:r,toggle:S}=ae("severity","desc"),y=t("severity"),b=t("category"),v=t("rule"),_=t("session"),R=t("source"),F=t("project"),T=t("from"),A=t("to"),d=t("status","open"),w=k.useMemo(()=>{const s=new URLSearchParams;for(const[c,u]of Object.entries({severity:y,category:b,rule:v,session:_,source:R,project:F,from:T,to:A,status:d}))u&&s.set(c,u);return s},[y,b,v,_,R,F,T,A,d]),i=E("/security/summary",null,[p]),I=E(h?null:"/security/mutes",[],[p]),L=`${w.toString()}|${r.key}|${r.dir}`,[C,U]=W(L,1),[o,O]=W(`${L}|${C}|${p}`,je),N=new URLSearchParams(w);N.set("sort",r.key),N.set("dir",r.dir),N.set("limit",String(P)),N.set("offset",String((C-1)*P));const{data:V,loading:D,error:Y}=ne("/security/findings?"+N.toString(),{deps:[p]}),[q,B]=W(`${L}|${C}|${p}`,null),J=q??Y,{total:j,findings:K}=V??pe,g=k.useCallback(async s=>{f(!0),B(null);try{await s(),Q(c=>c+1)}catch(c){B(String(c))}finally{f(!1)}},[]),X=k.useMemo(()=>new Map(((i==null?void 0:i.by_severity)??[]).map(s=>[s.severity,s.n])),[i]),G=k.useMemo(()=>((i==null?void 0:i.by_rule)??[]).filter(s=>!b||s.category===b),[i,b]),Z=Math.max(1,Math.ceil(j/P)),ee=[...w.keys()].some(s=>s!=="status")||d!=="open",z=K.map(s=>s.id),se=z.length>0&&z.every(s=>o.has(s)),te=s=>O(c=>{const u=new Set(c);return u.has(s)?u.delete(s):u.add(s),u});return e.jsxs("div",{children:[e.jsxs("div",{className:"detail-head",children:[e.jsx("h1",{children:"Security findings"}),e.jsxs("p",{className:"muted page-intro",children:["Risky operations the agent performed, flagged after the fact by deterministic rules over each tool call. Counts show ",e.jsx("strong",{children:"open"})," findings — mark benign ones safe or mute a noisy rule so a real one stands out. agent-lens is retrospective; it surfaces what ",e.jsx("em",{children:"happened"}),", it doesn't block."]})]}),h&&e.jsxs("div",{className:"demo-note",role:"note",children:["📦 This is a static demo over synthetic sessions. Browse the findings and reference below —"," ",e.jsx("strong",{children:"triage"})," (mark safe, mute rules) and live filtering run in the local app on your own data."]}),e.jsxs("div",{className:"kpi-row sev-kpis",role:"group","aria-label":"Open findings by severity",children:[e.jsxs("button",{type:"button",className:"kpi kpi-btn"+(y?"":" is-active"),onClick:()=>a({severity:""}),children:[e.jsx("div",{className:"kpi-label",children:"Open findings"}),e.jsx("div",{className:"kpi-value",children:(i==null?void 0:i.total)??"—"}),e.jsxs("div",{className:"kpi-sub",children:[(i==null?void 0:i.sessions_flagged)??0," sessions flagged"]})]}),he.map(s=>e.jsxs("button",{type:"button",className:"kpi kpi-btn sev-kpi sev-"+s+(y===s?" is-active":""),onClick:()=>a({severity:y===s?"":s}),"aria-pressed":y===s,children:[e.jsx("div",{className:"kpi-label",children:s}),e.jsx("div",{className:"kpi-value",children:X.get(s)??0})]},s))]}),i&&(i.dismissed>0||i.muted>0)&&e.jsxs("div",{className:"triage-counts muted small",children:[e.jsxs("button",{type:"button",className:"linkish",onClick:()=>a({status:"dismissed",severity:""}),children:[i.dismissed," dismissed"]})," · ",e.jsxs("button",{type:"button",className:"linkish",onClick:()=>a({status:"muted",severity:""}),children:[i.muted," muted by rule"]})]}),e.jsxs("div",{className:"filters",children:[e.jsxs("select",{"aria-label":"Filter by status",value:d,onChange:s=>a({status:s.target.value}),children:[e.jsx("option",{value:"open",children:"open"}),e.jsx("option",{value:"dismissed",children:"dismissed"}),e.jsx("option",{value:"muted",children:"muted"}),e.jsx("option",{value:"all",children:"all"})]}),e.jsxs("select",{"aria-label":"Filter by category",value:b,onChange:s=>{const c=s.target.value,u=!v||G.some(H=>H.rule_id===v&&(!c||H.category===c));a({category:c,rule:u?v:""})},children:[e.jsx("option",{value:"",children:"all categories"}),((i==null?void 0:i.categories)??[]).map(s=>e.jsx("option",{value:s.key,children:s.title},s.key))]}),e.jsxs("select",{"aria-label":"Filter by rule",value:v,onChange:s=>a({rule:s.target.value}),children:[e.jsx("option",{value:"",children:"all rules"}),G.map(s=>e.jsxs("option",{value:s.rule_id,children:[s.rule_id," (",s.n,")"]},s.rule_id))]}),e.jsxs("select",{"aria-label":"Filter by source",value:R,onChange:s=>a({source:s.target.value}),children:[e.jsx("option",{value:"",children:"all sources"}),n.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))]}),e.jsx(le,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:F,onChange:s=>a({project:s}),options:[{value:"",label:"all projects"},...M.map(s=>({value:s.id,label:s.path.replace(/^.*\//,"")}))]}),e.jsxs("label",{className:"ctl",children:["from ",e.jsx("input",{type:"date",value:T,onChange:s=>a({from:s.target.value})})]}),e.jsxs("label",{className:"ctl",children:["to ",e.jsx("input",{type:"date",value:A,onChange:s=>a({to:s.target.value})})]}),_&&e.jsxs("span",{className:"tag filter-chip",children:["session ",_.slice(0,8),"… ",e.jsx("button",{type:"button",className:"linkish",onClick:()=>a({session:""}),children:"✕"})]}),ee&&e.jsx("button",{type:"button",className:"ghost",onClick:l,children:"clear filters"})]}),!h&&(o.size>0||d==="open"&&j>0)&&e.jsxs("div",{className:"triage-bar",role:"group","aria-label":"Triage actions",children:[o.size>0&&d!=="dismissed"&&e.jsxs("button",{type:"button",disabled:m,onClick:()=>g(()=>x("/security/dismiss",{ids:[...o]})),children:["✓ Mark ",o.size," safe"]}),o.size>0&&d==="dismissed"&&e.jsxs("button",{type:"button",disabled:m,onClick:()=>g(()=>x("/security/reopen",{ids:[...o]})),children:["↩ Reopen ",o.size]}),o.size>0&&e.jsx("button",{type:"button",className:"ghost",onClick:()=>O(new Set),children:"clear selection"}),d==="open"&&j>0&&e.jsxs("button",{type:"button",className:"ghost",disabled:m,onClick:()=>{confirm(`Dismiss all ${j} open findings matching the current filter as safe?`)&&g(()=>x("/security/dismiss-matching",{filter:Object.fromEntries(w)}))},title:"Mark every open finding matching the current filter as safe",children:["Dismiss all ",j," matching"]})]}),e.jsx(re,{error:J}),D?e.jsx(ce,{}):K.length===0?e.jsx("div",{className:"muted pad",role:"status",children:i&&i.total===0&&d==="open"?"No open security findings — nothing risky is awaiting review.":"No findings match these filters."}):e.jsxs("table",{className:"sessions findings-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[!h&&e.jsx("th",{className:"check-col",children:e.jsx("input",{type:"checkbox","aria-label":"Select all on this page",checked:se,onChange:s=>O(s.target.checked?new Set(z):new Set)})}),e.jsx($,{label:"Severity",sortKey:"severity",active:r.key,dir:r.dir,onSort:S}),e.jsx("th",{children:"Finding"}),e.jsx($,{label:"Category",sortKey:"category",active:r.key,dir:r.dir,onSort:S}),e.jsx("th",{children:"Evidence"}),e.jsx($,{label:"When",sortKey:"time",active:r.key,dir:r.dir,onSort:S}),e.jsx($,{label:"Session",sortKey:"session",active:r.key,dir:r.dir,onSort:S}),!h&&e.jsx("th",{children:"Actions"})]})}),e.jsx("tbody",{children:K.map(s=>e.jsx(ge,{f:s,selected:o.has(s.id),onToggle:()=>te(s.id),busy:m,onDismiss:()=>g(()=>x("/security/dismiss",{ids:[s.id]})),onReopen:()=>g(()=>x("/security/reopen",{ids:[s.id]})),onMute:()=>g(()=>x("/security/mute",{rule_id:s.rule_id,scope:"global"}))},s.id))})]}),!D&&j>P&&e.jsx(oe,{page:C,pages:Z,total:j,unit:"findings",onPage:U}),!h&&I.length>0&&e.jsx(xe,{mutes:I,busy:m,onUnmute:s=>g(()=>x("/security/unmute",{rule_id:s.rule_id,scope:s.scope,scope_id:s.scope_id}))}),i&&i.categories.length>0&&e.jsx(ye,{summary:i})]})}function ge({f:t,selected:a,onToggle:l,busy:n,onDismiss:M,onReopen:m,onMute:f}){const p=`/session/${t.session_id}${t.event_uuid?`#ev-${t.event_uuid}`:""}`;return e.jsxs("tr",{className:t.dismissed?"is-dismissed":"",children:[!h&&e.jsx("td",{className:"check-col",children:e.jsx("input",{type:"checkbox","aria-label":"Select finding",checked:a,onChange:l})}),e.jsxs("td",{children:[e.jsx(me,{severity:t.severity}),t.dismissed?e.jsx("span",{className:"tag dismissed",title:t.dismiss_note??"",children:"safe"}):null]}),e.jsxs("td",{children:[e.jsx("div",{className:"finding-title",children:t.title??t.rule_id}),e.jsxs("div",{className:"muted small",children:[e.jsx("code",{children:t.rule_id}),t.framework_ref&&e.jsx("span",{className:"tag framework",children:t.framework_ref})]})]}),e.jsx("td",{className:"small",children:t.category}),e.jsxs("td",{className:"finding-evidence-cell",children:[t.tool_name&&e.jsx("span",{className:"tag tool-tag",title:"Tool the finding fired on",children:t.tool_name}),e.jsx("code",{title:t.evidence??"",children:t.evidence})]}),e.jsx("td",{className:"small muted",title:t.started_at??"",children:de(t.started_at??null)}),e.jsxs("td",{className:"small",children:[e.jsx(ue,{to:p,className:"title",children:t.session_title||t.session_id.slice(0,12)}),t.is_sidechain?e.jsx("span",{className:"tag subagent",children:"subagent"}):null,t.project_path&&e.jsx("div",{className:"muted path",children:t.project_path.replace(/^.*\//,"")})]}),!h&&e.jsxs("td",{className:"finding-actions small",children:[t.dismissed?e.jsx("button",{type:"button",className:"linkish",disabled:n,onClick:m,children:"reopen"}):e.jsx("button",{type:"button",className:"linkish",disabled:n,onClick:M,children:"safe"}),e.jsx("button",{type:"button",className:"linkish",disabled:n,onClick:f,title:`Mute rule ${t.rule_id} everywhere`,children:"mute rule"})]})]})}function xe({mutes:t,busy:a,onUnmute:l}){return e.jsxs("details",{className:"card muted-rules",children:[e.jsx("summary",{children:e.jsxs("span",{className:"sec-ref-title",children:["Muted rules (",t.length,")"]})}),e.jsx("ul",{className:"muted-rules-list",children:t.map(n=>e.jsxs("li",{children:[e.jsx("code",{children:n.rule_id}),e.jsxs("span",{className:"tag mute-scope",children:[n.scope,n.scope_id?`: ${n.scope_id}`:""]}),n.note&&e.jsx("span",{className:"muted small mute-note",children:n.note}),e.jsx("button",{type:"button",className:"linkish unmute",disabled:a,onClick:()=>l(n),children:"unmute"})]},`${n.rule_id}:${n.scope}:${n.scope_id}`))})]})}function ye({summary:t}){const a=new Map(t.by_category.map(l=>[l.category,l.n]));return e.jsxs("section",{className:"sec-reference",children:[e.jsx("h2",{children:"Risk categories"}),e.jsx("p",{className:"muted small sec-reference-intro",children:"What each category means and why it matters, anchored to OWASP Top 10 for Agentic Apps and MITRE ATLAS."}),e.jsx("div",{className:"sec-ref-grid",children:t.categories.map(l=>e.jsxs("details",{className:"card sec-ref",children:[e.jsxs("summary",{children:[e.jsx("span",{className:"sec-ref-title",children:l.title}),e.jsxs("a",{className:"tag framework",href:l.framework_url,target:"_blank",rel:"noreferrer",onClick:n=>n.stopPropagation(),children:[l.framework_ref," ↗"]}),e.jsxs("span",{className:"muted small",children:[a.get(l.key)??0," open"]})]}),e.jsxs("dl",{className:"sec-ref-body",children:[e.jsx("dt",{children:"What"}),e.jsx("dd",{children:l.what}),e.jsx("dt",{children:"Why it matters"}),e.jsx("dd",{children:l.why}),e.jsx("dt",{children:"What to do"}),e.jsx("dd",{children:l.remediation})]})]},l.key))})]})}export{ke as default};
@@ -0,0 +1,15 @@
1
+ import{e as Os,j as e,q as A,r as d,L as y,f as Ms,t as Fs,b as $s,v as Rs,c as T,w as ts,s as qs,x as As,h as G,i as as,l as Ls,y as Bs,z as Ps,k as Us,E as Ds,o as Hs}from"./index-BEJAVOfs.js";import{S as O,a as ls,u as Js}from"./useResetOn-Qq0cEkL8.js";import{A as L,C as S,p as v}from"./jsonish-BeRl_b24.js";import{M as Ws,r as Ks}from"./index-BMr6pgv5.js";function Vs({id:s}){const n=Os();return e.jsxs("details",{className:"export-menu col-customizer",ref:n,children:[e.jsx("summary",{className:"export",title:"Export this session as Markdown",children:"⬇ Export Markdown"}),e.jsxs("div",{className:"col-menu",role:"group","aria-label":"Export options",children:[e.jsxs("a",{href:A(s),download:!0,children:["Redacted ",e.jsx("span",{className:"muted small",children:"(secrets masked)"})]}),e.jsxs("a",{href:A(s,"structure"),download:!0,children:["Structure only ",e.jsx("span",{className:"muted small",children:"(scrubbed)"})]}),e.jsxs("a",{className:"export-verbatim",href:A(s,"off"),download:!0,children:["Verbatim ",e.jsx("span",{className:"muted small",children:"(unredacted)"})]})]})]})}function Qs({c:s}){var i;const[n,t]=d.useState(!1),a=d.useId(),l=(i=s.signals)==null?void 0:i.loc;return e.jsxs("div",{className:"classification",children:[e.jsx("span",{className:"tag cat cat-"+(s.category??"none"),children:s.category??"unclassified"}),s.complexity_band&&e.jsxs("span",{className:"tag complexity",children:[s.complexity_band," · ",s.complexity_score]}),l&&e.jsxs("span",{className:"muted small",children:["+",l.added,"/−",l.removed," LoC · ",l.files," files"]}),e.jsxs("button",{className:"ghost small","aria-expanded":n,"aria-controls":a,onClick:()=>t(r=>!r),children:["why ",n?"▾":"▸"]}),n&&(s.signals?e.jsx(Ys,{id:a,s:s.signals,category:s.category}):e.jsx("div",{id:a,className:"muted small pad",children:"No signals recorded for this session."}))]})}const zs={loc:"Lines changed",files:"Files touched",turns:"Turns",tokens:"Work tokens",duration:"Duration",subagents:"Subagents"},X=s=>`${Math.max(0,Math.min(1,s))*100}%`;function Z({counts:s}){const n=Object.entries(s).sort((t,a)=>a[1]-t[1]);return n.length===0?e.jsx("span",{className:"muted",children:"—"}):e.jsx("span",{className:"sig-chips",children:n.map(([t,a])=>e.jsxs("span",{className:"sig-chip",children:[t," ",e.jsxs("span",{className:"muted",children:["×",a]})]},t))})}function Ys({id:s,s:n,category:t}){const[a,l]=d.useState(!1),i=d.useId(),r=n.complexity_weights??{},o=n.complexity_subscores??{},c=Object.keys(r).map(m=>({key:m,weight:r[m],subscore:o[m]??0,pts:r[m]*(o[m]??0)*100})).sort((m,w)=>w.pts-m.pts),u=Math.max(...c.map(m=>m.pts),1e-4),h=Object.entries(n.category_scores??{}).map(([m,w])=>({k:m,v:w})).sort((m,w)=>w.v-m.v),f=Math.max(...h.map(m=>m.v),1e-4),x=h.filter(m=>m.v>.02||m.k===t),g=n.skills&&Object.keys(n.skills).length>0;return e.jsxs("div",{id:s,className:"signals-panel",children:[c.length>0&&e.jsxs("section",{className:"sig-section",children:[e.jsxs("h4",{className:"sig-h",children:["Complexity breakdown ",e.jsx("span",{className:"muted",children:"— what built the score"})]}),e.jsx("ul",{className:"sig-bars",children:c.map(m=>e.jsxs("li",{className:"sig-bar-row",children:[e.jsx("span",{className:"sig-bar-label",children:zs[m.key]??m.key}),e.jsx("span",{className:"sig-bar","aria-hidden":"true",children:e.jsx("span",{className:"sig-bar-fill",style:{width:X(m.pts/u)}})}),e.jsxs("span",{className:"sig-bar-val",children:[m.pts.toFixed(1)," pts"]}),e.jsxs("span",{className:"sig-bar-sub muted",children:[Math.round(m.subscore*100),"% intensity · weight ",Math.round(m.weight*100),"%"]})]},m.key))})]}),x.length>0&&e.jsxs("section",{className:"sig-section",children:[e.jsxs("h4",{className:"sig-h",children:["Category scores ",e.jsxs("span",{className:"muted",children:["— why “",t,"” won"]})]}),e.jsx("ul",{className:"sig-bars",children:x.map(m=>e.jsxs("li",{className:"sig-bar-row"+(m.k===t?" is-win":""),children:[e.jsx("span",{className:"sig-bar-label",children:m.k}),e.jsx("span",{className:"sig-bar","aria-hidden":"true",children:e.jsx("span",{className:"sig-bar-fill",style:{width:X(m.v/f)}})}),e.jsx("span",{className:"sig-bar-val",children:m.v.toFixed(2)})]},m.k))})]}),e.jsxs("section",{className:"sig-section",children:[e.jsx("h4",{className:"sig-h",children:"Evidence"}),e.jsxs("dl",{className:"sig-grid",children:[n.tool_counts&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Tools"}),e.jsx("dd",{children:e.jsx(Z,{counts:n.tool_counts})})]}),g&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Skills"}),e.jsx("dd",{children:e.jsx(Z,{counts:n.skills})})]}),n.subagent_role&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Subagent role"}),e.jsx("dd",{children:n.subagent_role})]}),n.files&&n.files.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("dt",{children:["Files (",n.files.length,")"]}),e.jsx("dd",{className:"sig-files",children:n.files.join(", ")})]})]})]}),e.jsx("button",{className:"ghost small","aria-expanded":a,"aria-controls":i,onClick:()=>l(m=>!m),children:a?"Hide raw JSON ▴":"View raw JSON ▾"}),a&&e.jsx("pre",{id:i,className:"code signals",children:JSON.stringify(n,null,2)})]})}function Gs({f:s}){var r;const[n,t]=d.useState(!1),a=d.useId(),l=((r=s.signals)==null?void 0:r.modifiers)??{},i=Object.keys(l).filter(o=>l[o]!==!1&&l[o]!=null&&l[o]!=="");return e.jsxs("div",{className:"finding sev-border-"+s.severity,children:[e.jsxs("button",{className:"finding-head","aria-expanded":n,"aria-controls":a,onClick:()=>t(o=>!o),children:[e.jsx(ls,{severity:s.severity}),e.jsx("span",{className:"finding-title",children:s.title??s.rule_id}),s.framework_ref&&e.jsx("span",{className:"tag framework",children:s.framework_ref}),e.jsx("span",{className:"chev",children:n?"▾":"▸"})]}),n&&e.jsxs("div",{className:"finding-body",id:a,children:[s.evidence&&e.jsx("div",{className:"code-block",children:e.jsx("pre",{className:"code finding-evidence",children:s.evidence})}),e.jsxs("dl",{className:"sig-grid",children:[e.jsx("dt",{children:"Rule"}),e.jsx("dd",{children:e.jsx("code",{children:s.rule_id})}),e.jsx("dt",{children:"Category"}),e.jsx("dd",{children:s.category}),i.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Context"}),e.jsx("dd",{children:i.map(o=>e.jsxs("span",{className:"sig-chip",children:[o,l[o]!==!0?e.jsxs("span",{className:"muted",children:[" ",String(l[o])]}):null]},o))})]})]}),e.jsxs(y,{className:"subagent-link small",to:`/security?rule=${encodeURIComponent(s.rule_id)}`,children:["see all “",s.rule_id,"” findings →"]})]})]})}function Xs({findings:s}){if(!s.length)return null;const n=[...s].sort((t,a)=>O.indexOf(t.severity)-O.indexOf(a.severity));return e.jsx("div",{className:"tool-findings",children:n.map(t=>e.jsx(Gs,{f:t},t.id))})}function Zs({findings:s,sessionId:n}){const t=new Map;for(const l of s)t.set(l.severity,(t.get(l.severity)??0)+1);const a=O.find(l=>t.has(l))??"info";return e.jsxs("div",{className:"security-banner sev-border-"+a,role:"status",children:[e.jsx("span",{className:"security-banner-icon","aria-hidden":"true",children:"🛡"}),e.jsxs("span",{className:"security-banner-text",children:[s.length," security ",s.length===1?"finding":"findings"," in this session"]}),e.jsx("span",{className:"security-banner-sevs",children:O.filter(l=>t.has(l)).map(l=>e.jsx(ls,{severity:l,count:t.get(l)},l))}),e.jsx(y,{className:"subagent-link small",to:`/security?session=${encodeURIComponent(n)}`,children:"view on Security page →"})]})}function se(s){const n={dirs:new Map,files:[]};for(const a of s){const l=a.display.startsWith("/"),i=(l?a.display.slice(1):a.display).split("/");l&&i.length>0&&(i[0]="/"+i[0]);let r=n;for(const o of i.slice(0,-1))r=r.dirs.get(o)??r.dirs.set(o,{dirs:new Map,files:[]}).get(o);r.files.push({name:i[i.length-1],path:a.path,list:a.list})}const t=a=>{for(const[l,i]of[...a.dirs.entries()])if(t(i),i.files.length===0&&i.dirs.size===1){const[r,o]=[...i.dirs.entries()][0];a.dirs.delete(l),a.dirs.set(l+"/"+r,o)}};return t(n),n}function rs({node:s,depth:n}){const t={paddingLeft:`${.4+n*1.1}rem`};return e.jsxs(e.Fragment,{children:[[...s.dirs.entries()].sort(([a],[l])=>a.localeCompare(l)).map(([a,l])=>e.jsxs(d.Fragment,{children:[e.jsx("tr",{children:e.jsx("td",{colSpan:3,style:t,children:e.jsxs("span",{className:"muted",children:["📁 ",a,"/"]})})}),e.jsx(rs,{node:l,depth:n+1})]},a)),[...s.files].sort((a,l)=>a.name.localeCompare(l.name)).map(a=>{const l=a.list.find(o=>o.event_uuid),i=a.list.reduce((o,c)=>o+(c.lines_added??0),0),r=a.list.reduce((o,c)=>o+(c.lines_removed??0),0);return e.jsxs("tr",{children:[e.jsx("td",{style:t,children:l!=null&&l.event_uuid?e.jsx("a",{href:`#ev-${l.event_uuid}`,className:"title",title:a.path+" — jump to the first change",children:a.name}):e.jsx("span",{title:a.path,children:a.name})}),e.jsxs("td",{className:"num",children:[a.list.length,"× ",e.jsxs("span",{className:"muted",children:["(+",i," −",r,")"]})]}),e.jsx("td",{children:e.jsx(y,{className:"subagent-link small",to:`/file?path=${encodeURIComponent(a.path)}`,children:"history →"})})]},a.path)})]})}function ee({changes:s,projectPath:n}){const t=new Map;for(const i of s)(t.get(i.file_path)??t.set(i.file_path,[]).get(i.file_path)).push(i);const a=i=>n&&i.startsWith(n.replace(/\/$/,"")+"/")?i.slice(n.replace(/\/$/,"").length+1):i,l=se([...t.entries()].map(([i,r])=>({display:a(i),path:i,list:r})));return e.jsxs("details",{className:"wf-run files-changed",children:[e.jsxs("summary",{children:["📄 ",t.size," ",t.size===1?"file":"files"," changed · ",s.length," ",s.length===1?"edit":"edits"]}),e.jsx("table",{className:"sessions",children:e.jsx("tbody",{children:e.jsx(rs,{node:l,depth:0})})})]})}function ne({d:s}){var t;const n=s.session;return e.jsxs("div",{className:"detail-head",children:[e.jsx(y,{to:"/",className:"back",children:"← all sessions"}),e.jsx("h1",{children:n.title||n.id.slice(0,12)}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:e.jsx("b",{children:n.source_id})}),e.jsx("span",{className:"path",children:n.project_path}),n.is_sidechain?e.jsx("span",{className:"tag subagent",children:"subagent"}):null,s.parent&&e.jsxs("span",{className:"spawned-by",children:["↖ spawned by"," ",e.jsx(y,{to:`/session/${s.parent.id}`,children:s.parent.title||s.parent.id.slice(0,12)}),s.parent.turn_seq!=null?` · turn ${s.parent.turn_seq+1}`:""]}),e.jsxs("span",{children:[s.turns.length," turns"]}),e.jsxs("span",{children:[n.event_count," events"]}),e.jsxs("span",{title:Fs(n.token_split),children:[Ms(n.tokens)," tok"]}),e.jsxs("span",{title:Rs(n.unpriced_models),children:[$s(n.cost),(t=n.unpriced_models)!=null&&t.length?e.jsx("span",{className:"warn-tag",children:" ⚠"}):null]}),n.tool_call_count>0&&e.jsxs("span",{className:n.tool_failure_count>0?"tool-err-stat":"muted",title:"Tool calls that returned is_error, of "+n.tool_call_count+". Failures = the agent's tool errored; declined/blocked = you rejected it or a guardrail blocked it (heuristic split from the result text — not an API-reported distinction).",children:[n.tool_failure_count," failed",n.tool_rejection_count>0?` · ${n.tool_rejection_count} declined/blocked`:"",` of ${n.tool_call_count} tool calls`]}),e.jsx("span",{children:T(n.duration_ms)}),e.jsx("span",{className:"muted",children:ts(n.started_at)}),e.jsx(Vs,{id:n.id})]}),s.classification&&e.jsx(Qs,{c:s.classification}),s.findings&&s.findings.length>0&&e.jsx(Zs,{findings:s.findings,sessionId:n.id}),s.file_changes&&s.file_changes.length>0&&e.jsx(ee,{changes:s.file_changes,projectPath:n.project_path??null})]})}function te({search:s,turnCount:n,anyOpen:t,onToggleAll:a,hideTools:l,onToggleHideTools:i,format:r,onChooseFormat:o}){return e.jsxs(e.Fragment,{children:[s,e.jsxs("div",{className:"transcript-tools",children:[n>1&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"muted small",children:[n," turns"]}),e.jsx("button",{className:"ghost small",onClick:a,children:t?"Collapse all":"Expand all"})]}),e.jsxs("button",{className:"ghost small"+(l?" is-active":""),"aria-pressed":l,onClick:i,title:"Hide Bash/Edit/Skill and other tool calls — show only assistant answers, plans and questions",children:[l?"☑ ":"☐ ","Hide tool messages"]}),e.jsxs("div",{className:"format-toggle",role:"group","aria-label":"Message format",children:[e.jsx("button",{className:"ghost small"+(r==="markdown"?" is-active":""),"aria-pressed":r==="markdown",onClick:()=>o("markdown"),children:"Markdown"}),e.jsx("button",{className:"ghost small"+(r==="raw"?" is-active":""),"aria-pressed":r==="raw",onClick:()=>o("raw"),children:"Raw"})]})]})]})}const M=2,ae={hits:[],byTurn:new Map,total:0};function is(s){var n;return[s.input_json,s.result_summary,(n=s.full_result)==null?void 0:n.text].filter(Boolean).join(`
2
+ `)}function os(s){const n=[];s.text&&n.push(s.text),s.thinking&&n.push(s.thinking);for(const t of s.toolCalls)n.push(is(t));return n.join(`
3
+ `).toLowerCase()}function le(s){return new Map(s.map(n=>[n.uuid,os(n)]))}function re(s,n){let t=0;for(let a=s.indexOf(n);a!==-1;a=s.indexOf(n,a+n.length))t++;return t}function ie(s,n,t){const a=t.trim().toLowerCase();if(a.length<M)return ae;const l=[],i=new Map;for(const r of s){const o=re(n.get(r.uuid)??os(r),a);o&&(l.push({uuid:r.uuid,turnId:r.turn_id??null,count:o}),r.turn_id&&i.set(r.turn_id,(i.get(r.turn_id)??0)+1))}return{hits:l,byTurn:i,total:l.length}}function oe(s,n){return U(is(s),n)}function U(s,n){const t=n.trim().toLowerCase();return!s||t.length<M?!1:s.toLowerCase().includes(t)}function cs(s,n,t){return a=>{if(a.key==="Escape"){a.preventDefault(),t();return}if(a.key==="Enter"){if(a.shiftKey){a.preventDefault(),s();return}a.target.tagName!=="BUTTON"&&(a.preventDefault(),n())}}}function ce({query:s,total:n,index:t,onPrev:a,onNext:l,onClear:i,onBackToBox:r}){return e.jsxs("div",{className:"search-nav",role:"group","aria-label":"Search matches",tabIndex:-1,onKeyDown:cs(a,l,i),children:[e.jsx("button",{type:"button",className:"ghost small sn-back","aria-label":"Back to the search box",onClick:r,children:"🔍"}),e.jsxs("span",{className:"sn-term",children:[e.jsx("span",{className:"sn-q",children:s}),e.jsxs("span",{className:"sn-pos",children:[t+1,"/",n]})]}),e.jsx("button",{type:"button",className:"ghost small","aria-label":"Previous match",onClick:a,children:"◂"}),e.jsx("button",{type:"button",className:"ghost small","aria-label":"Next match",onClick:l,children:"▸"}),e.jsx("button",{type:"button",className:"ghost small","aria-label":"Clear search",onClick:i,children:"✕"})]})}const de=150;function ue({query:s,onQuery:n,total:t,index:a,onPrev:l,onNext:i,inputRef:r}){const[o,c]=d.useState(s),u=d.useRef(0),h=d.useRef(null),[f,x]=d.useState(!0);d.useEffect(()=>{const N=h.current;if(!N||typeof IntersectionObserver>"u")return;const b=new IntersectionObserver(([F])=>x(F.isIntersecting));return b.observe(N),()=>b.disconnect()},[]);const g=d.useRef(s);g.current!==s&&(g.current=s,c(s)),d.useEffect(()=>()=>window.clearTimeout(u.current),[]);const m=N=>{c(N),window.clearTimeout(u.current),u.current=window.setTimeout(()=>n(N),de)},w=()=>{var N;window.clearTimeout(u.current),c(""),n(""),(N=r.current)==null||N.focus()},j=o.trim().length>=M;return e.jsxs(e.Fragment,{children:[e.jsxs("form",{ref:h,className:"transcript-search",role:"search",onSubmit:N=>N.preventDefault(),onKeyDown:cs(l,i,w),children:[e.jsx("span",{className:"ts-icon","aria-hidden":"true",children:"🔍"}),e.jsx("input",{ref:r,type:"search","aria-label":"Find in this session",placeholder:"Find in session…",value:o,onChange:N=>m(N.target.value)}),e.jsx("span",{className:"ts-count muted small",role:"status","aria-live":"polite",children:j?t===0?"No matches":`${a+1} of ${t} message${t===1?"":"s"}`:""}),e.jsx("button",{type:"button",className:"ghost small","aria-label":"Previous match",disabled:t===0,onClick:l,children:"◂"}),e.jsx("button",{type:"button",className:"ghost small","aria-label":"Next match",disabled:t===0,onClick:i,children:"▸"}),o&&e.jsx("button",{type:"button",className:"ghost small","aria-label":"Clear search",onClick:w,children:"✕"})]}),t>0&&!f&&e.jsx(ce,{query:s,total:t,index:a,onPrev:l,onNext:i,onClear:w,onBackToBox:()=>{var N;return(N=r.current)==null?void 0:N.focus()}})]})}function me({d:s}){const n=s.workflow_runs??[],t=s.children.filter(l=>!l.workflow_run_id),a=n.length>0;return e.jsxs("div",{className:"subagents",children:[e.jsxs("h2",{children:["Spawned subagents (",s.children.length,")"]}),n.map(l=>{const i=s.children.filter(r=>r.workflow_run_id===l.run_id);return e.jsxs("details",{className:"wf-run",children:[e.jsxs("summary",{children:[e.jsxs(y,{className:"wf-run-name",to:`/workflow/${l.run_id}`,onClick:r=>r.stopPropagation(),children:["🔀 ",l.name||"workflow"," →"]}),l.status&&e.jsx("span",{className:"tag task-status task-status-"+l.status.toLowerCase(),children:l.status}),e.jsxs("span",{className:"muted small",children:[i.length," agent",i.length===1?"":"s",l.turn_seq!=null?` · turn ${l.turn_seq+1}`:""," · ",e.jsx("code",{children:l.run_id})]})]}),e.jsx("ul",{children:i.map(r=>e.jsx(L,{a:r},r.id))})]},l.run_id)}),t.length>0&&(a?e.jsxs("details",{className:"wf-run",open:!0,children:[e.jsxs("summary",{children:[e.jsx("span",{className:"wf-run-name",children:"Task / Agent"}),e.jsxs("span",{className:"muted small",children:[t.length," subagent",t.length===1?"":"s"]})]}),e.jsx("ul",{children:t.map(l=>e.jsx(L,{a:l},l.id))})]}):e.jsx("ul",{children:t.map(l=>e.jsx(L,{a:l},l.id))}))]})}function ss(s,n){const t=s===""?[]:s.split(`
4
+ `),a=n===""?[]:n.split(`
5
+ `),l=t.length,i=a.length;if(l*i>25e4)return[...t.map(h=>({type:"del",text:h})),...a.map(h=>({type:"add",text:h}))];const r=Array.from({length:l+1},()=>new Array(i+1).fill(0));for(let h=l-1;h>=0;h--)for(let f=i-1;f>=0;f--)r[h][f]=t[h]===a[f]?r[h+1][f+1]+1:Math.max(r[h+1][f],r[h][f+1]);const o=[];let c=0,u=0;for(;c<l&&u<i;)t[c]===a[u]?(o.push({type:"ctx",text:t[c]}),c++,u++):r[c+1][u]>=r[c][u+1]?(o.push({type:"del",text:t[c]}),c++):(o.push({type:"add",text:a[u]}),u++);for(;c<l;)o.push({type:"del",text:t[c++]});for(;u<i;)o.push({type:"add",text:a[u++]});return o}function ds(s){if(!s)return null;try{const n=JSON.parse(s).plan;return typeof n=="string"&&n.trim()?n:null}catch{return null}}function he(s){if(!s)return[];try{const n=JSON.parse(s).questions;return Array.isArray(n)?n:[]}catch{return[]}}function pe(s){if(!s)return{answers:{},annotations:{}};try{const n=JSON.parse(s);if(n&&typeof n=="object"&&n.answers)return{answers:n.answers,annotations:n.annotations??{}}}catch{}return{answers:{},annotations:{}}}function xe(s){if(!s)return null;try{const n=JSON.parse(s);if(!n||typeof n!="object")return null;const t=typeof n.command=="string"?n.command:"";return t.trim()?{command:t,description:typeof n.description=="string"?n.description:void 0,timeout:typeof n.timeout=="number"?n.timeout:void 0,run_in_background:n.run_in_background===!0,restart:n.restart===!0}:null}catch{return null}}function fe(s,n){if(!n)return null;try{const t=JSON.parse(n);if(!t||typeof t!="object"||typeof t.file_path!="string")return null;let a;if(s==="Write"){if(typeof t.content!="string")return null;a=[t.content===""?[]:t.content.split(`
6
+ `).map(r=>({type:"add",text:r}))]}else if(s==="MultiEdit"){if(!Array.isArray(t.edits)||(a=t.edits.filter(r=>{const o=r;return!!o&&typeof o.old_string=="string"&&typeof o.new_string=="string"}).map(r=>ss(r.old_string,r.new_string)),a.length===0))return null}else{if(typeof t.old_string!="string"||typeof t.new_string!="string")return null;a=[ss(t.old_string,t.new_string)]}let l=0,i=0;for(const r of a)for(const o of r)o.type==="add"?l++:o.type==="del"&&i++;return{file_path:t.file_path,kind:s,hunks:a,adds:l,dels:i}}catch{return null}}function je(s){const n=s.lastIndexOf("/");return n>=0?{dir:s.slice(0,n+1),base:s.slice(n+1)}:{dir:"",base:s}}function us(s){var a,l,i,r,o;const n=(l=(a=s.match(/<command-name>([^<]*)<\/command-name>/))==null?void 0:a[1])==null?void 0:l.trim();if(n){const c=((r=(i=s.match(/<command-args>([^<]*)<\/command-args>/))==null?void 0:i[1])==null?void 0:r.trim())??"";return{kind:"invocation",name:n.startsWith("/")?n:`/${n}`,args:c}}const t=(o=s.match(/<(?:local-command-stdout|command-output|local-command-stderr)>([\s\S]*?)<\/(?:local-command-stdout|command-output|local-command-stderr)>/))==null?void 0:o[1];return t!=null?{kind:"output",stdout:t.trim()}:/<local-command-caveat>/.test(s)?{kind:"caveat"}:null}function ms(s){if(!/<task-notification>/.test(s))return null;const n=t=>{var a,l;return((l=(a=s.match(new RegExp(`<${t}>([\\s\\S]*?)</${t}>`)))==null?void 0:a[1])==null?void 0:l.trim())??null};return{taskId:n("task-id"),toolUseId:n("tool-use-id"),status:n("status"),summary:n("summary")}}function ge(s){const n=us(s);if((n==null?void 0:n.kind)==="invocation")return`⌘ ${n.name}${n.args?" "+n.args:""}`;if((n==null?void 0:n.kind)==="output")return"⌘ command output";if((n==null?void 0:n.kind)==="caveat")return"⌘ local command";const t=ms(s);return t?`🔔 task ${t.status??"notification"}`:s}const hs=d.createContext("markdown"),ps=d.createContext(new Map),xs=d.createContext(!1),fs=d.createContext(null),D=d.createContext({query:"",activeUuid:null});function Ne({cmd:s}){return s.kind==="invocation"?e.jsxs("div",{className:"cmd",children:[e.jsxs("span",{className:"cmd-chip",title:"Slash command",children:["⌘ ",s.name]}),s.args&&e.jsx("code",{className:"cmd-args",children:s.args})]}):s.kind==="output"?e.jsx("div",{className:"cmd-out",children:s.stdout&&s.stdout!=="(no content)"?s.stdout:e.jsx("span",{className:"muted",children:"no output"})}):e.jsx("div",{className:"cmd-note muted small",children:"⌘ local command context"})}function we({n:s}){const n=d.useContext(ps),t=s.toolUseId?n.get(s.toolUseId):void 0,a=(s.status??"").toLowerCase();return e.jsxs("div",{className:"task-notif",children:[e.jsxs("div",{className:"task-notif-head",children:[e.jsx("span",{className:"task-notif-icon","aria-hidden":"true",children:"🔔"}),s.status&&e.jsx("span",{className:"tag task-status task-status-"+a,children:s.status}),s.taskId&&e.jsxs("code",{className:"task-notif-id",children:["task ",s.taskId]}),t&&e.jsx(y,{className:"subagent-link small",to:`/workflow/${t}`,children:"view workflow →"})]}),s.summary&&e.jsx("div",{className:"task-notif-summary",children:s.summary})]})}function es({text:s,id:n}){return d.useContext(hs)==="raw"?e.jsx("div",{className:"text",id:n,children:s}):e.jsx("div",{className:"text md",id:n,children:e.jsx(Ws,{remarkPlugins:[Ks],components:_e,children:s})})}const _e={a:({node:s,...n})=>e.jsx("a",{...n,target:"_blank",rel:"noopener noreferrer"})};function js({text:s,uuid:n}){const t=s.length>1400||s.split(`
7
+ `).length>18,[a,l]=d.useState(!1),i=d.useContext(D),r=d.useId();if(!t)return e.jsx(es,{text:s});const o=a||!!n&&i.activeUuid===n&&U(s,i.query);return e.jsxs("div",{className:"text-wrap"+(o?"":" is-clamped"),children:[e.jsx(es,{text:s,id:r}),e.jsx("button",{className:"ghost small show-more","aria-expanded":o,"aria-controls":r,onClick:()=>l(!o),children:o?"Show less ▴":"Show more ▾"})]})}function gs({t:s}){const[n,t]=d.useState(!1),[a,l]=d.useState(!1),i=d.useId(),r=s.skill_name?`Skill · ${s.skill_name}`:s.tool_name==="Workflow"&&s.workflow_name?`Workflow · ${s.workflow_name}`:s.agent_type?`${s.tool_name} → ${s.agent_type}`:s.tool_name;return e.jsxs("div",{className:"tool "+(s.status==="error"?"tool-err":""),children:[e.jsxs("button",{className:"tool-head","aria-expanded":n,"aria-controls":i,onClick:()=>t(o=>!o),children:[e.jsxs("span",{className:"tool-name",children:["🔧 ",r]}),s.status&&e.jsx("span",{className:"tool-status",children:s.status}),s.total_duration_ms?e.jsx("span",{className:"muted",children:T(s.total_duration_ms)}):null,e.jsx("span",{className:"chev",children:n?"▾":"▸"})]}),s.spawned_session_id&&e.jsx(y,{className:"subagent-link small",to:`/session/${s.spawned_session_id}`,children:"view subagent transcript →"}),s.workflow_run_id&&e.jsxs(y,{className:"subagent-link small",to:`/workflow/${s.workflow_run_id}`,children:["🔀 launched ",s.workflow_agent_count??0," agent",s.workflow_agent_count===1?"":"s"," · ",e.jsx("code",{children:s.workflow_run_id})," →"]}),s.skill_name&&e.jsxs(y,{className:"subagent-link small",to:`/skill/${encodeURIComponent(s.skill_name)}${s.skill_id?`?v=${s.skill_id}`:""}`,children:["📖 view skill",s.skill_id?" version":""," →"]}),n&&e.jsxs("div",{className:"tool-body",id:i,children:[s.input_json&&s.input_json!=="{}"&&e.jsxs("div",{className:"code-block",children:[e.jsx(S,{text:v(s.input_json),className:"copy-corner",title:"Copy tool input JSON"}),e.jsx("pre",{className:"code",children:v(s.input_json)})]}),s.result_summary&&e.jsx("div",{className:"result",children:s.result_summary}),s.full_result&&e.jsxs("div",{className:"full-result",children:[e.jsxs("button",{type:"button",className:"ghost small show-full","aria-expanded":a,onClick:()=>l(o=>!o),children:[a?"Hide":"Show"," full result (",(s.full_result.bytes/1024).toFixed(1)," KB)"]}),a&&e.jsxs("div",{className:"code-block",children:[e.jsx(S,{text:s.full_result.text,className:"copy-corner",title:"Copy full tool result"}),e.jsx("pre",{className:"code",children:s.full_result.text})]})]})]})]})}function be({plan:s}){return e.jsxs("div",{className:"plan-card",children:[e.jsx("div",{className:"plan-card-head",children:"📋 Approved plan"}),e.jsx(js,{text:s})]})}function ke({t:s}){const[n,t]=d.useState(!1),a=d.useId(),l=he(s.input_json),{answers:i,annotations:r}=pe(s.result_summary);return l.length===0?e.jsx(gs,{t:s}):e.jsxs("div",{className:"qa-card",children:[e.jsxs("div",{className:"qa-card-head",children:["🙋 Question",l.length===1?"":"s"," for the user"]}),l.map((o,c)=>{var w;const u=i[o.question],h=Array.isArray(u)?u:u!=null?[u]:[],f=new Set(h),x=new Set(o.options.map(j=>j.label)),g=h.filter(j=>!x.has(j)),m=(w=r[o.question])==null?void 0:w.notes;return e.jsxs("div",{className:"qa-q",children:[e.jsxs("div",{className:"qa-q-head",children:[o.header&&e.jsx("span",{className:"tag",children:o.header}),o.multiSelect&&e.jsx("span",{className:"muted small",children:"multi-select"})]}),e.jsx("div",{className:"qa-question",children:o.question}),e.jsxs("ul",{className:"qa-options",children:[o.options.map((j,N)=>{const b=f.has(j.label);return e.jsxs("li",{className:"qa-opt"+(b?" is-selected":""),children:[e.jsx("span",{className:"qa-mark","aria-hidden":"true",children:b?"☑":"☐"}),e.jsxs("span",{className:"qa-opt-body",children:[e.jsx("span",{className:"qa-opt-label",children:j.label}),j.description&&e.jsx("span",{className:"qa-opt-desc muted",children:j.description})]})]},N)}),g.map((j,N)=>e.jsxs("li",{className:"qa-opt is-selected",children:[e.jsx("span",{className:"qa-mark","aria-hidden":"true",children:"☑"}),e.jsxs("span",{className:"qa-opt-body",children:[e.jsx("span",{className:"qa-opt-label",children:j}),e.jsx("span",{className:"qa-opt-desc muted",children:"custom answer"})]})]},"c"+N))]}),m&&e.jsxs("div",{className:"qa-note",children:["📝 ",m]})]},c)}),e.jsxs("div",{className:"launch-actions",children:[e.jsx("button",{className:"ghost small","aria-expanded":n,"aria-controls":a,onClick:()=>t(o=>!o),children:n?"Hide raw JSON ▴":"View raw JSON ▾"}),e.jsx(S,{text:v(s.input_json??"{}")+(s.result_summary?`
8
+
9
+ `+v(s.result_summary):""),label:"JSON",title:"Copy raw question JSON"})]}),n&&e.jsxs("pre",{id:a,className:"code",children:[v(s.input_json??"{}"),s.result_summary?`
10
+
11
+ `+v(s.result_summary):""]})]})}function ye({t:s}){const n=s.workflow_name?`Workflow · ${s.workflow_name}`:"Workflow";return e.jsxs("div",{className:"tool launch-tool",children:[e.jsxs("div",{className:"launch-tool-head",children:[e.jsxs("span",{className:"tool-name",children:["🔀 ",n]}),s.status&&e.jsx("span",{className:"tool-status",children:s.status})]}),s.workflow_run_id&&e.jsxs(y,{className:"subagent-link small",to:`/workflow/${s.workflow_run_id}`,children:["🔀 launched ",s.workflow_agent_count??0," agent",s.workflow_agent_count===1?"":"s"," · ",e.jsx("code",{children:s.workflow_run_id})," →"]}),s.result_summary&&e.jsx("div",{className:"result",children:s.result_summary})]})}function ns(s,n,t){let a=n+2,l=!1;for(s[a]==="-"&&(l=!0,a++);s[a]===" "||s[a]===" ";)a++;let i="";(s[a]==="'"||s[a]==='"')&&(i=s[a],a++);let r="";if(i){for(;a<s.length&&s[a]!==i;)r+=s[a++];s[a]===i&&a++}else for(;a<s.length&&/[A-Za-z0-9_]/.test(s[a]);)r+=s[a++];return r&&t.push({delim:r,strip:l}),a-1}function ve(s){const n=s.split(`
12
+ `),t=[];let a="NORMAL",l=0;const i=[];let r=!1;for(const o of n){if(i.length>0){t.push({text:o,cont:!0});const c=i[0];(c.strip?o.replace(/^\t+/,""):o).trimEnd()===c.delim&&i.shift();continue}t.push({text:o,cont:a!=="NORMAL"||l>0||r}),r=!1;for(let c=0;c<o.length;c++){const u=o[c];if(a==="SQUOTE"){u==="'"&&(a="NORMAL");continue}if(a==="DQUOTE"){u==="\\"?c++:u==='"'?a="NORMAL":u==="$"&&o[c+1]==="("?(l++,c++):u===")"?l>0&&l--:u==="<"&&o[c+1]==="<"&&o[c+2]!=="<"&&o[c-1]!=="<"&&(c=ns(o,c,i));continue}if(u==="\\")c++;else if(u==="'")a="SQUOTE";else if(u==='"')a="DQUOTE";else{if(u==="#"&&(c===0||/\s/.test(o[c-1])))break;u==="$"&&o[c+1]==="("?(l++,c++):u==="("?l++:u===")"?l>0&&l--:u==="<"&&o[c+1]==="<"&&o[c+2]!=="<"&&o[c-1]!=="<"&&(c=ns(o,c,i))}}if(a==="NORMAL"&&l===0&&i.length===0){const c=o.replace(/\s+$/,""),u=c.match(/\\+$/);(u&&u[0].length%2===1||/(&&|\|\||\|)$/.test(c))&&(r=!0)}}return t}function Se({t:s,bash:n}){const[t,a]=d.useState(!1),[l,i]=d.useState(!1),[r,o]=d.useState(!1),c=d.useId(),u=d.useId(),h=n.command.split(`
13
+ `)[0],f=ve(n.command);return e.jsxs("div",{className:"tool "+(s.status==="error"?"tool-err":""),children:[e.jsxs("button",{className:"tool-head","aria-expanded":t,"aria-controls":c,onClick:()=>a(x=>!x),children:[e.jsx("span",{className:"tool-name",children:"🖥 Bash"}),n.description?e.jsxs("span",{className:"bash-desc",children:["# ",n.description]}):!t&&e.jsx("span",{className:"bash-preview",children:h}),s.status&&e.jsx("span",{className:"tool-status",children:s.status}),s.total_duration_ms?e.jsx("span",{className:"muted",children:T(s.total_duration_ms)}):null,e.jsx("span",{className:"chev",children:t?"▾":"▸"})]}),t&&e.jsxs("div",{className:"tool-body",id:c,children:[e.jsxs("div",{className:"shell code-block",children:[e.jsx(S,{text:n.command,className:"copy-corner",title:"Copy command"}),e.jsx("pre",{className:"shell-cmd",children:f.map((x,g)=>e.jsxs("span",{children:[e.jsx("span",{className:"shell-gutter"+(x.cont?" cont":""),"aria-hidden":"true",children:x.cont?" ":"$ "}),x.text,g<f.length-1?`
14
+ `:""]},g))})]}),(n.run_in_background||n.restart||n.timeout!=null)&&e.jsxs("div",{className:"bash-badges",children:[n.run_in_background&&e.jsx("span",{className:"bash-badge",children:"background"}),n.restart&&e.jsx("span",{className:"bash-badge",children:"restart"}),n.timeout!=null&&e.jsxs("span",{className:"bash-badge",children:["timeout ",Math.round(n.timeout/1e3),"s"]})]}),s.result_summary&&e.jsx("pre",{className:"shell-out",children:s.result_summary}),s.full_result&&e.jsxs("div",{className:"full-result",children:[e.jsxs("button",{type:"button",className:"ghost small show-full","aria-expanded":l,onClick:()=>i(x=>!x),children:[l?"Hide":"Show"," full result (",(s.full_result.bytes/1024).toFixed(1)," KB)"]}),l&&e.jsxs("div",{className:"code-block",children:[e.jsx(S,{text:s.full_result.text,className:"copy-corner",title:"Copy full tool result"}),e.jsx("pre",{className:"code",children:s.full_result.text})]})]}),e.jsxs("div",{className:"launch-actions",children:[e.jsx("button",{className:"ghost small","aria-expanded":r,"aria-controls":u,onClick:()=>o(x=>!x),children:r?"Hide raw JSON ▴":"View raw JSON ▾"}),e.jsx(S,{text:v(s.input_json??"{}"),label:"JSON",title:"Copy raw tool input JSON"})]}),r&&e.jsx("pre",{id:u,className:"code",children:v(s.input_json??"{}")})]})]})}const Ce={Edit:"✏️",MultiEdit:"✏️",Write:"📄"},B=400;function Te({t:s,edit:n}){const[t,a]=d.useState(!1),[l,i]=d.useState(!1),[r,o]=d.useState(!1),c=d.useId(),u=d.useId(),{dir:h,base:f}=je(n.file_path);return e.jsxs("div",{className:"tool "+(s.status==="error"?"tool-err":""),children:[e.jsxs("button",{className:"tool-head","aria-expanded":t,"aria-controls":c,onClick:()=>a(x=>!x),children:[e.jsxs("span",{className:"tool-name",children:[Ce[n.kind]??"✏️"," ",n.kind]}),e.jsxs("span",{className:"edit-path",children:[e.jsx("span",{className:"base",children:f}),h&&e.jsx("span",{className:"dir",children:h.replace(/\/$/,"")})]}),e.jsxs("span",{className:"diff-stat",children:[n.adds>0&&e.jsxs("span",{className:"add",children:["+",n.adds]}),n.dels>0&&e.jsxs("span",{className:"del",children:["−",n.dels]})]}),s.status&&e.jsx("span",{className:"tool-status",children:s.status}),s.total_duration_ms?e.jsx("span",{className:"muted",children:T(s.total_duration_ms)}):null,e.jsx("span",{className:"chev",children:t?"▾":"▸"})]}),t&&e.jsxs("div",{className:"tool-body",id:c,children:[n.hunks.map((x,g)=>e.jsxs("div",{className:"diff",children:[n.hunks.length>1&&e.jsxs("div",{className:"diff-hunk-sep",children:["edit ",g+1]}),x.slice(0,B).map((m,w)=>e.jsxs("div",{className:"diff-line "+m.type,children:[e.jsx("span",{className:"diff-sign","aria-hidden":"true",children:m.type==="add"?"+":m.type==="del"?"−":" "}),e.jsx("span",{className:"diff-text",children:m.text===""?" ":m.text})]},w)),x.length>B&&e.jsxs("div",{className:"diff-more",children:["… ",x.length-B," more lines — View raw JSON for the rest"]})]},g)),s.result_summary&&e.jsx("pre",{className:"shell-out",children:s.result_summary}),s.full_result&&e.jsxs("div",{className:"full-result",children:[e.jsxs("button",{type:"button",className:"ghost small show-full","aria-expanded":l,onClick:()=>i(x=>!x),children:[l?"Hide":"Show"," full result (",(s.full_result.bytes/1024).toFixed(1)," KB)"]}),l&&e.jsxs("div",{className:"code-block",children:[e.jsx(S,{text:s.full_result.text,className:"copy-corner",title:"Copy full tool result"}),e.jsx("pre",{className:"code",children:s.full_result.text})]})]}),e.jsxs("div",{className:"launch-actions",children:[e.jsx("button",{className:"ghost small","aria-expanded":r,"aria-controls":u,onClick:()=>o(x=>!x),children:r?"Hide raw JSON ▴":"View raw JSON ▾"}),e.jsx(S,{text:v(s.input_json??"{}"),label:"JSON",title:"Copy raw tool input JSON"})]}),r&&e.jsx("pre",{id:u,className:"code",children:v(s.input_json??"{}")})]})]})}function Ie({t:s,hideTools:n}){const t=s.findings??[],a=n&&t.length===0,l=Ee(s,a);return t.length===0?l:e.jsxs(e.Fragment,{children:[l,e.jsx(Xs,{findings:t})]})}function Ee(s,n){if(s.tool_name==="ExitPlanMode"){const t=ds(s.input_json);if(t)return e.jsx(be,{plan:t})}if(s.tool_name==="AskUserQuestion")return e.jsx(ke,{t:s});if(s.tool_name==="Workflow")return e.jsx(ye,{t:s});if(s.tool_name==="Bash"){const t=xe(s.input_json);if(t)return n?null:e.jsx(Se,{t:s,bash:t})}if(s.tool_name==="Edit"||s.tool_name==="MultiEdit"||s.tool_name==="Write"){const t=fe(s.tool_name,s.input_json);if(t)return n?null:e.jsx(Te,{t:s,edit:t})}return n?null:e.jsx(gs,{t:s})}function Oe(s,n){return s.findings&&s.findings.length||s.tool_name==="AskUserQuestion"||s.tool_name==="Workflow"||s.tool_name==="ExitPlanMode"&&ds(s.input_json)?!0:!n}function Ns({e:s}){const[n,t]=d.useState(!1),a=d.useId(),l=d.useContext(xs),i=d.useContext(fs),r=d.useContext(D),o=n||r.activeUuid===s.uuid&&U(s.thinking,r.query),c=s.role||s.type,u=c==="user"?"👤":c==="assistant"?"🤖":"⚙️",h=j=>r.activeUuid===s.uuid&&oe(j,r.query),f=s.toolCalls.filter(j=>Oe(j,l)||h(j));if(!(s.text||s.thinking||f.length))return null;const g=s.text?us(s.text):null,m=s.text&&!g?ms(s.text):null,w=s.text||s.thinking||"";return e.jsxs("div",{id:"ev-"+s.uuid,className:"event ev-"+c+(i===s.uuid?" ev-flagged":""),children:[e.jsxs("div",{className:"ev-meta",children:[e.jsxs("span",{className:"ev-who",children:[u," ",c]}),s.model&&e.jsx("span",{className:"tag",children:qs(s.model)}),s.is_sidechain?e.jsx("span",{className:"tag subagent",children:"subagent"}):null,e.jsx("span",{className:"muted ev-time",children:ts(s.timestamp)}),w&&e.jsx(S,{text:w,className:"ev-copy copy-hover",title:"Copy message"})]}),s.thinking&&e.jsxs("div",{className:"thinking",children:[e.jsxs("button",{className:"thinking-toggle","aria-expanded":o,"aria-controls":a,onClick:()=>t(!o),children:["🧠 thinking ",o?"▾":"▸"]}),o&&e.jsxs("div",{className:"code-block",children:[e.jsx(S,{text:s.thinking,className:"copy-corner",title:"Copy thinking"}),e.jsx("pre",{id:a,className:"thinking-body",children:s.thinking})]})]}),s.text&&(g?e.jsx(Ne,{cmd:g}):m?e.jsx(we,{n:m}):e.jsx(js,{text:s.text,uuid:s.uuid})),f.map((j,N)=>e.jsx(Ie,{t:j,hideTools:l&&!h(j)},N))]})}function Me({turn:s,events:n,matches:t=0,open:a,onToggle:l}){const i=d.useId();return e.jsxs("section",{className:"turn"+(a?" is-open":""),children:[e.jsxs("button",{className:"turn-head","aria-expanded":a,"aria-controls":i,onClick:l,children:[e.jsx("span",{className:"chev turn-chev","aria-hidden":"true",children:a?"▾":"▸"}),e.jsxs("span",{className:"turn-no",children:["turn ",s.seq+1]}),s.prompt_preview?e.jsx("span",{className:"turn-preview",children:ge(s.prompt_preview)}):null,t>0&&e.jsx("span",{className:"turn-matches",title:`${t} message${t===1?"":"s"} match the search`,children:t}),e.jsxs("span",{className:"turn-stats muted",children:[n.length," msg",n.length===1?"":"s",s.duration_ms?" · "+T(s.duration_ms):""]})]}),e.jsx("div",{id:i,className:"turn-body",role:"region","aria-label":`turn ${s.seq+1} messages`,children:a&&n.map(r=>e.jsx(Ns,{e:r},r.uuid))})]})}function Fe(s,n){const t=new Map(n.map(l=>[l.id,l])),a=[];for(const l of s){const i=l.turn_id??null,r=a[a.length-1];r&&r.turnId===i?r.events.push(l):a.push({turnId:i,turn:i?t.get(i)??null:null,events:[l]})}return a}function $e(s){const{data:n,error:t}=As("/sessions/"+s,{reset:!0}),a=d.useMemo(()=>{const l=new Map;for(const i of(n==null?void 0:n.events)??[])for(const r of i.toolCalls)r.tool_name==="Workflow"&&r.id&&r.workflow_run_id&&l.set(r.id,r.workflow_run_id);return l},[n]);return{d:n,error:t,wfMap:a}}const P="al-search";function Re(s,n){d.useEffect(()=>{const t=s.current,a=CSS==null?void 0:CSS.highlights,l=globalThis.Highlight;if(!t||!a||!l)return;const i=n.trim().toLowerCase();let r=0;const o=()=>{var f;if(r=0,a.delete(P),i.length<M)return;const u=[],h=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let x=h.nextNode();x;x=h.nextNode()){const g=(f=x.nodeValue)==null?void 0:f.toLowerCase();if(g)for(let m=g.indexOf(i);m!==-1;m=g.indexOf(i,m+i.length)){const w=new Range;w.setStart(x,m),w.setEnd(x,m+i.length),u.push(w)}}u.length&&a.set(P,new l(...u))};o();const c=new MutationObserver(()=>{r||(r=requestAnimationFrame(o))});return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{c.disconnect(),r&&cancelAnimationFrame(r),a.delete(P)}},[s,n])}function qe(s,n,t,a,l){const[i,r]=d.useState(null);d.useEffect(()=>{var u;const c=n?(u=s==null?void 0:s.find(h=>h.uuid===n))==null?void 0:u.turn_id:null;c&&l(h=>{if(!h.has(c))return h;const f=new Set(h);return f.delete(c),f})},[s,n,t,l]);const o=d.useRef(null);return d.useEffect(()=>{if(!s||!n||!t){o.current=null;return}if(o.current===t)return;const c=document.getElementById("ev-"+n);if(!c)return;o.current=t,c.scrollIntoView({block:"center",behavior:"smooth"}),r(n);const u=window.setTimeout(()=>r(null),3e3);return()=>window.clearTimeout(u)},[s,n,t,a]),i}const H="msgFormat",J="hideTools";function ws(s){const n=Ls(s,null);if(n!=null)return n;try{return localStorage.getItem("agentlens."+s)}catch{return null}}const _s=s=>s==="raw"?"raw":"markdown",bs=s=>s===!0||s===1||s==="1";function Ae(){return _s(ws(H))}function Le(){return bs(ws(J))}function Be(s){as(H,s)}function Pe(s){as(J,s)}async function Ue(){const[s,n]=await Promise.all([G(H),G(J)]);return{...s!=null?{format:_s(s)}:{},...n!=null?{hideTools:bs(n)}:{}}}function Ke(){var z;const{id:s}=Bs(),{hash:n}=Ps(),{d:t,error:a,wfMap:l}=$e(s),[i,r]=d.useState(new Set),[o,c]=d.useState(Ae),[u,h]=d.useState(Le);d.useEffect(()=>r(new Set),[s]),d.useEffect(()=>{Ue().then(p=>{p.format!==void 0&&c(p.format),p.hideTools!==void 0&&h(p.hideTools)})},[]);const f=p=>{c(p),Be(p)},x=()=>h(p=>(Pe(!p),!p)),g=d.useMemo(()=>(t==null?void 0:t.events.filter(p=>p.text||p.thinking||p.toolCalls.length))??[],[t]),{get:m,set:w}=Us(),j=m("q"),N=d.useMemo(()=>le(g),[g]),b=d.useMemo(()=>ie(g,N,j),[g,N,j]),F=((z=/^#ev-(.+)$/.exec(n))==null?void 0:z[1])??null,[I,ks]=Js(n+`
15
+ `+j,{idx:0,seq:0}),C=b.hits[I.idx]??null,ys=(C==null?void 0:C.uuid)??F,vs=C?`q:${j}:${I.idx}:${I.seq}`:n||null,Ss=qe(t==null?void 0:t.events,ys,vs,i,r),E=p=>{b.total&&ks(_=>({idx:(_.idx+p+b.total)%b.total,seq:_.seq+1}))},$=d.useRef({step:E,total:b.total});$.current={step:E,total:b.total};const W=d.useRef(null),K=d.useRef(null);Re(K,j),d.useEffect(()=>{const p=_=>{var Y;if(_.defaultPrevented||_.metaKey||_.ctrlKey||_.altKey)return;const k=_.target,Is=!!k&&(k.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(k.tagName));if(_.key==="/"&&!Is){_.preventDefault(),(Y=W.current)==null||Y.focus();return}const q=document.activeElement,Es=!q||q===document.body||q===document.documentElement;_.key==="Enter"&&Es&&$.current.total&&(_.preventDefault(),$.current.step(_.shiftKey?-1:1))};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[]);const Cs=d.useMemo(()=>({query:j,activeUuid:(C==null?void 0:C.uuid)??null}),[j,C]);if(a)return e.jsx(Ds,{error:a});if(!t)return e.jsx(Hs,{});const V=Fe(g,t.turns),R=V.filter(p=>p.turn).map(p=>p.turnId),Q=R.some(p=>!i.has(p)),Ts=p=>r(_=>{const k=new Set(_);return k.has(p)?k.delete(p):k.add(p),k});return e.jsxs("div",{className:"detail",children:[e.jsx(ne,{d:t}),t.children&&t.children.length>0&&e.jsx(me,{d:t}),e.jsx(te,{search:e.jsx(ue,{query:j,onQuery:p=>w({q:p}),total:b.total,index:I.idx,onPrev:()=>E(-1),onNext:()=>E(1),inputRef:W}),turnCount:R.length,anyOpen:Q,onToggleAll:()=>r(Q?new Set(R):new Set),hideTools:u,onToggleHideTools:x,format:o,onChooseFormat:f}),e.jsx(ps.Provider,{value:l,children:e.jsx(hs.Provider,{value:o,children:e.jsx(xs.Provider,{value:u,children:e.jsx(fs.Provider,{value:Ss,children:e.jsx(D.Provider,{value:Cs,children:e.jsxs("div",{className:"transcript",ref:K,children:[g.length===0&&e.jsx("div",{className:"muted pad",role:"status",children:"This session has no rendered messages."}),V.map((p,_)=>p.turn?e.jsx(Me,{turn:p.turn,events:p.events,matches:b.byTurn.get(p.turnId)??0,open:!i.has(p.turnId),onToggle:()=>Ts(p.turnId)},p.turnId):e.jsx("div",{className:"unturned",children:p.events.map(k=>e.jsx(Ns,{e:k},k.uuid))},"unturned-"+_))]})})})})})})]})}export{Ke as default};
@@ -1 +1 @@
1
- import{y as x,x as j,j as s,A as v,e as f,r as d,L as m,w as c}from"./index-0iQ2t2WR.js";import{M as N,r as p}from"./index-DWa5WNaY.js";function k(e){return!e||e<0?"—":e>=1024?(e/1024).toFixed(1)+" KB":e+" B"}function y(e,l){return`${e.slice(0,8)} · ${c(l)}`}function S(){const{name:e=""}=x(),l=j("/skills/"+encodeURIComponent(e),{reset:!0});return s.jsx(v,{state:l,empty:s.jsx("div",{className:"muted pad",children:"Not found."}),children:t=>s.jsx(b,{data:t})})}function b({data:e}){const{get:l,set:t}=f(),o=l("v"),n=d.useMemo(()=>e.versions.length?e.versions.find(i=>i.id===o)??e.versions[0]:null,[e,o]),a=d.useMemo(()=>n?e.sessions.filter(i=>i.version_id===n.id):[],[e,n]),h=d.useMemo(()=>e.sessions.filter(i=>!i.version_id).length,[e]);function u(i){t({v:i})}return s.jsxs("div",{className:"skill-view",children:[s.jsx(m,{to:"/skills",className:"back",children:"← all skills"}),s.jsxs("header",{className:"skill-head",children:[s.jsxs("h1",{children:["📖 ",e.name]}),s.jsxs("div",{className:"skill-head-meta muted",children:[e.call_count.toLocaleString()," firing",e.call_count===1?"":"s"," ·"," ",e.versions.length," version",e.versions.length===1?"":"s",n!=null&&n.summary?s.jsxs(s.Fragment,{children:[" · ",n.summary]}):null]})]}),e.versions.length===0?s.jsxs("div",{className:"empty",children:["This skill fired ",e.call_count.toLocaleString()," time(s) but no SKILL.md body was captured in the transcripts, so there is no version content to show."]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"skill-version-bar",children:[s.jsxs("label",{className:"ctl",children:["version"," ",s.jsx("select",{"aria-label":"Skill version",value:(n==null?void 0:n.id)??"",onChange:i=>u(i.target.value),children:e.versions.map((i,r)=>s.jsxs("option",{value:i.id,children:[y(i.id,i.last_seen)," · ",i.call_count," fire",i.call_count===1?"":"s",r===0?" (latest)":""]},i.id))})]}),n&&s.jsxs("span",{className:"muted small",children:["first seen ",c(n.first_seen)," · last seen ",c(n.last_seen)," ·"," ",k(n.body_bytes)]})]}),n&&s.jsxs("div",{className:"cards skill-cards",children:[s.jsxs("div",{className:"card skill-body-card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Skill body"}),s.jsxs("span",{className:"card-hint",children:["version ",n.id.slice(0,8)]})]}),s.jsx("div",{className:"md skill-body",children:s.jsx(N,{remarkPlugins:[p],children:n.body})})]}),s.jsxs("div",{className:"card skill-sessions-card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Sessions that fired this version"}),s.jsx("span",{className:"card-hint",children:a.length})]}),a.length===0?s.jsx("div",{className:"empty",children:"No sessions fired this version."}):s.jsxs("table",{className:"sessions",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Session"}),s.jsx("th",{children:"Source"}),s.jsx("th",{children:"Project"}),s.jsx("th",{className:"num",children:"Fires"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:a.map(i=>{var r;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(m,{to:`/session/${i.id}`,className:"title",children:i.title||s.jsx("span",{className:"muted",children:i.id.slice(0,12)})})}),s.jsx("td",{children:i.source_id}),s.jsx("td",{className:"path",children:((r=i.project_path)==null?void 0:r.replace(/^.*\//,""))??"—"}),s.jsx("td",{className:"num",children:i.fire_count}),s.jsx("td",{children:c(i.fired_at)})]},i.id)})})]}),h>0&&s.jsxs("div",{className:"muted small pad",children:[h," firing(s) had no captured body and aren’t attributed to a version."]})]})]})]})]})}export{S as default};
1
+ import{y as x,x as j,j as s,A as v,k as f,r as d,L as m,w as c}from"./index-BEJAVOfs.js";import{M as N,r as p}from"./index-BMr6pgv5.js";function k(e){return!e||e<0?"—":e>=1024?(e/1024).toFixed(1)+" KB":e+" B"}function y(e,l){return`${e.slice(0,8)} · ${c(l)}`}function S(){const{name:e=""}=x(),l=j("/skills/"+encodeURIComponent(e),{reset:!0});return s.jsx(v,{state:l,empty:s.jsx("div",{className:"muted pad",children:"Not found."}),children:t=>s.jsx(b,{data:t})})}function b({data:e}){const{get:l,set:t}=f(),o=l("v"),n=d.useMemo(()=>e.versions.length?e.versions.find(i=>i.id===o)??e.versions[0]:null,[e,o]),a=d.useMemo(()=>n?e.sessions.filter(i=>i.version_id===n.id):[],[e,n]),h=d.useMemo(()=>e.sessions.filter(i=>!i.version_id).length,[e]);function u(i){t({v:i})}return s.jsxs("div",{className:"skill-view",children:[s.jsx(m,{to:"/skills",className:"back",children:"← all skills"}),s.jsxs("header",{className:"skill-head",children:[s.jsxs("h1",{children:["📖 ",e.name]}),s.jsxs("div",{className:"skill-head-meta muted",children:[e.call_count.toLocaleString()," firing",e.call_count===1?"":"s"," ·"," ",e.versions.length," version",e.versions.length===1?"":"s",n!=null&&n.summary?s.jsxs(s.Fragment,{children:[" · ",n.summary]}):null]})]}),e.versions.length===0?s.jsxs("div",{className:"empty",children:["This skill fired ",e.call_count.toLocaleString()," time(s) but no SKILL.md body was captured in the transcripts, so there is no version content to show."]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"skill-version-bar",children:[s.jsxs("label",{className:"ctl",children:["version"," ",s.jsx("select",{"aria-label":"Skill version",value:(n==null?void 0:n.id)??"",onChange:i=>u(i.target.value),children:e.versions.map((i,r)=>s.jsxs("option",{value:i.id,children:[y(i.id,i.last_seen)," · ",i.call_count," fire",i.call_count===1?"":"s",r===0?" (latest)":""]},i.id))})]}),n&&s.jsxs("span",{className:"muted small",children:["first seen ",c(n.first_seen)," · last seen ",c(n.last_seen)," ·"," ",k(n.body_bytes)]})]}),n&&s.jsxs("div",{className:"cards skill-cards",children:[s.jsxs("div",{className:"card skill-body-card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Skill body"}),s.jsxs("span",{className:"card-hint",children:["version ",n.id.slice(0,8)]})]}),s.jsx("div",{className:"md skill-body",children:s.jsx(N,{remarkPlugins:[p],children:n.body})})]}),s.jsxs("div",{className:"card skill-sessions-card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Sessions that fired this version"}),s.jsx("span",{className:"card-hint",children:a.length})]}),a.length===0?s.jsx("div",{className:"empty",children:"No sessions fired this version."}):s.jsxs("table",{className:"sessions",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Session"}),s.jsx("th",{children:"Source"}),s.jsx("th",{children:"Project"}),s.jsx("th",{className:"num",children:"Fires"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:a.map(i=>{var r;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(m,{to:`/session/${i.id}`,className:"title",children:i.title||s.jsx("span",{className:"muted",children:i.id.slice(0,12)})})}),s.jsx("td",{children:i.source_id}),s.jsx("td",{className:"path",children:((r=i.project_path)==null?void 0:r.replace(/^.*\//,""))??"—"}),s.jsx("td",{className:"num",children:i.fire_count}),s.jsx("td",{children:c(i.fired_at)})]},i.id)})})]}),h>0&&s.jsxs("div",{className:"muted small pad",children:[h," firing(s) had no captured body and aren’t attributed to a version."]})]})]})]})]})}export{S as default};
@@ -1 +1 @@
1
- import{e as q,h as v,r as c,B as F,x as C,C as E,j as e,F as R,E as w,m as I,S as d,L as K,w as M,P as D}from"./index-0iQ2t2WR.js";const u=50,$={name:t=>t.name,fired:t=>t.call_count,last_fired:t=>t.last_fired};function Q(){const{params:t,get:r,set:n,pick:f}=q(),k=v("/sources",[]),y=v("/projects",[]),[h,m]=c.useState(r("q")),{sort:a,toggle:i}=F("fired","desc"),[N,j]=c.useState(1),p=f(["source","project","q"]),{data:x,loading:g,error:_}=C("/skills"+(p.toString()?"?"+p:""));function L(s){s.preventDefault(),n({q:h.trim()})}c.useEffect(()=>j(1),[t,a.key,a.dir]);const l=c.useMemo(()=>E(x??[],$[a.key],a.dir),[x,a.key,a.dir]),b=Math.max(1,Math.ceil(l.length/u)),o=Math.min(N,b),P=l.slice((o-1)*u,o*u);return e.jsxs("div",{children:[e.jsx("h1",{className:"sr-only",children:"Skills"}),e.jsxs("div",{className:"filters",children:[e.jsxs("form",{onSubmit:L,className:"search",role:"search",children:[e.jsx("input",{type:"search","aria-label":"Search skills by name and body",placeholder:"Search skill names & bodies…",value:h,onChange:s=>m(s.target.value)}),e.jsx("button",{type:"submit",children:"Search"}),r("q")&&e.jsx("button",{type:"button",className:"ghost",onClick:()=>(m(""),n({q:""})),children:"clear"})]}),e.jsxs("select",{"aria-label":"Filter by source",value:r("source"),onChange:s=>n({source:s.target.value}),children:[e.jsx("option",{value:"",children:"all sources"}),k.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))]}),e.jsx(R,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:r("project"),onChange:s=>n({project:s}),options:[{value:"",label:"all projects"},...y.map(s=>({value:s.id,label:s.path.replace(/^.*\//,"")}))]})]}),e.jsx(w,{error:_}),g?e.jsx(I,{}):l.length===0?e.jsx("div",{className:"muted pad",role:"status",children:"No skills fired match."}):e.jsxs("table",{className:"sessions",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(d,{label:"Skill",sortKey:"name",active:a.key,dir:a.dir,onSort:i,defaultDir:"asc"}),e.jsx(d,{label:"Fired",sortKey:"fired",active:a.key,dir:a.dir,onSort:i,className:"num"}),e.jsx("th",{className:"num",children:"Versions"}),e.jsx("th",{children:"Sources"}),e.jsx(d,{label:"Last fired",sortKey:"last_fired",active:a.key,dir:a.dir,onSort:i})]})}),e.jsx("tbody",{children:P.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(K,{to:`/skill/${encodeURIComponent(s.name)}`,className:"title",children:s.name})}),e.jsx("td",{className:"num",children:s.call_count.toLocaleString()}),e.jsx("td",{className:"num",title:`${s.version_count} distinct captured ${s.version_count===1?"version":"versions"}`,children:s.version_count||e.jsx("span",{className:"muted",children:"—"})}),e.jsx("td",{children:e.jsx("span",{className:"sub",children:s.sources.map(S=>e.jsx("span",{className:"tag",children:S},S))})}),e.jsx("td",{children:M(s.last_fired)})]},s.name))})]}),!g&&l.length>0&&e.jsx(D,{page:o,pages:b,total:l.length,unit:"skills",onPage:j})]})}export{Q as default};
1
+ import{k as q,m as k,r as c,B as F,x as C,C as E,j as e,F as R,E as w,o as I,S as d,L as K,w as M,P as D}from"./index-BEJAVOfs.js";const u=50,$={name:t=>t.name,fired:t=>t.call_count,last_fired:t=>t.last_fired};function Q(){const{params:t,get:r,set:n,pick:v}=q(),f=k("/sources",[]),y=k("/projects",[]),[h,m]=c.useState(r("q")),{sort:a,toggle:i}=F("fired","desc"),[N,j]=c.useState(1),p=v(["source","project","q"]),{data:x,loading:g,error:_}=C("/skills"+(p.toString()?"?"+p:""));function L(s){s.preventDefault(),n({q:h.trim()})}c.useEffect(()=>j(1),[t,a.key,a.dir]);const l=c.useMemo(()=>E(x??[],$[a.key],a.dir),[x,a.key,a.dir]),b=Math.max(1,Math.ceil(l.length/u)),o=Math.min(N,b),P=l.slice((o-1)*u,o*u);return e.jsxs("div",{children:[e.jsx("h1",{className:"sr-only",children:"Skills"}),e.jsxs("div",{className:"filters",children:[e.jsxs("form",{onSubmit:L,className:"search",role:"search",children:[e.jsx("input",{type:"search","aria-label":"Search skills by name and body",placeholder:"Search skill names & bodies…",value:h,onChange:s=>m(s.target.value)}),e.jsx("button",{type:"submit",children:"Search"}),r("q")&&e.jsx("button",{type:"button",className:"ghost",onClick:()=>(m(""),n({q:""})),children:"clear"})]}),e.jsxs("select",{"aria-label":"Filter by source",value:r("source"),onChange:s=>n({source:s.target.value}),children:[e.jsx("option",{value:"",children:"all sources"}),f.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))]}),e.jsx(R,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:r("project"),onChange:s=>n({project:s}),options:[{value:"",label:"all projects"},...y.map(s=>({value:s.id,label:s.path.replace(/^.*\//,"")}))]})]}),e.jsx(w,{error:_}),g?e.jsx(I,{}):l.length===0?e.jsx("div",{className:"muted pad",role:"status",children:"No skills fired match."}):e.jsxs("table",{className:"sessions",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(d,{label:"Skill",sortKey:"name",active:a.key,dir:a.dir,onSort:i,defaultDir:"asc"}),e.jsx(d,{label:"Fired",sortKey:"fired",active:a.key,dir:a.dir,onSort:i,className:"num"}),e.jsx("th",{className:"num",children:"Versions"}),e.jsx("th",{children:"Sources"}),e.jsx(d,{label:"Last fired",sortKey:"last_fired",active:a.key,dir:a.dir,onSort:i})]})}),e.jsx("tbody",{children:P.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(K,{to:`/skill/${encodeURIComponent(s.name)}`,className:"title",children:s.name})}),e.jsx("td",{className:"num",children:s.call_count.toLocaleString()}),e.jsx("td",{className:"num",title:`${s.version_count} distinct captured ${s.version_count===1?"version":"versions"}`,children:s.version_count||e.jsx("span",{className:"muted",children:"—"})}),e.jsx("td",{children:e.jsx("span",{className:"sub",children:s.sources.map(S=>e.jsx("span",{className:"tag",children:S},S))})}),e.jsx("td",{children:M(s.last_fired)})]},s.name))})]}),!g&&l.length>0&&e.jsx(D,{page:o,pages:b,total:l.length,unit:"skills",onPage:j})]})}export{Q as default};
@@ -1 +1 @@
1
- import{j as s,r as C,y as D,x as G,A as K,L as T,s as L,f as W,b as q,c as Y,w as z}from"./index-0iQ2t2WR.js";import{s as E,d as v,l as M,a as H,C as V,p as S,A as Q}from"./jsonish-Bvk9aoZ9.js";import{M as F,r as J}from"./index-DWa5WNaY.js";const N=e=>e===null||typeof e!="object",R=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function A({v:e}){if(e==null)return s.jsx("span",{className:"json-null",children:"—"});const r=typeof e;return r==="boolean"?s.jsx("span",{className:e?"rv-true":"rv-false",children:e?"✓ true":"✗ false"}):r==="number"?s.jsx("span",{className:"json-number",children:String(e)}):s.jsx("span",{className:"rv-str",children:String(e)})}function P({v:e}){return N(e)?s.jsx(A,{v:e}):Array.isArray(e)?e.every(N)?s.jsx("span",{className:"rv-str",children:e.map(String).join(", ")||"—"}):s.jsxs("span",{className:"muted",children:["[",e.length,"]"]}):s.jsx("span",{className:"muted",children:`{${Object.keys(e).length}}`})}function I(e){const r=[],a=new Set;for(const l of e)for(const n of Object.keys(l??{}))a.has(n)||(a.add(n),r.push(n));return r}function U({rows:e}){const r=I(e);return s.jsx("div",{className:"rv-table-wrap",children:s.jsxs("table",{className:"rv-table",children:[s.jsx("thead",{children:s.jsx("tr",{children:r.map(a=>s.jsx("th",{children:a},a))})}),s.jsx("tbody",{children:e.map((a,l)=>s.jsx("tr",{children:r.map(n=>s.jsx("td",{children:s.jsx(P,{v:a[n]})},n))},l))})]})})}function X({obj:e}){const r=Object.entries(e),a=I(r.map(([,l])=>l));return s.jsx("div",{className:"rv-table-wrap",children:s.jsxs("table",{className:"rv-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"key"}),a.map(l=>s.jsx("th",{children:l},l))]})}),s.jsx("tbody",{children:r.map(([l,n])=>s.jsxs("tr",{children:[s.jsx("td",{className:"rv-rowkey",children:l}),a.map(t=>s.jsx("td",{children:s.jsx(P,{v:n[t]})},t))]},l))})]})})}function Z({name:e,value:r,depth:a}){const[l,n]=C.useState(a<1),t=Array.isArray(r)?`[${r.length}]`:`{${Object.keys(r).length}}`;return s.jsxs("div",{className:"rv-section",children:[s.jsxs("button",{className:"rv-sec-head","aria-expanded":l,onClick:()=>n(i=>!i),children:[s.jsx("span",{className:"json-chev","aria-hidden":"true",children:l?"▾":"▸"}),s.jsx("span",{className:"rv-sec-name",children:e}),s.jsx("span",{className:"muted small",children:t})]}),l&&s.jsx("div",{className:"rv-sec-body",children:s.jsx(B,{value:r,depth:a+1})})]})}function B({value:e,depth:r=0}){if(N(e))return s.jsx(A,{v:e});if(Array.isArray(e))return e.length===0?s.jsx("span",{className:"muted",children:"empty"}):e.every(R)?s.jsx(U,{rows:e}):s.jsx("ul",{className:"rv-list",children:e.map((t,i)=>s.jsx("li",{children:s.jsx(P,{v:t})},i))});const a=Object.entries(e);if(a.length===0)return s.jsx("span",{className:"muted",children:"empty"});if(a.every(([,t])=>R(t)))return s.jsx(X,{obj:e});const l=a.filter(([,t])=>N(t)),n=a.filter(([,t])=>!N(t));return s.jsxs("div",{className:"rv-obj",children:[l.length>0&&s.jsx("div",{className:"rv-metrics",children:l.map(([t,i])=>s.jsxs("div",{className:"rv-metric",children:[s.jsx("span",{className:"rv-mkey",children:t}),s.jsx("span",{className:"rv-mval",children:s.jsx(A,{v:i})})]},t))}),n.map(([t,i])=>s.jsx(Z,{name:t,value:i,depth:r},t))]})}function k({value:e}){return s.jsx("div",{className:"rv-root",children:s.jsx(B,{value:e,depth:0})})}const f=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),_=e=>e===null||typeof e!="object",ss=new Set(["script","scriptPath","description"]),es=["skill","name","id","title"];function as({v:e}){return e==null?s.jsx("span",{className:"muted",children:"—"}):typeof e=="string"?s.jsx("span",{className:"launch-text",children:e}):_(e)?s.jsx("span",{className:"json-number",children:String(e)}):Array.isArray(e)?e.every(_)?s.jsx("ol",{className:"launch-list",children:e.map((r,a)=>s.jsx("li",{children:r===null?"—":String(r)},a))}):s.jsx(k,{value:e}):s.jsx(k,{value:e})}function ns({rec:e,index:r}){const a=es.find(t=>typeof e[t]=="string"),l=a?String(e[a]):`task ${r+1}`,n=Object.entries(e).filter(([t])=>t!==a);return s.jsxs("div",{className:"launch-card",children:[s.jsxs("div",{className:"launch-card-head",children:[s.jsx("span",{className:"launch-card-idx",children:r+1}),s.jsx("span",{className:"launch-card-title",children:l})]}),s.jsx("dl",{className:"launch-fields",children:n.map(([t,i])=>s.jsxs("div",{className:"launch-field",children:[s.jsx("dt",{children:t}),s.jsx("dd",{children:s.jsx(as,{v:i})})]},t))})]})}function $({raw:e}){const[r,a]=C.useState(!1),{body:l,note:n}=E(v(e)),{value:t,repaired:i}=M(l);if(t===void 0)return s.jsx("div",{className:"launch",children:s.jsx("pre",{className:"code",children:e})});const d=H(t),x=f(d)?Object.entries(d):[["",d]],y=x.filter(([o,c])=>_(c)&&o!=="script"),g=x.filter(([,o])=>!_(o)),h=f(d)&&typeof d.script=="string"?d.script:null,u=f(d)&&typeof d.scriptPath=="string"?d.scriptPath:null,m=f(d)&&typeof d.description=="string"?d.description:null,p=y.filter(([o])=>!ss.has(o)),w=m||u||h||p.length>0,b=o=>Array.isArray(o)&&o.length>0&&o.every(f);return s.jsxs("div",{className:"launch",children:[w&&s.jsxs("div",{className:"launch-meta",children:[m&&s.jsx("div",{className:"launch-desc",children:m}),u&&s.jsxs("div",{className:"launch-metaline",children:[s.jsx("span",{className:"muted",children:"script"})," ",s.jsx("code",{children:u})]}),p.map(([o,c])=>s.jsxs("div",{className:"launch-metaline",children:[s.jsx("span",{className:"muted",children:o})," ",s.jsx("code",{children:String(c)})]},o)),h&&s.jsxs("details",{className:"launch-src",children:[s.jsxs("summary",{children:["script source · ",h.length.toLocaleString()," chars"]}),s.jsx("pre",{className:"code",children:h})]})]}),g.map(([o,c])=>b(c)?s.jsxs("div",{className:"launch-tasks",children:[s.jsxs("div",{className:"launch-tasks-head",children:[c.length," ",o||(c.length===1?"task":"tasks")," ",s.jsx("span",{className:"muted",children:"launched"})]}),c.map((j,O)=>s.jsx(ns,{rec:j,index:O},O))]},o||"tasks"):s.jsxs("div",{className:"launch-section",children:[o&&s.jsx("div",{className:"launch-tasks-head",children:o}),s.jsx(k,{value:c})]},o||"value")),(n||i)&&s.jsxs("div",{className:"muted small wf-trunc",children:["⚠ ",n??"Payload was truncated; showing the recoverable portion."]}),s.jsxs("div",{className:"launch-actions",children:[s.jsx("button",{type:"button",className:"ghost small","aria-expanded":r,onClick:()=>a(o=>!o),children:r?"Hide raw JSON ▴":"View raw JSON ▾"}),s.jsx(V,{text:S(l),label:"JSON",title:"Copy raw launch JSON"})]}),r&&s.jsx("pre",{className:"code launch-raw",children:S(l)})]})}function ts({raw:e}){const{body:r,note:a}=E(v(e)),l=/^\s*[[{]/.test(r),{value:n,repaired:t}=l?M(r):{value:void 0,repaired:!1},i=n!==void 0;return s.jsxs(s.Fragment,{children:[i?s.jsx("div",{className:"wf-result-body",children:s.jsx(k,{value:n})}):s.jsx("div",{className:"text md wf-result-body",children:s.jsx(F,{remarkPlugins:[J],children:r})}),(a||t)&&s.jsxs("div",{className:"muted small wf-trunc",children:["⚠ ",a??"Result was truncated; showing the recoverable portion."]}),s.jsx("div",{className:"launch-actions",children:s.jsx(V,{text:i?S(r):r,label:"result",title:"Copy the returned result"})})]})}function rs(e,r){if(e&&e.length){const a=new Map,l=(n,t)=>{let i=a.get(n);return i?t&&(i.title=t):(i={title:t||`Phase ${n}`,agentCount:0,models:[]},a.set(n,i)),i};for(const n of e)n.type==="workflow_phase"&&l(n.index,n.title);for(const n of e)if(n.type==="workflow_agent"&&n.phaseIndex!=null){const t=l(n.phaseIndex,n.phaseTitle);t.agentCount++,n.model&&!t.models.includes(n.model)&&t.models.push(n.model)}if(a.size)return[...a.keys()].sort((n,t)=>n-t).map(n=>a.get(n))}return r.map(a=>({title:a,agentCount:0,models:[]}))}function ds(){const{run_id:e}=D(),r=G("/workflows/"+e,{reset:!0});return s.jsx(K,{state:r,children:a=>s.jsx(ls,{d:a})})}function ls({d:e}){var x,y,g,h,u,m,p,w,b,o;const r=(e.status??"").toLowerCase(),a=((x=e.run)==null?void 0:x.agent_count)??e.stats.agent_count,l=((y=e.run)==null?void 0:y.total_tokens)??e.stats.total_tokens,n=((g=e.run)==null?void 0:g.duration_ms)??e.stats.duration_ms,t=(((h=e.run)==null?void 0:h.phases)??[]).map(c=>c==null?void 0:c.title).filter(c=>!!c),i=rs((u=e.run)==null?void 0:u.progress,t),d=((m=e.run)==null?void 0:m.logs)??[];return s.jsxs("div",{className:"detail",children:[s.jsxs("div",{className:"detail-head",children:[s.jsx(T,{to:"/",className:"back",children:"← all sessions"}),s.jsxs("h1",{children:["🔀 ",e.name||"workflow"]}),s.jsxs("div",{className:"detail-meta",children:[s.jsx("code",{children:e.run_id}),e.status&&s.jsx("span",{className:"tag task-status task-status-"+r,children:e.status}),((p=e.run)==null?void 0:p.default_model)&&s.jsx("span",{className:"tag",children:L(e.run.default_model)}),((w=e.parent)==null?void 0:w.id)&&s.jsxs("span",{className:"spawned-by",children:["↖ launched from"," ",s.jsx(T,{to:`/session/${e.parent.id}`,children:e.parent.title||e.parent.id.slice(0,12)}),e.parent.turn_seq!=null?` · turn ${e.parent.turn_seq+1}`:""]}),s.jsxs("span",{children:[a," agent",a===1?"":"s"]}),s.jsxs("span",{children:[W(l)," tok"]}),((b=e.run)==null?void 0:b.total_tool_calls)!=null&&s.jsxs("span",{children:[e.run.total_tool_calls," tool calls"]}),s.jsx("span",{title:"Estimated from ingested agent transcripts at API list prices (cache-aware)",children:q(e.stats.total_cost)}),s.jsx("span",{children:Y(n)}),s.jsx("span",{className:"muted",children:z(((o=e.run)==null?void 0:o.started_at)??e.stats.started_at)})]}),i.length>0&&s.jsx("div",{className:"wf-phases","aria-label":"workflow phases",children:i.map((c,j)=>s.jsxs(C.Fragment,{children:[j>0&&s.jsx("span",{className:"wf-phase-arrow","aria-hidden":"true",children:"→"}),s.jsxs("div",{className:"wf-phase-chip",children:[s.jsx("span",{className:"wf-phase-title",children:c.title}),c.agentCount>0&&s.jsxs("span",{className:"wf-phase-desc",children:[c.agentCount," agent",c.agentCount===1?"":"s",c.models.length?` · ${c.models.map(L).join(", ")}`:""]})]})]},j))})]}),e.completion&&s.jsxs("div",{className:"wf-result",children:[s.jsxs("h2",{children:["Returned result",e.completion.status&&s.jsx("span",{className:"tag task-status task-status-"+e.completion.status.toLowerCase(),children:e.completion.status})]}),e.completion.summary&&s.jsx("p",{className:"wf-result-summary",children:v(e.completion.summary)}),e.completion.result?s.jsx(ts,{raw:e.completion.result}):s.jsx("div",{className:"muted small",children:"Completed with no returned payload."}),e.completion.failures&&s.jsxs("details",{className:"wf-failures",children:[s.jsx("summary",{children:"failures"}),s.jsx("pre",{className:"code wf-result-body",children:v(e.completion.failures)})]})]}),d.length>0&&s.jsxs("details",{className:"wf-logs",open:d.length<=20,children:[s.jsxs("summary",{children:["Run log · ",d.length," line",d.length===1?"":"s"]}),s.jsx("ul",{className:"wf-log-list",children:d.map((c,j)=>s.jsx("li",{children:c},j))})]}),e.input_json?s.jsx("div",{className:"wf-result wf-launch",children:e.completion?s.jsxs("details",{children:[s.jsx("summary",{children:s.jsx("h2",{children:"Launch payload"})}),s.jsx($,{raw:e.input_json})]}):s.jsxs(s.Fragment,{children:[s.jsx("h2",{children:"Launch payload"}),r==="async_launched"&&s.jsx("p",{className:"wf-result-summary muted",children:"Launched asynchronously — results will appear here once the run reports back."}),s.jsx($,{raw:e.input_json})]})}):!e.completion&&e.result_summary?s.jsxs("div",{className:"wf-result",children:[s.jsx("h2",{children:"Workflow launch"}),s.jsx("div",{className:"text md",children:s.jsx(F,{remarkPlugins:[J],children:e.result_summary})})]}):null,s.jsxs("div",{className:"subagents",children:[s.jsxs("h2",{children:["Agents (",e.agents.length,")"]}),e.agents.length===0?s.jsx("div",{className:"muted pad",role:"status",children:"No agent transcripts ingested for this run yet."}):s.jsx("ul",{children:e.agents.map(c=>s.jsx(Q,{a:c},c.id))})]})]})}export{ds as default};
1
+ import{j as s,r as C,y as D,x as G,A as K,L as T,s as L,f as W,b as q,c as Y,w as z}from"./index-BEJAVOfs.js";import{s as E,d as v,l as M,a as H,C as V,p as S,A as Q}from"./jsonish-BeRl_b24.js";import{M as F,r as J}from"./index-BMr6pgv5.js";const N=e=>e===null||typeof e!="object",R=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function A({v:e}){if(e==null)return s.jsx("span",{className:"json-null",children:"—"});const r=typeof e;return r==="boolean"?s.jsx("span",{className:e?"rv-true":"rv-false",children:e?"✓ true":"✗ false"}):r==="number"?s.jsx("span",{className:"json-number",children:String(e)}):s.jsx("span",{className:"rv-str",children:String(e)})}function P({v:e}){return N(e)?s.jsx(A,{v:e}):Array.isArray(e)?e.every(N)?s.jsx("span",{className:"rv-str",children:e.map(String).join(", ")||"—"}):s.jsxs("span",{className:"muted",children:["[",e.length,"]"]}):s.jsx("span",{className:"muted",children:`{${Object.keys(e).length}}`})}function I(e){const r=[],a=new Set;for(const l of e)for(const n of Object.keys(l??{}))a.has(n)||(a.add(n),r.push(n));return r}function U({rows:e}){const r=I(e);return s.jsx("div",{className:"rv-table-wrap",children:s.jsxs("table",{className:"rv-table",children:[s.jsx("thead",{children:s.jsx("tr",{children:r.map(a=>s.jsx("th",{children:a},a))})}),s.jsx("tbody",{children:e.map((a,l)=>s.jsx("tr",{children:r.map(n=>s.jsx("td",{children:s.jsx(P,{v:a[n]})},n))},l))})]})})}function X({obj:e}){const r=Object.entries(e),a=I(r.map(([,l])=>l));return s.jsx("div",{className:"rv-table-wrap",children:s.jsxs("table",{className:"rv-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"key"}),a.map(l=>s.jsx("th",{children:l},l))]})}),s.jsx("tbody",{children:r.map(([l,n])=>s.jsxs("tr",{children:[s.jsx("td",{className:"rv-rowkey",children:l}),a.map(t=>s.jsx("td",{children:s.jsx(P,{v:n[t]})},t))]},l))})]})})}function Z({name:e,value:r,depth:a}){const[l,n]=C.useState(a<1),t=Array.isArray(r)?`[${r.length}]`:`{${Object.keys(r).length}}`;return s.jsxs("div",{className:"rv-section",children:[s.jsxs("button",{className:"rv-sec-head","aria-expanded":l,onClick:()=>n(i=>!i),children:[s.jsx("span",{className:"json-chev","aria-hidden":"true",children:l?"▾":"▸"}),s.jsx("span",{className:"rv-sec-name",children:e}),s.jsx("span",{className:"muted small",children:t})]}),l&&s.jsx("div",{className:"rv-sec-body",children:s.jsx(B,{value:r,depth:a+1})})]})}function B({value:e,depth:r=0}){if(N(e))return s.jsx(A,{v:e});if(Array.isArray(e))return e.length===0?s.jsx("span",{className:"muted",children:"empty"}):e.every(R)?s.jsx(U,{rows:e}):s.jsx("ul",{className:"rv-list",children:e.map((t,i)=>s.jsx("li",{children:s.jsx(P,{v:t})},i))});const a=Object.entries(e);if(a.length===0)return s.jsx("span",{className:"muted",children:"empty"});if(a.every(([,t])=>R(t)))return s.jsx(X,{obj:e});const l=a.filter(([,t])=>N(t)),n=a.filter(([,t])=>!N(t));return s.jsxs("div",{className:"rv-obj",children:[l.length>0&&s.jsx("div",{className:"rv-metrics",children:l.map(([t,i])=>s.jsxs("div",{className:"rv-metric",children:[s.jsx("span",{className:"rv-mkey",children:t}),s.jsx("span",{className:"rv-mval",children:s.jsx(A,{v:i})})]},t))}),n.map(([t,i])=>s.jsx(Z,{name:t,value:i,depth:r},t))]})}function k({value:e}){return s.jsx("div",{className:"rv-root",children:s.jsx(B,{value:e,depth:0})})}const f=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),_=e=>e===null||typeof e!="object",ss=new Set(["script","scriptPath","description"]),es=["skill","name","id","title"];function as({v:e}){return e==null?s.jsx("span",{className:"muted",children:"—"}):typeof e=="string"?s.jsx("span",{className:"launch-text",children:e}):_(e)?s.jsx("span",{className:"json-number",children:String(e)}):Array.isArray(e)?e.every(_)?s.jsx("ol",{className:"launch-list",children:e.map((r,a)=>s.jsx("li",{children:r===null?"—":String(r)},a))}):s.jsx(k,{value:e}):s.jsx(k,{value:e})}function ns({rec:e,index:r}){const a=es.find(t=>typeof e[t]=="string"),l=a?String(e[a]):`task ${r+1}`,n=Object.entries(e).filter(([t])=>t!==a);return s.jsxs("div",{className:"launch-card",children:[s.jsxs("div",{className:"launch-card-head",children:[s.jsx("span",{className:"launch-card-idx",children:r+1}),s.jsx("span",{className:"launch-card-title",children:l})]}),s.jsx("dl",{className:"launch-fields",children:n.map(([t,i])=>s.jsxs("div",{className:"launch-field",children:[s.jsx("dt",{children:t}),s.jsx("dd",{children:s.jsx(as,{v:i})})]},t))})]})}function $({raw:e}){const[r,a]=C.useState(!1),{body:l,note:n}=E(v(e)),{value:t,repaired:i}=M(l);if(t===void 0)return s.jsx("div",{className:"launch",children:s.jsx("pre",{className:"code",children:e})});const d=H(t),x=f(d)?Object.entries(d):[["",d]],y=x.filter(([o,c])=>_(c)&&o!=="script"),g=x.filter(([,o])=>!_(o)),h=f(d)&&typeof d.script=="string"?d.script:null,u=f(d)&&typeof d.scriptPath=="string"?d.scriptPath:null,m=f(d)&&typeof d.description=="string"?d.description:null,p=y.filter(([o])=>!ss.has(o)),w=m||u||h||p.length>0,b=o=>Array.isArray(o)&&o.length>0&&o.every(f);return s.jsxs("div",{className:"launch",children:[w&&s.jsxs("div",{className:"launch-meta",children:[m&&s.jsx("div",{className:"launch-desc",children:m}),u&&s.jsxs("div",{className:"launch-metaline",children:[s.jsx("span",{className:"muted",children:"script"})," ",s.jsx("code",{children:u})]}),p.map(([o,c])=>s.jsxs("div",{className:"launch-metaline",children:[s.jsx("span",{className:"muted",children:o})," ",s.jsx("code",{children:String(c)})]},o)),h&&s.jsxs("details",{className:"launch-src",children:[s.jsxs("summary",{children:["script source · ",h.length.toLocaleString()," chars"]}),s.jsx("pre",{className:"code",children:h})]})]}),g.map(([o,c])=>b(c)?s.jsxs("div",{className:"launch-tasks",children:[s.jsxs("div",{className:"launch-tasks-head",children:[c.length," ",o||(c.length===1?"task":"tasks")," ",s.jsx("span",{className:"muted",children:"launched"})]}),c.map((j,O)=>s.jsx(ns,{rec:j,index:O},O))]},o||"tasks"):s.jsxs("div",{className:"launch-section",children:[o&&s.jsx("div",{className:"launch-tasks-head",children:o}),s.jsx(k,{value:c})]},o||"value")),(n||i)&&s.jsxs("div",{className:"muted small wf-trunc",children:["⚠ ",n??"Payload was truncated; showing the recoverable portion."]}),s.jsxs("div",{className:"launch-actions",children:[s.jsx("button",{type:"button",className:"ghost small","aria-expanded":r,onClick:()=>a(o=>!o),children:r?"Hide raw JSON ▴":"View raw JSON ▾"}),s.jsx(V,{text:S(l),label:"JSON",title:"Copy raw launch JSON"})]}),r&&s.jsx("pre",{className:"code launch-raw",children:S(l)})]})}function ts({raw:e}){const{body:r,note:a}=E(v(e)),l=/^\s*[[{]/.test(r),{value:n,repaired:t}=l?M(r):{value:void 0,repaired:!1},i=n!==void 0;return s.jsxs(s.Fragment,{children:[i?s.jsx("div",{className:"wf-result-body",children:s.jsx(k,{value:n})}):s.jsx("div",{className:"text md wf-result-body",children:s.jsx(F,{remarkPlugins:[J],children:r})}),(a||t)&&s.jsxs("div",{className:"muted small wf-trunc",children:["⚠ ",a??"Result was truncated; showing the recoverable portion."]}),s.jsx("div",{className:"launch-actions",children:s.jsx(V,{text:i?S(r):r,label:"result",title:"Copy the returned result"})})]})}function rs(e,r){if(e&&e.length){const a=new Map,l=(n,t)=>{let i=a.get(n);return i?t&&(i.title=t):(i={title:t||`Phase ${n}`,agentCount:0,models:[]},a.set(n,i)),i};for(const n of e)n.type==="workflow_phase"&&l(n.index,n.title);for(const n of e)if(n.type==="workflow_agent"&&n.phaseIndex!=null){const t=l(n.phaseIndex,n.phaseTitle);t.agentCount++,n.model&&!t.models.includes(n.model)&&t.models.push(n.model)}if(a.size)return[...a.keys()].sort((n,t)=>n-t).map(n=>a.get(n))}return r.map(a=>({title:a,agentCount:0,models:[]}))}function ds(){const{run_id:e}=D(),r=G("/workflows/"+e,{reset:!0});return s.jsx(K,{state:r,children:a=>s.jsx(ls,{d:a})})}function ls({d:e}){var x,y,g,h,u,m,p,w,b,o;const r=(e.status??"").toLowerCase(),a=((x=e.run)==null?void 0:x.agent_count)??e.stats.agent_count,l=((y=e.run)==null?void 0:y.total_tokens)??e.stats.total_tokens,n=((g=e.run)==null?void 0:g.duration_ms)??e.stats.duration_ms,t=(((h=e.run)==null?void 0:h.phases)??[]).map(c=>c==null?void 0:c.title).filter(c=>!!c),i=rs((u=e.run)==null?void 0:u.progress,t),d=((m=e.run)==null?void 0:m.logs)??[];return s.jsxs("div",{className:"detail",children:[s.jsxs("div",{className:"detail-head",children:[s.jsx(T,{to:"/",className:"back",children:"← all sessions"}),s.jsxs("h1",{children:["🔀 ",e.name||"workflow"]}),s.jsxs("div",{className:"detail-meta",children:[s.jsx("code",{children:e.run_id}),e.status&&s.jsx("span",{className:"tag task-status task-status-"+r,children:e.status}),((p=e.run)==null?void 0:p.default_model)&&s.jsx("span",{className:"tag",children:L(e.run.default_model)}),((w=e.parent)==null?void 0:w.id)&&s.jsxs("span",{className:"spawned-by",children:["↖ launched from"," ",s.jsx(T,{to:`/session/${e.parent.id}`,children:e.parent.title||e.parent.id.slice(0,12)}),e.parent.turn_seq!=null?` · turn ${e.parent.turn_seq+1}`:""]}),s.jsxs("span",{children:[a," agent",a===1?"":"s"]}),s.jsxs("span",{children:[W(l)," tok"]}),((b=e.run)==null?void 0:b.total_tool_calls)!=null&&s.jsxs("span",{children:[e.run.total_tool_calls," tool calls"]}),s.jsx("span",{title:"Estimated from ingested agent transcripts at API list prices (cache-aware)",children:q(e.stats.total_cost)}),s.jsx("span",{children:Y(n)}),s.jsx("span",{className:"muted",children:z(((o=e.run)==null?void 0:o.started_at)??e.stats.started_at)})]}),i.length>0&&s.jsx("div",{className:"wf-phases","aria-label":"workflow phases",children:i.map((c,j)=>s.jsxs(C.Fragment,{children:[j>0&&s.jsx("span",{className:"wf-phase-arrow","aria-hidden":"true",children:"→"}),s.jsxs("div",{className:"wf-phase-chip",children:[s.jsx("span",{className:"wf-phase-title",children:c.title}),c.agentCount>0&&s.jsxs("span",{className:"wf-phase-desc",children:[c.agentCount," agent",c.agentCount===1?"":"s",c.models.length?` · ${c.models.map(L).join(", ")}`:""]})]})]},j))})]}),e.completion&&s.jsxs("div",{className:"wf-result",children:[s.jsxs("h2",{children:["Returned result",e.completion.status&&s.jsx("span",{className:"tag task-status task-status-"+e.completion.status.toLowerCase(),children:e.completion.status})]}),e.completion.summary&&s.jsx("p",{className:"wf-result-summary",children:v(e.completion.summary)}),e.completion.result?s.jsx(ts,{raw:e.completion.result}):s.jsx("div",{className:"muted small",children:"Completed with no returned payload."}),e.completion.failures&&s.jsxs("details",{className:"wf-failures",children:[s.jsx("summary",{children:"failures"}),s.jsx("pre",{className:"code wf-result-body",children:v(e.completion.failures)})]})]}),d.length>0&&s.jsxs("details",{className:"wf-logs",open:d.length<=20,children:[s.jsxs("summary",{children:["Run log · ",d.length," line",d.length===1?"":"s"]}),s.jsx("ul",{className:"wf-log-list",children:d.map((c,j)=>s.jsx("li",{children:c},j))})]}),e.input_json?s.jsx("div",{className:"wf-result wf-launch",children:e.completion?s.jsxs("details",{children:[s.jsx("summary",{children:s.jsx("h2",{children:"Launch payload"})}),s.jsx($,{raw:e.input_json})]}):s.jsxs(s.Fragment,{children:[s.jsx("h2",{children:"Launch payload"}),r==="async_launched"&&s.jsx("p",{className:"wf-result-summary muted",children:"Launched asynchronously — results will appear here once the run reports back."}),s.jsx($,{raw:e.input_json})]})}):!e.completion&&e.result_summary?s.jsxs("div",{className:"wf-result",children:[s.jsx("h2",{children:"Workflow launch"}),s.jsx("div",{className:"text md",children:s.jsx(F,{remarkPlugins:[J],children:e.result_summary})})]}):null,s.jsxs("div",{className:"subagents",children:[s.jsxs("h2",{children:["Agents (",e.agents.length,")"]}),e.agents.length===0?s.jsx("div",{className:"muted pad",role:"status",children:"No agent transcripts ingested for this run yet."}):s.jsx("ul",{children:e.agents.map(c=>s.jsx(Q,{a:c},c.id))})]})]})}export{ds as default};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SessionView-C3NBGoRm.js","assets/severity-FT-qpBVJ.js","assets/jsonish-Bvk9aoZ9.js","assets/index-DWa5WNaY.js","assets/WorkflowView-BohpjfRN.js","assets/SkillView-ChrzRaaf.js","assets/FileView-0gYNqeF8.js","assets/FilesView-CMwzNpYU.js","assets/SecurityView-B8QFRIOR.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SessionView-DFI1i_1s.js","assets/useResetOn-Qq0cEkL8.js","assets/jsonish-BeRl_b24.js","assets/index-BMr6pgv5.js","assets/WorkflowView-Bo9vuO3E.js","assets/SkillView-B4VQa9NY.js","assets/FileView-BGx2Tgs3.js","assets/FilesView-BkE8JdcH.js","assets/SecurityView-COYAu9X3.js"])))=>i.map(i=>d[i]);
2
2
  function Xd(o,a){for(var s=0;s<a.length;s++){const f=a[s];if(typeof f!="string"&&!Array.isArray(f)){for(const d in f)if(d!=="default"&&!(d in o)){const m=Object.getOwnPropertyDescriptor(f,d);m&&Object.defineProperty(o,d,m.get?m:{enumerable:!0,get:()=>f[d]})}}}return Object.freeze(Object.defineProperty(o,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"]'))f(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"&&f(g)}).observe(document,{childList:!0,subtree:!0});function s(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 f(d){if(d.ep)return;d.ep=!0;const m=s(d);fetch(d.href,m)}})();const Jd="modulepreload",Zd=function(o){return"/"+o},uc={},zt=function(a,s,f){let d=Promise.resolve();if(s&&s.length>0){let g=function(_){return Promise.all(_.map(T=>Promise.resolve(T).then(P=>({status:"fulfilled",value:P}),P=>({status:"rejected",reason:P}))))};document.getElementsByTagName("link");const x=document.querySelector("meta[property=csp-nonce]"),E=(x==null?void 0:x.nonce)||(x==null?void 0:x.getAttribute("nonce"));d=g(s.map(_=>{if(_=Zd(_),_ in uc)return;uc[_]=!0;const T=_.endsWith(".css"),P=T?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${_}"]${P}`))return;const D=document.createElement("link");if(D.rel=T?"stylesheet":Jd,T||(D.as="script"),D.crossOrigin="",D.href=_,E&&D.setAttribute("nonce",E),document.head.appendChild(D),T)return new Promise((Z,G)=>{D.addEventListener("load",Z),D.addEventListener("error",()=>G(new Error(`Unable to preload CSS for ${_}`)))})}))}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 tm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qd(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Xo={exports:{}},Lr={},Jo={exports:{}},ee={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -66,4 +66,4 @@ Error generating stack: `+i.message+`
66
66
  *
67
67
  * @license MIT
68
68
  */function Xl(){return Xl=Object.assign?Object.assign.bind():function(o){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var f in s)({}).hasOwnProperty.call(s,f)&&(o[f]=s[f])}return o},Xl.apply(null,arguments)}function Vc(o,a){if(o==null)return{};var s={};for(var f in o)if({}.hasOwnProperty.call(o,f)){if(a.indexOf(f)!==-1)continue;s[f]=o[f]}return s}function th(o){return!!(o.metaKey||o.altKey||o.ctrlKey||o.shiftKey)}function nh(o,a){return o.button===0&&(!a||a==="_self")&&!th(o)}function ou(o){return o===void 0&&(o=""),new URLSearchParams(typeof o=="string"||Array.isArray(o)||o instanceof URLSearchParams?o:Object.keys(o).reduce((a,s)=>{let f=o[s];return a.concat(Array.isArray(f)?f.map(d=>[s,d]):[[s,f]])},[]))}function rh(o,a){let s=ou(o);return a&&a.forEach((f,d)=>{s.has(d)||a.getAll(d).forEach(m=>{s.append(d,m)})}),s}const lh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ih=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],oh="6";try{window.__reactRouterVersion=oh}catch{}const uh=C.createContext({isTransitioning:!1}),sh="startTransition",Ec=np[sh];function ah(o){let{basename:a,children:s,future:f,window:d}=o,m=C.useRef();m.current==null&&(m.current=sp({window:d,v5Compat:!0}));let g=m.current,[x,E]=C.useState({action:g.action,location:g.location}),{v7_startTransition:_}=f||{},T=C.useCallback(P=>{_&&Ec?Ec(()=>E(P)):E(P)},[E,_]);return C.useLayoutEffect(()=>g.listen(T),[g,T]),C.useEffect(()=>Zp(f),[f]),C.createElement(bp,{basename:a,children:s,location:x.location,navigationType:x.action,navigator:g,future:f})}const ch=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",fh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jl=C.forwardRef(function(a,s){let{onClick:f,relative:d,reloadDocument:m,replace:g,state:x,target:E,to:_,preventScrollReset:T,viewTransition:P}=a,D=Vc(a,lh),{basename:Z}=C.useContext(tn),G,W=!1;if(typeof _=="string"&&fh.test(_)&&(G=_,ch))try{let I=new URL(window.location.href),Q=_.startsWith("//")?new URL(I.protocol+_):new URL(_),ae=Wn(Q.pathname,Z);Q.origin===I.origin&&ae!=null?_=ae+Q.search+Q.hash:W=!0}catch{}let N=Ip(_,{relative:d}),ne=ph(_,{replace:g,state:x,target:E,preventScrollReset:T,relative:d,viewTransition:P});function q(I){f&&f(I),I.defaultPrevented||ne(I)}return C.createElement("a",Xl({},D,{href:G||N,onClick:W||m?f:q,ref:s,target:E}))}),Tr=C.forwardRef(function(a,s){let{"aria-current":f="page",caseSensitive:d=!1,className:m="",end:g=!1,style:x,to:E,viewTransition:_,children:T}=a,P=Vc(a,ih),D=bl(E,{relative:P.relative}),Z=gn(),G=C.useContext(Ic),{navigator:W,basename:N}=C.useContext(tn),ne=G!=null&&mh(D)&&_===!0,q=W.encodeLocation?W.encodeLocation(D).pathname:D.pathname,I=Z.pathname,Q=G&&G.navigation&&G.navigation.location?G.navigation.location.pathname:null;d||(I=I.toLowerCase(),Q=Q?Q.toLowerCase():null,q=q.toLowerCase()),Q&&N&&(Q=Wn(Q,N)||Q);const ae=q!=="/"&&q.endsWith("/")?q.length-1:q.length;let ke=I===q||!g&&I.startsWith(q)&&I.charAt(ae)==="/",Pe=Q!=null&&(Q===q||!g&&Q.startsWith(q)&&Q.charAt(q.length)==="/"),Ne={isActive:ke,isPending:Pe,isTransitioning:ne},U=ke?f: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(Jl,Xl({},P,{"aria-current":U,className:Ce,ref:s,style:at,to:E,viewTransition:_}),typeof T=="function"?T(Ne):T)});var uu;(function(o){o.UseScrollRestoration="useScrollRestoration",o.UseSubmit="useSubmit",o.UseSubmitFetcher="useSubmitFetcher",o.UseFetcher="useFetcher",o.useViewTransitionState="useViewTransitionState"})(uu||(uu={}));var Cc;(function(o){o.UseFetcher="useFetcher",o.UseFetchers="useFetchers",o.UseScrollRestoration="useScrollRestoration"})(Cc||(Cc={}));function dh(o){let a=C.useContext(Zl);return a||Se(!1),a}function ph(o,a){let{target:s,replace:f,state:d,preventScrollReset:m,relative:g,viewTransition:x}=a===void 0?{}:a,E=Fc(),_=gn(),T=bl(o,{relative:g});return C.useCallback(P=>{if(nh(P,s)){P.preventDefault();let D=f!==void 0?f:Gl(_)===Gl(T);E(o,{replace:D,state:d,preventScrollReset:m,relative:g,viewTransition:x})}},[_,E,T,f,d,s,o,m,g,x])}function hh(o){let a=C.useRef(ou(o)),s=C.useRef(!1),f=gn(),d=C.useMemo(()=>rh(f.search,s.current?null:a.current),[f.search]),m=Fc(),g=C.useCallback((x,E)=>{const _=ou(typeof x=="function"?x(d):x);s.current=!0,m("?"+_,E)},[m,d]);return[d,g]}function mh(o,a){a===void 0&&(a={});let s=C.useContext(uh);s==null&&Se(!1);let{basename:f}=dh(uu.useViewTransitionState),d=bl(o,{relative:a.relative});if(!s.isTransitioning)return!1;let m=Wn(s.currentLocation.pathname,f)||s.currentLocation.pathname,g=Wn(s.nextLocation.pathname,f)||s.nextLocation.pathname;return lu(d.pathname,g)!=null||lu(d.pathname,m)!=null}const vh="/assets/logo-Cd7Wsq5o.png",tu={},vn=(tu==null?void 0:tu.VITE_SNAPSHOT)==="1",su="/";function gh(o){if(!vn)return"/api"+o;const[a,s]=o.split("?"),f=a.replace(/^\//,"");if(f==="file"){const d=new URLSearchParams(s??"");return`${su}snapshot/file/${yh(d.get("path")??"",d.get("project"))}.json`}return`${su}snapshot/${f}.json`}function yh(o,a){const s=`${a??""}
69
- ${o}`;let f=3735928559,d=1103547991;for(let m=0;m<s.length;m++){const g=s.charCodeAt(m);f=Math.imul(f^g,2654435761),d=Math.imul(d^g,1597334677)}return f=Math.imul(f^f>>>16,2246822507)^Math.imul(d^d>>>13,3266489909),d=Math.imul(d^d>>>16,2246822507)^Math.imul(f^f>>>13,3266489909),(4294967296*(2097151&d)+(f>>>0)).toString(36)}function rm(o,a){return vn?`${su}snapshot/sessions/${o}.export.md`:`/api/sessions/${o}/export.md${a?`?redact=${a}`:""}`}async function ei(o){const a=await fetch(gh(o));if(!a.ok)throw new Error(`${a.status} ${await a.text()}`);return a.json()}async function wh(o,a){const s=await fetch("/api"+o,{method:"POST",...a!==void 0?{headers:{"content-type":"application/json"},body:JSON.stringify(a)}:{}});if(!s.ok)throw new Error(`${s.status} ${await s.text()}`);return s.json()}const Bc="agentlens.theme";function Sh(){if(typeof document<"u"){const o=document.documentElement.dataset.theme;if(o==="light"||o==="dark")return o}try{const o=localStorage.getItem(Bc);if(o==="light"||o==="dark")return o}catch{}return"dark"}const Wc=C.createContext({theme:"dark",toggle:()=>{}});function kh({children:o}){const[a,s]=C.useState(Sh);typeof document<"u"&&(document.documentElement.dataset.theme=a),C.useEffect(()=>{try{localStorage.setItem(Bc,a)}catch{}},[a]);const f=()=>s(d=>d==="dark"?"light":"dark");return y.jsx(Wc.Provider,{value:{theme:a,toggle:f},children:o})}function xh(){return C.useContext(Wc)}function Eh(o){const a=Math.round((Date.now()-new Date(o).getTime())/1e3);if(a<45)return"just now";const s=Math.round(a/60);if(s<60)return`${s}m ago`;const f=Math.round(s/60);return f<24?`${f}h ago`:`${Math.round(f/24)}d ago`}function Ch(){const{theme:o,toggle:a}=xh(),[s,f]=C.useState(null),[d,m]=C.useState(!1),[g,x]=C.useState(null),E=C.useCallback(()=>{ei("/health").then(N=>{f(N.last_ingested??null),m(!!N.schema_stale),x(N.version??null)}).catch(()=>{})},[]);C.useEffect(()=>{E();const N=setInterval(E,6e4);return()=>clearInterval(N)},[E]);const[_,T]=C.useState(!1),[P,D]=C.useState(null),Z=C.useCallback(async()=>{T(!0),D(null);try{await wh("/refresh"),window.location.reload()}catch(N){D(String((N==null?void 0:N.message)??N).slice(0,200)),T(!1)}},[]),{pathname:G}=gn(),W=G==="/dashboard"||G==="/security"||G.startsWith("/skill/")||G==="/file";return y.jsxs("div",{className:"app",children:[y.jsx("a",{className:"skip-link",href:"#main",children:"Skip to content"}),y.jsxs("header",{className:"topbar",children:[y.jsxs(Jl,{to:"/",className:"brand",children:[y.jsx("img",{src:vh,alt:"",className:"brand-logo"})," Agent Lens"]}),g&&(vn?y.jsx("span",{className:"version-badge",title:`Agent Lens ${g}`,children:g}):y.jsx(Jl,{to:"/about",className:"version-badge",title:`Agent Lens ${g} — open diagnostics`,children:g})),y.jsxs("nav",{className:"nav",children:[y.jsx(Tr,{to:"/",end:!0,className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Sessions"}),y.jsx(Tr,{to:"/files",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Files"}),y.jsx(Tr,{to:"/skills",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Skills"}),y.jsx(Tr,{to:"/security",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Security"}),y.jsx(Tr,{to:"/dashboard",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Dashboard"})]}),s?y.jsxs("span",{className:"tagline",title:`Data last ingested ${new Date(s).toLocaleString()}`,children:["updated ",Eh(s)]}):y.jsx("span",{className:"tagline",children:"local agent session explorer"}),y.jsxs("div",{className:"topbar-actions",children:[!vn&&y.jsxs("button",{type:"button",className:"ghost refresh-btn",onClick:Z,disabled:_,"aria-label":"Refresh data — collect new transcripts and rebuild",title:P?`Refresh failed: ${P}`:"Collect new transcripts and rebuild the data (runs on the host)",children:[y.jsx("span",{className:_?"refresh-icon spinning":"refresh-icon","aria-hidden":"true",children:"⟳"})," ",_?"Refreshing…":P?"Retry":"Refresh"]}),y.jsx("button",{type:"button",className:"ghost theme-toggle",onClick:a,"aria-label":"Toggle light or dark theme","aria-pressed":o==="light",title:o==="dark"?"Switch to light theme":"Switch to dark theme",children:o==="dark"?"☀":"☾"})]})]}),d&&y.jsxs("div",{className:"schema-banner",role:"status",children:["⚠ Data schema is out of date — run ",y.jsx("code",{children:"agent-lens ingest --full"})," on the host to rebuild. The ",y.jsx("em",{children:"Refresh"})," button only does an incremental ingest and won't fix this."]}),y.jsx("main",{className:"content"+(W?" wide":""),id:"main",tabIndex:-1,children:y.jsx(qp,{})})]})}function Hc(o,a,s={}){const[f,d]=C.useState({data:null,loading:!0,error:null});return C.useEffect(()=>{const m=o();if(!m){d(x=>({...x,loading:!1,error:null}));return}d(x=>({data:s.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(E=>({data:E.data,loading:!1,error:String(x)}))),()=>{g=!0}},a),f}function _h(o,a){return Hc(()=>o===null?null:ei(o),[o,...(a==null?void 0:a.deps)??[]],a)}function nu(o,a,s=[]){const[f]=C.useState(a),{data:d}=Hc(()=>o===null?null:ei(o),[o,...s]);return d??f}function Ph(o=[]){const[a,s]=hh(),f=o.join(","),d=C.useCallback((E,_="")=>a.get(E)??_,[a]),m=C.useCallback(E=>{const _=new URLSearchParams(a);for(const[T,P]of Object.entries(E))P?_.set(T,P):_.delete(T);for(const T of f?f.split(","):[])T in E||_.delete(T);s(_)},[a,s,f]),g=C.useCallback(E=>{const _=new URLSearchParams;for(const T of E){const P=a.get(T);P&&_.set(T,P)}return _},[a]),x=C.useCallback(()=>s(new URLSearchParams),[s]);return{params:a,get:d,set:m,pick:g,clear:x}}function st(){return y.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"})}function Qc({error:o}){return o?y.jsx("div",{className:"error",role:"alert",children:o}):null}function lm({state:o,empty:a,children:s}){return o.error?y.jsx(Qc,{error:o.error}):o.loading?y.jsx(st,{}):o.data?y.jsx(y.Fragment,{children:s(o.data)}):y.jsx(y.Fragment,{children:a??y.jsx(st,{})})}function Kc(o,a=!0){const s=C.useRef(null),f=C.useRef(o);return f.current=o,C.useEffect(()=>{if(!a)return;const d=m=>{const g=s.current;g&&!g.contains(m.target)&&f.current()};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[a]),s}function Yc(){const o=Kc(()=>{var a;(a=o.current)!=null&&a.open&&(o.current.open=!1)});return o}function Nh(o){if(!o||o<0)return"—";const a=Math.round(o/1e3);if(a<60)return`${a}s`;const s=Math.round(a/60);return s<60?`${s}m`:`${Math.floor(s/60)}h ${s%60}m`}function zr(o){return o>=1e9?(o/1e9).toFixed(1)+"B":o>=1e6?(o/1e6).toFixed(1)+"M":o>=1e3?(o/1e3).toFixed(1)+"k":String(o)}function jh(o){return o>=.01?"$"+o.toFixed(2):o>0?"<$0.01":"$0"}const Rh="Estimated at API list prices (cache-aware)";function Lh(o){return o!=null&&o.length?`No list price for ${o.join(", ")} — this total is incomplete. Add rates under "pricing" in agent-lens.config.json, or upgrade for an updated table.`:Rh}function Th(o){return o?`input ${zr(o.input)} · output ${zr(o.output)} · cache-write ${zr(o.cache_creation)} · cache-read ${zr(o.cache_read)}`:""}function zh(o){if(!o)return"—";const a=new Date(o);return isNaN(a.getTime())?o:a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Gc(o){return o?o==="<synthetic>"?"local":o.replace(/^claude-/,"").replace(/-\d{8}$/,""):""}function Oh({value:o,options:a,onChange:s,ariaLabel:f,searchPlaceholder:d="Filter…"}){const[m,g]=C.useState(!1),[x,E]=C.useState(""),[_,T]=C.useState(0),P=Kc(()=>g(!1),m),D=C.useRef(null),Z=C.useId(),G=I=>`${Z}-opt-${I}`,W=a.find(I=>I.value===o)??a[0]??{value:"",label:""},N=C.useMemo(()=>{const I=x.trim().toLowerCase();return I?a.filter(Q=>Q.label.toLowerCase().includes(I)):a},[a,x]);C.useEffect(()=>{var Q;if(!m)return;E(""),(Q=D.current)==null||Q.focus();const I=N.findIndex(ae=>ae.value===o);T(I>=0?I:0)},[m]),C.useEffect(()=>{T(I=>Math.min(I,Math.max(0,N.length-1)))},[N.length]);function ne(I){I&&(s(I.value),g(!1))}function q(I){if(I.key==="ArrowDown"){if(I.preventDefault(),!m)return g(!0);T(Q=>Math.min(Q+1,N.length-1))}else I.key==="ArrowUp"?(I.preventDefault(),T(Q=>Math.max(Q-1,0))):I.key==="Enter"?(I.preventDefault(),ne(N[_])):I.key==="Escape"&&(I.preventDefault(),g(!1))}return y.jsxs("div",{className:"filter-select",ref:P,children:[y.jsxs("button",{type:"button",className:"filter-select-btn","aria-label":f,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(I=>!I),children:[y.jsx("span",{className:"filter-select-value"+(W.value?"":" muted"),children:W.label}),y.jsx("span",{className:"chev","aria-hidden":"true",children:"▾"})]}),m&&y.jsxs("div",{className:"filter-select-pop",children:[y.jsx("input",{ref:D,type:"text",role:"combobox","aria-expanded":"true","aria-controls":Z,"aria-activedescendant":N.length?G(_):void 0,"aria-label":f,className:"filter-select-search",placeholder:d,value:x,onChange:I=>E(I.target.value),onKeyDown:q}),y.jsx("ul",{className:"filter-select-list",role:"listbox",id:Z,"aria-label":f,children:N.length===0?y.jsx("li",{className:"filter-select-empty muted",role:"presentation",children:"No matches"}):N.map((I,Q)=>y.jsx("li",{id:G(Q),role:"option","aria-selected":I.value===o,className:"filter-select-opt"+(Q===_?" is-active":"")+(I.value===o?" is-selected":""),onMouseEnter:()=>T(Q),onMouseDown:ae=>{ae.preventDefault(),ne(I)},children:I.value?I.label:y.jsx("span",{className:"muted",children:I.label})},I.value||"__all__"))})]})]})}function Ih({page:o,pages:a,total:s,unit:f,onPage:d}){return y.jsxs("div",{className:"pager",children:[y.jsx("button",{disabled:o<=1,onClick:()=>d(o-1),children:"← Prev"}),y.jsxs("span",{className:"muted",children:["page ",o," / ",a," · ",s," ",f]}),y.jsx("button",{disabled:o>=a,onClick:()=>d(o+1),children:"Next →"}),a>1&&y.jsxs("label",{className:"page-jump",children:[y.jsx("span",{className:"sr-only",children:"Jump to page"}),y.jsx("select",{value:o,onChange:m=>d(Number(m.target.value)),children:Array.from({length:a},(m,g)=>g+1).map(m=>y.jsxs("option",{value:m,children:["page ",m," / ",a]},m))})]})]})}function im(o,a,s){const f=s==="asc"?1:-1;return o.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 E=typeof g=="number"&&typeof x=="number"?g-x:String(g).localeCompare(String(x),void 0,{numeric:!0,sensitivity:"base"});return E!==0?E*f:d.i-m.i}).map(d=>d.row)}function om(o,a){const[s,f]=C.useState({key:o,dir:a});return{sort:s,toggle:(m,g="desc")=>f(x=>x.key===m?{key:m,dir:x.dir==="asc"?"desc":"asc"}:{key:m,dir:g})}}function Dh({label:o,sortKey:a,active:s,dir:f,onSort:d,defaultDir:m="desc",className:g}){const x=s===a;return y.jsx("th",{className:g,"aria-sort":x?f==="asc"?"ascending":"descending":"none",children:y.jsxs("button",{type:"button",className:"sort-th"+(x?" is-active":""),onClick:()=>d(a,m),children:[y.jsx("span",{children:o}),y.jsx("span",{className:"sort-ind","aria-hidden":"true",children:x?f==="asc"?"▲":"▼":"↕"})]})})}const Xc="agentlens.";function Mh(o,a){try{const s=localStorage.getItem(Xc+o);return s==null?a:JSON.parse(s)}catch{return a}}async function Fh(o){if(vn)return null;try{return(await ei(`/prefs/${encodeURIComponent(o)}`)).value??null}catch{return null}}function Uh(o,a){try{localStorage.setItem(Xc+o,JSON.stringify(a))}catch{}vn||fetch(`/api/prefs/${encodeURIComponent(o)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:a})}).catch(()=>{})}const Jc=[{id:"session",label:"Session",toggleable:!1,defaultVisible:!0,sortKey:"title",sortDefaultDir:"asc",cell:o=>y.jsxs("td",{children:[y.jsx(Jl,{to:`/session/${o.id}`,className:"title",children:o.title||y.jsx("span",{className:"muted",children:o.id.slice(0,12)})}),y.jsxs("div",{className:"sub",children:[o.is_sidechain?y.jsx("span",{className:"tag subagent",children:"subagent"}):null,(o.models??"").split(",").filter(Boolean).slice(0,3).map(a=>y.jsx("span",{className:"tag",children:Gc(a)},a))]})]})},{id:"source",label:"Source",toggleable:!0,defaultVisible:!0,cell:o=>y.jsx("td",{children:o.source_id})},{id:"project",label:"Project",toggleable:!0,defaultVisible:!0,cell:o=>{var a;return y.jsx("td",{className:"path",children:((a=o.project_path)==null?void 0:a.replace(/^.*\//,""))??"—"})}},{id:"turns",label:"Turns",toggleable:!0,defaultVisible:!0,sortKey:"turns",thClassName:"num",cell:o=>y.jsx("td",{className:"num",children:o.turn_count})},{id:"tokens",label:"Tokens",toggleable:!0,defaultVisible:!0,sortKey:"tokens",thClassName:"num",cell:o=>y.jsx("td",{className:"num",title:Th(o.token_split),children:zr(o.tokens)})},{id:"security",label:"Security",toggleable:!0,defaultVisible:!0,sortKey:"security",thClassName:"num",cell:o=>y.jsx("td",{className:"num",children:o.finding_count>0&&o.worst_severity?y.jsxs("span",{className:"sec-count","aria-label":`${o.finding_count} finding${o.finding_count===1?"":"s"}, highest severity ${o.worst_severity}`,title:`${o.finding_count} finding${o.finding_count===1?"":"s"} · highest severity: ${o.worst_severity}`,children:[y.jsx("span",{className:"sev-dot sev-"+o.worst_severity,"aria-hidden":"true"}),o.finding_count]}):y.jsx("span",{className:"muted",children:"—"})})},{id:"errors",label:"Errors",toggleable:!0,defaultVisible:!0,sortKey:"errors",thClassName:"num",cell:o=>y.jsx("td",{className:"num",title:o.tool_call_count>0?`${o.tool_error_count}/${o.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:o.tool_error_count>0?y.jsx("span",{className:"tool-err-stat",children:o.tool_error_count}):y.jsx("span",{className:"muted",children:"—"})})},{id:"duration",label:"Duration",toggleable:!0,defaultVisible:!0,sortKey:"duration",thClassName:"num",cell:o=>y.jsx("td",{className:"num",children:Nh(o.duration_ms)})},{id:"cost",label:"Cost",toggleable:!0,defaultVisible:!1,sortKey:"cost",thClassName:"num",cell:o=>{var a;return y.jsxs("td",{className:"num",title:Lh(o.unpriced_models),children:[jh(o.cost),(a=o.unpriced_models)!=null&&a.length?y.jsx("span",{className:"warn-tag",children:" ⚠"}):null]})}},{id:"started",label:"Started",toggleable:!0,defaultVisible:!0,sortKey:"started",cell:o=>y.jsx("td",{children:zh(o.started_at)})}],au=Jc.filter(o=>o.toggleable),cu="sessions.columns";function Zc(o){if(!Array.isArray(o))return new Set(au.filter(s=>s.defaultVisible).map(s=>s.id));const a=new Set(au.map(s=>s.id));return new Set(o.filter(s=>typeof s=="string"&&a.has(s)))}function $h(){return Zc(Mh(cu,null))}const Yl=50,Ah={total:0,sessions:[]},Vh=[{value:"critical",label:"critical"},{value:"high",label:"high"},{value:"medium",label:"medium"},{value:"low",label:"low"},{value:"info",label:"info"}],Bh=[{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 _c({label:o,options:a,selected:s,onChange:f}){function d(g,x){const E=new Set(s);x?E.add(g):E.delete(g),f(a.map(_=>_.value).filter(_=>E.has(_)))}const m=Yc();return y.jsxs("details",{className:"multi-select",ref:m,children:[y.jsxs("summary",{"aria-label":o,children:[o,s.length?` (${s.length})`:""," ▾"]}),y.jsxs("div",{className:"col-menu",role:"group","aria-label":o,children:[a.map(g=>y.jsxs("label",{children:[y.jsx("input",{type:"checkbox",checked:s.includes(g.value),onChange:x=>d(g.value,x.target.checked)}),g.label]},g.value)),s.length>0&&y.jsx("button",{type:"button",className:"ghost small ms-clear",onClick:()=>f([]),children:"clear"})]})]})}function Wh({visible:o,onToggle:a}){const s=Yc();return y.jsxs("details",{className:"col-customizer",ref:s,children:[y.jsx("summary",{"aria-label":"Show or hide columns",title:"Show/hide columns",children:"⚙"}),y.jsx("div",{className:"col-menu",role:"group","aria-label":"Toggle columns",children:au.map(f=>y.jsxs("label",{children:[y.jsx("input",{type:"checkbox",checked:o.has(f.id),onChange:d=>a(f.id,d.target.checked)}),f.label]},f.id))})]})}function Hh(){const{get:o,set:a,pick:s}=Ph(["offset"]),f=nu("/sources",[]),d=nu("/projects",[]),m=nu("/models",[]),[g,x]=C.useState(o("q")),[E,_]=C.useState($h),T=Number(o("offset","0"));C.useEffect(()=>{Fh(cu).then(U=>U!=null&&_(Zc(U)))},[]);const P=s(["source","project","model","q","sort","dir","severity","error_type"]);P.set("kind",o("kind")||"main"),P.set("limit",String(Yl)),P.set("offset",String(T));const{data:D,loading:Z,error:G}=_h("/sessions?"+P.toString()),{total:W,sessions:N}=D??Ah;function ne(U){U.preventDefault(),a({q:g.trim()})}function q(U,Ce){_(at=>{const $e=new Set(at);return Ce?$e.add(U):$e.delete(U),Uh(cu,[...$e]),$e})}const I=o("sort","started"),Q=o("dir")==="asc"?"asc":"desc";function ae(U,Ce){a({sort:U,dir:I===U?Q==="asc"?"desc":"asc":Ce})}const ke=Math.floor(T/Yl)+1,Pe=Math.max(1,Math.ceil(W/Yl)),Ne=Jc.filter(U=>!U.toggleable||E.has(U.id));return y.jsxs("div",{children:[y.jsx("h1",{className:"sr-only",children:"Sessions"}),y.jsxs("div",{className:"filters",children:[y.jsxs("form",{onSubmit:ne,className:"search",role:"search",children:[y.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)}),y.jsx("button",{type:"submit",children:"Search"}),o("q")&&y.jsx("button",{type:"button",className:"ghost",onClick:()=>(x(""),a({q:""})),children:"clear"})]}),y.jsxs("select",{"aria-label":"Filter by source",value:o("source"),onChange:U=>a({source:U.target.value}),children:[y.jsx("option",{value:"",children:"all sources"}),f.map(U=>y.jsxs("option",{value:U.id,children:[U.label," (",U.session_count,")"]},U.id))]}),y.jsx(Oh,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:o("project"),onChange:U=>a({project:U}),options:[{value:"",label:"all projects"},...d.map(U=>({value:U.id,label:`${U.path.replace(/^.*\//,"")} (${U.session_count})`}))]}),y.jsxs("select",{"aria-label":"Filter by model",value:o("model"),onChange:U=>a({model:U.target.value}),children:[y.jsx("option",{value:"",children:"all models"}),m.map(U=>y.jsx("option",{value:U,children:Gc(U)},U))]}),y.jsxs("select",{"aria-label":"Filter by kind",value:o("kind")||"main",onChange:U=>a({kind:U.target.value}),children:[y.jsx("option",{value:"main",children:"main only"}),y.jsx("option",{value:"all",children:"main + subagents"}),y.jsx("option",{value:"subagent",children:"subagents only"})]}),y.jsx(_c,{label:"Security",options:Vh,selected:o("severity").split(",").filter(Boolean),onChange:U=>a({severity:U.join(",")})}),y.jsx(_c,{label:"Errors",options:Bh,selected:o("error_type").split(",").filter(Boolean),onChange:U=>a({error_type:U.join(",")})})]}),y.jsx(Qc,{error:G}),Z?y.jsx(st,{}):N.length===0?y.jsx("div",{className:"muted pad",role:"status",children:"No sessions match."}):y.jsxs("table",{className:"sessions",children:[y.jsx("thead",{children:y.jsxs("tr",{children:[Ne.map(U=>U.sortKey?y.jsx(Dh,{label:U.label,sortKey:U.sortKey,active:I,dir:Q,onSort:ae,defaultDir:U.sortDefaultDir??"desc",className:U.thClassName},U.id):y.jsx("th",{className:U.thClassName,children:U.label},U.id)),y.jsx("th",{className:"col-th","aria-label":"Columns",children:y.jsx(Wh,{visible:E,onToggle:q})})]})}),y.jsx("tbody",{children:N.map(U=>y.jsxs("tr",{children:[Ne.map(Ce=>y.jsx(C.Fragment,{children:Ce.cell(U)},Ce.id)),y.jsx("td",{className:"col-td"})]},U.id))})]}),y.jsx(Ih,{page:ke,pages:Pe,total:W,unit:"sessions",onPage:U=>a({offset:String((U-1)*Yl)})})]})}const Qh=C.lazy(()=>zt(()=>import("./Dashboard-CdjRQBg_.js"),[])),Kh=C.lazy(()=>zt(()=>import("./SessionView-C3NBGoRm.js"),__vite__mapDeps([0,1,2,3]))),Yh=C.lazy(()=>zt(()=>import("./WorkflowView-BohpjfRN.js"),__vite__mapDeps([4,2,3]))),Gh=C.lazy(()=>zt(()=>import("./SkillsView-BS-Hhx-l.js"),[])),Xh=C.lazy(()=>zt(()=>import("./SkillView-ChrzRaaf.js"),__vite__mapDeps([5,3]))),Jh=C.lazy(()=>zt(()=>import("./FilesView-CMwzNpYU.js"),[])),Zh=C.lazy(()=>zt(()=>import("./FileView-0gYNqeF8.js"),__vite__mapDeps([6,7]))),qh=C.lazy(()=>zt(()=>import("./SecurityView-B8QFRIOR.js"),__vite__mapDeps([8,1]))),bh=C.lazy(()=>zt(()=>import("./AboutView-ttDCxp0d.js"),[])),em="/".replace(/\/$/,"");up.createRoot(document.getElementById("root")).render(y.jsx(Pc.StrictMode,{children:y.jsx(kh,{children:y.jsx(ah,{basename:em,children:y.jsx(eh,{children:y.jsxs(ut,{path:"/",element:y.jsx(Ch,{}),children:[y.jsx(ut,{index:!0,element:y.jsx(Hh,{})}),y.jsx(ut,{path:"dashboard",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Qh,{})})}),y.jsx(ut,{path:"session/:id",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Kh,{})})}),y.jsx(ut,{path:"workflow/:run_id",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Yh,{})})}),y.jsx(ut,{path:"files",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Jh,{})})}),y.jsx(ut,{path:"file",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Zh,{})})}),y.jsx(ut,{path:"skills",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Gh,{})})}),y.jsx(ut,{path:"skill/:name",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Xh,{})})}),y.jsx(ut,{path:"security",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(qh,{})})}),!vn&&y.jsx(ut,{path:"about",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(bh,{})})})]})})})})}));export{lm as A,om as B,im as C,hh as D,Qc as E,Oh as F,vn as G,wh as H,Jl as L,Ih as P,Pc as R,Dh as S,Fc as a,jh as b,Nh as c,tm as d,Ph as e,zr as f,qd as g,nu as h,Fh as i,y as j,Hc as k,Mh as l,st as m,Uh as n,ei as o,Yc as p,rm as q,C as r,Gc as s,Th as t,xh as u,Lh as v,zh as w,_h as x,nm as y,gn as z};
69
+ ${o}`;let f=3735928559,d=1103547991;for(let m=0;m<s.length;m++){const g=s.charCodeAt(m);f=Math.imul(f^g,2654435761),d=Math.imul(d^g,1597334677)}return f=Math.imul(f^f>>>16,2246822507)^Math.imul(d^d>>>13,3266489909),d=Math.imul(d^d>>>16,2246822507)^Math.imul(f^f>>>13,3266489909),(4294967296*(2097151&d)+(f>>>0)).toString(36)}function rm(o,a){return vn?`${su}snapshot/sessions/${o}.export.md`:`/api/sessions/${o}/export.md${a?`?redact=${a}`:""}`}async function ei(o){const a=await fetch(gh(o));if(!a.ok)throw new Error(`${a.status} ${await a.text()}`);return a.json()}async function wh(o,a){const s=await fetch("/api"+o,{method:"POST",...a!==void 0?{headers:{"content-type":"application/json"},body:JSON.stringify(a)}:{}});if(!s.ok)throw new Error(`${s.status} ${await s.text()}`);return s.json()}const Bc="agentlens.theme";function Sh(){if(typeof document<"u"){const o=document.documentElement.dataset.theme;if(o==="light"||o==="dark")return o}try{const o=localStorage.getItem(Bc);if(o==="light"||o==="dark")return o}catch{}return"dark"}const Wc=C.createContext({theme:"dark",toggle:()=>{}});function kh({children:o}){const[a,s]=C.useState(Sh);typeof document<"u"&&(document.documentElement.dataset.theme=a),C.useEffect(()=>{try{localStorage.setItem(Bc,a)}catch{}},[a]);const f=()=>s(d=>d==="dark"?"light":"dark");return y.jsx(Wc.Provider,{value:{theme:a,toggle:f},children:o})}function xh(){return C.useContext(Wc)}function Eh(o){const a=Math.round((Date.now()-new Date(o).getTime())/1e3);if(a<45)return"just now";const s=Math.round(a/60);if(s<60)return`${s}m ago`;const f=Math.round(s/60);return f<24?`${f}h ago`:`${Math.round(f/24)}d ago`}function Ch(){const{theme:o,toggle:a}=xh(),[s,f]=C.useState(null),[d,m]=C.useState(!1),[g,x]=C.useState(null),E=C.useCallback(()=>{ei("/health").then(N=>{f(N.last_ingested??null),m(!!N.schema_stale),x(N.version??null)}).catch(()=>{})},[]);C.useEffect(()=>{E();const N=setInterval(E,6e4);return()=>clearInterval(N)},[E]);const[_,T]=C.useState(!1),[P,D]=C.useState(null),Z=C.useCallback(async()=>{T(!0),D(null);try{await wh("/refresh"),window.location.reload()}catch(N){D(String((N==null?void 0:N.message)??N).slice(0,200)),T(!1)}},[]),{pathname:G}=gn(),W=G==="/dashboard"||G==="/security"||G.startsWith("/skill/")||G==="/file";return y.jsxs("div",{className:"app",children:[y.jsx("a",{className:"skip-link",href:"#main",children:"Skip to content"}),y.jsxs("header",{className:"topbar",children:[y.jsxs(Jl,{to:"/",className:"brand",children:[y.jsx("img",{src:vh,alt:"",className:"brand-logo"})," Agent Lens"]}),g&&(vn?y.jsx("span",{className:"version-badge",title:`Agent Lens ${g}`,children:g}):y.jsx(Jl,{to:"/about",className:"version-badge",title:`Agent Lens ${g} — open diagnostics`,children:g})),y.jsxs("nav",{className:"nav",children:[y.jsx(Tr,{to:"/",end:!0,className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Sessions"}),y.jsx(Tr,{to:"/files",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Files"}),y.jsx(Tr,{to:"/skills",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Skills"}),y.jsx(Tr,{to:"/security",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Security"}),y.jsx(Tr,{to:"/dashboard",className:({isActive:N})=>N?"nav-link active":"nav-link",children:"Dashboard"})]}),s?y.jsxs("span",{className:"tagline",title:`Data last ingested ${new Date(s).toLocaleString()}`,children:["updated ",Eh(s)]}):y.jsx("span",{className:"tagline",children:"local agent session explorer"}),y.jsxs("div",{className:"topbar-actions",children:[!vn&&y.jsxs("button",{type:"button",className:"ghost refresh-btn",onClick:Z,disabled:_,"aria-label":"Refresh data — collect new transcripts and rebuild",title:P?`Refresh failed: ${P}`:"Collect new transcripts and rebuild the data (runs on the host)",children:[y.jsx("span",{className:_?"refresh-icon spinning":"refresh-icon","aria-hidden":"true",children:"⟳"})," ",_?"Refreshing…":P?"Retry":"Refresh"]}),y.jsx("button",{type:"button",className:"ghost theme-toggle",onClick:a,"aria-label":"Toggle light or dark theme","aria-pressed":o==="light",title:o==="dark"?"Switch to light theme":"Switch to dark theme",children:o==="dark"?"☀":"☾"})]})]}),d&&y.jsxs("div",{className:"schema-banner",role:"status",children:["⚠ Data schema is out of date — run ",y.jsx("code",{children:"agent-lens ingest --full"})," on the host to rebuild. The ",y.jsx("em",{children:"Refresh"})," button only does an incremental ingest and won't fix this."]}),y.jsx("main",{className:"content"+(W?" wide":""),id:"main",tabIndex:-1,children:y.jsx(qp,{})})]})}function Hc(o,a,s={}){const[f,d]=C.useState({data:null,loading:!0,error:null});return C.useEffect(()=>{const m=o();if(!m){d(x=>({...x,loading:!1,error:null}));return}d(x=>({data:s.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(E=>({data:E.data,loading:!1,error:String(x)}))),()=>{g=!0}},a),f}function _h(o,a){return Hc(()=>o===null?null:ei(o),[o,...(a==null?void 0:a.deps)??[]],a)}function nu(o,a,s=[]){const[f]=C.useState(a),{data:d}=Hc(()=>o===null?null:ei(o),[o,...s]);return d??f}function Ph(o=[]){const[a,s]=hh(),f=o.join(","),d=C.useCallback((E,_="")=>a.get(E)??_,[a]),m=C.useCallback(E=>{const _=new URLSearchParams(a);for(const[T,P]of Object.entries(E))P?_.set(T,P):_.delete(T);for(const T of f?f.split(","):[])T in E||_.delete(T);s(_)},[a,s,f]),g=C.useCallback(E=>{const _=new URLSearchParams;for(const T of E){const P=a.get(T);P&&_.set(T,P)}return _},[a]),x=C.useCallback(()=>s(new URLSearchParams),[s]);return{params:a,get:d,set:m,pick:g,clear:x}}function st(){return y.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"})}function Qc({error:o}){return o?y.jsx("div",{className:"error",role:"alert",children:o}):null}function lm({state:o,empty:a,children:s}){return o.error?y.jsx(Qc,{error:o.error}):o.loading?y.jsx(st,{}):o.data?y.jsx(y.Fragment,{children:s(o.data)}):y.jsx(y.Fragment,{children:a??y.jsx(st,{})})}function Kc(o,a=!0){const s=C.useRef(null),f=C.useRef(o);return f.current=o,C.useEffect(()=>{if(!a)return;const d=m=>{const g=s.current;g&&!g.contains(m.target)&&f.current()};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[a]),s}function Yc(){const o=Kc(()=>{var a;(a=o.current)!=null&&a.open&&(o.current.open=!1)});return o}function Nh(o){if(!o||o<0)return"—";const a=Math.round(o/1e3);if(a<60)return`${a}s`;const s=Math.round(a/60);return s<60?`${s}m`:`${Math.floor(s/60)}h ${s%60}m`}function zr(o){return o>=1e9?(o/1e9).toFixed(1)+"B":o>=1e6?(o/1e6).toFixed(1)+"M":o>=1e3?(o/1e3).toFixed(1)+"k":String(o)}function jh(o){return o>=.01?"$"+o.toFixed(2):o>0?"<$0.01":"$0"}const Rh="Estimated at API list prices (cache-aware)";function Lh(o){return o!=null&&o.length?`No list price for ${o.join(", ")} — this total is incomplete. Add rates under "pricing" in agent-lens.config.json, or upgrade for an updated table.`:Rh}function Th(o){return o?`input ${zr(o.input)} · output ${zr(o.output)} · cache-write ${zr(o.cache_creation)} · cache-read ${zr(o.cache_read)}`:""}function zh(o){if(!o)return"—";const a=new Date(o);return isNaN(a.getTime())?o:a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Gc(o){return o?o==="<synthetic>"?"local":o.replace(/^claude-/,"").replace(/-\d{8}$/,""):""}function Oh({value:o,options:a,onChange:s,ariaLabel:f,searchPlaceholder:d="Filter…"}){const[m,g]=C.useState(!1),[x,E]=C.useState(""),[_,T]=C.useState(0),P=Kc(()=>g(!1),m),D=C.useRef(null),Z=C.useId(),G=I=>`${Z}-opt-${I}`,W=a.find(I=>I.value===o)??a[0]??{value:"",label:""},N=C.useMemo(()=>{const I=x.trim().toLowerCase();return I?a.filter(Q=>Q.label.toLowerCase().includes(I)):a},[a,x]);C.useEffect(()=>{var Q;if(!m)return;E(""),(Q=D.current)==null||Q.focus();const I=N.findIndex(ae=>ae.value===o);T(I>=0?I:0)},[m]),C.useEffect(()=>{T(I=>Math.min(I,Math.max(0,N.length-1)))},[N.length]);function ne(I){I&&(s(I.value),g(!1))}function q(I){if(I.key==="ArrowDown"){if(I.preventDefault(),!m)return g(!0);T(Q=>Math.min(Q+1,N.length-1))}else I.key==="ArrowUp"?(I.preventDefault(),T(Q=>Math.max(Q-1,0))):I.key==="Enter"?(I.preventDefault(),ne(N[_])):I.key==="Escape"&&(I.preventDefault(),g(!1))}return y.jsxs("div",{className:"filter-select",ref:P,children:[y.jsxs("button",{type:"button",className:"filter-select-btn","aria-label":f,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(I=>!I),children:[y.jsx("span",{className:"filter-select-value"+(W.value?"":" muted"),children:W.label}),y.jsx("span",{className:"chev","aria-hidden":"true",children:"▾"})]}),m&&y.jsxs("div",{className:"filter-select-pop",children:[y.jsx("input",{ref:D,type:"text",role:"combobox","aria-expanded":"true","aria-controls":Z,"aria-activedescendant":N.length?G(_):void 0,"aria-label":f,className:"filter-select-search",placeholder:d,value:x,onChange:I=>E(I.target.value),onKeyDown:q}),y.jsx("ul",{className:"filter-select-list",role:"listbox",id:Z,"aria-label":f,children:N.length===0?y.jsx("li",{className:"filter-select-empty muted",role:"presentation",children:"No matches"}):N.map((I,Q)=>y.jsx("li",{id:G(Q),role:"option","aria-selected":I.value===o,className:"filter-select-opt"+(Q===_?" is-active":"")+(I.value===o?" is-selected":""),onMouseEnter:()=>T(Q),onMouseDown:ae=>{ae.preventDefault(),ne(I)},children:I.value?I.label:y.jsx("span",{className:"muted",children:I.label})},I.value||"__all__"))})]})]})}function Ih({page:o,pages:a,total:s,unit:f,onPage:d}){return y.jsxs("div",{className:"pager",children:[y.jsx("button",{disabled:o<=1,onClick:()=>d(o-1),children:"← Prev"}),y.jsxs("span",{className:"muted",children:["page ",o," / ",a," · ",s," ",f]}),y.jsx("button",{disabled:o>=a,onClick:()=>d(o+1),children:"Next →"}),a>1&&y.jsxs("label",{className:"page-jump",children:[y.jsx("span",{className:"sr-only",children:"Jump to page"}),y.jsx("select",{value:o,onChange:m=>d(Number(m.target.value)),children:Array.from({length:a},(m,g)=>g+1).map(m=>y.jsxs("option",{value:m,children:["page ",m," / ",a]},m))})]})]})}function im(o,a,s){const f=s==="asc"?1:-1;return o.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 E=typeof g=="number"&&typeof x=="number"?g-x:String(g).localeCompare(String(x),void 0,{numeric:!0,sensitivity:"base"});return E!==0?E*f:d.i-m.i}).map(d=>d.row)}function om(o,a){const[s,f]=C.useState({key:o,dir:a});return{sort:s,toggle:(m,g="desc")=>f(x=>x.key===m?{key:m,dir:x.dir==="asc"?"desc":"asc"}:{key:m,dir:g})}}function Dh({label:o,sortKey:a,active:s,dir:f,onSort:d,defaultDir:m="desc",className:g}){const x=s===a;return y.jsx("th",{className:g,"aria-sort":x?f==="asc"?"ascending":"descending":"none",children:y.jsxs("button",{type:"button",className:"sort-th"+(x?" is-active":""),onClick:()=>d(a,m),children:[y.jsx("span",{children:o}),y.jsx("span",{className:"sort-ind","aria-hidden":"true",children:x?f==="asc"?"▲":"▼":"↕"})]})})}const Xc="agentlens.";function Mh(o,a){try{const s=localStorage.getItem(Xc+o);return s==null?a:JSON.parse(s)}catch{return a}}async function Fh(o){if(vn)return null;try{return(await ei(`/prefs/${encodeURIComponent(o)}`)).value??null}catch{return null}}function Uh(o,a){try{localStorage.setItem(Xc+o,JSON.stringify(a))}catch{}vn||fetch(`/api/prefs/${encodeURIComponent(o)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:a})}).catch(()=>{})}const Jc=[{id:"session",label:"Session",toggleable:!1,defaultVisible:!0,sortKey:"title",sortDefaultDir:"asc",cell:(o,a)=>y.jsxs("td",{children:[y.jsx(Jl,{to:`/session/${o.id}${a?`?q=${encodeURIComponent(a)}`:""}`,className:"title",children:o.title||y.jsx("span",{className:"muted",children:o.id.slice(0,12)})}),y.jsxs("div",{className:"sub",children:[o.is_sidechain?y.jsx("span",{className:"tag subagent",children:"subagent"}):null,(o.models??"").split(",").filter(Boolean).slice(0,3).map(s=>y.jsx("span",{className:"tag",children:Gc(s)},s))]})]})},{id:"source",label:"Source",toggleable:!0,defaultVisible:!0,cell:o=>y.jsx("td",{children:o.source_id})},{id:"project",label:"Project",toggleable:!0,defaultVisible:!0,cell:o=>{var a;return y.jsx("td",{className:"path",children:((a=o.project_path)==null?void 0:a.replace(/^.*\//,""))??"—"})}},{id:"turns",label:"Turns",toggleable:!0,defaultVisible:!0,sortKey:"turns",thClassName:"num",cell:o=>y.jsx("td",{className:"num",children:o.turn_count})},{id:"tokens",label:"Tokens",toggleable:!0,defaultVisible:!0,sortKey:"tokens",thClassName:"num",cell:o=>y.jsx("td",{className:"num",title:Th(o.token_split),children:zr(o.tokens)})},{id:"security",label:"Security",toggleable:!0,defaultVisible:!0,sortKey:"security",thClassName:"num",cell:o=>y.jsx("td",{className:"num",children:o.finding_count>0&&o.worst_severity?y.jsxs("span",{className:"sec-count","aria-label":`${o.finding_count} finding${o.finding_count===1?"":"s"}, highest severity ${o.worst_severity}`,title:`${o.finding_count} finding${o.finding_count===1?"":"s"} · highest severity: ${o.worst_severity}`,children:[y.jsx("span",{className:"sev-dot sev-"+o.worst_severity,"aria-hidden":"true"}),o.finding_count]}):y.jsx("span",{className:"muted",children:"—"})})},{id:"errors",label:"Errors",toggleable:!0,defaultVisible:!0,sortKey:"errors",thClassName:"num",cell:o=>y.jsx("td",{className:"num",title:o.tool_call_count>0?`${o.tool_error_count}/${o.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:o.tool_error_count>0?y.jsx("span",{className:"tool-err-stat",children:o.tool_error_count}):y.jsx("span",{className:"muted",children:"—"})})},{id:"duration",label:"Duration",toggleable:!0,defaultVisible:!0,sortKey:"duration",thClassName:"num",cell:o=>y.jsx("td",{className:"num",children:Nh(o.duration_ms)})},{id:"cost",label:"Cost",toggleable:!0,defaultVisible:!1,sortKey:"cost",thClassName:"num",cell:o=>{var a;return y.jsxs("td",{className:"num",title:Lh(o.unpriced_models),children:[jh(o.cost),(a=o.unpriced_models)!=null&&a.length?y.jsx("span",{className:"warn-tag",children:" ⚠"}):null]})}},{id:"started",label:"Started",toggleable:!0,defaultVisible:!0,sortKey:"started",cell:o=>y.jsx("td",{children:zh(o.started_at)})}],au=Jc.filter(o=>o.toggleable),cu="sessions.columns";function Zc(o){if(!Array.isArray(o))return new Set(au.filter(s=>s.defaultVisible).map(s=>s.id));const a=new Set(au.map(s=>s.id));return new Set(o.filter(s=>typeof s=="string"&&a.has(s)))}function $h(){return Zc(Mh(cu,null))}const Yl=50,Ah={total:0,sessions:[]},Vh=[{value:"critical",label:"critical"},{value:"high",label:"high"},{value:"medium",label:"medium"},{value:"low",label:"low"},{value:"info",label:"info"}],Bh=[{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 _c({label:o,options:a,selected:s,onChange:f}){function d(g,x){const E=new Set(s);x?E.add(g):E.delete(g),f(a.map(_=>_.value).filter(_=>E.has(_)))}const m=Yc();return y.jsxs("details",{className:"multi-select",ref:m,children:[y.jsxs("summary",{"aria-label":o,children:[o,s.length?` (${s.length})`:""," ▾"]}),y.jsxs("div",{className:"col-menu",role:"group","aria-label":o,children:[a.map(g=>y.jsxs("label",{children:[y.jsx("input",{type:"checkbox",checked:s.includes(g.value),onChange:x=>d(g.value,x.target.checked)}),g.label]},g.value)),s.length>0&&y.jsx("button",{type:"button",className:"ghost small ms-clear",onClick:()=>f([]),children:"clear"})]})]})}function Wh({visible:o,onToggle:a}){const s=Yc();return y.jsxs("details",{className:"col-customizer",ref:s,children:[y.jsx("summary",{"aria-label":"Show or hide columns",title:"Show/hide columns",children:"⚙"}),y.jsx("div",{className:"col-menu",role:"group","aria-label":"Toggle columns",children:au.map(f=>y.jsxs("label",{children:[y.jsx("input",{type:"checkbox",checked:o.has(f.id),onChange:d=>a(f.id,d.target.checked)}),f.label]},f.id))})]})}function Hh(){const{get:o,set:a,pick:s}=Ph(["offset"]),f=nu("/sources",[]),d=nu("/projects",[]),m=nu("/models",[]),[g,x]=C.useState(o("q")),[E,_]=C.useState($h),T=Number(o("offset","0"));C.useEffect(()=>{Fh(cu).then(U=>U!=null&&_(Zc(U)))},[]);const P=s(["source","project","model","q","sort","dir","severity","error_type"]);P.set("kind",o("kind")||"main"),P.set("limit",String(Yl)),P.set("offset",String(T));const{data:D,loading:Z,error:G}=_h("/sessions?"+P.toString()),{total:W,sessions:N}=D??Ah;function ne(U){U.preventDefault(),a({q:g.trim()})}function q(U,Ce){_(at=>{const $e=new Set(at);return Ce?$e.add(U):$e.delete(U),Uh(cu,[...$e]),$e})}const I=o("sort","started"),Q=o("dir")==="asc"?"asc":"desc";function ae(U,Ce){a({sort:U,dir:I===U?Q==="asc"?"desc":"asc":Ce})}const ke=Math.floor(T/Yl)+1,Pe=Math.max(1,Math.ceil(W/Yl)),Ne=Jc.filter(U=>!U.toggleable||E.has(U.id));return y.jsxs("div",{children:[y.jsx("h1",{className:"sr-only",children:"Sessions"}),y.jsxs("div",{className:"filters",children:[y.jsxs("form",{onSubmit:ne,className:"search",role:"search",children:[y.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)}),y.jsx("button",{type:"submit",children:"Search"}),o("q")&&y.jsx("button",{type:"button",className:"ghost",onClick:()=>(x(""),a({q:""})),children:"clear"})]}),y.jsxs("select",{"aria-label":"Filter by source",value:o("source"),onChange:U=>a({source:U.target.value}),children:[y.jsx("option",{value:"",children:"all sources"}),f.map(U=>y.jsxs("option",{value:U.id,children:[U.label," (",U.session_count,")"]},U.id))]}),y.jsx(Oh,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:o("project"),onChange:U=>a({project:U}),options:[{value:"",label:"all projects"},...d.map(U=>({value:U.id,label:`${U.path.replace(/^.*\//,"")} (${U.session_count})`}))]}),y.jsxs("select",{"aria-label":"Filter by model",value:o("model"),onChange:U=>a({model:U.target.value}),children:[y.jsx("option",{value:"",children:"all models"}),m.map(U=>y.jsx("option",{value:U,children:Gc(U)},U))]}),y.jsxs("select",{"aria-label":"Filter by kind",value:o("kind")||"main",onChange:U=>a({kind:U.target.value}),children:[y.jsx("option",{value:"main",children:"main only"}),y.jsx("option",{value:"all",children:"main + subagents"}),y.jsx("option",{value:"subagent",children:"subagents only"})]}),y.jsx(_c,{label:"Security",options:Vh,selected:o("severity").split(",").filter(Boolean),onChange:U=>a({severity:U.join(",")})}),y.jsx(_c,{label:"Errors",options:Bh,selected:o("error_type").split(",").filter(Boolean),onChange:U=>a({error_type:U.join(",")})})]}),y.jsx(Qc,{error:G}),Z?y.jsx(st,{}):N.length===0?y.jsx("div",{className:"muted pad",role:"status",children:"No sessions match."}):y.jsxs("table",{className:"sessions",children:[y.jsx("thead",{children:y.jsxs("tr",{children:[Ne.map(U=>U.sortKey?y.jsx(Dh,{label:U.label,sortKey:U.sortKey,active:I,dir:Q,onSort:ae,defaultDir:U.sortDefaultDir??"desc",className:U.thClassName},U.id):y.jsx("th",{className:U.thClassName,children:U.label},U.id)),y.jsx("th",{className:"col-th","aria-label":"Columns",children:y.jsx(Wh,{visible:E,onToggle:q})})]})}),y.jsx("tbody",{children:N.map(U=>y.jsxs("tr",{children:[Ne.map(Ce=>y.jsx(C.Fragment,{children:Ce.cell(U,o("q"))},Ce.id)),y.jsx("td",{className:"col-td"})]},U.id))})]}),y.jsx(Ih,{page:ke,pages:Pe,total:W,unit:"sessions",onPage:U=>a({offset:String((U-1)*Yl)})})]})}const Qh=C.lazy(()=>zt(()=>import("./Dashboard-ChlOFRIl.js"),[])),Kh=C.lazy(()=>zt(()=>import("./SessionView-DFI1i_1s.js"),__vite__mapDeps([0,1,2,3]))),Yh=C.lazy(()=>zt(()=>import("./WorkflowView-Bo9vuO3E.js"),__vite__mapDeps([4,2,3]))),Gh=C.lazy(()=>zt(()=>import("./SkillsView-DBruj8UK.js"),[])),Xh=C.lazy(()=>zt(()=>import("./SkillView-B4VQa9NY.js"),__vite__mapDeps([5,3]))),Jh=C.lazy(()=>zt(()=>import("./FilesView-BkE8JdcH.js"),[])),Zh=C.lazy(()=>zt(()=>import("./FileView-BGx2Tgs3.js"),__vite__mapDeps([6,7]))),qh=C.lazy(()=>zt(()=>import("./SecurityView-COYAu9X3.js"),__vite__mapDeps([8,1]))),bh=C.lazy(()=>zt(()=>import("./AboutView-U57nmvB2.js"),[])),em="/".replace(/\/$/,"");up.createRoot(document.getElementById("root")).render(y.jsx(Pc.StrictMode,{children:y.jsx(kh,{children:y.jsx(ah,{basename:em,children:y.jsx(eh,{children:y.jsxs(ut,{path:"/",element:y.jsx(Ch,{}),children:[y.jsx(ut,{index:!0,element:y.jsx(Hh,{})}),y.jsx(ut,{path:"dashboard",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Qh,{})})}),y.jsx(ut,{path:"session/:id",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Kh,{})})}),y.jsx(ut,{path:"workflow/:run_id",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Yh,{})})}),y.jsx(ut,{path:"files",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Jh,{})})}),y.jsx(ut,{path:"file",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Zh,{})})}),y.jsx(ut,{path:"skills",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Gh,{})})}),y.jsx(ut,{path:"skill/:name",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(Xh,{})})}),y.jsx(ut,{path:"security",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(qh,{})})}),!vn&&y.jsx(ut,{path:"about",element:y.jsx(C.Suspense,{fallback:y.jsx(st,{}),children:y.jsx(bh,{})})})]})})})})}));export{lm as A,om as B,im as C,hh as D,Qc as E,Oh as F,vn as G,wh as H,Jl as L,Ih as P,Pc as R,Dh as S,Fc as a,jh as b,Nh as c,tm as d,Yc as e,zr as f,qd as g,Fh as h,Uh as i,y as j,Ph as k,Mh as l,nu as m,Hc as n,st as o,ei as p,rm as q,C as r,Gc as s,Th as t,xh as u,Lh as v,zh as w,_h as x,nm as y,gn as z};