0sec-cli 0.17.0 → 0.21.4
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/{0sec.js → 0.js} +92 -79
- package/LICENSE +1 -1
- package/README.md +77 -37
- package/chunks/adapt-loop-IGBRQAXO.js +18 -0
- package/chunks/{adgraph-JLGA6RYI.js → adgraph-AUDQTBYA.js} +5 -5
- package/chunks/agent/skills/frameworks/entra-id.yaml +2 -2
- package/chunks/agent/skills/techniques/assumption-mining.yaml +2 -2
- package/chunks/agent/skills/techniques/cve-poc-adaptation.yaml +2 -2
- package/chunks/agent/skills/techniques/entra-attack-paths.yaml +1 -1
- package/chunks/agent/skills/techniques/kernel-weaponization.yaml +1 -1
- package/chunks/agent/skills/techniques/llm-prompt-injection.yaml +2 -2
- package/chunks/agent/skills/techniques/npm-ecosystem.yaml +1 -1
- package/chunks/agent/skills/techniques/poc-verification.yaml +1 -1
- package/chunks/agent/skills/techniques/seedless-depth-review.yaml +20 -38
- package/chunks/{artifact-scraper-GJEZMOHF.js → artifact-scraper-LNQJUORS.js} +6 -6
- package/chunks/{assumption-mining-BVMMUZHB.js → assumption-mining-4MJTP6H5.js} +24 -26
- package/chunks/{chunk-P6WKNFWX.js → chunk-2OQOQ2FZ.js} +8 -8
- package/chunks/{chunk-5G3ZXFBW.js → chunk-2WNCI664.js} +3 -3
- package/chunks/{chunk-HDWV7PGI.js → chunk-2WSXFFJZ.js} +4 -4
- package/chunks/{chunk-DW5UWPFY.js → chunk-4VGLO2YS.js} +6 -5
- package/chunks/{chunk-SNKTC4BP.js → chunk-5T6D5BVY.js} +88 -88
- package/chunks/{chunk-OEFNRYI2.js → chunk-6GHSR47F.js} +3 -6
- package/chunks/chunk-6YNKRUMC.js +4474 -0
- package/chunks/{chunk-O462Y7P2.js → chunk-ANDKY54G.js} +22317 -19616
- package/chunks/{chunk-53G27VPS.js → chunk-AZ7L3HFD.js} +7 -2
- package/chunks/{chunk-2SANI5RH.js → chunk-BACXRTQ4.js} +691 -318
- package/chunks/{chunk-SOG2U7B3.js → chunk-CAJJRUTV.js} +4 -4
- package/chunks/{chunk-57ZENEX2.js → chunk-CGHCEN7W.js} +3 -3
- package/chunks/{chunk-VGRDNSHA.js → chunk-CL5KAUM6.js} +17 -16
- package/chunks/{chunk-QOKTUOU2.js → chunk-CXKDWFNO.js} +6 -6
- package/chunks/{chunk-RWONANDA.js → chunk-DQTNI3KY.js} +5 -5
- package/chunks/{chunk-K26SZ37E.js → chunk-E2UOY5PJ.js} +288 -100
- package/chunks/{chunk-CLHCDHP4.js → chunk-ER3SUMYJ.js} +40 -18
- package/chunks/{chunk-IORC6MQX.js → chunk-FAH6V4QM.js} +31964 -32279
- package/chunks/{chunk-6LKRLK2R.js → chunk-FHC2B7LN.js} +3 -3
- package/chunks/{chunk-4Y4KQJXE.js → chunk-FWAYJ2IV.js} +16 -16
- package/chunks/{chunk-WVTBZEQO.js → chunk-G34QP2XW.js} +8 -8
- package/chunks/{chunk-MYVT64FN.js → chunk-GHWODZMR.js} +2 -2
- package/chunks/{chunk-F3WBKITT.js → chunk-GIQKESMN.js} +10 -10
- package/chunks/{chunk-2RMLOJVB.js → chunk-GVD6SJGH.js} +2 -2
- package/chunks/{chunk-RDZYQQLW.js → chunk-HBKCGJAV.js} +7 -7
- package/chunks/{chunk-SF4KZ4O3.js → chunk-HLFS6WV2.js} +2 -2
- package/chunks/chunk-HPQZHOIU.js +67 -0
- package/chunks/{chunk-3QFDYBZQ.js → chunk-IMGWPNQM.js} +231 -1308
- package/chunks/{chunk-3MOLBTLS.js → chunk-K2PWUPUI.js} +2 -2
- package/chunks/{chunk-MMLDQR4H.js → chunk-NDJU5ZZ7.js} +14 -14
- package/chunks/{chunk-H44E2CRN.js → chunk-NOPBXZUV.js} +3 -3
- package/chunks/{chunk-HE7LCA7G.js → chunk-O6SD4A36.js} +3 -3
- package/chunks/{chunk-SAFFWQW4.js → chunk-P6YG6TEZ.js} +6 -6
- package/chunks/{chunk-KKGE5RQE.js → chunk-PC6RCKQV.js} +198 -11
- package/chunks/{chunk-LP3HHYQU.js → chunk-PD2BBBKT.js} +2 -2
- package/chunks/{chunk-BKZFDZ23.js → chunk-QCUFBVIZ.js} +3 -3
- package/chunks/{chunk-KLTNTE2Z.js → chunk-QZVG3BG4.js} +14 -14
- package/chunks/{chunk-D6S3IIPG.js → chunk-RF5QGKLR.js} +9 -9
- package/chunks/{chunk-LOHTE223.js → chunk-SBMB4OL3.js} +9 -9
- package/chunks/{chunk-IOL7D5YV.js → chunk-SQCBHFWN.js} +3 -3
- package/chunks/{chunk-A6CLR72I.js → chunk-TF46UWFU.js} +3 -3
- package/chunks/chunk-TH2LW437.js +7829 -0
- package/chunks/chunk-TRH2PJSN.js +547 -0
- package/chunks/{chunk-RJWOYEOG.js → chunk-UEX7PFSE.js} +5 -5
- package/chunks/{chunk-VQG4FT5D.js → chunk-UFHN6RIU.js} +2 -2
- package/chunks/{chunk-WU6AFRAZ.js → chunk-V36HVTUL.js} +12 -12
- package/chunks/{chunk-IR537GON.js → chunk-VCSFCHAJ.js} +2 -2
- package/chunks/{chunk-YLMN3N25.js → chunk-VIT5ALXF.js} +3 -3
- package/chunks/{chunk-UJ4IK5PO.js → chunk-VOAXLO4A.js} +10 -10
- package/chunks/{chunk-UM3ZNQIM.js → chunk-W4JOXE4N.js} +100 -84
- package/chunks/{chunk-DN25OQQA.js → chunk-WF5W75WY.js} +25 -25
- package/chunks/{chunk-QKICO43A.js → chunk-WPQLBN4S.js} +5 -5
- package/chunks/{chunk-HT6P7RY3.js → chunk-WZISK5VC.js} +37 -35
- package/chunks/{chunk-QJQKHO7G.js → chunk-Y5H6E24H.js} +3 -3
- package/chunks/{chunk-KTQDLNSR.js → chunk-YA4PUM4H.js} +41 -41
- package/chunks/{chunk-47TQJWDH.js → chunk-YHWWF4QY.js} +9 -9
- package/chunks/{chunk-2CJ776PV.js → chunk-YPOA3W4O.js} +48 -39
- package/chunks/{chunk-7DQEV5QI.js → chunk-Z3IKZX3X.js} +4 -4
- package/chunks/codex-models-TYYV4JNN.js +15 -0
- package/chunks/{commands-U3AMV5ZU.js → commands-WF5RG4I2.js} +5620 -2513
- package/chunks/corpus-v1.json +2 -2
- package/chunks/data/appsec-archetypes.json +2 -2
- package/chunks/data/chromium-archetypes.json +1 -1
- package/chunks/data/freebsd-archetypes.json +1 -1
- package/chunks/data/kernel-archetypes.json +2 -2
- package/chunks/db-U3WQZVAO.js +16 -0
- package/chunks/{disclose-A6AEIEDA.js → disclose-67GZCDBO.js} +5 -5
- package/chunks/{dist-JR67XKYO.js → dist-ACC3DZUZ.js} +11 -5
- package/chunks/{dist-GL66KMUX.js → dist-EVTN3UTT.js} +6 -6
- package/chunks/{dist-FDKALV4R.js → dist-F6X62TQK.js} +290 -327
- package/chunks/dist-KEULE5IQ.js +21914 -0
- package/chunks/dist-XZB53PS5.js +53 -0
- package/chunks/eval-runner-SA6OUGHZ.js +26 -0
- package/chunks/example-manifest.json +2 -2
- package/chunks/{exploit-agent-XP23ISN7.js → exploit-agent-36Q7XQFP.js} +4 -4
- package/chunks/{exploit-autoclimb-E6T7RRSC.js → exploit-autoclimb-J4OTSTZ6.js} +6 -6
- package/chunks/{exploit-climb-2FAUP6XU.js → exploit-climb-PYEJDIC4.js} +12 -12
- package/chunks/fix-J2KBRJDV.js +12 -0
- package/chunks/{github-issues-MJ6OYOOU.js → github-issues-IGTTWM7V.js} +7 -7
- package/chunks/harness-GDUMKGSE.js +22 -0
- package/chunks/http-conformance-U5F6GKYG.js +11 -0
- package/chunks/http-sender-I5XFFY35.js +10 -0
- package/chunks/hunt-scan-UDJSCISU.js +36 -0
- package/chunks/{identity-6ZAIIWOR.js → identity-JTIVJSV7.js} +5 -5
- package/chunks/{kernel-primitive-TENE3R7T.js → kernel-primitive-F2IXUFAX.js} +6 -6
- package/chunks/{kernel-vm-runner-4F6QSNFY.js → kernel-vm-runner-276LHIOV.js} +6 -6
- package/chunks/memsafety-scan-NHUOGTEX.js +16 -0
- package/chunks/{native-loop-NTONUDP7.js → native-loop-3BSYVDUI.js} +17 -18
- package/chunks/{npm-detectors-KB5Y5ZFX.js → npm-detectors-VIYJXKFQ.js} +6 -6
- package/chunks/npm-dynamic-discovery-5J7FT3XM.js +13 -0
- package/chunks/orchestrate-DHBFRTSI.js +59 -0
- package/chunks/{pre-recon-cve-66EB6G4M.js → pre-recon-cve-X2K2P5YQ.js} +4 -4
- package/chunks/prepare-KYHGFWCJ.js +13 -0
- package/chunks/process-PNMC36JI.js +15 -0
- package/chunks/{replay-runner-RRR4E2A7.js → replay-runner-LK2XFIVG.js} +7 -7
- package/chunks/{run-ESNN4V5W.js → run-CBGE6DRQ.js} +2401 -1810
- package/chunks/{runtime-62ZQAH7H.js → runtime-PXO5G6UV.js} +11 -11
- package/chunks/runtime-XFWJTBUO.js +12 -0
- package/chunks/{scan-stream-FHI2FYZE.js → scan-stream-BMOCPKQX.js} +7 -7
- package/chunks/{scope-BI7BF4ZY.js → scope-NJHIDDTN.js} +4 -4
- package/chunks/{session-store-BCFQYDCE.js → session-store-46WBZM22.js} +6 -6
- package/chunks/source-files-REHOM44I.js +12 -0
- package/chunks/{specdrift-WCLH6TTQ.js → specdrift-AFS54WEJ.js} +5 -5
- package/chunks/token-KRWP5JYA.js +72 -0
- package/chunks/token-util-DWTL33S3.js +8 -0
- package/chunks/variant-candidates-UH2WC2HA.js +13 -0
- package/chunks/{web-recon-prepass-DPVCBRZA.js → web-recon-prepass-SFXU44SS.js} +9 -9
- package/dashboard/assets/desktop-BT7RkC4q.js +32 -0
- package/dashboard/assets/desktop-OaBI0E0e.css +1 -0
- package/dashboard/assets/{findings-page-CACW9nw2.js → findings-page-B4rwF6fZ.js} +2 -2
- package/dashboard/assets/{format-PoISqsES.js → format-LNQSSpn6.js} +1 -1
- package/dashboard/assets/live-page-DoNwpPAO.js +1 -0
- package/dashboard/assets/{meta-tile-CcskIV_o.js → meta-tile-BMtBC-Qq.js} +1 -1
- package/dashboard/assets/operations-CMFVrXEe.css +2 -0
- package/dashboard/assets/operations-app-ER0gg7GN.js +2 -0
- package/dashboard/assets/{operations-D8nUP5_m.js → operations-e2CGYKB1.js} +2 -2
- package/dashboard/assets/{overview-page-DTGS8dPo.js → overview-page-CmeWH17A.js} +1 -1
- package/dashboard/assets/{page-header-MFVvEtZW.js → page-header-CIJyycfz.js} +1 -1
- package/dashboard/assets/scans-page-CuhzWhHx.js +1 -0
- package/dashboard/assets/{table-BYS-nIVA.js → table-BgsSBdke.js} +1 -1
- package/dashboard/assets/{tabs-DivxbhQy.js → tabs-vn6v7Bk6.js} +1 -1
- package/dashboard/desktop.html +3 -3
- package/dashboard/index.html +3 -3
- package/package.json +11 -11
- package/chunks/adapt-loop-ECQG7454.js +0 -18
- package/chunks/appsec-catalog-CBWHGTEL.js +0 -24
- package/chunks/chunk-H2FFLZNK.js +0 -3
- package/chunks/chunk-QI233I24.js +0 -333
- package/chunks/chunk-RRMJC3ZE.js +0 -105
- package/chunks/chunk-SZJCPG2I.js +0 -110
- package/chunks/chunk-WKNNZVJS.js +0 -2798
- package/chunks/cost-ledger-ZCKMBJEN.js +0 -13
- package/chunks/db-26NGQFKO.js +0 -16
- package/chunks/eval-runner-DDLE5RQ3.js +0 -27
- package/chunks/fix-IG7LYXH3.js +0 -12
- package/chunks/harness-HWOYFKFY.js +0 -22
- package/chunks/http-conformance-DU66MZIU.js +0 -11
- package/chunks/http-sender-GWH2IYEA.js +0 -10
- package/chunks/hunt-scan-XPELSPQQ.js +0 -38
- package/chunks/memsafety-scan-J7SECV5W.js +0 -16
- package/chunks/npm-dynamic-discovery-AHROOZDB.js +0 -13
- package/chunks/orchestrate-ZUWAUWBC.js +0 -62
- package/chunks/pipeline-FCARFZU3.js +0 -14
- package/chunks/prepare-MYY743TK.js +0 -13
- package/chunks/process-3Q7QJIOZ.js +0 -13
- package/chunks/runtime-J7PLXZNM.js +0 -12
- package/chunks/source-files-PWRQR6LY.js +0 -12
- package/chunks/variant-candidates-6KM6F6MD.js +0 -13
- package/dashboard/assets/0sec-icon-66SreztZ.gif +0 -0
- package/dashboard/assets/desktop-CXTQonNm.js +0 -32
- package/dashboard/assets/desktop-NOekk4QS.css +0 -1
- package/dashboard/assets/live-page-DrgQqQK5.js +0 -1
- package/dashboard/assets/operations-BKE8T-vY.css +0 -2
- package/dashboard/assets/operations-app-CQQhG54n.js +0 -2
- package/dashboard/assets/scans-page-ChVtq8Us.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-C7oxC63R.js";import{c as r,l as i,n as a,r as o,t as s,y as c}from"./format-PoISqsES.js";import{T as l,w as u,y as d}from"./operations-D8nUP5_m.js";import{_ as f,g as p}from"./dist-CmX-h7a4.js";import{t as m}from"./bot-yILPnRgD.js";import{t as h}from"./circle-alert-BEnMBMT-.js";import{t as g}from"./search-CiooTLck.js";import{t as _}from"./siren-CCBwTSuk.js";import{a as v,c as y,f as b,i as x,l as S,n as C,o as w,r as T,s as E,t as D,u as O}from"./table-BYS-nIVA.js";import{n as k,t as A}from"./meta-tile-CcskIV_o.js";import{C as j,S as M,_ as N,b as P,c as ee,d as te,f as F,g as I,h as L,j as R,k as ne,l as z,m as B,p as V,s as re,t as ie,u as H,v as U,x as W,y as G}from"./operations-app-CQQhG54n.js";var K=f(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),q=f(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),J=e(t(),1),Y=n();function ae({title:e,description:t,searchValue:n,onSearchChange:r,searchPlaceholder:i,children:a}){return(0,Y.jsxs)(B,{className:`flex min-h-[36rem] flex-col overflow-hidden`,children:[(0,Y.jsxs)(G,{className:`space-y-3`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(U,{children:`Queue`}),(0,Y.jsx)(M,{className:`mt-2`,children:e}),(0,Y.jsx)(I,{children:t})]}),(0,Y.jsxs)(`label`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(g,{className:`size-4 text-muted-foreground`}),(0,Y.jsx)(re,{value:n,onChange:e=>r(e.target.value),placeholder:i,className:`h-9`})]})]}),(0,Y.jsx)(L,{className:`flex min-h-0 flex-1 flex-col pt-3`,children:(0,Y.jsx)(ie,{className:`min-h-0 flex-1`,children:(0,Y.jsx)(P,{children:a})})})]})}function X({title:e,description:t,meta:n,badges:r,selected:i=!1}){return(0,Y.jsx)(W,{interactive:!0,selected:i,children:(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,Y.jsx)(`div`,{className:`text-sm font-semibold leading-5 text-foreground`,children:e}),(0,Y.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground`,children:t}),n?(0,Y.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:n}):null]}),r?(0,Y.jsx)(`div`,{className:`flex max-w-[12rem] flex-wrap justify-end gap-2`,children:r}):null]})})}function oe({events:e}){return(0,Y.jsxs)(B,{className:`overflow-hidden`,children:[(0,Y.jsx)(G,{children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(U,{children:`Activity`}),(0,Y.jsx)(M,{className:`mt-2`,children:`Timeline`})]})}),(0,Y.jsx)(L,{className:`space-y-4`,children:e.length===0?(0,Y.jsx)(N,{children:`No pipeline events recorded.`}):(0,Y.jsxs)(D,{children:[(0,Y.jsx)(v,{children:(0,Y.jsxs)(w,{className:`hover:bg-transparent`,children:[(0,Y.jsx)(x,{children:`Event`}),(0,Y.jsx)(x,{children:`Summary`}),(0,Y.jsx)(x,{className:`w-[10rem]`,children:`Time`}),(0,Y.jsx)(x,{className:`w-[14rem]`,children:`Payload`})]})}),(0,Y.jsx)(C,{children:e.map(e=>{let t=se(e.stage,e.eventType);return(0,Y.jsxs)(w,{children:[(0,Y.jsx)(T,{children:(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Y.jsx)(`div`,{className:`mt-0.5 inline-flex size-8 items-center justify-center rounded-md border border-border bg-muted text-primary`,children:(0,Y.jsx)(t,{className:`size-4`})}),(0,Y.jsxs)(`div`,{className:`space-y-1`,children:[(0,Y.jsxs)(`div`,{className:`font-medium text-foreground`,children:[e.stage,` · `,e.eventType]}),e.agentRole?(0,Y.jsx)(b,{value:e.agentRole}):null]})]})}),(0,Y.jsx)(T,{className:`text-muted-foreground`,children:(0,Y.jsxs)(`div`,{className:`space-y-1`,children:[(0,Y.jsx)(`div`,{children:o(e.payload)}),e.findingId?(0,Y.jsxs)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:[`finding `,e.findingId.slice(0,8)]}):null]})}),(0,Y.jsx)(T,{className:`text-xs text-muted-foreground`,children:a(e.timestamp)}),(0,Y.jsx)(T,{children:e.payload?(0,Y.jsxs)(`details`,{className:`rounded-md border border-border bg-muted/50 p-2 text-sm text-muted-foreground`,children:[(0,Y.jsx)(`summary`,{className:`cursor-pointer list-none font-medium text-foreground`,children:`View raw`}),(0,Y.jsx)(`pre`,{className:`mt-3 text-xs text-muted-foreground`,children:JSON.stringify(e.payload,null,2)})]}):(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`No payload`})})]},e.id)})})]})})]})}function se(e,t){let n=`${e}:${t}`.toLowerCase();return n.includes(`attack`)?p:n.includes(`agent`)?m:n.includes(`verify`)?K:n.includes(`finding`)?h:n.includes(`scan`)?ne:n.includes(`analysis`)?q:R}function Z({icon:e,label:t,value:n,hint:r,tone:i=`neutral`}){return(0,Y.jsx)(B,{className:`overflow-hidden`,children:(0,Y.jsxs)(L,{className:`space-y-4 p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:t}),(0,Y.jsx)(`div`,{className:j(`inline-flex size-9 items-center justify-center rounded-md border border-border bg-muted text-muted-foreground`,i===`danger`&&`border-destructive/20 bg-destructive/10 text-destructive`,i===`warning`&&`border-amber-500/20 bg-amber-500/10 text-amber-300`,i===`success`&&`border-emerald-500/20 bg-emerald-500/10 text-emerald-300`,i===`accent`&&`border-primary/20 bg-primary/12 text-primary`),children:(0,Y.jsx)(e,{className:`size-5`})})]}),(0,Y.jsxs)(`div`,{className:`space-y-1`,children:[(0,Y.jsx)(`div`,{className:`text-3xl font-bold tracking-tight text-foreground`,children:n}),(0,Y.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground`,children:r})]})]})})}function Q({children:e,className:t}){return(0,Y.jsx)(`section`,{className:j(`grid gap-4 xl:grid-cols-[22rem_minmax(0,1fr)_20rem]`,t),children:e})}function ce({children:e,className:t}){return(0,Y.jsx)(`div`,{className:j(`min-w-0 min-h-0`,t),children:e})}function $({children:e,className:t,span:n=!1}){return(0,Y.jsx)(`div`,{className:j(`min-w-0 min-h-0`,n&&`xl:col-span-2`,t),children:e})}function le({scans:e}){let{scanId:t}=l(),n=u(),[o,s]=(0,J.useState)(``),f=(0,J.useDeferredValue)(o),p=(0,J.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.target)??[];e.push(n),t.set(n.target,e)}return[...t.entries()].map(([e,t])=>{let n=[...t].sort((e,t)=>t.startedAt.localeCompare(e.startedAt));return{target:e,scans:n,latestScan:n[0],activeRunCount:n.filter(e=>e.status===`running`).length,totalFindings:n.reduce((e,t)=>e+t.summary.totalFindings,0)}}).sort((e,t)=>t.latestScan.startedAt.localeCompare(e.latestScan.startedAt))},[e]),m=(0,J.useMemo)(()=>{let e=f.trim().toLowerCase();return e?p.filter(t=>[t.target,...t.scans.flatMap(e=>[e.depth,e.runtime,e.mode,e.status,e.id])].join(` `).toLowerCase().includes(e)):p},[f,p]),h=(0,J.useMemo)(()=>e.find(e=>e.id===t)??m[0]?.latestScan??null,[m,t,e]),g=h?.id??null,_=(0,J.useMemo)(()=>h?p.find(e=>e.target===h.target)??null:null,[p,h]);(0,J.useEffect)(()=>{!t&&g&&n(`/runs/${g}`,{replace:!0})},[n,t,g]);let v=c({queryKey:[`scan-events`,g],queryFn:()=>r(g),enabled:!!g}),y=c({queryKey:[`scan-findings`,g],queryFn:()=>i(g),enabled:!!g});return(0,Y.jsx)(`div`,{className:`space-y-6`,children:(0,Y.jsxs)(Q,{className:`xl:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,Y.jsx)(ce,{children:(0,Y.jsx)(ae,{title:`${p.length} targets`,description:`Search by target, runtime, mode, depth, status, or run id.`,searchValue:o,onSearchChange:s,searchPlaceholder:`Filter targets and runs`,children:m.length===0?(0,Y.jsx)(N,{className:`py-8`,children:`No targets match the current filter.`}):m.map(e=>(0,Y.jsx)(d,{to:`/runs/${e.latestScan.id}`,children:({isActive:t})=>(0,Y.jsx)(X,{selected:t,title:e.target,description:`${e.scans.length} runs · latest ${e.latestScan.runtime} · ${e.latestScan.mode}`,meta:a(e.latestScan.startedAt),badges:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(b,{value:e.latestScan.status}),e.activeRunCount>0?(0,Y.jsxs)(V,{variant:`accent`,children:[e.activeRunCount,` active`]}):null,(0,Y.jsxs)(V,{children:[e.totalFindings,` findings`]})]})})},e.target))})}),g?v.isLoading||y.isLoading?(0,Y.jsx)($,{span:!0,children:(0,Y.jsx)(te,{label:`Scan detail`})}):v.error?(0,Y.jsx)($,{span:!0,children:(0,Y.jsx)(H,{error:v.error})}):y.error?(0,Y.jsx)($,{span:!0,children:(0,Y.jsx)(H,{error:y.error})}):v.data&&y.data?(0,Y.jsx)(ue,{events:v.data,findings:y.data,targetRuns:_?.scans??[]}):(0,Y.jsx)($,{span:!0,children:(0,Y.jsx)(z,{title:`Scan unavailable`,body:`The selected run could not be loaded from the local database.`})}):(0,Y.jsx)($,{span:!0,children:(0,Y.jsx)(z,{title:`No scan selected`,body:`Choose a run from the run history to inspect details.`})})]})})}function ue({events:e,findings:t,targetRuns:n}){let r=e.scan,i=u(),{openPanel:o,clearPanel:c}=F(),l=(0,J.useMemo)(()=>n.filter(e=>e.id!==r.id),[r.id,n]),f=(0,J.useMemo)(()=>n.filter(e=>e.status===`running`).length,[n]),p=(0,J.useMemo)(()=>de(e.events),[e.events]),m=(0,J.useMemo)(()=>(0,Y.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,Y.jsx)(k,{eyebrow:`Target`,title:`Target dossier`,description:`Shared context for the selected run across the full target history.`,children:(0,Y.jsxs)(P,{children:[(0,Y.jsx)(A,{label:`Target`,value:r.target}),(0,Y.jsx)(A,{label:`Runs on target`,value:String(n.length)}),(0,Y.jsx)(A,{label:`Running now`,value:String(f)}),(0,Y.jsx)(A,{label:`Scan id`,value:r.id,mono:!0}),(0,Y.jsx)(A,{label:`Started`,value:a(r.startedAt)}),(0,Y.jsx)(A,{label:`Completed`,value:r.completedAt?a(r.completedAt):`In progress`}),(0,Y.jsx)(A,{label:`Mode`,value:`${r.mode} / ${r.depth}`}),(0,Y.jsx)(A,{label:`Runtime`,value:r.runtime})]})}),(0,Y.jsxs)(B,{className:`overflow-hidden`,children:[(0,Y.jsx)(G,{children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(U,{children:`Target history`}),(0,Y.jsx)(M,{className:`mt-2`,children:`Recent passes`}),(0,Y.jsx)(I,{children:`Open another run on the same target without leaving the current dossier.`})]})}),(0,Y.jsx)(L,{className:`px-0 pb-0`,children:l.length===0?(0,Y.jsx)(`div`,{className:`px-6 pb-6`,children:(0,Y.jsx)(N,{children:`No other runs for this target yet.`})}):(0,Y.jsx)(P,{children:l.slice(0,5).map(e=>(0,Y.jsx)(`button`,{type:`button`,onClick:()=>i(`/runs/${e.id}`),className:`w-full text-left`,children:(0,Y.jsx)(X,{title:a(e.startedAt),description:`${e.runtime} · ${e.mode} · ${e.depth}`,meta:e.id.slice(0,8),badges:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(b,{value:e.status}),(0,Y.jsx)(V,{children:e.summary.totalFindings})]})})},e.id))})})]})]}),[f,i,l,r.completedAt,r.depth,r.id,r.mode,r.runtime,r.startedAt,r.target,n.length]);(0,J.useEffect)(()=>(c(),()=>c()),[c,r.id]);let g=(0,J.useCallback)(()=>{o({title:`${r.target} target dossier`,description:`Shared context for the selected run across the full target history.`,content:m})},[o,m,r.target]);return(0,Y.jsx)($,{span:!0,className:`space-y-4`,children:(0,Y.jsxs)(k,{eyebrow:`Run dossier`,title:r.target,description:`Started ${a(r.startedAt)} · ${r.runtime} runtime · ${r.mode} mode · ${n.length} total runs on this target`,actions:(0,Y.jsx)(ee,{variant:`outline`,size:`sm`,onClick:g,children:`Open target dossier`}),children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsx)(b,{value:r.status}),(0,Y.jsx)(V,{children:r.depth}),(0,Y.jsx)(V,{children:r.runtime}),(0,Y.jsx)(V,{children:r.mode})]}),p?(0,Y.jsx)(B,{className:`border-destructive/25 bg-destructive/5`,children:(0,Y.jsx)(L,{className:`space-y-3 p-4`,children:(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Y.jsx)(h,{className:`mt-0.5 size-5 text-destructive`}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Execution incident`}),(0,Y.jsx)(`div`,{className:`mt-1 text-sm leading-6 text-muted-foreground`,children:p.headline}),(0,Y.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[(0,Y.jsx)(V,{variant:`outline`,children:p.stage}),p.actor?(0,Y.jsx)(V,{variant:`outline`,children:p.actor}):null,(0,Y.jsx)(`span`,{children:a(p.timestamp)})]})]})]})})}):null,(0,Y.jsxs)(`section`,{className:`grid gap-4 lg:grid-cols-2 2xl:grid-cols-4`,children:[(0,Y.jsx)(Z,{icon:R,label:`Findings`,value:r.summary.totalFindings,hint:`Grouped and raw findings`,tone:`accent`}),(0,Y.jsx)(Z,{icon:_,label:`Critical`,value:r.summary.critical,hint:`Critical-severity findings`,tone:`danger`}),(0,Y.jsx)(Z,{icon:h,label:`High`,value:r.summary.high,hint:`High-severity findings`,tone:`warning`}),(0,Y.jsx)(Z,{icon:q,label:`Duration`,value:s(r.durationMs),hint:`Elapsed runtime`,tone:`success`})]}),(0,Y.jsxs)(B,{className:`overflow-hidden`,children:[(0,Y.jsx)(G,{children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(U,{children:`Run output`}),(0,Y.jsx)(M,{className:`mt-2`,children:`Finding families in this run`}),(0,Y.jsx)(I,{children:`Deduplicated finding families produced by the selected run.`})]})}),(0,Y.jsx)(L,{children:t.groups.length===0?(0,Y.jsx)(N,{children:`No finding families recorded for this run.`}):(0,Y.jsxs)(D,{children:[(0,Y.jsx)(v,{children:(0,Y.jsxs)(w,{className:`hover:bg-transparent`,children:[(0,Y.jsx)(x,{children:`Finding`}),(0,Y.jsx)(x,{children:`Category`}),(0,Y.jsx)(x,{children:`Count`}),(0,Y.jsx)(x,{className:`w-[12rem]`,children:`Posture`})]})}),(0,Y.jsx)(C,{children:t.groups.map(e=>(0,Y.jsxs)(w,{children:[(0,Y.jsx)(T,{className:`font-medium text-foreground`,children:e.latest.title}),(0,Y.jsx)(T,{className:`text-muted-foreground`,children:e.latest.category}),(0,Y.jsx)(T,{className:`text-muted-foreground`,children:e.count}),(0,Y.jsx)(T,{children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsx)(O,{severity:e.latest.severity}),(0,Y.jsx)(y,{value:e.workflow.phase}),e.workflow.reviewGate===`none`?null:(0,Y.jsx)(S,{value:e.workflow.reviewGate}),(0,Y.jsx)(b,{value:e.latest.triageStatus}),(0,Y.jsx)(E,{value:e.workflow.consensus})]})})]},e.fingerprint))})]})})]}),(0,Y.jsxs)(B,{className:`overflow-hidden`,children:[(0,Y.jsx)(G,{children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(U,{children:`Target provenance`}),(0,Y.jsx)(M,{className:`mt-2`,children:`Other runs on this target`}),(0,Y.jsx)(I,{children:`Use neighboring runs to understand whether this run is the first hit, a regression, or another pass over the same surface.`})]})}),(0,Y.jsx)(L,{children:n.length<=1?(0,Y.jsx)(N,{children:`No adjacent runs recorded for this target yet.`}):(0,Y.jsxs)(D,{children:[(0,Y.jsx)(v,{children:(0,Y.jsxs)(w,{className:`hover:bg-transparent`,children:[(0,Y.jsx)(x,{children:`Started`}),(0,Y.jsx)(x,{children:`Mode`}),(0,Y.jsx)(x,{children:`Runtime`}),(0,Y.jsx)(x,{children:`Findings`}),(0,Y.jsx)(x,{className:`w-[10rem]`,children:`Status`})]})}),(0,Y.jsx)(C,{children:n.slice(0,6).map(e=>(0,Y.jsxs)(w,{children:[(0,Y.jsx)(T,{className:`font-medium`,children:(0,Y.jsx)(d,{to:`/runs/${e.id}`,className:`text-foreground hover:text-primary`,children:a(e.startedAt)})}),(0,Y.jsxs)(T,{className:`text-muted-foreground`,children:[e.mode,` · `,e.depth]}),(0,Y.jsx)(T,{className:`text-muted-foreground`,children:e.runtime}),(0,Y.jsx)(T,{className:`text-muted-foreground`,children:e.summary.totalFindings}),(0,Y.jsx)(T,{children:(0,Y.jsx)(b,{value:e.status})})]},e.id))})]})})]}),(0,Y.jsx)(oe,{events:e.events})]})})}function de(e){let t=e=>{let t=e.payload??{},n=typeof t.summary==`string`&&t.summary.trim()?t.summary.trim():e.eventType;return/max turns|did not emit required tool_call/i.test(n)},n=[...e].reverse().find(e=>[`agent_error`,`scan_error`,`worker_failed`].includes(e.eventType)||(e.eventType===`stage_complete`||e.eventType===`agent_complete`)&&t(e));if(!n)return null;let r=n.payload??{},i=typeof r.error==`string`&&r.error.trim()?r.error.trim():typeof r.summary==`string`&&r.summary.trim()?r.summary.trim():`${n.stage} ${n.eventType}`.replaceAll(`_`,` `);return{stage:n.stage,actor:n.agentRole??null,headline:i,timestamp:n.timestamp}}export{le as ScansPage};
|