@capagents/forgeqe 2.7.5 → 2.7.6
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/HOW_TO_USE.md +23 -0
- package/dist/docs-site/docs/index.html +17 -0
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/forgeqe.js +1562 -1555
- package/dist/web/assets/Agent-BfZX7pM9.js +4 -0
- package/dist/web/assets/ApiTests-l_CkazdD.js +10 -0
- package/dist/web/assets/{Chat-DzcXQtRU.js → Chat-BSUVZdh2.js} +3 -3
- package/dist/web/assets/{CommandPalette-BPUcuL1R.js → CommandPalette-Ckz1AQJT.js} +1 -1
- package/dist/web/assets/{Data-ZQmWEw-T.js → Data-Ig_7x4WD.js} +3 -3
- package/dist/web/assets/Evidence-DsllYNNx.js +1 -0
- package/dist/web/assets/Features-IqPqXkST.js +1 -0
- package/dist/web/assets/{ForceGraph-oAsEGwQc.js → ForceGraph-CiIze1T6.js} +1 -1
- package/dist/web/assets/Impact-CLjFt7ih.js +1 -0
- package/dist/web/assets/Jobs-F4TIPvJk.js +5 -0
- package/dist/web/assets/KindPage-Dq6eGmG4.js +6 -0
- package/dist/web/assets/Migration-Cg6Cm_Gu.js +2 -0
- package/dist/web/assets/{Product-DE2i4GjQ.js → Product-osDkLGGT.js} +2 -2
- package/dist/web/assets/{Quality-BPS1A75g.js → Quality-BaX3Y0fL.js} +1 -1
- package/dist/web/assets/Record-CkGdISSf.js +2 -0
- package/dist/web/assets/{Regression-krYLUFdO.js → Regression-CpQr6snz.js} +3 -3
- package/dist/web/assets/{Reports-Bl3L0zPe.js → Reports-W8H8OB95.js} +2 -2
- package/dist/web/assets/{Response-C66KATyo.js → Response-B4iQEi_e.js} +2 -2
- package/dist/web/assets/Runs-Cl9PEJRv.js +2 -0
- package/dist/web/assets/Shell-8Y6stc_6.js +4 -0
- package/dist/web/assets/TestCases-th8t2FcZ.js +1 -0
- package/dist/web/assets/TestData-B3UImTlO.js +2 -0
- package/dist/web/assets/Tosca-Cu9NyPOL.js +2 -0
- package/dist/web/assets/{WhatsNew-Cix_kO-M.js → WhatsNew-CpysE5Dt.js} +1 -1
- package/dist/web/assets/{dataParts-DGQaavWq.js → dataParts-D_SP2_Pw.js} +2 -2
- package/dist/web/assets/{families-DWe5Tf6V.js → families-BGEp9m2k.js} +1 -1
- package/dist/web/assets/index-DuWTO5cE.js +45 -0
- package/dist/web/assets/index-X6LBvWis.css +2 -0
- package/dist/web/assets/{logos-UHk_LNd_.js → logos-C0_O1u21.js} +1 -1
- package/dist/web/assets/{parts-6yv4V1GV.js → parts-ByBgA7Hv.js} +1 -1
- package/dist/web/assets/{productParts-DlC0tpuk.js → productParts-BFrJx-M5.js} +1 -1
- package/dist/web/assets/{qualityParts-BSTx-oHr.js → qualityParts-BNNpjvm6.js} +1 -1
- package/dist/web/assets/{segmented-7nur8ck_.js → segmented-CD8WWurO.js} +1 -1
- package/dist/web/assets/{thread-RtF8vcSJ.js → thread-Dy_QsQDd.js} +1 -1
- package/dist/web/assets/{usePageChat-Btkpy-DG.js → usePageChat-DhO0cBVa.js} +1 -1
- package/dist/web/index.html +3 -3
- package/docs/user-guide.html +17 -0
- package/package.json +1 -1
- package/py/forgeqe_engine/cli.py +3 -0
- package/py/forgeqe_engine/logins.py +74 -0
- package/py/forgeqe_engine/neutral_log.py +61 -0
- package/py/forgeqe_engine/service.py +3 -1
- package/py/forgeqe_mobile/appium_driver.py +5 -0
- package/py/forgeqe_mobile/explore.py +23 -2
- package/dist/web/assets/Agent-DX2q9LmG.js +0 -4
- package/dist/web/assets/ApiTests-Cup02reL.js +0 -10
- package/dist/web/assets/Evidence-B6VB0N8L.js +0 -1
- package/dist/web/assets/Features-jvyThbaa.js +0 -1
- package/dist/web/assets/Impact-BWERCZIN.js +0 -1
- package/dist/web/assets/Jobs-bbs9Yh-0.js +0 -5
- package/dist/web/assets/KindPage-E4XiuZKL.js +0 -6
- package/dist/web/assets/Migration-CQmzKn1a.js +0 -2
- package/dist/web/assets/Record-Ch5qKyuS.js +0 -2
- package/dist/web/assets/Runs-Bq23Zfkc.js +0 -2
- package/dist/web/assets/Shell-2xDxqPtD.js +0 -4
- package/dist/web/assets/TestCases-DvusfxET.js +0 -1
- package/dist/web/assets/TestData-Y9MWzPfm.js +0 -2
- package/dist/web/assets/Tosca-DPI6ewM-.js +0 -2
- package/dist/web/assets/index-CAbuIKyt.js +0 -45
- package/dist/web/assets/index-Dj77NVTf.css +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{At as e,Et as t,F as n,Ja as r,L as i,Ln as a,Mn as o,Mt as s,Ot as c,Qt as l,Zt as u,
|
|
2
|
-
`):`Starting…`})]}),t.runs?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(S,{label:`Project numbers`,children:[(0,F.jsx)(m,{label:`Pass rate`,big:!0,value:y===null?`–`:`${y}%`,tone:y!==null&&y<80?`text-fail`:void 0,change:O===null?void 0:{text:O===0?`Same`:`${O>0?`+`:`−`}${Math.abs(O)} ${Math.abs(O)===1?`point`:`points`}`,dir:O>0?`up`:O<0?`down`:`same`,good:O>0,against:O===0?`as the week before`:`on the week before`}}),k.map(e=>(0,F.jsx)(m,{label:e.label,value:e.value,note:e.sub},e.label))]}),(0,F.jsx)(W,{title:`Cases by day`,note:`The last ${b(Math.min(30,t.days.length),`day`)} with runs. Hover a day for its pass rate.`,children:(0,F.jsx)(K,{days:t.days})}),(0,F.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,F.jsx)(W,{title:`Fails most`,note:`Cases that failed in the most runs.`,children:t.failing.length===0?(0,F.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`No case has failed.`}):(0,F.jsx)(`ul`,{className:`m-0 list-none p-0`,children:t.failing.slice(0,8).map(e=>(0,F.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,F.jsx)(a,{size:14,"aria-hidden":`true`,className:`flex-none text-fail`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-[14px]`,"data-tip":e.title,children:[e.id&&(0,F.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink-2`,children:e.id}),` `,e.title]}),(0,F.jsx)(`span`,{className:`flex-none text-[12px] text-muted`,children:j(e.lastFailed)})]}),(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3 pl-[22px]`,children:[(0,F.jsx)(G,{part:e.failed,whole:e.runs,tone:`fail`,label:`failed ${e.failed} of ${e.runs}`}),e.summary&&(0,F.jsx)(`span`,{className:`min-w-0 truncate text-[12.5px] text-muted`,children:e.summary.replace(/[*_`#>[\]]/g,``)})]})]},e.id||e.title))})}),(0,F.jsx)(W,{title:`Defects`,note:`Failures grouped by their cause.`,children:t.defects.length===0?(0,F.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`None found.`}):(0,F.jsx)(`ul`,{className:`m-0 list-none p-0`,children:t.defects.slice(0,8).map(e=>(0,F.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate text-[14px]`,"data-tip":e.title,children:e.title}),(0,F.jsxs)(`span`,{className:`text-[12.5px] whitespace-nowrap text-muted tabular-nums`,children:[b(e.cases,`case`),` · `,b(e.runs,`run`),e.lastSeen?` · ${j(e.lastSeen)}`:``]})]},e.title))})}),(0,F.jsx)(W,{title:`Flaky`,note:`Cases that both passed and failed.`,children:t.flaky.length===0?(0,F.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`None.`}):(0,F.jsx)(`ul`,{className:`m-0 list-none p-0`,children:t.flaky.slice(0,8).map(e=>(0,F.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,F.jsxs)(`span`,{className:`min-w-0 truncate text-[14px]`,"data-tip":e.title,children:[e.id&&(0,F.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink-2`,children:e.id}),` `,e.title]}),(0,F.jsx)(G,{part:e.failed,whole:e.runs,tone:`fail`,label:`${e.failed}/${e.runs} failed`})]},e.id||e.title))})}),(0,F.jsx)(W,{title:`By kind`,note:`Each kind of run and how often its cases passed.`,children:t.kinds.length===0?(0,F.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`No runs with results yet.`}):(0,F.jsx)(`ul`,{className:`m-0 list-none p-0`,children:t.kinds.map(e=>(0,F.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-x-4 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate text-[14px]`,children:I[e.scope]||e.scope}),(0,F.jsx)(`span`,{className:`text-[12.5px] text-muted tabular-nums`,children:b(e.runs,`run`)}),(0,F.jsx)(G,{part:e.passed,whole:e.cases,tone:`pass`,label:e.cases?`${Math.round(e.passed/e.cases*100)}% passed`:`no cases`})]},e.scope))})})]})]}):(0,F.jsx)(_,{icon:x,title:`No runs yet`,action:(0,F.jsx)(`a`,{className:l({size:`sm`}),href:e(),children:`Start a chat`}),children:`Runs, suites and monitor rounds are taken together here once there are some: pass rate by day, the cases that fail most, flaky cases and defects.`})]})}function J({sub:e}){let[n,i]=(0,P.useState)(null),[a,o]=(0,P.useState)(``),[s,l]=(0,P.useState)(``),[d,f]=(0,P.useState)(``),[m,g]=(0,P.useState)(`all`),[_,v]=(0,P.useState)(B),[b,x]=(0,P.useState)(``),S=(0,P.useCallback)(()=>{r.list().then(i,e=>o(e.message))},[]);(0,P.useEffect)(S,[S]);let C=e===`project`?`project`:`execution`,D=n?.rows??null,H=d.toLowerCase().split(/\s+/).filter(Boolean),U=(0,P.useMemo)(()=>(D||[]).filter(e=>(!s||e.scope===s)&&H.every(t=>`${e.title} ${e.id} ${I[e.scope]}`.toLowerCase().includes(t))),[D,s,d]),W=U.filter(e=>z(e).tone===`fail`).length,G=m===`failed`?U.filter(e=>z(e).tone===`fail`):U;(0,P.useEffect)(()=>v(B),[s,d,m]);let K=[...new Set((D||[]).map(e=>e.scope))];return(0,F.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,F.jsx)(y,{}),(0,F.jsxs)(`main`,{className:T(A,`@container flex-auto gap-4`),children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-6 gap-y-2`,children:[(0,F.jsx)(t,{pixel:h.reports,size:`lg`}),(0,F.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Reports`}),(0,F.jsx)(M,{label:`Runs and reports`,links:N,current:C===`project`?`reports-project`:`reports`})]}),a&&(0,F.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:a}),!n&&!a&&(0,F.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),n&&C===`project`&&(0,F.jsx)(q,{project:n.project,build:n.build,onBuilt:S}),n&&C===`execution`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Every report ForgeQE generated, newest first. Open one to see it in full in a new tab.`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(p,{id:`report-search`,label:`Find a report`,value:d,onChange:f}),[[`all`,`All`,U.length],[`failed`,`Failed`,W]].map(([e,t,n])=>(0,F.jsxs)(`button`,{type:`button`,"aria-pressed":m===e,onClick:()=>g(e),className:T(`inline-flex min-h-8 cursor-pointer items-center gap-1 rounded-[8px] border px-3 text-[13px] font-medium`,m===e?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:bg-line hover:text-ink`),children:[t,(0,F.jsx)(`span`,{className:T(`tabular-nums`,e===`failed`&&n?`text-fail`:``),children:n})]},e)),K.length>1&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`label`,{htmlFor:`report-kind`,className:`sr-only`,children:`Kind`}),(0,F.jsxs)(E,{size:`sm`,id:`report-kind`,value:s,onChange:e=>l(e.target.value),className:`w-auto pr-7 pl-3`,children:[(0,F.jsx)(`option`,{value:``,children:`Every kind`}),K.map(e=>(0,F.jsx)(`option`,{value:e,children:I[e]},e))]})]})]}),b&&(0,F.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:b}),(0,F.jsxs)(`div`,{className:`rounded-[14px] card border`,children:[(0,F.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[minmax(0,1fr)_110px_150px_100px_128px] items-center gap-x-4 border-b border-line-soft px-4 py-2 text-[12px] font-semibold text-muted @3xl:grid`,children:[(0,F.jsx)(`span`,{children:`Report`}),(0,F.jsx)(`span`,{children:`Kind`}),(0,F.jsx)(`span`,{children:`Result`}),(0,F.jsx)(`span`,{className:`text-right`,children:`When`}),(0,F.jsx)(`span`,{})]}),(0,F.jsxs)(`ul`,{"aria-label":`Execution reports`,className:`m-0 list-none p-1.5`,children:[G.length===0&&(0,F.jsx)(`li`,{className:`px-3 py-4 text-sm text-muted`,children:n.rows.length?`Nothing matches.`:`No reports yet. Runs, suites and monitor rounds show here once they have run.`}),G.slice(0,_).map((e,t,n)=>{let r=k(e.startedAt),i=z(e);return(0,F.jsxs)(`li`,{className:`contents`,children:[(t===0||k(n[t-1].startedAt)!==r)&&(0,F.jsx)(`span`,{className:`block px-3 pt-3 pb-1 text-[12px] font-semibold text-muted`,children:r}),(0,F.jsxs)(`div`,{className:`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 rounded-[10px] px-3 py-1.5 hover:bg-surface-muted @3xl:grid-cols-[auto_minmax(0,1fr)_110px_150px_100px_128px] @3xl:gap-x-4`,children:[(0,F.jsx)(V,{r:e}),(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,F.jsx)(`span`,{className:`truncate text-[14px] font-medium`,"data-tip":e.title,children:e.title}),(0,F.jsx)(`span`,{className:`truncate text-[12px] text-muted @3xl:hidden`,children:[I[e.scope],e.scope===`page`||!e.counts.total?``:`${e.counts.passed}/${e.counts.total} passed`,j(e.startedAt)].filter(Boolean).join(` · `)})]}),(0,F.jsx)(`span`,{className:`hidden truncate text-[13px] text-muted @3xl:block`,children:I[e.scope]}),(0,F.jsxs)(`span`,{className:`hidden truncate text-[13px] text-muted tabular-nums @3xl:block`,children:[(0,F.jsx)(`span`,{className:T(i.tone===`fail`&&`text-fail`),children:e.scope===`page`?`Report`:e.counts.total?`${e.counts.passed}/${e.counts.total} passed`:i.label}),R(e.ms)?` · ${R(e.ms)}`:``]}),(0,F.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,"data-tip":L(e.startedAt),children:j(e.startedAt)}),(0,F.jsx)(`span`,{className:`flex min-w-0 justify-end`,children:e.report?(0,F.jsxs)(u,{size:`sm`,"aria-label":`Open the report of ${e.title} in a new tab`,onClick:async()=>x(await c(e.report)),children:[(0,F.jsx)(w,{"aria-hidden":`true`}),(0,F.jsx)(`span`,{className:`hidden @md:inline`,children:`Open report`})]}):(0,F.jsx)(O,{path:e.folder,children:`Folder`})})]})]},e.key)})]}),(G.length>_||n.total>n.rows.length)&&(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t border-line-soft px-4 py-2.5 text-[13px] text-muted`,children:[(0,F.jsxs)(`span`,{children:[`Showing `,Math.min(_,G.length),` of `,G.length,n.total>n.rows.length?` (the newest ${n.rows.length} of ${n.total})`:``]}),G.length>_&&(0,F.jsxs)(u,{size:`sm`,onClick:()=>v(_+B),children:[`Show `,Math.min(B,G.length-_),` more`]})]})]})]})]})]})}export{J as Reports};
|
|
1
|
+
import{At as e,Et as t,F as n,Ja as r,L as i,Ln as a,Mn as o,Mt as s,Ot as c,Qt as l,Zt as u,ct as d,ft as f,gt as p,hr as m,ht as h,io as g,jn as _,lo as v,n as y,nn as b,oo as x,or as S,pt as C,rr as w,tn as T,ut as E,xi as D}from"./Shell-8Y6stc_6.js";import{c as O,i as k,o as A,r as j}from"./index-DuWTO5cE.js";import{t as M}from"./segmented-CD8WWurO.js";import{r as N}from"./families-BGEp9m2k.js";var P=v(x(),1),F=g(),I={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`Mobile run`,page:`Report page`},L=e=>{if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,...t.getFullYear()===new Date().getFullYear()?{}:{year:`numeric`},hour:`numeric`,minute:`2-digit`})},R=e=>{if(!e)return``;let t=Math.round(e/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${t%60}s`:`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`};function z(e){return e.scope===`page`?{tone:`neutral`,label:`Report`}:e.counts.total?e.counts.failed?{tone:`fail`,label:`${e.counts.failed} failed`}:e.stopped||e.counts.other?{tone:`warn`,label:e.stopped?`Stopped`:`${e.counts.other} not run`}:{tone:`pass`,label:`Passed`}:{tone:`neutral`,label:`No results`}}var B=50;function V({r:e}){let t=z(e),n=e.scope===`page`?m:t.tone===`pass`?_:t.tone===`fail`?a:o;return(0,F.jsx)(n,{size:16,"aria-label":t.label,className:T(`flex-none`,t.tone===`pass`?`text-pass`:t.tone===`fail`?`text-fail`:t.tone===`warn`?`text-warn`:`text-muted`)})}var H=e=>{let t=new Date(`${e}T12:00:00`);return Number.isNaN(t.getTime())?e:t.toLocaleDateString([],{day:`numeric`,month:`short`})},U=e=>{let t=e.reduce((e,t)=>e+t.cases,0);return t?Math.round(e.reduce((e,t)=>e+t.passed,0)/t*100):null};function W({title:e,note:t,children:n,className:r}){return(0,F.jsxs)(`section`,{className:T(`flex min-w-0 flex-col rounded-[14px] card border px-4 py-3.5`,r),children:[(0,F.jsx)(`h3`,{className:`m-0 text-[15px] font-semibold`,children:e}),t&&(0,F.jsx)(`p`,{className:`m-0 mt-0.5 text-[12.5px] text-muted`,children:t}),(0,F.jsx)(`div`,{className:`mt-3 flex min-w-0 flex-col`,children:n})]})}function G({part:e,whole:t,tone:n,label:r}){return(0,F.jsxs)(`span`,{className:`flex flex-none items-center gap-2`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-16 flex-none overflow-hidden rounded-full bg-surface-strong`,children:(0,F.jsx)(`span`,{className:T(`block h-full rounded-full transition-[width] duration-200 ease-out`,n===`pass`?`bg-pass`:n===`fail`?`bg-fail`:`bg-accent`),style:{width:`${t?Math.max(4,e/t*100):0}%`}})}),(0,F.jsx)(`span`,{className:`text-[12.5px] whitespace-nowrap text-ink-2 tabular-nums`,children:r})]})}function K({days:e}){let[t,n]=(0,P.useState)(null),r=e.slice(-30);if(!r.length)return(0,F.jsx)(`p`,{className:`m-0 py-6 text-sm text-muted`,children:`No runs with results yet.`});let i=Math.max(1,...r.map(e=>e.cases)),a=i<=4?1:Math.ceil(i/4/5)*5||1,o=Math.ceil(i/a)*a,s=[o,Math.round(o/2),0],c=Math.ceil(r.length/8),l=t===null?null:r[t];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsxs)(`div`,{"aria-hidden":`true`,className:`flex gap-4 text-[12.5px] text-ink-2`,children:[(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`size-2.5 rounded-[3px] bg-pass`}),` Passed`]}),(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`size-2.5 rounded-[3px] bg-fail`}),` Failed`]})]}),(0,F.jsxs)(`div`,{className:`relative grid grid-cols-[32px_minmax(0,1fr)] gap-x-2`,children:[(0,F.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-[180px] flex-col justify-between text-right text-[11px] text-muted tabular-nums`,children:s.map(e=>(0,F.jsx)(`span`,{className:`-translate-y-1/2 first:translate-y-0 last:translate-y-0`,children:e},e))}),(0,F.jsxs)(`div`,{className:`relative h-[180px]`,onMouseLeave:()=>n(null),children:[s.map((e,t)=>(0,F.jsx)(`span`,{"aria-hidden":`true`,className:T(`absolute inset-x-0 border-t`,t===s.length-1?`border-line`:`border-line-soft`),style:{top:`${(1-e/o)*100}%`}},e)),(0,F.jsx)(`div`,{className:`absolute inset-0 flex items-end gap-[3px]`,children:r.map((e,r)=>{let i=e.cases-e.passed;return(0,F.jsx)(`div`,{className:`flex h-full min-w-0 flex-1 cursor-default flex-col justify-end`,onMouseEnter:()=>n(r),children:(0,F.jsxs)(`div`,{className:T(`flex w-full flex-col justify-end gap-[2px] transition-opacity`,t!==null&&t!==r&&`opacity-50`),style:{height:`${e.cases/o*100}%`},children:[i>0&&(0,F.jsx)(`span`,{className:`min-h-[2px] w-full rounded-t-[4px] bg-fail`,style:{flexGrow:i}}),e.passed>0&&(0,F.jsx)(`span`,{className:T(`min-h-[2px] w-full bg-pass`,!i&&`rounded-t-[4px]`),style:{flexGrow:e.passed}})]})},e.day)})}),l&&(0,F.jsxs)(`div`,{role:`status`,className:`pointer-events-none absolute z-[2] w-max max-w-[220px] -translate-x-1/2 -translate-y-[calc(100%+8px)] rounded-[10px] border border-line-soft bg-bg px-3 py-2 text-[12.5px] shadow-composer`,style:{left:`${Math.min(88,Math.max(12,(t+.5)/r.length*100))}%`,top:`${(1-l.cases/o)*100}%`},children:[(0,F.jsx)(`b`,{className:`block text-ink`,children:H(l.day)}),(0,F.jsxs)(`span`,{className:`block text-ink-2 tabular-nums`,children:[l.passed,` passed, `,l.cases-l.passed,` failed · `,U([l]),`%`]}),(0,F.jsx)(`span`,{className:`block text-muted`,children:b(l.runs,`run`)})]})]}),(0,F.jsx)(`span`,{}),(0,F.jsx)(`div`,{"aria-hidden":`true`,className:`mt-1 flex gap-[3px] text-[11px] text-muted`,children:r.map((e,t)=>(0,F.jsx)(`span`,{className:`min-w-0 flex-1 text-center whitespace-nowrap`,children:t%c===0&&(0,F.jsx)(`span`,{className:T(t/c%2==1&&`hidden @2xl:inline`),children:H(e.day)})},e.day))})]}),(0,F.jsxs)(`table`,{className:`sr-only`,children:[(0,F.jsx)(`caption`,{children:`Cases by day`}),(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`th`,{children:`Day`}),(0,F.jsx)(`th`,{children:`Runs`}),(0,F.jsx)(`th`,{children:`Passed`}),(0,F.jsx)(`th`,{children:`Failed`})]})}),(0,F.jsx)(`tbody`,{children:r.map(e=>(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{children:e.day}),(0,F.jsx)(`td`,{children:e.runs}),(0,F.jsx)(`td`,{children:e.passed}),(0,F.jsx)(`td`,{children:e.cases-e.passed})]},e.day))})]})]})}function q({project:t,build:o,onBuilt:d}){let[p,m]=(0,P.useState)(o),[g,_]=(0,P.useState)(``),v=!!p?.running;(0,P.useEffect)(()=>{if(!v)return;let e=setInterval(async()=>{try{let e=await r.buildStatus();m(e),e&&!e.running&&d()}catch{}},1200);return()=>clearInterval(e)},[v,d]);let y=t.cases?Math.round(t.passed/t.cases*100):null,x=U(t.days.slice(-7)),E=U(t.days.slice(-14,-7)),O=x!==null&&E!==null?x-E:null,k=[{label:`Runs`,value:String(t.runs),sub:t.runs?`${H(String(t.from).slice(0,10))} – ${H(String(t.to).slice(0,10))}`:void 0},{label:`Cases run`,value:String(t.cases),sub:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{className:`text-pass`,children:[t.passed,` passed`]}),` · `,(0,F.jsxs)(`span`,{className:T(t.failed&&`text-fail`),children:[t.failed,` failed`]})]})},{label:`Tokens`,value:i(t.tokens),sub:t.cost?n(t.cost.amount,t.cost.currency):void 0}];return(0,F.jsxs)(`section`,{"aria-labelledby":`project-h`,className:`flex min-w-0 flex-col gap-4`,children:[(0,F.jsx)(`h2`,{id:`project-h`,className:`sr-only`,children:`Project report`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`min-w-0 flex-[1_1_240px] text-[13px] text-muted`,children:t.page?`The HTML report was built ${L(t.page.builtAt)}.`:`Every run, taken together. The HTML report has not been built yet.`}),t.page&&(0,F.jsxs)(u,{size:`sm`,onClick:async()=>_(await c(t.page.file)),children:[(0,F.jsx)(w,{"aria-hidden":`true`}),`Open HTML report`]}),(0,F.jsx)(u,{size:`sm`,variant:`outline`,disabled:v,onClick:async()=>{_(``);try{m(await r.build())}catch(e){_(e.message)}},children:v?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(s,{state:`working`,px:14}),`Building…`]}):t.page?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(D,{"aria-hidden":`true`}),`Rebuild`]}):`Build HTML report`})]}),g&&(0,F.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:g}),p&&(p.running||p.ok===!1)&&(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[!p.running&&(0,F.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:`forgeqe bi build stopped with a problem; its output is below.`}),(0,F.jsx)(`pre`,{"aria-label":`forgeqe bi build output`,"aria-live":`polite`,className:`m-0 max-h-[200px] overflow-auto rounded-[12px] bg-surface-muted px-4 py-3 font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:p.lines.length?p.lines.join(`
|
|
2
|
+
`):`Starting…`})]}),t.runs?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(C,{label:`Project numbers`,children:[(0,F.jsx)(f,{label:`Pass rate`,big:!0,value:y===null?`–`:`${y}%`,tone:y!==null&&y<80?`text-fail`:void 0,change:O===null?void 0:{text:O===0?`Same`:`${O>0?`+`:`−`}${Math.abs(O)} ${Math.abs(O)===1?`point`:`points`}`,dir:O>0?`up`:O<0?`down`:`same`,good:O>0,against:O===0?`as the week before`:`on the week before`}}),k.map(e=>(0,F.jsx)(f,{label:e.label,value:e.value,note:e.sub},e.label))]}),(0,F.jsx)(W,{title:`Cases by day`,note:`The last ${b(Math.min(30,t.days.length),`day`)} with runs. Hover a day for its pass rate.`,children:(0,F.jsx)(K,{days:t.days})}),(0,F.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,F.jsx)(W,{title:`Fails most`,note:`Cases that failed in the most runs.`,children:t.failing.length===0?(0,F.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`No case has failed.`}):(0,F.jsx)(`ul`,{className:`m-0 list-none p-0`,children:t.failing.slice(0,8).map(e=>(0,F.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,F.jsx)(a,{size:14,"aria-hidden":`true`,className:`flex-none text-fail`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-[14px]`,"data-tip":e.title,children:[e.id&&(0,F.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink-2`,children:e.id}),` `,e.title]}),(0,F.jsx)(`span`,{className:`flex-none text-[12px] text-muted`,children:j(e.lastFailed)})]}),(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3 pl-[22px]`,children:[(0,F.jsx)(G,{part:e.failed,whole:e.runs,tone:`fail`,label:`failed ${e.failed} of ${e.runs}`}),e.summary&&(0,F.jsx)(`span`,{className:`min-w-0 truncate text-[12.5px] text-muted`,children:e.summary.replace(/[*_`#>[\]]/g,``)})]})]},e.id||e.title))})}),(0,F.jsx)(W,{title:`Defects`,note:`Failures grouped by their cause.`,children:t.defects.length===0?(0,F.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`None found.`}):(0,F.jsx)(`ul`,{className:`m-0 list-none p-0`,children:t.defects.slice(0,8).map(e=>(0,F.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate text-[14px]`,"data-tip":e.title,children:e.title}),(0,F.jsxs)(`span`,{className:`text-[12.5px] whitespace-nowrap text-muted tabular-nums`,children:[b(e.cases,`case`),` · `,b(e.runs,`run`),e.lastSeen?` · ${j(e.lastSeen)}`:``]})]},e.title))})}),(0,F.jsx)(W,{title:`Flaky`,note:`Cases that both passed and failed.`,children:t.flaky.length===0?(0,F.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`None.`}):(0,F.jsx)(`ul`,{className:`m-0 list-none p-0`,children:t.flaky.slice(0,8).map(e=>(0,F.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,F.jsxs)(`span`,{className:`min-w-0 truncate text-[14px]`,"data-tip":e.title,children:[e.id&&(0,F.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink-2`,children:e.id}),` `,e.title]}),(0,F.jsx)(G,{part:e.failed,whole:e.runs,tone:`fail`,label:`${e.failed}/${e.runs} failed`})]},e.id||e.title))})}),(0,F.jsx)(W,{title:`By kind`,note:`Each kind of run and how often its cases passed.`,children:t.kinds.length===0?(0,F.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`No runs with results yet.`}):(0,F.jsx)(`ul`,{className:`m-0 list-none p-0`,children:t.kinds.map(e=>(0,F.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-x-4 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate text-[14px]`,children:I[e.scope]||e.scope}),(0,F.jsx)(`span`,{className:`text-[12.5px] text-muted tabular-nums`,children:b(e.runs,`run`)}),(0,F.jsx)(G,{part:e.passed,whole:e.cases,tone:`pass`,label:e.cases?`${Math.round(e.passed/e.cases*100)}% passed`:`no cases`})]},e.scope))})})]})]}):(0,F.jsx)(h,{icon:S,title:`No runs yet`,action:(0,F.jsx)(`a`,{className:l({size:`sm`}),href:e(),children:`Start a chat`}),children:`Runs, suites and monitor rounds are taken together here once there are some: pass rate by day, the cases that fail most, flaky cases and defects.`})]})}function J({sub:e}){let[n,i]=(0,P.useState)(null),[a,o]=(0,P.useState)(``),[s,l]=(0,P.useState)(``),[f,m]=(0,P.useState)(``),[h,g]=(0,P.useState)(`all`),[_,v]=(0,P.useState)(B),[b,x]=(0,P.useState)(``),S=(0,P.useCallback)(()=>{r.list().then(i,e=>o(e.message))},[]);(0,P.useEffect)(S,[S]);let C=e===`project`?`project`:`execution`,D=n?.rows??null,H=f.toLowerCase().split(/\s+/).filter(Boolean),U=(0,P.useMemo)(()=>(D||[]).filter(e=>(!s||e.scope===s)&&H.every(t=>`${e.title} ${e.id} ${I[e.scope]}`.toLowerCase().includes(t))),[D,s,f]),W=U.filter(e=>z(e).tone===`fail`).length,G=h===`failed`?U.filter(e=>z(e).tone===`fail`):U;(0,P.useEffect)(()=>v(B),[s,f,h]);let K=[...new Set((D||[]).map(e=>e.scope))];return(0,F.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,F.jsx)(y,{}),(0,F.jsxs)(`main`,{className:T(A,`@container flex-auto gap-4`),children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-6 gap-y-2`,children:[(0,F.jsx)(t,{pixel:p.reports,size:`lg`}),(0,F.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Reports`}),(0,F.jsx)(M,{label:`Runs and reports`,links:N,current:C===`project`?`reports-project`:`reports`})]}),a&&(0,F.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:a}),!n&&!a&&(0,F.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),n&&C===`project`&&(0,F.jsx)(q,{project:n.project,build:n.build,onBuilt:S}),n&&C===`execution`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Every report ForgeQE generated, newest first. Open one to see it in full in a new tab.`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(d,{id:`report-search`,label:`Find a report`,value:f,onChange:m}),[[`all`,`All`,U.length],[`failed`,`Failed`,W]].map(([e,t,n])=>(0,F.jsxs)(`button`,{type:`button`,"aria-pressed":h===e,onClick:()=>g(e),className:T(`inline-flex min-h-8 cursor-pointer items-center gap-1 rounded-[8px] border px-3 text-[13px] font-medium`,h===e?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:bg-line hover:text-ink`),children:[t,(0,F.jsx)(`span`,{className:T(`tabular-nums`,e===`failed`&&n?`text-fail`:``),children:n})]},e)),K.length>1&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`label`,{htmlFor:`report-kind`,className:`sr-only`,children:`Kind`}),(0,F.jsxs)(E,{size:`sm`,id:`report-kind`,value:s,onChange:e=>l(e.target.value),className:`w-auto pr-7 pl-3`,children:[(0,F.jsx)(`option`,{value:``,children:`Every kind`}),K.map(e=>(0,F.jsx)(`option`,{value:e,children:I[e]},e))]})]})]}),b&&(0,F.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:b}),(0,F.jsxs)(`div`,{className:`rounded-[14px] card border`,children:[(0,F.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[minmax(0,1fr)_110px_150px_100px_128px] items-center gap-x-4 border-b border-line-soft px-4 py-2 text-[12px] font-semibold text-muted @3xl:grid`,children:[(0,F.jsx)(`span`,{children:`Report`}),(0,F.jsx)(`span`,{children:`Kind`}),(0,F.jsx)(`span`,{children:`Result`}),(0,F.jsx)(`span`,{className:`text-right`,children:`When`}),(0,F.jsx)(`span`,{})]}),(0,F.jsxs)(`ul`,{"aria-label":`Execution reports`,className:`m-0 list-none p-1.5`,children:[G.length===0&&(0,F.jsx)(`li`,{className:`px-3 py-4 text-sm text-muted`,children:n.rows.length?`Nothing matches.`:`No reports yet. Runs, suites and monitor rounds show here once they have run.`}),G.slice(0,_).map((e,t,n)=>{let r=k(e.startedAt),i=z(e);return(0,F.jsxs)(`li`,{className:`contents`,children:[(t===0||k(n[t-1].startedAt)!==r)&&(0,F.jsx)(`span`,{className:`block px-3 pt-3 pb-1 text-[12px] font-semibold text-muted`,children:r}),(0,F.jsxs)(`div`,{className:`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 rounded-[10px] px-3 py-1.5 hover:bg-surface-muted @3xl:grid-cols-[auto_minmax(0,1fr)_110px_150px_100px_128px] @3xl:gap-x-4`,children:[(0,F.jsx)(V,{r:e}),(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,F.jsx)(`span`,{className:`truncate text-[14px] font-medium`,"data-tip":e.title,children:e.title}),(0,F.jsx)(`span`,{className:`truncate text-[12px] text-muted @3xl:hidden`,children:[I[e.scope],e.scope===`page`||!e.counts.total?``:`${e.counts.passed}/${e.counts.total} passed`,j(e.startedAt)].filter(Boolean).join(` · `)})]}),(0,F.jsx)(`span`,{className:`hidden truncate text-[13px] text-muted @3xl:block`,children:I[e.scope]}),(0,F.jsxs)(`span`,{className:`hidden truncate text-[13px] text-muted tabular-nums @3xl:block`,children:[(0,F.jsx)(`span`,{className:T(i.tone===`fail`&&`text-fail`),children:e.scope===`page`?`Report`:e.counts.total?`${e.counts.passed}/${e.counts.total} passed`:i.label}),R(e.ms)?` · ${R(e.ms)}`:``]}),(0,F.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,"data-tip":L(e.startedAt),children:j(e.startedAt)}),(0,F.jsx)(`span`,{className:`flex min-w-0 justify-end`,children:e.report?(0,F.jsxs)(u,{size:`sm`,"aria-label":`Open the report of ${e.title} in a new tab`,onClick:async()=>x(await c(e.report)),children:[(0,F.jsx)(w,{"aria-hidden":`true`}),(0,F.jsx)(`span`,{className:`hidden @md:inline`,children:`Open report`})]}):(0,F.jsx)(O,{path:e.folder,children:`Folder`})})]})]},e.key)})]}),(G.length>_||n.total>n.rows.length)&&(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t border-line-soft px-4 py-2.5 text-[13px] text-muted`,children:[(0,F.jsxs)(`span`,{children:[`Showing `,Math.min(_,G.length),` of `,G.length,n.total>n.rows.length?` (the newest ${n.rows.length} of ${n.total})`:``]}),G.length>_&&(0,F.jsxs)(u,{size:`sm`,onClick:()=>v(_+B),children:[`Show `,Math.min(B,G.length-_),` more`]})]})]})]})]})]})}export{J as Reports};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$t as e,Ai as t,An as n,Cn as r,Dt as i,Er as a,Fi as o,Ht as s,It as c,Ji as l,Mi as u,Mr as d,Mt as f,Ni as p,Nt as m,Qr as h,Tn as g,Wi as _,Yn as v,Zn as ee,Zr as te,Zt as y,
|
|
2
|
-
`).flatMap((e,t)=>{if(/^(diff |index |--- |\+\+\+ )/.test(e))return[];let i=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(e);return i?(n=Number(i[1]),r=Number(i[2]),[{key:t,kind:`hunk`,text:e,a:``,b:``}]):e.startsWith(`+`)?[{key:t,kind:`add`,text:e.slice(1),a:``,b:String(r++)}]:e.startsWith(`-`)?[{key:t,kind:`del`,text:e.slice(1),a:String(n++),b:``}]:e.startsWith(`\\`)?[{key:t,kind:`hunk`,text:e,a:``,b:``}]:[{key:t,kind:`same`,text:e.startsWith(` `)?e.slice(1):e,a:String(n++),b:String(r++)}]});return(0,I.jsx)(`div`,{className:w(`max-h-[420px] overflow-auto rounded-[10px] border border-line-soft bg-bg font-mono text-[12px] leading-[1.6]`,t),children:(0,I.jsx)(`table`,{className:`w-full border-collapse`,children:(0,I.jsx)(`tbody`,{children:i.map(e=>(0,I.jsxs)(`tr`,{className:e.kind===`add`?`bg-pass-soft`:e.kind===`del`?`bg-fail-soft`:e.kind===`hunk`?`bg-surface-muted`:void 0,children:[(0,I.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.a}),(0,I.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.b}),(0,I.jsx)(`td`,{"aria-hidden":`true`,className:w(`w-4 align-top select-none`,e.kind===`add`?`text-pass`:e.kind===`del`?`text-fail`:`text-muted`),children:e.kind===`add`?`+`:e.kind===`del`?`−`:``}),(0,I.jsxs)(`td`,{className:w(`pr-3 align-top whitespace-pre`,e.kind===`hunk`?`text-muted`:`text-ink`),children:[(0,I.jsx)(`span`,{className:`sr-only`,children:e.kind===`add`?`added: `:e.kind===`del`?`removed: `:``}),e.text||` `]})]},e.key))})})})}function R({review:e,className:t}){return(0,I.jsxs)(`div`,{className:w(`flex flex-col gap-2 text-[13px] leading-relaxed`,t),children:[e.summary&&(0,I.jsx)(`p`,{className:`m-0 text-ink-2 [overflow-wrap:anywhere]`,children:e.summary}),e.issues.length>0&&(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.issues.map((e,t)=>(0,I.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,I.jsx)(`span`,{className:w(`mt-px flex-none rounded-full px-2 py-px text-[11.5px] font-medium`,e.kind===`correctness`?`bg-fail-soft text-fail`:`bg-surface-strong text-ink-2`),children:e.kind===`correctness`?`Correctness`:`Standards`}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[e.file&&(0,I.jsx)(`span`,{className:`font-mono text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.file}),(0,I.jsx)(`span`,{className:`text-ink [overflow-wrap:anywhere]`,children:e.problem}),e.fix&&(0,I.jsxs)(`span`,{className:`text-muted [overflow-wrap:anywhere]`,children:[`Fix: `,e.fix]})]})]},t))})]})}var be={done:`border-pass/35`,active:`border-accent/35`,pending:`border-line-strong`,failed:`border-fail/35`,skipped:`border-line-strong`,note:`border-line-strong`};function z({status:e,orb:t,px:n=20,spin:i=!1}){let a={width:n,height:n};return e===`active`&&i?(0,I.jsx)(`span`,{role:`img`,"aria-label":`At work`,className:`flex flex-none items-center justify-center`,style:a,children:(0,I.jsx)(h,{size:n-2,strokeWidth:2.5,"aria-hidden":`true`,className:`animate-spin text-accent-fg motion-reduce:animate-none`})}):e===`active`?(0,I.jsx)(f,{state:t,px:n,label:`At work`}):e===`done`?(0,I.jsx)(`span`,{role:`img`,"aria-label":`Done`,className:`flex flex-none items-center justify-center rounded-full bg-pass`,style:a,children:(0,I.jsx)(r,{size:n*.6,strokeWidth:3,"aria-hidden":`true`,className:`text-bg`})}):e===`failed`?(0,I.jsx)(`span`,{role:`img`,"aria-label":`Failed`,className:`flex flex-none items-center justify-center rounded-full bg-fail`,style:a,children:(0,I.jsx)(pe,{size:n*.6,strokeWidth:3,"aria-hidden":`true`,className:`text-bg`})}):e===`note`?(0,I.jsx)(`span`,{role:`img`,"aria-label":`Note`,className:`flex flex-none items-center justify-center`,style:a,children:(0,I.jsx)(`span`,{className:`size-1.5 rounded-full bg-line-strong`})}):(0,I.jsx)(`span`,{role:`img`,"aria-label":e===`skipped`?`Skipped`:`To come`,className:w(`box-border block flex-none rounded-full border-2 border-line-strong`,e===`skipped`&&`border-dashed`),style:a})}var xe=(e,t)=>e.status===`running`?t?`active`:`done`:e.status===`ok`?`done`:e.status===`fail`?`failed`:`note`,Se={read:le,search:t,list:ve,edit:se,run:l,element:ee,outline:te,references:de,impact:ie,find:me,testfile:T,web:d,environment:p,cases:ye,browser:d,post:u,test:T,retry:_e,review:o,task:a,work:oe},Ce={done:`text-pass`,failed:`text-fail`,active:`text-accent-fg animate-pulse motion-reduce:animate-none`,pending:`text-muted`,skipped:`text-muted`,note:`text-muted`},B={done:`Done`,failed:`Failed`,active:`At work`,pending:`To come`,skipped:`Skipped`,note:`Note`};function we({kind:e,status:t}){let n=w(`mt-px flex size-4 flex-none items-center justify-center`,Ce[t]);if(e===`skill`)return(0,I.jsxs)(`span`,{role:`img`,"aria-label":B[t],className:w(n,`relative`),children:[(0,I.jsx)(x,{name:ce.skills,px:15}),(t===`done`||t===`failed`)&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:w(`absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full ring-1 ring-bg`,t===`done`?`bg-pass`:`bg-fail`)})]});let r=Se[e];return(0,I.jsx)(`span`,{role:`img`,"aria-label":B[t],className:n,children:(0,I.jsx)(r,{size:15,strokeWidth:2,"aria-hidden":`true`})})}function Te({status:e}){return e===`active`?(0,I.jsx)(h,{size:12,strokeWidth:2.5,"aria-label":`At work`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}):(0,I.jsx)(`span`,{role:`img`,"aria-label":B[e],className:w(`mt-[7px] size-2 flex-none rounded-full`,e===`done`?`bg-pass`:e===`failed`?`bg-fail`:`bg-line-strong`)})}function V({text:e,label:t}){let[n,i]=(0,F.useState)(!1);return(0,I.jsx)(`button`,{type:`button`,"aria-label":n?`Copied`:t,"data-tip":n?`Copied`:t,onClick:async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}},className:`flex size-6 flex-none cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted opacity-0 group-hover:opacity-100 hover:bg-surface-strong hover:text-ink focus-visible:opacity-100`,children:n?(0,I.jsx)(r,{size:13,"aria-hidden":`true`,className:`text-pass`}):(0,I.jsx)(v,{size:13,"aria-hidden":`true`})})}function Ee({step:e,failed:t}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1 py-0.5 font-mono text-[12px] leading-relaxed`,children:[e.command&&(0,I.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2 text-muted`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none select-none`,children:`$`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.command}),(0,I.jsx)(V,{text:e.command,label:`Copy the command`})]}),e.output&&(0,I.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none text-muted select-none`,children:`⎿`}),(0,I.jsx)(`pre`,{className:w(`m-0 max-h-56 min-w-0 flex-1 overflow-auto font-mono text-[12px] leading-relaxed whitespace-pre-wrap [overflow-wrap:anywhere]`,t?`text-fail`:`text-ink-2`),children:e.output}),(0,I.jsx)(V,{text:e.output,label:`Copy the output`})]})]})}var De=e=>/[/\\]|\.\w{1,5}$|^\$ /.test(e)&&!/\s{2,}/.test(e);function H({text:e}){return(0,I.jsx)(`span`,{className:w(`min-w-0 max-w-full truncate rounded-md bg-surface-strong px-1.5 py-0.5 text-[12.5px] text-ink-2`,De(e)&&`font-mono text-[12px]`),children:e})}function Oe({step:e}){return(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] leading-relaxed`,children:e.lines.map((e,t)=>(0,I.jsxs)(`li`,{className:w(`flex gap-1.5 [overflow-wrap:anywhere]`,e.ok===!0?`text-pass`:e.ok===!1?`text-fail`:`text-ink-2`),children:[e.ok!==void 0&&(0,I.jsx)(`span`,{"aria-hidden":`true`,children:e.ok?`✓`:`✗`}),(0,I.jsx)(D,{text:e.text,className:`min-w-0 text-[13px] leading-relaxed text-inherit [&_p]:my-0`})]},t))})}function U({agent:e,named:t=!0,working:n=!1}){let r=s(e);return(0,I.jsxs)(`span`,{className:`inline-flex flex-none items-center gap-1.5`,"data-tip":r.name,children:[(0,I.jsx)(m,{agent:e,px:18,decorative:t,working:n}),t&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`font-medium`,style:{color:r.hue},children:r.name}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`·`})]})]})}function W({step:e,from:t,live:n}){let r=e.handoff.agent,i=s(r);return(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5`,children:[(0,I.jsx)(m,{agent:t,px:18}),(0,I.jsxs)(`span`,{role:`img`,"aria-label":`hands off to`,className:w(`handoff-flow flex-none`,n&&`is-live`),style:{color:i.hue},children:[(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{})]}),(0,I.jsx)(m,{agent:r,px:20,decorative:!0,working:n,className:`handoff-in`}),(0,I.jsx)(`span`,{className:`font-medium`,style:{color:i.hue},children:i.name}),e.arg&&(0,I.jsx)(H,{text:e.arg})]})}function G({step:e,working:t,from:n=c}){let r=e.agent||n,a=K(e),o=xe(e,t),[s,l]=(0,F.useState)(null),u=s??((!!e.handoff||!!e.agent||e.key.startsWith(`try:`))&&o===`active`),d=(0,I.jsxs)(I.Fragment,{children:[e.handoff?(0,I.jsx)(z,{status:o,orb:e.orb,px:14,spin:!0}):!(e.icon&&r===n)&&(0,I.jsx)(Te,{status:o}),e.handoff?(0,I.jsx)(W,{step:e,from:n,live:o===`active`}):(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5`,children:[r!==n||!e.icon?(0,I.jsx)(U,{agent:r,named:r!==n,working:o===`active`}):(0,I.jsx)(we,{kind:e.icon,status:o}),(0,I.jsx)(`span`,{className:w(`[overflow-wrap:anywhere]`,o===`active`?`text-ink`:`text-ink-2`),children:e.label}),e.arg&&(0,I.jsx)(H,{text:e.arg}),e.change&&(0,I.jsxs)(`span`,{className:`font-mono text-[12px] tabular-nums`,children:[(0,I.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.change.added]}),` `,(0,I.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.change.removed]})]})]}),a&&(0,I.jsx)(g,{size:14,"aria-hidden":`true`,className:w(`mt-0.5 ml-auto flex-none text-muted transition-transform`,u&&`rotate-180`)})]});return(0,I.jsxs)(`li`,{className:`flex flex-col`,children:[a?(0,I.jsx)(`button`,{type:`button`,"aria-expanded":u,onClick:()=>l(!u),className:`flex min-h-8 w-full cursor-pointer items-start gap-2 rounded-lg border-0 bg-transparent px-1.5 py-1.5 text-left text-[13.5px] hover:bg-surface-muted`,children:d}):(0,I.jsx)(`div`,{className:`flex min-h-8 items-start gap-2 px-1.5 py-1.5 text-[13.5px]`,children:d}),a&&(0,I.jsx)(i,{open:u,children:(0,I.jsx)(q,{step:e,working:t,from:n,className:`mb-1 ml-[13px]`})})]})}var K=e=>e.lines.length>0||(e.children?.length??0)>0||!!e.handoff?.result||!!e.change||!!e.output||!!e.command||!!e.review;function q({step:e,working:t,from:n,className:r}){let i=e.children||[],a=e.handoff?.agent||e.agent;return(0,I.jsxs)(`div`,{className:w(`flex flex-col gap-1.5 border-l border-dotted py-1 pl-3`,r),style:{borderColor:a?`${s(a).hue}59`:`var(--color-line-strong)`},children:[(e.output||e.command)&&(0,I.jsx)(Ee,{step:e,failed:e.status===`fail`}),e.review&&(0,I.jsx)(R,{review:e.review}),e.lines.length>0&&(0,I.jsx)(Oe,{step:e}),e.change&&(0,I.jsx)(L,{diff:e.change.diff}),i.length>0&&(0,I.jsx)(`ul`,{"aria-label":a?`What ${C(s(a).name)} did`:`Steps`,className:`m-0 flex list-none flex-col p-0`,children:i.map(e=>(0,I.jsx)(G,{step:e,working:t,from:a||n},e.key))}),e.handoff?.result&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-0.5 text-[13px]`,children:[(0,I.jsxs)(`span`,{className:`text-muted`,children:[C(s(e.handoff.agent).name,!0),` answered`]}),(0,I.jsx)(D,{text:e.handoff.result.length>1200?`${e.handoff.result.slice(0,1199)}…`:e.handoff.result,className:`text-[13px] text-ink-2 [&_p]:my-0`})]})]})}function ke({node:e,last:t,working:n,now:r,orbed:a}){let o=e.step?[]:e.steps,s=e.step,c=o.length>0||!!r||!!s&&K(s),[l,u]=(0,F.useState)(null),d=l??(e.status===`active`||e.status===`failed`),f=s?.orb??[...o].reverse().find(e=>e.status===`running`)?.orb??r?.orb??`thinking`;return(0,I.jsxs)(`li`,{className:`flex gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-none flex-col items-center`,children:[(0,I.jsx)(`span`,{className:`mt-[3px]`,children:(0,I.jsx)(z,{status:e.status,orb:f,spin:!a})}),!t&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:w(`mt-1.5 min-h-4 w-0 flex-1 border-l border-dotted`,be[e.status])})]}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col pb-2`,children:[c?(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":d,onClick:()=>u(!d),className:`flex min-h-7 w-full cursor-pointer items-start gap-1.5 border-0 bg-transparent p-0 text-left`,children:[(0,I.jsx)(J,{node:e}),(0,I.jsx)(g,{size:14,"aria-hidden":`true`,className:w(`mt-1 flex-none text-muted transition-transform`,d&&`rotate-180`)}),e.status===`active`&&(0,I.jsx)(`span`,{className:`mt-0.5 ml-1 flex-none rounded-full border border-accent-line bg-accent-soft px-2 py-px text-[11.5px] font-medium text-accent-fg`,children:`In progress`})]}):(0,I.jsx)(`div`,{className:`min-h-7`,children:(0,I.jsx)(J,{node:e})}),c&&(0,I.jsx)(i,{open:d,className:`mt-0.5`,children:s?(0,I.jsx)(q,{step:s,working:n,from:`forgeqe`,className:`mt-1`}):(0,I.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[o.map(e=>(0,I.jsx)(G,{step:e,working:n},e.key)),r&&(0,I.jsx)(`li`,{children:(0,I.jsx)(Y,{live:r,className:`px-1.5`})})]})})]})]})}function J({node:e}){let t=e.status===`active`?`text-ink`:e.status===`pending`||e.status===`skipped`?`text-muted`:e.status===`failed`?`text-fail`:`text-ink-2`,n=e.step;return n?.handoff?(0,I.jsx)(W,{step:n,from:c,live:e.status===`active`}):(0,I.jsxs)(`span`,{className:w(`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 text-sm font-medium`,t,e.status===`skipped`&&`line-through`),children:[n&&(0,I.jsx)(U,{agent:n.agent||`forgeqe`,named:!!n.agent&&n.agent!==`forgeqe`,working:e.status===`active`}),e.status===`active`?(0,I.jsx)(`span`,{className:`shimmer [overflow-wrap:anywhere]`,children:(0,I.jsx)(`span`,{children:e.label})}):(0,I.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.label}),n?.arg&&(0,I.jsx)(H,{text:n.arg})]})}var Ae={info:`text-ink-2`,ok:`text-pass`,fail:`text-fail`,warn:`text-warn`,dim:`text-muted`,say:`text-ink-2`,you:`text-accent-fg`,think:`text-muted italic`};function je(e){let[t,n]=(0,F.useState)(()=>Date.now());(0,F.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]);let r=e?Date.parse(e):NaN;if(Number.isNaN(r))return``;let i=Math.max(0,Math.round((t-r)/1e3));return i<2?`just now`:i<60?`${i}s ago`:`${Math.floor(i/60)} min ago`}function Y({live:e,orb:t=!1,className:n}){let r=je(e.latest?.at);return(0,I.jsxs)(`div`,{className:w(`flex min-h-8 items-start gap-2 py-1`,n),children:[(0,I.jsx)(`span`,{className:`mt-0.5 flex size-4 flex-none items-center justify-center`,children:t?(0,I.jsx)(f,{state:e.orb,px:20,label:`At work`}):(0,I.jsxs)(`span`,{"aria-hidden":`true`,className:`relative flex size-2`,children:[(0,I.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-accent opacity-60 motion-reduce:animate-none`}),(0,I.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-accent`})]})}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,I.jsx)(`span`,{className:`shimmer text-[13.5px] font-medium text-muted`,children:(0,I.jsx)(`span`,{"aria-live":`polite`,children:e.text})}),e.latest&&(0,I.jsxs)(`button`,{type:`button`,onClick:e.onLog,"data-tip":`Open the activity log`,className:`flex w-full min-w-0 cursor-pointer items-baseline gap-2 border-0 bg-transparent p-0 text-left hover:underline`,children:[(0,I.jsx)(`span`,{className:w(`min-w-0 truncate font-mono text-[12px]`,Ae[e.latest.tone]),children:e.latest.plain}),(0,I.jsxs)(`span`,{className:`flex-none text-[11.5px] whitespace-nowrap text-muted tabular-nums`,children:[r,r&&` · `,e.events,` `,e.events===1?`event`:`events`]})]})]})]})}function Me({turn:e,working:t,live:n,folded:r=!1}){if(r)return(0,I.jsx)(Y,{live:n,orb:!0});let i=M(e,t),a=e.plan.length>0&&t?i.find(e=>e.status===`active`)??null:null,o=t&&!a?[{key:`now`,label:n.text,status:`active`,steps:[]}]:[],s=[...i,...o],c=[...i].reverse().find(e=>e.status===`active`);return(0,I.jsx)(`ol`,{"aria-label":`What ForgeQE did`,className:`m-0 flex list-none flex-col p-0 pt-1`,children:s.map((e,r)=>e.key===`now`?(0,I.jsx)(`li`,{className:`flex gap-3`,children:(0,I.jsx)(Y,{live:n,orb:!c,className:`-mt-1 min-w-0 flex-1 py-0`})},`now`):(0,I.jsx)(ke,{node:e,last:r===s.length-1,working:t,now:a===e?n:void 0,orbed:c===e},e.key))})}var Ne={passed:`Passed`,failed:`Failed`,stopped:`Stopped`,blocked:`Blocked`};function X({label:e,children:t}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`dt`,{className:`pt-0.5 text-[13px] text-muted`,children:e}),(0,I.jsx)(`dd`,{className:`m-0 min-w-0 text-[13px] [overflow-wrap:anywhere]`,children:t})]})}function Z({text:t}){let[n,i]=(0,F.useState)(!1);return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 rounded-[10px] bg-surface-muted px-3 py-2`,children:[(0,I.jsx)(e,{icon:_,size:14,className:`mt-0.5 flex-none text-muted`}),(0,I.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[12.5px] break-all whitespace-pre-wrap text-ink`,children:t}),(0,I.jsx)(`button`,{type:`button`,"aria-label":n?`Copied`:`Copy the command`,onClick:async()=>{await O(t)&&(i(!0),setTimeout(()=>i(!1),1500))},className:`inline-flex size-7 flex-none cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-surface-strong hover:text-ink`,children:n?(0,I.jsx)(r,{size:14,"aria-hidden":`true`,className:`text-pass`}):(0,I.jsx)(v,{size:14,"aria-hidden":`true`})})]})}function Pe(e){if(e.runs===void 0)return e.attempts===void 0?``:S(e.attempts,`attempt`);let t=`${S(e.runs,`test run`)}${e.failedRuns?` (${e.failedRuns} failed)`:``}`;return e.reviews?`${t} · ${S(e.reviews,`review`)}`:t}function Fe({name:e}){let t=e.lastIndexOf(`.`),n=t>0?e.slice(t+1):e,r=t>0?e.slice(0,t):``;return(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col`,"data-tip":e,children:[(0,I.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink [overflow-wrap:anywhere]`,children:n}),r&&(0,I.jsx)(`span`,{className:`font-mono text-[11.5px] text-muted [overflow-wrap:anywhere]`,children:r})]})}function Ie({t:e}){let t=Pe(e);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,I.jsx)(T,{size:17,strokeWidth:2,"aria-hidden":`true`,className:e.ok?`text-pass`:e.status===`stopped`?`text-muted`:`text-fail`}),(0,I.jsx)(`span`,{className:`text-[15px] font-semibold`,children:e.ok?`Test written`:`Test not finished`}),(0,I.jsx)(fe,{tone:e.ok?`pass`:e.status===`stopped`?`neutral`:`fail`,children:Ne[e.status]||e.status||`Not written`}),t&&(0,I.jsx)(`span`,{className:`text-[13px] text-muted`,children:t})]}),(0,I.jsxs)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-5 gap-y-1 sm:grid-cols-[96px_minmax(0,1fr)] sm:gap-y-3`,children:[(e.testFile||e.testName)&&(0,I.jsx)(X,{label:`Test`,children:(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[e.testFile&&(0,I.jsx)(E,{path:e.testFile}),e.testName&&(0,I.jsx)(Fe,{name:e.testName})]})}),e.command&&(0,I.jsx)(X,{label:`Run it`,children:(0,I.jsx)(Z,{text:e.command})}),e.review&&(0,I.jsx)(X,{label:e.review.approved?`Review`:`Review asked`,children:(0,I.jsx)(R,{review:e.review})}),e.runDir&&(0,I.jsx)(X,{label:`From the run`,children:(0,I.jsx)(E,{path:e.runDir})}),e.reused.length>0&&(0,I.jsx)(X,{label:`Reused`,children:(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.reused.map(e=>(0,I.jsx)(`li`,{className:`min-w-0`,children:(0,I.jsx)(E,{path:e})},e))})})]}),e.error&&(0,I.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:e.error})]})}function Le({c:e}){let[t,n]=(0,F.useState)(!1);return(0,I.jsxs)(`li`,{className:`flex flex-col`,children:[(0,I.jsxs)(`div`,{className:`flex min-h-9 items-center gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} the changes to ${e.path}`,onClick:()=>n(!t),className:`inline-flex size-7 flex-none cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-surface-strong hover:text-ink`,children:(0,I.jsx)(g,{size:15,"aria-hidden":`true`,className:w(`transition-transform`,!t&&`-rotate-90`)})}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,I.jsx)(E,{path:e.path})}),(0,I.jsxs)(`span`,{className:`flex-none font-mono text-[12px] tabular-nums`,children:[(0,I.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,I.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,I.jsx)(i,{open:t,children:(0,I.jsx)(L,{diff:e.diff,className:`mb-2 ml-9`})})]})}function Re({turn:e}){let t=e.reports.filter((e,t,n)=>n.findIndex(t=>t.path===e.path)===t),n=new Set(e.changes.map(e=>e.path)),r=[...new Set(e.tests.flatMap(e=>e.changed))].filter(e=>!n.has(e)&&![...n].some(t=>t.endsWith(e)||e.endsWith(t)));return!e.tests.length&&!t.length&&!e.changes.length&&!r.length?null:(0,I.jsxs)(`section`,{"aria-label":`Result`,className:`flex flex-col gap-4 border-t border-line-soft pt-4`,children:[e.tests.map((e,t)=>(0,I.jsx)(Ie,{t:e},t)),t.length>0&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:`Reports`}),(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-sm`,children:t.map(e=>(0,I.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,I.jsx)(`span`,{className:`text-ink-2`,children:e.label}),(0,I.jsx)(E,{path:e.path})]},e.path))})]}),(e.changes.length>0||r.length>0)&&(0,I.jsxs)(`div`,{className:w(`flex flex-col gap-1`,(e.tests.length>0||t.length>0)&&`border-t border-line-soft pt-3`),children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-medium`,children:[(0,I.jsx)(b,{size:15,"aria-hidden":`true`,className:`text-muted`}),`Files changed`,(0,I.jsxs)(`span`,{className:`font-normal text-muted`,children:[S(e.changes.length+r.length,`file`),e.changes.length>0&&(0,I.jsxs)(I.Fragment,{children:[` · `,(0,I.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.changes.reduce((e,t)=>e+t.added,0)]}),` `,(0,I.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.changes.reduce((e,t)=>e+t.removed,0)]})]})]})]}),(0,I.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[e.changes.map(e=>(0,I.jsx)(Le,{c:e},e.path)),r.map(e=>(0,I.jsx)(`li`,{className:`flex min-h-9 items-center gap-2 pl-9`,children:(0,I.jsx)(E,{path:e})},e))]})]})]})}var Q={info:`text-ink-2`,ok:`text-pass`,fail:`text-fail`,warn:`text-warn`,dim:`text-muted`,say:`text-ink`,you:`text-accent-fg`,think:`text-muted italic`};function ze({line:e,start:t}){let[n,r]=(0,F.useState)(!1),i=e.plain.length>160;return e.kind===`head`?(0,I.jsxs)(`li`,{className:`mt-3 flex items-baseline gap-3 border-b border-line-soft pb-1 first:mt-0`,children:[(0,I.jsx)(`span`,{className:`w-12 flex-none font-mono text-[11.5px] text-muted tabular-nums`,children:N(t,e.at)}),(0,I.jsx)(D,{text:e.md,className:`min-w-0 text-[13px] font-semibold text-ink [&_p]:my-0`})]}):(0,I.jsxs)(`li`,{className:w(`flex items-baseline gap-3 py-1`,e.kind===`sub`&&`pl-4`),children:[(0,I.jsx)(`span`,{className:`w-12 flex-none font-mono text-[11.5px] text-muted tabular-nums`,children:N(t,e.at)}),e.kind===`out`?(0,I.jsx)(`pre`,{className:`m-0 min-w-0 flex-1 font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:e.plain}):(0,I.jsx)(`button`,{type:`button`,disabled:!i,"aria-expanded":i?n:void 0,onClick:()=>r(!n),"data-tip":i&&!n?`Show all of it`:void 0,className:w(`min-w-0 flex-1 border-0 bg-transparent p-0 text-left`,i&&`cursor-pointer`),children:(0,I.jsx)(D,{text:e.md,className:w(`text-[13px] leading-relaxed [overflow-wrap:anywhere] [&_code]:text-[12px] [&_p]:my-0`,Q[e.tone],i&&!n&&`line-clamp-2`)})})]})}function $({lines:t,start:n,live:i,name:a,timeline:o=!1}){let s=(0,F.useRef)(null),c=(0,F.useRef)(!0),[l,u]=(0,F.useState)(!1),d=(0,F.useMemo)(()=>j(t,n),[t,n]);(0,F.useEffect)(()=>{c.current&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[d]);let f=`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-lg border-0 bg-transparent px-2 text-[12px] font-medium text-muted hover:bg-surface-strong hover:text-ink`;return(0,I.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,I.jsxs)(`div`,{className:`flex min-h-9 items-center gap-1 border-b border-line-soft text-[12px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`flex-1`,children:[o?``:`Markdown · `,t.length,` event`,t.length===1?``:`s`,i&&` · live`]}),(0,I.jsxs)(`button`,{type:`button`,"aria-label":l?`Copied`:`Copy the activity log as Markdown`,onClick:async()=>{try{await navigator.clipboard.writeText(d),u(!0),setTimeout(()=>u(!1),1500)}catch{}},className:f,children:[l?(0,I.jsx)(r,{size:14,"aria-hidden":`true`,className:`text-pass`}):(0,I.jsx)(v,{size:14,"aria-hidden":`true`}),l?`Copied`:`Copy`]}),(0,I.jsxs)(`button`,{type:`button`,"aria-label":`Download the activity log as a Markdown file`,onClick:()=>{let e=URL.createObjectURL(new Blob([d],{type:`text/markdown;charset=utf-8`})),t=document.createElement(`a`);t.href=e,t.download=a,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)},className:f,children:[(0,I.jsx)(e,{icon:ae,size:14}),`.md`]})]}),(0,I.jsx)(`div`,{ref:s,role:`log`,"aria-label":`Activity log`,onScroll:e=>{let t=e.currentTarget;c.current=t.scrollTop+t.clientHeight>=t.scrollHeight-24},className:w(`overflow-y-auto py-2`,o?`max-h-[calc(100vh-260px)] min-h-[320px]`:`max-h-[360px] border-b border-line-soft`),children:o?(0,I.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:t.map((e,t)=>(0,I.jsx)(ze,{line:e,start:n},t))}):(0,I.jsx)(D,{text:d,className:`text-[13px] leading-[1.6] [&_code]:text-[12px] [&_h4]:mt-3 [&_h4]:mb-1 [&_li]:my-0.5 [&_pre]:text-[12px] [&_ul]:my-1`})})]})}function Be({ask:e,live:t,onAnswer:n}){let r=t&&e.answer===void 0;return(0,I.jsxs)(`div`,{className:w(`flex flex-col gap-3`,r?`rounded-[14px] border border-accent-line bg-accent-soft px-4 py-3`:`py-1`),children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(he,{size:18,"aria-hidden":`true`,className:`mt-0.5 flex-none text-accent-fg`}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:e.title}),e.detail&&(0,I.jsx)(`span`,{className:`text-sm text-ink-2`,children:e.detail}),e.lines.map((e,t)=>(0,I.jsx)(`span`,{className:`text-sm text-ink-2 [overflow-wrap:anywhere]`,children:e},t))]})]}),r?(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.options.map(e=>(0,I.jsx)(y,{size:`sm`,onClick:()=>n(e.id),children:e.label},e.id)),!e.options.some(e=>e.id===`cancel`||e.label.trim().toLowerCase()===`cancel`)&&(0,I.jsx)(y,{size:`sm`,variant:`ghost`,onClick:()=>n(null),children:`Cancel`})]}):(0,I.jsx)(`span`,{className:`text-sm text-muted`,children:e.answer===void 0?`Not answered`:`You chose: ${e.answer}`})]})}function Ve({wait:e,live:t,onProceed:r}){let i=t&&e.answer===void 0;return(0,I.jsxs)(`div`,{className:w(`flex flex-col gap-3`,i?`rounded-[14px] border border-accent-line bg-accent-soft px-4 py-3`:`py-1`),children:[(0,I.jsxs)(`span`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(n,{size:18,"aria-hidden":`true`,className:`mt-0.5 flex-none text-accent-fg`}),(0,I.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.prompt})]}),i?(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(y,{size:`sm`,variant:`primary`,onClick:()=>r(!0),children:`Done, continue`}),(0,I.jsx)(y,{size:`sm`,onClick:()=>r(!1),children:`Cancel`})]}):(0,I.jsx)(`span`,{className:`text-sm text-muted`,children:e.answer===void 0?`Not done`:e.answer?`You continued`:`You cancelled`})]})}function He({turn:t,live:n,onAnswer:r,onProceed:a}){let o=n&&!t.outcome,[s,c]=(0,F.useState)(null),l=s??o,u=P(t),d=o?u.text:A(t),f=t.parts.map(e=>k(e.text)).filter(Boolean),[p,h]=(0,F.useState)(!1),_=[...t.log].reverse().find(e=>e.tone!==`you`&&e.tone!==`say`);return(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(`div`,{className:`size-9 flex-none`,"aria-hidden":`true`,children:(0,I.jsx)(m,{agent:`forgeqe`,px:34,working:o,className:`mt-0.5`})}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 pt-1.5`,children:[(t.steps.length>0||o||t.log.length>0)&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":l,disabled:!t.steps.length&&!t.plan.length,onClick:()=>c(!l),className:w(`flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 text-sm font-medium text-muted hover:text-ink disabled:cursor-default`,o&&`shimmer`),children:[(0,I.jsx)(`span`,{"aria-live":`polite`,children:d}),(t.steps.length>0||t.plan.length>0)&&(0,I.jsx)(g,{size:16,"aria-hidden":`true`,className:w(`transition-transform`,l&&`rotate-180`)})]}),t.log.length>0&&(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":p,onClick:()=>h(!p),className:`ml-auto inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-lg border-0 bg-transparent px-2 text-[13px] font-medium text-muted hover:bg-surface-muted hover:text-ink`,children:[(0,I.jsx)(e,{icon:ue,size:14}),`Activity log`,(0,I.jsx)(`span`,{className:`tabular-nums`,children:t.log.length})]})]}),(0,I.jsx)(i,{open:(l||o)&&(t.steps.length>0||t.plan.length>0||o),children:(0,I.jsx)(Me,{turn:t,working:o,folded:!l,live:{...u,latest:_,events:t.log.length,onLog:()=>h(!0)}})}),(0,I.jsx)(i,{open:p,children:(0,I.jsx)($,{lines:t.log,start:t.started||t.log[0]?.at,live:o,name:`forgeqe-activity-${t.id}.md`})})]}),t.asks.map(e=>(0,I.jsx)(Be,{ask:e,live:o,onAnswer:t=>r(e.id,t)},e.id)),t.waits.map(e=>(0,I.jsx)(Ve,{wait:e,live:o,onProceed:t=>a(e.id,t)},e.id)),t.outcome&&t.reply?(0,I.jsx)(D,{text:t.reply}):f.length>0&&(0,I.jsx)(D,{text:f.join(`
|
|
1
|
+
import{$t as e,Ai as t,An as n,Cn as r,Dt as i,Er as a,Fi as o,Ht as s,It as c,Ji as l,Mi as u,Mr as d,Mt as f,Ni as p,Nt as m,Qr as h,Tn as g,Wi as _,Yn as v,Zn as ee,Zr as te,Zt as y,di as ne,dr as re,en as ie,er as b,fa as x,fr as ae,gt as oe,hr as se,io as ce,ki as le,kr as ue,lo as de,mt as fe,nn as S,oo as pe,pa as me,pr as he,qt as C,ri as ge,tn as w,wi as _e,wr as ve,yr as T,zn as ye}from"./Shell-8Y6stc_6.js";import{c as E,l as D,u as O}from"./index-DuWTO5cE.js";import{c as k,i as A,o as j,r as M,s as N,t as P}from"./thread-Dy_QsQDd.js";var F=de(pe(),1),I=ce();function L({diff:e,className:t}){let n=0,r=0,i=e.split(`
|
|
2
|
+
`).flatMap((e,t)=>{if(/^(diff |index |--- |\+\+\+ )/.test(e))return[];let i=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(e);return i?(n=Number(i[1]),r=Number(i[2]),[{key:t,kind:`hunk`,text:e,a:``,b:``}]):e.startsWith(`+`)?[{key:t,kind:`add`,text:e.slice(1),a:``,b:String(r++)}]:e.startsWith(`-`)?[{key:t,kind:`del`,text:e.slice(1),a:String(n++),b:``}]:e.startsWith(`\\`)?[{key:t,kind:`hunk`,text:e,a:``,b:``}]:[{key:t,kind:`same`,text:e.startsWith(` `)?e.slice(1):e,a:String(n++),b:String(r++)}]});return(0,I.jsx)(`div`,{className:w(`max-h-[420px] overflow-auto rounded-[10px] border border-line-soft bg-bg font-mono text-[12px] leading-[1.6]`,t),children:(0,I.jsx)(`table`,{className:`w-full border-collapse`,children:(0,I.jsx)(`tbody`,{children:i.map(e=>(0,I.jsxs)(`tr`,{className:e.kind===`add`?`bg-pass-soft`:e.kind===`del`?`bg-fail-soft`:e.kind===`hunk`?`bg-surface-muted`:void 0,children:[(0,I.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.a}),(0,I.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.b}),(0,I.jsx)(`td`,{"aria-hidden":`true`,className:w(`w-4 align-top select-none`,e.kind===`add`?`text-pass`:e.kind===`del`?`text-fail`:`text-muted`),children:e.kind===`add`?`+`:e.kind===`del`?`−`:``}),(0,I.jsxs)(`td`,{className:w(`pr-3 align-top whitespace-pre`,e.kind===`hunk`?`text-muted`:`text-ink`),children:[(0,I.jsx)(`span`,{className:`sr-only`,children:e.kind===`add`?`added: `:e.kind===`del`?`removed: `:``}),e.text||` `]})]},e.key))})})})}function R({review:e,className:t}){return(0,I.jsxs)(`div`,{className:w(`flex flex-col gap-2 text-[13px] leading-relaxed`,t),children:[e.summary&&(0,I.jsx)(`p`,{className:`m-0 text-ink-2 [overflow-wrap:anywhere]`,children:e.summary}),e.issues.length>0&&(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.issues.map((e,t)=>(0,I.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,I.jsx)(`span`,{className:w(`mt-px flex-none rounded-full px-2 py-px text-[11.5px] font-medium`,e.kind===`correctness`?`bg-fail-soft text-fail`:`bg-surface-strong text-ink-2`),children:e.kind===`correctness`?`Correctness`:`Standards`}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[e.file&&(0,I.jsx)(`span`,{className:`font-mono text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.file}),(0,I.jsx)(`span`,{className:`text-ink [overflow-wrap:anywhere]`,children:e.problem}),e.fix&&(0,I.jsxs)(`span`,{className:`text-muted [overflow-wrap:anywhere]`,children:[`Fix: `,e.fix]})]})]},t))})]})}var be={done:`border-pass/35`,active:`border-accent/35`,pending:`border-line-strong`,failed:`border-fail/35`,skipped:`border-line-strong`,note:`border-line-strong`};function z({status:e,orb:t,px:n=20,spin:i=!1}){let a={width:n,height:n};return e===`active`&&i?(0,I.jsx)(`span`,{role:`img`,"aria-label":`At work`,className:`flex flex-none items-center justify-center`,style:a,children:(0,I.jsx)(h,{size:n-2,strokeWidth:2.5,"aria-hidden":`true`,className:`animate-spin text-accent-fg motion-reduce:animate-none`})}):e===`active`?(0,I.jsx)(f,{state:t,px:n,label:`At work`}):e===`done`?(0,I.jsx)(`span`,{role:`img`,"aria-label":`Done`,className:`flex flex-none items-center justify-center rounded-full bg-pass`,style:a,children:(0,I.jsx)(r,{size:n*.6,strokeWidth:3,"aria-hidden":`true`,className:`text-bg`})}):e===`failed`?(0,I.jsx)(`span`,{role:`img`,"aria-label":`Failed`,className:`flex flex-none items-center justify-center rounded-full bg-fail`,style:a,children:(0,I.jsx)(me,{size:n*.6,strokeWidth:3,"aria-hidden":`true`,className:`text-bg`})}):e===`note`?(0,I.jsx)(`span`,{role:`img`,"aria-label":`Note`,className:`flex flex-none items-center justify-center`,style:a,children:(0,I.jsx)(`span`,{className:`size-1.5 rounded-full bg-line-strong`})}):(0,I.jsx)(`span`,{role:`img`,"aria-label":e===`skipped`?`Skipped`:`To come`,className:w(`box-border block flex-none rounded-full border-2 border-line-strong`,e===`skipped`&&`border-dashed`),style:a})}var xe=(e,t)=>e.status===`running`?t?`active`:`done`:e.status===`ok`?`done`:e.status===`fail`?`failed`:`note`,Se={read:se,search:t,list:ve,edit:ae,run:l,element:ee,outline:te,references:ue,impact:ne,find:he,testfile:T,web:d,environment:p,cases:ye,browser:d,post:u,test:T,retry:_e,review:o,task:a,work:x},Ce={done:`text-pass`,failed:`text-fail`,active:`text-accent-fg animate-pulse motion-reduce:animate-none`,pending:`text-muted`,skipped:`text-muted`,note:`text-muted`},B={done:`Done`,failed:`Failed`,active:`At work`,pending:`To come`,skipped:`Skipped`,note:`Note`};function we({kind:e,status:t}){let n=w(`mt-px flex size-4 flex-none items-center justify-center`,Ce[t]);if(e===`skill`)return(0,I.jsxs)(`span`,{role:`img`,"aria-label":B[t],className:w(n,`relative`),children:[(0,I.jsx)(ie,{name:oe.skills,px:15}),(t===`done`||t===`failed`)&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:w(`absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full ring-1 ring-bg`,t===`done`?`bg-pass`:`bg-fail`)})]});let r=Se[e];return(0,I.jsx)(`span`,{role:`img`,"aria-label":B[t],className:n,children:(0,I.jsx)(r,{size:15,strokeWidth:2,"aria-hidden":`true`})})}function Te({status:e}){return e===`active`?(0,I.jsx)(h,{size:12,strokeWidth:2.5,"aria-label":`At work`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}):(0,I.jsx)(`span`,{role:`img`,"aria-label":B[e],className:w(`mt-[7px] size-2 flex-none rounded-full`,e===`done`?`bg-pass`:e===`failed`?`bg-fail`:`bg-line-strong`)})}function V({text:e,label:t}){let[n,i]=(0,F.useState)(!1);return(0,I.jsx)(`button`,{type:`button`,"aria-label":n?`Copied`:t,"data-tip":n?`Copied`:t,onClick:async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}},className:`flex size-6 flex-none cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted opacity-0 group-hover:opacity-100 hover:bg-surface-strong hover:text-ink focus-visible:opacity-100`,children:n?(0,I.jsx)(r,{size:13,"aria-hidden":`true`,className:`text-pass`}):(0,I.jsx)(v,{size:13,"aria-hidden":`true`})})}function Ee({step:e,failed:t}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1 py-0.5 font-mono text-[12px] leading-relaxed`,children:[e.command&&(0,I.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2 text-muted`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none select-none`,children:`$`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.command}),(0,I.jsx)(V,{text:e.command,label:`Copy the command`})]}),e.output&&(0,I.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none text-muted select-none`,children:`⎿`}),(0,I.jsx)(`pre`,{className:w(`m-0 max-h-56 min-w-0 flex-1 overflow-auto font-mono text-[12px] leading-relaxed whitespace-pre-wrap [overflow-wrap:anywhere]`,t?`text-fail`:`text-ink-2`),children:e.output}),(0,I.jsx)(V,{text:e.output,label:`Copy the output`})]})]})}var De=e=>/[/\\]|\.\w{1,5}$|^\$ /.test(e)&&!/\s{2,}/.test(e);function H({text:e}){return(0,I.jsx)(`span`,{className:w(`min-w-0 max-w-full truncate rounded-md bg-surface-strong px-1.5 py-0.5 text-[12.5px] text-ink-2`,De(e)&&`font-mono text-[12px]`),children:e})}function Oe({step:e}){return(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] leading-relaxed`,children:e.lines.map((e,t)=>(0,I.jsxs)(`li`,{className:w(`flex gap-1.5 [overflow-wrap:anywhere]`,e.ok===!0?`text-pass`:e.ok===!1?`text-fail`:`text-ink-2`),children:[e.ok!==void 0&&(0,I.jsx)(`span`,{"aria-hidden":`true`,children:e.ok?`✓`:`✗`}),(0,I.jsx)(D,{text:e.text,className:`min-w-0 text-[13px] leading-relaxed text-inherit [&_p]:my-0`})]},t))})}function U({agent:e,named:t=!0,working:n=!1}){let r=s(e);return(0,I.jsxs)(`span`,{className:`inline-flex flex-none items-center gap-1.5`,"data-tip":r.name,children:[(0,I.jsx)(m,{agent:e,px:18,decorative:t,working:n}),t&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`font-medium`,style:{color:r.hue},children:r.name}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`·`})]})]})}function W({step:e,from:t,live:n}){let r=e.handoff.agent,i=s(r);return(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5`,children:[(0,I.jsx)(m,{agent:t,px:18}),(0,I.jsxs)(`span`,{role:`img`,"aria-label":`hands off to`,className:w(`handoff-flow flex-none`,n&&`is-live`),style:{color:i.hue},children:[(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{})]}),(0,I.jsx)(m,{agent:r,px:20,decorative:!0,working:n,className:`handoff-in`}),(0,I.jsx)(`span`,{className:`font-medium`,style:{color:i.hue},children:i.name}),e.arg&&(0,I.jsx)(H,{text:e.arg})]})}function G({step:e,working:t,from:n=c}){let r=e.agent||n,a=K(e),o=xe(e,t),[s,l]=(0,F.useState)(null),u=s??((!!e.handoff||!!e.agent||e.key.startsWith(`try:`))&&o===`active`),d=(0,I.jsxs)(I.Fragment,{children:[e.handoff?(0,I.jsx)(z,{status:o,orb:e.orb,px:14,spin:!0}):!(e.icon&&r===n)&&(0,I.jsx)(Te,{status:o}),e.handoff?(0,I.jsx)(W,{step:e,from:n,live:o===`active`}):(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5`,children:[r!==n||!e.icon?(0,I.jsx)(U,{agent:r,named:r!==n,working:o===`active`}):(0,I.jsx)(we,{kind:e.icon,status:o}),(0,I.jsx)(`span`,{className:w(`[overflow-wrap:anywhere]`,o===`active`?`text-ink`:`text-ink-2`),children:e.label}),e.arg&&(0,I.jsx)(H,{text:e.arg}),e.change&&(0,I.jsxs)(`span`,{className:`font-mono text-[12px] tabular-nums`,children:[(0,I.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.change.added]}),` `,(0,I.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.change.removed]})]})]}),a&&(0,I.jsx)(g,{size:14,"aria-hidden":`true`,className:w(`mt-0.5 ml-auto flex-none text-muted transition-transform`,u&&`rotate-180`)})]});return(0,I.jsxs)(`li`,{className:`flex flex-col`,children:[a?(0,I.jsx)(`button`,{type:`button`,"aria-expanded":u,onClick:()=>l(!u),className:`flex min-h-8 w-full cursor-pointer items-start gap-2 rounded-lg border-0 bg-transparent px-1.5 py-1.5 text-left text-[13.5px] hover:bg-surface-muted`,children:d}):(0,I.jsx)(`div`,{className:`flex min-h-8 items-start gap-2 px-1.5 py-1.5 text-[13.5px]`,children:d}),a&&(0,I.jsx)(i,{open:u,children:(0,I.jsx)(q,{step:e,working:t,from:n,className:`mb-1 ml-[13px]`})})]})}var K=e=>e.lines.length>0||(e.children?.length??0)>0||!!e.handoff?.result||!!e.change||!!e.output||!!e.command||!!e.review;function q({step:e,working:t,from:n,className:r}){let i=e.children||[],a=e.handoff?.agent||e.agent;return(0,I.jsxs)(`div`,{className:w(`flex flex-col gap-1.5 border-l border-dotted py-1 pl-3`,r),style:{borderColor:a?`${s(a).hue}59`:`var(--color-line-strong)`},children:[(e.output||e.command)&&(0,I.jsx)(Ee,{step:e,failed:e.status===`fail`}),e.review&&(0,I.jsx)(R,{review:e.review}),e.lines.length>0&&(0,I.jsx)(Oe,{step:e}),e.change&&(0,I.jsx)(L,{diff:e.change.diff}),i.length>0&&(0,I.jsx)(`ul`,{"aria-label":a?`What ${C(s(a).name)} did`:`Steps`,className:`m-0 flex list-none flex-col p-0`,children:i.map(e=>(0,I.jsx)(G,{step:e,working:t,from:a||n},e.key))}),e.handoff?.result&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-0.5 text-[13px]`,children:[(0,I.jsxs)(`span`,{className:`text-muted`,children:[C(s(e.handoff.agent).name,!0),` answered`]}),(0,I.jsx)(D,{text:e.handoff.result.length>1200?`${e.handoff.result.slice(0,1199)}…`:e.handoff.result,className:`text-[13px] text-ink-2 [&_p]:my-0`})]})]})}function ke({node:e,last:t,working:n,now:r,orbed:a}){let o=e.step?[]:e.steps,s=e.step,c=o.length>0||!!r||!!s&&K(s),[l,u]=(0,F.useState)(null),d=l??(e.status===`active`||e.status===`failed`),f=s?.orb??[...o].reverse().find(e=>e.status===`running`)?.orb??r?.orb??`thinking`;return(0,I.jsxs)(`li`,{className:`flex gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-none flex-col items-center`,children:[(0,I.jsx)(`span`,{className:`mt-[3px]`,children:(0,I.jsx)(z,{status:e.status,orb:f,spin:!a})}),!t&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:w(`mt-1.5 min-h-4 w-0 flex-1 border-l border-dotted`,be[e.status])})]}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col pb-2`,children:[c?(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":d,onClick:()=>u(!d),className:`flex min-h-7 w-full cursor-pointer items-start gap-1.5 border-0 bg-transparent p-0 text-left`,children:[(0,I.jsx)(J,{node:e}),(0,I.jsx)(g,{size:14,"aria-hidden":`true`,className:w(`mt-1 flex-none text-muted transition-transform`,d&&`rotate-180`)}),e.status===`active`&&(0,I.jsx)(`span`,{className:`mt-0.5 ml-1 flex-none rounded-full border border-accent-line bg-accent-soft px-2 py-px text-[11.5px] font-medium text-accent-fg`,children:`In progress`})]}):(0,I.jsx)(`div`,{className:`min-h-7`,children:(0,I.jsx)(J,{node:e})}),c&&(0,I.jsx)(i,{open:d,className:`mt-0.5`,children:s?(0,I.jsx)(q,{step:s,working:n,from:`forgeqe`,className:`mt-1`}):(0,I.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[o.map(e=>(0,I.jsx)(G,{step:e,working:n},e.key)),r&&(0,I.jsx)(`li`,{children:(0,I.jsx)(Y,{live:r,className:`px-1.5`})})]})})]})]})}function J({node:e}){let t=e.status===`active`?`text-ink`:e.status===`pending`||e.status===`skipped`?`text-muted`:e.status===`failed`?`text-fail`:`text-ink-2`,n=e.step;return n?.handoff?(0,I.jsx)(W,{step:n,from:c,live:e.status===`active`}):(0,I.jsxs)(`span`,{className:w(`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 text-sm font-medium`,t,e.status===`skipped`&&`line-through`),children:[n&&(0,I.jsx)(U,{agent:n.agent||`forgeqe`,named:!!n.agent&&n.agent!==`forgeqe`,working:e.status===`active`}),e.status===`active`?(0,I.jsx)(`span`,{className:`shimmer [overflow-wrap:anywhere]`,children:(0,I.jsx)(`span`,{children:e.label})}):(0,I.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.label}),n?.arg&&(0,I.jsx)(H,{text:n.arg})]})}var Ae={info:`text-ink-2`,ok:`text-pass`,fail:`text-fail`,warn:`text-warn`,dim:`text-muted`,say:`text-ink-2`,you:`text-accent-fg`,think:`text-muted italic`};function je(e){let[t,n]=(0,F.useState)(()=>Date.now());(0,F.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]);let r=e?Date.parse(e):NaN;if(Number.isNaN(r))return``;let i=Math.max(0,Math.round((t-r)/1e3));return i<2?`just now`:i<60?`${i}s ago`:`${Math.floor(i/60)} min ago`}function Y({live:e,orb:t=!1,className:n}){let r=je(e.latest?.at);return(0,I.jsxs)(`div`,{className:w(`flex min-h-8 items-start gap-2 py-1`,n),children:[(0,I.jsx)(`span`,{className:`mt-0.5 flex size-4 flex-none items-center justify-center`,children:t?(0,I.jsx)(f,{state:e.orb,px:20,label:`At work`}):(0,I.jsxs)(`span`,{"aria-hidden":`true`,className:`relative flex size-2`,children:[(0,I.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-accent opacity-60 motion-reduce:animate-none`}),(0,I.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-accent`})]})}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,I.jsx)(`span`,{className:`shimmer text-[13.5px] font-medium text-muted`,children:(0,I.jsx)(`span`,{"aria-live":`polite`,children:e.text})}),e.latest&&(0,I.jsxs)(`button`,{type:`button`,onClick:e.onLog,"data-tip":`Open the activity log`,className:`flex w-full min-w-0 cursor-pointer items-baseline gap-2 border-0 bg-transparent p-0 text-left hover:underline`,children:[(0,I.jsx)(`span`,{className:w(`min-w-0 truncate font-mono text-[12px]`,Ae[e.latest.tone]),children:e.latest.plain}),(0,I.jsxs)(`span`,{className:`flex-none text-[11.5px] whitespace-nowrap text-muted tabular-nums`,children:[r,r&&` · `,e.events,` `,e.events===1?`event`:`events`]})]})]})]})}function Me({turn:e,working:t,live:n,folded:r=!1}){if(r)return(0,I.jsx)(Y,{live:n,orb:!0});let i=M(e,t),a=e.plan.length>0&&t?i.find(e=>e.status===`active`)??null:null,o=t&&!a?[{key:`now`,label:n.text,status:`active`,steps:[]}]:[],s=[...i,...o],c=[...i].reverse().find(e=>e.status===`active`);return(0,I.jsx)(`ol`,{"aria-label":`What ForgeQE did`,className:`m-0 flex list-none flex-col p-0 pt-1`,children:s.map((e,r)=>e.key===`now`?(0,I.jsx)(`li`,{className:`flex gap-3`,children:(0,I.jsx)(Y,{live:n,orb:!c,className:`-mt-1 min-w-0 flex-1 py-0`})},`now`):(0,I.jsx)(ke,{node:e,last:r===s.length-1,working:t,now:a===e?n:void 0,orbed:c===e},e.key))})}var Ne={passed:`Passed`,failed:`Failed`,stopped:`Stopped`,blocked:`Blocked`};function X({label:e,children:t}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`dt`,{className:`pt-0.5 text-[13px] text-muted`,children:e}),(0,I.jsx)(`dd`,{className:`m-0 min-w-0 text-[13px] [overflow-wrap:anywhere]`,children:t})]})}function Z({text:t}){let[n,i]=(0,F.useState)(!1);return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 rounded-[10px] bg-surface-muted px-3 py-2`,children:[(0,I.jsx)(e,{icon:_,size:14,className:`mt-0.5 flex-none text-muted`}),(0,I.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[12.5px] break-all whitespace-pre-wrap text-ink`,children:t}),(0,I.jsx)(`button`,{type:`button`,"aria-label":n?`Copied`:`Copy the command`,onClick:async()=>{await O(t)&&(i(!0),setTimeout(()=>i(!1),1500))},className:`inline-flex size-7 flex-none cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-surface-strong hover:text-ink`,children:n?(0,I.jsx)(r,{size:14,"aria-hidden":`true`,className:`text-pass`}):(0,I.jsx)(v,{size:14,"aria-hidden":`true`})})]})}function Pe(e){if(e.runs===void 0)return e.attempts===void 0?``:S(e.attempts,`attempt`);let t=`${S(e.runs,`test run`)}${e.failedRuns?` (${e.failedRuns} failed)`:``}`;return e.reviews?`${t} · ${S(e.reviews,`review`)}`:t}function Fe({name:e}){let t=e.lastIndexOf(`.`),n=t>0?e.slice(t+1):e,r=t>0?e.slice(0,t):``;return(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col`,"data-tip":e,children:[(0,I.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink [overflow-wrap:anywhere]`,children:n}),r&&(0,I.jsx)(`span`,{className:`font-mono text-[11.5px] text-muted [overflow-wrap:anywhere]`,children:r})]})}function Ie({t:e}){let t=Pe(e);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,I.jsx)(T,{size:17,strokeWidth:2,"aria-hidden":`true`,className:e.ok?`text-pass`:e.status===`stopped`?`text-muted`:`text-fail`}),(0,I.jsx)(`span`,{className:`text-[15px] font-semibold`,children:e.ok?`Test written`:`Test not finished`}),(0,I.jsx)(fe,{tone:e.ok?`pass`:e.status===`stopped`?`neutral`:`fail`,children:Ne[e.status]||e.status||`Not written`}),t&&(0,I.jsx)(`span`,{className:`text-[13px] text-muted`,children:t})]}),(0,I.jsxs)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-5 gap-y-1 sm:grid-cols-[96px_minmax(0,1fr)] sm:gap-y-3`,children:[(e.testFile||e.testName)&&(0,I.jsx)(X,{label:`Test`,children:(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[e.testFile&&(0,I.jsx)(E,{path:e.testFile}),e.testName&&(0,I.jsx)(Fe,{name:e.testName})]})}),e.command&&(0,I.jsx)(X,{label:`Run it`,children:(0,I.jsx)(Z,{text:e.command})}),e.review&&(0,I.jsx)(X,{label:e.review.approved?`Review`:`Review asked`,children:(0,I.jsx)(R,{review:e.review})}),e.runDir&&(0,I.jsx)(X,{label:`From the run`,children:(0,I.jsx)(E,{path:e.runDir})}),e.reused.length>0&&(0,I.jsx)(X,{label:`Reused`,children:(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.reused.map(e=>(0,I.jsx)(`li`,{className:`min-w-0`,children:(0,I.jsx)(E,{path:e})},e))})})]}),e.error&&(0,I.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:e.error})]})}function Le({c:e}){let[t,n]=(0,F.useState)(!1);return(0,I.jsxs)(`li`,{className:`flex flex-col`,children:[(0,I.jsxs)(`div`,{className:`flex min-h-9 items-center gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} the changes to ${e.path}`,onClick:()=>n(!t),className:`inline-flex size-7 flex-none cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-surface-strong hover:text-ink`,children:(0,I.jsx)(g,{size:15,"aria-hidden":`true`,className:w(`transition-transform`,!t&&`-rotate-90`)})}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,I.jsx)(E,{path:e.path})}),(0,I.jsxs)(`span`,{className:`flex-none font-mono text-[12px] tabular-nums`,children:[(0,I.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,I.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,I.jsx)(i,{open:t,children:(0,I.jsx)(L,{diff:e.diff,className:`mb-2 ml-9`})})]})}function Re({turn:e}){let t=e.reports.filter((e,t,n)=>n.findIndex(t=>t.path===e.path)===t),n=new Set(e.changes.map(e=>e.path)),r=[...new Set(e.tests.flatMap(e=>e.changed))].filter(e=>!n.has(e)&&![...n].some(t=>t.endsWith(e)||e.endsWith(t)));return!e.tests.length&&!t.length&&!e.changes.length&&!r.length?null:(0,I.jsxs)(`section`,{"aria-label":`Result`,className:`flex flex-col gap-4 border-t border-line-soft pt-4`,children:[e.tests.map((e,t)=>(0,I.jsx)(Ie,{t:e},t)),t.length>0&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:`Reports`}),(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-sm`,children:t.map(e=>(0,I.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,I.jsx)(`span`,{className:`text-ink-2`,children:e.label}),(0,I.jsx)(E,{path:e.path})]},e.path))})]}),(e.changes.length>0||r.length>0)&&(0,I.jsxs)(`div`,{className:w(`flex flex-col gap-1`,(e.tests.length>0||t.length>0)&&`border-t border-line-soft pt-3`),children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-medium`,children:[(0,I.jsx)(re,{size:15,"aria-hidden":`true`,className:`text-muted`}),`Files changed`,(0,I.jsxs)(`span`,{className:`font-normal text-muted`,children:[S(e.changes.length+r.length,`file`),e.changes.length>0&&(0,I.jsxs)(I.Fragment,{children:[` · `,(0,I.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.changes.reduce((e,t)=>e+t.added,0)]}),` `,(0,I.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.changes.reduce((e,t)=>e+t.removed,0)]})]})]})]}),(0,I.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[e.changes.map(e=>(0,I.jsx)(Le,{c:e},e.path)),r.map(e=>(0,I.jsx)(`li`,{className:`flex min-h-9 items-center gap-2 pl-9`,children:(0,I.jsx)(E,{path:e})},e))]})]})]})}var Q={info:`text-ink-2`,ok:`text-pass`,fail:`text-fail`,warn:`text-warn`,dim:`text-muted`,say:`text-ink`,you:`text-accent-fg`,think:`text-muted italic`};function ze({line:e,start:t}){let[n,r]=(0,F.useState)(!1),i=e.plain.length>160;return e.kind===`head`?(0,I.jsxs)(`li`,{className:`mt-3 flex items-baseline gap-3 border-b border-line-soft pb-1 first:mt-0`,children:[(0,I.jsx)(`span`,{className:`w-12 flex-none font-mono text-[11.5px] text-muted tabular-nums`,children:N(t,e.at)}),(0,I.jsx)(D,{text:e.md,className:`min-w-0 text-[13px] font-semibold text-ink [&_p]:my-0`})]}):(0,I.jsxs)(`li`,{className:w(`flex items-baseline gap-3 py-1`,e.kind===`sub`&&`pl-4`),children:[(0,I.jsx)(`span`,{className:`w-12 flex-none font-mono text-[11.5px] text-muted tabular-nums`,children:N(t,e.at)}),e.kind===`out`?(0,I.jsx)(`pre`,{className:`m-0 min-w-0 flex-1 font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:e.plain}):(0,I.jsx)(`button`,{type:`button`,disabled:!i,"aria-expanded":i?n:void 0,onClick:()=>r(!n),"data-tip":i&&!n?`Show all of it`:void 0,className:w(`min-w-0 flex-1 border-0 bg-transparent p-0 text-left`,i&&`cursor-pointer`),children:(0,I.jsx)(D,{text:e.md,className:w(`text-[13px] leading-relaxed [overflow-wrap:anywhere] [&_code]:text-[12px] [&_p]:my-0`,Q[e.tone],i&&!n&&`line-clamp-2`)})})]})}function $({lines:t,start:n,live:i,name:a,timeline:o=!1}){let s=(0,F.useRef)(null),c=(0,F.useRef)(!0),[l,u]=(0,F.useState)(!1),d=(0,F.useMemo)(()=>j(t,n),[t,n]);(0,F.useEffect)(()=>{c.current&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[d]);let f=`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-lg border-0 bg-transparent px-2 text-[12px] font-medium text-muted hover:bg-surface-strong hover:text-ink`;return(0,I.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,I.jsxs)(`div`,{className:`flex min-h-9 items-center gap-1 border-b border-line-soft text-[12px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`flex-1`,children:[o?``:`Markdown · `,t.length,` event`,t.length===1?``:`s`,i&&` · live`]}),(0,I.jsxs)(`button`,{type:`button`,"aria-label":l?`Copied`:`Copy the activity log as Markdown`,onClick:async()=>{try{await navigator.clipboard.writeText(d),u(!0),setTimeout(()=>u(!1),1500)}catch{}},className:f,children:[l?(0,I.jsx)(r,{size:14,"aria-hidden":`true`,className:`text-pass`}):(0,I.jsx)(v,{size:14,"aria-hidden":`true`}),l?`Copied`:`Copy`]}),(0,I.jsxs)(`button`,{type:`button`,"aria-label":`Download the activity log as a Markdown file`,onClick:()=>{let e=URL.createObjectURL(new Blob([d],{type:`text/markdown;charset=utf-8`})),t=document.createElement(`a`);t.href=e,t.download=a,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)},className:f,children:[(0,I.jsx)(e,{icon:b,size:14}),`.md`]})]}),(0,I.jsx)(`div`,{ref:s,role:`log`,"aria-label":`Activity log`,onScroll:e=>{let t=e.currentTarget;c.current=t.scrollTop+t.clientHeight>=t.scrollHeight-24},className:w(`overflow-y-auto py-2`,o?`max-h-[calc(var(--screen)-260px)] min-h-[320px]`:`max-h-[360px] border-b border-line-soft`),children:o?(0,I.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:t.map((e,t)=>(0,I.jsx)(ze,{line:e,start:n},t))}):(0,I.jsx)(D,{text:d,className:`text-[13px] leading-[1.6] [&_code]:text-[12px] [&_h4]:mt-3 [&_h4]:mb-1 [&_li]:my-0.5 [&_pre]:text-[12px] [&_ul]:my-1`})})]})}function Be({ask:e,live:t,onAnswer:n}){let r=t&&e.answer===void 0;return(0,I.jsxs)(`div`,{className:w(`flex flex-col gap-3`,r?`rounded-[14px] border border-accent-line bg-accent-soft px-4 py-3`:`py-1`),children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(ge,{size:18,"aria-hidden":`true`,className:`mt-0.5 flex-none text-accent-fg`}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:e.title}),e.detail&&(0,I.jsx)(`span`,{className:`text-sm text-ink-2`,children:e.detail}),e.lines.map((e,t)=>(0,I.jsx)(`span`,{className:`text-sm text-ink-2 [overflow-wrap:anywhere]`,children:e},t))]})]}),r?(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.options.map(e=>(0,I.jsx)(y,{size:`sm`,onClick:()=>n(e.id),children:e.label},e.id)),!e.options.some(e=>e.id===`cancel`||e.label.trim().toLowerCase()===`cancel`)&&(0,I.jsx)(y,{size:`sm`,variant:`ghost`,onClick:()=>n(null),children:`Cancel`})]}):(0,I.jsx)(`span`,{className:`text-sm text-muted`,children:e.answer===void 0?`Not answered`:`You chose: ${e.answer}`})]})}function Ve({wait:e,live:t,onProceed:r}){let i=t&&e.answer===void 0;return(0,I.jsxs)(`div`,{className:w(`flex flex-col gap-3`,i?`rounded-[14px] border border-accent-line bg-accent-soft px-4 py-3`:`py-1`),children:[(0,I.jsxs)(`span`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(n,{size:18,"aria-hidden":`true`,className:`mt-0.5 flex-none text-accent-fg`}),(0,I.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.prompt})]}),i?(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(y,{size:`sm`,variant:`primary`,onClick:()=>r(!0),children:`Done, continue`}),(0,I.jsx)(y,{size:`sm`,onClick:()=>r(!1),children:`Cancel`})]}):(0,I.jsx)(`span`,{className:`text-sm text-muted`,children:e.answer===void 0?`Not done`:e.answer?`You continued`:`You cancelled`})]})}function He({turn:t,live:n,onAnswer:r,onProceed:a}){let o=n&&!t.outcome,[s,c]=(0,F.useState)(null),l=s??o,u=P(t),d=o?u.text:A(t),f=t.parts.map(e=>k(e.text)).filter(Boolean),[p,h]=(0,F.useState)(!1),_=[...t.log].reverse().find(e=>e.tone!==`you`&&e.tone!==`say`);return(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(`div`,{className:`size-9 flex-none`,"aria-hidden":`true`,children:(0,I.jsx)(m,{agent:`forgeqe`,px:34,working:o,className:`mt-0.5`})}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 pt-1.5`,children:[(t.steps.length>0||o||t.log.length>0)&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":l,disabled:!t.steps.length&&!t.plan.length,onClick:()=>c(!l),className:w(`flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 text-sm font-medium text-muted hover:text-ink disabled:cursor-default`,o&&`shimmer`),children:[(0,I.jsx)(`span`,{"aria-live":`polite`,children:d}),(t.steps.length>0||t.plan.length>0)&&(0,I.jsx)(g,{size:16,"aria-hidden":`true`,className:w(`transition-transform`,l&&`rotate-180`)})]}),t.log.length>0&&(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":p,onClick:()=>h(!p),className:`ml-auto inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-lg border-0 bg-transparent px-2 text-[13px] font-medium text-muted hover:bg-surface-muted hover:text-ink`,children:[(0,I.jsx)(e,{icon:le,size:14}),`Activity log`,(0,I.jsx)(`span`,{className:`tabular-nums`,children:t.log.length})]})]}),(0,I.jsx)(i,{open:(l||o)&&(t.steps.length>0||t.plan.length>0||o),children:(0,I.jsx)(Me,{turn:t,working:o,folded:!l,live:{...u,latest:_,events:t.log.length,onLog:()=>h(!0)}})}),(0,I.jsx)(i,{open:p,children:(0,I.jsx)($,{lines:t.log,start:t.started||t.log[0]?.at,live:o,name:`forgeqe-activity-${t.id}.md`})})]}),t.asks.map(e=>(0,I.jsx)(Be,{ask:e,live:o,onAnswer:t=>r(e.id,t)},e.id)),t.waits.map(e=>(0,I.jsx)(Ve,{wait:e,live:o,onProceed:t=>a(e.id,t)},e.id)),t.outcome&&t.reply?(0,I.jsx)(D,{text:t.reply}):f.length>0&&(0,I.jsx)(D,{text:f.join(`
|
|
3
3
|
|
|
4
4
|
`)}),(0,I.jsx)(Re,{turn:t}),t.error&&(0,I.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:t.error}),t.outcome===`stopped`&&!t.reply&&(0,I.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Stopped.`})]})]})}export{L as i,He as n,Z as r,$ as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$r as e,$t as t,Ai as n,At as r,Bi as i,Dn as a,Dt as o,Et as s,Ht as c,Ji as l,L as u,Ln as d,Mn as f,Nr as p,Or as m,Ot as h,Qt as g,Ri as _,Si as v,Un as y,Wi as b,Ya as x,Zt as S,_r as C,ar as w,at as ee,bn as T,ct as E,fa as D,gt as O,ht as k,ii as A,io as te,jn as j,lo as M,mt as N,n as ne,nn as P,on as re,oo as ie,ot as ae,pn as oe,qr as se,rr as ce,sa as le,tn as F,ut as ue,vn as de,wa as fe,wi as pe,wt as me,yr as I}from"./Shell-8Y6stc_6.js";import{c as L,i as he,l as R,o as ge,r as _e}from"./index-DuWTO5cE.js";import{r as ve,t as ye}from"./Response-B4iQEi_e.js";import{i as be,r as xe,t as Se}from"./segmented-CD8WWurO.js";import{a as Ce,c as we}from"./thread-Dy_QsQDd.js";import{r as Te}from"./families-BGEp9m2k.js";var z=M(ie(),1),B=te(),V={execution:`Execution`,report:`Report`,coding:`Coding`,chat:`Chat`},Ee={execution:I,report:w,coding:y,chat:A};function De({kind:e}){let n=Ee[e];return(0,B.jsx)(t,{icon:n,size:14,className:`flex-none text-muted`})}var Oe={passed:{label:`Passed`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},error:{label:`Error`,tone:`fail`},skipped:{label:`Skipped`,tone:`neutral`},stopped:{label:`Stopped`,tone:`neutral`},blocked:{label:`Blocked`,tone:`warn`}},H=e=>Oe[e]||{label:e?e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g,` `):`–`,tone:`neutral`},ke={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`App run`},Ae=e=>{if(!e)return``;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`};function U({title:e,icon:t,children:n,aside:r}){return(0,B.jsxs)(`section`,{className:`flex flex-col gap-3 border-t border-line-soft pt-6 first:border-t-0 first:pt-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`h3`,{className:`m-0 flex flex-1 items-center gap-2 text-base font-semibold`,children:[(0,B.jsx)(`span`,{className:`text-accent-fg`,children:t}),e]}),r]}),n]})}function je({path:e,label:t=`Open report`}){let[n,r]=(0,z.useState)(``);return(0,B.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(S,{onClick:async()=>r(await h(e)),children:[(0,B.jsx)(ce,{"aria-hidden":`true`}),t]}),n&&(0,B.jsx)(`span`,{className:`text-[13px] text-fail`,children:n})]})}function Me({items:e,first:t,render:n}){let[r,i]=(0,z.useState)(!1);return(0,B.jsxs)(B.Fragment,{children:[(r?e:e.slice(0,t)).map(n),e.length>t&&(0,B.jsx)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>i(!r),className:`min-h-8 cursor-pointer self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:r?`Show fewer`:`Show all ${e.length}`})]})}function Ne({c:e}){if(!e.total)return null;let t=t=>`${t/e.total*100}%`;return(0,B.jsxs)(`div`,{role:`img`,"aria-label":`${e.passed} passed, ${e.failed} failed, ${e.other} other, of ${e.total}`,className:`flex h-2 overflow-hidden rounded-full bg-surface-strong`,children:[(0,B.jsx)(`div`,{className:`bg-pass transition-[width] duration-200 ease-out`,style:{width:t(e.passed)}}),(0,B.jsx)(`div`,{className:`bg-fail transition-[width] duration-200 ease-out`,style:{width:t(e.failed)}}),(0,B.jsx)(`div`,{className:`bg-warn transition-[width] duration-200 ease-out`,style:{width:t(e.other)}})]})}function Pe({e}){let t=e.counts.total?Math.round(e.counts.passed/e.counts.total*100):0;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-line-soft pt-3 first:border-t-0 first:pt-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,B.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:[ke[e.scope]||e.scope,Ae(e.ms),e.tokens?`${u(e.tokens)} tokens`:``,e.stopped?`stopped early`:``].filter(Boolean).join(` · `)})]}),e.report&&(0,B.jsx)(je,{path:e.report})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,B.jsxs)(`span`,{className:`text-[22px] font-semibold tabular-nums`,children:[t,`%`]}),(0,B.jsx)(`span`,{className:`text-muted`,children:`passed`}),(0,B.jsxs)(N,{tone:`pass`,children:[e.counts.passed,` passed`]}),e.counts.failed>0&&(0,B.jsxs)(N,{tone:`fail`,children:[e.counts.failed,` failed`]}),e.counts.other>0&&(0,B.jsxs)(N,{tone:`warn`,children:[e.counts.other,` other`]}),(0,B.jsxs)(`span`,{className:`text-muted`,children:[`of `,e.counts.total]})]}),(0,B.jsx)(Ne,{c:e.counts}),e.cases.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Cases of ${e.title}`,className:`m-0 flex list-none flex-col p-0`,children:(0,B.jsx)(Me,{items:[...e.cases].sort((e,t)=>Number(H(t.status).tone===`fail`)-Number(H(e.status).tone===`fail`)),first:6,render:(e,t)=>(0,B.jsxs)(`li`,{className:`flex min-w-0 items-start gap-3 border-t border-line-soft py-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`w-[76px] flex-none`,children:(0,B.jsx)(N,{tone:H(e.status).tone,children:H(e.status).label})}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,B.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[e.id&&(0,B.jsx)(`span`,{className:`mr-1.5 font-mono text-[12px] text-muted`,children:e.id}),e.title,e.device&&(0,B.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.device]})]}),e.summary&&(0,B.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted`,children:e.summary})]}),(0,B.jsx)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:Ae(e.ms)})]},`${e.id}-${t}`)})}),e.folder&&!e.report&&(0,B.jsxs)(`span`,{className:`text-sm`,children:[`Kept in `,(0,B.jsx)(L,{path:e.folder})]})]})}function Fe({list:e}){let n=e.reduce((e,t)=>({total:e.total+t.counts.total,passed:e.passed+t.counts.passed,failed:e.failed+t.counts.failed}),{total:0,passed:0,failed:0});return(0,B.jsx)(U,{title:`Execution summary`,icon:(0,B.jsx)(t,{icon:I,size:18}),aside:e.length>1?(0,B.jsxs)(`span`,{className:`text-sm text-muted`,children:[P(e.length,`run`),` · `,n.passed,` of `,n.total,` passed`]}):void 0,children:e.length?e.map((e,t)=>(0,B.jsx)(Pe,{e},`${e.folder||e.title}-${t}`)):(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No results found for this run yet: they appear once its report is written.`})})}function Ie({list:e}){return(0,B.jsxs)(U,{title:`Report summary`,icon:(0,B.jsx)(t,{icon:w,size:18}),children:[e.length===0&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No report was written in this run.`}),e.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-line-soft pt-3 first:border-t-0 first:pt-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,B.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.builtAt?`Written ${new Date(e.builtAt).toLocaleString([],{dateStyle:`medium`,timeStyle:`short`})}`:e.path?``:`Its page is not there any more`})]}),e.path&&(0,B.jsx)(je,{path:e.path})]}),e.stats&&(0,B.jsx)(`dl`,{className:`m-0 grid grid-cols-[repeat(auto-fit,minmax(110px,1fr))] gap-2`,children:e.stats.map(e=>(0,B.jsxs)(`div`,{className:`rounded-[10px] bg-surface-muted px-3 py-2`,children:[(0,B.jsx)(`dt`,{className:`text-[12px] text-muted`,children:e.label}),(0,B.jsx)(`dd`,{className:`m-0 text-[18px] font-semibold tabular-nums`,children:e.value})]},e.label))}),e.markdown&&(0,B.jsx)(Le,{text:e.markdown})]},`${e.path||e.title}-${t}`))]})}function Le({text:e,height:t=220}){let[n,r]=(0,z.useState)(!1),[i,a]=(0,z.useState)(!0),[o,s]=(0,z.useState)(t),c=(0,z.useRef)(null);return(0,z.useLayoutEffect)(()=>{c.current&&!n&&a(c.current.scrollHeight>t+8)},[e,t,n]),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsxs)(`div`,{ref:c,style:o===void 0?void 0:{maxHeight:o},onTransitionEnd:e=>e.target===e.currentTarget&&n&&s(void 0),className:F(`transition-[max-height] duration-200 ease-[cubic-bezier(0.2,0.7,0.2,1)]`,o!==void 0&&`relative overflow-hidden`),children:[(0,B.jsx)(R,{text:e,className:`text-sm`}),!n&&i&&(0,B.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-bg to-transparent`})]}),(n||i)&&(0,B.jsx)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>{let e=c.current?.scrollHeight??t;if(r(!n),me())return s(n?t:void 0);s(e),n&&requestAnimationFrame(()=>requestAnimationFrame(()=>s(t)))},className:`min-h-8 cursor-pointer self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:n?`Show less`:`Show all of it`})]})}function Re(e){let t=e.join(`
|
|
2
|
+
`),n=Math.max(2,...(t.match(/`+/g)||[]).map(e=>e.length)),r="`".repeat(n+1);return`${r}diff\n${t}\n${r}`}function ze({e}){let[t,n]=(0,z.useState)(!1),r=e.action===`write`?`New`:`Edited`;return(0,B.jsxs)(`li`,{className:`border-t border-line-soft`,children:[(0,B.jsxs)(`div`,{className:`flex min-h-[44px] min-w-0 items-center gap-2 py-1.5 text-sm`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} the diff of ${e.path}`,disabled:!e.diffs.length,onClick:()=>n(!t),className:`inline-flex size-8 flex-none cursor-pointer items-center justify-center rounded-lg border-0 bg-transparent text-muted hover:bg-surface-strong disabled:cursor-default disabled:opacity-40`,children:(0,B.jsx)(a,{size:16,"aria-hidden":`true`,className:F(`transition-transform duration-200`,t&&`rotate-90`)})}),(0,B.jsx)(`span`,{className:`w-[52px] flex-none text-[12px] text-muted`,children:r}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,B.jsx)(L,{path:e.path})}),(0,B.jsxs)(`span`,{className:`flex-none font-mono text-[12px] tabular-nums`,children:[(0,B.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,B.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,B.jsx)(o,{open:t,className:`pb-3 pl-10 [&_pre]:max-h-[420px] [&_pre]:overflow-auto`,children:e.diffs.length?(0,B.jsx)(R,{text:Re(e.diffs)}):null})]})}var Be={write:`New`,edit:`Edited`,delete:`Deleted`,"test written":`Test`};function W({label:e,children:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{className:`pt-0.5 text-[13px] text-muted`,children:e}),(0,B.jsx)(`dd`,{className:`m-0 min-w-0 text-sm [overflow-wrap:anywhere]`,children:t})]})}function Ve({c:e,files:n}){let r=e.edits.reduce((e,t)=>e+t.added,0),i=e.edits.reduce((e,t)=>e+t.removed,0),a=e.tests.filter(e=>!e.ok).length,o=e.reviews.at(-1),s=e.edits.length?[]:n.filter(e=>e.action&&e.action!==`read`);return(0,B.jsxs)(U,{title:`Code changes`,icon:(0,B.jsx)(t,{icon:y,size:18}),aside:e.edits.length?(0,B.jsxs)(`span`,{className:`font-mono text-[13px] tabular-nums`,children:[P(e.edits.length,`file`),` · `,(0,B.jsxs)(`span`,{className:`text-pass`,children:[`+`,r]}),` `,(0,B.jsxs)(`span`,{className:`text-fail`,children:[`−`,i]})]}):s.length?(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:P(s.length,`file`)}):void 0,children:[e.results.map((t,n)=>{let r=t.status===`passed`||t.status===`done`,i=t.status===`error`||t.status===`failed`;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-line-soft pb-4 last:border-b-0 last:pb-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,B.jsx)(I,{size:17,strokeWidth:2,"aria-hidden":`true`,className:r?`text-pass`:i?`text-fail`:`text-warn`}),(0,B.jsx)(`span`,{className:`text-[15px] font-semibold`,children:r?`Test written`:i?`Test not finished`:H(t.status).label}),(0,B.jsx)(N,{tone:r?`pass`:i?`fail`:`warn`,children:H(t.status).label}),e.tests.length>0&&(0,B.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[P(e.tests.length,`test run`),a?` (${a} failed)`:``,e.reviews.length?` · ${P(e.reviews.length,`review`)}`:``]})]}),(0,B.jsxs)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-5 gap-y-1 sm:grid-cols-[110px_minmax(0,1fr)] sm:gap-y-3`,children:[t.testFile&&(0,B.jsx)(W,{label:`Test`,children:(0,B.jsx)(L,{path:t.testFile})}),t.command&&(0,B.jsx)(W,{label:`Run it`,children:(0,B.jsx)(ve,{text:t.command})}),(t.review||o)&&(0,B.jsx)(W,{label:`Review`,children:(0,B.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)(N,{tone:(t.review??o).approved?`pass`:`warn`,children:(t.review??o).approved?`Approved`:`Changes asked`})}),(t.review?.summary||o?.summary)&&(0,B.jsx)(`span`,{className:`text-ink-2`,children:t.review?.summary||o?.summary})]})}),t.notes&&(0,B.jsx)(W,{label:`Notes`,children:(0,B.jsx)(R,{text:t.notes,className:`text-sm text-ink-2 [&_p]:my-0 [&_p+p]:mt-2`})})]}),t.error&&(0,B.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:t.error})]},n)}),e.edits.length>0&&(0,B.jsxs)(`div`,{className:`flex flex-col`,children:[(0,B.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,B.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:(0,B.jsx)(Me,{items:e.edits,first:8,render:e=>(0,B.jsx)(ze,{e},e.path)})})]}),s.length>0&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,B.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:s.map(e=>(0,B.jsxs)(`li`,{className:`flex min-h-9 min-w-0 items-center gap-3 border-t border-line-soft text-sm first:border-t-0`,children:[(0,B.jsx)(`span`,{className:`w-[52px] flex-none text-[12px] text-muted`,children:Be[e.action]||e.action.charAt(0).toUpperCase()+e.action.slice(1)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,B.jsx)(L,{path:e.path})})]},e.path))}),(0,B.jsx)(`p`,{className:`m-0 text-[12.5px] text-muted`,children:`Their diffs were not kept for this run.`})]}),!e.edits.length&&!s.length&&!e.results.length&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No files changed.`}),e.edits.some(e=>!e.diffs.length)&&(0,B.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`A file without a diff was changed before ForgeQE kept diffs, or is a hidden or credential file, whose text is not kept.`})]})}function He({final:e,answer:t}){let n=e.from===`agent`?t?.files??[]:[],r=e.from!==`agent`,i=Math.max(2,...(e.text.match(/`+/g)||[]).map(e=>e.length)),a="`".repeat(i+1);return(0,B.jsxs)(U,{title:`Final message`,icon:(0,B.jsx)(C,{size:18,"aria-hidden":`true`}),aside:(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.from===`agent`?`The agent's last reply`:e.from===`job`?`The end of the job's output`:`What the command said at the end`}),children:[(0,B.jsx)(Le,{text:r?`${a}text\n${e.text}\n${a}`:we(e.text),height:420}),n.length>0&&(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`text-muted`,children:`Files it names:`}),n.map(e=>(0,B.jsx)(L,{path:e},e))]})]})}var Ue={rule:{icon:oe,label:`Rulebook`},decision:{icon:m,label:`Test decisions`},memory:{icon:de,label:`Page memory`},replay:{icon:v,label:`Replays`},model:{icon:_,label:`Model`},skill:{icon:p,label:`Skills`}};function We({list:e}){let n=Object.keys(Ue).filter(t=>e.some(e=>e.kind===t));return(0,B.jsx)(U,{title:`Learnings`,icon:(0,B.jsx)(t,{icon:se,size:18}),aside:e.length?(0,B.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[e.length,` from this session`]}):void 0,children:e.length===0?(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing learned or decided in this session: no rules, test decisions, page memory or model switches in its log.`}):(0,B.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(280px,1fr))] gap-x-6 gap-y-3`,children:n.map(n=>{let{icon:r,label:i}=Ue[n];return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,B.jsxs)(`h4`,{className:`m-0 flex items-center gap-1.5 text-[13px] font-medium text-muted`,children:[(0,B.jsx)(t,{icon:r,size:14}),i]}),(0,B.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.filter(e=>e.kind===n).map((e,t)=>(0,B.jsxs)(`li`,{className:`flex flex-col gap-0.5 border-t border-line-soft py-1.5 text-sm first:border-t-0`,children:[(0,B.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.text}),e.note&&(0,B.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.note})]},t))})]},n)})})})}function Ge({run:e}){let t=[];return(e.executions.length||e.kind===`execution`)&&t.push({kind:`execution`,node:(0,B.jsx)(Fe,{list:e.executions},`e`)}),(e.reports.length||e.kind===`report`)&&t.push({kind:`report`,node:(0,B.jsx)(Ie,{list:e.reports},`r`)}),e.coding&&(e.coding.edits.length||e.coding.results.length||e.kind===`coding`)&&t.push({kind:`coding`,node:(0,B.jsx)(Ve,{c:e.coding,files:e.files},`c`)}),t.sort((t,n)=>Number(n.kind===e.kind)-Number(t.kind===e.kind)),(0,B.jsx)(B.Fragment,{children:t.map(e=>e.node)})}var Ke={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`}},qe={chat:`Chat`,suite:`Suite`,monitor:`Monitor`,run:`Browser run`,start:`Chat`,heal:`Heal`,"pr-tests":`PR tests`,pack:`Pack`,pipeline:`Pipeline watch`,explore:`Explore`,api:`API tests`,generate:`Generate`,jobs:`Jobs service`},Je=e=>qe[e]||e.charAt(0).toUpperCase()+e.slice(1),G=e=>{if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,...t.getFullYear()===new Date().getFullYear()?{}:{year:`numeric`},hour:`numeric`,minute:`2-digit`})},K=(e,t)=>Math.max(0,Math.round(((e.status===`running`?t:Date.parse(e.lastAt))-Date.parse(e.startedAt))/1e3)),q=e=>Number.isFinite(e)?e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m ${e%60}s`:`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`:`–`,J=e=>e.usage.input+e.usage.output;function Y(e){let[t,n]=(0,z.useState)(Date.now());return(0,z.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function Ye({r:e}){return e.origin.kind===`web`?(0,B.jsxs)(`a`,{href:r(`chats`,e.origin.chat),className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(t,{icon:A,size:14}),`Web chat`]}):e.origin.kind===`job`?(0,B.jsxs)(`a`,{href:r(`jobs`,encodeURIComponent(e.origin.job)),className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(t,{icon:T,size:14}),`Job`]}):(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-muted`,children:[(0,B.jsx)(t,{icon:l,size:14}),`Terminal`]})}function Xe({status:t}){let n=Ke[t].label;return t===`running`?(0,B.jsx)(e,{size:16,"aria-label":n,className:`flex-none animate-spin text-accent-fg`}):t===`done`?(0,B.jsx)(j,{size:16,"aria-label":n,className:`flex-none text-pass`}):t===`failed`?(0,B.jsx)(d,{size:16,"aria-label":n,className:`flex-none text-fail`}):(0,B.jsx)(f,{size:16,"aria-label":n,className:`flex-none text-muted`})}var X=e=>e.status!==`running`&&!e.tools&&!e.turns&&!J(e)&&!e.files.length&&!e.outputs.length&&K(e,0)<2;function Ze(e){return/^forgeqe(-|$)|^engine$/.test(e)?c(e).name:e&&e.charAt(0).toUpperCase()+e.slice(1)}function Z({label:e,children:t}){return(0,B.jsxs)(`div`,{className:`grid grid-cols-[120px_minmax(0,1fr)] items-baseline gap-3 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,B.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:t})]})}function Q({title:e,children:t}){return(0,B.jsxs)(`section`,{className:`flex min-w-0 flex-col`,children:[(0,B.jsx)(`h3`,{className:`m-0 mb-1 text-[14px] font-semibold`,children:e}),t]})}var Qe={rerun:pe,write_test:le,investigate:n,fix_test:D};function $e({actions:e}){let[n,i]=(0,z.useState)(``),[a,o]=(0,z.useState)(``);if(!e.length)return null;let s=async e=>{i(e.prompt),o(``);try{let{id:t}=await fe.start(e.prompt,{});location.hash=r(`chats`,t)}catch(e){o(e.message),i(``)}};return(0,B.jsxs)(`section`,{"aria-label":`Next steps`,className:`flex flex-col gap-2`,children:[(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map((e,r)=>(0,B.jsxs)(S,{disabled:!!n,onClick:()=>void s(e),"data-tip":e.note||void 0,className:`max-w-full min-w-0`,children:[(0,B.jsx)(t,{icon:Qe[e.kind],size:16,className:`flex-none`}),(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:n===e.prompt?`Opening a chat…`:e.label}),e.note&&(0,B.jsx)(`span`,{className:`min-w-0 flex-[1_1_0] truncate font-normal text-ink-2`,children:e.note})]},r))}),(0,B.jsx)(`span`,{className:`text-[12px] text-muted`,children:`Each opens a chat with the request; it asks before it changes anything.`}),a&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:a})]})}var et=e=>`\`${e.replace(/`/g,``)}\``,tt=[`summary`,`conversation`,`activity`,`details`],nt=e=>tt.find(t=>t===e)??`summary`;function rt({name:e,tab:t}){let[n,a]=(0,z.useState)(null),[o,s]=(0,z.useState)(``),[c,l]=(0,z.useState)(!1),d=nt(t),f=t=>location.hash=t===`summary`?r(`runs`,encodeURIComponent(e)):r(`runs`,encodeURIComponent(e),t),p=(0,z.useCallback)(()=>{x.detail(e).then(e=>{a(e),s(``)},e=>s(e.message))},[e]);(0,z.useEffect)(p,[p]);let m=n?.status===`running`;(0,z.useEffect)(()=>{if(!m)return;let e=setInterval(p,2e3);return()=>clearInterval(e)},[p,m]);let h=Y(m),g=(0,z.useMemo)(()=>(n?.events??[]).map(Ce).filter(e=>!!e),[n?.events]),_=async()=>{l(!0),s(``);try{await x.cancel(e),p()}catch(e){s(e.message)}finally{l(!1)}},v=(0,B.jsxs)(`a`,{href:r(`runs`),className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,B.jsx)(re,{size:16,"aria-hidden":`true`}),`All runs`]});if(!n)return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[v,o?(0,B.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:o}):(0,B.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})]});let y=Ke[n.status],b=!n.replies.length,C=!!n.final||n.executions.length>0||n.reports.length>0||!!(n.coding&&(n.coding.edits.length||n.coding.results.length))||n.learnings.length>0||n.outputs.length>0,w=[{id:`summary`,label:`Summary`},{id:`conversation`,label:b?`Command`:`Conversation`,n:n.replies.length||void 0},{id:`activity`,label:`Activity`,n:g.length||void 0},{id:`details`,label:`Details`}],ee=new Set([...n.reports.map(e=>e.path),...n.executions.flatMap(e=>[e.report,e.folder])].filter(Boolean)),T=n.outputs.filter(e=>!ee.has(e.path)),E=n.context?.limit?Math.round(n.context.tokens/n.context.limit*100):null;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[v,(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-3`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,B.jsx)(`h2`,{className:`m-0 min-w-0 text-[22px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:n.title}),(0,B.jsx)(N,{tone:y.tone,children:y.label})]}),(0,B.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-muted`,children:[(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(De,{kind:n.kind}),V[n.kind]]}),`· `,(0,B.jsx)(Ye,{r:n}),`· `,G(n.startedAt),` · `,m?`running for `:`took `,q(K(n,h)),` · `,u(J(n)),` tokens`,n.profile?.model?` · ${n.profile.model}`:``]})]}),n.cancel&&(0,B.jsxs)(S,{variant:`danger`,disabled:c,onClick:()=>void _(),children:[(0,B.jsx)(i,{fill:`currentColor`,"aria-hidden":`true`}),c?`Stopping…`:n.cancel===`chat`?`Stop this chat's work`:`Cancel this job's run`]})]}),o&&(0,B.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:o}),n.error&&(0,B.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[(0,B.jsx)(`strong`,{children:`What went wrong:`}),` `,n.error]}),!m&&(0,B.jsx)($e,{actions:n.actions??[]}),(0,B.jsx)(`div`,{role:`tablist`,"aria-label":`This run`,className:xe,children:w.map(e=>(0,B.jsxs)(`button`,{type:`button`,role:`tab`,id:`run-tab-${e.id}`,"aria-selected":d===e.id,"aria-controls":`run-panel-${e.id}`,onClick:()=>f(e.id),className:be(d===e.id),children:[e.label,e.n!==void 0&&(0,B.jsx)(`span`,{className:`text-[12px] text-muted tabular-nums`,children:e.n})]},e.id))}),(0,B.jsxs)(`div`,{role:`tabpanel`,id:`run-panel-${d}`,"aria-labelledby":`run-tab-${d}`,className:`flex min-w-0 flex-col gap-6`,children:[d===`summary`&&(0,B.jsxs)(B.Fragment,{children:[n.final&&(0,B.jsx)(He,{final:n.final,answer:n.answer}),(0,B.jsx)(Ge,{run:n}),T.length>0&&(0,B.jsx)(Q,{title:`What it produced (${T.length})`,children:T.map(e=>(0,B.jsx)(Z,{label:e.label,children:(0,B.jsx)(L,{path:e.path})},e.path))}),n.learnings.length>0&&(0,B.jsx)(We,{list:n.learnings}),!C&&(0,B.jsx)(k,{className:`py-4`,children:m?`Still working: its answer and what it produces show here when it ends.`:`This run left no answer, results or files. Its Activity shows what it did.`})]}),d===`conversation`&&(b?(0,B.jsx)(R,{text:et(n.prompt),className:`text-sm [&_p]:my-0`}):(0,B.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:n.replies.map((e,t)=>(0,B.jsxs)(`li`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`div`,{className:`self-end rounded-[14px] bg-surface-strong px-4 py-2.5 text-sm max-w-[85%]`,children:(0,B.jsx)(R,{text:e.ask,className:`[&_p]:my-0.5`})}),e.text&&(0,B.jsx)(R,{text:we(e.text),className:`text-sm`}),e.error&&(0,B.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e.error})]},t))})),d===`activity`&&(n.archived?(0,B.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-3 text-sm text-ink-2`,children:[`ForgeQE keeps the newest session logs only, and this run's is gone. Its summary, final message and learnings were kept in `,(0,B.jsx)(`code`,{className:`font-mono text-[13px]`,children:`.forgeqe/runs`}),`; its step-by-step activity was not.`]}):g.length?(0,B.jsx)(ye,{timeline:!0,lines:g,start:n.startedAt,live:m,name:`forgeqe-run-${n.name.replace(/\.log$/,``)}.md`}):(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing logged yet.`})),d===`details`&&(0,B.jsxs)(`div`,{className:`grid items-start gap-x-12 gap-y-8 @3xl:grid-cols-2`,children:[(0,B.jsxs)(Q,{title:`Numbers`,children:[(0,B.jsx)(Z,{label:m?`Running for`:`Took`,children:q(K(n,h))}),(0,B.jsx)(Z,{label:`Tokens`,children:(0,B.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,B.jsxs)(`span`,{children:[u(J(n)),` `,(0,B.jsxs)(`span`,{className:`text-muted`,children:[`· `,u(n.usage.input),` read · `,u(n.usage.output),` written`,n.usage.cached?` · ${u(n.usage.cached)} cached`:``]})]}),(n.byAgent?.length??0)>1&&(0,B.jsx)(`span`,{className:`flex flex-col gap-0.5 text-[13px]`,children:n.byAgent.map(e=>(0,B.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-2`,children:Ze(e.agent)}),(0,B.jsx)(`span`,{className:`text-muted tabular-nums`,children:u(e.input+e.output)})]},e.agent))})]})}),(0,B.jsxs)(Z,{label:`Context`,children:[n.context?u(n.context.tokens):`–`,E!==null&&(0,B.jsxs)(`span`,{className:`text-muted`,children:[` of `,u(n.context.limit),` (`,E,`%)`]})]}),(0,B.jsxs)(Z,{label:`Tool calls`,children:[n.tools,` `,(0,B.jsxs)(`span`,{className:`text-muted`,children:[`in `,P(n.turns,`turn`)]})]})]}),(0,B.jsxs)(Q,{title:`Session`,children:[(0,B.jsx)(Z,{label:`Started by`,children:(0,B.jsx)(Ye,{r:n})}),(0,B.jsx)(Z,{label:`Command`,children:Je(n.command)}),(0,B.jsx)(Z,{label:`Model`,children:n.profile?[n.profile.name,n.profile.model].filter(Boolean).join(` · `):`–`}),(0,B.jsx)(Z,{label:`Agents`,children:n.agents.length?(0,B.jsx)(`span`,{className:`flex flex-col gap-0.5`,children:n.agents.map(e=>(0,B.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:Ze(e.name)}),(0,B.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:P(e.calls,`call`)})]},e.name))}):(0,B.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,B.jsxs)(Z,{label:`Log`,children:[n.archived?(0,B.jsx)(`span`,{className:`text-muted`,children:`No longer kept: ForgeQE keeps the newest logs only`}):(0,B.jsx)(L,{path:`.forgeqe/logs/${n.name}`}),n.truncated&&(0,B.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Very long: only its start is shown.`})]})]}),n.job&&(0,B.jsxs)(Q,{title:`Job`,children:[(0,B.jsx)(Z,{label:`Job`,children:(0,B.jsx)(`a`,{href:r(`jobs`,encodeURIComponent(n.origin.kind===`job`?n.origin.job:n.job.name)),children:n.job.name})}),(0,B.jsx)(Z,{label:`Runs`,children:(0,B.jsx)(R,{text:et(n.job.command),className:`text-sm [&_p]:my-0`})}),(0,B.jsxs)(Z,{label:`Schedule`,children:[n.job.schedule,!n.job.enabled&&` (disabled)`,n.job.nextAt&&n.job.enabled?` · next ${G(n.job.nextAt)}`:``]}),n.job.run&&(0,B.jsxs)(Z,{label:`This run`,children:[n.job.run.reason===`asked`?`Asked for`:`On schedule`,`, `,n.job.run.status.replace(`_`,` `),n.job.run.exitCode!==void 0&&n.job.run.exitCode!==null?`, exit ${n.job.run.exitCode}`:``]})]}),(0,B.jsx)(Q,{title:`Files worked on (${n.files.length})`,children:n.files.length?[...n.files].sort((e,t)=>Number(e.action===`read`)-Number(t.action===`read`)).map(e=>(0,B.jsx)(Z,{label:e.action===`write`?`Written`:e.action===`edit`?`Edited`:e.action===`delete`?`Deleted`:e.action?e.action.charAt(0).toUpperCase()+e.action.slice(1):`Changed`,children:e.action===`delete`?(0,B.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.path}):(0,B.jsx)(L,{path:e.path})},e.path)):(0,B.jsx)(`p`,{className:`m-0 py-1 text-sm text-muted`,children:`No files changed.`})}),(0,B.jsx)(Q,{title:`Notifications`,children:n.notifications.length?n.notifications.map(e=>(0,B.jsx)(Z,{label:e.event.replace(/_/g,` `),children:e.channels.length?e.channels.join(`, `):(0,B.jsx)(`span`,{className:`text-muted`,children:`No channel takes it`})},e.event)):(0,B.jsx)(`p`,{className:`m-0 py-1 text-sm text-muted`,children:n.origin.kind===`terminal`||n.origin.kind===`web`?`None: notify channels go with jobs, suites and the monitor.`:`No notify channels are set up (Settings, Notify).`})})]})]})]})}var $=25;function it({runs:e}){let t=Y(e.some(e=>e.status===`running`)),[n,i]=(0,z.useState)(``),[a,o]=(0,z.useState)(`all`),[s,c]=(0,z.useState)(``),[l,d]=(0,z.useState)(``),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(0);(0,z.useEffect)(()=>h(0),[n,a,s,l,f]);let _=e.filter(X).length,v=n.toLowerCase().split(/\s+/).filter(Boolean),y=e.filter(e=>(f||!X(e))&&(!s||e.kind===s)&&(!l||e.origin.kind===l)&&v.every(t=>`${e.title} ${e.command} ${e.error||``}`.toLowerCase().includes(t))),x={all:y.length,running:y.filter(e=>e.status===`running`).length,failed:y.filter(e=>e.status===`failed`).length},S=a===`all`?y:y.filter(e=>e.status===a),C=Math.max(1,Math.ceil(S.length/$)),w=Math.min(m,C-1),T=S.slice(w*$,w*$+$),D=e.filter(e=>e.status!==`running`&&!X(e)),O=D.filter(e=>e.status===`failed`).length,A=D.length?D.reduce((e,n)=>e+K(n,t),0)/D.length:NaN,te=e.reduce((e,t)=>e+J(t),0),j=[...new Set(e.map(e=>e.kind))],M=[...new Set(e.map(e=>e.origin.kind))],N={web:`Web chat`,job:`Job`,terminal:`Terminal`};return e.length===0?(0,B.jsx)(k,{icon:b,title:`No runs yet`,action:(0,B.jsx)(`a`,{className:g({size:`sm`}),href:r(),children:`Start a chat`}),children:`A chat here, a job, or a ForgeQE command in this project adds one.`}):(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-1 text-[13px] text-muted`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-ink tabular-nums`,children:e.length-_}),` runs`]}),e.some(e=>e.status===`running`)&&(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-accent-fg tabular-nums`,children:e.filter(e=>e.status===`running`).length}),` running now`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:F(`tabular-nums`,O?`text-fail`:`text-ink`),children:O}),` failed`,D.length?` (${Math.round(O/D.length*100)}%)`:``]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-ink tabular-nums`,children:u(te)}),` tokens`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-ink tabular-nums`,children:q(Math.round(A))}),` on average`]})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(E,{id:`run-search`,label:`Find a run`,value:n,onChange:i,placeholder:`Find a run by what was asked`}),(0,B.jsx)(ee,{items:[{id:`all`,label:`All`,n:x.all},{id:`running`,label:`Running`,n:x.running},{id:`failed`,label:`Failed`,n:x.failed,alert:!0}],value:a,onChange:o}),j.length>1&&(0,B.jsxs)(ue,{size:`sm`,"aria-label":`What it did`,value:s,onChange:e=>c(e.target.value),className:`w-auto pr-7 pl-3`,children:[(0,B.jsx)(`option`,{value:``,children:`Any kind`}),j.map(e=>(0,B.jsx)(`option`,{value:e,children:V[e]},e))]}),M.length>1&&(0,B.jsxs)(ue,{size:`sm`,"aria-label":`Started by`,value:l,onChange:e=>d(e.target.value),className:`w-auto pr-7 pl-3`,children:[(0,B.jsx)(`option`,{value:``,children:`Started anywhere`}),M.map(e=>(0,B.jsx)(`option`,{value:e,children:N[e]||e},e))]})]}),(0,B.jsxs)(`div`,{className:`rounded-[14px] card border`,children:[(0,B.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[auto_minmax(0,1fr)_104px_104px_72px_64px_92px] items-center gap-x-4 border-b border-line-soft px-4 py-2 text-[12px] font-semibold text-muted @3xl:grid`,children:[(0,B.jsx)(`span`,{className:`w-4`}),(0,B.jsx)(`span`,{children:`Run`}),(0,B.jsx)(`span`,{children:`Kind`}),(0,B.jsx)(`span`,{children:`Started by`}),(0,B.jsx)(`span`,{className:`text-right`,children:`Took`}),(0,B.jsx)(`span`,{className:`text-right`,children:`Tokens`}),(0,B.jsx)(`span`,{className:`text-right`,children:`When`})]}),(0,B.jsxs)(`ul`,{"aria-label":`Runs`,className:`m-0 list-none p-1.5`,children:[T.length===0&&(0,B.jsx)(`li`,{className:`px-3 py-4 text-sm text-muted`,children:`Nothing matches.`}),T.map((e,n)=>{let i=he(e.startedAt);return(0,B.jsxs)(`li`,{className:`contents`,children:[(n===0||he(T[n-1].startedAt)!==i)&&(0,B.jsx)(`span`,{className:`block px-3 pt-3 pb-1 text-[12px] font-semibold text-muted`,children:i}),(0,B.jsxs)(`a`,{href:r(`runs`,encodeURIComponent(e.name)),className:`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 rounded-[10px] px-3 py-1.5 text-ink no-underline hover:bg-surface-muted hover:text-ink @3xl:grid-cols-[auto_minmax(0,1fr)_104px_104px_72px_64px_92px] @3xl:gap-x-4`,children:[(0,B.jsx)(Xe,{status:e.status}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,B.jsx)(`span`,{className:`truncate text-[14px] font-medium`,"data-tip":e.title,children:e.title}),e.error?(0,B.jsx)(`span`,{className:`truncate text-[12px] text-fail`,children:e.error}):(0,B.jsx)(`span`,{className:`truncate text-[12px] text-muted @3xl:hidden`,children:[V[e.kind],N[e.origin.kind],q(K(e,t)),`${u(J(e))} tokens`].join(` · `)})]}),(0,B.jsxs)(`span`,{className:`hidden min-w-0 items-center gap-1.5 text-[13px] text-ink-2 @3xl:inline-flex`,children:[(0,B.jsx)(De,{kind:e.kind}),V[e.kind]]}),(0,B.jsx)(`span`,{className:`hidden text-[13px] text-ink-2 @3xl:block`,children:N[e.origin.kind]||e.origin.kind}),(0,B.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:q(K(e,t))}),(0,B.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:u(J(e))}),(0,B.jsx)(`span`,{className:`text-right text-[12.5px] text-muted tabular-nums`,"data-tip":G(e.startedAt),children:_e(e.startedAt)})]})]},e.name)})]}),(0,B.jsx)(ae,{page:w,size:$,total:S.length,onPage:h,label:`Pages of runs`,children:_>0&&(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`button`,{type:`button`,onClick:()=>p(!f),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:f?`Hide the ${P(_,`empty session`)}`:`${P(_,`empty session`)} hidden`})]})})]})]})}function at({sub:e}){let[t,n]=(0,z.useState)(null),[r,i]=(0,z.useState)(``),a=(0,z.useCallback)(()=>{x.list().then(e=>{n(e.runs),i(``)},e=>i(e.message))},[]);(0,z.useEffect)(a,[a]);let o=t?.some(e=>e.status===`running`);(0,z.useEffect)(()=>{if(e)return;let t=setInterval(a,o?3e3:2e4);return()=>clearInterval(t)},[a,o,e]);let[c,l]=(e||``).split(`/`),u=c?decodeURIComponent(c):``;return(0,B.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,B.jsx)(ne,{}),(0,B.jsx)(`main`,{className:F(ge,`@container flex-auto gap-4`),children:u?(0,B.jsx)(rt,{name:u,tab:l},u):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(s,{pixel:O.runs,size:`lg`}),(0,B.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Runs`})]}),(0,B.jsx)(Se,{label:`Runs and reports`,links:Te,current:`runs`})]}),(0,B.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`Every ForgeQE session in this project: chats here, jobs' runs, and commands typed in a terminal, newest first. Open one for how it went and what it produced.`}),r&&(0,B.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r}),!t&&!r&&(0,B.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,B.jsx)(it,{runs:t})]})})]})}export{at as Runs,Xe as StatusIcon,nt as runTab};
|