@capagents/forgeqe 3.1.2 → 3.1.3

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.
Files changed (170) hide show
  1. package/HOW_TO_USE.md +5003 -2077
  2. package/README.md +155 -449
  3. package/dist/docs-site/docs/app-theme.css +30 -9
  4. package/dist/docs-site/docs/architecture/index.html +45 -515
  5. package/dist/docs-site/docs/architecture-reference/index.html +1781 -0
  6. package/dist/docs-site/docs/area-api/index.html +257 -116
  7. package/dist/docs-site/docs/area-automated-tests/index.html +1229 -419
  8. package/dist/docs-site/docs/area-browser/index.html +167 -125
  9. package/dist/docs-site/docs/area-data/index.html +178 -188
  10. package/dist/docs-site/docs/area-desktop/index.html +329 -282
  11. package/dist/docs-site/docs/area-mobile/index.html +138 -86
  12. package/dist/docs-site/docs/area-operations/index.html +567 -393
  13. package/dist/docs-site/docs/area-pull-requests/index.html +114 -32
  14. package/dist/docs-site/docs/area-quality/index.html +111 -49
  15. package/dist/docs-site/docs/area-release/index.html +180 -65
  16. package/dist/docs-site/docs/area-setup/index.html +742 -339
  17. package/dist/docs-site/docs/area-systems/index.html +32 -48
  18. package/dist/docs-site/docs/area-test-cases/index.html +387 -154
  19. package/dist/docs-site/docs/containers/index.html +87 -101
  20. package/dist/docs-site/docs/cost-architecture/index.html +4 -3
  21. package/dist/docs-site/docs/custom-agents-first-run/index.html +108 -50
  22. package/dist/docs-site/docs/desktop/index.html +277 -297
  23. package/dist/docs-site/docs/desktop-ci/index.html +15 -5
  24. package/dist/docs-site/docs/docs-tabs.js +56 -0
  25. package/dist/docs-site/docs/evidence/index.html +50 -49
  26. package/dist/docs-site/docs/feature-test-prompts/index.html +34 -24
  27. package/dist/docs-site/docs/get-started/index.html +464 -168
  28. package/dist/docs-site/docs/graphify/index.html +8 -7
  29. package/dist/docs-site/docs/guardrails/index.html +20 -4
  30. package/dist/docs-site/docs/index.html +4 -3
  31. package/dist/docs-site/docs/mobile/index.html +96 -76
  32. package/dist/docs-site/docs/model-routing/index.html +44 -18
  33. package/dist/docs-site/docs/overview/index.html +23 -7
  34. package/dist/docs-site/docs/product-graph/index.html +13 -12
  35. package/dist/docs-site/docs/product-knowledge/index.html +16 -5
  36. package/dist/docs-site/docs/product-views/index.html +7 -6
  37. package/dist/docs-site/docs/reference/index.html +95 -65
  38. package/dist/docs-site/docs/search.js +1 -1
  39. package/dist/docs-site/docs/using/index.html +444 -126
  40. package/dist/docs-site/docs/web-app/index.html +54 -51
  41. package/dist/forgeqe.js +1822 -1822
  42. package/dist/web/assets/Agent-3pV8Rwap.js +8 -0
  43. package/dist/web/assets/AgentWork-DAnmH0My.js +2 -0
  44. package/dist/web/assets/ApiTests-DW4MRFzG.js +10 -0
  45. package/dist/web/assets/Browse-Bd0ZZfc2.js +1 -0
  46. package/dist/web/assets/Chat-DnBUm_97.js +3 -0
  47. package/dist/web/assets/CommandPalette-B1O9aDTk.js +1 -0
  48. package/dist/web/assets/Compare-1v7_ca7z.js +1 -0
  49. package/dist/web/assets/Cost-CWrc4McH.js +1 -0
  50. package/dist/web/assets/Data-rWSiG4Cq.js +6 -0
  51. package/dist/web/assets/Desktop-3x6EQqos.js +1 -0
  52. package/dist/web/assets/DesktopReview-cSA10Rm3.js +1 -0
  53. package/dist/web/assets/Evidence-CKy3o7cw.js +1 -0
  54. package/dist/web/assets/{Explore-ObkEpUyS.js → Explore-CMAxWE_8.js} +2 -2
  55. package/dist/web/assets/Features-haQchkhA.js +1 -0
  56. package/dist/web/assets/{Flags-0-RniPJm.js → Flags-BaQjYi_t.js} +2 -2
  57. package/dist/web/assets/Flaky-DUuC0qTn.js +1 -0
  58. package/dist/web/assets/Impact-CP0H8ygo.js +3 -0
  59. package/dist/web/assets/Jobs-cYxoYd3i.js +5 -0
  60. package/dist/web/assets/KindPage-DWW8gN5_.js +6 -0
  61. package/dist/web/assets/Migration-Bsm7WU1d.js +2 -0
  62. package/dist/web/assets/PageAgent-c95zT2PJ.js +1 -0
  63. package/dist/web/assets/Product-BQSiR28a.js +7 -0
  64. package/dist/web/assets/Production-CAv0Vtoy.js +1 -0
  65. package/dist/web/assets/Quality-aQPaPYQc.js +1 -0
  66. package/dist/web/assets/Readiness-CkknP87n.js +1 -0
  67. package/dist/web/assets/Record-09IsC9U-.js +1 -0
  68. package/dist/web/assets/Regression-BL4MfN47.js +5 -0
  69. package/dist/web/assets/RelationGraph-Dg4fqt7l.js +1 -0
  70. package/dist/web/assets/Reports-CMV1l-iS.js +2 -0
  71. package/dist/web/assets/Response-DTBFBeKB.js +9 -0
  72. package/dist/web/assets/Responsive-DBRQ9FUO.js +3 -0
  73. package/dist/web/assets/RunDiff-CMDrnsA3.js +1 -0
  74. package/dist/web/assets/Runs-Dkeu6_vZ.js +2 -0
  75. package/dist/web/assets/Settings-KjKm8h-_.js +21 -0
  76. package/dist/web/assets/{Steps-D-YG0eJy.js → Steps-HYHK9psI.js} +1 -1
  77. package/dist/web/assets/TestCases-Cv6-OSv0.js +1 -0
  78. package/dist/web/assets/TestData-DbEfNlUE.js +2 -0
  79. package/dist/web/assets/TestDebt-DzHQIU4X.js +1 -0
  80. package/dist/web/assets/TestManagement-BgRTGHMT.js +1 -0
  81. package/dist/web/assets/Tosca-DZpHAtnH.js +3 -0
  82. package/dist/web/assets/WhatsNew-jp0c4WSV.js +1 -0
  83. package/dist/web/assets/coverage-BB9BLjGz.js +5 -0
  84. package/dist/web/assets/{dataParts-DbeCj9ga.js → dataParts-DEPK4eQE.js} +2 -2
  85. package/dist/web/assets/{diff-BStuTmsN.js → diff-CcNwLCX6.js} +1 -1
  86. package/dist/web/assets/{families-BBFFrUlo.js → families-gkpkloLT.js} +1 -1
  87. package/dist/web/assets/filters-C7phIFfd.js +1 -0
  88. package/dist/web/assets/fold-i73P-EDV.js +1 -0
  89. package/dist/web/assets/head-BtTqyLlj.js +1 -0
  90. package/dist/web/assets/{highlight-BcFZIf59.js → highlight-DZI39CzZ.js} +1 -1
  91. package/dist/web/assets/index-ClFOh63x.css +2 -0
  92. package/dist/web/assets/index-YGWJEkAT.js +64 -0
  93. package/dist/web/assets/input-C2vQ9O3a.js +1 -0
  94. package/dist/web/assets/logos-BmbNTDu2.js +1 -0
  95. package/dist/web/assets/palette-XFlqvgZl.js +1 -0
  96. package/dist/web/assets/{paletteCommands-Co-RlQ8q.js → paletteCommands-DsbD2ASU.js} +1 -1
  97. package/dist/web/assets/parts-DEVx2Sea.js +1 -0
  98. package/dist/web/assets/productParts-Bi-XjszL.js +1 -0
  99. package/dist/web/assets/qualityParts-Dbu01g7G.js +1 -0
  100. package/dist/web/assets/{recordTest-Cez2sDJO.js → recordTest--Wr40QdN.js} +1 -1
  101. package/dist/web/assets/route-Dg53WdFu.js +1 -0
  102. package/dist/web/index.html +6 -7
  103. package/docs/ARCHITECTURE.md +50 -563
  104. package/docs/ARCHITECTURE_REFERENCE.md +1484 -0
  105. package/docs/CONTAINERS.md +87 -87
  106. package/docs/CUSTOM_AGENTS_FIRST_RUN.md +125 -43
  107. package/docs/DESKTOP-CI.md +18 -3
  108. package/docs/DESKTOP.md +298 -297
  109. package/docs/MOBILE.md +103 -71
  110. package/docs/MODEL_ROUTING.md +48 -15
  111. package/docs/WEB_APP.md +49 -44
  112. package/docs/feature-test-prompts.md +29 -16
  113. package/docs/user-guide.html +5263 -2453
  114. package/guardrails/README.md +22 -2
  115. package/knowledge/README.md +15 -2
  116. package/package.json +1 -1
  117. package/prompts/brain.md +1 -0
  118. package/py/forgeqe_engine/recordsession.py +100 -24
  119. package/dist/web/assets/Agent-CPhmZdFX.js +0 -8
  120. package/dist/web/assets/AgentWork-BXdN9xgi.js +0 -2
  121. package/dist/web/assets/ApiTests-Do3xLjfB.js +0 -10
  122. package/dist/web/assets/Browse-WVkJT6Bs.js +0 -2
  123. package/dist/web/assets/Chat-CDc9UcQX.js +0 -3
  124. package/dist/web/assets/CommandPalette-BAZm62lV.js +0 -1
  125. package/dist/web/assets/Compare-Br6n9T9L.js +0 -1
  126. package/dist/web/assets/Cost-BBUyBu3Y.js +0 -1
  127. package/dist/web/assets/Data-Ch2DPEWp.js +0 -6
  128. package/dist/web/assets/Desktop-Qzoq-cQv.js +0 -1
  129. package/dist/web/assets/DesktopReview-CF_jQYAM.js +0 -1
  130. package/dist/web/assets/Evidence-C72Lj5_Q.js +0 -1
  131. package/dist/web/assets/Features-CQzNo_WP.js +0 -1
  132. package/dist/web/assets/Flaky-BPJvNLCA.js +0 -1
  133. package/dist/web/assets/Impact-CfccsL_k.js +0 -3
  134. package/dist/web/assets/Jobs-T6m4zhDy.js +0 -5
  135. package/dist/web/assets/KindPage-BDUvWe2p.js +0 -6
  136. package/dist/web/assets/Migration-Dqeh4x5u.js +0 -2
  137. package/dist/web/assets/PageAgent-DNjzIgeY.js +0 -1
  138. package/dist/web/assets/Product-nYV_scOV.js +0 -7
  139. package/dist/web/assets/Production-CGSbEWVa.js +0 -1
  140. package/dist/web/assets/Quality-BIypojZm.js +0 -1
  141. package/dist/web/assets/Readiness-BlRjwJRg.js +0 -1
  142. package/dist/web/assets/Record-v2KLI-_Z.js +0 -1
  143. package/dist/web/assets/Regression-B-jSt4Jz.js +0 -5
  144. package/dist/web/assets/RelationGraph-8J98lOVG.js +0 -1
  145. package/dist/web/assets/Reports-GI4u6SyW.js +0 -2
  146. package/dist/web/assets/Response-mhBThq2b.js +0 -9
  147. package/dist/web/assets/Responsive-DXu7Ra7K.js +0 -3
  148. package/dist/web/assets/RunDiff-D0SHDNp0.js +0 -1
  149. package/dist/web/assets/Runs-C1Gjdi9M.js +0 -2
  150. package/dist/web/assets/Settings-BGGeuvyF.js +0 -21
  151. package/dist/web/assets/TestCases-DC4w77eQ.js +0 -1
  152. package/dist/web/assets/TestData-CvKWRVVV.js +0 -2
  153. package/dist/web/assets/TestDebt-D8YzN29_.js +0 -1
  154. package/dist/web/assets/TestManagement-C5cDCqrD.js +0 -1
  155. package/dist/web/assets/Tosca-BGUv3RiJ.js +0 -3
  156. package/dist/web/assets/WhatsNew-B_Gyuv8O.js +0 -1
  157. package/dist/web/assets/coverage-BMP6ELFJ.js +0 -5
  158. package/dist/web/assets/filters-CnAMr286.js +0 -1
  159. package/dist/web/assets/fold-D_O_VZui.js +0 -1
  160. package/dist/web/assets/head-CRo48rPt.js +0 -1
  161. package/dist/web/assets/index-B3JsM7tv.js +0 -64
  162. package/dist/web/assets/index-CafApcbZ.css +0 -2
  163. package/dist/web/assets/input-CtzK50ZF.js +0 -1
  164. package/dist/web/assets/line-icons-rdF8DYDJ.js +0 -1
  165. package/dist/web/assets/logos-D4oVWzqa.js +0 -1
  166. package/dist/web/assets/palette-DAaGSao7.js +0 -1
  167. package/dist/web/assets/parts-D357Wolo.js +0 -1
  168. package/dist/web/assets/productParts-B8oHRCJF.js +0 -1
  169. package/dist/web/assets/qualityParts-BLkmIfDY.js +0 -1
  170. package/dist/web/assets/route-BloYJWgw.js +0 -1
@@ -0,0 +1,3 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$n as t,$t as n,A as r,At as i,Bn as a,Cn as o,F as s,Fn as c,H as l,Hr as u,I as d,Ir as f,Jn as p,Lr as m,Lt as h,Mr as g,O as _,Pt as v,Rn as y,Rr as b,St as x,Un as S,Yt as C,Zn as w,ar as T,cn as E,ft as ee,ht as D,l as O,lt as k,n as te,on as ne,ot as A,r as j,sr as M,u as re,wr as N,xr as ie,y as P}from"./route-Dg53WdFu.js";import{t as F}from"./jsx-runtime-LKYXHABd.js";import{A as I,Rt as L,W as ae,a as oe,n as R,r as z,t as B,zt as V}from"./input-C2vQ9O3a.js";import{a as H,c as se,d as U,i as W,l as ce,n as le,r as G,t as ue}from"./filters-C7phIFfd.js";import{a as de}from"./palette-XFlqvgZl.js";import{Bt as fe,Dn as pe,E as me,En as he,Gn as ge,Hn as _e,It as ve,Jn as ye,Jt as be,Kt as xe,Lt as K,Qn as Se,Rt as Ce,Un as we,Vn as Te,Vt as Ee,Wn as De,g as Oe,u as q,xt as ke,yt as Ae,zt as J}from"./index-YGWJEkAT.js";import{t as je}from"./fold-i73P-EDV.js";import{t as Me}from"./head-BtTqyLlj.js";import{f as Ne,u as Pe}from"./parts-DEVx2Sea.js";import{S as Fe,_ as Ie,b as Y,d as Le,f as Re,g as ze,h as Be,l as Ve,m as He,p as Ue,r as We,s as Ge,t as Ke,u as qe,v as Je,x as Ye,y as Xe}from"./logos-BmbNTDu2.js";import{t as Ze}from"./Steps-HYHK9psI.js";var X=e(u(),1),Z=F(),Qe=500,$e=10;function et({plan:e,acceptLimits:t,next:n,again:r,onClose:i,onStarted:a}){let o=e.units.filter(e=>e.kind===`test`).length,[s,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!!n),[f,p]=(0,X.useState)(String(n?.size||$e)),[m,h]=(0,X.useState)(!1),[g,_]=(0,X.useState)(``),v=Number(f),y=Number.isInteger(v)&&v>=1&&v<=Qe,x=async()=>{h(!0),_(``);try{a((await L.start(e.id,s,t,u?v:void 0)).detail)}catch(e){_(e.message),h(!1)}};return(0,Z.jsx)(ye,{open:!0,onClose:i,title:n?`Continue with the next batch`:r?`Start the conversion again`:`Start the conversion`,description:n?`${(v||n.size)>=n.left?`The last ${n.left===1?`test case`:`${n.left} test cases`} not tried yet ${n.left===1?`is`:`are`}`:`The next ${v||n.size} of the ${n.left} test cases not tried yet are`} written as ${e.target.title} tests in ${e.target.dir}. What is done is kept; a failed test stays for you to fix.`:r?`ForgeQE picks up where the conversion stopped: what is done and unchanged is kept, the rest is written as ${e.target.title} tests in ${e.target.dir}. It runs in the background.`:`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,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(U,{variant:`ghost`,onClick:i,children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(U,{variant:`primary`,disabled:m||s!==e.id||u&&!y,onClick:()=>void x(),"data-tip":n?`Continue with the next batch`:r?`Start the conversion again`:`Start the conversion`,children:[r?(0,Z.jsx)(S,{"aria-hidden":`true`}):(0,Z.jsx)(c,{"aria-hidden":`true`}),n?`Continue`:r?`Start again`:`Start`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 text-sm`,children:[!n&&o>1&&(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,Z.jsx)(q,{className:`mt-1`,checked:u,onCheckedChange:d}),(0,Z.jsxs)(`span`,{children:[`Convert in batches`,(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`A few test cases at a time, stopping after each batch so you can check them before the next.`})]})]}),u&&(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{children:`Test cases per batch`}),(0,Z.jsx)(B,{type:`number`,min:1,max:Qe,step:1,inputMode:`numeric`,value:f,"aria-invalid":!y,"aria-describedby":y?void 0:`batch-size-error`,onChange:e=>p(e.target.value),className:`w-24`}),!y&&(0,Z.jsxs)(`p`,{id:`batch-size-error`,role:`alert`,className:`m-0 text-[13px] text-fail`,children:[`A whole number from 1 to `,Qe,`.`]})]}),(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`span`,{children:[`Type `,(0,Z.jsx)(`span`,{className:`font-mono`,children:e.id}),` to confirm`]}),(0,Z.jsx)(B,{value:s,onChange:e=>l(e.target.value),autoComplete:`off`,spellCheck:!1})]}),(0,Z.jsx)(qe,{error:g})]})})}function tt(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?Le[t.status]:e.job?.last?{label:`Did not start`,tone:`fail`}:e.confirmed?{label:`Confirmed`,tone:`neutral`}:Ie[e.plan.feasibility.verdict]}var Q=e=>e.slice(e.lastIndexOf(`/`)+1);function nt({d:e,onClose:t}){let n=(e.plan.sources||[]).some(e=>e.workspace),[r,i]=(0,X.useState)(n),[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(``),l=async()=>{o(!0),c(``);try{let t=await L.reimport(e.plan.id,n&&r);location.hash=j(`tosca`,t.plan.id)}catch(e){c(e.message),o(!1)}};return(0,Z.jsx)(ye,{open:!0,onClose:t,title:`Read the exports again`,description:`A new plan from the same exports, into the same folder. Test cases unchanged in Tosca keep their tests; changed and new ones are converted; ones no longer there are listed. Nothing is written until you start it.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(U,{variant:`ghost`,onClick:t,children:`Cancel`}),(0,Z.jsx)(U,{variant:`primary`,disabled:a,onClick:()=>void l(),children:a?`Reading…`:`Make the new plan`})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 text-sm`,children:[n&&(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,Z.jsx)(q,{className:`mt-1`,checked:r,onCheckedChange:i}),(0,Z.jsxs)(`span`,{children:[`Get the newest commit of the cloned repositories`,(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Each is cloned again, as before; the old copy stays for this plan.`})]})]}),s&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:s})]})})}var rt=[{id:`ci-github`,label:`GitHub Actions`},{id:`ci-azure`,label:`Azure Pipelines`}];function it({id:e,onClose:t}){let[n,r]=(0,X.useState)(`github`),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(!1);(0,X.useEffect)(()=>{let t=!0;return a(null),p(!1),s(``),l(``),L.ci(e,n).then(e=>t&&a(e),e=>t&&s(e.message)),()=>{t=!1}},[e,n]);let m=i?i.file.slice(i.file.lastIndexOf(`/`)+1):``,h=()=>{if(!i)return;let e=URL.createObjectURL(new Blob([i.text],{type:`text/yaml;charset=utf-8`})),t=document.createElement(`a`);t.href=e,t.download=m,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)},g=async()=>{d(!0),s(``);try{let t=await L.writeCi(e,n);p(!0),l(`Added ${t.file}.${n===`github`?` GitHub runs a workflow only from ${t.path}: move it there.`:` Create a pipeline from it in Azure DevOps.`}`)}catch(e){s(e.message)}finally{d(!1)}};return(0,Z.jsxs)(ye,{open:!0,wide:!0,onClose:t,title:`CI pipeline`,description:`Runs the converted tests in your CI, one job per Tosca execution list. Review it before you commit it.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(U,{variant:`ghost`,onClick:t,children:`Close`}),(0,Z.jsxs)(U,{disabled:!i,onClick:h,children:[(0,Z.jsx)(A,{"aria-hidden":`true`}),`Download`]}),!f&&(0,Z.jsx)(U,{variant:`primary`,disabled:!i||u,onClick:()=>void g(),"data-tip":`Into the target folder's ci/, so a pull request of the conversion carries it.`,children:u?`Adding…`:`Add to the target folder`})]}),children:[(0,Z.jsx)(be,{label:`CI`,current:`ci-${n}`,onPick:e=>!u&&r(e.slice(3)),tabs:rt}),(0,Z.jsxs)(`div`,{id:`panel-ci-${n}`,role:`tabpanel`,"aria-labelledby":`tab-ci-${n}`,className:`flex flex-col gap-4 text-sm`,children:[!i&&!o&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-muted`,children:`Making the pipeline…`}),o&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:o}),c&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 rounded-[12px] border border-accent-line bg-accent-soft px-4 py-2 text-ink [overflow-wrap:anywhere]`,children:c}),i&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-2`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Jobs`}),(0,Z.jsx)(`dd`,{className:`m-0`,children:[...i.tests?[i.suites.length?`One per Tosca execution list: ${i.suites.join(`, `)}`:`One for every test: the export has no execution lists`]:[],...i.workflows?[`One per kind of app (desktop, mobile), replaying ${Y(i.workflows,`workflow`)}`]:[]].join(`; `)}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Goes in`}),(0,Z.jsx)(`dd`,{className:`m-0 font-mono text-[13px] [overflow-wrap:anywhere]`,children:i.path}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`To set`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[i.tests&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:`BASE_URL`}),` as a variable`]}),i.secrets.length?(0,Z.jsxs)(Z.Fragment,{children:[i.tests?`; as `:`As `,n===`github`?`secrets`:`secret variables`,`: `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px] [overflow-wrap:anywhere]`,children:i.secrets.join(`, `)})]}):null,!i.tests&&!i.secrets.length?`None`:null,i.skipped.length?(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Not passed, not a name the CI takes: `,i.skipped.join(`, `)]}):null]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-muted`,children:m}),(0,Z.jsx)(me,{text:i.text,label:`Copy ${m}`})]}),(0,Z.jsx)(`pre`,{"aria-label":m,tabIndex:0,className:`m-0 max-h-[420px] overflow-auto rounded-[12px] bg-surface-muted px-4 py-4 font-mono text-[13px] leading-relaxed whitespace-pre text-ink-2`,children:i.text})]})]})]})]})}function at({id:e,onClose:t}){let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(!1),[m,h]=(0,X.useState)(``),g=(t=``)=>L.pr(e,t).then(e=>{r(e),h(``),e.preview&&(a(e.preview),s(t=>t||e.preview.base),l(t=>t||e.preview.title))},e=>h(e.message));(0,X.useEffect)(()=>{g()},[e]),(0,X.useEffect)(()=>{if(n?.job?.state!==`running`)return;let e=setTimeout(()=>void g(o),1e3);return()=>clearTimeout(e)},[n]);let _=async()=>{p(!0),h(``);try{let t=await L.openPr(e,{base:o.trim(),title:c.trim(),draft:u});r(e=>e&&{...e,job:t.job})}catch(e){h(e.message)}finally{p(!1)}},v=i,y=n?.job,b=y?.state===`running`,x=y?.state===`done`?y.result:void 0,S=m||(y?.state===`failed`?y.error:``)||(n&&!n.preview?n.problem:``)||``,C=e=>/^https:\/\//.test(e)?e:void 0,w=(e,t)=>(0,Z.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-1 text-accent-fg`,children:[t,(0,Z.jsx)(k,{size:11,"aria-hidden":`true`})]});return(0,Z.jsx)(ye,{open:!0,wide:!0,onClose:t,title:`Open a pull request`,description:`The converted tests on a branch of their own, for your team to review. ForgeQE commits in a separate copy of the repository, so your own branch and edits stay as they are, and merges nothing.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(U,{variant:`ghost`,onClick:t,children:x?`Close`:`Cancel`}),!x&&(0,Z.jsx)(U,{variant:`primary`,disabled:!v||!n?.preview||f||b||!o.trim(),onClick:()=>void _(),children:f?`Starting…`:b?`Pushing…`:`Push and open the pull request`})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 text-sm`,children:[!n&&!m&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-muted`,children:`Checking the repository…`}),S&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:S}),x&&(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 rounded-[12px] border border-accent-line bg-accent-soft px-4 py-2 text-ink [overflow-wrap:anywhere]`,children:[x.existing?`Nothing new to push: this is the pull request.`:`Pushed ${Y(x.files,`file`)} on ${x.branch}.`,` `,C(x.url)?w(C(x.url),`Open the pull request`):`It is open on ${x.branch}; the host gave no https address to link to.`]}),v&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-2`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Repository`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[v.platform===`github`?`GitHub`:`Azure DevOps`,` `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:v.repository}),` (`,v.remote,`)`]}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Branch`}),(0,Z.jsx)(`dd`,{className:`m-0 font-mono text-[13px] [overflow-wrap:anywhere]`,children:v.branch}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Files`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[Y(v.files.length,`file`),` of `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:v.folder})]})]}),v.last&&C(v.last.url)&&!x&&(0,Z.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Opened before: `,w(C(v.last.url),`the pull request`),`. Pushing again updates its branch.`]}),(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`Merge into`}),(0,Z.jsx)(B,{value:o,spellCheck:!1,maxLength:200,placeholder:`main`,"aria-invalid":!(!n||n.preview),onChange:e=>s(e.target.value),onBlur:()=>o.trim()&&o.trim()!==n?.preview?.base&&void g(o.trim()),disabled:b,className:`font-mono`})]}),(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`Title`}),(0,Z.jsx)(B,{value:c,maxLength:200,onChange:e=>l(e.target.value),disabled:b})]}),(0,Z.jsxs)(`label`,{className:I(`flex items-start gap-2`,b?`cursor-default`:`cursor-pointer`),children:[(0,Z.jsx)(q,{className:`mt-1`,checked:u,onCheckedChange:d,disabled:b}),(0,Z.jsxs)(`span`,{children:[`Open it as a draft`,(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Reviewers are not asked yet.`})]})]}),(0,Z.jsx)(je,{title:`Files (${v.files.length})`,children:(0,Z.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 font-mono text-[13px]`,children:[v.files.slice(0,200).map(e=>(0,Z.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},e)),v.files.length>200&&(0,Z.jsxs)(`li`,{className:`text-muted`,children:[`and `,v.files.length-200,` more`]})]})}),v.skipped.length>0&&(0,Z.jsx)(je,{title:`Left out (${v.skipped.length})`,children:(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:v.skipped.slice(0,100).map(e=>(0,Z.jsxs)(`li`,{className:`[overflow-wrap:anywhere]`,children:[(0,Z.jsx)(`span`,{className:`font-mono`,children:e.path}),`: `,(0,Z.jsx)(`span`,{className:`text-muted`,children:e.why})]},e.path))})})]})]})})}function ot({id:e,title:t,targetDir:n,onClose:r}){let[i,a]=(0,X.useState)(``),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(``),u=async()=>{s(!0),l(``);try{await L.delete(e,i),location.hash=j(`migration`,`migrations`)}catch(e){l(e.message),s(!1)}};return(0,Z.jsx)(ye,{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,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(U,{variant:`ghost`,onClick:r,"data-tip":`Keep it`,children:[(0,Z.jsx)(_,{"aria-hidden":`true`}),`Keep`]}),(0,Z.jsxs)(U,{variant:`danger`,disabled:o||i!==e,onClick:()=>void u(),children:[(0,Z.jsx)(ie,{"aria-hidden":`true`}),`Delete`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,Z.jsxs)(`span`,{children:[`Type `,(0,Z.jsx)(`span`,{className:`font-mono`,children:e}),` to confirm`]}),(0,Z.jsx)(B,{value:i,onChange:e=>a(e.target.value),autoComplete:`off`,spellCheck:!1})]}),c?(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:c}):null]})})}function st({d:e,unit:t,onClose:n,onSend:r}){let[i,a]=(0,X.useState)(``),o=e.plan.units.find(e=>e.id===t),s=e.result?.units.find(e=>e.id===t);return(0,Z.jsx)(ye,{open:!0,onClose:n,title:`Fix ${o?Q(o.target):t}`,description:`Bridge works on this file again, with ForgeQE's last check and your note. It runs in the background.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(U,{variant:`ghost`,onClick:n,children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(U,{variant:`primary`,onClick:()=>r(i.trim()),"data-tip":`Send to the agent`,children:[(0,Z.jsx)(w,{"aria-hidden":`true`}),`Send`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[s?.problems?.length?(0,Z.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:s.problems[0]}):null,(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`What should change? (optional)`}),(0,Z.jsx)(z,{value:i,rows:4,maxLength:2e3,placeholder:`The cart badge is a span now, not a button.`,onChange:e=>a(e.target.value)})]})]})})}function ct({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,Z.jsx)(ye,{open:!0,onClose:n,wide:!0,title:`Output of ${i?Q(i.target):t}`,description:r?.checkedAt?`Run again ${Ne(r.checkedAt)}`:`From the conversion's own run`,footer:(0,Z.jsxs)(U,{onClick:n,children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Close`]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[r?.problems?.length?(0,Z.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r.problems.join(` `)}):r?.status===`converted`?(0,Z.jsx)(`p`,{className:`m-0 text-sm text-pass`,children:`Passes, with every Tosca step in the test.`}):null,r?.command&&(0,Z.jsxs)(`code`,{className:`block font-mono text-[13px] text-muted`,children:[`$ `,r.command]}),(0,Z.jsx)(`pre`,{className:`m-0 max-h-[60vh] overflow-auto rounded-[12px] bg-surface-muted px-4 py-2 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:r?.output||`No output.`})]})})}function lt(e){let t=Object.fromEntries(Ue.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 ut({label:e,children:t}){return(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(`dt`,{className:`text-[13px] text-muted`,children:e}),(0,Z.jsx)(`dd`,{className:`m-0 text-[13px] text-ink [overflow-wrap:anywhere] tabular-nums`,children:t})]})}function dt({d:e,planView:t,busy:n,onFix:r,onSteps:i,onOutput:a,onRun:o,onNext:s}){let l=e.result||(e.job?.running?lt(e):null);if(!l)return(0,Z.jsx)(Z.Fragment,{children:t});let u=new Map(l.units.map(e=>[e.id,e])),d=e.plan.units.filter(e=>e.kind===`test`&&!e.engine),f=e.plan.units.filter(e=>e.kind===`test`&&e.engine),h=new Set(d.map(e=>e.id)),g=new Set(f.map(e=>e.id)),_=l.units.filter(e=>h.has(e.id)&&e.status===`converted`).length,v=l.units.filter(e=>g.has(e.id)&&e.status===`written`).length,y=l.units.reduce((e,t)=>t.fidelity?{m:e.m+t.fidelity.matched,n:e.n+t.fidelity.required}:e,{m:0,n:0}),b=l.units.filter(e=>e.status===`failed`||e.status===`blocked`).length,x=e=>l.units.filter(t=>(h.has(t.id)||g.has(t.id))&&t.status===e).length,S=d.length+f.length,C=[{label:`Failed`,n:x(`failed`),bar:`bg-fail`},{label:`Needs a look`,n:x(`blocked`),bar:`bg-warn`},{label:`Passing`,n:_,bar:`bg-pass`},{label:f.length===1?`Workflow written`:`Workflows written`,n:v,bar:`bg-line-strong`},{label:f.length?`Not done yet`:`Not run yet`,n:Math.max(0,S-l.units.filter(e=>h.has(e.id)||g.has(e.id)).length),bar:`bg-line`}],[w,...T]=e.plan.target.id.split(`-`);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(`section`,{"aria-label":`Summary`,className:`flex flex-col gap-4 rounded-[12px] card border px-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`font-semibold`,children:d.length?`${_} of ${d.length} passing`:`${v} of ${Y(f.length,`workflow`)} written`}),C.filter(e=>e.n>0).map(e=>(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-ink-2`,children:[(0,Z.jsx)(`span`,{className:I(`size-2 rounded-full`,e.bar),"aria-hidden":`true`}),e.label,` `,(0,Z.jsx)(`span`,{className:I(`tabular-nums`,e.label===`Failed`?`text-fail`:``),children:e.n})]},e.label))]}),(0,Z.jsx)(`div`,{className:`flex h-1.5 overflow-hidden rounded-full bg-surface-strong`,"aria-hidden":`true`,children:C.map(e=>e.n?(0,Z.jsx)(`span`,{className:e.bar,style:{width:`${e.n/Math.max(1,S)*100}%`}},e.label):null)}),(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-2 gap-x-6 gap-y-2 @3xl:grid-cols-4`,children:[(0,Z.jsx)(ut,{label:l.status===`running`?`Running for`:`Took`,children:Pe(l.status===`running`?Date.now()-Date.parse(l.startedAt):l.ms)}),(0,Z.jsx)(ut,{label:`Tosca steps in the tests`,children:(0,Z.jsx)(`span`,{className:y.n&&y.m===y.n?`text-pass`:void 0,children:y.n?`${y.m} of ${y.n}`:`–`})}),(0,Z.jsx)(ut,{label:`Need attention`,children:(0,Z.jsx)(`span`,{className:b?`text-fail`:void 0,children:b})}),(0,Z.jsx)(ut,{label:`Pages`,children:Y(e.plan.units.filter(e=>e.kind===`page`).length,`page object`)})]})]}),l.notes&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:l.notes}),l.batch&&l.batch.left>0&&l.status!==`running`&&(0,Z.jsxs)(`div`,{role:`status`,className:`flex flex-wrap items-center gap-x-4 gap-y-2 rounded-[12px] border border-accent-line bg-accent-soft px-4 py-2 text-sm text-ink`,children:[(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`Batch `,l.batch.runs,` is done. Check its tests, then continue: `,Y(l.batch.left,`test case`),` not tried yet.`]}),(0,Z.jsxs)(U,{size:`sm`,disabled:n,onClick:s,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Continue with the next batch`]})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,Z.jsx)(`div`,{className:`@container min-w-0`,children:(0,Z.jsx)(ve,{label:`Files`,placeholder:`Find a file`,empty:`No files.`,height:`min(58vh, 580px)`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:J,children:`File`}),(0,Z.jsx)(`th`,{scope:`col`,className:J,children:`Status`}),(0,Z.jsx)(`th`,{scope:`col`,className:I(J,`hidden @2xl:table-cell`),children:`Tosca steps`}),(0,Z.jsx)(`th`,{scope:`col`,className:I(J,`hidden @3xl:table-cell`),children:`Note`}),(0,Z.jsx)(`th`,{scope:`col`,className:J,children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:e.plan.units.map(t=>{let o=u.get(t.id),s=o?ze[o.status]:null,c=t.case?e.plan.cases.find(e=>e.id===t.case):void 0;return(0,Z.jsxs)(`tr`,{className:Ee,children:[(0,Z.jsxs)(`td`,{className:K,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:t.kind===`setup`?`Project set-up`:Q(t.target)}),(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[c?t.engine?`${Ye(t)} · ${c.name}`:c.name:`${Ye(t)} · ${t.target}`,c?.suites?.length?` · ${c.suites.join(`, `)}`:``]})]}),(0,Z.jsxs)(`td`,{className:I(K,`whitespace-nowrap`),children:[s?(0,Z.jsx)(H,{tone:s.tone,children:s.label}):(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Waiting`}),o?.checkedAt&&(0,Z.jsxs)(`span`,{className:`block pt-1 text-[13px] text-muted`,children:[`Run again `,Oe(o.checkedAt)]})]}),(0,Z.jsx)(`td`,{className:I(K,`hidden text-[13px] whitespace-nowrap @2xl:table-cell`),children:o?.fidelity?(0,Z.jsxs)(`span`,{className:o.fidelity.missing.length?`text-fail`:`text-ink-2`,children:[o.fidelity.matched,` of `,o.fidelity.required]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`–`})}),(0,Z.jsx)(`td`,{className:I(K,`hidden text-[13px] text-ink-2 @3xl:table-cell`),children:(0,Z.jsx)(`span`,{className:`line-clamp-2`,children:o?.problems?.[0]||o?.reason||``})}),(0,Z.jsx)(`td`,{className:I(K,`whitespace-nowrap text-right`),children:(0,Z.jsxs)(`span`,{className:`inline-flex gap-1`,children:[t.kind===`test`&&(o?.output||o?.problems?.length)&&(0,Z.jsx)(U,{variant:`icon`,size:`icon-sm`,"aria-label":`Output of ${Q(t.target)}`,"data-tip":`Output of ${Q(t.target)}`,onClick:()=>a(t.id),children:(0,Z.jsx)(p,{"aria-hidden":`true`})}),t.case&&(0,Z.jsx)(U,{variant:`icon`,size:`icon-sm`,"aria-label":`Steps of ${Q(t.target)}`,"data-tip":`Steps of ${Q(t.target)}`,onClick:()=>i(t.case),children:(0,Z.jsx)(E,{"aria-hidden":`true`})}),o&&(o.status===`failed`||o.status===`blocked`)&&t.kind!==`setup`&&!t.engine&&(0,Z.jsx)(U,{variant:`icon`,size:`icon-sm`,disabled:n,"aria-label":`Fix ${Q(t.target)}`,"data-tip":`Fix ${Q(t.target)}`,onClick:()=>r(t.id),children:(0,Z.jsx)(m,{"aria-hidden":`true`})})]})})]},t.id)})})}),(0,Z.jsxs)(`aside`,{"aria-label":`Details`,className:`flex flex-col gap-4 rounded-[14px] card border p-6 text-sm @5xl:sticky @5xl:top-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:`From`}),(0,Z.jsxs)(`span`,{className:`font-medium`,children:[`Tricentis Tosca`,e.plan.source.project?` · ${e.plan.source.project}`:``]}),(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:e.plan.source.file})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:`To`}),(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(Ge,{framework:w,language:T.join(`-`)}),e.plan.target.title]}),(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:e.targetPath})]}),(e.plan.suites||[]).length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:`Suites`}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.plan.suites.map(e=>{let t=new Set(e.cases),r=l.units.filter(e=>e.kind===`test`&&e.case&&t.has(e.case)&&e.status===`converted`).length;return(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate`,children:e.name}),(0,Z.jsxs)(`span`,{className:I(`text-[13px]`,r===e.cases.length?`text-pass`:`text-muted`),children:[r,` of `,Y(e.cases.length,`test`),` pass · @`,e.tag]})]}),(0,Z.jsx)(U,{variant:`icon`,size:`icon-sm`,disabled:n,"aria-label":`Run the ${e.name} suite`,"data-tip":`Run the ${e.name} suite`,onClick:()=>o(e.name),children:(0,Z.jsx)(c,{"aria-hidden":`true`})})]},e.name)})})]}),e.plan.env.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:`Environment variables`}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.plan.env.map(e=>(0,Z.jsxs)(`li`,{className:`flex flex-col`,children:[(0,Z.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[e.name,e.secret?(0,Z.jsx)(`span`,{className:`font-sans text-muted`,children:` · secret`}):null]}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.from})]},e.name))})]}),(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 border-t border-line-soft pt-4`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Started`}),(0,Z.jsx)(`dd`,{className:`m-0 text-right`,children:Ne(l.startedAt)}),l.model&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Agent`}),(0,Z.jsx)(`dd`,{className:`m-0 truncate text-right`,"data-tip":l.model,children:l.model})]}),l.reverted.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Put back`}),(0,Z.jsxs)(`dd`,{className:`m-0 text-right`,children:[l.reverted.length,` edits outside the target`]})]})]})]})]})]})}var ft={fail:{icon:l,cls:`text-fail`,label:`Failed`},ok:{icon:d,cls:`text-pass`,label:`Done`},info:{icon:C,cls:`text-muted`,label:`Info`},agent:{icon:P,cls:`text-accent-fg`,label:`Agent`},tool:{icon:m,cls:`text-muted`,label:`Tool`}};function pt(e,t){let n=new Map;for(let r of e){let e=r.unit?`u:${r.unit}`:`s:${r.stage}`,i=n.get(e);if(!i){let a=r.unit?t.plan.units.find(e=>e.id===r.unit):void 0,o=a?.case?t.plan.cases.find(e=>e.id===a.case):void 0;i=a?{key:e,title:a.kind===`test`?o?.name||a.case||a.id:a.kind===`page`?`Page object ${a.page||``}`.trim():`Set-up`,sub:`${a.id} · ${Ye(a)} · ${a.target}`,status:t.result?.units.find(e=>e.id===a.id)?.status,events:[]}:{key:e,title:He[r.stage]||r.stage,sub:`Stage`,events:[]},n.set(e,i)}i.events.push(r)}return[...n.values()]}var mt=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`});function ht({d:e,events:t,running:n}){let i=(0,X.useRef)(null),a=(0,X.useRef)(!0),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(`all`),[u,d]=(0,X.useState)({}),f=pt(t,e),p=o.trim().toLowerCase(),m=e=>(c===`all`||e.kind===c)&&(!p||e.text.toLowerCase().includes(p)),h=c!==`all`||!!p,g=f.map(e=>({...e,lines:e.events.filter(m),matchTitle:!!p&&`${e.title} ${e.sub}`.toLowerCase().includes(p)})).map(e=>({...e,lines:e.matchTitle?e.events.filter(e=>c===`all`||e.kind===c):e.lines})).filter(e=>e.lines.length),_=e=>t.filter(t=>t.kind===e).length,v=f[f.length-1]?.key;return(0,X.useEffect)(()=>{n&&!h&&a.current&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[t.length,n,h]),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(W,{id:`tosca-activity-search`,label:`Find a line`,value:o,onChange:s,placeholder:`Find a line, test case or file`}),(0,Z.jsx)(ue,{items:[{id:`all`,label:`All`,n:t.length},{id:`fail`,label:`Failed`,n:_(`fail`),alert:!0},{id:`ok`,label:`Done`,n:_(`ok`)},{id:`info`,label:`Info`,n:_(`info`)},{id:`agent`,label:`Agent`,n:_(`agent`)},{id:`tool`,label:`Tools`,n:_(`tool`)}],value:c,onChange:l})]}),(0,Z.jsxs)(`div`,{ref:i,role:`log`,"aria-live":n?`polite`:void 0,"aria-label":`Activity`,onScroll:e=>{let t=e.currentTarget;a.current=t.scrollTop+t.clientHeight>=t.scrollHeight-24},className:`flex max-h-[60vh] flex-col overflow-y-auto rounded-[12px] card border`,children:[g.map(e=>{let t=e.events.filter(e=>e.kind===`fail`).length,i=u[e.key]??(h||t>0||n&&e.key===v),a=`act-${e.key.replace(/[^A-Za-z0-9_-]/g,`-`)}`,o=e.status?ze[e.status]:void 0;return(0,Z.jsxs)(`div`,{className:`border-b border-line-soft last:border-b-0`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":a,onClick:()=>d(t=>({...t,[e.key]:!i})),className:`flex w-full min-w-0 cursor-pointer items-center gap-4 border-0 bg-transparent px-4 py-2 text-left hover:bg-surface-muted`,children:[(0,Z.jsx)(r,{size:15,"aria-hidden":`true`,className:I(`flex-none text-muted transition-transform`,i&&`rotate-180`)}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block text-sm font-medium text-ink [overflow-wrap:anywhere]`,children:e.title}),(0,Z.jsx)(`span`,{className:`block truncate font-mono text-[13px] text-muted`,children:e.sub})]}),(0,Z.jsxs)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:[h&&e.lines.length!==e.events.length?`${e.lines.length} of ${Y(e.events.length,`line`)}`:Y(e.events.length,`line`),t>0&&(0,Z.jsxs)(`span`,{className:`text-fail`,children:[` · `,t,` failed`]})]}),o&&(0,Z.jsx)(H,{tone:o.tone,children:o.label})]}),(0,Z.jsx)(Te,{open:i,id:a,children:(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col border-t border-line-soft p-0`,children:e.lines.map((e,t)=>{let n=ft[e.kind];return(0,Z.jsxs)(`li`,{className:`flex gap-4 border-b border-line-soft py-2 pr-4 pl-12 text-[13px] last:border-b-0`,children:[(0,Z.jsx)(`span`,{className:`w-[76px] flex-none text-[13px] whitespace-nowrap text-muted tabular-nums`,children:mt(e.ts)}),(0,Z.jsx)(n.icon,{size:16,role:`img`,"aria-label":n.label,className:I(`mt-1 flex-none`,n.cls)}),(0,Z.jsx)(`span`,{className:I(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`fail`?`text-fail`:e.kind===`ok`?`text-ink`:e.kind===`tool`?`font-mono text-[13px] text-muted`:`text-ink-2`),children:e.text})]},t)})})})]},e.key)}),!g.length&&(0,Z.jsx)(`p`,{className:`m-0 px-4 py-8 text-center text-sm text-muted`,children:t.length?`No line matches.`:`Nothing yet.`})]})]})}function gt({id:e,plan:t}){let[n,i]=(0,X.useState)(null),[s,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(`overview`),[p,m]=(0,X.useState)(),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)([]),[C,w]=(0,X.useState)(!1),[T,E]=(0,X.useState)(!1),[D,k]=(0,X.useState)(!1),[te,ne]=(0,X.useState)(!1),[A,N]=(0,X.useState)(!1),[P,F]=(0,X.useState)(!1),[I,ae]=(0,X.useState)(!1),[oe,R]=(0,X.useState)(!1),z=(0,X.useRef)(0),B=(0,X.useCallback)(()=>{L.detail(e).then(e=>{i(e),l(``)},e=>l(e.message));let t=z.current;L.events(e,t).then(e=>{if(e.next<z.current){z.current=0,x([]);return}let t=z.current;if(e.next<=t)return;let n=e.events.slice(Math.max(0,e.events.length-(e.next-t)));z.current=e.next,n.length&&x(e=>[...e,...n].slice(-2e3))},()=>{})},[e]);(0,X.useEffect)(B,[B]);let V=!!(n?.job?.running||n?.result?.status===`running`);(0,X.useEffect)(()=>{if(!V)return;let e=we(B,1500);return()=>_e(e)},[V,B]);let se=(0,X.useCallback)(e=>{i(e),l(``),d(`overview`),setTimeout(B,800)},[B]),W=async e=>{w(!0),l(``);try{i(await e()),setTimeout(B,800)}catch(e){l(e.message)}finally{w(!1)}};if(!n)return s?(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:s}):(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});let ce=tt(n),le=Fe(n.plan,n.result),G=n.result,ue=(G?.units||[]).filter(e=>e.kind===`test`&&(e.status===`failed`||e.status===`blocked`)).length,de=n.plan.cases.filter(e=>e.included).length,fe=[{id:`overview`,label:`Overview`},{id:`steps`,label:`Steps`,n:de?String(de):void 0,tone:ue?`text-fail`:void 0},{id:`activity`,label:`Activity`}];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`a`,{href:j(`migration`,`migrations`),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,Z.jsx)(O,{size:16,"aria-hidden":`true`}),`Migrations`]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-start`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,Z.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:Q(n.plan.source.file)}),(0,Z.jsx)(re,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Z.jsx)(Ge,{framework:n.plan.target.id.split(`-`)[0],language:n.plan.target.id.split(`-`).slice(1).join(`-`),size:20}),n.plan.target.title]})]}),(0,Z.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm text-muted`,children:[(0,Z.jsxs)(`span`,{children:[`Tricentis Tosca`,n.plan.source.project?` · ${n.plan.source.project}`:``]}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Z.jsxs)(`span`,{children:[`into `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:n.plan.target.dir})]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(H,{tone:ce.tone,children:ce.label}),V?(0,Z.jsxs)(U,{variant:`danger`,disabled:C,onClick:()=>void W(()=>L.stop(e)),children:[(0,Z.jsx)(M,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]}):(0,Z.jsxs)(Z.Fragment,{children:[G&&(G.status===`stopped`||G.status===`failed`)&&(0,Z.jsxs)(U,{disabled:C,onClick:()=>R(!0),"data-tip":`Start this conversion again. Tests it already wrote are kept.`,children:[(0,Z.jsx)(S,{"aria-hidden":`true`}),`Start again`]}),G&&(0,Z.jsxs)(U,{variant:`ghost`,onClick:()=>location.hash=j(`tosca`,e,`report`),children:[(0,Z.jsx)(ee,{"aria-hidden":`true`}),`Report`]}),G&&n.plan.units.some(e=>e.kind===`test`&&!e.engine)&&(0,Z.jsxs)(U,{disabled:C,onClick:()=>void W(()=>L.verify(e)),"data-tip":`Run every converted test again, no agent`,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Run`]}),(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsxs)(U,{variant:`ghost`,disabled:C,"aria-haspopup":`menu`,"aria-expanded":P,onClick:()=>F(!P),children:[(0,Z.jsx)(o,{"aria-hidden":`true`}),`More`,(0,Z.jsx)(r,{"aria-hidden":`true`})]}),(0,Z.jsxs)(he,{open:P,onClose:()=>F(!1),label:`More for this conversion`,align:`end`,className:`w-[240px]`,children:[G&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(pe,{onClick:()=>(F(!1),k(!0)),children:[(0,Z.jsx)(a,{size:16,"aria-hidden":`true`,className:`mr-2 flex-none text-muted`}),`Re-import`]}),(0,Z.jsxs)(pe,{onClick:()=>(F(!1),N(!0)),children:[(0,Z.jsx)(f,{size:16,"aria-hidden":`true`,className:`mr-2 flex-none text-muted`}),`CI`]}),(0,Z.jsxs)(pe,{onClick:()=>(F(!1),ne(!0)),children:[(0,Z.jsx)(h,{size:16,"aria-hidden":`true`,className:`mr-2 flex-none text-muted`}),`Pull request`]}),(0,Z.jsx)(`div`,{role:`separator`,className:`mx-2 my-1 border-t border-line-soft`})]}),(0,Z.jsxs)(pe,{onClick:()=>(F(!1),E(!0)),children:[(0,Z.jsx)(ie,{size:16,"aria-hidden":`true`,className:`mr-2 flex-none text-fail`}),(0,Z.jsx)(`span`,{className:`text-fail`,children:`Delete`})]})]})]})]})]})]}),D&&(0,Z.jsx)(nt,{d:n,onClose:()=>k(!1)}),te&&(0,Z.jsx)(at,{id:e,onClose:()=>ne(!1)}),A&&(0,Z.jsx)(it,{id:e,onClose:()=>N(!1)}),oe&&(0,Z.jsx)(et,{plan:n.plan,acceptLimits:!1,again:!0,onClose:()=>R(!1),onStarted:e=>{R(!1),i(e)}}),I&&n.result?.batch&&(0,Z.jsx)(et,{plan:n.plan,acceptLimits:!1,next:n.result.batch,onClose:()=>ae(!1),onStarted:e=>{ae(!1),i(e)}}),T&&(0,Z.jsx)(ot,{id:e,title:`${Q(n.plan.source.file)} → ${n.plan.target.title}`,targetDir:n.plan.target.dir,onClose:()=>E(!1)}),G&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 rounded-[12px] card border px-4 py-2 @xl:gap-4 @xl:px-4`,children:[(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(Be,{states:G.stages})}),V&&(0,Z.jsxs)(`span`,{className:`flex-none text-[13px] font-semibold tabular-nums text-accent-fg`,"aria-label":`${Math.round(le)}% done`,children:[Math.round(le),`%`]})]}),s&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:s}),(0,Z.jsx)(xe,{prefix:`mtab`,className:`mb-0`,tabs:fe,current:u,onPick:d,label:`Tosca conversion`}),(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`mtab-panel-${u}`,"aria-labelledby":`mtab-${u}`,className:`pane-swap flex min-w-0 flex-col gap-4`,children:[u===`overview`&&(0,Z.jsx)(dt,{d:n,planView:t(n,se),busy:C||V,onFix:_,onSteps:e=>(m(e),d(`steps`)),onOutput:y,onRun:t=>void W(()=>L.verify(e,t)),onNext:()=>ae(!0)}),u===`steps`&&(0,Z.jsx)(Ze,{id:e,plan:n.plan,result:G,initial:p}),u===`activity`&&(0,Z.jsx)(ht,{d:n,events:b,running:V})]},u),v&&(0,Z.jsx)(ct,{d:n,unit:v,onClose:()=>y(null)}),g&&(0,Z.jsx)(st,{d:n,unit:g,onClose:()=>_(null),onSend:t=>{_(null),W(()=>L.fix(e,[g],t))}})]})}var _t=e=>e.slice(e.lastIndexOf(`/`)+1),vt=50,yt=[{id:`failed`,label:`Failed`,bar:`bg-fail`,open:!0},{id:`attention`,label:`Needs a look`,bar:`bg-warn`,open:!0},{id:`passed`,label:`Passed`,bar:`bg-pass`,open:!1},{id:`notrun`,label:`Not run`,bar:`bg-line-strong`,open:!1},{id:`leftout`,label:`Left out`,bar:`bg-line`,open:!1}];function bt(e){return e===`converted`?ze.converted:e===`failed`?ze.failed:e===`blocked`?ze.blocked:e===`left out`?{label:`Left out`,tone:`neutral`}:e===`written`?ze.written:e===`not run`||e===`skipped`?{label:`Not run`,tone:`neutral`}:{label:e,tone:`neutral`}}function xt(e){for(let t of Ue){let n=e[t];if(n?.status===`failed`)return{id:t,...n.note?{note:n.note}:{}}}return null}function St({planId:e,unit:t,file:n}){let r=/\.(webm|mp4)$/i.test(n),[i,a]=(0,X.useState)(!r),[o,s]=(0,X.useState)(``),[l,u]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{if(!i)return;let r=!1;return s(``),u(!1),L.evidence(e,t,n).then(e=>!r&&s(e),()=>!r&&u(!0)),()=>{r=!0}},[e,t,n,i]),(0,Z.jsxs)(`li`,{className:`flex w-[260px] max-w-full flex-col gap-1`,children:[o?r?(0,Z.jsx)(`video`,{controls:!0,autoPlay:!0,src:o,className:`max-h-[200px] w-full rounded-[10px] border border-line-soft bg-surface-muted`}):(0,Z.jsx)(`img`,{src:o,alt:`Screenshot ${n}`,className:`max-h-[200px] w-full rounded-[10px] border border-line-soft object-contain`}):r&&!i?(0,Z.jsxs)(U,{variant:`ghost`,onClick:()=>a(!0),className:`h-[120px] w-full rounded-[10px] border border-line-soft bg-surface-muted`,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Play video`]}):(0,Z.jsx)(`span`,{role:`status`,className:`flex h-[120px] items-center justify-center rounded-[10px] border border-line-soft bg-surface-muted text-[13px] text-muted`,children:l?`Not available`:`Loading…`}),(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-muted`,children:n})]})}function Ct({planId:e,pick:t,video:n}){let[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(``);(0,X.useEffect)(()=>{let n=!1;return i(null),o(``),L.reportCase(e,t.case).then(e=>!n&&i(e),e=>!n&&o(e.message)),()=>{n=!0}},[e,t.case]);let s=bt(t.status),c=t.group===`failed`||t.group===`attention`;return(0,Z.jsxs)(`section`,{"aria-label":`Test case ${t.name}`,className:`flex min-w-0 flex-col gap-4 rounded-[12px] card border p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-1`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold [overflow-wrap:anywhere]`,children:t.name}),(0,Z.jsxs)(`p`,{className:`m-0 pt-1 text-[13px] text-muted [overflow-wrap:anywhere]`,children:[t.file?(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:t.file}):`No file`,t.suites.length?` · ${t.suites.join(`, `)}`:``,t.folders.length?` · ${t.folders.join(` / `)}`:``]}),(t.uid||t.change)&&(0,Z.jsxs)(`p`,{className:`m-0 pt-1 text-[13px] text-muted [overflow-wrap:anywhere]`,children:[t.uid?(0,Z.jsxs)(`span`,{children:[`Tosca id `,(0,Z.jsx)(`span`,{className:`font-mono`,children:t.uid})]}):null,t.uid&&t.change?` · `:``,t.change?wt[t.change]:``]})]}),(0,Z.jsx)(H,{tone:s.tone,children:s.label}),t.ms>0&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:Pe(t.ms)})]}),a&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a}),!r&&!a&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),r&&(0,Z.jsxs)(Z.Fragment,{children:[(r.problems?.length||r.reason)&&(0,Z.jsx)(`div`,{className:I(`flex flex-col gap-1 rounded-[10px] px-4 py-2 text-[13px] [overflow-wrap:anywhere]`,c?`bg-fail-soft text-fail`:`bg-surface-muted text-ink-2`),children:(r.problems?.length?r.problems:[r.reason]).map((e,t)=>(0,Z.jsx)(`span`,{children:e},t))}),r.media.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:n?`Video and failure screenshots`:`Failure screenshots`}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-4 p-0`,children:r.media.map(t=>(0,Z.jsx)(St,{planId:e,unit:r.unit,file:t},t))})]}):r.unit&&r.group!==`notrun`?(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:c?`No screenshot${n?` or video`:``} was kept for this failure.`:n?`No video was kept for this run.`:`No screenshot: the test passed.`}):null,r.fidelity&&r.fidelity.rows.length>0&&(0,Z.jsx)(je,{title:`Tosca steps (${r.fidelity.matched} of ${r.fidelity.required} in the test)`,defaultOpen:!!(r.fidelity.missing.length||r.personSteps.length),children:(0,Z.jsx)(ve,{label:`Tosca steps`,placeholder:`Find a step`,height:`min(40vh, 360px)`,resetKey:t.case,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:I(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-14`),children:`Step`}),(0,Z.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`What it does`}),(0,Z.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`In the test`})]}),children:r.fidelity.rows.map(e=>{let t=Ve[e.status]||Ve.matched;return(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,Z.jsx)(`td`,{className:I(`px-4 py-2`,`font-mono text-[13px] text-muted`),children:e.id}),(0,Z.jsxs)(`td`,{className:I(`px-4 py-2`,`[overflow-wrap:anywhere]`),children:[e.kind===`assert`?`check ${e.op}`:e.op,` on `,e.element||`—`,e.step&&(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Tosca “`,e.step,`”`]})]}),(0,Z.jsx)(`td`,{className:I(`px-4 py-2`,`whitespace-nowrap`),children:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:I(`size-2 flex-none rounded-full`,t.dot)}),t.label]})})]},e.id)})})}),r.command&&(0,Z.jsxs)(`code`,{className:`block font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:[`$ `,r.command]}),r.output&&(0,Z.jsx)(je,{title:`Test output`,defaultOpen:c,children:(0,Z.jsx)(`pre`,{className:`m-0 max-h-[40vh] overflow-auto rounded-[10px] bg-surface-muted px-4 py-2 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:r.output})})]})]})}var wt={same:`Unchanged in Tosca: its earlier test kept`,changed:`Changed in Tosca: converted again`,new:`New in Tosca`},Tt=e=>`"${(/^[=+\-@\t\r]/.test(e)?`'${e}`:e).replace(/"/g,`""`)}"`;function Et(e){let t=[`Tosca id`,`Test case`,`Tosca path`,`Status`,`Test file`,`Steps in the test`,`Change`,`Execution lists`],n=e.tests.map(t=>[t.uid||``,t.name,[...t.folders,t.name].join(` / `),bt(t.status).label,t.file?`${e.target.dir}/${t.file}`:``,t.fidelity?`${t.fidelity.matched}/${t.fidelity.required}`:``,t.change?wt[t.change]:``,t.suites.join(`; `)]);for(let t of e.removed)n.push([t.uid||``,t.name,t.name,`Removed from Tosca`,t.file||``,``,``,``]);let r=[t,...n].map(e=>e.map(Tt).join(`,`)).join(`\r
2
+ `),i=URL.createObjectURL(new Blob([`${r}\r\n`],{type:`text/csv;charset=utf-8`})),a=document.createElement(`a`);a.href=i,a.download=`tosca-${e.id}-traceability.csv`,a.click(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}function Dt({g:e,rows:t,open:n,onToggle:i,pick:a,onPick:o}){let s=()=>Math.max(0,Math.floor(t.findIndex(e=>e.case===a)/vt)),[c,l]=(0,X.useState)(s),u=(0,X.useId)();(0,X.useEffect)(()=>l(s()),[t.length]);let d=t.slice(c*vt,c*vt+vt);return(0,Z.jsxs)(`div`,{className:`border-b border-line-soft last:border-b-0`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":n,"aria-controls":u,onClick:i,className:`flex w-full cursor-pointer items-center gap-2 border-0 bg-transparent px-4 py-2 text-left hover:bg-surface-muted`,children:[(0,Z.jsx)(r,{size:15,"aria-hidden":`true`,className:I(`flex-none text-muted transition-transform`,n&&`rotate-180`)}),(0,Z.jsx)(`span`,{className:I(`size-2 flex-none rounded-full`,e.bar),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1 text-sm font-medium`,children:e.label}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:t.length})]}),(0,Z.jsxs)(Te,{open:n,id:u,children:[(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:d.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":a===e.case,onClick:()=>o(e),className:I(`flex w-full min-w-0 cursor-pointer flex-col gap-1 border-0 px-4 py-2 pl-10 text-left`,a===e.case?`bg-accent-soft`:`bg-transparent hover:bg-surface-muted`),children:[(0,Z.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px] font-medium text-ink [overflow-wrap:anywhere]`,children:e.name}),e.ms>0&&(0,Z.jsx)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:Pe(e.ms)})]}),e.note&&(0,Z.jsx)(`span`,{className:I(`truncate text-[13px]`,e.group===`failed`?`text-fail`:`text-muted`),children:e.note}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 gap-2 text-[13px] text-muted`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:e.file||`No file`}),e.fidelity&&(0,Z.jsxs)(`span`,{className:`flex-none tabular-nums`,children:[e.fidelity.matched,`/`,e.fidelity.required,` steps`]}),e.media>0&&(0,Z.jsx)(`span`,{className:`flex-none tabular-nums`,children:Y(e.media,`file`)})]})]})},e.case))}),t.length>vt&&(0,Z.jsx)(le,{page:c,size:vt,total:t.length,onPage:l,label:`${e.label} pages`})]})]})}function Ot({label:e,children:t,wide:n}){return(0,Z.jsxs)(`div`,{className:I(`flex min-w-0 flex-col gap-1`,n&&`@3xl:col-span-2`),children:[(0,Z.jsx)(`dt`,{className:`text-[13px] text-muted`,children:e}),(0,Z.jsx)(`dd`,{className:`m-0 text-[13px] text-ink [overflow-wrap:anywhere]`,children:t})]})}function kt({id:e,caseId:t}){let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(``),[o,s]=(0,X.useState)(!0),[c,l]=(0,X.useState)(`all`),[u,d]=(0,X.useState)(``),[f,p]=(0,X.useState)(``),[m,h]=(0,X.useState)({}),[g,_]=(0,X.useState)(``),[v,y]=(0,X.useState)(``);(0,X.useEffect)(()=>{s(!0),L.report(e).then(e=>{if(r(e.report),a(e.report?``:`No report yet. Start the conversion first.`),s(!1),e.report){let n=t&&e.report.tests.find(e=>e.case===t)||e.report.tests.find(e=>e.group===`failed`||e.group===`attention`)||e.report.tests.find(e=>e.group!==`leftout`);p(n?n.case:``)}},e=>{a(e.message),s(!1)})},[e]),(0,X.useEffect)(()=>{f&&history.replaceState(null,``,j(`tosca`,e,`report`,encodeURIComponent(f)))},[e,f]);let b=u.trim().toLowerCase(),x=(0,X.useMemo)(()=>{let e={failed:[],attention:[],passed:[],notrun:[],leftout:[]};for(let t of n?.tests||[])c!==`all`&&t.group!==c||b&&!`${t.name} ${t.file} ${t.case} ${t.note||``} ${t.suites.join(` `)} ${t.folders.join(` `)}`.toLowerCase().includes(b)||e[t.group].push(t);return e},[n,c,b]),S=async t=>{_(t),y(``);try{let n=await(t===`zip`?L.reportZip(e):L.reportHtml(e)),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`tosca-${e}.${t}`,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}catch(e){y(e.message)}finally{_(``)}};if(o)return(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading report…`});if(i||!n)return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`a`,{href:j(`tosca`,e),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,Z.jsx)(O,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i||`No report.`})]});let C=Le[n.status]||{label:n.status,tone:`neutral`},[w,...T]=n.target.id.split(`-`),E=xt(n.stages),ee=n.tests.length-n.counts.leftout,D=n.tests.find(e=>e.case===f)||null,k=yt.reduce((e,t)=>e+x[t.id].length,0),te=Math.max(1,n.tests.length);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`a`,{href:j(`tosca`,e),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,Z.jsx)(O,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsx)(`p`,{className:`m-0 text-[13px] font-medium tracking-wide text-muted uppercase`,children:`Conversion report`}),(0,Z.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,Z.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:_t(n.source.file)}),(0,Z.jsx)(re,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Z.jsx)(Ge,{framework:w,language:T.join(`-`),size:20}),n.target.title]})]})]}),(0,Z.jsx)(H,{tone:C.tone,children:C.label}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsxs)(U,{size:`sm`,onClick:()=>void S(`html`),disabled:!!g,"data-tip":`ForgeQE's HTML report of this conversion: one file with the failure screenshots inside. The zip has the videos too.`,children:[(0,Z.jsx)(A,{"aria-hidden":`true`}),g===`html`?`Making the HTML report…`:`HTML report`]}),(0,Z.jsxs)(U,{size:`sm`,variant:`ghost`,onClick:()=>Et(n),"data-tip":`Every Tosca test case by its unique id and path, with what became of it: its test file, outcome and steps.`,children:[(0,Z.jsx)(A,{"aria-hidden":`true`}),`Traceability CSV`]}),(0,Z.jsxs)(U,{size:`sm`,onClick:()=>void S(`zip`),disabled:!!g||n.status===`running`,"data-tip":n.status===`running`?`The zip is made when the run ends.`:`The HTML report with every screenshot and video: unzip it and open report.html.`,children:[(0,Z.jsx)(A,{"aria-hidden":`true`}),g===`zip`?`Making the zip…`:`Zip with videos`]})]})]}),v&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:v}),(0,Z.jsxs)(`section`,{"aria-label":`Summary`,className:`flex flex-col gap-4 rounded-[12px] card border px-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-[13px]`,children:[(0,Z.jsxs)(`span`,{className:`font-semibold`,children:[n.counts.passed,` of `,ee,` passed`]}),yt.filter(e=>n.counts[e.id]>0).map(e=>(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-ink-2`,children:[(0,Z.jsx)(`span`,{className:I(`size-2 rounded-full`,e.bar),"aria-hidden":`true`}),e.label,` `,(0,Z.jsx)(`span`,{className:I(`tabular-nums`,e.id===`failed`?`text-fail`:``),children:n.counts[e.id]})]},e.id))]}),(0,Z.jsx)(`div`,{className:`flex h-1.5 overflow-hidden rounded-full bg-surface-strong`,"aria-hidden":`true`,children:yt.map(e=>n.counts[e.id]?(0,Z.jsx)(`span`,{className:e.bar,style:{width:`${n.counts[e.id]/te*100}%`}},e.id):null)}),(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-2 gap-x-6 gap-y-2 @3xl:grid-cols-4 @5xl:grid-cols-6`,children:[(0,Z.jsxs)(Ot,{label:`Time`,children:[Pe(n.ms),` · started `,Ne(n.startedAt)]}),(0,Z.jsxs)(Ot,{label:`Tosca steps in the tests`,children:[n.steps.required?`${n.steps.matched} of ${n.steps.required}`:`–`,n.personSteps?(0,Z.jsxs)(`span`,{className:`text-warn`,children:[` · `,n.personSteps,` for a person`]}):null]}),(0,Z.jsx)(Ot,{label:`Media`,children:n.media?Y(n.media,`file`):n.target.video?`Videos and failure screenshots`:`Failure screenshots`}),(0,Z.jsxs)(Ot,{label:`LLM`,children:[n.model||`–`,n.usage.input||n.usage.output?(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,ke(n.usage.input+n.usage.output),` tokens`,n.cost?` · ${n.cost.estimate?`≈`:``}${Ae(n.cost.amount,n.cost.currency)}`:``]}):null]}),(0,Z.jsxs)(Ot,{label:`From`,children:[`Tosca`,n.source.project?` · ${n.source.project}`:``,` · `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:n.source.file}),n.source.baseUrl&&(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:n.source.baseUrl})]}),(0,Z.jsxs)(Ot,{label:`To`,children:[n.target.title,` · `,(0,Z.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[n.target.dir,`/`]}),n.reverted.length>0&&(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[Y(n.reverted.length,`edit`),` outside it put back`]})]})]}),(n.previous||n.removed.length>0)&&(0,Z.jsxs)(`p`,{className:`m-0 rounded-[10px] bg-surface-muted px-4 py-2 text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:[n.previous?(0,Z.jsxs)(Z.Fragment,{children:[`Re-imported from `,(0,Z.jsx)(`a`,{href:j(`tosca`,n.previous,`report`),children:n.previous}),`: `,n.tests.filter(e=>e.change===`same`).length,` unchanged (their tests kept), `,n.tests.filter(e=>e.change===`changed`).length,` changed, `,n.tests.filter(e=>e.change===`new`).length,` new.`,` `]}):null,n.removed.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[Y(n.removed.length,`test case`),` no longer in the exports; their tests are left as they are: `,n.removed.slice(0,5).map(e=>`${e.name}${e.file?` (${e.file})`:``}`).join(`; `),n.removed.length>5?`; …`:``,`.`]})]}),E&&(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[`Failed in `,He[E.id],E.note?`: ${E.note}`:``]})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-4 @5xl:grid-cols-[minmax(320px,400px)_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,Z.jsx)(W,{id:`tosca-report-search`,label:`Find a test case`,value:u,onChange:d,placeholder:`Find a test case, file or problem`,className:`max-w-none flex-none`}),(0,Z.jsx)(`div`,{role:`group`,"aria-label":`Show`,className:`flex flex-wrap gap-1`,children:(0,Z.jsx)(ue,{items:[{id:`all`,label:`All`,n:n.tests.length},...yt.filter(e=>n.counts[e.id]>0).map(e=>({id:e.id,label:e.label,n:n.counts[e.id],alert:e.id===`failed`}))],value:c,onChange:l})}),(0,Z.jsxs)(`nav`,{"aria-label":`Test cases`,className:`flex flex-col overflow-hidden overscroll-contain rounded-[12px] card border @5xl:max-h-[min(70vh,760px)] @5xl:overflow-y-auto`,children:[yt.filter(e=>x[e.id].length).map(e=>(0,Z.jsx)(Dt,{g:e,rows:x[e.id],open:m[e.id]??(e.open||c===e.id||!!b||x[e.id].some(e=>e.case===f)),onToggle:()=>h(t=>({...t,[e.id]:!(t[e.id]??(e.open||c===e.id||!!b||x[e.id].some(e=>e.case===f)))})),pick:f,onPick:e=>p(e.case)},e.id)),!k&&(0,Z.jsx)(`p`,{className:`m-0 px-4 py-6 text-center text-sm text-muted`,children:`No test case matches.`})]})]}),(0,Z.jsx)(`div`,{className:`min-w-0 @5xl:sticky @5xl:top-4`,children:D?(0,Z.jsx)(`div`,{className:`pane-swap`,children:(0,Z.jsx)(Ct,{planId:n.id,pick:D,video:n.target.video})},D.case):(0,Z.jsx)(`p`,{className:`m-0 rounded-[12px] card border px-4 py-6 text-center text-sm text-muted`,children:`Pick a test case to see its steps, output and media.`})})]})]})}var At={converted:{icon:d,cls:`text-pass`,label:`Converted`},partly:{icon:s,cls:`text-warn`,label:`Converted, with steps for a person`},not:{icon:l,cls:`text-muted`,label:`Not converted`}},jt=e=>`"${(/^[=+\-@\t\r]/.test(e)?`'${e}`:e).replace(/"/g,`""`)}"`;function Mt(e,t,n){let r=[[`Test case id`,`Test case`,`Kind`,`What happens`,`Modules behind it`].map(jt).join(`,`)];for(let n of e.rows)for(let e of n.cases)r.push([e,t.get(e)||e,n.label,At[n.outcome].label,n.modules.map(e=>e.name).join(`; `)].map(jt).join(`,`));let i=URL.createObjectURL(new Blob([`${r.join(`\r
3
+ `)}\r\n`],{type:`text/csv;charset=utf-8`})),a=document.createElement(`a`);a.href=i,a.download=n,a.click(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}function Nt({coverage:e,names:t,file:n,folded:i=!1}){let a=e.converted+e.partly,[o,s]=(0,X.useState)(!i),c=(0,X.useId)();return(0,Z.jsxs)(`section`,{"aria-labelledby":`tsc-coverage`,className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-4 gap-y-1`,children:[(0,Z.jsx)(`h3`,{id:`tsc-coverage`,className:`m-0 text-sm font-semibold`,children:`What can be migrated`}),(0,Z.jsxs)(`span`,{className:`flex-1 text-[13px] text-ink-2`,children:[a,` of `,e.total,` test case`,e.total===1?``:`s`,e.partly?`, ${e.partly} of them with steps for a person`:``,`; `,e.not,` not`]}),i&&(0,Z.jsxs)(U,{size:`sm`,variant:`ghost`,"aria-expanded":o,"aria-controls":c,onClick:()=>s(!o),children:[(0,Z.jsx)(r,{"aria-hidden":`true`,className:I(`transition-transform`,o&&`rotate-180`)}),o?`Hide the breakdown`:`Show the breakdown`]}),(0,Z.jsxs)(U,{size:`sm`,variant:`ghost`,onClick:()=>Mt(e,t,n),"data-tip":`Every test case with its kind and what happens to it, for a spreadsheet.`,children:[(0,Z.jsx)(A,{"aria-hidden":`true`}),`CSV`]})]}),(0,Z.jsx)(Te,{open:o,id:c,children:(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:e.rows.map(e=>{let t=At[e.outcome];return(0,Z.jsxs)(`li`,{className:`flex gap-4 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,Z.jsx)(t.icon,{size:16,role:`img`,"aria-label":t.label,className:I(`mt-1 flex-none`,t.cls)}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-ink`,children:e.label}),(0,Z.jsx)(`span`,{className:`tabular-nums text-ink-2`,children:e.cases.length===1?`1 test case`:`${e.cases.length} test cases`})]}),(0,Z.jsx)(`span`,{className:`text-ink-2`,children:e.becomes}),e.modules.length>0&&(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[`Because of: `,e.modules.slice(0,4).map(e=>`${e.name}${e.engine?` (${e.engine})`:``} in ${e.cases}`).join(` · `),e.modules.length>4?` · and ${e.modules.length-4} more`:``]}),e.reasons&&e.reasons.length>0&&(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[`Steps left: `,e.reasons.slice(0,3).map(e=>`${e.count}× ${e.reason}`).join(` · `),e.reasons.length>3?` · and ${e.reasons.length-3} more`:``]})]})]},e.kind)})})})]})}var Pt={ok:{icon:d,cls:`text-pass`,label:`Ready`},answer:{icon:s,cls:`text-warn`,label:`Needs an answer`},blocker:{icon:l,cls:`text-fail`,label:`Blocks the start`}};function Ft({planId:e,stamp:t,busy:n,open:r,onChanged:i,onAccept:a,acceptTip:o}){let[s,c]=(0,X.useState)(null),[l,u]=(0,X.useState)(``),[d,f]=(0,X.useState)(``),[p,m]=(0,X.useState)(!1),[h,g]=(0,X.useState)(``);(0,X.useEffect)(()=>{L.data(e).then(e=>{c(e),g(``)},e=>g(e.message))},[e,t]);let _=async t=>{m(!0),g(``);try{c(await L.setData(e,t)),u(``),f(``),i()}catch(e){g(e.message)}finally{m(!1)}},v=n||p,y=s?[...new Set(s.cases.flatMap(e=>e.missing))]:[];return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 pt-1`,children:[s&&s.sources.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] text-ink-2`,children:s.sources.map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`font-mono`,children:e.file}),e.sheet?` (sheet ${e.sheet})`:``,`: `,Y(e.rows,`row`),e.transposed?`, attributes down the first column`:``]}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.file}${e.sheet?`, sheet ${e.sheet}`:``}`,disabled:v,onClick:()=>void _({remove:t}),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:`Remove`})]},`${e.file}\u0000${e.sheet||``}`))}),s&&y.length>0&&(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[`Not found yet: `,(0,Z.jsx)(`span`,{className:`font-mono`,children:y.slice(0,12).join(`, `)}),y.length>12?` and ${y.length-12} more`:``]}),r&&(0,Z.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),l&&_({file:l,...d.trim()?{sheet:d.trim()}:{}})},children:[(0,Z.jsxs)(R,{size:`sm`,"aria-label":`A data file of the project`,value:l,disabled:v||!s,onChange:e=>u(e.target.value),className:`w-auto max-w-[320px] font-mono`,children:[(0,Z.jsx)(`option`,{value:``,children:s&&!s.files.length?`No CSV, TSV, Excel or JSON file in the project`:`A data file of the project…`}),(s?.files||[]).map(e=>(0,Z.jsx)(`option`,{value:e.path,children:e.path},e.path))]}),/\.xls[xm]$/i.test(l)&&(0,Z.jsx)(B,{size:`sm`,"aria-label":`Sheet, the first if empty`,placeholder:`Sheet, the first if empty`,value:d,onChange:e=>f(e.target.value),disabled:v,className:`min-w-0 flex-[1_1_160px]`}),(0,Z.jsx)(U,{size:`sm`,type:`submit`,disabled:v||!l,children:`Use it`}),a&&(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,disabled:v,onClick:a,"data-tip":o,children:`Leave them for a person`})]}),h&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 text-[13px] text-fail`,children:h})]})}function It({r:e,busy:t,onAnswer:n}){let[r,i]=(0,X.useState)(``),a=String(e.environments.findIndex(t=>t.environment===e.answers.environment&&t.app===e.answers.app));return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[e.environments.length>0&&(0,Z.jsxs)(R,{size:`sm`,"aria-label":`An app of env.yaml`,value:a,disabled:t,onChange:t=>{let r=e.environments[Number(t.target.value)];r&&n({environment:r.environment,app:r.app})},className:`w-auto max-w-[320px]`,children:[(0,Z.jsx)(`option`,{value:`-1`,children:`An app of env.yaml…`}),e.environments.map((e,t)=>(0,Z.jsxs)(`option`,{value:String(t),children:[e.environment,` · `,e.app,` · `,e.url]},`${e.environment}\u0000${e.app}`))]}),(0,Z.jsxs)(`form`,{className:`flex min-w-0 flex-[1_1_280px] gap-2`,onSubmit:e=>{e.preventDefault(),r.trim()&&n({baseUrl:r.trim()})},children:[(0,Z.jsx)(B,{size:`sm`,type:`url`,"aria-label":`Or the address the tests start at`,placeholder:`Or the address, https://…`,value:r,onChange:e=>i(e.target.value),disabled:t,className:`min-w-0 flex-1`}),(0,Z.jsx)(U,{size:`sm`,type:`submit`,disabled:t||!r.trim(),children:`Use it`})]})]})}function Lt({item:e,picked:t,busy:n,onPick:r}){let i=e.apps||[];return i.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:(0,Z.jsxs)(R,{size:`sm`,"aria-label":e.engine===`database`?`A database`:e.engine===`mobile`?`A mobile app`:`A desktop app`,value:t&&i.includes(t)?t:``,disabled:n,onChange:e=>e.target.value&&r(e.target.value),className:`w-auto max-w-[320px] font-mono`,children:[(0,Z.jsx)(`option`,{value:``,children:e.engine===`database`?`A database…`:e.engine===`mobile`?`A mobile app…`:`A desktop app…`}),i.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]})}):(0,Z.jsxs)(`p`,{className:`m-0 pt-1 text-[13px] text-muted`,children:[e.engine===`database`?`No databases yet: add one in `:`No ${e.engine} apps yet: add one in `,(0,Z.jsx)(`a`,{href:j(`settings`,e.engine===`database`?`databases`:`environments`),children:e.engine===`database`?`Settings, Databases`:`Settings, Environments`}),`.`]})}function Rt({item:e,busy:t,secrets:n,onSaved:r,onAccept:i,onUse:a}){let[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(``),m=async()=>{d(!0),p(``);try{await ae.saveSecrets({[e.name]:o}),s(``),r()}catch(e){p(e.message)}finally{d(!1)}};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 pt-1`,children:[(0,Z.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),o&&m()},children:[(0,Z.jsx)(B,{size:`sm`,type:e.secret?`password`:`text`,autoComplete:`off`,spellCheck:!1,"aria-label":`Value of ${e.name}`,placeholder:e.secret?`Its value, kept in the credential store`:`Its value`,value:o,onChange:e=>s(e.target.value),disabled:t||u,className:`min-w-0 flex-[1_1_220px]`}),(0,Z.jsx)(U,{size:`sm`,type:`submit`,disabled:t||u||!o,children:`Save`}),e.accept&&(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,disabled:t||u,onClick:i,"data-tip":e.accept,children:`Convert without it`})]}),n.length>0&&!e.uses&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:`use-${e.name}`,className:`text-[13px] text-muted`,children:`Or use a saved secret`}),(0,Z.jsxs)(R,{id:`use-${e.name}`,size:`sm`,value:c,disabled:t||u,onChange:e=>l(e.target.value),className:`w-auto min-w-[200px] font-mono`,children:[(0,Z.jsx)(`option`,{value:``,children:`A saved secret…`}),n.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),(0,Z.jsx)(U,{size:`sm`,disabled:t||u||!c,onClick:()=>a(c),children:`Use it`})]}),f&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 text-[13px] text-fail`,children:f})]})}function zt({planId:e,onReady:t,onCoverage:n}){let[r,i]=(0,X.useState)(null),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(``),u=(0,X.useCallback)(e=>{i(e.readiness),t?.(e.readiness.ready),n?.(e.coverage)},[t,n]),d=(0,X.useCallback)(()=>{L.ready(e).then(u,e=>l(e.message))},[e,u]);(0,X.useEffect)(()=>{i(null),l(``),t?.(!1)},[e]),(0,X.useEffect)(d,[d]);let f=async t=>{s(!0),l(``);try{u(await L.answer(e,t))}catch(e){l(e.message)}finally{s(!1)}};return(0,Z.jsxs)(`section`,{"aria-labelledby":`tsc-ready`,className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-4 gap-y-1`,children:[(0,Z.jsx)(`h3`,{id:`tsc-ready`,className:`m-0 text-sm font-semibold`,children:`Before it runs`}),(0,Z.jsx)(`span`,{role:`status`,className:I(`flex-1 text-[13px]`,r?r.ready?`text-pass`:`text-ink-2`:`text-muted`),children:r?r.ready?`Everything the tests need is in place.`:`${r.blockers?`${r.blockers} to fix`:``}${r.blockers&&r.open?`, `:``}${r.open?`${r.open} to answer`:``} before it can start.`:`Checking…`}),(0,Z.jsxs)(U,{size:`sm`,variant:`ghost`,onClick:d,disabled:o,"data-tip":`Check again, after installing a program or setting a variable.`,children:[(0,Z.jsx)(a,{"aria-hidden":`true`}),`Check again`]})]}),c&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:c}),r&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:r.items.map(t=>{let n=Pt[t.level];return(0,Z.jsxs)(`li`,{className:`flex gap-4 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,Z.jsx)(n.icon,{size:16,role:`img`,"aria-label":n.label,className:I(`mt-1 flex-none`,n.cls)}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:I(`font-medium text-ink`,t.kind===`env`||t.kind===`tool`?`font-mono text-[13px]`:``),children:t.title}),(0,Z.jsx)(`span`,{className:`text-ink-2 [overflow-wrap:anywhere]`,children:t.text}),t.accepted&&(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-warn`,children:[`Accepted: `,t.accept,(0,Z.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>void f({unaccept:[t.id]}),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:`Undo`})]}),t.kind===`url`&&(0,Z.jsx)(It,{r,busy:o,onAnswer:e=>void f(e)}),t.kind===`app`&&t.engine&&(0,Z.jsx)(Lt,{item:t,picked:t.engine===`desktop`?r.answers.desktopApp:t.engine===`mobile`?r.answers.mobileApp:r.answers.database,busy:o,onPick:e=>void f(t.engine===`desktop`?{desktopApp:e}:t.engine===`mobile`?{mobileApp:e}:{database:e})}),t.kind===`env`&&t.level===`answer`&&(0,Z.jsx)(Rt,{item:t,busy:o,secrets:r.secrets||[],onSaved:d,onAccept:()=>void f({accept:[t.id]}),onUse:e=>void f({use:{name:t.name,secret:e}})}),t.kind===`env`&&t.uses&&(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-muted`,children:[(0,Z.jsxs)(`span`,{children:[`Uses the saved secret `,(0,Z.jsx)(`span`,{className:`font-mono`,children:t.uses}),`.`]}),(0,Z.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>void f({use:{name:t.name,secret:``}}),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:`Stop using it`})]}),t.kind===`data`&&(0,Z.jsx)(Ft,{planId:e,stamp:r,busy:o,open:t.level===`answer`,onChanged:d,onAccept:t.accept&&t.level===`answer`?()=>void f({accept:[t.id]}):void 0,acceptTip:t.accept})]})]},t.id)})})]})}var Bt=/^[a-f0-9]{16}$/,Vt=`forgeqe.tosca.assistant`;function Ht(){try{let e=localStorage.getItem(Vt)||``;return Bt.test(e)?e:``}catch{return``}}function Ut(e){try{e?localStorage.setItem(Vt,e):localStorage.removeItem(Vt)}catch{}}var Wt=[/\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{20,}/,/\bgithub_pat_[A-Za-z0-9_]{20,}/,/\bglpat-[A-Za-z0-9_-]{20,}/,/\bATBB[A-Za-z0-9_-]{20,}/,/\b[a-z2-7]{52}\b/,/\bsk-[A-Za-z0-9_-]{16,}/,/\b(?:Bearer|Basic)\s+[A-Za-z0-9._~+/=-]{16,}/i,/\b(?:password|passwd|secret|token|api[_-]?key)\s*[:=]\s*\S{6,}/i],Gt=e=>e.replace(/^.*\//,``).replace(/\.tsu$/i,``);function Kt(e){let t=e.exports[0]?.path||e.clones[0]?.exports[0]?.path,r=e.exports.length+e.clones.reduce((e,t)=>e+t.exports.length,0),i=[];return r>1&&i.push({icon:n,title:`All ${r} exports to Playwright`,hint:`Every export in one plan, in TypeScript`,text:`Migrate all the exports to Playwright in TypeScript`}),t&&i.push({icon:D,title:`${Gt(t)} to Selenium`,hint:`One export, in Java, with page objects`,text:`Migrate ${Gt(t)} to Selenium in Java, with page objects`}),t&&i.push({icon:g,title:`${Gt(t)} to Cypress`,hint:`Into a folder of its own`,text:`Migrate ${Gt(t)} to Cypress in TypeScript, into e2e/tosca`}),i.push({icon:T,title:`Help me choose`,hint:`The assistant asks one thing at a time`,text:`I want to migrate our Tosca tests. Help me choose.`}),i.slice(0,4)}function qt({view:e,sid:n,onSid:r}){let[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1),f=(0,X.useRef)(null),p=Se();(0,X.useEffect)(()=>{n&&i?.id!==n&&V.view(n).then(a,()=>{r(``),Ut(``)})},[n]),(0,X.useEffect)(()=>{if(!i?.thinking&&!i?.checking)return;let e=setTimeout(()=>V.view(i.id).then(a,e=>l(e.message)),1200);return()=>clearTimeout(e)},[i]);let m=i?.messages.length??0;(0,X.useEffect)(()=>{m&&f.current?.scrollIntoView({block:`nearest`,behavior:oe()})},[m,i?.thinking]);let h=e=>{s(e),setTimeout(()=>document.getElementById(`tosca-agent-box`)?.focus(),0)},g=async e=>{d(!0),l(``);try{let t=await e();return a(t),t.id!==n&&(r(t.id),Ut(t.id)),!0}catch(e){return l(e.message),!1}finally{d(!1)}},_=async e=>{!e.trim()||u||i?.thinking||(Wt.some(t=>t.test(e))?(s(``),l(`That looks like a token or a password, so it was not sent and the box was cleared. Use the token field of the clone question: it keeps it in your credential store.`)):await g(()=>i?V.say(i.id,e):V.start(e))&&s(``))},v=()=>{i&&V.end(i.id).catch(()=>{}),a(null),s(``),l(``),r(``),Ut(``)},y=()=>i?.prefill&&(location.hash=j(`tosca`,`new`,i.id)),b=!i,x=u||!!i?.thinking;return(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`panel-agent`,"aria-labelledby":`tab-agent`,className:`mx-auto flex w-full max-w-[1080px] flex-auto flex-col gap-6`,children:[b?(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[880px] flex-col items-center gap-4 pt-2 text-center short:gap-4 short:pt-0`,children:[(0,Z.jsx)(de,{agent:`forgeqe-tosca`,px:p?72:112,working:x,className:`mb-1`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`h2`,{className:`m-0 text-[20px] font-semibold`,children:`What do you want to migrate from Tosca?`}),(0,Z.jsx)(`p`,{className:`m-0 text-[16px] text-muted`,children:`Say it in your words: the exports, the framework and where the tests run. I ask only what I still need, then open the wizard with every stage filled in for you to check.`})]}),(0,Z.jsx)(Qt,{view:e,onGit:()=>h(`Clone the Tosca exports from https://`)}),(0,Z.jsx)(`div`,{className:`grid w-full gap-2 text-left sm:grid-cols-2`,children:Kt(e).map(e=>(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>h(e.text),className:`flex cursor-pointer items-start gap-4 rounded-[12px] card border px-4 py-2 text-left hover:border-line-strong hover:bg-surface-muted`,children:[(0,Z.jsx)(ce,{icon:e.icon,size:18,className:`mt-1 text-accent-fg`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-ink [overflow-wrap:anywhere]`,children:e.title}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.hint})]})]},e.title))}),(0,Z.jsxs)(`a`,{href:j(`tosca`,`new`),className:`inline-flex items-center gap-2 text-[13px]`,children:[(0,Z.jsx)(t,{size:14,"aria-hidden":`true`}),`Or set every option yourself`]})]}):(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,Z.jsxs)(`section`,{"aria-label":`Conversation with Guide`,className:`flex min-w-0 flex-col gap-6`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:i.model?`Worked out by ForgeQE's model from what you said and what your project has.`:`Worked out by ForgeQE's rules: no model is set up.`}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,onClick:v,disabled:u,children:`New conversation`})]}),(0,Z.jsxs)(`ol`,{"aria-live":`polite`,className:`m-0 flex list-none flex-col gap-6 p-0`,children:[i.messages.map((e,t)=>(0,Z.jsx)(`li`,{className:`fade-quick`,children:e.role===`person`?(0,Z.jsx)(ge,{text:e.text}):(0,Z.jsx)(Jt,{text:e.text})},t)),i.thinking&&(0,Z.jsx)(`li`,{className:`fade-quick`,children:(0,Z.jsx)(Jt,{text:i.working===`cloning`?`Cloning the repository and looking for Tosca exports…`:`Reading what you said…`,working:i.working===`cloning`?`cloning`:`reading`})})]}),!i.thinking&&i.question?.id===`clone`&&i.clone&&(0,Z.jsx)(Xt,{c:i.clone,disabled:u,onToken:e=>g(()=>V.token(i.id,e)),onPick:e=>void g(()=>V.pick(i.id,`clone`,[e]))},`clone-${m}`),!i.thinking&&i.question&&i.question.id!==`clone`&&i.question.options.length>0&&(0,Z.jsx)(Yt,{q:i.question,disabled:u,onPick:e=>void g(()=>V.pick(i.id,i.question.id,e)).then(()=>document.getElementById(`tosca-agent-box`)?.focus())},`${i.question.id}-${m}`),!i.thinking&&i.prefill&&(0,Z.jsxs)(`div`,{className:`fade-quick flex flex-wrap items-center gap-4 rounded-[14px] border border-accent-line bg-accent-soft px-4 py-4`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px] text-ink`,children:i.question?`The wizard can open now; the rest is optional.`:`Everything is ready.`}),(0,Z.jsxs)(U,{variant:`primary`,onClick:y,children:[`Open the prefilled wizard`,(0,Z.jsx)(re,{"aria-hidden":`true`})]})]}),(0,Z.jsx)(`div`,{ref:f})]}),(0,Z.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,Z.jsx)(Zt,{v:i})})]}),(0,Z.jsxs)(`div`,{className:`sticky bottom-0 z-10 mt-auto flex flex-col bg-gradient-to-t from-bg from-85% to-transparent pt-6 pb-4`,children:[c&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 bg-bg pb-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:c}),(0,Z.jsx)(De,{id:`tosca-agent-box`,label:`Tell Guide`,value:o,onChange:e=>{s(e),l(``)},onSend:()=>void _(o),busy:u,disabled:x,placeholder:b?`Migrate checkout.tsu to Playwright in TypeScript, on QA…`:`Answer, or change anything you said…`})]})]})}function Jt({text:e,working:t}){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,Z.jsx)(se,{state:t?`working`:`idle`,px:28,label:t?`Guide is ${t}`:`Guide`,className:`mt-1 flex-none`}),(0,Z.jsx)(`p`,{className:I(`m-0 text-[16px] leading-relaxed whitespace-pre-line [overflow-wrap:anywhere]`,t?`text-muted`:`text-ink-2`),children:e})]})}function Yt({q:e,disabled:t,onPick:n}){let[r,i]=(0,X.useState)([]);return(0,Z.jsxs)(`fieldset`,{className:`fade-quick m-0 ml-10 flex min-w-0 flex-col gap-2 border-0 p-0`,children:[(0,Z.jsx)(`legend`,{className:`sr-only`,children:e.text}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.multi?(0,Z.jsx)(G,{items:e.options.filter(e=>!e.action).map(e=>({id:e.id,label:e.label})),value:r,onChange:e=>{let t=e.includes(`all`)&&!r.includes(`all`);i(t?[`all`]:e.filter(e=>e!==`all`))}}):e.options.map(e=>(0,Z.jsxs)(U,{size:`sm`,variant:e.id===`skip`?`ghost`:`outline`,disabled:t,onClick:()=>n([e.id]),children:[e.label,e.hint&&(0,Z.jsx)(`span`,{className:`text-[13px] font-normal text-muted`,children:e.hint})]},e.id))}),e.multi&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[e.options.some(e=>!e.action)&&(0,Z.jsxs)(U,{size:`sm`,variant:`primary`,disabled:t||!r.length,onClick:()=>n(r),children:[`Use `,r.includes(`all`)?`all`:r.length>1?`these ${r.length}`:`this`]}),e.options.filter(e=>e.action).map(e=>(0,Z.jsxs)(U,{size:`sm`,variant:`outline`,disabled:t,onClick:()=>n([e.id]),children:[e.id===`git`&&(0,Z.jsx)(v,{"aria-hidden":`true`}),e.label]},e.id)),e.typed&&e.options.some(e=>!e.action)&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Or type the names below.`})]})]})}function Xt({c:e,disabled:t,onToken:n,onPick:r}){let[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(``),u=[...new Set([...e.credentials,...e.tokenVar?[e.tokenVar]:[]])].sort(),d=async()=>{if(i){s(!0),l(``);try{await ae.saveSecrets({[i.name]:i.value}),a(null),await n(i.name)}catch(e){l(e.message)}finally{s(!1)}}},f=t||o;return(0,Z.jsxs)(`fieldset`,{className:`fade-quick m-0 ml-10 flex min-w-0 flex-col gap-4 rounded-[14px] card border p-4`,children:[(0,Z.jsxs)(`legend`,{className:`sr-only`,children:[`Clone `,e.url]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,Z.jsxs)(`label`,{htmlFor:`tsa-token`,className:`flex flex-col gap-1 text-[13px] font-medium text-muted`,children:[`Access token`,(0,Z.jsxs)(R,{id:`tsa-token`,size:`sm`,value:e.tokenVar??``,disabled:f,onChange:e=>void n(e.target.value),className:`min-w-[220px]`,children:[(0,Z.jsx)(`option`,{value:``,children:`None (public, or ssh)`}),u.map(t=>(0,Z.jsxs)(`option`,{value:t,children:[t,t===e.tokenVar&&!e.tokenSaved?` (not saved yet)`:``]},t))]})]}),!i&&(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,disabled:f,onClick:()=>a({name:e.tokenVar&&!e.tokenSaved?e.tokenVar:e.suggested,value:``}),children:`Add a token`}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,disabled:f,onClick:()=>void n(e.tokenVar??``),children:`Check again`})]}),!i&&(0,Z.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Or save it in`,` `,(0,Z.jsx)(`a`,{href:j(`settings`,`repo-tokens`),target:`_blank`,rel:`noopener`,children:`Settings › Secrets › Repository tokens`}),`, then press Check again.`]}),i&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2 rounded-[12px] bg-surface-muted p-4`,children:[(0,Z.jsxs)(`label`,{htmlFor:`tsa-token-name`,className:`flex flex-col gap-1 text-[13px] font-medium text-muted`,children:[`Name`,(0,Z.jsx)(B,{id:`tsa-token-name`,size:`sm`,value:i.name,spellCheck:!1,maxLength:64,onChange:e=>a({...i,name:e.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,`_`)}),className:`w-[180px]`})]}),(0,Z.jsxs)(`label`,{htmlFor:`tsa-token-value`,className:`flex flex-col gap-1 text-[13px] font-medium text-muted`,children:[`Token`,(0,Z.jsx)(B,{id:`tsa-token-value`,size:`sm`,type:`password`,autoComplete:`off`,value:i.value,onChange:e=>a({...i,value:e.target.value}),className:`w-[260px] max-w-full`})]}),(0,Z.jsx)(U,{size:`sm`,disabled:f||!i.name||!i.value,onClick:()=>void d(),children:o?`Saving…`:`Save`}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,disabled:o,onClick:()=>a(null),children:`Cancel`}),(0,Z.jsx)(`span`,{className:`w-full text-[13px] text-muted`,children:`Kept in ForgeQE's credential store, never in the chat, the address or this page. Give it read access to the repository only.`})]}),c&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 text-[13px] text-fail [overflow-wrap:anywhere]`,children:c}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsxs)(U,{size:`sm`,variant:`primary`,disabled:f||!(!e.tokenVar||e.tokenSaved),onClick:()=>r(`yes`),children:[(0,Z.jsx)(v,{"aria-hidden":`true`}),`Clone it`]}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,disabled:f,onClick:()=>r(`no`),children:`No`}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.tokenVar&&!e.tokenSaved?`Save a token as ${e.tokenVar} first, or pick None.`:e.tokenVar?`Signs in with ${e.tokenVar}.`:`Nothing is cloned until you say so.`})]})]})}function Zt({v:e}){let t=(e,t)=>(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-line-soft py-4 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:e}),(0,Z.jsx)(`div`,{className:`text-sm [overflow-wrap:anywhere]`,children:t})]}),n=(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not picked yet`}),r=e.have;return(0,Z.jsxs)(`aside`,{"aria-label":`What the assistant has so far`,className:`flex flex-col rounded-[14px] card border p-6`,children:[t(r.exports.length>1?`Exports (${r.exports.length})`:`Export`,r.exports.length?(0,Z.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:[r.exports.slice(0,6).map(e=>(0,Z.jsx)(`li`,{className:`font-mono text-[13px]`,children:e},e)),r.exports.length>6&&(0,Z.jsxs)(`li`,{className:`text-[13px] text-muted`,children:[`and `,r.exports.length-6,` more`]})]}):n),t(`Target`,r.targetId?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(Ge,{framework:r.targetId.split(`-`)[0],language:r.targetId.split(`-`).slice(1).join(`-`)}),r.target]}):n),t(`Tests start at`,r.start||(0,Z.jsx)(`span`,{className:`text-muted`,children:`Asked on Review when not given`})),r.needs.map(e=>(0,Z.jsx)(X.Fragment,{children:t(e.need===`database`?`Database`:e.need===`mobile`?`Mobile app`:`Desktop app`,e.picked?(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.picked}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Asked on Review when not given`}))},e.need)),t(`Folder`,r.into?(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:r.into}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`tosca-<target>`})),t(`Saved secrets`,r.uses.length?(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:r.uses.map(e=>(0,Z.jsxs)(`li`,{className:`font-mono text-[13px]`,children:[e.variable,` uses `,e.secret]},e.variable))}):(0,Z.jsx)(`span`,{className:`text-muted`,children:e.checking?`Reading which variables the tests need…`:`None`})),t(`Instructions`,r.instructions?(0,Z.jsx)(`span`,{className:`line-clamp-3 text-ink-2`,children:r.instructions}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`None`}))]})}function Qt({view:e,onGit:t}){let n=`inline-flex min-h-7 items-center gap-1 rounded-full border px-2 no-underline`,r=e.clones.reduce((e,t)=>e+t.exports.length,0);return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2 text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`mr-1 text-muted`,children:`Exports`}),e.exports.slice(0,5).map(e=>(0,Z.jsxs)(`span`,{className:I(n,`border-transparent bg-surface-strong text-ink-2`),children:[(0,Z.jsx)(i,{size:12,"aria-hidden":`true`}),Gt(e.path)]},e.path)),e.clones.map(e=>(0,Z.jsxs)(`span`,{className:I(n,`border-transparent bg-surface-strong text-ink-2`),children:[(0,Z.jsx)(v,{size:12,"aria-hidden":`true`}),e.label.replace(/^.*\//,``).replace(/\.git$/,``)]},e.id)),(0,Z.jsxs)(`button`,{type:`button`,onClick:t,className:I(n,`cursor-pointer border-dashed border-line-strong bg-transparent text-muted hover:text-ink`),children:[(0,Z.jsx)(v,{size:12,"aria-hidden":`true`}),`Clone a git repository`]}),(0,Z.jsx)(`span`,{className:`ml-1 text-muted`,children:e.exports.length+r?`${e.exports.length+r} found`:`none in this project yet`})]})}var $t=[`Export`,`Target`,`Instructions`,`Review`],en=[`The Tosca export and its test cases`,`Framework and language`,`Your rules, optional`,`Check and start`],tn=[`Keep one page object per Tosca module, in pages/.`,`Name each test after its Tosca test case.`,`Read the base URL from BASE_URL.`],nn={playwright:`Microsoft`,cypress:`JavaScript only`,webdriverio:`WebDriver and BiDi`,selenium:`WebDriver`};function rn({at:e,reached:t,onGo:n}){return(0,Z.jsx)(`nav`,{"aria-label":`Steps`,children:(0,Z.jsx)(`ol`,{className:`m-0 flex list-none items-center gap-2 p-0`,children:$t.map((r,i)=>{let a=i<=t,o=i===e,s=i<t&&!o;return(0,Z.jsxs)(`li`,{className:I(`flex items-center gap-2`,i<$t.length-1&&`flex-1`),children:[(0,Z.jsxs)(`button`,{type:`button`,disabled:!a,"aria-current":o?`step`:void 0,onClick:()=>n(i),"aria-label":r,"data-tip":en[i],className:I(`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,Z.jsx)(`span`,{"aria-hidden":`true`,className:I(`inline-flex size-6 flex-none items-center justify-center rounded-full text-[13px] 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,Z.jsx)(_,{size:13,strokeWidth:3}):i+1}),(0,Z.jsx)(`span`,{className:I(o?`font-medium text-ink`:a?`text-ink-2`:`text-muted`,!o&&`hidden @xl:inline`),children:r})]}),i<$t.length-1&&(0,Z.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,Z.jsx)(`span`,{className:I(`block h-full rounded-full bg-pass transition-[width] duration-250 ease-out`,i<t?`w-full`:`w-0`)})})]},r)})})})}function an({id:e,label:t,help:n,children:r}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:e,className:`text-sm font-medium`,children:t}),r,n&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:n})]})}function on({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){return(0,Z.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-4 border-t border-line-soft bg-bg py-4`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px]`,children:a}),t&&(0,Z.jsxs)(U,{variant:`ghost`,disabled:e,onClick:t,children:[(0,Z.jsx)(O,{"aria-hidden":`true`}),`Back`]}),(0,Z.jsx)(U,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}function sn({on:e,onPick:t,logo:n,title:r,sub:i,label:a,multi:o}){return(0,Z.jsxs)(`button`,{type:`button`,role:o?`checkbox`:`radio`,"aria-checked":e,"aria-label":a,onClick:t,className:I(`flex min-h-[72px] min-w-0 cursor-pointer items-center gap-4 rounded-[12px] border px-4 py-4 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,Z.jsx)(`span`,{className:`inline-flex size-9 flex-none items-center justify-center rounded-[10px] bg-surface-muted`,children:n}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium text-ink`,children:r}),i&&(0,Z.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:i})]})]})}var cn=e=>e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;function ln({s:e}){return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-[12px] bg-surface-muted px-4 py-4 text-sm`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:e.project||e.file}),(0,Z.jsxs)(`span`,{className:`text-ink-2`,children:[Y(e.test_cases.length,`test case`),` · `,Y(e.pages.length,`module`),` · `,Y(e.totals.steps,`step`),` · `,Y(e.totals.asserts,`check`)]}),e.suites.length>0&&(0,Z.jsxs)(`span`,{className:`text-ink-2`,children:[`· `,Y(e.suites.length,`execution list`)]}),e.totals.unsupported>0&&(0,Z.jsxs)(`span`,{className:`text-warn`,children:[`· `,e.totals.unsupported===1?`1 step value cannot`:`${e.totals.unsupported} step values cannot`,` be converted`]}),e.duplicates?(0,Z.jsxs)(`span`,{className:`text-ink-2`,children:[`· `,Y(e.duplicates,`test case`),` in more than one export, converted once`]}):null]})}var $=e=>`${e.workspace||``}\u0000${e.file}`;function un({busy:e,onClone:t}){let[n,r]=(0,X.useState)(``),[i,a]=(0,X.useState)(``),[o,s]=(0,X.useState)(``);return(0,Z.jsxs)(`form`,{className:`flex flex-col gap-4 rounded-[12px] card border px-4 py-4`,onSubmit:e=>{e.preventDefault(),n.trim()&&t(n.trim(),i.trim(),o.trim())},children:[(0,Z.jsx)(an,{id:`tsc-git-url`,label:`Repository`,help:`https:// or git@ address. A shallow copy is made under ForgeQE's home, with no hooks run; the project is not changed.`,children:(0,Z.jsx)(B,{inputMode:`url`,id:`tsc-git-url`,value:n,spellCheck:!1,maxLength:500,placeholder:`https://github.com/org/tosca-exports.git`,onChange:e=>r(e.target.value)})}),(0,Z.jsxs)(`div`,{className:`grid gap-4 @xl:grid-cols-2`,children:[(0,Z.jsx)(an,{id:`tsc-git-branch`,label:`Branch`,help:`The default branch when empty.`,children:(0,Z.jsx)(B,{id:`tsc-git-branch`,value:i,spellCheck:!1,maxLength:200,placeholder:`main`,onChange:e=>a(e.target.value)})}),(0,Z.jsx)(an,{id:`tsc-git-token`,label:`Credential variable`,help:`For a private repository: the name of the variable that holds its token (saved in Settings), never the token.`,children:(0,Z.jsx)(B,{id:`tsc-git-token`,value:o,spellCheck:!1,maxLength:80,placeholder:`GITHUB_TOKEN`,onChange:e=>s(e.target.value)})})]}),(0,Z.jsx)(`div`,{children:(0,Z.jsx)(U,{type:`submit`,disabled:e||!n.trim(),children:e?`Cloning…`:`Clone it`})})]})}function dn({view:e,onView:t,picked:n,setPicked:i,found:a,setFound:o,only:s,setOnly:c}){let[l,u]=(0,X.useState)(a?`tsc-cases`:`tsc-exports`),[d,f]=(0,X.useState)(``),[p,m]=(0,X.useState)(!1),[h,g]=(0,X.useState)(!1),[_,v]=(0,X.useState)(e.clones.length>0&&e.exports.length===0),[y,b]=(0,X.useState)(``),[S,C]=(0,X.useState)(``),w=new Set(n.map($)),T=[...e.exports.map(e=>({p:{file:e.path},bytes:e.bytes,from:`This project`})),...e.clones.flatMap(e=>e.exports.map(t=>({p:{file:t.path,workspace:e.id},bytes:t.bytes,from:`${e.label.replace(/^.*\//,``).replace(/\.git$/,``)}${e.branch?` (${e.branch})`:``}`})))],E=async(e,t)=>{if(i(e),o(null),C(``),e.length){m(!0);try{let t=await L.inspectSources(e);o(t),c(new Set(t.test_cases.filter(Xe).map(e=>e.id))),u(`tsc-cases`)}catch(e){t&&i(t),C(e.message)}finally{m(!1)}}},ee=e=>{o(null),C(``),i(t=>t.some(t=>$(t)===$(e))?t.filter(t=>$(t)!==$(e)):[...t,e])},O=T.length>0&&T.every(e=>w.has($(e.p))),k=async(e,n,r)=>{g(!0),C(``);try{t?.(await L.clone(e,n||void 0,r||void 0))}catch(e){C(e.message)}finally{g(!1)}},te=async e=>{C(``),b(``);try{t?.(await L.removeClone(e)),i(t=>t.filter(t=>t.workspace!==e)),o(null)}catch(e){C(e.message)}},ne=e=>{let t=new Set(s);t.has(e)?t.delete(e):t.add(e),c(t)},A=e=>Xe(e),j=a?a.test_cases.filter(A):[],M=S&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:S});return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(be,{label:`Export`,tabs:[{id:`tsc-exports`,label:n.length?`Exports · ${n.length} picked`:`Exports`},{id:`tsc-cases`,label:a?`Test cases · ${s.size} of ${a.test_cases.length}`:`Test cases`}],current:l,onPick:e=>{e===`tsc-cases`&&!a?n.length?E(n):C(`Pick at least one export first.`):u(e)}}),l===`tsc-exports`?(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`panel-tsc-exports`,"aria-labelledby":`tab-tsc-exports`,className:`pane-swap flex flex-col gap-6`,children:[T.length>0?(0,Z.jsx)(`div`,{className:`@container`,children:(0,Z.jsx)(ve,{label:`Tosca exports`,placeholder:`Find an export`,height:`min(44vh, 400px)`,tools:(0,Z.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-[13px] text-ink-2`,children:[(0,Z.jsx)(q,{checked:O,onCheckedChange:e=>{o(null),C(``),i(e?T.map(e=>e.p):[])}}),`Pick all `,T.length]}),head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:I(J,`w-10`),children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,Z.jsx)(`th`,{scope:`col`,className:J,children:`Export`}),(0,Z.jsx)(`th`,{scope:`col`,className:I(J,`hidden @xl:table-cell`),children:`Folder`}),(0,Z.jsx)(`th`,{scope:`col`,className:J,children:`From`}),(0,Z.jsx)(`th`,{scope:`col`,className:fe,children:`Size`})]}),children:T.map(e=>{let t=$(e.p),n=e.p.file.slice(e.p.file.lastIndexOf(`/`)+1);return(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,Z.jsx)(`td`,{className:K,children:(0,Z.jsx)(q,{"aria-label":`Pick ${e.p.file}${e.p.workspace?` of ${e.from}`:``}`,checked:w.has(t),onCheckedChange:()=>ee(e.p)})}),(0,Z.jsx)(`td`,{className:K,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(D,{size:15,"aria-hidden":`true`,className:`flex-none text-muted`}),(0,Z.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:n})]})}),(0,Z.jsx)(`td`,{className:I(K,`hidden font-mono text-[13px] text-muted @xl:table-cell`),children:e.p.file.includes(`/`)?e.p.file.slice(0,e.p.file.lastIndexOf(`/`)):`.`}),(0,Z.jsx)(`td`,{className:I(K,`text-ink-2`),children:e.from}),(0,Z.jsx)(`td`,{className:Ce,children:cn(e.bytes)})]},t)})})}):(0,Z.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-4 text-sm text-ink-2`,children:[`No Tosca export (.tsu) in this project yet. Export the test cases from Tosca Commander and put the files inside the project, for example `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:`tosca/checkout.tsu`}),`, or clone the repository that holds them below.`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsx)(U,{variant:`primary`,disabled:p||!n.length,onClick:()=>void E(n),children:p?`Reading…`:n.length>1?`Read ${n.length} exports`:`Read the export`}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:n.length?n.length>1?`Their test cases become one plan; a module they share becomes one page object.`:`Tick more to convert several exports in one plan.`:`Tick one or more exports.`})]}),p&&!S&&(0,Z.jsx)(`p`,{role:`status`,className:`shimmer m-0 text-[13px]`,children:(0,Z.jsxs)(`span`,{children:[`Reading `,n.length===1?`the export`:`${n.length} exports`,`…`]})}),M,(0,Z.jsx)(an,{id:`tsc-path`,label:`Add by its path`,help:`A .tsu, or a folder of them, inside the project. Secrets in an export stay encrypted: they become environment variables.`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsx)(B,{id:`tsc-path`,value:d,spellCheck:!1,maxLength:300,placeholder:`tosca/checkout.tsu or tosca/`,onChange:e=>f(e.target.value),className:`min-w-0 flex-[1_1_300px]`}),(0,Z.jsxs)(U,{disabled:p||!d.trim(),onClick:()=>void E([...n.filter(e=>$(e)!==$({file:d.trim()})),{file:d.trim()}],n),"data-tip":`Add the export at this path and read it`,children:[(0,Z.jsx)(x,{"aria-hidden":`true`}),`Add`]})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":_,onClick:()=>v(!_),className:`inline-flex min-h-8 cursor-pointer items-center gap-2 self-start rounded-[8px] border-0 bg-transparent px-1 text-sm font-medium text-ink hover:bg-surface-strong`,children:[(0,Z.jsx)(r,{size:15,"aria-hidden":`true`,className:I(`transition-transform`,_&&`rotate-180`)}),`From a git repository`,e.clones.length?` (${e.clones.length} cloned)`:``]}),_&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.clones.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:e.clones.map(e=>(0,Z.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.label,(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[e.branch?`${e.branch} · `:``,e.commit?`@${e.commit} · `:``,Y(e.exports.length,`export`),` · cloned `,new Date(e.createdAt).toLocaleDateString()]})]}),y===e.id?(0,Z.jsxs)(`span`,{role:`alert`,className:`flex flex-wrap items-center gap-2 text-ink-2`,children:[`Remove this copy? Plans made from it can no longer run.`,(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,onClick:()=>void te(e.id),children:`Remove it`}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,onClick:()=>b(``),children:`Keep it`})]}):(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,"aria-label":`Remove the copy of ${e.label}`,onClick:()=>b(e.id),children:`Remove`})]},e.id))}),(0,Z.jsx)(un,{busy:h,onClone:(e,t,n)=>void k(e,t,n)})]})]})]}):(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`panel-tsc-cases`,"aria-labelledby":`tab-tsc-cases`,className:`pane-swap flex flex-col gap-6`,children:[M,!a&&!p&&(0,Z.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Pick exports and read them first.`}),p&&(0,Z.jsx)(`p`,{role:`status`,className:`shimmer m-0 text-[13px]`,children:(0,Z.jsx)(`span`,{children:`Reading…`})}),a&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-[13px] text-ink-2`,children:[(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[`From `,n.length===1?(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:n[0].file}):Y(n.length,`export`)]}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,onClick:()=>u(`tsc-exports`),children:`Change exports`})]}),(0,Z.jsx)(ln,{s:a}),a.coverage&&(0,Z.jsx)(Nt,{coverage:a.coverage,names:new Map(a.test_cases.map(e=>[e.id,e.name])),file:`${n.length===1?n[0].file.replace(/^.*\//,``).replace(/\.tsu$/i,``):`tosca-exports`}-coverage.csv`,folded:!0}),(0,Z.jsx)(`div`,{className:`@container`,children:(0,Z.jsx)(ve,{label:`Test cases to convert`,placeholder:`Find a test case`,height:`min(52vh, 520px)`,tools:(0,Z.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-[13px] text-ink-2`,children:[(0,Z.jsx)(q,{checked:j.length>0&&j.every(e=>s.has(e.id)),onCheckedChange:e=>c(new Set(e?j.map(e=>e.id):[]))}),`Pick all `,j.length,` test cases ForgeQE can convert`]}),head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:I(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-10`),children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,Z.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Test case`}),(0,Z.jsx)(`th`,{scope:`col`,className:I(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Folder`}),(0,Z.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Steps · checks`}),(0,Z.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Kind`})]}),children:a.test_cases.map(e=>{let t=A(e);return(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,Z.jsx)(`td`,{className:`px-4 py-2`,children:(0,Z.jsx)(q,{"aria-label":`Pick ${e.name}`,disabled:!t,checked:t&&s.has(e.id),onCheckedChange:()=>ne(e.id)})}),(0,Z.jsxs)(`td`,{className:`px-4 py-2`,children:[(0,Z.jsx)(`span`,{className:I(`font-medium [overflow-wrap:anywhere]`,t?`text-ink`:`text-muted`),children:e.name}),(e.unsupported>0||e.suites.length>0)&&(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[e.unsupported?`${e.unsupported} not convertible`:``,e.unsupported&&e.suites.length?` · `:``,e.suites.length?`in ${e.suites.join(`, `)}`:``]})]}),(0,Z.jsx)(`td`,{className:I(`px-4 py-2`,`hidden text-muted @2xl:table-cell [overflow-wrap:anywhere]`),children:e.folders.join(` / `)||`–`}),(0,Z.jsxs)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:[e.steps,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.asserts]})]}),(0,Z.jsx)(`td`,{className:I(`px-4 py-2`,`whitespace-nowrap`),children:(0,Z.jsx)(H,{tone:t?`neutral`:`warn`,children:t?Je(e):`${Re[e.route]||e.route}: later`})})]},e.id)})})}),a.env.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`Environment variables`}),(0,Z.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[a.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`. Their values are never in the export; you set them before the tests run.`]})]})]})]})]})}function fn({view:e,to:t,setTo:n,fw:r,setFw:i,into:a,setInto:o,attr:s,setAttr:c}){let l=e=>e.split(`-`)[0],u=e=>e.split(`-`).slice(1).join(`-`),d=[...new Map(e.targets.map(e=>[l(e.id),e.framework])).entries()],f=r||(t?l(t):``),p=e.targets.filter(e=>l(e.id)===f);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,Z.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:`Framework`}),(0,Z.jsx)(`div`,{role:`radiogroup`,"aria-label":`Framework`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2`,children:d.map(([e,t])=>{let r=Ke[e];return(0,Z.jsx)(sn,{on:f===e,onPick:()=>{e!==f&&(i(e),n(``))},logo:r?(0,Z.jsx)(r,{width:22,height:22,"aria-hidden":`true`}):null,title:t,sub:nn[e],label:t},e)})})]}),(0,Z.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,Z.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:`Language`}),!f&&(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Pick a framework first.`}),f&&!t&&(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Pick its language.`}),(0,Z.jsx)(`div`,{role:`radiogroup`,"aria-label":`Language`,className:`pane-swap grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2`,children:p.map(e=>{let r=We[u(e.id)];return(0,Z.jsx)(sn,{on:t===e.id,onPick:()=>n(e.id),logo:r?(0,Z.jsx)(r,{width:22,height:22,"aria-hidden":`true`}):null,title:e.language,label:e.language},e.id)})},f)]}),(0,Z.jsxs)(`div`,{className:`grid gap-4 @2xl:grid-cols-2`,children:[(0,Z.jsx)(an,{id:`tsc-into`,label:`Output folder`,help:`A new folder. Empty: named after the target.`,children:(0,Z.jsx)(B,{id:`tsc-into`,value:a,spellCheck:!1,maxLength:300,placeholder:t?`tosca-${t}`:`Named after the target`,onChange:e=>o(e.target.value)})}),(0,Z.jsx)(an,{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,Z.jsx)(B,{id:`tsc-attr`,value:s,spellCheck:!1,maxLength:40,placeholder:`data-automation-id`,onChange:e=>c(e.target.value.replace(/[^A-Za-z0-9_-]/g,``))})})]})]})}function pn({view:e,picked:t,found:n,only:r,to:i,instructions:a}){let o=e.targets.find(e=>e.id===i),s=(e,t)=>(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-line-soft py-4 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:e}),(0,Z.jsx)(`div`,{className:`text-sm`,children:t})]});return(0,Z.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col rounded-[14px] card border p-6`,children:[s(t.length>1?`Exports (${t.length})`:`Export`,t.length?(0,Z.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:[t.slice(0,6).map(t=>(0,Z.jsxs)(`li`,{className:`font-mono text-[13px] [overflow-wrap:anywhere]`,children:[t.workspace?`${e.clones.find(e=>e.id===t.workspace)?.label.replace(/^.*\//,``)||`git`}: `:``,t.file]},$(t))),t.length>6&&(0,Z.jsxs)(`li`,{className:`text-[13px] text-muted`,children:[`and `,t.length-6,` more`]})]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not picked yet`})),s(`Test cases`,n?(0,Z.jsxs)(`span`,{children:[r.size,` of `,n.test_cases.length,` picked`]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`–`})),s(`Target`,o?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(Ge,{framework:o.id.split(`-`)[0],language:o.id.split(`-`).slice(1).join(`-`)}),o.title]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not picked yet`})),s(`Instructions`,a.trim()?(0,Z.jsx)(`span`,{className:`line-clamp-3 text-ink-2`,children:a.trim()}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`None`}))]})}function mn({view:e,onView:t,review:n,onStart:r,from:i}){let[a,o]=(0,X.useState)(0),[s,l]=(0,X.useState)(0),[u,d]=(0,X.useState)([]),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(new Set),[g,_]=(0,X.useState)(``),[v,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(``),[T,E]=(0,X.useState)(``),[ee,D]=(0,X.useState)(null),[O,k]=(0,X.useState)(!1),[te,A]=(0,X.useState)(!1),[M,N]=(0,X.useState)(!1),[ie,P]=(0,X.useState)(``),F=[...m].sort().join(`,`);(0,X.useEffect)(()=>{D(null),k(!1),l(e=>Math.min(e,2))},[u.map($).join(`|`),F,g,x,C,T]);let[ae,R]=(0,X.useState)(`next`),B=(0,X.useRef)(null),H=e=>{R(e<a?`back`:`next`),o(e);let t=B.current;t&&t.getBoundingClientRect().top<0&&t.scrollIntoView({block:`start`,behavior:oe()})},se=e=>{H(e),l(t=>Math.max(t,e)),P(``)},[U,W]=(0,X.useState)(i?`filling`:``);(0,X.useEffect)(()=>{if(!i)return;let e=!0;return(async()=>{N(!0);try{let t=(await V.view(i)).prefill;if(!t)throw Error(`The assistant does not have the exports and the target yet: go back to it, or pick them here.`);if(!e)return;d(t.sources),b(t.to.split(`-`)[0]),_(t.to),S(t.into??``),E(t.instructions??``);let n=await L.inspectSources(t.sources);if(!e)return;let r=n.test_cases.filter(Xe).map(e=>e.id);if(p(n),h(new Set(r)),!r.length)throw Error(`These exports hold no web or API test case to convert.`);let a=await L.plan({sources:t.sources,to:t.to,...t.into?{into:t.into}:{},...t.instructions?{instructions:t.instructions}:{}});(t.app||t.baseUrl)&&await L.answer(a.plan.id,t.app?{environment:t.app.environment,app:t.app.app}:{baseUrl:t.baseUrl}).catch(()=>{});for(let[e,n]of Object.entries(t.uses||{}))await L.answer(a.plan.id,{use:{name:e,secret:n}}).catch(()=>{});if((t.desktopApp||t.mobileApp||t.database)&&await L.answer(a.plan.id,{...t.desktopApp?{desktopApp:t.desktopApp}:{},...t.mobileApp?{mobileApp:t.mobileApp}:{},...t.database?{database:t.database}:{}}).catch(()=>{}),!e)return;D(a),l(3),H(3),W(`done`)}catch(t){if(!e)return;P(t.message),W(``)}finally{e&&N(!1)}})(),()=>{e=!1}},[i]);let ce=async()=>{N(!0),P(``);try{let e=!f||f.test_cases.filter(Xe).every(e=>m.has(e.id)),t=await L.plan({sources:u,to:g,...x.trim()?{into:x.trim()}:{},...e?{}:{only:[...m]},...T.trim()?{instructions:T.trim()}:{},...C?{testAttributes:[C]}:{}});D(t),se(3)}catch(e){let t=e.message;P(t);let n=x.trim().replace(/\\/g,`/`).replace(/(?<!\/)\/+$/,``);n&&t.includes(n)&&H(1)}finally{N(!1)}},le=ee?.plan,G=le?.feasibility.findings.some(e=>e.level===`limit`),ue=le?.feasibility.verdict===`blocked`;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i&&U&&(0,Z.jsxs)(`p`,{role:`status`,className:`fade-quick m-0 flex flex-wrap items-center gap-x-4 gap-y-1 rounded-[14px] border border-accent-line bg-accent-soft px-4 py-2 text-sm text-ink`,children:[(0,Z.jsx)(`span`,{className:`flex-1`,children:U===`filling`?`Filling in every stage from your conversation with the assistant…`:`Filled in from your conversation with the assistant. Check each stage before you start.`}),(0,Z.jsx)(`a`,{href:j(`tosca`),className:`text-[13px]`,children:`Back to the assistant`})]}),(0,Z.jsx)(`div`,{ref:B,className:`scroll-mt-4`,children:(0,Z.jsx)(rn,{at:a,reached:s,onGo:e=>!M&&(e<3||ee)&&H(e)})}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,Z.jsxs)(`section`,{"aria-labelledby":`tsc-step`,className:I(`flex min-w-0 flex-col gap-6`,ae===`next`?`pane-next`:`pane-back`),children:[(0,Z.jsx)(`h2`,{id:`tsc-step`,className:`m-0 text-[20px] font-semibold tracking-[-0.01em]`,children:[`Which Tosca export?`,`What should the tests become?`,`Anything the agent should know?`,`Review and start`][a]}),ie&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:ie}),a===0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(dn,{view:e,onView:t,picked:u,setPicked:d,found:f,setFound:p,only:m,setOnly:h}),(0,Z.jsx)(on,{busy:M,next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(re,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>se(1),disabled:!f||!m.size,aside:f&&!m.size?(0,Z.jsx)(`span`,{className:`text-muted`,children:`Pick at least one web or API test case.`}):void 0})]}),a===1&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(fn,{view:e,to:g,setTo:_,fw:v,setFw:b,into:x,setInto:S,attr:C,setAttr:w}),(0,Z.jsx)(on,{busy:M,onBack:()=>H(0),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(re,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>se(2),disabled:!g})]}),a===2&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(an,{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,Z.jsx)(z,{id:`tsc-instructions`,value:T,rows:6,maxLength:4e3,placeholder:`Page objects go in pages/, one class per Tosca module.`,onChange:e=>E(e.target.value)})}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:tn.map(e=>(0,Z.jsxs)(`button`,{type:`button`,disabled:T.includes(e),onClick:()=>E(T.trim()?`${T.trim()}\n${e}`:e),className:`inline-flex min-h-8 cursor-pointer items-center gap-2 rounded-[8px] border-0 bg-surface-strong px-2 text-[13px] text-ink hover:bg-line disabled:cursor-default disabled:opacity-50`,children:[(0,Z.jsx)(y,{size:13,"aria-hidden":`true`}),e]},e))}),(0,Z.jsx)(on,{busy:M,onBack:()=>H(1),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ne,{"aria-hidden":`true`}),M?`Checking…`:`Check`]}),onNext:()=>void ce(),aside:(0,Z.jsx)(`span`,{className:`text-muted`,children:`Nothing is changed yet.`})})]}),a===3&&le&&(0,Z.jsxs)(Z.Fragment,{children:[n(le,O,k,A),(0,Z.jsx)(on,{busy:M,onBack:()=>H(2),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Start`]}),disabled:ue||!te||G&&!O,onNext:()=>r(ee,!!G&&O),aside:(0,Z.jsx)(`span`,{className:`text-muted`,children:ue?`Change what is not possible first.`:te?G&&!O?`Accept the limits to start.`:`Runs in the background.`:`Answer what the tests need first.`})})]})]},a),(0,Z.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,Z.jsx)(pn,{view:e,picked:u,found:f,only:m,to:g,instructions:T})})]})]})}function hn({planId:e}){let[t,n]=(0,X.useState)(null),[r,i]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{let t=!0;return n(null),i(!1),L.estimate(e).then(e=>t&&n(e),()=>t&&i(!0)),()=>{t=!1}},[e]),r?(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not known`}):t?t.files.setup+t.files.pages+t.files.tests?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{children:[`About `,ke(t.tokens.mid),` tokens`,t.cost?`, about ${Ae(t.cost.mid,t.cost.currency)}`:``,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`(`,ke(t.tokens.low),` to `,ke(t.tokens.high),t.cost?`, ${Ae(t.cost.low,t.cost.currency)} to ${Ae(t.cost.high,t.cost.currency)}`:``,`)`]})]}),(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[t.model&&t.model!==`none`?`With ${t.model}. `:`No model is set up for Bridge yet. `,t.basis.from===`history`?`From ${t.basis.files} files written by earlier conversions here.`:`From defaults: no conversion has run here yet.`,t.cost||!t.model||t.model===`none`?``:` No price is set for this model.`]})]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Nothing left to write`}):(0,Z.jsx)(`span`,{role:`status`,className:`text-muted`,children:`Working it out…`})}function gn({plan:e,accepted:t,onAccept:n,onReady:r}){let[i,a]=(0,X.useState)(null),o=(0,X.useMemo)(()=>new Map(e.cases.map(e=>[e.id,e.name])),[e]),s=e.feasibility.findings.filter(e=>e.level===`blocker`),c=e.feasibility.findings.filter(e=>e.level===`limit`),l=e.cases.filter(e=>e.included),u=e.units.filter(e=>e.kind===`page`).length,d=l.filter(e=>e.workflow).length;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(`dl`,{className:`m-0 grid gap-x-6 gap-y-2 rounded-[14px] card border px-6 py-4 text-sm @xl:grid-cols-[auto_1fr]`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`From`}),(0,Z.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[`Tricentis Tosca`,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[e.sources&&e.sources.length>1?` · ${e.sources.length} exports`:(0,Z.jsxs)(Z.Fragment,{children:[` `,`· `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.source.file})]}),e.source.project?` · ${e.source.project}`:``]}),e.sources&&e.sources.length>1&&(0,Z.jsx)(`ul`,{className:`m-0 mt-1 flex list-none flex-col gap-1 p-0`,children:e.sources.map((t,n)=>(0,Z.jsxs)(`li`,{className:`font-mono text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:[t.label,(0,Z.jsxs)(`span`,{className:`font-sans text-muted`,children:[` · `,(e=>e?Y(e,`test case`):`its test cases are all in another export`)(e.cases.filter(e=>e.source===n).length)]})]},n))})]}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`To`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[e.target.title,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.target.dir]})]}),e.previous&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Since`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[(0,Z.jsx)(`a`,{href:j(`tosca`,e.previous.id),children:e.previous.id}),(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,Y(e.cases.filter(e=>e.change===`same`).length,`test case`),` unchanged (their tests kept), `,e.cases.filter(e=>e.change===`changed`).length,` changed, `,e.cases.filter(e=>e.change===`new`).length,` new, `,(e.removed||[]).length,` removed`]})]})]}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Files`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[l.length-d,` test`,l.length-d===1?``:`s`,d?`, ${d} desktop or mobile workflow${d===1?``:`s`}`:``,` of `,e.cases.length,` test case`,e.cases.length===1?``:`s`,`, `,u,` page object`,u===1?``:`s`]}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Estimate`}),(0,Z.jsx)(`dd`,{className:`m-0`,children:(0,Z.jsx)(hn,{planId:e.id})}),(e.suites||[]).length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Suites`}),(0,Z.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[e.suites.map(e=>`${e.name} (${Y(e.cases.length,`test`)})`).join(`, `),(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Tosca's execution lists, as tags on the tests: `,e.suites.map(e=>`@${e.tag}`).join(`, `),`.`]})]})]}),e.env.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Environment variables`}),(0,Z.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[e.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Never in the export: you set them before the tests run.`})]})]}),e.instructions&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Instructions`}),(0,Z.jsx)(`dd`,{className:`m-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.instructions})]})]}),i&&(0,Z.jsx)(Nt,{coverage:i,names:o,file:`tosca-${e.id}-coverage.csv`}),s.length>0&&(0,Z.jsxs)(`section`,{"aria-labelledby":`tsc-blockers`,className:`flex flex-col gap-2 rounded-[14px] bg-fail-soft px-6 py-4`,children:[(0,Z.jsxs)(`h3`,{id:`tsc-blockers`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-fail`,children:[(0,Z.jsx)(N,{size:16,"aria-hidden":`true`}),`Not possible`]}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-6 text-sm text-ink`,children:s.map(e=>(0,Z.jsx)(`li`,{children:e.text},e.code))})]}),c.length>0&&(0,Z.jsxs)(`section`,{"aria-labelledby":`tsc-limits`,className:`flex flex-col gap-4 rounded-[14px] bg-warn-soft px-6 py-4`,children:[(0,Z.jsxs)(`h3`,{id:`tsc-limits`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-warn`,children:[(0,Z.jsx)(N,{size:16,"aria-hidden":`true`}),`Before you start`]}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-2 pl-6 text-sm text-ink`,children:c.map(e=>(0,Z.jsx)(`li`,{children:e.text},e.code))}),n&&!s.length&&(0,Z.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center gap-2 text-sm font-medium`,children:[(0,Z.jsx)(q,{checked:!!t,onCheckedChange:n}),`I understand`]})]}),(0,Z.jsx)(zt,{planId:e.id,onReady:r,onCoverage:a}),(0,Z.jsx)(je,{title:`Test cases (${e.cases.length})`,children:(0,Z.jsx)(`div`,{className:`@container`,children:(0,Z.jsx)(ve,{label:`Test cases of the plan`,placeholder:`Find a test case`,height:`min(48vh, 440px)`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:J,children:`Test case`}),(0,Z.jsx)(`th`,{scope:`col`,className:J,children:`In the plan`}),(0,Z.jsx)(`th`,{scope:`col`,className:I(fe,`hidden @xl:table-cell`),children:`Steps · checks`}),(0,Z.jsx)(`th`,{scope:`col`,className:J,children:`Kind`})]}),children:e.cases.map(e=>{let t=e.change;return(0,Z.jsxs)(`tr`,{className:Ee,children:[(0,Z.jsx)(`td`,{className:I(K,`[overflow-wrap:anywhere]`,e.included?`text-ink`:`text-muted`),children:e.name}),(0,Z.jsxs)(`td`,{className:I(K,`text-ink-2`),children:[e.included?`Converted`:e.why?e.why[0].toUpperCase()+e.why.slice(1):`Left out`,t?(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:{same:`Unchanged: its test kept`,changed:`Changed in Tosca`,new:`New in Tosca`}[t]}):null]}),(0,Z.jsxs)(`td`,{className:I(Ce,`hidden @xl:table-cell`),children:[e.steps,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.asserts]})]}),(0,Z.jsx)(`td`,{className:I(K,`whitespace-nowrap text-muted`),children:Re[e.route]||e.route})]},e.id)})})})}),(0,Z.jsx)(je,{title:`Files, in order (${e.units.length})`,children:(0,Z.jsx)(ve,{label:`Files, in order`,placeholder:`Find a file`,height:`min(40vh, 360px)`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:I(J,`w-24`),children:`Kind`}),(0,Z.jsx)(`th`,{scope:`col`,className:J,children:`File`})]}),children:e.units.map(e=>(0,Z.jsxs)(`tr`,{className:Ee,children:[(0,Z.jsx)(`td`,{className:I(K,`text-muted`),children:Ye(e)}),(0,Z.jsx)(`td`,{className:I(K,`font-mono text-[13px] [overflow-wrap:anywhere]`),children:e.target})]},e.id))})})]})}function _n({d:e,onStarted:t}){let[n,r]=(0,X.useState)(!1),[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(!1),l=e.plan.feasibility.findings.some(e=>e.level===`limit`),u=e.plan.feasibility.verdict===`blocked`,d=!!e.job?.running;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[e.job?.last&&!d&&(0,Z.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:`The last start did not run. Its job's log on the Jobs page says why.`}),(0,Z.jsx)(gn,{plan:e.plan,accepted:e.confirmed||n,onAccept:e.confirmed?void 0:r,onReady:a}),!u&&!d&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsxs)(U,{variant:`primary`,disabled:!i||!e.confirmed&&l&&!n,onClick:()=>s(!0),"data-tip":`Start the conversion`,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Start`]}),!i&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Answer what the tests need first.`})]}),o&&(0,Z.jsx)(et,{plan:e.plan,acceptLimits:l&&(e.confirmed||n),onClose:()=>s(!1),onStarted:e=>{s(!1),t(e)}})]})}function vn({sub:e}){let[t,n]=(0,X.useState)(null),[r,i]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),[s,c]=(0,X.useState)(Ht),l=(0,X.useCallback)(()=>{L.list().then(e=>{n(e),i(``)},e=>i(e.message))},[]);(0,X.useEffect)(l,[l,e]),(0,X.useEffect)(()=>{e===`conversions`&&location.replace(j(`migration`,`migrations`))},[e]);let u=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:u?.[1]||``,f=!!u,p;try{p=u?.[2]?te(u[2]):void 0}catch{}let m=!t&&!r&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),h=e?.match(/^new\/([a-f0-9]{16})$/)?.[1];return e===`new`||h?(0,Z.jsxs)(Me,{tab:`migrations`,children:[(0,Z.jsx)(qe,{error:r}),m,t&&(0,Z.jsx)(mn,{view:t,onView:n,from:h,review:(e,t,n,r)=>(0,Z.jsx)(gn,{plan:e,accepted:t,onAccept:n,onReady:r}),onStart:(e,t)=>o({d:e,accept:t})},h||`new`),a&&(0,Z.jsx)(et,{plan:a.d.plan,acceptLimits:a.accept,onClose:()=>o(null),onStarted:e=>{o(null),location.hash=j(`tosca`,e.plan.id)}})]}):d&&f?(0,Z.jsx)(Me,{tab:`migrations`,wide:!0,children:(0,Z.jsx)(kt,{id:d,caseId:p},d)}):d?(0,Z.jsxs)(Me,{tab:`migrations`,wide:!0,children:[(0,Z.jsx)(qe,{error:r}),m,t&&(0,Z.jsx)(gt,{id:d,plan:(e,t)=>(0,Z.jsx)(_n,{d:e,onStarted:t})},d)]}):e===`conversions`?(0,Z.jsx)(Me,{tab:`migrations`,children:m}):(0,Z.jsxs)(Me,{tab:`migrations`,children:[(0,Z.jsx)(qe,{error:r}),m,t&&(0,Z.jsx)(qt,{view:t,sid:s,onSid:c})]})}export{vn as Tosca};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Hr as t,M as n,u as r}from"./route-Dg53WdFu.js";import{t as i}from"./jsx-runtime-LKYXHABd.js";import{A as a,j as o}from"./input-C2vQ9O3a.js";import{a as s}from"./filters-C7phIFfd.js";import{L as c}from"./palette-XFlqvgZl.js";import{B as l,H as u,I as d,J as f,L as p,R as m,U as h,Vn as g,kn as _,z as v}from"./index-YGWJEkAT.js";var y=e(t(),1),b=i(),x={new:{label:`New`,tone:`running`},improved:{label:`Improved`,tone:`neutral`},fixed:{label:`Fixed`,tone:`pass`}};function S({change:e,id:t,first:i}){let[o,c]=(0,y.useState)(!1),l=m(e);return(0,b.jsxs)(`li`,{className:a(!i&&`border-t border-line-soft`),children:[(0,b.jsxs)(`button`,{type:`button`,"aria-expanded":o,"aria-controls":t,onClick:()=>c(!o),className:`flex min-h-11 w-full cursor-pointer items-center gap-4 border-0 bg-transparent px-4 py-2 text-left text-sm text-ink hover:bg-surface-muted`,children:[(0,b.jsx)(s,{tone:x[e.kind].tone,icon:!1,className:`w-[76px] justify-center`,children:x[e.kind].label}),(0,b.jsx)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,b.jsx)(n,{size:16,"aria-hidden":`true`,className:a(`flex-none text-muted transition-transform duration-200`,o&&`rotate-90`)})]}),(0,b.jsx)(g,{open:o,id:t,children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 pt-1 pb-4 sm:pl-26`,children:[(0,b.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:e.detail}),l&&(0,b.jsxs)(`a`,{href:l,className:`inline-flex items-center gap-1 self-start text-[13px] font-medium`,children:[`Open`,(0,b.jsx)(r,{size:13,"aria-hidden":`true`})]})]})})]})}function C({release:e}){let t=e===d;return(0,b.jsxs)(`li`,{className:`relative flex gap-4 pb-8`,children:[(0,b.jsx)(`span`,{"aria-hidden":`true`,className:a(`relative mt-2 size-[15px] flex-none rounded-full border-[3px] border-bg`,t?`bg-accent`:`bg-line`)}),(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,b.jsxs)(`h3`,{className:`m-0 text-[16px] font-semibold`,children:[`ForgeQE `,e.version]}),t&&(0,b.jsx)(s,{tone:`running`,icon:!1,children:`Latest`}),(0,b.jsxs)(`span`,{className:`text-sm text-muted`,children:[(0,b.jsx)(`time`,{dateTime:e.date,children:l(e.date)}),` · `,o(e.changes.length,`change`)]})]}),(0,b.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:e.summary}),(0,b.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,b.jsx)(S,{change:t,first:n===0,id:`change-${e.version}-${n}`},n))})]})]})}function w({embedded:e=!1}={}){(0,y.useEffect)(v,[]);let t=p(),n=(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)(`div`,{className:`relative flex flex-col gap-2`,children:[(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[60px] bottom-10 left-[7px] w-px bg-line`}),t.map(e=>(0,b.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,b.jsx)(`h2`,{className:`m-0 pl-8 text-[20px] font-semibold`,children:e.month}),(0,b.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.releases.map(e=>(0,b.jsx)(C,{release:e},e.version))})]},e.month))]})});return e?(0,b.jsx)(`div`,{className:`flex flex-col gap-6`,children:n}):(0,b.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,b.jsx)(f,{}),(0,b.jsxs)(`main`,{className:a(h,`flex-auto gap-6`),children:[(0,b.jsx)(u,{}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,b.jsx)(_,{pixel:c[`whats-new`],size:`lg`}),(0,b.jsx)(`h1`,{className:`m-0 flex-1 text-[25px] font-semibold tracking-[-0.01em]`,children:`What's new`})]}),(0,b.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:`What each release of ForgeQE added, improved and fixed. Pick a change to read more.`}),n]})]})}export{x as KIND,w as WhatsNew};
@@ -0,0 +1,5 @@
1
+ import{C as e,Ir as t,It as n,K as r,Pt as i,Sn as a,Tt as o,W as s,Zn as c,lr as l,on as u,rt as d,v as f,vr as p}from"./route-Dg53WdFu.js";var m=(...e)=>e.map(([e,t])=>({value:e,label:t})),h=[{title:`Where runs happen`,base:[`browser`],fields:[{key:`provider`,label:`Browser`,help:`Where the browser agent runs. Remote grids need their sign-in under Integrations.`,type:`select`,default:`local`,options:m([`local`,`Chrome on this machine`],[`docker`,`Chrome in Docker`],[`browserstack`,`BrowserStack`],[`testmu`,`TestMu AI (LambdaTest)`])},{key:`local_browser`,label:`Local browser`,help:`Automatic tries Chrome first, then Edge, then Playwright's Chromium, each when the one before does not start.`,type:`select`,default:`auto`,options:m([`auto`,`Automatic`],[`chrome`,`Google Chrome`],[`edge`,`Microsoft Edge`],[`chromium`,`Playwright's Chromium`]),when:e=>!e.provider||e.provider===`local`},{key:`launch`,label:`How it starts`,help:`Automatic starts the browser directly, then through Playwright when this computer stops it, and remembers what worked.`,type:`select`,default:`auto`,options:m([`auto`,`Automatic`],[`direct`,`Directly`],[`playwright`,`Through Playwright`],[`attach`,`Connect to a browser I started`]),when:e=>!e.provider||e.provider===`local`},{key:`attach_port`,label:`Port of your browser`,help:`Start it with --remote-debugging-port and this number. Only on this computer.`,type:`number`,placeholder:`9222`,when:e=>(!e.provider||e.provider===`local`)&&e.launch===`attach`},{key:`start_url`,label:`Start page`,help:`Leave empty to let the agent choose, or to start at the active environment's app.`,type:`url`,placeholder:`https://staging.example.com`},{key:`allowed_hosts`,label:`Allowed sites`,help:`Hosts the agent may open, comma separated. Empty: the environment's apps.`,type:`list`,placeholder:`staging.example.com, auth.example.com`}]},{title:`The browser window`,base:[`browser`],fields:[{key:`headless`,label:`Run without a window`,help:`Off shows the browser while the agent works.`,type:`switch`,default:!0},{key:`window`,label:`Visible window`,type:`select`,default:`maximized`,options:m([`maximized`,`Maximized`],[`viewport`,`The size below`])},{key:`viewport.width`,label:`Page width`,type:`number`,default:1280},{key:`viewport.height`,label:`Page height`,type:`number`,default:800},{key:`overlay`,label:`Show what the agent does`,help:`In a visible browser: a bar with the current step, and your mouse and keyboard locked while it works.`,type:`switch`,default:!0}]},{title:`Limits and checks`,base:[`browser`],fields:[{key:`max_steps`,label:`Steps before a checkpoint`,help:`A run still making progress carries on, up to three times this.`,type:`number`,default:40},{key:`timeout_seconds`,label:`Time limit per run`,help:`In seconds.`,type:`number`,default:600},{key:`vision_detail`,label:`Screenshot detail`,help:`High reads small text better and costs more.`,type:`select`,default:`low`,options:m([`low`,`Low`],[`high`,`High`])},{key:`video`,label:`Record a video`,type:`switch`,default:!0},{key:`judge`,label:`Second check of each result`,help:`Another model call checks each finished run against its goal, and can fail it.`,type:`switch`,default:!1},{key:`rulebook`,label:`Learn rules per site`,help:`One-line rules the agent keeps after it recovers from a failed action.`,type:`switch`,default:!0}]},{title:`Remote browser, set here`,help:`For BrowserStack or TestMu AI set inline in forgeqe.yaml. These win over the grid's own file under Integrations when both are set.`,base:[`browser`,`remote`],fields:[{key:`browser`,label:`Browser`,type:`text`,placeholder:`chrome`},{key:`browser_version`,label:`Browser version`,type:`text`,placeholder:`latest`},{key:`os`,label:`Operating system`,help:`BrowserStack: Windows or OS X.`,type:`text`,placeholder:`Windows`},{key:`os_version`,label:`Its version`,type:`text`,placeholder:`11, or Sequoia`},{key:`platform`,label:`Platform`,help:`TestMu AI; or set the two above and ForgeQE joins them.`,type:`text`,placeholder:`Windows 11`},{key:`username_env`,label:`User name`,type:`var`,placeholder:`BROWSERSTACK_USERNAME`},{key:`access_key_env`,label:`Access key`,type:`var`,placeholder:`BROWSERSTACK_ACCESS_KEY`},{key:`project`,label:`Project`,type:`text`,placeholder:`ForgeQE`},{key:`build`,label:`Build`,type:`text`,placeholder:`nightly`},{key:`name`,label:`Session name`,type:`text`,placeholder:`checkout smoke`},{key:`local`,label:`Through a tunnel`,help:`BrowserStack Local or the LambdaTest tunnel, for sites only your network reaches.`,type:`switch`,default:!1},{key:`extra`,label:`More capabilities`,help:`The provider's own, one per line.`,type:`kv`,placeholder:`browserstack.console = errors`}]}],g=[{title:`Where tests go`,base:[`code`],fields:[{key:`repo`,label:`Repository`,help:`Where passed runs become tests. Empty: this folder.`,type:`path`,placeholder:`../my-app`},{key:`test_command`,label:`Test command`,help:`Empty: the agent finds it.`,type:`path`,placeholder:`npx playwright test`},{key:`model`,label:`Model`,help:`Empty: the default model.`,type:`text`,placeholder:`anthropic/claude-sonnet-4-5`},{key:`review_profile`,label:`Checker's model`,help:`A profile from Models. Checker only reads and judges, so a cheaper one is enough.`,type:`text`},{key:`runtime`,label:`Agent runtime`,help:`Empty: the runtime ForgeQE downloads.`,type:`path`,placeholder:`/path/to/agent-runtime`}]},{title:`How hard it tries`,base:[`code`],fields:[{key:`max_attempts`,label:`Attempts`,help:`Test runs before it gives up, and healing attempts.`,type:`number`,default:3},{key:`test_timeout_seconds`,label:`Time limit per test run`,help:`In seconds.`,type:`number`,default:600},{key:`confirm_runs`,label:`Passes in a row before a test counts`,help:`A new test is run again until it has passed this many times in a row, to catch a flaky test. 1 runs it once.`,type:`number`,default:3},{key:`stall_after`,label:`Stop after repeated failures`,help:`When one command has failed this many times.`,type:`number`,default:5},{key:`repeat_after`,label:`Stop after repeated look-ups`,help:`When the coding agent has re-read files or state it already saw, unchanged, this many times; it is then asked for its test.`,type:`number`,default:6},{key:`edit_after`,label:`Stop after repeated edits`,help:`When the coding agent has changed files it already changed this many times without handing its test over to be run.`,type:`number`,default:8},{key:`max_tokens`,label:`Token limit per job`,help:`Cached input counts at its share of the input price. 0 turns the limit off.`,type:`number`,default:15e5}]},{title:`Help it gets`,base:[`code`],fields:[{key:`replay`,label:`Replay the steps first`,help:`Runs the steps as a Playwright script and hands over what worked.`,type:`switch`,default:!0},{key:`live_browser`,label:`Look at the failing page`,help:`Once a step fails, the agent looks at that page in a browser.`,type:`switch`,default:!0},{key:`graph`,label:`Read the repository's code`,help:`Links the run's elements to the page objects that already locate them.`,type:`switch`,default:!0},{key:`duplicates`,label:`Check for copied code`,help:`Tells the reviewer which code a new test or a pull request copied from the repository (jscpd).`,type:`switch`,default:!0},{key:`header`,label:`Mark generated files`,help:`Files ForgeQE creates start with a “Generated with ForgeQE” line.`,type:`switch`,default:!0},{key:`rulebook`,label:`Learn from its own mistakes`,type:`switch`,default:!0},{key:`requests`,label:`When an agent asks for more`,help:`Packages, a command its shell refuses, or a change to package.json. Shells, pushes, .npmrc and lockfiles are refused whatever this says.`,type:`select`,default:`ask`,options:m([`ask`,`Ask me each time`],[`allow`,`Allow without asking`],[`off`,`Always refuse`])}]}],_=[{title:`Reports`,base:[],fields:[{key:`export.out_dir`,label:`Report folder`,help:`One folder per run.`,type:`path`,default:`./.forgeqe/reports`},{key:`export.format`,label:`Test format`,type:`select`,default:`playwright`,options:m([`playwright`,`Playwright`])},{key:`report.screenshots`,label:`Screenshots in reports`,type:`select`,default:`all`,options:m([`all`,`Every step`],[`failures`,`Failures only`],[`off`,`None`])},{key:`report.accessibility`,label:`Check accessibility of each page`,type:`switch`,default:!0},{key:`suite.out_dir`,label:`Suite report folder`,type:`path`,default:`./.forgeqe/reports/suites`}]},{title:`Memory and replays`,base:[],fields:[{key:`memory.enabled`,label:`Remember pages and flows`,type:`switch`,default:!0},{key:`memory.dir`,label:`Memory folder`,type:`path`,default:`./.forgeqe/memory`},{key:`memory.replay`,label:`Replays`,help:`Verify checks each recorded step; trust replays without a model.`,type:`select`,default:`verify`,options:m([`verify`,`Verify`],[`trust`,`Trust`],[`off`,`Off`])},{key:`registry.mode`,label:`Replay passed runs for free`,help:`Running a passed test again repeats its saved steps without the AI; if the page changed, the AI takes over. Test mode only notes what it would have replayed.`,type:`select`,default:`on`,options:m([`on`,`On`],[`shadow`,`Test mode: only note it`],[`off`,`Off`])}]},{title:`Suites`,base:[],fields:[{key:`suite.code`,label:`Write tests for passed cases`,help:`With a repository set under Code.`,type:`switch`,default:!0},{key:`suite.restore_sessions`,label:`Start each case signed in`,help:`Cases start from the saved logins' sessions. Off runs each case as its test starts, signed out.`,type:`switch`,default:!1},{key:`suite.case_check`,label:`Before a run, check the cases`,help:`Warn shows what the check found and runs every case; block leaves out the ones that cannot run as written.`,type:`select`,default:`warn`,options:m([`warn`,`Warn`],[`block`,`Block`],[`off`,`Off`])}]},{title:`Flaky tests`,help:`A test that fails and then passes is flaky; quarantine keeps it running, but its failures stop failing the run and CI.`,base:[`flaky`],fields:[{key:`retries`,label:`Runs again in the same run`,help:`0 to 3.`,type:`number`,default:1},{key:`quarantine`,label:`Quarantine`,type:`select`,default:`suggest`,options:m([`suggest`,`The agent asks first`],[`auto`,`ForgeQE does it`],[`off`,`Off: history only`])},{key:`flaky_after`,label:`Flaky from this score`,type:`number`,default:2}]},{title:`Release readiness`,help:`When a release reads GO, GO WITH RISKS or NO-GO.`,base:[`release`],fields:[{key:`max_critical`,label:`Open critical bugs allowed`,type:`number`,default:0},{key:`max_high`,label:`Open high bugs allowed`,type:`number`,default:0},{key:`min_pass_rate`,label:`Pass rate needed`,help:`Percent of executed test cases.`,type:`number`,default:95},{key:`require_tests`,label:`A story needs a test case`,help:`Without one it is a risk.`,type:`switch`,default:!0}]},{title:`Regression packs in a pipeline`,help:`Where Run in the pipeline sends a pack (forgeqe pack run --on pipeline).`,base:[`packs`,`pipeline`],fields:[{key:`default`,label:`Pipeline`,type:`select`,options:m([`github`,`GitHub Actions`],[`azure_devops`,`Azure Pipelines`])},{key:`github.repo`,label:`GitHub repository`,type:`text`,placeholder:`acme/shop-tests`},{key:`github.workflow`,label:`Workflow file`,type:`text`,default:`forgeqe-pack.yml`},{key:`github.ref`,label:`Branch`,type:`text`,default:`main`},{key:`azure_devops.project`,label:`Azure DevOps project`,type:`text`,placeholder:`Shop`},{key:`azure_devops.pipeline_id`,label:`Pipeline id`,type:`number`,placeholder:`42`},{key:`azure_devops.ref`,label:`Branch`,type:`text`,default:`refs/heads/main`},{key:`timeout_minutes`,label:`Wait for it`,help:`In minutes.`,type:`number`,default:60}]},{title:`Defect analysis`,help:`For a failed case that is a defect: a repro, suspect commits in the product's repository, and a root-cause hypothesis.`,base:[`defects`],fields:[{key:`product_repo`,label:`Product repository`,help:`The application's code: suspect commits, and what the analysis reads.`,type:`path`,placeholder:`../shop`},{key:`reproduce`,label:`Run a new defect's case once more`,help:`To see whether it repeats.`,type:`switch`,default:!0},{key:`analyze`,label:`Write a root-cause hypothesis`,help:`One model session per new defect or regression.`,type:`switch`,default:!0},{key:`max_analyses`,label:`Analyses per suite`,type:`number`,default:3}]}],v=[{title:`Accessibility`,base:[`quality`],fields:[{key:`accessibility.standard`,label:`Standard`,type:`select`,default:`wcag21aa`,options:m([`wcag2a`,`WCAG 2.0 A`],[`wcag21aa`,`WCAG 2.1 AA`],[`wcag22aa`,`WCAG 2.2 AA`],[`wcag21aaa`,`WCAG 2.1 AAA`],[`section508`,`Section 508`],[`en301549`,`EN 301 549`],[`best-practice`,`Best practice`])},{key:`accessibility.ask_before_run`,label:`Ask before running a persona session`,help:`The Accessibility agent shows its plan and asks before it starts the browser runs, a few minutes and model tokens each. Off: it runs the plan straight away.`,type:`switch`,default:!0},{key:`budgets.accessibility.critical`,label:`Critical issues allowed`,help:`Empty: reported, never failed on.`,type:`number`},{key:`budgets.accessibility.serious`,label:`Serious issues allowed`,type:`number`},{key:`budgets.accessibility.ignore`,label:`Rules to ignore`,type:`list`,placeholder:`region`}]},{title:`Performance and visual changes`,base:[`quality`],fields:[{key:`budgets.performance`,label:`Performance budget`,help:`web-vitals uses Google's thresholds. Per-page budgets are edited in Settings as text.`,type:`select`,options:m([`web-vitals`,`Core Web Vitals`])},{key:`budgets.visual`,label:`Visual change allowed`,help:`Percent of a page's pixels.`,type:`number`},{key:`visual.full_page`,label:`Compare whole pages`,type:`switch`,default:!1},{key:`visual.mask`,label:`Hide before comparing`,help:`CSS selectors, comma separated.`,type:`list`,placeholder:`.clock, #ad-slot`}]},{title:`API tests`,base:[`api`],fields:[{key:`capture`,label:`Record the app's API calls`,help:`In every browser run, with secrets redacted.`,type:`switch`,default:!0},{key:`base_url`,label:`API address`,type:`url`,placeholder:`https://staging.shop.example`},{key:`third_party`,label:`Keep calls to other sites`,type:`switch`,default:!1},{key:`browser_fallback`,label:`Send blocked calls from a browser page`,help:`When the site's bot protection answers a read-only call with a challenge or block page, the call is sent again from a page of a real browser on the API's site. Never a call that changes data.`,type:`switch`,default:!0},{key:`keep_headers`,label:`More headers to keep`,help:`On the API calls runs, recordings and re-runs capture, and in the calls made from them: a tenant or a correlation id, comma separated. Never one that carries a credential (Authorization, cookies, a token or key).`,type:`list`,placeholder:`X-Tenant, X-Correlation-Id`},{key:`timeout_seconds`,label:`Time limit per call`,help:`In seconds.`,type:`number`,default:30},{key:`headers`,label:`Headers on every call`,help:"Values are ${NAME} references to environment variables, never the values.",type:`kv`,placeholder:"Authorization = Bearer ${API_TOKEN}"}]},{title:`API sign-in with OAuth2`,base:[`api`,`oauth2`],fields:[{key:`token_url`,label:`Token address`,help:`https only. ForgeQE asks it for a token with the client-credentials grant and sends it as a bearer token.`,type:`url`,placeholder:`https://login.shop.example/oauth2/token`},{key:`client_id_env`,label:`Client id`,type:`var`,placeholder:`SHOP_API_CLIENT_ID`},{key:`client_secret_env`,label:`Client secret`,type:`var`,placeholder:`SHOP_API_CLIENT_SECRET`},{key:`scope`,label:`Scope`,help:`Space separated.`,type:`text`,placeholder:`orders.read orders.write`},{key:`audience`,label:`Audience`,help:`When the provider asks for one.`,type:`text`,placeholder:`https://api.shop.example`}]},{title:`API load testing`,base:[`api`,`load`],fields:[{key:`users`,label:`Virtual users`,help:`1 to 50.`,type:`number`,placeholder:`10`},{key:`duration_seconds`,label:`Duration`,help:`In seconds, up to 600.`,type:`number`,placeholder:`60`},{key:`limits.p95_ms`,label:`p95 latency limit`,help:`Milliseconds. Broken: the run fails.`,type:`number`,placeholder:`800`},{key:`limits.p99_ms`,label:`p99 latency limit`,help:`Milliseconds.`,type:`number`,placeholder:`1500`},{key:`limits.error_rate`,label:`Error rate limit`,help:`0 to 1.`,type:`number`,placeholder:`0.01`},{key:`limits.min_rps`,label:`Throughput floor`,help:`Calls per second.`,type:`number`,placeholder:`20`}]},{title:`API client certificate (mutual TLS)`,base:[`api`,`tls`],fields:[{key:`cert`,label:`Certificate`,help:`A PEM file.`,type:`path`,placeholder:`~/.certs/shop-client.pem`},{key:`key`,label:`Private key`,help:`A PEM file kept out of the repository.`,type:`path`,placeholder:`~/.certs/shop-client-key.pem`},{key:`ca`,label:`Authorities trusted`,help:`A PEM file, for an API with its own certificate authority.`,type:`path`,placeholder:`~/.certs/shop-ca.pem`},{key:`key_passphrase_env`,label:`Key passphrase`,type:`var`,placeholder:`SHOP_API_KEY_PASSPHRASE`}]}],y=[{title:`Search service`,base:[`rag`],fields:[{key:`url`,label:`Address`,help:`ForgeQE sends POST {query, top_k} and reads the passages it answers.`,type:`url`,placeholder:`https://search.acme.example/search`},{key:`token_env`,label:`Token`,help:`Sent as a bearer token to that address only.`,type:`var`,placeholder:`RAG_TOKEN`},{key:`mcp.server`,label:`MCP server`,help:`Its name under MCP servers.`,type:`text`,placeholder:`docs`},{key:`mcp.tool`,label:`Its search tool`,type:`text`,placeholder:`search`},{key:`mcp.query_arg`,label:`The tool's query argument`,type:`text`,default:`query`},{key:`mcp.top_k_arg`,label:`The tool's argument for how many`,help:`Empty: the tool decides.`,type:`text`,placeholder:`limit`},{key:`command`,label:`Command`,help:`Gets {query, top_k} on stdin and prints passages. Comma separated.`,type:`list`,placeholder:`python, rag/search.py`},{key:`documents.folders`,label:`More folders`,help:`Folders inside the project, beside the knowledge folder, the documents below and product.docs. Comma separated.`,type:`list`,placeholder:`docs/requirements, docs/specs`},{key:`documents.reasoning`,label:`Let the model pick sections`,help:`Skimmer picks the sections that answer from their outline: one model call per search. Off: keywords only.`,type:`switch`},{key:`top_k`,label:`Passages per search`,type:`number`,default:5},{key:`timeout_seconds`,label:`Time limit`,help:`In seconds.`,type:`number`,default:20}]}],b=[{title:`The product`,help:`Agents design and judge tests as an expert in this industry, and add the obligations of each regulation a feature touches.`,base:[],fields:[{key:`product.name`,label:`Product name`,type:`text`,placeholder:`Shop`},{key:`domain.industry`,label:`Industry`,type:`text`,placeholder:`retail banking`},{key:`domain.regulations`,label:`Regulations`,type:`list`,placeholder:`DORA, PSD2, GDPR`},{key:`domain.notes`,label:`Notes`,type:`textarea`,placeholder:`Payments to UK and EU accounts; customers are consumers and small businesses.`}]},{title:`Where the knowledge is kept`,help:`The product graph forgeqe knowledge build writes, and how much of it a browser run gets. Page memory is under Reports and memory.`,base:[`knowledge`],fields:[{key:`dir`,label:`Product knowledge folder`,type:`path`,default:`.forgeqe/knowledge`},{key:`browser_max_chars`,label:`Knowledge per browser run`,help:`Characters. 0: none.`,type:`number`,default:1500}]},{title:`The graph store`,help:`The graph store keeps the product graph and BASAL's scenario graphs, so agents search them by meaning as well as words. forgeqe graph setup starts it after you agree: Docker first, else a native install, on this computer only. Without it, the graph's JSON file is used.`,base:[`graph`],fields:[{key:`store`,label:`Graph store`,type:`select`,default:`auto`,options:m([`auto`,`The graph store when it is running`],[`neo4j`,`The graph store, required`],[`json`,`The JSON file only`])},{key:`neo4j.setup`,label:`Where it runs`,help:`Automatic uses Docker when it is installed, else downloads what it needs once.`,type:`select`,default:`auto`,options:m([`auto`,`Automatic`],[`docker`,`In Docker`],[`native`,`Installed by ForgeQE`],[`server`,`On our own server`]),when:e=>e.store!==`json`},{key:`neo4j.url`,label:`Address`,help:`Another computer needs TLS: bolt+s:// or neo4j+s://.`,type:`text`,placeholder:`bolt://127.0.0.1:7688`,when:e=>e.store!==`json`},{key:`neo4j.user`,label:`User`,type:`text`,placeholder:`neo4j`,when:e=>e.store!==`json`},{key:`neo4j.password_env`,label:`Password variable`,help:`Its value is kept in Settings › Secrets. ForgeQE makes one for its own graph store.`,type:`text`,placeholder:`FORGEQE_NEO4J_PASSWORD`,when:e=>e.store!==`json`},{key:`embedding`,label:`Embedding model`,help:`A profile of llms.json that embeds, such as text-embedding-3-large. Empty: search by words only.`,type:`text`,placeholder:`azure-embed`,when:e=>e.store!==`json`},{key:`embedding_dimensions`,label:`Vector size`,type:`number`,default:1536,when:e=>e.store!==`json`&&!!e.embedding}]},{title:`The team's knowledge`,help:`Where the pipeline publishes the built product knowledge (forgeqe knowledge pipeline init). forgeqe knowledge pull brings it here: no repository needs to be cloned. One of a git branch, a link, or a file.`,base:[`product`,`shared`],fields:[{key:`git`,label:`Repository`,help:`The repository the pipeline publishes to.`,type:`text`,placeholder:`https://dev.azure.com/acme/Shop/_git/qa`},{key:`branch`,label:`Branch`,type:`text`,placeholder:`forgeqe-knowledge`},{key:`file`,label:`Pack in it`,type:`text`,placeholder:`shop.knowledge.forgeqe`},{key:`url`,label:`Or a link`,help:`https; a token goes to that host only.`,type:`url`,placeholder:`https://files.acme.local/shop.knowledge.forgeqe`},{key:`path`,label:`Or a file`,help:`On this computer or a shared folder.`,type:`path`,placeholder:`//share/qa/shop.knowledge.forgeqe`},{key:`token_env`,label:`Token`,help:`With the repository or the link. Empty: git's own sign-in.`,type:`var`,placeholder:`ADO_PAT`},{key:`user`,label:`User name for the token`,help:`Only when the server needs one.`,type:`text`}]}],x=[{title:`Building the graph`,help:`forgeqe knowledge build reads the repositories and documents into one graph the agents search: services, endpoints, tables, tests, and how they connect.`,base:[`product`],fields:[{key:`exclude`,label:`Files to leave out`,help:`Glob patterns, comma separated, beside each repository's .gitignore and .forgeqeignore.`,type:`list`,placeholder:`**/generated/**`},{key:`model`,label:`Understand the code with the model`,help:`Off: structure only; nothing is sent to a model.`,type:`switch`,default:!0},{key:`max_model_files`,label:`Files the model reads per build`,help:`0: none. Only new and changed files are read again.`,type:`number`,default:400},{key:`max_investigation_steps`,label:`Steps per question`,help:`5 to 200. Most tool calls one question to the product makes; at the limit it answers with what it found.`,type:`number`,placeholder:`40`}]}],S=[...y,...b,...x],C=[{key:`host`,label:`Host`,type:`select`,options:m([`github`,`GitHub`],[`azure-devops`,`Azure DevOps`],[`gitlab`,`GitLab`],[`bitbucket-cloud`,`Bitbucket Cloud`],[`bitbucket-server`,`Bitbucket Data Center`])},{key:`url`,label:`Address`,help:`A server of your own (GitHub Enterprise, GitLab, Azure DevOps Server, Bitbucket Data Center). Empty: the host's cloud.`,type:`url`,placeholder:`https://git.acme.example`},{key:`org`,label:`Organization`,help:`Azure DevOps' organization; a Bitbucket Cloud workspace.`,type:`text`,placeholder:`acme`},{key:`auth`,label:`Sign in`,type:`select`,options:m([`browser`,`In the browser`],[`token`,`With a token`])},{key:`token_env`,label:`Token`,type:`var`,placeholder:`GITHUB_TOKEN`},{key:`user`,label:`User name for the token`,help:`Bitbucket only, with an app password.`,type:`text`}],w=[{title:`Instructions and knowledge`,base:[],fields:[{key:`prompts.step_instruction`,label:`Extra instruction for the browser agent`,type:`textarea`},{key:`prompts.dir`,label:`Shared prompts folder`,help:`Wins over .forgeqe/prompts.`,type:`path`,placeholder:`../shared-prompts`},{key:`guardrails.dir`,label:`Guardrails folder`,type:`path`,default:`.forgeqe/guardrails`},{key:`prompts.guiderails`,label:`Guardrails kept in forgeqe.yaml`,help:`The older way: one rule per line. Prefer Guardrails.`,type:`textarea`}]},{title:`Custom agents`,help:`The team's agents for one job each (Agents, Custom agents). Off: none of them runs, from the terminal, this app, Atlas or a schedule; their files and history are kept.`,base:[`custom_agents`],fields:[{key:`enabled`,label:`Custom agents on`,help:`Off: none runs, and their scheduled runs do not start.`,type:`switch`,default:!0}]},{title:`Capabilities`,help:`The agent gets the tools a request is about. Pin some on, or turn some off for this project (forgeqe features lists them).`,base:[`agent`,`capabilities`],fields:[{key:`always`,label:`Always given`,type:`list`,placeholder:`regression-packs`},{key:`off`,label:`Never given`,type:`list`,placeholder:`desktop-apps`}]}],T=[{id:`jira`,icon:p,name:`Jira`,note:`Test cases, results and bugs`,base:[`sources`,`jira`],vars:[`email_env`,`token_env`],fields:[{key:`url`,label:`Site`,type:`url`,placeholder:`https://acme.atlassian.net`},{key:`email_env`,label:`Email variable`,help:`Cloud only.`,type:`var`,default:`JIRA_EMAIL`},{key:`token_env`,label:`Token variable`,type:`var`,default:`JIRA_API_TOKEN`},{key:`mcp`,label:`MCP server`,type:`select`,default:`mcp-atlassian`,options:m([`mcp-atlassian`,`mcp-atlassian (Cloud and Server)`],[`rovo`,`Rovo (Atlassian's, Cloud)`],[`false`,`None`])},{key:`test_cases`,label:`Where existing test cases are`,help:`One line per story project: the Jira project key (or * for the rest) = project=, label=, component=, type=, separated by ;. Saving cases reads only there (at most 300) to reuse or extend one.`,type:`kv`,placeholder:`SHOP = label=regression; component=Checkout
2
+ * = project=QA`},{key:`sibling_cases`,label:`Also compare with the epic's other stories`,help:`The tests of the other stories under the story's epic (Jira Cloud parent; the first 30 stories).`,type:`switch`,default:!1},{key:`new_cases.priority`,label:`Priority of new test cases`,help:`A priority name. The agent may give a case its own.`,type:`text`,placeholder:`Medium`},{key:`new_cases.tags`,label:`Labels on new test cases`,help:`No spaces. Added to the case's own.`,type:`list`,placeholder:`forgeqe`},{key:`retire_label`,label:`Label of a retired test case`,help:`What retire_test_case adds; nothing is deleted.`,type:`text`,default:`obsolete`},{key:`done_statuses`,label:`Statuses that mean done`,help:`Only where the site categorises its own statuses wrongly; otherwise Jira's status category says, custom statuses included.`,type:`list`,placeholder:`Verified, Shipped`}]},{id:`azure_devops`,icon:t,name:`Azure DevOps`,note:`Test plans, work items and wiki`,base:[`sources`,`azure_devops`],vars:[`token_env`],fields:[{key:`test_plans`,label:`Test plans in Test management`,help:`plan=12, or plan=12/suite=34. Every case of these shows in Test management, synced from here.`,type:`list`,placeholder:`plan=12, plan=19/suite=204`},{key:`org_url`,label:`Organization`,type:`url`,placeholder:`https://dev.azure.com/acme`},{key:`project`,label:`Project`,help:`Empty: every project.`,type:`text`,placeholder:`Shop`},{key:`token_env`,label:`Token variable`,help:`A PAT with Test Management and Work Items, read and write.`,type:`var`,default:`ADO_PAT`},{key:`mcp`,label:`Use Microsoft's MCP server`,type:`switch`,default:!0},{key:`mcp_domains`,label:`MCP tool groups`,type:`list`,placeholder:`core, work, work-items, pipelines`},{key:`test_cases`,label:`Where existing test cases are`,help:`One line per story area path (or * for the rest) = plan=12, plan=12/suite=34, or area=<area path>. Saving cases reads only there (at most 300) to reuse or extend one.`,type:`kv`,placeholder:`Shop\\Checkout = plan=12/suite=34
3
+ * = area=Shop\\Regression`},{key:`sibling_cases`,label:`Also compare with the feature's other stories`,help:`The cases of the other stories under the story's feature or epic (the first 30 stories).`,type:`switch`,default:!1},{key:`new_cases.priority`,label:`Priority of new test cases`,help:`1 (highest) to 4. The agent may give a case its own.`,type:`number`,placeholder:`2`},{key:`new_cases.tags`,label:`Tags on new test cases`,help:`Added to the case's own.`,type:`list`,placeholder:`forgeqe`},{key:`new_cases.state`,label:`State of new test cases`,help:`For example Design, so a person reviews a case before it is Ready.`,type:`text`,placeholder:`Design`},{key:`retire_state`,label:`State of a retired test case`,help:`What retire_test_case sets; nothing is deleted. Empty: a state the project itself calls done.`,type:`text`,placeholder:`Closed`},{key:`states.done`,label:`States that mean done`,help:`Only where the project categorises its own states wrongly; otherwise they are read from the project, custom ones included.`,type:`list`,placeholder:`Verified, Shipped`},{key:`states.removed`,label:`States that mean removed`,help:`States for an item taken out of the project.`,type:`list`,placeholder:`Dropped`},{key:`shared_steps`,label:`Shared steps to use`,help:`Shared Steps work item ids. New cases refer to them instead of copying their steps.`,type:`list`,placeholder:`345, 346`}]},{id:`xray`,icon:o,name:`Xray`,note:`Test cases in Jira, through Xray Cloud`,base:[`sources`,`xray`],vars:[`client_id_env`,`client_secret_env`],fields:[{key:`test_plans`,label:`Test plans in Test management`,help:`A test plan's key: plan=SHOP-100. Every case of these shows in Test management, synced from here.`,type:`list`,placeholder:`plan=SHOP-100`},{key:`url`,label:`Address`,type:`url`,default:`https://xray.cloud.getxray.app`},{key:`client_id_env`,label:`Client id variable`,type:`var`,default:`XRAY_CLIENT_ID`},{key:`client_secret_env`,label:`Client secret variable`,type:`var`,default:`XRAY_CLIENT_SECRET`},{key:`save_steps`,label:`Save cases as Xray tests`,help:`Cases saved from a Jira story become Xray tests with their steps in Xray.`,type:`switch`,default:!1}]},{id:`confluence`,icon:f,name:`Confluence`,note:`Requirements pages`,base:[`sources`,`confluence`],vars:[`email_env`,`token_env`],fields:[{key:`url`,label:`Site`,help:`Empty: the Jira site, same account.`,type:`url`,placeholder:`https://acme.atlassian.net/wiki`},{key:`email_env`,label:`Email variable`,type:`var`,default:`CONFLUENCE_EMAIL`},{key:`token_env`,label:`Token variable`,type:`var`,default:`CONFLUENCE_TOKEN`},{key:`space`,label:`Space`,help:`Search this space only.`,type:`text`,placeholder:`QA`}]},{id:`testrail`,icon:u,name:`TestRail`,note:`Test cases and results`,base:[`sources`,`testrail`],vars:[`email_env`,`token_env`],fields:[{key:`test_plans`,label:`Test plans in Test management`,help:`run=7, plan=3 or suite=5. Every case of these shows in Test management, synced from here.`,type:`list`,placeholder:`run=7`},{key:`url`,label:`Site`,type:`url`,placeholder:`https://acme.testrail.io`},{key:`email_env`,label:`Email variable`,type:`var`,default:`TESTRAIL_EMAIL`},{key:`token_env`,label:`API key variable`,type:`var`,default:`TESTRAIL_API_KEY`},{key:`project_id`,label:`Project id`,type:`number`},{key:`section_id`,label:`Section for new test cases`,help:`Where cases written from a story are saved, with the story in refs.`,type:`number`},{key:`template_id`,label:`Template of new test cases`,help:`2 is Test Case (Steps).`,type:`number`,default:2},{key:`retired_section_id`,label:`Section for retired test cases`,help:`Retiring a case moves it here; TestRail has no retired state.`,type:`number`},{key:`automation_field`,label:`Automation field`,help:`Your custom field a passing test marks, e.g. custom_automation_type.`,type:`text`,placeholder:`custom_automation_type`},{key:`automation_value`,label:`Automation value`,help:`What the field is set to.`,type:`text`,placeholder:`2`}]},{id:`zephyr`,icon:s,name:`Zephyr Scale`,note:`Test cases and results`,base:[`sources`,`zephyr`],vars:[`token_env`],fields:[{key:`test_plans`,label:`Test plans in Test management`,help:`cycle=SHOP-R12 or folder=34. Every case of these shows in Test management, synced from here.`,type:`list`,placeholder:`cycle=SHOP-R12`},{key:`token_env`,label:`Token variable`,type:`var`,default:`ZEPHYR_API_TOKEN`},{key:`project_key`,label:`Project key`,type:`text`,placeholder:`SHOP`},{key:`folder_id`,label:`Folder for new test cases`,help:`Where cases written from a story are saved, and where ForgeQE looks for ones to reuse.`,type:`number`},{key:`retire_status`,label:`Status of a retired test case`,help:`What retire_test_case sets.`,type:`text`,default:`Deprecated`}]},{id:`qtest`,icon:l,name:`qTest`,note:`Test cases and results`,base:[`sources`,`qtest`],vars:[`token_env`],fields:[{key:`test_plans`,label:`Test plans in Test management`,help:`cycle=12 or suite=34. Every case of these shows in Test management, synced from here.`,type:`list`,placeholder:`cycle=12`},{key:`url`,label:`Site`,type:`url`,placeholder:`https://acme.qtestnet.com`},{key:`token_env`,label:`Token variable`,type:`var`,default:`QTEST_TOKEN`},{key:`project_id`,label:`Project id`,type:`number`},{key:`statuses`,label:`Status names`,help:`Your qTest's automation status for each result, one per line.`,type:`kv`,placeholder:`passed = PASS
4
+ failed = FAIL
5
+ error = BLOCKED`},{key:`module_id`,label:`Module for new test cases`,help:`Where cases written from a requirement are saved, linked to it.`,type:`number`}]},{id:`servicenow`,icon:s,name:`ServiceNow`,note:`Test Management tests, read only`,base:[`sources`,`servicenow`],vars:[`user_env`,`token_env`],fields:[{key:`url`,label:`Site`,help:`The instance's https address.`,type:`url`,placeholder:`https://acme.service-now.com`},{key:`user_env`,label:`User name variable`,help:`When it has no value, the password variable holds an OAuth access token.`,type:`var`,default:`SERVICENOW_USER`},{key:`token_env`,label:`Password or token variable`,type:`var`,default:`SERVICENOW_PASSWORD`},{key:`test_table`,label:`Test table`,help:`Table names differ by release: check them in your instance.`,type:`text`,default:`sn_test_management_test`},{key:`step_table`,label:`Step table`,type:`text`,default:`sn_test_management_step`},{key:`step_parent`,label:`Step's test field`,help:`The field of a step that names its test.`,type:`text`,default:`test`}]},{id:`github`,icon:i,name:`GitHub`,note:`Issues as test cases, bugs, pull requests`,base:[`sources`,`github`],vars:[`token_env`],fields:[{key:`repo`,label:`Repository`,type:`text`,placeholder:`acme/shop`},{key:`token_env`,label:`Token variable`,help:`Without it, the GitHub CLI's sign-in.`,type:`var`,default:`GITHUB_TOKEN`},{key:`toolsets`,label:`MCP tool groups`,type:`list`,placeholder:`repos, issues, pull_requests, actions`}]},{id:`gitlab`,icon:n,name:`GitLab`,note:`Issues, merge requests and pipelines`,group:`tools`,base:[`integrations`,`gitlab`],vars:[`token_env`],fields:[{key:`url`,label:`Address`,help:`GitLab.com or your own GitLab.`,type:`url`,default:`https://gitlab.com`},{key:`token_env`,label:`Token variable`,help:`A fine-grained personal access token with the MCP permission.`,type:`var`,default:`GITLAB_TOKEN`},{key:`toolsets`,label:`MCP tool groups`,help:`Empty: all of them.`,type:`list`,placeholder:`core, work_items`}]},{id:`browserstack_mcp`,icon:a,logo:`browserstack`,name:`BrowserStack tools`,note:`Sessions, accessibility and test management`,group:`tools`,base:[`integrations`,`browserstack`],vars:[`username_env`,`access_key_env`],fields:[{key:`username_env`,label:`User name variable`,type:`var`,default:`BROWSERSTACK_USERNAME`},{key:`access_key_env`,label:`Access key variable`,type:`var`,default:`BROWSERSTACK_ACCESS_KEY`}]},{id:`postman`,icon:c,name:`Postman`,note:`Collections, environments and mocks`,group:`tools`,base:[`integrations`,`postman`],vars:[`api_key_env`],fields:[{key:`api_key_env`,label:`API key variable`,type:`var`,default:`POSTMAN_API_KEY`},{key:`region`,label:`Region`,type:`select`,default:`us`,options:m([`us`,`US`],[`eu`,`EU`])},{key:`tools`,label:`Tools`,type:`select`,default:`full`,options:m([`full`,`Full`],[`minimal`,`Minimal`],[`code`,`Code`])}]},{id:`azure`,icon:r,name:`Azure`,note:`Azure resources, as az login's account`,untestable:!0,group:`tools`,base:[`integrations`,`azure`],vars:[],fields:[{key:`namespaces`,label:`MCP tool groups`,help:`Empty: all of them.`,type:`list`,placeholder:`storage, keyvault`},{key:`read_only`,label:`Read only`,help:`Off: its tools that change resources too.`,type:`switch`,default:!0}]},{id:`aws`,icon:r,name:`AWS`,note:`AWS resources, as this computer's AWS sign-in`,untestable:!0,group:`tools`,base:[`integrations`,`aws`],vars:[],fields:[{key:`read_only`,label:`Read only`,help:`Off: its tools that may change resources too.`,type:`switch`,default:!0},{key:`profile`,label:`Profile`,help:`Empty: the profile of the environment in use, else this computer's default AWS sign-in.`,type:`text`,placeholder:`shop-qa`},{key:`region`,label:`Region`,help:`Empty: the region of the environment in use.`,type:`text`,placeholder:`eu-west-1`},{key:`endpoint_region`,label:`Server region`,help:`The region of the AWS MCP Server's address.`,type:`text`,default:`us-east-1`}]},{id:`gcp`,icon:r,name:`Google Cloud`,note:`Google Cloud resources, as gcloud's account`,untestable:!0,group:`tools`,base:[`integrations`,`gcp`],vars:[],fields:[{key:`project`,label:`Project`,help:`Empty: the project of the environment in use.`,type:`text`,placeholder:`shop-qa-123`},{key:`allow`,label:`More commands`,help:`Whole gcloud commands it may run besides its read commands, comma separated.`,type:`list`,placeholder:`pubsub topics publish, run services update`}]},{id:`dataverse`,icon:d,name:`Dataverse`,note:`Tables and records`,untestable:!0,group:`tools`,base:[`integrations`,`dataverse`],vars:[],fields:[{key:`url`,label:`Environment`,help:`Sign in once: npx @microsoft/dataverse@1.0.82 auth create --environment <address>.`,type:`url`,placeholder:`https://acme.crm.dynamics.com`},{key:`preview`,label:`Preview endpoint`,type:`switch`,default:!1}]},{id:`sentry`,icon:e,name:`Sentry`,note:`Errors, stack traces and releases`,group:`tools`,base:[`integrations`,`sentry`],vars:[`token_env`],fields:[{key:`url`,label:`Address`,help:`sentry.io or your own Sentry.`,type:`url`,default:`https://sentry.io`},{key:`token_env`,label:`Token variable`,help:`A user auth token.`,type:`var`,default:`SENTRY_ACCESS_TOKEN`},{key:`organization`,label:`Organization`,type:`text`,placeholder:`acme`}]},{id:`datadog`,icon:e,name:`Datadog`,note:`Production errors, for Production signals`,untestable:!0,group:`tools`,base:[`integrations`,`datadog`],vars:[`api_key_env`,`app_key_env`],fields:[{key:`site`,label:`Site`,type:`select`,default:`us1`,options:m([`us1`,`US1 (datadoghq.com)`],[`us3`,`US3`],[`us5`,`US5`],[`eu`,`EU (datadoghq.eu)`],[`ap1`,`AP1`],[`ap2`,`AP2`],[`gov`,`US1-FED`])},{key:`api_key_env`,label:`API key variable`,type:`var`,default:`DD_API_KEY`},{key:`app_key_env`,label:`Application key variable`,help:`With the error tracking and RUM read scopes.`,type:`var`,default:`DD_APP_KEY`},{key:`track`,label:`Errors from`,type:`select`,default:`rum`,options:m([`rum`,`Real user monitoring (has the page)`],[`logs`,`Logs`],[`trace`,`Traces`])},{key:`query`,label:`Search`,help:`Optional, in Datadog's search syntax, such as service:shop env:prod.`,type:`text`,placeholder:`service:shop`}]},{id:`appinsights`,icon:e,name:`Application Insights`,note:`Production exceptions, for Production signals`,untestable:!0,group:`tools`,base:[`integrations`,`appinsights`],vars:[`api_key_env`],fields:[{key:`app_id`,label:`Application ID`,help:`API Access in the Azure portal.`,type:`text`,placeholder:`00000000-0000-0000-0000-000000000000`},{key:`cloud`,label:`Cloud`,type:`select`,default:`public`,options:m([`public`,`Azure`],[`china`,`Azure China`],[`usgov`,`Azure US Government`])},{key:`auth`,label:`Sign in with`,type:`select`,default:`azure-cli`,options:m([`azure-cli`,`The Azure CLI (az login)`],[`api-key`,`An API key`])},{key:`api_key_env`,label:`API key variable`,help:`Only when signing in with an API key.`,type:`var`,default:`APPINSIGHTS_API_KEY`}]},{id:`testmu_mcp`,icon:r,logo:`testmu`,name:`TestMu AI tools`,note:`HyperExecute, failure triage, SmartUI, accessibility and Test Manager`,signinOnly:!0,group:`tools`,base:[`integrations`,`testmu`],vars:[],fields:[]}],E={title:`Bugs`,help:`A bug for each defect a run finds; a comment on the open bug while it still fails.`,base:[`sources`,`bugs`],fields:[{key:`system`,label:`Where bugs go`,type:`select`,options:m([`jira`,`Jira`],[`azure_devops`,`Azure DevOps`],[`github`,`GitHub`])},{key:`project`,label:`Project`,help:`Jira project key, or GitHub owner/repo.`,type:`text`,placeholder:`SHOP`},{key:`type`,label:`Issue type`,type:`text`,default:`Bug`},{key:`labels`,label:`Labels`,help:`Jira labels, or Azure DevOps tags.`,type:`list`,placeholder:`forgeqe`},{key:`area_path`,label:`Area path`,help:`Azure DevOps.`,type:`text`,placeholder:`Shop\\Web`},{key:`group_by`,label:`One bug per`,type:`select`,default:`defect`,options:m([`defect`,`Defect (cases failing the same way share one)`],[`case`,`Case`])},{key:`on_error`,label:`Also for cases that could not run`,type:`switch`,default:!1}]},D=[[`suite_failed`,`A suite failed`],[`suite_passed`,`A suite passed`],[`release`,`Release verdict`],[`eval_failed`,`An eval failed`],[`job_failed`,`A schedule failed`],[`job_recovered`,`A schedule recovered`],[`job_done`,`A schedule finished`],[`job_investigated`,`A failure was investigated`],[`agent_waiting`,`A custom agent waits for a person's approval`],[`agent_failed`,`A custom agent's run with nobody watching did not finish`],[`agent_done`,`A custom agent's run with nobody watching finished`],[`evidence_drift`,`An agent under test drifted from its baseline (Evidence)`],[`sign_in_waiting`,`A run waits for a person to approve a sign-in (a push to a phone)`]],O=[{title:`Project report`,help:`forgeqe bi builds a static site from ForgeQE's data and the datasets below, with no server (Reports, Build project report).`,base:[`bi`],fields:[{key:`title`,label:`Title`,type:`text`,default:`ForgeQE BI`},{key:`evidence_dir`,label:`Evidence project`,type:`path`,default:`./evidence`},{key:`data_dir`,label:`Data folder`,type:`path`,default:`./evidence/sources/forgeqe`},{key:`build_dir`,label:`Built site`,type:`path`,default:`./.forgeqe/reports/bi`},{key:`collect`,label:`Teammates' exports`,help:`Files or folders of forgeqe bi export, comma separated.`,type:`list`,placeholder:`//share/qa-reports`}]}],k=[{key:`kind`,label:`From`,type:`select`,options:m([`ado_wiql`,`Azure DevOps (WIQL)`],[`jira_jql`,`Jira (JQL)`])},{key:`title`,label:`Title`,type:`text`,placeholder:`Current sprint stories`},{key:`project`,label:`Azure DevOps project`,type:`text`,placeholder:`Shop`},{key:`wiql`,label:`WIQL`,type:`textarea`,placeholder:`SELECT [System.Id] FROM WorkItems WHERE ...`},{key:`jql`,label:`JQL`,type:`textarea`,placeholder:`project = SHOP AND issuetype = Bug`}],A=[{title:`Running in parallel`,help:`More at once finishes sooner, and uses more of this machine (or of your grid's sessions) and more model calls at the same time.`,base:[],fields:[{key:`suite.parallel`,label:`Browsers at once in a suite`,help:`Test cases of one suite run side by side. Coding jobs always go one at a time.`,type:`number`,default:1},{key:`jobs.parallel`,label:`Scheduled runs at once`,help:`Over all jobs of the jobs service.`,type:`number`,default:2},{key:`monitor.parallel`,label:`Monitor checks at once`,help:`In each monitor round.`,type:`number`,default:1}]}],j=[{title:`Driver`,help:`Appium runs workflows step by step and explores goals; Maestro replays them and runs your team's own flows. The apps themselves are in Environments (kind: mobile).`,base:[`mobile`],fields:[{key:`driver`,label:`Replays run on`,type:`select`,default:`appium`,options:m([`appium`,`Appium`],[`maestro`,`Maestro`])},{key:`heal`,label:`Heal a replay that breaks`,help:`A step that no longer finds its element is found again from the screen.`,type:`switch`,default:!0},{key:`headless`,label:`Emulators without a window`,help:`Appium starts this computer's emulators (a device's Emulator to start) and iOS simulators without a window. Off: you see them.`,type:`switch`,default:!1},{key:`secrets`,label:`Secrets a flow may read`,help:`The only environment variables {{secret:…}} may read, comma separated.`,type:`list`,placeholder:`COURIER_PASSWORD`}]}],M=e=>e.runs_on===`browserstack`||e.runs_on===`testmu`,N=[{key:`runs_on`,label:`Runs on`,help:`Devices on a cloud are kept in its own file, below.`,type:`select`,default:`local`,options:m([`local`,`This computer`],[`browserstack`,`BrowserStack`],[`testmu`,`TestMu AI`]),when:e=>M(e)},{key:`type`,label:`Type`,type:`select`,emptyLabel:`Emulator here, real device on a cloud`,options:m([`real`,`Real device`],[`virtual`,`Emulator or simulator`]),when:e=>e.runs_on!==`browserstack`},{key:`platform`,label:`Platform`,type:`select`,default:`android`,options:m([`android`,`Android`],[`ios`,`iOS`])},{key:`model`,label:`Device model`,help:`An iOS simulator's name; else optional.`,type:`text`,placeholder:`iPhone 15`},{key:`os_version`,label:`OS version`,help:`Android or iOS version.`,type:`text`,placeholder:`14`},{key:`udid`,label:`Device id`,help:`From adb devices or xcrun simctl list. Empty: the one connected.`,type:`text`,placeholder:`emulator-5554`,when:e=>!M(e)},{key:`avd`,label:`Emulator to start`,help:`An Android emulator's name (emulator -list-avds): Appium starts it for the run. Empty: one already running.`,type:`text`,placeholder:`Pixel_8_API_35`,when:e=>!M(e)&&e.platform!==`ios`&&e.type!==`real`},{key:`enabled`,label:`Use in runs`,help:`Off: kept here, run only when a run names it.`,type:`switch`,default:!0}],P=[{title:`Running in parallel`,help:`Each replay and each set of Maestro flows runs on every device in use. More at once finishes sooner, and uses more of this machine or of your device cloud's sessions.`,base:[`mobile`],fields:[{key:`parallel`,label:`Devices at once`,help:`Empty: all of them. 1: one after another. TestMu AI's too.`,type:`number`,placeholder:`All`}]},{title:`Appium on this computer`,help:`For devices that run on this computer.`,base:[`mobile`,`appium`],fields:[{key:`url`,label:`Appium server`,type:`url`,default:`http://127.0.0.1:4723`},{key:`capabilities`,label:`Extra capabilities`,help:`Rarely needed: ForgeQE builds them from the app and each device. Added to every session, one per line.`,type:`kv`,placeholder:`appium:newCommandTimeout = 300`}]},{title:`Maestro`,help:`Runs on this computer's devices, and on TestMu AI's through HyperExecute. Not on BrowserStack.`,base:[`mobile`],fields:[{key:`maestro.command`,label:`Maestro program`,help:`With its arguments, comma separated.`,type:`list`,placeholder:`maestro`},{key:`hyperexecute`,label:`hyperexecute program`,help:`TestMu AI's, for Maestro on its devices.`,type:`path`,placeholder:`hyperexecute`}]}],F=[{title:`Desktop apps`,base:[`desktop`],fields:[{key:`heal`,label:`Heal a replay that breaks`,help:`The model re-finds a control that moved.`,type:`switch`,default:!0},{key:`screenshots`,label:`Screenshot each replayed step`,type:`switch`,default:!0},{key:`video`,label:`Record a video`,help:`Of the whole screen, while a workflow replays, explores or is recorded.`,type:`switch`,default:!0},{key:`driver`,label:`Replay on`,help:`Accessibility calls replay on macOS, Linux and Windows without taking the mouse. Exploring and recording by hand need Windows.`,type:`select`,default:`auto`,options:m([`auto`,`Automatic (the mouse and keyboard on Windows, accessibility calls elsewhere)`],[`pywinauto`,`The mouse and keyboard (Windows)`],[`agent-desktop`,`Accessibility calls, no mouse (macOS, Linux, Windows)`])},{key:`headed`,label:`Let replay use the mouse and keyboard`,help:`For replay by accessibility calls: only a double-click needs it; it is headless otherwise.`,type:`switch`,default:!1},{key:`secrets`,label:`Secrets a workflow may read`,help:`The only environment variables {{secret:…}} may read, comma separated.`,type:`list`,placeholder:`BILLING_PASSWORD`}]}],I=[{title:`Runtime`,help:`ForgeQE starts only what is declared here, with ports on 127.0.0.1 and read-only mounts inside the project. Images take an exact version or a digest, never latest.`,base:[`containers`],fields:[{key:`runtime`,label:`Runtime`,type:`select`,emptyLabel:`Docker, else Podman`,options:m([`docker`,`Docker`],[`podman`,`Podman`])},{key:`compose`,label:`Compose files`,help:`Services from a compose file too, checked by the same rules.`,type:`list`,placeholder:`docker-compose.yml`},{key:`mock.image`,label:`Mocks' image`,type:`text`,placeholder:`wiremock/wiremock:3.9.1`}]},{title:`Tests in a container`,help:`run_tests runs the repository's tests in this image, its services started first and reachable by name.`,base:[`containers`,`tests`],fields:[{key:`image`,label:`Image`,type:`text`,placeholder:`mcr.microsoft.com/playwright:v1.48.2-jammy`},{key:`services`,label:`Services first`,type:`list`,placeholder:`db`},{key:`env`,label:`Environment`,type:`kv`,placeholder:`CI = true`},{key:`secrets`,label:`Secrets`,help:`Environment variable names.`,type:`list`,placeholder:`TEST_DB_PASSWORD`}]},{title:`The coding agents' workspace`,help:`Their shell commands, builds and test runs happen in this image, with the repository mounted; the agents and their keys stay on this machine.`,base:[`containers`,`workspace`],fields:[{key:`image`,label:`Image`,type:`text`,placeholder:`node:20.18.0`},{key:`services`,label:`Services first`,type:`list`,placeholder:`db`},{key:`env`,label:`Environment`,type:`kv`},{key:`secrets`,label:`Secrets`,type:`list`}]},{title:`Browser in a container`,help:`Used when Browser is set to Chrome in Docker.`,base:[`containers`,`browser`],fields:[{key:`image`,label:`Image`,type:`text`,placeholder:`the image ForgeQE ships`},{key:`headless`,label:`Without a window`,type:`switch`,default:!0}]}],L=[{key:`path`,label:`Folder of documents`,help:`Markdown, text, or HTML. Relative to forgeqe.yaml.`,type:`path`,placeholder:`../shop-docs`},{key:`url`,label:`Or a link`,help:`A docs site or help centre, or an OpenAPI, Swagger, WSDL, or GraphQL description.`,type:`url`,placeholder:`https://help.shop.example/`},{key:`depth`,label:`Links to follow`,help:`How many links deep, on the same site only. 0 to 5; 0: the page alone.`,type:`number`,placeholder:`1`},{key:`max_pages`,label:`Most pages`,help:`A link: 1 to 2000, 100 if empty. Confluence: 1 to 25, 25 if empty.`,type:`number`,placeholder:`100`},{key:`token_env`,label:`Token for the link`,help:`Sent as a bearer token, to that site only.`,type:`var`,placeholder:`DOCS_TOKEN`},{key:`confluence`,label:`Or a Confluence space or page`,help:`A space key, or a page's link with the pages under it.`,type:`text`,placeholder:`SHOP`},{key:`app`,label:`Or a web app of env.yaml`,help:`The pages ForgeQE's runs and explorations remember of it.`,type:`text`,placeholder:`shop-web`}],R=[{key:`path`,label:`Local clone`,help:`Relative to forgeqe.yaml.`,type:`path`,placeholder:`../shop-web`},{key:`git`,label:`Or its link`,help:`GitHub, Azure DevOps, GitLab, Bitbucket, or any git server, over https or ssh. ForgeQE fetches the branch's latest commit into its own cache, only when it moved.`,type:`text`,placeholder:`https://dev.azure.com/acme/Shop/_git/orders`},{key:`branch`,label:`Branch`,help:`With a link. The repository's default branch if empty.`,type:`text`,placeholder:`main`},{key:`token_env`,label:`Token`,help:`With an https link. Sent to that host only; empty: git's own sign-in.`,type:`var`,placeholder:`ADO_PAT`},{key:`user`,label:`User name for the token`,help:`Only when the server needs one, like a Bitbucket app password.`,type:`text`},{key:`auth`,label:`Browser sign-in`,help:`In place of a token: the GitHub CLI's or the Azure CLI's sign-in. Empty: the token, or git's own sign-in.`,type:`select`,options:m([`github-cli`,`GitHub CLI`],[`azure-cli`,`Azure CLI`]),emptyLabel:`None`},{key:`account`,label:`Account`,help:`The account it was connected from (Repositories).`,type:`text`},{key:`system`,label:`System`,help:`The system it is part of, as your teams name it, for the Landscape on the Product page. Empty: grouped by its name.`,type:`text`,placeholder:`CRM`},{key:`database`,label:`Its database`,help:`A database of Databases, whose tables, keys and foreign keys are read into the graph. Only one that is not Writable.`,type:`text`,placeholder:`orders`}],z=[{key:`image`,label:`Image`,help:`An exact version or a digest.`,type:`text`,placeholder:`postgres:16.4`},{key:`description`,label:`What it is`,type:`text`,placeholder:`Orders database`},{key:`ports`,label:`Ports`,help:`5432, or 15432:5432 (this machine:container). On 127.0.0.1 only.`,type:`list`,placeholder:`5432`},{key:`env`,label:`Environment`,type:`kv`,placeholder:`POSTGRES_DB = shop`},{key:`secrets`,label:`Secrets`,help:`Environment variable names (.env works).`,type:`list`,placeholder:`POSTGRES_PASSWORD`},{key:`volumes`,label:`Mounts`,help:`Read-only, inside the project: ./host:/container.`,type:`list`,placeholder:`./db/init:/docker-entrypoint-initdb.d`},{key:`command`,label:`Command`,help:`Its arguments, comma separated.`,type:`list`},{key:`depends_on`,label:`Starts after`,type:`list`,placeholder:`db`},{key:`ready.tcp`,label:`Ready when this port answers`,type:`number`,placeholder:`5432`},{key:`ready.http`,label:`Or when this path answers`,type:`text`,placeholder:`/health`},{key:`ready.port`,label:`On port`,type:`number`,placeholder:`8080`},{key:`timeout`,label:`Wait for it`,help:`In seconds.`,type:`number`,placeholder:`60`}],B=[{key:`description`,label:`What it holds`,type:`text`,placeholder:`Orders written by the checkout app`},{key:`url_env`,label:`Connection string`,help:`A whole URI, JDBC or ADO.NET string. Or give the parts below.`,type:`var`,placeholder:`ORDERS_DB_URL`},{key:`engine`,label:`Engine`,type:`select`,options:m([`postgres`,`PostgreSQL`],[`mysql`,`MySQL`],[`mariadb`,`MariaDB`],[`mssql`,`SQL Server`],[`oracle`,`Oracle`],[`snowflake`,`Snowflake`],[`redshift`,`Redshift`],[`cockroachdb`,`CockroachDB`],[`sqlite`,`SQLite`],[`duckdb`,`DuckDB`],[`mongodb`,`MongoDB`],[`kafka`,`Kafka`])},{key:`host`,label:`Host`,type:`text`,placeholder:`localhost`},{key:`port`,label:`Port`,type:`number`,placeholder:`5432`},{key:`database`,label:`Database`,type:`text`,placeholder:`test`},{key:`schema`,label:`Schema`,type:`text`},{key:`path`,label:`File`,help:`SQLite or DuckDB.`,type:`path`,placeholder:`./data/test.db`},{key:`user`,label:`User`,type:`text`,placeholder:`qa`},{key:`auth`,label:`Signs in with`,type:`select`,default:`password`,options:m([`password`,`A password`],[`azure`,`Microsoft Entra`],[`aws_iam`,`AWS IAM`],[`none`,`Nothing`])},{key:`password_env`,label:`Password`,type:`var`,placeholder:`FIXTURES_DB_PASSWORD`},{key:`region`,label:`AWS region`,type:`text`,placeholder:`eu-west-1`},{key:`ssl`,label:`TLS`,type:`select`,emptyLabel:`The driver's default`,options:m([`verify`,`Verify the certificate`],[`require`,`Require`],[`disable`,`Off`])},{key:`ssl_ca`,label:`CA certificate`,type:`path`,placeholder:`./certs/ca.pem`},{key:`writable`,label:`Writable`,help:`Allows confirmed INSERT, and UPDATE or DELETE with a WHERE clause. Each one is asked first.`,type:`switch`,default:!1},{key:`timeout_seconds`,label:`Query time limit`,help:`In seconds.`,type:`number`,placeholder:`30`},{key:`options`,label:`Driver options`,type:`kv`}],V=[`theme.logo`,`theme.logo_mark`,`theme.logo_frame`,`theme.logo_size`,`theme.icon_style`,`theme.icon_set`,`theme.icon_colour`,`theme.mascot`,`theme.mascot_colours`,`theme.name`,`theme.primary`,`theme.gradient`,`theme.secondary`,`theme.background`,`agent.names.*`,`agent.app_name`,`llm.models_file`,`llm.active`,`llm.routing`,`llm.strategy`,`llm.fallback`,`llm.routes.*`,`llm.agents.*`,`environments.file`,`environments.dir`,`environments.default`,`logins.*.url`,`logins.*.domains`,`logins.*.username_env`,`logins.*.password_env`,`logins.*.totp_env`,`logins.*.save_session`,`logins.*.app`,`logins.*.code`,`logins.*.code_host`,`logins.*.code_user_env`,`logins.*.code_secret_env`,`logins.*.code_to`,`logins.*.code_sender`,`logins.*.code_folder`,`logins.*.code_url`,`logins.*.code_header`,`logins.*.code_pattern`,`logins.*.code_wait`,`logins.*.passkey_env`,`logins.*.push_wait`,`browser.providers.browserstack`,`browser.providers.testmu`,`notify.report_url`,`notify.channels.*.teams`,`notify.channels.*.email`,`notify.channels.*.on`,`mcp.*.url`,`mcp.*.headers`,`mcp.*.command`,`mcp.*.env`,...[`checks`,`every`,`replay`,`parallel`,`write_back`,`fail_after`,`remind_every`,`report_url`,`keep`,`out_dir`,`alerts.teams.webhook_env`,`alerts.email.host`,`alerts.email.port`,`alerts.email.username_env`,`alerts.email.password_env`,`alerts.email.from`,`alerts.email.to`].map(e=>`monitor.${e}`),...[`enabled`,`external`,`dirs`,`browser_max_chars`,`disable`].map(e=>`skills.${e}`),...[`run`,`day`,`month`,`currency`].map(e=>`budget.${e}`),...[`run`,`day`,`month`].map(e=>`budget.premium_requests.${e}`),`export.format`];[...(e=>e.flatMap(e=>e.fields.map(t=>[...e.base,t.key].join(`.`))))([...h,...g,..._,...A,...v,...S,...w,...j,...P,...F,...I,...O,E]),...T.flatMap(e=>e.fields.length?e.fields.map(t=>[...e.base,t.key].join(`.`)):[e.base.join(`.`)]),...z.map(e=>`containers.services.*.${e.key}`),...R.map(e=>`product.repos.*.${e.key}`),...C.map(e=>`product.accounts.*.${e.key}`),...L.map(e=>`product.docs.*.${e.key}`),...B.map(e=>`databases.*.${e.key}`),...k.map(e=>`bi.datasets.*.${e.key}`),...N.map(e=>`mobile.devices.*.${e.key}`),...V];var H=(e,t)=>t.flatMap(t=>t.fields.map(n=>({section:e,label:n.label,key:[...t.base,n.key].join(`.`)}))),U=(e,t,n)=>n.map(n=>({section:e,label:n.label,key:`${t}.*.${n.key}`})),W=[...H(`browser`,h),...H(`tests`,g),...H(`runs`,[..._,...O]),...U(`runs`,`bi.datasets`,k),...H(`parallel`,A),...H(`quality`,v),...H(`evidence`,S),...U(`evidence`,`product.accounts`,C),...U(`evidence`,`product.repos`,R),...U(`evidence`,`product.docs`,L),...H(`agents`,w),...H(`mobile`,[...j,...P]),...U(`mobile`,`mobile.devices`,N),...H(`desktop`,F),...H(`containers`,I),...U(`containers`,`containers.services`,z),...U(`databases`,`databases`,B),...H(`integrations`,[E]),...T.flatMap(e=>e.fields.map(t=>({section:e.group===`tools`?`mcp`:`integrations`,label:`${e.name}: ${t.label}`,key:[...e.base,t.key].join(`.`)}))),{section:`integrations`,label:`Post results back`,key:`sources.write_back`},{section:`integrations`,label:`Which system an id is in`,key:`sources.id_routes`},{section:`integrations`,label:`Remote browser grids`,key:`browser.providers`},{section:`models`,label:`Models file`,key:`llm.models_file`},{section:`models`,label:`Profile in use`,key:`llm.active`},{section:`routing`,label:`Routing`,key:`llm.routing`},{section:`routing`,label:`Routing strategy`,key:`llm.strategy`},{section:`routing`,label:`Fall back to a working model`,key:`llm.fallback`},{section:`routing`,label:`An agent's own model`,key:`llm.agents`},{section:`routing`,label:`Areas of work`,key:`llm.routes`},{section:`environments`,label:`Environments file`,key:`environments.file`},{section:`environments`,label:`Environments folder`,key:`environments.dir`},{section:`environments`,label:`Active environment`,key:`environments.default`},{section:`signins`,label:`Sign-ins`,key:`logins`},{section:`notifications`,label:`Teams and email channels`,key:`notify.channels`},{section:`notifications`,label:`Where reports are published`,key:`notify.report_url`},{section:`appearance`,label:`Logo`,key:`theme.logo`},{section:`appearance`,label:`Small logo`,key:`theme.logo_mark`},{section:`appearance`,label:`Logo frame`,key:`theme.logo_frame`},{section:`appearance`,label:`Logo size`,key:`theme.logo_size`},{section:`appearance`,label:`Icon style`,key:`theme.icon_style`},{section:`appearance`,label:`Icons (3D, Phosphor, Solar or Lucide)`,key:`theme.icon_set`},{section:`appearance`,label:`Icon colour`,key:`theme.icon_colour`},{section:`appearance`,label:`Agents (robots, characters or icons)`,key:`theme.mascot`},{section:`appearance`,label:`Agent colours`,key:`theme.mascot_colours`},{section:`appearance`,label:`Name beside the logo`,key:`theme.name`},{section:`appearance`,label:`Sidebar colour (primary)`,key:`theme.primary`},{section:`appearance`,label:`Sidebar gradient`,key:`theme.gradient`},{section:`appearance`,label:`Buttons and highlights colour (secondary)`,key:`theme.secondary`},{section:`appearance`,label:`Page background`,key:`theme.background`},{section:`mcp`,label:`MCP servers`,key:`mcp`},{section:`monitor`,label:`Monitor checks, schedule and alerts`,key:`monitor`},{section:`monitor`,label:`Monitor alerts by Teams or email`,key:`monitor.alerts`},{section:`skills`,label:`Skills`,key:`skills`},{section:`tokenomics`,label:`Spending budgets`,key:`budget`},{section:`about`,label:`Version and updates`,key:`forgeqe update`},{section:`about`,label:`Guides: docs, architecture`,key:`forgeqe docs`},{section:`report`,label:`Report a problem in ForgeQE (raise a bug)`,key:`forgeqe bug report`},{section:`notifications`,label:`Send a test notification`,key:`forgeqe notify test`},{section:`agents`,label:`Agent names`,key:`agent.names`},{section:`agents`,label:`ForgeQE's name (rename the app)`,key:`agent.app_name`},{section:`evidence`,label:`Check the agent's domain knowledge`,key:`forgeqe eval domain`},{section:`generated`,label:`Generated code still in the repository`,key:`forgeqe generated`}];export{_ as C,R as S,j as _,h as a,A as b,I as c,N as d,L as f,T as g,y as h,k as i,B as l,b as m,w as n,E as o,x as p,O as r,g as s,W as t,F as u,P as v,z as w,v as x,D as y};
@@ -1,3 +1,3 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Lr as t,rr as n}from"./line-icons-rdF8DYDJ.js";import{t as r}from"./jsx-runtime-LKYXHABd.js";import{A as i,j as a,tt as o}from"./input-CtzK50ZF.js";import{a as s,d as c,f as l,i as u,n as d,s as f}from"./filters-CnAMr286.js";import{Bt as p,Fn as m,In as h,It as g,Vt as _,zt as v}from"./index-B3JsM7tv.js";var y=e(t(),1),b=r(),x={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 Miner for test data`,`Asked Miner for test data`,`thinking`],fetch:[`Fetching the request again`,`Fetched the request again`,`searching`],ask:[`Asking Miner`,`Asked Miner`,`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 S(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(``),[i,a]=(0,y.useState)(!1),s=(0,y.useCallback)(()=>{o.view().then(e=>{t(e),r(``)},e=>r(e.message))},[]);(0,y.useEffect)(s,[s]);let c=!!e?.job?.running;return(0,y.useEffect)(()=>{if(!c)return;let e=h(s,1e3);return()=>m(e)},[c,s]),{view:e,error:n,busy:i||c,running:c,act:async(e,t)=>{a(!0),r(``);try{await o.run(e,t),s()}catch(e){r(e.message)}finally{a(!1)}},stop:()=>void o.stop().then(s),load:s,job:e?.job??null}}var C=e=>e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e);function w({file:e,onNote:t}){return(0,b.jsx)(`button`,{type:`button`,"data-tip":e,onClick:async()=>t(await f(e)),className:i(l({size:`sm`}),`font-mono text-[13px]`),children:e.split(/[\\/]/).pop()})}function T({children:e,label:t}){return(0,b.jsx)(`pre`,{"aria-label":t,className:`m-0 max-h-[320px] overflow-auto rounded-[12px] bg-surface-muted p-4 font-mono text-[13px] leading-relaxed whitespace-pre text-ink-2`,children:e})}function E({job:e,onStop:t,words:r}){let[i,o,l]=(r??x)[e.kind]??[`Working`,`Done`,`working`],u=(0,y.useRef)(null);(0,y.useEffect)(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[e.lines.length]);let d=e.exitCode===0,f=!d&&(e.kind===`check`||e.kind===`trace`)&&e.result!==void 0&&!e.result.error;return(0,b.jsxs)(`section`,{"aria-label":e.running?i:o,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,b.jsxs)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:[e.running?i:o,e.target?(0,b.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,e.target]}):null]}),(0,b.jsx)(s,{tone:e.running?`running`:d?`pass`:e.exitCode===2||f?`warn`:`fail`,orb:l,children:e.running?`Working`:d?`Done`:f?`Some broken`:e.exitCode===2?`Not done`:`Failed`}),e.running&&(0,b.jsxs)(c,{variant:`danger`,onClick:t,children:[(0,b.jsx)(n,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,b.jsxs)(`details`,{open:e.running||!d&&!e.result,children:[(0,b.jsxs)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:[`Output (`,a(e.lines.length,`line`),`)`]}),(0,b.jsx)(`code`,{className:`mt-2 block font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.command}),(0,b.jsx)(`pre`,{ref:u,className:`mt-2 max-h-[240px] overflow-auto rounded-[10px] bg-surface-muted p-4 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:e.lines.join(`
2
- `)||`Starting…`})]})]})}function D({text:e}){return(0,b.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e})}function O({columns:e,rows:t}){let n=e.map((e,n)=>t.length>0&&t.every(e=>e[n]===null||e[n]===void 0||typeof e[n]==`number`)&&t.some(e=>typeof e[n]==`number`));return(0,b.jsx)(g,{label:`Rows`,resetKey:t,head:e.map((e,t)=>(0,b.jsx)(`th`,{scope:`col`,className:n[t]?p:v,children:e},e)),children:t.map((e,t)=>(0,b.jsx)(`tr`,{className:_,children:e.map((e,t)=>(0,b.jsx)(`td`,{"data-tip":C(e),className:i(`px-4 py-2 font-mono text-[13px]`,n[t]?`text-right whitespace-nowrap tabular-nums`:`max-w-[320px] truncate`,e==null&&`text-muted`),children:C(e)},t))},t))})}function k({r:e}){return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(e.order||[]).map(t=>{let n=e.preview?.[t],r=n?.sample||[],i=r.length?Object.keys(r[0]):[];return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsxs)(`span`,{className:`text-sm`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:t}),` · `,a(e.rows?.[t]??0,`row`),n?.database_fills?.length?(0,b.jsxs)(`span`,{className:`text-muted`,children:[` · the database fills `,n.database_fills.join(`, `)]}):null,e.masked?.[t]?.length?(0,b.jsxs)(`span`,{className:`text-muted`,children:[` · masked `,e.masked[t].join(`, `)]}):null]}),i.length>0&&(0,b.jsx)(O,{columns:i,rows:r.slice(0,3).map(e=>i.map(t=>e[t]))})]},t)}),(e.warnings||[]).map((e,t)=>(0,b.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:e},t))]})}var A={query:`Existing rows`,generate:`New rows`};function j({r:e,onNote:t}){let n=Object.entries(e.rows||{});return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(s,{tone:`pass`,children:A[e.kind||``]||`Answered`}),(0,b.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,b.jsx)(M,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`span`,{className:`text-sm font-medium`,children:`The query, as the database checked it`}),(0,b.jsx)(T,{label:`SQL`,children:e.sql})]}),e.script_preview&&e.script_preview.length>0&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script for these rows, not run`}),(0,b.jsx)(T,{label:`INSERT script`,children:e.script_preview.join(`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Hr as t,sr as n}from"./route-Dg53WdFu.js";import{t as r}from"./jsx-runtime-LKYXHABd.js";import{A as i,j as a,tt as o}from"./input-C2vQ9O3a.js";import{a as s,d as c,f as l,i as u,n as d,s as f}from"./filters-C7phIFfd.js";import{Bt as p,Hn as m,It as h,Un as g,Vt as _,zt as v}from"./index-YGWJEkAT.js";var y=e(t(),1),b=r(),x={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 Miner for test data`,`Asked Miner for test data`,`thinking`],fetch:[`Fetching the request again`,`Fetched the request again`,`searching`],ask:[`Asking Miner`,`Asked Miner`,`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 S(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(``),[i,a]=(0,y.useState)(!1),s=(0,y.useCallback)(()=>{o.view().then(e=>{t(e),r(``)},e=>r(e.message))},[]);(0,y.useEffect)(s,[s]);let c=!!e?.job?.running;return(0,y.useEffect)(()=>{if(!c)return;let e=g(s,1e3);return()=>m(e)},[c,s]),{view:e,error:n,busy:i||c,running:c,act:async(e,t)=>{a(!0),r(``);try{await o.run(e,t),s()}catch(e){r(e.message)}finally{a(!1)}},stop:()=>void o.stop().then(s),load:s,job:e?.job??null}}var C=e=>e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e);function w({file:e,onNote:t}){return(0,b.jsx)(`button`,{type:`button`,"data-tip":e,onClick:async()=>t(await f(e)),className:i(l({size:`sm`}),`font-mono text-[13px]`),children:e.split(/[\\/]/).pop()})}function T({children:e,label:t}){return(0,b.jsx)(`pre`,{"aria-label":t,className:`m-0 max-h-[320px] overflow-auto rounded-[12px] bg-surface-muted p-4 font-mono text-[13px] leading-relaxed whitespace-pre text-ink-2`,children:e})}function E({job:e,onStop:t,words:r}){let[i,o,l]=(r??x)[e.kind]??[`Working`,`Done`,`working`],u=(0,y.useRef)(null);(0,y.useEffect)(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[e.lines.length]);let d=e.exitCode===0,f=!d&&(e.kind===`check`||e.kind===`trace`)&&e.result!==void 0&&!e.result.error;return(0,b.jsxs)(`section`,{"aria-label":e.running?i:o,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,b.jsxs)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:[e.running?i:o,e.target?(0,b.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,e.target]}):null]}),(0,b.jsx)(s,{tone:e.running?`running`:d?`pass`:e.exitCode===2||f?`warn`:`fail`,orb:l,children:e.running?`Working`:d?`Done`:f?`Some broken`:e.exitCode===2?`Not done`:`Failed`}),e.running&&(0,b.jsxs)(c,{variant:`danger`,onClick:t,children:[(0,b.jsx)(n,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,b.jsxs)(`details`,{open:e.running||!d&&!e.result,children:[(0,b.jsxs)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:[`Output (`,a(e.lines.length,`line`),`)`]}),(0,b.jsx)(`code`,{className:`mt-2 block font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.command}),(0,b.jsx)(`pre`,{ref:u,className:`mt-2 max-h-[240px] overflow-auto rounded-[10px] bg-surface-muted p-4 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:e.lines.join(`
2
+ `)||`Starting…`})]})]})}function D({text:e}){return(0,b.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e})}function O({columns:e,rows:t}){let n=e.map((e,n)=>t.length>0&&t.every(e=>e[n]===null||e[n]===void 0||typeof e[n]==`number`)&&t.some(e=>typeof e[n]==`number`));return(0,b.jsx)(h,{label:`Rows`,resetKey:t,head:e.map((e,t)=>(0,b.jsx)(`th`,{scope:`col`,className:n[t]?p:v,children:e},e)),children:t.map((e,t)=>(0,b.jsx)(`tr`,{className:_,children:e.map((e,t)=>(0,b.jsx)(`td`,{"data-tip":C(e),className:i(`px-4 py-2 font-mono text-[13px]`,n[t]?`text-right whitespace-nowrap tabular-nums`:`max-w-[320px] truncate`,e==null&&`text-muted`),children:C(e)},t))},t))})}function k({r:e}){return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(e.order||[]).map(t=>{let n=e.preview?.[t],r=n?.sample||[],i=r.length?Object.keys(r[0]):[];return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsxs)(`span`,{className:`text-sm`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:t}),` · `,a(e.rows?.[t]??0,`row`),n?.database_fills?.length?(0,b.jsxs)(`span`,{className:`text-muted`,children:[` · the database fills `,n.database_fills.join(`, `)]}):null,e.masked?.[t]?.length?(0,b.jsxs)(`span`,{className:`text-muted`,children:[` · masked `,e.masked[t].join(`, `)]}):null]}),i.length>0&&(0,b.jsx)(O,{columns:i,rows:r.slice(0,3).map(e=>i.map(t=>e[t]))})]},t)}),(e.warnings||[]).map((e,t)=>(0,b.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:e},t))]})}var A={query:`Existing rows`,generate:`New rows`};function j({r:e,onNote:t}){let n=Object.entries(e.rows||{});return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(s,{tone:`pass`,children:A[e.kind||``]||`Answered`}),(0,b.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,b.jsx)(M,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`span`,{className:`text-sm font-medium`,children:`The query, as the database checked it`}),(0,b.jsx)(T,{label:`SQL`,children:e.sql})]}),e.script_preview&&e.script_preview.length>0&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script for these rows, not run`}),(0,b.jsx)(T,{label:`INSERT script`,children:e.script_preview.join(`
3
3
  `)})]}),e.files?.length?(0,b.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Kept`,e.files.map(e=>(0,b.jsx)(w,{file:e,onNote:t},e))]}):null,e.replay&&(0,b.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Tests and pipelines get the same data with `,(0,b.jsx)(`code`,{className:`font-mono text-[13px] text-ink-2`,children:e.replay}),`, without a model.`]})]})}function M({title:e,rows:t,total:n}){let r=[...new Set(t.flatMap(e=>Object.keys(e)))];return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsxs)(`span`,{className:`text-sm`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:e}),` · `,a(n,`row`),n>t.length?(0,b.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.length,` shown`]}):null]}),r.length>0?(0,b.jsx)(O,{columns:r,rows:t.map(e=>r.map(t=>e[t]))}):(0,b.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No rows match.`})]})}function N({items:e,text:t,label:n,size:r=10,children:i}){let[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)(0),l=a.toLowerCase().split(/\s+/).filter(Boolean),f=l.length?e.filter(e=>l.every(n=>t(e).toLowerCase().includes(n))):e;(0,y.useEffect)(()=>c(0),[a,e.length]);let p=Math.min(s,Math.max(0,Math.ceil(f.length/r)-1));return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.length>r&&(0,b.jsx)(u,{id:`find-${n.toLowerCase().replace(/\W+/g,`-`)}`,label:`Find in ${n.toLowerCase()}`,value:a,onChange:o,className:`flex-none`}),f.length?(0,b.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:f.slice(p*r,p*r+r).map(i)}):(0,b.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing matches.`}),f.length>r&&(0,b.jsx)(d,{page:p,size:r,total:f.length,onPage:c,label:`Pages of ${n.toLowerCase()}`})]})}export{E as a,D as c,C as d,S as f,k as i,O as l,T as n,A as o,w as r,N as s,j as t,M as u};
@@ -1,2 +1,2 @@
1
- import{t as e}from"./jsx-runtime-LKYXHABd.js";import{A as t}from"./input-CtzK50ZF.js";var n=e();function r({diff:e,className:r}){let i=0,a=0,o=e.split(`
1
+ import{t as e}from"./jsx-runtime-LKYXHABd.js";import{A as t}from"./input-C2vQ9O3a.js";var n=e();function r({diff:e,className:r}){let i=0,a=0,o=e.split(`
2
2
  `).flatMap((e,t)=>{if(/^(diff |index |--- |\+\+\+ )/.test(e))return[];let n=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(e);return n?(i=Number(n[1]),a=Number(n[2]),[{key:t,kind:`hunk`,text:e,a:``,b:``}]):e.startsWith(`+`)?[{key:t,kind:`add`,text:e.slice(1),a:``,b:String(a++)}]:e.startsWith(`-`)?[{key:t,kind:`del`,text:e.slice(1),a:String(i++),b:``}]:e.startsWith(`\\`)?[{key:t,kind:`hunk`,text:e,a:``,b:``}]:[{key:t,kind:`same`,text:e.startsWith(` `)?e.slice(1):e,a:String(i++),b:String(a++)}]});return(0,n.jsx)(`div`,{className:t(`max-h-[420px] overflow-auto rounded-[10px] border border-line-soft bg-bg font-mono text-[13px] leading-[1.6]`,r),children:(0,n.jsx)(`table`,{className:`w-full border-collapse`,children:(0,n.jsx)(`tbody`,{children:o.map(e=>(0,n.jsxs)(`tr`,{className:e.kind===`add`?`bg-pass-soft`:e.kind===`del`?`bg-fail-soft`:e.kind===`hunk`?`bg-surface-muted`:void 0,children:[(0,n.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.a}),(0,n.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.b}),(0,n.jsx)(`td`,{"aria-hidden":`true`,className:t(`w-4 align-top select-none`,e.kind===`add`?`text-pass`:e.kind===`del`?`text-fail`:`text-muted`),children:e.kind===`add`?`+`:e.kind===`del`?`−`:``}),(0,n.jsxs)(`td`,{className:t(`pr-4 align-top whitespace-pre`,e.kind===`hunk`?`text-muted`:`text-ink`),children:[(0,n.jsx)(`span`,{className:`sr-only`,children:e.kind===`add`?`added: `:e.kind===`del`?`removed: `:``}),e.text||` `]})]},e.key))})})})}export{r as t};
@@ -1 +1 @@
1
- import{r as e}from"./route-BloYJWgw.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:`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{t as n,n as t};
1
+ import{r as e}from"./route-Dg53WdFu.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:`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{t as n,n as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$t as t,At as n,Bt as r,C as i,D as a,Dn as o,En as s,Et as c,Fn as l,Fr as u,Gn as d,Gt as f,Hn as p,Hr as m,Ht as h,In as g,Ir as _,J as v,Jn as y,Jt as ee,K as te,Kt as b,Ln as ne,Lr as re,Lt as x,M as S,Mr as C,Nr as w,Nt as T,O as E,Ot as D,Pn as O,Pt as k,Q as A,Qn as j,Qt as M,Rr as ie,Rt as N,S as P,Sn as F,T as I,Tn as L,Tt as ae,U as R,Vn as oe,Vt as se,W as z,X as B,Xt as V,Y as H,Yn as ce,Yt as le,Z as ue,Zn as de,_ as fe,_n as pe,_r as me,a as he,ar as ge,b as _e,bt as ve,cn as ye,dn as be,dr as xe,dt as Se,en as Ce,er as we,ft as Te,g as Ee,gn as De,gt as Oe,h as ke,hr as Ae,ht as je,ir as Me,it as Ne,j as Pe,jr as Fe,kt as Ie,lr as Le,m as Re,mn as ze,mr as Be,mt as Ve,nn as He,nr as Ue,o as We,on as Ge,ot as Ke,p as qe,pn as Je,q as Ye,qn as Xe,qt as Ze,rn as Qe,rr as $e,rt as et,s as tt,tr as nt,tt as rt,ut as it,v as at,vn as ot,vr as st,w as ct,wr as lt,wt as ut,xn as dt,xt as ft,yn as pt,yr as mt,zt as ht}from"./route-Dg53WdFu.js";import{t as gt}from"./jsx-runtime-LKYXHABd.js";import{A as U,M as _t,c as vt,d as yt,lt as bt,t as xt}from"./input-C2vQ9O3a.js";var W=e(m(),1),G=gt(),St=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ct=_t,wt=((e,t)=>n=>{if(t?.variants==null)return Ct(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=St(t)||St(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ct(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)})(`inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap font-medium no-underline transition-colors disabled:cursor-not-allowed disabled:opacity-50`,{variants:{variant:{outline:`rounded-[8px] border border-line-strong bg-surface-strong text-ink hover:bg-line hover:text-ink`,primary:`rounded-[8px] border border-accent bg-accent text-accent-ink hover:border-accent-hover hover:bg-accent-hover hover:text-accent-ink`,danger:`rounded-[8px] border border-line-strong bg-surface-strong text-fail hover:bg-fail-soft hover:text-fail`,destructive:`rounded-[8px] border border-fail bg-fail text-bg hover:opacity-90 hover:text-bg`,ghost:`rounded-[8px] border-0 bg-transparent text-ink hover:bg-surface-strong`,icon:`rounded-[8px] border-0 bg-transparent text-ink-2 hover:bg-surface-strong hover:text-ink`},size:{default:`min-h-10 px-4 text-sm [&>svg]:size-4 [&>svg]:flex-none`,lg:`min-h-11 px-6 text-sm [&>svg]:size-4 [&>svg]:flex-none`,sm:`min-h-8 px-4 text-[13px] [&>svg]:size-3.5 [&>svg]:flex-none`,icon:`size-10 [&>svg]:size-4`,"icon-sm":`size-8 [&>svg]:size-4`}},defaultVariants:{variant:`outline`,size:`default`}});function Tt({className:e,variant:t,size:n,type:r=`button`,...i}){return(0,G.jsx)(`button`,{type:r,className:U(wt({variant:t,size:n}),e),...i})}var Et=new Map([[he,`accessibility`],[We,`history`],[tt,`web`],[qe,`branch`],[Ee,`feature`],[fe,`knowledge-base`],[at,`knowledge-base`],[_e,`container`],[P,`architecture`],[i,`bug`],[ct,`speed`],[I,`history`],[a,`report`],[R,`stories`],[z,`stories`],[te,`cloud`],[Ye,`code`],[v,`code`],[H,`coins`],[B,`columns`],[A,`container`],[rt,`server`],[et,`database`],[Ne,`database`],[Ke,`download`],[it,`visual`],[Se,`report`],[Te,`report`],[Ve,`code`],[je,`code`],[Oe,`file`],[ve,`table`],[ft,`stories`],[ut,`warning`],[ae,`flask`],[c,`folder`],[D,`folder`],[Ie,`folder`],[n,`folder`],[T,`visual`],[k,`branch`],[x,`branch`],[N,`web`],[ht,`feature`],[r,`wrench`],[se,`pulse`],[h,`history`],[f,`screenshot`],[b,`screenshot`],[Ze,`screenshot`],[ee,`inbox`],[le,`info`],[V,`key`],[M,`desktop`],[t,`layers`],[Ce,`board`],[He,`info`],[Qe,`sparkle`],[Ge,`stories`],[ye,`layers`],[be,`key`],[Je,`mail`],[ze,`web`],[De,`chat`],[pe,`stories`],[ot,`chat`],[pt,`mic`],[dt,`desktop`],[F,`mobile`],[L,`network`],[s,`replay`],[o,`palette`],[O,`coins`],[l,`replay`],[g,`plug`],[ne,`plug`],[oe,`replay`],[p,`rocket`],[d,`route`],[Xe,`visual`],[y,`scroll`],[de,`mail`],[j,`server`],[we,`feature`],[nt,`shield`],[Ue,`route`],[$e,`mobile`],[Me,`sparkle`],[ge,`sparkle`],[Le,`board`],[xe,`terminal`],[Be,`table`],[Ae,`mobile`],[me,`terminal`],[st,`ticket`],[mt,`history`],[lt,`warning`],[Fe,`coins`],[C,`wand`],[w,`wand`],[u,`plug`],[_,`network`],[re,`wrench`],[Re,`bell`],[ke,`bell`],[ue,`route`]]);function Dt({icon:e,size:t=16,className:n,label:r}){let i=Et.get(e);if(i){let e=yt(i);if(e)return(0,G.jsx)(vt,{src:e,name:i,px:t+2,alt:r||``,className:n})}return(0,G.jsx)(e,{size:t,strokeWidth:1.8,"aria-hidden":!r||void 0,"aria-label":r,className:n})}var Ot={idle:[`default`,`blink`],working:[`default`,`gyro`],reasoning:[`default`,`twins`],searching:[`default`,`lighthouse`],background:[`default`,`spiral`],retrying:[`default`,`surge`],compacting:[`default`,`squeeze`,`fuse`],waiting:[`default`],using:[`default`,`tap`,`scroll`,`type`,`zoom`,`snap`,`record`]},K=Math.PI*2,kt=Math.PI*(3-Math.sqrt(5)),q=e=>(1-Math.cos(Math.PI*e))/2,J=e=>{let t=Math.sin(e*127.1)*43758.5453;return t-Math.floor(t)},At=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,jt=(e,t,n)=>{let r=[],i=[],a=e[t];for(let o=0;o<e.length;o++){if(o===t)continue;let s=At(a,e[o]),c=r.length;if(c===n){if(s>=i[n-1])continue;c--}for(;c>0&&i[c-1]>s;)r[c]=r[c-1],i[c]=i[c-1],c--;r[c]=o,i[c]=s}return r},Mt={idle:6500,"idle-blink":13e3,working:3e3,"working-gyro":3e3,reasoning:6500,"reasoning-twins":6500,searching:13e3,"searching-lighthouse":13e3,background:13e3,"background-spiral":13e3,retrying:13e3,"retrying-surge":13e3,compacting:1e4,"compacting-squeeze":1e4,"compacting-fuse":1e4,waiting:13e3,using:13e3,"using-tap":13e3,"using-scroll":13e3,"using-type":13e3,"using-zoom":13e3,"using-snap":13e3,"using-record":13e3},Nt=new Map;function Pt(e,t,n){let r=Nt.get(e);return r||Nt.set(e,r={t:0,last:t}),t>r.last&&(r.t+=Math.min(t-r.last,100)*n,r.last=t),r.t}var Ft=e=>1-Math.exp(-4.5*e)*Math.cos(3*Math.PI*e)-e*Math.exp(-4.5);function It(e,t){let n=3200,r=Math.floor(e/n),i=e-r*n,a=1260*t,o=2200*t,s;if(i<2e3)s=i*t;else if(i<2200){let e=(i-2e3)/200;s=(2e3+200*(e-e*e/2))*t}else if(i<3e3)s=2100*t-a*Ft((i-2200)/800);else{let e=(i-3e3)/200;s=2100*t-a+100*e*e*t}return r*(o-a)+s}function Lt(e,t){if(e===`retrying`)return It(2*t,K/9e3);if(e===`retrying-surge`){let e=t/3250,n=e-Math.floor(e);return(Math.floor(e)+(1-(1-n)**3))*K}return e===`using-scroll`?.4:e===`using-snap`?(Math.floor(t/X)*dn+Math.min(t%X,dn))/Mt[e]*K:t/Mt[e]*K}var Rt=(()=>{let e=30*Math.PI/180,t=10*Math.PI/180;return[-Math.sin(t)*Math.cos(e),Math.cos(t)*Math.cos(e),Math.sin(e)]})(),zt=1.4,Bt=30*Math.PI/180,Vt=Math.PI/2,Ht=1800,Ut=.4,Wt=.6;function Gt(e){let t=e*2.45+J(e)*1.5,n=(15+30*J(e+.5))*Math.PI/180;return[Math.sin(n)*Math.cos(t),Math.sin(n)*Math.sin(t),Math.cos(n)]}function Kt(e){let t=Math.floor(e/Ht),n=e/Ht-t,r=n<Ut?(1-Math.cos(n/Ut*Math.PI))/2:1,i=Gt(t),a=Gt(t+1),o=i.map((e,t)=>e+(a[t]-e)*r),s=Math.hypot(o[0],o[1],o[2]);return o.map(e=>e/s)}var qt=.45,Jt=.5,Yt=600,Xt=e=>Gt(e+57),Zt=(e,t,n)=>{let r=e.map((e,r)=>e+(t[r]-e)*n),i=Math.hypot(r[0],r[1],r[2]);return r.map(e=>e/i)},Qt=(e,t)=>e<t?(1-(e/t)**2)**2:0,$t=1400;function en(e){let t=Math.floor(e/$t),n=e/$t-t;return{at:Zt(Xt(t),Xt(t+1),n<.35?q(n/.35):1),click:Xt(n<.5?t:t+1),since:(n<.5?n+.5:n-.5)*$t}}var tn=e=>e<60?e/60:Math.max(0,1-(e-60)/240)**2,nn=1,rn=[[0,0],[0,16],[4,12],[7,18],[9,17],[6,11],[11,11]].map(([e,t])=>[e/18*nn,t/18*nn]);function an(e,t,n){let r=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){let[o,s]=e[i],[c,l]=e[a];s>n!=l>n&&t<(c-o)*(n-s)/(l-s)+o&&(r=!r)}return r}var Y=[-.3,.5],on=(e,t)=>[e,t,Math.sqrt(Math.max(0,1-e*e-t*t))],sn=e=>on(Y[0]+.35*e[0],Y[1]+.35*e[1]),cn=1800;function ln(e,t){let n=e%cn/cn,r=n<.3?q(n/.3):n<.6?1:n<.85?1-q((n-.6)/.25):0,i=e=>on(Y[0]+.3*e*Math.cos(t),Y[1]+.3*e*Math.sin(t));return{at:i(r),click:i(1),since:(n<.45?n+.55:n-.45)*cn}}var un=2600,X=2600,dn=2100;function fn(e){let t=e%X-dn;return t<0?0:Math.exp(-t/220)}function pn(e){let t=e%X;return t<120?1.2*(1-q(t/120)):t<180?0:t<430?1.2*q((t-180)/250):1.2}var mn=1200,hn=e=>Math.abs(1-2*(e%mn/mn));function gn(e){let t=e%un/un;return t<.25?q(t/.25):t<.5?1:t<.75?1-q((t-.5)/.25):0}var _n=1500,vn=1.1;function yn(e){let t=Math.floor(e/_n),n=Math.min(1,(e/_n-t)/.75);return{by:(t+1-(1-n)**3)*vn,pace:(1-n)**2}}var bn={right:0,"up-right":45,up:90,"up-left":135,left:180,"down-left":225,down:270,"down-right":315},Z=[90,270,45,180,0,225].map(e=>e*Math.PI/180);function xn(e,t){let n=-Math.sin(e),r=Math.cos(e),i=Math.sin(t),a=Math.cos(t),o=1-a;return[a+n*n*o,n*r*o,r*i,n*r*o,a+r*r*o,-n*i,-r*i,n*i,a]}var Sn=(e,t)=>e.map((n,r)=>e[r-r%3]*t[r%3]+e[r-r%3+1]*t[r%3+3]+e[r-r%3+2]*t[r%3+6]),Q=[`xxxx xxx xx`,`xxxxx xx xxxx`,`xxx xxxxx`],Cn=.09,wn=.3,Tn=.33,En=-.5,$=(()=>{let e=0;return Q.flatMap((t,n)=>[...t].map((r,i)=>{let a={row:n,col:i,at:e};return e+=r===` `?200:i===t.length-1?350:70+60*J(n*31+i),a}))})(),Dn=Q.map((e,t)=>$.flatMap((e,n)=>e.row===t?[n]:[])),On=$[$.length-1].at,kn=On+1300;function An(e){let t=e%kn,n=0;for(;n<$.length&&$[n].at<=t;)n++;let r=n?t-$[n-1].at:1/0,i=$[n]??{row:Q.length-1,col:Q[Q.length-1].length},a=r<300?1:+(Math.floor(t/450)%2==0);return{n,since:r,blink:a,caret:[En+i.col*Cn,Tn-i.row*wn],fade:t<On+900?1:Math.max(0,1-(t-On-900)/300)}}var jn=220,Mn=5,Nn=24,Pn=16,Fn={mount:({make:e,pts:t})=>{let n=t.map(()=>e(`circle`)),r=new Uint8Array(t.length);return{dot(e,t,i,a,o){let s=n[e],c=o.toFixed(2);c===`0.00`&&r[e]||(r[e]=+(c===`0.00`),s.setAttribute(`cx`,t.toFixed(2)),s.setAttribute(`cy`,i.toFixed(2)),s.setAttribute(`r`,Math.max(.45,a).toFixed(2)),s.setAttribute(`fill-opacity`,c))}}}};function In(e){let t=(e,t)=>[Math.cos(e)*Math.cos(t),Math.sin(e),Math.cos(e)*Math.sin(t)],n=Math.sqrt(4*Math.PI/e),r=.6*n;return Array.from({length:8},(e,i)=>{let a=i?i&-i:8,o=Math.min(85*Math.PI/180,Math.acos(Math.min(1,n*8/(K*a)))),s=[];for(let e=-o+i*.618%1*r;e<=o;e+=r/Math.sqrt(1+Math.cos(e)**2))s.push(t(e,i/8*K-e));return s}).flat()}function Ln(e,t,n){return n?n.points(t,e):e===`background-spiral`?In(t):Array.from({length:t},(e,n)=>{let r=1-2*(n+.5)/t,i=Math.sqrt(1-r*r),a=n*kt;return[i*Math.cos(a),r,i*Math.sin(a)]})}function Rn(e,{state:t,variant:n,size:r=20,speed:i=1,label:a,shape:o,render:s=Fn,density:c=1,dotSize:l=1,tilt:u=20,direction:d}={}){let f=t===`base`?`idle`:t,p=f&&Object.hasOwn(Ot,f)?f:`idle`,m=n!=="default"&&Ot[p].includes(n??``)?`${p}-${n}`:p,h={width:r,height:r,viewBox:`0 0 ${r} ${r}`,fill:`currentColor`};for(let[t,n]of Object.entries(h))e.setAttribute(t,String(n));a?(e.setAttribute(`role`,`img`),e.setAttribute(`aria-label`,a),e.removeAttribute(`aria-hidden`)):(e.setAttribute(`aria-hidden`,`true`),e.removeAttribute(`role`),e.removeAttribute(`aria-label`));let g=m===`background`?1:m===`using`||m===`using-type`?Math.max(4,1e3/r):4,_=Math.max(8,Math.round(r*g*c)),v=typeof o==`function`?{points:o}:o,y=r/2,ee=y*.8*(v?.scale??1),te=(r/64)**.6*(.72*Math.sqrt(4/g))*l,b=Ln(m,_,v),ne=s.mount({make:t=>e.appendChild(document.createElementNS(`http://www.w3.org/2000/svg`,t)),pts:b,size:r,radius:te}),re=!!s.flat,x=(m===`reasoning`||m===`reasoning-twins`)&&b.length>1,S=m===`compacting`||m===`compacting-fuse`,C=x?b.map((e,t)=>jt(b,t,Nn)):[],w=Array.from({length:m===`reasoning-twins`?2:1},()=>[]),T=0,E={k:0,m:[1,0,0,0,1,0,0,0,1]},D=e=>{let t=Mt[m],n=Lt(m,e),i=m===`using-scroll`?yn(e):null,a=d&&bn[d],o=null;if(i&&a!==void 0)o=xn(a*Math.PI/180+Math.PI,i.by);else if(i){let t=Math.floor(e/_n);for(t<E.k&&(E={k:0,m:[1,0,0,0,1,0,0,0,1]});E.k<t;E.k++)E.m=Sn(xn(Z[E.k%Z.length],vn),E.m);o=Sn(xn(Z[t%Z.length],i.by-t*vn),E.m)}let s=m===`working-gyro`?e/5e3*K:null,c=((re?0:u)+(v?.tip??0)+(s===null?0:10*Math.cos(s)))*Math.PI/180,l=s===null?0:12*Math.sin(s)*Math.PI/180,f=Math.sin(l),p=Math.cos(l),h=Math.sin(n),g=Math.cos(n),_=Math.sin(c),D=Math.cos(c),O=e=>b[e][1]*_+(-b[e][0]*h+b[e][2]*g)*D,k=new Map;if(x){let t=e/jn,n=Math.floor(t),r=t-n;if(!w[0].length){let e=[...b.keys()].reduce((e,t)=>O(t)>O(e)?t:e,0),t=t=>O(t)+At(b[t],b[e]);w.forEach((n,r)=>n.push(r?[...b.keys()].reduce((e,n)=>t(n)>t(e)?n:e,0):e))}for(T=Math.max(T,n-Pn);T<n;T++)w.forEach((e,t)=>{let n=e.slice(-8),r=e[e.length-1],i=-1,a=-1/0,o=m===`reasoning-twins`?w[1-t].at(-1):void 0;C[r].forEach((e,r)=>{let s=o===void 0?0:1.2*Math.min(Math.sqrt(At(b[e],b[o])),.8),c=O(e)+.35*J(T*31+r+t*977)+s;!n.includes(e)&&c>a&&(a=c,i=e)}),e.push(i<0?C[r][0]:i),e.length>Pn&&e.shift()});let i=(e,t)=>e!==void 0&&k.set(e,Math.max(k.get(e)??0,t));for(let e of w)for(let t=4;t>=0;t--)i(e[e.length-1-t],t===0?q(Math.min(1,r*2)):1-(t-1+r)/Mn)}let A=e/2e3*K+n,j=K/2e3+K/t,M=e=>70*Math.PI/180*(1-2*(e%6e3/6e3)),ie=Math.min(1,3*Math.sin(Math.PI*(e%6e3/6e3))),N=m===`searching`?Kt(e):null,P=m===`working-gyro`?.5*Math.sin(e/2600*K):m===`compacting-squeeze`?Math.sin(e/2600*K):0,F=null;if(S){let t=e%2800/2800,n=(t-.7)/.3,r=m===`compacting-fuse`?(1-n)**3:n<.45?1-1.25*q(n/.45):n<.7?-.25*(1-(n-.45)/.25)**2:0;F={at:-1.15+2.3*Math.min(1,t/.7),hold:t<.7?1:r}}let I=null;m===`using-tap`&&(I=en(e));let L=m===`using`;if(L){let t=a===void 0?en(e):null;I=t?{...t,at:sn(t.at),click:sn(t.click)}:ln(e,(a??0)*Math.PI/180)}let ae=L&&I?1-.15*tn(I.since):1,R=m===`using-type`?An(e):null,oe=m===`using-zoom`?gn(e):null,se=m===`using-snap`?fn(e):null,z=m===`idle-blink`?pn(e):null,B=m===`using-record`?hn(e):null;b.forEach(([t,a,s],c)=>{let u=n+zt*P*a,[d,v]=P?[Math.sin(u),Math.cos(u)]:[h,g],b=-t*d+s*v,S=t*v+s*d,C=a*D-b*_,w=b,T=S*_,E=a*_+b*D;o&&([S,C,E]=[0,3,6].map(e=>o[e]*S+o[e+1]*C+o[e+2]*E));let O=(E+1)/2,V=(.5+1.4*O)*te,H=Math.max(0,(O-.3)/.7);if(N){let e=Math.acos(Math.min(1,(S*N[0]+C*N[1]+E*N[2])/Math.hypot(S,C,E))),t=e<Wt?(1-(e/Wt)**2)**2:0;H*=1-.55*(1-t),r<=24&&(V*=1+.5*t),t&&(S*=1+.12*t,C*=1+.12*t,S+=(S-N[0])*.35*t,C+=(C-N[1])*.35*t,V*=1+.9*t,H+=(1-H)*t)}if(F){let e=S,t=Math.min(1,Math.max(0,(F.at-e)/.2))*F.hold,n=m===`compacting`?1.5:1;if(S*=1-.2*n*t,C*=1-.2*n*t,V*=1-.3*n*t,m===`compacting-fuse`){H*=1-.5*t;let n=Math.exp(-(((e-F.at)/.08)**2))*Math.max(0,F.hold)*Math.min(1,O/.5);V*=1+.8*n,H+=(1-H)*n}}if(m===`working`){let t=e%1700,n=1.3-2.6*q(Math.min(1,t/1200)),r=re?C:S*Rt[0]+C*Rt[1]+E*Rt[2],i=t<1200?Math.exp(-(((r-n)/.2)**2)):0;V*=1+.6*i,H+=(1-H)*i;let a=Math.min(1,Math.max(0,(r-n)/.2))*(t<1200?1:1-Math.min(1,1.6*((t-1200)/800)));S*=1-.08*a,C*=1-.08*a,V*=1-.15*a}if(m===`searching-lighthouse`){H*=.5;let t=Math.sin(Bt),n=Math.cos(Bt),r=S*n-C*t,i=-_*(S*t+C*n)+D*E,a=((Math.atan2(r,i)-(e/2500%1*K-Math.PI)+Math.PI)%K+K)%K-Math.PI,o=(a<0?Math.max(0,1+a/Vt):Math.exp(-((a/.45)**2)))*(.25+.75*Math.min(1,Math.max(0,(O-.4)/.3)));V*=1+.6*o,H+=(1-H)*o}if(x){let e=k.get(c)??0;H*=.5,e&&(V*=1+.8*e,H+=(1-H)*e)}if(m===`waiting`){let n=Math.asin(a/(Math.hypot(t,a,s)||1)),r=Math.atan2(s,t),i=Math.atan2(Math.sin(r-A),Math.cos(r-A)),o=i*Math.cos(n),c=Math.exp(-(((n-M(e+i/j))/.28)**2))*Math.exp(-((o/(i*j>0?.12:1))**2)),l=ie*c**.6;H=H*.5+(1-H*.5)*l,V*=1+1.1*l}if(I){let e=Math.hypot(S,C,E)||1,t=t=>Math.acos(Math.min(1,Math.max(-1,(S*t[0]+C*t[1]+E*t[2])/e)));H*=L?.25:.5;let n=I.since,r=L?0:Qt(t(I.at),qt),i=t(I.click),a=tn(n),o=a*Qt(i,Jt),s=Math.min(1,n/Yt),c=Math.exp(-(((i-(.15+1.3*(1-(1-s)**2)))/.18)**2))*(1-s)**2;if(S*=1-.14*o,C*=1-.14*o,V*=(1-.35*o)*(1+.7*Math.max(c,r*(1-a))),H+=(1-H)*Math.max(r,c),L&&an(rn,(S-I.at[0])/ae,(I.at[1]-C)/ae)){let e=Math.min(1,Math.max(0,(O-.5)/.2));V*=1+.15*e,H+=(1-H)*e}}if(R){H*=.25;let e=Math.round((Tn-C)/wn),t=Math.floor((S-En)/Cn),n=Dn[e]?.[t],r=0;n!==void 0&&n<R.n&&Q[e][t]===`x`&&Math.abs(Tn-e*wn-C)<.085&&(r=.75+(n===R.n-1?.25*Math.exp(-R.since/120):0));let[i,a]=R.caret;Math.abs(C-a)<.1&&(r=Math.max(r,R.blink*Math.exp(-(((S-i)/.04)**2)))),H+=(1-H)*r*R.fade*Math.min(1,Math.max(0,(O-.5)/.2))}if(oe){let e=oe*Math.max(0,E);S*=1+.45*e,C*=1+.45*e,V*=1+.8*e,H*=Math.min(1,Math.max(0,(1.05-Math.hypot(S,C))/.1))}if(i&&(H*=.55+.45*i.pace),se!==null&&(H*=.55,V*=1+.25*se,H+=(1-H)*se),z!==null){let e=Math.exp(-(((Math.abs(C)-z)/.06)**2))*+(z<1.2);H*=Math.min(1,Math.max(0,(z-Math.abs(C))/.08)),V*=1+.4*e,H+=(1-H)*e*Math.min(1,Math.max(0,(O-.4)/.3))}B!==null&&(S*=.92+.08*B,C*=.92+.08*B,H*=.3+.7*B),l&&([S,C]=[S*p-C*f,S*f+C*p]),ne.dot(c,y+S*ee,y-C*ee,V,H,w,-T)}),ne.frame?.()},O=`${m}@${i}`;D(Pt(O,performance.now(),i));let k=matchMedia(`(prefers-reduced-motion: reduce)`).matches,A=!1,j=0,M=!1,ie=new IntersectionObserver(e=>A=e[e.length-1].isIntersecting);ie.observe(e);function N(e){A&&D(Pt(O,e,i)),j=requestAnimationFrame(N)}let P=()=>{cancelAnimationFrame(j),j=0},F=()=>{j||k||M||(j=requestAnimationFrame(N))};return F(),{pause:P,play:F,destroy(){M=!0,P(),ie.disconnect(),e.replaceChildren()}}}function zn({state:e,variant:t,size:n=20,speed:r=1,paused:i=!1,label:a,shape:o,render:s,density:c,dotSize:l,tilt:u,direction:d,className:f}){let p=(0,W.useRef)(null),m=(0,W.useRef)(null);(0,W.useEffect)(()=>(m.current=Rn(p.current,{state:e,variant:t,size:n,speed:r,label:a,shape:o,render:s,density:c,dotSize:l,tilt:u,direction:d})).destroy,[e,t,n,r,a,o,s,c,l,u,d]),(0,W.useEffect)(()=>{i?m.current.pause():m.current.play()},[i,e,t,n,r,a,o,s,c,l,u,d]);let h=a?{role:`img`,"aria-label":a}:{"aria-hidden":!0};return(0,G.jsx)(`svg`,{ref:p,width:n,height:n,viewBox:`0 0 ${n} ${n}`,fill:`currentColor`,className:f,...h})}var Bn={thinking:{state:`reasoning`},searching:{state:`searching`},reading:{state:`searching`,variant:`lighthouse`},working:{state:`working`},writing:{state:`working`,variant:`gyro`},browsing:{state:`using`,variant:`tap`},recording:{state:`using`,variant:`record`},handing:{state:`background`},retrying:{state:`retrying`},compacting:{state:`compacting`},waiting:{state:`waiting`},idle:{state:`idle`}};function Vn({state:e=`working`,label:t,px:n=16,className:r}){return(0,G.jsx)(zn,{...Bn[e],size:n,label:t,className:U(`block flex-none text-ink`,r)})}async function Hn(e,t=bt.open){let n=window.open(`about:blank`,`_blank`);try{let r=await t(e);if(r.kind===`download`){n?.close();let e=document.createElement(`a`);return e.href=r.url,e.download=r.name,e.click(),``}return n?(n.opener=null,n.location.href=r.url,``):`The browser blocked the new tab.`}catch(e){return n?.close(),e.message}}function Un({icon:e,title:t,children:n,action:r,center:i=!1,className:a}){return(0,G.jsxs)(`div`,{role:`status`,className:U(`flex flex-col gap-2 py-6`,i?`items-center text-center`:`items-start`,a),children:[e&&(0,G.jsx)(Dt,{icon:e,size:22,className:`mb-1 text-muted`}),t&&(0,G.jsx)(`p`,{className:`m-0 text-[16px] font-medium text-ink`,children:t}),n&&(0,G.jsx)(`div`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:n}),r&&(0,G.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:r})]})}var Wn={pass:`bg-pass-soft text-pass`,fail:`bg-fail-soft text-fail`,warn:`bg-warn-soft text-warn`,running:`bg-accent-soft text-accent-fg`,neutral:`bg-surface-strong text-ink-2`},Gn={pass:E,fail:ie,warn:lt};function Kn({tone:e,children:t,className:n,icon:r=!0,orb:i=`working`}){let a=r?Gn[e]:void 0,o=r&&e===`running`;return(0,G.jsxs)(`span`,{className:U(`inline-flex min-h-6 items-center gap-1 rounded-full px-2 text-xs font-medium whitespace-nowrap`,(a||o)&&`pl-2`,Wn[e],n),children:[o&&(0,G.jsx)(Vn,{state:i,px:16}),a&&(0,G.jsx)(a,{size:12,strokeWidth:2.5,"aria-hidden":`true`,className:`flex-none`}),t]})}function qn({id:e,label:t,value:n,onChange:r,placeholder:i,className:a}){return(0,G.jsxs)(`div`,{className:U(`relative min-w-0 w-full max-w-[320px] flex-[0_1_320px]`,a),children:[(0,G.jsx)(ce,{size:14,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-muted`}),(0,G.jsx)(`label`,{htmlFor:e,className:`sr-only`,children:t}),(0,G.jsx)(xt,{size:`sm`,id:e,type:`search`,value:n,onChange:e=>r(e.target.value),placeholder:i??t,className:`pl-8`})]})}function Jn({items:e,value:t,onChange:n}){return(0,G.jsx)(G.Fragment,{children:e.map(e=>(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":t===e.id,"data-tip":e.tip,onClick:()=>n(e.id),className:U(`inline-flex min-h-8 cursor-pointer items-center gap-1 rounded-[8px] border px-4 text-[13px] font-medium`,t===e.id?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:bg-line hover:text-ink`),children:[e.icon&&(0,G.jsx)(Dt,{icon:e.icon,size:14}),e.label,e.n!==void 0&&(0,G.jsx)(`span`,{className:U(`tabular-nums`,e.alert&&e.n?`text-fail`:``),children:e.n})]},e.id))})}function Yn({items:e,value:t,onChange:n,className:r}){return(0,G.jsx)(G.Fragment,{children:e.map(e=>{let i=t.includes(e.id);return(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":i,"data-tip":e.title,onClick:()=>n(i?t.filter(t=>t!==e.id):[...t,e.id]),className:U(`inline-flex min-h-9 cursor-pointer items-center gap-2 rounded-[8px] border px-4 text-[13px] font-medium`,i?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:bg-line`,r),children:[i&&(0,G.jsx)(E,{size:14,"aria-hidden":`true`}),e.label,e.note&&(0,G.jsx)(`span`,{className:U(`text-[13px] font-normal`,e.noteClass),children:e.note})]},e.id)})})}function Xn({page:e,size:t,total:n,onPage:r,label:i,children:a}){let o=Math.max(1,Math.ceil(n/t));return(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 border-t border-line-soft px-4 py-2 text-[13px] text-muted`,children:[(0,G.jsxs)(`span`,{className:`flex-1`,children:[n?`${e*t+1}–${Math.min(n,e*t+t)} of ${n}`:`None`,a]}),o>1&&(0,G.jsxs)(`nav`,{"aria-label":i,className:`flex items-center gap-1`,children:[(0,G.jsx)(Tt,{size:`sm`,variant:`ghost`,disabled:e===0,onClick:()=>r(e-1),"aria-label":`Previous page`,"data-tip":`Previous page`,children:(0,G.jsx)(Pe,{"aria-hidden":`true`})}),(0,G.jsxs)(`span`,{className:`px-1 tabular-nums`,children:[`Page `,e+1,` of `,o]}),(0,G.jsx)(Tt,{size:`sm`,variant:`ghost`,disabled:e>=o-1,onClick:()=>r(e+1),"aria-label":`Next page`,"data-tip":`Next page`,children:(0,G.jsx)(S,{"aria-hidden":`true`})})]})]})}export{Kn as a,Vn as c,Tt as d,wt as f,qn as i,Dt as l,Xn as n,Un as o,Yn as r,Hn as s,Jn as t,Et as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Hr as n}from"./route-Dg53WdFu.js";import{t as r}from"./jsx-runtime-LKYXHABd.js";import{A as i}from"./input-C2vQ9O3a.js";import{Vn as a}from"./index-YGWJEkAT.js";var o=e(n(),1),s=r();function c({title:e,children:n,defaultOpen:r}){let[c,l]=(0,o.useState)(!!r),u=(0,o.useId)();return(0,s.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,s.jsxs)(`button`,{type:`button`,"aria-expanded":c,"aria-controls":u,onClick:()=>l(!c),className:`inline-flex min-h-8 cursor-pointer items-center gap-2 self-start rounded-[8px] border-0 bg-transparent px-1 text-sm font-medium text-ink hover:bg-surface-strong`,children:[(0,s.jsx)(t,{size:15,"aria-hidden":`true`,className:i(`transition-transform`,c&&`rotate-180`)}),e]}),(0,s.jsx)(a,{open:c,id:u,children:n})]})}export{c as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./route-Dg53WdFu.js";import{l as t}from"./agents-C0Jg2pN8.js";import{t as n}from"./jsx-runtime-LKYXHABd.js";import{i as r,in as i,o as a}from"./index-YGWJEkAT.js";var o=n();function s({tab:n,wide:s,action:c,agentBody:l,children:u}){let d=t(`migration`);return(0,o.jsx)(r,{title:i(`migration`),page:d,label:`Migration`,current:n,onPick:t=>location.hash=t===`agent`?e(`migration`):e(`migration`,`migrations`),tabs:[{id:`migrations`,label:`Migrations`}],below:(0,o.jsx)(a,{page:d}),...l===void 0?{}:{agentBody:l},...s?{wide:s}:{},...c?{end:c}:{},children:u})}export{s as t};