@capagents/forgeqe 2.4.9 → 2.5.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/dist/docs-site/architecture-map/index.html +1 -0
- package/dist/docs-site/docs/architecture/index.html +5 -5
- package/dist/docs-site/docs/containers/index.html +3 -3
- package/dist/docs-site/docs/cost-architecture/index.html +3 -3
- package/dist/docs-site/docs/desktop/index.html +3 -3
- package/dist/docs-site/docs/desktop-ci/index.html +3 -3
- package/dist/docs-site/docs/feature-test-prompts/index.html +3 -3
- package/dist/docs-site/docs/guardrails/index.html +3 -3
- package/dist/docs-site/docs/index.html +41 -77
- package/dist/docs-site/docs/mobile/index.html +32 -10
- package/dist/docs-site/docs/model-routing/index.html +3 -3
- package/dist/docs-site/docs/product-knowledge/index.html +3 -3
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/docs-site/docs/web-app/index.html +14 -6
- package/dist/docs-site/img/icons/mail.svg +1 -0
- package/dist/forgeqe.js +997 -987
- package/dist/web/assets/{Agent-DJMzvP5e.js → Agent-BMqCDZeZ.js} +1 -1
- package/dist/web/assets/{ApiTests-CatQogdX.js → ApiTests-CkxIx6sI.js} +2 -2
- package/dist/web/assets/{Chat-BnMf86ti.js → Chat-BT6yGqKW.js} +3 -3
- package/dist/web/assets/{Data-Dv1J1F3q.js → Data-BPtl_mUy.js} +4 -4
- package/dist/web/assets/{Features-BoUfO669.js → Features-DwHyOoJu.js} +1 -1
- package/dist/web/assets/Jobs-DW2uXMkv.js +3 -0
- package/dist/web/assets/Quality-BeuhtzZi.js +1 -0
- package/dist/web/assets/Record-EHgUTspl.js +1 -0
- package/dist/web/assets/{Regression-icTMw-63.js → Regression-BDq3BUP_.js} +2 -2
- package/dist/web/assets/Reports-Bapldq1A.js +2 -0
- package/dist/web/assets/{Response-DhcE4o_e.js → Response-Dh_kxnCt.js} +3 -3
- package/dist/web/assets/Runs-BOi2fP0o.js +2 -0
- package/dist/web/assets/{circle-dashed-DJoDKq93.js → circle-dashed-C84s5T0C.js} +1 -1
- package/dist/web/assets/frame-z3iL_6aL.js +3 -0
- package/dist/web/assets/index-BVw2ygO2.js +26 -0
- package/dist/web/assets/index-CBa29-yG.css +2 -0
- package/dist/web/assets/markdown-BtqKvAEi.js +10 -0
- package/dist/web/assets/{sticky-note-BHLEsD2N.js → sticky-note-C_NJNONZ.js} +1 -1
- package/dist/web/assets/{trending-up-DWgCJxJf.js → trending-up-DK1wDqic.js} +1 -1
- package/dist/web/index.html +3 -3
- package/docs/MOBILE.md +29 -7
- package/docs/WEB_APP.md +11 -1
- package/docs/user-guide.html +29 -7
- package/forgeqe.example.yaml +7 -0
- package/package.json +1 -1
- package/py/forgeqe_mobile/cli.py +9 -2
- package/py/forgeqe_mobile/hyperexecute.py +133 -19
- package/py/forgeqe_mobile/maestro.py +45 -3
- package/py/forgeqe_mobile/service.py +51 -14
- package/dist/web/assets/Jobs-DHLGBQQg.js +0 -3
- package/dist/web/assets/Quality-D0xYMvar.js +0 -1
- package/dist/web/assets/Record-Dnt4y9hn.js +0 -1
- package/dist/web/assets/Reports-C_IwjymA.js +0 -2
- package/dist/web/assets/Runs-5qNwwohN.js +0 -2
- package/dist/web/assets/external-link-Cu8-HMUj.js +0 -1
- package/dist/web/assets/frame-3JV5tjBP.js +0 -3
- package/dist/web/assets/index-C65qlV-q.css +0 -2
- package/dist/web/assets/index-XRjCGJfG.js +0 -26
- package/dist/web/assets/markdown-Bca_tHZ5.js +0 -10
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,Ar as t,Bt as n,E as r,Et as i,G as a,Nr as o,Un as s,X as c,Z as l,_t as u,br as d,bt as f,dr as p,dt as m,ir as h,ln as g,ot as _,r as v,rr as y,st as b,t as x,vn as S,yt as C}from"./frame-3JV5tjBP.js";import{t as w}from"./circle-dashed-DJoDKq93.js";import{i as T,t as E}from"./markdown-Bca_tHZ5.js";import{t as D}from"./external-link-Cu8-HMUj.js";import{n as O,t as k}from"./trending-up-DWgCJxJf.js";import{i as A,n as j,r as M,t as N,w as P}from"./index-XRjCGJfG.js";import{n as F,t as I}from"./when-CHnpLdYw.js";var L={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};L.node;var R=h(L),z=o(t(),1),B=C(),V=[`critical`,`serious`,`moderate`,`minor`],H={critical:`fail`,serious:`fail`,moderate:`warn`,minor:`neutral`},U=[{key:`lcp`,label:`LCP`,good:2500,poor:4e3,unit:`ms`},{key:`cls`,label:`CLS`,good:.1,poor:.25,unit:``},{key:`inp`,label:`INP`,good:200,poor:500,unit:`ms`},{key:`fcp`,label:`FCP`,good:1800,poor:3e3,unit:`ms`},{key:`ttfb`,label:`TTFB`,good:800,poor:1800,unit:`ms`},{key:`load`,label:`Load`,good:1/0,poor:1/0,unit:`ms`}],W={same:{label:`Same`,tone:`pass`},changed:{label:`Changed`,tone:`warn`},new:{label:`New baseline`,tone:`neutral`},no_baseline:{label:`No baseline`,tone:`neutral`}},G=e=>new Date(e).toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),K=(e,t)=>t?e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`:e.toFixed(3).replace(/0+$/,``).replace(/\.$/,``),q=(e,t)=>`${e} ${t}${e===1?``:`s`}`,J=e=>{try{let t=new URL(e);return`${t.host}${t.pathname}${t.search}`}catch{return e}};function Y(e){let t=[];return e.a11y&&t.push(e.a11y.failed?`${q(e.a11y.failed,`rule`)} failed`:`WCAG clean`),e.perf.over&&t.push(`${q(e.perf.over,`page`)} slow`),e.visual?.changed&&t.push(`${e.visual.changed} changed`),e.captured&&t.push(`not compared`),t.join(` · `)||`measured`}var X=e=>!!(e.breaches||e.a11y?.failed||e.perf.over||e.visual?.changed),Z=25;function ee({run:e,standard:t}){let n=e.report,[r,i]=(0,z.useState)(null),[a,o]=(0,z.useState)(`all`);if(!n?.accessibility.pages)return(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`This run has no accessibility results: report.accessibility was off, or the run visited no page.`});let s=n.accessibility,c=n.breaches.filter(e=>e.kind===`accessibility`),l=a===`all`?s.failed:s.failed.filter(e=>e.impact===a),u=[{id:`all`,label:`All`,n:s.failed.length},...V.filter(e=>s.failed.some(t=>t.impact===e)).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1),n:s.failed.filter(t=>t.impact===e).length,alert:e===`critical`||e===`serious`}))];return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,B.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[t,` with `,n.engine||`axe`,`: `,q(s.passed.length,`rule`),` passed, `,s.failed.length,` failed, on `,q(s.pages,`page`),`. `,n.budgets.accessibility?c.length?`${q(c.length,`budget`)} exceeded.`:`Within the budget.`:`No budget set, so nothing here fails the run.`]}),c.map((e,t)=>(0,B.jsxs)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[J(e.page),`: `,e.text]},t)),s.failed.length?(0,B.jsxs)(B.Fragment,{children:[u.length>2&&(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,B.jsx)(N,{items:u,value:a,onChange:o})}),(0,B.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:l.map(t=>(0,B.jsx)(te,{f:t,examples:e.examples[t.rule]??[],open:r===t.rule,onToggle:()=>i(r===t.rule?null:t.rule)},t.rule))})]}):(0,B.jsx)(`p`,{className:`m-0 text-sm text-pass`,children:`No rule failed on the pages this run visited.`})]})}function te({f:e,examples:t,open:n,onToggle:r}){return(0,B.jsxs)(`li`,{className:`border-t border-line-soft first:border-t-0`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:r,className:`flex min-h-12 w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-1 py-1.5 text-left text-ink hover:bg-surface-muted`,children:[(0,B.jsx)(A,{tone:H[e.impact],className:`w-[88px] flex-none justify-center`,children:e.impact}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,B.jsx)(`span`,{className:`text-sm [overflow-wrap:anywhere]`,children:e.help}),(0,B.jsxs)(`span`,{className:`truncate text-[12px] text-muted`,children:[e.rule,e.wcag?` · WCAG ${e.wcag}${e.level?` (${e.level})`:``}`:``,` · `,q(e.count,`element`),` on `,q(e.pages,`page`)]})]})]}),(0,B.jsx)(b,{open:n,children:(0,B.jsxs)(`div`,{className:`mb-3 ml-[104px] flex flex-col gap-2 text-sm max-sm:ml-2`,children:[t.length?t.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-[10px] bg-surface-muted p-2.5`,children:[(0,B.jsxs)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:[J(e.page),e.target?` · ${e.target}`:``]}),e.html&&(0,B.jsx)(`code`,{className:`font-mono text-[12px] whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:e.html})]},t)):(0,B.jsx)(`span`,{className:`text-muted`,children:`No elements were kept for this rule.`}),e.helpUrl&&T(e.helpUrl)===`web`&&(0,B.jsxs)(`a`,{href:e.helpUrl,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-1 self-start text-[13px]`,children:[`How to fix it `,(0,B.jsx)(D,{size:13,"aria-hidden":`true`})]})]})})]})}function ne({run:e}){let t=e.report;if(!t?.performance.pages.length)return(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`This run has no timings: the run visited no page.`});let n=(e,t)=>e>t.poor?`poor`:e>t.good?`needs improvement`:`good`,r={poor:`text-fail`,"needs improvement":`text-warn`,good:`text-pass`};return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,B.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Core Web Vitals per page against Google's thresholds: `,(0,B.jsx)(`span`,{className:`text-pass`,children:`good`}),`, `,(0,B.jsx)(`span`,{className:`text-warn`,children:`needs improvement`}),`, `,(0,B.jsx)(`span`,{className:`text-fail`,children:`poor`}),`.`,` `,t.budgets.performance?`Pages over the budget in quality.budgets.performance are marked.`:`No performance budget set: nothing fails on timings (quality.budgets.performance).`]}),(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`w-full min-w-[640px] border-collapse text-sm`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{className:`text-left text-[12px] text-muted`,children:[(0,B.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:`Page`}),U.map(e=>(0,B.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:e.label},e.key)),(0,B.jsx)(`th`,{className:`py-2 pl-2 text-right font-medium`,children:`Requests`})]})}),(0,B.jsx)(`tbody`,{children:t.performance.pages.map((e,t)=>(0,B.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,B.jsxs)(`td`,{className:`py-2 pr-3`,children:[(0,B.jsx)(`span`,{className:`block font-mono text-[12px] [overflow-wrap:anywhere]`,children:J(e.url)}),e.over.length>0&&(0,B.jsx)(`span`,{className:`text-[12px] text-fail`,children:e.over.join(`, `)})]}),U.map(t=>{let i=e[t.key];return(0,B.jsxs)(`td`,{className:f(`px-2 py-2 text-right tabular-nums`,typeof i==`number`&&t.good!==1/0?r[n(i,t)]:typeof i==`number`?`text-ink-2`:`text-muted`),children:[typeof i==`number`?K(i,t.unit):`–`,typeof i==`number`&&t.good!==1/0&&(0,B.jsxs)(`span`,{className:`sr-only`,children:[` (`,n(i,t),`)`]})]},t.key)}),(0,B.jsx)(`td`,{className:`py-2 pl-2 text-right text-muted tabular-nums`,children:e.requests?`${e.requests} · ${e.kb} KB`:`–`})]},t))})]})})]})}function Q({run:e,index:t,which:n,label:r}){let[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{let r=!1;return a(``),s(!1),d.image(e,t,n).then(e=>!r&&a(e),()=>!r&&s(!0)),()=>{r=!0}},[e,t,n]),(0,B.jsxs)(`figure`,{className:`m-0 flex min-w-0 flex-col gap-1.5`,children:[(0,B.jsx)(`figcaption`,{className:`text-[12px] font-medium text-muted`,children:r}),i?(0,B.jsx)(`img`,{src:i,alt:`${r} of the page`,className:`block h-auto w-full rounded-[10px] border border-line-soft bg-surface-muted`}):(0,B.jsx)(`span`,{className:`flex h-[120px] items-center justify-center gap-2 rounded-[10px] border border-line-soft bg-surface-muted text-[12px] text-muted`,children:o?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(R,{size:14,"aria-hidden":`true`}),` Not available`]}):`Loading…`})]})}function re({run:e,budget:t,onChange:r}){let[i,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(``),[l,p]=(0,z.useState)(!1),[h,_]=(0,z.useState)(``),[v,y]=(0,z.useState)(null),x=e.visual?.pages??[],S=x.find(e=>e.status===`changed`)?.index??null;(0,z.useEffect)(()=>y(S),[e.id,S]);let C=async e=>{p(!0),_(``);try{r(await e()),o(null),c(``)}catch(e){_(e.message)}finally{p(!1)}};if(!e.visual)return e.captured?(0,B.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,children:[(0,B.jsxs)(`p`,{className:`m-0 text-sm text-ink-2`,children:[`This run captured `,q(e.captured,`page`),` but they were not compared with the baselines yet.`]}),(0,B.jsxs)(m,{variant:`primary`,disabled:l,onClick:()=>C(()=>d.compare(e.id)),children:[(0,B.jsx)(u,{icon:n,size:16}),`Compare with the baselines`]}),h&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:h})]}):(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`This run has no visual captures: quality.visual.enabled was off, or the run visited no page.`});let w=x.filter(e=>e.status===`changed`);return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`p`,{className:`m-0 flex-1 text-[13px] text-muted`,children:[`Each page captured with animations frozen and masked regions hidden, against its approved baseline. `,t?`A page over quality.budgets.visual fails the run.`:`No visual budget set: a change does not fail the run (quality.budgets.visual).`]}),w.length>1&&(0,B.jsxs)(m,{disabled:l,onClick:()=>o(w.map(e=>e.url)),children:[`Approve all `,w.length,` changes`]})]}),i&&(0,B.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Approve as baseline`,className:`flex flex-col gap-3 rounded-[12px] border border-accent-line bg-accent-soft p-4`,children:[(0,B.jsxs)(`span`,{className:`font-medium`,children:[`Make this run's capture the baseline of `,i.length===1?J(i[0]):q(i.length,`page`),`?`]}),(0,B.jsx)(`span`,{className:`text-sm text-ink-2`,children:`Later runs are compared with it. Approve only a change that was intended; one that was not is a visual defect.`}),(0,B.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[`Why it changed (kept with the baseline)`,(0,B.jsx)(a,{value:s,maxLength:300,placeholder:`New checkout banner`,onChange:e=>c(e.target.value),className:`max-w-[480px] bg-bg`})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsxs)(m,{variant:`primary`,disabled:l,onClick:()=>C(()=>d.approve(e.id,i,s.trim()||void 0)),children:[(0,B.jsx)(P,{size:16,"aria-hidden":`true`}),`Approve`]}),(0,B.jsx)(m,{onClick:()=>o(null),children:`Cancel`})]})]}),h&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:h}),(0,B.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:x.map(t=>(0,B.jsxs)(`li`,{className:`border-t border-line-soft first:border-t-0`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":v===t.index,onClick:()=>y(v===t.index?null:t.index),className:`flex min-h-[52px] w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-1 py-2 text-left text-ink hover:bg-surface-muted`,children:[(0,B.jsx)(u,{icon:g,size:16,className:`flex-none text-muted`}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,B.jsx)(`span`,{className:`text-sm [overflow-wrap:anywhere]`,children:t.title||J(t.url)}),(0,B.jsxs)(`span`,{className:`truncate text-[12px] text-muted`,children:[J(t.url),t.size?` · ${t.size}`:``,t.resized?` · resized ${t.resized}`:``]})]}),t.status===`changed`&&(0,B.jsxs)(`span`,{className:f(`text-sm tabular-nums`,t.over?`text-fail`:`text-warn`),children:[t.diffPercent,`%`,t.limit===void 0?``:` / ${t.limit}%`]}),(0,B.jsx)(A,{tone:t.over?`fail`:W[t.status].tone,children:t.over?`Over budget`:W[t.status].label})]}),(0,B.jsx)(b,{open:v===t.index,children:(0,B.jsxs)(`div`,{className:`mb-4 flex flex-col gap-3 px-1`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(160px,1fr))] gap-3`,children:[t.images.baseline&&(0,B.jsx)(Q,{run:e.id,index:t.index,which:`baseline`,label:`Baseline`}),t.images.current&&(0,B.jsx)(Q,{run:e.id,index:t.index,which:`current`,label:`This run`}),t.images.diff&&(0,B.jsx)(Q,{run:e.id,index:t.index,which:`diff`,label:`Difference (in red)`})]}),t.status===`changed`&&(0,B.jsxs)(m,{className:`self-start`,disabled:l,onClick:()=>o([t.url]),children:[(0,B.jsx)(P,{size:16,"aria-hidden":`true`}),`Approve as the new baseline`]})]})})]},t.index))})]})}function ie({values:e}){if(e.length<2)return null;let t=Math.max(1,...e),n=e.map((n,r)=>`${r/(e.length-1)*96+2},${22-n/t*20}`).join(` `);return(0,B.jsx)(`svg`,{width:`100`,height:`24`,viewBox:`0 0 100 24`,"aria-label":`Violations over the last ${e.length} runs: ${e.join(`, `)}`,role:`img`,className:`flex-none text-muted`,children:(0,B.jsx)(`polyline`,{points:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinejoin:`round`})})}function $({icon:e,className:t,lines:n}){return n.length?(0,B.jsxs)(`span`,{className:f(`flex items-start gap-1.5 text-[13px]`,t),children:[(0,B.jsx)(u,{icon:e,size:14,className:`mt-0.5 flex-none`}),(0,B.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:n.join(` · `)})]}):null}function ae({trends:e}){return e.length?(0,B.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.map(e=>{let t=e.a11y.latest?V.reduce((t,n)=>t+(e.a11y.latest[n]||0),0):void 0;return(0,B.jsxs)(`li`,{className:`flex flex-col gap-1.5 border-t border-line-soft py-3 first:border-t-0`,children:[(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-3`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-[1_1_240px] font-mono text-[13px] [overflow-wrap:anywhere]`,children:e.page}),(0,B.jsx)(ie,{values:e.a11y.trail}),(0,B.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[q(e.runs,`run`),t===void 0?``:` · ${q(t,`violation`)} now`]})]}),(0,B.jsx)($,{icon:k,className:`text-fail`,lines:[...e.perf.worse.map(e=>`slower: ${e}`),...e.a11y.newRules.map(e=>`newly failing: ${e}`)]}),(0,B.jsx)($,{icon:O,className:`text-pass`,lines:[...e.perf.better.map(e=>`faster: ${e}`),...e.a11y.fixedRules.map(e=>`fixed: ${e}`)]})]},e.page)})}):(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No history yet: every browser run adds each page's accessibility and timings to quality-history.json in the reports folder.`})}function oe({id:t,view:n,onChanged:r}){let[a,o]=(0,z.useState)(null),[c,h]=(0,z.useState)(``),[_,v]=(0,z.useState)(`accessibility`),[b,x]=(0,z.useState)(``);if((0,z.useEffect)(()=>{let e=!1;return o(null),d.run(t).then(t=>{if(e)return;o(t),h(``);let n=t.visual?.pages.some(e=>e.status===`changed`)||!t.visual&&t.captured;v(t.report?.breaches.some(e=>e.kind===`performance`)&&!t.report.accessibility.failed.length?`performance`:n&&!t.report?.accessibility.failed.length?`visual`:t.report?.accessibility.pages?`accessibility`:t.report?.performance.pages.length?`performance`:`visual`)},t=>!e&&h(t.message)),()=>{e=!0}},[t]),c)return(0,B.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:c});if(!a)return(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Loading…`});let C=async()=>{try{let{id:e}=await p.start(`Explain the accessibility, performance and visual results of the run in ${a.dir}: call quality_report and visual_compare with run_dir ${a.dir}. Say what matters most to fix first, and why.`,{});location.hash=l(`chats`,e)}catch(e){x(e.message)}},T=a.report,D=T?.accessibility.failed??[],O=V.find(e=>D.some(t=>t.impact===e)),k=T?.performance.pages.filter(e=>e.over.length).length??0,A=a.visual?.pages.filter(e=>e.status===`changed`).length??0,j=e=>!!T?.breaches.some(t=>t.kind===e),M=[{id:`accessibility`,label:`Accessibility`,icon:y,state:T?.accessibility.pages?j(`accessibility`)||O===`critical`?`fail`:D.length?`warn`:`pass`:`none`,headline:T?.accessibility.pages?D.length?`${q(D.length,`rule`)} failed`:`No rule failed`:`Not measured`,note:T?.accessibility.pages?V.filter(e=>T.accessibility.byImpact[e]).map(e=>`${T.accessibility.byImpact[e]} ${e}`).join(` · `)||`${q(T.accessibility.pages,`page`)} checked`:``},{id:`performance`,label:`Performance`,icon:S,state:T?.performance.pages.length?j(`performance`)?`fail`:k?`warn`:`pass`:`none`,headline:T?.performance.pages.length?k?`${q(k,`page`)} over budget`:`Within budget`:`Not measured`,note:T?.performance.pages.length?`${q(T.performance.pages.length,`page`)} timed`:``},{id:`visual`,label:`Visual`,icon:g,state:a.visual?j(`visual`)?`fail`:A?`warn`:`pass`:`none`,headline:a.visual?A?`${q(A,`page`)} changed`:`No change`:a.captured?`Not compared yet`:`Not captured`,note:a.visual?`${q(a.visual.pages.length,`page`)} against the baseline`:a.captured?`${q(a.captured,`page`)} captured`:``}],N={pass:P,warn:i,fail:s,none:w},F={pass:`text-pass`,warn:`text-warn`,fail:`text-fail`,none:`text-muted`};return(0,B.jsxs)(`section`,{"aria-labelledby":`run-h`,className:`flex min-w-0 flex-1 flex-col gap-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,B.jsx)(`h2`,{id:`run-h`,title:a.goal,className:`m-0 line-clamp-2 text-[20px] leading-snug font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:a.goal}),(0,B.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-[13px] text-muted`,children:[G(a.at),` · `,(0,B.jsx)(E,{path:a.dir})]})]}),(0,B.jsxs)(m,{size:`sm`,variant:`ghost`,onClick:()=>void C(),children:[(0,B.jsx)(u,{icon:e,size:15}),`Ask in a chat`]})]}),b&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:b}),(0,B.jsx)(`div`,{role:`tablist`,"aria-label":`Results`,className:`grid gap-2 @xl:grid-cols-3`,children:M.map(e=>{let t=N[e.state];return(0,B.jsxs)(`button`,{type:`button`,role:`tab`,id:`tab-${e.id}`,"aria-selected":_===e.id,"aria-controls":`panel-${e.id}`,onClick:()=>v(e.id),className:f(`flex min-w-0 cursor-pointer flex-col gap-1 rounded-[14px] border px-4 py-3 text-left`,_===e.id?`border-accent bg-accent-soft`:`border-line-soft bg-bg hover:bg-surface-muted`),children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[13px] text-muted`,children:[(0,B.jsx)(u,{icon:e.icon,size:14}),e.label]}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[16px] font-semibold text-ink`,children:[(0,B.jsx)(t,{size:16,"aria-hidden":`true`,className:f(`flex-none`,F[e.state])}),e.headline]}),e.note&&(0,B.jsx)(`span`,{className:`truncate text-[12.5px] text-muted`,children:e.note})]},e.id)})}),(0,B.jsxs)(`div`,{role:`tabpanel`,id:`panel-${_}`,"aria-labelledby":`tab-${_}`,className:`flex min-w-0 flex-col`,children:[_===`accessibility`&&(0,B.jsx)(ee,{run:a,standard:n.standard}),_===`performance`&&(0,B.jsx)(ne,{run:a}),_===`visual`&&(0,B.jsx)(re,{run:a,budget:n.budgets.visual,onChange:e=>{o(e),r()}})]}),_===`accessibility`&&a.report?.accessibility.pages?(0,B.jsx)(`p`,{className:`m-0 text-[12px] text-muted`,children:n.disclaimer}):null]})}function se({sub:e}){let[t,n]=(0,z.useState)(null),[a,o]=(0,z.useState)(``),[p,m]=(0,z.useState)(e===`trends`?`trends`:`runs`),h=(0,z.useCallback)(()=>{d.view().then(e=>{n(e),o(``)},e=>o(e.message))},[]);(0,z.useEffect)(h,[h]);let g=e&&e!==`trends`?decodeURIComponent(e):``;(0,z.useEffect)(()=>{e===`trends`?m(`trends`):e&&m(`runs`)},[e]);let b=(0,z.useMemo)(()=>t?.runs.find(e=>e.id===g)||t?.runs[0],[t,g]),S=t?.trends.filter(e=>e.perf.worse.length||e.a11y.newRules.length).length??0,[C,w]=(0,z.useState)(``),[T,E]=(0,z.useState)(`all`),[D,O]=(0,z.useState)(0);(0,z.useEffect)(()=>O(0),[C,T]);let k=C.toLowerCase().split(/\s+/).filter(Boolean),A=(t?.runs??[]).filter(e=>k.every(t=>e.goal.toLowerCase().includes(t))),L=T===`attention`?A.filter(X):A;return(0,B.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,B.jsx)(v,{}),(0,B.jsxs)(`main`,{className:f(x,`@container flex-auto gap-4`),children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,B.jsx)(_,{pixel:c.quality,size:`lg`}),(0,B.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`Quality`})]}),(0,B.jsxs)(`p`,{className:`m-0 max-w-[74ch] text-sm leading-relaxed text-muted`,children:[`What each browser run measured on the pages it visited: accessibility (`,t?.standard||`WCAG`,`), Core Web Vitals, and visual changes against approved baselines. Budgets (quality.budgets) decide what fails a run.`]}),a&&(0,B.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a}),!t&&!a&&(0,B.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,B.jsx)(r,{label:`Quality`,current:p,onPick:e=>{m(e),e===`trends`?location.hash=l(`quality`,`trends`):location.hash=b?l(`quality`,encodeURIComponent(b.id)):l(`quality`)},tabs:[{id:`runs`,label:`Runs (${t.runs.length})`},{id:`trends`,label:`Trends${S?` (${S} worse)`:``}`}]}),t&&p===`trends`&&(0,B.jsx)(`div`,{role:`tabpanel`,id:`panel-trends`,"aria-labelledby":`tab-trends`,children:(0,B.jsx)(ae,{trends:t.trends})}),t&&p===`runs`&&(t.runs.length?(0,B.jsxs)(`div`,{role:`tabpanel`,id:`panel-runs`,"aria-labelledby":`tab-runs`,className:`flex flex-col gap-6 @2xl:flex-row @2xl:items-start @2xl:gap-8`,children:[(0,B.jsxs)(`nav`,{"aria-label":`Runs`,className:`flex min-w-0 flex-col gap-2 @2xl:sticky @2xl:top-6 @2xl:w-[290px] @2xl:flex-none`,children:[(0,B.jsx)(M,{id:`quality-search`,label:`Find a run`,value:C,onChange:w,className:`flex-none`}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,B.jsx)(N,{items:[{id:`all`,label:`All`,n:A.length},{id:`attention`,label:`Needs a look`,n:A.filter(X).length,alert:!0}],value:T,onChange:E})}),(0,B.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[L.length===0&&(0,B.jsx)(`li`,{className:`px-3 py-3 text-sm text-muted`,children:`Nothing matches.`}),L.slice(D*Z,D*Z+Z).map((e,t,n)=>{let r=F(e.at),a=e.breaches?s:X(e)?i:P;return(0,B.jsxs)(`li`,{className:`contents`,children:[(t===0||F(n[t-1].at)!==r)&&(0,B.jsx)(`span`,{className:`block px-3 pt-2 pb-1 text-[12px] font-semibold text-muted`,children:r}),(0,B.jsxs)(`a`,{href:l(`quality`,encodeURIComponent(e.id)),"aria-current":b?.id===e.id?`page`:void 0,className:f(`flex min-h-12 items-center gap-2.5 rounded-[10px] px-3 py-1.5 text-ink no-underline`,b?.id===e.id?`bg-surface-strong hover:text-ink`:`hover:bg-surface-muted hover:text-ink`),children:[(0,B.jsx)(a,{size:16,"aria-label":e.breaches?`Over a budget`:X(e)?`Needs a look`:`Within budgets`,className:f(`flex-none`,e.breaches?`text-fail`:X(e)?`text-warn`:`text-pass`)}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,B.jsx)(`span`,{className:`truncate text-[14px] font-medium`,title:e.goal,children:e.goal}),(0,B.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:Y(e)})]}),(0,B.jsx)(`span`,{className:`flex-none text-[12px] text-muted tabular-nums`,children:I(e.at)})]})]},e.id)})]}),L.length>Z&&(0,B.jsx)(j,{page:D,size:Z,total:L.length,onPage:O,label:`Pages of runs`})]}),b&&(0,B.jsx)(oe,{id:b.id,view:t,onChanged:h})]}):(0,B.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-[18px] border border-line p-6`,children:[(0,B.jsx)(u,{icon:y,size:24,className:`text-muted`}),(0,B.jsx)(`p`,{className:`m-0 max-w-[62ch] leading-relaxed text-ink-2`,children:`No run has measured anything yet. Every browser run checks accessibility, timings and visual changes of the pages it visits; run a flow from a chat or the Record page, and its results show here.`})]}))]})]})}export{se as Quality};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{An as e,Ar as t,At as n,G as r,Gn as i,K as a,Nr as o,Pn as s,Tt as c,Un as l,X as u,Y as d,Z as f,Zt as p,_t as m,at as h,bt as g,ct as _,dr as v,dt as y,hn as b,in as x,ir as S,ot as C,qt as w,r as T,st as ee,t as E,wn as D,xr as O,xt as k,yt as A}from"./frame-3JV5tjBP.js";import{t as j}from"./markdown-Bca_tHZ5.js";import{t as M}from"./sticky-note-BHLEsD2N.js";import{D as te,b as N,h as ne,i as P,m as re,n as ie,r as ae,t as oe,w as F}from"./index-XRjCGJfG.js";import{n as I,t as se}from"./when-CHnpLdYw.js";var L={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};L.node;var ce=S(L),R={name:`crosshair`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]};R.node;var le=S(R),z={name:`dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]};z.node;var ue=S(z),B={name:`hourglass`,size:24,node:[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]};B.node;var V=S(B),H={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};H.node;var U=S(H),W={name:`mouse-pointer-click`,size:24,node:[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]};W.node;var G=S(W),K={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};K.node;var de=S(K),q={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};q.node;var fe=S(q),J={name:`variable`,size:24,node:[[`path`,{d:`M8 21s-4-3-4-9 4-9 4-9`,key:`uto9ud`}],[`path`,{d:`M16 3s4 3 4 9-4 9-4 9`,key:`4w2vsq`}],[`line`,{x1:`15`,x2:`9`,y1:`9`,y2:`15`,key:`f7djnv`}],[`line`,{x1:`9`,x2:`15`,y1:`9`,y2:`15`,key:`1shsy8`}]]};J.node;var Y=S(J),X=o(t(),1),Z=A(),pe={navigate:b,back:te,click:G,dblclick:G,input:U,press:U,select:x,upload:fe,expect:F,wait_for:V,capture:Y,note:M,launch:w,double_click:G,type:U,keys:U},me=e=>pe[e]||(e.startsWith(`expect`)?F:ue),he=new Set([`starting`,`recording`,`paused`,`stopping`]);function ge(e,t){let n=Math.max(0,Math.round(((t?Date.parse(t):Date.now())-Date.parse(e))/1e3));return n<3600?`${Math.floor(n/60)}:${String(n%60).padStart(2,`0`)}`:`${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}async function _e(e){let{id:t}=await v.start(`Turn the recording in ${e} into a test: call write_test with run_dir ${e}. Show me the plan before you write.`,{});location.hash=f(`chats`,t)}async function Q(e){let{id:t}=await v.start(`Replay the desktop workflow ${e}: call desktop_replay with workflow ${e}, and tell me how each step went.`,{});location.hash=f(`chats`,t)}function ve({s:e,live:t,onDelete:n}){let r=me(e.op);return(0,Z.jsxs)(`li`,{className:`group flex min-h-[44px] items-start gap-3 border-t border-line-soft py-2 first:border-t-0`,children:[(0,Z.jsx)(`span`,{className:`w-6 flex-none pt-0.5 text-right text-[13px] text-muted tabular-nums`,children:e.n}),(0,Z.jsx)(r,{size:16,"aria-hidden":`true`,className:g(`mt-0.5 flex-none`,e.op.startsWith(`expect`)?`text-pass`:`text-muted`)}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Z.jsx)(`span`,{className:`text-sm [overflow-wrap:anywhere]`,children:e.text}),(e.note||e.dynamic||e.inferred||e.case_step)&&(0,Z.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-[12px] text-muted`,children:[e.case_step?(0,Z.jsxs)(`span`,{children:[`case step `,e.case_step]}):null,e.dynamic&&(0,Z.jsx)(`span`,{children:`value changes between runs`}),e.inferred&&(0,Z.jsx)(`span`,{children:`added by ForgeQE`}),e.note&&(0,Z.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[`note: `,e.note]})]})]}),t&&e.n>1&&(0,Z.jsx)(y,{variant:`icon`,size:`icon`,"aria-label":`Delete step ${e.n}`,onClick:n,className:`size-8 flex-none opacity-60 group-hover:opacity-100`,children:(0,Z.jsx)(ne,{size:15,"aria-hidden":`true`})})]})}function ye({s:e,send:t,busy:i}){let[a,o]=(0,X.useState)(``),[,l]=(0,X.useState)(0);(0,X.useEffect)(()=>{let e=setInterval(()=>l(e=>e+1),1e3);return()=>clearInterval(e)},[]);let u=(0,X.useRef)(null);(0,X.useEffect)(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[e.log.length]);let d=e.kind===`desktop`,f=e.state===`paused`,p=e.log.at(-1)?.level===`warn`&&/press Stop again/i.test(e.log.at(-1).text),h=Math.max(0,...e.steps.map(e=>e.case_step||0)),v=(n,r,a,o)=>(0,Z.jsxs)(y,{disabled:i||e.state===`starting`,onClick:()=>t({cmd:n}),title:o,children:[(0,Z.jsx)(a,{size:16,"aria-hidden":`true`}),r]},n);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3 rounded-[14px] border border-line-soft px-4 py-3`,children:[f?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-3 flex-none rounded-full bg-warn`}):(0,Z.jsx)(_,{state:e.state===`starting`?`waiting`:e.state===`stopping`?`working`:`recording`,px:20}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-0.5`,children:[(0,Z.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.name}),(0,Z.jsxs)(`span`,{className:`truncate text-[13px] text-muted`,children:[e.state===`starting`?d?`Starting ${e.app}…`:`Opening the browser…`:e.state===`stopping`?`Saving the workflow…`:f?`Paused: what you do now is not recorded`:`Recording`,` · `,ge(e.startedAt),` ·`,` `,d?`${e.app}, a desktop app`:e.url]})]}),!d&&(0,Z.jsxs)(y,{disabled:i||e.state===`starting`,onClick:()=>t({cmd:`pause`}),children:[f?(0,Z.jsx)(m,{icon:w,size:16}):(0,Z.jsx)(de,{size:16,"aria-hidden":`true`}),f?`Resume`:`Pause`]}),(0,Z.jsxs)(y,{disabled:i||e.state===`stopping`,onClick:()=>t({cmd:`stop`,...p?{force:!0}:{}}),className:`border-fail bg-fail text-white hover:bg-fail hover:text-white hover:opacity-90`,children:[(0,Z.jsx)(n,{size:14,fill:`currentColor`,"aria-hidden":`true`}),p?`Stop anyway`:`Stop and save`]})]}),d?(0,Z.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-accent-soft px-4 py-3 text-sm leading-relaxed text-ink-2`,children:[e.app,` is open on this computer: do the steps in it. Only clicks and keys in its own windows are recorded; password fields are saved as secret names, never as what you type. In the app, `,(0,Z.jsx)(`strong`,{children:`Ctrl+Shift+F11`}),` over a control adds a check of what it shows, and `,(0,Z.jsx)(`strong`,{children:`Ctrl+Shift+F12`}),` or closing the app stops.`]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`details`,{className:`rounded-[12px] bg-accent-soft px-4 py-2.5 text-sm text-ink-2`,children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer`,children:`Do the steps in the browser on this computer. Keys in the page…`}),(0,Z.jsxs)(`p`,{className:`m-0 mt-2 leading-relaxed`,children:[`The Recorder panel in the page does the same as these buttons; in the page, `,e.leader,` then a letter: `,(0,Z.jsx)(`strong`,{children:`A`}),` check, `,(0,Z.jsx)(`strong`,{children:`V`}),` keep a value, `,(0,Z.jsx)(`strong`,{children:`W`}),` wait for, `,(0,Z.jsx)(`strong`,{children:`D`}),` test data, `,(0,Z.jsx)(`strong`,{children:`N`}),` note,`,` `,(0,Z.jsx)(`strong`,{children:`P`}),` pause, `,(0,Z.jsx)(`strong`,{children:`Z`}),` undo, `,(0,Z.jsx)(`strong`,{children:`S`}),` stop.`]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,role:`toolbar`,"aria-label":`Recorder`,children:[v(`assert`,`Check an element`,le,`Pick an element in the page to check`),v(`variable`,`Keep a value`,Y,`Pick an element whose text later steps use`),v(`wait`,`Wait for`,V,`Pick an element the test waits for`),v(`data`,`Test data`,s,`The last value you typed becomes test data`),v(`note`,`Note`,M,`A note for the step, for whoever reads the test`),v(`undo`,`Undo`,re,`Remove the last step`)]}),(0,Z.jsxs)(`form`,{className:`flex flex-wrap gap-2`,onSubmit:e=>{e.preventDefault(),a.trim()&&(t({cmd:`chat`,text:a.trim()}),o(``))},children:[(0,Z.jsx)(`label`,{htmlFor:`rec-check`,className:`sr-only`,children:`Describe a check`}),(0,Z.jsx)(r,{id:`rec-check`,value:a,maxLength:2e3,placeholder:`Describe a check: the total shows "$40.00", or note: …`,onChange:e=>o(e.target.value),className:`min-w-0 flex-[1_1_320px]`}),(0,Z.jsxs)(y,{type:`submit`,variant:`primary`,disabled:i||!a.trim()||e.state===`starting`,children:[(0,Z.jsx)(m,{icon:c,size:16}),`Add`]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-6 gap-y-5`,children:[(0,Z.jsxs)(`section`,{"aria-labelledby":`rec-steps`,className:`flex min-w-0 flex-[999_1_420px] flex-col gap-2 rounded-[14px] border border-line-soft px-4 py-3`,children:[(0,Z.jsxs)(`h2`,{id:`rec-steps`,className:`m-0 flex items-center gap-2 text-base font-semibold`,children:[(0,Z.jsx)(m,{icon:x,size:18,className:`text-accent-fg`}),`Steps`,(0,Z.jsx)(`span`,{className:`text-sm font-normal text-muted`,children:e.summary})]}),e.steps.length?(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,"aria-live":`polite`,children:e.steps.map(e=>(0,Z.jsx)(ve,{s:e,live:!d,onDelete:()=>t({cmd:`delete`,n:e.n})},`${e.n}-${e.text}`))}):(0,Z.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:e.state===`starting`?d?`Starting ${e.app}…`:`Opening the browser…`:`Nothing yet: do the first step in ${d?e.app:`the browser`}.`})]}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-5`,children:[e.case&&(0,Z.jsxs)(`section`,{"aria-labelledby":`rec-case`,className:`flex flex-col gap-2 rounded-[14px] border border-line-soft px-4 py-3`,children:[(0,Z.jsxs)(`h2`,{id:`rec-case`,className:`m-0 flex items-center gap-2 text-base font-semibold`,children:[(0,Z.jsx)(m,{icon:x,size:18,className:`text-accent-fg`}),e.case.id]}),(0,Z.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[e.case.title,`. Each step you record belongs to the case step you are on: pick one to record it.`]}),(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.case.steps.map(n=>{let r=e.steps.some(e=>e.case_step===n.n);return(0,Z.jsx)(`li`,{className:`border-t border-line-soft first:border-t-0`,children:(0,Z.jsxs)(`button`,{type:`button`,disabled:i,"aria-current":n.n===h?`step`:void 0,onClick:()=>t({cmd:`case_step`,n:n.n}),className:g(`flex w-full cursor-pointer items-start gap-2 rounded-[10px] border-0 bg-transparent px-2 py-2 text-left text-sm text-ink hover:bg-surface-muted`,n.n===h&&`bg-accent-soft`),children:[r?(0,Z.jsx)(F,{size:16,"aria-hidden":`true`,className:`mt-0.5 flex-none text-pass`}):(0,Z.jsx)(`span`,{className:`mt-0.5 w-4 flex-none text-center text-[12px] text-muted`,children:n.n}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:n.action}),n.expected&&(0,Z.jsxs)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:[`Expect: `,n.expected]})]})]})},n.n)})}),(0,Z.jsx)(y,{disabled:i,onClick:()=>t({cmd:`case_next`}),className:`self-start`,children:`Next case step`})]}),(0,Z.jsxs)(`section`,{"aria-labelledby":`rec-log`,className:`flex flex-col gap-2 rounded-[14px] border border-line-soft px-4 py-3`,children:[(0,Z.jsx)(`h2`,{id:`rec-log`,className:`m-0 text-base font-semibold`,children:`What the recorder says`}),(0,Z.jsx)(`div`,{ref:u,className:`flex max-h-[280px] flex-col gap-1 overflow-auto text-[13px]`,"aria-live":`polite`,children:e.log.length?e.log.map((e,t)=>(0,Z.jsx)(`p`,{className:g(`m-0 [overflow-wrap:anywhere]`,e.level===`warn`?`text-warn`:e.level===`error`?`text-fail`:`text-ink-2`),children:e.text},t)):(0,Z.jsxs)(`p`,{className:`m-0 text-muted`,children:[`Waiting for `,d?`the app`:`the browser`,`…`]})})]})]})]})]})}function be({s:t}){let n=t.result,[r,i]=(0,X.useState)(``),[a,o]=(0,X.useState)(!1);if(!n)return null;let s=t.kind===`desktop`;return(0,Z.jsxs)(`section`,{"aria-labelledby":`rec-result`,className:`flex flex-col gap-3 rounded-[14px] border border-line-soft p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`h2`,{id:`rec-result`,className:`m-0 flex-1 text-base font-semibold [overflow-wrap:anywhere]`,children:t.name}),(0,Z.jsx)(P,{tone:n.ok?`pass`:`fail`,children:n.ok?`Recorded`:`Not recorded`})]}),(0,Z.jsxs)(`p`,{className:`m-0 text-sm text-ink-2`,children:[n.ok?n.summary||t.summary:n.error||`Nothing was recorded.`,` `,t.endedAt&&(0,Z.jsxs)(`span`,{className:`text-muted`,children:[`· `,ge(t.startedAt,t.endedAt)]})]}),n.ok&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-sm`,children:[(0,Z.jsx)(P,{tone:`neutral`,icon:!1,children:k(t.steps.length,`step`)}),(0,Z.jsxs)(P,{tone:n.checks?`pass`:`warn`,children:[n.checks,` check`,n.checks===1?``:`s`]}),n.variables.length>0&&(0,Z.jsxs)(P,{tone:`neutral`,icon:!1,children:[`kept: `,n.variables.join(`, `)]}),n.testData.length>0&&(0,Z.jsxs)(P,{tone:`neutral`,icon:!1,children:[`test data: `,n.testData.join(`, `)]})]}),!s&&n.secrets.length>0&&(0,Z.jsxs)(`p`,{className:`m-0 text-sm text-ink-2`,children:[`The test reads`,` `,n.secrets.map((e,t)=>(0,Z.jsxs)(`span`,{children:[t?`, `:``,(0,Z.jsx)(`code`,{className:`font-mono text-[13px]`,children:e})]},e)),` `,`from the environment: what you typed there was not saved. Set `,n.secrets.length===1?`it`:`them`,` before the test runs.`]}),n.caseGaps.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-5 text-sm text-warn`,children:n.caseGaps.map(e=>(0,Z.jsxs)(`li`,{children:[`No check for case step `,e.n,`: expects “`,e.expected,`”`]},e.n))}),(n.notes??[]).length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-5 text-sm text-ink-2`,children:n.notes.map((e,t)=>(0,Z.jsx)(`li`,{children:e},t))}),n.skipped.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-5 text-sm text-muted`,children:n.skipped.map((e,t)=>(0,Z.jsxs)(`li`,{children:[`Not recorded: `,e.action,`: `,e.reason]},t))}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[s&&n.workflow&&(0,Z.jsxs)(y,{variant:`primary`,disabled:a,onClick:async()=>{o(!0);try{await Q(n.workflow)}catch(e){i(e.message),o(!1)}},children:[(0,Z.jsx)(N,{size:16,"aria-hidden":`true`}),`Replay it`]}),s&&n.report&&(0,Z.jsxs)(y,{onClick:async()=>i(await d(n.report)),children:[(0,Z.jsx)(m,{icon:e,size:16}),`Open the report`]}),!s&&n.ok&&(0,Z.jsxs)(y,{variant:`primary`,disabled:a,onClick:async()=>{o(!0);try{await _e(t.runDir)}catch(e){i(e.message),o(!1)}},children:[(0,Z.jsx)(m,{icon:c,size:16}),`Write a test from it`]}),!s&&n.ok&&(0,Z.jsxs)(y,{onClick:async()=>i(await d(`${t.runDir}/trace.md`)),children:[(0,Z.jsx)(m,{icon:D,size:16}),`Read the steps`]}),(0,Z.jsx)(`span`,{className:`text-sm`,children:(0,Z.jsx)(j,{path:s&&n.workflow?n.workflow:t.runDir})}),r&&(0,Z.jsx)(`span`,{className:`text-[13px] text-fail`,children:r})]})]})}function xe({view:e,busy:t,onStart:n}){let[o,s]=(0,X.useState)(e.session?.kind===`desktop`&&e.desktop.available?`desktop`:`web`),[c,l]=(0,X.useState)(e.desktop.apps[0]??``),[u,d]=(0,X.useState)(e.apps[0]?.name??``),[m,_]=(0,X.useState)(``),[v,x]=(0,X.useState)(``),[S,C]=(0,X.useState)(``),[w,T]=(0,X.useState)(e.environment??``),[E,D]=(0,X.useState)(!1),[O,k]=(0,X.useState)(!1),A=o===`desktop`?e.desktop.available&&!!c:u?!0:/^https?:\/\/\S+$/i.test(m.trim()),j=o===`web`||e.environments.length>1;return(0,Z.jsxs)(`form`,{"aria-labelledby":`rec-new`,className:`flex flex-col gap-3 rounded-[14px] border border-line-soft bg-bg p-4`,onSubmit:t=>{if(t.preventDefault(),A){if(o===`desktop`)return n({kind:`desktop`,app:c,...v.trim()?{name:v.trim()}:{},...w&&w!==e.environment?{env:w}:{}});n({...u?{app:u}:{url:m.trim()},...v.trim()?{name:v.trim()}:{},...S.trim()?{case:S.trim()}:{},...w&&w!==e.environment?{env:w}:{},signedIn:E})}},children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Z.jsx)(`h2`,{id:`rec-new`,className:`m-0 flex-1 text-base font-semibold`,children:`New recording`}),(0,Z.jsx)(`div`,{role:`radiogroup`,"aria-label":`What to record`,className:`flex gap-1 rounded-[10px] bg-surface-strong p-1`,children:[[`web`,`Web page`,b,!0],[`desktop`,`Desktop app`,p,e.desktop.available]].map(([t,n,r,i])=>(0,Z.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o===t,disabled:!i,title:i?void 0:e.desktop.reason||`Windows only.`,onClick:()=>s(t),className:g(`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-[7px] border-0 px-3 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-50`,o===t?`bg-bg text-ink shadow-sm`:`bg-transparent text-muted hover:text-ink`),children:[(0,Z.jsx)(r,{size:14,"aria-hidden":`true`}),n]},t))})]}),(0,Z.jsxs)(`div`,{className:`grid gap-2 @2xl:grid-cols-[minmax(0,1.2fr)_minmax(0,1fr)_auto]`,children:[o===`desktop`?e.desktop.apps.length?(0,Z.jsx)(a,{"aria-label":`App`,value:c,onChange:e=>l(e.target.value),children:e.desktop.apps.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))}):(0,Z.jsxs)(`p`,{className:`m-0 self-center text-sm text-muted`,children:[`No desktop apps yet: add one in `,(0,Z.jsx)(`a`,{href:f(`settings`,`environments`),children:`Settings, Environments`}),`.`]}):(0,Z.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[e.apps.length>0&&(0,Z.jsxs)(a,{"aria-label":`Start on`,value:u,onChange:e=>d(e.target.value),className:g(u?`min-w-0 flex-1`:`w-[150px] flex-none`),children:[e.apps.map(e=>(0,Z.jsxs)(`option`,{value:e.name,children:[e.name,` · `,e.url]},e.name)),(0,Z.jsx)(`option`,{value:``,children:`Another page…`})]}),!u&&(0,Z.jsx)(r,{"aria-label":`Page address`,type:`url`,value:m,spellCheck:!1,placeholder:`https://shop.example.com/`,onChange:e=>_(e.target.value),className:`min-w-0 flex-1`})]}),(0,Z.jsx)(r,{"aria-label":`What the test does`,value:v,maxLength:200,placeholder:`What the test does`,onChange:e=>x(e.target.value)}),(0,Z.jsxs)(y,{type:`submit`,variant:`primary`,disabled:t||!A,children:[(0,Z.jsx)(ce,{size:16,"aria-hidden":`true`}),t?o===`desktop`?`Starting…`:`Opening…`:`Start recording`]})]}),j&&(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":O,onClick:()=>k(!O),className:`inline-flex cursor-pointer items-center gap-1 self-start border-0 bg-transparent p-0 text-[13px] text-muted hover:text-ink`,children:[(0,Z.jsx)(i,{size:14,"aria-hidden":`true`,className:g(`transition-transform`,O&&`rotate-180`)}),`More options`,!O&&(S||E||w&&w!==e.environment)?(0,Z.jsx)(`span`,{className:`text-accent-fg`,children:`· set`}):null]}),(0,Z.jsx)(ee,{open:O,children:(0,Z.jsxs)(`div`,{className:`grid gap-3 rounded-[12px] bg-surface-muted p-3 @2xl:grid-cols-2`,children:[o===`web`&&(0,Z.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium`,children:[`Test case `,(0,Z.jsx)(`span`,{className:`-mt-1 text-[12.5px] font-normal text-muted`,children:`Its steps are listed while you record; each one you do is tied to it.`}),(0,Z.jsx)(r,{value:S,spellCheck:!1,placeholder:`SHOP-12, ado:1234 or a file`,onChange:e=>C(e.target.value),className:`bg-bg`})]}),e.environments.length>1&&(o===`desktop`||!!u)&&(0,Z.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium`,children:[`Environment`,(0,Z.jsx)(a,{value:w,onChange:e=>T(e.target.value),children:e.environments.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))})]}),o===`web`&&e.logins.length>0&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 @2xl:col-span-2`,children:[(0,Z.jsx)(h,{checked:E,onChange:D,label:`Start signed in`}),(0,Z.jsxs)(`span`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-sm font-medium`,children:`Start signed in`}),(0,Z.jsxs)(`span`,{className:`text-[12.5px] text-muted`,children:[`With the saved sign-ins (`,e.logins.join(`, `),`). Off: the sign-in is recorded too, its password saved as a variable name, never as typed.`]})]})]})]})}),(0,Z.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:o===`desktop`?`The app starts on this computer; do the steps in it. It is saved as a workflow that replays with no model.`:`A browser opens on this computer with the Recorder panel in the page. A chat turns the recording into a test.`})]})}var $=20;function Se({rows:t}){let[n,r]=(0,X.useState)(``),[i,a]=(0,X.useState)(``),[o,s]=(0,X.useState)(`all`),[u,f]=(0,X.useState)(0);if((0,X.useEffect)(()=>f(0),[i,o]),!t.length)return null;let h=i.toLowerCase().split(/\s+/).filter(Boolean),g=t.filter(e=>h.every(t=>`${e.name} ${e.caseId||``} ${e.app||``} ${e.startUrl}`.toLowerCase().includes(t))),_=o===`all`?g:g.filter(e=>e.kind===o),v=_.slice(u*$,u*$+$),x=t.some(e=>e.kind===`desktop`)&&t.some(e=>e.kind===`web`);return(0,Z.jsxs)(`section`,{"aria-labelledby":`rec-list`,className:`flex min-w-0 flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(`h2`,{id:`rec-list`,className:`m-0 mr-2 text-base font-semibold`,children:[`Recordings `,(0,Z.jsx)(`span`,{className:`font-normal text-muted tabular-nums`,children:t.length})]}),(0,Z.jsx)(ae,{id:`rec-search`,label:`Find a recording`,value:i,onChange:a}),x&&(0,Z.jsx)(oe,{items:[{id:`all`,label:`All`,n:g.length},{id:`web`,label:`Web`,n:g.filter(e=>e.kind===`web`).length},{id:`desktop`,label:`Desktop`,n:g.filter(e=>e.kind===`desktop`).length}],value:o,onChange:s})]}),n&&(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:n}),(0,Z.jsxs)(`div`,{className:`rounded-[14px] border border-line-soft bg-bg`,children:[(0,Z.jsxs)(`ul`,{className:`m-0 list-none p-1.5`,children:[v.length===0&&(0,Z.jsx)(`li`,{className:`px-3 py-4 text-sm text-muted`,children:`Nothing matches.`}),v.map((t,n)=>{let i=I(t.startedAt);return(0,Z.jsxs)(`li`,{className:`contents`,children:[(n===0||I(v[n-1].startedAt)!==i)&&(0,Z.jsx)(`span`,{className:`block px-3 pt-3 pb-1 text-[12px] font-semibold text-muted`,children:i}),(0,Z.jsxs)(`div`,{className:`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 rounded-[10px] px-3 py-1.5 hover:bg-surface-muted`,children:[t.ok?(0,Z.jsx)(F,{size:16,"aria-label":`Recorded`,className:`text-pass`}):(0,Z.jsx)(l,{size:16,"aria-label":`Not recorded`,className:`text-fail`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[t.kind===`desktop`?(0,Z.jsx)(m,{icon:p,size:13,className:`flex-none text-muted`,label:`Desktop app`}):(0,Z.jsx)(m,{icon:b,size:13,className:`flex-none text-muted`,label:`Web page`}),(0,Z.jsx)(`span`,{className:`truncate text-[14px] font-medium`,title:t.name,children:t.name})]}),(0,Z.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:[k(t.steps,`step`),k(t.checks,`check`),t.caseId,t.app,se(t.startedAt)].filter(Boolean).join(` · `)})]}),(0,Z.jsxs)(`span`,{className:`flex flex-none items-center gap-1`,children:[t.trace&&(0,Z.jsx)(y,{size:`icon`,variant:`icon`,"aria-label":`Read the steps of ${t.name}`,title:`Read the steps`,onClick:async()=>r(await d(t.trace)),children:(0,Z.jsx)(m,{icon:D,size:15})}),t.report&&(0,Z.jsx)(y,{size:`icon`,variant:`icon`,"aria-label":`Open the report of ${t.name}`,title:`Open the report`,onClick:async()=>r(await d(t.report)),children:(0,Z.jsx)(m,{icon:e,size:15})}),t.kind===`desktop`&&t.workflow&&(0,Z.jsxs)(y,{size:`sm`,onClick:()=>Q(t.workflow).catch(e=>r(e.message)),children:[(0,Z.jsx)(N,{size:14,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`hidden @md:inline`,children:`Replay`})]}),t.kind===`web`&&t.ok&&(0,Z.jsxs)(y,{size:`sm`,onClick:()=>_e(t.runDir).catch(e=>r(e.message)),children:[(0,Z.jsx)(m,{icon:c,size:14}),(0,Z.jsx)(`span`,{className:`hidden @md:inline`,children:`Write a test`})]})]})]})]},t.runDir)})]}),(0,Z.jsx)(ie,{page:u,size:$,total:_.length,onPage:f,label:`Pages of recordings`})]})]})}function Ce(){let[e,t]=(0,X.useState)(null),[n,r]=(0,X.useState)(``),[i,a]=(0,X.useState)(!1),o=(0,X.useCallback)(()=>{O.get().then(e=>{t(e),r(``)},e=>r(e.message))},[]);(0,X.useEffect)(o,[o]);let s=!!e?.session&&he.has(e.session.state);(0,X.useEffect)(()=>{if(!s)return;let e=setInterval(o,800);return()=>clearInterval(e)},[s,o]);let c=async e=>{a(!0),r(``);try{t(await e())}catch(e){r(e.message)}finally{a(!1)}},l=e?.session;return(0,Z.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,Z.jsx)(T,{}),(0,Z.jsxs)(`main`,{className:g(E,`@container flex-auto gap-4`),children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(C,{pixel:u.record,size:`lg`}),(0,Z.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Record`})]}),(0,Z.jsx)(`p`,{className:`m-0 max-w-[74ch] text-sm leading-relaxed text-muted`,children:`Do a test's steps yourself in a browser or a Windows app ForgeQE opens; each click, entry and check you add is recorded in order.`}),n&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:n}),!e&&!n&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),e&&l&&s&&(0,Z.jsx)(ye,{s:l,busy:i,send:e=>void c(()=>O.command(e))}),e&&!s&&(0,Z.jsxs)(Z.Fragment,{children:[l?.result&&(0,Z.jsx)(be,{s:l}),(0,Z.jsx)(xe,{view:e,busy:i,onStart:e=>void c(()=>O.start(e))}),(0,Z.jsx)(Se,{rows:e.recordings})]})]})]})}export{Ce as Record};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Ar as e,Cr as t,G as n,K as r,Nr as i,Un as a,X as o,Y as s,Z as c,bt as l,ct as u,dt as d,j as f,k as p,ot as m,r as h,t as g,wn as _,xt as v,yt as y}from"./frame-3JV5tjBP.js";import{t as b}from"./circle-dashed-DJoDKq93.js";import{t as x}from"./markdown-Bca_tHZ5.js";import{t as S}from"./external-link-Cu8-HMUj.js";import{n as C,t as w}from"./trending-up-DWgCJxJf.js";import{w as T,x as E,y as D}from"./index-XRjCGJfG.js";import{n as O,t as k}from"./when-CHnpLdYw.js";var A=i(e(),1),j=y(),M={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`Mobile run`,page:`Report page`},N=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`})},P=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 F(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 I=50;function L({r:e}){let t=F(e),n=e.scope===`page`?_:t.tone===`pass`?T:t.tone===`fail`?a:b;return(0,j.jsx)(n,{size:16,"aria-label":t.label,className:l(`flex-none`,t.tone===`pass`?`text-pass`:t.tone===`fail`?`text-fail`:t.tone===`warn`?`text-warn`:`text-muted`)})}var R=e=>{let t=new Date(`${e}T12:00:00`);return Number.isNaN(t.getTime())?e:t.toLocaleDateString([],{day:`numeric`,month:`short`})},z=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 B({title:e,note:t,children:n,className:r}){return(0,j.jsxs)(`section`,{className:l(`flex min-w-0 flex-col rounded-[14px] border border-line-soft bg-bg px-4 py-3.5`,r),children:[(0,j.jsx)(`h3`,{className:`m-0 text-[15px] font-semibold`,children:e}),t&&(0,j.jsx)(`p`,{className:`m-0 mt-0.5 text-[12.5px] text-muted`,children:t}),(0,j.jsx)(`div`,{className:`mt-3 flex min-w-0 flex-col`,children:n})]})}function V({part:e,whole:t,tone:n,label:r}){return(0,j.jsxs)(`span`,{className:`flex flex-none items-center gap-2`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-16 flex-none overflow-hidden rounded-full bg-surface-strong`,children:(0,j.jsx)(`span`,{className:l(`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,j.jsx)(`span`,{className:`text-[12.5px] whitespace-nowrap text-ink-2 tabular-nums`,children:r})]})}function H({days:e}){let[t,n]=(0,A.useState)(null),r=e.slice(-30);if(!r.length)return(0,j.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),u=t===null?null:r[t];return(0,j.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,j.jsxs)(`div`,{"aria-hidden":`true`,className:`flex gap-4 text-[12.5px] text-ink-2`,children:[(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,j.jsx)(`span`,{className:`size-2.5 rounded-[3px] bg-pass`}),` Passed`]}),(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,j.jsx)(`span`,{className:`size-2.5 rounded-[3px] bg-fail`}),` Failed`]})]}),(0,j.jsxs)(`div`,{className:`relative grid grid-cols-[32px_minmax(0,1fr)] gap-x-2`,children:[(0,j.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-[180px] flex-col justify-between text-right text-[11px] text-muted tabular-nums`,children:s.map(e=>(0,j.jsx)(`span`,{className:`-translate-y-1/2 first:translate-y-0 last:translate-y-0`,children:e},e))}),(0,j.jsxs)(`div`,{className:`relative h-[180px]`,onMouseLeave:()=>n(null),children:[s.map((e,t)=>(0,j.jsx)(`span`,{"aria-hidden":`true`,className:l(`absolute inset-x-0 border-t`,t===s.length-1?`border-line`:`border-line-soft`),style:{top:`${(1-e/o)*100}%`}},e)),(0,j.jsx)(`div`,{className:`absolute inset-0 flex items-end gap-[3px]`,children:r.map((e,r)=>{let i=e.cases-e.passed;return(0,j.jsx)(`div`,{className:`flex h-full min-w-0 flex-1 cursor-default flex-col justify-end`,onMouseEnter:()=>n(r),children:(0,j.jsxs)(`div`,{className:l(`flex w-full flex-col justify-end gap-[2px] transition-opacity`,t!==null&&t!==r&&`opacity-50`),style:{height:`${e.cases/o*100}%`},children:[i>0&&(0,j.jsx)(`span`,{className:`min-h-[2px] w-full rounded-t-[4px] bg-fail`,style:{flexGrow:i}}),e.passed>0&&(0,j.jsx)(`span`,{className:l(`min-h-[2px] w-full bg-pass`,!i&&`rounded-t-[4px]`),style:{flexGrow:e.passed}})]})},e.day)})}),u&&(0,j.jsxs)(`div`,{role:`status`,className:`pointer-events-none absolute z-[2] w-max max-w-[220px] -translate-x-1/2 -translate-y-[calc(100%+8px)] rounded-[10px] border border-line-soft bg-bg px-3 py-2 text-[12.5px] shadow-composer`,style:{left:`${Math.min(88,Math.max(12,(t+.5)/r.length*100))}%`,top:`${(1-u.cases/o)*100}%`},children:[(0,j.jsx)(`b`,{className:`block text-ink`,children:R(u.day)}),(0,j.jsxs)(`span`,{className:`block text-ink-2 tabular-nums`,children:[u.passed,` passed, `,u.cases-u.passed,` failed · `,z([u]),`%`]}),(0,j.jsx)(`span`,{className:`block text-muted`,children:v(u.runs,`run`)})]})]}),(0,j.jsx)(`span`,{}),(0,j.jsx)(`div`,{"aria-hidden":`true`,className:`mt-1 flex gap-[3px] text-[11px] text-muted`,children:r.map((e,t)=>(0,j.jsx)(`span`,{className:`min-w-0 flex-1 text-center whitespace-nowrap`,children:t%c===0&&(0,j.jsx)(`span`,{className:l(t/c%2==1&&`hidden @2xl:inline`),children:R(e.day)})},e.day))})]}),(0,j.jsxs)(`table`,{className:`sr-only`,children:[(0,j.jsx)(`caption`,{children:`Cases by day`}),(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{children:`Day`}),(0,j.jsx)(`th`,{children:`Runs`}),(0,j.jsx)(`th`,{children:`Passed`}),(0,j.jsx)(`th`,{children:`Failed`})]})}),(0,j.jsx)(`tbody`,{children:r.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{children:e.day}),(0,j.jsx)(`td`,{children:e.runs}),(0,j.jsx)(`td`,{children:e.passed}),(0,j.jsx)(`td`,{children:e.cases-e.passed})]},e.day))})]})]})}function U({project:e,build:n,onBuilt:r}){let[i,o]=(0,A.useState)(n),[c,m]=(0,A.useState)(``),h=!!i?.running;(0,A.useEffect)(()=>{if(!h)return;let e=setInterval(async()=>{try{let e=await t.buildStatus();o(e),e&&!e.running&&r()}catch{}},1200);return()=>clearInterval(e)},[h,r]);let g=e.cases?Math.round(e.passed/e.cases*100):null,_=z(e.days.slice(-7)),y=z(e.days.slice(-14,-7)),b=_!==null&&y!==null?_-y:null,x=[{label:`Runs`,value:String(e.runs),sub:e.runs?`${R(String(e.from).slice(0,10))} – ${R(String(e.to).slice(0,10))}`:void 0},{label:`Cases run`,value:String(e.cases),sub:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`span`,{className:`text-pass`,children:[e.passed,` passed`]}),` · `,(0,j.jsxs)(`span`,{className:l(e.failed&&`text-fail`),children:[e.failed,` failed`]})]})},{label:`Tokens`,value:f(e.tokens),sub:e.cost?p(e.cost.amount,e.cost.currency):void 0}];return(0,j.jsxs)(`section`,{"aria-labelledby":`project-h`,className:`flex min-w-0 flex-col gap-4`,children:[(0,j.jsx)(`h2`,{id:`project-h`,className:`sr-only`,children:`Project report`}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-[1_1_240px] text-[13px] text-muted`,children:e.page?`The HTML report was built ${N(e.page.builtAt)}.`:`Every run, taken together. The HTML report has not been built yet.`}),e.page&&(0,j.jsxs)(d,{size:`sm`,onClick:async()=>m(await s(e.page.file)),children:[(0,j.jsx)(S,{size:14,"aria-hidden":`true`}),`Open HTML report`]}),(0,j.jsx)(d,{size:`sm`,variant:`outline`,disabled:h,onClick:async()=>{m(``);try{o(await t.build())}catch(e){m(e.message)}},children:h?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(u,{state:`working`,px:14}),`Building…`]}):e.page?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(E,{size:14,"aria-hidden":`true`}),`Rebuild`]}):`Build HTML report`})]}),c&&(0,j.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:c}),i&&(i.running||i.ok===!1)&&(0,j.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[!i.running&&(0,j.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:`forgeqe bi build stopped with a problem; its output is below.`}),(0,j.jsx)(`pre`,{"aria-label":`forgeqe bi build output`,"aria-live":`polite`,className:`m-0 max-h-[200px] overflow-auto rounded-[12px] bg-surface-muted px-4 py-3 font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:i.lines.length?i.lines.join(`
|
|
2
|
-
`):`Starting…`})]}),e.runs?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-[14px] border border-line-soft bg-line-soft @2xl:grid-cols-[1.4fr_1fr_1fr_1fr]`,children:[(0,j.jsxs)(`div`,{className:`col-span-2 flex flex-col gap-1 bg-bg px-5 py-4 @2xl:col-span-1`,children:[(0,j.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Pass rate`}),(0,j.jsx)(`span`,{className:l(`text-[34px] leading-none font-semibold tracking-[-0.02em] tabular-nums`,g!==null&&g<80?`text-fail`:`text-ink`),children:g===null?`–`:`${g}%`}),b!==null&&(0,j.jsxs)(`span`,{className:l(`inline-flex items-center gap-1 text-[12.5px]`,b>0?`text-pass`:b<0?`text-fail`:`text-muted`),children:[b>0?(0,j.jsx)(w,{size:14,"aria-hidden":`true`}):b<0?(0,j.jsx)(C,{size:14,"aria-hidden":`true`}):null,b===0?`Same as the week before`:`${b>0?`Up`:`Down`} ${Math.abs(b)} ${Math.abs(b)===1?`point`:`points`} on the week before`]})]}),x.map(e=>(0,j.jsxs)(`div`,{className:`flex flex-col gap-1 bg-bg px-5 py-4 last:col-span-2 @2xl:last:col-span-1`,children:[(0,j.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.label}),(0,j.jsx)(`span`,{className:`text-[22px] leading-tight font-semibold tabular-nums`,children:e.value}),e.sub&&(0,j.jsx)(`span`,{className:`text-[12.5px] text-muted tabular-nums`,children:e.sub})]},e.label))]}),(0,j.jsx)(B,{title:`Cases by day`,note:`The last ${v(Math.min(30,e.days.length),`day`)} with runs. Hover a day for its pass rate.`,children:(0,j.jsx)(H,{days:e.days})}),(0,j.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,j.jsx)(B,{title:`Fails most`,note:`Cases that failed in the most runs.`,children:e.failing.length===0?(0,j.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`No case has failed.`}):(0,j.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.failing.slice(0,8).map(e=>(0,j.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,j.jsx)(a,{size:14,"aria-hidden":`true`,className:`flex-none text-fail`}),(0,j.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-[14px]`,title:e.title,children:[e.id&&(0,j.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink-2`,children:e.id}),` `,e.title]}),(0,j.jsx)(`span`,{className:`flex-none text-[12px] text-muted`,children:k(e.lastFailed)})]}),(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3 pl-[22px]`,children:[(0,j.jsx)(V,{part:e.failed,whole:e.runs,tone:`fail`,label:`failed ${e.failed} of ${e.runs}`}),e.summary&&(0,j.jsx)(`span`,{className:`min-w-0 truncate text-[12.5px] text-muted`,children:e.summary.replace(/[*_`#>[\]]/g,``)})]})]},e.id||e.title))})}),(0,j.jsx)(B,{title:`Defects`,note:`Failures grouped by their cause.`,children:e.defects.length===0?(0,j.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`None found.`}):(0,j.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.defects.slice(0,8).map(e=>(0,j.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,j.jsx)(`span`,{className:`min-w-0 truncate text-[14px]`,title:e.title,children:e.title}),(0,j.jsxs)(`span`,{className:`text-[12.5px] whitespace-nowrap text-muted tabular-nums`,children:[v(e.cases,`case`),` · `,v(e.runs,`run`),e.lastSeen?` · ${k(e.lastSeen)}`:``]})]},e.title))})}),(0,j.jsx)(B,{title:`Flaky`,note:`Cases that both passed and failed.`,children:e.flaky.length===0?(0,j.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`None.`}):(0,j.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.flaky.slice(0,8).map(e=>(0,j.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 border-t border-line-soft py-2 first:border-t-0 first:pt-0`,children:[(0,j.jsxs)(`span`,{className:`min-w-0 truncate text-[14px]`,title:e.title,children:[e.id&&(0,j.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink-2`,children:e.id}),` `,e.title]}),(0,j.jsx)(V,{part:e.failed,whole:e.runs,tone:`fail`,label:`${e.failed}/${e.runs} failed`})]},e.id||e.title))})}),(0,j.jsx)(B,{title:`By kind`,note:`Each kind of run and how often its cases passed.`,children:e.kinds.length===0?(0,j.jsx)(`p`,{className:`m-0 py-2 text-sm text-muted`,children:`No runs with results yet.`}):(0,j.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.kinds.map(e=>(0,j.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,j.jsx)(`span`,{className:`min-w-0 truncate text-[14px]`,children:M[e.scope]||e.scope}),(0,j.jsx)(`span`,{className:`text-[12.5px] text-muted tabular-nums`,children:v(e.runs,`run`)}),(0,j.jsx)(V,{part:e.passed,whole:e.cases,tone:`pass`,label:e.cases?`${Math.round(e.passed/e.cases*100)}% passed`:`no cases`})]},e.scope))})})]})]}):(0,j.jsxs)(`div`,{className:`flex flex-col items-start gap-2 rounded-[14px] border border-dashed border-line px-5 py-6`,children:[(0,j.jsx)(`span`,{className:`font-medium`,children:`No runs yet`}),(0,j.jsx)(`span`,{className:`max-w-[60ch] text-sm text-muted`,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 W({sub:e}){let[i,a]=(0,A.useState)(null),[u,f]=(0,A.useState)(``),[p,_]=(0,A.useState)(``),[v,y]=(0,A.useState)(``),[b,C]=(0,A.useState)(`all`),[w,T]=(0,A.useState)(I),[E,R]=(0,A.useState)(``),z=(0,A.useCallback)(()=>{t.list().then(a,e=>f(e.message))},[]);(0,A.useEffect)(z,[z]);let B=e===`project`?`project`:`execution`,V=i?.rows??null,H=v.toLowerCase().split(/\s+/).filter(Boolean),W=(0,A.useMemo)(()=>(V||[]).filter(e=>(!p||e.scope===p)&&H.every(t=>`${e.title} ${e.id} ${M[e.scope]}`.toLowerCase().includes(t))),[V,p,v]),G=W.filter(e=>F(e).tone===`fail`).length,K=b===`failed`?W.filter(e=>F(e).tone===`fail`):W;(0,A.useEffect)(()=>T(I),[p,v,b]);let q=[...new Set((V||[]).map(e=>e.scope))];return(0,j.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,j.jsx)(h,{}),(0,j.jsxs)(`main`,{className:l(g,`@container flex-auto gap-4`),children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-6 gap-y-2`,children:[(0,j.jsx)(m,{pixel:o.reports,size:`lg`}),(0,j.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Reports`}),(0,j.jsx)(`nav`,{"aria-label":`Reports`,className:`flex gap-1 rounded-[10px] bg-surface-strong p-1`,children:[[`execution`,`Execution reports`,c(`reports`)],[`project`,`Project report`,c(`reports`,`project`)]].map(([e,t,n])=>(0,j.jsx)(`a`,{href:n,"aria-current":B===e?`page`:void 0,className:l(`inline-flex min-h-9 items-center rounded-[7px] px-4 text-sm font-medium no-underline`,B===e?`bg-bg text-ink shadow-composer hover:text-ink`:`text-ink-2 hover:text-ink`),children:t},e))})]}),u&&(0,j.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:u}),!i&&!u&&(0,j.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),i&&B===`project`&&(0,j.jsx)(U,{project:i.project,build:i.build,onBuilt:z}),i&&B===`execution`&&(0,j.jsxs)(j.Fragment,{children:[(0,j.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,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,j.jsxs)(`div`,{className:`relative min-w-0 flex-[1_1_240px]`,children:[(0,j.jsx)(D,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted`}),(0,j.jsx)(`label`,{htmlFor:`report-search`,className:`sr-only`,children:`Find a report`}),(0,j.jsx)(n,{id:`report-search`,type:`search`,value:v,onChange:e=>y(e.target.value),placeholder:`Find a report`,className:`h-9 pl-9`})]}),[[`all`,`All`,W.length],[`failed`,`Failed`,G]].map(([e,t,n])=>(0,j.jsxs)(`button`,{type:`button`,"aria-pressed":b===e,onClick:()=>C(e),className:l(`inline-flex min-h-8 cursor-pointer items-center gap-1 rounded-[8px] border px-3 text-[13px] font-medium`,b===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,j.jsx)(`span`,{className:l(`tabular-nums`,e===`failed`&&n?`text-fail`:``),children:n})]},e)),q.length>1&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`label`,{htmlFor:`report-kind`,className:`sr-only`,children:`Kind`}),(0,j.jsxs)(r,{id:`report-kind`,value:p,onChange:e=>_(e.target.value),className:`h-8 w-auto py-0 pr-7 pl-3 text-[13px]`,children:[(0,j.jsx)(`option`,{value:``,children:`Every kind`}),q.map(e=>(0,j.jsx)(`option`,{value:e,children:M[e]},e))]})]})]}),E&&(0,j.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:E}),(0,j.jsxs)(`div`,{className:`rounded-[14px] border border-line-soft bg-bg`,children:[(0,j.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[minmax(0,1fr)_110px_150px_100px_128px] items-center gap-x-4 border-b border-line-soft px-4 py-2 text-[12px] font-semibold text-muted @3xl:grid`,children:[(0,j.jsx)(`span`,{children:`Report`}),(0,j.jsx)(`span`,{children:`Kind`}),(0,j.jsx)(`span`,{children:`Result`}),(0,j.jsx)(`span`,{className:`text-right`,children:`When`}),(0,j.jsx)(`span`,{})]}),(0,j.jsxs)(`ul`,{"aria-label":`Execution reports`,className:`m-0 list-none p-1.5`,children:[K.length===0&&(0,j.jsx)(`li`,{className:`px-3 py-4 text-sm text-muted`,children:i.rows.length?`Nothing matches.`:`No reports yet. Runs, suites and monitor rounds show here once they have run.`}),K.slice(0,w).map((e,t,n)=>{let r=O(e.startedAt),i=F(e);return(0,j.jsxs)(`li`,{className:`contents`,children:[(t===0||O(n[t-1].startedAt)!==r)&&(0,j.jsx)(`span`,{className:`block px-3 pt-3 pb-1 text-[12px] font-semibold text-muted`,children:r}),(0,j.jsxs)(`div`,{className:`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 rounded-[10px] px-3 py-1.5 hover:bg-surface-muted @3xl:grid-cols-[auto_minmax(0,1fr)_110px_150px_100px_128px] @3xl:gap-x-4`,children:[(0,j.jsx)(L,{r:e}),(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,j.jsx)(`span`,{className:`truncate text-[14px] font-medium`,title:e.title,children:e.title}),(0,j.jsx)(`span`,{className:`truncate text-[12px] text-muted @3xl:hidden`,children:[M[e.scope],e.scope===`page`||!e.counts.total?``:`${e.counts.passed}/${e.counts.total} passed`,k(e.startedAt)].filter(Boolean).join(` · `)})]}),(0,j.jsx)(`span`,{className:`hidden truncate text-[13px] text-muted @3xl:block`,children:M[e.scope]}),(0,j.jsxs)(`span`,{className:`hidden truncate text-[13px] text-muted tabular-nums @3xl:block`,children:[(0,j.jsx)(`span`,{className:l(i.tone===`fail`&&`text-fail`),children:e.scope===`page`?`Report`:e.counts.total?`${e.counts.passed}/${e.counts.total} passed`:i.label}),P(e.ms)?` · ${P(e.ms)}`:``]}),(0,j.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,title:N(e.startedAt),children:k(e.startedAt)}),(0,j.jsx)(`span`,{className:`flex min-w-0 justify-end`,children:e.report?(0,j.jsxs)(d,{size:`sm`,"aria-label":`Open the report of ${e.title} in a new tab`,onClick:async()=>R(await s(e.report)),children:[(0,j.jsx)(S,{size:14,"aria-hidden":`true`}),(0,j.jsx)(`span`,{className:`hidden @md:inline`,children:`Open report`})]}):(0,j.jsx)(x,{path:e.folder,children:`Folder`})})]})]},e.key)})]}),(K.length>w||i.total>i.rows.length)&&(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t border-line-soft px-4 py-2.5 text-[13px] text-muted`,children:[(0,j.jsxs)(`span`,{children:[`Showing `,Math.min(w,K.length),` of `,K.length,i.total>i.rows.length?` (the newest ${i.rows.length} of ${i.total})`:``]}),K.length>w&&(0,j.jsxs)(d,{size:`sm`,onClick:()=>T(w+I),children:[`Show `,Math.min(I,K.length-w),` more`]})]})]})]})]})]})}export{W as Reports};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$t as e,An as t,Ar as n,At as r,Bn as i,Ct as a,G as o,K as s,Nr as c,Nt as l,Ot as u,Sn as d,Tt as f,Un as p,Wn as m,Wt as h,X as g,Y as _,Yn as v,Z as y,Zn as b,_n as x,_t as S,an as C,bt as w,dr as T,dt as E,ir as D,j as O,lt as k,mn as A,ot as ee,qn as j,r as M,rn as N,st as P,t as te,wr as F,xt as I,yt as ne}from"./frame-3JV5tjBP.js";import{t as re}from"./circle-dashed-DJoDKq93.js";import{n as L,t as R}from"./markdown-Bca_tHZ5.js";import{t as ie}from"./external-link-Cu8-HMUj.js";import{a as z,i as ae,t as oe}from"./Response-DhcE4o_e.js";import{D as se,E as ce,b as le,i as B,w as ue,y as de}from"./index-XRjCGJfG.js";import{n as fe,t as pe}from"./when-CHnpLdYw.js";var me={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};me.node;var he=D(me),V=c(n(),1),H=ne(),U={execution:`Execution`,report:`Report`,coding:`Coding`,chat:`Chat`},ge={execution:d,report:t,coding:i,chat:e};function _e({kind:e}){let t=ge[e];return(0,H.jsx)(S,{icon:t,size:14,className:`flex-none text-muted`})}var ve={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`}},W=e=>ve[e]||{label:e?e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g,` `):`–`,tone:`neutral`},ye={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`App run`},be=e=>{if(!e)return``;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`};function G({title:e,icon:t,children:n,aside:r}){return(0,H.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-[14px] border border-line-soft p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`h3`,{className:`m-0 flex flex-1 items-center gap-2 text-base font-semibold`,children:[(0,H.jsx)(`span`,{className:`text-accent-fg`,children:t}),e]}),r]}),n]})}function xe({path:e,label:t=`Open report`}){let[n,r]=(0,V.useState)(``);return(0,H.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(E,{onClick:async()=>r(await _(e)),children:[(0,H.jsx)(ie,{size:16,"aria-hidden":`true`}),t]}),n&&(0,H.jsx)(`span`,{className:`text-[13px] text-fail`,children:n})]})}function Se({items:e,first:t,render:n}){let[r,i]=(0,V.useState)(!1);return(0,H.jsxs)(H.Fragment,{children:[(r?e:e.slice(0,t)).map(n),e.length>t&&(0,H.jsx)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>i(!r),className:`min-h-8 cursor-pointer self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:r?`Show fewer`:`Show all ${e.length}`})]})}function Ce({c:e}){if(!e.total)return null;let t=t=>`${t/e.total*100}%`;return(0,H.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,H.jsx)(`div`,{className:`bg-pass transition-[width] duration-200 ease-out`,style:{width:t(e.passed)}}),(0,H.jsx)(`div`,{className:`bg-fail transition-[width] duration-200 ease-out`,style:{width:t(e.failed)}}),(0,H.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,H.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-line-soft pt-3 first:border-t-0 first:pt-0`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,H.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,H.jsx)(`span`,{className:`text-[13px] text-muted`,children:[ye[e.scope]||e.scope,be(e.ms),e.tokens?`${O(e.tokens)} tokens`:``,e.stopped?`stopped early`:``].filter(Boolean).join(` · `)})]}),e.report&&(0,H.jsx)(xe,{path:e.report})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,H.jsxs)(`span`,{className:`text-[22px] font-semibold tabular-nums`,children:[t,`%`]}),(0,H.jsx)(`span`,{className:`text-muted`,children:`passed`}),(0,H.jsxs)(B,{tone:`pass`,children:[e.counts.passed,` passed`]}),e.counts.failed>0&&(0,H.jsxs)(B,{tone:`fail`,children:[e.counts.failed,` failed`]}),e.counts.other>0&&(0,H.jsxs)(B,{tone:`warn`,children:[e.counts.other,` other`]}),(0,H.jsxs)(`span`,{className:`text-muted`,children:[`of `,e.counts.total]})]}),(0,H.jsx)(Ce,{c:e.counts}),e.cases.length>0&&(0,H.jsx)(`ul`,{"aria-label":`Cases of ${e.title}`,className:`m-0 flex list-none flex-col p-0`,children:(0,H.jsx)(Se,{items:[...e.cases].sort((e,t)=>Number(W(t.status).tone===`fail`)-Number(W(e.status).tone===`fail`)),first:6,render:(e,t)=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-start gap-3 border-t border-line-soft py-2 text-sm`,children:[(0,H.jsx)(`span`,{className:`w-[76px] flex-none`,children:(0,H.jsx)(B,{tone:W(e.status).tone,children:W(e.status).label})}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,H.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[e.id&&(0,H.jsx)(`span`,{className:`mr-1.5 font-mono text-[12px] text-muted`,children:e.id}),e.title,e.device&&(0,H.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.device]})]}),e.summary&&(0,H.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted`,children:e.summary})]}),(0,H.jsx)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:be(e.ms)})]},`${e.id}-${t}`)})}),e.folder&&!e.report&&(0,H.jsxs)(`span`,{className:`text-sm`,children:[`Kept in `,(0,H.jsx)(R,{path:e.folder})]})]})}function Te({list:e}){let t=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,H.jsx)(G,{title:`Execution summary`,icon:(0,H.jsx)(S,{icon:d,size:18}),aside:e.length>1?(0,H.jsxs)(`span`,{className:`text-sm text-muted`,children:[I(e.length,`run`),` · `,t.passed,` of `,t.total,` passed`]}):void 0,children:e.length?e.map((e,t)=>(0,H.jsx)(we,{e},`${e.folder||e.title}-${t}`)):(0,H.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 Ee({list:e}){return(0,H.jsxs)(G,{title:`Report summary`,icon:(0,H.jsx)(S,{icon:t,size:18}),children:[e.length===0&&(0,H.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No report was written in this run.`}),e.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-line-soft pt-3 first:border-t-0 first:pt-0`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,H.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,H.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,H.jsx)(xe,{path:e.path})]}),e.stats&&(0,H.jsx)(`dl`,{className:`m-0 grid grid-cols-[repeat(auto-fit,minmax(110px,1fr))] gap-2`,children:e.stats.map(e=>(0,H.jsxs)(`div`,{className:`rounded-[10px] bg-surface-muted px-3 py-2`,children:[(0,H.jsx)(`dt`,{className:`text-[12px] text-muted`,children:e.label}),(0,H.jsx)(`dd`,{className:`m-0 text-[18px] font-semibold tabular-nums`,children:e.value})]},e.label))}),e.markdown&&(0,H.jsx)(De,{text:e.markdown})]},`${e.path||e.title}-${t}`))]})}function De({text:e,height:t=220}){let[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(!0),[o,s]=(0,V.useState)(t),c=(0,V.useRef)(null);return(0,V.useLayoutEffect)(()=>{c.current&&!n&&a(c.current.scrollHeight>t+8)},[e,t,n]),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsxs)(`div`,{ref:c,style:o===void 0?void 0:{maxHeight:o},onTransitionEnd:e=>e.target===e.currentTarget&&n&&s(void 0),className:w(`transition-[max-height] duration-200 ease-[cubic-bezier(0.2,0.7,0.2,1)]`,o!==void 0&&`relative overflow-hidden`),children:[(0,H.jsx)(L,{text:e,className:`text-sm`}),!n&&i&&(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-bg to-transparent`})]}),(n||i)&&(0,H.jsx)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>{let e=c.current?.scrollHeight??t;if(r(!n),k())return s(n?t:void 0);s(e),n&&requestAnimationFrame(()=>requestAnimationFrame(()=>s(t)))},className:`min-h-8 cursor-pointer self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:n?`Show less`:`Show all of it`})]})}function Oe(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 ke({e}){let[t,n]=(0,V.useState)(!1),r=e.action===`write`?`New`:`Edited`;return(0,H.jsxs)(`li`,{className:`border-t border-line-soft`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-[44px] min-w-0 items-center gap-2 py-1.5 text-sm`,children:[(0,H.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} the diff of ${e.path}`,disabled:!e.diffs.length,onClick:()=>n(!t),className:`inline-flex size-8 flex-none cursor-pointer items-center justify-center rounded-lg border-0 bg-transparent text-muted hover:bg-surface-strong disabled:cursor-default disabled:opacity-40`,children:(0,H.jsx)(m,{size:16,"aria-hidden":`true`,className:w(`transition-transform duration-200`,t&&`rotate-90`)})}),(0,H.jsx)(`span`,{className:`w-[52px] flex-none text-[12px] text-muted`,children:r}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,H.jsx)(R,{path:e.path})}),(0,H.jsxs)(`span`,{className:`flex-none font-mono text-[12px] tabular-nums`,children:[(0,H.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,H.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,H.jsx)(P,{open:t,className:`pb-3 pl-10 [&_pre]:max-h-[420px] [&_pre]:overflow-auto`,children:e.diffs.length?(0,H.jsx)(L,{text:Oe(e.diffs)}):null})]})}function Ae({c:e}){let t=e.edits.reduce((e,t)=>e+t.added,0),n=e.edits.reduce((e,t)=>e+t.removed,0),r=e.tests.at(-1),a=e.reviews.at(-1);return(0,H.jsxs)(G,{title:`Code changes`,icon:(0,H.jsx)(S,{icon:i,size:18}),aside:(0,H.jsxs)(`span`,{className:`font-mono text-[13px] tabular-nums`,children:[e.edits.length,` file`,e.edits.length===1?``:`s`,` · `,(0,H.jsxs)(`span`,{className:`text-pass`,children:[`+`,t]}),` `,(0,H.jsxs)(`span`,{className:`text-fail`,children:[`−`,n]})]}),children:[e.results.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[12px] bg-surface-muted px-4 py-3 text-sm`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(B,{tone:e.status===`passed`||e.status===`done`?`pass`:e.status===`error`||e.status===`failed`?`fail`:`warn`,children:W(e.status).label}),e.testFile&&(0,H.jsx)(R,{path:e.testFile}),e.maxAttempts>0&&(0,H.jsxs)(`span`,{className:`text-muted`,children:[`attempt `,e.attempts,` of `,e.maxAttempts]}),e.review&&(0,H.jsx)(B,{tone:e.review.approved?`pass`:`warn`,children:e.review.approved?`Review approved`:`Review not approved`})]}),e.error&&(0,H.jsx)(`p`,{className:`m-0 text-fail`,children:e.error}),e.notes&&(0,H.jsx)(L,{text:e.notes,className:`text-sm [&_p]:my-1`}),e.command&&(0,H.jsx)(L,{text:`Run it with \`${e.command.replace(/`/g,``)}\``,className:`text-sm [&_p]:my-0`})]},t)),(r||a)&&(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-sm`,children:[r&&(0,H.jsxs)(B,{tone:r.ok?`pass`:`fail`,children:[`Last test run `,r.ok?`passed`:`failed`,e.tests.length>1?` (${e.tests.length} runs)`:``]}),a&&(0,H.jsxs)(B,{tone:a.approved?`pass`:`warn`,children:[`Review `,a.approved?`approved`:`asked for ${a.issues} fix${a.issues===1?``:`es`}`]})]}),e.edits.length?(0,H.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:(0,H.jsx)(Se,{items:e.edits,first:8,render:e=>(0,H.jsx)(ke,{e},e.path)})}):(0,H.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No files changed.`}),e.edits.some(e=>!e.diffs.length)&&(0,H.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 je({final:e,answer:t}){let n=e.from===`agent`?t?.facts??[]:[],r=e.from===`agent`?t?.files??[]:[],i=e.from!==`agent`,a=Math.max(2,...(e.text.match(/`+/g)||[]).map(e=>e.length)),o="`".repeat(a+1);return(0,H.jsxs)(G,{title:`Final message`,icon:(0,H.jsx)(he,{size:18,"aria-hidden":`true`}),aside:(0,H.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:[n.length>0&&(0,H.jsx)(`dl`,{className:`m-0 grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-2`,children:n.map((e,t)=>(0,H.jsxs)(`div`,{className:`min-w-0 rounded-[10px] bg-surface-muted px-3 py-2`,children:[(0,H.jsx)(`dt`,{className:`text-[12px] text-muted`,children:e.label}),(0,H.jsx)(`dd`,{className:`m-0 text-sm [overflow-wrap:anywhere]`,children:(0,H.jsx)(L,{text:e.value,className:`[&_p]:my-0`})})]},`${e.label}-${t}`))}),(0,H.jsx)(De,{text:i?`${o}text\n${e.text}\n${o}`:z(e.text),height:360}),r.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,H.jsx)(`span`,{className:`text-muted`,children:`Files it names:`}),r.map(e=>(0,H.jsx)(R,{path:e},e))]})]})}var Me={rule:{icon:b,label:`Rulebook`},decision:{icon:x,label:`Test decisions`},memory:{icon:v,label:`Page memory`},replay:{icon:h,label:`Replays`},model:{icon:l,label:`Model`},skill:{icon:A,label:`Skills`}};function Ne({list:e}){let t=Object.keys(Me).filter(t=>e.some(e=>e.kind===t));return(0,H.jsx)(G,{title:`Learnings`,icon:(0,H.jsx)(S,{icon:C,size:18}),aside:e.length?(0,H.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[e.length,` from this session`]}):void 0,children:e.length===0?(0,H.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,H.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(280px,1fr))] gap-x-6 gap-y-3`,children:t.map(t=>{let{icon:n,label:r}=Me[t];return(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsxs)(`h4`,{className:`m-0 flex items-center gap-1.5 text-[13px] font-medium text-muted`,children:[(0,H.jsx)(S,{icon:n,size:14}),r]}),(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.filter(e=>e.kind===t).map((e,t)=>(0,H.jsxs)(`li`,{className:`flex flex-col gap-0.5 border-t border-line-soft py-1.5 text-sm first:border-t-0`,children:[(0,H.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.text}),e.note&&(0,H.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.note})]},t))})]},t)})})})}function Pe({run:e}){let t=[];return(e.executions.length||e.kind===`execution`)&&t.push({kind:`execution`,node:(0,H.jsx)(Te,{list:e.executions},`e`)}),(e.reports.length||e.kind===`report`)&&t.push({kind:`report`,node:(0,H.jsx)(Ee,{list:e.reports},`r`)}),e.coding&&(e.coding.edits.length||e.coding.results.length||e.kind===`coding`)&&t.push({kind:`coding`,node:(0,H.jsx)(Ae,{c:e.coding},`c`)}),t.sort((t,n)=>Number(n.kind===e.kind)-Number(t.kind===e.kind)),(0,H.jsx)(H.Fragment,{children:t.map(e=>e.node)})}var Fe={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`}},Ie={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`},Le=e=>Ie[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 Re(e){let[t,n]=(0,V.useState)(Date.now());return(0,V.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function ze({r:t}){return t.origin.kind===`web`?(0,H.jsxs)(`a`,{href:y(`chats`,t.origin.chat),className:`inline-flex items-center gap-1.5`,children:[(0,H.jsx)(S,{icon:e,size:14}),`Web chat`]}):t.origin.kind===`job`?(0,H.jsxs)(`a`,{href:y(`jobs`,encodeURIComponent(t.origin.job)),className:`inline-flex items-center gap-1.5`,children:[(0,H.jsx)(S,{icon:j,size:14}),`Job`]}):(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-muted`,children:[(0,H.jsx)(S,{icon:u,size:14}),`Terminal`]})}function Be({status:e}){let t=Fe[e].label;return e===`running`?(0,H.jsx)(N,{size:16,"aria-label":t,className:`flex-none animate-spin text-accent-fg`}):e===`done`?(0,H.jsx)(ue,{size:16,"aria-label":t,className:`flex-none text-pass`}):e===`failed`?(0,H.jsx)(p,{size:16,"aria-label":t,className:`flex-none text-fail`}):(0,H.jsx)(re,{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 Z({label:e,children:t}){return(0,H.jsxs)(`div`,{className:`grid grid-cols-[120px_minmax(0,1fr)] items-baseline gap-3 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,H.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,H.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:t})]})}function Q({title:e,children:t}){return(0,H.jsxs)(`section`,{className:`flex min-w-0 flex-col rounded-[14px] border border-line-soft px-4 py-3`,children:[(0,H.jsx)(`h3`,{className:`m-0 mb-1 text-[14px] font-semibold`,children:e}),t]})}var Ve={rerun:le,write_test:f,investigate:de,fix_test:a};function He({actions:e}){let[t,n]=(0,V.useState)(``),[r,i]=(0,V.useState)(``);if(!e.length)return null;let a=async e=>{n(e.prompt),i(``);try{let{id:t}=await T.start(e.prompt,{});location.hash=y(`chats`,t)}catch(e){i(e.message),n(``)}};return(0,H.jsxs)(`section`,{"aria-label":`Next steps`,className:`flex flex-col gap-2`,children:[(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map((e,n)=>{let r=Ve[e.kind];return(0,H.jsxs)(`button`,{type:`button`,disabled:!!t,onClick:()=>void a(e),className:w(`flex min-h-[52px] max-w-full cursor-pointer items-center gap-3 rounded-[14px] border px-3 py-2 text-left disabled:cursor-default disabled:opacity-60`,n===0?`border-accent bg-accent-soft hover:bg-accent-soft/70`:`border-line-soft bg-bg hover:bg-surface-muted`),children:[(0,H.jsx)(S,{icon:r,size:18,className:`flex-none text-accent-fg`}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium text-ink`,children:t===e.prompt?`Opening a chat…`:e.label}),(0,H.jsx)(`span`,{className:`max-w-[320px] truncate text-[12px] text-muted`,children:e.note})]})]},n)})}),(0,H.jsx)(`span`,{className:`text-[12px] text-muted`,children:`Each opens a chat with the request; it asks before it changes anything.`}),r&&(0,H.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:r})]})}var Ue=e=>`\`${e.replace(/`/g,``)}\``;function We({name:e}){let[t,n]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(!1),[c,l]=(0,V.useState)(`summary`),u=(0,V.useCallback)(()=>{F.detail(e).then(e=>{n(e),a(``)},e=>a(e.message))},[e]);(0,V.useEffect)(u,[u]);let d=t?.status===`running`;(0,V.useEffect)(()=>{if(!d)return;let e=setInterval(u,2e3);return()=>clearInterval(e)},[u,d]);let f=Re(d),p=(0,V.useMemo)(()=>(t?.events??[]).map(ae).filter(e=>!!e),[t?.events]),m=async()=>{s(!0),a(``);try{await F.cancel(e),u()}catch(e){a(e.message)}finally{s(!1)}},h=(0,H.jsxs)(`a`,{href:y(`runs`),className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,H.jsx)(se,{size:16,"aria-hidden":`true`}),`All runs`]});if(!t)return(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[h,i?(0,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:i}):(0,H.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})]});let g=Fe[t.status],_=!t.replies.length,v=!!t.final||t.executions.length>0||t.reports.length>0||!!(t.coding&&(t.coding.edits.length||t.coding.results.length))||t.learnings.length>0||t.outputs.length>0,b=[{id:`summary`,label:`Summary`},{id:`conversation`,label:_?`Command`:`Conversation`,n:t.replies.length||void 0},{id:`activity`,label:`Activity`,n:p.length||void 0},{id:`details`,label:`Details`}],x=new Set([...t.reports.map(e=>e.path),...t.executions.flatMap(e=>[e.report,e.folder])].filter(Boolean)),S=t.outputs.filter(e=>!x.has(e.path)),C=t.context?.limit?Math.round(t.context.tokens/t.context.limit*100):null;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[h,(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,H.jsx)(`h2`,{className:`m-0 min-w-0 text-[22px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:t.title}),(0,H.jsx)(B,{tone:g.tone,children:g.label})]}),(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-muted`,children:[(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,H.jsx)(_e,{kind:t.kind}),U[t.kind]]}),`· `,(0,H.jsx)(ze,{r:t}),`· `,K(t.startedAt),` · `,d?`running for `:`took `,J(q(t,f)),` · `,O(Y(t)),` tokens`,t.profile?.model?` · ${t.profile.model}`:``]})]}),t.cancel&&(0,H.jsxs)(E,{disabled:o,onClick:()=>void m(),className:`border-fail text-fail hover:bg-fail-soft`,children:[(0,H.jsx)(r,{size:14,fill:`currentColor`,"aria-hidden":`true`}),o?`Stopping…`:t.cancel===`chat`?`Stop this chat's work`:`Cancel this job's run`]})]}),i&&(0,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}),t.error&&(0,H.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[(0,H.jsx)(`strong`,{children:`What went wrong:`}),` `,t.error]}),!d&&(0,H.jsx)(He,{actions:t.actions??[]}),(0,H.jsx)(`div`,{role:`tablist`,"aria-label":`This run`,className:`flex gap-1 overflow-x-auto border-b border-line-soft`,children:b.map(e=>(0,H.jsxs)(`button`,{type:`button`,role:`tab`,id:`run-tab-${e.id}`,"aria-selected":c===e.id,"aria-controls":`run-panel-${e.id}`,onClick:()=>l(e.id),className:w(`-mb-px inline-flex min-h-10 cursor-pointer items-center gap-1.5 border-0 border-b-2 bg-transparent px-3 text-sm font-medium whitespace-nowrap`,c===e.id?`border-accent text-ink`:`border-transparent text-muted hover:text-ink`),children:[e.label,e.n!==void 0&&(0,H.jsx)(`span`,{className:`text-[12px] text-muted tabular-nums`,children:e.n})]},e.id))}),(0,H.jsxs)(`div`,{role:`tabpanel`,id:`run-panel-${c}`,"aria-labelledby":`run-tab-${c}`,className:`flex min-w-0 flex-col gap-4`,children:[c===`summary`&&(0,H.jsxs)(H.Fragment,{children:[t.final&&(0,H.jsx)(je,{final:t.final,answer:t.answer}),(0,H.jsx)(Pe,{run:t}),S.length>0&&(0,H.jsx)(Q,{title:`What it produced (${S.length})`,children:S.map(e=>(0,H.jsx)(Z,{label:e.label,children:(0,H.jsx)(R,{path:e.path})},e.path))}),t.learnings.length>0&&(0,H.jsx)(Ne,{list:t.learnings}),!v&&(0,H.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-3 text-sm text-ink-2`,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,H.jsx)(L,{text:Ue(t.prompt),className:`text-sm [&_p]:my-0`}):(0,H.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:t.replies.map((e,t)=>(0,H.jsxs)(`li`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`div`,{className:`self-end rounded-[14px] bg-surface-strong px-4 py-2.5 text-sm max-w-[85%]`,children:(0,H.jsx)(L,{text:e.ask,className:`[&_p]:my-0.5`})}),e.text&&(0,H.jsx)(L,{text:z(e.text),className:`text-sm`}),e.error&&(0,H.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e.error})]},t))})),c===`activity`&&(t.archived?(0,H.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-3 text-sm text-ink-2`,children:[`ForgeQE keeps the newest session logs only, and this run's is gone. Its summary, final message and learnings were kept in `,(0,H.jsx)(`code`,{className:`font-mono text-[13px]`,children:`.forgeqe/runs`}),`; its step-by-step activity was not.`]}):p.length?(0,H.jsx)(oe,{lines:p,start:t.startedAt,live:d,name:`forgeqe-run-${t.name.replace(/\.log$/,``)}.md`}):(0,H.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing logged yet.`})),c===`details`&&(0,H.jsxs)(`div`,{className:`grid items-start gap-3 @3xl:grid-cols-2`,children:[(0,H.jsxs)(Q,{title:`Numbers`,children:[(0,H.jsx)(Z,{label:d?`Running for`:`Took`,children:J(q(t,f))}),(0,H.jsxs)(Z,{label:`Tokens`,children:[O(Y(t)),` `,(0,H.jsxs)(`span`,{className:`text-muted`,children:[`(`,O(t.usage.input),` in · `,O(t.usage.output),` out`,t.usage.cached?` · ${O(t.usage.cached)} cached`:``,`)`]})]}),(0,H.jsxs)(Z,{label:`Context`,children:[t.context?O(t.context.tokens):`–`,C!==null&&(0,H.jsxs)(`span`,{className:`text-muted`,children:[` of `,O(t.context.limit),` (`,C,`%)`]})]}),(0,H.jsxs)(Z,{label:`Tool calls`,children:[t.tools,` `,(0,H.jsxs)(`span`,{className:`text-muted`,children:[`in `,I(t.turns,`turn`)]})]})]}),(0,H.jsxs)(Q,{title:`Session`,children:[(0,H.jsx)(Z,{label:`Started by`,children:(0,H.jsx)(ze,{r:t})}),(0,H.jsx)(Z,{label:`Command`,children:Le(t.command)}),(0,H.jsx)(Z,{label:`Model`,children:t.profile?[t.profile.name,t.profile.model].filter(Boolean).join(` · `):`–`}),(0,H.jsx)(Z,{label:`Agents`,children:t.agents.length?t.agents.map(e=>`${e.name} (${I(e.calls,`call`)})`).join(`, `):(0,H.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,H.jsxs)(Z,{label:`Log`,children:[t.archived?(0,H.jsx)(`span`,{className:`text-muted`,children:`No longer kept: ForgeQE keeps the newest logs only`}):(0,H.jsx)(R,{path:`.forgeqe/logs/${t.name}`}),t.truncated&&(0,H.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Very long: only its start is shown.`})]})]}),t.job&&(0,H.jsxs)(Q,{title:`Job`,children:[(0,H.jsx)(Z,{label:`Job`,children:(0,H.jsx)(`a`,{href:y(`jobs`,encodeURIComponent(t.origin.kind===`job`?t.origin.job:t.job.name)),children:t.job.name})}),(0,H.jsx)(Z,{label:`Runs`,children:(0,H.jsx)(L,{text:Ue(t.job.command),className:`text-sm [&_p]:my-0`})}),(0,H.jsxs)(Z,{label:`Schedule`,children:[t.job.schedule,!t.job.enabled&&` (disabled)`,t.job.nextAt&&t.job.enabled?` · next ${K(t.job.nextAt)}`:``]}),t.job.run&&(0,H.jsxs)(Z,{label:`This run`,children:[t.job.run.reason===`asked`?`Asked for`:`On schedule`,`, `,t.job.run.status.replace(`_`,` `),t.job.run.exitCode!==void 0&&t.job.run.exitCode!==null?`, exit ${t.job.run.exitCode}`:``]})]}),(0,H.jsx)(Q,{title:`Files worked on (${t.files.length})`,children:t.files.length?t.files.map(e=>(0,H.jsx)(Z,{label:e.action===`write`?`Written`:e.action===`edit`?`Edited`:e.action===`delete`?`Deleted`:e.action||`Changed`,children:e.action===`delete`?(0,H.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.path}):(0,H.jsx)(R,{path:e.path})},e.path)):(0,H.jsx)(`p`,{className:`m-0 py-1 text-sm text-muted`,children:`No files changed.`})}),(0,H.jsx)(Q,{title:`Notifications`,children:t.notifications.length?t.notifications.map(e=>(0,H.jsx)(Z,{label:e.event.replace(/_/g,` `),children:e.channels.length?e.channels.join(`, `):(0,H.jsx)(`span`,{className:`text-muted`,children:`No channel takes it`})},e.event)):(0,H.jsx)(`p`,{className:`m-0 py-1 text-sm text-muted`,children:t.origin.kind===`terminal`||t.origin.kind===`web`?`None: notify channels go with jobs, suites and the monitor.`:`No notify channels are set up (Settings, Notify).`})})]})]})]})}var $=25;function Ge({runs:e}){let t=Re(e.some(e=>e.status===`running`)),[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(`all`),[c,l]=(0,V.useState)(``),[u,d]=(0,V.useState)(``),[f,p]=(0,V.useState)(!1),[h,g]=(0,V.useState)(0);(0,V.useEffect)(()=>g(0),[n,i,c,u,f]);let _=e.filter(X).length,v=n.toLowerCase().split(/\s+/).filter(Boolean),b=e.filter(e=>(f||!X(e))&&(!c||e.kind===c)&&(!u||e.origin.kind===u)&&v.every(t=>`${e.title} ${e.command} ${e.error||``}`.toLowerCase().includes(t))),x={all:b.length,running:b.filter(e=>e.status===`running`).length,failed:b.filter(e=>e.status===`failed`).length},S=i===`all`?b:b.filter(e=>e.status===i),C=Math.max(1,Math.ceil(S.length/$)),T=Math.min(h,C-1),D=S.slice(T*$,T*$+$),k=e.filter(e=>e.status!==`running`&&!X(e)),A=k.filter(e=>e.status===`failed`).length,ee=k.length?k.reduce((e,n)=>e+q(n,t),0)/k.length:NaN,j=e.reduce((e,t)=>e+Y(t),0),M=[...new Set(e.map(e=>e.kind))],N=[...new Set(e.map(e=>e.origin.kind))],P={web:`Web chat`,job:`Job`,terminal:`Terminal`};return e.length===0?(0,H.jsx)(`p`,{className:`m-0 rounded-[14px] bg-surface-muted px-5 py-4 text-sm leading-relaxed text-ink-2`,children:`No runs yet. A chat here, a job, or a ForgeQE command in this project adds one.`}):(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-1 text-[13px] text-muted`,children:[(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:e.length-_}),` runs`]}),e.some(e=>e.status===`running`)&&(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-accent-fg tabular-nums`,children:e.filter(e=>e.status===`running`).length}),` running now`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:w(`tabular-nums`,A?`text-fail`:`text-ink`),children:A}),` failed`,k.length?` (${Math.round(A/k.length*100)}%)`:``]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:O(j)}),` tokens`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:J(Math.round(ee))}),` on average`]})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative min-w-0 flex-[1_1_240px]`,children:[(0,H.jsx)(de,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted`}),(0,H.jsx)(`label`,{htmlFor:`run-search`,className:`sr-only`,children:`Find a run`}),(0,H.jsx)(o,{id:`run-search`,type:`search`,value:n,onChange:e=>r(e.target.value),placeholder:`Find a run by what was asked`,className:`h-9 pl-9`})]}),[[`all`,`All`],[`running`,`Running`],[`failed`,`Failed`]].map(([e,t])=>(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":i===e,onClick:()=>a(e),className:w(`inline-flex min-h-8 cursor-pointer items-center gap-1 rounded-[8px] border px-3 text-[13px] font-medium`,i===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,H.jsx)(`span`,{className:w(`tabular-nums`,e===`failed`&&x.failed?`text-fail`:``),children:x[e]})]},e)),M.length>1&&(0,H.jsxs)(s,{"aria-label":`What it did`,value:c,onChange:e=>l(e.target.value),className:`h-8 w-auto py-0 pr-7 pl-3 text-[13px]`,children:[(0,H.jsx)(`option`,{value:``,children:`Any kind`}),M.map(e=>(0,H.jsx)(`option`,{value:e,children:U[e]},e))]}),N.length>1&&(0,H.jsxs)(s,{"aria-label":`Started by`,value:u,onChange:e=>d(e.target.value),className:`h-8 w-auto py-0 pr-7 pl-3 text-[13px]`,children:[(0,H.jsx)(`option`,{value:``,children:`Started anywhere`}),N.map(e=>(0,H.jsx)(`option`,{value:e,children:P[e]||e},e))]})]}),(0,H.jsxs)(`div`,{className:`rounded-[14px] border border-line-soft bg-bg`,children:[(0,H.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[auto_minmax(0,1fr)_104px_104px_72px_64px_92px] items-center gap-x-4 border-b border-line-soft px-4 py-2 text-[12px] font-semibold text-muted @3xl:grid`,children:[(0,H.jsx)(`span`,{className:`w-4`}),(0,H.jsx)(`span`,{children:`Run`}),(0,H.jsx)(`span`,{children:`Kind`}),(0,H.jsx)(`span`,{children:`Started by`}),(0,H.jsx)(`span`,{className:`text-right`,children:`Took`}),(0,H.jsx)(`span`,{className:`text-right`,children:`Tokens`}),(0,H.jsx)(`span`,{className:`text-right`,children:`When`})]}),(0,H.jsxs)(`ul`,{"aria-label":`Runs`,className:`m-0 list-none p-1.5`,children:[D.length===0&&(0,H.jsx)(`li`,{className:`px-3 py-4 text-sm text-muted`,children:`Nothing matches.`}),D.map((e,n)=>{let r=fe(e.startedAt);return(0,H.jsxs)(`li`,{className:`contents`,children:[(n===0||fe(D[n-1].startedAt)!==r)&&(0,H.jsx)(`span`,{className:`block px-3 pt-3 pb-1 text-[12px] font-semibold text-muted`,children:r}),(0,H.jsxs)(`a`,{href:y(`runs`,encodeURIComponent(e.name)),className:`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 rounded-[10px] px-3 py-1.5 text-ink no-underline hover:bg-surface-muted hover:text-ink @3xl:grid-cols-[auto_minmax(0,1fr)_104px_104px_72px_64px_92px] @3xl:gap-x-4`,children:[(0,H.jsx)(Be,{status:e.status}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate text-[14px] font-medium`,title:e.title,children:e.title}),e.error?(0,H.jsx)(`span`,{className:`truncate text-[12px] text-fail`,children:e.error}):(0,H.jsx)(`span`,{className:`truncate text-[12px] text-muted @3xl:hidden`,children:[U[e.kind],P[e.origin.kind],J(q(e,t)),`${O(Y(e))} tokens`].join(` · `)})]}),(0,H.jsxs)(`span`,{className:`hidden min-w-0 items-center gap-1.5 text-[13px] text-ink-2 @3xl:inline-flex`,children:[(0,H.jsx)(_e,{kind:e.kind}),U[e.kind]]}),(0,H.jsx)(`span`,{className:`hidden text-[13px] text-ink-2 @3xl:block`,children:P[e.origin.kind]||e.origin.kind}),(0,H.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:J(q(e,t))}),(0,H.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:O(Y(e))}),(0,H.jsx)(`span`,{className:`text-right text-[12.5px] text-muted tabular-nums`,title:K(e.startedAt),children:pe(e.startedAt)})]})]},e.name)})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-t border-line-soft px-4 py-2.5 text-[13px] text-muted`,children:[(0,H.jsxs)(`span`,{className:`flex-1`,children:[S.length?`${T*$+1}–${Math.min(S.length,T*$+$)} of ${S.length}`:`0 runs`,_>0&&(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsx)(`button`,{type:`button`,onClick:()=>p(!f),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:f?`Hide the ${I(_,`empty session`)}`:`${I(_,`empty session`)} hidden`})]})]}),C>1&&(0,H.jsxs)(`nav`,{"aria-label":`Pages of runs`,className:`flex items-center gap-1`,children:[(0,H.jsx)(E,{size:`sm`,variant:`ghost`,disabled:T===0,onClick:()=>g(T-1),"aria-label":`Newer runs`,children:(0,H.jsx)(ce,{size:16,"aria-hidden":`true`})}),(0,H.jsxs)(`span`,{className:`px-1 tabular-nums`,children:[`Page `,T+1,` of `,C]}),(0,H.jsx)(E,{size:`sm`,variant:`ghost`,disabled:T>=C-1,onClick:()=>g(T+1),"aria-label":`Older runs`,children:(0,H.jsx)(m,{size:16,"aria-hidden":`true`})})]})]})]})]})}function Ke({sub:e}){let[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(``),a=(0,V.useCallback)(()=>{F.list().then(e=>{n(e.runs),i(``)},e=>i(e.message))},[]);(0,V.useEffect)(a,[a]);let o=t?.some(e=>e.status===`running`);(0,V.useEffect)(()=>{if(e)return;let t=setInterval(a,o?3e3:2e4);return()=>clearInterval(t)},[a,o,e]);let s=e?decodeURIComponent(e):``;return(0,H.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,H.jsx)(M,{}),(0,H.jsx)(`main`,{className:w(te,`@container flex-auto gap-4`),children:s?(0,H.jsx)(We,{name:s},s):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(ee,{pixel:g.runs,size:`lg`}),(0,H.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Runs`})]}),(0,H.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,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,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r}),!t&&!r&&(0,H.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,H.jsx)(Ge,{runs:t})]})})]})}export{Ke as Runs,Be as StatusIcon};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ir as e}from"./frame-3JV5tjBP.js";var t={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};t.node;var n=e(t);export{n as t};
|