@capagents/forgeqe 3.1.9 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HOW_TO_USE.md +43 -4
- package/THIRD_PARTY_NOTICES.md +2 -1
- package/dist/docs-site/docs/area-api/index.html +1 -1
- package/dist/docs-site/docs/area-mobile/index.html +28 -8
- package/dist/docs-site/docs/area-quality/index.html +27 -3
- package/dist/docs-site/docs/area-setup/index.html +1 -1
- package/dist/docs-site/docs/get-started/index.html +4 -1
- package/dist/docs-site/docs/mobile/index.html +19 -7
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/docs-site/docs/web-app/index.html +2 -1
- package/dist/forgeqe.js +1931 -1917
- 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-ByL874l5.js} +1 -1
- package/dist/web/assets/Agent-Drs4mcil.js +8 -0
- package/dist/web/assets/{AgentWork-DEZVZTuJ.js → AgentWork-DLcCZTgu.js} +1 -1
- package/dist/web/assets/ApiTests-BcrTspwJ.js +10 -0
- package/dist/web/assets/Browse-D9eaDrZT.js +1 -0
- package/dist/web/assets/Chat-CMNf9-ys.js +3 -0
- package/dist/web/assets/{CommandPalette-sokhT5PA.js → CommandPalette-Bcf1Muan.js} +1 -1
- package/dist/web/assets/Compare-V5xKnwGO.js +1 -0
- package/dist/web/assets/Cost-DC3DYthD.js +1 -0
- package/dist/web/assets/Data-DzrP-MdL.js +6 -0
- package/dist/web/assets/Desktop-DjTq9eAr.js +1 -0
- package/dist/web/assets/DesktopReview-Buecn3n5.js +2 -0
- package/dist/web/assets/DeviceScreen-CoArZGyY.js +1 -0
- package/dist/web/assets/Evidence-D6VvlFNK.js +1 -0
- package/dist/web/assets/Explore-YkonRPmA.js +2 -0
- package/dist/web/assets/Features-BKB4iSRj.js +1 -0
- package/dist/web/assets/Flags-4GGW38Xu.js +2 -0
- package/dist/web/assets/Flaky-BRcLjYrP.js +1 -0
- package/dist/web/assets/Impact-CvuahLDQ.js +3 -0
- package/dist/web/assets/Jobs-DBCw8Z8I.js +5 -0
- package/dist/web/assets/KindPage-Ige-qO2t.js +6 -0
- package/dist/web/assets/LiveDevice-DI7Bq6ag.js +1 -0
- package/dist/web/assets/Migration-CEwXGs4c.js +8 -0
- package/dist/web/assets/Mobile-BqyFTBeG.js +1 -0
- package/dist/web/assets/Observability-B2Y1pHpD.js +1 -0
- package/dist/web/assets/PageAgent-BRhWi7LL.js +1 -0
- package/dist/web/assets/Product-CXIbmmMF.js +12 -0
- package/dist/web/assets/Production-BOy7ew7l.js +1 -0
- package/dist/web/assets/Quality-Dtcq2AWE.js +1 -0
- package/dist/web/assets/Readiness-B53Drc7i.js +1 -0
- package/dist/web/assets/Record-BuCIDb1d.js +1 -0
- package/dist/web/assets/Regression-BpPXCQIv.js +5 -0
- package/dist/web/assets/{RelationGraph-CeBfmWYf.js → RelationGraph-UXFyQOKO.js} +1 -1
- package/dist/web/assets/Reports-CWCa9uof.js +2 -0
- package/dist/web/assets/Response-C6EmnnQz.js +9 -0
- package/dist/web/assets/Responsive-Bl6i7kB3.js +3 -0
- package/dist/web/assets/{RunDiff-T4e0xs_5.js → RunDiff-CWf9Bkmu.js} +1 -1
- package/dist/web/assets/Runs-C0tfrB_j.js +2 -0
- package/dist/web/assets/Settings-tgCcBEwu.js +21 -0
- package/dist/web/assets/Steps-xASPoq1N.js +3 -0
- package/dist/web/assets/TestCases-Cm4KwWIP.js +1 -0
- package/dist/web/assets/TestData-DMV5S00V.js +2 -0
- package/dist/web/assets/{TestDebt-WuBkOmz5.js → TestDebt-D54mt0ZT.js} +1 -1
- package/dist/web/assets/TestManagement-DBFlK8Xe.js +4 -0
- package/dist/web/assets/WhatsNew-Dp-zP-jw.js +1 -0
- package/dist/web/assets/agents-DPabR9dS.js +1 -0
- package/dist/web/assets/coverage-xSRsKFL6.js +5 -0
- package/dist/web/assets/dataParts-BPff7ClX.js +3 -0
- package/dist/web/assets/desktopAppPath-BVJxel_D.js +1 -0
- package/dist/web/assets/{diff-CZ0iWWGv.js → diff-BXu8cULX.js} +1 -1
- package/dist/web/assets/families-CrnKBjis.js +1 -0
- package/dist/web/assets/{highlight-CGRzYrMa.js → highlight-DCCKhwHj.js} +1 -1
- package/dist/web/assets/index-BsAaOk_G.js +64 -0
- package/dist/web/assets/index-CgpH1pj9.css +2 -0
- package/dist/web/assets/input-BmJ7dt1C.js +1 -0
- package/dist/web/assets/pageBack-BNLSF2VR.js +3 -0
- package/dist/web/assets/palette-BS9ixqiJ.js +1 -0
- package/dist/web/assets/{paletteCommands-DU0boMQR.js → paletteCommands-C3knXWbA.js} +1 -1
- package/dist/web/assets/{parts-CTmOGb8E.js → parts-69Ei7EPi.js} +1 -1
- package/dist/web/assets/productParts-CrAb3-j0.js +1 -0
- package/dist/web/assets/qualityParts-BQTnBwPs.js +1 -0
- package/dist/web/assets/{recordTest-H42EwQYC.js → recordTest-DVJCNI0y.js} +1 -1
- package/dist/web/assets/{route-Mq0QZuqV.js → route-D8G-pTdk.js} +1 -1
- package/dist/web/assets/{stepper-ceEfHcbV.js → stepper-t0O_8eQo.js} +1 -1
- package/dist/web/index.html +7 -7
- package/docs/MOBILE.md +22 -7
- package/docs/WEB_APP.md +2 -1
- package/docs/user-guide.html +40 -5
- package/forgeqe.example.yaml +3 -1
- package/package.json +2 -1
- package/prompts/browser-persona.md +1 -1
- package/py/forgeqe_engine/copilot_gateway.py +80 -1
- package/py/forgeqe_engine/diagnostics.py +119 -2
- package/py/forgeqe_engine/persona.py +200 -12
- package/py/forgeqe_engine/service.py +6 -3
- package/py/forgeqe_mobile/a11y.py +322 -0
- package/py/forgeqe_mobile/appium_driver.py +16 -0
- package/py/forgeqe_mobile/live.py +225 -0
- package/py/forgeqe_mobile/service.py +102 -4
- 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/Compare-ChWSXkvf.js +0 -1
- 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/agents-BUWN-VJv.js +0 -1
- package/dist/web/assets/coverage-CWE1aatw.js +0 -5
- package/dist/web/assets/dataParts-ClIBv7-8.js +0 -3
- 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/input-1RVqxCVH.js +0 -1
- 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 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Gr as n,H as r,I as i,R as a,Tr as o,_n as s,_t as c,n as l,r as u}from"./route-Mq0QZuqV.js";import{t as d}from"./jsx-runtime-LKYXHABd.js";import{A as f,Ot as p,Z as m,a as h,n as g}from"./input-1RVqxCVH.js";import{D as _,O as v,n as y,s as b}from"./logLevel-CFPS8IkY.js";import{L as x}from"./palette-5nApQc76.js";import{F as S,I as C,It as w,Nn as T,Yt as E,xn as D,z as O}from"./index-Cg0SmlXN.js";import{n as k}from"./families-CfIM4f2s.js";import{_ as A,o as j}from"./qualityParts-CnlpML55.js";var M=e(n(),1),N=d(),P={server:{label:`The server answered differently`,hint:`A call returned another status: likely a product or backend change, not the test. File it as a defect if the first run was right.`},locator:{label:`An element was not found`,hint:`The page likely changed under the test. If the change was intended, heal the test; if not, it is a product bug.`},navigation:{label:`It reached another page`,hint:`A redirect, a sign-in, a feature flag or the environment's settings may differ between the runs.`},path:{label:`It took another path`,hint:`The run did something else here: the flow changed, or the agent found another way through it.`},data:{label:`Same step, another outcome`,hint:`The step was the same but ended otherwise: the test data, the account or what the page held likely differs.`},timing:{label:`Only the timing differs`,hint:`A slow environment, or a wait that races the page: a likely cause of flaky failures.`},errors:{label:`New browser errors`,hint:`The page raised errors in the second run that it did not in the first.`},missing:{label:`A step only one run did`,hint:`One run has a step the other does not: a dialog, a retry or a changed flow.`}},F=e=>`${(e/1e3).toFixed(1)}s`,I=e=>`${e.goal.slice(0,80)} · ${e.status} · ${E(e.at)}`;function L(e,t){let n=e.find(e=>e.id===t),r=e.filter(e=>e.id!==t);if(!n)return{same:[],other:r};let i=n.goal.trim().toLowerCase();return{same:r.filter(e=>e.goal.trim().toLowerCase()===i),other:r.filter(e=>e.goal.trim().toLowerCase()!==i)}}function R({run:e,step:t}){let[n,r]=(0,M.useState)(``),[i,a]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{let n=!1;return r(``),a(!1),t?.shot&&p.shot(e,t.n,t.shot).then(e=>!n&&r(e),()=>!n&&a(!0)),()=>{n=!0}},[e,t?.n,t?.shot]),t?!t.shot||i?(0,N.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-6 text-center text-[13px] text-muted`,children:`No screenshot`}):n?(0,N.jsx)(`img`,{src:n,alt:`Step ${t.n} of ${e}`,className:`max-h-[420px] w-full rounded-[12px] border border-line-soft object-contain object-top`}):(0,N.jsx)(`div`,{className:`min-h-24 rounded-[12px] bg-surface-muted`}):(0,N.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-6 text-center text-[13px] text-muted`,children:`Not in this run`})}function z({step:e,other:t}){if(!e)return(0,N.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Not in this run`});let n=e.ok?i:r,a=new Set((t?.calls??[]).map(e=>`${e.method} ${e.path} ${e.status}`)),o=t?e.calls.filter(e=>!a.has(`${e.method} ${e.path} ${e.status}`)):[];return(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,N.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2`,children:[(0,N.jsx)(n,{size:14,"aria-label":e.ok?`Passed`:`Failed`,className:f(`mt-1 flex-none`,e.ok?`text-pass`:`text-fail`)}),(0,N.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:e.action||`–`})]}),(0,N.jsxs)(`span`,{className:`truncate text-[13px] text-muted`,"data-tip":e.title?`${e.title} · ${e.page}`:e.page,children:[e.page,typeof e.ms==`number`?` · ${F(e.ms)}`:``]}),e.error&&(0,N.jsx)(`span`,{className:`text-[13px] text-fail [overflow-wrap:anywhere]`,children:e.error}),o.slice(0,3).map(e=>(0,N.jsxs)(`span`,{className:f(`truncate font-mono text-[13px]`,e.status>=400||e.failed?`text-fail`:`text-muted`),"data-tip":`${e.method} ${e.path}`,children:[e.method,` `,e.path,` `,e.failed?`no answer`:e.status]},`${e.method} ${e.path}`)),e.problems.slice(0,2).map(e=>(0,N.jsx)(`span`,{className:`truncate text-[13px] text-warn`,"data-tip":e,children:e},e))]})}function B({row:e,i:n,a:r,b:i,focus:a,open:o,onToggle:s}){let c=e.a?.n,l=e.b?.n;return(0,N.jsxs)(`li`,{id:a?`look-here`:void 0,className:f(`border-t border-line-soft`,!e.same&&`bg-warn-soft/40`,a&&`outline-2 -outline-offset-2 outline-warn`),children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] items-start gap-4 px-4 py-2 text-[13px]`,children:[(0,N.jsx)(`span`,{className:`pt-1 text-muted tabular-nums`,"data-tip":c!==void 0&&l!==void 0&&c!==l?`Step ${c} of the first run, ${l} of the second`:void 0,children:c!==void 0&&l!==void 0&&c!==l?`${c}·${l}`:c??l??n+1}),(0,N.jsx)(z,{step:e.a,other:e.b}),(0,N.jsx)(z,{step:e.b,other:e.a}),(0,N.jsx)(_,{variant:`icon`,size:`icon-sm`,"aria-label":o?`Hide screenshots`:`Show screenshots`,"aria-expanded":o,onClick:s,"data-tip":o?`Hide screenshots`:`Show screenshots`,children:(0,N.jsx)(t,{"aria-hidden":`true`,className:f(`transition-transform`,o&&`rotate-180`)})})]}),!e.same&&(0,N.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pb-2 pl-[3.75rem] text-[13px] text-ink-2`,children:[a&&e.kind&&(0,N.jsxs)(`span`,{className:`font-medium text-warn`,children:[`Look here first: `,P[e.kind].label]}),e.differences.map(e=>(0,N.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e},e))]}),(0,N.jsx)(T,{open:o,children:(0,N.jsxs)(`div`,{className:`grid grid-cols-1 items-start gap-4 px-4 pb-4 @2xl:grid-cols-2`,children:[(0,N.jsx)(R,{run:r,step:e.a}),(0,N.jsx)(R,{run:i,step:e.b})]})})]})}function V({runs:e,a:t,b:n}){let[r,i]=(0,M.useState)(t??``),[a,o]=(0,M.useState)(n??``);(0,M.useEffect)(()=>{i(t??``),o(n??``)},[t,n]);let{same:s,other:l}=L(e,r);return(0,N.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),r&&a&&r!==a&&(location.hash=u(`run-diff`,`${encodeURIComponent(r)}~${encodeURIComponent(a)}`))},children:[(0,N.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-[13px] font-medium`,children:[`First run (as expected)`,(0,N.jsxs)(g,{size:`sm`,value:r,onChange:e=>i(e.target.value),children:[(0,N.jsx)(`option`,{value:``,children:`Pick a run`}),e.map(e=>(0,N.jsx)(`option`,{value:e.id,children:I(e)},e.id))]})]}),(0,N.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-[13px] font-medium`,children:[`Second run`,(0,N.jsxs)(g,{size:`sm`,value:a,onChange:e=>o(e.target.value),disabled:!r,children:[(0,N.jsx)(`option`,{value:``,children:r?`Pick a run to compare`:`Pick the first run`}),s.length>0&&(0,N.jsx)(`optgroup`,{label:`Same test`,children:s.map(e=>(0,N.jsx)(`option`,{value:e.id,children:I(e)},e.id))}),(0,N.jsx)(`optgroup`,{label:s.length?`Other runs`:`Runs`,children:l.map(e=>(0,N.jsx)(`option`,{value:e.id,children:I(e)},e.id))})]})]}),(0,N.jsxs)(_,{size:`sm`,variant:`primary`,type:`submit`,disabled:!r||!a||r===a,children:[(0,N.jsx)(c,{"aria-hidden":`true`}),`Compare`]})]})}function H({sub:e}){let[t,n]=(0,M.useState)(null),[r,i]=(0,M.useState)(null),[c,d]=(0,M.useState)(``),[g,T]=(0,M.useState)(`all`),[E,I]=(0,M.useState)(new Set),[L,R]=(0,M.useState)(``),[z,H]=(0,M.useMemo)(()=>{let t=(e?l(e):``).split(`~`);return t.length===2&&t[0]&&t[1]?[t[0],t[1]]:[void 0,void 0]},[e]);(0,M.useEffect)(()=>{p.runs().then(e=>n(e.runs),e=>d(e.message))},[]),(0,M.useEffect)(()=>{let e=!1;if(i(null),R(``),z&&H)return p.diff(z,H).then(t=>{e||(i(t),d(``),I(new Set(t.focus===void 0?[]:[t.focus])))},t=>!e&&d(t.message)),()=>{e=!0}},[z,H]);let U=async()=>{if(r)try{let{id:e}=await m.start(`Compare the browser runs ${r.a.id} and ${r.b.id} in the reports folder, step by step (their steps.json, network.json and screenshots). Say where they first differ and whether that is a product bug, a test that needs healing, test data or the environment, and what to do next.`,{});location.hash=u(`chats`,e)}catch(e){R(e.message)}},W=r?.rows??[],G=W.map((e,t)=>({r:e,i:t})).filter(({r:e})=>g===`all`||!e.same),K=e=>e===void 0?void 0:W[e]?.b?.n??W[e]?.a?.n,q=K(r?.first),J=K(r?.focus);return(0,N.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,N.jsx)(O,{}),(0,N.jsxs)(`main`,{className:f(C,`@container flex-auto gap-4`),children:[(0,N.jsx)(S,{}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,N.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,N.jsx)(D,{pixel:x[`run-diff`],size:`lg`}),(0,N.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Run diff`})]}),(0,N.jsx)(w,{label:`Runs and reports`,links:k,current:`run-diff`})]}),(0,N.jsx)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:`Two browser runs side by side, step by step: a run that passed and one that failed, the same test on two environments or devices, or a test before and after it was healed. Steps are lined up by page and action, and the first one that differs is marked with what it likely means.`}),c&&(0,N.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:c}),!t&&!c&&(0,N.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),t&&t.length<2&&(0,N.jsx)(b,{icon:o,title:`Two runs are needed`,action:(0,N.jsxs)(`a`,{className:v({size:`sm`}),href:u(`record`),"data-tip":`Record a flow`,children:[(0,N.jsx)(a,{"aria-hidden":`true`}),`Record`]}),children:`Every browser run keeps its steps in the reports folder. Run a flow from a chat or the Record page twice, or a test case on two environments, and compare them here.`}),t&&t.length>=2&&(0,N.jsx)(V,{runs:t,a:z,b:H}),z&&H&&!r&&!c&&(0,N.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Comparing…`}),r&&(0,N.jsxs)(`section`,{"aria-label":`Comparison`,className:`flex min-w-0 flex-col gap-4`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-3 @4xl:grid-cols-6 @4xl:divide-x @4xl:divide-line-soft`,children:[(0,N.jsx)(j,{label:`Verdict`,value:r.first===void 0?`Same`:`Differ`,tone:r.first===void 0?`text-pass`:`text-warn`,sub:r.first===void 0?`every step alike`:`from step ${q??`?`}`}),(0,N.jsx)(j,{label:`Steps differing`,value:r.counts.differing,tone:r.counts.differing?`text-warn`:void 0,sub:`of ${W.length} lined up`}),(0,N.jsx)(j,{label:`Steps`,value:`${r.a.steps} · ${r.b.steps}`,sub:`first · second`}),(0,N.jsx)(j,{label:`Time`,value:`${F(r.a.ms)} · ${F(r.b.ms)}`,sub:`first · second`}),(0,N.jsx)(j,{label:`Calls answered otherwise`,value:r.counts.calls,tone:r.counts.calls?`text-fail`:void 0,sub:`steps with a different status`}),(0,N.jsx)(j,{label:`New browser errors`,value:r.counts.errors,tone:r.counts.errors?`text-fail`:void 0,sub:`steps with new errors`})]}),(0,N.jsx)(`div`,{className:`grid grid-cols-1 gap-2 text-[13px] @2xl:grid-cols-2`,children:[r.a,r.b].map((e,t)=>(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,N.jsx)(`span`,{className:`text-[13px] text-muted`,children:t?`Second run`:`First run`}),(0,N.jsx)(`span`,{className:`truncate font-medium`,"data-tip":e.goal,children:e.goal}),(0,N.jsxs)(`span`,{className:`truncate text-[13px] text-muted`,"data-tip":e.startUrl??e.id,children:[e.status,` · `,A(e.at),` · `,e.host??e.id]})]},e.id))}),!r.sameGoal&&(0,N.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:`These runs had different goals: they may not be the same test.`}),r.kind&&(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4 rounded-[12px] bg-warn-soft px-4 py-2 text-[13px]`,children:[(0,N.jsx)(o,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none text-warn`}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,N.jsxs)(`span`,{className:`font-medium`,children:[`Look at step `,J??`?`,` of the second run: `,P[r.kind].label]}),(0,N.jsx)(`span`,{className:`text-ink-2`,children:P[r.kind].hint}),r.first!==r.focus&&r.first!==void 0&&W[r.first]?.kind&&(0,N.jsxs)(`span`,{className:`text-ink-2`,children:[`They first differ at step `,q,`: `,P[W[r.first].kind].label.toLowerCase(),`.`]})]}),(0,N.jsx)(`a`,{href:`#look-here`,onClick:e=>(e.preventDefault(),document.getElementById(`look-here`)?.scrollIntoView({behavior:h(),block:`center`})),className:`self-center text-[13px]`,children:`Go to it`})]}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,N.jsx)(y,{items:[{id:`all`,label:`All steps`,n:W.length},{id:`diff`,label:`Only differences`,n:r.counts.differing,alert:!0}],value:g,onChange:T})}),(0,N.jsxs)(_,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void U(),className:`ml-auto`,children:[(0,N.jsx)(s,{"aria-hidden":`true`}),`Chat`]})]}),L&&(0,N.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:L}),(0,N.jsxs)(`div`,{className:`overflow-hidden rounded-[10px] border border-line`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] gap-4 bg-surface-muted px-4 py-2 text-[13px] text-muted`,children:[(0,N.jsx)(`span`,{children:`Step`}),(0,N.jsx)(`span`,{children:`First run`}),(0,N.jsx)(`span`,{children:`Second run`}),(0,N.jsx)(`span`,{className:`sr-only`,children:`Screenshots`})]}),G.length?(0,N.jsx)(`ol`,{className:`m-0 list-none p-0`,children:G.map(({r:e,i:t})=>(0,N.jsx)(B,{row:e,i:t,a:r.a.id,b:r.b.id,focus:t===r.focus,open:E.has(t),onToggle:()=>{let e=new Set(E);e.has(t)?e.delete(t):e.add(t),I(e)}},t))}):(0,N.jsx)(`p`,{className:`m-0 border-t border-line-soft px-4 py-4 text-[13px] text-muted`,children:`Nothing differs.`})]})]})]})]})}export{P as KIND_TEXT,H as RunDiff,L as choicesFor};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Er as n,H as r,I as i,Kr as a,R as o,_n as s,_t as c,n as l,r as u}from"./route-D8G-pTdk.js";import{t as d}from"./jsx-runtime-LKYXHABd.js";import{A as f,Z as p,a as m,kt as h,n as g}from"./input-BmJ7dt1C.js";import{D as _,E as v,i as y,l as b,n as x}from"./pageBack-BNLSF2VR.js";import{L as S}from"./palette-BS9ixqiJ.js";import{Cn as C,F as w,Fn as T,It as E,Yt as D,z as O}from"./index-BsAaOk_G.js";import{n as k}from"./families-CrnKBjis.js";import{_ as A,o as j}from"./qualityParts-BQTnBwPs.js";var M=e(a(),1),N=d(),P={server:{label:`The server answered differently`,hint:`A call returned another status: likely a product or backend change, not the test. File it as a defect if the first run was right.`},locator:{label:`An element was not found`,hint:`The page likely changed under the test. If the change was intended, heal the test; if not, it is a product bug.`},navigation:{label:`It reached another page`,hint:`A redirect, a sign-in, a feature flag or the environment's settings may differ between the runs.`},path:{label:`It took another path`,hint:`The run did something else here: the flow changed, or the agent found another way through it.`},data:{label:`Same step, another outcome`,hint:`The step was the same but ended otherwise: the test data, the account or what the page held likely differs.`},timing:{label:`Only the timing differs`,hint:`A slow environment, or a wait that races the page: a likely cause of flaky failures.`},errors:{label:`New browser errors`,hint:`The page raised errors in the second run that it did not in the first.`},missing:{label:`A step only one run did`,hint:`One run has a step the other does not: a dialog, a retry or a changed flow.`}},F=e=>`${(e/1e3).toFixed(1)}s`,I=e=>`${e.goal.slice(0,80)} · ${e.status} · ${D(e.at)}`;function L(e,t){let n=e.find(e=>e.id===t),r=e.filter(e=>e.id!==t);if(!n)return{same:[],other:r};let i=n.goal.trim().toLowerCase();return{same:r.filter(e=>e.goal.trim().toLowerCase()===i),other:r.filter(e=>e.goal.trim().toLowerCase()!==i)}}function R({run:e,step:t}){let[n,r]=(0,M.useState)(``),[i,a]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{let n=!1;return r(``),a(!1),t?.shot&&h.shot(e,t.n,t.shot).then(e=>!n&&r(e),()=>!n&&a(!0)),()=>{n=!0}},[e,t?.n,t?.shot]),t?!t.shot||i?(0,N.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-6 text-center text-[13px] text-muted`,children:`No screenshot`}):n?(0,N.jsx)(`img`,{src:n,alt:`Step ${t.n} of ${e}`,className:`max-h-[420px] w-full rounded-[12px] border border-line-soft object-contain object-top`}):(0,N.jsx)(`div`,{className:`min-h-24 rounded-[12px] bg-surface-muted`}):(0,N.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-6 text-center text-[13px] text-muted`,children:`Not in this run`})}function z({step:e,other:t}){if(!e)return(0,N.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Not in this run`});let n=e.ok?i:r,a=new Set((t?.calls??[]).map(e=>`${e.method} ${e.path} ${e.status}`)),o=t?e.calls.filter(e=>!a.has(`${e.method} ${e.path} ${e.status}`)):[];return(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,N.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2`,children:[(0,N.jsx)(n,{size:14,"aria-label":e.ok?`Passed`:`Failed`,className:f(`mt-1 flex-none`,e.ok?`text-pass`:`text-fail`)}),(0,N.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:e.action||`–`})]}),(0,N.jsxs)(`span`,{className:`truncate text-[13px] text-muted`,"data-tip":e.title?`${e.title} · ${e.page}`:e.page,children:[e.page,typeof e.ms==`number`?` · ${F(e.ms)}`:``]}),e.error&&(0,N.jsx)(`span`,{className:`text-[13px] text-fail [overflow-wrap:anywhere]`,children:e.error}),o.slice(0,3).map(e=>(0,N.jsxs)(`span`,{className:f(`truncate font-mono text-[13px]`,e.status>=400||e.failed?`text-fail`:`text-muted`),"data-tip":`${e.method} ${e.path}`,children:[e.method,` `,e.path,` `,e.failed?`no answer`:e.status]},`${e.method} ${e.path}`)),e.problems.slice(0,2).map(e=>(0,N.jsx)(`span`,{className:`truncate text-[13px] text-warn`,"data-tip":e,children:e},e))]})}function B({row:e,i:n,a:r,b:i,focus:a,open:o,onToggle:s}){let c=e.a?.n,l=e.b?.n;return(0,N.jsxs)(`li`,{id:a?`look-here`:void 0,className:f(`border-t border-line-soft`,!e.same&&`bg-warn-soft/40`,a&&`outline-2 -outline-offset-2 outline-warn`),children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] items-start gap-4 px-4 py-2 text-[13px]`,children:[(0,N.jsx)(`span`,{className:`pt-1 text-muted tabular-nums`,"data-tip":c!==void 0&&l!==void 0&&c!==l?`Step ${c} of the first run, ${l} of the second`:void 0,children:c!==void 0&&l!==void 0&&c!==l?`${c}·${l}`:c??l??n+1}),(0,N.jsx)(z,{step:e.a,other:e.b}),(0,N.jsx)(z,{step:e.b,other:e.a}),(0,N.jsx)(v,{variant:`icon`,size:`icon-sm`,"aria-label":o?`Hide screenshots`:`Show screenshots`,"aria-expanded":o,onClick:s,"data-tip":o?`Hide screenshots`:`Show screenshots`,children:(0,N.jsx)(t,{"aria-hidden":`true`,className:f(`transition-transform`,o&&`rotate-180`)})})]}),!e.same&&(0,N.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pb-2 pl-[3.75rem] text-[13px] text-ink-2`,children:[a&&e.kind&&(0,N.jsxs)(`span`,{className:`font-medium text-warn`,children:[`Look here first: `,P[e.kind].label]}),e.differences.map(e=>(0,N.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e},e))]}),(0,N.jsx)(T,{open:o,children:(0,N.jsxs)(`div`,{className:`grid grid-cols-1 items-start gap-4 px-4 pb-4 @2xl:grid-cols-2`,children:[(0,N.jsx)(R,{run:r,step:e.a}),(0,N.jsx)(R,{run:i,step:e.b})]})})]})}function V({runs:e,a:t,b:n}){let[r,i]=(0,M.useState)(t??``),[a,o]=(0,M.useState)(n??``);(0,M.useEffect)(()=>{i(t??``),o(n??``)},[t,n]);let{same:s,other:l}=L(e,r);return(0,N.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),r&&a&&r!==a&&(location.hash=u(`run-diff`,`${encodeURIComponent(r)}~${encodeURIComponent(a)}`))},children:[(0,N.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-[13px] font-medium`,children:[`First run (as expected)`,(0,N.jsxs)(g,{size:`sm`,value:r,onChange:e=>i(e.target.value),children:[(0,N.jsx)(`option`,{value:``,children:`Pick a run`}),e.map(e=>(0,N.jsx)(`option`,{value:e.id,children:I(e)},e.id))]})]}),(0,N.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-[13px] font-medium`,children:[`Second run`,(0,N.jsxs)(g,{size:`sm`,value:a,onChange:e=>o(e.target.value),disabled:!r,children:[(0,N.jsx)(`option`,{value:``,children:r?`Pick a run to compare`:`Pick the first run`}),s.length>0&&(0,N.jsx)(`optgroup`,{label:`Same test`,children:s.map(e=>(0,N.jsx)(`option`,{value:e.id,children:I(e)},e.id))}),(0,N.jsx)(`optgroup`,{label:s.length?`Other runs`:`Runs`,children:l.map(e=>(0,N.jsx)(`option`,{value:e.id,children:I(e)},e.id))})]})]}),(0,N.jsxs)(v,{size:`sm`,variant:`primary`,type:`submit`,disabled:!r||!a||r===a,children:[(0,N.jsx)(c,{"aria-hidden":`true`}),`Compare`]})]})}function H({sub:e}){let[t,r]=(0,M.useState)(null),[i,a]=(0,M.useState)(null),[c,d]=(0,M.useState)(``),[g,T]=(0,M.useState)(`all`),[D,I]=(0,M.useState)(new Set),[L,R]=(0,M.useState)(``),[z,H]=(0,M.useMemo)(()=>{let t=(e?l(e):``).split(`~`);return t.length===2&&t[0]&&t[1]?[t[0],t[1]]:[void 0,void 0]},[e]);(0,M.useEffect)(()=>{h.runs().then(e=>r(e.runs),e=>d(e.message))},[]),(0,M.useEffect)(()=>{let e=!1;if(a(null),R(``),z&&H)return h.diff(z,H).then(t=>{e||(a(t),d(``),I(new Set(t.focus===void 0?[]:[t.focus])))},t=>!e&&d(t.message)),()=>{e=!0}},[z,H]);let U=async()=>{if(i)try{let{id:e}=await p.start(`Compare the browser runs ${i.a.id} and ${i.b.id} in the reports folder, step by step (their steps.json, network.json and screenshots). Say where they first differ and whether that is a product bug, a test that needs healing, test data or the environment, and what to do next.`,{});location.hash=u(`chats`,e)}catch(e){R(e.message)}},W=i?.rows??[],G=W.map((e,t)=>({r:e,i:t})).filter(({r:e})=>g===`all`||!e.same),K=e=>e===void 0?void 0:W[e]?.b?.n??W[e]?.a?.n,q=K(i?.first),J=K(i?.focus);return(0,N.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,N.jsx)(O,{}),(0,N.jsxs)(`main`,{className:f(w,`@container flex-auto gap-4`),children:[(0,N.jsx)(x,{}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,N.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,N.jsx)(C,{pixel:S[`run-diff`],size:`lg`}),(0,N.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Run diff`})]}),(0,N.jsx)(E,{label:`Runs and reports`,links:k,current:`run-diff`})]}),(0,N.jsx)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:`Two browser runs side by side, step by step: a run that passed and one that failed, the same test on two environments or devices, or a test before and after it was healed. Steps are lined up by page and action, and the first one that differs is marked with what it likely means.`}),c&&(0,N.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:c}),!t&&!c&&(0,N.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),t&&t.length<2&&(0,N.jsx)(b,{icon:n,title:`Two runs are needed`,action:(0,N.jsxs)(`a`,{className:_({size:`sm`}),href:u(`record`),"data-tip":`Record a flow`,children:[(0,N.jsx)(o,{"aria-hidden":`true`}),`Record`]}),children:`Every browser run keeps its steps in the reports folder. Run a flow from a chat or the Record page twice, or a test case on two environments, and compare them here.`}),t&&t.length>=2&&(0,N.jsx)(V,{runs:t,a:z,b:H}),z&&H&&!i&&!c&&(0,N.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Comparing…`}),i&&(0,N.jsxs)(`section`,{"aria-label":`Comparison`,className:`flex min-w-0 flex-col gap-4`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-3 @4xl:grid-cols-6 @4xl:divide-x @4xl:divide-line-soft`,children:[(0,N.jsx)(j,{label:`Verdict`,value:i.first===void 0?`Same`:`Differ`,tone:i.first===void 0?`text-pass`:`text-warn`,sub:i.first===void 0?`every step alike`:`from step ${q??`?`}`}),(0,N.jsx)(j,{label:`Steps differing`,value:i.counts.differing,tone:i.counts.differing?`text-warn`:void 0,sub:`of ${W.length} lined up`}),(0,N.jsx)(j,{label:`Steps`,value:`${i.a.steps} · ${i.b.steps}`,sub:`first · second`}),(0,N.jsx)(j,{label:`Time`,value:`${F(i.a.ms)} · ${F(i.b.ms)}`,sub:`first · second`}),(0,N.jsx)(j,{label:`Calls answered otherwise`,value:i.counts.calls,tone:i.counts.calls?`text-fail`:void 0,sub:`steps with a different status`}),(0,N.jsx)(j,{label:`New browser errors`,value:i.counts.errors,tone:i.counts.errors?`text-fail`:void 0,sub:`steps with new errors`})]}),(0,N.jsx)(`div`,{className:`grid grid-cols-1 gap-2 text-[13px] @2xl:grid-cols-2`,children:[i.a,i.b].map((e,t)=>(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,N.jsx)(`span`,{className:`text-[13px] text-muted`,children:t?`Second run`:`First run`}),(0,N.jsx)(`span`,{className:`truncate font-medium`,"data-tip":e.goal,children:e.goal}),(0,N.jsxs)(`span`,{className:`truncate text-[13px] text-muted`,"data-tip":e.startUrl??e.id,children:[e.status,` · `,A(e.at),` · `,e.host??e.id]})]},e.id))}),!i.sameGoal&&(0,N.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:`These runs had different goals: they may not be the same test.`}),i.kind&&(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4 rounded-[12px] bg-warn-soft px-4 py-2 text-[13px]`,children:[(0,N.jsx)(n,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none text-warn`}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,N.jsxs)(`span`,{className:`font-medium`,children:[`Look at step `,J??`?`,` of the second run: `,P[i.kind].label]}),(0,N.jsx)(`span`,{className:`text-ink-2`,children:P[i.kind].hint}),i.first!==i.focus&&i.first!==void 0&&W[i.first]?.kind&&(0,N.jsxs)(`span`,{className:`text-ink-2`,children:[`They first differ at step `,q,`: `,P[W[i.first].kind].label.toLowerCase(),`.`]})]}),(0,N.jsx)(`a`,{href:`#look-here`,onClick:e=>(e.preventDefault(),document.getElementById(`look-here`)?.scrollIntoView({behavior:m(),block:`center`})),className:`self-center text-[13px]`,children:`Go to it`})]}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,N.jsx)(y,{items:[{id:`all`,label:`All steps`,n:W.length},{id:`diff`,label:`Only differences`,n:i.counts.differing,alert:!0}],value:g,onChange:T})}),(0,N.jsxs)(v,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void U(),className:`ml-auto`,children:[(0,N.jsx)(s,{"aria-hidden":`true`}),`Chat`]})]}),L&&(0,N.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:L}),(0,N.jsxs)(`div`,{className:`overflow-hidden rounded-[10px] border border-line`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] gap-4 bg-surface-muted px-4 py-2 text-[13px] text-muted`,children:[(0,N.jsx)(`span`,{children:`Step`}),(0,N.jsx)(`span`,{children:`First run`}),(0,N.jsx)(`span`,{children:`Second run`}),(0,N.jsx)(`span`,{className:`sr-only`,children:`Screenshots`})]}),G.length?(0,N.jsx)(`ol`,{className:`m-0 list-none p-0`,children:G.map(({r:e,i:t})=>(0,N.jsx)(B,{row:e,i:t,a:i.a.id,b:i.b.id,focus:t===i.focus,open:D.has(t),onToggle:()=>{let e=new Set(D);e.has(t)?e.delete(t):e.add(t),I(e)}},t))}):(0,N.jsx)(`p`,{className:`m-0 border-t border-line-soft px-4 py-4 text-[13px] text-muted`,children:`Nothing differs.`})]})]})]})]})}export{P as KIND_TEXT,H as RunDiff,L as choicesFor};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Ct as n,Et as r,Gn as i,H as a,Hr as o,I as s,J as c,Kr as l,L as u,Ln as d,M as f,N as p,Pt as m,S as h,Tr as g,Tt as _,Un as v,Vr as y,Xn as b,Xt as x,Zn as S,_ as C,_n as w,dn as T,dt as E,fr as D,ft as O,in as k,lr as ee,m as te,n as ne,pr as A,r as j,sr as re,tn as ie,w as ae,xt as oe,yr as se,zt as ce}from"./route-D8G-pTdk.js";import{f as le}from"./agents-DPabR9dS.js";import{t as ue}from"./jsx-runtime-LKYXHABd.js";import{A as M,At as de,Z as fe,i as pe,j as N,n as me}from"./input-BmJ7dt1C.js";import{D as he,E as ge,S as _e,a as ve,c as P,i as ye,l as be,n as xe,s as Se,t as Ce,w as F}from"./pageBack-BNLSF2VR.js";import{L as we}from"./palette-BS9ixqiJ.js";import{$ as Te,$t as Ee,C as De,Cn as Oe,F as ke,Fn as Ae,Ft as je,In as Me,It as Ne,Ln as Pe,Lt as Fe,Pt as I,Qt as Ie,S as L,X as Le,Xt as Re,Yt as ze,dt as Be,ft as R,x as z,z as Ve}from"./index-BsAaOk_G.js";import{r as He,t as Ue}from"./Response-C6EmnnQz.js";import{n as We}from"./families-CrnKBjis.js";var B=e(l(),1),V=ue(),H={execution:`Execution`,report:`Report`,coding:`Coding`,chat:`Chat`},Ge={execution:_,report:E,coding:c,chat:w};function Ke({kind:e}){let t=Ge[e];return(0,V.jsx)(F,{icon:t,size:14,className:`flex-none text-muted`})}var qe={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`}},U=e=>qe[e]||{label:e?e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g,` `):`–`,tone:`neutral`},Je={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`App run`},Ye=e=>{if(!e)return``;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`};function W({title:e,icon:t,children:n,aside:r,className:i}){return(0,V.jsx)(Ie,{level:3,icon:t,title:e,actions:r,className:M(`border-t border-line-soft pt-6`,i),children:n})}function Xe({path:e,label:t=`Report`}){let[n,r]=(0,B.useState)(``);return(0,V.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(ge,{"data-tip":`Open the report`,onClick:async()=>r(await _e(e)),children:[(0,V.jsx)(O,{"aria-hidden":`true`}),t]}),n&&(0,V.jsx)(`span`,{className:`text-[13px] text-fail`,children:n})]})}function Ze({items:e,first:n,render:r}){let[i,a]=(0,B.useState)(!1);return(0,V.jsxs)(V.Fragment,{children:[(i?e:e.slice(0,n)).map(r),e.length>n&&(0,V.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,V.jsx)(p,{size:14,"aria-hidden":`true`}):(0,V.jsx)(t,{size:14,"aria-hidden":`true`}),i?`Less`:`All (${e.length})`]})]})}function Qe({c:e}){if(!e.total)return null;let t=t=>`${t/e.total*100}%`;return(0,V.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,V.jsx)(`div`,{className:`bg-pass transition-[width] duration-200 ease-out`,style:{width:t(e.passed)}}),(0,V.jsx)(`div`,{className:`bg-fail transition-[width] duration-200 ease-out`,style:{width:t(e.failed)}}),(0,V.jsx)(`div`,{className:`bg-warn transition-[width] duration-200 ease-out`,style:{width:t(e.other)}})]})}function $e({e}){let t=e.counts.total?Math.round(e.counts.passed/e.counts.total*100):0;return(0,V.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-line-soft pt-4 first:border-t-0 first:pt-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,V.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:[Je[e.scope]||e.scope,Ye(e.ms),e.tokens?`${R(e.tokens)} tokens`:``,e.stopped?`stopped early`:``].filter(Boolean).join(` · `)})]}),e.report&&(0,V.jsx)(Xe,{path:e.report})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,V.jsxs)(`span`,{className:`text-[20px] font-semibold tabular-nums`,children:[t,`%`]}),(0,V.jsx)(`span`,{className:`text-muted`,children:`passed`}),(0,V.jsxs)(P,{tone:`pass`,children:[e.counts.passed,` passed`]}),e.counts.failed>0&&(0,V.jsxs)(P,{tone:`fail`,children:[e.counts.failed,` failed`]}),e.counts.other>0&&(0,V.jsxs)(P,{tone:`warn`,children:[e.counts.other,` other`]}),(0,V.jsxs)(`span`,{className:`text-muted`,children:[`of `,e.counts.total]})]}),(0,V.jsx)(Qe,{c:e.counts}),e.cases.length>0&&(0,V.jsx)(`ul`,{"aria-label":`Cases of ${e.title}`,className:`m-0 flex list-none flex-col p-0`,children:(0,V.jsx)(Ze,{items:e.cases.toSorted((e,t)=>Number(U(t.status).tone===`fail`)-Number(U(e.status).tone===`fail`)),first:6,render:(e,t)=>(0,V.jsxs)(`li`,{className:`flex min-w-0 items-start gap-4 border-t border-line-soft py-2 text-sm`,children:[(0,V.jsx)(`span`,{className:`w-[76px] flex-none`,children:(0,V.jsx)(P,{tone:U(e.status).tone,children:U(e.status).label})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,V.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[e.id&&(0,V.jsx)(`span`,{className:`mr-2 font-mono text-[13px] text-muted`,children:e.id}),e.title,e.device&&(0,V.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.device]})]}),e.summary&&(0,V.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted`,children:e.summary})]}),(0,V.jsx)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:Ye(e.ms)})]},`${e.id}-${t}`)})}),e.folder&&!e.report&&(0,V.jsxs)(`span`,{className:`text-sm`,children:[`Kept in `,(0,V.jsx)(z,{path:e.folder})]})]})}function et({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,V.jsx)(W,{...t?{className:t}:{},title:`Execution summary`,icon:_,aside:e.length>1?(0,V.jsxs)(`span`,{className:`text-sm text-muted`,children:[N(e.length,`run`),` · `,n.passed,` of `,n.total,` passed`]}):void 0,children:e.length?e.map((e,t)=>(0,V.jsx)($e,{e},`${e.folder||e.title}-${t}`)):(0,V.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 tt({list:e,className:t}){return(0,V.jsxs)(W,{...t?{className:t}:{},title:`Report summary`,icon:E,children:[e.length===0&&(0,V.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No report was written in this run.`}),e.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-line-soft pt-4 first:border-t-0 first:pt-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,V.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,V.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,V.jsx)(Xe,{path:e.path})]}),e.stats&&(0,V.jsx)(`dl`,{className:`m-0 grid grid-cols-[repeat(auto-fit,minmax(110px,1fr))] gap-2`,children:e.stats.map(e=>(0,V.jsxs)(`div`,{className:`rounded-[10px] bg-surface-muted px-4 py-2`,children:[(0,V.jsx)(`dt`,{className:`text-[13px] text-muted`,children:e.label}),(0,V.jsx)(`dd`,{className:`m-0 text-[20px] font-semibold tabular-nums`,children:e.value})]},e.label))}),e.markdown&&(0,V.jsx)(nt,{text:e.markdown})]},`${e.path||e.title}-${t}`))]})}function nt({text:e,height:n=220}){let[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(!0),[s,c]=(0,B.useState)(n),l=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{l.current&&!r&&o(l.current.scrollHeight>n+8)},[e,n,r]),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsxs)(`div`,{ref:l,style:s===void 0?void 0:{maxHeight:s},onTransitionEnd:e=>e.target===e.currentTarget&&r&&c(void 0),className:M(`transition-[max-height] duration-200 ease-out`,s!==void 0&&`relative overflow-hidden`),children:[(0,V.jsx)(L,{text:e,className:M(`text-sm`,De)}),!r&&a&&(0,V.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,V.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>{let e=l.current?.scrollHeight??n;if(i(!r),pe())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,V.jsx)(p,{size:14,"aria-hidden":`true`}):(0,V.jsx)(t,{size:14,"aria-hidden":`true`}),r?`Less`:`More`]})]})}function rt(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 it({e}){let[t,n]=(0,B.useState)(!1),r=e.action===`write`?`New`:`Edited`;return(0,V.jsxs)(`li`,{className:`border-t border-line-soft`,children:[(0,V.jsxs)(`div`,{className:`flex min-h-[44px] min-w-0 items-center gap-2 py-2 text-sm`,children:[(0,V.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,V.jsx)(f,{size:16,"aria-hidden":`true`,className:M(`transition-transform duration-200`,t&&`rotate-90`)})}),(0,V.jsx)(`span`,{className:`w-[52px] flex-none text-[13px] text-muted`,children:r}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,V.jsx)(z,{path:e.path})}),(0,V.jsxs)(`span`,{className:`flex-none font-mono text-[13px] tabular-nums`,children:[(0,V.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,V.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,V.jsx)(Ae,{open:t,className:`pb-4 pl-10 [&_pre]:max-h-[420px] [&_pre]:overflow-auto`,children:e.diffs.length?(0,V.jsx)(L,{text:rt(e.diffs),className:De}):null})]})}var at={write:`New`,edit:`Edited`,delete:`Deleted`,"test written":`Test`};function G({label:e,children:t}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`pt-1 text-[13px] text-muted`,children:e}),(0,V.jsx)(`dd`,{className:`m-0 min-w-0 text-sm [overflow-wrap:anywhere]`,children:t})]})}function ot({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,V.jsxs)(W,{...n?{className:n}:{},title:`Code changes`,icon:c,aside:e.edits.length?(0,V.jsxs)(`span`,{className:`font-mono text-[13px] tabular-nums`,children:[N(e.edits.length,`file`),` · `,(0,V.jsxs)(`span`,{className:`text-pass`,children:[`+`,r]}),` `,(0,V.jsxs)(`span`,{className:`text-fail`,children:[`−`,i]})]}):s.length?(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:N(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,V.jsxs)(`div`,{className:`flex flex-col gap-4 border-b border-line-soft pb-4 last:border-b-0 last:pb-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,V.jsx)(_,{size:17,strokeWidth:2,"aria-hidden":`true`,className:r?`text-pass`:i?`text-fail`:`text-warn`}),(0,V.jsx)(`span`,{className:`text-[16px] font-semibold`,children:r?`Test written`:i?`Test not finished`:U(t.status).label}),(0,V.jsx)(P,{tone:r?`pass`:i?`fail`:`warn`,children:U(t.status).label}),e.tests.length>0&&(0,V.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[N(e.tests.length,`test run`),a?` (${a} failed)`:``,e.reviews.length?` · ${N(e.reviews.length,`review`)}`:``]})]}),(0,V.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,V.jsx)(G,{label:`Test`,children:(0,V.jsx)(z,{path:t.testFile})}),t.command&&(0,V.jsx)(G,{label:`Run it`,children:(0,V.jsx)(He,{text:t.command})}),(t.review||o)&&(0,V.jsx)(G,{label:`Review`,children:(0,V.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,V.jsx)(`span`,{children:(0,V.jsx)(P,{tone:(t.review??o).approved?`pass`:`warn`,children:(t.review??o).approved?`Approved`:`Changes asked`})}),(t.review?.summary||o?.summary)&&(0,V.jsx)(`span`,{className:`text-ink-2`,children:t.review?.summary||o?.summary})]})}),t.notes&&(0,V.jsx)(G,{label:`Notes`,children:(0,V.jsx)(L,{text:t.notes,className:M(`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,V.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,V.jsxs)(`div`,{className:`flex flex-col`,children:[(0,V.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,V.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:(0,V.jsx)(Ze,{items:e.edits,first:8,render:e=>(0,V.jsx)(it,{e},e.path)})})]}),s.length>0&&(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,V.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:s.map(e=>(0,V.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,V.jsx)(`span`,{className:`w-[52px] flex-none text-[13px] text-muted`,children:at[e.action]||e.action.charAt(0).toUpperCase()+e.action.slice(1)}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,V.jsx)(z,{path:e.path})})]},e.path))}),(0,V.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,V.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No files changed.`}),e.edits.some(e=>!e.diffs.length)&&(0,V.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 st({final:e,answer:t,className:r}){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,V.jsxs)(W,{...r?{className:r}:{},title:`Final message`,icon:n,aside:(0,V.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,V.jsx)(nt,{text:a?`${s}text\n${e.text}\n${s}`:Te(e.text),height:420}),i.length>0&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,V.jsx)(`span`,{className:`text-muted`,children:`Files it names:`}),i.map(e=>(0,V.jsx)(z,{path:e},e))]})]})}var ct={rule:{icon:C,label:`Rulebook`},decision:{icon:m,label:`Test decisions`},memory:{icon:h,label:`Page memory`},replay:{icon:v,label:`Replays`},model:{icon:re,label:`Model`},skill:{icon:ce,label:`Skills`}};function lt({list:e,className:t}){let n=Object.keys(ct).filter(t=>e.some(e=>e.kind===t));return(0,V.jsx)(W,{...t?{className:t}:{},title:`Learnings`,icon:k,aside:e.length?(0,V.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[e.length,` from this session`]}):void 0,children:e.length===0?(0,V.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,V.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}=ct[t];return(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,V.jsxs)(`h4`,{className:`m-0 flex items-center gap-2 text-[13px] font-medium text-muted`,children:[(0,V.jsx)(F,{icon:n,size:14}),r]}),(0,V.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.filter(e=>e.kind===t).map((e,t)=>(0,V.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,V.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.text}),e.note&&(0,V.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.note})]},t))})]},t)})})})}function ut({run:e,className:t}){let n=[],r=t?{className:t}:{};return(e.executions.length||e.kind===`execution`)&&n.push({kind:`execution`,node:(0,V.jsx)(et,{list:e.executions,...r},`e`)}),(e.reports.length||e.kind===`report`)&&n.push({kind:`report`,node:(0,V.jsx)(tt,{list:e.reports,...r},`r`)}),e.coding&&(e.coding.edits.length||e.coding.results.length||e.kind===`coding`)&&n.push({kind:`coding`,node:(0,V.jsx)(ot,{c:e.coding,files:e.files,...r},`c`)}),n.sort((t,n)=>Number(n.kind===e.kind)-Number(t.kind===e.kind)),(0,V.jsx)(V.Fragment,{children:n.map(e=>e.node)})}var K={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`}},dt={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`},ft=e=>dt[e]||e.charAt(0).toUpperCase()+e.slice(1),pt=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 mt(e){let[t,n]=(0,B.useState)(Date.now());return(0,B.useEffect)(()=>{if(!e)return;let t=Pe(()=>n(Date.now()),1e3);return()=>Me(t)},[e]),t}function ht({r:e}){return e.origin.kind===`web`?(0,V.jsxs)(`a`,{href:j(`chats`,e.origin.chat),className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(F,{icon:w,size:14}),`Web chat`]}):e.origin.kind===`job`?(0,V.jsxs)(`a`,{href:j(`jobs`,encodeURIComponent(e.origin.job)),className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(F,{icon:ae,size:14}),`Job`]}):(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-muted`,children:[(0,V.jsx)(F,{icon:se,size:14}),`Terminal`]})}var gt=e=>K[e].label;function _t({status:e}){let t=K[e].label;return e===`running`?(0,V.jsx)(T,{size:16,"aria-label":t,className:`flex-none animate-spin text-accent-fg`}):e===`done`?(0,V.jsx)(s,{size:16,"aria-label":t,className:`flex-none text-pass`}):e===`failed`?(0,V.jsx)(a,{size:16,"aria-label":t,className:`flex-none text-fail`}):(0,V.jsx)(u,{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 vt(e){return/^forgeqe(-|$)|^engine$/.test(e)?le(e).name:e&&e.charAt(0).toUpperCase()+e.slice(1)}function Z({label:e,children:t,stacked:n=!1}){return n?(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-col border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,V.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:t})]}):(0,V.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,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,V.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:t})]})}function Q({title:e,icon:t,children:n}){return(0,V.jsx)(Ie,{level:3,icon:t,title:e,className:`gap-2`,children:(0,V.jsx)(`div`,{className:`flex min-w-0 flex-col`,children:n})})}var yt=8,bt=e=>e===`write`?`Written`:e===`edit`?`Edited`:e===`delete`?`Deleted`:e?e.charAt(0).toUpperCase()+e.slice(1):`Changed`;function xt({run:e,now:t,running:n,events:r}){let i=K[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,V.jsxs)(je,{label:`How this run went`,children:[(0,V.jsx)(I,{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,V.jsx)(I,{label:n?`Running for`:`Took`,value:J(q(e,t)),...r?{note:N(r,`event`)}:{}}),a.total>0&&(0,V.jsx)(I,{label:`Cases`,value:`${a.passed}/${a.total}`,...a.failed?{tone:`text-fail`}:a.passed===a.total?{tone:`text-pass`}:{},note:`passed`}),s>0&&(0,V.jsx)(I,{label:`Test runs`,value:s,...c?{note:`${c} failed`}:{}}),f>0&&(0,V.jsx)(I,{label:`Files changed`,value:f,...u+d?{note:`+${u} −${d}`}:{}}),Y(e)>0&&(0,V.jsx)(I,{label:`Tokens`,value:R(Y(e)),note:`${R(e.usage.input)} in · ${R(e.usage.output)} out`})]})}var St={rerun:i,write_test:D,investigate:S,fix_test:y},Ct={rerun:`Retry`,write_test:`Write`,investigate:`Investigate`,fix_test:`Fix`};function wt({actions:e}){let[t,n]=(0,B.useState)(``),[r,i]=(0,B.useState)(``);if(!e.length)return null;let a=async e=>{n(e.prompt),i(``);try{let{id:t}=await fe.start(e.prompt,{});location.hash=j(`chats`,t)}catch(e){i(e.message),n(``)}};return(0,V.jsxs)(`section`,{"aria-label":`Next steps`,className:`flex flex-col gap-2`,children:[(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map((e,n)=>(0,V.jsxs)(ge,{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,V.jsx)(F,{icon:St[e.kind],size:16,className:`flex-none`}),(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:t===e.prompt?`Opening…`:Ct[e.kind]}),e.note&&(0,V.jsx)(`span`,{className:`min-w-0 flex-[1_1_0] truncate font-normal text-ink-2`,children:e.note})]},n))}),(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Each opens a chat with the request; it asks before it changes anything.`}),r&&(0,V.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:r})]})}var Tt=e=>`\`${e.replace(/`/g,``)}\``,Et=[`summary`,`conversation`,`activity`,`details`],Dt=e=>Et.find(t=>t===e)??`summary`;function Ot({name:e,tab:t}){let[n,i]=(0,B.useState)(null),[a,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(!1),u=Dt(t),f=t=>location.hash=t===`summary`?j(`runs`,encodeURIComponent(e)):j(`runs`,encodeURIComponent(e),t),p=(0,B.useCallback)(()=>{de.detail(e).then(e=>{i(e),s(``)},e=>s(e.message))},[e]);(0,B.useEffect)(p,[p]);let m=n?.status===`running`;(0,B.useEffect)(()=>{if(!m)return;let e=Pe(p,2e3);return()=>Me(e)},[p,m]);let h=mt(m),_=(0,B.useMemo)(()=>(n?.events??[]).map(Le).filter(e=>!!e),[n?.events]),v=async()=>{l(!0),s(``);try{await de.cancel(e),p()}catch(e){s(e.message)}finally{l(!1)}},y=(0,V.jsx)(Ce,{href:j(`runs`),label:`All runs`});if(!n)return(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[y,a?(0,V.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:a}):(0,V.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})]});let S=K[n.status],C=!n.replies.length,T=!!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,E=[{id:`summary`,label:`Summary`,icon:ie},{id:`conversation`,label:C?`Command`:`Conversation`,icon:C?A:w,n:n.replies.length||void 0},{id:`activity`,label:`Activity`,icon:b,n:_.length||void 0},{id:`details`,label:`Details`,icon:x}],D=new Set([...n.reports.map(e=>e.path),...n.executions.flatMap(e=>[e.report,e.folder])].filter(Boolean)),O=n.outputs.filter(e=>!D.has(e.path)),k=n.context?.limit?Math.round(n.context.tokens/n.context.limit*100):null,ne=O.length>0||n.files.length>0?`@3xl:col-span-3`:`@3xl:col-span-4`;return(0,V.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[y,(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-2`,children:[(0,V.jsx)(Ee,{icon:d,title:n.title,actions:(0,V.jsx)(P,{tone:S.tone,children:S.label})}),(0,V.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-muted`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(Ke,{kind:n.kind}),H[n.kind]]}),`· `,(0,V.jsx)(ht,{r:n}),`· `,pt(n.startedAt),` · `,m?`running for `:`took `,J(q(n,h)),` · `,R(Y(n)),` tokens`,n.profile?.model?` · ${n.profile.model}`:``]})]}),n.cancel&&(0,V.jsxs)(ge,{variant:`danger`,disabled:c,"data-tip":n.cancel===`chat`?`Stop this chat's work`:`Cancel this job's run`,onClick:()=>void v(),children:[n.cancel===`chat`?(0,V.jsx)(ee,{fill:`currentColor`,"aria-hidden":`true`}):(0,V.jsx)(o,{"aria-hidden":`true`}),c?`Stopping…`:n.cancel===`chat`?`Stop`:`Cancel`]})]}),a&&(0,V.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}),n.error&&(0,V.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[(0,V.jsx)(`strong`,{children:`What went wrong:`}),` `,n.error]}),!m&&(0,V.jsx)(wt,{actions:n.actions??[]}),(0,V.jsx)(Fe,{prefix:`run`,label:`This run`,className:`mb-0`,current:u,onPick:f,tabs:E}),(0,V.jsxs)(`div`,{role:`tabpanel`,id:`run-panel-${u}`,"aria-labelledby":`run-${u}`,className:`flex min-w-0 flex-col gap-6`,children:[u===`summary`&&(0,V.jsxs)(V.Fragment,{children:[T&&(0,V.jsx)(xt,{run:n,now:h,running:m,events:_.length}),(0,V.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,V.jsx)(st,{final:n.final,answer:n.answer,className:ne}),(0,V.jsx)(ut,{run:n,className:ne}),O.length>0&&(0,V.jsx)(`div`,{className:`flex min-w-0 flex-col border-t border-line-soft pt-6 @3xl:col-span-1`,children:(0,V.jsx)(Q,{title:`What it produced (${O.length})`,icon:oe,children:O.map(e=>(0,V.jsx)(Z,{label:e.label,stacked:!0,children:(0,V.jsx)(z,{path:e.path,children:e.path.split(`/`).pop()})},e.path))})}),n.files.length>0&&(0,V.jsx)(`div`,{className:`flex min-w-0 flex-col border-t border-line-soft pt-6 @3xl:col-span-1`,children:(0,V.jsx)(Q,{title:`Files worked on (${n.files.length})`,icon:r,children:(0,V.jsx)(Ze,{items:[...n.files].sort((e,t)=>Number(e.action===`read`)-Number(t.action===`read`)),first:yt,render:e=>(0,V.jsx)(Z,{label:bt(e.action),stacked:!0,children:e.action===`delete`?(0,V.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.path.split(`/`).pop()}):(0,V.jsx)(z,{path:e.path,children:e.path.split(`/`).pop()})},e.path)})})}),n.learnings.length>0&&(0,V.jsx)(lt,{list:n.learnings,className:`@3xl:col-span-4`})]}),!T&&(0,V.jsx)(be,{className:`py-4`,children:m?`Still working: its answer and what it produces show here when it ends.`:`This run left no answer, results or files. Its Activity shows what it did.`})]}),u===`conversation`&&(C?(0,V.jsx)(L,{text:Tt(n.prompt),className:`text-sm [&_p]:my-0`}):(0,V.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:n.replies.map((e,t)=>(0,V.jsxs)(`li`,{className:`flex flex-col gap-2`,children:[(0,V.jsx)(`div`,{className:`self-end rounded-[14px] bg-surface-strong px-4 py-2 text-sm max-w-[85%]`,children:(0,V.jsx)(L,{text:e.ask,className:`[&_p]:my-1`})}),e.text&&(0,V.jsx)(L,{text:Te(e.text),className:`text-sm`}),e.error&&(0,V.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))})),u===`activity`&&(n.archived?(0,V.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,V.jsx)(`code`,{className:`font-mono text-[13px]`,children:`.forgeqe/runs`}),`; its step-by-step activity was not.`]}):_.length?(0,V.jsx)(Ue,{timeline:!0,lines:_,start:n.startedAt,live:m,name:`forgeqe-run-${n.name.replace(/\.log$/,``)}.md`}):(0,V.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing logged yet.`})),u===`details`&&(0,V.jsxs)(kt,{children:[(0,V.jsxs)(Q,{title:`Numbers`,icon:g,children:[(0,V.jsx)(Z,{label:m?`Running for`:`Took`,children:J(q(n,h))}),(0,V.jsx)(Z,{label:`Tokens`,children:(0,V.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,V.jsxs)(`span`,{children:[R(Y(n)),` `,(0,V.jsxs)(`span`,{className:`text-muted`,children:[`· `,Be(n.usage)]})]}),(n.byAgent?.length??0)>1&&(0,V.jsx)(`span`,{className:`flex flex-col gap-1 text-[13px]`,children:n.byAgent.map(e=>(0,V.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-2`,children:vt(e.agent)}),(0,V.jsx)(`span`,{className:`text-muted tabular-nums`,children:R(e.input+e.output)})]},e.agent))})]})}),(0,V.jsxs)(Z,{label:`Context`,children:[n.context?R(n.context.tokens):`–`,k!==null&&(0,V.jsxs)(`span`,{className:`text-muted`,children:[` of `,R(n.context.limit),` (`,k,`%)`]})]}),(0,V.jsxs)(Z,{label:`Tool calls`,children:[n.tools,` `,(0,V.jsxs)(`span`,{className:`text-muted`,children:[`in `,N(n.turns,`turn`)]})]})]}),(0,V.jsxs)(Q,{title:`Session`,icon:A,children:[(0,V.jsx)(Z,{label:`Started by`,children:(0,V.jsx)(ht,{r:n})}),(0,V.jsx)(Z,{label:`Command`,children:ft(n.command)}),(0,V.jsx)(Z,{label:`Model`,children:n.profile?[n.profile.name,n.profile.model].filter(Boolean).join(` · `):`–`}),(0,V.jsx)(Z,{label:`Agents`,children:n.agents.length?(0,V.jsx)(`span`,{className:`flex flex-col gap-1`,children:n.agents.map(e=>(0,V.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:vt(e.name)}),(0,V.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:N(e.calls,`call`)})]},e.name))}):(0,V.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,V.jsxs)(Z,{label:`Log`,children:[n.archived?(0,V.jsx)(`span`,{className:`text-muted`,children:`No longer kept: ForgeQE keeps the newest logs only`}):(0,V.jsx)(z,{path:`.forgeqe/logs/${n.name}`}),n.truncated&&(0,V.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Very long: only its start is shown.`})]})]}),n.job&&(0,V.jsxs)(Q,{title:`Job`,icon:ae,children:[(0,V.jsx)(Z,{label:`Job`,children:(0,V.jsx)(`a`,{href:j(`jobs`,encodeURIComponent(n.origin.kind===`job`?n.origin.job:n.job.name)),children:n.job.name})}),(0,V.jsx)(Z,{label:`Runs`,children:(0,V.jsx)(L,{text:Tt(n.job.command),className:`text-sm [&_p]:my-0`})}),(0,V.jsxs)(Z,{label:`Schedule`,children:[n.job.schedule,!n.job.enabled&&` (disabled)`,n.job.nextAt&&n.job.enabled?` · next ${pt(n.job.nextAt)}`:``]}),n.job.run&&(0,V.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,V.jsx)(Q,{title:`Notifications`,icon:te,children:n.notifications.length?n.notifications.map(e=>(0,V.jsx)(Z,{label:e.event.replace(/_/g,` `),children:e.channels.length?e.channels.join(`, `):(0,V.jsx)(`span`,{className:`text-muted`,children:`No channel takes it`})},e.event)):(0,V.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 kt({children:e}){let t=B.Children.toArray(e).filter(Boolean),n=t.length%2==1;return(0,V.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,V.jsx)(`div`,{className:M(`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 At({runs:e}){let t=mt(e.some(e=>e.status===`running`)),[n,r]=(0,B.useState)(``),[i,a]=(0,B.useState)(`all`),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(0);(0,B.useEffect)(()=>p(0),[n,i,o,c,u]);let m=e.filter(X).length,h=n.toLowerCase().split(/\s+/).filter(Boolean),g=e.filter(e=>(u||!X(e))&&(!o||e.kind===o)&&(!c||e.origin.kind===c)&&h.every(t=>`${e.title} ${e.command} ${e.error||``}`.toLowerCase().includes(t))),_={all:g.length,running:g.filter(e=>e.status===`running`).length,failed:g.filter(e=>e.status===`failed`).length},v=i===`all`?g:g.filter(e=>e.status===i),y=Math.max(1,Math.ceil(v.length/$)),b=Math.min(f,y-1),x=v.slice(b*$,b*$+$),S=e.filter(e=>e.status!==`running`&&!X(e)),C=S.filter(e=>e.status===`failed`).length,T=S.length?S.reduce((e,n)=>e+q(n,t),0)/S.length:NaN,E=e.reduce((e,t)=>e+Y(t),0),D=[...new Set(e.map(e=>e.kind))],O=[...new Set(e.map(e=>e.origin.kind))],k={web:`Web chat`,job:`Job`,terminal:`Terminal`};return e.length===0?(0,V.jsx)(be,{icon:A,title:`No runs yet`,action:(0,V.jsxs)(`a`,{className:he({size:`sm`}),href:j(),"data-tip":`Start a chat`,children:[(0,V.jsx)(w,{"aria-hidden":`true`}),`Chat`]}),children:`A chat here, a job, or a ForgeQE command in this project adds one.`}):(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-1 text-[13px] text-muted`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:`text-ink tabular-nums`,children:e.length-m}),` runs`]}),e.some(e=>e.status===`running`)&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:`text-accent-fg tabular-nums`,children:e.filter(e=>e.status===`running`).length}),` running now`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:M(`tabular-nums`,C?`text-fail`:`text-ink`),children:C}),` failed`,S.length?` (${Math.round(C/S.length*100)}%)`:``]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:`text-ink tabular-nums`,children:R(E)}),` tokens`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:`text-ink tabular-nums`,children:J(Math.round(T))}),` on average`]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(Se,{id:`run-search`,label:`Find a run`,value:n,onChange:r,placeholder:`Find a run by what was asked`}),(0,V.jsx)(ye,{items:[{id:`all`,label:`All`,n:_.all},{id:`running`,label:`Running`,n:_.running},{id:`failed`,label:`Failed`,n:_.failed,alert:!0}],value:i,onChange:a}),D.length>1&&(0,V.jsxs)(me,{size:`sm`,"aria-label":`What it did`,value:o,onChange:e=>s(e.target.value),className:`w-auto pr-8 pl-4`,children:[(0,V.jsx)(`option`,{value:``,children:`Any kind`}),D.map(e=>(0,V.jsx)(`option`,{value:e,children:H[e]},e))]}),O.length>1&&(0,V.jsxs)(me,{size:`sm`,"aria-label":`Started by`,value:c,onChange:e=>l(e.target.value),className:`w-auto pr-8 pl-4`,children:[(0,V.jsx)(`option`,{value:``,children:`Started anywhere`}),O.map(e=>(0,V.jsx)(`option`,{value:e,children:k[e]||e},e))]})]}),(0,V.jsxs)(`div`,{className:`rounded-[14px] card border`,children:[(0,V.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,V.jsx)(`span`,{className:`w-4`}),(0,V.jsx)(`span`,{children:`Run`}),(0,V.jsx)(`span`,{children:`Kind`}),(0,V.jsx)(`span`,{children:`Started by`}),(0,V.jsx)(`span`,{className:`text-right`,children:`Took`}),(0,V.jsx)(`span`,{className:`text-right`,children:`Tokens`}),(0,V.jsx)(`span`,{className:`text-right`,children:`When`})]}),(0,V.jsxs)(`ul`,{"aria-label":`Runs`,className:`m-0 list-none p-2`,children:[x.length===0&&(0,V.jsx)(`li`,{className:`px-4 py-4 text-sm text-muted`,children:`Nothing matches.`}),x.map((e,n)=>{let r=Re(e.startedAt);return(0,V.jsxs)(`li`,{className:`contents`,children:[(n===0||Re(x[n-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)(`a`,{href:j(`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,V.jsx)(_t,{status:e.status}),(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}),e.error?(0,V.jsx)(`span`,{className:`truncate text-[13px] text-fail`,children:e.error}):(0,V.jsx)(`span`,{className:`truncate text-[13px] text-muted @3xl:hidden`,children:[H[e.kind],k[e.origin.kind],J(q(e,t)),`${R(Y(e))} tokens`].join(` · `)})]}),(0,V.jsxs)(`span`,{className:`hidden min-w-0 items-center gap-2 text-[13px] text-ink-2 @3xl:inline-flex`,children:[(0,V.jsx)(Ke,{kind:e.kind}),H[e.kind]]}),(0,V.jsx)(`span`,{className:`hidden text-[13px] text-ink-2 @3xl:block`,children:k[e.origin.kind]||e.origin.kind}),(0,V.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:J(q(e,t))}),(0,V.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:R(Y(e))}),(0,V.jsx)(`span`,{className:`text-right text-[13px] text-muted tabular-nums`,"data-tip":pt(e.startedAt),children:ze(e.startedAt)})]})]},e.name)})]}),(0,V.jsx)(ve,{page:b,size:$,total:v.length,onPage:p,label:`Pages of runs`,children:m>0&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.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 ${N(m,`empty session`)}`:`${N(m,`empty session`)} hidden`})]})})]})]})}function jt({sub:e}){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(``),a=(0,B.useCallback)(()=>{de.list().then(e=>{n(e.runs),i(``)},e=>i(e.message))},[]);(0,B.useEffect)(a,[a]);let o=t?.some(e=>e.status===`running`);(0,B.useEffect)(()=>{if(e)return;let t=Pe(a,o?3e3:2e4);return()=>Me(t)},[a,o,e]);let[s,c]=(e||``).split(`/`),l=s?ne(s):``;return(0,V.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,V.jsx)(Ve,{}),(0,V.jsx)(`main`,{className:M(ke,`@container flex-auto gap-4`),children:l?(0,V.jsx)(Ot,{name:l,tab:c},l):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(xe,{}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,V.jsx)(Oe,{pixel:we.runs,size:`lg`}),(0,V.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Runs`})]}),(0,V.jsx)(Ne,{label:`Runs and reports`,links:We,current:`runs`})]}),(0,V.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,V.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,V.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,V.jsx)(At,{runs:t})]})})]})}export{jt as Runs,_t as StatusIcon,X as empty,Dt as runTab,gt as statusLabel};
|