@straiffi/archon 1.2.3 → 1.2.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.
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-BYbx6iT9.js";import{Dt as t,It as n,Nt as r,Ot as i,Pt as a,Tt as o,a as s,i as c,l,n as u,pt as d,r as f,t as p,u as m}from"./badge-Bpry9xkS.js";import{_ as h,a as g,c as _,d as v,f as y,g as b,h as x,i as ee,l as S,m as C,n as w,o as T,p as E,r as D,s as O,t as k,u as A,v as te,y as ne}from"./index-CFp3AoS0.js";var j=e(n(),1),re=(e,t)=>a(i(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),ie=(e,t)=>a(i(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),ae=(e,t={})=>a(i(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),oe=(e,t)=>a(i(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),se=e=>a(i(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),ce=e=>r(i(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),M=o(),N=256*1024,P=24,F=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),le=(e,t)=>{let n=`${e}${t}`;return n.length<=N?n:n.slice(-N)},I=e=>e.replace(F,``),ue=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=P,L=e=>{e.scrollTop=e.scrollHeight},de=(e,t=!1)=>{L(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{L(e),t&&(r=window.requestAnimationFrame(()=>{L(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},fe=e=>{if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e;if(typeof t.id!=`string`||typeof t.name!=`string`||typeof t.command!=`string`)return[];let n=t.runner===`vitest`||t.runner===`jest`||t.runner===`unknown`?t.runner:`auto`;return[{id:t.id,name:t.name,command:t.command,runner:n,...typeof t.cwd==`string`&&t.cwd.trim()!==``?{cwd:t.cwd}:{}}]}):[]}catch{return[]}},pe=e=>e===`running`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e===`passed`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e===`failed`||e===`error`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e===`stopped`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`,R=e=>e==null?null:e<1e3?`${e} ms`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`,z=e=>{let t=e.split(`/`);return t[t.length-1]||e},B=e=>e.toLowerCase().trim().split(/\s+/).filter(Boolean),V=(e,t)=>e.length===0?!0:e.every(e=>t.some(t=>t.includes(e))),H=(e,t)=>{let n=B(t);return n.length===0?e:e.flatMap(e=>{let t=z(e.path);if(V(n,[t.toLowerCase(),e.path.toLowerCase()]))return[e];let r=e.cases.filter(r=>V(n,[t.toLowerCase(),e.path.toLowerCase(),r.name.toLowerCase()]));return r.length===0?[]:[{...e,cases:r}]})},U=e=>e===`passed`?`Passed`:e===`failed`?`Failed`:e===`running`?`Running`:e===`error`?`Error`:e===`stopped`?`Stopped`:`Idle`,me=e=>e?.selection?e.selection.kind===`all`?`All tests`:e.selection.kind===`case`?e.selection.name:z(e.selection.path):`No test run yet`,W=e=>/(^|\s)(?:FAIL|✗)(\s|$)|\b(?:failed|error|stderr|Expected:|Received:)\b/i.test(e)?`failure`:/(^|\s)(?:PASS|✓)(\s|$)|\bpassed\b/i.test(e)?`success`:/\b(?:WARN|warning|skipped|todo|pending)\b/i.test(e)?`warning`:`default`,G=e=>e===`failure`?`text-rose-200`:e===`success`?`text-emerald-200`:e===`warning`?`text-amber-200`:`text-slate-200`,he=(e,t)=>e===t?!0:e.length===t.length?e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.name===r.name&&e.command===r.command&&e.cwd===r.cwd&&e.runner===r.runner}):!1,ge=`min-w-24 justify-center shadow-none transition-none disabled:opacity-100`,K=({line:e,tone:t})=>(0,M.jsx)(`div`,{"data-tone":t,className:m(`whitespace-pre-wrap break-words`,G(t)),children:e===``?` `:e}),q=(0,j.memo)(({canRunGranular:e,filePath:t,isActive:n,name:r,onRunCase:i})=>(0,M.jsxs)(`button`,{type:`button`,"aria-label":`Run ${r}`,title:r,className:m(`flex w-full min-w-0 items-center gap-2.5 rounded-xl px-2.5 py-1.5 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,e?`cursor-pointer hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,n&&`bg-sky-500/10`),disabled:!e,onClick:()=>{i(t,r)},children:[(0,M.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,M.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:r})]}));q.displayName=`TestCaseRow`;var J=(0,j.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:r,file:i,isExpanded:a,onRunCase:o,onRunFile:s,onToggleFile:u})=>{let d=e===`file`&&n===i.path,f=e===`case`&&n===i.path;return(0,M.jsx)(O,{open:a,onOpenChange:e=>{u(i.path,e)},children:(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(S,{asChild:!0,children:(0,M.jsx)(l,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`${a?`Collapse`:`Expand`} ${i.path}`,className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,M.jsx)(c,{className:m(`h-4 w-4 transition-transform`,a&&`rotate-180`)})})}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Run ${i.path}`,className:m(`min-w-0 flex-1 rounded-xl border border-border/60 bg-background/20 px-2.5 py-2 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,r?`cursor-pointer hover:border-sky-400/35 hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,(d||f)&&`border-sky-400/45 bg-sky-500/10`),disabled:!r,onClick:()=>{s(i.path)},children:(0,M.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,M.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-sky-200`,children:(0,M.jsx)(T,{className:`h-3.5 w-3.5`})}),(0,M.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,M.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:z(i.path)}),(0,M.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:i.path})]}),(0,M.jsxs)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:[i.cases.length,` test`,i.cases.length===1?``:`s`]})]})]})})]}),(0,M.jsx)(_,{children:(0,M.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:i.cases.length===0?(0,M.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:`No named tests were detected in this file.`}):(0,M.jsx)(`div`,{className:`space-y-1`,children:i.cases.map(a=>{let s=e===`case`&&n===i.path&&t===a.name;return(0,M.jsx)(q,{canRunGranular:r,filePath:i.path,isActive:s,name:a.name,onRunCase:o},a.id)})})})})]})})});J.displayName=`DiscoveryFileRow`;var _e=(0,j.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,availableCommands:r,canRunGranular:i,discovery:a,expandedFiles:o,fullSuiteOnlyNotice:d,isLoading:p,selectedCommandId:h,selectedCommandName:_,sessionError:v,sessionStatus:y,shouldShowCommandSelector:b,onRunCase:x,onRunFile:S,onSelectCommand:C,onToggleFile:T})=>{let[E,O]=(0,j.useState)(``),k=(0,j.useMemo)(()=>H(a,E),[a,E]),A=(0,j.useMemo)(()=>k.reduce((e,t)=>e+t.cases.length,0),[k]),te=B(E).length>0;return(0,M.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,M.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[b&&(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:`Test scope`}),(0,M.jsxs)(w,{children:[(0,M.jsx)(g,{asChild:!0,children:(0,M.jsxs)(l,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":`Selected test command`,disabled:r.length===0||y===`running`,children:[(0,M.jsx)(`span`,{className:`truncate`,children:_??`Select test scope`}),(0,M.jsx)(c,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,M.jsx)(D,{align:`start`,className:`w-72`,children:r.map(e=>(0,M.jsx)(ee,{className:m(h===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{C(e.id)},children:(0,M.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),d&&(0,M.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:d}),(a.length>0||E.length>0)&&(0,M.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,M.jsx)(s,{type:`search`,value:E,onChange:e=>{O(e.target.value)},placeholder:`Filter`,"aria-label":`Filter test cases`,className:`pr-10`}),E.length>0&&(0,M.jsx)(l,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Clear test case filter`,className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{O(``)},children:(0,M.jsx)(u,{className:`size-4`})})]}),!r.length&&(0,M.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-4 text-sm text-muted-foreground`,children:`No test commands are configured for this target yet.`}),v&&(0,M.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:v}),(0,M.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,M.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,M.jsx)(`div`,{className:`min-w-0`,children:(0,M.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[k.length,` file`,k.length===1?``:`s`,`, `,A,` test case`,A===1?``:`s`]})}),p&&(0,M.jsx)(f,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,M.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:a.length===0&&!p?(0,M.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:`No JS or TS test files were detected for this target yet.`}):k.length===0?(0,M.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:`No test cases match this filter.`}):k.map(r=>(0,M.jsx)(J,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:i,file:r,isExpanded:te||(o[r.path]??!1),onRunCase:x,onRunFile:S,onToggleFile:T},r.path))})]})]})})});_e.displayName=`DiscoveryPane`;var ve=(0,j.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:a,viewportRef:o,onScroll:s})=>{let c=(0,j.useMemo)(()=>t?I(t).replaceAll(`\r
1
+ import{a as e}from"./rolldown-runtime-BYbx6iT9.js";import{Dt as t,It as n,Nt as r,Ot as i,Pt as a,Tt as o,a as s,i as c,l,n as u,pt as d,r as f,t as p,u as m}from"./badge-Bpry9xkS.js";import{_ as h,a as g,c as _,d as v,f as y,g as b,h as x,i as ee,l as S,m as C,n as w,o as T,p as E,r as D,s as O,t as k,u as A,v as te,y as ne}from"./index-DHJbmRpg.js";var j=e(n(),1),re=(e,t)=>a(i(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),ie=(e,t)=>a(i(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),ae=(e,t={})=>a(i(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),oe=(e,t)=>a(i(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),se=e=>a(i(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),ce=e=>r(i(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),M=o(),N=256*1024,P=24,F=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),le=(e,t)=>{let n=`${e}${t}`;return n.length<=N?n:n.slice(-N)},I=e=>e.replace(F,``),ue=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=P,L=e=>{e.scrollTop=e.scrollHeight},de=(e,t=!1)=>{L(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{L(e),t&&(r=window.requestAnimationFrame(()=>{L(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},fe=e=>{if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e;if(typeof t.id!=`string`||typeof t.name!=`string`||typeof t.command!=`string`)return[];let n=t.runner===`vitest`||t.runner===`jest`||t.runner===`unknown`?t.runner:`auto`;return[{id:t.id,name:t.name,command:t.command,runner:n,...typeof t.cwd==`string`&&t.cwd.trim()!==``?{cwd:t.cwd}:{}}]}):[]}catch{return[]}},pe=e=>e===`running`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e===`passed`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e===`failed`||e===`error`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e===`stopped`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`,R=e=>e==null?null:e<1e3?`${e} ms`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`,z=e=>{let t=e.split(`/`);return t[t.length-1]||e},B=e=>e.toLowerCase().trim().split(/\s+/).filter(Boolean),V=(e,t)=>e.length===0?!0:e.every(e=>t.some(t=>t.includes(e))),H=(e,t)=>{let n=B(t);return n.length===0?e:e.flatMap(e=>{let t=z(e.path);if(V(n,[t.toLowerCase(),e.path.toLowerCase()]))return[e];let r=e.cases.filter(r=>V(n,[t.toLowerCase(),e.path.toLowerCase(),r.name.toLowerCase()]));return r.length===0?[]:[{...e,cases:r}]})},U=e=>e===`passed`?`Passed`:e===`failed`?`Failed`:e===`running`?`Running`:e===`error`?`Error`:e===`stopped`?`Stopped`:`Idle`,me=e=>e?.selection?e.selection.kind===`all`?`All tests`:e.selection.kind===`case`?e.selection.name:z(e.selection.path):`No test run yet`,W=e=>/(^|\s)(?:FAIL|✗)(\s|$)|\b(?:failed|error|stderr|Expected:|Received:)\b/i.test(e)?`failure`:/(^|\s)(?:PASS|✓)(\s|$)|\bpassed\b/i.test(e)?`success`:/\b(?:WARN|warning|skipped|todo|pending)\b/i.test(e)?`warning`:`default`,G=e=>e===`failure`?`text-rose-200`:e===`success`?`text-emerald-200`:e===`warning`?`text-amber-200`:`text-slate-200`,he=(e,t)=>e===t?!0:e.length===t.length?e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.name===r.name&&e.command===r.command&&e.cwd===r.cwd&&e.runner===r.runner}):!1,ge=`min-w-24 justify-center shadow-none transition-none disabled:opacity-100`,K=({line:e,tone:t})=>(0,M.jsx)(`div`,{"data-tone":t,className:m(`whitespace-pre-wrap break-words`,G(t)),children:e===``?` `:e}),q=(0,j.memo)(({canRunGranular:e,filePath:t,isActive:n,name:r,onRunCase:i})=>(0,M.jsxs)(`button`,{type:`button`,"aria-label":`Run ${r}`,title:r,className:m(`flex w-full min-w-0 items-center gap-2.5 rounded-xl px-2.5 py-1.5 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,e?`cursor-pointer hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,n&&`bg-sky-500/10`),disabled:!e,onClick:()=>{i(t,r)},children:[(0,M.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,M.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:r})]}));q.displayName=`TestCaseRow`;var J=(0,j.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:r,file:i,isExpanded:a,onRunCase:o,onRunFile:s,onToggleFile:u})=>{let d=e===`file`&&n===i.path,f=e===`case`&&n===i.path;return(0,M.jsx)(O,{open:a,onOpenChange:e=>{u(i.path,e)},children:(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(S,{asChild:!0,children:(0,M.jsx)(l,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`${a?`Collapse`:`Expand`} ${i.path}`,className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,M.jsx)(c,{className:m(`h-4 w-4 transition-transform`,a&&`rotate-180`)})})}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Run ${i.path}`,className:m(`min-w-0 flex-1 rounded-xl border border-border/60 bg-background/20 px-2.5 py-2 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,r?`cursor-pointer hover:border-sky-400/35 hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,(d||f)&&`border-sky-400/45 bg-sky-500/10`),disabled:!r,onClick:()=>{s(i.path)},children:(0,M.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,M.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-sky-200`,children:(0,M.jsx)(T,{className:`h-3.5 w-3.5`})}),(0,M.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,M.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:z(i.path)}),(0,M.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:i.path})]}),(0,M.jsxs)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:[i.cases.length,` test`,i.cases.length===1?``:`s`]})]})]})})]}),(0,M.jsx)(_,{children:(0,M.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:i.cases.length===0?(0,M.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:`No named tests were detected in this file.`}):(0,M.jsx)(`div`,{className:`space-y-1`,children:i.cases.map(a=>{let s=e===`case`&&n===i.path&&t===a.name;return(0,M.jsx)(q,{canRunGranular:r,filePath:i.path,isActive:s,name:a.name,onRunCase:o},a.id)})})})})]})})});J.displayName=`DiscoveryFileRow`;var _e=(0,j.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,availableCommands:r,canRunGranular:i,discovery:a,expandedFiles:o,fullSuiteOnlyNotice:d,isLoading:p,selectedCommandId:h,selectedCommandName:_,sessionError:v,sessionStatus:y,shouldShowCommandSelector:b,onRunCase:x,onRunFile:S,onSelectCommand:C,onToggleFile:T})=>{let[E,O]=(0,j.useState)(``),k=(0,j.useMemo)(()=>H(a,E),[a,E]),A=(0,j.useMemo)(()=>k.reduce((e,t)=>e+t.cases.length,0),[k]),te=B(E).length>0;return(0,M.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,M.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[b&&(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:`Test scope`}),(0,M.jsxs)(w,{children:[(0,M.jsx)(g,{asChild:!0,children:(0,M.jsxs)(l,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":`Selected test command`,disabled:r.length===0||y===`running`,children:[(0,M.jsx)(`span`,{className:`truncate`,children:_??`Select test scope`}),(0,M.jsx)(c,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,M.jsx)(D,{align:`start`,className:`w-72`,children:r.map(e=>(0,M.jsx)(ee,{className:m(h===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{C(e.id)},children:(0,M.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),d&&(0,M.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:d}),(a.length>0||E.length>0)&&(0,M.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,M.jsx)(s,{type:`search`,value:E,onChange:e=>{O(e.target.value)},placeholder:`Filter`,"aria-label":`Filter test cases`,className:`pr-10`}),E.length>0&&(0,M.jsx)(l,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Clear test case filter`,className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{O(``)},children:(0,M.jsx)(u,{className:`size-4`})})]}),!r.length&&(0,M.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-4 text-sm text-muted-foreground`,children:`No test commands are configured for this target yet.`}),v&&(0,M.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:v}),(0,M.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,M.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,M.jsx)(`div`,{className:`min-w-0`,children:(0,M.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[k.length,` file`,k.length===1?``:`s`,`, `,A,` test case`,A===1?``:`s`]})}),p&&(0,M.jsx)(f,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,M.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:a.length===0&&!p?(0,M.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:`No JS or TS test files were detected for this target yet.`}):k.length===0?(0,M.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:`No test cases match this filter.`}):k.map(r=>(0,M.jsx)(J,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:i,file:r,isExpanded:te||(o[r.path]??!1),onRunCase:x,onRunFile:S,onToggleFile:T},r.path))})]})]})})});_e.displayName=`DiscoveryPane`;var ve=(0,j.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:a,viewportRef:o,onScroll:s})=>{let c=(0,j.useMemo)(()=>t?I(t).replaceAll(`\r
2
2
  `,`
3
3
  `).replaceAll(`\r`,`
4
4
  `).split(`