@capagents/forgeqe 3.1.9 → 3.2.0
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 +18 -2
- package/THIRD_PARTY_NOTICES.md +2 -1
- package/dist/docs-site/docs/area-quality/index.html +17 -3
- package/dist/docs-site/docs/area-setup/index.html +1 -1
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/forgeqe.js +1878 -1875
- package/dist/template.html +12 -12
- package/dist/vendor/ibm-ace.js +2 -0
- package/dist/web/assets/{3d-force-graph-CGHQthr3.js → 3d-force-graph-Bhmgjf_7.js} +1 -1
- package/dist/web/assets/Agent-Dx4aOB_h.js +8 -0
- package/dist/web/assets/{AgentWork-DEZVZTuJ.js → AgentWork-D0MS10up.js} +2 -2
- package/dist/web/assets/ApiTests-DUoEh0nX.js +10 -0
- package/dist/web/assets/Browse-BGgyLuL3.js +1 -0
- package/dist/web/assets/Chat-CEHUI2ty.js +3 -0
- package/dist/web/assets/{CommandPalette-sokhT5PA.js → CommandPalette-rY8rp79k.js} +1 -1
- package/dist/web/assets/{Compare-ChWSXkvf.js → Compare-B_NCvogR.js} +1 -1
- package/dist/web/assets/Cost-sm-6tWRQ.js +1 -0
- package/dist/web/assets/Data-CFyxbwPS.js +6 -0
- package/dist/web/assets/Desktop-A_D4LTis.js +1 -0
- package/dist/web/assets/DesktopReview-CM7xmpHS.js +2 -0
- package/dist/web/assets/Evidence-BlTkmzfE.js +1 -0
- package/dist/web/assets/Explore-DyGqAEff.js +2 -0
- package/dist/web/assets/Features-BjPR9gCe.js +1 -0
- package/dist/web/assets/Flags-C_DneXS9.js +2 -0
- package/dist/web/assets/Flaky-l5ugC_ER.js +1 -0
- package/dist/web/assets/Impact-7TXQHcsW.js +3 -0
- package/dist/web/assets/Jobs-xRLNI-8l.js +5 -0
- package/dist/web/assets/KindPage-BZu1Zo4S.js +6 -0
- package/dist/web/assets/Migration-DKsyDwDO.js +8 -0
- package/dist/web/assets/Observability-CVwKJ-fI.js +1 -0
- package/dist/web/assets/PageAgent-C1X5ot6v.js +1 -0
- package/dist/web/assets/Product-iHqLyIhD.js +12 -0
- package/dist/web/assets/Production-C8eGcwCi.js +1 -0
- package/dist/web/assets/Quality-BVsN6u0E.js +1 -0
- package/dist/web/assets/Readiness-BWlbiTeu.js +1 -0
- package/dist/web/assets/Record-C7qgNFqs.js +1 -0
- package/dist/web/assets/Regression-ChleHlqe.js +5 -0
- package/dist/web/assets/{RelationGraph-CeBfmWYf.js → RelationGraph-CzR_Hs8A.js} +1 -1
- package/dist/web/assets/Reports-CIcKyoHH.js +2 -0
- package/dist/web/assets/Response-D2ZeO8uW.js +9 -0
- package/dist/web/assets/Responsive-DCfw-Oz3.js +3 -0
- package/dist/web/assets/{RunDiff-T4e0xs_5.js → RunDiff-COaxhvKm.js} +1 -1
- package/dist/web/assets/Runs-3qx2qf56.js +2 -0
- package/dist/web/assets/Settings-DG2k3Lno.js +21 -0
- package/dist/web/assets/Steps-CN4n8U1I.js +3 -0
- package/dist/web/assets/TestCases-BEfJFp5h.js +1 -0
- package/dist/web/assets/TestData-SO2qqaAF.js +2 -0
- package/dist/web/assets/{TestDebt-WuBkOmz5.js → TestDebt-DIYhbhjh.js} +1 -1
- package/dist/web/assets/TestManagement-D7q6G3YN.js +4 -0
- package/dist/web/assets/WhatsNew-DqBLhhgk.js +1 -0
- package/dist/web/assets/{coverage-CWE1aatw.js → coverage-DCtiu73T.js} +4 -4
- package/dist/web/assets/{dataParts-ClIBv7-8.js → dataParts-BdmBLsU9.js} +3 -3
- package/dist/web/assets/{diff-CZ0iWWGv.js → diff-DEgLgw6R.js} +1 -1
- package/dist/web/assets/families-CrnKBjis.js +1 -0
- package/dist/web/assets/{highlight-CGRzYrMa.js → highlight-DSLpJ_Dq.js} +1 -1
- package/dist/web/assets/index-DAteDsgB.css +2 -0
- package/dist/web/assets/index-RJ1kEHuo.js +64 -0
- package/dist/web/assets/{input-1RVqxCVH.js → input-Be3YOEK2.js} +1 -1
- package/dist/web/assets/logLevel-Dq8s6DZz.js +3 -0
- package/dist/web/assets/palette-Dcoz5crU.js +1 -0
- package/dist/web/assets/{paletteCommands-DU0boMQR.js → paletteCommands-fwv5XVOS.js} +1 -1
- package/dist/web/assets/{parts-CTmOGb8E.js → parts-CkI14hIv.js} +1 -1
- package/dist/web/assets/productParts-BOUMBM_H.js +1 -0
- package/dist/web/assets/qualityParts-8KI3JCY8.js +1 -0
- package/dist/web/assets/{recordTest-H42EwQYC.js → recordTest-kf2ykEQF.js} +1 -1
- package/dist/web/assets/{route-Mq0QZuqV.js → route-D8G-pTdk.js} +1 -1
- package/dist/web/assets/{stepper-ceEfHcbV.js → stepper-CQSK6KS0.js} +1 -1
- package/dist/web/index.html +6 -6
- package/docs/user-guide.html +17 -3
- package/forgeqe.example.yaml +2 -1
- package/package.json +2 -1
- package/prompts/browser-persona.md +1 -1
- package/py/forgeqe_engine/diagnostics.py +119 -2
- package/py/forgeqe_engine/persona.py +3 -2
- package/py/forgeqe_engine/service.py +4 -1
- package/dist/web/assets/Agent-lzvUoYv1.js +0 -8
- package/dist/web/assets/ApiTests-k9bR9dXo.js +0 -10
- package/dist/web/assets/Browse-4bm1SVvY.js +0 -1
- package/dist/web/assets/Chat-CbyylnvP.js +0 -3
- package/dist/web/assets/Cost-DlZnyY_C.js +0 -1
- package/dist/web/assets/Data-CElI9cSA.js +0 -6
- package/dist/web/assets/Desktop-YtONOq0M.js +0 -1
- package/dist/web/assets/DesktopReview-CldegMwj.js +0 -2
- package/dist/web/assets/Evidence-B9wlQQy6.js +0 -1
- package/dist/web/assets/Explore-Cp3eqrm2.js +0 -2
- package/dist/web/assets/Features-ySmycsYI.js +0 -1
- package/dist/web/assets/Flags-CnjZtCU3.js +0 -2
- package/dist/web/assets/Flaky-D7VtH51H.js +0 -1
- package/dist/web/assets/Impact-Dx1cn9WD.js +0 -3
- package/dist/web/assets/Jobs-BwfvwxGd.js +0 -5
- package/dist/web/assets/KindPage-BHGa8zq7.js +0 -6
- package/dist/web/assets/Migration-f-gLkpSC.js +0 -4
- package/dist/web/assets/Observability-CibZbiOA.js +0 -1
- package/dist/web/assets/PageAgent-UTRXl1j4.js +0 -1
- package/dist/web/assets/Product-LJxwGFzs.js +0 -12
- package/dist/web/assets/Production-DXwaHzaa.js +0 -1
- package/dist/web/assets/Quality-Di4cF4nd.js +0 -1
- package/dist/web/assets/Readiness-Bu1OXgnc.js +0 -1
- package/dist/web/assets/Record-olwaN1G1.js +0 -1
- package/dist/web/assets/Regression-DBu-34b_.js +0 -5
- package/dist/web/assets/Reports-hoagfsmM.js +0 -2
- package/dist/web/assets/Response-CJSq1qN7.js +0 -9
- package/dist/web/assets/Responsive-DYhEQEpT.js +0 -3
- package/dist/web/assets/Runs-CcG9BELK.js +0 -2
- package/dist/web/assets/Settings-lWl74aQY.js +0 -21
- package/dist/web/assets/Steps-BefTJLTB.js +0 -3
- package/dist/web/assets/TestCases-CyzfvT_X.js +0 -1
- package/dist/web/assets/TestData-DSusRbgZ.js +0 -2
- package/dist/web/assets/TestManagement-HwkjrA4a.js +0 -4
- package/dist/web/assets/WhatsNew-B-w1pGj6.js +0 -1
- package/dist/web/assets/families-CfIM4f2s.js +0 -1
- package/dist/web/assets/index-Cg0SmlXN.js +0 -64
- package/dist/web/assets/index-tPgJ7dv2.css +0 -2
- package/dist/web/assets/logLevel-CFPS8IkY.js +0 -3
- package/dist/web/assets/palette-5nApQc76.js +0 -1
- package/dist/web/assets/productParts-CL2E8Uaf.js +0 -1
- package/dist/web/assets/qualityParts-CnlpML55.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Bt as n,Gr as r,H as i,I as a,L as o,Vn as s,_n as c,ft as l,r as u,xt as d}from"./route-Mq0QZuqV.js";import{t as f}from"./jsx-runtime-LKYXHABd.js";import{A as p,Dt as m,j as h,n as g}from"./input-1RVqxCVH.js";import{C as _,D as v,O as y,a as b,s as x,t as S,w as C}from"./logLevel-CFPS8IkY.js";import{L as w}from"./palette-5nApQc76.js";import{F as T,Fn as E,Ft as D,I as O,It as k,Pn as A,Pt as j,Xt as M,Yt as N,b as P,ft as F,ut as I,xn as L,z as R}from"./index-Cg0SmlXN.js";import{n as z}from"./families-CfIM4f2s.js";var B=e(r(),1),V=f(),H={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`Mobile run`,page:`Report page`},U=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`})},W=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 G(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 K=50;function q({r:e}){let t=G(e),n=e.scope===`page`?d:t.tone===`pass`?a:t.tone===`fail`?i:o;return(0,V.jsx)(n,{size:16,"aria-label":t.label,className:p(`flex-none`,t.tone===`pass`?`text-pass`:t.tone===`fail`?`text-fail`:t.tone===`warn`?`text-warn`:`text-muted`)})}var J=e=>{let t=new Date(`${e}T12:00:00`);return Number.isNaN(t.getTime())?e:t.toLocaleDateString([],{day:`numeric`,month:`short`})},Y=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 X({title:e,note:t,children:n,className:r}){return(0,V.jsxs)(`section`,{className:p(`flex min-w-0 flex-col rounded-[14px] card border px-4 py-4`,r),children:[(0,V.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold`,children:e}),t&&(0,V.jsx)(`p`,{className:`m-0 mt-1 text-[13px] text-muted`,children:t}),(0,V.jsx)(`div`,{className:`mt-4 flex min-w-0 flex-col`,children:n})]})}function Z({part:e,whole:t,tone:n,label:r}){return(0,V.jsxs)(`span`,{className:`flex flex-none items-center gap-2`,children:[(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-16 flex-none overflow-hidden rounded-full bg-surface-strong`,children:(0,V.jsx)(`span`,{className:p(`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,V.jsx)(`span`,{className:`text-[13px] whitespace-nowrap text-ink-2 tabular-nums`,children:r})]})}function Q({days:e}){let[t,n]=(0,B.useState)(null),r=e.slice(-30);if(!r.length)return(0,V.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,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsxs)(`div`,{"aria-hidden":`true`,className:`flex gap-4 text-[13px] text-ink-2`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`size-2.5 rounded-[3px] bg-pass`}),` Passed`]}),(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`size-2.5 rounded-[3px] bg-fail`}),` Failed`]})]}),(0,V.jsxs)(`div`,{className:`relative grid grid-cols-[32px_minmax(0,1fr)] gap-x-2`,children:[(0,V.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-[180px] flex-col justify-between text-right text-[13px] text-muted tabular-nums`,children:s.map(e=>(0,V.jsx)(`span`,{className:`-translate-y-1/2 first:translate-y-0 last:translate-y-0`,children:e},e))}),(0,V.jsxs)(`div`,{className:`relative h-[180px]`,onMouseLeave:()=>n(null),children:[s.map((e,t)=>(0,V.jsx)(`span`,{"aria-hidden":`true`,className:p(`absolute inset-x-0 border-t`,t===s.length-1?`border-line`:`border-line-soft`),style:{top:`${(1-e/o)*100}%`}},e)),(0,V.jsx)(`div`,{className:`absolute inset-0 flex items-end gap-1`,children:r.map((e,r)=>{let i=e.cases-e.passed;return(0,V.jsx)(`div`,{className:`flex h-full min-w-0 flex-1 cursor-default flex-col justify-end`,onMouseEnter:()=>n(r),children:(0,V.jsxs)(`div`,{className:p(`flex w-full flex-col justify-end gap-1 transition-opacity`,t!==null&&t!==r&&`opacity-50`),style:{height:`${e.cases/o*100}%`},children:[i>0&&(0,V.jsx)(`span`,{className:`min-h-[2px] w-full rounded-t-[4px] bg-fail`,style:{flexGrow:i}}),e.passed>0&&(0,V.jsx)(`span`,{className:p(`min-h-[2px] w-full bg-pass`,!i&&`rounded-t-[4px]`),style:{flexGrow:e.passed}})]})},e.day)})}),l&&(0,V.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-surface-muted px-4 py-2 text-[13px] shadow-composer`,style:{left:`${Math.min(88,Math.max(12,(t+.5)/r.length*100))}%`,top:`${(1-l.cases/o)*100}%`},children:[(0,V.jsx)(`b`,{className:`block text-ink`,children:J(l.day)}),(0,V.jsxs)(`span`,{className:`block text-ink-2 tabular-nums`,children:[l.passed,` passed, `,l.cases-l.passed,` failed · `,Y([l]),`%`]}),(0,V.jsx)(`span`,{className:`block text-muted`,children:h(l.runs,`run`)})]})]}),(0,V.jsx)(`span`,{}),(0,V.jsx)(`div`,{"aria-hidden":`true`,className:`mt-1 flex gap-1 text-[13px] text-muted`,children:r.map((e,t)=>(0,V.jsx)(`span`,{className:`min-w-0 flex-1 text-center whitespace-nowrap`,children:t%c===0&&(0,V.jsx)(`span`,{className:p(t/c%2==1&&`hidden @2xl:inline`),children:J(e.day)})},e.day))})]}),(0,V.jsxs)(`table`,{className:`sr-only`,children:[(0,V.jsx)(`caption`,{children:`Cases by day`}),(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{scope:`col`,children:`Day`}),(0,V.jsx)(`th`,{scope:`col`,children:`Runs`}),(0,V.jsx)(`th`,{scope:`col`,children:`Passed`}),(0,V.jsx)(`th`,{scope:`col`,children:`Failed`})]})}),(0,V.jsx)(`tbody`,{children:r.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{children:e.day}),(0,V.jsx)(`td`,{children:e.runs}),(0,V.jsx)(`td`,{children:e.passed}),(0,V.jsx)(`td`,{children:e.cases-e.passed})]},e.day))})]})]})}function $({project:e,build:t,onBuilt:r}){let[a,o]=(0,B.useState)(t),[d,f]=(0,B.useState)(``),g=!!a?.running;(0,B.useEffect)(()=>{if(!g)return;let e=E(async()=>{try{let e=await m.buildStatus();o(e),e&&!e.running&&r()}catch{}},1200);return()=>A(e)},[g,r]);let b=e.cases?Math.round(e.passed/e.cases*100):null,w=Y(e.days.slice(-7)),T=Y(e.days.slice(-14,-7)),O=w!==null&&T!==null?w-T:null,k=[{label:`Runs`,value:String(e.runs),sub:e.runs?`${J(String(e.from).slice(0,10))} – ${J(String(e.to).slice(0,10))}`:void 0},{label:`Cases run`,value:String(e.cases),sub:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`text-pass`,children:[e.passed,` passed`]}),` · `,(0,V.jsxs)(`span`,{className:p(e.failed&&`text-fail`),children:[e.failed,` failed`]})]})},{label:`Tokens`,value:F(e.tokens),sub:e.cost?I(e.cost.amount,e.cost.currency):void 0}];return(0,V.jsxs)(`section`,{"aria-labelledby":`project-h`,className:`flex min-w-0 flex-col gap-4`,children:[(0,V.jsx)(`h2`,{id:`project-h`,className:`sr-only`,children:`Project report`}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-[1_1_240px] text-[13px] text-muted`,children:e.page?`The HTML report was built ${U(e.page.builtAt)}.`:`Every run, taken together. The HTML report has not been built yet.`}),e.page&&(0,V.jsxs)(v,{size:`sm`,"data-tip":`Open the HTML report`,onClick:async()=>f(await _(e.page.file)),children:[(0,V.jsx)(l,{"aria-hidden":`true`}),`Report`]}),(0,V.jsx)(v,{size:`sm`,variant:`outline`,disabled:g,"data-tip":e.page?`Build the HTML report again`:`Build the HTML report`,onClick:async()=>{f(``);try{o(await m.build())}catch(e){f(e.message)}},children:g?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(C,{state:`working`,px:14}),`Building…`]}):e.page?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(s,{"aria-hidden":`true`}),`Rebuild`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(n,{"aria-hidden":`true`}),`Build`]})})]}),d&&(0,V.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:d}),a&&(a.running||a.ok===!1)&&(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[!a.running&&(0,V.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:`forgeqe bi build stopped with a problem; its output is below.`}),(0,V.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-4 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:(0,V.jsx)(S,{text:a.lines.length?a.lines.join(`
|
|
2
|
-
`):`Starting…`})})]}),e.runs?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(D,{label:`Project numbers`,children:[(0,V.jsx)(j,{label:`Pass rate`,big:!0,value:b===null?`–`:`${b}%`,tone:b!==null&&b<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,V.jsx)(j,{label:e.label,value:e.value,note:e.sub},e.label))]}),(0,V.jsx)(X,{title:`Cases by day`,note:`The last ${h(Math.min(30,e.days.length),`day`)} with runs. Hover a day for its pass rate.`,children:(0,V.jsx)(Q,{days:e.days})}),(0,V.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,V.jsx)(X,{title:`Fails most`,note:`Cases that failed in the most runs.`,children:e.failing.length===0?(0,V.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`No case has failed.`}):(0,V.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.failing.slice(0,8).map(e=>(0,V.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,V.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(i,{size:14,"aria-hidden":`true`,className:`flex-none text-fail`}),(0,V.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,"data-tip":e.title,children:[e.id&&(0,V.jsx)(`span`,{className:`font-mono text-[13px] text-ink-2`,children:e.id}),` `,e.title]}),(0,V.jsx)(`span`,{className:`flex-none text-[13px] text-muted`,children:N(e.lastFailed)})]}),(0,V.jsxs)(`span`,{className:`flex min-w-0 items-center gap-4 pl-6`,children:[(0,V.jsx)(Z,{part:e.failed,whole:e.runs,tone:`fail`,label:`failed ${e.failed} of ${e.runs}`}),e.summary&&(0,V.jsx)(`span`,{className:`min-w-0 truncate text-[13px] text-muted`,children:e.summary.replace(/[*_`#>[\]]/g,``)})]})]},e.id||e.title))})}),(0,V.jsx)(X,{title:`Defects`,note:`Failures grouped by their cause.`,children:e.defects.length===0?(0,V.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`None found.`}):(0,V.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.defects.slice(0,8).map(e=>(0,V.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,V.jsx)(`span`,{className:`min-w-0 truncate text-[13px]`,"data-tip":e.title,children:e.title}),(0,V.jsxs)(`span`,{className:`text-[13px] whitespace-nowrap text-muted tabular-nums`,children:[h(e.cases,`case`),` · `,h(e.runs,`run`),e.lastSeen?` · ${N(e.lastSeen)}`:``]})]},e.title))})}),(0,V.jsx)(X,{title:`Flaky`,note:`Cases that both passed and failed.`,children:e.flaky.length===0?(0,V.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`None.`}):(0,V.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.flaky.slice(0,8).map(e=>(0,V.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,V.jsxs)(`span`,{className:`min-w-0 truncate text-[13px]`,"data-tip":e.title,children:[e.id&&(0,V.jsx)(`span`,{className:`font-mono text-[13px] text-ink-2`,children:e.id}),` `,e.title]}),(0,V.jsx)(Z,{part:e.failed,whole:e.runs,tone:`fail`,label:`${e.failed}/${e.runs} failed`})]},e.id||e.title))})}),(0,V.jsx)(X,{title:`By kind`,note:`Each kind of run and how often its cases passed.`,children:e.kinds.length===0?(0,V.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`No runs with results yet.`}):(0,V.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.kinds.map(e=>(0,V.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,V.jsx)(`span`,{className:`min-w-0 truncate text-[13px]`,children:H[e.scope]||e.scope}),(0,V.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:h(e.runs,`run`)}),(0,V.jsx)(Z,{part:e.passed,whole:e.cases,tone:`pass`,label:e.cases?`${Math.round(e.passed/e.cases*100)}% passed`:`no cases`})]},e.scope))})})]})]}):(0,V.jsx)(x,{icon:l,title:`No runs yet`,action:(0,V.jsxs)(`a`,{className:y({size:`sm`}),href:u(),"data-tip":`Start a chat`,children:[(0,V.jsx)(c,{"aria-hidden":`true`}),`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 ee({sub:e}){let[n,r]=(0,B.useState)(null),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),[c,u]=(0,B.useState)(``),[d,f]=(0,B.useState)(`all`),[h,y]=(0,B.useState)(K),[x,S]=(0,B.useState)(``),C=(0,B.useCallback)(()=>{m.list().then(r,e=>a(e.message))},[]);(0,B.useEffect)(C,[C]);let E=e===`project`?`project`:`execution`,D=n?.rows??null,A=c.toLowerCase().split(/\s+/).filter(Boolean),j=(0,B.useMemo)(()=>(D||[]).filter(e=>(!o||e.scope===o)&&A.every(t=>`${e.title} ${e.id} ${H[e.scope]}`.toLowerCase().includes(t))),[D,o,c]),F=j.filter(e=>G(e).tone===`fail`).length,I=d===`failed`?j.filter(e=>G(e).tone===`fail`):j;(0,B.useEffect)(()=>y(K),[o,c,d]);let J=[...new Set((D||[]).map(e=>e.scope))];return(0,V.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,V.jsx)(R,{}),(0,V.jsxs)(`main`,{className:p(O,`@container flex-auto gap-4`),children:[(0,V.jsx)(T,{}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-6 gap-y-2`,children:[(0,V.jsx)(L,{pixel:w.reports,size:`lg`}),(0,V.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Reports`}),(0,V.jsx)(k,{label:`Runs and reports`,links:z,current:E===`project`?`reports-project`:`reports`})]}),i&&(0,V.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:i}),!n&&!i&&(0,V.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),n&&E===`project`&&(0,V.jsx)($,{project:n.project,build:n.build,onBuilt:C}),n&&E===`execution`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.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,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(b,{id:`report-search`,label:`Find a report`,value:c,onChange:u}),[[`all`,`All`,j.length],[`failed`,`Failed`,F]].map(([e,t,n])=>(0,V.jsxs)(`button`,{type:`button`,"aria-pressed":d===e,onClick:()=>f(e),className:p(`inline-flex min-h-8 cursor-pointer items-center gap-1 rounded-[8px] border px-4 text-[13px] font-medium`,d===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,V.jsx)(`span`,{className:p(`tabular-nums`,e===`failed`&&n?`text-fail`:``),children:n})]},e)),J.length>1&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`label`,{htmlFor:`report-kind`,className:`sr-only`,children:`Kind`}),(0,V.jsxs)(g,{size:`sm`,id:`report-kind`,value:o,onChange:e=>s(e.target.value),className:`w-auto pr-8 pl-4`,children:[(0,V.jsx)(`option`,{value:``,children:`Every kind`}),J.map(e=>(0,V.jsx)(`option`,{value:e,children:H[e]},e))]})]})]}),x&&(0,V.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:x}),(0,V.jsxs)(`div`,{className:`rounded-[14px] card border`,children:[(0,V.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-[13px] font-semibold text-muted @3xl:grid`,children:[(0,V.jsx)(`span`,{children:`Report`}),(0,V.jsx)(`span`,{children:`Kind`}),(0,V.jsx)(`span`,{children:`Result`}),(0,V.jsx)(`span`,{className:`text-right`,children:`When`}),(0,V.jsx)(`span`,{})]}),(0,V.jsxs)(`ul`,{"aria-label":`Execution reports`,className:`m-0 list-none p-2`,children:[I.length===0&&(0,V.jsx)(`li`,{className:`px-4 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.`}),I.slice(0,h).map((e,t,n)=>{let r=M(e.startedAt),i=G(e);return(0,V.jsxs)(`li`,{className:`contents`,children:[(t===0||M(n[t-1].startedAt)!==r)&&(0,V.jsx)(`span`,{className:`block px-4 pt-4 pb-1 text-[13px] font-semibold text-muted`,children:r}),(0,V.jsxs)(`div`,{className:`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-4 rounded-[10px] px-4 py-2 hover:bg-surface-muted @3xl:grid-cols-[auto_minmax(0,1fr)_110px_150px_100px_128px] @3xl:gap-x-4`,children:[(0,V.jsx)(q,{r:e}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,V.jsx)(`span`,{className:`truncate text-[13px] font-medium`,"data-tip":e.title,children:e.title}),(0,V.jsx)(`span`,{className:`truncate text-[13px] text-muted @3xl:hidden`,children:[H[e.scope],e.scope===`page`||!e.counts.total?``:`${e.counts.passed}/${e.counts.total} passed`,N(e.startedAt)].filter(Boolean).join(` · `)})]}),(0,V.jsx)(`span`,{className:`hidden truncate text-[13px] text-muted @3xl:block`,children:H[e.scope]}),(0,V.jsxs)(`span`,{className:`hidden truncate text-[13px] text-muted tabular-nums @3xl:block`,children:[(0,V.jsx)(`span`,{className:p(i.tone===`fail`&&`text-fail`),children:e.scope===`page`?`Report`:e.counts.total?`${e.counts.passed}/${e.counts.total} passed`:i.label}),W(e.ms)?` · ${W(e.ms)}`:``]}),(0,V.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,"data-tip":U(e.startedAt),children:N(e.startedAt)}),(0,V.jsx)(`span`,{className:`flex min-w-0 justify-end`,children:e.report?(0,V.jsx)(v,{variant:`icon`,size:`icon-sm`,"aria-label":`Open the report of ${e.title} in a new tab`,"data-tip":`Open the report of ${e.title} in a new tab`,onClick:async()=>S(await _(e.report)),children:(0,V.jsx)(l,{"aria-hidden":`true`})}):(0,V.jsx)(P,{path:e.folder,onNote:S,children:`Folder`})})]})]},e.key)})]}),(I.length>h||n.total>n.rows.length)&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4 border-t border-line-soft px-4 py-2 text-[13px] text-muted`,children:[(0,V.jsxs)(`span`,{children:[`Showing `,Math.min(h,I.length),` of `,I.length,n.total>n.rows.length?` (the newest ${n.rows.length} of ${n.total})`:``]}),I.length>h&&(0,V.jsxs)(v,{size:`sm`,onClick:()=>y(h+K),children:[(0,V.jsx)(t,{"aria-hidden":`true`}),`More (`,Math.min(K,I.length-h),`)`]})]})]})]})]})]})}export{ee as Reports};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,$n as n,A as r,At as i,Br as a,En as o,F as s,Ft as c,Gr as l,Mt as u,O as d,Qn as f,Rt as p,Tt as m,Vr as h,W as g,Wn as _,Xn as v,Yn as ee,_t as te,fr as ne,gn as re,ln as ie,nr as ae,nt as oe,ot as se,u as ce,un as y,vr as le,vt as ue,xt as de,yt as fe}from"./route-Mq0QZuqV.js";import{f as b,r as x,y as S}from"./agents-BUWN-VJv.js";import{t as pe}from"./jsx-runtime-LKYXHABd.js";import{A as C,j as w,l as me}from"./input-1RVqxCVH.js";import{D as T,T as E,o as he,t as D,w as O}from"./logLevel-CFPS8IkY.js";import{L as ge,a as k,c as A,s as j}from"./palette-5nApQc76.js";import{$ as _e,C as ve,Fn as ye,G as M,Nn as N,Pn as be,Q as xe,S as Se,Y as Ce,Z as we,Zt as Te,b as P,d as Ee,q as De,x as F}from"./index-Cg0SmlXN.js";import{t as I}from"./diff-CZ0iWWGv.js";var L=e(l(),1),R=pe();function z({review:e,className:t}){return(0,R.jsxs)(`div`,{className:C(`flex flex-col gap-2 text-[13px] leading-relaxed`,t),children:[e.summary&&(0,R.jsx)(`p`,{className:`m-0 text-ink-2 [overflow-wrap:anywhere]`,children:e.summary}),e.issues.length>0&&(0,R.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.issues.map((e,t)=>(0,R.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,R.jsx)(`span`,{className:C(`mt-px flex-none rounded-full px-2 py-px text-[13px] font-medium`,e.kind===`correctness`?`bg-fail-soft text-fail`:`bg-surface-strong text-ink-2`),children:e.kind===`correctness`?`Correctness`:`Standards`}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[e.file&&(0,R.jsx)(`span`,{className:`font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.file}),(0,R.jsx)(`span`,{className:`text-ink [overflow-wrap:anywhere]`,children:e.problem}),e.fix&&(0,R.jsxs)(`span`,{className:`text-muted [overflow-wrap:anywhere]`,children:[`Fix: `,e.fix]})]})]},t))})]})}var Oe={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 B({status:e,orb:t,px:n=20,spin:r=!1}){let i={width:n,height:n};return e===`active`&&r?(0,R.jsx)(`span`,{role:`img`,"aria-label":`At work`,className:`flex flex-none items-center justify-center`,style:i,children:(0,R.jsx)(y,{size:n-2,strokeWidth:2.5,"aria-hidden":`true`,className:`animate-spin text-accent-fg motion-reduce:animate-none`})}):e===`active`?(0,R.jsx)(O,{state:t,px:n,label:`At work`}):e===`done`?(0,R.jsx)(`span`,{role:`img`,"aria-label":`Done`,className:`flex flex-none items-center justify-center rounded-full bg-pass`,style:i,children:(0,R.jsx)(d,{size:n*.6,strokeWidth:3,"aria-hidden":`true`,className:`text-bg`})}):e===`failed`?(0,R.jsx)(`span`,{role:`img`,"aria-label":`Failed`,className:`flex flex-none items-center justify-center rounded-full bg-fail`,style:i,children:(0,R.jsx)(h,{size:n*.6,strokeWidth:3,"aria-hidden":`true`,className:`text-bg`})}):e===`note`?(0,R.jsx)(`span`,{role:`img`,"aria-label":`Note`,className:`flex flex-none items-center justify-center`,style:i,children:(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-line-strong`})}):(0,R.jsx)(`span`,{role:`img`,"aria-label":e===`skipped`?`Skipped`:`To come`,className:C(`box-border block flex-none rounded-full border-2 border-line-strong`,e===`skipped`&&`border-dashed`),style:i})}var ke=(e,t)=>e.status===`running`?t?`active`:`done`:e.status===`ok`?`done`:e.status===`fail`?`failed`:`note`,Ae={read:de,search:v,list:i,edit:ue,run:le,element:oe,outline:ie,references:c,impact:o,find:fe,testfile:m,web:p,environment:n,cases:g,browser:p,post:f,test:m,retry:_,review:ae,task:u,work:a},je={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`},V={done:`Done`,failed:`Failed`,active:`At work`,pending:`To come`,skipped:`Skipped`,note:`Note`};function Me({kind:e,status:t}){let n=C(`mt-px flex size-4 flex-none items-center justify-center`,je[t]);if(e===`skill`)return(0,R.jsxs)(`span`,{role:`img`,"aria-label":V[t],className:C(n,`relative`),children:[(0,R.jsx)(me,{name:ge.skills,px:15}),(t===`done`||t===`failed`)&&(0,R.jsx)(`span`,{"aria-hidden":`true`,className:C(`absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full ring-1 ring-bg`,t===`done`?`bg-pass`:`bg-fail`)})]});let r=Ae[e];return(0,R.jsx)(`span`,{role:`img`,"aria-label":V[t],className:n,children:(0,R.jsx)(r,{size:15,strokeWidth:2,"aria-hidden":`true`})})}function Ne({status:e}){return e===`active`?(0,R.jsx)(y,{size:12,strokeWidth:2.5,"aria-label":`At work`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}):(0,R.jsx)(`span`,{role:`img`,"aria-label":V[e],className:C(`mt-2 size-2 flex-none rounded-full`,e===`done`?`bg-pass`:e===`failed`?`bg-fail`:`bg-line-strong`)})}function H({text:e,label:n}){let[r,i]=(0,L.useState)(!1);return(0,R.jsx)(`button`,{type:`button`,"aria-label":r?`Copied`:n,"data-tip":r?`Copied`:n,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:r?(0,R.jsx)(d,{size:13,"aria-hidden":`true`,className:`text-pass`}):(0,R.jsx)(t,{size:13,"aria-hidden":`true`})})}function Pe({step:e,failed:t}){return(0,R.jsxs)(`div`,{className:`flex flex-col gap-1 py-1 font-mono text-[13px] leading-relaxed`,children:[e.command&&(0,R.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2 text-muted`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none select-none`,children:`$`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.command}),(0,R.jsx)(H,{text:e.command,label:`Copy the command`})]}),e.output&&(0,R.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none text-muted select-none`,children:`⎿`}),(0,R.jsx)(`pre`,{className:C(`m-0 max-h-56 min-w-0 flex-1 overflow-auto font-mono text-[13px] leading-relaxed whitespace-pre-wrap [overflow-wrap:anywhere]`,t?`text-fail`:`text-ink-2`),children:(0,R.jsx)(D,{text:e.output})}),(0,R.jsx)(H,{text:e.output,label:`Copy the output`})]}),e.shell?.exit!==void 0&&e.shell.exit!==0&&(0,R.jsxs)(`span`,{className:`text-fail`,children:[`Exit code `,e.shell.exit]})]})}var Fe=e=>/[/\\]|\.\w{1,5}$|^\$ /.test(e)&&!/\s{2,}/.test(e);function U({text:e}){return(0,R.jsx)(`span`,{className:C(`min-w-0 max-w-full truncate rounded-md bg-surface-strong px-2 py-1 text-[13px] text-ink-2`,Fe(e)&&`font-mono text-[13px]`),children:e})}function Ie(e){return{count:e.length,failed:e.filter(e=>e.ok===!1).length,latest:e[e.length-1]}}function W({line:e}){return(0,R.jsxs)(`li`,{className:C(`flex gap-2 [overflow-wrap:anywhere]`,e.ok===!0?`text-pass`:e.ok===!1?`text-fail`:`text-ink-2`),children:[e.ok!==void 0&&(0,R.jsx)(`span`,{"aria-hidden":`true`,children:e.ok?`✓`:`✗`}),(0,R.jsx)(F,{text:e.text,className:`min-w-0 text-[13px] leading-relaxed text-inherit [&_p]:my-0`})]})}function Le({step:e}){let[t,n]=(0,L.useState)(!1),i=e.lines.length>3&&!t,{count:a,failed:o,latest:s}=Ie(e.lines);return(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e.lines.length>3&&(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(!t),className:`flex w-fit cursor-pointer items-center gap-1 rounded-md border-0 bg-transparent p-0 text-[13px] text-muted hover:text-ink-2`,children:[(0,R.jsxs)(`span`,{children:[t?`Hide`:`Show`,` `,a,` lines`,o>0&&(0,R.jsxs)(`span`,{className:`text-fail`,children:[` · `,o,` failed`]})]}),(0,R.jsx)(r,{size:13,"aria-hidden":`true`,className:C(`transition-transform`,t&&`rotate-180`)})]}),(0,R.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] leading-relaxed`,children:i?s&&(0,R.jsx)(W,{line:s}):e.lines.map((e,t)=>(0,R.jsx)(W,{line:e},t))})]})}function G({agent:e,named:t=!0,working:n=!1,state:r,orb:i}){let a=b(e),o=j(e);return(0,R.jsxs)(`span`,{className:`inline-flex flex-none items-center gap-2`,"data-tip":a.name,children:[(0,R.jsx)(k,{agent:e,px:24,decorative:t,working:n,state:r,activity:n?A(i):void 0}),t&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`font-medium`,style:{color:o},children:a.name}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`·`})]})]})}var K=e=>e===`active`?`thinking`:e===`failed`?`failed`:e===`done`?`done`:`idle`;function q({step:e,from:t,to:n,live:r}){let i=b(n),a=j(n),o=r?`thinking`:e.status===`fail`?`failed`:e.status===`ok`?`done`:`idle`,s=[...e.children??[]].reverse().find(e=>e.status===`running`)?.orb??(e.orb===`handing`?void 0:e.orb);return(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,R.jsx)(k,{agent:t,px:24,activity:r?`handing`:void 0}),(0,R.jsxs)(`span`,{role:`img`,"aria-label":`hands off to`,className:C(`handoff-flow flex-none`,r&&`is-live`),style:{color:a},children:[(0,R.jsx)(`span`,{}),(0,R.jsx)(`span`,{}),(0,R.jsx)(`span`,{})]}),(0,R.jsx)(k,{agent:n,px:28,decorative:!0,state:o,activity:r?A(s):void 0,className:`handoff-in`}),(0,R.jsx)(`span`,{className:`font-medium`,style:{color:a},children:i.name}),!e.handoff&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`·`}),(0,R.jsx)(`span`,{className:C(`[overflow-wrap:anywhere]`,r?`text-ink`:`text-ink-2`),children:e.label})]}),e.arg&&(0,R.jsx)(U,{text:e.arg})]})}function J({step:e,working:t,from:n=x}){let i=e.agent||n,a=Y(e),o=ke(e,t),[s,c]=(0,L.useState)(null),l=s??((!!e.handoff||!!e.agent||!!e.shell||e.key.startsWith(`try:`))&&o===`active`),u=(0,R.jsxs)(R.Fragment,{children:[e.handoff||i!==n?(0,R.jsx)(B,{status:o,orb:e.orb,px:14,spin:!0}):!e.icon&&(0,R.jsx)(Ne,{status:o}),e.handoff||i!==n?(0,R.jsx)(q,{step:e,from:n,to:e.handoff?.agent??i,live:o===`active`}):(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[e.icon?(0,R.jsx)(Me,{kind:e.icon,status:o}):(0,R.jsx)(G,{agent:i,named:!1,working:o===`active`,state:K(o),orb:e.orb}),(0,R.jsx)(`span`,{className:C(`[overflow-wrap:anywhere]`,o===`active`?`text-ink`:`text-ink-2`),children:e.label}),e.arg&&(0,R.jsx)(U,{text:e.arg}),e.change&&(0,R.jsxs)(`span`,{className:`font-mono text-[13px] tabular-nums`,children:[(0,R.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.change.added]}),` `,(0,R.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.change.removed]})]})]}),a&&(0,R.jsx)(r,{size:14,"aria-hidden":`true`,className:C(`mt-1 ml-auto flex-none text-muted transition-transform`,l&&`rotate-180`)})]});return(0,R.jsxs)(`li`,{className:`flex flex-col`,children:[a?(0,R.jsx)(`button`,{type:`button`,"aria-expanded":l,onClick:()=>c(!l),className:`flex min-h-8 w-full cursor-pointer items-start gap-2 rounded-lg border-0 bg-transparent px-2 py-2 text-left text-[13px] hover:bg-surface-muted`,children:u}):(0,R.jsx)(`div`,{className:`flex min-h-8 items-start gap-2 px-2 py-2 text-[13px]`,children:u}),a&&(0,R.jsx)(N,{open:l,children:(0,R.jsx)(X,{step:e,working:t,from:n,className:`mb-1 ml-4`})})]})}var Y=e=>e.lines.length>0||(e.children?.length??0)>0||!!e.handoff?.result||!!e.change||!!e.output||!!e.command||!!e.review;function X({step:e,working:t,from:n,className:r}){let i=e.children||[],a=e.handoff?.agent||e.agent;return(0,R.jsxs)(`div`,{className:C(`flex flex-col gap-2 border-l border-dotted py-1 pl-4`,r),style:{borderColor:a?`${b(a).hue}59`:`var(--color-line-strong)`},children:[(e.output||e.command)&&(0,R.jsx)(Pe,{step:e,failed:e.status===`fail`}),e.review&&(0,R.jsx)(z,{review:e.review}),e.lines.length>0&&(0,R.jsx)(Le,{step:e}),e.change&&(0,R.jsx)(I,{diff:e.change.diff}),i.length>0&&(0,R.jsx)(`ul`,{"aria-label":a?`What ${S(b(a).name)} did`:`Steps`,className:`m-0 flex list-none flex-col p-0`,children:i.map(e=>(0,R.jsx)(J,{step:e,working:t,from:a||n},e.key))}),e.handoff?.result&&(0,R.jsxs)(`div`,{className:`flex flex-col gap-1 text-[13px]`,children:[(0,R.jsxs)(`span`,{className:`text-muted`,children:[S(b(e.handoff.agent).name,!0),` answered`]}),(0,R.jsx)(F,{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 Re({node:e,last:t,working:n,now:i,orbed:a}){let o=e.step?[]:e.steps,s=e.step,c=o.length>0||!!i||!!s&&Y(s),[l,u]=(0,L.useState)(null),d=l??(e.status===`active`||e.status===`failed`),f=s?.orb??o.findLast(e=>e.status===`running`)?.orb??i?.orb??`thinking`;return(0,R.jsxs)(`li`,{className:`flex gap-4`,children:[(0,R.jsxs)(`div`,{className:`flex flex-none flex-col items-center`,children:[(0,R.jsx)(`span`,{className:`mt-1`,children:(0,R.jsx)(B,{status:e.status,orb:f,spin:!a})}),!t&&(0,R.jsx)(`span`,{"aria-hidden":`true`,className:C(`mt-2 min-h-4 w-0 flex-1 border-l border-dotted`,Oe[e.status])})]}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col pb-2`,children:[c?(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":d,onClick:()=>u(!d),className:`flex min-h-7 w-full cursor-pointer items-start gap-2 border-0 bg-transparent p-0 text-left`,children:[(0,R.jsx)(Z,{node:e,orb:f}),(0,R.jsx)(r,{size:14,"aria-hidden":`true`,className:C(`mt-1 flex-none text-muted transition-transform`,d&&`rotate-180`)}),e.status===`active`&&(0,R.jsx)(`span`,{className:`mt-1 ml-1 flex-none rounded-full border border-accent-line bg-accent-soft px-2 py-px text-[13px] font-medium text-accent-fg`,children:`In progress`})]}):(0,R.jsx)(`div`,{className:`min-h-7`,children:(0,R.jsx)(Z,{node:e,orb:f})}),c&&(0,R.jsx)(N,{open:d,className:`mt-1`,children:s?(0,R.jsx)(X,{step:s,working:n,from:`forgeqe`,className:`mt-1`}):(0,R.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[o.map(e=>(0,R.jsx)(J,{step:e,working:n},e.key)),i&&(0,R.jsx)(`li`,{children:(0,R.jsx)(Q,{live:i,className:`px-2`})})]})})]})]})}function Z({node:e,orb:t}){let n=e.status===`active`?`text-ink`:e.status===`pending`||e.status===`skipped`?`text-muted`:e.status===`failed`?`text-fail`:`text-ink-2`,r=e.step;return r?.handoff||r?.agent&&r.agent!==`forgeqe`?(0,R.jsx)(q,{step:r,from:x,to:r.handoff?.agent??r.agent,live:e.status===`active`}):(0,R.jsxs)(`span`,{className:C(`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-sm font-medium`,n,e.status===`skipped`&&`line-through`),children:[r&&(0,R.jsx)(G,{agent:r.agent||`forgeqe`,named:!!r.agent&&r.agent!==`forgeqe`,working:e.status===`active`,state:K(e.status),orb:t}),e.status===`active`?(0,R.jsx)(`span`,{className:`shimmer [overflow-wrap:anywhere]`,children:(0,R.jsx)(`span`,{children:e.label})}):(0,R.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.label}),r?.arg&&(0,R.jsx)(U,{text:r.arg})]})}var ze={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 Be(e){let[t,n]=(0,L.useState)(()=>Date.now());(0,L.useEffect)(()=>{let e=ye(()=>n(Date.now()),1e3);return()=>be(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?Te(i,`second`):Te(Math.floor(i/60),`minute`)}function Q({live:e,orb:t=!1,className:n}){let r=Be(e.latest?.at);return(0,R.jsxs)(`div`,{className:C(`flex min-h-8 items-start gap-2 py-1`,n),children:[(0,R.jsx)(`span`,{className:`mt-1 flex size-4 flex-none items-center justify-center`,children:t?(0,R.jsx)(O,{state:e.orb,px:20,label:`At work`}):(0,R.jsxs)(`span`,{"aria-hidden":`true`,className:`relative flex size-2`,children:[(0,R.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-accent opacity-60 motion-reduce:animate-none`}),(0,R.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-accent`})]})}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`shimmer text-[13px] font-medium text-muted`,children:(0,R.jsx)(`span`,{"aria-live":`polite`,children:e.text})}),e.latest&&(0,R.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,R.jsx)(`span`,{className:C(`min-w-0 truncate font-mono text-[13px]`,ze[e.latest.tone]),children:e.latest.plain}),(0,R.jsxs)(`span`,{className:`flex-none text-[13px] whitespace-nowrap text-muted tabular-nums`,children:[r,r&&` · `,e.events,` `,e.events===1?`event`:`events`]})]})]})]})}function Ve({turn:e,working:t,live:n,folded:r=!1}){if(r)return(0,R.jsx)(Q,{live:n,orb:!0});let i=De(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.findLast(e=>e.status===`active`);return(0,R.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,R.jsx)(`li`,{className:`flex gap-4`,children:(0,R.jsx)(Q,{live:n,orb:!c,className:`-mt-1 min-w-0 flex-1 py-0`})},`now`):(0,R.jsx)(Re,{node:e,last:r===s.length-1,working:t,now:a===e?n:void 0,orbed:c===e},e.key))})}var He={passed:`Passed`,failed:`Failed`,stopped:`Stopped`,blocked:`Blocked`};function $({label:e,children:t}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`dt`,{className:`pt-1 text-[13px] text-muted`,children:e}),(0,R.jsx)(`dd`,{className:`m-0 min-w-0 text-[13px] [overflow-wrap:anywhere]`,children:t})]})}function Ue({text:e}){let[n,r]=(0,L.useState)(!1);return(0,R.jsxs)(`div`,{className:`flex items-start gap-2 rounded-[10px] bg-surface-muted px-4 py-2`,children:[(0,R.jsx)(E,{icon:ne,size:14,className:`mt-1 flex-none text-muted`}),(0,R.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[13px] break-all whitespace-pre-wrap text-ink`,children:e}),(0,R.jsx)(`button`,{type:`button`,"aria-label":n?`Copied`:`Copy the command`,"data-tip":n?`Copied`:`Copy the command`,onClick:async()=>{await ve(e)&&(r(!0),setTimeout(()=>r(!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,R.jsx)(d,{size:14,"aria-hidden":`true`,className:`text-pass`}):(0,R.jsx)(t,{size:14,"aria-hidden":`true`})})]})}function We(e){if(e.runs===void 0)return e.attempts===void 0?``:w(e.attempts,`attempt`);let t=`${w(e.runs,`test run`)}${e.failedRuns?` (${e.failedRuns} failed)`:``}`;return e.reviews?`${t} · ${w(e.reviews,`review`)}`:t}function Ge({name:e}){let t=e.lastIndexOf(`.`),n=t>0?e.slice(t+1):e,r=t>0?e.slice(0,t):``;return(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col`,"data-tip":e,children:[(0,R.jsx)(`span`,{className:`font-mono text-[13px] text-ink [overflow-wrap:anywhere]`,children:n}),r&&(0,R.jsx)(`span`,{className:`font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:r})]})}function Ke({t:e}){let t=We(e);return(0,R.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,R.jsx)(m,{size:17,strokeWidth:2,"aria-hidden":`true`,className:e.ok?`text-pass`:e.status===`stopped`?`text-muted`:`text-fail`}),(0,R.jsx)(`span`,{className:`text-[16px] font-semibold`,children:e.ok?`Test written`:`Test not finished`}),(0,R.jsx)(he,{tone:e.ok?`pass`:e.status===`stopped`?`neutral`:`fail`,children:He[e.status]||e.status||`Not written`}),t&&(0,R.jsx)(`span`,{className:`text-[13px] text-muted`,children:t})]}),(0,R.jsxs)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-6 gap-y-1 sm:grid-cols-[96px_minmax(0,1fr)] sm:gap-y-4`,children:[(e.testFile||e.testName)&&(0,R.jsx)($,{label:`Test`,children:(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[e.testFile&&(0,R.jsx)(P,{path:e.testFile}),e.testName&&(0,R.jsx)(Ge,{name:e.testName})]})}),e.command&&(0,R.jsx)($,{label:`Run it`,children:(0,R.jsx)(Ue,{text:e.command})}),e.review&&(0,R.jsx)($,{label:e.review.approved?`Review`:`Review asked`,children:(0,R.jsx)(z,{review:e.review})}),e.runDir&&(0,R.jsx)($,{label:`From the run`,children:(0,R.jsx)(P,{path:e.runDir})}),e.reused.length>0&&(0,R.jsx)($,{label:`Reused`,children:(0,R.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.reused.map(e=>(0,R.jsx)(`li`,{className:`min-w-0`,children:(0,R.jsx)(P,{path:e})},e))})})]}),e.error&&(0,R.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:e.error})]})}function qe({c:e}){let[t,n]=(0,L.useState)(!1);return(0,R.jsxs)(`li`,{className:`flex flex-col`,children:[(0,R.jsxs)(`div`,{className:`flex min-h-9 items-center gap-2`,children:[(0,R.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} the changes to ${e.path}`,"data-tip":`${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,R.jsx)(r,{size:15,"aria-hidden":`true`,className:C(`transition-transform`,!t&&`-rotate-90`)})}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,R.jsx)(P,{path:e.path})}),(0,R.jsxs)(`span`,{className:`flex-none font-mono text-[13px] tabular-nums`,children:[(0,R.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,R.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,R.jsx)(N,{open:t,children:(0,R.jsx)(I,{diff:e.diff,className:`mb-2 ml-10`})})]})}function Je({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,R.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,R.jsx)(Ke,{t:e},t)),t.length>0&&(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium`,children:`Reports`}),(0,R.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-sm`,children:t.map(e=>(0,R.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`text-ink-2`,children:e.label}),(0,R.jsx)(P,{path:e.path})]},e.path))})]}),(e.changes.length>0||r.length>0)&&(0,R.jsxs)(`div`,{className:C(`flex flex-col gap-1`,(e.tests.length>0||t.length>0)&&`border-t border-line-soft pt-4`),children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,R.jsx)(te,{size:15,"aria-hidden":`true`,className:`text-muted`}),`Files changed`,(0,R.jsxs)(`span`,{className:`font-normal text-muted`,children:[w(e.changes.length+r.length,`file`),e.changes.length>0&&(0,R.jsxs)(R.Fragment,{children:[` · `,(0,R.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.changes.reduce((e,t)=>e+t.added,0)]}),` `,(0,R.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.changes.reduce((e,t)=>e+t.removed,0)]})]})]})]}),(0,R.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[e.changes.map(e=>(0,R.jsx)(qe,{c:e},e.path)),r.map(e=>(0,R.jsx)(`li`,{className:`flex min-h-9 items-center gap-2 pl-10`,children:(0,R.jsx)(P,{path:e})},e))]})]})]})}var Ye=/^\s*(?:[-*>]\s*)?(?:\*\*|__)?\s*(?:sources?|evidence|references?|refs?)\s*(?:\*\*|__)?\s*:/i;function Xe(e){let t=[],n=[],r=!1;for(let i of e.split(`
|
|
2
|
-
`))/^\s*(```|~~~)/.test(i)&&(r=!r),!r&&Ye.test(i)?n.push(i.trim()):t.push(i);return{body:t.join(`
|
|
3
|
-
`).replace(/\n{3,}/g,`
|
|
4
|
-
|
|
5
|
-
`).trimEnd(),sources:n.join(`
|
|
6
|
-
|
|
7
|
-
`)}}var Ze=1.5;function Qe(e,t){if(e>=t)return t;let n=t-e;return Math.min(t,e+Math.max(Ze,n/45))}function $e(e,t){return Math.min(Math.floor(t),e.length)}var et=()=>typeof window<`u`&&!!window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;function tt(e,t){let n=(0,L.useRef)(t);t&&(n.current=!0);let r=n.current&&!et(),[i,a]=(0,L.useState)(()=>r?0:e.length),o=(0,L.useRef)(i),s=(0,L.useRef)(e);s.current!==e&&(o.current=$e(e,o.current),s.current=e),r||(o.current=e.length),(0,L.useEffect)(()=>{if(!r||o.current>=e.length){a(o.current);return}let t=0,n=()=>{o.current=Qe(o.current,e.length),a(o.current),o.current<e.length&&(t=requestAnimationFrame(n))};return t=requestAnimationFrame(n),()=>cancelAnimationFrame(t)},[e,r]);let c=Math.min(Math.floor(r?i:e.length),e.length);return{shown:e.slice(0,c),typing:c<e.length}}var nt={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 rt({line:e,start:t}){let[n,r]=(0,L.useState)(!1),i=e.plain.length>160;return e.kind===`head`?(0,R.jsxs)(`li`,{className:`mt-4 flex items-baseline gap-4 border-b border-line-soft pb-1 first:mt-0`,children:[(0,R.jsx)(`span`,{className:`w-12 flex-none font-mono text-[13px] text-muted tabular-nums`,children:xe(t,e.at)}),(0,R.jsx)(F,{text:e.md,className:C(`min-w-0 text-[13px] font-semibold text-ink [&_p]:my-0`,Se)})]}):(0,R.jsxs)(`li`,{className:C(`flex items-baseline gap-4 py-1`,e.kind===`sub`&&`pl-4`),children:[(0,R.jsx)(`span`,{className:`w-12 flex-none font-mono text-[13px] text-muted tabular-nums`,children:xe(t,e.at)}),e.kind===`out`?(0,R.jsx)(`pre`,{className:`m-0 min-w-0 flex-1 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:(0,R.jsx)(D,{text:e.plain})}):(0,R.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:C(`min-w-0 flex-1 border-0 bg-transparent p-0 text-left`,i&&`cursor-pointer`),children:(0,R.jsx)(F,{text:e.md,className:C(`text-[13px] leading-relaxed [overflow-wrap:anywhere] [&_code]:text-[13px] [&_p]:my-0`,Se,nt[e.tone],i&&!n&&`line-clamp-2`)})})]})}function it({lines:e,start:n,live:r,name:i,timeline:a=!1}){let o=(0,L.useRef)(null),s=(0,L.useRef)(!0),[c,l]=(0,L.useState)(!1),u=(0,L.useMemo)(()=>we(e,n),[e,n]);(0,L.useEffect)(()=>{s.current&&o.current&&(o.current.scrollTop=o.current.scrollHeight)},[u]);let f=`inline-flex min-h-8 cursor-pointer items-center gap-2 rounded-lg border-0 bg-transparent px-2 text-[13px] font-medium text-muted hover:bg-surface-strong hover:text-ink`;return(0,R.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`flex min-h-9 items-center gap-1 border-b border-line-soft text-[13px] text-muted`,children:[(0,R.jsxs)(`span`,{className:`flex-1`,children:[e.length,` event`,e.length===1?``:`s`,r&&` · live`]}),(0,R.jsx)(`button`,{type:`button`,"aria-label":c?`Copied`:`Copy the activity log as Markdown`,"data-tip":c?`Copied`:`Copy the activity log as Markdown`,onClick:async()=>{try{await navigator.clipboard.writeText(u),l(!0),setTimeout(()=>l(!1),1500)}catch{}},className:f,children:c?(0,R.jsx)(d,{size:14,"aria-hidden":`true`,className:`text-pass`}):(0,R.jsx)(t,{size:14,"aria-hidden":`true`})}),(0,R.jsx)(`button`,{type:`button`,"aria-label":`Download the activity log as a Markdown file`,"data-tip":`Download the activity log as a Markdown file`,onClick:()=>{let e=URL.createObjectURL(new Blob([u],{type:`text/markdown;charset=utf-8`})),t=document.createElement(`a`);t.href=e,t.download=i,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)},className:f,children:(0,R.jsx)(E,{icon:se,size:14})})]}),(0,R.jsx)(`div`,{ref:o,role:`log`,"aria-label":`Activity log`,onScroll:e=>{let t=e.currentTarget;s.current=t.scrollTop+t.clientHeight>=t.scrollHeight-24},className:C(`overflow-y-auto py-2`,a?`max-h-[calc(var(--screen)-260px)] min-h-[320px]`:`max-h-[360px] border-b border-line-soft`),children:(0,R.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.map((e,t)=>(0,R.jsx)(rt,{line:e,start:n},t))})})]})}function at({ask:e,live:t,onAnswer:n}){let r=t&&e.answer===void 0;return(0,R.jsxs)(`div`,{className:C(`flex flex-col gap-4`,r?`rounded-[14px] border border-accent-line bg-accent-soft px-4 py-4`:`py-1`),children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(re,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none text-accent-fg`}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`font-medium`,children:e.title}),e.detail&&(0,R.jsx)(`span`,{className:`text-sm text-ink-2`,children:e.detail}),e.lines.map((e,t)=>(0,R.jsx)(`span`,{className:`text-sm text-ink-2 [overflow-wrap:anywhere]`,children:e},t))]})]}),r?(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.options.map(e=>(0,R.jsx)(T,{size:`sm`,onClick:()=>n(e.id),children:e.label},e.id)),!e.options.some(e=>e.id===`cancel`||e.label.trim().toLowerCase()===`cancel`)&&(0,R.jsxs)(T,{size:`sm`,variant:`ghost`,onClick:()=>n(null),children:[(0,R.jsx)(h,{"aria-hidden":`true`}),`Cancel`]})]}):(0,R.jsx)(`span`,{className:`text-sm text-muted`,children:e.answer===void 0?`Not answered`:`You chose: ${e.answer}`})]})}function ot({wait:e,live:t,onProceed:n}){let r=t&&e.answer===void 0;return(0,R.jsxs)(`div`,{className:C(`flex flex-col gap-4`,r?`rounded-[14px] border border-accent-line bg-accent-soft px-4 py-4`:`py-1`),children:[(0,R.jsxs)(`span`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(s,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none text-accent-fg`}),(0,R.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.prompt})]}),r?(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsxs)(T,{size:`sm`,variant:`primary`,"data-tip":`Done, continue`,onClick:()=>n(!0),children:[(0,R.jsx)(ce,{"aria-hidden":`true`}),`Continue`]}),(0,R.jsxs)(T,{size:`sm`,onClick:()=>n(!1),children:[(0,R.jsx)(h,{"aria-hidden":`true`}),`Cancel`]})]}):(0,R.jsx)(`span`,{className:`text-sm text-muted`,children:e.answer===void 0?`Not done`:e.answer?`You continued`:`You cancelled`})]})}function st(e,t){let[n,r]=(0,L.useState)(!1),i=(0,L.useRef)(t);return(0,L.useEffect)(()=>{let n=t>i.current;if(i.current=t,!e||!n)return void(e||r(!1));r(!0);let a=setTimeout(()=>r(!1),900);return()=>clearTimeout(a)},[e,t]),n}function ct({turn:e,live:t,onAnswer:n,onProceed:i}){let a=t&&!e.outcome,[o,s]=(0,L.useState)(null),c=o??a,l=M(e),u=a?l.text:Ce(e),d=e.parts.map(e=>_e(e.text)).filter(Boolean),f=tt(e.outcome&&e.reply?e.reply:d.join(`
|
|
8
|
-
|
|
9
|
-
`),a),p=(0,L.useMemo)(()=>Xe(f.shown),[f.shown]),m=st(a,d.reduce((e,t)=>e+t.length,0)),h=f.typing||m,[g,_]=(0,L.useState)(!1),v=e.log.findLast(e=>e.tone!==`you`&&e.tone!==`say`);return(0,R.jsxs)(`div`,{className:`flex gap-4`,children:[(0,R.jsx)(`div`,{className:`size-9 flex-none`,"aria-hidden":`true`,children:(0,R.jsx)(k,{agent:`forgeqe`,px:34,working:a,state:h?`speaking`:a?`thinking`:e.outcome===`done`?`done`:e.outcome===`failed`?`failed`:`idle`,activity:a&&!h?A(M(e).orb):void 0,className:`mt-1`})}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-4 pt-2`,children:[(e.steps.length>0||a||e.log.length>0)&&(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":c,disabled:!e.steps.length&&!e.plan.length,onClick:()=>s(!c),className:C(`flex cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-sm font-medium text-muted hover:text-ink disabled:cursor-default`,a&&`shimmer`),children:[(0,R.jsx)(`span`,{"aria-live":`polite`,children:u}),(e.steps.length>0||e.plan.length>0)&&(0,R.jsx)(r,{size:16,"aria-hidden":`true`,className:C(`transition-transform`,c&&`rotate-180`)})]}),e.log.length>0&&(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":g,onClick:()=>_(!g),className:`ml-auto inline-flex min-h-8 cursor-pointer items-center gap-2 rounded-lg border-0 bg-transparent px-2 text-[13px] font-medium text-muted hover:bg-surface-muted hover:text-ink`,children:[(0,R.jsx)(E,{icon:ee,size:14}),`Activity log`,(0,R.jsx)(`span`,{className:`tabular-nums`,children:e.log.length})]})]}),(0,R.jsx)(N,{open:(c||a)&&(e.steps.length>0||e.plan.length>0||a),children:(0,R.jsx)(Ve,{turn:e,working:a,folded:!c,live:{...l,latest:v,events:e.log.length,onLog:()=>_(!0)}})}),(0,R.jsx)(N,{open:g,children:(0,R.jsx)(it,{lines:e.log,start:e.started||e.log[0]?.at,live:a,name:`forgeqe-activity-${e.id}.md`})})]}),e.asks.map(e=>(0,R.jsx)(at,{ask:e,live:a,onAnswer:t=>n(e.id,t)},e.id)),e.waits.map(e=>(0,R.jsx)(ot,{wait:e,live:a,onProceed:t=>i(e.id,t)},e.id)),p.body&&(0,R.jsx)(F,{text:p.body,className:C((f.typing||a)&&`typing-caret`)}),p.sources&&!f.typing&&!a&&(0,R.jsx)(Ee,{title:`Sources`,children:(0,R.jsx)(F,{text:p.sources,className:`text-muted`})}),(0,R.jsx)(Je,{turn:e}),e.error&&(0,R.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e.error}),e.outcome===`stopped`&&!e.reply&&(0,R.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Stopped.`})]})]})}export{ct as n,Ue as r,it as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Dr as t,Gr as n,H as r,I as i,In as a,Sn as o,Sr as s,Tr as c,Vr as l,W as u,Xn as d,Xt as f,cr as p,gr as m,ir as h,jt as g,k as _,l as v,r as y,tn as b,u as x,xt as S,zn as C}from"./route-Mq0QZuqV.js";import{l as w}from"./agents-BUWN-VJv.js";import{t as T}from"./jsx-runtime-LKYXHABd.js";import{A as E,X as D,j as O,mt as k,n as ee,r as te,t as A}from"./input-1RVqxCVH.js";import{D as j,T as M,_ as N,a as ne,n as P,o as F,s as I}from"./logLevel-CFPS8IkY.js";import{At as L,Bn as R,Dt as z,Fn as B,Lt as re,Mt as ie,Nt as ae,Ot as V,P as oe,Pn as se,Rt as ce,Yt as H,i as U,jt as W,kt as le,o as ue,r as G,u as de}from"./index-Cg0SmlXN.js";import{i as K,s as fe,t as pe}from"./parts-CTmOGb8E.js";import{t as me}from"./stepper-ceEfHcbV.js";var q=e(n(),1),J={browserstack:`BrowserStack`,testmu:`TestMu AI`},he=/^rsp-\d{8}-\d{6}-[0-9a-f]{4}$/,Y={info:()=>D(`GET`,`/api/responsive`),runs:()=>D(`GET`,`/api/responsive/runs`),run:e=>D(`GET`,`/api/responsive/runs/${encodeURIComponent(e)}`),shot:(e,t)=>k(`/api/responsive/runs/${encodeURIComponent(e)}/shots/${encodeURIComponent(t)}`,`image/jpeg`),start:e=>D(`POST`,`/api/responsive/runs`,e),stop:e=>D(`POST`,`/api/responsive/runs/${encodeURIComponent(e)}/stop`,{}),flows:()=>D(`GET`,`/api/responsive/flows`),saveFlow:(e,t,n=!1)=>D(`POST`,`/api/responsive/flows`,{label:e,prompt:t,replace:n}),cloudDevices:(e,t=!1)=>D(`GET`,`/api/responsive/clouds/${e}/devices${t?`?fresh=1`:``}`),cases:e=>D(`GET`,`/api/responsive/cases?q=${encodeURIComponent(e)}`),caseSteps:e=>D(`GET`,`/api/responsive/case?key=${encodeURIComponent(e)}`)};function ge(e,t=`600px`){let[n,r]=(0,q.useState)(()=>typeof IntersectionObserver>`u`);return(0,q.useEffect)(()=>{let i=e.current;if(n||!i)return;let a=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(r(!0),a.disconnect())},{rootMargin:t});return a.observe(i),()=>a.disconnect()},[e,n,t]),n}var X=T(),_e={phone:h,tablet:m,desktop:o};function ve({devices:e,picked:t,max:n,onChange:r,drawnBy:i,real:a}){let[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(`all`),u=o.trim().toLowerCase(),d=e.filter(e=>(c===`all`||e.category===c)&&(!u||`${e.label} ${e.os??``} ${e.width}x${e.height} ${e.width}×${e.height}`.toLowerCase().includes(u))),f=t.length>=n,p=t=>e.filter(e=>e.category===t).length;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,X.jsx)(ne,{id:`rp-search`,label:`Search devices`,value:o,onChange:s,placeholder:`iPhone, Pixel, 1920…`,className:`flex-none`}),(0,X.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which devices to list`,children:(0,X.jsx)(P,{value:c,onChange:l,items:[{id:`all`,label:`All`,n:e.length},{id:`phone`,label:`Phones`,n:p(`phone`)},{id:`tablet`,label:`Tablets`,n:p(`tablet`)},...a?[]:[{id:`desktop`,label:`Desktops`,n:p(`desktop`)}]]})})]}),(0,X.jsxs)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:[t.length,` of `,n,` picked`,f?`: remove one to add another.`:`.`,` `,a?`Real devices on ${a}, as it lists them now: each is its own session of your plan, and a real browser (Safari on iOS, Chrome on Android).`:(0,X.jsxs)(X.Fragment,{children:[`Each is emulated in full (size, pixel ratio, touch, user agent)`,i?` and drawn by ${i}.`:` and drawn by Chromium, so a Safari-only difference does not show.`]})]}),d.length?(0,X.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-1 gap-2 p-0 @3xl:grid-cols-2`,children:d.map(e=>{let n=t.includes(e.id);return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`label`,{className:E(`flex items-center gap-2 rounded-[8px] px-2 py-1 text-sm`,!n&&f?`cursor-not-allowed text-muted`:`cursor-pointer hover:bg-surface-muted`),children:[(0,X.jsx)(de,{checked:n,disabled:!n&&f,onCheckedChange:n=>r(n?[...t,e.id]:t.filter(t=>t!==e.id))}),(0,X.jsx)(M,{icon:_e[e.category],size:16,className:`flex-none text-muted`}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,X.jsx)(`span`,{className:`ml-auto flex-none text-[13px] text-muted`,children:e.os??`${e.width}×${e.height} · ${e.scale}x`})]})},e.id)})}):(0,X.jsxs)(I,{children:[`No device matches “`,o,`”.`]})]})}function ye({results:e}){return(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,"aria-label":`What happened on each device`,children:e.map(e=>(0,X.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,X.jsx)(M,{icon:e.skipped?f:e.ok?i:r,size:16,className:E(`mt-1 flex-none`,e.skipped?`text-muted`:e.ok?`text-pass`:`text-fail`)}),(0,X.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,X.jsx)(`strong`,{className:`font-semibold`,children:e.label}),(0,X.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,e.skipped?`nothing to do on this layout`:`${e.done} of ${O(e.of,`step`)}`]}),e.error&&(0,X.jsx)(`span`,{className:`block text-muted`,children:e.error})]})]},e.device))})}var be={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},stopped:{label:`Stopped`,tone:`neutral`},failed:{label:`Failed`,tone:`fail`}},xe=e=>{try{let t=new URL(e);return`${t.host}${t.pathname===`/`?``:t.pathname}`}catch{return e}},Se=e=>e.status===`running`?`running`:e.findings?`findings`:`clean`;function Ce({rows:e}){let[t,n]=(0,q.useState)(`all`),r=t=>t===`all`?e.length:e.filter(e=>Se(e)===t).length,i=e.filter(e=>t===`all`||Se(e)===t),a=e=>location.hash=y(`responsive`,e);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(fe,{children:[(0,X.jsx)(K,{label:`All`,value:r(`all`),onClick:()=>n(`all`),on:t===`all`}),(0,X.jsx)(K,{label:`Running`,value:r(`running`),onClick:()=>n(`running`),on:t===`running`}),(0,X.jsx)(K,{label:`With findings`,value:r(`findings`),tone:r(`findings`)?`text-warn`:void 0,onClick:()=>n(`findings`),on:t===`findings`}),(0,X.jsx)(K,{label:`Clean`,value:r(`clean`),tone:r(`clean`)?`text-pass`:void 0,onClick:()=>n(`clean`),on:t===`clean`})]}),(0,X.jsx)(z,{label:`Runs`,placeholder:`Find a run`,empty:t===`all`?`No runs.`:`None here.`,resetKey:t,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{scope:`col`,className:L,children:`Page`}),(0,X.jsx)(`th`,{scope:`col`,className:E(L,`hidden @xl:table-cell`),children:`Devices`}),(0,X.jsx)(`th`,{scope:`col`,className:E(L,`hidden @3xl:table-cell`),children:`How`}),(0,X.jsx)(`th`,{scope:`col`,className:L,children:`Findings`}),(0,X.jsx)(`th`,{scope:`col`,className:L,children:`Status`}),(0,X.jsx)(`th`,{scope:`col`,className:E(L,`hidden @xl:table-cell`),children:`When`})]}),children:i.map(e=>{let t=be[e.status];return(0,X.jsxs)(`tr`,{onClick:()=>a(e.id),className:ae,children:[(0,X.jsxs)(`td`,{className:V,children:[(0,X.jsx)(`a`,{href:y(`responsive`,e.id),onClick:e=>e.stopPropagation(),className:`font-medium text-ink no-underline [overflow-wrap:anywhere] hover:underline`,children:xe(e.url)}),(0,X.jsx)(`span`,{className:`block text-[13px] text-muted`,children:e.id})]}),(0,X.jsxs)(`td`,{className:E(V,`hidden text-[13px] text-ink-2 @xl:table-cell`),children:[e.devices,e.on?(0,X.jsxs)(`span`,{className:`block text-muted`,children:[`on `,J[e.on]]}):null]}),(0,X.jsx)(`td`,{className:E(V,`hidden text-[13px] text-ink-2 @3xl:table-cell`),children:e.mode===`guided`?`Guided, ${e.steps} step${e.steps===1?``:`s`}`:`Interactive${e.steps?`, ${e.steps} instruction${e.steps===1?``:`s`}`:``}`}),(0,X.jsx)(`td`,{className:E(V,`text-[13px] whitespace-nowrap`),children:e.findings?(0,X.jsxs)(`span`,{className:e.high?`text-fail`:`text-warn`,children:[e.findings,e.high?` · ${e.high} high`:``]}):e.status===`running`?(0,X.jsx)(`span`,{className:`text-muted`,children:`So far none`}):(0,X.jsx)(`span`,{className:`text-pass`,children:`None`})}),(0,X.jsx)(`td`,{className:E(V,`whitespace-nowrap`),children:(0,X.jsx)(F,{tone:t.tone,children:t.label})}),(0,X.jsx)(`td`,{className:E(V,`hidden text-[13px] whitespace-nowrap text-muted @xl:table-cell`),children:H(e.endedAt||e.startedAt)})]},e.id)})})]})}var we={high:{label:`High`,tone:`fail`},medium:{label:`Medium`,tone:`warn`},low:{label:`Low`,tone:`neutral`}},Te=1500,Ee={chrome:`Chrome`,edge:`Edge`,firefox:`Firefox`,webkit:`WebKit`};function De({id:e,file:t,label:n,className:r,onOpen:i,thumb:a}){let[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(!1),u=(0,q.useRef)(null),d=ge(u);(0,q.useEffect)(()=>{if(!d)return;let n=!1;return Y.shot(e,t).then(e=>!n&&s(e),()=>!n&&l(!0)),()=>{n=!0}},[e,t,d]);let f=c?(0,X.jsx)(`span`,{className:`grid min-h-24 place-items-center text-[13px] text-muted`,children:`No picture`}):o?(0,X.jsx)(`img`,{src:o,alt:`${n} screenshot`,className:E(`block w-full object-top`,a?`h-24 object-cover`:`object-contain`)}):(0,X.jsx)(`span`,{className:`block min-h-24 bg-surface-muted`});return i?(0,X.jsx)(`button`,{ref:u,type:`button`,onClick:i,"aria-label":`Show the ${n} screenshot larger`,"data-tip":`Show larger`,className:E(`block cursor-zoom-in overflow-hidden rounded-[12px] border border-line-soft bg-surface-muted p-0 hover:border-line-strong`,r),children:f}):(0,X.jsx)(`div`,{ref:u,className:E(`overflow-hidden rounded-[12px] border border-line-soft bg-surface-muted`,r),children:f})}var Oe=[`high`,`medium`,`low`],ke={sideways:`Scrolls sideways`,small_text:`Text under 12px`,small_targets:`Tap targets under 24px`,broken_images:`Broken images`},Z=e=>e.check.startsWith(`custom-`),Q=e=>Z(e)?e.title:ke[e.check]??e.title,Ae=e=>{let t=e.steps.filter(e=>e>0);return t.length?`${t.length<e.steps.length?`Start, step`:`Step`}${t.length>1?`s`:``} ${t.join(`, `)}`:`At the start`};function je({run:e,onOpen:t}){let[n,r]=(0,q.useState)(`all`),i=t=>t===`all`?e.findings.length:e.findings.filter(e=>e.severity===t).length;if(!e.findings.length)return(0,X.jsx)(I,{icon:_,title:e.status===`running`?`Nothing found so far`:`Nothing found`,children:e.status===`running`?`Each device is checked after every step; findings show here as they are made.`:`Every device passed the checks at each of the run's ${O(e.steps.length,`step`)}.`});let a=e.findings.filter(e=>n===`all`||e.severity===n).sort((e,t)=>Oe.indexOf(e.severity)-Oe.indexOf(t.severity)||Math.min(...e.steps)-Math.min(...t.steps));return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which findings to show`,children:(0,X.jsx)(P,{value:n,onChange:r,items:[{id:`all`,label:`All`,n:i(`all`)},{id:`high`,label:`High`,n:i(`high`)},{id:`medium`,label:`Medium`,n:i(`medium`)},{id:`low`,label:`Low`,n:i(`low`)}]})}),(0,X.jsx)(z,{label:`Findings`,placeholder:`Find a finding`,empty:`None here.`,resetKey:n,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{scope:`col`,className:L,children:`Finding`}),(0,X.jsx)(`th`,{scope:`col`,className:L,children:`Severity`}),(0,X.jsx)(`th`,{scope:`col`,className:L,children:`Device`}),(0,X.jsx)(`th`,{scope:`col`,className:E(L,`hidden @xl:table-cell`),children:`When`})]}),children:a.map(e=>{let n=we[e.severity];return(0,X.jsxs)(`tr`,{onClick:()=>t(e),className:ae,children:[(0,X.jsxs)(`td`,{className:V,children:[(0,X.jsx)(`button`,{type:`button`,onClick:n=>(n.stopPropagation(),t(e)),className:`cursor-pointer border-0 bg-transparent p-0 text-left font-medium text-ink [overflow-wrap:anywhere] hover:underline`,children:Z(e)?`“${Q(e)}”`:Q(e)}),(0,X.jsx)(`span`,{className:`block text-[13px] text-muted [overflow-wrap:anywhere]`,children:Z(e)?`Your check`:e.title===Q(e)?e.detail:e.title})]}),(0,X.jsx)(`td`,{className:E(V,`whitespace-nowrap`),children:(0,X.jsx)(F,{tone:n.tone,icon:!1,children:n.label})}),(0,X.jsx)(`td`,{className:E(V,`text-[13px] whitespace-nowrap`),children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,X.jsx)(M,{icon:_e[e.layout],size:16,className:`flex-none text-muted`}),e.label]})}),(0,X.jsx)(`td`,{className:E(V,`hidden text-[13px] whitespace-nowrap text-muted @xl:table-cell`),children:Ae(e)})]},e.id)})})]})}function Me({f:e,run:t,onOpen:n}){let r=t.findings.filter(t=>t.check===e.check&&t.id!==e.id);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,X.jsx)(F,{tone:we[e.severity].tone,icon:!1,children:we[e.severity].label}),(0,X.jsx)(M,{icon:_e[e.layout],size:16,className:`flex-none text-muted`}),(0,X.jsx)(`strong`,{className:`font-semibold`,children:e.label}),(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:Ae(e)})]}),e.title!==Q(e)&&(0,X.jsx)(`p`,{className:`m-0 text-sm font-medium [overflow-wrap:anywhere]`,children:e.title}),e.detail&&(0,X.jsx)(`p`,{className:`m-0 text-sm text-ink-2 [overflow-wrap:anywhere]`,children:e.detail}),e.quote&&(0,X.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-2 text-[13px] [overflow-wrap:anywhere]`,children:[`On the screen: “`,e.quote,`”`]}),(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] text-ink-2`,children:e.steps.map(e=>(0,X.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e?`Step ${e}: ${t.steps.find(t=>t.n===e)?.instruction??``}`:`When the page opened`},e))}),e.shot?(0,X.jsx)(De,{id:t.id,file:e.shot,label:e.label},e.shot):(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`No screenshot for this finding.`}),r.length>0&&(0,X.jsxs)(`section`,{"aria-labelledby":`rp-others`,className:`flex flex-col gap-2`,children:[(0,X.jsxs)(`h3`,{id:`rp-others`,className:`m-0 text-base font-semibold`,children:[`Also on `,O(new Set(r.map(e=>e.device)).size,`other device`)]}),(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-2 p-0`,children:r.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(j,{size:`sm`,onClick:()=>n(e),"data-tip":`Show it on ${e.label}`,children:[(0,X.jsx)(M,{icon:_e[e.layout],size:16,"aria-hidden":`true`}),e.label]})},e.id))})]})]})}function Ne({run:e,onShot:t}){let n=e.spec;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[n.prompt&&(0,X.jsxs)(`section`,{"aria-labelledby":`rp-prompt`,className:`flex min-w-0 flex-col gap-2 rounded-[14px] card border px-4 py-4`,children:[(0,X.jsx)(`h3`,{id:`rp-prompt`,className:`m-0 text-base font-semibold`,children:`Your prompt`}),(0,X.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-2 text-sm whitespace-pre-wrap [overflow-wrap:anywhere]`,children:n.prompt}),n.attachments&&n.attachments.length>0&&(0,X.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Attached: `,n.attachments.join(`, `)]}),(0,X.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Read as `,O(n.steps.length,`step`),n.custom.length?`, with ${O(n.custom.length,`check`)} of your own`:``,`: `,n.steps.join(` → `)||`none`]})]}),(0,X.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:e.steps.map(n=>{let r=e.shots.filter(e=>e.step===n.n),i=e.findings.filter(e=>e.steps.includes(n.n)).length;return(0,X.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-4 rounded-[14px] card border px-4 py-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`inline-flex size-6 flex-none items-center justify-center rounded-full bg-surface-strong text-[13px] font-semibold tabular-nums`,children:n.n}),(0,X.jsx)(`h3`,{className:`m-0 min-w-0 flex-1 text-base font-semibold [overflow-wrap:anywhere]`,children:n.instruction}),(0,X.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[i?`${O(i,`finding`)}`:`No findings`,` · `,H(n.at)]})]}),n.plan.length>0&&(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] text-muted`,children:n.plan.map(e=>(0,X.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},e))}),n.results.length>0&&(0,X.jsx)(ye,{results:n.results}),!n.results.length&&n.note&&n.by!==`check`&&n.by!==`open`&&(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-warn [overflow-wrap:anywhere]`,children:n.note}),r.length>0&&(0,X.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-2`,"aria-label":`Screenshots after step ${n.n}`,children:r.map(r=>{let i=e.spec.devices.includes(r.device)?r.device:`device`;return(0,X.jsx)(De,{id:e.id,file:r.file,label:i,className:`w-[120px] flex-none`,onOpen:()=>t(r.file,`${i}, step ${n.n}`)},r.file)})})]},`${n.n}-${n.at}`)})})]})}function Pe({run:e,onShot:t}){let n=[...new Set(e.shots.map(e=>e.step))];return n.length?(0,X.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.map(n=>{let r=e.steps.find(e=>e.n===n);return(0,X.jsxs)(`section`,{"aria-labelledby":`rp-shots-${n}`,className:`flex flex-col gap-2`,children:[(0,X.jsx)(`h3`,{id:`rp-shots-${n}`,className:`m-0 text-base font-semibold [overflow-wrap:anywhere]`,children:n?`Step ${n}: ${r?.instruction??``}`:`When the page opened`}),(0,X.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-2 gap-4 p-0 @3xl:grid-cols-4 @5xl:grid-cols-6`,children:e.shots.filter(e=>e.step===n).map(r=>(0,X.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,X.jsx)(De,{id:e.id,file:r.file,label:r.device,onOpen:()=>t(r.file,`${r.device}, ${n?`step ${n}`:`start`}`)}),(0,X.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:r.device})]},r.file))})]},n)})}):(0,X.jsx)(I,{children:`No screenshots were kept.`})}function Fe({log:e}){let[t,n]=(0,q.useState)(`all`),i=e.filter(e=>e.level!==`info`),a=t===`all`?e:i;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which lines to show`,children:(0,X.jsx)(P,{value:t,onChange:n,items:[{id:`all`,label:`Everything`,n:e.length},{id:`problems`,label:`Errors and warnings`,n:i.length}]})}),a.length?(0,X.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,"aria-label":`Log`,children:a.map((e,t)=>(0,X.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 border-t border-line-soft py-2 text-[13px] first:border-t-0`,children:[(0,X.jsx)(M,{icon:e.level===`error`?r:e.level===`warn`?c:f,size:16,className:E(`mt-1 flex-none`,e.level===`error`?`text-fail`:e.level===`warn`?`text-warn`:`text-muted`)}),(0,X.jsx)(`span`,{className:`w-[72px] flex-none text-muted tabular-nums`,children:new Date(e.at).toLocaleTimeString()}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:e.text})]},`${e.at}-${t}`))}):(0,X.jsx)(I,{children:t===`all`?`Nothing logged yet.`:`No errors or warnings.`})]})}function Ie({run:e}){let t=e.steps.toReversed();return(0,X.jsx)(z,{label:`Devices`,placeholder:`Find a device`,empty:`No devices.`,head:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`th`,{scope:`col`,className:L,children:`Device`}),(0,X.jsx)(`th`,{scope:`col`,className:L,children:`Last step`}),(0,X.jsx)(`th`,{scope:`col`,className:W,children:`Findings`})]}),children:e.spec.devices.map(n=>{let a=t.find(e=>e.results.some(e=>e.device===n)),o=a?.results.find(e=>e.device===n),s=e.findings.filter(e=>e.device===n).length,c=o?.label||e.spec.labels?.[n]||e.findings.find(e=>e.device===n)?.label||n,l=e.shots.some(e=>e.device===n);return(0,X.jsxs)(`tr`,{className:ie,children:[(0,X.jsx)(`td`,{className:E(V,`font-medium whitespace-nowrap`),children:c}),(0,X.jsx)(`td`,{className:E(V,`text-[13px]`),children:o?(0,X.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2`,children:[(0,X.jsx)(M,{icon:o.skipped?f:o.ok?i:r,size:16,className:E(`mt-1 flex-none`,o.skipped?`text-muted`:o.ok?`text-pass`:`text-fail`)}),(0,X.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`Step `,a.n,`: `,o.skipped?`nothing to do on this layout`:o.ok?`done`:o.error||`did not finish`]})]}):(0,X.jsx)(`span`,{className:`text-muted`,children:l?`Page opened`:`Opening…`})}),(0,X.jsx)(`td`,{className:E(le,`text-[13px]`,s?`text-warn`:`text-muted`),children:s})]},n)})})}function Le({id:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)([]),[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(null),[u,d]=(0,q.useState)(``),[f,m]=(0,q.useState)(!1),[h,g]=(0,q.useState)(null),[_,v]=(0,q.useState)(null),b=(0,q.useCallback)(()=>{Y.run(e).then(e=>{n(e.run),i(e.log),o(e.live)},e=>d(e.message))},[e]);(0,q.useEffect)(b,[b]),(0,q.useEffect)(()=>{if(!a)return;let e=B(b,Te);return()=>se(e)},[a,b]);let x=async()=>{m(!0),d(``);try{await Y.stop(e),b()}catch(e){d(e.message)}finally{m(!1)}};if(!t)return u?(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:u}):(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});let S=be[t.status],C=r.filter(e=>e.level!==`info`).length,w=a?[{id:`findings`,label:`Findings`,n:t.findings.length,tone:t.findings.length?`text-warn`:void 0},{id:`devices`,label:`Devices`,n:t.spec.devices.length},{id:`log`,label:`Log and errors`,n:C||void 0,tone:C?`text-fail`:void 0}]:[{id:`steps`,label:`Steps`,n:t.steps.length},{id:`findings`,label:`Findings`,n:t.findings.length,tone:t.findings.length?`text-warn`:void 0},{id:`shots`,label:`Screenshots`,n:t.shots.length},{id:`log`,label:`Log and errors`,n:C||void 0,tone:C?`text-fail`:void 0}],T=s&&w.some(e=>e.id===s)?s:w[0].id,E=t.steps.filter(e=>e.by===`plan`||e.by===`words`).length,D=t.spec.steps.length;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(oe,{href:y(`responsive`,`runs`),label:`All runs`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-start`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,X.jsx)(`h2`,{className:`m-0 text-[20px] leading-snug font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:xe(t.spec.url)}),(0,X.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[O(t.spec.devices.length,`device`),t.spec.on?` on ${J[t.spec.on]} (${t.spec.real?`real devices`:Ee[t.spec.browser??`chrome`]})`:``,` · `,t.spec.mode===`guided`?`${D?O(D,`step`):`reading the prompt`}${t.spec.source?.label?` from ${t.spec.source.label}`:``}`:`interactive (an earlier kind of run)`,` · started `,H(t.startedAt)]})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(F,{tone:S.tone,children:S.label}),a&&(0,X.jsxs)(j,{variant:`danger`,disabled:f,onClick:()=>void x(),"data-tip":`Stop now; what was done is kept`,children:[(0,X.jsx)(p,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]})]}),a&&(0,X.jsxs)(`div`,{className:`flex items-center gap-4 rounded-[12px] card border px-4 py-2`,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:D?E<D?`Step ${Math.min(E+1,D)} of ${D}: ${t.spec.steps[E]??``}`:`Last checks…`:`Reading your prompt as steps…`}),(0,X.jsx)(`span`,{className:`w-[160px] flex-none`,children:(0,X.jsx)(pe,{value:E/Math.max(1,D)*100,label:`Steps done`})})]}),t.error&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:t.error}),u&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:u}),(0,X.jsx)(re,{prefix:`rtab`,className:`mb-0`,tabs:w,current:T,onPick:c,label:`Run`}),(0,X.jsxs)(`div`,{role:`tabpanel`,id:`rtab-panel-${T}`,"aria-labelledby":`rtab-${T}`,className:`flex min-w-0 flex-col gap-4`,children:[T===`devices`&&a&&(0,X.jsx)(Ie,{run:t}),T===`steps`&&(0,X.jsx)(Ne,{run:t,onShot:(e,t)=>g({file:e,label:t})}),T===`findings`&&(0,X.jsx)(je,{run:t,onOpen:v}),T===`shots`&&(0,X.jsx)(Pe,{run:t,onShot:(e,t)=>g({file:e,label:t})}),T===`log`&&(0,X.jsx)(Fe,{log:r})]}),(0,X.jsx)(R,{open:!!h,onClose:()=>g(null),wide:!0,title:h?.label??`Screenshot`,footer:(0,X.jsxs)(j,{onClick:()=>g(null),children:[(0,X.jsx)(l,{"aria-hidden":`true`}),`Close`]}),children:h&&(0,X.jsx)(De,{id:t.id,file:h.file,label:h.label})}),(0,X.jsx)(R,{open:!!_,onClose:()=>v(null),wide:!0,title:_?Z(_)?`“${Q(_)}”`:Q(_):`Finding`,..._&&Z(_)?{description:`A check of your own`}:{},footer:(0,X.jsxs)(j,{onClick:()=>v(null),children:[(0,X.jsx)(l,{"aria-hidden":`true`}),`Close`]}),children:_&&(0,X.jsx)(Me,{f:_,run:t,onOpen:v})})]})}var Re=[{name:`Page and devices`,tip:`The page and the devices to show it on`},{name:`What to do`,tip:`Your prompt, files or a test case`},{name:`What to check`,tip:`Built-in checks and your own`},{name:`Review`,tip:`Check and start`}],ze=8,Be=[`The main menu can be opened`,`Sign in is visible without scrolling`,`The page title is shown`,`Prices show next to each product`],Ve=`forgeqe:responsive`;function He(){try{let e=JSON.parse(localStorage.getItem(Ve)||`{}`);return e&&typeof e==`object`?e:{}}catch{return{}}}function Ue(e){try{localStorage.setItem(Ve,JSON.stringify({...He(),...e}))}catch{}}function We({id:e,label:t,help:n,children:r}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`label`,{htmlFor:e,className:`text-sm font-medium`,children:t}),r,n&&(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:n})]})}function Ge({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){return(0,X.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-4 border-t border-line-soft bg-bg py-4`,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px]`,children:a}),t&&(0,X.jsxs)(j,{variant:`ghost`,disabled:e,onClick:t,children:[(0,X.jsx)(v,{"aria-hidden":`true`}),`Back`]}),(0,X.jsx)(j,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}var Ke=`inline-flex min-h-8 cursor-pointer items-center gap-2 rounded-[8px] border-0 bg-surface-strong px-2 text-[13px] text-ink hover:bg-line disabled:cursor-default disabled:opacity-50`,qe=4e3,Je=3,Ye=5e4,Xe=`Search for pliers, open the first result and add it to the cart, then open the cart.
|
|
2
|
-
The cart should show 1 item and its total should be visible without scrolling.`;function Ze({prompt:e,setPrompt:n,files:r,setFiles:i,source:a,setSource:o,flows:s,onFlowsChanged:c,onError:f}){let[p,m]=(0,q.useState)(!1),[h,_]=(0,q.useState)(``),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(``),[C,w]=(0,q.useState)(``),[T,E]=(0,q.useState)(``),D=(0,q.useRef)(null),k=(e,t)=>{n(e.slice(0,qe)),o(t),f(``)},M=async t=>{try{let n=await Y.saveFlow(b.trim(),e,t);E(``),w(n.flow.label),x(``),c()}catch(e){let n=e.message;!t&&/saved already/.test(n)?E(n):f(n)}},N=async e=>{let t=[...e??[]];if(!t.length)return;if(r.length+t.length>Je)return f(`Attach at most ${Je} files.`);let n=[...r];for(let e of t){if(!/\.(txt|md|csv|feature)$/i.test(e.name)||e.size>262144)return f(`Attach .txt, .md, .csv or .feature files of at most 256 KB.`);let t=await e.text();if(t.length>Ye)return f(`${e.name} is longer than ${Ye/1e3}k characters.`);n.some(t=>t.name===e.name)||n.push({name:e.name.replace(/[^\w .()-]/g,`_`).slice(-80),text:t})}i(n),f(``)};return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(We,{id:`rp-prompt`,label:`What should ForgeQE do on every device?`,help:`Write it as you would tell a tester: what to do, in order, and what should be true. Attached files are read too. ${e.length}/${qe}`,children:(0,X.jsx)(te,{id:`rp-prompt`,value:e,rows:6,maxLength:qe,placeholder:Xe,onChange:e=>n(e.target.value)})}),r.length>0&&(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-2 p-0`,"aria-label":`Attached files`,children:r.map(e=>(0,X.jsxs)(`li`,{className:`inline-flex min-h-8 items-center gap-2 rounded-[8px] bg-surface-strong pr-1 pl-2 text-[13px] text-ink`,children:[(0,X.jsx)(S,{size:13,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`max-w-[240px] truncate`,children:e.name}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,"data-tip":`Remove ${e.name}`,onClick:()=>i(r.filter(t=>t.name!==e.name)),className:`inline-flex size-6 cursor-pointer items-center justify-center rounded-[8px] border-0 bg-transparent p-0 text-muted hover:bg-line hover:text-ink`,children:(0,X.jsx)(l,{size:13,"aria-hidden":`true`})})]},e.name))}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(j,{size:`sm`,disabled:r.length>=Je,onClick:()=>D.current?.click(),"data-tip":`Attach a test case, notes or a feature file (.txt, .md, .csv, .feature), read in this browser`,children:[(0,X.jsx)(t,{"aria-hidden":`true`}),`Attach`]}),(0,X.jsx)(`input`,{ref:D,type:`file`,multiple:!0,accept:`.txt,.md,.csv,.feature,text/plain,text/markdown,text/csv`,className:`hidden`,onChange:e=>{N(e.target.files),e.target.value=``}}),(0,X.jsxs)(j,{size:`sm`,"aria-expanded":p,onClick:()=>m(!p),"data-tip":`Fill the prompt from a test case of test management`,children:[(0,X.jsx)(u,{"aria-hidden":`true`}),`Test case`]}),(0,X.jsxs)(ee,{"aria-label":`A saved prompt`,size:`sm`,value:``,disabled:!s.length,onChange:e=>{let t=s.find(t=>t.name===e.target.value);t&&k(t.prompt,{kind:`flow`,label:t.label})},className:`min-w-0 flex-[0_1_220px]`,children:[(0,X.jsx)(`option`,{value:``,children:s.length?`A saved prompt…`:`No saved prompts yet`}),s.map(e=>(0,X.jsx)(`option`,{value:e.name,children:e.label},e.name))]}),(0,X.jsx)(`span`,{className:`flex-1`}),(0,X.jsx)(A,{"aria-label":`Name for the prompt`,size:`sm`,value:b,maxLength:80,placeholder:`Name to save as`,onChange:e=>x(e.target.value),className:`min-w-0 flex-[0_1_200px]`}),(0,X.jsxs)(j,{size:`sm`,disabled:!b.trim()||!e.trim(),"data-tip":`Save this prompt to use again`,onClick:()=>void M(!1),children:[(0,X.jsx)(g,{"aria-hidden":`true`}),`Save`]})]}),p&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[12px] bg-surface-muted p-4`,children:[(0,X.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:async e=>{e.preventDefault();try{y((await Y.cases(h)).cases)}catch(e){f(e.message)}},children:[(0,X.jsx)(A,{"aria-label":`Find a test case`,autoFocus:!0,value:h,maxLength:100,placeholder:`checkout, ADO-12…`,onChange:e=>_(e.target.value),className:`min-w-0 flex-[1_1_200px] bg-bg`}),(0,X.jsxs)(j,{size:`sm`,type:`submit`,"data-tip":`Find test cases from test management`,children:[(0,X.jsx)(d,{"aria-hidden":`true`}),`Find`]})]}),v&&(v.length?(0,X.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:v.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,className:`flex w-full cursor-pointer items-center gap-2 rounded-[8px] border-0 bg-transparent px-2 py-1 text-left text-sm text-ink hover:bg-surface-strong`,onClick:async()=>{try{let t=await Y.caseSteps(e.key),n=t.key.split(`:`)[1];k(`Test case ${n}: ${t.title}\n${t.steps.map((e,t)=>`${t+1}. ${e}`).join(`
|
|
3
|
-
`)}`,{kind:`case`,label:`${n} ${t.title}`}),m(!1),y(null)}catch(e){f(e.message)}},children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,X.jsxs)(`span`,{className:`flex-none text-[13px] text-muted`,children:[e.key.split(`:`)[1],` · `,O(e.steps,`step`)]})]})},e.key))}):(0,X.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`No test case with steps matches. Test management lists the cases of the plans Settings connects.`}))]}),a.kind!==`typed`&&a.label&&(0,X.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`From `,a.kind===`flow`?`the saved prompt`:`the test case`,` `,(0,X.jsx)(`strong`,{className:`font-medium text-ink-2`,children:a.label}),`; change it as you like.`]}),C&&(0,X.jsxs)(`p`,{role:`status`,className:`m-0 text-[13px] text-pass`,children:[`Saved as “`,C,`”.`]}),(0,X.jsx)(R,{open:!!T,onClose:()=>E(``),title:`Replace the saved prompt?`,description:T,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(j,{onClick:()=>E(``),children:[(0,X.jsx)(l,{"aria-hidden":`true`}),`Cancel`]}),(0,X.jsxs)(j,{variant:`primary`,onClick:()=>void M(!0),children:[(0,X.jsx)(g,{"aria-hidden":`true`}),`Replace`]})]}),children:(0,X.jsx)(`p`,{className:`m-0 text-sm text-ink-2`,children:`The saved prompt's old text is not kept.`})})]})}function Qe({info:e,url:t,named:n,where:r,prompt:i,files:a,checks:o,custom:s}){let c=(e,t)=>(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-line-soft py-4 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,X.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:e}),(0,X.jsx)(`div`,{className:`text-sm`,children:t})]});return(0,X.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col rounded-[14px] card border p-6`,children:[c(`Page`,t.trim()?(0,X.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:xe(t.trim())}):(0,X.jsx)(`span`,{className:`text-muted`,children:`Not given yet`})),c(`Devices`,n.length?(0,X.jsx)(`span`,{children:n.join(`, `)}):(0,X.jsx)(`span`,{className:`text-muted`,children:`None picked`})),c(`Runs on`,r),c(`What to do`,i.trim()?`Your prompt${a?` and ${O(a,`file`)}`:``}`:(0,X.jsx)(`span`,{className:`text-muted`,children:`No prompt yet`})),c(`Checks`,o.length+s.filter(e=>e.trim()).length?(0,X.jsx)(`span`,{children:[...o.map(t=>e.checks.find(e=>e.id===t)?.label??t),...s.filter(e=>e.trim())].join(` · `)}):(0,X.jsx)(`span`,{className:`text-muted`,children:`None yet`}))]})}function $e({info:e,onStarted:t}){let n=He(),r=(n.devices??[]).filter(t=>e.devices.some(e=>e.id===t)).slice(0,e.maxPanes),[i,o]=(0,q.useState)(0),[c,l]=(0,q.useState)(0),[u,d]=(0,q.useState)(n.address??e.start),[f,p]=(0,q.useState)(r.length?r:e.defaults),[m,h]=(0,q.useState)(``),[g,_]=(0,q.useState)([]),[v,y]=(0,q.useState)({kind:`typed`}),[b,S]=(0,q.useState)((n.checks??[]).filter(t=>e.checks.some(e=>e.id===t)).length?n.checks.filter(t=>e.checks.some(e=>e.id===t)):e.checks.map(e=>e.id)),[w,T]=(0,q.useState)([]),[D,O]=(0,q.useState)(n.on&&n.on!==`local`&&e.clouds[n.on]?.ready?n.on:`local`),[k,te]=(0,q.useState)(e.browsers.some(e=>e.id===n.browser)?n.browser:`chrome`),M=e.browsers.find(e=>e.id===k)?.label??k,[N,ne]=(0,q.useState)(n.kind===`browser`?`browser`:`real`),[P,F]=(0,q.useState)(null),[I,L]=(0,q.useState)(``),[R,z]=(0,q.useState)([]),B=D!==`local`&&N===`real`;(0,q.useEffect)(()=>{if(!B||P?.cloud===D)return;let e=!1;return L(``),z([]),Y.cloudDevices(D).then(t=>!e&&F({cloud:D,devices:t.devices,max:t.max}),t=>!e&&L(t.message)),()=>{e=!0}},[B,D,P?.cloud]);let re=P?.cloud===D?P.devices.map(e=>({id:e.id,label:e.name,category:e.category,width:0,height:0,scale:1,os:`${e.platform===`ios`?`iOS`:`Android`} ${e.version}`})):[],ie=B?R:f,ae=B?R.map(e=>P?.devices.find(t=>t.id===e)?.label??e):f.map(t=>e.devices.find(e=>e.id===t)?.label??t),V=D===`local`?`This computer (Chromium)`:B?`${J[D]}: real devices, one session each`:`${J[D]}: ${M}`,[oe,se]=(0,q.useState)([]),[H,U]=(0,q.useState)(``),[W,le]=(0,q.useState)(!1),ue=()=>void Y.flows().then(e=>se(e.flows),()=>{});(0,q.useEffect)(ue,[]);let G=e=>{U(``),o(e),l(t=>Math.max(t,e)),window.scrollTo({top:0})},K=w.map(e=>e.trim()).filter(Boolean),fe=/^(https?:\/\/)?[^\s/]+\.[^\s]+|^https?:\/\/(localhost|127\.0\.0\.1)/i.test(u.trim()),pe=async()=>{le(!0),U(``);let e={url:u.trim(),devices:ie,prompt:m.trim(),attachments:g,source:v,checks:b,custom:K,...D===`local`?{}:B?{on:D,real:!0}:{on:D,browser:k}};try{Ue({...B?{}:{devices:f},address:u.trim(),checks:b,on:D,browser:k,kind:N}),t((await Y.start(e)).id)}catch(e){U(e.message),le(!1)}};return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,X.jsx)(me,{steps:Re,at:i,reached:c,onGo:e=>!W&&G(e)}),(0,X.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,X.jsxs)(`section`,{"aria-labelledby":`rp-step`,className:`flex min-w-0 flex-col gap-6`,children:[(0,X.jsx)(`h2`,{id:`rp-step`,className:`m-0 text-[20px] font-semibold tracking-[-0.01em]`,children:[`Which page, on which devices?`,`What should ForgeQE do?`,`What should be checked?`,`Check and start`][i]}),H&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:H}),i===0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(We,{id:`rp-url`,label:`Page address`,help:e.start&&u.trim()===e.start?`The active environment's web app, from env.yaml.`:`An http or https address; sign in on the page itself.`,children:(0,X.jsx)(A,{id:`rp-url`,type:`url`,value:u,placeholder:`https://your-app.example.com`,spellCheck:!1,onChange:e=>d(e.target.value)})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{id:`rp-on`,className:`text-sm font-medium`,children:`Run on`}),(0,X.jsx)(ce,{labelledBy:`rp-on`,value:D,onChange:O,options:[{id:`local`,label:`This computer`,tip:`ForgeQE's own browser, in the background`},...[`browserstack`,`testmu`].map(t=>({id:t,label:J[t],disabled:!e.clouds[t]?.ready,tip:e.clouds[t]?.ready?`A real browser on ${J[t]}: one session for every device`:`Not signed in: ${e.clouds[t]?.missing??`no sign-in`}. Save it in Settings › Secrets.`}))]}),D!==`local`&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 pt-2`,children:[(0,X.jsxs)(`span`,{id:`rp-kind`,className:`text-sm font-medium`,children:[`Devices on `,J[D]]}),(0,X.jsx)(ce,{labelledBy:`rp-kind`,value:N,onChange:ne,options:[{id:`real`,label:`Real devices`,tip:`Phones and tablets ${J[D]} lists now, each its own session`},{id:`browser`,label:`Emulated in a browser`,tip:`The device list emulated in one desktop browser on the cloud`}]})]}),D!==`local`&&!B&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 pt-2`,children:[(0,X.jsxs)(`label`,{htmlFor:`rp-browser`,className:`text-sm font-medium`,children:[`Browser on `,J[D]]}),(0,X.jsx)(ee,{id:`rp-browser`,value:k,onChange:e=>te(e.target.value),className:`max-w-[360px]`,children:e.browsers.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,X.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`One `,J[D],` session for the whole run, each device in its own window of it. It takes longer to start than this computer, and counts against your `,J[D],` plan. A page on this computer or your own network cannot be reached from there.`]})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:`Devices`}),B?I?(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:I}):P?.cloud===D?(0,X.jsx)(ve,{devices:re,picked:R,max:P.max,onChange:z,real:J[D]}):(0,X.jsxs)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:[`Asking `,J[D],` for its devices…`]}):(0,X.jsx)(ve,{devices:e.devices,picked:f,max:e.maxPanes,onChange:p,...D===`local`?{}:{drawnBy:`${M} on ${J[D]}`}})]}),(0,X.jsx)(Ge,{busy:W,next:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(x,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>G(1),disabled:!fe||!ie.length,aside:fe?void 0:(0,X.jsx)(`span`,{className:`text-muted`,children:`Enter the page's address.`})})]}),i===1&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:[`ForgeQE reads your prompt as steps and does each on every device in its own browser in the background, planned for each layout from what its screen shows (a phone's menu is often behind a button). After every step it checks every device and keeps a screenshot of each. What the prompt asks to verify becomes a check. It goes on if you leave the page.`,e.planner?``:` No model is set up, so the prompt is read line by line and only plain steps work (click …, scroll down, go back, press Enter).`]}),(0,X.jsx)(Ze,{prompt:m,setPrompt:h,files:g,setFiles:_,source:v,setSource:y,flows:oe,onFlowsChanged:ue,onError:U}),(0,X.jsx)(Ge,{busy:W,onBack:()=>G(0),next:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(x,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>G(2),disabled:!m.trim(),aside:m.trim()?void 0:(0,X.jsx)(`span`,{className:`text-muted`,children:`Say what to do.`})})]}),i===2&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,X.jsx)(`legend`,{className:`mb-2 p-0 text-sm font-medium`,children:`Checked by ForgeQE on every device`}),e.checks.map(e=>(0,X.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-[8px] px-2 py-1 hover:bg-surface-muted`,children:[(0,X.jsx)(de,{className:`mt-1`,checked:b.includes(e.id),onCheckedChange:t=>S(t?[...b,e.id]:b.filter(t=>t!==e.id))}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:e.label}),(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.about})]})]},e.id))]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:`Your own checks`}),(0,X.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`In plain words, judged on each layout from what its screen shows; a finding always quotes the screen.`,e.planner?``:` No model is set up, so these are not judged.`]}),w.map((e,t)=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(A,{"aria-label":`Your check ${t+1}`,value:e,maxLength:300,placeholder:`The cart total shows without scrolling`,onChange:e=>T(w.map((n,r)=>r===t?e.target.value:n)),className:`min-w-0 flex-1`}),(0,X.jsx)(j,{variant:`icon`,size:`icon`,"aria-label":`Remove your check ${t+1}`,"data-tip":`Remove`,onClick:()=>T(w.filter((e,n)=>n!==t)),children:(0,X.jsx)(s,{"aria-hidden":`true`})})]},t)),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsxs)(`button`,{type:`button`,className:Ke,disabled:w.length>=ze,onClick:()=>T([...w,``]),children:[(0,X.jsx)(C,{size:13,"aria-hidden":`true`}),`Add a check`]}),Be.map(e=>(0,X.jsxs)(`button`,{type:`button`,className:Ke,disabled:w.includes(e)||w.length>=ze,onClick:()=>T([...w.filter(e=>e.trim()),e]),children:[(0,X.jsx)(C,{size:13,"aria-hidden":`true`}),e]},e))]})]}),(0,X.jsx)(Ge,{busy:W,onBack:()=>G(1),next:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(x,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>G(3),aside:!b.length&&!K.length?(0,X.jsx)(`span`,{className:`text-muted`,children:`Only what your prompt asks to verify will be checked.`}):void 0})]}),i===3&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`dl`,{className:`m-0 grid grid-cols-[minmax(0,1fr)] gap-4 @xl:grid-cols-[160px_minmax(0,1fr)]`,children:[(0,X.jsx)(`dt`,{className:`text-[13px] font-medium text-muted`,children:`Page`}),(0,X.jsx)(`dd`,{className:`m-0 text-sm [overflow-wrap:anywhere]`,children:u.trim()}),(0,X.jsx)(`dt`,{className:`text-[13px] font-medium text-muted`,children:`Devices`}),(0,X.jsx)(`dd`,{className:`m-0 text-sm`,children:ae.join(`, `)}),(0,X.jsx)(`dt`,{className:`text-[13px] font-medium text-muted`,children:`Runs on`}),(0,X.jsx)(`dd`,{className:`m-0 text-sm`,children:V}),(0,X.jsx)(`dt`,{className:`text-[13px] font-medium text-muted`,children:`What to do`}),(0,X.jsx)(`dd`,{className:`m-0 text-sm`,children:(0,X.jsxs)(`span`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`rounded-[12px] bg-surface-muted px-4 py-2 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:m.trim()}),g.length>0&&(0,X.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`Attached: `,g.map(e=>e.name).join(`, `)]}),(0,X.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Read as steps and checks when the run starts; the run's page shows how.`})]})}),(0,X.jsx)(`dt`,{className:`text-[13px] font-medium text-muted`,children:`Checks`}),(0,X.jsxs)(`dd`,{className:`m-0 flex flex-col gap-1 text-sm`,children:[b.map(t=>(0,X.jsx)(`span`,{children:e.checks.find(e=>e.id===t)?.label},t)),K.map(t=>(0,X.jsxs)(`span`,{className:E(!e.planner&&`text-muted`),children:[`“`,t,`”`,e.planner?``:` (not judged: no model)`]},t))]})]}),(0,X.jsx)(Ge,{busy:W,onBack:()=>G(2),next:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(a,{"aria-hidden":`true`}),W?`Starting…`:`Start`]}),onNext:()=>void pe(),aside:(0,X.jsx)(`span`,{className:`text-muted`,children:`Opens in ForgeQE's own browser on this computer; screenshots and findings are kept with the run.`})})]})]}),(0,X.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,X.jsx)(Qe,{info:e,url:u,named:ae,where:V,prompt:m,files:g.length,checks:b,custom:w})})]})]})}function $({tab:e,wide:t,action:n,children:r}){let i=w(`responsive`);return(0,X.jsx)(U,{title:N(`responsive`),page:i,label:`Responsive`,current:e,onPick:e=>location.hash=e===`agent`?y(`responsive`):y(`responsive`,`runs`),tabs:[{id:`runs`,label:`Runs`}],below:(0,X.jsx)(ue,{page:i}),...t?{wide:t}:{},...n?{end:n}:{},children:r})}function et({sub:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)(``),s=(0,q.useCallback)(()=>{Promise.all([Y.info(),Y.runs()]).then(([e,t])=>{n(e),i(t.runs),o(``)},e=>o(e.message))},[]);(0,q.useEffect)(s,[s,e]);let c=!!r?.some(e=>e.status===`running`);(0,q.useEffect)(()=>{if(!c||e!==`runs`)return;let t=B(s,3e3);return()=>se(t)},[c,e,s]);let l=()=>location.hash=y(`responsive`,`new`),u=a&&(0,X.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a}),d=!t&&!a&&(0,X.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});if(e===`new`)return(0,X.jsxs)($,{tab:`runs`,children:[u,d,t&&(0,X.jsx)($e,{info:t,onStarted:e=>location.hash=y(`responsive`,e)})]});if(e&&he.test(e))return(0,X.jsxs)($,{tab:`runs`,wide:!0,children:[u,d,(0,X.jsx)(Le,{id:e},e)]});if(e!==`runs`)return(0,X.jsx)($,{tab:G});let f=r?.find(e=>e.status===`running`);return(0,X.jsxs)($,{tab:`runs`,action:r&&!r.length?void 0:(0,X.jsxs)(j,{variant:`primary`,disabled:!t||!!f,onClick:l,"data-tip":f?`A run is going: finish or stop it first`:`New run`,children:[(0,X.jsx)(C,{"aria-hidden":`true`}),`New`]}),children:[u,d,t&&r&&(r.length?(0,X.jsx)(Ce,{rows:r}):(0,X.jsx)(I,{icon:b,title:`No runs yet`,action:(0,X.jsxs)(j,{size:`sm`,onClick:l,"data-tip":`New run`,children:[(0,X.jsx)(C,{"aria-hidden":`true`}),`New`]}),children:`Pick a page and the phones, tablets and desktops to show it on, say in a prompt what to do (or start from a test case or a saved prompt), and say what to check. The run goes on by itself, and each device is checked after every step, with a screenshot of each.`}))]})}export{et as Responsive};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Br as n,Ct as r,Gr as i,H as a,Hn as o,I as s,J as c,L as l,M as u,N as d,Pt as f,S as p,Tt as m,Vr as ee,Wn as h,Xn as g,_,_n as v,cr as te,dn as y,dr as b,dt as x,fr as S,ft as C,in as ne,n as re,or as ie,r as w,vr as ae,w as T,zt as oe}from"./route-Mq0QZuqV.js";import{f as se}from"./agents-BUWN-VJv.js";import{t as ce}from"./jsx-runtime-LKYXHABd.js";import{A as E,Z as le,i as ue,j as D,kt as O,n as de}from"./input-1RVqxCVH.js";import{C as fe,D as k,O as pe,T as A,a as me,n as he,o as j,r as ge,s as _e}from"./logLevel-CFPS8IkY.js";import{L as ve}from"./palette-5nApQc76.js";import{$ as ye,F as be,Fn as M,Ft as xe,I as Se,It as Ce,Lt as we,Nn as Te,P as Ee,Pn as N,Pt as P,S as De,X as Oe,Xt as ke,Yt as Ae,b as F,dt as je,ft as I,x as L,xn as Me,z as Ne}from"./index-Cg0SmlXN.js";import{r as Pe,t as Fe}from"./Response-CJSq1qN7.js";import{n as Ie}from"./families-CfIM4f2s.js";var R=e(i(),1),z=ce(),B={execution:`Execution`,report:`Report`,coding:`Coding`,chat:`Chat`},Le={execution:m,report:x,coding:c,chat:v};function Re({kind:e}){let t=Le[e];return(0,z.jsx)(A,{icon:t,size:14,className:`flex-none text-muted`})}var ze={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`}},V=e=>ze[e]||{label:e?e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g,` `):`–`,tone:`neutral`},Be={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`App run`},Ve=e=>{if(!e)return``;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`};function H({title:e,icon:t,children:n,aside:r,className:i}){return(0,z.jsxs)(`section`,{className:E(`flex flex-col gap-4 border-t border-line-soft pt-6`,i),children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsxs)(`h3`,{className:`m-0 flex flex-1 items-center gap-2 text-base font-semibold`,children:[(0,z.jsx)(`span`,{className:`text-accent-fg`,children:t}),e]}),r]}),n]})}function He({path:e,label:t=`Report`}){let[n,r]=(0,R.useState)(``);return(0,z.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2`,children:[(0,z.jsxs)(k,{"data-tip":`Open the report`,onClick:async()=>r(await fe(e)),children:[(0,z.jsx)(C,{"aria-hidden":`true`}),t]}),n&&(0,z.jsx)(`span`,{className:`text-[13px] text-fail`,children:n})]})}function U({items:e,first:n,render:r}){let[i,a]=(0,R.useState)(!1);return(0,z.jsxs)(z.Fragment,{children:[(i?e:e.slice(0,n)).map(r),e.length>n&&(0,z.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(!i),className:`inline-flex min-h-8 cursor-pointer items-center gap-1 self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:[i?(0,z.jsx)(d,{size:14,"aria-hidden":`true`}):(0,z.jsx)(t,{size:14,"aria-hidden":`true`}),i?`Less`:`All (${e.length})`]})]})}function Ue({c:e}){if(!e.total)return null;let t=t=>`${t/e.total*100}%`;return(0,z.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,z.jsx)(`div`,{className:`bg-pass transition-[width] duration-200 ease-out`,style:{width:t(e.passed)}}),(0,z.jsx)(`div`,{className:`bg-fail transition-[width] duration-200 ease-out`,style:{width:t(e.failed)}}),(0,z.jsx)(`div`,{className:`bg-warn transition-[width] duration-200 ease-out`,style:{width:t(e.other)}})]})}function We({e}){let t=e.counts.total?Math.round(e.counts.passed/e.counts.total*100):0;return(0,z.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-line-soft pt-4 first:border-t-0 first:pt-0`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-2`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,z.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,z.jsx)(`span`,{className:`text-[13px] text-muted`,children:[Be[e.scope]||e.scope,Ve(e.ms),e.tokens?`${I(e.tokens)} tokens`:``,e.stopped?`stopped early`:``].filter(Boolean).join(` · `)})]}),e.report&&(0,z.jsx)(He,{path:e.report})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,z.jsxs)(`span`,{className:`text-[20px] font-semibold tabular-nums`,children:[t,`%`]}),(0,z.jsx)(`span`,{className:`text-muted`,children:`passed`}),(0,z.jsxs)(j,{tone:`pass`,children:[e.counts.passed,` passed`]}),e.counts.failed>0&&(0,z.jsxs)(j,{tone:`fail`,children:[e.counts.failed,` failed`]}),e.counts.other>0&&(0,z.jsxs)(j,{tone:`warn`,children:[e.counts.other,` other`]}),(0,z.jsxs)(`span`,{className:`text-muted`,children:[`of `,e.counts.total]})]}),(0,z.jsx)(Ue,{c:e.counts}),e.cases.length>0&&(0,z.jsx)(`ul`,{"aria-label":`Cases of ${e.title}`,className:`m-0 flex list-none flex-col p-0`,children:(0,z.jsx)(U,{items:e.cases.toSorted((e,t)=>Number(V(t.status).tone===`fail`)-Number(V(e.status).tone===`fail`)),first:6,render:(e,t)=>(0,z.jsxs)(`li`,{className:`flex min-w-0 items-start gap-4 border-t border-line-soft py-2 text-sm`,children:[(0,z.jsx)(`span`,{className:`w-[76px] flex-none`,children:(0,z.jsx)(j,{tone:V(e.status).tone,children:V(e.status).label})}),(0,z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,z.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[e.id&&(0,z.jsx)(`span`,{className:`mr-2 font-mono text-[13px] text-muted`,children:e.id}),e.title,e.device&&(0,z.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.device]})]}),e.summary&&(0,z.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted`,children:e.summary})]}),(0,z.jsx)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:Ve(e.ms)})]},`${e.id}-${t}`)})}),e.folder&&!e.report&&(0,z.jsxs)(`span`,{className:`text-sm`,children:[`Kept in `,(0,z.jsx)(F,{path:e.folder})]})]})}function Ge({list:e,className:t}){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,z.jsx)(H,{...t?{className:t}:{},title:`Execution summary`,icon:(0,z.jsx)(A,{icon:m,size:18}),aside:e.length>1?(0,z.jsxs)(`span`,{className:`text-sm text-muted`,children:[D(e.length,`run`),` · `,n.passed,` of `,n.total,` passed`]}):void 0,children:e.length?e.map((e,t)=>(0,z.jsx)(We,{e},`${e.folder||e.title}-${t}`)):(0,z.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 Ke({list:e,className:t}){return(0,z.jsxs)(H,{...t?{className:t}:{},title:`Report summary`,icon:(0,z.jsx)(A,{icon:x,size:18}),children:[e.length===0&&(0,z.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No report was written in this run.`}),e.map((e,t)=>(0,z.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-line-soft pt-4 first:border-t-0 first:pt-0`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-2`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,z.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,z.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,z.jsx)(He,{path:e.path})]}),e.stats&&(0,z.jsx)(`dl`,{className:`m-0 grid grid-cols-[repeat(auto-fit,minmax(110px,1fr))] gap-2`,children:e.stats.map(e=>(0,z.jsxs)(`div`,{className:`rounded-[10px] bg-surface-muted px-4 py-2`,children:[(0,z.jsx)(`dt`,{className:`text-[13px] text-muted`,children:e.label}),(0,z.jsx)(`dd`,{className:`m-0 text-[20px] font-semibold tabular-nums`,children:e.value})]},e.label))}),e.markdown&&(0,z.jsx)(qe,{text:e.markdown})]},`${e.path||e.title}-${t}`))]})}function qe({text:e,height:n=220}){let[r,i]=(0,R.useState)(!1),[a,o]=(0,R.useState)(!0),[s,c]=(0,R.useState)(n),l=(0,R.useRef)(null);return(0,R.useLayoutEffect)(()=>{l.current&&!r&&o(l.current.scrollHeight>n+8)},[e,n,r]),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsxs)(`div`,{ref:l,style:s===void 0?void 0:{maxHeight:s},onTransitionEnd:e=>e.target===e.currentTarget&&r&&c(void 0),className:E(`transition-[max-height] duration-200 ease-out`,s!==void 0&&`relative overflow-hidden`),children:[(0,z.jsx)(L,{text:e,className:E(`text-sm`,De)}),!r&&a&&(0,z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-bg to-transparent`})]}),(r||a)&&(0,z.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>{let e=l.current?.scrollHeight??n;if(i(!r),ue())return c(r?n:void 0);c(e),r&&requestAnimationFrame(()=>requestAnimationFrame(()=>c(n)))},className:`inline-flex min-h-8 cursor-pointer items-center gap-1 self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:[r?(0,z.jsx)(d,{size:14,"aria-hidden":`true`}):(0,z.jsx)(t,{size:14,"aria-hidden":`true`}),r?`Less`:`More`]})]})}function Je(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 Ye({e}){let[t,n]=(0,R.useState)(!1),r=e.action===`write`?`New`:`Edited`;return(0,z.jsxs)(`li`,{className:`border-t border-line-soft`,children:[(0,z.jsxs)(`div`,{className:`flex min-h-[44px] min-w-0 items-center gap-2 py-2 text-sm`,children:[(0,z.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} the diff of ${e.path}`,"data-tip":`${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,z.jsx)(u,{size:16,"aria-hidden":`true`,className:E(`transition-transform duration-200`,t&&`rotate-90`)})}),(0,z.jsx)(`span`,{className:`w-[52px] flex-none text-[13px] text-muted`,children:r}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,z.jsx)(F,{path:e.path})}),(0,z.jsxs)(`span`,{className:`flex-none font-mono text-[13px] tabular-nums`,children:[(0,z.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,z.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,z.jsx)(Te,{open:t,className:`pb-4 pl-10 [&_pre]:max-h-[420px] [&_pre]:overflow-auto`,children:e.diffs.length?(0,z.jsx)(L,{text:Je(e.diffs),className:De}):null})]})}var Xe={write:`New`,edit:`Edited`,delete:`Deleted`,"test written":`Test`};function W({label:e,children:t}){return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`dt`,{className:`pt-1 text-[13px] text-muted`,children:e}),(0,z.jsx)(`dd`,{className:`m-0 min-w-0 text-sm [overflow-wrap:anywhere]`,children:t})]})}function Ze({c:e,files:t,className: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?[]:t.filter(e=>e.action&&e.action!==`read`);return(0,z.jsxs)(H,{...n?{className:n}:{},title:`Code changes`,icon:(0,z.jsx)(A,{icon:c,size:18}),aside:e.edits.length?(0,z.jsxs)(`span`,{className:`font-mono text-[13px] tabular-nums`,children:[D(e.edits.length,`file`),` · `,(0,z.jsxs)(`span`,{className:`text-pass`,children:[`+`,r]}),` `,(0,z.jsxs)(`span`,{className:`text-fail`,children:[`−`,i]})]}):s.length?(0,z.jsx)(`span`,{className:`text-[13px] text-muted`,children:D(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,z.jsxs)(`div`,{className:`flex flex-col gap-4 border-b border-line-soft pb-4 last:border-b-0 last:pb-0`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,z.jsx)(m,{size:17,strokeWidth:2,"aria-hidden":`true`,className:r?`text-pass`:i?`text-fail`:`text-warn`}),(0,z.jsx)(`span`,{className:`text-[16px] font-semibold`,children:r?`Test written`:i?`Test not finished`:V(t.status).label}),(0,z.jsx)(j,{tone:r?`pass`:i?`fail`:`warn`,children:V(t.status).label}),e.tests.length>0&&(0,z.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[D(e.tests.length,`test run`),a?` (${a} failed)`:``,e.reviews.length?` · ${D(e.reviews.length,`review`)}`:``]})]}),(0,z.jsxs)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-6 gap-y-1 sm:grid-cols-[110px_minmax(0,1fr)] sm:gap-y-4`,children:[t.testFile&&(0,z.jsx)(W,{label:`Test`,children:(0,z.jsx)(F,{path:t.testFile})}),t.command&&(0,z.jsx)(W,{label:`Run it`,children:(0,z.jsx)(Pe,{text:t.command})}),(t.review||o)&&(0,z.jsx)(W,{label:`Review`,children:(0,z.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,z.jsx)(`span`,{children:(0,z.jsx)(j,{tone:(t.review??o).approved?`pass`:`warn`,children:(t.review??o).approved?`Approved`:`Changes asked`})}),(t.review?.summary||o?.summary)&&(0,z.jsx)(`span`,{className:`text-ink-2`,children:t.review?.summary||o?.summary})]})}),t.notes&&(0,z.jsx)(W,{label:`Notes`,children:(0,z.jsx)(L,{text:t.notes,className:E(`text-sm text-ink-2 [&_p]:my-0 [&_p+p]:mt-2`,`[&_p]:max-w-none [&_ul]:max-w-none [&_ol]:max-w-none [&_blockquote]:max-w-none [&_h1]:max-w-none [&_h2]:max-w-none [&_h3]:max-w-none [&_h4]:max-w-none [&_h5]:max-w-none [&_h6]:max-w-none`)})})]}),t.error&&(0,z.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:t.error})]},n)}),e.edits.length>0&&(0,z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,z.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,z.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:(0,z.jsx)(U,{items:e.edits,first:8,render:e=>(0,z.jsx)(Ye,{e},e.path)})})]}),s.length>0&&(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,z.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:s.map(e=>(0,z.jsxs)(`li`,{className:`flex min-h-9 min-w-0 items-center gap-4 border-t border-line-soft text-sm first:border-t-0`,children:[(0,z.jsx)(`span`,{className:`w-[52px] flex-none text-[13px] text-muted`,children:Xe[e.action]||e.action.charAt(0).toUpperCase()+e.action.slice(1)}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,z.jsx)(F,{path:e.path})})]},e.path))}),(0,z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Their diffs were not kept for this run.`})]}),!e.edits.length&&!s.length&&!e.results.length&&(0,z.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No files changed.`}),e.edits.some(e=>!e.diffs.length)&&(0,z.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 Qe({final:e,answer:t,className:n}){let i=e.from===`agent`?t?.files??[]:[],a=e.from!==`agent`,o=Math.max(2,...(e.text.match(/`+/g)||[]).map(e=>e.length)),s="`".repeat(o+1);return(0,z.jsxs)(H,{...n?{className:n}:{},title:`Final message`,icon:(0,z.jsx)(r,{size:18,"aria-hidden":`true`}),aside:(0,z.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,z.jsx)(qe,{text:a?`${s}text\n${e.text}\n${s}`:ye(e.text),height:420}),i.length>0&&(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,z.jsx)(`span`,{className:`text-muted`,children:`Files it names:`}),i.map(e=>(0,z.jsx)(F,{path:e},e))]})]})}var $e={rule:{icon:_,label:`Rulebook`},decision:{icon:f,label:`Test decisions`},memory:{icon:p,label:`Page memory`},replay:{icon:o,label:`Replays`},model:{icon:ie,label:`Model`},skill:{icon:oe,label:`Skills`}};function et({list:e,className:t}){let n=Object.keys($e).filter(t=>e.some(e=>e.kind===t));return(0,z.jsx)(H,{...t?{className:t}:{},title:`Learnings`,icon:(0,z.jsx)(A,{icon:ne,size:18}),aside:e.length?(0,z.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[e.length,` from this session`]}):void 0,children:e.length===0?(0,z.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,z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(280px,1fr))] gap-x-6 gap-y-4`,children:n.map(t=>{let{icon:n,label:r}=$e[t];return(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,z.jsxs)(`h4`,{className:`m-0 flex items-center gap-2 text-[13px] font-medium text-muted`,children:[(0,z.jsx)(A,{icon:n,size:14}),r]}),(0,z.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.filter(e=>e.kind===t).map((e,t)=>(0,z.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,z.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.text}),e.note&&(0,z.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.note})]},t))})]},t)})})})}function tt({run:e,className:t}){let n=[],r=t?{className:t}:{};return(e.executions.length||e.kind===`execution`)&&n.push({kind:`execution`,node:(0,z.jsx)(Ge,{list:e.executions,...r},`e`)}),(e.reports.length||e.kind===`report`)&&n.push({kind:`report`,node:(0,z.jsx)(Ke,{list:e.reports,...r},`r`)}),e.coding&&(e.coding.edits.length||e.coding.results.length||e.kind===`coding`)&&n.push({kind:`coding`,node:(0,z.jsx)(Ze,{c:e.coding,files:e.files,...r},`c`)}),n.sort((t,n)=>Number(n.kind===e.kind)-Number(t.kind===e.kind)),(0,z.jsx)(z.Fragment,{children:n.map(e=>e.node)})}var G={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`}},nt={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`},rt=e=>nt[e]||e.charAt(0).toUpperCase()+e.slice(1),K=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`})},q=(e,t)=>Math.max(0,Math.round(((e.status===`running`?t:Date.parse(e.lastAt))-Date.parse(e.startedAt))/1e3)),J=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`:`–`,Y=e=>e.usage.input+e.usage.output;function it(e){let[t,n]=(0,R.useState)(Date.now());return(0,R.useEffect)(()=>{if(!e)return;let t=M(()=>n(Date.now()),1e3);return()=>N(t)},[e]),t}function at({r:e}){return e.origin.kind===`web`?(0,z.jsxs)(`a`,{href:w(`chats`,e.origin.chat),className:`inline-flex items-center gap-2`,children:[(0,z.jsx)(A,{icon:v,size:14}),`Web chat`]}):e.origin.kind===`job`?(0,z.jsxs)(`a`,{href:w(`jobs`,encodeURIComponent(e.origin.job)),className:`inline-flex items-center gap-2`,children:[(0,z.jsx)(A,{icon:T,size:14}),`Job`]}):(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-muted`,children:[(0,z.jsx)(A,{icon:ae,size:14}),`Terminal`]})}var ot=e=>G[e].label;function st({status:e}){let t=G[e].label;return e===`running`?(0,z.jsx)(y,{size:16,"aria-label":t,className:`flex-none animate-spin text-accent-fg`}):e===`done`?(0,z.jsx)(s,{size:16,"aria-label":t,className:`flex-none text-pass`}):e===`failed`?(0,z.jsx)(a,{size:16,"aria-label":t,className:`flex-none text-fail`}):(0,z.jsx)(l,{size:16,"aria-label":t,className:`flex-none text-muted`})}var X=e=>e.status!==`running`&&!e.tools&&!e.turns&&!Y(e)&&!e.files.length&&!e.outputs.length&&q(e,0)<2;function ct(e){return/^forgeqe(-|$)|^engine$/.test(e)?se(e).name:e&&e.charAt(0).toUpperCase()+e.slice(1)}function Z({label:e,children:t,stacked:n=!1}){return n?(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,z.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,z.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:t})]}):(0,z.jsxs)(`div`,{className:`grid grid-cols-[120px_minmax(0,1fr)] items-baseline gap-4 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,z.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,z.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:t})]})}function Q({title:e,children:t}){return(0,z.jsxs)(`section`,{className:`flex min-w-0 flex-col`,children:[(0,z.jsx)(`h3`,{className:`m-0 mb-1 text-[13px] font-semibold`,children:e}),t]})}var lt=8,ut=e=>e===`write`?`Written`:e===`edit`?`Edited`:e===`delete`?`Deleted`:e?e.charAt(0).toUpperCase()+e.slice(1):`Changed`;function dt({run:e,now:t,running:n,events:r}){let i=G[e.status],a=e.executions.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}),o=e.coding?.results.at(-1),s=e.coding?.tests.length??0,c=e.coding?.tests.filter(e=>!e.ok).length??0,l=e.coding?.edits??[],u=l.reduce((e,t)=>e+t.added,0),d=l.reduce((e,t)=>e+t.removed,0),f=l.length||e.files.filter(e=>e.action&&e.action!==`read`).length;return(0,z.jsxs)(xe,{label:`How this run went`,children:[(0,z.jsx)(P,{compact:!0,label:`Outcome`,value:i.label,tone:i.tone===`fail`?`text-fail`:i.tone===`pass`?`text-pass`:void 0,...o?.attempts?{note:`attempt ${o.attempts}${o.maxAttempts?` of ${o.maxAttempts}`:``}`}:{}}),(0,z.jsx)(P,{label:n?`Running for`:`Took`,value:J(q(e,t)),...r?{note:D(r,`event`)}:{}}),a.total>0&&(0,z.jsx)(P,{label:`Cases`,value:`${a.passed}/${a.total}`,...a.failed?{tone:`text-fail`}:a.passed===a.total?{tone:`text-pass`}:{},note:`passed`}),s>0&&(0,z.jsx)(P,{label:`Test runs`,value:s,...c?{note:`${c} failed`}:{}}),f>0&&(0,z.jsx)(P,{label:`Files changed`,value:f,...u+d?{note:`+${u} −${d}`}:{}}),Y(e)>0&&(0,z.jsx)(P,{label:`Tokens`,value:I(Y(e)),note:`${I(e.usage.input)} in · ${I(e.usage.output)} out`})]})}var ft={rerun:h,write_test:b,investigate:g,fix_test:n},pt={rerun:`Retry`,write_test:`Write`,investigate:`Investigate`,fix_test:`Fix`};function mt({actions:e}){let[t,n]=(0,R.useState)(``),[r,i]=(0,R.useState)(``);if(!e.length)return null;let a=async e=>{n(e.prompt),i(``);try{let{id:t}=await le.start(e.prompt,{});location.hash=w(`chats`,t)}catch(e){i(e.message),n(``)}};return(0,z.jsxs)(`section`,{"aria-label":`Next steps`,className:`flex flex-col gap-2`,children:[(0,z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map((e,n)=>(0,z.jsxs)(k,{disabled:!!t,onClick:()=>void a(e),"data-tip":e.note?`${e.label}: ${e.note}`:e.label,className:`max-w-full min-w-0`,children:[(0,z.jsx)(A,{icon:ft[e.kind],size:16,className:`flex-none`}),(0,z.jsx)(`span`,{className:`min-w-0 truncate`,children:t===e.prompt?`Opening…`:pt[e.kind]}),e.note&&(0,z.jsx)(`span`,{className:`min-w-0 flex-[1_1_0] truncate font-normal text-ink-2`,children:e.note})]},n))}),(0,z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Each opens a chat with the request; it asks before it changes anything.`}),r&&(0,z.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:r})]})}var ht=e=>`\`${e.replace(/`/g,``)}\``,gt=[`summary`,`conversation`,`activity`,`details`],_t=e=>gt.find(t=>t===e)??`summary`;function vt({name:e,tab:t}){let[n,r]=(0,R.useState)(null),[i,a]=(0,R.useState)(``),[o,s]=(0,R.useState)(!1),c=_t(t),l=t=>location.hash=t===`summary`?w(`runs`,encodeURIComponent(e)):w(`runs`,encodeURIComponent(e),t),u=(0,R.useCallback)(()=>{O.detail(e).then(e=>{r(e),a(``)},e=>a(e.message))},[e]);(0,R.useEffect)(u,[u]);let d=n?.status===`running`;(0,R.useEffect)(()=>{if(!d)return;let e=M(u,2e3);return()=>N(e)},[u,d]);let f=it(d),p=(0,R.useMemo)(()=>(n?.events??[]).map(Oe).filter(e=>!!e),[n?.events]),m=async()=>{s(!0),a(``);try{await O.cancel(e),u()}catch(e){a(e.message)}finally{s(!1)}},h=(0,z.jsx)(Ee,{href:w(`runs`),label:`All runs`});if(!n)return(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[h,i?(0,z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:i}):(0,z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})]});let g=G[n.status],_=!n.replies.length,v=!!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||n.files.length>0,y=[{id:`summary`,label:`Summary`},{id:`conversation`,label:_?`Command`:`Conversation`,n:n.replies.length||void 0},{id:`activity`,label:`Activity`,n:p.length||void 0},{id:`details`,label:`Details`}],b=new Set([...n.reports.map(e=>e.path),...n.executions.flatMap(e=>[e.report,e.folder])].filter(Boolean)),x=n.outputs.filter(e=>!b.has(e.path)),S=n.context?.limit?Math.round(n.context.tokens/n.context.limit*100):null,C=x.length>0||n.files.length>0?`@3xl:col-span-3`:`@3xl:col-span-4`;return(0,z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[h,(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-4`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-2`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,z.jsx)(`h2`,{className:`m-0 min-w-0 text-[20px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:n.title}),(0,z.jsx)(j,{tone:g.tone,children:g.label})]}),(0,z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-muted`,children:[(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,z.jsx)(Re,{kind:n.kind}),B[n.kind]]}),`· `,(0,z.jsx)(at,{r:n}),`· `,K(n.startedAt),` · `,d?`running for `:`took `,J(q(n,f)),` · `,I(Y(n)),` tokens`,n.profile?.model?` · ${n.profile.model}`:``]})]}),n.cancel&&(0,z.jsxs)(k,{variant:`danger`,disabled:o,"data-tip":n.cancel===`chat`?`Stop this chat's work`:`Cancel this job's run`,onClick:()=>void m(),children:[n.cancel===`chat`?(0,z.jsx)(te,{fill:`currentColor`,"aria-hidden":`true`}):(0,z.jsx)(ee,{"aria-hidden":`true`}),o?`Stopping…`:n.cancel===`chat`?`Stop`:`Cancel`]})]}),i&&(0,z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}),n.error&&(0,z.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[(0,z.jsx)(`strong`,{children:`What went wrong:`}),` `,n.error]}),!d&&(0,z.jsx)(mt,{actions:n.actions??[]}),(0,z.jsx)(we,{prefix:`run`,label:`This run`,className:`mb-0`,current:c,onPick:l,tabs:y}),(0,z.jsxs)(`div`,{role:`tabpanel`,id:`run-panel-${c}`,"aria-labelledby":`run-${c}`,className:`flex min-w-0 flex-col gap-6`,children:[c===`summary`&&(0,z.jsxs)(z.Fragment,{children:[v&&(0,z.jsx)(dt,{run:n,now:f,running:d,events:p.length}),(0,z.jsxs)(`div`,{className:`grid items-start gap-x-12 gap-y-6 @3xl:grid-cols-4 @3xl:[grid-auto-flow:dense]`,children:[n.final&&(0,z.jsx)(Qe,{final:n.final,answer:n.answer,className:C}),(0,z.jsx)(tt,{run:n,className:C}),x.length>0&&(0,z.jsx)(`section`,{className:`flex min-w-0 flex-col border-t border-line-soft pt-6 @3xl:col-span-1`,children:(0,z.jsx)(Q,{title:`What it produced (${x.length})`,children:x.map(e=>(0,z.jsx)(Z,{label:e.label,stacked:!0,children:(0,z.jsx)(F,{path:e.path,children:e.path.split(`/`).pop()})},e.path))})}),n.files.length>0&&(0,z.jsx)(`section`,{className:`flex min-w-0 flex-col border-t border-line-soft pt-6 @3xl:col-span-1`,children:(0,z.jsx)(Q,{title:`Files worked on (${n.files.length})`,children:(0,z.jsx)(U,{items:[...n.files].sort((e,t)=>Number(e.action===`read`)-Number(t.action===`read`)),first:lt,render:e=>(0,z.jsx)(Z,{label:ut(e.action),stacked:!0,children:e.action===`delete`?(0,z.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.path.split(`/`).pop()}):(0,z.jsx)(F,{path:e.path,children:e.path.split(`/`).pop()})},e.path)})})}),n.learnings.length>0&&(0,z.jsx)(et,{list:n.learnings,className:`@3xl:col-span-4`})]}),!v&&(0,z.jsx)(_e,{className:`py-4`,children:d?`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.`})]}),c===`conversation`&&(_?(0,z.jsx)(L,{text:ht(n.prompt),className:`text-sm [&_p]:my-0`}):(0,z.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:n.replies.map((e,t)=>(0,z.jsxs)(`li`,{className:`flex flex-col gap-2`,children:[(0,z.jsx)(`div`,{className:`self-end rounded-[14px] bg-surface-strong px-4 py-2 text-sm max-w-[85%]`,children:(0,z.jsx)(L,{text:e.ask,className:`[&_p]:my-1`})}),e.text&&(0,z.jsx)(L,{text:ye(e.text),className:`text-sm`}),e.error&&(0,z.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e.error})]},t))})),c===`activity`&&(n.archived?(0,z.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-4 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,z.jsx)(`code`,{className:`font-mono text-[13px]`,children:`.forgeqe/runs`}),`; its step-by-step activity was not.`]}):p.length?(0,z.jsx)(Fe,{timeline:!0,lines:p,start:n.startedAt,live:d,name:`forgeqe-run-${n.name.replace(/\.log$/,``)}.md`}):(0,z.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing logged yet.`})),c===`details`&&(0,z.jsxs)(yt,{children:[(0,z.jsxs)(Q,{title:`Numbers`,children:[(0,z.jsx)(Z,{label:d?`Running for`:`Took`,children:J(q(n,f))}),(0,z.jsx)(Z,{label:`Tokens`,children:(0,z.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,z.jsxs)(`span`,{children:[I(Y(n)),` `,(0,z.jsxs)(`span`,{className:`text-muted`,children:[`· `,je(n.usage)]})]}),(n.byAgent?.length??0)>1&&(0,z.jsx)(`span`,{className:`flex flex-col gap-1 text-[13px]`,children:n.byAgent.map(e=>(0,z.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-2`,children:ct(e.agent)}),(0,z.jsx)(`span`,{className:`text-muted tabular-nums`,children:I(e.input+e.output)})]},e.agent))})]})}),(0,z.jsxs)(Z,{label:`Context`,children:[n.context?I(n.context.tokens):`–`,S!==null&&(0,z.jsxs)(`span`,{className:`text-muted`,children:[` of `,I(n.context.limit),` (`,S,`%)`]})]}),(0,z.jsxs)(Z,{label:`Tool calls`,children:[n.tools,` `,(0,z.jsxs)(`span`,{className:`text-muted`,children:[`in `,D(n.turns,`turn`)]})]})]}),(0,z.jsxs)(Q,{title:`Session`,children:[(0,z.jsx)(Z,{label:`Started by`,children:(0,z.jsx)(at,{r:n})}),(0,z.jsx)(Z,{label:`Command`,children:rt(n.command)}),(0,z.jsx)(Z,{label:`Model`,children:n.profile?[n.profile.name,n.profile.model].filter(Boolean).join(` · `):`–`}),(0,z.jsx)(Z,{label:`Agents`,children:n.agents.length?(0,z.jsx)(`span`,{className:`flex flex-col gap-1`,children:n.agents.map(e=>(0,z.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:ct(e.name)}),(0,z.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:D(e.calls,`call`)})]},e.name))}):(0,z.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,z.jsxs)(Z,{label:`Log`,children:[n.archived?(0,z.jsx)(`span`,{className:`text-muted`,children:`No longer kept: ForgeQE keeps the newest logs only`}):(0,z.jsx)(F,{path:`.forgeqe/logs/${n.name}`}),n.truncated&&(0,z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Very long: only its start is shown.`})]})]}),n.job&&(0,z.jsxs)(Q,{title:`Job`,children:[(0,z.jsx)(Z,{label:`Job`,children:(0,z.jsx)(`a`,{href:w(`jobs`,encodeURIComponent(n.origin.kind===`job`?n.origin.job:n.job.name)),children:n.job.name})}),(0,z.jsx)(Z,{label:`Runs`,children:(0,z.jsx)(L,{text:ht(n.job.command),className:`text-sm [&_p]:my-0`})}),(0,z.jsxs)(Z,{label:`Schedule`,children:[n.job.schedule,!n.job.enabled&&` (disabled)`,n.job.nextAt&&n.job.enabled?` · next ${K(n.job.nextAt)}`:``]}),n.job.run&&(0,z.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,z.jsx)(Q,{title:`Notifications`,children:n.notifications.length?n.notifications.map(e=>(0,z.jsx)(Z,{label:e.event.replace(/_/g,` `),children:e.channels.length?e.channels.join(`, `):(0,z.jsx)(`span`,{className:`text-muted`,children:`No channel takes it`})},e.event)):(0,z.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).`})})]})]})]})}function yt({children:e}){let t=R.Children.toArray(e).filter(Boolean),n=t.length%2==1;return(0,z.jsx)(`div`,{className:`grid items-start gap-x-12 gap-y-6 @3xl:grid-cols-4 @3xl:[grid-auto-flow:dense]`,children:t.map((e,r)=>(0,z.jsx)(`section`,{className:E(`flex min-w-0 flex-col border-t border-line-soft pt-6`,n&&r===t.length-1?`@3xl:col-span-4`:`@3xl:col-span-2`),children:e},r))})}var $=25;function bt({runs:e}){let t=it(e.some(e=>e.status===`running`)),[n,r]=(0,R.useState)(``),[i,a]=(0,R.useState)(`all`),[o,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(``),[u,d]=(0,R.useState)(!1),[f,p]=(0,R.useState)(0);(0,R.useEffect)(()=>p(0),[n,i,o,c,u]);let m=e.filter(X).length,ee=n.toLowerCase().split(/\s+/).filter(Boolean),h=e.filter(e=>(u||!X(e))&&(!o||e.kind===o)&&(!c||e.origin.kind===c)&&ee.every(t=>`${e.title} ${e.command} ${e.error||``}`.toLowerCase().includes(t))),g={all:h.length,running:h.filter(e=>e.status===`running`).length,failed:h.filter(e=>e.status===`failed`).length},_=i===`all`?h:h.filter(e=>e.status===i),te=Math.max(1,Math.ceil(_.length/$)),y=Math.min(f,te-1),b=_.slice(y*$,y*$+$),x=e.filter(e=>e.status!==`running`&&!X(e)),C=x.filter(e=>e.status===`failed`).length,ne=x.length?x.reduce((e,n)=>e+q(n,t),0)/x.length:NaN,re=e.reduce((e,t)=>e+Y(t),0),ie=[...new Set(e.map(e=>e.kind))],ae=[...new Set(e.map(e=>e.origin.kind))],T={web:`Web chat`,job:`Job`,terminal:`Terminal`};return e.length===0?(0,z.jsx)(_e,{icon:S,title:`No runs yet`,action:(0,z.jsxs)(`a`,{className:pe({size:`sm`}),href:w(),"data-tip":`Start a chat`,children:[(0,z.jsx)(v,{"aria-hidden":`true`}),`Chat`]}),children:`A chat here, a job, or a ForgeQE command in this project adds one.`}):(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-1 text-[13px] text-muted`,children:[(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`b`,{className:`text-ink tabular-nums`,children:e.length-m}),` runs`]}),e.some(e=>e.status===`running`)&&(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`b`,{className:`text-accent-fg tabular-nums`,children:e.filter(e=>e.status===`running`).length}),` running now`]}),(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`b`,{className:E(`tabular-nums`,C?`text-fail`:`text-ink`),children:C}),` failed`,x.length?` (${Math.round(C/x.length*100)}%)`:``]}),(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`b`,{className:`text-ink tabular-nums`,children:I(re)}),` tokens`]}),(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`b`,{className:`text-ink tabular-nums`,children:J(Math.round(ne))}),` on average`]})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsx)(me,{id:`run-search`,label:`Find a run`,value:n,onChange:r,placeholder:`Find a run by what was asked`}),(0,z.jsx)(he,{items:[{id:`all`,label:`All`,n:g.all},{id:`running`,label:`Running`,n:g.running},{id:`failed`,label:`Failed`,n:g.failed,alert:!0}],value:i,onChange:a}),ie.length>1&&(0,z.jsxs)(de,{size:`sm`,"aria-label":`What it did`,value:o,onChange:e=>s(e.target.value),className:`w-auto pr-8 pl-4`,children:[(0,z.jsx)(`option`,{value:``,children:`Any kind`}),ie.map(e=>(0,z.jsx)(`option`,{value:e,children:B[e]},e))]}),ae.length>1&&(0,z.jsxs)(de,{size:`sm`,"aria-label":`Started by`,value:c,onChange:e=>l(e.target.value),className:`w-auto pr-8 pl-4`,children:[(0,z.jsx)(`option`,{value:``,children:`Started anywhere`}),ae.map(e=>(0,z.jsx)(`option`,{value:e,children:T[e]||e},e))]})]}),(0,z.jsxs)(`div`,{className:`rounded-[14px] card border`,children:[(0,z.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-[13px] font-semibold text-muted @3xl:grid`,children:[(0,z.jsx)(`span`,{className:`w-4`}),(0,z.jsx)(`span`,{children:`Run`}),(0,z.jsx)(`span`,{children:`Kind`}),(0,z.jsx)(`span`,{children:`Started by`}),(0,z.jsx)(`span`,{className:`text-right`,children:`Took`}),(0,z.jsx)(`span`,{className:`text-right`,children:`Tokens`}),(0,z.jsx)(`span`,{className:`text-right`,children:`When`})]}),(0,z.jsxs)(`ul`,{"aria-label":`Runs`,className:`m-0 list-none p-2`,children:[b.length===0&&(0,z.jsx)(`li`,{className:`px-4 py-4 text-sm text-muted`,children:`Nothing matches.`}),b.map((e,n)=>{let r=ke(e.startedAt);return(0,z.jsxs)(`li`,{className:`contents`,children:[(n===0||ke(b[n-1].startedAt)!==r)&&(0,z.jsx)(`span`,{className:`block px-4 pt-4 pb-1 text-[13px] font-semibold text-muted`,children:r}),(0,z.jsxs)(`a`,{href:w(`runs`,encodeURIComponent(e.name)),className:`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-4 rounded-[10px] px-4 py-2 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,z.jsx)(st,{status:e.status}),(0,z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,z.jsx)(`span`,{className:`truncate text-[13px] font-medium`,"data-tip":e.title,children:e.title}),e.error?(0,z.jsx)(`span`,{className:`truncate text-[13px] text-fail`,children:e.error}):(0,z.jsx)(`span`,{className:`truncate text-[13px] text-muted @3xl:hidden`,children:[B[e.kind],T[e.origin.kind],J(q(e,t)),`${I(Y(e))} tokens`].join(` · `)})]}),(0,z.jsxs)(`span`,{className:`hidden min-w-0 items-center gap-2 text-[13px] text-ink-2 @3xl:inline-flex`,children:[(0,z.jsx)(Re,{kind:e.kind}),B[e.kind]]}),(0,z.jsx)(`span`,{className:`hidden text-[13px] text-ink-2 @3xl:block`,children:T[e.origin.kind]||e.origin.kind}),(0,z.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:J(q(e,t))}),(0,z.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:I(Y(e))}),(0,z.jsx)(`span`,{className:`text-right text-[13px] text-muted tabular-nums`,"data-tip":K(e.startedAt),children:Ae(e.startedAt)})]})]},e.name)})]}),(0,z.jsx)(ge,{page:y,size:$,total:_.length,onPage:p,label:`Pages of runs`,children:m>0&&(0,z.jsxs)(z.Fragment,{children:[` · `,(0,z.jsx)(`button`,{type:`button`,onClick:()=>d(!u),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:u?`Hide the ${D(m,`empty session`)}`:`${D(m,`empty session`)} hidden`})]})})]})]})}function xt({sub:e}){let[t,n]=(0,R.useState)(null),[r,i]=(0,R.useState)(``),a=(0,R.useCallback)(()=>{O.list().then(e=>{n(e.runs),i(``)},e=>i(e.message))},[]);(0,R.useEffect)(a,[a]);let o=t?.some(e=>e.status===`running`);(0,R.useEffect)(()=>{if(e)return;let t=M(a,o?3e3:2e4);return()=>N(t)},[a,o,e]);let[s,c]=(e||``).split(`/`),l=s?re(s):``;return(0,z.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,z.jsx)(Ne,{}),(0,z.jsx)(`main`,{className:E(Se,`@container flex-auto gap-4`),children:l?(0,z.jsx)(vt,{name:l,tab:c},l):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(be,{}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,z.jsx)(Me,{pixel:ve.runs,size:`lg`}),(0,z.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Runs`})]}),(0,z.jsx)(Ce,{label:`Runs and reports`,links:Ie,current:`runs`})]}),(0,z.jsx)(`p`,{className:`m-0 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,z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r}),!t&&!r&&(0,z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,z.jsx)(bt,{runs:t})]})})]})}export{xt as Runs,st as StatusIcon,X as empty,_t as runTab,ot as statusLabel};
|