@capagents/forgeqe 2.8.9 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HOW_TO_USE.md +250 -22
- package/dist/docs-site/docs/desktop/index.html +45 -1
- package/dist/docs-site/docs/index.html +335 -4
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/forgeqe.js +2077 -2022
- package/dist/template.html +66 -66
- package/dist/web/THIRD_PARTY_NOTICES.md +455 -0
- package/dist/web/assets/Agent-BNWcLTrm.js +4 -0
- package/dist/web/assets/ApiTests-CZFzjMKc.js +10 -0
- package/dist/web/assets/Browse-CeiK4X_V.js +2 -0
- package/dist/web/assets/Chat-BqXSNxV2.js +3 -0
- package/dist/web/assets/CommandPalette-VSEzjRS1.js +1 -0
- package/dist/web/assets/Compare-Bjh-qB8C.js +1 -0
- package/dist/web/assets/Cost-BRtni21m.js +1 -0
- package/dist/web/assets/Data-Bzn351xU.js +6 -0
- package/dist/web/assets/Evidence-eM1ZsFF-.js +1 -0
- package/dist/web/assets/Explore-D07Qbzyq.js +2 -0
- package/dist/web/assets/Features-DFwuL5cN.js +1 -0
- package/dist/web/assets/Flags-pxSAu21R.js +2 -0
- package/dist/web/assets/Flaky-BdfqCR6j.js +1 -0
- package/dist/web/assets/ForceGraph-DC7NzeR4.js +1 -0
- package/dist/web/assets/Impact-CfnvrPzq.js +3 -0
- package/dist/web/assets/Jobs-CIKpgvcv.js +5 -0
- package/dist/web/assets/KindPage-OyYE9NU7.js +6 -0
- package/dist/web/assets/Migration-BQA6MOPN.js +2 -0
- package/dist/web/assets/Product-DNe8RV_H.js +7 -0
- package/dist/web/assets/Production-ClEiFS1u.js +1 -0
- package/dist/web/assets/Quality-BZnQcbb2.js +1 -0
- package/dist/web/assets/Readiness-Dk2KZZm4.js +1 -0
- package/dist/web/assets/Record-CSapdwkr.js +2 -0
- package/dist/web/assets/Regression-C7bZ5sSE.js +5 -0
- package/dist/web/assets/Reports-BWtgbiVp.js +2 -0
- package/dist/web/assets/Response-DyvlQXek.js +4 -0
- package/dist/web/assets/RunDiff-DWV5qdHx.js +1 -0
- package/dist/web/assets/Runs-CET6zwQu.js +2 -0
- package/dist/web/assets/Steps-DUG1BKJb.js +2 -0
- package/dist/web/assets/TestCases-DyicRSqL.js +1 -0
- package/dist/web/assets/TestData-D2aWG3dq.js +2 -0
- package/dist/web/assets/TestDebt-DobUiGTz.js +1 -0
- package/dist/web/assets/Tosca-DvTni6va.js +3 -0
- package/dist/web/assets/WhatsNew-B3xewvk5.js +1 -0
- package/dist/web/assets/dataParts-rU9wRwfo.js +3 -0
- package/dist/web/assets/families-DWrv-fcS.js +1 -0
- package/dist/web/assets/filters-BDJYWuRV.js +1 -0
- package/dist/web/assets/fold-BgITvJex.js +1 -0
- package/dist/web/assets/frame-Dn34zQXO.js +4 -0
- package/dist/web/assets/index-BiMUTOBo.js +45 -0
- package/dist/web/assets/index-CGfii-zv.css +2 -0
- package/dist/web/assets/line-icons-CQ-3V8ax.js +1 -0
- package/dist/web/assets/logos-C067hMmF.js +1 -0
- package/dist/web/assets/palette-Br50dJuQ.js +1 -0
- package/dist/web/assets/parts-CbA0h_uO.js +1 -0
- package/dist/web/assets/productParts-BxQnjrHo.js +1 -0
- package/dist/web/assets/qualityParts-Cn74cNyX.js +1 -0
- package/dist/web/assets/rows-X8lfgK8j.js +1 -0
- package/dist/web/assets/segmented-mcjXGwLg.js +1 -0
- package/dist/web/assets/thread-Bamx8xqR.js +5 -0
- package/dist/web/assets/usePageChat-B-vpiXQ6.js +1 -0
- package/dist/web/index.html +5 -3
- package/docs/DESKTOP.md +48 -1
- package/docs/user-guide.html +335 -4
- package/evals/evidence/build/README.md +20 -0
- package/evals/evidence/build/base/package.json +1 -0
- package/evals/evidence/build/base/src/index.ts +1 -0
- package/evals/evidence/build/base/src/pricing.ts +22 -0
- package/evals/evidence/build/base/tests/discount.test.ts +6 -0
- package/evals/evidence/build/base/tests/legacy.test.ts +7 -0
- package/evals/evidence/build/base/tests/pricing.test.ts +10 -0
- package/evals/evidence/build/cases/build-broken/after/src/pricing.ts +22 -0
- package/evals/evidence/build/cases/build-broken/case.json +13 -0
- package/evals/evidence/build/cases/fixes-legacy/after/src/pricing.ts +22 -0
- package/evals/evidence/build/cases/fixes-legacy/case.json +11 -0
- package/evals/evidence/build/cases/flaky-test/after/tests/flaky.test.ts +11 -0
- package/evals/evidence/build/cases/flaky-test/case.json +11 -0
- package/evals/evidence/build/cases/good-feature/after/src/index.ts +1 -0
- package/evals/evidence/build/cases/good-feature/after/src/pricing.ts +28 -0
- package/evals/evidence/build/cases/good-feature/after/tests/bulk.test.ts +7 -0
- package/evals/evidence/build/cases/good-feature/case.json +17 -0
- package/evals/evidence/build/cases/new-test-fails/after/src/index.ts +1 -0
- package/evals/evidence/build/cases/new-test-fails/after/src/pricing.ts +27 -0
- package/evals/evidence/build/cases/new-test-fails/after/tests/coupon.test.ts +6 -0
- package/evals/evidence/build/cases/new-test-fails/case.json +19 -0
- package/evals/evidence/build/cases/regression/after/src/pricing.ts +23 -0
- package/evals/evidence/build/cases/regression/case.json +13 -0
- package/evals/evidence/build/cases/test-removed/case.json +14 -0
- package/forgeqe.example.yaml +2 -0
- package/package.json +2 -1
- package/prompts/README.md +1 -0
- package/prompts/impact-reader.md +8 -9
- package/prompts/tosca-assistant.md +47 -0
- package/prompts/tosca.md +3 -1
- package/py/forgeqe_desktop/agentdesktop_driver.py +57 -7
- package/py/forgeqe_desktop/handhooks.py +71 -22
- package/py/forgeqe_desktop/handrecord.py +7 -1
- package/py/forgeqe_desktop/heal.py +24 -2
- package/py/forgeqe_desktop/memory.py +54 -4
- package/py/forgeqe_desktop/pywinauto_driver.py +210 -12
- package/py/forgeqe_desktop/replay.py +10 -2
- package/py/forgeqe_desktop/service.py +9 -2
- package/py/forgeqe_desktop/ufo_runner.py +101 -1
- package/py/forgeqe_engine/browser.py +309 -31
- package/py/forgeqe_engine/browserdoctor.py +255 -0
- package/py/forgeqe_engine/browserlaunch.py +271 -0
- package/py/forgeqe_engine/capture.py +20 -4
- package/py/forgeqe_engine/cli.py +26 -0
- package/py/forgeqe_engine/logins.py +1 -1
- package/py/forgeqe_engine/pwlaunch.mjs +61 -0
- package/py/forgeqe_engine/recordsession.py +1 -1
- package/py/forgeqe_engine/service.py +1 -1
- package/py/forgeqe_mobile/service.py +4 -1
- package/py/forgeqe_tosca/__init__.py +11 -1
- package/py/forgeqe_tosca/app.py +168 -0
- package/py/forgeqe_tosca/db.py +131 -0
- package/py/forgeqe_tosca/files.py +74 -0
- package/py/forgeqe_tosca/ntir.py +357 -5
- package/py/forgeqe_tosca/render.py +38 -0
- package/py/forgeqe_tosca/tsu.py +110 -0
- package/skills/tosca-knowledge/SKILL.md +14 -3
- package/skills/tosca-knowledge/references/api.md +54 -0
- package/dist/web/assets/Agent-CHliM9aG.js +0 -4
- package/dist/web/assets/ApiTests-DcGDtIjl.js +0 -10
- package/dist/web/assets/Browse-DWZgEdaB.js +0 -1
- package/dist/web/assets/Chat-DVolc6Rs.js +0 -3
- package/dist/web/assets/CommandPalette-CdwjRIsa.js +0 -1
- package/dist/web/assets/Cost-BifpK_Ac.js +0 -1
- package/dist/web/assets/Data-Crk0ef8O.js +0 -6
- package/dist/web/assets/Evidence-EYGofupD.js +0 -1
- package/dist/web/assets/Explore-DtqBRQi7.js +0 -2
- package/dist/web/assets/Features-B_ZtQEtR.js +0 -1
- package/dist/web/assets/Flags-DCLSg8Na.js +0 -2
- package/dist/web/assets/Flaky-HpgrkJIF.js +0 -1
- package/dist/web/assets/ForceGraph-Dm4VEUjO.js +0 -1
- package/dist/web/assets/Impact-CyzbgGih.js +0 -3
- package/dist/web/assets/Jobs-CbTd9csb.js +0 -5
- package/dist/web/assets/KindPage-cfP76U_9.js +0 -6
- package/dist/web/assets/Migration-va16JqtB.js +0 -2
- package/dist/web/assets/Product-D0iY6orX.js +0 -7
- package/dist/web/assets/Production-CBUb6wZJ.js +0 -1
- package/dist/web/assets/Quality-OMhrUKTU.js +0 -1
- package/dist/web/assets/Readiness-B64Rxahv.js +0 -1
- package/dist/web/assets/Record-B_JXq6Dv.js +0 -2
- package/dist/web/assets/Regression-2blJAX7v.js +0 -5
- package/dist/web/assets/Reports-DCgjGdw4.js +0 -2
- package/dist/web/assets/Response-BtMM8nqx.js +0 -4
- package/dist/web/assets/RunDiff-KuUVRuQI.js +0 -1
- package/dist/web/assets/Runs-zHDZ-rSo.js +0 -2
- package/dist/web/assets/TestCases-B1j2Oelt.js +0 -1
- package/dist/web/assets/TestData-CZSynoi-.js +0 -2
- package/dist/web/assets/TestDebt-DEdIBwdb.js +0 -1
- package/dist/web/assets/Tosca-BcuaHsQC.js +0 -2
- package/dist/web/assets/WhatsNew-CjvX6DNo.js +0 -1
- package/dist/web/assets/dataParts-BImZKYEu.js +0 -3
- package/dist/web/assets/families-q4nF1Fqo.js +0 -1
- package/dist/web/assets/frame-eAHxqKfn.js +0 -4
- package/dist/web/assets/index-COTk3Bz-.js +0 -45
- package/dist/web/assets/index-DvuGI8X3.css +0 -2
- package/dist/web/assets/logos-DEPdha9g.js +0 -1
- package/dist/web/assets/parts-CVdJRIxI.js +0 -1
- package/dist/web/assets/productParts-CqY4Zs7J.js +0 -1
- package/dist/web/assets/qualityParts-BcrXEQ9B.js +0 -1
- package/dist/web/assets/segmented-BJECij_J.js +0 -1
- package/dist/web/assets/thread-Cuvu0HhP.js +0 -5
- package/dist/web/assets/usePageChat-Bz7fuynu.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ao as e,Bn as t,Ct as n,Io as r,Ka as i,Kn as a,Lt as o,Ma as s,Na as c,No as l,Nt as u,Pt as d,Qn as f,bo as p,dt as m,ga as h,gt as g,ja as _,ot as v,r as y,t as b,yi as x}from"./frame-eAHxqKfn.js";import{r as S}from"./index-COTk3Bz-.js";import{t as C}from"./segmented-BJECij_J.js";import{r as w}from"./families-q4nF1Fqo.js";import{_ as T,o as E}from"./qualityParts-BcrXEQ9B.js";var D=r(l(),1),O=e(),k={server:{label:`The server answered differently`,hint:`A call returned another status: likely a product or backend change, not the test. File it as a defect if the first run was right.`},locator:{label:`An element was not found`,hint:`The page likely changed under the test. If the change was intended, heal the test; if not, it is a product bug.`},navigation:{label:`It reached another page`,hint:`A redirect, a sign-in, a feature flag or the environment's settings may differ between the runs.`},path:{label:`It took another path`,hint:`The run did something else here: the flow changed, or the agent found another way through it.`},data:{label:`Same step, another outcome`,hint:`The step was the same but ended otherwise: the test data, the account or what the page held likely differs.`},timing:{label:`Only the timing differs`,hint:`A slow environment, or a wait that races the page: a likely cause of flaky failures.`},errors:{label:`New browser errors`,hint:`The page raised errors in the second run that it did not in the first.`},missing:{label:`A step only one run did`,hint:`One run has a step the other does not: a dialog, a retry or a changed flow.`}},A=e=>`${(e/1e3).toFixed(1)}s`,j=e=>`${e.goal.slice(0,80)} · ${e.status} · ${S(e.at)}`;function M(e,t){let n=e.find(e=>e.id===t),r=e.filter(e=>e.id!==t);if(!n)return{same:[],other:r};let i=n.goal.trim().toLowerCase();return{same:r.filter(e=>e.goal.trim().toLowerCase()===i),other:r.filter(e=>e.goal.trim().toLowerCase()!==i)}}function N({run:e,step:t}){let[n,r]=(0,D.useState)(``),[i,a]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{let n=!1;return r(``),a(!1),t?.shot&&p.shot(e,t.n,t.shot).then(e=>!n&&r(e),()=>!n&&a(!0)),()=>{n=!0}},[e,t?.n,t?.shot]),t?!t.shot||i?(0,O.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-3 py-6 text-center text-[12.5px] text-muted`,children:`No screenshot`}):n?(0,O.jsx)(`img`,{src:n,alt:`Step ${t.n} of ${e}`,className:`max-h-[420px] w-full rounded-[12px] border border-line-soft object-contain object-top`}):(0,O.jsx)(`div`,{className:`min-h-24 rounded-[12px] bg-surface-muted`}):(0,O.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-3 py-6 text-center text-[12.5px] text-muted`,children:`Not in this run`})}function P({step:e,other:t}){if(!e)return(0,O.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`Not in this run`});let n=e.ok?a:f,r=new Set((t?.calls??[]).map(e=>`${e.method} ${e.path} ${e.status}`)),i=t?e.calls.filter(e=>!r.has(`${e.method} ${e.path} ${e.status}`)):[];return(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,O.jsxs)(`span`,{className:`flex min-w-0 items-start gap-1.5`,children:[(0,O.jsx)(n,{size:14,"aria-label":e.ok?`Passed`:`Failed`,className:c(`mt-0.5 flex-none`,e.ok?`text-pass`:`text-fail`)}),(0,O.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:e.action||`–`})]}),(0,O.jsxs)(`span`,{className:`truncate text-[12px] text-muted`,"data-tip":e.title?`${e.title} · ${e.page}`:e.page,children:[e.page,typeof e.ms==`number`?` · ${A(e.ms)}`:``]}),e.error&&(0,O.jsx)(`span`,{className:`text-[12.5px] text-fail [overflow-wrap:anywhere]`,children:e.error}),i.slice(0,3).map(e=>(0,O.jsxs)(`span`,{className:c(`truncate font-mono text-[12px]`,e.status>=400||e.failed?`text-fail`:`text-muted`),"data-tip":`${e.method} ${e.path}`,children:[e.method,` `,e.path,` `,e.failed?`no answer`:e.status]},`${e.method} ${e.path}`)),e.problems.slice(0,2).map(e=>(0,O.jsx)(`span`,{className:`truncate text-[12px] text-warn`,"data-tip":e,children:e},e))]})}function F({row:e,i:n,a:r,b:i,focus:a,open:o,onToggle:s}){let l=e.a?.n,u=e.b?.n;return(0,O.jsxs)(`li`,{id:a?`look-here`:void 0,className:c(`border-t border-line-soft`,!e.same&&`bg-warn-soft/40`,a&&`outline-2 -outline-offset-2 outline-warn`),children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] items-start gap-3 px-3 py-2 text-[13px]`,children:[(0,O.jsx)(`span`,{className:`pt-0.5 text-muted tabular-nums`,"data-tip":l!==void 0&&u!==void 0&&l!==u?`Step ${l} of the first run, ${u} of the second`:void 0,children:l!==void 0&&u!==void 0&&l!==u?`${l}·${u}`:l??u??n+1}),(0,O.jsx)(P,{step:e.a,other:e.b}),(0,O.jsx)(P,{step:e.b,other:e.a}),(0,O.jsx)(_,{size:`sm`,variant:`icon`,"aria-label":o?`Hide screenshots`:`Show screenshots`,"aria-expanded":o,onClick:s,"data-tip":`Screenshots`,children:(0,O.jsx)(t,{"aria-hidden":`true`,className:c(`transition-transform`,o&&`rotate-180`)})})]}),!e.same&&(0,O.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-3 pb-2 pl-[3.75rem] text-[12.5px] text-ink-2`,children:[a&&e.kind&&(0,O.jsxs)(`span`,{className:`font-medium text-warn`,children:[`Look here first: `,k[e.kind].label]}),e.differences.map(e=>(0,O.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e},e))]}),(0,O.jsx)(d,{open:o,children:(0,O.jsxs)(`div`,{className:`grid grid-cols-1 items-start gap-3 px-3 pb-3 @2xl:grid-cols-2`,children:[(0,O.jsx)(N,{run:r,step:e.a}),(0,O.jsx)(N,{run:i,step:e.b})]})})]})}function I({runs:e,a:t,b:n}){let[r,i]=(0,D.useState)(t??``),[a,s]=(0,D.useState)(n??``);(0,D.useEffect)(()=>{i(t??``),s(n??``)},[t,n]);let{same:c,other:l}=M(e,r);return(0,O.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),r&&a&&r!==a&&(location.hash=o(`run-diff`,`${encodeURIComponent(r)}~${encodeURIComponent(a)}`))},children:[(0,O.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-[13px] font-medium`,children:[`First run (as expected)`,(0,O.jsxs)(m,{size:`sm`,value:r,onChange:e=>i(e.target.value),children:[(0,O.jsx)(`option`,{value:``,children:`Pick a run`}),e.map(e=>(0,O.jsx)(`option`,{value:e.id,children:j(e)},e.id))]})]}),(0,O.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-[13px] font-medium`,children:[`Second run`,(0,O.jsxs)(m,{size:`sm`,value:a,onChange:e=>s(e.target.value),disabled:!r,children:[(0,O.jsx)(`option`,{value:``,children:r?`Pick a run to compare`:`Pick the first run`}),c.length>0&&(0,O.jsx)(`optgroup`,{label:`Same test`,children:c.map(e=>(0,O.jsx)(`option`,{value:e.id,children:j(e)},e.id))}),(0,O.jsx)(`optgroup`,{label:c.length?`Other runs`:`Runs`,children:l.map(e=>(0,O.jsx)(`option`,{value:e.id,children:j(e)},e.id))})]})]}),(0,O.jsx)(_,{size:`sm`,variant:`primary`,type:`submit`,disabled:!r||!a||r===a,children:`Compare`})]})}function L({sub:e}){let[t,r]=(0,D.useState)(null),[a,l]=(0,D.useState)(null),[d,f]=(0,D.useState)(``),[m,S]=(0,D.useState)(`all`),[j,M]=(0,D.useState)(new Set),[N,P]=(0,D.useState)(``),[L,R]=(0,D.useMemo)(()=>{let t=(e?decodeURIComponent(e):``).split(`~`);return t.length===2&&t[0]&&t[1]?[t[0],t[1]]:[void 0,void 0]},[e]);(0,D.useEffect)(()=>{p.runs().then(e=>r(e.runs),e=>f(e.message))},[]),(0,D.useEffect)(()=>{let e=!1;if(l(null),P(``),L&&R)return p.diff(L,R).then(t=>{e||(l(t),f(``),M(new Set(t.focus===void 0?[]:[t.focus])))},t=>!e&&f(t.message)),()=>{e=!0}},[L,R]);let z=async()=>{if(a)try{let{id:e}=await i.start(`Compare the browser runs ${a.a.id} and ${a.b.id} in the reports folder, step by step (their steps.json, network.json and screenshots). Say where they first differ and whether that is a product bug, a test that needs healing, test data or the environment, and what to do next.`,{});location.hash=o(`chats`,e)}catch(e){P(e.message)}},B=a?.rows??[],V=B.map((e,t)=>({r:e,i:t})).filter(({r:e})=>m===`all`||!e.same),H=e=>e===void 0?void 0:B[e]?.b?.n??B[e]?.a?.n,U=H(a?.first),W=H(a?.focus);return(0,O.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,O.jsx)(y,{}),(0,O.jsxs)(`main`,{className:c(b,`@container max-w-[1320px] flex-auto gap-4`),children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,O.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(u,{pixel:n[`run-diff`],size:`lg`}),(0,O.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Run diff`})]}),(0,O.jsx)(C,{label:`Runs and reports`,links:w,current:`run-diff`})]}),(0,O.jsx)(`p`,{className:`m-0 max-w-[80ch] text-[13px] leading-relaxed text-ink-2`,children:`Two browser runs side by side, step by step: a run that passed and one that failed, the same test on two environments or devices, or a test before and after it was healed. Steps are lined up by page and action, and the first one that differs is marked with what it likely means.`}),d&&(0,O.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:d}),!t&&!d&&(0,O.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),t&&t.length<2&&(0,O.jsx)(g,{icon:h,title:`Two runs are needed`,action:(0,O.jsx)(`a`,{className:s({size:`sm`}),href:o(`record`),children:`Record a flow`}),children:`Every browser run keeps its steps in the reports folder. Run a flow from a chat or the Record page twice, or a test case on two environments, and compare them here.`}),t&&t.length>=2&&(0,O.jsx)(I,{runs:t,a:L,b:R}),L&&R&&!a&&!d&&(0,O.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Comparing…`}),a&&(0,O.jsxs)(`section`,{"aria-label":`Comparison`,className:`flex min-w-0 flex-col gap-3`,children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-3 @4xl:grid-cols-6 @4xl:divide-x @4xl:divide-line-soft`,children:[(0,O.jsx)(E,{label:`Verdict`,value:a.first===void 0?`Same`:`Differ`,tone:a.first===void 0?`text-pass`:`text-warn`,sub:a.first===void 0?`every step alike`:`from step ${U??`?`}`}),(0,O.jsx)(E,{label:`Steps differing`,value:a.counts.differing,tone:a.counts.differing?`text-warn`:void 0,sub:`of ${B.length} lined up`}),(0,O.jsx)(E,{label:`Steps`,value:`${a.a.steps} · ${a.b.steps}`,sub:`first · second`}),(0,O.jsx)(E,{label:`Time`,value:`${A(a.a.ms)} · ${A(a.b.ms)}`,sub:`first · second`}),(0,O.jsx)(E,{label:`Calls answered otherwise`,value:a.counts.calls,tone:a.counts.calls?`text-fail`:void 0,sub:`steps with a different status`}),(0,O.jsx)(E,{label:`New browser errors`,value:a.counts.errors,tone:a.counts.errors?`text-fail`:void 0,sub:`steps with new errors`})]}),(0,O.jsx)(`div`,{className:`grid grid-cols-1 gap-2 text-[13px] @2xl:grid-cols-2`,children:[a.a,a.b].map((e,t)=>(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,O.jsx)(`span`,{className:`text-[12px] text-muted`,children:t?`Second run`:`First run`}),(0,O.jsx)(`span`,{className:`truncate font-medium`,"data-tip":e.goal,children:e.goal}),(0,O.jsxs)(`span`,{className:`truncate text-[12.5px] text-muted`,"data-tip":e.startUrl??e.id,children:[e.status,` · `,T(e.at),` · `,e.host??e.id]})]},e.id))}),!a.sameGoal&&(0,O.jsx)(`p`,{className:`m-0 text-[12.5px] text-warn`,children:`These runs had different goals: they may not be the same test.`}),a.kind&&(0,O.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3 rounded-[12px] bg-warn-soft px-3 py-2.5 text-[13px]`,children:[(0,O.jsx)(h,{size:16,"aria-hidden":`true`,className:`mt-0.5 flex-none text-warn`}),(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-0.5`,children:[(0,O.jsxs)(`span`,{className:`font-medium`,children:[`Look at step `,W??`?`,` of the second run: `,k[a.kind].label]}),(0,O.jsx)(`span`,{className:`text-ink-2`,children:k[a.kind].hint}),a.first!==a.focus&&a.first!==void 0&&B[a.first]?.kind&&(0,O.jsxs)(`span`,{className:`text-ink-2`,children:[`They first differ at step `,U,`: `,k[B[a.first].kind].label.toLowerCase(),`.`]})]}),(0,O.jsx)(`a`,{href:`#look-here`,onClick:e=>(e.preventDefault(),document.getElementById(`look-here`)?.scrollIntoView({behavior:`smooth`,block:`center`})),className:`self-center text-[13px]`,children:`Go to it`})]}),(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,O.jsx)(v,{items:[{id:`all`,label:`All steps`,n:B.length},{id:`diff`,label:`Only differences`,n:a.counts.differing,alert:!0}],value:m,onChange:S})}),(0,O.jsxs)(_,{size:`sm`,variant:`ghost`,onClick:()=>void z(),className:`ml-auto`,children:[(0,O.jsx)(x,{"aria-hidden":`true`}),`Ask in a chat`]})]}),N&&(0,O.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:N}),(0,O.jsxs)(`div`,{className:`overflow-hidden rounded-[10px] border border-line`,children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] gap-3 bg-surface-muted px-3 py-1.5 text-[11.5px] text-muted`,children:[(0,O.jsx)(`span`,{children:`Step`}),(0,O.jsx)(`span`,{children:`First run`}),(0,O.jsx)(`span`,{children:`Second run`}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Screenshots`})]}),V.length?(0,O.jsx)(`ol`,{className:`m-0 list-none p-0`,children:V.map(({r:e,i:t})=>(0,O.jsx)(F,{row:e,i:t,a:a.a.id,b:a.b.id,focus:t===a.focus,open:j.has(t),onToggle:()=>{let e=new Set(j);e.has(t)?e.delete(t):e.add(t),M(e)}},t))}):(0,O.jsx)(`p`,{className:`m-0 border-t border-line-soft px-3 py-3 text-[13px] text-muted`,children:`Nothing differs.`})]})]})]})]})}export{k as KIND_TEXT,L as RunDiff,M as choicesFor};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Ao as e,Bi as t,Ca as n,Ct as r,Fn as i,Ft as a,Hn as o,Io as s,Jr as c,Ka as l,Ki as u,Kn as d,Lt as f,Ma as p,Mr as m,Na as h,Nn as g,No as _,Nt as v,Oa as y,On as b,Pa as x,Pr as S,Pt as C,Qn as w,R as T,Ri as E,Ur as D,br as O,ci as ee,dt as te,ea as ne,en as k,gn as A,gt as j,ht as M,ir as re,ja as N,jt as ie,lt as ae,mi as oe,na as se,oa as ce,ot as le,qn as ue,r as de,st as fe,t as pe,ua as me,vr as he,xn as ge,xo as P,yi as F}from"./frame-eAHxqKfn.js";import{c as I,i as L,r as _e,s as R}from"./index-COTk3Bz-.js";import{r as ve,t as ye}from"./Response-BtMM8nqx.js";import{i as be,r as xe,t as Se}from"./segmented-BJECij_J.js";import{a as Ce,c as we}from"./thread-Cuvu0HhP.js";import{r as Te}from"./families-q4nF1Fqo.js";var z=s(_(),1),B=e(),V={execution:`Execution`,report:`Report`,coding:`Coding`,chat:`Chat`},Ee={execution:S,report:O,coding:re,chat:F};function De({kind:e}){let t=Ee[e];return(0,B.jsx)(A,{icon:t,size:14,className:`flex-none text-muted`})}var Oe={passed:{label:`Passed`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},error:{label:`Error`,tone:`fail`},skipped:{label:`Skipped`,tone:`neutral`},stopped:{label:`Stopped`,tone:`neutral`},blocked:{label:`Blocked`,tone:`warn`}},H=e=>Oe[e]||{label:e?e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g,` `):`–`,tone:`neutral`},ke={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`App run`},Ae=e=>{if(!e)return``;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`};function U({title:e,icon:t,children:n,aside:r}){return(0,B.jsxs)(`section`,{className:`flex flex-col gap-3 border-t border-line-soft pt-6 first:border-t-0 first:pt-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`h3`,{className:`m-0 flex flex-1 items-center gap-2 text-base font-semibold`,children:[(0,B.jsx)(`span`,{className:`text-accent-fg`,children:t}),e]}),r]}),n]})}function je({path:e,label:t=`Open report`}){let[n,r]=(0,z.useState)(``);return(0,B.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(N,{onClick:async()=>r(await a(e)),children:[(0,B.jsx)(he,{"aria-hidden":`true`}),t]}),n&&(0,B.jsx)(`span`,{className:`text-[13px] text-fail`,children:n})]})}function Me({items:e,first:t,render:n}){let[r,i]=(0,z.useState)(!1);return(0,B.jsxs)(B.Fragment,{children:[(r?e:e.slice(0,t)).map(n),e.length>t&&(0,B.jsx)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>i(!r),className:`min-h-8 cursor-pointer self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:r?`Show fewer`:`Show all ${e.length}`})]})}function Ne({c:e}){if(!e.total)return null;let t=t=>`${t/e.total*100}%`;return(0,B.jsxs)(`div`,{role:`img`,"aria-label":`${e.passed} passed, ${e.failed} failed, ${e.other} other, of ${e.total}`,className:`flex h-2 overflow-hidden rounded-full bg-surface-strong`,children:[(0,B.jsx)(`div`,{className:`bg-pass transition-[width] duration-200 ease-out`,style:{width:t(e.passed)}}),(0,B.jsx)(`div`,{className:`bg-fail transition-[width] duration-200 ease-out`,style:{width:t(e.failed)}}),(0,B.jsx)(`div`,{className:`bg-warn transition-[width] duration-200 ease-out`,style:{width:t(e.other)}})]})}function Pe({e}){let t=e.counts.total?Math.round(e.counts.passed/e.counts.total*100):0;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-line-soft pt-3 first:border-t-0 first:pt-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,B.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:[ke[e.scope]||e.scope,Ae(e.ms),e.tokens?`${T(e.tokens)} tokens`:``,e.stopped?`stopped early`:``].filter(Boolean).join(` · `)})]}),e.report&&(0,B.jsx)(je,{path:e.report})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,B.jsxs)(`span`,{className:`text-[22px] font-semibold tabular-nums`,children:[t,`%`]}),(0,B.jsx)(`span`,{className:`text-muted`,children:`passed`}),(0,B.jsxs)(M,{tone:`pass`,children:[e.counts.passed,` passed`]}),e.counts.failed>0&&(0,B.jsxs)(M,{tone:`fail`,children:[e.counts.failed,` failed`]}),e.counts.other>0&&(0,B.jsxs)(M,{tone:`warn`,children:[e.counts.other,` other`]}),(0,B.jsxs)(`span`,{className:`text-muted`,children:[`of `,e.counts.total]})]}),(0,B.jsx)(Ne,{c:e.counts}),e.cases.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Cases of ${e.title}`,className:`m-0 flex list-none flex-col p-0`,children:(0,B.jsx)(Me,{items:[...e.cases].sort((e,t)=>Number(H(t.status).tone===`fail`)-Number(H(e.status).tone===`fail`)),first:6,render:(e,t)=>(0,B.jsxs)(`li`,{className:`flex min-w-0 items-start gap-3 border-t border-line-soft py-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`w-[76px] flex-none`,children:(0,B.jsx)(M,{tone:H(e.status).tone,children:H(e.status).label})}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,B.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[e.id&&(0,B.jsx)(`span`,{className:`mr-1.5 font-mono text-[12px] text-muted`,children:e.id}),e.title,e.device&&(0,B.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.device]})]}),e.summary&&(0,B.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted`,children:e.summary})]}),(0,B.jsx)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:Ae(e.ms)})]},`${e.id}-${t}`)})}),e.folder&&!e.report&&(0,B.jsxs)(`span`,{className:`text-sm`,children:[`Kept in `,(0,B.jsx)(R,{path:e.folder})]})]})}function Fe({list:e}){let t=e.reduce((e,t)=>({total:e.total+t.counts.total,passed:e.passed+t.counts.passed,failed:e.failed+t.counts.failed}),{total:0,passed:0,failed:0});return(0,B.jsx)(U,{title:`Execution summary`,icon:(0,B.jsx)(A,{icon:S,size:18}),aside:e.length>1?(0,B.jsxs)(`span`,{className:`text-sm text-muted`,children:[x(e.length,`run`),` · `,t.passed,` of `,t.total,` passed`]}):void 0,children:e.length?e.map((e,t)=>(0,B.jsx)(Pe,{e},`${e.folder||e.title}-${t}`)):(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No results found for this run yet: they appear once its report is written.`})})}function Ie({list:e}){return(0,B.jsxs)(U,{title:`Report summary`,icon:(0,B.jsx)(A,{icon:O,size:18}),children:[e.length===0&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No report was written in this run.`}),e.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-line-soft pt-3 first:border-t-0 first:pt-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,B.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.builtAt?`Written ${new Date(e.builtAt).toLocaleString([],{dateStyle:`medium`,timeStyle:`short`})}`:e.path?``:`Its page is not there any more`})]}),e.path&&(0,B.jsx)(je,{path:e.path})]}),e.stats&&(0,B.jsx)(`dl`,{className:`m-0 grid grid-cols-[repeat(auto-fit,minmax(110px,1fr))] gap-2`,children:e.stats.map(e=>(0,B.jsxs)(`div`,{className:`rounded-[10px] bg-surface-muted px-3 py-2`,children:[(0,B.jsx)(`dt`,{className:`text-[12px] text-muted`,children:e.label}),(0,B.jsx)(`dd`,{className:`m-0 text-[18px] font-semibold tabular-nums`,children:e.value})]},e.label))}),e.markdown&&(0,B.jsx)(Le,{text:e.markdown})]},`${e.path||e.title}-${t}`))]})}function Le({text:e,height:t=220}){let[n,r]=(0,z.useState)(!1),[i,a]=(0,z.useState)(!0),[o,s]=(0,z.useState)(t),c=(0,z.useRef)(null);return(0,z.useLayoutEffect)(()=>{c.current&&!n&&a(c.current.scrollHeight>t+8)},[e,t,n]),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsxs)(`div`,{ref:c,style:o===void 0?void 0:{maxHeight:o},onTransitionEnd:e=>e.target===e.currentTarget&&n&&s(void 0),className:h(`transition-[max-height] duration-200 ease-[cubic-bezier(0.2,0.7,0.2,1)]`,o!==void 0&&`relative overflow-hidden`),children:[(0,B.jsx)(I,{text:e,className:`text-sm`}),!n&&i&&(0,B.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-bg to-transparent`})]}),(n||i)&&(0,B.jsx)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>{let e=c.current?.scrollHeight??t;if(r(!n),ie())return s(n?t:void 0);s(e),n&&requestAnimationFrame(()=>requestAnimationFrame(()=>s(t)))},className:`min-h-8 cursor-pointer self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:n?`Show less`:`Show all of it`})]})}function Re(e){let t=e.join(`
|
|
2
|
-
`),n=Math.max(2,...(t.match(/`+/g)||[]).map(e=>e.length)),r="`".repeat(n+1);return`${r}diff\n${t}\n${r}`}function ze({e}){let[t,n]=(0,z.useState)(!1),r=e.action===`write`?`New`:`Edited`;return(0,B.jsxs)(`li`,{className:`border-t border-line-soft`,children:[(0,B.jsxs)(`div`,{className:`flex min-h-[44px] min-w-0 items-center gap-2 py-1.5 text-sm`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} the diff of ${e.path}`,disabled:!e.diffs.length,onClick:()=>n(!t),className:`inline-flex size-8 flex-none cursor-pointer items-center justify-center rounded-lg border-0 bg-transparent text-muted hover:bg-surface-strong disabled:cursor-default disabled:opacity-40`,children:(0,B.jsx)(o,{size:16,"aria-hidden":`true`,className:h(`transition-transform duration-200`,t&&`rotate-90`)})}),(0,B.jsx)(`span`,{className:`w-[52px] flex-none text-[12px] text-muted`,children:r}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,B.jsx)(R,{path:e.path})}),(0,B.jsxs)(`span`,{className:`flex-none font-mono text-[12px] tabular-nums`,children:[(0,B.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,B.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,B.jsx)(C,{open:t,className:`pb-3 pl-10 [&_pre]:max-h-[420px] [&_pre]:overflow-auto`,children:e.diffs.length?(0,B.jsx)(I,{text:Re(e.diffs)}):null})]})}var Be={write:`New`,edit:`Edited`,delete:`Deleted`,"test written":`Test`};function W({label:e,children:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{className:`pt-0.5 text-[13px] text-muted`,children:e}),(0,B.jsx)(`dd`,{className:`m-0 min-w-0 text-sm [overflow-wrap:anywhere]`,children:t})]})}function Ve({c:e,files:t}){let n=e.edits.reduce((e,t)=>e+t.added,0),r=e.edits.reduce((e,t)=>e+t.removed,0),i=e.tests.filter(e=>!e.ok).length,a=e.reviews.at(-1),o=e.edits.length?[]:t.filter(e=>e.action&&e.action!==`read`);return(0,B.jsxs)(U,{title:`Code changes`,icon:(0,B.jsx)(A,{icon:re,size:18}),aside:e.edits.length?(0,B.jsxs)(`span`,{className:`font-mono text-[13px] tabular-nums`,children:[x(e.edits.length,`file`),` · `,(0,B.jsxs)(`span`,{className:`text-pass`,children:[`+`,n]}),` `,(0,B.jsxs)(`span`,{className:`text-fail`,children:[`−`,r]})]}):o.length?(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:x(o.length,`file`)}):void 0,children:[e.results.map((t,n)=>{let r=t.status===`passed`||t.status===`done`,o=t.status===`error`||t.status===`failed`;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-line-soft pb-4 last:border-b-0 last:pb-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,B.jsx)(S,{size:17,strokeWidth:2,"aria-hidden":`true`,className:r?`text-pass`:o?`text-fail`:`text-warn`}),(0,B.jsx)(`span`,{className:`text-[15px] font-semibold`,children:r?`Test written`:o?`Test not finished`:H(t.status).label}),(0,B.jsx)(M,{tone:r?`pass`:o?`fail`:`warn`,children:H(t.status).label}),e.tests.length>0&&(0,B.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[x(e.tests.length,`test run`),i?` (${i} failed)`:``,e.reviews.length?` · ${x(e.reviews.length,`review`)}`:``]})]}),(0,B.jsxs)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-5 gap-y-1 sm:grid-cols-[110px_minmax(0,1fr)] sm:gap-y-3`,children:[t.testFile&&(0,B.jsx)(W,{label:`Test`,children:(0,B.jsx)(R,{path:t.testFile})}),t.command&&(0,B.jsx)(W,{label:`Run it`,children:(0,B.jsx)(ve,{text:t.command})}),(t.review||a)&&(0,B.jsx)(W,{label:`Review`,children:(0,B.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)(M,{tone:(t.review??a).approved?`pass`:`warn`,children:(t.review??a).approved?`Approved`:`Changes asked`})}),(t.review?.summary||a?.summary)&&(0,B.jsx)(`span`,{className:`text-ink-2`,children:t.review?.summary||a?.summary})]})}),t.notes&&(0,B.jsx)(W,{label:`Notes`,children:(0,B.jsx)(I,{text:t.notes,className:`text-sm text-ink-2 [&_p]:my-0 [&_p+p]:mt-2`})})]}),t.error&&(0,B.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:t.error})]},n)}),e.edits.length>0&&(0,B.jsxs)(`div`,{className:`flex flex-col`,children:[(0,B.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,B.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:(0,B.jsx)(Me,{items:e.edits,first:8,render:e=>(0,B.jsx)(ze,{e},e.path)})})]}),o.length>0&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,B.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:o.map(e=>(0,B.jsxs)(`li`,{className:`flex min-h-9 min-w-0 items-center gap-3 border-t border-line-soft text-sm first:border-t-0`,children:[(0,B.jsx)(`span`,{className:`w-[52px] flex-none text-[12px] text-muted`,children:Be[e.action]||e.action.charAt(0).toUpperCase()+e.action.slice(1)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,B.jsx)(R,{path:e.path})})]},e.path))}),(0,B.jsx)(`p`,{className:`m-0 text-[12.5px] text-muted`,children:`Their diffs were not kept for this run.`})]}),!e.edits.length&&!o.length&&!e.results.length&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No files changed.`}),e.edits.some(e=>!e.diffs.length)&&(0,B.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`A file without a diff was changed before ForgeQE kept diffs, or is a hidden or credential file, whose text is not kept.`})]})}function He({final:e,answer:t}){let n=e.from===`agent`?t?.files??[]:[],r=e.from!==`agent`,i=Math.max(2,...(e.text.match(/`+/g)||[]).map(e=>e.length)),a="`".repeat(i+1);return(0,B.jsxs)(U,{title:`Final message`,icon:(0,B.jsx)(m,{size:18,"aria-hidden":`true`}),aside:(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.from===`agent`?`The agent's last reply`:e.from===`job`?`The end of the job's output`:`What the command said at the end`}),children:[(0,B.jsx)(Le,{text:r?`${a}text\n${e.text}\n${a}`:we(e.text),height:420}),n.length>0&&(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`text-muted`,children:`Files it names:`}),n.map(e=>(0,B.jsx)(R,{path:e},e))]})]})}var Ue={rule:{icon:b,label:`Rulebook`},decision:{icon:D,label:`Test decisions`},memory:{icon:g,label:`Page memory`},replay:{icon:E,label:`Replays`},model:{icon:ne,label:`Model`},skill:{icon:c,label:`Skills`}};function We({list:e}){let t=Object.keys(Ue).filter(t=>e.some(e=>e.kind===t));return(0,B.jsx)(U,{title:`Learnings`,icon:(0,B.jsx)(A,{icon:ee,size:18}),aside:e.length?(0,B.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[e.length,` from this session`]}):void 0,children:e.length===0?(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing learned or decided in this session: no rules, test decisions, page memory or model switches in its log.`}):(0,B.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(280px,1fr))] gap-x-6 gap-y-3`,children:t.map(t=>{let{icon:n,label:r}=Ue[t];return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,B.jsxs)(`h4`,{className:`m-0 flex items-center gap-1.5 text-[13px] font-medium text-muted`,children:[(0,B.jsx)(A,{icon:n,size:14}),r]}),(0,B.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.filter(e=>e.kind===t).map((e,t)=>(0,B.jsxs)(`li`,{className:`flex flex-col gap-0.5 border-t border-line-soft py-1.5 text-sm first:border-t-0`,children:[(0,B.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.text}),e.note&&(0,B.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.note})]},t))})]},t)})})})}function Ge({run:e}){let t=[];return(e.executions.length||e.kind===`execution`)&&t.push({kind:`execution`,node:(0,B.jsx)(Fe,{list:e.executions},`e`)}),(e.reports.length||e.kind===`report`)&&t.push({kind:`report`,node:(0,B.jsx)(Ie,{list:e.reports},`r`)}),e.coding&&(e.coding.edits.length||e.coding.results.length||e.kind===`coding`)&&t.push({kind:`coding`,node:(0,B.jsx)(Ve,{c:e.coding,files:e.files},`c`)}),t.sort((t,n)=>Number(n.kind===e.kind)-Number(t.kind===e.kind)),(0,B.jsx)(B.Fragment,{children:t.map(e=>e.node)})}var Ke={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`}},qe={chat:`Chat`,suite:`Suite`,monitor:`Monitor`,run:`Browser run`,start:`Chat`,heal:`Heal`,"pr-tests":`PR tests`,pack:`Pack`,pipeline:`Pipeline watch`,explore:`Explore`,api:`API tests`,generate:`Generate`,jobs:`Jobs service`},Je=e=>qe[e]||e.charAt(0).toUpperCase()+e.slice(1),G=e=>{if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,...t.getFullYear()===new Date().getFullYear()?{}:{year:`numeric`},hour:`numeric`,minute:`2-digit`})},K=(e,t)=>Math.max(0,Math.round(((e.status===`running`?t:Date.parse(e.lastAt))-Date.parse(e.startedAt))/1e3)),q=e=>Number.isFinite(e)?e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m ${e%60}s`:`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`:`–`,J=e=>e.usage.input+e.usage.output;function Y(e){let[t,n]=(0,z.useState)(Date.now());return(0,z.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function Ye({r:e}){return e.origin.kind===`web`?(0,B.jsxs)(`a`,{href:f(`chats`,e.origin.chat),className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(A,{icon:F,size:14}),`Web chat`]}):e.origin.kind===`job`?(0,B.jsxs)(`a`,{href:f(`jobs`,encodeURIComponent(e.origin.job)),className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(A,{icon:i,size:14}),`Job`]}):(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-muted`,children:[(0,B.jsx)(A,{icon:me,size:14}),`Terminal`]})}function Xe({status:e}){let t=Ke[e].label;return e===`running`?(0,B.jsx)(oe,{size:16,"aria-label":t,className:`flex-none animate-spin text-accent-fg`}):e===`done`?(0,B.jsx)(d,{size:16,"aria-label":t,className:`flex-none text-pass`}):e===`failed`?(0,B.jsx)(w,{size:16,"aria-label":t,className:`flex-none text-fail`}):(0,B.jsx)(ue,{size:16,"aria-label":t,className:`flex-none text-muted`})}var X=e=>e.status!==`running`&&!e.tools&&!e.turns&&!J(e)&&!e.files.length&&!e.outputs.length&&K(e,0)<2;function Ze(e){return/^forgeqe(-|$)|^engine$/.test(e)?k(e).name:e&&e.charAt(0).toUpperCase()+e.slice(1)}function Z({label:e,children:t}){return(0,B.jsxs)(`div`,{className:`grid grid-cols-[120px_minmax(0,1fr)] items-baseline gap-3 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,B.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:t})]})}function Q({title:e,children:t}){return(0,B.jsxs)(`section`,{className:`flex min-w-0 flex-col`,children:[(0,B.jsx)(`h3`,{className:`m-0 mb-1 text-[14px] font-semibold`,children:e}),t]})}var Qe={rerun:t,write_test:n,investigate:u,fix_test:y};function $e({actions:e}){let[t,n]=(0,z.useState)(``),[r,i]=(0,z.useState)(``);if(!e.length)return null;let a=async e=>{n(e.prompt),i(``);try{let{id:t}=await l.start(e.prompt,{});location.hash=f(`chats`,t)}catch(e){i(e.message),n(``)}};return(0,B.jsxs)(`section`,{"aria-label":`Next steps`,className:`flex flex-col gap-2`,children:[(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map((e,n)=>(0,B.jsxs)(N,{disabled:!!t,onClick:()=>void a(e),"data-tip":e.note||void 0,className:`max-w-full min-w-0`,children:[(0,B.jsx)(A,{icon:Qe[e.kind],size:16,className:`flex-none`}),(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:t===e.prompt?`Opening a chat…`:e.label}),e.note&&(0,B.jsx)(`span`,{className:`min-w-0 flex-[1_1_0] truncate font-normal text-ink-2`,children:e.note})]},n))}),(0,B.jsx)(`span`,{className:`text-[12px] text-muted`,children:`Each opens a chat with the request; it asks before it changes anything.`}),r&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:r})]})}var et=e=>`\`${e.replace(/`/g,``)}\``,tt=[`summary`,`conversation`,`activity`,`details`],nt=e=>tt.find(t=>t===e)??`summary`;function rt({name:e,tab:t}){let[n,r]=(0,z.useState)(null),[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(!1),c=nt(t),l=t=>location.hash=t===`summary`?f(`runs`,encodeURIComponent(e)):f(`runs`,encodeURIComponent(e),t),u=(0,z.useCallback)(()=>{P.detail(e).then(e=>{r(e),a(``)},e=>a(e.message))},[e]);(0,z.useEffect)(u,[u]);let d=n?.status===`running`;(0,z.useEffect)(()=>{if(!d)return;let e=setInterval(u,2e3);return()=>clearInterval(e)},[u,d]);let p=Y(d),m=(0,z.useMemo)(()=>(n?.events??[]).map(Ce).filter(e=>!!e),[n?.events]),h=async()=>{s(!0),a(``);try{await P.cancel(e),u()}catch(e){a(e.message)}finally{s(!1)}},g=(0,B.jsxs)(`a`,{href:f(`runs`),className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,B.jsx)(ge,{size:16,"aria-hidden":`true`}),`All runs`]});if(!n)return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[g,i?(0,B.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:i}):(0,B.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})]});let _=Ke[n.status],v=!n.replies.length,y=!!n.final||n.executions.length>0||n.reports.length>0||!!(n.coding&&(n.coding.edits.length||n.coding.results.length))||n.learnings.length>0||n.outputs.length>0,b=[{id:`summary`,label:`Summary`},{id:`conversation`,label:v?`Command`:`Conversation`,n:n.replies.length||void 0},{id:`activity`,label:`Activity`,n:m.length||void 0},{id:`details`,label:`Details`}],S=new Set([...n.reports.map(e=>e.path),...n.executions.flatMap(e=>[e.report,e.folder])].filter(Boolean)),C=n.outputs.filter(e=>!S.has(e.path)),w=n.context?.limit?Math.round(n.context.tokens/n.context.limit*100):null;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[g,(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-3`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,B.jsx)(`h2`,{className:`m-0 min-w-0 text-[22px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:n.title}),(0,B.jsx)(M,{tone:_.tone,children:_.label})]}),(0,B.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-muted`,children:[(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(De,{kind:n.kind}),V[n.kind]]}),`· `,(0,B.jsx)(Ye,{r:n}),`· `,G(n.startedAt),` · `,d?`running for `:`took `,q(K(n,p)),` · `,T(J(n)),` tokens`,n.profile?.model?` · ${n.profile.model}`:``]})]}),n.cancel&&(0,B.jsxs)(N,{variant:`danger`,disabled:o,onClick:()=>void h(),children:[(0,B.jsx)(se,{fill:`currentColor`,"aria-hidden":`true`}),o?`Stopping…`:n.cancel===`chat`?`Stop this chat's work`:`Cancel this job's run`]})]}),i&&(0,B.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}),n.error&&(0,B.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[(0,B.jsx)(`strong`,{children:`What went wrong:`}),` `,n.error]}),!d&&(0,B.jsx)($e,{actions:n.actions??[]}),(0,B.jsx)(`div`,{role:`tablist`,"aria-label":`This run`,className:xe,children:b.map(e=>(0,B.jsxs)(`button`,{type:`button`,role:`tab`,id:`run-tab-${e.id}`,"aria-selected":c===e.id,"aria-controls":`run-panel-${e.id}`,onClick:()=>l(e.id),className:be(c===e.id),children:[e.label,e.n!==void 0&&(0,B.jsx)(`span`,{className:`text-[12px] text-muted tabular-nums`,children:e.n})]},e.id))}),(0,B.jsxs)(`div`,{role:`tabpanel`,id:`run-panel-${c}`,"aria-labelledby":`run-tab-${c}`,className:`flex min-w-0 flex-col gap-6`,children:[c===`summary`&&(0,B.jsxs)(B.Fragment,{children:[n.final&&(0,B.jsx)(He,{final:n.final,answer:n.answer}),(0,B.jsx)(Ge,{run:n}),C.length>0&&(0,B.jsx)(Q,{title:`What it produced (${C.length})`,children:C.map(e=>(0,B.jsx)(Z,{label:e.label,children:(0,B.jsx)(R,{path:e.path})},e.path))}),n.learnings.length>0&&(0,B.jsx)(We,{list:n.learnings}),!y&&(0,B.jsx)(j,{className:`py-4`,children:d?`Still working: its answer and what it produces show here when it ends.`:`This run left no answer, results or files. Its Activity shows what it did.`})]}),c===`conversation`&&(v?(0,B.jsx)(I,{text:et(n.prompt),className:`text-sm [&_p]:my-0`}):(0,B.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:n.replies.map((e,t)=>(0,B.jsxs)(`li`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`div`,{className:`self-end rounded-[14px] bg-surface-strong px-4 py-2.5 text-sm max-w-[85%]`,children:(0,B.jsx)(I,{text:e.ask,className:`[&_p]:my-0.5`})}),e.text&&(0,B.jsx)(I,{text:we(e.text),className:`text-sm`}),e.error&&(0,B.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e.error})]},t))})),c===`activity`&&(n.archived?(0,B.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-3 text-sm text-ink-2`,children:[`ForgeQE keeps the newest session logs only, and this run's is gone. Its summary, final message and learnings were kept in `,(0,B.jsx)(`code`,{className:`font-mono text-[13px]`,children:`.forgeqe/runs`}),`; its step-by-step activity was not.`]}):m.length?(0,B.jsx)(ye,{timeline:!0,lines:m,start:n.startedAt,live:d,name:`forgeqe-run-${n.name.replace(/\.log$/,``)}.md`}):(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing logged yet.`})),c===`details`&&(0,B.jsxs)(`div`,{className:`grid items-start gap-x-12 gap-y-8 @3xl:grid-cols-2`,children:[(0,B.jsxs)(Q,{title:`Numbers`,children:[(0,B.jsx)(Z,{label:d?`Running for`:`Took`,children:q(K(n,p))}),(0,B.jsx)(Z,{label:`Tokens`,children:(0,B.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,B.jsxs)(`span`,{children:[T(J(n)),` `,(0,B.jsxs)(`span`,{className:`text-muted`,children:[`· `,T(n.usage.input),` read · `,T(n.usage.output),` written`,n.usage.cached?` · ${T(n.usage.cached)} cached`:``]})]}),(n.byAgent?.length??0)>1&&(0,B.jsx)(`span`,{className:`flex flex-col gap-0.5 text-[13px]`,children:n.byAgent.map(e=>(0,B.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-2`,children:Ze(e.agent)}),(0,B.jsx)(`span`,{className:`text-muted tabular-nums`,children:T(e.input+e.output)})]},e.agent))})]})}),(0,B.jsxs)(Z,{label:`Context`,children:[n.context?T(n.context.tokens):`–`,w!==null&&(0,B.jsxs)(`span`,{className:`text-muted`,children:[` of `,T(n.context.limit),` (`,w,`%)`]})]}),(0,B.jsxs)(Z,{label:`Tool calls`,children:[n.tools,` `,(0,B.jsxs)(`span`,{className:`text-muted`,children:[`in `,x(n.turns,`turn`)]})]})]}),(0,B.jsxs)(Q,{title:`Session`,children:[(0,B.jsx)(Z,{label:`Started by`,children:(0,B.jsx)(Ye,{r:n})}),(0,B.jsx)(Z,{label:`Command`,children:Je(n.command)}),(0,B.jsx)(Z,{label:`Model`,children:n.profile?[n.profile.name,n.profile.model].filter(Boolean).join(` · `):`–`}),(0,B.jsx)(Z,{label:`Agents`,children:n.agents.length?(0,B.jsx)(`span`,{className:`flex flex-col gap-0.5`,children:n.agents.map(e=>(0,B.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:Ze(e.name)}),(0,B.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:x(e.calls,`call`)})]},e.name))}):(0,B.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,B.jsxs)(Z,{label:`Log`,children:[n.archived?(0,B.jsx)(`span`,{className:`text-muted`,children:`No longer kept: ForgeQE keeps the newest logs only`}):(0,B.jsx)(R,{path:`.forgeqe/logs/${n.name}`}),n.truncated&&(0,B.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Very long: only its start is shown.`})]})]}),n.job&&(0,B.jsxs)(Q,{title:`Job`,children:[(0,B.jsx)(Z,{label:`Job`,children:(0,B.jsx)(`a`,{href:f(`jobs`,encodeURIComponent(n.origin.kind===`job`?n.origin.job:n.job.name)),children:n.job.name})}),(0,B.jsx)(Z,{label:`Runs`,children:(0,B.jsx)(I,{text:et(n.job.command),className:`text-sm [&_p]:my-0`})}),(0,B.jsxs)(Z,{label:`Schedule`,children:[n.job.schedule,!n.job.enabled&&` (disabled)`,n.job.nextAt&&n.job.enabled?` · next ${G(n.job.nextAt)}`:``]}),n.job.run&&(0,B.jsxs)(Z,{label:`This run`,children:[n.job.run.reason===`asked`?`Asked for`:`On schedule`,`, `,n.job.run.status.replace(`_`,` `),n.job.run.exitCode!==void 0&&n.job.run.exitCode!==null?`, exit ${n.job.run.exitCode}`:``]})]}),(0,B.jsx)(Q,{title:`Files worked on (${n.files.length})`,children:n.files.length?[...n.files].sort((e,t)=>Number(e.action===`read`)-Number(t.action===`read`)).map(e=>(0,B.jsx)(Z,{label:e.action===`write`?`Written`:e.action===`edit`?`Edited`:e.action===`delete`?`Deleted`:e.action?e.action.charAt(0).toUpperCase()+e.action.slice(1):`Changed`,children:e.action===`delete`?(0,B.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.path}):(0,B.jsx)(R,{path:e.path})},e.path)):(0,B.jsx)(`p`,{className:`m-0 py-1 text-sm text-muted`,children:`No files changed.`})}),(0,B.jsx)(Q,{title:`Notifications`,children:n.notifications.length?n.notifications.map(e=>(0,B.jsx)(Z,{label:e.event.replace(/_/g,` `),children:e.channels.length?e.channels.join(`, `):(0,B.jsx)(`span`,{className:`text-muted`,children:`No channel takes it`})},e.event)):(0,B.jsx)(`p`,{className:`m-0 py-1 text-sm text-muted`,children:n.origin.kind===`terminal`||n.origin.kind===`web`?`None: notify channels go with jobs, suites and the monitor.`:`No notify channels are set up (Settings, Notify).`})})]})]})]})}var $=25;function it({runs:e}){let t=Y(e.some(e=>e.status===`running`)),[n,r]=(0,z.useState)(``),[i,a]=(0,z.useState)(`all`),[o,s]=(0,z.useState)(``),[c,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(!1),[m,g]=(0,z.useState)(0);(0,z.useEffect)(()=>g(0),[n,i,o,c,u]);let _=e.filter(X).length,v=n.toLowerCase().split(/\s+/).filter(Boolean),y=e.filter(e=>(u||!X(e))&&(!o||e.kind===o)&&(!c||e.origin.kind===c)&&v.every(t=>`${e.title} ${e.command} ${e.error||``}`.toLowerCase().includes(t))),b={all:y.length,running:y.filter(e=>e.status===`running`).length,failed:y.filter(e=>e.status===`failed`).length},S=i===`all`?y:y.filter(e=>e.status===i),C=Math.max(1,Math.ceil(S.length/$)),w=Math.min(m,C-1),E=S.slice(w*$,w*$+$),D=e.filter(e=>e.status!==`running`&&!X(e)),O=D.filter(e=>e.status===`failed`).length,ee=D.length?D.reduce((e,n)=>e+K(n,t),0)/D.length:NaN,ne=e.reduce((e,t)=>e+J(t),0),k=[...new Set(e.map(e=>e.kind))],A=[...new Set(e.map(e=>e.origin.kind))],M={web:`Web chat`,job:`Job`,terminal:`Terminal`};return e.length===0?(0,B.jsx)(j,{icon:ce,title:`No runs yet`,action:(0,B.jsx)(`a`,{className:p({size:`sm`}),href:f(),children:`Start a chat`}),children:`A chat here, a job, or a ForgeQE command in this project adds one.`}):(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-1 text-[13px] text-muted`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-ink tabular-nums`,children:e.length-_}),` runs`]}),e.some(e=>e.status===`running`)&&(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-accent-fg tabular-nums`,children:e.filter(e=>e.status===`running`).length}),` running now`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:h(`tabular-nums`,O?`text-fail`:`text-ink`),children:O}),` failed`,D.length?` (${Math.round(O/D.length*100)}%)`:``]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-ink tabular-nums`,children:T(ne)}),` tokens`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-ink tabular-nums`,children:q(Math.round(ee))}),` on average`]})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(ae,{id:`run-search`,label:`Find a run`,value:n,onChange:r,placeholder:`Find a run by what was asked`}),(0,B.jsx)(le,{items:[{id:`all`,label:`All`,n:b.all},{id:`running`,label:`Running`,n:b.running},{id:`failed`,label:`Failed`,n:b.failed,alert:!0}],value:i,onChange:a}),k.length>1&&(0,B.jsxs)(te,{size:`sm`,"aria-label":`What it did`,value:o,onChange:e=>s(e.target.value),className:`w-auto pr-7 pl-3`,children:[(0,B.jsx)(`option`,{value:``,children:`Any kind`}),k.map(e=>(0,B.jsx)(`option`,{value:e,children:V[e]},e))]}),A.length>1&&(0,B.jsxs)(te,{size:`sm`,"aria-label":`Started by`,value:c,onChange:e=>l(e.target.value),className:`w-auto pr-7 pl-3`,children:[(0,B.jsx)(`option`,{value:``,children:`Started anywhere`}),A.map(e=>(0,B.jsx)(`option`,{value:e,children:M[e]||e},e))]})]}),(0,B.jsxs)(`div`,{className:`rounded-[14px] card border`,children:[(0,B.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[auto_minmax(0,1fr)_104px_104px_72px_64px_92px] items-center gap-x-4 border-b border-line-soft px-4 py-2 text-[12px] font-semibold text-muted @3xl:grid`,children:[(0,B.jsx)(`span`,{className:`w-4`}),(0,B.jsx)(`span`,{children:`Run`}),(0,B.jsx)(`span`,{children:`Kind`}),(0,B.jsx)(`span`,{children:`Started by`}),(0,B.jsx)(`span`,{className:`text-right`,children:`Took`}),(0,B.jsx)(`span`,{className:`text-right`,children:`Tokens`}),(0,B.jsx)(`span`,{className:`text-right`,children:`When`})]}),(0,B.jsxs)(`ul`,{"aria-label":`Runs`,className:`m-0 list-none p-1.5`,children:[E.length===0&&(0,B.jsx)(`li`,{className:`px-3 py-4 text-sm text-muted`,children:`Nothing matches.`}),E.map((e,n)=>{let r=L(e.startedAt);return(0,B.jsxs)(`li`,{className:`contents`,children:[(n===0||L(E[n-1].startedAt)!==r)&&(0,B.jsx)(`span`,{className:`block px-3 pt-3 pb-1 text-[12px] font-semibold text-muted`,children:r}),(0,B.jsxs)(`a`,{href:f(`runs`,encodeURIComponent(e.name)),className:`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 rounded-[10px] px-3 py-1.5 text-ink no-underline hover:bg-surface-muted hover:text-ink @3xl:grid-cols-[auto_minmax(0,1fr)_104px_104px_72px_64px_92px] @3xl:gap-x-4`,children:[(0,B.jsx)(Xe,{status:e.status}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,B.jsx)(`span`,{className:`truncate text-[14px] font-medium`,"data-tip":e.title,children:e.title}),e.error?(0,B.jsx)(`span`,{className:`truncate text-[12px] text-fail`,children:e.error}):(0,B.jsx)(`span`,{className:`truncate text-[12px] text-muted @3xl:hidden`,children:[V[e.kind],M[e.origin.kind],q(K(e,t)),`${T(J(e))} tokens`].join(` · `)})]}),(0,B.jsxs)(`span`,{className:`hidden min-w-0 items-center gap-1.5 text-[13px] text-ink-2 @3xl:inline-flex`,children:[(0,B.jsx)(De,{kind:e.kind}),V[e.kind]]}),(0,B.jsx)(`span`,{className:`hidden text-[13px] text-ink-2 @3xl:block`,children:M[e.origin.kind]||e.origin.kind}),(0,B.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:q(K(e,t))}),(0,B.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:T(J(e))}),(0,B.jsx)(`span`,{className:`text-right text-[12.5px] text-muted tabular-nums`,"data-tip":G(e.startedAt),children:_e(e.startedAt)})]})]},e.name)})]}),(0,B.jsx)(fe,{page:w,size:$,total:S.length,onPage:g,label:`Pages of runs`,children:_>0&&(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`button`,{type:`button`,onClick:()=>d(!u),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:u?`Hide the ${x(_,`empty session`)}`:`${x(_,`empty session`)} hidden`})]})})]})]})}function at({sub:e}){let[t,n]=(0,z.useState)(null),[i,a]=(0,z.useState)(``),o=(0,z.useCallback)(()=>{P.list().then(e=>{n(e.runs),a(``)},e=>a(e.message))},[]);(0,z.useEffect)(o,[o]);let s=t?.some(e=>e.status===`running`);(0,z.useEffect)(()=>{if(e)return;let t=setInterval(o,s?3e3:2e4);return()=>clearInterval(t)},[o,s,e]);let[c,l]=(e||``).split(`/`),u=c?decodeURIComponent(c):``;return(0,B.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,B.jsx)(de,{}),(0,B.jsx)(`main`,{className:h(pe,`@container flex-auto gap-4`),children:u?(0,B.jsx)(rt,{name:u,tab:l},u):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(v,{pixel:r.runs,size:`lg`}),(0,B.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Runs`})]}),(0,B.jsx)(Se,{label:`Runs and reports`,links:Te,current:`runs`})]}),(0,B.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`Every ForgeQE session in this project: chats here, jobs' runs, and commands typed in a terminal, newest first. Open one for how it went and what it produced.`}),i&&(0,B.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}),!t&&!i&&(0,B.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,B.jsx)(it,{runs:t})]})})]})}export{at as Runs,Xe as StatusIcon,nt as runTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,$n as t,Ao as n,Ct as r,Eo as i,Io as a,Lt as o,Na as s,No as c,Nt as l,Va as u,Zr as d,di as f,et as p,ga as m,gn as h,gt as g,it as _,ja as v,nt as y,ot as b,r as x,t as S,ui as C,ut as w,vr as T}from"./frame-eAHxqKfn.js";import{d as E,r as D}from"./index-COTk3Bz-.js";var O=a(c(),1),k=n(),A=[{id:`azure_devops`,label:`Azure DevOps`},{id:`jira`,label:`Jira`},{id:`testrail`,label:`TestRail`},{id:`zephyr`,label:`Zephyr Scale`},{id:`qtest`,label:`qTest`}],j=e=>A.some(t=>t.id===e),M=e=>e&&E(e)===`web`?e:void 0,N=(e,t)=>`${e} ${t}${e===1?``:`s`}`,P=e=>`${e.kind}:${e.id}`;function F(e){return e.found===`reuse`||e.kind===`link`?`Link`:e.found===`extends`||e.kind===`extend`?`Add ${N((e.insert??[]).reduce((e,t)=>e+t.steps.length,0),`step`)}`:`Update steps`}function I(e,t){let n=`Story ${t} asks for it: ${e.wrote}`,r=e.link?{link:!0}:{};return e.kind===`link`?{kind:`link`,id:e.id}:e.kind===`extend`?{kind:`extend`,id:e.id,insert:e.insert??[],reason:n,...r}:{kind:`update`,id:e.id,steps:e.steps??[],reason:n,...r}}function L(){let[e,t]=(0,O.useState)(A.map(e=>e.id)),[n,r]=(0,O.useState)(``);return(0,O.useEffect)(()=>{u.settings().then(e=>{let n=e.config.sources??{},r=A.map(e=>e.id).filter(e=>n[e]&&typeof n[e]==`object`);r.length&&t(r)},e=>r(`The settings could not be read, so every system is offered: ${e.message}`))},[]),{systems:A.filter(t=>e.includes(t.id)),error:n}}function R({id:e,icon:t,title:n,children:r}){return(0,k.jsxs)(`section`,{"aria-labelledby":e,className:`flex min-w-0 flex-col gap-3`,children:[(0,k.jsxs)(`h2`,{id:e,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,k.jsx)(h,{icon:t,size:18,className:`text-accent-fg`}),n]}),r]})}function z({view:n,onApplied:r,onError:a}){let[o,c]=(0,O.useState)([]),[l,u]=(0,O.useState)(null),[h,g]=(0,O.useState)(!1),[b,x]=(0,O.useState)(null),S=n.story.id,w=n.proposals.filter(e=>o.includes(P(e))),E=async()=>{let e=w.map(e=>I(e,S));g(!0);try{let t=await i.preview(n.system,S,e);u({lines:t.lines,changes:e}),a(``)}catch(e){a(e.message)}finally{g(!1)}},j=async()=>{if(l){g(!0);try{let e=await i.apply(n.system,S,l.changes);x({applied:e.applied,failed:e.failed}),u(null),c([]),a(``),r()}catch(e){a(e.message)}finally{g(!1)}}},L=M(n.story.url);return(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,k.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-lg font-semibold [overflow-wrap:anywhere]`,children:[L?(0,k.jsxs)(`a`,{href:L,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[S,(0,k.jsx)(T,{size:14,"aria-hidden":`true`})]}):(0,k.jsx)(`span`,{children:S}),n.story.title&&(0,k.jsx)(`span`,{className:`font-normal text-ink-2`,children:n.story.title})]}),n.changed&&(0,k.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,"data-tip":new Date(n.changed.when).toLocaleString(),children:[`The story's `,n.changed.field,` changed `,D(n.changed.when),`.`]})]}),(0,k.jsx)(R,{id:`cases-h`,icon:C,title:`Linked cases`,children:(0,k.jsx)(e,{label:`Linked cases`,empty:`No test case is linked to this story.`,head:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:y,children:`Case`}),(0,k.jsx)(`th`,{className:y,children:`Title`}),(0,k.jsx)(`th`,{className:s(y,`text-right`),children:`Steps`}),(0,k.jsx)(`th`,{className:y,children:`State`})]}),children:n.cases.map(e=>{let t=M(e.url);return(0,k.jsxs)(`tr`,{className:_,children:[(0,k.jsx)(`td`,{className:s(p,`whitespace-nowrap`),children:t?(0,k.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[e.id,(0,k.jsx)(T,{size:12,"aria-hidden":`true`})]}):e.id}),(0,k.jsx)(`td`,{className:s(p,`[overflow-wrap:anywhere]`),children:e.title}),(0,k.jsx)(`td`,{className:s(p,`text-right tabular-nums`),children:e.steps}),(0,k.jsx)(`td`,{className:s(p,e.stale?`text-warn`:`text-muted`),children:e.stale?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,k.jsx)(m,{size:13,"aria-hidden":`true`,className:`flex-none`}),`older than the story's last change`]}):e.changed?(0,k.jsxs)(`span`,{"data-tip":new Date(e.changed).toLocaleString(),children:[`changed `,D(e.changed)]}):`–`})]},e.id)})})}),(0,k.jsx)(R,{id:`criteria-h`,icon:t,title:`Acceptance criteria`,children:(0,k.jsx)(e,{label:`Acceptance criteria`,empty:`No acceptance criteria were read for this story.`,head:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:y,children:`Criterion`}),(0,k.jsx)(`th`,{className:y,children:`Cases`})]}),children:n.criteria.map((e,t)=>(0,k.jsxs)(`tr`,{className:_,children:[(0,k.jsx)(`td`,{className:s(p,`[overflow-wrap:anywhere]`),children:e.text}),(0,k.jsx)(`td`,{className:s(p,e.cases.length?`text-ink-2`:`text-warn`),children:e.cases.length?e.cases.join(`, `):`no case`})]},t))})}),(0,k.jsxs)(R,{id:`proposals-h`,icon:f,title:`Proposed changes`,children:[(0,k.jsx)(e,{label:`Proposed changes`,empty:`No change is waiting. save_test_cases in a chat proposes them.`,tools:(0,k.jsxs)(v,{size:`sm`,variant:`primary`,disabled:h||!w.length||!!l,onClick:()=>void E(),children:[`Review `,N(w.length,`change`)]}),head:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:s(y,`w-10`),children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,k.jsx)(`th`,{className:y,children:`Change`}),(0,k.jsx)(`th`,{className:y,children:`Existing case`}),(0,k.jsx)(`th`,{className:y,children:`The agent wrote`})]}),children:n.proposals.map(e=>{let t=P(e);return(0,k.jsxs)(`tr`,{className:_,children:[(0,k.jsx)(`td`,{className:p,children:(0,k.jsx)(`input`,{type:`checkbox`,"aria-label":`${F(e)}: ${e.id} ${e.title}`,checked:o.includes(t),disabled:h||!!l,onChange:e=>c(e.target.checked?[...o,t]:o.filter(e=>e!==t))})}),(0,k.jsxs)(`td`,{className:s(p,`whitespace-nowrap font-medium`),children:[F(e),e.link&&e.kind!==`link`&&(0,k.jsx)(`span`,{className:`block text-[12px] font-normal text-muted`,children:`and link it`})]}),(0,k.jsxs)(`td`,{className:s(p,`[overflow-wrap:anywhere]`),children:[(0,k.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2`,children:e.id}),` `,e.title]}),(0,k.jsx)(`td`,{className:s(p,`text-ink-2 [overflow-wrap:anywhere]`),children:e.wrote})]},t)})}),l&&(0,k.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Apply the changes`,className:`flex flex-col gap-2 rounded-[10px] border border-accent-line bg-accent-soft p-3 text-[13px]`,children:[(0,k.jsxs)(`span`,{className:`font-medium`,children:[`Apply `,N(l.changes.length,`change`),` to `,A.find(e=>e.id===n.system)?.label,`?`]}),(0,k.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-5 text-ink-2`,children:l.lines.map((e,t)=>(0,k.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}),(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,k.jsx)(v,{size:`sm`,variant:`primary`,disabled:h,onClick:()=>void j(),children:`Apply`}),(0,k.jsx)(v,{size:`sm`,disabled:h,onClick:()=>u(null),children:`Cancel`})]})]}),b&&b.applied.length>0&&(0,k.jsxs)(`p`,{role:`status`,className:`m-0 text-[13px] text-pass`,children:[`Applied: `,b.applied.join(`, `)]}),b&&b.failed.length>0&&(0,k.jsxs)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Not applied: `,b.failed.map(e=>`${e.id||`a change`}: ${e.error}`).join(`; `)]})]}),(0,k.jsx)(R,{id:`changes-h`,icon:d,title:`Recent changes`,children:n.changes.length?(0,k.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] text-ink-2`,children:n.changes.map((e,t)=>(0,k.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}):(0,k.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`ForgeQE has not changed this story's cases.`})}),n.notes.map((e,t)=>(0,k.jsx)(`p`,{className:`m-0 text-[13px] text-muted [overflow-wrap:anywhere]`,children:e},t))]})}function B({sub:e}){let{systems:t,error:n}=L(),a=e?e.indexOf(`/`):-1,c=a>0?e.slice(0,a):e,u=j(c)?c:void 0,d=u&&a>0?decodeURIComponent(e.slice(a+1)):``,[f,p]=(0,O.useState)(u??`azure_devops`),[m,h]=(0,O.useState)(d),[_,y]=(0,O.useState)(null),[T,E]=(0,O.useState)(``),[D,A]=(0,O.useState)(!1);(0,O.useEffect)(()=>{u&&p(u),h(d)},[u,d]),(0,O.useEffect)(()=>{!u&&t.length&&!t.some(e=>e.id===f)&&p(t[0].id)},[t,f,u]);let M=(0,O.useCallback)(()=>{!u||!d?y(null):(A(!0),i.view(u,d).then(e=>{y(e),E(``),A(!1)},e=>{E(e.message),A(!1)}))},[u,d]);return(0,O.useEffect)(()=>y(null),[u,d]),(0,O.useEffect)(M,[M]),(0,k.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,k.jsx)(x,{}),(0,k.jsxs)(`main`,{className:s(S,`@container flex-auto gap-4`),children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(l,{pixel:r[`test-cases`],size:`lg`}),(0,k.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test cases`})]}),(0,k.jsxs)(`p`,{className:`m-0 max-w-[80ch] text-[13px] leading-relaxed text-ink-2`,children:[`A story's test cases in your test management system: which are older than the story's last change, which acceptance criteria no case covers, and the changes save_test_cases proposed. Tick the ones to make; nothing is written until you review and apply them. The tests that run them are on `,(0,k.jsx)(`a`,{href:o(`regression`),children:`Regression`}),`; their results on `,(0,k.jsx)(`a`,{href:o(`runs`),children:`Runs`}),`.`]}),(0,k.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=m.trim();if(!t)return;let n=o(`test-cases`,f,encodeURIComponent(t));location.hash===n?M():location.hash=n},className:`flex flex-col gap-3`,children:[(0,k.jsx)(`div`,{role:`group`,"aria-label":`System`,className:`flex flex-wrap gap-1.5`,children:(0,k.jsx)(b,{items:t,value:f,onChange:p})}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,k.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_320px] flex-col gap-1 text-[13px] font-medium`,children:[`Story`,(0,k.jsx)(w,{value:m,maxLength:120,spellCheck:!1,placeholder:f===`azure_devops`?`1234`:f===`qtest`?`5678`:f===`testrail`?`R12`:`SHOP-12`,onChange:e=>h(e.target.value)})]}),(0,k.jsx)(v,{type:`submit`,variant:`primary`,disabled:!m.trim()||D,children:`Open`})]})]}),[n,T].filter(Boolean).map(e=>(0,k.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:e},e)),D&&(0,k.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),_&&(0,k.jsx)(z,{view:_,onApplied:M,onError:E},`${_.system}:${_.story.id}`),!d&&!_&&(0,k.jsx)(g,{icon:C,title:`No story opened yet`,children:`Pick the system and type a story's id to see its linked test cases, its acceptance criteria and which cases trace to them. When save_test_cases runs in a chat for a story, the changes it proposes to existing cases show here to apply.`})]})]})}export{B as TestCases};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$ as e,Ao as t,Bn as n,Ct as r,Fo as i,Hn as a,Io as o,Ka as s,Lt as c,Ma as l,Na as u,No as d,Nt as f,Pa as p,Pr as m,Vi as h,Xa as g,at as _,dt as v,et as y,gn as b,gt as x,ht as S,ja as C,nt as w,ot as T,pa as E,r as D,rt as O,t as k,ta as A,tt as j,ut as M,xn as N,yi as P}from"./frame-eAHxqKfn.js";import{r as F}from"./index-COTk3Bz-.js";import{n as I}from"./segmented-BJECij_J.js";import{a as L,c as R,f as z,i as B,n as V,o as H,r as U,s as W,t as G,u as K}from"./dataParts-BImZKYEu.js";var q=i({Requests:()=>$,TestData:()=>ie}),J=o(d(),1),Y=t(),X=[`requests`,`kept`,`specs`,`batches`],Z={fetch:`kept`,request:`requests`,gen:`specs`,files:`specs`,insert:`specs`,batches:`batches`,clean:`batches`},Q=e=>Object.values(e.row_counts||{}).reduce((e,t)=>e+t,0);function ee({e,kept:t,busy:n,act:r}){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 px-1 py-2`,children:[(0,Y.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-[13px]`,children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:`Asked for`}),(0,Y.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:e.need}),(0,Y.jsx)(`dt`,{className:`text-muted`,children:`When`}),(0,Y.jsxs)(`dd`,{className:`m-0`,children:[new Date(e.at).toLocaleString(),e.ms===void 0?``:` · answered in ${(e.ms/1e3).toFixed(1)} s`]}),(0,Y.jsx)(`dt`,{className:`text-muted`,children:`How`}),(0,Y.jsxs)(`dd`,{className:`m-0`,children:[e.source===`fetch`?`A kept request fetched again, with no model`:`Asked the DB agent for ${e.asked===`existing`?`existing rows`:e.asked===`new`?`new rows`:`either`}`,e.name?(0,Y.jsxs)(Y.Fragment,{children:[` · `,(0,Y.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.name})]}):null]}),e.why&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:`The answer`}),(0,Y.jsx)(`dd`,{className:`m-0`,children:e.why})]})]}),e.error&&(0,Y.jsx)(R,{text:e.error}),Object.entries(e.sample||{}).map(([t,n])=>(0,Y.jsx)(K,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:`The query`}),(0,Y.jsx)(V,{label:`SQL`,children:e.sql})]}),e.script_preview?.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script`}),(0,Y.jsx)(V,{label:`INSERT script`,children:e.script_preview.join(`
|
|
2
|
-
`)})]}):null,t&&e.name&&(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(C,{size:`sm`,disabled:n,onClick:()=>r(`fetch`,{name:e.name}),children:[(0,Y.jsx)(h,{"aria-hidden":`true`}),`Fetch again`]})})]})}function $({view:t,log:r,busy:i,act:o}){let[s,d]=(0,J.useState)(`all`),[f,p]=(0,J.useState)(``),[h,g]=(0,J.useState)(``),[b,C]=(0,J.useState)(``),E=r??[],D=(0,J.useMemo)(()=>[...new Set(E.map(e=>e.requester))].sort(),[r]),k=(0,J.useMemo)(()=>[...new Set(E.map(e=>e.database).filter(Boolean))].sort(),[r]),A=E.filter(e=>!e.ok).length,M=E.filter(e=>(s===`all`||s===`ok`===e.ok)&&(!f||e.requester===f)&&(!h||e.database===h)),N=new Set(t.requests.map(e=>e.name));return r===null?(0,Y.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading the requests…`}):E.length?(0,Y.jsx)(e,{label:`Requests`,resetKey:`${s}|${f}|${h}`,minWidth:760,fixed:!0,placeholder:`Find a request`,tools:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(T,{value:s,onChange:d,items:[{id:`all`,label:`All`,n:E.length},{id:`ok`,label:`Answered`,n:E.length-A},{id:`failed`,label:`Failed`,n:A,alert:!0}]}),D.length>1&&(0,Y.jsxs)(v,{size:`sm`,"aria-label":`Who asked`,value:f,onChange:e=>p(e.target.value),className:`w-[180px]`,children:[(0,Y.jsx)(`option`,{value:``,children:`Anyone`}),D.map(e=>(0,Y.jsx)(`option`,{children:e},e))]}),k.length>1&&(0,Y.jsxs)(v,{size:`sm`,"aria-label":`Database`,value:h,onChange:e=>g(e.target.value),className:`w-[160px]`,children:[(0,Y.jsx)(`option`,{value:``,children:`Any database`}),k.map(e=>(0,Y.jsx)(`option`,{children:e},e))]})]}),head:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`th`,{className:u(w,`w-9`),children:(0,Y.jsx)(`span`,{className:`sr-only`,children:`Open`})}),(0,Y.jsx)(`th`,{className:u(w,`w-[110px]`),children:`When`}),(0,Y.jsx)(`th`,{className:u(w,`w-[150px]`),children:`Who asked`}),(0,Y.jsx)(`th`,{className:w,children:`What for`}),(0,Y.jsx)(`th`,{className:u(w,`w-[110px]`),children:`Database`}),(0,Y.jsx)(`th`,{className:u(w,`w-[140px]`),children:`Answer`}),(0,Y.jsx)(`th`,{className:u(O,`w-[70px]`),children:`Rows`})]}),empty:`No requests match these filters. Pick All and Anyone to see every request.`,children:M.map(e=>{let t=b===e.id;return(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsxs)(`tr`,{className:u(_,t&&`bg-surface-muted`),onClick:()=>C(t?``:e.id),children:[(0,Y.jsx)(`td`,{className:u(y,`pr-0`),children:(0,Y.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":t?`Close the request`:`Open the request`,onClick:n=>(n.stopPropagation(),C(t?``:e.id)),className:`flex cursor-pointer items-center border-0 bg-transparent p-0 text-muted`,children:t?(0,Y.jsx)(n,{size:16,"aria-hidden":`true`}):(0,Y.jsx)(a,{size:16,"aria-hidden":`true`})})}),(0,Y.jsx)(`td`,{className:u(y,`whitespace-nowrap text-muted`),"data-tip":new Date(e.at).toLocaleString(),children:F(e.at)}),(0,Y.jsx)(`td`,{className:u(y,`truncate`),"data-tip":e.requester,children:e.requester}),(0,Y.jsxs)(`td`,{className:u(y,`truncate`),"data-tip":e.need,children:[e.need,e.source===`fetch`?(0,Y.jsx)(`span`,{className:`text-muted`,children:` · fetched again`}):null]}),(0,Y.jsx)(`td`,{className:u(y,`truncate`),"data-tip":e.database,children:e.database||(0,Y.jsx)(`span`,{className:`text-muted`,children:`—`})}),(0,Y.jsx)(`td`,{className:u(y,`whitespace-nowrap`),children:(0,Y.jsx)(S,{tone:e.ok?`pass`:`fail`,children:e.ok?H[e.kind||``]||`Answered`:`Failed`})}),(0,Y.jsx)(`td`,{className:j,children:e.ok?Q(e):``})]}),t&&(0,Y.jsx)(`tr`,{className:`border-t border-line-soft bg-surface-muted/40`,children:(0,Y.jsx)(`td`,{colSpan:7,className:`max-w-0 px-4 py-2`,children:(0,Y.jsx)(ee,{e,kept:!!e.name&&N.has(e.name),busy:i,act:o})})})]},e.id)})}):(0,Y.jsx)(x,{icon:m,title:`No test data asked for yet`,action:(0,Y.jsxs)(`a`,{href:c(`data`,`ask`,`test-data`),className:u(l({size:`sm`}),`no-underline`),children:[(0,Y.jsx)(m,{"aria-hidden":`true`}),`Ask for test data`]}),children:`The agents ask before a test runs, or you can ask yourself.`})}function te({view:e,job:t,busy:n,act:r,onNote:i}){let a=t&&!t.running&&t.kind===`fetch`?t:null,o=a?.result;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`Each request is kept in test-data/requests with its query or INSERT script. Fetch one again to get the same data with no model: a query reads the rows there now, a spec makes the same rows.`}),a&&(0,Y.jsxs)(`section`,{"aria-label":`Fetched ${a.target}`,className:`flex flex-col gap-3 rounded-[14px] card border p-4`,children:[(0,Y.jsx)(`h2`,{className:`m-0 text-base font-semibold [overflow-wrap:anywhere]`,children:a.target}),o&&!o.ok&&(0,Y.jsx)(R,{text:o.error||`It could not fetch the data.`}),o?.ok&&(0,Y.jsx)(G,{r:o,onNote:i})]}),e.requests.length===0?(0,Y.jsxs)(x,{className:`py-3`,children:[`No kept requests yet. Each request the DB agent answers is kept here; `,(0,Y.jsx)(`a`,{href:c(`data`,`ask`,`test-data`),children:`ask for test data`}),` to make the first.`]}):(0,Y.jsx)(W,{items:e.requests,text:e=>`${e.need} ${e.name} ${e.database} ${e.requester||``}`,label:`Kept requests`,size:15,children:e=>(0,Y.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-3 border-t border-line-soft py-2.5 text-sm first:border-t-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`text-[14px] font-medium [overflow-wrap:anywhere]`,children:e.need}),(0,Y.jsxs)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:[(0,Y.jsx)(`span`,{className:`font-mono`,children:e.name}),` · `,e.database,` · `,H[e.kind],e.rows?` · ${p(e.rows,`row`)}`:``,e.created?` · ${F(e.created)}`:``,e.requester?` · asked by ${e.requester}`:``]})]}),(0,Y.jsxs)(C,{size:`sm`,disabled:n,onClick:()=>r(`fetch`,{name:e.name}),children:[(0,Y.jsx)(h,{"aria-hidden":`true`}),`Fetch again`]})]},e.name)})]})}function ne({view:e,job:t,busy:n,act:r,onNote:i}){let[a,o]=(0,J.useState)(e.specs[0]??``),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(``),[p,h]=(0,J.useState)(`csv`),[g,_]=(0,J.useState)(!1),y={spec:a,...l?{db:l}:{},...d?{seed:d}:{}},S=t&&!t.running?t:null,w=S&&[`gen`,`files`,`insert`].includes(S.kind)&&S.target===a?S.result:void 0,T=e.databases.find(e=>e.name===l),E=async()=>{try{let{id:e}=await s.start(`Write a test data spec for this project (a YAML file with tables: under test-data/), from the database's schema. Show me the spec and a preview before you save it.`,{});location.hash=c(`chats`,e)}catch(e){i(e.message)}};return(0,Y.jsxs)(`section`,{"aria-labelledby":`spec-h`,className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Y.jsxs)(`h2`,{id:`spec-h`,className:`m-0 flex flex-1 items-center gap-2 text-lg font-semibold`,children:[(0,Y.jsx)(b,{icon:m,size:18,className:`text-accent-fg`}),`Make test data from a spec`]}),(0,Y.jsxs)(C,{variant:`ghost`,onClick:()=>void E(),children:[(0,Y.jsx)(P,{"aria-hidden":`true`}),`Write a spec in a chat`]})]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`A spec is a YAML file with tables: and what goes in each column. The same spec and seed make the same data again, so a test or a pipeline can rely on it. No model is used.`}),e.specs.length===0?(0,Y.jsx)(x,{className:`py-3`,children:`No specs in this project yet: a YAML file with tables: in test-data/, data/ or specs/. Write one in a chat, from a database's schema.`}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-[14px] card border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,Y.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-1.5 text-sm font-medium`,children:[`Spec`,(0,Y.jsx)(v,{value:a,onChange:e=>o(e.target.value),children:e.specs.map(e=>(0,Y.jsx)(`option`,{children:e},e))})]}),(0,Y.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-1.5 text-sm font-medium`,children:[`Database`,(0,Y.jsxs)(v,{value:l,onChange:e=>u(e.target.value),children:[(0,Y.jsx)(`option`,{value:``,children:`The spec's own`}),e.databases.map(e=>(0,Y.jsxs)(`option`,{value:e.name,children:[e.name,e.writable?``:` (read only)`]},e.name))]})]}),(0,Y.jsxs)(`label`,{className:`flex w-[120px] flex-col gap-1.5 text-sm font-medium`,children:[`Seed`,(0,Y.jsx)(M,{value:d,inputMode:`numeric`,placeholder:`Random`,onChange:e=>f(e.target.value.replace(/\D/g,``).slice(0,9))})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(C,{variant:g?void 0:`primary`,disabled:n||!a,onClick:()=>r(`gen`,y),children:[(0,Y.jsx)(m,{"aria-hidden":`true`}),`Preview`]}),(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Y.jsx)(C,{disabled:n||!a,onClick:()=>r(`gen`,{...y,mode:`files`,format:p}),children:`Write files`}),(0,Y.jsx)(v,{"aria-label":`File format`,value:p,onChange:e=>h(e.target.value),className:`w-[88px]`,children:[`csv`,`json`,`sql`].map(e=>(0,Y.jsx)(`option`,{children:e},e))})]}),(0,Y.jsxs)(C,{disabled:n||!a||!T?.writable,"data-tip":T?.writable?void 0:`Pick a writable database to insert into`,onClick:()=>_(!0),children:[(0,Y.jsx)(A,{"aria-hidden":`true`}),`Insert into `,T?.writable?T.name:`a database`]})]}),g&&T&&(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Insert test data`,className:`flex flex-col gap-3 rounded-[12px] border border-warn bg-warn-soft p-4`,children:[(0,Y.jsxs)(`span`,{className:`font-medium`,children:[`Insert the rows of `,a,` into `,T.name,`?`]}),(0,Y.jsx)(`span`,{className:`text-sm text-ink-2`,children:`They go in as one batch, which you can remove again under Batches. Only on a test database.`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsx)(C,{variant:`primary`,onClick:()=>{_(!1),r(`gen`,{...y,mode:`insert`,confirmed:!0})},children:`Insert`}),(0,Y.jsx)(C,{onClick:()=>_(!1),children:`Don't insert`})]})]}),w&&!w.ok&&(0,Y.jsx)(R,{text:w.error||`It did not make the data.`}),w?.ok&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[w.batch&&(0,Y.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Inserted as batch `,(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:w.batch}),`.`]}),w.files?.length?(0,Y.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Wrote`,w.files.map(e=>(0,Y.jsx)(U,{file:e,onNote:i},e))]}):null,(0,Y.jsx)(B,{r:w})]})]})]})}function re({view:e,job:t,busy:n,act:r}){let i=e.databases.filter(e=>e.writable),[a,o]=(0,J.useState)(i[0]?.name??``),[s,c]=(0,J.useState)(``),l=t&&!t.running?t:null,u=l?.kind===`batches`?(Array.isArray(l.result)?l.result.flatMap(e=>e.batches||[]):l.result?.batches)??[]:null;return(0,Y.jsxs)(`section`,{"aria-labelledby":`batch-h`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`h2`,{id:`batch-h`,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,Y.jsx)(b,{icon:A,size:18,className:`text-accent-fg`}),`Inserted batches`]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`Rows inserted from a spec go in as a batch. Remove a batch to take exactly those rows out again, children first.`}),i.length===0?(0,Y.jsx)(x,{className:`py-3`,children:`No writable database: test data is inserted only into one marked writable in Settings, Databases.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(v,{"aria-label":`Database`,value:a,onChange:e=>o(e.target.value),className:`w-[220px]`,children:i.map(e=>(0,Y.jsx)(`option`,{children:e.name},e.name))}),(0,Y.jsx)(C,{disabled:n||!a,onClick:()=>r(`batches`,{db:a}),children:`List batches`})]}),u&&u.length===0&&(0,Y.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`No batches in `,l?.target,`.`]}),u&&u.length>0&&(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:u.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-3 border-t border-line-soft py-2.5 text-sm first:border-t-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.batch}),(0,Y.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[(0,Y.jsx)(`span`,{"data-tip":new Date(e.created).toLocaleString(),children:F(e.created)}),e.spec?` · ${e.spec}`:``,` ·`,` `,Object.entries(e.rows).map(([e,t])=>`${e} ${t}`).join(`, `)]})]}),s===e.batch?(0,Y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Y.jsxs)(`span`,{className:`text-[13px] text-warn`,children:[`Remove its rows from `,l?.target,`?`]}),(0,Y.jsx)(C,{variant:`danger`,size:`sm`,onClick:()=>{c(``),r(`clean`,{db:l?.target,batch:e.batch,confirmed:!0})},children:`Remove`}),(0,Y.jsx)(C,{size:`sm`,onClick:()=>c(``),children:`Keep`})]}):(0,Y.jsxs)(C,{size:`sm`,disabled:n,onClick:()=>c(e.batch),children:[(0,Y.jsx)(E,{"aria-hidden":`true`}),`Remove`]})]},e.batch))}),l?.kind===`clean`&&l.result?.ok&&(0,Y.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Removed:`,` `,Object.entries(l.result.removed||{}).map(([e,t])=>`${e} ${t}`).join(`, `)]})]})]})}function ie({sub:e}){let{view:t,error:n,busy:i,act:a,stop:o,job:s}=z(),[d,h]=(0,J.useState)(null),[_,v]=(0,J.useState)(``),y=X.includes(e)?e:`requests`,b=s&&!s.running?s.endedAt:``;(0,J.useEffect)(()=>{g.log().then(h,e=>v(e.message))},[b]);let x=(d||[]).filter(e=>!e.ok).length,S=new Set((d||[]).map(e=>e.requester)).size,C={requests:`Requests${d?` (${d.length})`:``}`,kept:`Kept${t?` (${t.requests.length})`:``}`,specs:`Specs${t?` (${t.specs.length})`:``}`,batches:`Batches`};return(0,Y.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,Y.jsx)(D,{}),(0,Y.jsxs)(`main`,{className:u(k,`@container flex-auto gap-4`),children:[(0,Y.jsxs)(`a`,{href:c(`data`,`databases`),className:`inline-flex w-fit items-center gap-1.5 text-sm`,children:[(0,Y.jsx)(N,{size:16,"aria-hidden":`true`}),`All databases`]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Y.jsx)(f,{pixel:r[`test-data`],size:`lg`}),(0,Y.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test data`}),(0,Y.jsxs)(`a`,{href:c(`data`,`ask`,`test-data`),className:u(l(),`no-underline`),children:[(0,Y.jsx)(m,{"aria-hidden":`true`}),`Ask for test data`]})]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-[74ch] text-sm leading-relaxed text-ink-2`,children:`Every request for test data: which agent asked, what for, when, and what the DB agent sent back. Kept requests fetch the same data again with no model; specs make data you can insert as batches and remove again.`}),d&&d.length>0&&(0,Y.jsxs)(`p`,{className:`m-0 text-sm text-ink-2 tabular-nums`,children:[p(d.length,`request`),` · `,p(S,`asker`),` · `,(0,Y.jsxs)(`span`,{className:x?`text-fail`:``,children:[x,` failed`]}),t?` · ${t.requests.length} kept`:``]}),(n||_)&&(0,Y.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:n||_}),!t&&!n&&(0,Y.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(I,{label:`Test data`,current:y,onPick:e=>location.hash=c(`test-data`,e),tabs:X.map(e=>({id:e,label:C[e]}))}),s&&(s.running?Z[s.kind]!==void 0:Z[s.kind]===y)&&(0,Y.jsx)(L,{job:s,onStop:o}),(0,Y.jsxs)(`div`,{role:`tabpanel`,id:`panel-${y}`,"aria-labelledby":`tab-${y}`,children:[y===`requests`&&(0,Y.jsx)($,{view:t,log:d,busy:i,act:a}),y===`kept`&&(0,Y.jsx)(te,{view:t,job:s,busy:i,act:a,onNote:v}),y===`specs`&&(0,Y.jsx)(ne,{view:t,job:s,busy:i,act:a,onNote:v}),y===`batches`&&(0,Y.jsx)(re,{view:t,job:s,busy:i,act:a})]})]})]})]})}export{q as n,$ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,Ao as t,Ct as n,Ga as r,Io as i,Ka as a,Kn as o,Li as s,Lt as c,Ma as l,Na as u,No as d,Nt as ee,Qn as te,dt as ne,ga as f,gt as p,ja as m,ot as h,qn as g,r as re,t as ie,ui as _,ur as v,ut as y,yi as b}from"./frame-eAHxqKfn.js";import{r as x}from"./index-COTk3Bz-.js";import{_ as S,o as C}from"./qualityParts-BcrXEQ9B.js";var w=i(d(),1),T={view:()=>r(`GET`,`/api/testdebt`),refresh:()=>r(`POST`,`/api/testdebt/refresh`,{}),readCases:(e,t)=>r(`POST`,`/api/testdebt/cases`,{source:e,scope:t})},E=t(),D=[`untested`,`signal`,`duplicates`,`cases`],O={endpoint:`Endpoint`,screen:`Screen`,file:`Code file`},k={test:`Test`,recording:`Recording`,case:`Test case`},A={azure_devops:`Azure DevOps`,jira:`Jira`,xray:`Xray`,testrail:`TestRail`,zephyr:`Zephyr Scale`,qtest:`qTest`,other:`Other`},j={azure_devops:`plan=12/suite=34`,testrail:`run=7`,zephyr:`cycle=SHOP-R12`,qtest:`cycle=12`,xray:`plan=SHOP-100`},M=e=>`${Math.round(e*100)}%`,ae=e=>D.includes(e)?e:`untested`;function N({part:e,what:t,action:n}){return(0,E.jsxs)(p,{icon:f,title:e.state===`empty`?`No ${t} yet`:`${t[0].toUpperCase()}${t.slice(1)}: not connected`,action:(0,E.jsx)(`a`,{className:l({size:`sm`}),href:n.to,children:n.label}),children:[`To see this list, set `,e.set,`.`]})}function P({text:e,tip:t}){return(0,E.jsx)(`span`,{"data-tip":t??e,className:`block truncate`,children:e})}function F({sub:t}){let[r,i]=(0,w.useState)(null),[d,f]=(0,w.useState)(``),[D,F]=(0,w.useState)(!1),[I,L]=(0,w.useState)(``),R=ae(t),[z,B]=(0,w.useState)(`all`),[V,H]=(0,w.useState)(`manual`),[U,W]=(0,w.useState)(``),[G,K]=(0,w.useState)(``);(0,w.useEffect)(()=>{T.view().then(e=>{i(e),f(``)},e=>f(e.message))},[]);let q=(0,w.useCallback)(async(e,t)=>{F(!0),L(``);try{i(await e()),f(``),t&&L(t)}catch(e){f(e.message)}finally{F(!1)}},[]),oe=async e=>{if(e){F(!0);try{let{id:t}=await a.start(e,{});location.hash=c(`chats`,t)}catch(e){f(e.message),F(!1)}}},J=(e,t)=>(0,E.jsxs)(m,{size:`sm`,variant:`ghost`,disabled:D||!e,onClick:()=>void oe(e),"data-tip":e?`Ask in a chat to draft a test for this ${t}`:`Its id or file is not of a plain shape, so no chat request names it: open it where it lives instead.`,children:[(0,E.jsx)(b,{"aria-hidden":`true`}),`Draft the test`]}),Y=r?.sources.filter(e=>e.connected&&e.id!==`jira`)??[],X=U||Y[0]?.id||``,Z=r?.cases.filter(e=>!e.automated).length??0,se=r?.areas.filter(e=>z===`all`||e.kind===z)??[],ce=r?.cases.filter(e=>V===`all`||(V===`manual`?!e.automated:e.automated))??[],Q=`py-2 pr-3 text-right tabular-nums`,$={untested:(r?.areas.length??0)+(r?.rules.length??0),signal:(r?.quiet.length??0)+(r?.gone.length??0),duplicates:r?.duplicates.length??0,cases:Z};return(0,E.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,E.jsx)(re,{}),(0,E.jsxs)(`main`,{className:u(ie,`@container max-w-[1320px] flex-auto gap-4`),children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,E.jsx)(ee,{pixel:n[`test-debt`],size:`lg`}),(0,E.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test debt`}),r&&(0,E.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[13px] text-muted`,children:[(0,E.jsxs)(`span`,{"data-tip":S(r.at),children:[`Worked out `,x(r.at)]}),(0,E.jsxs)(m,{size:`sm`,disabled:D,onClick:()=>void q(T.refresh,`Worked out again.`),children:[(0,E.jsx)(s,{"aria-hidden":`true`}),`Refresh`]})]})]}),(0,E.jsxs)(`p`,{className:`m-0 max-w-[80ch] text-[13px] leading-relaxed text-ink-2`,children:[`What no test checks yet, and tests that tell little: code and business rules no test reaches in the `,(0,E.jsx)(`a`,{href:c(`product`),children:`product graph`}),`, tests that passed every one of their last 30 runs or whose file is gone from `,r?.repo&&r.repo!==`.`?(0,E.jsx)(`code`,{className:`font-mono text-[12.5px]`,children:r.repo}):`the test repository`,`, tests that read alike, and each test case with whether it is automated. It only reads; Draft the test asks in a chat, and nothing changes until you agree there.`]}),d&&(0,E.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:d}),!r&&!d&&(0,E.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),I&&(0,E.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2`,children:I}),r&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-6 @xl:divide-x @xl:divide-line-soft`,children:[(0,E.jsx)(C,{label:`Untested code`,value:r.graph.state===`ok`?r.areas.length:`–`,tone:r.areas.length?`text-warn`:void 0,sub:r.graph.state===`ok`?`of ${r.graph.checked} areas`:`graph not built`}),(0,E.jsx)(C,{label:`Untested rules`,value:r.rules.length,tone:r.rules.length?`text-warn`:void 0,sub:`of ${r.graph.rulesChecked} rules`}),(0,E.jsx)(C,{label:`Never fail`,value:r.quiet.length,sub:`30 passes in a row`}),(0,E.jsx)(C,{label:`Code gone`,value:r.gone.length,tone:r.gone.length?`text-fail`:void 0,sub:`of ${r.files.count} files listed`}),(0,E.jsx)(C,{label:`Near-duplicates`,value:r.duplicates.length,sub:`from ${M(r.threshold)} alike`}),(0,E.jsx)(C,{label:`Not automated`,value:Z,tone:Z?`text-warn`:void 0,sub:`of ${r.cases.length} test cases`})]}),(0,E.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,E.jsx)(h,{items:[{id:`untested`,label:`Untested code and rules`,n:$.untested},{id:`signal`,label:`Low-signal tests`,n:$.signal},{id:`duplicates`,label:`Near-duplicates`,n:$.duplicates},{id:`cases`,label:`Test cases`,n:$.cases}],value:R,onChange:e=>location.hash=c(`test-debt`,e)})}),r.notes.map(e=>(0,E.jsx)(`p`,{className:`m-0 text-[12.5px] text-ink-2`,children:e},e)),R===`untested`&&(0,E.jsxs)(E.Fragment,{children:[r.graph.state===`ok`?(0,E.jsx)(e,{label:`Code no test reaches`,placeholder:`Find an endpoint, screen or file`,resetKey:z,empty:r.areas.length?`Nothing matches.`:`Every endpoint, screen and code file the graph holds is reached by a test.`,tools:(0,E.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,E.jsx)(h,{items:[{id:`all`,label:`All`,n:r.areas.length},...[`endpoint`,`screen`,`file`].map(e=>({id:e,label:`${O[e]}s`,n:r.areas.filter(t=>t.kind===e).length}))],value:z,onChange:B})}),head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`w-[34%] py-1.5 pr-3 pl-3 font-medium`,children:`Code`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Kind`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Where`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @2xl:table-cell`,children:`Used by`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:se.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,E.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(g,{size:15,"aria-label":`No test reaches it`,className:`flex-none text-warn`}),(0,E.jsx)(P,{text:e.name,tip:`${e.name} · ${e.known===`observed`?`read in the code`:`worked out from the code`}`})]})}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-[12.5px] whitespace-nowrap`,children:O[e.kind]}),(0,E.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 font-mono text-[12px] text-ink-2 @xl:table-cell`,children:(0,E.jsx)(P,{text:e.where})}),(0,E.jsx)(`td`,{className:u(Q,`hidden text-muted @2xl:table-cell`),children:e.users}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,O[e.kind].toLowerCase())})]},e.id))}):(0,E.jsx)(N,{part:r.graph,what:`product graph`,action:{label:`Open Product`,to:c(`product`)}}),(0,E.jsx)(e,{label:`Business rules no test checks`,placeholder:`Find a rule`,empty:r.graph.rulesChecked?`Every business rule found is checked by a test.`:`No business rules found: the product graph's rules come from the code; the knowledge folder's from a business-rules.md file.`,head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`w-[46%] py-1.5 pr-3 pl-3 font-medium`,children:`Rule`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`From`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Where`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Closest test`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:r.rules.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,E.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(g,{size:15,"aria-label":`No test checks it`,className:`flex-none text-warn`}),(0,E.jsx)(P,{text:e.text,tip:e.endpoint?`${e.text} · checked by ${e.endpoint}`:e.text})]})}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-[12.5px] whitespace-nowrap`,"data-tip":e.from===`graph`?`Found in the code by forgeqe knowledge build`:`A rule of the knowledge folder, matched to tests by its words`,children:e.from===`graph`?`Code`:`Knowledge`}),(0,E.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 font-mono text-[12px] text-ink-2 @xl:table-cell`,children:(0,E.jsx)(P,{text:e.where})}),(0,E.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 text-[12.5px] text-ink-2 @2xl:table-cell`,children:e.nearest?(0,E.jsx)(P,{text:`${e.nearest.name} (${M(e.nearest.score)})`,tip:`${M(e.nearest.score)} of the rule's words are in ${e.nearest.name}`}):`–`}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`rule`)})]},e.id))})]}),R===`signal`&&(r.history.state===`ok`?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(e,{label:`Tests that never fail`,placeholder:`Find a test`,empty:`No test has passed 30 runs in a row without a failure or a retry.`,head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`w-[50%] py-1.5 pr-3 pl-3 font-medium`,children:`Test`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Passes`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Since`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:r.quiet.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,E.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(o,{size:15,"aria-label":`Always passed`,className:`flex-none text-muted`}),(0,E.jsx)(P,{text:e.name,tip:e.file?`${e.name} · ${e.file}`:e.name})]})}),(0,E.jsx)(`td`,{className:u(Q,`text-muted`),children:e.runs}),(0,E.jsx)(`td`,{className:`hidden py-2 pr-3 text-[12.5px] whitespace-nowrap text-muted @xl:table-cell`,"data-tip":e.since?S(e.since):void 0,children:e.since?x(e.since):`–`}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`test`)})]},e.key))}),(0,E.jsx)(e,{label:`Tests whose file is gone`,placeholder:`Find a test or file`,empty:`Every test file the history names is in the test repository (${r.files.count} files, listed by ${r.files.by===`git`?`git`:`walking the folder`}).`,head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`w-[40%] py-1.5 pr-3 pl-3 font-medium`,children:`Test`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`File`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Last run`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:r.gone.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,E.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(te,{size:15,"aria-label":`Its file is gone`,className:`flex-none text-fail`}),(0,E.jsx)(P,{text:e.name})]})}),(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3 font-mono text-[12px] text-ink-2`,children:(0,E.jsx)(P,{text:e.file})}),(0,E.jsx)(`td`,{className:`hidden py-2 pr-3 text-[12.5px] whitespace-nowrap text-muted @xl:table-cell`,"data-tip":e.last?S(e.last):void 0,children:e.last?x(e.last):`–`}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`test`)})]},e.key))})]}):(0,E.jsx)(N,{part:r.history,what:`test history`,action:{label:`Open Regression`,to:c(`regression`)}})),R===`duplicates`&&(0,E.jsx)(e,{label:`Tests that read alike`,placeholder:`Find a test, recording or case`,empty:`No two tests, recordings or test cases share ${M(r.threshold)} of their words (${r.compared} pairs compared).`,head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 text-right font-medium`,children:`Alike`}),(0,E.jsx)(`th`,{className:`w-[30%] py-1.5 pr-3 font-medium`,children:`First`}),(0,E.jsx)(`th`,{className:`w-[30%] py-1.5 pr-3 font-medium`,children:`Second`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Shared words`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:r.duplicates.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:u(Q,`pl-3`,e.score>=.85?`text-warn`:`text-muted`),children:(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,E.jsx)(v,{size:14,"aria-hidden":`true`}),M(e.score)]})}),[e.a,e.b].map((e,t)=>(0,E.jsxs)(`td`,{className:`max-w-0 py-2 pr-3`,children:[(0,E.jsx)(P,{text:e.name,tip:`${k[e.kind]}: ${e.name}${e.where?` · ${e.where}`:``}`}),(0,E.jsx)(`span`,{className:`block text-[12px] text-muted`,children:k[e.kind]})]},t)),(0,E.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 text-[12.5px] text-ink-2 @2xl:table-cell`,children:(0,E.jsx)(P,{text:e.shared.join(`, `)})}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`pair`)})]},`${e.a.kind}:${e.a.key}|${e.b.kind}:${e.b.key}`))}),R===`cases`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(`span`,{className:`text-[13px] font-medium`,children:`Test management`}),(0,E.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:r.sources.map(e=>(0,E.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[e.connected?(0,E.jsx)(o,{size:15,"aria-label":`Connected`,className:`flex-none text-pass`}):(0,E.jsx)(g,{size:15,"aria-label":`Not connected`,className:`flex-none text-muted`}),(0,E.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,E.jsx)(`span`,{className:`text-ink-2`,children:e.connected?e.scopes.length?e.scopes.map(e=>`${e.scope}: ${e.cases} read ${x(e.at)}`).join(` · `):e.id===`jira`?`connected: its cases show once ForgeQE has indexed or automated them`:`connected`:`not connected: set ${e.set}`})]},e.id))})]}),Y.length>0&&(0,E.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),X&&q(()=>T.readCases(X,G.trim()),`Test cases read.`)},children:[(0,E.jsx)(ne,{size:`sm`,"aria-label":`Source`,value:X,onChange:e=>W(e.target.value),children:Y.map(e=>(0,E.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,E.jsx)(y,{size:`sm`,"aria-label":`Scope`,placeholder:X&&X!==`jira`?j[X]:``,value:G,maxLength:80,onChange:e=>K(e.target.value),className:`w-full max-w-[240px] flex-[0_1_240px]`}),(0,E.jsxs)(m,{size:`sm`,type:`submit`,disabled:D||!G.trim(),children:[(0,E.jsx)(_,{"aria-hidden":`true`}),`Read cases`]})]}),r.cases.length?(0,E.jsx)(e,{label:`Test cases`,placeholder:`Find a test case by id or title`,resetKey:V,empty:`Nothing matches.`,tools:(0,E.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,E.jsx)(h,{items:[{id:`manual`,label:`Not automated`,n:Z,alert:!0},{id:`automated`,label:`Automated`,n:r.cases.length-Z},{id:`all`,label:`All`,n:r.cases.length}],value:V,onChange:H})}),head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Case`}),(0,E.jsx)(`th`,{className:`w-[36%] py-1.5 pr-3 font-medium`,children:`Title`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Source`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Automated`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Test`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:ce.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:`py-2 pr-3 pl-3 font-mono text-[12.5px] whitespace-nowrap`,children:/^https?:\/\//i.test(e.url)?(0,E.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id}):e.id}),(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3`,children:(0,E.jsx)(P,{text:e.title||`–`})}),(0,E.jsx)(`td`,{className:`hidden py-2 pr-3 text-[12.5px] whitespace-nowrap @xl:table-cell`,"data-tip":`From ${e.scope}`,children:A[e.source]}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-[12.5px] whitespace-nowrap`,children:(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,"data-tip":e.how===`mapping`?`Its test is in the automated tests' mapping`:e.how===`name`?`A test in the history names its id`:`No automated test names it`,children:[e.automated?(0,E.jsx)(o,{size:15,"aria-hidden":`true`,className:`text-pass`}):(0,E.jsx)(g,{size:15,"aria-hidden":`true`,className:`text-muted`}),e.automated?`Yes`:`No`]})}),(0,E.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 text-[12.5px] text-ink-2 @2xl:table-cell`,children:e.test?(0,E.jsx)(P,{text:e.test,tip:e.file?`${e.test} · ${e.file}`:e.test}):`–`}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:!e.automated&&J(e.draft,`test case`)})]},`${e.source}|${e.id}`))}):(0,E.jsx)(p,{icon:_,title:`No test cases yet`,action:(0,E.jsx)(`a`,{className:l({size:`sm`}),href:c(`settings`,`integrations`),children:`Open Settings`}),children:`Test cases show here from ForgeQE's case index, the automated tests' mapping (.forgeqe/test-cases.json), and the plans, runs or cycles you read above from a connected source.`})]})]})]})]})}export{F as TestDebt};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$ as e,Ao as t,Ar as n,Bn as r,Ct as i,Fi as a,I as o,Io as s,It as c,Li as l,Lt as u,Mi as d,Na as f,No as p,Nt as m,Oa as h,Oo as g,Pt as _,R as v,Rn as y,Sn as b,at as x,et as S,fi as C,ft as w,ga as T,gn as E,gt as D,ht as O,it as k,ja as A,ka as j,lt as M,na as N,pa as ee,pi as P,r as te,si as F,t as I,ut as L,wr as ne,xn as re}from"./frame-eAHxqKfn.js";import{o as ie,r as ae,u as oe}from"./index-COTk3Bz-.js";import{t as se}from"./segmented-BJECij_J.js";import{n as ce}from"./families-q4nF1Fqo.js";import{r as le,s as R,t as ue}from"./logos-DEPdha9g.js";import{d as z,o as de,p as fe,r as B,s as pe,t as me}from"./parts-CVdJRIxI.js";var V=s(p(),1),H=t(),U=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,he={ok:{label:`Ready to start`,tone:`pass`},limits:{label:`Ready, with limits`,tone:`warn`},blocked:{label:`Not possible`,tone:`fail`}},ge={converted:{label:`Converted`,tone:`pass`},partial:{label:`Needs review`,tone:`warn`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`},running:{label:`Running`,tone:`running`}},W={converted:{label:`Converted`,tone:`pass`},written:{label:`Written`,tone:`neutral`},failed:{label:`Failed`,tone:`fail`},blocked:{label:`Not possible`,tone:`warn`},skipped:{label:`Skipped`,tone:`neutral`}},_e={setup:`Set-up`,page:`Page`,test:`Test`},ve={matched:{label:`In the test`,dot:`bg-pass`},missing:{label:`Missing from the test`,dot:`bg-fail`},elided:{label:`Not needed: this branch never runs`,dot:`bg-line-strong`},marked:{label:`Left for a person to finish`,dot:`bg-warn`}},G={web:`Web`,api:`API`,desktop:`Desktop`,mobile:`Mobile`,data:`Data`,mixed:`Mixed`,unsupported:`Not supported`},ye={prepare:`Prepare`,setup:`Set up`,pages:`Pages`,tests:`Tests`,validate:`Validate`,review:`Review`},K=[`prepare`,`setup`,`pages`,`tests`,`validate`,`review`];function be(e,t){if(!t)return 0;if(t.status===`converted`||t.stages?.review.status===`done`)return 100;let n=t.stages?.validate.status===`done`?8:0,r=Math.min(t.units.length,e.units.length);return Math.min(99,Math.round(r/Math.max(1,e.units.length)*90+n))}function xe(e){let t=e?.status||`pending`,n=e?.startedAt&&e?.endedAt?z(Date.parse(e.endedAt)-Date.parse(e.startedAt)):``;return t===`running`?e?.startedAt?`Running · ${z(Date.now()-Date.parse(e.startedAt))}`:`Running`:t===`done`?e?.note||(n?`Done · ${n}`:`Done`):t===`failed`?e?.note||`Did not finish`:t===`skipped`?e?.note||`Skipped`:`Waiting`}function Se({states:e}){return(0,H.jsx)(`ol`,{"aria-label":`Stages`,className:`m-0 flex w-full min-w-0 list-none items-center gap-1 p-0 @xl:gap-2`,children:K.map((t,n)=>{let r=e?.[t],i=r?.status||`pending`,a=i===`done`||i===`skipped`,o=i===`running`||i===`failed`,s=xe(r);return(0,H.jsxs)(`li`,{"data-tip":`${ye[t]}: ${s}`,className:f(`relative flex items-center gap-1 @xl:gap-2`,n<K.length-1&&`flex-1`),"aria-current":i===`running`?`step`:void 0,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:f(`inline-flex size-5 flex-none items-center justify-center rounded-full text-[11px] font-semibold tabular-nums @xl:size-6`,a?`bg-pass text-white`:i===`running`?`border-2 border-accent bg-accent-soft text-accent-fg`:i===`failed`?`bg-fail text-white`:`border border-line bg-bg text-muted`),children:a?(0,H.jsx)(y,{size:12,strokeWidth:3}):i===`failed`?(0,H.jsx)(j,{size:12,strokeWidth:3}):i===`running`?(0,H.jsx)(P,{size:12,strokeWidth:2.5,className:`animate-spin`}):n+1}),(0,H.jsxs)(`span`,{className:f(`flex-none text-[13px] whitespace-nowrap`,o?`inline`:`hidden @xl:inline`,i===`running`?`font-medium text-accent-fg`:i===`failed`?`font-medium text-fail`:i===`pending`?`text-muted`:`text-ink`),children:[ye[t],o&&(0,H.jsx)(`span`,{className:`ml-1.5 hidden font-normal text-muted @3xl:inline`,children:s})]}),(0,H.jsxs)(`span`,{className:`sr-only`,children:[ye[t],`: `,s]}),n<K.length-1&&(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 min-w-4 flex-1 overflow-hidden rounded-full bg-line @xl:min-w-8`,children:(0,H.jsx)(`span`,{className:f(`block h-full rounded-full bg-pass transition-[width] duration-500`,a?`w-full`:`w-0`)})})]},t)})})}function q(e){return e?`literal`in e?JSON.stringify(e.literal):`env`in e?`env ${String(e.env)}${e.secret?` (secret)`:``}`:`var`in e?`variable ${String(e.var)}`:`param`in e?`parameter ${String(e.param)}`:`data`in e?`test data ${String(e.data)}`:`expr`in e?`expression ${String(e.expr)}`:`concat`in e&&Array.isArray(e.concat)?e.concat.map(q).join(` + `):``:``}function Ce(e){let t=e.target?e.target.slice(e.target.indexOf(`.`)+1).replace(/_/g,` `):``;if(e.kind===`action`){let n=e.op===`navigate`?`Open ${q(e.value)}`:e.op===`close`?`Close the browser`:e.op===`fill`?`Fill ${t} with ${q(e.value)}`:e.op===`press`?`Press ${e.key} on ${t}`:e.op===`select`?`Select in ${t}`:`${e.op[0].toUpperCase()}${e.op.slice(1)} ${t}`;return e.optional?`${n} (if it is there)`:n}return e.kind===`assert`?`Check ${t} ${e.op===`text`||e.op===`value`?`${e.match===`contains`?`contains`:`is`} ${q(e.expected)}`:`is ${e.op}`}${e.wait?`, waiting`:``}`:e.kind===`store`?`Read ${t} into ${e.var}`:e.kind===`set_var`?`Set ${e.var} to ${q(e.value)}`:e.kind===`wait`?`Wait ${e.ms} ms`:e.kind===`unsupported`?e.reason||`Cannot be converted`:e.name||e.kind}var we={before:`Before`,after:`After`,block:`Reusable block`,folder:`Folder`};function Te({nodes:e,status:t,pick:n,onPick:r,depth:i=0}){return(0,H.jsx)(`ul`,{className:f(`m-0 flex list-none flex-col p-0`,i>0&&`ml-3 border-l border-line-soft pl-3`),children:e.map((e,a)=>{if(e.kind===`group`)return(0,H.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,H.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[we[e.role||`folder`]||`Folder`,`: `,(0,H.jsx)(`span`,{className:`text-ink-2`,children:e.name})]}),(0,H.jsx)(Te,{nodes:e.body||[],status:t,pick:n,onPick:r,depth:i+1})]},`g${a}`);if(e.kind===`if`||e.kind===`loop`){let o=e.condition;return(0,H.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,H.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[e.kind===`if`?`If`:`Loop`,` `,e.name,`: `,(0,H.jsx)(`code`,{className:`font-mono text-[12px] text-ink-2`,children:o?.tosca}),o?.constant!==void 0&&(0,H.jsxs)(`span`,{children:[` · always `,o.constant?`true`:`false`]})]}),[`then`,`else`,`loop`].map(a=>e[a]?.length?(0,H.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,H.jsx)(`span`,{className:`ml-3 text-[12px] text-muted`,children:a===`then`?`Then`:a===`else`?`Else`:`Each time`}),(0,H.jsx)(Te,{nodes:e[a],status:t,pick:n,onPick:r,depth:i+1})]},a):null)]},`i${a}`)}let o=e.id?t.get(e.id):void 0,s=o?ve[o]:void 0;return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":n===e.id,onClick:()=>r(e),className:f(`flex w-full min-w-0 cursor-pointer items-start gap-2 rounded-[8px] border-0 px-2 py-1.5 text-left text-[13px]`,n===e.id?`bg-accent-soft`:`bg-transparent hover:bg-surface-muted`),children:[(0,H.jsx)(`span`,{role:`img`,"aria-label":s?.label||`Not converted yet`,"data-tip":s?.label||`Not converted yet`,className:f(`mt-1.5 size-2 flex-none rounded-full`,s?.dot||`bg-line`)}),(0,H.jsx)(`span`,{className:`w-9 flex-none font-mono text-[12px] text-muted`,children:e.id}),(0,H.jsxs)(`span`,{className:f(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`unsupported`?`text-warn`:`text-ink`),children:[Ce(e),e.tosca?.step&&(0,H.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[`Tosca step "`,e.tosca.step,`"`]})]})]})},e.id||a)})})}function Ee(e,t){for(let n of e){if(n.id===t)return n;for(let e of[`body`,`then`,`else`,`loop`]){let r=n[e]&&Ee(n[e],t);if(r)return r}}}function De({view:e,pick:t}){let n=e.target,r=n?.text||``,i=r.split(`
|
|
2
|
-
`),a=(0,V.useMemo)(()=>r?oe(r,n?.lang||`plaintext`):null,[r,n?.lang]),o=(0,V.useMemo)(()=>{if(!t)return new Set;let e=RegExp(`tosca:[\\sn\\d,]*\\b${t}\\b`,`i`);return new Set(i.flatMap((t,n)=>e.test(t)?[n]:[]))},[t,r]),s=(0,V.useRef)(null);(0,V.useEffect)(()=>{s.current?.scrollIntoView({block:`center`,behavior:`smooth`})},[t,o.size]);let c=Math.min(...o);return(0,H.jsxs)(`figure`,{className:`m-0 flex min-h-0 min-w-0 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,H.jsxs)(`figcaption`,{className:`flex min-h-10 items-center gap-2 border-b border-line-soft pr-1 pl-3`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[0.04em] text-muted uppercase`,children:`Converted test`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[12px] text-ink-2`,"data-tip":n?.path,children:n?.path||``}),r&&(0,H.jsx)(ie,{text:r,label:`Copy ${n?.path||`the test`}`})]}),r?(0,H.jsxs)(`div`,{className:`flex min-h-[260px] flex-1 overflow-auto font-mono text-[12.5px] leading-[1.6]`,children:[(0,H.jsx)(`pre`,{"aria-hidden":`true`,className:`m-0 min-h-full flex-none self-stretch border-r border-line-soft py-3 text-right text-muted select-none`,children:i.map((e,t)=>(0,H.jsx)(`span`,{ref:t===c?s:void 0,className:f(`block px-3`,o.has(t)&&`bg-accent-soft font-semibold text-accent-fg`),children:t+1},t))}),(0,H.jsx)(`pre`,{className:`m-0 min-w-0 flex-1 px-3 py-3`,children:(0,H.jsx)(`code`,{className:`hljs`,children:a})})]}):(0,H.jsx)(`p`,{className:`m-0 flex min-h-[260px] flex-1 items-center justify-center px-4 text-center text-sm text-muted`,children:n?`Not written yet.`:`This test case is left out of the plan.`}),t&&r&&(0,H.jsx)(`p`,{role:`status`,className:`m-0 border-t border-line-soft px-3 py-2 text-[12.5px] text-muted`,children:o.size?`${t} is done on line ${[...o].map(e=>e+1).join(`, `)}.`:`No line of the test is marked ${t}.`})]})}function Oe({view:e,node:t}){if(!t?.target)return null;let[n,r]=t.target.split(`.`),i=e.pages.find(e=>e.id===n),a=i?.elements.find(e=>e.id===r);return a?(0,H.jsxs)(`section`,{"aria-label":`Locators Tosca recorded`,className:`flex flex-col gap-2 rounded-[12px] card border px-4 py-3 text-[13px]`,children:[(0,H.jsxs)(`span`,{className:`font-medium`,children:[a.name,` `,(0,H.jsxs)(`span`,{className:`font-normal text-muted`,children:[`on `,i?.name,a.scope?.length?`, inside ${a.scope.join(` › `)}`:``,a.nth===void 0?``:`, number ${a.nth+1}`]})]}),a.locators.length?(0,H.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:a.locators.slice(0,6).map((e,t)=>(0,H.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`w-14 flex-none text-[12px] text-muted`,children:e.strategy}),(0,H.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:e.strategy===`role`?`${e.role} "${e.name}"`:e.attr?`[${e.attr}="${e.value}"]`:e.value}),e.fragile&&(0,H.jsx)(O,{tone:`warn`,children:`Fragile`})]},t))}):(0,H.jsx)(`span`,{className:`text-muted`,children:`Tosca recorded no locator for it.`})]}):null}function ke({id:e,plan:t,result:n,initial:r}){let i=t.cases.filter(e=>e.included),[a,o]=(0,V.useState)(``),[s,c]=(0,V.useState)(r||i[0]?.id||``),[l,u]=(0,V.useState)(null),[d,p]=(0,V.useState)(``),[m,h]=(0,V.useState)(``);(0,V.useEffect)(()=>{s&&(h(``),g.case(e,s).then(u,e=>h(e.message)))},[e,s,n?.units.length,n?.status]),(0,V.useEffect)(()=>{p(``)},[s]);let _=new Map((l?.fidelity||[]).map(e=>[e.id,e.status])),v=i.filter(e=>!a||e.name.toLowerCase().includes(a.toLowerCase())),y=e=>n?.units.find(t=>t.kind===`test`&&t.case===e);return i.length?(0,H.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] gap-4 @5xl:h-[calc(var(--screen)-320px)] @5xl:min-h-[540px] @5xl:grid-cols-[220px_minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,H.jsxs)(`nav`,{"aria-label":`Test cases`,className:`flex max-h-[320px] min-h-0 min-w-0 flex-col gap-2 overflow-hidden rounded-[14px] card border p-3 @5xl:max-h-none`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-1`,children:[(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:`Test cases`}),(0,H.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[i.filter(e=>y(e.id)?.status===`converted`).length,` converted · `,i.filter(e=>[`failed`,`blocked`].includes(y(e.id)?.status||``)).length,` failed · `,U(i.length,`test case`)]})]}),(0,H.jsx)(M,{id:`find-a-case`,label:`Find a test case`,value:a,onChange:o,className:`max-w-none flex-none`}),(0,H.jsxs)(`ul`,{className:`m-0 flex min-h-0 flex-1 list-none flex-col gap-0.5 overflow-y-auto p-0`,children:[v.map(e=>{let t=y(e.id);return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":s===e.id,onClick:()=>c(e.id),className:f(`flex w-full cursor-pointer items-start gap-2 rounded-[8px] border-0 px-2 py-1.5 text-left text-[13px]`,s===e.id?`bg-accent-soft text-ink`:`bg-transparent text-ink-2 hover:bg-surface-muted`),children:[(0,H.jsx)(`span`,{role:`img`,"aria-label":t?W[t.status].label:`Waiting`,className:f(`mt-1.5 size-2 flex-none rounded-full`,t?.status===`converted`?`bg-pass`:t?.status===`failed`?`bg-fail`:t?.status===`blocked`?`bg-warn`:`bg-line`)}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.name,(0,H.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[U(e.steps,`step`),` · `,U(e.asserts,`check`),t?.fidelity?` · ${t.fidelity.matched}/${t.fidelity.required} in the test`:``]})]})]})},e.id)}),!v.length&&(0,H.jsx)(`li`,{className:`px-2 py-3 text-[13px] text-muted`,children:`No test case matches.`})]})]}),(0,H.jsxs)(`section`,{"aria-label":`Tosca steps`,className:`flex min-h-[360px] min-w-0 flex-col gap-3 overflow-hidden`,children:[m&&(0,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:m}),(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,H.jsxs)(`header`,{className:`flex min-h-10 flex-wrap items-center gap-2 border-b border-line-soft px-3 py-1.5`,children:[(0,H.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[0.04em] text-muted uppercase`,children:`Tosca steps`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:l?.name}),l&&t.cases.find(e=>e.id===s)&&(0,H.jsx)(`span`,{className:`text-[12px] text-muted`,children:G[t.cases.find(e=>e.id===s).route]||``})]}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:l?(0,H.jsx)(Te,{nodes:l.body,status:_,pick:d,onPick:e=>p(e.id||``)}):m?(0,H.jsx)(`p`,{className:`m-0 px-2 text-sm text-muted`,children:`Nothing to show.`}):(0,H.jsx)(`p`,{role:`status`,className:`m-0 px-2 text-sm text-muted`,children:`Loading…`})}),l&&(l.env.length>0||l.warnings.length>0)&&(0,H.jsxs)(`footer`,{className:`flex flex-col gap-1 border-t border-line-soft px-3 py-2 text-[12.5px] text-ink-2`,children:[l.env.length>0&&(0,H.jsxs)(`span`,{children:[`Environment variables: `,l.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`.`]}),l.warnings.slice(0,3).map(e=>(0,H.jsx)(`span`,{className:`text-warn`,children:e},e))]})]}),l&&(0,H.jsx)(Oe,{view:l,node:Ee(l.body,d)})]}),l?(0,H.jsx)(De,{view:l,pick:d}):(0,H.jsx)(`p`,{className:`m-0 flex min-h-[260px] items-center justify-center rounded-[12px] card border px-4 text-center text-sm text-muted`,children:m?`Nothing to show.`:`Loading…`})]}):(0,H.jsx)(D,{center:!0,className:`py-6`,children:`No test case of this plan is converted.`})}function Ae(e){if(e.job?.running)return{label:e.job.kind===`fix`?`Fixing`:e.job.kind===`verify`?`Running tests`:`Running`,tone:`running`};let t=e.result;return t?.status===`running`?{label:t.stage===`validate`?`Validating`:`Running`,tone:`running`}:t?ge[t.status]:e.job?.last?{label:`Did not start`,tone:`fail`}:e.confirmed?{label:`Confirmed`,tone:`neutral`}:he[e.plan.feasibility.verdict]}var J=e=>e.slice(e.lastIndexOf(`/`)+1);function je({id:e,title:t,targetDir:n,onClose:r}){let[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(!1),[l,d]=(0,V.useState)(``),f=async()=>{s(!0),d(``);try{await g.delete(e,i),location.hash=u(`tosca`)}catch(e){d(e.message),s(!1)}};return(0,H.jsx)(c,{open:!0,onClose:r,title:`Delete this conversion`,description:`${t}. Removes the plan and its run history from the list. Files already written under ${n} stay.`,footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(A,{variant:`ghost`,onClick:r,children:`Keep it`}),(0,H.jsxs)(A,{variant:`danger`,disabled:o||i!==e,onClick:()=>void f(),children:[(0,H.jsx)(ee,{"aria-hidden":`true`}),`Delete`]})]}),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,H.jsxs)(`span`,{children:[`Type `,(0,H.jsx)(`span`,{className:`font-mono`,children:e}),` to confirm`]}),(0,H.jsx)(L,{value:i,onChange:e=>a(e.target.value),autoComplete:`off`,spellCheck:!1})]}),l?(0,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:l}):null]})})}function Me({d:e,unit:t,onClose:n,onSend:r}){let[i,a]=(0,V.useState)(``),o=e.plan.units.find(e=>e.id===t),s=e.result?.units.find(e=>e.id===t);return(0,H.jsx)(c,{open:!0,onClose:n,title:`Fix ${o?J(o.target):t}`,description:`The Tosca agent works on this file again, with ForgeQE's last check and your note. It runs in the background.`,footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(A,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,H.jsxs)(A,{variant:`primary`,onClick:()=>r(i.trim()),children:[(0,H.jsx)(h,{"aria-hidden":`true`}),`Send to the agent`]})]}),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[s?.problems?.length?(0,H.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:s.problems[0]}):null,(0,H.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:`What should change? (optional)`}),(0,H.jsx)(w,{value:i,rows:4,maxLength:2e3,placeholder:`The cart badge is a span now, not a button.`,onChange:e=>a(e.target.value)})]})]})})}function Ne({d:e,unit:t,onClose:n}){let r=e.result?.units.find(e=>e.id===t),i=e.plan.units.find(e=>e.id===t);return(0,H.jsx)(c,{open:!0,onClose:n,wide:!0,title:`Output of ${i?J(i.target):t}`,description:r?.checkedAt?`Run again ${fe(r.checkedAt)}`:`From the conversion's own run`,footer:(0,H.jsx)(A,{onClick:n,children:`Close`}),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[r?.problems?.length?(0,H.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r.problems.join(` `)}):r?.status===`converted`?(0,H.jsx)(`p`,{className:`m-0 text-sm text-pass`,children:`Passes, with every Tosca step in the test.`}):null,r?.command&&(0,H.jsxs)(`code`,{className:`block font-mono text-[12px] text-muted`,children:[`$ `,r.command]}),(0,H.jsx)(`pre`,{className:`m-0 max-h-[60vh] overflow-auto rounded-[12px] bg-surface-muted px-3 py-2 font-mono text-[12.5px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:r?.output||`No output.`})]})})}function Pe(e){let t=Object.fromEntries(K.map(e=>[e,{status:e===`prepare`?`running`:`pending`,...e===`prepare`?{startedAt:new Date().toISOString()}:{}}]));return{status:`running`,plan:e.plan.id,target:e.plan.target,units:[],reverted:[],model:``,startedAt:e.job?.last?.startedAt||new Date().toISOString(),ms:0,stage:`prepare`,stages:t,notes:``}}function Fe({d:t,planView:r,busy:i,onFix:a,onSteps:o,onOutput:s,onRun:c}){let l=t.result||(t.job?.running?Pe(t):null);if(!l)return(0,H.jsx)(H.Fragment,{children:r});let u=new Map(l.units.map(e=>[e.id,e])),p=t.plan.units.filter(e=>e.kind===`test`),m=l.units.filter(e=>e.kind===`test`&&e.status===`converted`).length,g=l.units.reduce((e,t)=>t.fidelity?{m:e.m+t.fidelity.matched,n:e.n+t.fidelity.required}:e,{m:0,n:0}),_=l.units.filter(e=>e.status===`failed`||e.status===`blocked`).length,[v,...y]=t.plan.target.id.split(`-`);return(0,H.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,H.jsxs)(de,{children:[(0,H.jsx)(B,{label:`Tests passing`,value:`${m} / ${p.length}`,tone:m===p.length&&p.length?`text-pass`:void 0}),(0,H.jsx)(B,{label:`Tosca steps in the tests`,value:g.n?`${g.m} / ${g.n}`:`–`,tone:g.n&&g.m===g.n?`text-pass`:void 0}),(0,H.jsx)(B,{label:`Need attention`,value:_,tone:_?`text-fail`:void 0}),(0,H.jsx)(B,{label:l.status===`running`?`Running for`:`Took`,value:z(l.status===`running`?Date.now()-Date.parse(l.startedAt):l.ms)})]}),l.notes&&(0,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:l.notes}),(0,H.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-5 @5xl:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,H.jsx)(e,{label:`Files`,placeholder:`Find a file`,empty:`No files.`,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{className:`py-2 pr-3 pl-3 font-medium`,children:`File`}),(0,H.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:`Status`}),(0,H.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @2xl:table-cell`,children:`Tosca steps`}),(0,H.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @3xl:table-cell`,children:`Note`}),(0,H.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:(0,H.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:t.plan.units.map(e=>{let r=u.get(e.id),c=r?W[r.status]:null,l=e.case?t.plan.cases.find(t=>t.id===e.case):void 0;return(0,H.jsxs)(`tr`,{className:k,children:[(0,H.jsxs)(`td`,{className:S,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.kind===`setup`?`Project set-up`:J(e.target)}),(0,H.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[l?l.name:`${_e[e.kind]} · ${e.target}`,l?.suites?.length?` · ${l.suites.join(`, `)}`:``]})]}),(0,H.jsxs)(`td`,{className:f(S,`whitespace-nowrap`),children:[c?(0,H.jsx)(O,{tone:c.tone,children:c.label}):(0,H.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Waiting`}),r?.checkedAt&&(0,H.jsxs)(`span`,{className:`block pt-1 text-[12px] text-muted`,children:[`Run again `,ae(r.checkedAt)]})]}),(0,H.jsx)(`td`,{className:f(S,`hidden text-[13px] whitespace-nowrap @2xl:table-cell`),children:r?.fidelity?(0,H.jsxs)(`span`,{className:r.fidelity.missing.length?`text-fail`:`text-ink-2`,children:[r.fidelity.matched,` of `,r.fidelity.required]}):(0,H.jsx)(`span`,{className:`text-muted`,children:`–`})}),(0,H.jsx)(`td`,{className:f(S,`hidden text-[13px] text-ink-2 @3xl:table-cell`),children:(0,H.jsx)(`span`,{className:`line-clamp-2`,children:r?.problems?.[0]||r?.reason||``})}),(0,H.jsx)(`td`,{className:f(S,`whitespace-nowrap text-right`),children:(0,H.jsxs)(`span`,{className:`inline-flex gap-1`,children:[e.kind===`test`&&(r?.output||r?.problems?.length)&&(0,H.jsxs)(A,{size:`sm`,variant:`ghost`,"aria-label":`Output of ${J(e.target)}`,onClick:()=>s(e.id),children:[(0,H.jsx)(n,{"aria-hidden":`true`}),`Output`]}),e.case&&(0,H.jsxs)(A,{size:`sm`,variant:`ghost`,"aria-label":`Steps of ${J(e.target)}`,onClick:()=>o(e.case),children:[(0,H.jsx)(C,{"aria-hidden":`true`}),`Steps`]}),r&&(r.status===`failed`||r.status===`blocked`)&&e.kind!==`setup`&&(0,H.jsxs)(A,{size:`sm`,disabled:i,"aria-label":`Fix ${J(e.target)}`,onClick:()=>a(e.id),children:[(0,H.jsx)(h,{"aria-hidden":`true`}),`Fix`]})]})})]},e.id)})}),(0,H.jsxs)(`aside`,{"aria-label":`Details`,className:`flex flex-col gap-4 rounded-[14px] card border p-5 text-sm`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`From`}),(0,H.jsxs)(`span`,{className:`font-medium`,children:[`Tricentis Tosca`,t.plan.source.project?` · ${t.plan.source.project}`:``]}),(0,H.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:t.plan.source.file})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,H.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`To`}),(0,H.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(R,{framework:v,language:y.join(`-`)}),t.plan.target.title]}),(0,H.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:t.targetPath})]}),(t.plan.suites||[]).length>0&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,H.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Suites`}),(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1.5 p-0`,children:t.plan.suites.map(e=>{let t=new Set(e.cases),n=l.units.filter(e=>e.kind===`test`&&e.case&&t.has(e.case)&&e.status===`converted`).length;return(0,H.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate`,children:e.name}),(0,H.jsxs)(`span`,{className:f(`text-[12px]`,n===e.cases.length?`text-pass`:`text-muted`),children:[n,` of `,U(e.cases.length,`test`),` pass · @`,e.tag]})]}),(0,H.jsxs)(A,{size:`sm`,variant:`ghost`,disabled:i,"aria-label":`Run the ${e.name} suite`,onClick:()=>c(e.name),children:[(0,H.jsx)(d,{"aria-hidden":`true`}),`Run`]})]},e.name)})})]}),t.plan.env.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,H.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Environment variables`}),(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:t.plan.env.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-col`,children:[(0,H.jsxs)(`span`,{className:`font-mono text-[12px]`,children:[e.name,e.secret?(0,H.jsx)(`span`,{className:`font-sans text-muted`,children:` · secret`}):null]}),(0,H.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.from})]},e.name))})]}),(0,H.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 border-t border-line-soft pt-4`,children:[(0,H.jsx)(`dt`,{className:`text-muted`,children:`Started`}),(0,H.jsx)(`dd`,{className:`m-0 text-right`,children:fe(l.startedAt)}),l.model&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{className:`text-muted`,children:`Agent`}),(0,H.jsx)(`dd`,{className:`m-0 truncate text-right`,"data-tip":l.model,children:l.model})]}),l.reverted.length>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{className:`text-muted`,children:`Put back`}),(0,H.jsxs)(`dd`,{className:`m-0 text-right`,children:[l.reverted.length,` edits outside the target`]})]})]})]})]})]})}var Ie={ok:{mark:`✓`,cls:`text-pass`},fail:{mark:`✗`,cls:`text-fail`},info:{mark:`•`,cls:`text-muted`},agent:{mark:`•`,cls:`text-accent-fg`},tool:{mark:`·`,cls:`text-muted`}};function Le({events:e,running:t}){let n=(0,V.useRef)(null);(0,V.useEffect)(()=>{t&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e.length,t]);let r=e.filter(e=>e.kind!==`tool`);return(0,H.jsxs)(`ol`,{ref:n,"aria-live":t?`polite`:void 0,"aria-label":`Activity`,className:`m-0 flex max-h-[60vh] list-none flex-col overflow-y-auto rounded-[12px] card border p-0`,children:[r.map((e,t)=>(0,H.jsxs)(`li`,{className:`flex gap-3 border-b border-line-soft px-4 py-2 text-[13px] last:border-b-0`,children:[(0,H.jsx)(`span`,{className:`w-[64px] flex-none text-[12px] text-muted tabular-nums`,children:new Date(e.ts).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:f(`w-3 flex-none text-center`,Ie[e.kind].cls),children:Ie[e.kind].mark}),(0,H.jsx)(`span`,{className:f(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`fail`?`text-fail`:e.kind===`ok`?`text-ink`:`text-ink-2`),children:e.text})]},t)),!r.length&&(0,H.jsx)(`li`,{className:`px-4 py-8 text-center text-sm text-muted`,children:`Nothing yet.`})]})}function Re({id:e,plan:t}){let[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(`overview`),[c,d]=(0,V.useState)(),[f,p]=(0,V.useState)(null),[m,h]=(0,V.useState)(null),[_,v]=(0,V.useState)([]),[y,x]=(0,V.useState)(!1),[S,C]=(0,V.useState)(!1),w=(0,V.useRef)(0),T=(0,V.useCallback)(()=>{g.detail(e).then(e=>{r(e),a(``)},e=>a(e.message)),g.events(e,w.current).then(e=>{e.next<w.current?(w.current=0,v([])):(w.current=e.next,e.events.length&&v(t=>[...t,...e.events].slice(-2e3)))},()=>{})},[e]);(0,V.useEffect)(T,[T]);let E=!!(n?.job?.running||n?.result?.status===`running`);(0,V.useEffect)(()=>{if(!E)return;let e=setInterval(T,1500);return()=>clearInterval(e)},[E,T]);let D=(0,V.useCallback)(e=>{r(e),a(``),s(`overview`),setTimeout(T,800)},[T]),k=async e=>{x(!0),a(``);try{r(await e()),setTimeout(T,800)}catch(e){a(e.message)}finally{x(!1)}};if(!n)return i?(0,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}):(0,H.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});let j=Ae(n),M=be(n.plan,n.result),P=n.result,te=(P?.units||[]).filter(e=>e.kind===`test`&&(e.status===`failed`||e.status===`blocked`)).length,F=n.plan.cases.filter(e=>e.included).length,I=[{id:`overview`,label:`Overview`},{id:`steps`,label:`Steps`,n:F?String(F):void 0,tone:te?`text-fail`:void 0},{id:`activity`,label:`Activity`}];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`a`,{href:u(`tosca`),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,H.jsx)(re,{size:16,"aria-hidden":`true`}),`Tosca`]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 @3xl:flex-row @3xl:items-start`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,H.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:J(n.plan.source.file)}),(0,H.jsx)(b,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,H.jsx)(R,{framework:n.plan.target.id.split(`-`)[0],language:n.plan.target.id.split(`-`).slice(1).join(`-`),size:20}),n.plan.target.title]})]}),(0,H.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-1.5 text-sm text-muted`,children:[(0,H.jsxs)(`span`,{children:[`Tricentis Tosca`,n.plan.source.project?` · ${n.plan.source.project}`:``]}),(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,H.jsxs)(`span`,{children:[`into `,(0,H.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:n.plan.target.dir})]})]})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(O,{tone:j.tone,children:j.label}),E?(0,H.jsxs)(A,{variant:`danger`,disabled:y,onClick:()=>void k(()=>g.stop(e)),children:[(0,H.jsx)(N,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]}):(0,H.jsxs)(H.Fragment,{children:[P?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(A,{variant:`ghost`,onClick:()=>location.hash=u(`tosca`,e,`report`),children:`Report`}),(0,H.jsxs)(A,{disabled:y,onClick:()=>void k(()=>g.verify(e)),"data-tip":`Run every converted test again, no agent`,children:[(0,H.jsx)(l,{"aria-hidden":`true`}),`Run tests again`]})]}):null,(0,H.jsxs)(A,{variant:`ghost`,disabled:y,onClick:()=>C(!0),"data-tip":`Remove this plan from the list. Converted tests stay.`,children:[(0,H.jsx)(ee,{"aria-hidden":`true`}),`Delete`]})]})]})]}),S&&(0,H.jsx)(je,{id:e,title:`${J(n.plan.source.file)} → ${n.plan.target.title}`,targetDir:n.plan.target.dir,onClose:()=>C(!1)}),P&&(0,H.jsxs)(`div`,{className:`flex items-center gap-3 rounded-[12px] card border px-3 py-2.5 @xl:gap-4 @xl:px-4`,children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(Se,{states:P.stages})}),E&&(0,H.jsxs)(`span`,{className:`flex-none text-[13px] font-semibold tabular-nums text-accent-fg`,"aria-label":`${Math.round(M)}% done`,children:[Math.round(M),`%`]})]}),i&&(0,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}),(0,H.jsx)(pe,{tabs:I,tab:o,onTab:s,label:`Tosca conversion`}),(0,H.jsxs)(`div`,{role:`tabpanel`,id:`mpanel-${o}`,"aria-labelledby":`mtab-${o}`,className:`flex min-w-0 flex-col gap-4`,children:[o===`overview`&&(0,H.jsx)(Fe,{d:n,planView:t(n,D),busy:y||E,onFix:p,onSteps:e=>(d(e),s(`steps`)),onOutput:h,onRun:t=>void k(()=>g.verify(e,t))}),o===`steps`&&(0,H.jsx)(ke,{id:e,plan:n.plan,result:P,initial:c}),o===`activity`&&(0,H.jsx)(Le,{events:_,running:E})]}),m&&(0,H.jsx)(Ne,{d:n,unit:m,onClose:()=>h(null)}),f&&(0,H.jsx)(Me,{d:n,unit:f,onClose:()=>p(null),onSend:t=>{p(null),k(()=>g.fix(e,[f],t))}})]})}var ze=e=>e.slice(e.lastIndexOf(`/`)+1),Be={prepare:`Prepare`,setup:`Set up`,pages:`Pages`,tests:`Tests`,validate:`Validate`,review:`Review`};function Ve(e){return e===`converted`?W.converted:e===`failed`?W.failed:e===`blocked`?W.blocked:e===`left out`||e===`skipped`||e===`not run`?{label:e===`left out`?`Left out`:e===`not run`?`Not run`:`Skipped`,tone:`neutral`}:{label:e,tone:`neutral`}}function He(e){for(let t of K){let n=e[t];if(n?.status===`failed`)return{id:t,...n.note?{note:n.note}:{}}}return null}function Ue({title:e,children:t,defaultOpen:n}){let[i,a]=(0,V.useState)(!!n),o=(0,V.useId)();return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":o,onClick:()=>a(!i),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 self-start rounded-[8px] border-0 bg-transparent px-1 text-sm font-medium text-ink hover:bg-surface-strong`,children:[(0,H.jsx)(r,{size:15,"aria-hidden":`true`,className:f(`transition-transform`,i&&`rotate-180`)}),e]}),(0,H.jsx)(_,{open:i,id:o,children:t})]})}function We({planId:e,unit:t,file:n}){let[r,i]=(0,V.useState)(``),[a,o]=(0,V.useState)(!1),s=/\.(webm|mp4)$/i.test(n);return(0,V.useEffect)(()=>{let r=!1;return i(``),o(!1),g.evidence(e,t,n).then(e=>!r&&i(e),()=>!r&&o(!0)),()=>{r=!0}},[e,t,n]),(0,H.jsxs)(`li`,{className:`flex max-w-[320px] flex-col gap-1`,children:[r?s?(0,H.jsx)(`video`,{controls:!0,src:r,className:`max-h-[220px] w-full rounded-[10px] border border-line-soft bg-surface-muted`}):(0,H.jsx)(`img`,{src:r,alt:n,className:`max-h-[220px] w-full rounded-[10px] border border-line-soft object-contain`}):(0,H.jsx)(`span`,{className:`flex h-[120px] items-center justify-center rounded-[10px] border border-line-soft bg-surface-muted text-[12px] text-muted`,children:a?`Not available`:`Loading…`}),(0,H.jsx)(`span`,{className:`font-mono text-[11px] text-muted`,children:n})]})}function Ge({planId:e,unit:t,files:n}){return!t||!n.length?null:(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-3 p-0`,children:n.map(n=>(0,H.jsx)(We,{planId:e,unit:t,file:n},n))})}function Ke({planId:e,t}){let n=t.fidelity,r=t.status===`failed`||t.status===`blocked`,i=t.problems?.length?t.problems.join(` `):r&&t.reason?t.reason:``;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-[14px] card border p-5`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:t.name}),(0,H.jsxs)(`p`,{className:`m-0 pt-1 text-[13px] text-muted`,children:[t.file?(0,H.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:t.file}):`No file`,t.suites.length?` · ${t.suites.join(`, `)}`:``,t.folders.length?` · ${t.folders.join(` / `)}`:``]})]}),(0,H.jsx)(O,{tone:Ve(t.status).tone,children:Ve(t.status).label}),t.ms>0&&(0,H.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:z(t.ms)})]}),i&&(0,H.jsx)(`p`,{role:`status`,className:f(`m-0 rounded-[10px] px-3 py-2 text-sm [overflow-wrap:anywhere]`,r?`bg-fail-soft text-fail`:`bg-surface-muted text-ink-2`),children:i}),n&&n.rows.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[`Tosca steps (`,n.matched,` of `,n.required,`)`]}),(0,H.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[10px] border border-line-soft p-0 text-[13px]`,children:n.rows.map(e=>{let t=ve[e.status]||ve.matched;return(0,H.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-3 border-b border-line-soft px-3 py-2 last:border-b-0`,children:[(0,H.jsx)(`span`,{className:f(`mt-1.5 h-2 w-2 flex-none rounded-full`,t.dot),"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`w-12 flex-none font-mono text-[12px] text-muted`,children:e.id}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.kind===`assert`?`check ${e.op}`:e.op,` on `,e.element||`—`,(0,H.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[t.label,e.step?` · Tosca “${e.step}”`:``]})]})]},e.id)})})]}),t.media.length>0?(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Screenshots and video`}),(0,H.jsx)(Ge,{planId:e,unit:t.unit,files:t.media})]}):r?(0,H.jsx)(`p`,{className:`m-0 text-[12.5px] text-muted`,children:`No screenshot or video was kept for this failure.`}):null,t.command&&(0,H.jsxs)(`code`,{className:`block font-mono text-[12px] text-muted`,children:[`$ `,t.command]}),t.output&&(0,H.jsx)(Ue,{title:`Test output`,defaultOpen:r,children:(0,H.jsx)(`pre`,{className:`m-0 max-h-[40vh] overflow-auto rounded-[10px] bg-surface-muted px-3 py-2 font-mono text-[12.5px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:t.output})})]})}function qe({id:t}){let[r,i]=(0,V.useState)(null),[a,s]=(0,V.useState)(``),[c,l]=(0,V.useState)(!0),[d,p]=(0,V.useState)(`all`),[m,h]=(0,V.useState)(``);(0,V.useEffect)(()=>{l(!0),g.report(t).then(e=>{if(i(e.report),s(e.report?``:`No report yet. Start the conversion first.`),l(!1),e.report){let t=e.report.tests.filter(e=>e.status!==`left out`),n=t.find(e=>e.status===`failed`||e.status===`blocked`);h(n?.case||t[0]?.case||``),p(n?`attention`:`all`)}},e=>{s(e.message),l(!1)})},[t]);let _=(0,V.useMemo)(()=>r?r.tests.filter(e=>e.status!==`left out`):[],[r]),y=(0,V.useMemo)(()=>_.filter(e=>!(d===`attention`&&e.status!==`failed`&&e.status!==`blocked`||d===`converted`&&e.status!==`converted`)),[_,d]);if((0,V.useEffect)(()=>{m&&(y.some(e=>e.case===m)||h(y[0]?.case||``))},[y,m]),c)return(0,H.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading report…`});if(a||!r)return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`a`,{href:u(`tosca`,t),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,H.jsx)(re,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a||`No report.`})]});let x=_.filter(e=>e.status===`converted`).length,C=_.filter(e=>e.status===`failed`||e.status===`blocked`).length,w=_.reduce((e,t)=>t.fidelity?{m:e.m+t.fidelity.matched,n:e.n+t.fidelity.required}:e,{m:0,n:0}),T=_.reduce((e,t)=>e+t.media.length,0),E=ge[r.status]||{label:r.status,tone:`neutral`},[D,...A]=r.target.id.split(`-`),j=He(r.stages),M=_.find(e=>e.case===m)||null,N=[{id:`all`,label:`All (${_.length})`},{id:`attention`,label:`Needs attention (${C})`},{id:`converted`,label:`Converted (${x})`}];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`a`,{href:u(`tosca`,t),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,H.jsx)(re,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 @3xl:flex-row @3xl:items-start`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsx)(`p`,{className:`m-0 text-[12px] font-medium tracking-wide text-muted uppercase`,children:`Conversion report`}),(0,H.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,H.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:ze(r.source.file)}),(0,H.jsx)(b,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,H.jsx)(R,{framework:D,language:A.join(`-`),size:20}),r.target.title]})]}),(0,H.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-1.5 text-sm text-muted`,children:[(0,H.jsxs)(`span`,{children:[`Tricentis Tosca`,r.source.project?` · ${r.source.project}`:``]}),(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,H.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:r.id}),(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,H.jsxs)(`span`,{children:[`Started `,fe(r.startedAt)]})]})]}),(0,H.jsx)(O,{tone:E.tone,children:E.label})]}),j&&(0,H.jsxs)(`p`,{role:`status`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[`Failed in `,Be[j.id],j.note?`: ${j.note}`:``]}),(0,H.jsxs)(de,{children:[(0,H.jsx)(B,{label:`Tests passing`,value:`${x} / ${_.length}`,tone:x===_.length&&_.length?`text-pass`:void 0}),(0,H.jsx)(B,{label:`Total time`,value:z(r.ms)}),(0,H.jsx)(B,{label:`Tosca steps`,value:w.n?`${w.m} / ${w.n}`:`–`,tone:w.n&&w.m===w.n?`text-pass`:void 0}),(0,H.jsx)(B,{label:`Media`,value:T,sub:T?`screenshots / video`:`only on failure`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-5 @5xl:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,H.jsx)(e,{label:`Test cases`,placeholder:`Find a test case`,empty:_.length?`No test case matches.`:`No test cases.`,resetKey:d,tools:(0,H.jsx)(`div`,{role:`group`,"aria-label":`Filter test cases`,className:`flex flex-wrap gap-1`,children:N.map(e=>(0,H.jsx)(`button`,{type:`button`,"aria-pressed":d===e.id,onClick:()=>p(e.id),className:f(`min-h-8 cursor-pointer rounded-[8px] border px-2.5 text-[13px]`,d===e.id?`border-accent bg-accent-soft font-medium text-accent-fg`:`border-line bg-transparent text-ink-2 hover:bg-surface-muted`),children:e.label},e.id))}),head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{className:`py-2 pr-3 pl-3 font-medium`,children:`Test case`}),(0,H.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:`Status`}),(0,H.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @2xl:table-cell`,children:`Steps`}),(0,H.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @3xl:table-cell`,children:`Time`})]}),children:y.map(e=>{let t=Ve(e.status),n=m===e.case;return(0,H.jsxs)(`tr`,{className:f(k,`cursor-pointer hover:bg-surface-muted`,n&&`bg-accent-soft`),onClick:()=>h(e.case),"aria-selected":n,children:[(0,H.jsxs)(`td`,{className:S,children:[(0,H.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.name}),(0,H.jsx)(`span`,{className:`block font-mono text-[12px] text-muted`,children:e.file||`No file`})]}),(0,H.jsxs)(`td`,{className:f(S,`whitespace-nowrap`),children:[(0,H.jsx)(O,{tone:t.tone,children:t.label}),e.media.length>0&&(0,H.jsx)(`span`,{className:`block pt-1 text-[12px] text-muted`,children:U(e.media.length,`file`)})]}),(0,H.jsx)(`td`,{className:f(S,`hidden text-[13px] whitespace-nowrap tabular-nums @2xl:table-cell`,e.fidelity?.missing.length?`text-fail`:`text-ink-2`),children:e.fidelity?`${e.fidelity.matched}/${e.fidelity.required}`:`–`}),(0,H.jsx)(`td`,{className:f(S,`hidden text-[13px] whitespace-nowrap text-muted tabular-nums @3xl:table-cell`),children:e.ms>0?z(e.ms):`–`})]},e.case)})}),M?(0,H.jsx)(Ke,{planId:r.id,t:M}):y.length?(0,H.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Select a test case for steps, output, and media.`}):null,r.personSteps.length>0&&(0,H.jsxs)(`section`,{className:`flex flex-col gap-2 rounded-[14px] bg-warn-soft px-5 py-4`,children:[(0,H.jsx)(`h3`,{className:`m-0 text-sm font-semibold text-warn`,children:`Steps a person has to finish`}),(0,H.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-5 text-sm text-ink`,children:r.personSteps.map(e=>(0,H.jsxs)(`li`,{children:[e.case,` / `,e.id,`: Tosca step “`,e.step,`” on “`,e.element,`”`]},`${e.case}-${e.id}`))})]})]}),(0,H.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col gap-4 rounded-[14px] card border p-5 text-sm @5xl:sticky @5xl:top-6`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`From`}),(0,H.jsxs)(`span`,{className:`font-medium`,children:[`Tricentis Tosca`,r.source.project?` · ${r.source.project}`:``]}),(0,H.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:r.source.file}),r.source.baseUrl&&(0,H.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:r.source.baseUrl})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,H.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`To`}),(0,H.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(R,{framework:D,language:A.join(`-`)}),r.target.title]}),(0,H.jsxs)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:[r.target.dir,`/`]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,H.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`LLM`}),(0,H.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:r.model||`—`}),r.usage.input||r.usage.output?(0,H.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-[12.5px]`,children:[(0,H.jsx)(`dt`,{className:`text-muted`,children:`Tokens`}),(0,H.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:v(r.usage.input+r.usage.output)}),(0,H.jsx)(`dt`,{className:`text-muted`,children:`Read`}),(0,H.jsxs)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:[v(r.usage.input),r.usage.cached?(0,H.jsxs)(`span`,{className:`text-muted`,children:[` · `,v(r.usage.cached),` cached`]}):null]}),(0,H.jsx)(`dt`,{className:`text-muted`,children:`Written`}),(0,H.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:v(r.usage.output)}),(0,H.jsx)(`dt`,{className:`text-muted`,children:`Cost`}),(0,H.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:r.cost?(0,H.jsxs)(H.Fragment,{children:[r.cost.estimate?`≈`:``,o(r.cost.amount,r.cost.currency)]}):`—`})]}):(0,H.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`No usage recorded.`})]}),r.env.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,H.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Environment variables`}),(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:r.env.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-col`,children:[(0,H.jsxs)(`span`,{className:`font-mono text-[12px]`,children:[e.name,e.secret?(0,H.jsx)(`span`,{className:`font-sans text-muted`,children:` · secret`}):null]}),(0,H.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.from})]},e.name))})]}),r.reverted.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,H.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Put back`}),(0,H.jsxs)(`span`,{className:`text-[12.5px] text-ink-2`,children:[r.reverted.length,` edit`,r.reverted.length===1?``:`s`,` outside the target`]})]}),r.notes&&(0,H.jsxs)(`p`,{className:`m-0 border-t border-line-soft pt-4 text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:[(0,H.jsx)(n,{size:14,"aria-hidden":`true`,className:`mr-1 inline align-text-bottom`}),r.notes]})]})]})]})}var Je=[`Export`,`Target`,`Instructions`,`Review`],Ye=[`The Tosca export and its test cases`,`Framework and language`,`Your rules, optional`,`Check and start`],Xe=[`Keep one page object per Tosca module, in pages/.`,`Name each test after its Tosca test case.`,`Read the base URL from BASE_URL.`],Ze={playwright:`Microsoft`,cypress:`JavaScript only`,webdriverio:`WebDriver and BiDi`,selenium:`WebDriver`};function Qe({at:e,reached:t,onGo:n}){return(0,H.jsx)(`nav`,{"aria-label":`Steps`,children:(0,H.jsx)(`ol`,{className:`m-0 flex list-none items-center gap-2 p-0`,children:Je.map((r,i)=>{let a=i<=t,o=i===e,s=i<t&&!o;return(0,H.jsxs)(`li`,{className:f(`flex items-center gap-2`,i<Je.length-1&&`flex-1`),children:[(0,H.jsxs)(`button`,{type:`button`,disabled:!a,"aria-current":o?`step`:void 0,onClick:()=>n(i),"aria-label":r,"data-tip":Ye[i],className:f(`inline-flex min-h-8 flex-none items-center gap-2 rounded-[8px] border-0 bg-transparent px-1 text-[13px] whitespace-nowrap`,a&&!o?`cursor-pointer hover:bg-surface-strong`:``),children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:f(`inline-flex size-6 flex-none items-center justify-center rounded-full text-[11px] font-semibold tabular-nums`,s?`bg-pass text-white`:o?`bg-accent text-accent-ink`:`border border-line bg-bg text-muted`),children:s?(0,H.jsx)(y,{size:13,strokeWidth:3}):i+1}),(0,H.jsx)(`span`,{className:f(o?`font-medium text-ink`:a?`text-ink-2`:`text-muted`,!o&&`hidden @xl:inline`),children:r})]}),i<Je.length-1&&(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 min-w-4 flex-1 overflow-hidden rounded-full bg-line @xl:min-w-8`,children:(0,H.jsx)(`span`,{className:f(`block h-full rounded-full bg-pass transition-[width] duration-500`,i<t?`w-full`:`w-0`)})})]},r)})})})}function Y({id:e,label:t,help:n,children:r}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(`label`,{htmlFor:e,className:`text-sm font-medium`,children:t}),r,n&&(0,H.jsx)(`span`,{className:`text-[13px] text-muted`,children:n})]})}function X({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){return(0,H.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-3 border-t border-line-soft bg-bg py-3`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px]`,children:a}),t&&(0,H.jsx)(A,{variant:`ghost`,disabled:e,onClick:t,children:`Back`}),(0,H.jsx)(A,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}function $e({on:e,onPick:t,logo:n,title:r,sub:i,label:a}){return(0,H.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e,"aria-label":a,onClick:t,className:f(`flex min-h-[72px] min-w-0 cursor-pointer items-center gap-3 rounded-[12px] border px-3.5 py-3 text-left transition-colors`,e?`border-accent bg-accent-soft ring-1 ring-accent`:`border-line-soft bg-bg hover:border-line hover:bg-surface-muted`),children:[(0,H.jsx)(`span`,{className:`inline-flex size-9 flex-none items-center justify-center rounded-[10px] bg-surface-muted`,children:n}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate text-sm font-medium text-ink`,children:r}),i&&(0,H.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:i})]})]})}var et=e=>e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;function tt({s:e}){return(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-[12px] bg-surface-muted px-4 py-3 text-sm`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.project||e.file}),(0,H.jsxs)(`span`,{className:`text-ink-2`,children:[U(e.test_cases.length,`test case`),` · `,U(e.pages.length,`module`),` · `,U(e.totals.steps,`step`),` · `,U(e.totals.asserts,`check`)]}),e.suites.length>0&&(0,H.jsxs)(`span`,{className:`text-ink-2`,children:[`· `,U(e.suites.length,`execution list`)]}),e.totals.unsupported>0&&(0,H.jsxs)(`span`,{className:`text-warn`,children:[`· `,e.totals.unsupported===1?`1 step value cannot`:`${e.totals.unsupported} step values cannot`,` be converted`]})]})}function nt({view:e,file:t,setFile:n,found:r,setFound:i,only:a,setOnly:o}){let[s,c]=(0,V.useState)(e.exports.some(e=>e.path===t)?``:t),[l,u]=(0,V.useState)(!1),[d,p]=(0,V.useState)(``),m=async e=>{if(n(e),i(null),p(``),e){u(!0);try{let t=await g.inspect(e);i(t),o(new Set(t.test_cases.filter(e=>e.route===`web`||(e.routes?.web??0)>0).map(e=>e.id)))}catch(e){p(e.message)}finally{u(!1)}}},h=e=>{let t=new Set(a);t.has(e)?t.delete(e):t.add(e),o(t)};return(0,H.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[e.exports.length>0?(0,H.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,H.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Tosca exports in this project`}),(0,H.jsx)(`div`,{role:`radiogroup`,"aria-label":`Tosca exports`,className:`grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2.5`,children:e.exports.map(e=>(0,H.jsx)($e,{on:t===e.path,onPick:()=>void m(e.path),logo:(0,H.jsx)(ne,{size:18,"aria-hidden":`true`,className:`text-ink-2`}),title:e.path.slice(e.path.lastIndexOf(`/`)+1),sub:`${e.path.includes(`/`)?e.path.slice(0,e.path.lastIndexOf(`/`)):`.`} · ${et(e.bytes)}`,label:e.path},e.path))})]}):(0,H.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-3 text-sm text-ink-2`,children:[`No Tosca export (.tsu) in this project yet. Export the test cases from Tosca Commander, put the file inside the project, for example `,(0,H.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:`tosca/checkout.tsu`}),`, and type its path below.`]}),(0,H.jsx)(Y,{id:`tsc-path`,label:e.exports.length?`Or type its path`:`Path of the export`,help:`Inside the project. Secrets in it stay encrypted: they become environment variables.`,children:(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(L,{id:`tsc-path`,value:s,spellCheck:!1,maxLength:300,placeholder:`tosca/checkout.tsu`,onChange:e=>c(e.target.value),className:`min-w-0 flex-[1_1_300px]`}),(0,H.jsx)(A,{disabled:l||!s.trim(),onClick:()=>void m(s.trim()),children:l?`Reading…`:`Read it`})]})}),d&&(0,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:d}),l&&!d&&(0,H.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Reading the export…`}),r&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(tt,{s:r}),(0,H.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,H.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:`Test cases to convert`}),(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:r.test_cases.map(e=>{let t=e.route===`web`||(e.routes?.web??0)>0;return(0,H.jsx)(`li`,{className:`border-b border-line-soft last:border-b-0`,children:(0,H.jsxs)(`label`,{className:f(`flex min-h-11 items-start gap-3 px-4 py-2.5`,t?`cursor-pointer`:``),children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`mt-0.5`,disabled:!t,checked:t&&a.has(e.id),onChange:()=>h(e.id)}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`font-medium text-ink [overflow-wrap:anywhere]`,children:e.name}),(0,H.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[e.folders.join(` / `)||`–`,` · `,U(e.steps,`step`),` · `,U(e.asserts,`check`),e.unsupported?` · ${e.unsupported} not convertible`:``,e.suites.length?` · in ${e.suites.join(`, `)}`:``]})]}),(0,H.jsx)(O,{tone:t?`neutral`:`warn`,children:e.route===`web`?G.web:t?`${G.web} + notes`:`${G[e.route]||e.route}: later`})]})},e.id)})})]}),r.env.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:`Environment variables`}),(0,H.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[r.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`. Their values are never in the export; you set them before the tests run.`]})]})]})]})}function rt({view:e,to:t,setTo:n,into:r,setInto:i,attr:a,setAttr:o}){let s=e=>e.split(`-`)[0],c=e=>e.split(`-`).slice(1).join(`-`),l=[...new Map(e.targets.map(e=>[s(e.id),e.framework])).entries()],u=e.targets.filter(e=>s(e.id)===s(t));return(0,H.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,H.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,H.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Framework`}),(0,H.jsx)(`div`,{role:`radiogroup`,"aria-label":`Framework`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2.5`,children:l.map(([r,i])=>{let a=ue[r];return(0,H.jsx)($e,{on:s(t)===r,onPick:()=>n((e.targets.find(e=>s(e.id)===r&&c(e.id)===c(t))||e.targets.find(e=>s(e.id)===r)).id),logo:a?(0,H.jsx)(a,{width:22,height:22,"aria-hidden":`true`}):null,title:i,sub:Ze[r],label:i},r)})})]}),(0,H.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,H.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Language`}),(0,H.jsx)(`div`,{role:`radiogroup`,"aria-label":`Language`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2.5`,children:u.map(e=>{let r=le[c(e.id)];return(0,H.jsx)($e,{on:t===e.id,onPick:()=>n(e.id),logo:r?(0,H.jsx)(r,{width:22,height:22,"aria-hidden":`true`}):null,title:e.language,label:e.language},e.id)})})]}),(0,H.jsxs)(`div`,{className:`grid gap-4 @2xl:grid-cols-2`,children:[(0,H.jsx)(Y,{id:`tsc-into`,label:`Output folder`,help:`A new folder. Empty: named after the target.`,children:(0,H.jsx)(L,{id:`tsc-into`,value:r,spellCheck:!1,maxLength:300,placeholder:`tosca-${t}`,onChange:e=>i(e.target.value)})}),(0,H.jsx)(Y,{id:`tsc-attr`,label:`Test id attribute (optional)`,help:`When the app's is not data-test-id, data-testid, data-test, data-cy or data-qa.`,children:(0,H.jsx)(L,{id:`tsc-attr`,value:a,spellCheck:!1,maxLength:40,placeholder:`data-automation-id`,onChange:e=>o(e.target.value.replace(/[^A-Za-z0-9_-]/g,``))})})]})]})}function it({view:e,file:t,found:n,only:r,to:i,instructions:a}){let o=e.targets.find(e=>e.id===i),s=(e,t)=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-b border-line-soft py-3.5 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,H.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:e}),(0,H.jsx)(`div`,{className:`text-sm`,children:t})]});return(0,H.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col rounded-[14px] card border p-5`,children:[s(`Export`,t?(0,H.jsx)(`span`,{className:`font-mono text-[12.5px] [overflow-wrap:anywhere]`,children:t}):(0,H.jsx)(`span`,{className:`text-muted`,children:`Not picked yet`})),s(`Test cases`,n?(0,H.jsxs)(`span`,{children:[r.size,` of `,n.test_cases.length,` picked`]}):(0,H.jsx)(`span`,{className:`text-muted`,children:`–`})),s(`Target`,o?(0,H.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(R,{framework:o.id.split(`-`)[0],language:o.id.split(`-`).slice(1).join(`-`)}),o.title]}):(0,H.jsx)(`span`,{className:`text-muted`,children:`–`})),s(`Instructions`,a.trim()?(0,H.jsx)(`span`,{className:`line-clamp-3 text-ink-2`,children:a.trim()}):(0,H.jsx)(`span`,{className:`text-muted`,children:`None`}))]})}function at({view:e,review:t,onStart:n}){let[r,i]=(0,V.useState)(0),[o,s]=(0,V.useState)(0),[c,l]=(0,V.useState)(``),[u,f]=(0,V.useState)(null),[p,m]=(0,V.useState)(new Set),[h,_]=(0,V.useState)(e.targets[0]?.id||``),[v,y]=(0,V.useState)(``),[b,x]=(0,V.useState)(``),[S,C]=(0,V.useState)(``),[T,D]=(0,V.useState)(null),[O,k]=(0,V.useState)(!1),[A,j]=(0,V.useState)(!1),[M,N]=(0,V.useState)(``),ee=[...p].sort().join(`,`);(0,V.useEffect)(()=>{D(null),k(!1),s(e=>Math.min(e,2))},[c,ee,h,v,b,S]);let P=e=>{i(e),s(t=>Math.max(t,e)),N(``)},te=async()=>{j(!0),N(``);try{let e=!u||u.test_cases.filter(e=>e.route===`web`||(e.routes?.web??0)>0).every(e=>p.has(e.id)),t=await g.plan({file:c,to:h,...v.trim()?{into:v.trim()}:{},...e?{}:{only:[...p]},...S.trim()?{instructions:S.trim()}:{},...b?{testAttributes:[b]}:{}});D(t),P(3)}catch(e){N(e.message)}finally{j(!1)}},F=T?.plan,I=F?.feasibility.findings.some(e=>e.level===`limit`),L=F?.feasibility.verdict===`blocked`;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,H.jsx)(Qe,{at:r,reached:o,onGo:e=>!A&&(e<3||T)&&i(e)}),(0,H.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,H.jsxs)(`section`,{"aria-labelledby":`tsc-step`,className:`flex min-w-0 flex-col gap-5`,children:[(0,H.jsx)(`h2`,{id:`tsc-step`,className:`m-0 text-[22px] font-semibold tracking-[-0.01em]`,children:[`Which Tosca export?`,`What should the tests become?`,`Anything the agent should know?`,`Review and start`][r]}),M&&(0,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:M}),r===0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(nt,{view:e,file:c,setFile:l,found:u,setFound:f,only:p,setOnly:m}),(0,H.jsx)(X,{busy:A,next:`Continue`,onNext:()=>P(1),disabled:!u||!p.size,aside:u&&!p.size?(0,H.jsx)(`span`,{className:`text-muted`,children:`Pick at least one web test case.`}):void 0})]}),r===1&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(rt,{view:e,to:h,setTo:_,into:v,setInto:y,attr:b,setAttr:x}),(0,H.jsx)(X,{busy:A,onBack:()=>i(0),next:`Continue`,onNext:()=>P(2),disabled:!h})]}),r===2&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Y,{id:`tsc-instructions`,label:`Instructions (optional)`,help:`Style and structure for the new code. Every Tosca step and check is kept either way.`,children:(0,H.jsx)(w,{id:`tsc-instructions`,value:S,rows:6,maxLength:4e3,placeholder:`Page objects go in pages/, one class per Tosca module.`,onChange:e=>C(e.target.value)})}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Xe.map(e=>(0,H.jsxs)(`button`,{type:`button`,disabled:S.includes(e),onClick:()=>C(S.trim()?`${S.trim()}\n${e}`:e),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-[8px] border-0 bg-surface-strong px-2.5 text-[13px] text-ink hover:bg-line disabled:cursor-default disabled:opacity-50`,children:[(0,H.jsx)(a,{size:13,"aria-hidden":`true`}),e]},e))}),(0,H.jsx)(X,{busy:A,onBack:()=>i(1),next:A?`Checking…`:`Check the plan`,onNext:()=>void te(),aside:(0,H.jsx)(`span`,{className:`text-muted`,children:`Nothing is changed yet.`})})]}),r===3&&F&&(0,H.jsxs)(H.Fragment,{children:[t(F,O,k),(0,H.jsx)(X,{busy:A,onBack:()=>i(2),next:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(E,{icon:d,size:15}),`Start conversion`]}),disabled:L||I&&!O,onNext:()=>n(T,!!I&&O),aside:(0,H.jsx)(`span`,{className:`text-muted`,children:L?`Change what is not possible first.`:I&&!O?`Accept the limits to start.`:`Runs in the background.`})})]})]}),(0,H.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,H.jsx)(it,{view:e,file:c,found:u,only:p,to:h,instructions:S})})]})]})}function Z({children:e,wide:t}){return(0,H.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,H.jsx)(te,{}),(0,H.jsx)(`main`,{className:f(I,`@container flex-auto gap-5`,t?`max-w-[1480px]`:`max-w-[1180px]`),children:e})]})}function Q({action:e}){return(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(m,{pixel:i.tosca,size:`lg`}),(0,H.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Tosca`})]}),(0,H.jsx)(se,{label:`Migration`,links:ce,current:`tosca`}),(0,H.jsx)(`span`,{className:`flex-1`}),e]})}function $({error:e}){return e?(0,H.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e}):null}function ot({title:e,children:t}){let[n,i]=(0,V.useState)(!1),a=(0,V.useId)();return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":n,"aria-controls":a,onClick:()=>i(!n),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 self-start rounded-[8px] border-0 bg-transparent px-1 text-sm font-medium text-ink hover:bg-surface-strong`,children:[(0,H.jsx)(r,{size:15,"aria-hidden":`true`,className:f(`transition-transform`,n&&`rotate-180`)}),e]}),(0,H.jsx)(_,{open:n,id:a,children:t})]})}function st({plan:e,accepted:t,onAccept:n}){let r=e.feasibility.findings.filter(e=>e.level===`blocker`),i=e.feasibility.findings.filter(e=>e.level===`limit`),a=e.cases.filter(e=>e.included),o=e.units.filter(e=>e.kind===`page`).length;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,H.jsxs)(`dl`,{className:`m-0 grid gap-x-6 gap-y-2.5 rounded-[14px] card border px-5 py-4 text-sm @xl:grid-cols-[auto_1fr]`,children:[(0,H.jsx)(`dt`,{className:`text-muted`,children:`From`}),(0,H.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[`Tricentis Tosca`,(0,H.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,(0,H.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:e.source.file}),e.source.project?` · ${e.source.project}`:``]})]}),(0,H.jsx)(`dt`,{className:`text-muted`,children:`To`}),(0,H.jsxs)(`dd`,{className:`m-0`,children:[e.target.title,(0,H.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.target.dir]})]}),(0,H.jsx)(`dt`,{className:`text-muted`,children:`Files`}),(0,H.jsxs)(`dd`,{className:`m-0`,children:[a.length,` test`,a.length===1?``:`s`,` of `,e.cases.length,` test case`,e.cases.length===1?``:`s`,`, `,o,` page object`,o===1?``:`s`]}),(e.suites||[]).length>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{className:`text-muted`,children:`Suites`}),(0,H.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[e.suites.map(e=>`${e.name} (${U(e.cases.length,`test`)})`).join(`, `),(0,H.jsxs)(`span`,{className:`block text-[12.5px] text-muted`,children:[`Tosca's execution lists, as tags on the tests: `,e.suites.map(e=>`@${e.tag}`).join(`, `),`.`]})]})]}),e.env.length>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{className:`text-muted`,children:`Environment variables`}),(0,H.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[e.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),(0,H.jsx)(`span`,{className:`block text-[12.5px] text-muted`,children:`Never in the export: you set them before the tests run.`})]})]}),e.instructions&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{className:`text-muted`,children:`Instructions`}),(0,H.jsx)(`dd`,{className:`m-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.instructions})]})]}),r.length>0&&(0,H.jsxs)(`section`,{"aria-labelledby":`tsc-blockers`,className:`flex flex-col gap-2 rounded-[14px] bg-fail-soft px-5 py-4`,children:[(0,H.jsxs)(`h3`,{id:`tsc-blockers`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-fail`,children:[(0,H.jsx)(T,{size:16,"aria-hidden":`true`}),`Not possible`]}),(0,H.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-5 text-sm text-ink`,children:r.map(e=>(0,H.jsx)(`li`,{children:e.text},e.code))})]}),i.length>0&&(0,H.jsxs)(`section`,{"aria-labelledby":`tsc-limits`,className:`flex flex-col gap-3 rounded-[14px] bg-warn-soft px-5 py-4`,children:[(0,H.jsxs)(`h3`,{id:`tsc-limits`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-warn`,children:[(0,H.jsx)(T,{size:16,"aria-hidden":`true`}),`Before you start`]}),(0,H.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1.5 pl-5 text-sm text-ink`,children:i.map(e=>(0,H.jsx)(`li`,{children:e.text},e.code))}),n&&!r.length&&(0,H.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center gap-2 text-sm font-medium`,children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:!!t,onChange:e=>n(e.target.checked)}),`I understand`]})]}),(0,H.jsx)(ot,{title:`Test cases (${e.cases.length})`,children:(0,H.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:e.cases.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-3 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,H.jsx)(`span`,{className:f(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.included?`text-ink`:`text-muted`),children:e.name}),(0,H.jsx)(`span`,{className:`text-muted`,children:e.included?`${U(e.steps,`step`)} · ${U(e.asserts,`check`)}`:e.why}),(0,H.jsx)(`span`,{className:`w-16 flex-none text-right text-muted`,children:G[e.route]||e.route})]},e.id))})}),(0,H.jsx)(ot,{title:`Files, in order (${e.units.length})`,children:(0,H.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:e.units.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-wrap gap-x-3 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,H.jsx)(`span`,{className:`w-16 flex-none text-muted`,children:_e[e.kind]}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:e.target})]},e.id))})})]})}function ct({plan:e,acceptLimits:t,onClose:n,onStarted:r}){let[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(!1),[l,u]=(0,V.useState)(``),d=async()=>{s(!0),u(``);try{r((await g.start(e.id,i,t)).detail)}catch(e){u(e.message),s(!1)}};return(0,H.jsx)(c,{open:!0,onClose:n,title:`Start the conversion`,description:`The Tosca test cases are written as ${e.target.title} tests in ${e.target.dir}, and ForgeQE runs each one. It runs in the background; the Tosca export is not changed.`,footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(A,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,H.jsx)(A,{variant:`primary`,disabled:o||i!==e.id,onClick:()=>void d(),children:`Start conversion`})]}),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,H.jsxs)(`span`,{children:[`Type `,(0,H.jsx)(`span`,{className:`font-mono`,children:e.id}),` to confirm`]}),(0,H.jsx)(L,{value:i,onChange:e=>a(e.target.value),autoComplete:`off`,spellCheck:!1})]}),(0,H.jsx)($,{error:l})]})})}function lt({d:e,onStarted:t}){let[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(!1),o=e.plan.feasibility.findings.some(e=>e.level===`limit`),s=e.plan.feasibility.verdict===`blocked`,c=!!e.job?.running;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[e.job?.last&&!c&&(0,H.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:`The last start did not run. Its job's log on the Jobs page says why.`}),(0,H.jsx)(st,{plan:e.plan,accepted:e.confirmed||n,onAccept:e.confirmed?void 0:r}),!s&&!c&&(0,H.jsx)(`div`,{children:(0,H.jsxs)(A,{variant:`primary`,disabled:!e.confirmed&&o&&!n,onClick:()=>a(!0),children:[(0,H.jsx)(d,{"aria-hidden":`true`}),`Start conversion`]})}),i&&(0,H.jsx)(ct,{plan:e.plan,acceptLimits:o&&(e.confirmed||n),onClose:()=>a(!1),onStarted:e=>{a(!1),t(e)}})]})}function ut(e){return e.result?.status===`running`?`running`:e.result?.status===`converted`?`done`:e.result?`review`:`planned`}function dt(e){return e.result?ge[e.result.status]:e.confirmed?{label:`Confirmed`,tone:`neutral`}:he[e.verdict]}var ft=e=>e.slice(e.lastIndexOf(`/`)+1);function pt({view:t}){let[n,r]=(0,V.useState)(`all`),i=e=>e===`all`?t.plans.length:t.plans.filter(t=>ut(t)===e).length,a=t.plans.filter(e=>n===`all`||ut(e)===n),o=e=>location.hash=u(`tosca`,e);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(de,{children:[(0,H.jsx)(B,{label:`All`,value:i(`all`),onClick:()=>r(`all`),on:n===`all`}),(0,H.jsx)(B,{label:`Running`,value:i(`running`),onClick:()=>r(`running`),on:n===`running`}),(0,H.jsx)(B,{label:`Converted`,value:i(`done`),tone:i(`done`)?`text-pass`:void 0,onClick:()=>r(`done`),on:n===`done`}),(0,H.jsx)(B,{label:`Needs review`,value:i(`review`),tone:i(`review`)?`text-warn`:void 0,onClick:()=>r(`review`),on:n===`review`})]}),(0,H.jsx)(e,{label:`Conversions`,placeholder:`Find a conversion`,empty:n===`all`?`No conversions.`:`None here.`,resetKey:n,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Conversion`}),(0,H.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Tests`}),(0,H.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Status`}),(0,H.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Updated`})]}),children:a.map(e=>{let t=dt(e),n=e.result?e.result.status===`converted`||e.result.endedAt?100:Math.min(99,Math.round(e.result.done/Math.max(1,e.units||e.tests+1)*95)):0;return(0,H.jsxs)(`tr`,{onClick:()=>o(e.id),className:x,children:[(0,H.jsx)(`td`,{className:S,children:(0,H.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`span`,{className:`hidden flex-none items-center gap-1 @xl:inline-flex`,"aria-hidden":`true`,children:(0,H.jsx)(R,{framework:e.targetId.split(`-`)[0],language:e.targetId.split(`-`).slice(1).join(`-`),size:18})}),(0,H.jsxs)(`span`,{className:`min-w-0`,children:[(0,H.jsxs)(`a`,{href:u(`tosca`,e.id),onClick:e=>e.stopPropagation(),className:`font-medium text-ink no-underline hover:underline`,children:[ft(e.file),` to `,e.target]}),(0,H.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[e.project?`${e.project} · `:``,e.into]})]})]})}),(0,H.jsx)(`td`,{className:f(S,`w-[180px] text-[13px]`),children:e.result?.status===`running`?(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(me,{value:n,label:`${ft(e.file)} to ${e.target}: progress`}),(0,H.jsxs)(`span`,{className:`w-9 flex-none text-right text-[12px] text-muted tabular-nums`,children:[n,`%`]})]}):e.result?(0,H.jsxs)(`span`,{className:e.result.converted===e.tests?`text-pass`:`text-ink-2`,children:[e.result.converted,` of `,e.tests,` pass`]}):(0,H.jsx)(`span`,{className:`text-muted`,children:`Not started`})}),(0,H.jsx)(`td`,{className:f(S,`whitespace-nowrap`),children:(0,H.jsx)(O,{tone:t.tone,children:t.label})}),(0,H.jsx)(`td`,{className:f(S,`hidden text-[12.5px] whitespace-nowrap text-muted @xl:table-cell`),children:ae(e.result?.endedAt||e.result?.at||e.createdAt)})]},e.id)})})]})}function mt({sub:e}){let[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(``),[a,o]=(0,V.useState)(null),s=(0,V.useCallback)(()=>{g.list().then(e=>{n(e),i(``)},e=>i(e.message))},[]);(0,V.useEffect)(s,[s,e]);let c=t?.plans.some(e=>e.result?.status===`running`);(0,V.useEffect)(()=>{if(!c||e)return;let t=setInterval(s,3e3);return()=>clearInterval(t)},[c,e,s]);let l=e?.match(/^(tsc-\d{8}-\d{6}-[0-9a-f]{4})\/report$/),d=e&&/^tsc-\d{8}-\d{6}-[0-9a-f]{4}$/.test(e)?e:l?.[1]||``,f=!!l,p=()=>location.hash=u(`tosca`,`new`),m=!t&&!r&&(0,H.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});return e===`new`?(0,H.jsxs)(Z,{children:[(0,H.jsx)(Q,{}),(0,H.jsx)($,{error:r}),m,t&&(0,H.jsx)(at,{view:t,review:(e,t,n)=>(0,H.jsx)(st,{plan:e,accepted:t,onAccept:n}),onStart:(e,t)=>o({d:e,accept:t})}),a&&(0,H.jsx)(ct,{plan:a.d.plan,acceptLimits:a.accept,onClose:()=>o(null),onStarted:e=>{o(null),location.hash=u(`tosca`,e.plan.id)}})]}):d&&f?(0,H.jsxs)(Z,{wide:!0,children:[(0,H.jsx)(Q,{}),(0,H.jsx)(qe,{id:d},d)]}):d?(0,H.jsxs)(Z,{wide:!0,children:[(0,H.jsx)(Q,{}),(0,H.jsx)($,{error:r}),m,t&&(0,H.jsx)(Re,{id:d,plan:(e,t)=>(0,H.jsx)(lt,{d:e,onStarted:t})},d)]}):(0,H.jsxs)(Z,{children:[(0,H.jsx)(Q,{action:t&&!t.plans.length?void 0:(0,H.jsx)(A,{variant:`primary`,disabled:!t,onClick:p,children:`New conversion`})}),(0,H.jsx)($,{error:r}),m,t&&(t.plans.length?(0,H.jsx)(pt,{view:t}):(0,H.jsx)(D,{icon:F,title:`No Tosca conversions yet`,action:(0,H.jsx)(A,{size:`sm`,onClick:p,children:`New conversion`}),children:`Pick a Tosca export (.tsu) in this project and the framework its test cases become. Every Tosca step and check is kept, and nothing starts until you confirm.`}))]})}export{mt as Tosca};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ao as e,Ct as t,Hn as n,Io as r,Na as i,No as a,Nt as o,Pa as s,Pt as c,Sn as l,ht as u,r as d,t as f}from"./frame-eAHxqKfn.js";import{_ as p,g as m,h,m as g,p as _}from"./index-COTk3Bz-.js";var v=r(a(),1),y=e(),b={new:{label:`New`,tone:`running`},improved:{label:`Improved`,tone:`neutral`},fixed:{label:`Fixed`,tone:`pass`}};function x({change:e,id:t,first:r}){let[a,o]=(0,v.useState)(!1),s=h(e);return(0,y.jsxs)(`li`,{className:i(!r&&`border-t border-line-soft`),children:[(0,y.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":t,onClick:()=>o(!a),className:`flex min-h-11 w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-3 py-2.5 text-left text-sm text-ink hover:bg-surface-muted`,children:[(0,y.jsx)(u,{tone:b[e.kind].tone,icon:!1,className:`w-[76px] justify-center`,children:b[e.kind].label}),(0,y.jsx)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,y.jsx)(n,{size:16,"aria-hidden":`true`,className:i(`flex-none text-muted transition-transform duration-200`,a&&`rotate-90`)})]}),(0,y.jsx)(c,{open:a,id:t,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-2 px-3 pt-1 pb-3 sm:pl-[100px]`,children:[(0,y.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:e.detail}),s&&(0,y.jsxs)(`a`,{href:s,className:`inline-flex items-center gap-1 self-start text-[13px] font-medium`,children:[`Open`,(0,y.jsx)(l,{size:13,"aria-hidden":`true`})]})]})})]})}function S({release:e}){let t=e===_;return(0,y.jsxs)(`li`,{className:`relative flex gap-4 pb-8`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:i(`relative mt-1.5 size-[15px] flex-none rounded-full border-[3px] border-bg`,t?`bg-accent`:`bg-line`)}),(0,y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,y.jsxs)(`h3`,{className:`m-0 text-[15px] font-semibold`,children:[`ForgeQE `,e.version]}),t&&(0,y.jsx)(u,{tone:`running`,icon:!1,children:`Latest`}),(0,y.jsxs)(`span`,{className:`text-sm text-muted`,children:[(0,y.jsx)(`time`,{dateTime:e.date,children:p(e.date)}),` · `,s(e.changes.length,`change`)]})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:e.summary}),(0,y.jsx)(`ul`,{className:`m-0 flex list-none flex-col overflow-hidden rounded-[12px] card border p-0`,children:e.changes.map((t,n)=>(0,y.jsx)(x,{change:t,first:n===0,id:`change-${e.version}-${n}`},n))})]})]})}function C({embedded:e=!1}={}){(0,v.useEffect)(m,[]);let n=g(),r=(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)(`div`,{className:`relative flex flex-col gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[60px] bottom-10 left-[7px] w-px bg-line`}),n.map(e=>(0,y.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,y.jsx)(`h2`,{className:`m-0 pl-[31px] text-[22px] font-semibold`,children:e.month}),(0,y.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.releases.map(e=>(0,y.jsx)(S,{release:e},e.version))})]},e.month))]})});return e?(0,y.jsx)(`div`,{className:`flex flex-col gap-5`,children:r}):(0,y.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,y.jsx)(d,{}),(0,y.jsxs)(`main`,{className:i(f,`flex-auto gap-5`),children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,y.jsx)(o,{pixel:t[`whats-new`],size:`lg`}),(0,y.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`What's new`})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`What each release of ForgeQE added, improved and fixed. Pick a change to read more.`}),r]})]})}export{b as KIND,C as WhatsNew};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{$ as e,Ao as t,Ft as n,Io as r,Ma as i,Na as a,No as o,Pa as s,Xa as c,ht as l,it as u,ja as d,lt as f,na as p,nt as m,rt as h,st as g}from"./frame-eAHxqKfn.js";import"./index-COTk3Bz-.js";var _=r(o(),1),v=t(),y={test:[`Testing the connection`,`Tested the connection`,`waiting`],tables:[`Reading the tables`,`Read the tables`,`searching`],query:[`Running the query`,`Ran the query`,`working`],gen:[`Making a preview`,`Made a preview`,`writing`],files:[`Writing the files`,`Wrote the files`,`writing`],insert:[`Inserting test data`,`Inserted test data`,`working`],batches:[`Listing the batches`,`Listed the batches`,`searching`],clean:[`Removing a batch`,`Removed a batch`,`working`],request:[`Asking the DB agent for test data`,`Asked the DB agent for test data`,`thinking`],fetch:[`Fetching the request again`,`Fetched the request again`,`searching`],ask:[`Asking the DB agent`,`Asked the DB agent`,`thinking`],checks:[`Running the checks`,`Ran the checks`,`working`],map:[`Reading the schema`,`Read the schema`,`searching`],check:[`Checking the flows`,`Checked the flows`,`working`],trace:[`Following the record`,`Followed the record`,`searching`]};function b(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(!1),o=(0,_.useCallback)(()=>{c.view().then(e=>{t(e),r(``)},e=>r(e.message))},[]);(0,_.useEffect)(o,[o]);let s=!!e?.job?.running;return(0,_.useEffect)(()=>{if(!s)return;let e=setInterval(o,1e3);return()=>clearInterval(e)},[s,o]),{view:e,error:n,busy:i||s,running:s,act:async(e,t)=>{a(!0),r(``);try{await c.run(e,t),o()}catch(e){r(e.message)}finally{a(!1)}},stop:()=>void c.stop().then(o),load:o,job:e?.job??null}}var x=e=>e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e);function S({file:e,onNote:t}){return(0,v.jsx)(`button`,{type:`button`,"data-tip":e,onClick:async()=>t(await n(e)),className:a(i({size:`sm`}),`font-mono text-[12px]`),children:e.split(/[\\/]/).pop()})}function C({children:e,label:t}){return(0,v.jsx)(`pre`,{"aria-label":t,className:`m-0 max-h-[320px] overflow-auto rounded-[12px] bg-surface-muted p-3 font-mono text-[12px] leading-relaxed whitespace-pre text-ink-2`,children:e})}function w({job:e,onStop:t}){let[n,r,i]=y[e.kind]??[`Working`,`Done`,`working`],a=(0,_.useRef)(null);(0,_.useEffect)(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},[e.lines.length]);let o=e.exitCode===0,c=!o&&(e.kind===`check`||e.kind===`trace`)&&e.result!==void 0&&!e.result.error;return(0,v.jsxs)(`section`,{"aria-label":e.running?n:r,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,v.jsxs)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:[e.running?n:r,e.target?(0,v.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,e.target]}):null]}),(0,v.jsx)(l,{tone:e.running?`running`:o?`pass`:e.exitCode===2||c?`warn`:`fail`,orb:i,children:e.running?`Working`:o?`Done`:c?`Some broken`:e.exitCode===2?`Not done`:`Failed`}),e.running&&(0,v.jsxs)(d,{variant:`danger`,onClick:t,children:[(0,v.jsx)(p,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,v.jsxs)(`details`,{open:e.running||!o&&!e.result,children:[(0,v.jsxs)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:[`Output (`,s(e.lines.length,`line`),`)`]}),(0,v.jsx)(`code`,{className:`mt-2 block font-mono text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.command}),(0,v.jsx)(`pre`,{ref:a,className:`mt-2 max-h-[240px] overflow-auto rounded-[10px] bg-surface-muted p-3 font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:e.lines.join(`
|
|
2
|
-
`)||`Starting…`})]})]})}function T({text:e}){return(0,v.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e})}function E({columns:t,rows:n}){let r=t.map((e,t)=>n.length>0&&n.every(e=>e[t]===null||e[t]===void 0||typeof e[t]==`number`)&&n.some(e=>typeof e[t]==`number`));return(0,v.jsx)(e,{label:`Rows`,resetKey:n,head:t.map((e,t)=>(0,v.jsx)(`th`,{className:r[t]?h:m,children:e},e)),children:n.map((e,t)=>(0,v.jsx)(`tr`,{className:u,children:e.map((e,t)=>(0,v.jsx)(`td`,{"data-tip":x(e),className:a(`px-3 py-1.5 font-mono text-[12px]`,r[t]?`text-right whitespace-nowrap tabular-nums`:`max-w-[320px] truncate`,e==null&&`text-muted`),children:x(e)},t))},t))})}function D({r:e}){return(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(e.order||[]).map(t=>{let n=e.preview?.[t],r=n?.sample||[],i=r.length?Object.keys(r[0]):[];return(0,v.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,v.jsxs)(`span`,{className:`text-sm`,children:[(0,v.jsx)(`span`,{className:`font-medium`,children:t}),` · `,s(e.rows?.[t]??0,`row`),n?.database_fills?.length?(0,v.jsxs)(`span`,{className:`text-muted`,children:[` · the database fills `,n.database_fills.join(`, `)]}):null,e.masked?.[t]?.length?(0,v.jsxs)(`span`,{className:`text-muted`,children:[` · masked `,e.masked[t].join(`, `)]}):null]}),i.length>0&&(0,v.jsx)(E,{columns:i,rows:r.slice(0,3).map(e=>i.map(t=>e[t]))})]},t)}),(e.warnings||[]).map((e,t)=>(0,v.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:e},t))]})}var O={query:`Existing rows`,generate:`New rows`};function k({r:e,onNote:t}){let n=Object.entries(e.rows||{});return(0,v.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(l,{tone:`pass`,children:O[e.kind||``]||`Answered`}),(0,v.jsxs)(`span`,{className:`min-w-0 text-sm text-ink-2 [overflow-wrap:anywhere]`,children:[e.database,e.why?` · ${e.why}`:``]})]}),n.map(([t,n])=>(0,v.jsx)(A,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,v.jsx)(`span`,{className:`text-sm font-medium`,children:`The query, as the database checked it`}),(0,v.jsx)(C,{label:`SQL`,children:e.sql})]}),e.script_preview&&e.script_preview.length>0&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,v.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script for these rows, not run`}),(0,v.jsx)(C,{label:`INSERT script`,children:e.script_preview.join(`
|
|
3
|
-
`)})]}),e.files?.length?(0,v.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Kept`,e.files.map(e=>(0,v.jsx)(S,{file:e,onNote:t},e))]}):null,e.replay&&(0,v.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Tests and pipelines get the same data with `,(0,v.jsx)(`code`,{className:`font-mono text-[12px] text-ink-2`,children:e.replay}),`, without a model.`]})]})}function A({title:e,rows:t,total:n}){let r=[...new Set(t.flatMap(e=>Object.keys(e)))];return(0,v.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,v.jsxs)(`span`,{className:`text-sm`,children:[(0,v.jsx)(`span`,{className:`font-medium`,children:e}),` · `,s(n,`row`),n>t.length?(0,v.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.length,` shown`]}):null]}),r.length>0?(0,v.jsx)(E,{columns:r,rows:t.map(e=>r.map(t=>e[t]))}):(0,v.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No rows match.`})]})}function j({items:e,text:t,label:n,size:r=10,children:i}){let[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(0),l=a.toLowerCase().split(/\s+/).filter(Boolean),u=l.length?e.filter(e=>l.every(n=>t(e).toLowerCase().includes(n))):e;(0,_.useEffect)(()=>c(0),[a,e.length]);let d=Math.min(s,Math.max(0,Math.ceil(u.length/r)-1));return(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.length>r&&(0,v.jsx)(f,{id:`find-${n.toLowerCase().replace(/\W+/g,`-`)}`,label:`Find in ${n.toLowerCase()}`,value:a,onChange:o,className:`flex-none`}),u.length?(0,v.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:u.slice(d*r,d*r+r).map(i)}):(0,v.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing matches.`}),u.length>r&&(0,v.jsx)(g,{page:d,size:r,total:u.length,onPage:c,label:`Pages of ${n.toLowerCase()}`})]})}export{w as a,T as c,x as d,b as f,D as i,E as l,C as n,O as o,S as r,j as s,k as t,A as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Lt as e}from"./frame-eAHxqKfn.js";var t=[{id:`runs`,label:`Runs`,href:e(`runs`)},{id:`reports`,label:`Execution reports`,href:e(`reports`)},{id:`reports-project`,label:`Project report`,href:e(`reports`,`project`)},{id:`run-diff`,label:`Run diff`,href:e(`run-diff`)},{id:`flaky`,label:`Flaky tests`,href:e(`flaky`)}],n=[{id:`migration`,label:`Migration`,href:e(`migration`)},{id:`tosca`,label:`Tosca`,href:e(`tosca`)}],r=[{id:`evidence-contracts`,label:`Contracts`,href:e(`evidence-contracts`)},{id:`evidence-releases`,label:`Releases`,href:e(`evidence-releases`)},{id:`evidence-learn`,label:`Learn`,href:e(`evidence-learn`)},{id:`evidence-monitor`,label:`Monitor`,href:e(`evidence-monitor`)}];export{n,t as r,r as t};
|