@straiffi/archon 1.1.0 → 1.1.1

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.
@@ -0,0 +1,5 @@
1
+ import{a as e}from"./rolldown-runtime-BYbx6iT9.js";import{At as t,H as n,It as r,Nt as i,Pt as a,a as o,d as s,f as c,gt as l,i as u,kt as d,o as f,s as p,t as m}from"./badge-DBRMkzQk.js";import{_ as h,a as g,c as _,d as v,f as y,g as b,h as ee,i as x,l as S,m as te,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as ne,y as re}from"./index-BK_84mfc.js";var A=e(r(),1),ie=(e,n)=>a(t(`/projects/${e}/test-sessions`),{method:`POST`,body:n,fallbackErrorMessage:`Unable to open the test runner right now.`}),ae=(e,n)=>a(t(`/tickets/${e}/test-sessions${n?`?project_id=${encodeURIComponent(n)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),oe=(e,n={})=>a(t(`/test-sessions/${e}/discovery${n.commandId?`?command_id=${encodeURIComponent(n.commandId)}`:``}`),{signal:n.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),se=(e,n)=>a(t(`/test-sessions/${e}/run`),{method:`POST`,body:n,fallbackErrorMessage:`Unable to start the selected tests right now.`}),ce=e=>a(t(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),le=e=>i(t(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),j=n(),M=256*1024,N=24,P=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),ue=(e,t)=>{let n=`${e}${t}`;return n.length<=M?n:n.slice(-M)},F=e=>e.replace(P,``),de=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=N,I=e=>{e.scrollTop=e.scrollHeight},fe=(e,t=!1)=>{I(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{I(e),t&&(r=window.requestAnimationFrame(()=>{I(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},pe=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[]}},L=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,j.jsx)(`div`,{"data-tone":t,className:c(`whitespace-pre-wrap break-words`,G(t)),children:e===``?` `:e}),q=(0,A.memo)(({canRunGranular:e,filePath:t,isActive:n,name:r,onRunCase:i})=>(0,j.jsxs)(`button`,{type:`button`,"aria-label":`Run ${r}`,title:r,className:c(`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,j.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,j.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:r})]}));q.displayName=`TestCaseRow`;var J=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:r,file:i,isExpanded:a,onRunCase:o,onRunFile:l,onToggleFile:u})=>{let d=e===`file`&&n===i.path,p=e===`case`&&n===i.path;return(0,j.jsx)(w,{open:a,onOpenChange:e=>{u(i.path,e)},children:(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(_,{asChild:!0,children:(0,j.jsx)(s,{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,j.jsx)(f,{className:c(`h-4 w-4 transition-transform`,a&&`rotate-180`)})})}),(0,j.jsx)(`button`,{type:`button`,"aria-label":`Run ${i.path}`,className:c(`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||p)&&`border-sky-400/45 bg-sky-500/10`),disabled:!r,onClick:()=>{l(i.path)},children:(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,j.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,j.jsx)(S,{className:`h-3.5 w-3.5`})}),(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,j.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:z(i.path)}),(0,j.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:i.path})]}),(0,j.jsxs)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:[i.cases.length,` test`,i.cases.length===1?``:`s`]})]})]})})]}),(0,j.jsx)(D,{children:(0,j.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:i.cases.length===0?(0,j.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:`No named tests were detected in this file.`}):(0,j.jsx)(`div`,{className:`space-y-1`,children:i.cases.map(a=>{let s=e===`case`&&n===i.path&&t===a.name;return(0,j.jsx)(q,{canRunGranular:r,filePath:i.path,isActive:s,name:a.name,onRunCase:o},a.id)})})})})]})})});J.displayName=`DiscoveryFileRow`;var _e=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,availableCommands:r,canRunGranular:i,discovery:a,expandedFiles:l,fullSuiteOnlyNotice:d,isLoading:m,selectedCommandId:h,selectedCommandName:_,sessionError:v,sessionStatus:y,shouldShowCommandSelector:b,onRunCase:ee,onRunFile:S,onSelectCommand:te,onToggleFile:w})=>{let[T,D]=(0,A.useState)(``),O=(0,A.useMemo)(()=>H(a,T),[a,T]),k=(0,A.useMemo)(()=>O.reduce((e,t)=>e+t.cases.length,0),[O]),ne=B(T).length>0;return(0,j.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,j.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[b&&(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:`Test scope`}),(0,j.jsxs)(C,{children:[(0,j.jsx)(g,{asChild:!0,children:(0,j.jsxs)(s,{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,j.jsx)(`span`,{className:`truncate`,children:_??`Select test scope`}),(0,j.jsx)(f,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,j.jsx)(E,{align:`start`,className:`w-72`,children:r.map(e=>(0,j.jsx)(x,{className:c(h===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{te(e.id)},children:(0,j.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),d&&(0,j.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||T.length>0)&&(0,j.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,j.jsx)(p,{type:`search`,value:T,onChange:e=>{D(e.target.value)},placeholder:`Filter`,"aria-label":`Filter test cases`,className:`pr-10`}),T.length>0&&(0,j.jsx)(s,{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:()=>{D(``)},children:(0,j.jsx)(u,{className:`size-4`})})]}),!r.length&&(0,j.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,j.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,j.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,j.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,j.jsx)(`div`,{className:`min-w-0`,children:(0,j.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[O.length,` file`,O.length===1?``:`s`,`, `,k,` test case`,k===1?``:`s`]})}),m&&(0,j.jsx)(o,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:a.length===0&&!m?(0,j.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.`}):O.length===0?(0,j.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.`}):O.map(r=>(0,j.jsx)(J,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:i,file:r,isExpanded:ne||(l[r.path]??!1),onRunCase:ee,onRunFile:S,onToggleFile:w},r.path))})]})]})})});_e.displayName=`DiscoveryPane`;var ve=(0,A.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:a,viewportRef:o,onScroll:s})=>{let l=(0,A.useMemo)(()=>t?F(t).replaceAll(`\r
2
+ `,`
3
+ `).replaceAll(`\r`,`
4
+ `).split(`
5
+ `).map(e=>({line:e,tone:W(e)})):[],[t]);return(0,j.jsx)(`section`,{className:`min-h-0 px-4 py-4`,children:(0,j.jsxs)(`div`,{className:`flex h-full flex-col gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,j.jsx)(`span`,{className:`font-medium text-foreground`,children:r}),i&&(0,j.jsx)(m,{variant:`outline`,className:c(`px-3 py-1 text-xs uppercase tracking-[0.2em]`,L(i)),children:U(i)}),a&&(0,j.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-xs font-medium uppercase tracking-[0.18em]`,children:[(0,j.jsxs)(`span`,{className:`text-rose-200`,children:[a.failed,` failed`]}),(0,j.jsxs)(`span`,{className:`text-emerald-200`,children:[a.passed,` passed`]})]}),e!=null&&(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:R(e)}),n&&(0,j.jsx)(m,{variant:`outline`,className:`border-amber-400/30 bg-amber-500/10 text-amber-200`,children:`Output trimmed to recent logs`})]}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-2xl border border-border/70 bg-[#0d1017]`,children:(0,j.jsx)(`div`,{ref:o,"aria-label":`Test output`,className:`h-full overflow-auto px-4 py-4`,onScroll:s,children:(0,j.jsx)(`div`,{className:`font-mono text-xs leading-5`,children:l.length>0?l.map((e,t)=>(0,j.jsx)(K,{line:e.line,tone:e.tone},`${t}:${e.line}`)):(0,j.jsx)(`div`,{className:`text-slate-200`,children:`No test output yet.`})})})})]})})});ve.displayName=`OutputPane`;var ye=({testCommands:e,onClose:t,...n})=>{let r=n.scope,i=n.projectId,a=n.scope===`ticket`?n.ticketId:null,o=n.scope===`project`?n.targetKind:null,c=n.scope===`project`?n.targetBundleId:null,[f,p]=(0,A.useState)(e),[m,g]=(0,A.useState)(null),[_,x]=(0,A.useState)([]),[S,C]=(0,A.useState)(``),[w,E]=(0,A.useState)({}),[D,M]=(0,A.useState)(!0),[N,P]=(0,A.useState)(!1),[F,I]=(0,A.useState)(!1),[L,R]=(0,A.useState)(null),[z,B]=(0,A.useState)(!1),[V,H]=(0,A.useState)(!1),U=(0,A.useRef)(null),W=(0,A.useRef)(!1),G=(0,A.useRef)(null),K=(0,A.useRef)(!0),q=(0,A.useRef)(null),J=(0,A.useRef)(null),ye=m?.selection?.kind??null,be=m?.selection?.kind===`all`?null:m?.selection?.path??null,xe=m?.selection?.kind===`case`?m.selection.name:null,Y=m?.id??null,X=m?.status??null,Z=(0,A.useMemo)(()=>f.find(e=>e.id===S)??null,[f,S]),Se=(0,A.useMemo)(()=>m?.summary?.failed_count==null&&m?.summary?.passed_count==null?null:{failed:m?.summary?.failed_count??0,passed:m?.summary?.passed_count??0},[m?.summary?.failed_count,m?.summary?.passed_count]),Ce=Z?.runner===`unknown`?`This scope supports full-suite runs only, so file and case selection is disabled.`:null,we=!!(Z&&m?.status!==`running`&&!N&&!F),Te=we,Ee=we&&V,De=f.length>1;(0,A.useEffect)(()=>{S||f.length===0||C(f[0]?.id??``)},[f,S]),(0,A.useEffect)(()=>{e.length>0&&p(t=>he(t,e)?t:e)},[e]),(0,A.useEffect)(()=>{if(f.length>0||!i)return;let e=new AbortController;return l(e.signal).then(e=>{let t=e.find(e=>e.id===i);t&&p(e=>{let n=pe(t.test_commands);return he(e,n)?e:n})}).catch(()=>{}),()=>{e.abort()}},[f.length,i]),(0,A.useEffect)(()=>{let e=e=>{!e||e.id!==U.current||g(e)},t=e=>{!e||e.session_id!==U.current||g(t=>!t||t.id!==e.session_id?t:{...t,output:ue(t.output,e.chunk),output_truncated:e.output_truncated})};return O.on(`test-session:updated`,e),O.on(`test-session:output`,t),()=>{O.off(`test-session:updated`,e),O.off(`test-session:output`,t)}},[]),(0,A.useEffect)(()=>{let e=G.current;if(!e){q.current=m?.output??null,J.current=m?.status??null;return}let t=q.current!==(m?.output??null),n=J.current!==`running`&&m?.status===`running`,r=J.current===`running`&&m?.status!==`running`;if(n&&(K.current=!0),n||t&&m?.status===`running`&&K.current||r&&K.current){let t=fe(e,r);return q.current=m?.output??null,J.current=m?.status??null,t}q.current=m?.output??null,J.current=m?.status??null},[m?.output,m?.status]),(0,A.useEffect)(()=>{let e=!1;return(async()=>{try{let t=r===`project`?await ie(i,{target_kind:o??`repo_root`,target_bundle_id:c??null}):await ae(a??``,i);if(e)return;U.current=t.id,g(t)}catch(t){e||R(t instanceof d?t.message:`Unable to load the test runner right now.`)}finally{!e&&U.current==null&&M(!1)}})(),()=>{e=!0}},[i,r,c,o,a]),(0,A.useEffect)(()=>{if(!m?.id){H(!1);return}if(f.length>0&&!S){H(!1);return}let e=new AbortController,t=!1;return M(!0),H(!1),oe(m.id,{commandId:S||null,signal:e.signal}).then(e=>{t||(x(e.files),H(e.supports_granular_selection))}).catch(n=>{t||e.signal.aborted||R(n instanceof d?n.message:`Unable to discover tests right now.`)}).finally(()=>{t||M(!1)}),()=>{t=!0,e.abort()}},[f.length,S,m?.id]),(0,A.useEffect)(()=>()=>{let e=U.current;!e||W.current||(W.current=!0,le(e).catch(()=>{}))},[]);let Q=(0,A.useCallback)(async e=>{if(!(!Y||X===`running`||!Z||N||F)){R(null),P(!0);try{g(await se(Y,{command_id:Z.id,selection:e}))}catch(e){R(e instanceof d?e.message:`Unable to start the selected tests right now.`)}finally{P(!1)}}},[N,F,Z,Y,X]),Oe=(0,A.useCallback)(async()=>{if(!(!Y||X!==`running`||F)){R(null),I(!0);try{g(await ce(Y))}catch(e){R(e instanceof d?e.message:`Unable to stop the test run right now.`)}finally{I(!1)}}},[F,Y,X]),$=(0,A.useCallback)(()=>{let e=U.current;if(!e||W.current){t();return}W.current=!0,t(),le(e).catch(()=>{})},[t]),ke=(0,A.useCallback)(()=>{if(X===`running`){B(!0);return}$()},[$,X]),Ae=(0,A.useCallback)(()=>{let e=G.current;e&&(K.current=de(e))},[]),je=(0,A.useCallback)(e=>{C(e)},[]),Me=(0,A.useCallback)((e,t)=>{E(n=>(n[e]??!1)===t?n:{...n,[e]:t})},[]),Ne=(0,A.useCallback)(e=>{Q({kind:`file`,path:e})},[Q]),Pe=(0,A.useCallback)((e,t)=>{Q({kind:`case`,path:e,name:t})},[Q]);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(te,{open:!0,onOpenChange:e=>{e||ke()},children:(0,j.jsxs)(b,{showCloseButton:!1,overlayClassName:`bg-black/70`,className:`flex h-[calc(100vh-2rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl border border-[#2a2a38] bg-[#16161f] p-0 shadow-2xl sm:max-w-7xl`,children:[(0,j.jsx)(re,{className:`sr-only`,children:`Tests`}),(0,j.jsx)(h,{className:`sr-only`,children:`Run configured tests for the selected project target and discard the session when this dialog closes.`}),(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,j.jsx)(`div`,{className:`min-w-0`,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-sky-200`,children:(0,j.jsx)(T,{className:`h-5 w-5`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:`Tests`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:m?.target_label??`Preparing target...`})]})]})}),(0,j.jsx)(ee,{asChild:!0,children:(0,j.jsx)(s,{type:`button`,"aria-label":`Close modal`,variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,j.jsx)(u,{className:`h-4 w-4`})})})]}),(0,j.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,j.jsx)(_e,{activeSelectionKind:ye,activeSelectionName:xe,activeSelectionPath:be,availableCommands:f,canRunGranular:Ee,discovery:_,expandedFiles:w,fullSuiteOnlyNotice:Ce,isLoading:D,selectedCommandId:S,selectedCommandName:Z?.name??null,sessionError:L,sessionStatus:X,shouldShowCommandSelector:De,onRunCase:Pe,onRunFile:Ne,onSelectCommand:je,onToggleFile:Me}),(0,j.jsx)(ve,{durationMs:m?.duration_ms??null,output:m?.output??``,outputTruncated:m?.output_truncated??!1,selectionLabel:me(m),status:X,summaryCounts:Se,viewportRef:G,onScroll:Ae})]}),(0,j.jsx)(ne,{className:`border-t border-border/70 px-6 py-4 sm:flex-row sm:items-center sm:justify-end`,children:(0,j.jsx)(`div`,{className:`flex items-center justify-end gap-2`,children:m?.status===`running`?(0,j.jsxs)(s,{type:`button`,variant:`destructive`,className:ge,onClick:()=>{Oe()},disabled:F,children:[(0,j.jsx)(v,{className:`h-4 w-4`}),(0,j.jsx)(`span`,{children:`Stop`})]}):(0,j.jsxs)(s,{type:`button`,variant:`success`,className:ge,disabled:!Te,onClick:()=>{Q({kind:`all`})},children:[(0,j.jsx)(y,{className:`h-4 w-4`}),(0,j.jsx)(`span`,{children:`Run`})]})})})]})}),z&&(0,j.jsx)(k,{title:`Stop test run and close?`,description:`Closing the Tests dialog discards the current session and its output. Stop the active test run first?`,confirmLabel:`Stop and close`,cancelLabel:`Keep running`,confirmVariant:`destructive`,onConfirm:()=>{B(!1),$()},onCancel:()=>B(!1)})]})};export{ye as TestsDialog};