@straiffi/archon 1.4.7 → 1.4.8
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/dist/client/assets/GitHubActionsDialog-ln1X9xDf.js +1 -0
- package/dist/client/assets/{TestsDialog-CcSvemLJ.js → TestsDialog-Cp3Da2W0.js} +1 -1
- package/dist/client/assets/{architectureDiagram-3BPJPVTR-DJjMJGQa.js → architectureDiagram-3BPJPVTR-CFEtd9pl.js} +1 -1
- package/dist/client/assets/{blockDiagram-GPEHLZMM-D7qr0WKZ.js → blockDiagram-GPEHLZMM-9UsBOlSn.js} +1 -1
- package/dist/client/assets/{c4Diagram-AAUBKEIU-Dtpwhh8J.js → c4Diagram-AAUBKEIU--TsvWn6X.js} +1 -1
- package/dist/client/assets/channel-BjRPoR7Z.js +1 -0
- package/dist/client/assets/{chunk-2J33WTMH-BImOu1wB.js → chunk-2J33WTMH-B3FphDWz.js} +1 -1
- package/dist/client/assets/{chunk-3OPIFGDE-WBqy9pqS.js → chunk-3OPIFGDE-CLbUIPKK.js} +1 -1
- package/dist/client/assets/{chunk-5ZQYHXKU-gzwfOytX.js → chunk-5ZQYHXKU-CUHKY5eH.js} +1 -1
- package/dist/client/assets/{chunk-727SXJPM-DZRDmsY-.js → chunk-727SXJPM-DfKJ4Ud0.js} +1 -1
- package/dist/client/assets/{chunk-AQP2D5EJ-BNsOD4b1.js → chunk-AQP2D5EJ-B0oLVoZs.js} +1 -1
- package/dist/client/assets/{chunk-CSCIHK7Q-Be5NZf-h.js → chunk-CSCIHK7Q-Czl8GWBW.js} +1 -1
- package/dist/client/assets/{chunk-KSCS5N6A-t3G5p-H3.js → chunk-KSCS5N6A-pOOnuun_.js} +1 -1
- package/dist/client/assets/{chunk-L5ZTLDWV-08eeTRtA.js → chunk-L5ZTLDWV-DzRVeTqf.js} +1 -1
- package/dist/client/assets/{chunk-LZXEDZCA-BhEnRZZ3.js → chunk-LZXEDZCA-MVhzvLVp.js} +2 -2
- package/dist/client/assets/{chunk-ND2GUHAM-n8aRhp2g.js → chunk-ND2GUHAM-BeNiy3nE.js} +1 -1
- package/dist/client/assets/{chunk-NZK2D7GU-BzDdHd-c.js → chunk-NZK2D7GU-CnENvQ9d.js} +1 -1
- package/dist/client/assets/{chunk-O5CBEL6O-B4hb9RKU.js → chunk-O5CBEL6O-CkqDMX_f.js} +1 -1
- package/dist/client/assets/{chunk-WU5MYG2G-95dAWX8f.js → chunk-WU5MYG2G-sJ18xVVM.js} +1 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-BjzBLL5f.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BDLW6NLv.js +1 -0
- package/dist/client/assets/{dagre-BM42HDAG-BrFwfUb5.js → dagre-BM42HDAG-BWnmF2aL.js} +1 -1
- package/dist/client/assets/{diagram-2AECGRRQ-C-spx6S1.js → diagram-2AECGRRQ-CASRQI5Y.js} +1 -1
- package/dist/client/assets/{diagram-5GNKFQAL-CTGmw6IF.js → diagram-5GNKFQAL-CY8fXRrV.js} +1 -1
- package/dist/client/assets/{diagram-KO2AKTUF-CGR_6C8P.js → diagram-KO2AKTUF-vtm-gqIm.js} +1 -1
- package/dist/client/assets/{diagram-LMA3HP47-Biu8iKKN.js → diagram-LMA3HP47-Ck-iA5q1.js} +1 -1
- package/dist/client/assets/{diagram-OG6HWLK6-CgPqxTkQ.js → diagram-OG6HWLK6-ALBEY2Nn.js} +1 -1
- package/dist/client/assets/{erDiagram-TEJ5UH35-Dvb5W4CZ.js → erDiagram-TEJ5UH35-BAHPzYR7.js} +1 -1
- package/dist/client/assets/{flowDiagram-I6XJVG4X-tU7PIdFt.js → flowDiagram-I6XJVG4X-pUYj1KCo.js} +1 -1
- package/dist/client/assets/{ganttDiagram-6RSMTGT7-Cxn3Y-uw.js → ganttDiagram-6RSMTGT7-zw-EKZcX.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PVQCEYII-C3ODPbCH.js → gitGraphDiagram-PVQCEYII-DmPxQKXO.js} +1 -1
- package/dist/client/assets/index-BokL1E46.css +2 -0
- package/dist/client/assets/index-WeECH1eZ.js +260 -0
- package/dist/client/assets/{infoDiagram-5YYISTIA-DI-gw2Xm.js → infoDiagram-5YYISTIA-D0zuFK8l.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-Boo7JuBN.js → ishikawaDiagram-YF4QCWOH-BoNe_Ie6.js} +1 -1
- package/dist/client/assets/{journeyDiagram-JHISSGLW-N9__o75J.js → journeyDiagram-JHISSGLW-ByAP1uL0.js} +1 -1
- package/dist/client/assets/{kanban-definition-UN3LZRKU-BbtqdHL3.js → kanban-definition-UN3LZRKU-CGXOqdl0.js} +1 -1
- package/dist/client/assets/{line-MwEcOq8D.js → line-BZ3JWBtG.js} +1 -1
- package/dist/client/assets/{mermaid-parser.core-C_-_i9ct.js → mermaid-parser.core-DuHIifHL.js} +1 -1
- package/dist/client/assets/{mermaid.core-jFmh7tic.js → mermaid.core-Co8EqKSU.js} +3 -3
- package/dist/client/assets/{mindmap-definition-RKZ34NQL-cAM3OmtA.js → mindmap-definition-RKZ34NQL-Cv3-5Q_b.js} +1 -1
- package/dist/client/assets/{pieDiagram-4H26LBE5-B7wO_tA6.js → pieDiagram-4H26LBE5-DziVyTJT.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-W4KKPZXB-41IRD1HZ.js → quadrantDiagram-W4KKPZXB-DjNtV4An.js} +1 -1
- package/dist/client/assets/{requirementDiagram-4Y6WPE33-CRp-2G5Y.js → requirementDiagram-4Y6WPE33-Cs3npD-z.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-5OEKKPKP-C2jxwbv9.js → sankeyDiagram-5OEKKPKP-DxepDJwc.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-3UESZ5HK-C0ifwFNY.js → sequenceDiagram-3UESZ5HK-DIPg-NEj.js} +1 -1
- package/dist/client/assets/{stateDiagram-AJRCARHV-DtkDso6_.js → stateDiagram-AJRCARHV-DUA-Ko9b.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-D6OlcyEp.js +1 -0
- package/dist/client/assets/{timeline-definition-PNZ67QCA-DwL2DqkA.js → timeline-definition-PNZ67QCA-wvi8pREg.js} +1 -1
- package/dist/client/assets/{vennDiagram-CIIHVFJN-Cd1A1glE.js → vennDiagram-CIIHVFJN-CabtIweB.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YWT4CUSO-DpWpjU7R.js → wardleyDiagram-YWT4CUSO-BiOWydTY.js} +1 -1
- package/dist/client/assets/{xychartDiagram-2RQKCTM6-BROvAGf_.js → xychartDiagram-2RQKCTM6-sWfRgDRl.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/db.js +50 -9
- package/dist/server/db.js.map +1 -1
- package/dist/server/index.js +218 -5
- package/dist/server/index.js.map +1 -1
- package/dist/server/lib/attachments.js +36 -26
- package/dist/server/lib/attachments.js.map +1 -1
- package/dist/server/lib/chats.js +2 -2
- package/dist/server/lib/chats.js.map +1 -1
- package/dist/server/lib/integrations/github-issues.js +107 -12
- package/dist/server/lib/integrations/github-issues.js.map +1 -1
- package/dist/server/lib/integrations/importedIssueImages.js +210 -0
- package/dist/server/lib/integrations/importedIssueImages.js.map +1 -0
- package/dist/server/lib/integrations/jira.js +132 -21
- package/dist/server/lib/integrations/jira.js.map +1 -1
- package/dist/server/lib/specOperations.js +9 -4
- package/dist/server/lib/specOperations.js.map +1 -1
- package/dist/server/lib/specs.js +2 -7
- package/dist/server/lib/specs.js.map +1 -1
- package/package.json +1 -1
- package/dist/client/assets/GitHubActionsDialog-B0yRjwYQ.js +0 -1
- package/dist/client/assets/channel-JBvp4GqN.js +0 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-vGoYHbZF.js +0 -1
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-DuL6ksKg.js +0 -1
- package/dist/client/assets/index--HKq89za.css +0 -2
- package/dist/client/assets/index-QYW4Cu-e.js +0 -260
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-CpWls-En.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-BNv3lrIs.js";import{B as t,C as n,D as r,E as i,F as a,I as o,L as s,M as c,N as l,O as u,R as d,T as f,W as p,_ as m,b as h,c as g,d as _,f as v,j as y,l as b,r as x,s as S,u as C,w,y as T,z as E}from"./index-WeECH1eZ.js";var D=e(p(),1),O=E(),k=`https://docs.github.com/en/actions`,A=(e,t)=>_.t(`common:githubActions.${e}`,t),j=e=>A(`status.${e}`),M=e=>e?A(`conclusion.${e}`):null,N=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`||e.conclusion===`timed_out`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e.conclusion===`cancelled`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e.status===`queued`?`border-violet-400/40 bg-violet-500/10 text-violet-200`:`border-border/70 bg-background/60 text-muted-foreground`,P=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`?`border-rose-400/30 bg-rose-500/10 text-rose-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border/70 bg-background/60 text-muted-foreground`,F=e=>{let t=e.run_started_at??e.created_at,n=e.updated_at;if(!t||!n)return null;let r=Date.parse(t),i=Date.parse(n);if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return null;let a=i-r;if(a<1e3)return`${a} ms`;let o=Math.floor(a/1e3),s=Math.floor(o/3600),c=Math.floor(o%3600/60),l=o%60;return s>0?`${s}h ${c}m ${l}s`:c>0?`${c}m ${l}s`:`${(a/1e3).toFixed(a>=1e4?0:1)} s`},I=e=>e.status===`completed`?M(e.conclusion)??A(`status.completed`):j(e.status),L=e=>{let t={};for(let n of e){if(n.type===`boolean`){t[n.name]=n.default===!0;continue}typeof n.default==`string`&&n.default!==``&&(t[n.name]=n.default)}return t},R=({workflow:e,inputsState:t,isSelected:n,onSelect:r})=>{let i=e.state===`active`,a=t?.dispatchable??!0,o=i&&a&&!t?.isLoading;return(0,O.jsxs)(`div`,{className:l(`flex items-center justify-between gap-3 rounded-2xl border px-4 py-3 transition-colors`,n?`border-sky-400/45 bg-sky-500/10`:`border-border/60 bg-background/20 hover:bg-accent/20`),children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`p`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),(0,O.jsx)(`p`,{className:`mt-0.5 truncate text-[11px] text-muted-foreground`,children:e.path.split(`/`).pop()})]}),(0,O.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,O.jsx)(S,{variant:`outline`,className:l(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,i?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:`border-border/70 bg-background/60 text-muted-foreground`),children:A(i?`workflows.stateActive`:`workflows.stateDisabled`)}),(0,O.jsxs)(c,{type:`button`,variant:n?`secondary`:`outline`,size:`sm`,className:`h-8 gap-1.5 px-3 text-xs`,disabled:!o,"aria-label":A(`workflows.runAriaLabel`,{name:e.name}),title:!a&&t?A(`inputs.notDispatchable`):void 0,onClick:r,children:[t?.isLoading?(0,O.jsx)(h,{className:`h-3.5 w-3.5 animate-spin`}):(0,O.jsx)(T,{className:`h-3.5 w-3.5`}),(0,O.jsx)(`span`,{children:A(`actions.run`)})]})]})]})},z=({workflow:e,inputsState:t,refValue:r,onRefChange:i,values:a,onValueChange:o,isDispatching:s,onDispatch:l,onCancel:u})=>{let d=t.inputs.filter(e=>e.required&&!B(a[e.name],e)),f=t.dispatchable&&!t.isLoading&&!t.error&&r.trim()!==``&&d.length===0&&!s;return(0,O.jsxs)(`div`,{className:`space-y-4 rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:A(`inputs.title`)}),(0,O.jsx)(`p`,{className:`mt-0.5 truncate text-sm font-medium text-foreground`,children:e.name})]}),(0,O.jsx)(c,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":A(`actions.cancel`),onClick:u,children:(0,O.jsx)(g,{className:`h-4 w-4`})})]}),(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsx)(n,{htmlFor:`github-actions-ref`,children:A(`inputs.refLabel`)}),(0,O.jsx)(w,{id:`github-actions-ref`,type:`text`,value:r,onChange:e=>{i(e.target.value)},placeholder:A(`inputs.refPlaceholder`),"aria-label":A(`inputs.refAriaLabel`)})]}),t.isLoading&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(h,{className:`h-3.5 w-3.5 animate-spin`}),(0,O.jsx)(`span`,{children:A(`inputs.loading`)})]}),t.error&&(0,O.jsx)(`p`,{className:`text-xs text-rose-200`,children:t.error}),!t.dispatchable&&!t.isLoading&&!t.error&&(0,O.jsx)(`p`,{className:`text-xs text-amber-200`,children:A(`inputs.notDispatchable`)}),t.inputs.map(e=>(0,O.jsx)(V,{input:e,value:a[e.name],onChange:t=>{o(e.name,t)}},e.name)),d.length>0&&(0,O.jsx)(`p`,{className:`text-xs text-rose-200`,children:A(`inputs.requiredValidationError`)}),(0,O.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,O.jsx)(c,{type:`button`,variant:`ghost`,onClick:u,disabled:s,children:A(`actions.cancel`)}),(0,O.jsxs)(c,{type:`button`,variant:`success`,onClick:l,disabled:!f,children:[s?(0,O.jsx)(h,{className:`h-4 w-4 animate-spin`}):(0,O.jsx)(T,{className:`h-4 w-4`}),(0,O.jsx)(`span`,{children:A(`actions.dispatch`)})]})]})]})},B=(e,t)=>t.type===`boolean`?typeof e==`boolean`:typeof e==`string`&&e.trim()!==``,V=({input:e,value:t,onChange:r})=>{let i=`github-actions-input-${e.name}`;return(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsxs)(n,{htmlFor:i,className:`flex items-center gap-2`,children:[(0,O.jsx)(`span`,{children:e.name}),e.required&&(0,O.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.18em] text-rose-200/80`,children:A(`inputs.requiredLabel`)})]}),e.description&&(0,O.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.description}),H(e,i,t,r)]})},H=(e,t,n,r)=>{if(e.type===`boolean`){let i=typeof n==`boolean`?n:e.default===!0;return(0,O.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(x,{id:t,checked:i,onCheckedChange:e=>{r(e)}}),(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:A(i?`inputs.booleanYes`:`inputs.booleanNo`)})]})}if(e.type===`choice`){let i=e.options??[],a=typeof n==`string`?n:typeof e.default==`string`?e.default:``;return(0,O.jsxs)(`select`,{id:t,className:`h-9 w-full rounded-lg border border-border/70 bg-background/60 px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,value:a,onChange:e=>{r(e.target.value)},children:[a===``&&(0,O.jsx)(`option`,{value:``,children:A(`inputs.selectPlaceholder`)}),i.map(e=>(0,O.jsx)(`option`,{value:e,children:e},e))]})}return(0,O.jsx)(w,{id:t,type:`text`,value:typeof n==`string`?n:typeof e.default==`string`?e.default:``,onChange:e=>{r(e.target.value)}})},U=({job:e})=>e.steps.length===0?null:(0,O.jsx)(`div`,{className:`mt-2 ml-4 space-y-1 border-l border-border/60 pl-4`,children:e.steps.map(t=>(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(S,{variant:`outline`,className:l(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,P(t)),children:t.status===`completed`?M(t.conclusion)??A(`status.completed`):j(t.status)}),(0,O.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:t.name})]},`${e.id}-${t.number}`))}),W=({run:e})=>{let t=F(e),n=I(e);return(0,O.jsxs)(`div`,{className:`rounded-2xl border border-border/60 bg-background/20 px-4 py-3`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name??`#${e.id}`}),(0,O.jsx)(S,{variant:`outline`,className:l(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,N(e)),children:n})]}),(0,O.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[t&&(0,O.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t}),e.html_url&&(0,O.jsxs)(`a`,{href:e.html_url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-sky-200 hover:text-sky-100`,children:[A(`actions.openOnGithub`),(0,O.jsx)(b,{className:`h-3 w-3`})]})]})]}),e.head_branch&&(0,O.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e.head_branch}),e.jobs.map(e=>(0,O.jsxs)(`div`,{className:`mt-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(S,{variant:`outline`,className:l(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,N(e)),children:e.status===`completed`?M(e.conclusion)??A(`status.completed`):j(e.status)}),(0,O.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.name})]}),(0,O.jsx)(U,{job:e})]},e.id))]})},G=({tracked:e})=>{let t=e.state===`not_visible`?A(`runs.notVisible`):A(`runs.resolving`);return(0,O.jsxs)(`div`,{className:`flex items-center gap-2 rounded-2xl border border-border/60 bg-background/20 px-4 py-3`,children:[(0,O.jsx)(h,{className:`h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]})},K=e=>({ref:e??`main`}),q=({projectId:e,defaultBranch:n,onClose:l})=>{let[p,_]=(0,D.useState)([]),[x,S]=(0,D.useState)(!0),[w,T]=(0,D.useState)(null),[E,j]=(0,D.useState)([]),[M,N]=(0,D.useState)([]),[P,F]=(0,D.useState)({}),[I,B]=(0,D.useState)(null),[V,H]=(0,D.useState)(!1),[U]=(0,D.useState)(()=>K(n)),q=(0,D.useCallback)(async n=>{F(e=>{let t=e[n.id];return t?.isLoading?e:{...e,[n.id]:{inputs:t?.inputs??[],dispatchable:t?.dispatchable??!0,isLoading:!0,error:null}}});try{let t=await o(e,n.id,n.path);return F(e=>({...e,[n.id]:{inputs:t.inputs,dispatchable:t.dispatchable,isLoading:!1,error:null}})),t}catch(e){return F(r=>({...r,[n.id]:{inputs:[],dispatchable:!0,isLoading:!1,error:e instanceof t?e.message:A(`workflows.loadError`)}})),null}},[e]),J=(0,D.useCallback)(async()=>{S(!0),T(null);try{let t=await d(e);_(t.workflows),Promise.allSettled(t.workflows.map(e=>q(e)))}catch(e){T(e instanceof t?e.message:A(`workflows.loadError`))}finally{S(!1)}},[q,e]),Y=(0,D.useCallback)(async()=>{try{j((await s(e)).runs)}catch(e){console.warn(`[github-actions] unable to load runs`,e)}},[e]);(0,D.useEffect)(()=>{J(),Y()},[J,Y]);let X=(0,D.useCallback)(async e=>{B({workflow:e,ref:U.ref,values:{}});let t=P[e.id];if(t&&!t.isLoading&&!t.error){B(n=>!n||n.workflow.id!==e.id?n:{...n,values:L(t.inputs)});return}let n=await q(e);n&&B(t=>!t||t.workflow.id!==e.id?t:{...t,values:L(n.inputs)})},[U.ref,P,q]),Z=(0,D.useCallback)(async()=>{if(!I)return;let n=P[I.workflow.id];if(!n||!n.dispatchable)return;H(!0);let r={};for(let e of n.inputs){let t=I.values[e.name];e.type===`boolean`?r[e.name]=typeof t==`boolean`?t:e.default===!0:typeof t==`string`&&t!==``?r[e.name]=t:typeof e.default==`string`&&e.default!==``&&(r[e.name]=e.default)}try{await a(e,I.workflow.id,{ref:I.ref,inputs:r}),m.success(A(`messages.dispatched`)),B(null),Y()}catch(e){m.error(e instanceof t?e.message:A(`messages.dispatchError`))}finally{H(!1)}},[P,Y,e,I]);(0,D.useEffect)(()=>{let t=t=>{!t||t.project_id!==e||(N(e=>{let n=e.filter(e=>e.tracking_key!==t.tracking_key);return t.run?n:[...n,t]}),t.run&&j(e=>{let n=e.findIndex(e=>e.id===t.run.id);if(n===-1)return[t.run,...e];let r=[...e];return r[n]=t.run,r}))};return C.on(`github-actions:updated`,t),()=>{C.off(`github-actions:updated`,t)}},[e]);let Q=(0,D.useMemo)(()=>[...E].sort((e,t)=>{let n=e.updated_at?Date.parse(e.updated_at):0;return(t.updated_at?Date.parse(t.updated_at):0)-n}),[E]);return(0,O.jsx)(f,{open:!0,onOpenChange:e=>{e||l()},children:(0,O.jsxs)(r,{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-5xl`,onInteractOutside:e=>e.preventDefault(),children:[(0,O.jsx)(y,{className:`sr-only`,children:A(`dialog.srTitle`)}),(0,O.jsx)(u,{className:`sr-only`,children:A(`dialog.srDescription`)}),(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-violet-200`,children:(0,O.jsx)(v,{className:`h-5 w-5`})}),(0,O.jsx)(`div`,{children:(0,O.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:A(`dialog.title`)})})]}),(0,O.jsx)(i,{asChild:!0,children:(0,O.jsx)(c,{type:`button`,"aria-label":A(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,O.jsx)(g,{className:`h-4 w-4`})})})]}),(0,O.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 overflow-hidden lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,O.jsxs)(`aside`,{"aria-label":A(`workflows.ariaLabel`),className:`flex min-h-0 flex-col gap-3 overflow-y-auto border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,O.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:A(`workflows.title`)}),(0,O.jsx)(c,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>{J(),Y()},children:A(`actions.refresh`)})]}),x&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 px-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(h,{className:`h-3.5 w-3.5 animate-spin`}),(0,O.jsx)(`span`,{children:A(`workflows.loading`)})]}),w&&(0,O.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:w}),!x&&p.length===0&&!w&&(0,O.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:[(0,O.jsx)(`p`,{children:A(`workflows.empty`)}),(0,O.jsx)(`p`,{className:`mt-1`,children:A(`workflows.emptyHint`)}),(0,O.jsxs)(`a`,{href:k,target:`_blank`,rel:`noreferrer`,className:`mt-2 inline-flex items-center gap-1 text-xs text-sky-200 hover:text-sky-100`,children:[A(`workflows.docsLink`),(0,O.jsx)(b,{className:`h-3 w-3`})]})]}),(0,O.jsx)(`div`,{className:`space-y-2`,children:p.map(e=>(0,O.jsx)(R,{workflow:e,inputsState:P[e.id]??null,isSelected:I?.workflow.id===e.id,onSelect:()=>{X(e)}},e.id))}),I&&(0,O.jsx)(z,{workflow:I.workflow,inputsState:P[I.workflow.id]??{inputs:[],dispatchable:!0,isLoading:!1,error:null},refValue:I.ref,onRefChange:e=>{B(t=>t&&{...t,ref:e})},values:I.values,onValueChange:(e,t)=>{B(n=>n&&{...n,values:{...n.values,[e]:t}})},isDispatching:V,onDispatch:()=>{Z()},onCancel:()=>{B(null)}})]}),(0,O.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-3 overflow-y-auto px-4 py-4`,children:[(0,O.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:A(`runs.title`)}),M.map(e=>(0,O.jsx)(G,{tracked:e},e.tracking_key)),Q.map(e=>(0,O.jsx)(W,{run:e},e.id)),Q.length===0&&M.length===0&&(0,O.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:A(`runs.empty`)})]})]})]})})};export{q as GitHubActionsDialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./chunk-BNv3lrIs.js";import{A as t,B as n,D as r,E as i,H as a,M as o,N as s,O as c,P as l,S as u,T as d,U as f,V as p,W as m,a as h,b as g,c as ee,d as _,g as v,h as y,i as b,j as x,k as S,m as te,n as C,o as w,p as ne,s as T,u as E,v as D,w as O,x as re,y as ie,z as k}from"./index-QYW4Cu-e.js";var A=e(m(),1),ae=(e,t)=>f(p(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),oe=(e,t)=>f(p(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),se=(e,t={})=>f(p(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),ce=(e,t)=>f(p(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),le=e=>f(p(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),ue=e=>a(p(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),j=k(),M=256*1024,N=24,P=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),F=(e,t)=>_.t(`common:testsDialog.${e}`,t),de=(e,t)=>{let n=`${e}${t}`;return n.length<=M?n:n.slice(-M)},I=e=>e.replace(P,``),fe=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=N,L=e=>{e.scrollTop=e.scrollHeight},pe=(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)}},me=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[]}},R=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`,he=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=>F(e===`passed`?`status.passed`:e===`failed`?`status.failed`:e===`running`?`status.running`:e===`error`?`status.error`:e===`stopped`?`status.stopped`:`status.idle`),ge=e=>e?.selection?e.selection.kind===`all`?F(`selection.allTests`):e.selection.kind===`case`?e.selection.name:z(e.selection.path):F(`selection.noRunYet`),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`,_e=(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,ve=`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:s(`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":F(`caseRow.runAriaLabel`,{name:r}),title:r,className:s(`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:c,onRunFile:l,onToggleFile:d})=>{let f=e===`file`&&n===i.path,p=e===`case`&&n===i.path;return(0,j.jsx)(b,{open:a,onOpenChange:e=>{d(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)(w,{asChild:!0,children:(0,j.jsx)(o,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":F(a?`fileRow.collapseAriaLabel`:`fileRow.expandAriaLabel`,{path:i.path}),className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,j.jsx)(u,{className:s(`h-4 w-4 transition-transform`,a&&`rotate-180`)})})}),(0,j.jsx)(`button`,{type:`button`,"aria-label":F(`fileRow.runAriaLabel`,{path:i.path}),className:s(`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`,(f||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)(C,{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.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:F(`fileRow.testCount`,{count:i.cases.length})})]})]})})]}),(0,j.jsx)(h,{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:F(`fileRow.noNamedTests`)}):(0,j.jsx)(`div`,{className:`space-y-1`,children:i.cases.map(a=>{let o=e===`case`&&n===i.path&&t===a.name;return(0,j.jsx)(q,{canRunGranular:r,filePath:i.path,isActive:o,name:a.name,onRunCase:c},a.id)})})})})]})})});J.displayName=`DiscoveryFileRow`;var ye=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,availableCommands:r,canRunGranular:i,discovery:a,expandedFiles:c,fullSuiteOnlyNotice:l,isLoading:d,selectedCommandId:f,selectedCommandName:p,sessionError:m,sessionStatus:h,shouldShowCommandSelector:_,onRunCase:b,onRunFile:x,onSelectCommand:S,onToggleFile:C})=>{let[w,T]=(0,A.useState)(``),E=(0,A.useMemo)(()=>H(a,w),[a,w]),D=(0,A.useMemo)(()=>E.reduce((e,t)=>e+t.cases.length,0),[E]),re=B(w).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:[_&&(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:F(`scope.label`)}),(0,j.jsxs)(ne,{children:[(0,j.jsx)(v,{asChild:!0,children:(0,j.jsxs)(o,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":F(`scope.selectedCommandAriaLabel`),disabled:r.length===0||h===`running`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:p??F(`scope.selectTestScope`)}),(0,j.jsx)(u,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,j.jsx)(te,{align:`start`,className:`w-72`,children:r.map(e=>(0,j.jsx)(y,{className:s(f===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{S(e.id)},children:(0,j.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),l&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:l}),(a.length>0||w.length>0)&&(0,j.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,j.jsx)(O,{type:`search`,value:w,onChange:e=>{T(e.target.value)},placeholder:F(`filter.placeholder`),"aria-label":F(`filter.ariaLabel`),className:`pr-10`}),w.length>0&&(0,j.jsx)(o,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":F(`filter.clearAriaLabel`),className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{T(``)},children:(0,j.jsx)(ee,{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:F(`discovery.noCommands`)}),m&&(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:m}),(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:[F(`discovery.fileCount`,{count:E.length}),`, `,F(`discovery.caseCount`,{count:D})]})}),d&&(0,j.jsx)(g,{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&&!d?(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:F(`discovery.noFilesDetected`)}):E.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:F(`discovery.noFilterMatches`)}):E.map(r=>(0,j.jsx)(J,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:i,file:r,isExpanded:re||(c[r.path]??!1),onRunCase:b,onRunFile:x,onToggleFile:C},r.path))})]})]})})});ye.displayName=`DiscoveryPane`;var be=(0,A.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:a,viewportRef:o,onScroll:c})=>{let l=(0,A.useMemo)(()=>t?I(t).replaceAll(`\r
|
|
1
|
+
import{a as e}from"./chunk-BNv3lrIs.js";import{A as t,B as n,D as r,E as i,H as a,M as o,N as s,O as c,P as l,S as u,T as d,U as f,V as p,W as m,a as h,b as g,c as ee,d as _,g as v,h as y,i as b,j as x,k as S,m as te,n as C,o as w,p as ne,s as T,u as E,v as D,w as O,x as re,y as ie,z as k}from"./index-WeECH1eZ.js";var A=e(m(),1),ae=(e,t)=>f(p(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),oe=(e,t)=>f(p(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),se=(e,t={})=>f(p(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),ce=(e,t)=>f(p(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),le=e=>f(p(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),ue=e=>a(p(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),j=k(),M=256*1024,N=24,P=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),F=(e,t)=>_.t(`common:testsDialog.${e}`,t),de=(e,t)=>{let n=`${e}${t}`;return n.length<=M?n:n.slice(-M)},I=e=>e.replace(P,``),fe=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=N,L=e=>{e.scrollTop=e.scrollHeight},pe=(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)}},me=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[]}},R=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`,he=e=>{if(e==null)return null;if(e<1e3)return`${e} ms`;let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m ${i}s`:r>0?`${r}m ${i}s`:`${(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=>F(e===`passed`?`status.passed`:e===`failed`?`status.failed`:e===`running`?`status.running`:e===`error`?`status.error`:e===`stopped`?`status.stopped`:`status.idle`),ge=e=>e?.selection?e.selection.kind===`all`?F(`selection.allTests`):e.selection.kind===`case`?e.selection.name:z(e.selection.path):F(`selection.noRunYet`),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`,_e=(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,ve=`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:s(`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":F(`caseRow.runAriaLabel`,{name:r}),title:r,className:s(`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:c,onRunFile:l,onToggleFile:d})=>{let f=e===`file`&&n===i.path,p=e===`case`&&n===i.path;return(0,j.jsx)(b,{open:a,onOpenChange:e=>{d(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)(w,{asChild:!0,children:(0,j.jsx)(o,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":F(a?`fileRow.collapseAriaLabel`:`fileRow.expandAriaLabel`,{path:i.path}),className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,j.jsx)(u,{className:s(`h-4 w-4 transition-transform`,a&&`rotate-180`)})})}),(0,j.jsx)(`button`,{type:`button`,"aria-label":F(`fileRow.runAriaLabel`,{path:i.path}),className:s(`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`,(f||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)(C,{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.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:F(`fileRow.testCount`,{count:i.cases.length})})]})]})})]}),(0,j.jsx)(h,{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:F(`fileRow.noNamedTests`)}):(0,j.jsx)(`div`,{className:`space-y-1`,children:i.cases.map(a=>{let o=e===`case`&&n===i.path&&t===a.name;return(0,j.jsx)(q,{canRunGranular:r,filePath:i.path,isActive:o,name:a.name,onRunCase:c},a.id)})})})})]})})});J.displayName=`DiscoveryFileRow`;var ye=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,availableCommands:r,canRunGranular:i,discovery:a,expandedFiles:c,fullSuiteOnlyNotice:l,isLoading:d,selectedCommandId:f,selectedCommandName:p,sessionError:m,sessionStatus:h,shouldShowCommandSelector:_,onRunCase:b,onRunFile:x,onSelectCommand:S,onToggleFile:C})=>{let[w,T]=(0,A.useState)(``),E=(0,A.useMemo)(()=>H(a,w),[a,w]),D=(0,A.useMemo)(()=>E.reduce((e,t)=>e+t.cases.length,0),[E]),re=B(w).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:[_&&(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:F(`scope.label`)}),(0,j.jsxs)(ne,{children:[(0,j.jsx)(v,{asChild:!0,children:(0,j.jsxs)(o,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":F(`scope.selectedCommandAriaLabel`),disabled:r.length===0||h===`running`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:p??F(`scope.selectTestScope`)}),(0,j.jsx)(u,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,j.jsx)(te,{align:`start`,className:`w-72`,children:r.map(e=>(0,j.jsx)(y,{className:s(f===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{S(e.id)},children:(0,j.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),l&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:l}),(a.length>0||w.length>0)&&(0,j.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,j.jsx)(O,{type:`search`,value:w,onChange:e=>{T(e.target.value)},placeholder:F(`filter.placeholder`),"aria-label":F(`filter.ariaLabel`),className:`pr-10`}),w.length>0&&(0,j.jsx)(o,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":F(`filter.clearAriaLabel`),className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{T(``)},children:(0,j.jsx)(ee,{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:F(`discovery.noCommands`)}),m&&(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:m}),(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:[F(`discovery.fileCount`,{count:E.length}),`, `,F(`discovery.caseCount`,{count:D})]})}),d&&(0,j.jsx)(g,{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&&!d?(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:F(`discovery.noFilesDetected`)}):E.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:F(`discovery.noFilterMatches`)}):E.map(r=>(0,j.jsx)(J,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:i,file:r,isExpanded:re||(c[r.path]??!1),onRunCase:b,onRunFile:x,onToggleFile:C},r.path))})]})]})})});ye.displayName=`DiscoveryPane`;var be=(0,A.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:a,viewportRef:o,onScroll:c})=>{let l=(0,A.useMemo)(()=>t?I(t).replaceAll(`\r
|
|
2
2
|
`,`
|
|
3
3
|
`).replaceAll(`\r`,`
|
|
4
4
|
`).split(`
|