@swestash/agent-lens 0.17.4 → 0.17.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/404.html +2 -2
- package/web/assets/{AboutView-tTOWbdtR.js → AboutView-aUqi2IBU.js} +1 -1
- package/web/assets/{Dashboard-C3qXLVs0.js → Dashboard-DByihW7N.js} +1 -1
- package/web/assets/{FileView-DMUoh5N2.js → FileView-Aqwd0lJV.js} +1 -1
- package/web/assets/{FilesView-CDA5f05Z.js → FilesView-MMsd5fgG.js} +1 -1
- package/web/assets/{SecurityView-DXDnsRCb.js → SecurityView-CL8p3Drg.js} +1 -1
- package/web/assets/{SessionView-Cb_Q-gSc.js → SessionView-DrCE0ZFH.js} +1 -1
- package/web/assets/{SkillView-AX-xMPdI.js → SkillView-DqFqSIFK.js} +1 -1
- package/web/assets/{SkillsView-BwUdENAc.js → SkillsView-BYWpuxva.js} +1 -1
- package/web/assets/{WorkflowView-C-39SjGW.js → WorkflowView-D5ulOXFS.js} +1 -1
- package/web/assets/{index-DiDvUUQ7.js → index-BAzJJeOV.js} +2 -2
- package/web/assets/{index-CtNviuC1.js → index-BInWVVgH.js} +1 -1
- package/web/assets/{index-7p3QjWYa.css → index-CZlMEmLZ.css} +1 -1
- package/web/assets/{jsonish-DDjKYx9o.js → jsonish-CTF43Da0.js} +1 -1
- package/web/assets/{theme-BMrL_mzt.js → theme-C0b3Oyq9.js} +1 -1
- package/web/assets/{useResetOn-D_B_9yU4.js → useResetOn-wnsToI6F.js} +1 -1
- package/web/index.html +2 -2
package/package.json
CHANGED
package/web/404.html
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
document.documentElement.dataset.theme = "dark";
|
|
17
17
|
}
|
|
18
18
|
</script>
|
|
19
|
-
<script type="module" crossorigin src="/assets/index-
|
|
20
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-BAzJJeOV.js"></script>
|
|
20
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CZlMEmLZ.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
23
|
<div id="root"></div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as j,j as e,D as g}from"./index-
|
|
1
|
+
import{p as j,j as e,D as g}from"./index-BAzJJeOV.js";const c="v0.17.4-1-g4f72a47";function d(r){if(r==null)return"unknown";if(r<1e3)return`${r} B`;const s=["kB","MB","GB","TB"];let n=r/1e3,t=0;for(;n>=1e3&&t<s.length-1;)n/=1e3,t++;return`${n<10?n.toFixed(1):Math.round(n)} ${s[t]}`}function i({label:r,children:s}){return e.jsxs("tr",{children:[e.jsx("th",{scope:"row",children:r}),e.jsx("td",{children:s})]})}function a({info:r}){return e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"path",children:r.path})," ",e.jsx("span",{className:"origin-tag","data-tip":l(r.origin),children:r.origin})]})}function l(r){switch(r){case"env":return"Set by an environment variable";case"flag":return"Set by a command-line flag";case"file":return"Set in the config file";case"fixed":return"Not independently relocatable — move the whole data dir (ADR-021)";default:return"Built-in default"}}function o({label:r,v:s,what:n,rerun:t}){const h=s.in_data.filter(x=>x<s.expected);return e.jsxs(i,{label:r,children:["v",s.expected,s.stale&&e.jsxs(e.Fragment,{children:[" ",e.jsx("span",{className:"warn-tag",children:"data is older"})]}),e.jsx("div",{className:"muted",children:s.in_data.length===0?e.jsxs(e.Fragment,{children:["No ",n," stored yet."]}):s.stale?e.jsxs(e.Fragment,{children:["Stored ",n," came from v",h.join(", v")," — re-run ",e.jsx("code",{children:t})," to relabel with v",s.expected,"."]}):e.jsxs(e.Fragment,{children:["All stored ",n," came from v",s.in_data.join(", v"),"."]})})]})}function p(){const r=j("/about");return e.jsxs("div",{className:"about",children:[e.jsx("h1",{children:"About"}),e.jsxs("p",{className:"muted",children:["Diagnostics for this install. Configuration is shown read-only — it resolves"," ",e.jsx("code",{children:"flag > env > config file > default"}),", so change it with"," ",e.jsx("code",{children:"agent-lens config"}),", an env var, or the config file."]}),e.jsx(g,{state:r,children:s=>e.jsxs(e.Fragment,{children:[e.jsxs("section",{children:[e.jsx("h2",{children:"Versions"}),e.jsx("table",{className:"kv",children:e.jsxs("tbody",{children:[e.jsxs(i,{label:"Agent Lens",children:[s.versions.app," ",e.jsx("span",{className:"origin-tag",children:s.versions.app_source}),s.versions.app_source==="unknown"&&e.jsxs("span",{className:"muted",children:[" ","— no npm metadata and no git tag reachable; this is an unreleased or archive build"]})]}),c!==s.versions.app&&e.jsxs(i,{label:"Web build",children:[c," ",e.jsx("span",{className:"warn-tag",role:"status",children:"differs from the server"}),e.jsx("div",{className:"muted",children:"The page you are looking at was built from a different revision than the server serving it — usually a service still running an older install. Restart it, or rebuild the UI."})]}),e.jsxs(i,{label:"Schema",children:[s.versions.schema??"unstamped",s.versions.schema_stale&&e.jsxs(e.Fragment,{children:[" ",e.jsx("span",{className:"warn-tag",children:"stale"}),e.jsxs("div",{className:"muted",children:["Written by an older build (this one expects ",s.versions.schema_expected,"). Run"," ",e.jsx("code",{children:"agent-lens ingest --full"}),"."]})]})]}),e.jsx(o,{label:"Detector",v:s.versions.detector,what:"security findings",rerun:"agent-lens ingest --full"}),e.jsx(o,{label:"Classifier",v:s.versions.classifier,what:"session categories",rerun:"agent-lens metrics"})]})})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"Paths"}),e.jsx("table",{className:"kv",children:e.jsxs("tbody",{children:[e.jsx(i,{label:"Config file",children:s.paths.config_file?e.jsx("code",{className:"path",children:s.paths.config_file}):e.jsx("span",{className:"muted",children:"none — using built-in defaults"})}),e.jsx(i,{label:"Data dir",children:e.jsx(a,{info:s.paths.data_dir})}),e.jsx(i,{label:"Archive",children:e.jsx(a,{info:s.paths.archive})}),e.jsx(i,{label:"Database",children:e.jsx(a,{info:s.paths.db})}),e.jsx(i,{label:"Triage store",children:e.jsx(a,{info:s.paths.triage_db})})]})})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"Server"}),e.jsx("table",{className:"kv",children:e.jsxs("tbody",{children:[e.jsx(i,{label:"Bound to",children:e.jsxs("code",{children:[s.server.host,":",s.server.port]})}),e.jsx(i,{label:"Network",children:s.server.loopback_only?"Loopback only — not reachable from other machines":e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"warn-tag",children:"non-loopback bind"}),e.jsx("div",{className:"muted",children:"Reachable from other machines on this network. The API is unauthenticated."})]})})]})})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"Retention"}),e.jsx("table",{className:"kv",children:e.jsx("tbody",{children:e.jsxs(i,{label:"Keep .versions",children:[s.retention.versions_keep_days," day",s.retention.versions_keep_days===1?"":"s"," ",e.jsx("span",{className:"origin-tag","data-tip":l(s.retention.origin),children:s.retention.origin}),e.jsxs("div",{className:"muted",children:["How long superseded transcript snapshots are kept before ",e.jsx("code",{children:"scripts/prune.sh"})," ","removes them. Does not affect the database."]})]})})})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"Pricing"}),e.jsx("table",{className:"kv",children:e.jsxs("tbody",{children:[e.jsxs(i,{label:"Models priced",children:[s.pricing.models," ",e.jsx("span",{className:"origin-tag","data-tip":l(s.pricing.origin),children:s.pricing.origin}),e.jsxs("div",{className:"muted",children:["Cost is estimated from token counts at API list prices — never read from the transcripts, which do not record it. Override or add rates with a"," ",e.jsx("code",{children:"pricing"})," block in the config file."]})]}),s.pricing.applied.length>0&&e.jsx(i,{label:"Overrides",children:s.pricing.applied.map(n=>e.jsx("code",{className:"path",children:n},n))}),s.pricing.invalid.length>0&&e.jsxs(i,{label:"Ignored",children:[e.jsx("span",{className:"warn-tag",children:"malformed"})," ",s.pricing.invalid.map(n=>e.jsx("code",{className:"path",children:n},n)),e.jsxs("div",{className:"muted",children:["Each entry needs numeric ",e.jsx("code",{children:"input"})," and ",e.jsx("code",{children:"output"})," rates. These kept their built-in rate."]})]}),e.jsx(i,{label:"Unpriced models",children:s.pricing.unpriced.length===0?e.jsx("span",{className:"muted",children:"None — every model in this store has a rate"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"warn-tag",role:"status",children:"cost understated"})," ",s.pricing.unpriced.map(n=>e.jsx("code",{className:"path",children:n},n)),e.jsxs("div",{className:"muted",children:["These have token usage but no rate, so they contribute $0 to every cost shown. Upgrade for an updated table, or add rates under ",e.jsx("code",{children:"pricing"})," in the config file."]})]})})]})})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"Sources"}),s.sources.length===0?e.jsx("p",{className:"muted",children:"No sources configured."}):e.jsx("table",{className:"kv",children:e.jsx("tbody",{children:s.sources.map(n=>e.jsxs(i,{label:n.label,children:[e.jsx("code",{className:"path",children:n.config_dir})," ",e.jsx("span",{className:"origin-tag",children:n.agent})]},n.label))})})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"Storage"}),e.jsx("table",{className:"kv",children:e.jsxs("tbody",{children:[e.jsx(i,{label:"Database",children:d(s.storage.db_bytes)}),e.jsxs(i,{label:"Ingested",children:[d(s.storage.archive_bytes)," across ",s.storage.archive_files.toLocaleString()," file",s.storage.archive_files===1?"":"s",e.jsxs("div",{className:"muted",children:["Transcript bytes read into the database",s.storage.last_ingested?`, as of the last ingest (${new Date(s.storage.last_ingested).toLocaleString()})`:"",". Excludes anything in the archive that has not been ingested, such as"," ",e.jsx("code",{children:".versions/"})," retention snapshots — so it is not the archive folder’s size on disk."]})]})]})})]})]})})]})}export{p as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as R,j as v,u as l0,f as yt,s as fr,a as Nn,b as Ti,L as C_,c as Ei,g as le,R as P,l as kl,d as M_,e as lh,h as $_,i as I_,k as So,m as Ao,M as N_,S as fh,E as jo,n as D_,o as yn}from"./index-DiDvUUQ7.js";import{u as ge,K as et,C as Pe}from"./theme-BMrL_mzt.js";const Po=8,R_=26;function q_(){const[e,t]=R.useState(new Set),r=o=>t(s=>{const u=new Set(s);return u.has(o)?u.delete(o):u.add(o),u});return{topN:(o,s)=>e.has(s)?o:o.slice(0,Po),expandHeight:(o,s,u=R_)=>e.has(o)?Math.max(240,s*u):void 0,expandBtn:(o,s)=>{if(!(s<=Po))return v.jsx("button",{type:"button",className:"link-btn",onClick:()=>r(o),children:e.has(o)?`show top ${Po}`:`show all (${s})`})}}}function f0(e,t){var n;const r=((n=e==null?void 0:e.payload)==null?void 0:n[t])??(e==null?void 0:e[t]);return typeof r=="string"&&r!==""?r:null}function L_({active:e,payload:t,versionsByName:r}){var u,c,f,l;const{C:n,tooltipStyle:i}=ge();if(!e||!(t!=null&&t.length))return null;const a=String(((c=(u=t[0])==null?void 0:u.payload)==null?void 0:c.name)??""),o=Number(((l=(f=t[0])==null?void 0:f.payload)==null?void 0:l.n)??0),s=r.get(a)??[];return v.jsxs("div",{style:{...i.contentStyle,padding:"8px 10px",maxWidth:280},children:[v.jsx("div",{style:{color:n.text,fontWeight:600,marginBottom:4},children:a}),v.jsxs("div",{style:{color:n.muted,marginBottom:s.length?6:0},children:[o," firing",o===1?"":"s"," total"]}),s.map(d=>v.jsxs("div",{style:{color:n.text,display:"flex",justifyContent:"space-between",gap:12},children:[v.jsx("span",{style:{color:n.muted},children:d.version_id.slice(0,8)}),v.jsx("span",{children:d.n})]},d.version_id)),s.length>0&&v.jsx("div",{style:{color:n.muted,marginTop:6,fontSize:11},children:"click to open skill →"})]})}function Qf({x:e,y:t,payload:r,onSelect:n,title:i}){return v.jsx("text",{x:e,y:t,dy:4,textAnchor:"end",className:"axis-link",fontSize:11,onClick:()=>(r==null?void 0:r.value)&&n(r.value),"data-tip":i,children:r==null?void 0:r.value})}function B_(){const e=l0(),t=(n,i)=>{i!=null&&i!==""&&e(`/?${n}=${encodeURIComponent(i)}`)};return{drillFilter:t,drillTo:(n,i)=>a=>t(n,f0(a,i))}}const Ir="custom",Ka="all",d0=[{id:Ka,label:"All"},{id:"cost",label:"Cost",kpis:["cost","cost-per-session","total-tokens","token-breakdown","cache-read-ratio","sessions"],charts:["cost-over-time","tokens-over-time","tokens-by-model"]},{id:"reliability",label:"Reliability",kpis:["tool-error-rate","rejection-rate","workflow-runs","turns","turn-duration","session-duration","security"],charts:["tool-errors","error-types","activity"]},{id:"time",label:"Time",kpis:["sessions","total-tokens","cost","turn-duration","session-duration"],charts:["burn-heatmap","weekly-burn","model-latency","review-latency"]},{id:"activity",label:"Activity",kpis:["sessions","projects","turns","session-duration"],charts:["activity","category","complexity","tool-frequency","skill-activation","subagent-fanout"]}];function h0(e){return d0.find(t=>t.id===e)}const To="dashboard.layout",dh="dashboard.charts";function Ui(){return{hidden:[],order:[]}}function p0(){return{kpis:Ui(),charts:Ui()}}function F_(){return{v:1,active:Ka,custom:null,kpisCollapsed:!1}}function Cl(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function hh(e){if(typeof e!="object"||e===null)return Ui();const t=e;return{hidden:Cl(t.hidden),order:Cl(t.order)}}function W_(e){if(typeof e!="object"||e===null)return null;const t=e;return{kpis:hh(t.kpis),charts:hh(t.charts)}}function ph(e,t){if(typeof e!="object"||e===null){const n=Cl(t);if(n.length===0)return F_();const i=p0();return i.charts.hidden=n,{v:1,active:Ir,custom:i,kpisCollapsed:!1}}const r=e;return{v:1,active:typeof r.active=="string"?r.active:Ka,custom:W_(r.custom),kpisCollapsed:r.kpisCollapsed===!0}}function v0(e,t){const r=new Set(e),n=new Set,i=[];for(const a of t)r.has(a)&&!n.has(a)&&(i.push(a),n.add(a));for(const a of e)n.has(a)||i.push(a);return i}function zi(e,t){const r=new Map(e.map(n=>[n.id,n]));return v0(e.map(n=>n.id),t).map(n=>r.get(n))}function vh(e,t){if(!e)return Ui();const r=new Set(e);return{order:[...e],hidden:t.filter(n=>!r.has(n))}}function z_(e,t,r){return{kpis:vh(e.kpis,t),charts:vh(e.charts,r)}}function y0(e){return e.active!==Ir&&h0(e.active)?e.active:e.custom?Ir:Ka}function yh(e,t,r){const n=y0(e);return n!==Ir?z_(h0(n),t,r):e.custom??p0()}function U_(e,t){return{...e,active:Ir,custom:t}}function K_(e,t,r,n){const i=v0(e,t),a=i.indexOf(r),o=a+n;return a<0||o<0||o>=i.length?t:([i[a],i[o]]=[i[o],i[a]],i)}function H_(e,t,r){const n=e.filter(i=>i!==t);return r||n.push(t),n}function G_({s:e}){const t=new Map(e.by_severity.map(a=>[a.severity,a.n])),r=t.get("critical")??0,n=t.get("high")??0,i=e.total===0?"—":`${r} / ${n}`;return v.jsxs(C_,{className:"kpi kpi-btn"+(r>0?" sev-critical":n>0?" sev-high":""),to:"/security","data-tip":"Security findings — critical / high. Opens the Security page.",children:[v.jsx("div",{className:"kpi-label",children:"Security findings"}),v.jsx("div",{className:"kpi-value",children:i}),v.jsx("div",{className:"kpi-sub",children:e.total===0?"no open findings":`critical / high · ${e.total} open in ${e.sessions_flagged} sessions`})]})}function V_({t:e}){const{TOKEN_COLORS:t}=ge(),r=e.input+e.output+e.cache_creation+e.cache_read,n=[{name:"Input",v:e.input,c:t.input},{name:"Output",v:e.output,c:t.output},{name:"Cache write",v:e.cache_creation,c:t.cache_creation},{name:"Cache read",v:e.cache_read,c:t.cache_read}];return v.jsxs("div",{className:"kpi","data-tip":"Token totals by type: input · output · cache-write · cache-read",children:[v.jsx("div",{className:"kpi-label",children:"Token breakdown"}),v.jsx("ul",{className:"kpi-bd",children:n.map(i=>v.jsxs("li",{children:[v.jsx("span",{className:"kpi-bd-dot",style:{background:i.c},"aria-hidden":"true"}),v.jsx("span",{className:"kpi-bd-name",children:i.name}),v.jsx("span",{className:"kpi-bd-val",children:yt(i.v)}),v.jsxs("span",{className:"kpi-bd-pct",children:[r?Math.round(i.v/r*100):0,"%"]})]},i.name))})]})}function mh({overview:e,bd:t}){var a,o;const r=((a=t==null?void 0:t.error_types)==null?void 0:a.failures)??0,n=((o=t==null?void 0:t.error_types)==null?void 0:o.rejections)??0,i=e.tool_calls??0;return{failures:r,rejections:n,toolCalls:i,errRate:i?r/i*100:0,rejRate:i?n/i*100:0}}const ed=[{id:"sessions",label:"Sessions",render:({overview:e})=>v.jsx(et,{label:"Sessions",value:e.sessions_main,sub:`+${e.sessions_subagent.toLocaleString()} subagent runs`})},{id:"projects",label:"Projects",render:({overview:e})=>v.jsx(et,{label:"Projects",value:e.projects,sub:"distinct project paths"})},{id:"turns",label:"Turns",render:({overview:e})=>v.jsx(et,{label:"Turns",value:e.turns,sub:`${e.tool_calls.toLocaleString()} tool calls`})},{id:"tool-error-rate",label:"Tool error rate",render:e=>{const{failures:t,toolCalls:r,errRate:n}=mh(e);return v.jsx(et,{label:"Tool error rate",value:r?n.toFixed(1)+"%":"—",tip:"Genuine tool failures as a share of all tool calls (rejections/blocks excluded — see the rejection rate).",sub:`${t.toLocaleString()} failed of ${r.toLocaleString()} calls`})}},{id:"rejection-rate",label:"Rejection rate",render:e=>{const{rejections:t,toolCalls:r,rejRate:n}=mh(e);return v.jsx(et,{label:"Rejection rate",value:r?n.toFixed(1)+"%":"—",tip:"User-rejected + guardrail-blocked tool calls as a share of all tool calls. Not agent failures.",sub:`${t.toLocaleString()} rejected/blocked`})}},{id:"workflow-runs",label:"Workflow runs",render:({overview:e})=>v.jsx(et,{label:"Workflow runs",value:e.workflows.total||"—",tip:"Async workflow runs in range. Success rate is over decided runs (completed vs failed); in-flight runs are excluded from the rate.",sub:e.workflows.total?`${Math.round(e.workflows.success_rate*100)}% success · ${yt(e.workflows.total_tokens)}`:"no workflow runs"})},{id:"cost",label:"Est. cost",render:({overview:e})=>v.jsx(et,{label:"Est. cost (API-equiv.)",value:Nn(e.cost),tip:"Estimated at API list prices for this usage (cache reads/writes included at their discounted cache rates).",sub:e.unpriced_models.length?`⚠ unpriced: ${e.unpriced_models.map(fr).join(", ")}`:"API list price estimate"})},{id:"cost-per-session",label:"Cost / session",render:({overview:e})=>v.jsx(et,{label:"Cost / session",value:e.sessions_main?Nn(e.cost/e.sessions_main):"—",tip:"Estimated API-equivalent cost divided by main sessions in range.",sub:"API-equiv. per main session"})},{id:"cache-read-ratio",label:"Cache-read ratio",render:({overview:e})=>v.jsx(et,{label:"Cache-read ratio",value:(e.cache_read_ratio*100).toFixed(1)+"%",sub:"of all tokens are cached replays — excluded from “work”"})},{id:"turn-duration",label:"Turn duration",render:({overview:e})=>v.jsx(et,{label:"Turn duration p50 / p95",value:`${Ti(e.turn_duration_ms.p50)} / ${Ti(e.turn_duration_ms.p95)}`,sub:`${e.turn_duration_ms.count} turns`})},{id:"session-duration",label:"Session duration",render:({overview:e})=>v.jsx(et,{label:"Session duration p50 / p95",value:`${Ti(e.session_duration_ms.p50)} / ${Ti(e.session_duration_ms.p95)}`,tip:"End-to-end wall-clock length of main sessions (subagents excluded).",sub:`${e.session_duration_ms.count} sessions`})},{id:"total-tokens",label:"Total tokens",render:({overview:e})=>v.jsx(et,{label:"Total tokens",value:yt(e.total_tokens),sub:`${yt(e.tokens.input+e.tokens.output)} non-cache`})},{id:"token-breakdown",label:"Token breakdown",render:({overview:e})=>v.jsx(V_,{t:e.tokens})},{id:"security",label:"Security findings",render:({security:e})=>e?v.jsx(G_,{s:e}):null}];function X_({ctx:e,layout:t}){const r=new Set(t.hidden);return v.jsx("div",{className:"kpis",children:zi(ed,t.order).filter(n=>!r.has(n.id)).map(n=>v.jsx(R.Fragment,{children:n.render(e)},n.id))})}function m0(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=m0(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ee(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=m0(e))&&(n&&(n+=" "),n+=t);return n}var Eo,gh;function He(){if(gh)return Eo;gh=1;var e=Array.isArray;return Eo=e,Eo}var ko,bh;function g0(){if(bh)return ko;bh=1;var e=typeof Ei=="object"&&Ei&&Ei.Object===Object&&Ei;return ko=e,ko}var Co,xh;function St(){if(xh)return Co;xh=1;var e=g0(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Co=r,Co}var Mo,wh;function mi(){if(wh)return Mo;wh=1;var e=St(),t=e.Symbol;return Mo=t,Mo}var $o,_h;function Y_(){if(_h)return $o;_h=1;var e=mi(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var s=r.call(o,i),u=o[i];try{o[i]=void 0;var c=!0}catch{}var f=n.call(o);return c&&(s?o[i]=u:delete o[i]),f}return $o=a,$o}var Io,Oh;function Z_(){if(Oh)return Io;Oh=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Io=r,Io}var No,Sh;function Dt(){if(Sh)return No;Sh=1;var e=mi(),t=Y_(),r=Z_(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?t(s):r(s)}return No=o,No}var Do,Ah;function Rt(){if(Ah)return Do;Ah=1;function e(t){return t!=null&&typeof t=="object"}return Do=e,Do}var Ro,jh;function on(){if(jh)return Ro;jh=1;var e=Dt(),t=Rt(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Ro=n,Ro}var qo,Ph;function td(){if(Ph)return qo;Ph=1;var e=He(),t=on(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return qo=i,qo}var Lo,Th;function Ht(){if(Th)return Lo;Th=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Lo=e,Lo}var Bo,Eh;function rd(){if(Eh)return Bo;Eh=1;var e=Dt(),t=Ht(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var u=e(s);return u==n||u==i||u==r||u==a}return Bo=o,Bo}var Fo,kh;function J_(){if(kh)return Fo;kh=1;var e=St(),t=e["__core-js_shared__"];return Fo=t,Fo}var Wo,Ch;function Q_(){if(Ch)return Wo;Ch=1;var e=J_(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Wo=r,Wo}var zo,Mh;function b0(){if(Mh)return zo;Mh=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return zo=r,zo}var Uo,$h;function eO(){if($h)return Uo;$h=1;var e=rd(),t=Q_(),r=Ht(),n=b0(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,f=RegExp("^"+u.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(d){if(!r(d)||t(d))return!1;var h=e(d)?f:a;return h.test(n(d))}return Uo=l,Uo}var Ko,Ih;function tO(){if(Ih)return Ko;Ih=1;function e(t,r){return t==null?void 0:t[r]}return Ko=e,Ko}var Ho,Nh;function mr(){if(Nh)return Ho;Nh=1;var e=eO(),t=tO();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return Ho=r,Ho}var Go,Dh;function Ha(){if(Dh)return Go;Dh=1;var e=mr(),t=e(Object,"create");return Go=t,Go}var Vo,Rh;function rO(){if(Rh)return Vo;Rh=1;var e=Ha();function t(){this.__data__=e?e(null):{},this.size=0}return Vo=t,Vo}var Xo,qh;function nO(){if(qh)return Xo;qh=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Xo=e,Xo}var Yo,Lh;function iO(){if(Lh)return Yo;Lh=1;var e=Ha(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var s=o[a];return s===t?void 0:s}return n.call(o,a)?o[a]:void 0}return Yo=i,Yo}var Zo,Bh;function aO(){if(Bh)return Zo;Bh=1;var e=Ha(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return Zo=n,Zo}var Jo,Fh;function oO(){if(Fh)return Jo;Fh=1;var e=Ha(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return Jo=r,Jo}var Qo,Wh;function sO(){if(Wh)return Qo;Wh=1;var e=rO(),t=nO(),r=iO(),n=aO(),i=oO();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Qo=a,Qo}var es,zh;function uO(){if(zh)return es;zh=1;function e(){this.__data__=[],this.size=0}return es=e,es}var ts,Uh;function nd(){if(Uh)return ts;Uh=1;function e(t,r){return t===r||t!==t&&r!==r}return ts=e,ts}var rs,Kh;function Ga(){if(Kh)return rs;Kh=1;var e=nd();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return rs=t,rs}var ns,Hh;function cO(){if(Hh)return ns;Hh=1;var e=Ga(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():r.call(a,o,1),--this.size,!0}return ns=n,ns}var is,Gh;function lO(){if(Gh)return is;Gh=1;var e=Ga();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return is=t,is}var as,Vh;function fO(){if(Vh)return as;Vh=1;var e=Ga();function t(r){return e(this.__data__,r)>-1}return as=t,as}var os,Xh;function dO(){if(Xh)return os;Xh=1;var e=Ga();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return os=t,os}var ss,Yh;function Va(){if(Yh)return ss;Yh=1;var e=uO(),t=cO(),r=lO(),n=fO(),i=dO();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ss=a,ss}var us,Zh;function id(){if(Zh)return us;Zh=1;var e=mr(),t=St(),r=e(t,"Map");return us=r,us}var cs,Jh;function hO(){if(Jh)return cs;Jh=1;var e=sO(),t=Va(),r=id();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return cs=n,cs}var ls,Qh;function pO(){if(Qh)return ls;Qh=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return ls=e,ls}var fs,ep;function Xa(){if(ep)return fs;ep=1;var e=pO();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return fs=t,fs}var ds,tp;function vO(){if(tp)return ds;tp=1;var e=Xa();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return ds=t,ds}var hs,rp;function yO(){if(rp)return hs;rp=1;var e=Xa();function t(r){return e(this,r).get(r)}return hs=t,hs}var ps,np;function mO(){if(np)return ps;np=1;var e=Xa();function t(r){return e(this,r).has(r)}return ps=t,ps}var vs,ip;function gO(){if(ip)return vs;ip=1;var e=Xa();function t(r,n){var i=e(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return vs=t,vs}var ys,ap;function ad(){if(ap)return ys;ap=1;var e=hO(),t=vO(),r=yO(),n=mO(),i=gO();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ys=a,ys}var ms,op;function x0(){if(op)return ms;op=1;var e=ad(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,s=i?i.apply(this,o):o[0],u=a.cache;if(u.has(s))return u.get(s);var c=n.apply(this,o);return a.cache=u.set(s,c)||u,c};return a.cache=new(r.Cache||e),a}return r.Cache=e,ms=r,ms}var gs,sp;function bO(){if(sp)return gs;sp=1;var e=x0(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return gs=r,gs}var bs,up;function xO(){if(up)return bs;up=1;var e=bO(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,s,u,c){a.push(u?c.replace(r,"$1"):s||o)}),a});return bs=n,bs}var xs,cp;function od(){if(cp)return xs;cp=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=r(t[n],n,t);return a}return xs=e,xs}var ws,lp;function wO(){if(lp)return ws;lp=1;var e=mi(),t=od(),r=He(),n=on(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return t(s,o)+"";if(n(s))return a?a.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return ws=o,ws}var _s,fp;function w0(){if(fp)return _s;fp=1;var e=wO();function t(r){return r==null?"":e(r)}return _s=t,_s}var Os,dp;function _0(){if(dp)return Os;dp=1;var e=He(),t=td(),r=xO(),n=w0();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return Os=i,Os}var Ss,hp;function Ya(){if(hp)return Ss;hp=1;var e=on();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Ss=t,Ss}var As,pp;function sd(){if(pp)return As;pp=1;var e=_0(),t=Ya();function r(n,i){i=e(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[t(i[a++])];return a&&a==o?n:void 0}return As=r,As}var js,vp;function O0(){if(vp)return js;vp=1;var e=sd();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return js=t,js}var _O=O0();const at=le(_O);var Ps,yp;function OO(){if(yp)return Ps;yp=1;function e(t){return t==null}return Ps=e,Ps}var SO=OO();const Q=le(SO);var Ts,mp;function AO(){if(mp)return Ts;mp=1;var e=Dt(),t=He(),r=Rt(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return Ts=i,Ts}var jO=AO();const dr=le(jO);var PO=rd();const X=le(PO);var TO=Ht();const sn=le(TO);var Es={exports:{}},ne={};/**
|
|
1
|
+
import{r as R,j as v,u as l0,f as yt,s as fr,a as Nn,b as Ti,L as C_,c as Ei,g as le,R as P,l as kl,d as M_,e as lh,h as $_,i as I_,k as So,m as Ao,M as N_,S as fh,E as jo,n as D_,o as yn}from"./index-BAzJJeOV.js";import{u as ge,K as et,C as Pe}from"./theme-C0b3Oyq9.js";const Po=8,R_=26;function q_(){const[e,t]=R.useState(new Set),r=o=>t(s=>{const u=new Set(s);return u.has(o)?u.delete(o):u.add(o),u});return{topN:(o,s)=>e.has(s)?o:o.slice(0,Po),expandHeight:(o,s,u=R_)=>e.has(o)?Math.max(240,s*u):void 0,expandBtn:(o,s)=>{if(!(s<=Po))return v.jsx("button",{type:"button",className:"link-btn",onClick:()=>r(o),children:e.has(o)?`show top ${Po}`:`show all (${s})`})}}}function f0(e,t){var n;const r=((n=e==null?void 0:e.payload)==null?void 0:n[t])??(e==null?void 0:e[t]);return typeof r=="string"&&r!==""?r:null}function L_({active:e,payload:t,versionsByName:r}){var u,c,f,l;const{C:n,tooltipStyle:i}=ge();if(!e||!(t!=null&&t.length))return null;const a=String(((c=(u=t[0])==null?void 0:u.payload)==null?void 0:c.name)??""),o=Number(((l=(f=t[0])==null?void 0:f.payload)==null?void 0:l.n)??0),s=r.get(a)??[];return v.jsxs("div",{style:{...i.contentStyle,padding:"8px 10px",maxWidth:280},children:[v.jsx("div",{style:{color:n.text,fontWeight:600,marginBottom:4},children:a}),v.jsxs("div",{style:{color:n.muted,marginBottom:s.length?6:0},children:[o," firing",o===1?"":"s"," total"]}),s.map(d=>v.jsxs("div",{style:{color:n.text,display:"flex",justifyContent:"space-between",gap:12},children:[v.jsx("span",{style:{color:n.muted},children:d.version_id.slice(0,8)}),v.jsx("span",{children:d.n})]},d.version_id)),s.length>0&&v.jsx("div",{style:{color:n.muted,marginTop:6,fontSize:11},children:"click to open skill →"})]})}function Qf({x:e,y:t,payload:r,onSelect:n,title:i}){return v.jsx("text",{x:e,y:t,dy:4,textAnchor:"end",className:"axis-link",fontSize:11,onClick:()=>(r==null?void 0:r.value)&&n(r.value),"data-tip":i,children:r==null?void 0:r.value})}function B_(){const e=l0(),t=(n,i)=>{i!=null&&i!==""&&e(`/?${n}=${encodeURIComponent(i)}`)};return{drillFilter:t,drillTo:(n,i)=>a=>t(n,f0(a,i))}}const Ir="custom",Ka="all",d0=[{id:Ka,label:"All"},{id:"cost",label:"Cost",kpis:["cost","cost-per-session","total-tokens","token-breakdown","cache-read-ratio","sessions"],charts:["cost-over-time","tokens-over-time","tokens-by-model"]},{id:"reliability",label:"Reliability",kpis:["tool-error-rate","rejection-rate","workflow-runs","turns","turn-duration","session-duration","security"],charts:["tool-errors","error-types","activity"]},{id:"time",label:"Time",kpis:["sessions","total-tokens","cost","turn-duration","session-duration"],charts:["burn-heatmap","weekly-burn","model-latency","review-latency"]},{id:"activity",label:"Activity",kpis:["sessions","projects","turns","session-duration"],charts:["activity","category","complexity","tool-frequency","skill-activation","subagent-fanout"]}];function h0(e){return d0.find(t=>t.id===e)}const To="dashboard.layout",dh="dashboard.charts";function Ui(){return{hidden:[],order:[]}}function p0(){return{kpis:Ui(),charts:Ui()}}function F_(){return{v:1,active:Ka,custom:null,kpisCollapsed:!1}}function Cl(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function hh(e){if(typeof e!="object"||e===null)return Ui();const t=e;return{hidden:Cl(t.hidden),order:Cl(t.order)}}function W_(e){if(typeof e!="object"||e===null)return null;const t=e;return{kpis:hh(t.kpis),charts:hh(t.charts)}}function ph(e,t){if(typeof e!="object"||e===null){const n=Cl(t);if(n.length===0)return F_();const i=p0();return i.charts.hidden=n,{v:1,active:Ir,custom:i,kpisCollapsed:!1}}const r=e;return{v:1,active:typeof r.active=="string"?r.active:Ka,custom:W_(r.custom),kpisCollapsed:r.kpisCollapsed===!0}}function v0(e,t){const r=new Set(e),n=new Set,i=[];for(const a of t)r.has(a)&&!n.has(a)&&(i.push(a),n.add(a));for(const a of e)n.has(a)||i.push(a);return i}function zi(e,t){const r=new Map(e.map(n=>[n.id,n]));return v0(e.map(n=>n.id),t).map(n=>r.get(n))}function vh(e,t){if(!e)return Ui();const r=new Set(e);return{order:[...e],hidden:t.filter(n=>!r.has(n))}}function z_(e,t,r){return{kpis:vh(e.kpis,t),charts:vh(e.charts,r)}}function y0(e){return e.active!==Ir&&h0(e.active)?e.active:e.custom?Ir:Ka}function yh(e,t,r){const n=y0(e);return n!==Ir?z_(h0(n),t,r):e.custom??p0()}function U_(e,t){return{...e,active:Ir,custom:t}}function K_(e,t,r,n){const i=v0(e,t),a=i.indexOf(r),o=a+n;return a<0||o<0||o>=i.length?t:([i[a],i[o]]=[i[o],i[a]],i)}function H_(e,t,r){const n=e.filter(i=>i!==t);return r||n.push(t),n}function G_({s:e}){const t=new Map(e.by_severity.map(a=>[a.severity,a.n])),r=t.get("critical")??0,n=t.get("high")??0,i=e.total===0?"—":`${r} / ${n}`;return v.jsxs(C_,{className:"kpi kpi-btn"+(r>0?" sev-critical":n>0?" sev-high":""),to:"/security","data-tip":"Security findings — critical / high. Opens the Security page.",children:[v.jsx("div",{className:"kpi-label",children:"Security findings"}),v.jsx("div",{className:"kpi-value",children:i}),v.jsx("div",{className:"kpi-sub",children:e.total===0?"no open findings":`critical / high · ${e.total} open in ${e.sessions_flagged} sessions`})]})}function V_({t:e}){const{TOKEN_COLORS:t}=ge(),r=e.input+e.output+e.cache_creation+e.cache_read,n=[{name:"Input",v:e.input,c:t.input},{name:"Output",v:e.output,c:t.output},{name:"Cache write",v:e.cache_creation,c:t.cache_creation},{name:"Cache read",v:e.cache_read,c:t.cache_read}];return v.jsxs("div",{className:"kpi","data-tip":"Token totals by type: input · output · cache-write · cache-read",children:[v.jsx("div",{className:"kpi-label",children:"Token breakdown"}),v.jsx("ul",{className:"kpi-bd",children:n.map(i=>v.jsxs("li",{children:[v.jsx("span",{className:"kpi-bd-dot",style:{background:i.c},"aria-hidden":"true"}),v.jsx("span",{className:"kpi-bd-name",children:i.name}),v.jsx("span",{className:"kpi-bd-val",children:yt(i.v)}),v.jsxs("span",{className:"kpi-bd-pct",children:[r?Math.round(i.v/r*100):0,"%"]})]},i.name))})]})}function mh({overview:e,bd:t}){var a,o;const r=((a=t==null?void 0:t.error_types)==null?void 0:a.failures)??0,n=((o=t==null?void 0:t.error_types)==null?void 0:o.rejections)??0,i=e.tool_calls??0;return{failures:r,rejections:n,toolCalls:i,errRate:i?r/i*100:0,rejRate:i?n/i*100:0}}const ed=[{id:"sessions",label:"Sessions",render:({overview:e})=>v.jsx(et,{label:"Sessions",value:e.sessions_main,sub:`+${e.sessions_subagent.toLocaleString()} subagent runs`})},{id:"projects",label:"Projects",render:({overview:e})=>v.jsx(et,{label:"Projects",value:e.projects,sub:"distinct project paths"})},{id:"turns",label:"Turns",render:({overview:e})=>v.jsx(et,{label:"Turns",value:e.turns,sub:`${e.tool_calls.toLocaleString()} tool calls`})},{id:"tool-error-rate",label:"Tool error rate",render:e=>{const{failures:t,toolCalls:r,errRate:n}=mh(e);return v.jsx(et,{label:"Tool error rate",value:r?n.toFixed(1)+"%":"—",tip:"Genuine tool failures as a share of all tool calls (rejections/blocks excluded — see the rejection rate).",sub:`${t.toLocaleString()} failed of ${r.toLocaleString()} calls`})}},{id:"rejection-rate",label:"Rejection rate",render:e=>{const{rejections:t,toolCalls:r,rejRate:n}=mh(e);return v.jsx(et,{label:"Rejection rate",value:r?n.toFixed(1)+"%":"—",tip:"User-rejected + guardrail-blocked tool calls as a share of all tool calls. Not agent failures.",sub:`${t.toLocaleString()} rejected/blocked`})}},{id:"workflow-runs",label:"Workflow runs",render:({overview:e})=>v.jsx(et,{label:"Workflow runs",value:e.workflows.total||"—",tip:"Async workflow runs in range. Success rate is over decided runs (completed vs failed); in-flight runs are excluded from the rate.",sub:e.workflows.total?`${Math.round(e.workflows.success_rate*100)}% success · ${yt(e.workflows.total_tokens)}`:"no workflow runs"})},{id:"cost",label:"Est. cost",render:({overview:e})=>v.jsx(et,{label:"Est. cost (API-equiv.)",value:Nn(e.cost),tip:"Estimated at API list prices for this usage (cache reads/writes included at their discounted cache rates).",sub:e.unpriced_models.length?`⚠ unpriced: ${e.unpriced_models.map(fr).join(", ")}`:"API list price estimate"})},{id:"cost-per-session",label:"Cost / session",render:({overview:e})=>v.jsx(et,{label:"Cost / session",value:e.sessions_main?Nn(e.cost/e.sessions_main):"—",tip:"Estimated API-equivalent cost divided by main sessions in range.",sub:"API-equiv. per main session"})},{id:"cache-read-ratio",label:"Cache-read ratio",render:({overview:e})=>v.jsx(et,{label:"Cache-read ratio",value:(e.cache_read_ratio*100).toFixed(1)+"%",sub:"of all tokens are cached replays — excluded from “work”"})},{id:"turn-duration",label:"Turn duration",render:({overview:e})=>v.jsx(et,{label:"Turn duration p50 / p95",value:`${Ti(e.turn_duration_ms.p50)} / ${Ti(e.turn_duration_ms.p95)}`,sub:`${e.turn_duration_ms.count} turns`})},{id:"session-duration",label:"Session duration",render:({overview:e})=>v.jsx(et,{label:"Session duration p50 / p95",value:`${Ti(e.session_duration_ms.p50)} / ${Ti(e.session_duration_ms.p95)}`,tip:"End-to-end wall-clock length of main sessions (subagents excluded).",sub:`${e.session_duration_ms.count} sessions`})},{id:"total-tokens",label:"Total tokens",render:({overview:e})=>v.jsx(et,{label:"Total tokens",value:yt(e.total_tokens),sub:`${yt(e.tokens.input+e.tokens.output)} non-cache`})},{id:"token-breakdown",label:"Token breakdown",render:({overview:e})=>v.jsx(V_,{t:e.tokens})},{id:"security",label:"Security findings",render:({security:e})=>e?v.jsx(G_,{s:e}):null}];function X_({ctx:e,layout:t}){const r=new Set(t.hidden);return v.jsx("div",{className:"kpis",children:zi(ed,t.order).filter(n=>!r.has(n.id)).map(n=>v.jsx(R.Fragment,{children:n.render(e)},n.id))})}function m0(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=m0(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ee(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=m0(e))&&(n&&(n+=" "),n+=t);return n}var Eo,gh;function He(){if(gh)return Eo;gh=1;var e=Array.isArray;return Eo=e,Eo}var ko,bh;function g0(){if(bh)return ko;bh=1;var e=typeof Ei=="object"&&Ei&&Ei.Object===Object&&Ei;return ko=e,ko}var Co,xh;function St(){if(xh)return Co;xh=1;var e=g0(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Co=r,Co}var Mo,wh;function mi(){if(wh)return Mo;wh=1;var e=St(),t=e.Symbol;return Mo=t,Mo}var $o,_h;function Y_(){if(_h)return $o;_h=1;var e=mi(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function a(o){var s=r.call(o,i),u=o[i];try{o[i]=void 0;var c=!0}catch{}var f=n.call(o);return c&&(s?o[i]=u:delete o[i]),f}return $o=a,$o}var Io,Oh;function Z_(){if(Oh)return Io;Oh=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Io=r,Io}var No,Sh;function Dt(){if(Sh)return No;Sh=1;var e=mi(),t=Y_(),r=Z_(),n="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?t(s):r(s)}return No=o,No}var Do,Ah;function Rt(){if(Ah)return Do;Ah=1;function e(t){return t!=null&&typeof t=="object"}return Do=e,Do}var Ro,jh;function on(){if(jh)return Ro;jh=1;var e=Dt(),t=Rt(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Ro=n,Ro}var qo,Ph;function td(){if(Ph)return qo;Ph=1;var e=He(),t=on(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(e(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return qo=i,qo}var Lo,Th;function Ht(){if(Th)return Lo;Th=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Lo=e,Lo}var Bo,Eh;function rd(){if(Eh)return Bo;Eh=1;var e=Dt(),t=Ht(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var u=e(s);return u==n||u==i||u==r||u==a}return Bo=o,Bo}var Fo,kh;function J_(){if(kh)return Fo;kh=1;var e=St(),t=e["__core-js_shared__"];return Fo=t,Fo}var Wo,Ch;function Q_(){if(Ch)return Wo;Ch=1;var e=J_(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Wo=r,Wo}var zo,Mh;function b0(){if(Mh)return zo;Mh=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return zo=r,zo}var Uo,$h;function eO(){if($h)return Uo;$h=1;var e=rd(),t=Q_(),r=Ht(),n=b0(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,f=RegExp("^"+u.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(d){if(!r(d)||t(d))return!1;var h=e(d)?f:a;return h.test(n(d))}return Uo=l,Uo}var Ko,Ih;function tO(){if(Ih)return Ko;Ih=1;function e(t,r){return t==null?void 0:t[r]}return Ko=e,Ko}var Ho,Nh;function mr(){if(Nh)return Ho;Nh=1;var e=eO(),t=tO();function r(n,i){var a=t(n,i);return e(a)?a:void 0}return Ho=r,Ho}var Go,Dh;function Ha(){if(Dh)return Go;Dh=1;var e=mr(),t=e(Object,"create");return Go=t,Go}var Vo,Rh;function rO(){if(Rh)return Vo;Rh=1;var e=Ha();function t(){this.__data__=e?e(null):{},this.size=0}return Vo=t,Vo}var Xo,qh;function nO(){if(qh)return Xo;qh=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Xo=e,Xo}var Yo,Lh;function iO(){if(Lh)return Yo;Lh=1;var e=Ha(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(e){var s=o[a];return s===t?void 0:s}return n.call(o,a)?o[a]:void 0}return Yo=i,Yo}var Zo,Bh;function aO(){if(Bh)return Zo;Bh=1;var e=Ha(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var a=this.__data__;return e?a[i]!==void 0:r.call(a,i)}return Zo=n,Zo}var Jo,Fh;function oO(){if(Fh)return Jo;Fh=1;var e=Ha(),t="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&i===void 0?t:i,this}return Jo=r,Jo}var Qo,Wh;function sO(){if(Wh)return Qo;Wh=1;var e=rO(),t=nO(),r=iO(),n=aO(),i=oO();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Qo=a,Qo}var es,zh;function uO(){if(zh)return es;zh=1;function e(){this.__data__=[],this.size=0}return es=e,es}var ts,Uh;function nd(){if(Uh)return ts;Uh=1;function e(t,r){return t===r||t!==t&&r!==r}return ts=e,ts}var rs,Kh;function Ga(){if(Kh)return rs;Kh=1;var e=nd();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return rs=t,rs}var ns,Hh;function cO(){if(Hh)return ns;Hh=1;var e=Ga(),t=Array.prototype,r=t.splice;function n(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():r.call(a,o,1),--this.size,!0}return ns=n,ns}var is,Gh;function lO(){if(Gh)return is;Gh=1;var e=Ga();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return is=t,is}var as,Vh;function fO(){if(Vh)return as;Vh=1;var e=Ga();function t(r){return e(this.__data__,r)>-1}return as=t,as}var os,Xh;function dO(){if(Xh)return os;Xh=1;var e=Ga();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return os=t,os}var ss,Yh;function Va(){if(Yh)return ss;Yh=1;var e=uO(),t=cO(),r=lO(),n=fO(),i=dO();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ss=a,ss}var us,Zh;function id(){if(Zh)return us;Zh=1;var e=mr(),t=St(),r=e(t,"Map");return us=r,us}var cs,Jh;function hO(){if(Jh)return cs;Jh=1;var e=sO(),t=Va(),r=id();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return cs=n,cs}var ls,Qh;function pO(){if(Qh)return ls;Qh=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return ls=e,ls}var fs,ep;function Xa(){if(ep)return fs;ep=1;var e=pO();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return fs=t,fs}var ds,tp;function vO(){if(tp)return ds;tp=1;var e=Xa();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return ds=t,ds}var hs,rp;function yO(){if(rp)return hs;rp=1;var e=Xa();function t(r){return e(this,r).get(r)}return hs=t,hs}var ps,np;function mO(){if(np)return ps;np=1;var e=Xa();function t(r){return e(this,r).has(r)}return ps=t,ps}var vs,ip;function gO(){if(ip)return vs;ip=1;var e=Xa();function t(r,n){var i=e(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return vs=t,vs}var ys,ap;function ad(){if(ap)return ys;ap=1;var e=hO(),t=vO(),r=yO(),n=mO(),i=gO();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var c=o[s];this.set(c[0],c[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ys=a,ys}var ms,op;function x0(){if(op)return ms;op=1;var e=ad(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,s=i?i.apply(this,o):o[0],u=a.cache;if(u.has(s))return u.get(s);var c=n.apply(this,o);return a.cache=u.set(s,c)||u,c};return a.cache=new(r.Cache||e),a}return r.Cache=e,ms=r,ms}var gs,sp;function bO(){if(sp)return gs;sp=1;var e=x0(),t=500;function r(n){var i=e(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return gs=r,gs}var bs,up;function xO(){if(up)return bs;up=1;var e=bO(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,s,u,c){a.push(u?c.replace(r,"$1"):s||o)}),a});return bs=n,bs}var xs,cp;function od(){if(cp)return xs;cp=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=r(t[n],n,t);return a}return xs=e,xs}var ws,lp;function wO(){if(lp)return ws;lp=1;var e=mi(),t=od(),r=He(),n=on(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(r(s))return t(s,o)+"";if(n(s))return a?a.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return ws=o,ws}var _s,fp;function w0(){if(fp)return _s;fp=1;var e=wO();function t(r){return r==null?"":e(r)}return _s=t,_s}var Os,dp;function _0(){if(dp)return Os;dp=1;var e=He(),t=td(),r=xO(),n=w0();function i(a,o){return e(a)?a:t(a,o)?[a]:r(n(a))}return Os=i,Os}var Ss,hp;function Ya(){if(hp)return Ss;hp=1;var e=on();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Ss=t,Ss}var As,pp;function sd(){if(pp)return As;pp=1;var e=_0(),t=Ya();function r(n,i){i=e(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[t(i[a++])];return a&&a==o?n:void 0}return As=r,As}var js,vp;function O0(){if(vp)return js;vp=1;var e=sd();function t(r,n,i){var a=r==null?void 0:e(r,n);return a===void 0?i:a}return js=t,js}var _O=O0();const at=le(_O);var Ps,yp;function OO(){if(yp)return Ps;yp=1;function e(t){return t==null}return Ps=e,Ps}var SO=OO();const Q=le(SO);var Ts,mp;function AO(){if(mp)return Ts;mp=1;var e=Dt(),t=He(),r=Rt(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return Ts=i,Ts}var jO=AO();const dr=le(jO);var PO=rd();const X=le(PO);var TO=Ht();const sn=le(TO);var Es={exports:{}},ne={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-is.production.min.js
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as c,p as h,j as e,D as o,L as r,w as n}from"./index-
|
|
1
|
+
import{J as c,p as h,j as e,D as o,L as r,w as n}from"./index-BAzJJeOV.js";import{relPath as p,LinesDelta as m}from"./FilesView-MMsd5fgG.js";function v(){const[i]=c(),l=i.get("path")??"",a=i.get("project")??"",t=new URLSearchParams({path:l});a&&t.set("project",a);const s=h(l?"/file?"+t.toString():null);return e.jsx(o,{state:s,empty:e.jsx("div",{className:"muted pad",children:"Not found."}),children:d=>e.jsx(j,{data:d})})}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:["📄 ",p(i.file_path,i.project_path)]}),e.jsxs("div",{className:"skill-head-meta muted",children:[e.jsx("span",{"data-tip":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:[n(i.first_ts)," · ",n(i.last_ts)]})]})]}),i.sessions.map(l=>{var t;const a=(t=l.changes.find(s=>s.event_uuid))==null?void 0:t.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","data-tip":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})," ",n(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","data-tip":"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(m,{added:s.lines_added,removed:s.lines_removed})}),e.jsx("td",{className:"muted","data-tip":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:n(s.timestamp)})]},s.id))})]})]},l.session_id)}),e.jsx("p",{className:"muted pad",children:"Tracked from Edit/Write tool calls plus unambiguous shell writes (heredoc, tee, sed -i, redirects) — other shell changes and edits made outside sessions aren’t captured."})]})}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as E,k as x,r as F,p as C,j as e,H as P,E as k,n as D,I as n,L as I,w as K,P as $}from"./index-
|
|
1
|
+
import{i as E,k as x,r as F,p as C,j as e,H as P,E as k,n as D,I as n,L as I,w as K,P as $}from"./index-BAzJJeOV.js";const i=50,M={total:0,files:[]};function w(t,a){return a&&t.startsWith(a.replace(/\/$/,"")+"/")?t.slice(a.replace(/\/$/,"").length+1):t}function A({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}=E(["offset"]),f=x("/sources",[]),b=x("/projects",[]),[h,u]=F.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 r=t("sort","last_ts"),l=t("dir")==="asc"?"asc":"desc";function c(s,q){a({sort:s,dir:r===s?l==="asc"?"desc":"asc":q})}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:r,dir:l,onSort:c,defaultDir:"asc"}),e.jsx("th",{children:"Project"}),e.jsx(n,{label:"Sessions",sortKey:"sessions",active:r,dir:l,onSort:c,className:"num"}),e.jsx(n,{label:"Changes",sortKey:"changes",active:r,dir:l,onSort:c,className:"num"}),e.jsx("th",{className:"num",children:"+ / −"}),e.jsx(n,{label:"Last touched",sortKey:"last_ts",active:r,dir:l,onSort:c})]})}),e.jsx("tbody",{children:m.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(I,{to:`/file?path=${encodeURIComponent(s.file_path)}${s.project_id?`&project=${encodeURIComponent(s.project_id)}`:""}`,className:"title","data-tip":s.file_path,children:w(s.file_path,s.project_path)})}),e.jsx("td",{children:s.project_path?e.jsx("span",{className:"tag","data-tip":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(A,{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($,{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 plus unambiguous shell writes (heredoc, tee, sed -i, redirects) — other shell changes and edits made outside sessions aren’t captured."})]})}export{A as LinesDelta,G as default,w as relPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as ie,k as E,r as k,F as ae,p as ne,j as e,S as h,H as le,K as x,E as re,n as ce,I as $,P as oe,w as de,L as ue}from"./index-DiDvUUQ7.js";import{u as I,S as he,a as pe}from"./useResetOn-D_B_9yU4.js";const P=50,me={total:0,findings:[]},je=new Set;function ke(){const{get:t,set:a,clear:l}=ie(),n=E("/sources",[]),M=E("/projects",[]),[p,f]=k.useState(!1),[m,B]=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,[m]),W=E(h?null:"/security/mutes",[],[m]),L=`${w.toString()}|${r.key}|${r.dir}`,[C,G]=I(L,1),[o,O]=I(`${L}|${C}|${m}`,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:[m]}),[q,H]=I(`${L}|${C}|${m}`,null),J=q??Y,{total:j,findings:K}=V??me,g=k.useCallback(async s=>{f(!0),H(null);try{await s(),B(c=>c+1)}catch(c){H(String(c))}finally{f(!1)}},[]),X=k.useMemo(()=>new Map(((i==null?void 0:i.by_severity)??[]).map(s=>[s.severity,s.n])),[i]),Q=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||Q.some(U=>U.rule_id===v&&(!c||U.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"}),Q.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:p,onClick:()=>g(()=>x("/security/dismiss",{ids:[...o]})),children:["✓ Mark ",o.size," safe"]}),o.size>0&&d==="dismissed"&&e.jsxs("button",{type:"button",disabled:p,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:p,onClick:()=>{confirm(`Dismiss all ${j} open findings matching the current filter as safe?`)&&g(()=>x("/security/dismiss-matching",{filter:Object.fromEntries(w)}))},"data-tip":"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:p,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:G}),!h&&W.length>0&&e.jsx(xe,{mutes:W,busy:p,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:p,onMute:f}){const m=`/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(pe,{severity:t.severity}),t.dismissed?e.jsx("span",{className:"tag dismissed","data-tip":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","data-tip":"Tool the finding fired on",children:t.tool_name}),e.jsx("code",{"data-tip":t.evidence??"",children:t.evidence})]}),e.jsx("td",{className:"small muted","data-tip":t.started_at??"",children:de(t.started_at??null)}),e.jsxs("td",{className:"small",children:[e.jsx(ue,{to:m,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:p,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,"data-tip":`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};
|
|
1
|
+
import{i as ie,k as E,r as k,F as ae,p as ne,j as e,S as h,H as le,K as x,E as re,n as ce,I as $,P as oe,w as de,L as ue}from"./index-BAzJJeOV.js";import{u as I,S as he,a as pe}from"./useResetOn-wnsToI6F.js";const P=50,me={total:0,findings:[]},je=new Set;function ke(){const{get:t,set:a,clear:l}=ie(),n=E("/sources",[]),M=E("/projects",[]),[p,f]=k.useState(!1),[m,B]=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,[m]),W=E(h?null:"/security/mutes",[],[m]),L=`${w.toString()}|${r.key}|${r.dir}`,[C,G]=I(L,1),[o,O]=I(`${L}|${C}|${m}`,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:[m]}),[q,H]=I(`${L}|${C}|${m}`,null),J=q??Y,{total:j,findings:K}=V??me,g=k.useCallback(async s=>{f(!0),H(null);try{await s(),B(c=>c+1)}catch(c){H(String(c))}finally{f(!1)}},[]),X=k.useMemo(()=>new Map(((i==null?void 0:i.by_severity)??[]).map(s=>[s.severity,s.n])),[i]),Q=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||Q.some(U=>U.rule_id===v&&(!c||U.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"}),Q.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:p,onClick:()=>g(()=>x("/security/dismiss",{ids:[...o]})),children:["✓ Mark ",o.size," safe"]}),o.size>0&&d==="dismissed"&&e.jsxs("button",{type:"button",disabled:p,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:p,onClick:()=>{confirm(`Dismiss all ${j} open findings matching the current filter as safe?`)&&g(()=>x("/security/dismiss-matching",{filter:Object.fromEntries(w)}))},"data-tip":"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:p,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:G}),!h&&W.length>0&&e.jsx(xe,{mutes:W,busy:p,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:p,onMute:f}){const m=`/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(pe,{severity:t.severity}),t.dismissed?e.jsx("span",{className:"tag dismissed","data-tip":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","data-tip":"Tool the finding fired on",children:t.tool_name}),e.jsx("code",{"data-tip":t.evidence??"",children:t.evidence})]}),e.jsx("td",{className:"small muted","data-tip":t.started_at??"",children:de(t.started_at??null)}),e.jsxs("td",{className:"small",children:[e.jsx(ue,{to:m,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:p,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,"data-tip":`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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{S as Ts,j as s,p as ns,d as Es,q as ye,r as u,L as W,f as oe,t as as,a as Is,v as Os,b as Z,w as ls,s as As,x as Ee,e as ke,h as be,l as $s,y as Rs,z as Ds,i as Fs,E as Ls,n as Ps,A as Be}from"./index-
|
|
1
|
+
import{S as Ts,j as s,p as ns,d as Es,q as ye,r as u,L as W,f as oe,t as as,a as Is,v as Os,b as Z,w as ls,s as As,x as Ee,e as ke,h as be,l as $s,y as Rs,z as Ds,i as Fs,E as Ls,n as Ps,A as Be}from"./index-BAzJJeOV.js";import{C as J,A as Me,p as X}from"./jsonish-CTF43Da0.js";import{S as _e,a as rs,u as qs}from"./useResetOn-wnsToI6F.js";import{M as Bs,r as Hs}from"./index-BInWVVgH.js";import{u as Us}from"./theme-C0b3Oyq9.js";function Ks({id:e}){return Ts?null:s.jsx(Gs,{id:e})}function Gs({id:e}){const{data:t}=ns("/sessions/"+e+"/location",{reset:!0});return t?s.jsx(J,{text:t.path,className:"copy-archive-path",label:"Copy archive path",title:"Copy archive path",tip:`Copies the path to this session's full raw trace, the archived .jsonl transcript with every event verbatim, so you can point another agent on this machine straight at it.
|
|
2
2
|
|
|
3
3
|
`+t.path+(t.exists?"":`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as x,p as j,j as s,D as v,i as f,r as d,L as m,w as c}from"./index-
|
|
1
|
+
import{y as x,p as j,j as s,D as v,i as f,r as d,L as m,w as c}from"./index-BAzJJeOV.js";import{M as p,r as N}from"./index-BInWVVgH.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(p,{remarkPlugins:[N],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{i as q,k,r as c,F,p as E,G as C,j as e,H as I,E as R,n as w,I as d,L as K,w as M,P as D}from"./index-
|
|
1
|
+
import{i as q,k,r as c,F,p as E,G as C,j as e,H as I,E as R,n as w,I as d,L as K,w as M,P as D}from"./index-BAzJJeOV.js";const u=50,$={name:t=>t.name,fired:t=>t.call_count,last_fired:t=>t.last_fired};function G(){const{params:t,get:l,set:n,pick:v}=q(),f=k("/sources",[]),y=k("/projects",[]),[h,m]=c.useState(l("q")),{sort:a,toggle:i}=F("fired","desc"),[N,j]=c.useState(1),p=v(["source","project","q"]),{data:x,loading:g,error:_}=E("/skills"+(p.toString()?"?"+p:""));function L(s){s.preventDefault(),n({q:h.trim()})}c.useEffect(()=>j(1),[t,a.key,a.dir]);const r=c.useMemo(()=>C(x??[],$[a.key],a.dir),[x,a.key,a.dir]),b=Math.max(1,Math.ceil(r.length/u)),o=Math.min(N,b),P=r.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"}),l("q")&&e.jsx("button",{type:"button",className:"ghost",onClick:()=>(m(""),n({q:""})),children:"clear"})]}),e.jsxs("select",{"aria-label":"Filter by source",value:l("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(I,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:l("project"),onChange:s=>n({project:s}),options:[{value:"",label:"all projects"},...y.map(s=>({value:s.id,label:s.path.replace(/^.*\//,"")}))]})]}),e.jsx(R,{error:_}),g?e.jsx(w,{}):r.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","data-tip":`${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&&r.length>0&&e.jsx(D,{page:o,pages:b,total:r.length,unit:"skills",onPage:j})]})}export{G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,r as C,y as B,p as G,D as K,L as T,s as L,f as W,a as q,b as Y,w as z}from"./index-DiDvUUQ7.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-DDjKYx9o.js";import{M as F,r as J}from"./index-CtNviuC1.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 D(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=D(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=D(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(I,{value:r,depth:a+1})})]})}function I({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(I,{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}=B(),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",{"data-tip":"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 B,p as G,D as K,L as T,s as L,f as W,a as q,b as Y,w as z}from"./index-BAzJJeOV.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-CTF43Da0.js";import{M as F,r as J}from"./index-BInWVVgH.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 D(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=D(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=D(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(I,{value:r,depth:a+1})})]})}function I({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(I,{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}=B(),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",{"data-tip":"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};
|