@capagents/forgeqe 2.9.5 → 2.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HOW_TO_USE.md +130 -1
- package/README.md +3 -0
- package/dist/docs-site/docs/architecture/index.html +1 -1
- package/dist/docs-site/docs/containers/index.html +2 -2
- package/dist/docs-site/docs/cost-architecture/index.html +1 -1
- package/dist/docs-site/docs/custom-agents-first-run/index.html +216 -0
- package/dist/docs-site/docs/desktop/index.html +1 -1
- package/dist/docs-site/docs/desktop-ci/index.html +1 -1
- package/dist/docs-site/docs/evidence/index.html +992 -0
- package/dist/docs-site/docs/feature-test-prompts/index.html +1 -1
- package/dist/docs-site/docs/graphify/index.html +380 -0
- package/dist/docs-site/docs/guardrails/index.html +2 -2
- package/dist/docs-site/docs/index.html +141 -6
- package/dist/docs-site/docs/mobile/index.html +1 -1
- package/dist/docs-site/docs/model-routing/index.html +1 -1
- package/dist/docs-site/docs/product-graph/index.html +356 -0
- package/dist/docs-site/docs/product-knowledge/index.html +3 -3
- package/dist/docs-site/docs/product-views/index.html +431 -0
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/docs-site/docs/web-app/index.html +2 -2
- package/dist/forgeqe.js +1866 -1664
- package/dist/web/assets/{Agent-BU8FKiQt.js → Agent-I5mRol1P.js} +1 -1
- package/dist/web/assets/{ApiTests-Bsv3NhD5.js → ApiTests--JGFKbOa.js} +1 -1
- package/dist/web/assets/{Browse-D-ho9bS_.js → Browse-CIcl1j4N.js} +2 -2
- package/dist/web/assets/Chat-Baph1nlV.js +3 -0
- package/dist/web/assets/{CommandPalette-CrLuxoE5.js → CommandPalette-Dd0seTKQ.js} +1 -1
- package/dist/web/assets/{Compare-DfHMTNGi.js → Compare-B7barE31.js} +1 -1
- package/dist/web/assets/{Cost-BYb3T8-c.js → Cost-CGXZTXSz.js} +1 -1
- package/dist/web/assets/{Data-EF_k6c_T.js → Data-DGKi3KHS.js} +1 -1
- package/dist/web/assets/{Desktop-DY5Q1Sd3.js → Desktop-wfNhaxat.js} +1 -1
- package/dist/web/assets/{DesktopReview-DFKpYor2.js → DesktopReview-Cxn3mgKO.js} +1 -1
- package/dist/web/assets/{Evidence-Db9H4-Nu.js → Evidence-BZ-WKU9t.js} +1 -1
- package/dist/web/assets/{Explore-B0EkFCFe.js → Explore-pa8l7kiC.js} +1 -1
- package/dist/web/assets/{Features-8jsv2A1d.js → Features-JDMSSUpb.js} +1 -1
- package/dist/web/assets/{Flags-DtzmOA5o.js → Flags-DcWTBteQ.js} +1 -1
- package/dist/web/assets/{Flaky-BCzOx7Mq.js → Flaky-DnHWlzlk.js} +1 -1
- package/dist/web/assets/{ForceGraph-i1zlas5l.js → ForceGraph-BLYMwmyj.js} +1 -1
- package/dist/web/assets/{Impact-Da9L1tDd.js → Impact-Dn5PPQ5Z.js} +1 -1
- package/dist/web/assets/{Jobs-CHw00lcx.js → Jobs-CNhlUenm.js} +1 -1
- package/dist/web/assets/{KindPage-DiOmtzVZ.js → KindPage-BPwFdxHe.js} +1 -1
- package/dist/web/assets/{Migration-Cu4JgOj1.js → Migration-DsGwJd40.js} +1 -1
- package/dist/web/assets/{Product-DmvUI7pH.js → Product-DsolJU4Y.js} +1 -1
- package/dist/web/assets/{Production-CLoOV4jl.js → Production-Cnh3wWiK.js} +1 -1
- package/dist/web/assets/{Quality-ylTg9e0c.js → Quality-W_rQ6nRf.js} +1 -1
- package/dist/web/assets/{Readiness-BMD5Uj8D.js → Readiness-IWAIRZwC.js} +1 -1
- package/dist/web/assets/Record-DOImb7O7.js +2 -0
- package/dist/web/assets/{Regression-D_Hy9bMt.js → Regression-DQuiIAFx.js} +1 -1
- package/dist/web/assets/{Reports-DXphAHAy.js → Reports-C16UVZtQ.js} +1 -1
- package/dist/web/assets/{Response-PDQ8zEZU.js → Response-Vh2lEWnS.js} +1 -1
- package/dist/web/assets/{RunDiff-C3MIKipo.js → RunDiff-CVnhT7JE.js} +1 -1
- package/dist/web/assets/{Runs-DSQZwCpE.js → Runs-CI8NJB1v.js} +1 -1
- package/dist/web/assets/{Steps-CY6WROAr.js → Steps-Bwe4WAjy.js} +1 -1
- package/dist/web/assets/{TestCases-BjgWdtPi.js → TestCases-D5oOzYL4.js} +1 -1
- package/dist/web/assets/{TestData-CDziNp2d.js → TestData-27tyi6OD.js} +1 -1
- package/dist/web/assets/{TestDebt-D59zFYSu.js → TestDebt-D9k3uAiS.js} +1 -1
- package/dist/web/assets/{Tosca-umw1O224.js → Tosca-CMmixiPy.js} +1 -1
- package/dist/web/assets/{WhatsNew-DqNMAytd.js → WhatsNew-CuCua9dD.js} +1 -1
- package/dist/web/assets/{dataParts-DGVc48Ed.js → dataParts-D06wI4i1.js} +1 -1
- package/dist/web/assets/{families-DlfXDoO8.js → families-B0QIuAe3.js} +1 -1
- package/dist/web/assets/filters-mFECJpMB.js +1 -0
- package/dist/web/assets/{fold-BKAl2p_2.js → fold-CeQ84ypG.js} +1 -1
- package/dist/web/assets/frame-BcGZt823.js +4 -0
- package/dist/web/assets/{index-BLUj4Sgh.js → index-CotEpFLY.js} +19 -17
- package/dist/web/assets/index-VgSzQGK8.css +2 -0
- package/dist/web/assets/{logos-J0WPxDqj.js → logos-DN9jLn4q.js} +1 -1
- package/dist/web/assets/{palette-DViz4KwG.js → palette-BdMPhc9j.js} +1 -1
- package/dist/web/assets/{parts-W2J4TR3o.js → parts-z_AE9U-M.js} +1 -1
- package/dist/web/assets/{productParts-_8gKGn4o.js → productParts-C4vc_bLJ.js} +1 -1
- package/dist/web/assets/{qualityParts-DnbSeK-G.js → qualityParts-Cfirt7dZ.js} +1 -1
- package/dist/web/assets/{recordTest-etYNiLQy.js → recordTest-GvGQjhR4.js} +1 -1
- package/dist/web/assets/{rows-CbXelp5_.js → rows-CiR4hGkv.js} +1 -1
- package/dist/web/assets/{segmented-B7n6eLrO.js → segmented-DANusepM.js} +1 -1
- package/dist/web/assets/thread-CyTIuLgk.js +5 -0
- package/dist/web/assets/{usePageChat-DMOtRwzT.js → usePageChat-DOTAHsIS.js} +1 -1
- package/dist/web/index.html +4 -4
- package/docs/user-guide.html +137 -2
- package/env.example.yaml +1 -0
- package/forgeqe.example.yaml +14 -0
- package/package.json +1 -1
- package/prompts/brain.md +6 -3
- package/prompts/doc-reader.md +49 -0
- package/prompts/knowledge-agent.md +64 -0
- package/py/forgeqe_engine/brand.py +10 -1
- package/py/forgeqe_engine/capture.py +28 -12
- package/py/forgeqe_engine/logins.py +27 -0
- package/py/forgeqe_engine/loops.py +9 -0
- package/py/forgeqe_engine/memory.py +59 -0
- package/py/forgeqe_engine/recordsession.py +315 -40
- package/py/forgeqe_engine/service.py +11 -3
- package/py/forgeqe_engine/webrecord.py +153 -12
- package/py/forgeqe_engine/webrecord_page.py +211 -45
- package/dist/web/assets/Chat-czaM5kUi.js +0 -3
- package/dist/web/assets/Record-CoCnmfqW.js +0 -2
- package/dist/web/assets/filters-NVjc0d8i.js +0 -1
- package/dist/web/assets/frame-B0nzdTfN.js +0 -4
- package/dist/web/assets/index-RzPHjTCW.css +0 -2
- package/dist/web/assets/thread-BIUxcjeu.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ar as e,Bt as t,Ir as n,L as r,Nr as i,T as a,dt as o,gr as s,hr as c,j as l,mr as u,o as d,rt as f}from"./line-icons-CQ-3V8ax.js";import{B as p,R as m,a as h,c as g,f as _,h as v,kt as y,qt as b,t as x}from"./filters-NVjc0d8i.js";import{et as S}from"./frame-B0nzdTfN.js";import{l as C,p as w,r as T}from"./index-BLUj4Sgh.js";var E=n(i(),1),D=b(),O=[`critical`,`serious`,`moderate`,`minor`],k={critical:`fail`,serious:`fail`,moderate:`warn`,minor:`neutral`},A=[{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`}],j={same:{label:`Same`,tone:`pass`},changed:{label:`Changed`,tone:`warn`},new:{label:`New baseline`,tone:`neutral`},no_baseline:{label:`No baseline`,tone:`neutral`}},M=e=>new Date(e).toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),N=(e,t)=>t?e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`:e.toFixed(3).replace(/0+$/,``).replace(/\.$/,``),P=(e,t)=>`${e} ${t}${e===1?``:`s`}`,F=e=>e.replace(/(data:[\w/+.-]+;base64,)[A-Za-z0-9+/=]{24,}/g,`$1…`),I=e=>{try{let t=new URL(e),n=t.pathname===`/`?``:t.pathname.length>44?`${t.pathname.slice(0,20)}…${t.pathname.slice(-20)}`:t.pathname;return`${t.host}${n}${t.search?`?…`:``}`}catch{return e.length>70?`${e.slice(0,68)}…`:e}},L=e=>!!(e.breaches||e.a11y?.failed||e.perf.over||e.visual?.changed);function R({run:e,standard:t,disclaimer:n}){let r=e.report,[i,o]=(0,E.useState)(new Set),[s,c]=(0,E.useState)(`all`),[l,u]=(0,E.useState)(!1);if(!r?.accessibility.pages)return(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`This run has no accessibility results: report.accessibility was off, or the run visited no page.`});let d=r.accessibility,m=r.breaches.filter(e=>e.kind===`accessibility`),h=d.failed.filter(e=>s===`all`||e.impact===s).sort((e,t)=>O.indexOf(e.impact)-O.indexOf(t.impact)||t.count-e.count),_=e=>{let t=new Set(i);t.has(e)?t.delete(e):t.add(e),o(t)};return(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[t,` with `,r.engine||`axe`,` on `,P(d.pages,`page`),`: `,(0,D.jsxs)(`span`,{className:`text-pass`,children:[P(d.passed.length,`rule`),` passed`]}),`, `,(0,D.jsxs)(`span`,{className:d.failed.length?`text-fail`:``,children:[d.failed.length,` failed`]}),`.`,` `,r.budgets.accessibility?m.length?`${P(m.length,`budget`)} exceeded.`:`Within the budget.`:`No budget set, so nothing here fails the run.`]}),m.map((e,t)=>(0,D.jsxs)(`p`,{className:`m-0 rounded-[8px] bg-fail-soft px-3 py-1.5 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Over budget · `,I(e.page),`: `,e.text]},t)),d.failed.length>0&&(0,D.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,D.jsx)(`div`,{role:`group`,"aria-label":`Impact`,className:`flex flex-wrap gap-1`,children:[`all`,...O].map(e=>{let t=e===`all`?d.failed.length:d.failed.filter(t=>t.impact===e).length;return e!==`all`&&!t?null:(0,D.jsxs)(`button`,{type:`button`,"aria-pressed":s===e,onClick:()=>c(e),className:p(`inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-[6px] border px-2 text-[12px] capitalize`,s===e?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:text-ink`),children:[e,` `,(0,D.jsx)(`span`,{className:`tabular-nums opacity-75`,children:t})]},e)})})}),d.failed.length?(0,D.jsx)(S,{label:`Failed rules`,placeholder:`Find a rule, WCAG criterion, page or element`,resetKey:s,empty:`Nothing matches.`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`w-[96px] py-1.5 pl-3 font-medium`,children:`Impact`}),(0,D.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Rule`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`WCAG`}),(0,D.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Elements`}),(0,D.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Pages`})]}),children:h.map(t=>{let n=i.has(t.rule),r=e.examples[t.rule]??[];return(0,D.jsxs)(E.Fragment,{children:[(0,D.jsxs)(`tr`,{onClick:()=>_(t.rule),"aria-expanded":n,className:p(`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,n&&`bg-surface-muted`),children:[(0,D.jsx)(`td`,{className:`py-1.5 pl-3`,children:(0,D.jsx)(g,{tone:k[t.impact],className:`min-h-5 px-2 text-[11px] capitalize`,children:t.impact})}),(0,D.jsx)(`td`,{className:`py-1.5 pr-3`,children:(0,D.jsxs)(`span`,{className:`flex items-start gap-1`,children:[(0,D.jsx)(a,{size:13,"aria-hidden":`true`,className:p(`mt-0.5 flex-none text-muted transition-transform`,!n&&`-rotate-90`)}),(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,D.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:t.help}),(0,D.jsx)(`span`,{className:`font-mono text-[11.5px] text-muted`,children:t.rule})]})]})}),(0,D.jsx)(`td`,{className:`hidden py-1.5 pr-3 whitespace-nowrap text-ink-2 @2xl:table-cell`,children:t.wcag?`${t.wcag}${t.level?` · ${t.level}`:``}`:`–`}),(0,D.jsx)(`td`,{className:`py-1.5 pr-3 text-right tabular-nums`,children:t.count}),(0,D.jsx)(`td`,{className:`py-1.5 pr-3 text-right tabular-nums`,children:t.pages})]}),n&&(0,D.jsxs)(`tr`,{className:`bg-surface-muted`,children:[(0,D.jsx)(`td`,{}),(0,D.jsx)(`td`,{colSpan:4,className:`pr-3 pb-3`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-1.5 pl-[17px]`,children:[r.length?r.map((e,t)=>(0,D.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-[8px] border border-line-soft bg-bg px-2.5 py-1.5`,children:[(0,D.jsxs)(`span`,{className:`flex min-w-0 gap-1.5 text-[12px] text-muted`,children:[(0,D.jsx)(`span`,{className:`flex-none`,"data-tip":e.page,children:I(e.page)}),e.target&&(0,D.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-[11.5px]`,"data-tip":e.target,children:[`· `,e.target]})]}),e.html&&(0,D.jsx)(`code`,{className:`line-clamp-3 font-mono text-[12px] break-all text-ink-2`,children:F(e.html)})]},t)):(0,D.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`No elements were kept for this rule.`}),t.helpUrl&&w(t.helpUrl)===`web`&&(0,D.jsxs)(`a`,{href:t.helpUrl,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-1 self-start text-[12.5px]`,children:[`How to fix it `,(0,D.jsx)(f,{size:12,"aria-hidden":`true`})]})]})})]})]},t.rule)})}):(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-pass`,children:`No rule failed on the pages this run visited.`}),d.passed.length>0&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,D.jsxs)(`button`,{type:`button`,"aria-expanded":l,onClick:()=>u(!l),className:`flex cursor-pointer items-center gap-1 self-start border-0 bg-transparent p-0 text-[13px] font-medium text-ink`,children:[(0,D.jsx)(a,{size:13,"aria-hidden":`true`,className:p(`text-muted transition-transform`,!l&&`-rotate-90`)}),`Rules that passed `,(0,D.jsx)(`span`,{className:`font-normal text-muted tabular-nums`,children:d.passed.length})]}),l&&(0,D.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-1 p-0`,children:d.passed.map(e=>(0,D.jsx)(`li`,{className:`rounded-[6px] bg-pass-soft px-2 py-0.5 font-mono text-[11.5px] text-pass`,children:e},e))})]}),(0,D.jsx)(`p`,{className:`m-0 text-[12px] text-muted`,children:n})]})}function z({run:e}){let t=e.report;if(!t?.performance.pages.length)return(0,D.jsx)(`p`,{className:`m-0 text-[13px] 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`},i=t.breaches.filter(e=>e.kind===`performance`);return(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,D.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Core Web Vitals of each page, from one visit in the browser the agent drove, against Google's thresholds: `,(0,D.jsx)(`span`,{className:`text-pass`,children:`good`}),`, `,(0,D.jsx)(`span`,{className:`text-warn`,children:`needs improvement`}),`, `,(0,D.jsx)(`span`,{className:`text-fail`,children:`poor`}),`.`,` `,t.budgets.performance?`Pages over quality.budgets.performance are marked.`:`No performance budget set: nothing fails on timings.`]}),i.map((e,t)=>(0,D.jsxs)(`p`,{className:`m-0 rounded-[8px] bg-fail-soft px-3 py-1.5 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Over budget · `,I(e.page),`: `,e.text]},t)),(0,D.jsx)(S,{label:`Timings`,minWidth:720,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Page`}),A.map(e=>(0,D.jsx)(`th`,{className:`px-2 py-1.5 text-right font-medium`,"data-tip":e.label,children:e.label},e.key)),(0,D.jsx)(`th`,{className:`px-2 py-1.5 text-right font-medium`,children:`Requests`}),(0,D.jsx)(`th`,{className:`py-1.5 pr-3 pl-2 text-right font-medium`,children:`Size`})]}),children:t.performance.pages.map((e,t)=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,D.jsxs)(`td`,{className:`py-1.5 pr-3 pl-3`,children:[(0,D.jsx)(`span`,{className:`block max-w-[340px] truncate font-mono text-[12px]`,"data-tip":e.url,children:I(e.url)}),e.over.length>0&&(0,D.jsxs)(`span`,{className:`text-[11.5px] text-fail`,children:[`over: `,e.over.join(`, `)]})]}),A.map(t=>{let i=e[t.key];return(0,D.jsxs)(`td`,{className:p(`px-2 py-1.5 text-right whitespace-nowrap 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`?N(i,t.unit):`–`,typeof i==`number`&&t.good!==1/0&&(0,D.jsxs)(`span`,{className:`sr-only`,children:[` (`,n(i,t),`)`]})]},t.key)}),(0,D.jsx)(`td`,{className:`px-2 py-1.5 text-right whitespace-nowrap text-muted tabular-nums`,children:e.requests??`–`}),(0,D.jsx)(`td`,{className:`py-1.5 pr-3 pl-2 text-right whitespace-nowrap text-muted tabular-nums`,children:e.kb===void 0?`–`:`${e.kb} KB`})]},t))}),(0,D.jsxs)(`p`,{className:`m-0 text-[12px] text-muted`,children:[A.filter(e=>e.good!==1/0).map(e=>`${e.label}: good up to ${N(e.good,e.unit)}, poor over ${N(e.poor,e.unit)}`).join(` · `),`. Lab values from one visit, not data from real users.`]})]})}function B({run:e,index:n,which:r,label:i}){let[a,o]=(0,E.useState)(``),[s,c]=(0,E.useState)(!1);return(0,E.useEffect)(()=>{let t=!1;return o(``),c(!1),y.image(e,n,r).then(e=>!t&&o(e),()=>!t&&c(!0)),()=>{t=!0}},[e,n,r]),(0,D.jsxs)(`figure`,{className:`m-0 flex min-w-0 flex-col gap-1.5`,children:[(0,D.jsx)(`figcaption`,{className:`text-[12px] font-medium text-muted`,children:i}),a?(0,D.jsx)(`img`,{src:a,alt:`${i} of the page`,className:`block h-auto w-full rounded-[10px] border border-line-soft bg-surface-muted`}):(0,D.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:s?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(v,{icon:t,size:14}),` Not available`]}):`Loading…`})]})}function V({run:t,budget:n,onChange:r}){let[i,s]=(0,E.useState)(null),[c,u]=(0,E.useState)(``),[d,f]=(0,E.useState)(!1),[_,v]=(0,E.useState)(``),[b,x]=(0,E.useState)(new Set),[C,w]=(0,E.useState)(`all`),T=t.visual?.pages??[],O=T.find(e=>e.status===`changed`)?.index;(0,E.useEffect)(()=>x(O===void 0?new Set:new Set([O])),[t.id,O]);let k=async e=>{f(!0),v(``);try{r(await e()),s(null),u(``)}catch(e){v(e.message)}finally{f(!1)}};if(!t.visual)return t.captured?(0,D.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,D.jsxs)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:[`This run captured `,P(t.captured,`page`),` but they were not compared with the baselines yet.`]}),(0,D.jsxs)(m,{size:`sm`,variant:`primary`,disabled:d,"data-tip":`Compare with the baselines`,onClick:()=>k(()=>y.compare(t.id)),children:[(0,D.jsx)(o,{"aria-hidden":`true`}),`Compare`]}),_&&(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:_})]}):(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`This run has no visual captures: quality.visual.enabled was off, or the run visited no page.`});let A=T.filter(e=>e.status===`changed`),M=(C===`changed`?A:T).slice().sort((e,t)=>Number(t.status===`changed`)-Number(e.status===`changed`)||(t.diffPercent??0)-(e.diffPercent??0)),N=e=>{let t=new Set(b);t.has(e)?t.delete(e):t.add(e),x(t)};return(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Each page captured with animations frozen and masked regions hidden, against its approved baseline. `,n?`A page over quality.budgets.visual fails the run.`:`No visual budget set: a change does not fail the run.`]}),(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,D.jsx)(`div`,{role:`group`,"aria-label":`Show`,className:`flex gap-1`,children:[[`all`,`All pages`,T.length],[`changed`,`Changed`,A.length]].map(([e,t,n])=>(0,D.jsxs)(`button`,{type:`button`,"aria-pressed":C===e,onClick:()=>w(e),className:p(`inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-[6px] border px-2 text-[12px]`,C===e?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:text-ink`),children:[t,` `,(0,D.jsx)(`span`,{className:`tabular-nums opacity-75`,children:n})]},e))}),(0,D.jsx)(`span`,{className:`flex-1`}),A.length>1&&(0,D.jsxs)(m,{size:`sm`,disabled:d,"data-tip":`Approve all ${A.length} changes`,onClick:()=>s(A.map(e=>e.url)),children:[(0,D.jsx)(l,{"aria-hidden":`true`}),`Approve (`,A.length,`)`]})]}),i&&(0,D.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Approve as baseline`,className:`flex flex-col gap-2 rounded-[10px] border border-accent-line bg-accent-soft p-3 text-[13px]`,children:[(0,D.jsxs)(`span`,{className:`font-medium`,children:[`Make this run's capture the baseline of `,i.length===1?I(i[0]):P(i.length,`page`),`?`]}),(0,D.jsx)(`span`,{className:`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,D.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[`Why it changed (kept with the baseline)`,(0,D.jsx)(h,{size:`sm`,value:c,maxLength:300,placeholder:`New checkout banner`,onChange:e=>u(e.target.value),className:`max-w-[480px] bg-bg`})]}),(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,D.jsxs)(m,{size:`sm`,variant:`primary`,disabled:d,onClick:()=>k(()=>y.approve(t.id,i,c.trim()||void 0)),children:[(0,D.jsx)(l,{"aria-hidden":`true`}),`Approve`]}),(0,D.jsxs)(m,{size:`sm`,onClick:()=>s(null),children:[(0,D.jsx)(e,{"aria-hidden":`true`}),`Cancel`]})]})]}),_&&(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:_}),(0,D.jsx)(S,{label:`Pages against their baselines`,fixed:!0,resetKey:C,empty:`No page changed.`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Page`}),(0,D.jsx)(`th`,{className:`hidden w-[110px] py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Size`}),(0,D.jsx)(`th`,{className:`w-[90px] py-1.5 pr-3 text-right font-medium`,children:`Changed`}),(0,D.jsx)(`th`,{className:`w-[120px] py-1.5 pr-3 font-medium`,children:`Result`}),(0,D.jsx)(`th`,{className:`w-[96px] py-1.5 pr-3`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Approve`})})]}),children:M.map(e=>{let n=b.has(e.index);return(0,D.jsxs)(E.Fragment,{children:[(0,D.jsxs)(`tr`,{onClick:()=>N(e.index),"aria-expanded":n,className:p(`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,n&&`bg-surface-muted`),children:[(0,D.jsx)(`td`,{className:`py-1.5 pr-3 pl-3`,children:(0,D.jsxs)(`span`,{className:`flex items-start gap-1`,children:[(0,D.jsx)(a,{size:13,"aria-hidden":`true`,className:p(`mt-0.5 flex-none text-muted transition-transform`,!n&&`-rotate-90`)}),(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,D.jsx)(`span`,{className:`truncate`,"data-tip":e.title||e.url,children:e.title||I(e.url)}),(0,D.jsx)(`span`,{className:`truncate font-mono text-[11.5px] text-muted`,"data-tip":e.url,children:I(e.url)})]})]})}),(0,D.jsxs)(`td`,{className:`hidden py-1.5 pr-3 whitespace-nowrap text-muted @2xl:table-cell`,children:[e.size||`–`,e.resized?` · resized ${e.resized}`:``]}),(0,D.jsx)(`td`,{className:p(`py-1.5 pr-3 text-right whitespace-nowrap tabular-nums`,e.over?`text-fail`:e.status===`changed`?`text-warn`:`text-muted`),children:e.status===`changed`?`${e.diffPercent}%${e.limit===void 0?``:` / ${e.limit}%`}`:`–`}),(0,D.jsx)(`td`,{className:`py-1.5 pr-3`,children:(0,D.jsx)(g,{tone:e.over?`fail`:j[e.status].tone,className:`min-h-5 px-2 text-[11px]`,children:e.over?`Over budget`:j[e.status].label})}),(0,D.jsx)(`td`,{className:`py-1 pr-3 text-right`,onClick:e=>e.stopPropagation(),children:e.status===`changed`&&(0,D.jsx)(m,{variant:`icon`,size:`icon-sm`,disabled:d,"aria-label":`Approve ${I(e.url)}`,"data-tip":`Approve ${I(e.url)}`,onClick:()=>s([e.url]),children:(0,D.jsx)(l,{"aria-hidden":`true`})})})]}),n&&(0,D.jsx)(`tr`,{className:`bg-surface-muted`,children:(0,D.jsx)(`td`,{colSpan:5,className:`px-3 pb-3`,children:(0,D.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-3`,children:[e.images.baseline&&(0,D.jsx)(B,{run:t.id,index:e.index,which:`baseline`,label:`Baseline`}),e.images.current&&(0,D.jsx)(B,{run:t.id,index:e.index,which:`current`,label:`This run`}),e.images.diff&&(0,D.jsx)(B,{run:t.id,index:e.index,which:`diff`,label:`Difference (in red)`})]})})})]},e.index)})})]})}function H({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,D.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,D.jsx)(`polyline`,{points:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinejoin:`round`})})}function U({icon:e,className:t,lines:n}){return n.length?(0,D.jsxs)(`span`,{className:p(`flex items-start gap-1.5 text-[13px]`,t),children:[(0,D.jsx)(v,{icon:e,size:14,className:`mt-0.5 flex-none`}),(0,D.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:n.join(` · `)})]}):null}function W({trends:e}){return e.length?(0,D.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.map(e=>{let t=e.a11y.latest?O.reduce((t,n)=>t+(e.a11y.latest[n]||0),0):void 0;return(0,D.jsxs)(`li`,{className:`flex flex-col gap-1.5 border-t border-line-soft py-3 first:border-t-0`,children:[(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-3`,children:[(0,D.jsx)(`span`,{className:`min-w-0 flex-[1_1_240px] truncate font-mono text-[13px]`,"data-tip":e.page,children:/^https?:/.test(e.page)?I(e.page):e.page}),(0,D.jsx)(H,{values:e.a11y.trail}),(0,D.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[P(e.runs,`run`),t===void 0?``:` · ${P(t,`violation`)} now`]})]}),(0,D.jsx)(U,{icon:c,className:`text-fail`,lines:[...e.perf.worse.map(e=>`slower: ${e}`),...e.a11y.newRules.map(e=>`newly failing: ${e}`)]}),(0,D.jsx)(U,{icon:u,className:`text-pass`,lines:[...e.perf.better.map(e=>`faster: ${e}`),...e.a11y.fixedRules.map(e=>`fixed: ${e}`)]})]},e.page)})}):(0,D.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.`})}var G={accessibility:e=>!!e.a11y?.pages,performance:e=>e.perf.pages>0,visual:e=>!!e.visual||e.captured>0},K={accessibility:e=>!!e.a11y?.failed,performance:e=>e.perf.over>0,visual:e=>!!(e.visual?.changed||e.visual?.over)},q=(e,t)=>t.filter(G[e]);function J({kind:e,runs:t}){let[n,i]=(0,E.useState)(`all`),a=q(e,t),o=n===`attention`?a.filter(K[e]):a,c=t=>location.hash=_(e,encodeURIComponent(t)),u=`py-2 pr-3 text-right tabular-nums`;return(0,D.jsx)(S,{label:`Runs`,placeholder:`Find a run by what it did`,resetKey:n,empty:`Nothing matches.`,tools:(0,D.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,D.jsx)(x,{items:[{id:`all`,label:`All`,n:a.length},{id:`attention`,label:`Needs a look`,n:a.filter(K[e]).length,alert:!0}],value:n,onChange:i})}),head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`w-[46%] py-1.5 pr-3 pl-3 font-medium`,children:`Run`}),e===`accessibility`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Rules failed`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @2xl:table-cell`,children:`Critical · serious`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @3xl:table-cell`,children:`Moderate · minor`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @xl:table-cell`,children:`Pages`})]}),e===`performance`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Over budget`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @xl:table-cell`,children:`Pages timed`})]}),e===`visual`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Changed`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @2xl:table-cell`,children:`New`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @xl:table-cell`,children:`Same`})]}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`When`})]}),children:o.map(t=>{let n=K[e](t),i=(t.over?.[e]??0)>0;return(0,D.jsxs)(`tr`,{onClick:()=>c(t.id),className:`cursor-pointer border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(i?r:n?s:l,{size:15,"aria-label":i?`Over a budget`:n?`Needs a look`:`Within budgets`,className:p(`flex-none`,i?`text-fail`:n?`text-warn`:`text-pass`)}),(0,D.jsx)(`a`,{href:_(e,encodeURIComponent(t.id)),onClick:e=>e.stopPropagation(),"data-tip":t.goal,className:`truncate text-ink no-underline hover:underline`,children:t.goal})]})}),e===`accessibility`&&t.a11y&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`td`,{className:p(u,t.a11y.failed?`text-fail`:`text-muted`),children:t.a11y.failed}),(0,D.jsx)(`td`,{className:p(u,`hidden @2xl:table-cell`,t.a11y.critical+t.a11y.serious?`text-fail`:`text-muted`),children:`${t.a11y.critical} · ${t.a11y.serious}`}),(0,D.jsx)(`td`,{className:p(u,`hidden text-muted @3xl:table-cell`),children:`${t.a11y.moderate} · ${t.a11y.minor}`}),(0,D.jsx)(`td`,{className:p(u,`hidden text-muted @xl:table-cell`),children:t.a11y.pages})]}),e===`performance`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`td`,{className:p(u,t.perf.over?`text-fail`:`text-muted`),children:t.perf.over}),(0,D.jsx)(`td`,{className:p(u,`hidden text-muted @xl:table-cell`),children:t.perf.pages})]}),e===`visual`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`td`,{className:p(u,t.visual?.changed?`text-warn`:`text-muted`),children:t.visual?t.visual.changed:`not compared`}),(0,D.jsx)(`td`,{className:p(u,`hidden text-muted @2xl:table-cell`),children:t.visual?t.visual.new+t.visual.no_baseline:`–`}),(0,D.jsx)(`td`,{className:p(u,`hidden text-muted @xl:table-cell`),children:t.visual?t.visual.same:`–`})]}),(0,D.jsx)(`td`,{className:`hidden py-2 pr-3 whitespace-nowrap text-[12.5px] text-muted @xl:table-cell`,"data-tip":M(t.at),children:T(t.at)})]},t.id)})})}function Y({kind:e,id:t,view:n,onChanged:r}){let[i,o]=(0,E.useState)(null),[s,c]=(0,E.useState)(``);(0,E.useEffect)(()=>{let e=!1;return o(null),y.run(t).then(t=>{e||(o(t),c(``))},t=>!e&&c(t.message)),()=>{e=!0}},[t]);let l=(0,D.jsxs)(`a`,{href:_(e),className:`inline-flex items-center gap-1 self-start text-[13px] no-underline`,children:[(0,D.jsx)(a,{size:14,"aria-hidden":`true`,className:`rotate-90`}),`All runs`]});return s||!i?(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[l,s?(0,D.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail`,children:s}):(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Loading…`})]}):(0,D.jsxs)(`section`,{"aria-labelledby":`run-h`,className:`flex min-w-0 flex-col gap-3`,children:[l,(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,D.jsx)(`h2`,{id:`run-h`,"data-tip":i.goal,className:`m-0 truncate text-[16px] leading-snug font-semibold`,children:i.goal}),(0,D.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-[12.5px] text-muted`,children:[M(i.at),` · `,(0,D.jsx)(C,{path:i.dir}),` · `,(0,D.jsx)(`a`,{href:_(`quality`,encodeURIComponent(i.id)),children:`Everything it measured`})]})]}),e===`accessibility`&&(0,D.jsx)(R,{run:i,standard:n.standard,disclaimer:n.disclaimer}),e===`performance`&&(0,D.jsx)(z,{run:i}),e===`visual`&&(0,D.jsx)(V,{run:i,budget:n.budgets.visual,onChange:e=>{o(e),r()}})]})}function X({r:e,to:t,line:n}){return(0,D.jsxs)(`div`,{className:`ml-12 flex flex-wrap items-center gap-x-4 gap-y-2 rounded-[14px] card border px-4 py-3`,children:[(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col`,children:[(0,D.jsx)(`span`,{className:`text-[14.5px] font-medium [overflow-wrap:anywhere]`,children:e.goal}),(0,D.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:n})]}),(0,D.jsxs)(m,{size:`sm`,variant:`primary`,"data-tip":`Open the run`,onClick:()=>location.hash=t,children:[(0,D.jsx)(d,{"aria-hidden":`true`}),`Open`]})]})}function Z({label:e,value:t,sub:n,tone:r}){return(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5 px-3 py-2`,children:[(0,D.jsx)(`span`,{className:`text-[11.5px] text-muted`,children:e}),(0,D.jsx)(`span`,{className:p(`text-[16px] leading-tight font-semibold tabular-nums`,r),children:t}),n&&(0,D.jsx)(`span`,{className:`truncate text-[11.5px] text-muted`,children:n})]})}export{M as _,J as a,X as c,V as d,N as f,I as g,q as h,Y as i,W as l,P as m,O as n,Z as o,L as p,k as r,z as s,R as t,A as u};
|
|
1
|
+
import{Ar as e,Bt as t,Ir as n,L as r,Nr as i,T as a,dt as o,gr as s,hr as c,j as l,mr as u,o as d,rt as f}from"./line-icons-CQ-3V8ax.js";import{B as p,R as m,a as h,c as g,f as _,h as v,kt as y,qt as b,t as x}from"./filters-mFECJpMB.js";import{et as S}from"./frame-BcGZt823.js";import{l as C,p as w,r as T}from"./index-CotEpFLY.js";var E=n(i(),1),D=b(),O=[`critical`,`serious`,`moderate`,`minor`],k={critical:`fail`,serious:`fail`,moderate:`warn`,minor:`neutral`},A=[{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`}],j={same:{label:`Same`,tone:`pass`},changed:{label:`Changed`,tone:`warn`},new:{label:`New baseline`,tone:`neutral`},no_baseline:{label:`No baseline`,tone:`neutral`}},M=e=>new Date(e).toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),N=(e,t)=>t?e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`:e.toFixed(3).replace(/0+$/,``).replace(/\.$/,``),P=(e,t)=>`${e} ${t}${e===1?``:`s`}`,F=e=>e.replace(/(data:[\w/+.-]+;base64,)[A-Za-z0-9+/=]{24,}/g,`$1…`),I=e=>{try{let t=new URL(e),n=t.pathname===`/`?``:t.pathname.length>44?`${t.pathname.slice(0,20)}…${t.pathname.slice(-20)}`:t.pathname;return`${t.host}${n}${t.search?`?…`:``}`}catch{return e.length>70?`${e.slice(0,68)}…`:e}},L=e=>!!(e.breaches||e.a11y?.failed||e.perf.over||e.visual?.changed);function R({run:e,standard:t,disclaimer:n}){let r=e.report,[i,o]=(0,E.useState)(new Set),[s,c]=(0,E.useState)(`all`),[l,u]=(0,E.useState)(!1);if(!r?.accessibility.pages)return(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`This run has no accessibility results: report.accessibility was off, or the run visited no page.`});let d=r.accessibility,m=r.breaches.filter(e=>e.kind===`accessibility`),h=d.failed.filter(e=>s===`all`||e.impact===s).sort((e,t)=>O.indexOf(e.impact)-O.indexOf(t.impact)||t.count-e.count),_=e=>{let t=new Set(i);t.has(e)?t.delete(e):t.add(e),o(t)};return(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[t,` with `,r.engine||`axe`,` on `,P(d.pages,`page`),`: `,(0,D.jsxs)(`span`,{className:`text-pass`,children:[P(d.passed.length,`rule`),` passed`]}),`, `,(0,D.jsxs)(`span`,{className:d.failed.length?`text-fail`:``,children:[d.failed.length,` failed`]}),`.`,` `,r.budgets.accessibility?m.length?`${P(m.length,`budget`)} exceeded.`:`Within the budget.`:`No budget set, so nothing here fails the run.`]}),m.map((e,t)=>(0,D.jsxs)(`p`,{className:`m-0 rounded-[8px] bg-fail-soft px-3 py-1.5 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Over budget · `,I(e.page),`: `,e.text]},t)),d.failed.length>0&&(0,D.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,D.jsx)(`div`,{role:`group`,"aria-label":`Impact`,className:`flex flex-wrap gap-1`,children:[`all`,...O].map(e=>{let t=e===`all`?d.failed.length:d.failed.filter(t=>t.impact===e).length;return e!==`all`&&!t?null:(0,D.jsxs)(`button`,{type:`button`,"aria-pressed":s===e,onClick:()=>c(e),className:p(`inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-[6px] border px-2 text-[12px] capitalize`,s===e?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:text-ink`),children:[e,` `,(0,D.jsx)(`span`,{className:`tabular-nums opacity-75`,children:t})]},e)})})}),d.failed.length?(0,D.jsx)(S,{label:`Failed rules`,placeholder:`Find a rule, WCAG criterion, page or element`,resetKey:s,empty:`Nothing matches.`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`w-[96px] py-1.5 pl-3 font-medium`,children:`Impact`}),(0,D.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Rule`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`WCAG`}),(0,D.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Elements`}),(0,D.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Pages`})]}),children:h.map(t=>{let n=i.has(t.rule),r=e.examples[t.rule]??[];return(0,D.jsxs)(E.Fragment,{children:[(0,D.jsxs)(`tr`,{onClick:()=>_(t.rule),"aria-expanded":n,className:p(`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,n&&`bg-surface-muted`),children:[(0,D.jsx)(`td`,{className:`py-1.5 pl-3`,children:(0,D.jsx)(g,{tone:k[t.impact],className:`min-h-5 px-2 text-[11px] capitalize`,children:t.impact})}),(0,D.jsx)(`td`,{className:`py-1.5 pr-3`,children:(0,D.jsxs)(`span`,{className:`flex items-start gap-1`,children:[(0,D.jsx)(a,{size:13,"aria-hidden":`true`,className:p(`mt-0.5 flex-none text-muted transition-transform`,!n&&`-rotate-90`)}),(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,D.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:t.help}),(0,D.jsx)(`span`,{className:`font-mono text-[11.5px] text-muted`,children:t.rule})]})]})}),(0,D.jsx)(`td`,{className:`hidden py-1.5 pr-3 whitespace-nowrap text-ink-2 @2xl:table-cell`,children:t.wcag?`${t.wcag}${t.level?` · ${t.level}`:``}`:`–`}),(0,D.jsx)(`td`,{className:`py-1.5 pr-3 text-right tabular-nums`,children:t.count}),(0,D.jsx)(`td`,{className:`py-1.5 pr-3 text-right tabular-nums`,children:t.pages})]}),n&&(0,D.jsxs)(`tr`,{className:`bg-surface-muted`,children:[(0,D.jsx)(`td`,{}),(0,D.jsx)(`td`,{colSpan:4,className:`pr-3 pb-3`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-1.5 pl-[17px]`,children:[r.length?r.map((e,t)=>(0,D.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-[8px] border border-line-soft bg-bg px-2.5 py-1.5`,children:[(0,D.jsxs)(`span`,{className:`flex min-w-0 gap-1.5 text-[12px] text-muted`,children:[(0,D.jsx)(`span`,{className:`flex-none`,"data-tip":e.page,children:I(e.page)}),e.target&&(0,D.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-[11.5px]`,"data-tip":e.target,children:[`· `,e.target]})]}),e.html&&(0,D.jsx)(`code`,{className:`line-clamp-3 font-mono text-[12px] break-all text-ink-2`,children:F(e.html)})]},t)):(0,D.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`No elements were kept for this rule.`}),t.helpUrl&&w(t.helpUrl)===`web`&&(0,D.jsxs)(`a`,{href:t.helpUrl,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-1 self-start text-[12.5px]`,children:[`How to fix it `,(0,D.jsx)(f,{size:12,"aria-hidden":`true`})]})]})})]})]},t.rule)})}):(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-pass`,children:`No rule failed on the pages this run visited.`}),d.passed.length>0&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,D.jsxs)(`button`,{type:`button`,"aria-expanded":l,onClick:()=>u(!l),className:`flex cursor-pointer items-center gap-1 self-start border-0 bg-transparent p-0 text-[13px] font-medium text-ink`,children:[(0,D.jsx)(a,{size:13,"aria-hidden":`true`,className:p(`text-muted transition-transform`,!l&&`-rotate-90`)}),`Rules that passed `,(0,D.jsx)(`span`,{className:`font-normal text-muted tabular-nums`,children:d.passed.length})]}),l&&(0,D.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-1 p-0`,children:d.passed.map(e=>(0,D.jsx)(`li`,{className:`rounded-[6px] bg-pass-soft px-2 py-0.5 font-mono text-[11.5px] text-pass`,children:e},e))})]}),(0,D.jsx)(`p`,{className:`m-0 text-[12px] text-muted`,children:n})]})}function z({run:e}){let t=e.report;if(!t?.performance.pages.length)return(0,D.jsx)(`p`,{className:`m-0 text-[13px] 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`},i=t.breaches.filter(e=>e.kind===`performance`);return(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,D.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Core Web Vitals of each page, from one visit in the browser the agent drove, against Google's thresholds: `,(0,D.jsx)(`span`,{className:`text-pass`,children:`good`}),`, `,(0,D.jsx)(`span`,{className:`text-warn`,children:`needs improvement`}),`, `,(0,D.jsx)(`span`,{className:`text-fail`,children:`poor`}),`.`,` `,t.budgets.performance?`Pages over quality.budgets.performance are marked.`:`No performance budget set: nothing fails on timings.`]}),i.map((e,t)=>(0,D.jsxs)(`p`,{className:`m-0 rounded-[8px] bg-fail-soft px-3 py-1.5 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Over budget · `,I(e.page),`: `,e.text]},t)),(0,D.jsx)(S,{label:`Timings`,minWidth:720,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Page`}),A.map(e=>(0,D.jsx)(`th`,{className:`px-2 py-1.5 text-right font-medium`,"data-tip":e.label,children:e.label},e.key)),(0,D.jsx)(`th`,{className:`px-2 py-1.5 text-right font-medium`,children:`Requests`}),(0,D.jsx)(`th`,{className:`py-1.5 pr-3 pl-2 text-right font-medium`,children:`Size`})]}),children:t.performance.pages.map((e,t)=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,D.jsxs)(`td`,{className:`py-1.5 pr-3 pl-3`,children:[(0,D.jsx)(`span`,{className:`block max-w-[340px] truncate font-mono text-[12px]`,"data-tip":e.url,children:I(e.url)}),e.over.length>0&&(0,D.jsxs)(`span`,{className:`text-[11.5px] text-fail`,children:[`over: `,e.over.join(`, `)]})]}),A.map(t=>{let i=e[t.key];return(0,D.jsxs)(`td`,{className:p(`px-2 py-1.5 text-right whitespace-nowrap 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`?N(i,t.unit):`–`,typeof i==`number`&&t.good!==1/0&&(0,D.jsxs)(`span`,{className:`sr-only`,children:[` (`,n(i,t),`)`]})]},t.key)}),(0,D.jsx)(`td`,{className:`px-2 py-1.5 text-right whitespace-nowrap text-muted tabular-nums`,children:e.requests??`–`}),(0,D.jsx)(`td`,{className:`py-1.5 pr-3 pl-2 text-right whitespace-nowrap text-muted tabular-nums`,children:e.kb===void 0?`–`:`${e.kb} KB`})]},t))}),(0,D.jsxs)(`p`,{className:`m-0 text-[12px] text-muted`,children:[A.filter(e=>e.good!==1/0).map(e=>`${e.label}: good up to ${N(e.good,e.unit)}, poor over ${N(e.poor,e.unit)}`).join(` · `),`. Lab values from one visit, not data from real users.`]})]})}function B({run:e,index:n,which:r,label:i}){let[a,o]=(0,E.useState)(``),[s,c]=(0,E.useState)(!1);return(0,E.useEffect)(()=>{let t=!1;return o(``),c(!1),y.image(e,n,r).then(e=>!t&&o(e),()=>!t&&c(!0)),()=>{t=!0}},[e,n,r]),(0,D.jsxs)(`figure`,{className:`m-0 flex min-w-0 flex-col gap-1.5`,children:[(0,D.jsx)(`figcaption`,{className:`text-[12px] font-medium text-muted`,children:i}),a?(0,D.jsx)(`img`,{src:a,alt:`${i} of the page`,className:`block h-auto w-full rounded-[10px] border border-line-soft bg-surface-muted`}):(0,D.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:s?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(v,{icon:t,size:14}),` Not available`]}):`Loading…`})]})}function V({run:t,budget:n,onChange:r}){let[i,s]=(0,E.useState)(null),[c,u]=(0,E.useState)(``),[d,f]=(0,E.useState)(!1),[_,v]=(0,E.useState)(``),[b,x]=(0,E.useState)(new Set),[C,w]=(0,E.useState)(`all`),T=t.visual?.pages??[],O=T.find(e=>e.status===`changed`)?.index;(0,E.useEffect)(()=>x(O===void 0?new Set:new Set([O])),[t.id,O]);let k=async e=>{f(!0),v(``);try{r(await e()),s(null),u(``)}catch(e){v(e.message)}finally{f(!1)}};if(!t.visual)return t.captured?(0,D.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,D.jsxs)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:[`This run captured `,P(t.captured,`page`),` but they were not compared with the baselines yet.`]}),(0,D.jsxs)(m,{size:`sm`,variant:`primary`,disabled:d,"data-tip":`Compare with the baselines`,onClick:()=>k(()=>y.compare(t.id)),children:[(0,D.jsx)(o,{"aria-hidden":`true`}),`Compare`]}),_&&(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:_})]}):(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`This run has no visual captures: quality.visual.enabled was off, or the run visited no page.`});let A=T.filter(e=>e.status===`changed`),M=(C===`changed`?A:T).slice().sort((e,t)=>Number(t.status===`changed`)-Number(e.status===`changed`)||(t.diffPercent??0)-(e.diffPercent??0)),N=e=>{let t=new Set(b);t.has(e)?t.delete(e):t.add(e),x(t)};return(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Each page captured with animations frozen and masked regions hidden, against its approved baseline. `,n?`A page over quality.budgets.visual fails the run.`:`No visual budget set: a change does not fail the run.`]}),(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,D.jsx)(`div`,{role:`group`,"aria-label":`Show`,className:`flex gap-1`,children:[[`all`,`All pages`,T.length],[`changed`,`Changed`,A.length]].map(([e,t,n])=>(0,D.jsxs)(`button`,{type:`button`,"aria-pressed":C===e,onClick:()=>w(e),className:p(`inline-flex min-h-7 cursor-pointer items-center gap-1 rounded-[6px] border px-2 text-[12px]`,C===e?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:text-ink`),children:[t,` `,(0,D.jsx)(`span`,{className:`tabular-nums opacity-75`,children:n})]},e))}),(0,D.jsx)(`span`,{className:`flex-1`}),A.length>1&&(0,D.jsxs)(m,{size:`sm`,disabled:d,"data-tip":`Approve all ${A.length} changes`,onClick:()=>s(A.map(e=>e.url)),children:[(0,D.jsx)(l,{"aria-hidden":`true`}),`Approve (`,A.length,`)`]})]}),i&&(0,D.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Approve as baseline`,className:`flex flex-col gap-2 rounded-[10px] border border-accent-line bg-accent-soft p-3 text-[13px]`,children:[(0,D.jsxs)(`span`,{className:`font-medium`,children:[`Make this run's capture the baseline of `,i.length===1?I(i[0]):P(i.length,`page`),`?`]}),(0,D.jsx)(`span`,{className:`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,D.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[`Why it changed (kept with the baseline)`,(0,D.jsx)(h,{size:`sm`,value:c,maxLength:300,placeholder:`New checkout banner`,onChange:e=>u(e.target.value),className:`max-w-[480px] bg-bg`})]}),(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,D.jsxs)(m,{size:`sm`,variant:`primary`,disabled:d,onClick:()=>k(()=>y.approve(t.id,i,c.trim()||void 0)),children:[(0,D.jsx)(l,{"aria-hidden":`true`}),`Approve`]}),(0,D.jsxs)(m,{size:`sm`,onClick:()=>s(null),children:[(0,D.jsx)(e,{"aria-hidden":`true`}),`Cancel`]})]})]}),_&&(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:_}),(0,D.jsx)(S,{label:`Pages against their baselines`,fixed:!0,resetKey:C,empty:`No page changed.`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Page`}),(0,D.jsx)(`th`,{className:`hidden w-[110px] py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Size`}),(0,D.jsx)(`th`,{className:`w-[90px] py-1.5 pr-3 text-right font-medium`,children:`Changed`}),(0,D.jsx)(`th`,{className:`w-[120px] py-1.5 pr-3 font-medium`,children:`Result`}),(0,D.jsx)(`th`,{className:`w-[96px] py-1.5 pr-3`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Approve`})})]}),children:M.map(e=>{let n=b.has(e.index);return(0,D.jsxs)(E.Fragment,{children:[(0,D.jsxs)(`tr`,{onClick:()=>N(e.index),"aria-expanded":n,className:p(`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,n&&`bg-surface-muted`),children:[(0,D.jsx)(`td`,{className:`py-1.5 pr-3 pl-3`,children:(0,D.jsxs)(`span`,{className:`flex items-start gap-1`,children:[(0,D.jsx)(a,{size:13,"aria-hidden":`true`,className:p(`mt-0.5 flex-none text-muted transition-transform`,!n&&`-rotate-90`)}),(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,D.jsx)(`span`,{className:`truncate`,"data-tip":e.title||e.url,children:e.title||I(e.url)}),(0,D.jsx)(`span`,{className:`truncate font-mono text-[11.5px] text-muted`,"data-tip":e.url,children:I(e.url)})]})]})}),(0,D.jsxs)(`td`,{className:`hidden py-1.5 pr-3 whitespace-nowrap text-muted @2xl:table-cell`,children:[e.size||`–`,e.resized?` · resized ${e.resized}`:``]}),(0,D.jsx)(`td`,{className:p(`py-1.5 pr-3 text-right whitespace-nowrap tabular-nums`,e.over?`text-fail`:e.status===`changed`?`text-warn`:`text-muted`),children:e.status===`changed`?`${e.diffPercent}%${e.limit===void 0?``:` / ${e.limit}%`}`:`–`}),(0,D.jsx)(`td`,{className:`py-1.5 pr-3`,children:(0,D.jsx)(g,{tone:e.over?`fail`:j[e.status].tone,className:`min-h-5 px-2 text-[11px]`,children:e.over?`Over budget`:j[e.status].label})}),(0,D.jsx)(`td`,{className:`py-1 pr-3 text-right`,onClick:e=>e.stopPropagation(),children:e.status===`changed`&&(0,D.jsx)(m,{variant:`icon`,size:`icon-sm`,disabled:d,"aria-label":`Approve ${I(e.url)}`,"data-tip":`Approve ${I(e.url)}`,onClick:()=>s([e.url]),children:(0,D.jsx)(l,{"aria-hidden":`true`})})})]}),n&&(0,D.jsx)(`tr`,{className:`bg-surface-muted`,children:(0,D.jsx)(`td`,{colSpan:5,className:`px-3 pb-3`,children:(0,D.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-3`,children:[e.images.baseline&&(0,D.jsx)(B,{run:t.id,index:e.index,which:`baseline`,label:`Baseline`}),e.images.current&&(0,D.jsx)(B,{run:t.id,index:e.index,which:`current`,label:`This run`}),e.images.diff&&(0,D.jsx)(B,{run:t.id,index:e.index,which:`diff`,label:`Difference (in red)`})]})})})]},e.index)})})]})}function H({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,D.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,D.jsx)(`polyline`,{points:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinejoin:`round`})})}function U({icon:e,className:t,lines:n}){return n.length?(0,D.jsxs)(`span`,{className:p(`flex items-start gap-1.5 text-[13px]`,t),children:[(0,D.jsx)(v,{icon:e,size:14,className:`mt-0.5 flex-none`}),(0,D.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:n.join(` · `)})]}):null}function W({trends:e}){return e.length?(0,D.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.map(e=>{let t=e.a11y.latest?O.reduce((t,n)=>t+(e.a11y.latest[n]||0),0):void 0;return(0,D.jsxs)(`li`,{className:`flex flex-col gap-1.5 border-t border-line-soft py-3 first:border-t-0`,children:[(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-3`,children:[(0,D.jsx)(`span`,{className:`min-w-0 flex-[1_1_240px] truncate font-mono text-[13px]`,"data-tip":e.page,children:/^https?:/.test(e.page)?I(e.page):e.page}),(0,D.jsx)(H,{values:e.a11y.trail}),(0,D.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[P(e.runs,`run`),t===void 0?``:` · ${P(t,`violation`)} now`]})]}),(0,D.jsx)(U,{icon:c,className:`text-fail`,lines:[...e.perf.worse.map(e=>`slower: ${e}`),...e.a11y.newRules.map(e=>`newly failing: ${e}`)]}),(0,D.jsx)(U,{icon:u,className:`text-pass`,lines:[...e.perf.better.map(e=>`faster: ${e}`),...e.a11y.fixedRules.map(e=>`fixed: ${e}`)]})]},e.page)})}):(0,D.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.`})}var G={accessibility:e=>!!e.a11y?.pages,performance:e=>e.perf.pages>0,visual:e=>!!e.visual||e.captured>0},K={accessibility:e=>!!e.a11y?.failed,performance:e=>e.perf.over>0,visual:e=>!!(e.visual?.changed||e.visual?.over)},q=(e,t)=>t.filter(G[e]);function J({kind:e,runs:t}){let[n,i]=(0,E.useState)(`all`),a=q(e,t),o=n===`attention`?a.filter(K[e]):a,c=t=>location.hash=_(e,encodeURIComponent(t)),u=`py-2 pr-3 text-right tabular-nums`;return(0,D.jsx)(S,{label:`Runs`,placeholder:`Find a run by what it did`,resetKey:n,empty:`Nothing matches.`,tools:(0,D.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,D.jsx)(x,{items:[{id:`all`,label:`All`,n:a.length},{id:`attention`,label:`Needs a look`,n:a.filter(K[e]).length,alert:!0}],value:n,onChange:i})}),head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`w-[46%] py-1.5 pr-3 pl-3 font-medium`,children:`Run`}),e===`accessibility`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Rules failed`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @2xl:table-cell`,children:`Critical · serious`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @3xl:table-cell`,children:`Moderate · minor`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @xl:table-cell`,children:`Pages`})]}),e===`performance`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Over budget`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @xl:table-cell`,children:`Pages timed`})]}),e===`visual`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Changed`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @2xl:table-cell`,children:`New`}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @xl:table-cell`,children:`Same`})]}),(0,D.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`When`})]}),children:o.map(t=>{let n=K[e](t),i=(t.over?.[e]??0)>0;return(0,D.jsxs)(`tr`,{onClick:()=>c(t.id),className:`cursor-pointer border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(i?r:n?s:l,{size:15,"aria-label":i?`Over a budget`:n?`Needs a look`:`Within budgets`,className:p(`flex-none`,i?`text-fail`:n?`text-warn`:`text-pass`)}),(0,D.jsx)(`a`,{href:_(e,encodeURIComponent(t.id)),onClick:e=>e.stopPropagation(),"data-tip":t.goal,className:`truncate text-ink no-underline hover:underline`,children:t.goal})]})}),e===`accessibility`&&t.a11y&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`td`,{className:p(u,t.a11y.failed?`text-fail`:`text-muted`),children:t.a11y.failed}),(0,D.jsx)(`td`,{className:p(u,`hidden @2xl:table-cell`,t.a11y.critical+t.a11y.serious?`text-fail`:`text-muted`),children:`${t.a11y.critical} · ${t.a11y.serious}`}),(0,D.jsx)(`td`,{className:p(u,`hidden text-muted @3xl:table-cell`),children:`${t.a11y.moderate} · ${t.a11y.minor}`}),(0,D.jsx)(`td`,{className:p(u,`hidden text-muted @xl:table-cell`),children:t.a11y.pages})]}),e===`performance`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`td`,{className:p(u,t.perf.over?`text-fail`:`text-muted`),children:t.perf.over}),(0,D.jsx)(`td`,{className:p(u,`hidden text-muted @xl:table-cell`),children:t.perf.pages})]}),e===`visual`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`td`,{className:p(u,t.visual?.changed?`text-warn`:`text-muted`),children:t.visual?t.visual.changed:`not compared`}),(0,D.jsx)(`td`,{className:p(u,`hidden text-muted @2xl:table-cell`),children:t.visual?t.visual.new+t.visual.no_baseline:`–`}),(0,D.jsx)(`td`,{className:p(u,`hidden text-muted @xl:table-cell`),children:t.visual?t.visual.same:`–`})]}),(0,D.jsx)(`td`,{className:`hidden py-2 pr-3 whitespace-nowrap text-[12.5px] text-muted @xl:table-cell`,"data-tip":M(t.at),children:T(t.at)})]},t.id)})})}function Y({kind:e,id:t,view:n,onChanged:r}){let[i,o]=(0,E.useState)(null),[s,c]=(0,E.useState)(``);(0,E.useEffect)(()=>{let e=!1;return o(null),y.run(t).then(t=>{e||(o(t),c(``))},t=>!e&&c(t.message)),()=>{e=!0}},[t]);let l=(0,D.jsxs)(`a`,{href:_(e),className:`inline-flex items-center gap-1 self-start text-[13px] no-underline`,children:[(0,D.jsx)(a,{size:14,"aria-hidden":`true`,className:`rotate-90`}),`All runs`]});return s||!i?(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[l,s?(0,D.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail`,children:s}):(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Loading…`})]}):(0,D.jsxs)(`section`,{"aria-labelledby":`run-h`,className:`flex min-w-0 flex-col gap-3`,children:[l,(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,D.jsx)(`h2`,{id:`run-h`,"data-tip":i.goal,className:`m-0 truncate text-[16px] leading-snug font-semibold`,children:i.goal}),(0,D.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-[12.5px] text-muted`,children:[M(i.at),` · `,(0,D.jsx)(C,{path:i.dir}),` · `,(0,D.jsx)(`a`,{href:_(`quality`,encodeURIComponent(i.id)),children:`Everything it measured`})]})]}),e===`accessibility`&&(0,D.jsx)(R,{run:i,standard:n.standard,disclaimer:n.disclaimer}),e===`performance`&&(0,D.jsx)(z,{run:i}),e===`visual`&&(0,D.jsx)(V,{run:i,budget:n.budgets.visual,onChange:e=>{o(e),r()}})]})}function X({r:e,to:t,line:n}){return(0,D.jsxs)(`div`,{className:`ml-12 flex flex-wrap items-center gap-x-4 gap-y-2 rounded-[14px] card border px-4 py-3`,children:[(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col`,children:[(0,D.jsx)(`span`,{className:`text-[14.5px] font-medium [overflow-wrap:anywhere]`,children:e.goal}),(0,D.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:n})]}),(0,D.jsxs)(m,{size:`sm`,variant:`primary`,"data-tip":`Open the run`,onClick:()=>location.hash=t,children:[(0,D.jsx)(d,{"aria-hidden":`true`}),`Open`]})]})}function Z({label:e,value:t,sub:n,tone:r}){return(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5 px-3 py-2`,children:[(0,D.jsx)(`span`,{className:`text-[11.5px] text-muted`,children:e}),(0,D.jsx)(`span`,{className:p(`text-[16px] leading-tight font-semibold tabular-nums`,r),children:t}),n&&(0,D.jsx)(`span`,{className:`truncate text-[11.5px] text-muted`,children:n})]})}export{M as _,J as a,X as c,V as d,N as f,I as g,q as h,Y as i,W as l,P as m,O as n,Z as o,L as p,k as r,z as s,R as t,A as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,rt as t,u as n}from"./filters-
|
|
1
|
+
import{f as e,rt as t,u as n}from"./filters-mFECJpMB.js";var r=t=>e(`record`,`recording`,encodeURIComponent(t)),i=e=>e.split(`/`).pop()||e;function a(e){let t=!!e?.testFile&&e.exists!==!1,n=e?.testFile?i(e.testFile):``,r=e=>e;if(!e)return{tone:`neutral`,label:`No test yet`,detail:`No test has been written from this recording. Write turns it into a test in your repository.`,hasTest:!1,writing:!1};if(e.state===`checking`)return{tone:`running`,label:`Checking the steps…`,detail:`The steps are played in a new browser first; when they work, the Coding agent ${t?`updates ${n}`:`writes the test`}. You can leave this page.`,hasTest:t,writing:!0};if(e.state===`check_failed`)return{tone:`fail`,label:t?`Steps failed, test not updated`:`Steps failed, no test written`,detail:`${e.error||`The steps did not work when played.`} Fix the step (Show, Record or Remove), or write the test anyway.`,hasTest:t,writing:!1};if(e.state===`writing`&&e.waiting&&e.resumeUntil){let n=new Date(e.resumeUntil).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});return{tone:`warn`,label:`Waiting for the model…`,detail:`${e.waiting} ForgeQE checks every 30 seconds and carries on from where it stopped as soon as the model answers, until ${n}. Stop writing to give up now.`,hasTest:t,writing:!0}}if(e.state===`writing`&&e.waiting)return{tone:`warn`,label:`Waiting for the model…`,detail:`${e.waiting} The agent keeps retrying; if the model stays away ForgeQE stops it after 10 minutes and carries on by itself once the model answers. Stop writing to give up now.`,hasTest:t,writing:!0};if(e.state===`writing`)return r({tone:`running`,label:e.resumes?`Carrying on…`:t?`Updating the test…`:`Writing the test…`,detail:`${e.resumes?`The model answered again: the Coding agent carries on from where it stopped. `:``}The Coding agent is ${t?`updating ${n}`:`writing the test`} from this recording. It goes on if you leave or refresh this page; it shows here when it is done.`,hasTest:t,writing:!0});if(e.testFile&&e.exists===!1)return{tone:`warn`,label:`Test file not found`,detail:`${e.testFile} was written from this recording but is no longer in the repository. Write makes a new one.`,hasTest:!1,writing:!1};if(t){if(e.state===`passed`||e.state===`stopped`||e.state===`interrupted`){let r=e.error?` (${e.error})`:``,i=e.state===`stopped`?` The last update was stopped; what it changed so far is kept, and Update carries on from there.${r}`:e.state===`interrupted`?` The last update did not finish; what it changed so far is kept, and Update carries on from there.${r}`:``;return e.changedSince?{tone:`warn`,label:`Test out of date`,detail:`${n} was written before you changed the recording. Update the test to bring it in line.${i}`,hasTest:t,writing:!1}:{tone:`pass`,label:`Test written`,detail:`${n} was written from this recording and passed.${i} Update the test only if the recording changes.`,hasTest:t,writing:!1}}return{tone:`warn`,label:`Test not passing`,detail:`${n} was written, but it did not pass ForgeQE's run${e.state===`blocked`?` (something blocked it)`:``}.${e.error?` ${e.error}`:``} Update the test to try again.`,hasTest:t,writing:!1}}if(e.state===`stopped`)return{tone:`neutral`,label:`Writing stopped`,detail:`${e.error||`Writing the test was stopped before a test was written.`} Write starts again.`,hasTest:!1,writing:!1};if(e.state===`interrupted`)return{tone:`warn`,label:`Writing did not finish`,detail:`${e.error||`The writing ended before a test was written.`} Write starts again.`,hasTest:!1,writing:!1};let a=!!e.error&&/^(Couldn't reach the model|The model refused|The model is busy|Stopped after)/.test(e.error);return{tone:`fail`,label:a?`Model not reachable`:`Writing failed`,detail:`${e.error||`The Coding agent could not write a passing test from this recording.`} ${a?`Write tries again once it is fixed.`:`Open the chat to see more, or Write to try again.`}`,hasTest:!1,writing:!1}}function o(e){return n(e,e=>t.openFile(e,{}))}export{r as n,a as r,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Xn as e}from"./line-icons-CQ-3V8ax.js";import{B as t,V as n,c as r,f as i,h as a,qt as o}from"./filters-
|
|
1
|
+
import{Xn as e}from"./line-icons-CQ-3V8ax.js";import{B as t,V as n,c as r,f as i,h as a,qt as o}from"./filters-mFECJpMB.js";import{r as s}from"./index-CotEpFLY.js";var c=o();function l(e){return e.waiting||e.state===`ready`&&e.outcome===`needs_input`?`waiting`:e.state===`busy`||e.state===`starting`?`working`:e.state===`closed`||e.state===`failed`?`ended`:`done`}var u={working:{label:`Working`,tone:`running`},waiting:{label:`Needs you`,tone:`warn`},done:{label:`Your turn`,tone:`pass`},ended:{label:`Ended`,tone:`neutral`}};function d(e){let t=e=>Date.parse(e.lastAt||e.started)||0;return[...e].sort((e,n)=>t(n)-t(e))}function f(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean),r=`${e.title} ${e.lastReply||``} ${e.profile||``}`.toLowerCase();return n.every(e=>r.includes(e))}function p(e,t,n=3,r=50){return!Number.isFinite(e)||!Number.isFinite(t)||t<=0?n:Math.min(r,Math.max(n,Math.floor(e/t)))}function m({c:o}){let d=l(o),f=u[d];return(0,c.jsxs)(`a`,{href:i(`chats`,o.id),className:`group grid min-h-14 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 rounded-[10px] px-3 py-2 text-ink no-underline hover:bg-surface-muted hover:text-ink @3xl:grid-cols-[minmax(0,1fr)_120px_90px_150px_96px]`,children:[(0,c.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,c.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[d===`waiting`&&(0,c.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none rounded-full bg-warn`}),(0,c.jsx)(`span`,{className:`truncate text-[14px] font-medium`,children:o.title})]}),(0,c.jsx)(`span`,{className:t(`truncate text-[12.5px]`,o.lastReply?`text-muted`:`text-muted italic`),children:o.lastReply||(d===`working`?`Working on the first answer…`:`No answer yet`)})]}),(0,c.jsx)(`span`,{className:`justify-self-end @3xl:justify-self-start`,children:(0,c.jsx)(r,{tone:f.tone,orb:o.state===`starting`?`waiting`:`working`,children:f.label})}),(0,c.jsx)(`span`,{className:`hidden text-[13px] text-muted tabular-nums @3xl:block`,children:o.turns?n(o.turns,`message`):`—`}),(0,c.jsx)(`span`,{className:`hidden min-w-0 items-center gap-1 truncate text-[13px] text-muted @3xl:flex`,children:o.profile?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a,{icon:e,size:11,className:`flex-none text-accent-fg`}),(0,c.jsx)(`span`,{className:`truncate`,children:o.profile})]}):`Default model`}),(0,c.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:s(o.lastAt||o.started)})]})}export{p as a,d as i,f as n,l as r,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,qt as t}from"./filters-
|
|
1
|
+
import{B as e,qt as t}from"./filters-mFECJpMB.js";var n=t(),r=`flex w-fit max-w-full flex-wrap gap-1 rounded-[10px] bg-surface-strong p-1`,i=t=>e(`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-[7px] border-0 px-3 text-sm font-medium whitespace-nowrap`,t?`bg-bg text-ink shadow-sm`:`bg-transparent text-muted hover:text-ink`);function a({tabs:t,current:a,onPick:o,label:s,className:c}){return(0,n.jsx)(`div`,{role:`tablist`,"aria-label":s,className:e(`mb-5`,r,c),children:t.map((e,r)=>(0,n.jsxs)(`button`,{id:`tab-${e.id}`,type:`button`,role:`tab`,"aria-selected":a===e.id,"aria-controls":`panel-${e.id}`,tabIndex:a===e.id?0:-1,onClick:()=>o(e.id),onKeyDown:e=>{let n=e.key===`ArrowRight`?t[(r+1)%t.length]:e.key===`ArrowLeft`?t[(r-1+t.length)%t.length]:void 0;n&&(o(n.id),document.getElementById(`tab-${n.id}`)?.focus())},className:i(a===e.id),children:[e.label,e.n!==void 0&&(0,n.jsx)(`span`,{className:`text-[12px] text-muted tabular-nums`,children:e.n})]},e.id))})}function o({links:t,current:a,label:o,className:s}){return(0,n.jsx)(`nav`,{"aria-label":o,className:e(r,s),children:t.map(t=>(0,n.jsx)(`a`,{href:t.href,"aria-current":a===t.id?`page`:void 0,className:e(i(a===t.id),`no-underline hover:no-underline`,a===t.id&&`hover:text-ink`),children:t.label},t.id))})}export{i,a as n,r,o as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{Ut as e,Yt as t}from"./frame-BcGZt823.js";var n=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},r=e=>typeof e==`string`?e:e==null?``:String(e),i=(e,t=400)=>e.length>t?`${e.slice(0,t-1)}…`:e,a=e=>typeof e==`number`?` in ${Math.round(e/1e3)}s`:``;function o(e,t=400){return i(e.replace(/\s+/g,` `).trim(),t).replace(/([\\`*_[\]<>#|~!])/g,`\\$1`)}function s(e){let t=e.replace(/\s+/g,` `).trim();if(!t)return``;let n=t.includes("`")?"``":"`";return`${n}${n==="``"?` `:``}${t}${n==="``"?` `:``}${n}`}function c(e,t){return/^https?:\/\/[^\s)]+$/i.test(t)?`[${o(e||t,120)}](${t})`:o(e)}var l=e=>[s(r(n(e).id)),o(r(n(e).title),200)].filter(Boolean).join(` `);function u(e){return e.replace(/<!--[\s\S]*?(?:-->|$)/g,``).trim()}function d(e){return e.replace(/\[((?:\\.|[^\]\\])*)\]\(https?:\/\/[^\s)]+\)/g,`$1`).replace(/\\(.)/g,`$1`).replace(/[*`]/g,``)}var f=(e,t)=>({tone:e,kind:`item`,md:t}),p=(e,t)=>({tone:e,kind:`sub`,md:t});function m(e,t=``){let i=t||(e.agent&&e.agent!==`forgeqe`?`**${o(r(e.agent))}:** `:``);switch(e.kind){case`info`:return f(`info`,`${i}${o(r(e.text))}`);case`start`:return f(`dim`,`${i}→ ${s(r(e.tool))}${e.text&&e.text!==e.tool?` ${o(r(e.text),200)}`:``}`);case`tool`:{let t=n(e.file);return f(e.ok===!1?`warn`:`dim`,`${i}${e.ok===!1?`⚠`:`✓`} ${o(r(e.text)||r(e.tool),240)}${t.path?` (${o(r(t.action))} ${s(r(t.path))})`:``}`)}case`say`:{let t=u(r(e.text));return t?f(`say`,`${i}*${o(t)}*`):null}case`test`:return Number(e.attempt)>0?f(e.ok?`ok`:`fail`,`${i}${e.ok?`✓`:`✗`} **Test, attempt ${o(r(e.attempt))}:** ${o(r(e.text),240)}`):f(e.ok?`ok`:`fail`,`${i}${e.ok?`✓`:`✗`} ${o(r(e.text),240)}`);case`plan`:{let t=Array.isArray(e.items)?e.items.map(n):[],a=t.find(e=>e.status===`in_progress`);return f(`info`,`${i}**Plan:** ${t.filter(e=>e.status===`completed`).length} of ${t.length} done${a?`; now: ${o(r(a.text))}`:``}`)}case`review`:return f(e.approved?`ok`:`warn`,`${i}**Review, attempt ${o(r(e.attempt))}:** ${e.approved?`approved`:`changes asked`}. ${o(r(e.summary),240)}`);case`attempt`:return f(`warn`,`${i}**Attempt ${o(r(e.attempt))} of ${o(r(e.max))}:** ${o(r(e.why),240)}`);case`answer`:return f(`dim`,`${i}Attempt ${o(r(e.attempt))}: ${o(r(e.notes)||`changed ${(Array.isArray(e.changed)?e.changed:[]).map(r).join(`, `)}`,240)}`);case`context`:return e.compacted?f(`info`,`${i}Context compacted: the conversation was summarised to make room.`):null;default:return null}}function h(e,t=``){switch(e.type){case`log`:return f(e.level===`error`?`fail`:e.level===`warn`?`warn`:`dim`,`${t}${e.level===`warn`||e.level===`error`?`⚠ `:``}${o(r(e.text))}`);case`step`:return f(`dim`,`${t}**Step ${o(r(e.step))}** · ${e.source===`memory`?`from memory`:o(r(e.category))} · ${c(r(e.title)||`untitled`,r(e.url))}`);case`memory`:return f(`info`,`${t}↻ ${o(r(e.text))}`);case`thought`:return p(`think`,`*${o(r(e.text))}*`);case`outcome`:return p(e.ok?`ok`:`fail`,`${e.ok?`✓`:`✗`} ${o(r(e.text),300)}`);case`done`:{let i=n(e.result);return f(i.status===`complete`?`ok`:`fail`,`${t}**${o(r(i.status))}:** ${o(r(i.summary))}`)}case`code`:return m(e,t);default:return null}}function g(e){switch(e.type){case`run-start`:return{tone:`info`,kind:`head`,md:`Browser run: ${o(r(e.goal),200)}${e.url?` · ${c(r(e.url).replace(/^https?:\/\//,``),r(e.url))}`:``}`};case`run-event`:return h(n(e.event));case`run-done`:{let t=n(e.result),i=!e.error&&(t.outcome===`passed`||!t.outcome&&t.status===`complete`);return f(i?`ok`:`fail`,`${i?`✓`:`✗`} **Run ${i?`passed`:`failed`}**${a(e.ms)}: ${o(r(e.error)||r(t.summary))}${e.runDir?` · ${s(r(e.runDir))}`:``}`)}case`suite-start`:return{tone:`info`,kind:`head`,md:`Suite: ${(Array.isArray(e.cases)?e.cases:[]).length} cases, ${o(r(e.parallel))} at once`};case`suite-event`:{let t=n(e.event);if(t.type===`case-start`)return f(`info`,`**Case ${Number(t.index)+1} of ${o(r(t.total))}:** ${l(t.case)}`);if(t.type===`case-event`)return h(n(t.event),`${s(r(n(t.case).id))} `);if(t.type===`case-done`){let e=n(t.result);return f(e.status===`passed`?`ok`:`fail`,`${e.status===`passed`?`✓`:`✗`} ${l(e.case)}: **${o(r(e.status))}**${a(e.ms)}${e.summary?`. ${o(r(e.summary),240)}`:``}`)}return t.type===`code-start`?f(`info`,`${s(r(n(t.case).id))} writing its test`):t.type===`writeback`?f(`dim`,`Posted the result back: ${o(JSON.stringify(t.item),240)}`):null}case`suite-done`:{let t=(Array.isArray(n(e.suite).results)?n(e.suite).results:[]).map(n),r=t.filter(e=>e.status===`passed`).length;return f(r===t.length?`ok`:`fail`,`**Suite: ${r} of ${t.length} passed**${a(n(e.suite).ms)}`)}case`info`:return f(e.ok===!1?`fail`:e.ok===!0?`ok`:`info`,o(r(e.text)));case`agent`:return m(n(n(e.event)),`**Coding agent:** `);case`code-start`:return{tone:`info`,kind:`head`,md:`Writing a test: ${o(r(e.goal),200)}`};case`code-done`:{let t=r(n(e.result).status);return e.error?f(`fail`,`✗ **Test not written**${a(e.ms)}: ${o(r(e.error),240)}`):!t||t===`passed`?f(`ok`,`✓ **Test written**${a(e.ms)}`):t===`stopped`?f(`warn`,`**Test writing stopped**${a(e.ms)}`):f(`fail`,`✗ **Test not finished**${a(e.ms)} (${o(t,40)})`)}case`card`:{let t=n(e.card),i=(Array.isArray(t.body)?t.body:[]).map(r).filter(Boolean);return f(t.status===`ok`?`ok`:t.status===`fail`?`fail`:`info`,`**${o(r(t.title))}**${t.stats?` · ${o(r(t.stats))}`:``}${i.length?`: ${o(i.join(`; `),300)}`:``}`)}case`report`:return f(`ok`,`✓ Report saved: ${o(r(e.title))}`);case`call-start`:return f(`dim`,`→ ${o(r(e.text),240)}`);case`call`:return f(e.ok===!1?`warn`:`dim`,`${e.ok===!1?`⚠`:`✓`} ${o(r(e.text),240)}`);default:return null}}function _(e){let t=r(e.at)||r(e.t),i=null;switch(e.type){case`user`:i=f(`you`,`**You:** ${o(r(e.text),240)}`);break;case`agent`:i=m(n(e.event));break;case`tool`:i=g(n(e.event));break;case`ask`:i=f(`you`,`**Asked:** ${o(r(n(e.question).title))}`);break;case`wait`:i=f(`you`,`**Waiting for you:** ${o(r(e.prompt))}`);break;case`answered`:i=f(`you`,`**You:** ${e.label===void 0?e.ok?`done, continue`:`cancel`:o(r(e.label))}`);break;case`turn_done`:i=f(e.outcome===`done`?`ok`:e.outcome===`stopped`?`warn`:`fail`,`**${e.outcome===`done`?`Done`:e.outcome===`stopped`?`Stopped`:e.outcome===`needs_input`?`Needs your input`:`Failed`}**${e.error?`: ${o(r(e.error),300)}`:``}`);break;case`settings`:i=f(`you`,`**Settings:** browser ${e.headed?`shown`:`headless`}, ${e.writeTests?`passed runs become tests`:`no tests written`}`);break;case`model`:i=f(`you`,`**Model:** ${o(r(n(e.profile).name),80)}`);break;case`settings_applied`:i=f(`you`,`**Settings:** carried on with the settings as they are on disk now`);break;case`stderr`:i={tone:`dim`,kind:`out`,md:r(e.text)};break;case`error`:i=f(`warn`,`⚠ ${o(r(e.message))}`);break;case`fatal`:i=f(`fail`,`✗ **ForgeQE cannot go on:** ${o(r(e.message))}`);break;case`exit`:i=f(e.code===0?`dim`:`fail`,`ForgeQE stopped${e.code!==null&&e.code!==void 0?` (exit ${o(r(e.code))})`:``}${e.message?`: ${o(r(e.message))}`:``}`)}return i?{at:t,...i,plain:i.kind===`out`?i.md:d(i.md)}:null}function v(e,t){if(!e||!t)return``;let n=Math.max(0,Math.round((Date.parse(t)-Date.parse(e))/1e3));return Number.isFinite(n)?`+${Math.floor(n/60)}:${String(n%60).padStart(2,`0`)}`:``}function y(e,t,n){let r=n?[`## ${o(n,200)}`,``]:[],i=[],a=()=>{if(!i.length)return;let e=Math.max(2,...i.map(e=>Math.max(0,...(e.match(/`+/g)||[]).map(e=>e.length)))),t="`".repeat(e+1);r.push(``,`${t}text`,...i,t,``),i=[]};for(let n of e){let e=v(t,n.at),o=e?`\`${e}\``:``;n.kind===`out`?i.push(e?`${e} ${n.md}`:n.md):(a(),n.kind===`head`?r.push(``,`#### ${n.md}${o?` ${o}`:``}`,``):n.kind===`sub`?r.push(` - ${n.md}`):r.push(`- ${o?`${o} `:``}${n.md}`))}return a(),r.join(`
|
|
2
|
+
`).replace(/\n{3,}/g,`
|
|
3
|
+
|
|
4
|
+
`).trim()+`
|
|
5
|
+
`}var b=e=>{let t=S(e);return typeof t.input==`number`&&typeof t.output==`number`?{input:t.input,output:t.output,cached:typeof t.cached==`number`?t.cached:void 0}:void 0};function x(e,t){let n=(e?.cached||0)+(t?.cached||0);return{input:(e?.input||0)+(t?.input||0),output:(e?.output||0)+(t?.output||0),...n?{cached:n}:{}}}var S=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},C=e=>typeof e==`string`?e:e==null?``:String(e),w=[[/^(product_(knowledge|docs|code|runs?)|services|database_schema)$/,`Product knowledge`],[/^page_memory$/,`Memory`],[/^playbook$/,`Playbook`],[/^(requirements_file|trace_criteria)$/,`Requirements`],[/^read_confluence$/,`Confluence pages`],[/^read_mapping_file$/,`Mapping file`]],T={github:`GitHub`,gitlab:`GitLab`,azure_devops:`Azure DevOps`,atlassian:`Jira`,confluence:`Confluence`,notify:`Notifications`,sentry:`Sentry`,browserstack:`BrowserStack`,testmu:`TestMu`,dataverse:`Dataverse`,aws:`AWS`,azure:`Azure`,gcp:`Google Cloud`,postman:`Postman`},E=20;function D(e,t,n){let r=(e,t)=>{t&&e.length<E&&!e.includes(t)&&e.push(t)},i=t.toLowerCase();if(i===`skill`){let t=(n||``).trim();/^[\w.:-]{1,64}$/.test(t)&&r(e.skills,t);return}let a=i.replace(/^forgeqe_/,``),o=w.find(([e])=>e.test(a));if(o)return r(e.knowledge,o[1]);if(Object.hasOwn(T,a))return r(e.systems,T[a]);let s=L.find(([e])=>e.test(a))?.[1];s&&r(e.systems,s)}function O(e,t){let n=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:0,r=e.sections??=[];for(let e of Array.isArray(t.sections)?t.sections:[]){let t=C(e).replace(/\s+/g,` `).trim().slice(0,160);t&&r.length<E&&!r.includes(t)&&r.push(t)}let i=e.text??={sent:0,whole:0};i.sent+=n(t.sent),i.whole+=n(t.whole)}var k=[[/find_test_cases|story_test_cases|check_test_cases|list_sprints/,`Finding test cases`,`searching`],[/environment|logins/,`Preparing the environment`,`handing`],[/run_test_cases|browser_run|suite|run_goal|run_direct/,`Running in the browser`,`browsing`],[/comment_on_pr/,`Commenting on the pull request`,`working`],[/write_back|post_result|post_results|file_bugs|create_bugs/,`Posting the result`,`working`],[/write_test|heal/,`Writing the test`,`writing`],[/run_tests|bash|shell/,`Running the tests`,`working`],[/read_confluence|read|grep|glob|list|webfetch/,`Reading`,`reading`],[/edit|write|patch/,`Changing the code`,`writing`],[/task/,`Handing work to another agent`,`handing`]],A=/^(test|attempt|info|review)$/,j=/run_test_cases|browser_run|run_suite|write_test/,M=[[/(^|_)skill/,`skill`],[/code_element/,`element`],[/code_outline/,`outline`],[/code_references/,`references`],[/code_impact|(^|_)impact/,`impact`],[/code_find|find_tests/,`find`],[/code_test_file/,`testfile`],[/code_command|code_status|run_tests|bash|shell/,`run`],[/find_test_cases|story_test_cases|check_test_cases|list_sprints/,`cases`],[/environment|logins/,`environment`],[/run_test_cases|browser_run|suite|run_goal|run_direct/,`browser`],[/comment_on_pr|write_back|post_result|post_results|file_bugs|create_bugs/,`post`],[/grep|glob|search/,`search`],[/webfetch|websearch|fetch/,`web`],[/(^|_)list/,`list`],[/read/,`read`],[/edit|write|patch/,`edit`],[/task/,`task`]];function N(e){let t=e.toLowerCase();return M.find(([e])=>e.test(t))?.[1]??`work`}function P(e){let t=/^(.*?\(attempt \d+\/\d+\))\s*:\s*([\s\S]+)$/.exec(e)??/^([^:\n]{1,160}?):\s+([\s\S]{40,})$/.exec(e),n=(t?t[1]:e).replace(/\s*\(attempt \d+\/\d+\)$/,``).replace(/(^|\s)(?:[\w.-]+[\\/])+([\w.-]+)/g,`$1$2`);return{summary:n.length>140?`${n.slice(0,139)}…`:n,detail:t?t[2].trim():``}}var F=[[/find_test_cases|story_test_cases|check_test_cases/,`forgeqe-find`],[/run_test_cases|browser_run|run_goal|run_direct|suite|explore_run/,`engine`],[/write_test/,`forgeqe-test`],[/heal/,`forgeqe-heal`],[/review_pr|pr_review/,`forgeqe-pr-review`],[/api_plan/,`forgeqe-api-plan`],[/write_api|api_test/,`forgeqe-api`],[/explore_plan|plan_charters/,`forgeqe-explore-plan`],[/defect_rca|root_cause/,`forgeqe-defect-rca`],[/insights|forgeqe_bi|defect_intelligence/,`forgeqe-bi`],[/refine/,`forgeqe-refine`]];function I(e){let t=e.toLowerCase();if(!z(t))return F.find(([e])=>e.test(t))?.[1]}var L=[[/^(azure_devops|ado|azuredevops)_/,`Azure DevOps`],[/^(jira|atlassian)_/,`Jira`],[/^confluence_/,`Confluence`],[/^github_/,`GitHub`],[/^xray_/,`Xray`],[/^testrail_/,`TestRail`],[/^zephyr_/,`Zephyr Scale`],[/^qtest_/,`qTest`]],R=/(^|_)(create|update|add|delete|remove|post|comment|link|unlink|upload|set|assign|transition|edit|merge|close|reopen|queue|trigger|run|push|move|copy|import|write|publish|approve|vote|lock|unlock)(_|$)/;function z(e){let t=e.toLowerCase();if(!t.startsWith(`forgeqe_`))return L.find(([e])=>e.test(t))?.[1]}var B=e=>{let t=S(e);return typeof t.diff==`string`&&t.diff?{diff:t.diff,added:Number(t.added)||0,removed:Number(t.removed)||0}:void 0},V=e=>Array.isArray(e)?e.map(C).filter(Boolean):[];function H(e,t,n){let r=C(e.status)||(t?`failed`:``);return{status:r,ok:!t&&/^(passed|pass|written|ok|known_defect)$/i.test(r),...C(e.testFile)?{testFile:C(e.testFile)}:{},...C(e.testName)?{testName:C(e.testName)}:{},...C(e.command)?{command:C(e.command)}:{},...typeof e.attempts==`number`?{attempts:e.attempts}:{},...typeof e.maxAttempts==`number`?{maxAttempts:e.maxAttempts}:{},changed:V(e.changed),reused:V(e.reused),...n?{runDir:n}:{},...t?{error:t}:{},...C(e.notes)?{notes:C(e.notes)}:{}}}function U(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=S(n),r=(typeof n==`string`?n:C(e.label)||C(e.request)).replace(/\s+/g,` `).trim(),i=(typeof n==`string`?n:C(e.request)||C(e.label)).trim();r&&i&&!t.some(e=>e.label.toLowerCase()===r.toLowerCase())&&t.push({label:r.length>60?`${r.slice(0,59)}…`:r,request:i})}return t.slice(0,4)}function W(e){let t=e.toLowerCase(),n=z(t);if(n)return R.test(t.replace(/^[a-z]+_/,``))?{label:`Updating ${n}`,orb:`working`}:{label:`Reading ${n}`,orb:`reading`};for(let[e,n,r]of k)if(e.test(t))return{label:n,orb:r};let r=t.replace(/^forgeqe_/,``).replace(/[_-]+/g,` `).trim();return{label:r?r[0].toUpperCase()+r.slice(1):`Working`,orb:`working`}}function G(e,t){return{id:e,user:t,steps:[],parts:[],next:[],asks:[],waits:[],log:[],plan:[],changes:[],tests:[],reports:[]}}function K(e){let t=S(e);return[C(t.id),C(t.title)].filter(Boolean).join(`: `)}function q(n){let r={turns:[],notes:[]},i=new Map,a=e=>(typeof e==`string`?i.get(e):void 0)??r.turns.at(-1),o=(e,t)=>{let n=e=>{for(let r of e){if(r.key===t)return r;let e=r.children&&n(r.children);if(e)return e}};return n(e.steps)},s=(e,t,n)=>{let r={lines:[],...t};if(n)n.push(r);else{let t=e.plan.find(e=>e.status===`active`)??e.plan.find(e=>e.status===`pending`)??e.plan.at(-1);t&&(r.phase=t.text),e.steps.push(r)}return r},c=(t,n,r)=>{let i=n.parent?o(t,`c:${C(n.parent)}`):void 0;if(i)return i.children??=[];let a=C(n.agent);if(!a&&A.test(C(n.kind))){let e=[...t.steps].reverse().find(e=>e.status===`running`&&!!e.agent&&e.agent!==`forgeqe`);return e?l(e):void 0}if(!r||!a||a===`forgeqe`)return;let c=[...t.steps].reverse().find(e=>e.status===`running`);return c||=s(t,{key:`ag:${a}:${t.steps.length}`,label:e(a).name,status:`running`,orb:`handing`,agent:a}),c.agent??=a,l(c)},l=e=>{let t=e.children??=[],n=t.at(-1);return n&&n.key.startsWith(`try:`)&&n.status===`running`?n.children??=[]:t},u=(e,t)=>{let n=e?.children?.at(-1);if(!n||!n.key.startsWith(`try:`)||n.status!==`running`)return;let r=[...n.children||[]].reverse().find(e=>e.key.startsWith(`t:`)||!!e.review),i=t??(r?r.review?r.review.approved:r.status===`ok`:void 0);n.status=i===void 0?`info`:i?`ok`:`fail`},d,f=new Map,p=new Map,m=0,h=e=>{let t=r.agents??=[],n=t.find(t=>t.agent===e);return n||t.push(n={agent:e,usage:{input:0,output:0},at:0}),n.at=++m,n},g=(n,i,a)=>{let l=C(i.kind),m=C(i.id);if((l===`start`||l===`tool`)&&j.test(C(i.tool))&&!z(C(i.tool)))return;let g=c(n,i,a),_=S(i.delegate),v=C(i.tool)||C(i.text),y=C(_.agent)?{agent:C(_.agent),task:C(_.task)}:void 0;if(l===`start`){if(y)s(n,{key:`c:${m}`,label:`Hands off to ${t(e(y.agent).name)}`,arg:y.task||void 0,status:`running`,orb:`handing`,agent:y.agent,handoff:y,children:[]},g);else{let{label:e,orb:t}=W(v),r=g?void 0:I(C(i.tool));s(n,{key:`c:${m}`,label:e,arg:C(i.text)&&C(i.text)!==C(i.tool)?C(i.text):void 0,status:`running`,orb:t,icon:N(v),...r?{agent:r}:{}},g)}}else if(l===`tool`){i.ok!==!1&&C(i.tool)&&D(r.uses??={skills:[],knowledge:[],systems:[]},C(i.tool),C(i.skill));let a=m?o(n,`c:${m}`):void 0,c=S(i.file),l=B(i.change);if(l&&C(c.path)){let e=n.changes.find(e=>e.path===C(c.path));e?Object.assign(e,{diff:`${e.diff}\n${l.diff}`,added:e.added+l.added,removed:e.removed+l.removed}):n.changes.push({path:C(c.path),...l,...C(i.agent)?{agent:C(i.agent)}:{}})}if(a)a.status=i.ok===!1?`fail`:`ok`,a.handoff&&C(_.result)&&(a.handoff.result=C(_.result));else if(y)s(n,{key:`c:${m||n.steps.length}`,label:`Hands off to ${t(e(y.agent).name)}`,arg:y.task||void 0,status:i.ok===!1?`fail`:`ok`,orb:`handing`,agent:y.agent,handoff:{...y,...C(_.result)?{result:C(_.result)}:{}},children:[]},g);else{let{label:e,orb:t}=W(v),r=g?void 0:I(C(i.tool));s(n,{key:`c:${m||n.steps.length}`,label:e,arg:C(c.path)||C(i.text)||void 0,status:i.ok===!1?`fail`:`ok`,orb:t,icon:N(v),...r?{agent:r}:{},...l?{change:l}:{}},g)}a&&l&&(a.change=l)}else if(l===`stream`||l===`say`){if(a)return;let e=n.parts.find(e=>e.id===m);e?e.text=l===`say`?C(i.text):e.text+C(i.text):n.parts.push({id:m||`p${n.parts.length}`,text:C(i.text)})}else if(l===`plan`){if(g||i.agent&&i.agent!==`forgeqe`)return;let e=Array.isArray(i.items)?i.items.map(S):[],t=e=>e===`completed`?`done`:e===`in_progress`?`active`:e===`cancelled`?`skipped`:`pending`;n.plan=e.map(e=>({text:C(e.text),status:t(e.status)})).filter(e=>e.text)}else if(l===`test`){let e=Number(i.attempt)||0;if(e>0){let{summary:t,detail:r}=P(C(i.text));s(n,{key:`t:${e}:${n.steps.length}`,label:`Test, attempt ${e}`,arg:t||void 0,status:i.ok?`ok`:`fail`,orb:`retrying`,icon:`test`,...r?{output:r}:{},...d?{command:d}:{}},g),d=void 0}else if(i.ok&&/\bconnected$/i.test(C(i.text)))return;else s(n,{key:`t:${n.steps.length}`,label:C(i.text)||(i.ok?`Checked`:`Check failed`),status:i.ok?`ok`:`fail`,orb:/connect|mcp/i.test(C(i.text))?`waiting`:`working`},g)}else if(l===`attempt`){let e=[...n.steps].reverse().find(e=>e.status===`running`&&!!e.agent&&e.agent!==`forgeqe`);if(!e)return;u(e);let t=C(i.fixing)||C(i.why);(e.children??=[]).push({key:`try:${C(i.attempt)}:${e.children.length}`,label:`Attempt ${C(i.attempt)} of ${C(i.max)}`,arg:t?t.length>120?`${t.slice(0,119)}…`:t:void 0,status:`running`,orb:`retrying`,icon:`retry`,lines:t.length>120?[{text:t}]:[],children:[]})}else if(l===`review`){let e=(Array.isArray(i.issues)?i.issues:[]).map(S).map(e=>({kind:C(e.kind)===`standards`?`standards`:`correctness`,...C(e.file)?{file:C(e.file)}:{},problem:C(e.problem),...C(e.fix)?{fix:C(e.fix)}:{}})).filter(e=>e.problem).slice(0,20),t=i.approved===!0,r=(g??n.steps).length;s(n,{key:`r:${C(i.attempt)}:${r}`,label:t?`Review approved`:`Review asked for changes`,arg:e.length?`${e.length} ${e.length===1?`issue`:`issues`}`:void 0,status:t?`ok`:`fail`,orb:`thinking`,agent:`forgeqe-review`,icon:`review`,review:{approved:t,summary:C(i.summary),issues:e}},g)}else if(l===`context`||l===`usage`){let e=C(i.agent)||`forgeqe`,t=h(e);l===`context`&&typeof i.tokens==`number`&&typeof i.limit==`number`&&(t.context={tokens:i.tokens,limit:i.limit,compactsAt:typeof i.compactsAt==`number`?i.compactsAt:void 0},e===`forgeqe`&&(r.context=t.context));let n=l===`usage`?b(i.usage):void 0;if(n){let i=f.get(e);i&&(n.input<i.input||n.output<i.output)&&p.set(e,x(p.get(e),i)),f.set(e,n),t.usage=x(p.get(e),n),r.usage=(r.agents||[]).reduce((e,t)=>x(e,t.usage),void 0)}}else if(l===`info`){let e=(g??n.steps).at(-1),t=/^ForgeQE runs the test:\s*([\s\S]+)$/.exec(C(i.text));t?d=t[1].trim():e&&e.lines.push({text:C(i.text)})}},v,y=(e,t)=>{let n=C(t.type);if(n===`docs`)return O(r.uses??={skills:[],knowledge:[],systems:[]},t);if(n===`run-start`)s(e,{key:`run:${e.steps.length}`,label:`Running in the browser`,arg:C(t.goal),status:`running`,orb:`browsing`,agent:`engine`});else if(n===`run-event`){let n=[...e.steps].reverse().find(e=>e.key.startsWith(`run:`)),r=S(t.event);if(!n)return;r.type===`outcome`?n.lines.push({text:`Step ${C(r.step)}: ${C(r.action)||C(r.text)}`,ok:r.ok===!0||r.ok!==!1&&void 0}):r.type===`log`&&(r.level!==`info`||r.progress)&&n.lines.push({text:C(r.text),ok:r.level!==`error`&&void 0})}else if(n===`run-done`){let n=[...e.steps].reverse().find(e=>e.key.startsWith(`run:`)&&e.status===`running`),r=S(t.result),i=!t.error&&(r.outcome===`passed`||!r.outcome&&r.status===`complete`);if(n){n.status=i?`ok`:`fail`;let e=C(t.error)||C(r.summary);e&&n.lines.push({text:e,ok:!!i})}C(t.runDir)&&e.reports.push({label:i?`Browser run report`:`Browser run report (failed)`,path:C(t.runDir)})}else if(n===`suite-start`){let n=Array.isArray(t.cases)?t.cases:[];s(e,{key:`suite:${e.steps.length}`,label:`Running ${n.length} test case${n.length===1?``:`s`}`,status:`running`,orb:`working`,agent:`engine`})}else if(n===`suite-event`){let n=[...e.steps].reverse().find(e=>e.key.startsWith(`suite:`)),r=S(t.event);if(n&&r.type===`case-done`){let e=S(r.result);n.lines.push({text:`${K(e.case)}: ${C(e.status)}`,ok:e.status===`passed`})}}else if(n===`suite-done`){let n=[...e.steps].reverse().find(e=>e.key.startsWith(`suite:`)),r=Array.isArray(S(t.suite).results)?S(t.suite).results.map(S):[];if(n){let e=r.filter(e=>e.status!==`passed`).length;n.status=e?`fail`:`ok`,n.arg=`${r.length-e} of ${r.length} passed`}}else if(n===`card`){let n=S(t.card);s(e,{key:`card:${e.steps.length}`,label:C(n.title),arg:C(n.stats)||void 0,status:n.status===`ok`?`ok`:n.status===`fail`?`fail`:`info`,orb:`working`,lines:(Array.isArray(n.body)?n.body:[]).map(e=>({text:C(e)}))})}else if(n===`call-start`&&!t.quiet)s(e,{key:`call:${C(t.id)}`,label:C(t.text),status:`running`,orb:`working`});else if(n===`call`&&!t.quiet){let n=t.id?o(e,`call:${C(t.id)}`):void 0;n?n.status=t.ok===!1?`fail`:`ok`:s(e,{key:`call:${e.steps.length}`,label:C(t.text),status:t.ok===!1?`fail`:`ok`,orb:`working`})}else if(n===`code-start`)v=C(t.runDir)||void 0,s(e,{key:`code:${e.steps.length}`,label:`Hands off to the Coding agent`,arg:C(t.goal),status:`running`,orb:`writing`,agent:`forgeqe-test`,handoff:{agent:`forgeqe-test`,task:C(t.goal)},children:[]});else if(n===`code-done`){let n=[...e.steps].reverse().find(e=>e.key.startsWith(`code:`)&&e.status===`running`);u(n),n&&(n.status=t.error?`fail`:`ok`,t.error&&n.lines.push({text:C(t.error),ok:!1}));let r=[],i=(e=[])=>e.forEach(e=>(r.push(e),i(e.children)));i(n?.children);let a=r.filter(e=>e.key.startsWith(`t:`)),o=r.filter(e=>e.review);e.tests.push({...H(S(t.result),C(t.error),v),...n?{runs:a.length,failedRuns:a.filter(e=>e.status===`fail`).length,reviews:o.length}:{},...o.length?{review:o.at(-1).review}:{}}),v=void 0}else if(n===`agent`)g(e,S(t.event),!0);else if(n===`info`){let n=e.steps.at(-1);n?n.lines.push({text:C(t.text),ok:t.ok===!0||t.ok!==!1&&void 0}):s(e,{key:`info:${e.steps.length}`,label:C(t.text),status:t.ok===!1?`fail`:`info`,orb:`working`})}else n===`report`&&(s(e,{key:`report:${e.steps.length}`,label:`Report saved`,arg:C(t.title),status:`ok`,orb:`working`}),C(t.html)&&e.reports.push({label:C(t.title)||`Report`,path:C(t.html)}))};for(let e of n){w(e);let t=_(e);t&&(typeof e.id==`string`&&i.get(e.id)||typeof e.turn==`string`&&i.get(e.turn)||r.turns.at(-1))?.log.push(t)}return r;function w(e){switch(e.type){case`user`:{let t=G(C(e.id),C(e.text));r.turns.push(t),i.set(t.id,t);break}case`ready`:{r.ended=void 0,r.fatal=void 0;let t=S(e.profile);t.name&&(r.model={name:C(t.name),provider:C(t.provider)}),r.writeTests=e.writeTests!==!1,r.headed=e.headed===!0;break}case`models`:case`model`:{let t=S(e.profile);t.name&&(r.model={name:C(t.name),provider:C(t.provider)}),e.type===`models`&&Array.isArray(e.models)&&(r.models=e.models.map(e=>({name:C(S(e).name),provider:C(S(e).provider)})).filter(e=>e.name));break}case`settings`:typeof e.writeTests==`boolean`&&(r.writeTests=e.writeTests),typeof e.headed==`boolean`&&(r.headed=e.headed);break;case`turn_start`:{let t=a(e.id);t&&(t.started=C(e.t)||C(e.at));break}case`agent`:{let t=a(e.id);t&&g(t,S(e.event),!1);break}case`tool`:{let t=a(e.id);t&&y(t,S(e.event));break}case`ask`:{let t=a(e.turn),n=S(e.question);t?.asks.push({id:C(e.id),title:C(n.title),detail:C(n.detail)||void 0,lines:Array.isArray(n.lines)?n.lines.map(C):[],options:(Array.isArray(n.options)?n.options:[]).map(e=>({id:C(S(e).id),label:C(S(e).label)}))});break}case`wait`:a(e.turn)?.waits.push({id:C(e.id),prompt:C(e.prompt)});break;case`answered`:for(let t of r.turns){let n=t.asks.find(t=>t.id===e.ask);n&&(n.answer=C(e.label));let r=t.waits.find(t=>t.id===e.ask);r&&(r.answer=e.ok===!0)}break;case`turn_done`:{let t=a(e.id);if(!t)break;t.outcome=e.outcome,t.reply=C(e.reply),t.next=U(e.next),t.error=C(e.error)||void 0,t.ended=C(e.t)||C(e.at),r.usage=b(e.usage)??r.usage;let n=e=>{for(let r of e)r.status===`running`&&(r.status=t.outcome===`done`?`ok`:`info`),r.children&&n(r.children)};if(n(t.steps),t.outcome===`done`)for(let e of t.plan)e.status===`active`&&(e.status=`done`);break}case`error`:e.code!==`busy`&&r.notes.push(C(e.message));break;case`fatal`:r.fatal=C(e.message);break;case`exit`:r.ended={code:typeof e.code==`number`?e.code:null,stderr:Array.isArray(e.stderr)?e.stderr.map(C):void 0,message:C(e.message)||void 0}}}}function J(e){let t=e.asks.find(e=>e.answer===void 0),n=e.waits.find(e=>e.answer===void 0);if(t||n)return{text:`Waiting for you…`,orb:`waiting`};let r=[...e.steps].reverse().find(e=>e.status===`running`);return r?{text:`${r.label}…`,orb:r.orb}:e.parts.some(e=>e.text.trim())&&e.steps.length?{text:`Writing a reply…`,orb:`writing`}:{text:`Thinking…`,orb:`thinking`}}function Y(e){if(!e.started||!e.ended)return`Done`;let t=Math.max(1,Math.round((Date.parse(e.ended)-Date.parse(e.started))/1e3)),n=e.outcome===`stopped`?`Stopped after`:`Worked for`;return t<60?`${n} ${t} second${t===1?``:`s`}`:`${n} ${Math.floor(t/60)} min ${t%60} s`}var X={running:`active`,ok:`done`,fail:`failed`,info:`note`};function Z(e,t){let n=e=>e===`active`&&!t?`done`:e;if(!e.plan.length)return e.steps.map(e=>({key:e.key,label:e.label,status:n(X[e.status]),steps:[],step:e}));let r=new Set(e.plan.map(e=>e.text)),i=new Map,a=``;for(let t of e.steps)t.phase&&r.has(t.phase)&&(a=t.phase),i.set(a,[...i.get(a)||[],t]);let o=e=>e.some(e=>e.status===`running`),s=[],c=i.get(``)||[];c.length&&s.push({key:`plan:start`,label:`Getting started`,status:n(o(c)?`active`:`done`),steps:c});let l=e.plan.map((e,n)=>{let r=i.get(e.text)||[],a=e.status===`done`?`done`:e.status===`skipped`?`skipped`:e.status===`active`||o(r)?`active`:`pending`;return{key:`plan:${n}`,label:e.text,status:a===`active`&&!t?`pending`:a,steps:r}});return[...s,...Q(l)]}function Q(e){let t=e.findIndex(e=>e.status===`active`);return t<0?e:e.map((e,n)=>e.status===`skipped`||e.status===`failed`||n===t?e:{...e,status:n<t?`done`:`pending`})}export{_ as a,u as c,Y as i,q as n,y as o,Z as r,v as s,J as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ir as e,Nr as t}from"./line-icons-CQ-3V8ax.js";import{rt as n}from"./filters-
|
|
1
|
+
import{Ir as e,Nr as t}from"./line-icons-CQ-3V8ax.js";import{rt as n}from"./filters-mFECJpMB.js";import{n as r}from"./thread-CyTIuLgk.js";var i=e(t(),1),a=e=>e&&/^No model in llms\.json/.test(e)?`No model is set up for the agent yet: add one in Settings, Models (or sign in to GitHub Copilot there), then send this again.`:e;function o(e){let t=()=>{try{return localStorage.getItem(e)}catch{return null}},a=t=>{try{t?localStorage.setItem(e,t):localStorage.removeItem(e)}catch{}},[o,s]=(0,i.useState)(t),[c,l]=(0,i.useState)([]),[u,d]=(0,i.useState)(null);(0,i.useEffect)(()=>{if(!o){l([]),d(null);return}let e=!1,t=0;return l([]),(async()=>{for(;!e;)try{let r=await n.events(o,t,t>0);if(e||(d(r.state),r.events.length&&(t=r.events.at(-1).n,l(e=>[...e,...r.events])),(r.state===`closed`||r.state===`failed`)&&!r.events.length))return}catch(t){if(e)return;if(t.status===404){a(null),s(null);return}await new Promise(e=>setTimeout(e,2e3))}})(),()=>{e=!0}},[o]);let f=(0,i.useMemo)(()=>r(c),[c]),p=f.turns.at(-1),m=u===`closed`||u===`failed`;return{chat:o,thread:f,last:p,busy:u===`busy`||u===`starting`||!!p&&!p.outcome&&!m,ended:m,send:async(e,t,r={})=>{if(o&&!m)await n.send(o,e);else{let{id:i}=await n.start(`${t}\n${e}`,r);a(i),s(i)}},reset:()=>{a(null),s(null)}}}export{o as n,a as t};
|
package/dist/web/index.html
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="referrer" content="no-referrer" />
|
|
7
7
|
<title>ForgeQE</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CotEpFLY.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/line-icons-CQ-3V8ax.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/filters-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/frame-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/filters-mFECJpMB.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/frame-BcGZt823.js">
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/assets/index-VgSzQGK8.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|
package/docs/user-guide.html
CHANGED
|
@@ -387,7 +387,7 @@ forgeqe docs --copy ./docs # copy the guide, the architecture page, the refere
|
|
|
387
387
|
<h3 class="band-title">Every feature</h3>
|
|
388
388
|
<div class="area"><a class="area-name" href="#area-browser"><span class="mono">Browser</span></a><ul class="tiles"><li><a class="tile" href="#cap-browser-goals"><b>Run any goal in a real browser</b><span>Go to booking.com and search hotels in Mumbai for next weekend</span></a></li><li><a class="tile" href="#cap-logins"><b>Saved logins for the application under test</b><span>Sign in to the admin site and keep the session</span></a></li><li><a class="tile" href="#cap-record-web"><b>Record a web test by hand</b><span>I'll show you the checkout steps in the shop: record them</span></a></li></ul></div>
|
|
389
389
|
<div class="area"><a class="area-name" href="#area-test-cases"><span class="mono">Test cases</span></a><ul class="tiles"><li><a class="tile" href="#cap-run-test-cases"><b>Run manual test cases in browsers</b><span>Run SHOP-12 and SHOP-14 from Jira, two browsers at once</span></a></li><li><a class="tile" href="#cap-test-case-quality"><b>Check and improve test cases</b><span>Are the cases in test plan 12 good enough to run?</span></a></li><li><a class="tile" href="#cap-write-test-cases"><b>Write test cases from a story</b><span>Write test cases for story 1234 and save them</span></a></li><li><a class="tile" href="#cap-domain-compliance"><b>Domain and regulatory test design</b><span>Write test cases for story 1234, covering our DORA and PSD2 obligations</span></a></li><li><a class="tile" href="#cap-exploratory-testing"><b>Exploratory testing of a story</b><span>Explore story 1234 and find bugs</span></a></li><li><a class="tile" href="#cap-business-personas"><b>Business personas for testing</b><span>Create a persona of an SME in payments</span></a></li></ul></div>
|
|
390
|
-
<div class="area"><a class="area-name" href="#area-setup"><span class="mono">Setup</span></a><ul class="tiles"><li><a class="tile" href="#cap-test-apps"><b>Test environments and their apps</b><span>Place an order in the shop, then check its invoice in Billing, in UAT</span></a></li><li><a class="tile" href="#cap-generated-code"><b>What ForgeQE wrote</b><span>How much of the code ForgeQE wrote is still there?</span></a></li><li><a class="tile" href="#cap-forgeqe-commands"><b>Every forgeqe command from the shell</b><span>Show me the context budget</span></a></li><li><a class="tile" href="#cap-product-knowledge"><b>Product knowledge from the product's repositories</b><span>How does the product cancel an order? Show the endpoints and tables involved</span></a></li><li><a class="tile" href="#cap-setup-help"><b>Setup, skills, and documentation</b><span>What can you do?</span></a></li></ul></div>
|
|
390
|
+
<div class="area"><a class="area-name" href="#area-setup"><span class="mono">Setup</span></a><ul class="tiles"><li><a class="tile" href="#cap-test-apps"><b>Test environments and their apps</b><span>Place an order in the shop, then check its invoice in Billing, in UAT</span></a></li><li><a class="tile" href="#cap-generated-code"><b>What ForgeQE wrote</b><span>How much of the code ForgeQE wrote is still there?</span></a></li><li><a class="tile" href="#cap-forgeqe-commands"><b>Every forgeqe command from the shell</b><span>Show me the context budget</span></a></li><li><a class="tile" href="#cap-product-knowledge"><b>Product knowledge from the product's repositories</b><span>How does the product cancel an order? Show the endpoints and tables involved</span></a></li><li><a class="tile" href="#cap-knowledge-agent"><b>The Knowledge agent: what ForgeQE understood, and your corrections</b><span>What do you know about refunds?</span></a></li><li><a class="tile" href="#cap-document-search"><b>Search the project's documents, without vectors</b><span>What does the payments spec say about refund limits?</span></a></li><li><a class="tile" href="#cap-setup-help"><b>Setup, skills, and documentation</b><span>What can you do?</span></a></li></ul></div>
|
|
391
391
|
<div class="area"><a class="area-name" href="#area-desktop"><span class="mono">Desktop</span></a><ul class="tiles"><li><a class="tile" href="#cap-desktop-apps"><b>Automate Windows desktop apps</b><span>Create an invoice for Contoso in the Billing app and save it as a test</span></a></li></ul></div>
|
|
392
392
|
<div class="area"><a class="area-name" href="#area-mobile"><span class="mono">Mobile</span></a><ul class="tiles"><li><a class="tile" href="#cap-mobile-apps"><b>Automate Android and iOS apps</b><span>Sign in to the courier app and accept the first delivery, and save it as a test</span></a></li></ul></div>
|
|
393
393
|
<div class="area"><a class="area-name" href="#area-operations"><span class="mono">Operations</span></a><ul class="tiles"><li><a class="tile" href="#cap-containers"><b>Services, mocks, workspace and browser in Docker or Podman</b><span>Start the database and the queue in Docker</span></a></li><li><a class="tile" href="#cap-production-errors"><b>Production errors and the tests that cover them</b><span>Which production errors have no test?</span></a></li><li><a class="tile" href="#cap-model-cost"><b>Model cost and usage</b><span>What did ForgeQE cost this month?</span></a></li><li><a class="tile" href="#cap-monitoring"><b>Scheduled monitoring with alerts</b><span>Check the login flow every 15 minutes and alert Teams</span></a></li><li><a class="tile" href="#cap-jobs"><b>Background jobs on a schedule</b><span>Run the release-2.3 pack every weekday at 2am in the background</span></a></li><li><a class="tile" href="#cap-custom-agents"><b>Your team's custom agents</b><span>Ask our custom agent checkout-guard to check the basket on QA</span></a></li><li><a class="tile" href="#cap-notifications"><b>Teams and email notifications</b><span>Post the results to the QA channel</span></a></li><li><a class="tile" href="#cap-pipelines"><b>CI pipelines</b><span>Add a GitHub Actions workflow that runs tests/cases.yaml on every PR, and make it green</span></a></li></ul></div>
|
|
@@ -1445,12 +1445,27 @@ what it is doing, the files it changed, and its answer (or why it stopped).</p>
|
|
|
1445
1445
|
forgeqe cases cases.yaml --goal # and the exact goal each one runs
|
|
1446
1446
|
</code></pre>
|
|
1447
1447
|
<p><strong>Plain text.</strong> A quoted string is one case: <code>forgeqe suite "Log in as the demo user and open Invoices"</code>.</p>
|
|
1448
|
-
<p><strong>Text or Markdown file.</strong>
|
|
1448
|
+
<p><strong>Text or Markdown file.</strong> Without case headings, each block between <code>---</code> lines is a case, its first line the title:</p>
|
|
1449
1449
|
<pre><code>Search for hotels in Mumbai and check at least one result is shown
|
|
1450
1450
|
---
|
|
1451
1451
|
Open the Deals page
|
|
1452
1452
|
Check every deal has a price
|
|
1453
1453
|
</code></pre>
|
|
1454
|
+
<p><strong>Markdown with a heading per case.</strong> A heading that starts with a case id (<code>## 5458-02 Empty state</code>, <code>### TC-3: Sign in</code>, <code>## Test case 4 – Search</code>) starts a case; a section number (<code>## 1. Introduction</code>) does not. Every section outside a case (the introduction, <code>## Common steps</code>, <code>## Preconditions</code>, <code>## Test data</code>, business rules) goes with every case: common steps (or setup, background, sign-in) come before the case's own steps, preconditions join its preconditions, and the rest is in its description. Inside a case, <code>Preconditions</code>, <code>Steps</code> (a numbered list or a table with Step, Data and Expected columns) and <code>Expected results</code> are read as sub-headings or as <code>**Label:**</code> lines. Run one case of the file by its id: "run test case 5458-02 from TestCases/DTPE-5458-View-Documents.md". An id the file does not have is an error that lists the ids it has. A case's preconditions are taken as met by the test data it names: the run does not stop to prove them.</p>
|
|
1455
|
+
<pre><code class="language-markdown"># DTPE-5458 View Documents
|
|
1456
|
+
|
|
1457
|
+
## Common steps
|
|
1458
|
+
1. Open the Corporate Portal.
|
|
1459
|
+
2. Sign in with the account the case names.
|
|
1460
|
+
|
|
1461
|
+
## 5458-02 Empty state when the user has no documents
|
|
1462
|
+
### Preconditions
|
|
1463
|
+
- Sign in as withoutdocs_user, who has no documents.
|
|
1464
|
+
### Steps
|
|
1465
|
+
1. Open Documents.
|
|
1466
|
+
### Expected results
|
|
1467
|
+
- "You have no documents" is shown.
|
|
1468
|
+
</code></pre>
|
|
1454
1469
|
<p><strong>YAML or JSON.</strong> A list, or <code>{cases: [...]}</code>:</p>
|
|
1455
1470
|
<pre><code class="language-yaml">- id: SHOP-12
|
|
1456
1471
|
title: Valid login
|
|
@@ -1498,7 +1513,24 @@ SHOP-12,Valid login,https://staging.shop.test/login,Sign in as demo,Dashboard sh
|
|
|
1498
1513
|
project_id: 12345
|
|
1499
1514
|
statuses: { passed: PASS, failed: FAIL, error: BLOCKED }
|
|
1500
1515
|
</code></pre>
|
|
1516
|
+
<p><strong>ServiceNow (read only).</strong> <code>servicenow:TST0001234</code> (record numbers or sys_ids) or <code>servicenow:query=active=true^short_descriptionLIKElogin</code> (the first 100) reads Test Management tests and their steps through the Table API; results are not posted back. With <code>user_env</code> set it signs in as that user with <code>token_env</code> as the password; with <code>user_env: ""</code> the token variable holds an OAuth access token. Table names differ between releases, so check them in your instance:</p>
|
|
1517
|
+
<pre><code class="language-yaml">sources:
|
|
1518
|
+
servicenow:
|
|
1519
|
+
url: https://acme.service-now.com
|
|
1520
|
+
user_env: SERVICENOW_USER
|
|
1521
|
+
token_env: SERVICENOW_PASSWORD
|
|
1522
|
+
# test_table: sn_test_management_test
|
|
1523
|
+
# step_table: sn_test_management_step
|
|
1524
|
+
# step_parent: test # the step's field naming its test
|
|
1525
|
+
</code></pre>
|
|
1501
1526
|
<p>Several sources can be mixed: <code>forgeqe suite smoke.yaml jira:SHOP-7 testrail:C12</code>.</p>
|
|
1527
|
+
<p><strong>Which system an id is in.</strong> A prefix (<code>jira:TA-2344</code>, <code>ado:1234</code>) or a link to a configured site always settles it. A bare id is matched by its shape against the systems you set up: <code>C12</code> TestRail, <code>SHOP-T3</code> Zephyr Scale, <code>SHOP-12</code> Jira, <code>TST0001234</code> ServiceNow, and a plain number Azure DevOps, GitHub or qTest. If only one configured system fits, that one is used; if several fit, the command stops and the agent asks you which, never guessing. Map ids for good with <code>id_routes</code>, a prefix and <code>*</code> (never a regular expression), or <code>*</code> alone for plain numbers:</p>
|
|
1528
|
+
<pre><code class="language-yaml">sources:
|
|
1529
|
+
id_routes:
|
|
1530
|
+
"TA-*": jira
|
|
1531
|
+
"TST*": servicenow
|
|
1532
|
+
"*": azure_devops
|
|
1533
|
+
</code></pre>
|
|
1502
1534
|
<p><strong>From requirements.</strong> Ask the agent to test a Confluence page, a story, or a spec file ("write and run test cases for the refund rules page in Confluence"). It reads the requirements, writes one case per rule or acceptance criterion with the main negative paths, shows them, and runs them as text cases. It saves them into a test system only when you ask. Confluence needs <code>sources.confluence</code>:</p>
|
|
1503
1535
|
<pre><code class="language-yaml">sources:
|
|
1504
1536
|
confluence: true # the wiki on the Jira Cloud site above, same account
|
|
@@ -1687,6 +1719,9 @@ forgeqe suite cases.yaml --no-code --no-write-back --out .forgeqe/reports/smoke
|
|
|
1687
1719
|
# or a local command: gets {"query", "top_k"} on stdin, prints the list on stdout
|
|
1688
1720
|
# rag:
|
|
1689
1721
|
# command: ["python", "rag/search.py"]
|
|
1722
|
+
# or ForgeQE's own search of the project's documents, no vectors (Searching your documents, without vectors)
|
|
1723
|
+
# rag:
|
|
1724
|
+
# documents: { folders: [docs/requirements], reasoning: false }
|
|
1690
1725
|
</code></pre>
|
|
1691
1726
|
<p>The answer can also be an object with <code>results</code>, <code>passages</code>, <code>documents</code>, or <code>hits</code>, and a passage's text can be <code>text</code>, <code>content</code>, or <code>page_content</code> (LangChain's shape). A RAG server with an MCP interface works through <code>mcp:</code> instead: ForgeQE's agent calls its tools.</p>
|
|
1692
1727
|
<p><code>suite.case_check</code> decides what happens before a run: <code>warn</code> (the default) shows the findings and runs every case, <code>block</code> leaves out the cases that cannot run as written, <code>off</code> skips the check. Ask to run a case and it runs, whatever the check found; ForgeQE's agent reports the findings with the result instead of refusing. A case whose steps have no expected results runs too: it passes when every step can be done, and the check lists it <strong>to review</strong>, since it checks no result the page should show.</p>
|
|
@@ -1893,6 +1928,21 @@ environments:
|
|
|
1893
1928
|
uat:
|
|
1894
1929
|
apps: { ... }
|
|
1895
1930
|
</code></pre>
|
|
1931
|
+
<p><strong>A value kept in <code>.env</code>.</strong> A variable can take its value from an environment variable (<code>.env</code> or the shell) by
|
|
1932
|
+
naming it: <code>TestPassword: password</code> (a password-, secret-, token-, key- or credential-like name whose value is a
|
|
1933
|
+
variable's name), or <code>${NAME}</code> / <code>env:NAME</code> under any name. Such a variable is a secret: the browser agent types it as
|
|
1934
|
+
<code><secret>TestPassword</secret></code>, filled with that variable's value only on the environment's own sites; a test case's
|
|
1935
|
+
<code>{{var.TestPassword}}</code> becomes that placeholder; tests read it from the variable itself (never <code>FORGEQE_VAR_*</code>); and
|
|
1936
|
+
its value is never shown to a model or written into a report. When the variable is not set, <code>forgeqe apps</code> and the
|
|
1937
|
+
agent say so instead of the word written in the file being typed.</p>
|
|
1938
|
+
<pre><code class="language-yaml"># .env
|
|
1939
|
+
password=test@123
|
|
1940
|
+
# env.yaml
|
|
1941
|
+
environments:
|
|
1942
|
+
QA:
|
|
1943
|
+
variables:
|
|
1944
|
+
TestPassword: password # typed as test@123, never as "password"
|
|
1945
|
+
</code></pre>
|
|
1896
1946
|
<p>Your test cases stay the same in every environment; only where they run changes. The environment supplies the URLs,
|
|
1897
1947
|
executables, accounts and values, and the same test, workflow or scenario runs against QA or UAT.</p>
|
|
1898
1948
|
<p><strong>Any layout works.</strong> The layout above is ForgeQE's own, but an <code>env.yaml</code> your team already keeps is read as it is:</p>
|
|
@@ -2453,6 +2503,91 @@ here, and a gateway route to no known service, are open questions in <code>forge
|
|
|
2453
2503
|
</section>
|
|
2454
2504
|
</div>
|
|
2455
2505
|
</article>
|
|
2506
|
+
<article class="spec feat" id="cap-knowledge-agent">
|
|
2507
|
+
<div class="hd"><span class="mono">Setup</span><h3>The Knowledge agent: what ForgeQE understood, and your corrections</h3></div>
|
|
2508
|
+
<p class="ds">Says what ForgeQE has understood about the product from its knowledge notes, documents, skills, the team's prompts and the product graph, citing each source. A correction in your words becomes changes: a section of a knowledge note or a project skill, a team prompt, or Right/Wrong with what is right on a business rule, journey, capability or term of the graph. Where two sources disagree it asks which is right. Each change is shown as a diff and written only when a person approves it.</p>
|
|
2509
|
+
<div class="facts">
|
|
2510
|
+
<div class="fact"><span class="mono">Ask it</span><ul class="asks"><li>What do you know about refunds?</li><li>That's wrong: the supervisor limit is 1000 EUR, not 500</li><li>Remember that every test must carry its work item</li></ul></div>
|
|
2511
|
+
<div class="fact"><span class="mono">What it needs</span><ul class="needs"><li><span class="need req">Required</span><span>A live model profile in llms.json (an API key or Microsoft Entra ID sign-in)</span></li></ul></div>
|
|
2512
|
+
<div class="fact"><span class="mono">Limits</span><ul class="plainlist"><li>It changes only the project's own files: knowledge notes, project skills (a built-in skill is copied into the project first) and team prompts; ForgeQE's own prompts and skills never change</li><li>Documents of product.docs and the uploaded documents are read, never changed</li></ul></div>
|
|
2513
|
+
<div class="fact"><span class="mono">Tools</span><p class="tools"><code>knowledge_agent</code></p></div>
|
|
2514
|
+
</div>
|
|
2515
|
+
<div class="detail"><span class="mono">In detail</span>
|
|
2516
|
+
<section class="doc" id="doc-how_to_use-the-knowledge-agent">
|
|
2517
|
+
<h4>The Knowledge agent</h4>
|
|
2518
|
+
<div class="prose"><p>The Knowledge agent (<code>forgeqe-knowledge-agent</code>) tells you what ForgeQE has understood about your product, and takes your corrections. Ask it on its page in the web app (Knowledge agent), with <code>forgeqe knowledge chat</code>, or in any chat ("what do you know about refunds?", "that's wrong: the supervisor limit is 1000 EUR"), where ForgeQE's agent hands it over.</p>
|
|
2519
|
+
<ul>
|
|
2520
|
+
<li><strong>What it reads.</strong> The sections of your knowledge notes, documents and skills that your words are about (found as in <em>Searching your documents, without vectors</em>), the team's prompts, and the business rules, journeys, capabilities and terms of the product graph. Each answer names the sources it rests on.</li>
|
|
2521
|
+
<li><strong>What a correction changes.</strong> Only what is the project's own: one section of a knowledge note (or a section added after it, or a new note), one section of a project skill (a skill of ForgeQE's or yours is copied into <code>.forgeqe/skills</code> first, and that copy is used from then on), a team prompt (<code>.forgeqe/prompts/team</code>), or Right/Wrong with what is right on a part of the product graph (<code>graph/feedback.json</code>, which outranks the model on the next build). Documents of <code>product.docs</code>, the uploaded documents and ForgeQE's own prompts are never changed.</li>
|
|
2522
|
+
<li><strong>When sources disagree.</strong> It shows both, with where each comes from, and asks which is right; it changes nothing until you say.</li>
|
|
2523
|
+
<li><strong>Nothing is written until you approve it.</strong> Each change is shown as a before-and-after, written only when you approve it, only if the file is still the one shown, never through a link, and kept in the audit log. A change that holds what looks like a password or a key is refused.</li>
|
|
2524
|
+
</ul>
|
|
2525
|
+
<pre><code class="language-bash">forgeqe knowledge chat # ask, correct, approve each change with y
|
|
2526
|
+
forgeqe knowledge chat "what do you know about refunds?"
|
|
2527
|
+
</code></pre>
|
|
2528
|
+
<p>It has no tools: ForgeQE gives it the sections, and keeps a change only for one of them. Without a model it lists what ForgeQE has about your words.</p>
|
|
2529
|
+
</div>
|
|
2530
|
+
</section>
|
|
2531
|
+
</div>
|
|
2532
|
+
</article>
|
|
2533
|
+
<article class="spec feat" id="cap-document-search">
|
|
2534
|
+
<div class="hd"><span class="mono">Setup</span><h3>Search the project's documents, without vectors</h3></div>
|
|
2535
|
+
<p class="ds">Finds the passages of the project's documents that answer a question: the team's notes, the documents added in Settings, the folders of product.docs and of rag.documents (Markdown, text, HTML, and PDF, Word and Excel once indexed). No vector database or embedding model: each document is read as a tree of its sections, ranked by keywords, and the Document reader picks the sections that answer from their outline. Each passage says its file, line and headings.</p>
|
|
2536
|
+
<div class="facts">
|
|
2537
|
+
<div class="fact"><span class="mono">Ask it</span><ul class="asks"><li>What does the payments spec say about refund limits?</li><li>Which document describes the password rules?</li><li>Search our documents for the checkout requirements</li></ul></div>
|
|
2538
|
+
<div class="fact"><span class="mono">What it needs</span><ul class="needs"><li><span class="need opt">Optional</span><span>A live model profile in llms.json (an API key or Microsoft Entra ID sign-in)</span></li></ul></div>
|
|
2539
|
+
<div class="fact"><span class="mono">Limits</span><ul class="plainlist"><li>PDF, Word and Excel files are read only by forgeqe knowledge docs index; a scanned page with no text is not read</li><li>Without a model, only the keywords rank the sections: a question in other words than the document may miss</li></ul></div>
|
|
2540
|
+
<div class="fact"><span class="mono">Tools</span><p class="tools"><code>search_documents</code></p></div>
|
|
2541
|
+
</div>
|
|
2542
|
+
<div class="detail"><span class="mono">In detail</span>
|
|
2543
|
+
<section class="doc" id="doc-how_to_use-searching-your-documents-without-vectors">
|
|
2544
|
+
<h4>Searching your documents, without vectors</h4>
|
|
2545
|
+
<div class="prose"><p>ForgeQE searches your project's own documents with no vector database, no embedding model and nothing to run beside it, the way <a href="https://github.com/VectifyAI/PageIndex" rel="noopener">PageIndex</a> reads a long document: by its structure, not by chunks of a fixed size.</p>
|
|
2546
|
+
<ol>
|
|
2547
|
+
<li><strong>Each document becomes a tree of its sections</strong>: its Markdown headings (<code>#</code> or underlined), else numbered headings (<code>3.2 Refunds</code>, as PDFs and Word documents have them), else parts of about 2,400 characters at paragraph breaks. A section knows the headings it is under ("Payments › Refunds › Limits") and its line.</li>
|
|
2548
|
+
<li><strong>Keywords rank the sections</strong> (BM25, as search engines rank; a heading counts three times), then a light re-rank with no model: a section that has more of the question's different words ranks higher, so "refund limits" finds the section on limits before one that only repeats "refund".</li>
|
|
2549
|
+
<li><strong>Reasoning, when a model is set up</strong>: the Document reader (<code>forgeqe-doc-reader</code>, no tools, a fixed answer) gets your question and the outline of the documents, and picks the sections that answer it, so "what can a customer get back" finds the section headed "Refund limits". This is the re-ranking step; no separate re-ranking model is needed. When the outline of every document fits (about 16,000 characters), the reader sees all of it, as PageIndex does; otherwise the documents step 2 found. Only ids from the outline are kept; its words reach nobody. Without a model, or when it fails, the keywords answer.</li>
|
|
2550
|
+
</ol>
|
|
2551
|
+
<p><strong>What it saves.</strong> Agents get sections, not whole files:</p>
|
|
2552
|
+
<ul>
|
|
2553
|
+
<li>
|
|
2554
|
+
<p><strong>Skills.</strong> A browser skill longer than its share of <code>skills.browser_max_chars</code> is cut down to its introduction, the sections the goal needs, and a list of its other headings (before, it was left out whole). On ForgeQE's own skills that is 55–80% fewer characters. ForgeQE's agent finds a section of any skill or its references with <code>search_documents</code> and <code>in: skills</code>.</p>
|
|
2555
|
+
</li>
|
|
2556
|
+
<li>
|
|
2557
|
+
<p><strong>Knowledge.</strong> The notes in <code>.forgeqe/knowledge</code> are split at every heading level, so the planners and the browser agent get only the matching sections, even of a long file. ForgeQE's agent searches them before it reads a whole file.</p>
|
|
2558
|
+
</li>
|
|
2559
|
+
<li>
|
|
2560
|
+
<p><strong>Chat history.</strong> When a conversation continues in a new agent session (a web chat reopened, the profile switched, the settings changed), a long one is no longer sent as its last 20 turns whole: the last four turns and the earlier turns about the new message go in full, and every other turn as one line (what was asked → how the reply began), so nothing is dropped without a trace and a long chat costs a few thousand tokens. A short one is sent whole, as before. The agent runtime still summarises the live session itself when it nears the model's window.</p>
|
|
2561
|
+
</li>
|
|
2562
|
+
<li>
|
|
2563
|
+
<p><strong>Earlier chats.</strong> The web app's kept chats (<code>.forgeqe/chats</code>) and the terminal shell's (<code>.forgeqe/terminal-chats</code>, one file per <code>forgeqe start</code> session) are indexed a turn each: <code>search_documents</code> with <code>in: chats</code> (or <code>forgeqe knowledge docs search "..." --in chats</code>) finds what was asked and decided before. What a chat says is what was said then, not what is true now. A terminal chat is kept like a web chat: ForgeQE's secrets and remembered passwords taken out, mode 0600, git-ignored, the newest 500.</p>
|
|
2564
|
+
</li>
|
|
2565
|
+
</ul>
|
|
2566
|
+
<p><strong>What is cached, so it costs less the second time.</strong></p>
|
|
2567
|
+
<ul>
|
|
2568
|
+
<li>The index: a document is read and split again only when it changes.</li>
|
|
2569
|
+
<li>The Document reader's answers: the same question over the same outline with the same model gets the kept answer with no model call (<code>~/.forgeqe/cache/doc-index/picks.json</code>, 30 days). A changed document or another model asks again; <code>--no-cache</code> asks anyway.</li>
|
|
2570
|
+
<li>The provider's prompt cache: the outline comes before the question in the reader's message, and is the same text for every question while the documents do not change, so a provider that caches prompts (Anthropic, OpenAI, Azure OpenAI) charges less for it.</li>
|
|
2571
|
+
</ul>
|
|
2572
|
+
<p>What is searched: the knowledge folder (<code>.forgeqe/knowledge</code>), the documents added in Settings › Evidence (<code>.forgeqe/documents</code>), every folder of <code>product.docs</code>, and the folders <code>rag.documents.folders</code> names inside the project. Markdown, text, reStructuredText, AsciiDoc and HTML files are read again whenever they change. PDF, Word and Excel files are read by Graphify's converters when you run <code>forgeqe knowledge docs index</code>, and their text is kept for later searches. A folder is listed like a product's documents: no hidden file or folder, no file named like a credential, nothing through a link out of it. The index is one JSON file in ForgeQE's cache (<code>~/.forgeqe/cache/doc-index/</code>), never in the repository.</p>
|
|
2573
|
+
<pre><code class="language-bash">forgeqe knowledge docs index # read the documents, PDF, Word and Excel included
|
|
2574
|
+
forgeqe knowledge docs search "refund limits" # passages with their file, line and headings
|
|
2575
|
+
forgeqe knowledge docs search "refund limits" --no-model --limit 3 --json
|
|
2576
|
+
forgeqe knowledge docs search "scenario outline" --in skills # a section of a skill, not the whole skill
|
|
2577
|
+
forgeqe knowledge docs outline specs/payments.md # the tree of one document
|
|
2578
|
+
</code></pre>
|
|
2579
|
+
<p>ForgeQE's agent searches them with <code>search_documents</code> ("what does the spec say about refunds?"). To give the passages to the test case check, story test cases and exploratory charters too, make it the <code>rag:</code> search:</p>
|
|
2580
|
+
<pre><code class="language-yaml">rag:
|
|
2581
|
+
documents:
|
|
2582
|
+
folders: [docs/requirements] # beside the knowledge folder, the uploaded documents and product.docs
|
|
2583
|
+
reasoning: false # true: the Document reader picks sections (one model call per search)
|
|
2584
|
+
top_k: 5
|
|
2585
|
+
</code></pre>
|
|
2586
|
+
<p><code>documents: true</code> searches the default folders with keywords only. The passages are the documents' text: agents get them as data, never as instructions.</p>
|
|
2587
|
+
</div>
|
|
2588
|
+
</section>
|
|
2589
|
+
</div>
|
|
2590
|
+
</article>
|
|
2456
2591
|
<article class="spec feat" id="cap-setup-help">
|
|
2457
2592
|
<div class="hd"><span class="mono">Setup</span><h3>Setup, skills, and documentation</h3></div>
|
|
2458
2593
|
<p class="ds">Shows the model profiles and MCP servers, installs or repairs the browser engine, creates a forgeqe.yaml, manages skills, and answers any question about ForgeQE from its documentation, this list, and its own code (the prompts, skills, and source it runs).</p>
|
package/env.example.yaml
CHANGED
|
@@ -51,6 +51,7 @@ environments:
|
|
|
51
51
|
variables:
|
|
52
52
|
company: Contoso QA
|
|
53
53
|
test_customer: Fabrikam Ltd
|
|
54
|
+
# test_password: SHOP_TEST_PASSWORD # a password-like name whose value names a .env variable: typed from it, as a secret
|
|
54
55
|
secrets: [BILLING_PASSWORD_QA]
|
|
55
56
|
# Feature flags the Feature flags page can run a regression pack across (read only; no flag is ever changed).
|
|
56
57
|
# Each run gets FORGEQE_FLAG_<KEY>=<value> and FORGEQE_FLAGS (JSON: flag, value, via, name); your test fixture
|
package/forgeqe.example.yaml
CHANGED
|
@@ -450,6 +450,17 @@ sources:
|
|
|
450
450
|
# project_id: 12345
|
|
451
451
|
# statuses: { passed: PASS, failed: FAIL, error: BLOCKED } # automation status names in your qTest
|
|
452
452
|
# # module_id: 40 # where save_test_cases writes cases, linked to the story's qTest requirement (by its id)
|
|
453
|
+
# servicenow: # ServiceNow Test Management, read only (servicenow:TST0001234, a sys_id, or servicenow:query=<encoded query>)
|
|
454
|
+
# url: https://acme.service-now.com # or SERVICENOW_URL; https only
|
|
455
|
+
# user_env: SERVICENOW_USER # with token_env as the password; empty: token_env is an OAuth access token
|
|
456
|
+
# token_env: SERVICENOW_PASSWORD
|
|
457
|
+
# # test_table: sn_test_management_test # tables and the step's field naming its test differ by release:
|
|
458
|
+
# # step_table: sn_test_management_step # check them in your instance's tables
|
|
459
|
+
# # step_parent: test
|
|
460
|
+
# id_routes: # which system an id belongs to when more than one set up could hold it.
|
|
461
|
+
# "TA-*": jira # An id is otherwise placed by its shape (C12 TestRail, SHOP-T3 Zephyr, SHOP-12 Jira,
|
|
462
|
+
# "TST*": servicenow # TST0001234 ServiceNow, 1234 Azure DevOps, GitHub or qTest); several fit: ForgeQE asks.
|
|
463
|
+
# "*": azure_devops # * alone: a plain number. A prefix, never a regular expression.
|
|
453
464
|
# github: # GitHub issues as test cases (github:#12, github:label=login) and bugs;
|
|
454
465
|
# repo: acme/shop # also turns on GitHub's MCP server (on anyway in a repo with a GitHub remote)
|
|
455
466
|
# token_env: GITHUB_TOKEN # default; without it, the GitHub CLI's sign-in (forgeqe auth login github)
|
|
@@ -559,6 +570,9 @@ suite:
|
|
|
559
570
|
# url: http://localhost:8080/search # POST {"query", "top_k"}; answers a list of {text, source, score}
|
|
560
571
|
# # command: [python, rag/search.py] # or a local command: the query on stdin, the list on stdout
|
|
561
572
|
# # mcp: { server: docs, tool: search, query_arg: query, top_k_arg: limit } # or a tool of a server under mcp:
|
|
573
|
+
# # documents: # or ForgeQE's own search of this project's documents: no vectors, no database
|
|
574
|
+
# # folders: [docs/requirements] # inside the project, beside .forgeqe/knowledge, .forgeqe/documents and product.docs
|
|
575
|
+
# # reasoning: false # true: the Document reader picks the sections that answer (one model call a search)
|
|
562
576
|
# token_env: RAG_TOKEN # optional, sent as a bearer token
|
|
563
577
|
# top_k: 5
|
|
564
578
|
# timeout_seconds: 20
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capagents/forgeqe",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.7",
|
|
4
4
|
"description": "ForgeQE: a browser agent CLI that runs goals and test cases in local Chrome or Chromium, or BrowserStack and TestMu AI/LambdaTest when configured, and turns passing runs into tests in your repo",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
package/prompts/brain.md
CHANGED
|
@@ -120,6 +120,8 @@ Read data from Azure DevOps, Jira, Xray, Confluence, and other systems in this s
|
|
|
120
120
|
### Test cases
|
|
121
121
|
- To run test cases from these systems, files, or text, you MUST use run_test_cases. It turns each case into a browser goal, writes the reports, and sends the results back.
|
|
122
122
|
- For more than one test case, you MUST use run_test_cases, not one browser_run for each case.
|
|
123
|
+
- For a test case in a file (Markdown, YAML, JSON, CSV, or a feature file), you MUST call run_test_cases with source file, the path, and the case's id in ids, such as 5458-02. You MUST NOT read the file and write a browser goal for the case yourself: run_test_cases gives the case the file's common steps, preconditions, and test data.
|
|
124
|
+
- A case's preconditions are met by the test data that it or the environment names, such as an account set up for them. You MUST NOT refuse, stop, or fail a run because a precondition cannot be proved before it. When the page contradicts a precondition, report it as a test data problem.
|
|
123
125
|
- To look at test cases before they run, you MUST use find_test_cases.
|
|
124
126
|
- run_test_cases files bugs for failed cases itself when "This session" says so, only for functional defects. You MUST NOT file them again. Its write_back list names each bug.
|
|
125
127
|
- run_test_cases checks the cases first (case_check in its result). When a case needs a review or cannot run as written, say so briefly, with the correction.
|
|
@@ -157,7 +159,7 @@ For a Confluence page, a Jira or Azure DevOps story, a specification file, or a
|
|
|
157
159
|
- story_test_cases gives the numbered criteria (AC1, AC2), the feature and epic, and the other stories of the feature.
|
|
158
160
|
- It also gives linked pages, RAG passages, product knowledge, and the linked cases.
|
|
159
161
|
- It also gives the app pages and flows that page memory knows, and the past defects of the area.
|
|
160
|
-
- For other requirements, you MUST
|
|
162
|
+
- For other requirements, you MUST look up the product knowledge that the requirement touches. Use search_documents first. Read a whole file only when it is short or the passages are not enough. You MUST number its criteria AC1, AC2, and so on.
|
|
161
163
|
- Before you write a case, you MUST give a short analysis of the requirement. It has five parts:
|
|
162
164
|
1. The aim of the feature, from the story, its parents, the linked pages, and the knowledge.
|
|
163
165
|
2. Each criterion as testable rules: its conditions, data, limits, states, and roles.
|
|
@@ -211,6 +213,7 @@ For "an end-to-end test for story 1234", "combine these cases into one flow", or
|
|
|
211
213
|
### Signing in
|
|
212
214
|
- The browser agent signs in to the sites under "Saved logins" with stored credentials and a saved session. You MUST NOT ask the user for those passwords or codes.
|
|
213
215
|
- You MUST NOT put credentials in goals.
|
|
216
|
+
- When a site asks for a one-time code, and the environment's variables or the case give a fixed code for the test environment, that code is test data: the run types it. It is not a reason to stop.
|
|
214
217
|
- When a message or a test case gives credentials for a site, you MUST call logins with action remember before the first run that needs them. Give a short name, the url, and each other sign-in host.
|
|
215
218
|
- Examples of sign-in hosts are login.microsoftonline.com, accounts.google.com, and the Okta or ADFS host of the company.
|
|
216
219
|
- You MUST give the values exactly as the user gave them, without the quotes or the punctuation of the sentence.
|
|
@@ -223,7 +226,7 @@ For "an end-to-end test for story 1234", "combine these cases into one flow", or
|
|
|
223
226
|
- A browser_run goal is the complete instruction that the browser agent follows. It MUST give each value and each setting that the user named (dates, places, filters, sort order), and what to check.
|
|
224
227
|
- The goal MUST NOT have your questions, alternatives, or reasoning. You MUST remove all doubt before you call it.
|
|
225
228
|
- The goal MUST NOT add values that the user did not give, such as a number of guests or rooms. Leave the site's default.
|
|
226
|
-
- The goal MUST ask only for what the page can show. When the user gives a limit per unit (per night, per item, per month) and the site can show the total for the whole stay or order, give both in the goal: the limit per unit and the total that it means (5 nights under £100 a night is a total under £500). The agent then uses the one that the page shows.
|
|
229
|
+
- The goal MUST ask only for what the page can show. It MUST NOT make the run prove what a page cannot show, such as how an account's data was set up. When the user gives a limit per unit (per night, per item, per month) and the site can show the total for the whole stay or order, give both in the goal: the limit per unit and the total that it means (5 nights under £100 a night is a total under £500). The agent then uses the one that the page shows.
|
|
227
230
|
- A run with outcome assertion_failed did all the steps and found an expected result that is not true. failed_expectations gives what was expected and what the page shows.
|
|
228
231
|
- That is a correct result: a failed test case. You MUST report it as a failed test, with the expected and the actual result.
|
|
229
232
|
- You MUST NOT run it again, look for the value in other places, or change the expectation. Run again only the runs that could not do their steps.
|
|
@@ -475,7 +478,7 @@ For REST, GraphQL, SOAP, and gRPC:
|
|
|
475
478
|
- When the docs sections do not answer it, you MUST call forgeqe_setup search with the words of the question, then read the guide that answers it. When the guides do not say, tell the user so. You MUST NOT guess or invent.
|
|
476
479
|
- Copies of the agents' prompts that the project can edit are in .forgeqe/prompts/. An edited copy is used.
|
|
477
480
|
- To change how an agent works in this project, you MAY edit its copy there. You MUST say what you changed, and tell the user to try it on some runs first.
|
|
478
|
-
- Product knowledge is in .forgeqe/knowledge/. When the user
|
|
481
|
+
- Product knowledge is in .forgeqe/knowledge/. When the user corrects what ForgeQE knows about the product, you MUST give their words to knowledge_agent. Do the same with facts about the product that stay true. It proposes changes, and the user approves each one.
|
|
479
482
|
|
|
480
483
|
### CI pipelines
|
|
481
484
|
For GitHub Actions or Azure DevOps Pipelines:
|