@capagents/forgeqe 2.9.0 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/HOW_TO_USE.md +250 -22
  2. package/dist/docs-site/docs/desktop/index.html +45 -1
  3. package/dist/docs-site/docs/index.html +261 -4
  4. package/dist/docs-site/docs/search.js +1 -1
  5. package/dist/forgeqe.js +1671 -1623
  6. package/dist/web/assets/Agent-BNWcLTrm.js +4 -0
  7. package/dist/web/assets/ApiTests-CZFzjMKc.js +10 -0
  8. package/dist/web/assets/Browse-CeiK4X_V.js +2 -0
  9. package/dist/web/assets/{Chat-BcFP0BbA.js → Chat-BqXSNxV2.js} +3 -3
  10. package/dist/web/assets/CommandPalette-VSEzjRS1.js +1 -0
  11. package/dist/web/assets/Compare-Bjh-qB8C.js +1 -0
  12. package/dist/web/assets/Cost-BRtni21m.js +1 -0
  13. package/dist/web/assets/Data-Bzn351xU.js +6 -0
  14. package/dist/web/assets/Evidence-eM1ZsFF-.js +1 -0
  15. package/dist/web/assets/{Explore-Dw8S6DG1.js → Explore-D07Qbzyq.js} +2 -2
  16. package/dist/web/assets/Features-DFwuL5cN.js +1 -0
  17. package/dist/web/assets/Flags-pxSAu21R.js +2 -0
  18. package/dist/web/assets/Flaky-BdfqCR6j.js +1 -0
  19. package/dist/web/assets/ForceGraph-DC7NzeR4.js +1 -0
  20. package/dist/web/assets/Impact-CfnvrPzq.js +3 -0
  21. package/dist/web/assets/Jobs-CIKpgvcv.js +5 -0
  22. package/dist/web/assets/KindPage-OyYE9NU7.js +6 -0
  23. package/dist/web/assets/Migration-BQA6MOPN.js +2 -0
  24. package/dist/web/assets/Product-DNe8RV_H.js +7 -0
  25. package/dist/web/assets/Production-ClEiFS1u.js +1 -0
  26. package/dist/web/assets/Quality-BZnQcbb2.js +1 -0
  27. package/dist/web/assets/Readiness-Dk2KZZm4.js +1 -0
  28. package/dist/web/assets/Record-CSapdwkr.js +2 -0
  29. package/dist/web/assets/Regression-C7bZ5sSE.js +5 -0
  30. package/dist/web/assets/Reports-BWtgbiVp.js +2 -0
  31. package/dist/web/assets/{Response-DGl2R0A-.js → Response-DyvlQXek.js} +2 -2
  32. package/dist/web/assets/RunDiff-DWV5qdHx.js +1 -0
  33. package/dist/web/assets/{Runs-CkNWhAhe.js → Runs-CET6zwQu.js} +2 -2
  34. package/dist/web/assets/Steps-DUG1BKJb.js +2 -0
  35. package/dist/web/assets/TestCases-DyicRSqL.js +1 -0
  36. package/dist/web/assets/TestData-D2aWG3dq.js +2 -0
  37. package/dist/web/assets/TestDebt-DobUiGTz.js +1 -0
  38. package/dist/web/assets/Tosca-DvTni6va.js +3 -0
  39. package/dist/web/assets/WhatsNew-B3xewvk5.js +1 -0
  40. package/dist/web/assets/dataParts-rU9wRwfo.js +3 -0
  41. package/dist/web/assets/families-DWrv-fcS.js +1 -0
  42. package/dist/web/assets/filters-BDJYWuRV.js +1 -0
  43. package/dist/web/assets/fold-BgITvJex.js +1 -0
  44. package/dist/web/assets/frame-Dn34zQXO.js +4 -0
  45. package/dist/web/assets/index-BiMUTOBo.js +45 -0
  46. package/dist/web/assets/index-CGfii-zv.css +2 -0
  47. package/dist/web/assets/logos-C067hMmF.js +1 -0
  48. package/dist/web/assets/palette-Br50dJuQ.js +1 -0
  49. package/dist/web/assets/parts-CbA0h_uO.js +1 -0
  50. package/dist/web/assets/productParts-BxQnjrHo.js +1 -0
  51. package/dist/web/assets/qualityParts-Cn74cNyX.js +1 -0
  52. package/dist/web/assets/rows-X8lfgK8j.js +1 -0
  53. package/dist/web/assets/segmented-mcjXGwLg.js +1 -0
  54. package/dist/web/assets/{thread-BeaLQ_f4.js → thread-Bamx8xqR.js} +2 -2
  55. package/dist/web/assets/usePageChat-B-vpiXQ6.js +1 -0
  56. package/dist/web/index.html +4 -3
  57. package/docs/DESKTOP.md +48 -1
  58. package/docs/user-guide.html +261 -4
  59. package/package.json +1 -1
  60. package/prompts/README.md +1 -0
  61. package/prompts/impact-reader.md +8 -9
  62. package/prompts/tosca-assistant.md +47 -0
  63. package/prompts/tosca.md +3 -1
  64. package/py/forgeqe_desktop/agentdesktop_driver.py +57 -7
  65. package/py/forgeqe_desktop/handhooks.py +71 -22
  66. package/py/forgeqe_desktop/handrecord.py +7 -1
  67. package/py/forgeqe_desktop/heal.py +24 -2
  68. package/py/forgeqe_desktop/memory.py +54 -4
  69. package/py/forgeqe_desktop/pywinauto_driver.py +210 -12
  70. package/py/forgeqe_desktop/replay.py +10 -2
  71. package/py/forgeqe_desktop/service.py +9 -2
  72. package/py/forgeqe_desktop/ufo_runner.py +101 -1
  73. package/py/forgeqe_mobile/service.py +4 -1
  74. package/py/forgeqe_tosca/__init__.py +11 -1
  75. package/py/forgeqe_tosca/app.py +168 -0
  76. package/py/forgeqe_tosca/db.py +131 -0
  77. package/py/forgeqe_tosca/files.py +74 -0
  78. package/py/forgeqe_tosca/ntir.py +357 -5
  79. package/py/forgeqe_tosca/render.py +38 -0
  80. package/py/forgeqe_tosca/tsu.py +110 -0
  81. package/skills/tosca-knowledge/SKILL.md +14 -3
  82. package/skills/tosca-knowledge/references/api.md +54 -0
  83. package/dist/web/assets/Agent-BGwHbXbc.js +0 -4
  84. package/dist/web/assets/ApiTests-DSnZHRlF.js +0 -10
  85. package/dist/web/assets/Browse-Dx3pHGuG.js +0 -2
  86. package/dist/web/assets/CommandPalette-v6mqHZnU.js +0 -1
  87. package/dist/web/assets/Cost-C9LZdx1p.js +0 -1
  88. package/dist/web/assets/Data-DvbaOc9e.js +0 -6
  89. package/dist/web/assets/Evidence-Y1AeSzh5.js +0 -1
  90. package/dist/web/assets/Features-CjrVraBE.js +0 -1
  91. package/dist/web/assets/Flags-C_Qm0078.js +0 -2
  92. package/dist/web/assets/Flaky-DYgN586D.js +0 -1
  93. package/dist/web/assets/ForceGraph-CEH86-Z0.js +0 -1
  94. package/dist/web/assets/Impact-dBPp7aM2.js +0 -3
  95. package/dist/web/assets/Jobs-CSyN6YRx.js +0 -5
  96. package/dist/web/assets/KindPage-BQl-5bcd.js +0 -6
  97. package/dist/web/assets/Migration-COly7O-T.js +0 -2
  98. package/dist/web/assets/Product-7mM8tcxH.js +0 -7
  99. package/dist/web/assets/Production-De5CCUoP.js +0 -1
  100. package/dist/web/assets/Quality-Q_iqj3fk.js +0 -1
  101. package/dist/web/assets/Readiness-kU9kum_I.js +0 -1
  102. package/dist/web/assets/Record-CIhINuEz.js +0 -2
  103. package/dist/web/assets/Regression-CMQnH7dN.js +0 -5
  104. package/dist/web/assets/Reports-dUOe6_vN.js +0 -2
  105. package/dist/web/assets/RunDiff-BVRRIz3m.js +0 -1
  106. package/dist/web/assets/TestCases-exR7hRWd.js +0 -1
  107. package/dist/web/assets/TestData-yVPMg9kw.js +0 -2
  108. package/dist/web/assets/TestDebt-C3sM6cH0.js +0 -1
  109. package/dist/web/assets/Tosca-Bcalg1JU.js +0 -2
  110. package/dist/web/assets/WhatsNew-EFSt6xx2.js +0 -1
  111. package/dist/web/assets/dataParts-D33u08WR.js +0 -3
  112. package/dist/web/assets/families-Btjss8bN.js +0 -1
  113. package/dist/web/assets/frame-D3IhgCFt.js +0 -4
  114. package/dist/web/assets/index-D5sya6FK.css +0 -2
  115. package/dist/web/assets/index-v-k_CVn7.js +0 -45
  116. package/dist/web/assets/logos-CfpaNwbY.js +0 -1
  117. package/dist/web/assets/palette-X7hU78Wy.js +0 -1
  118. package/dist/web/assets/parts-B7YrlR3a.js +0 -1
  119. package/dist/web/assets/productParts-CAxyMnWJ.js +0 -1
  120. package/dist/web/assets/qualityParts-CN9JVKZN.js +0 -1
  121. package/dist/web/assets/rows-IEP4Jvfi.js +0 -1
  122. package/dist/web/assets/segmented-DBqHvZW3.js +0 -1
  123. package/dist/web/assets/usePageChat-D_3KsqBU.js +0 -1
@@ -1,2 +0,0 @@
1
- import{Ar as e,C as t,D as n,Fr as r,Ir as i,Mn as a,Nr as o,Q as s,Qn as c,T as l,a as u,it as d,ln as f,pr as p,tt as m,yt as h}from"./line-icons-CQ-3V8ax.js";import{$ as g,Pn as _,Pt as v,Rn as y,Rt as b,Sn as x,_n as S,at as C,bn as w,dt as T,et as E,gt as D,ht as O,nt as k,ot as A,r as j,rt as M,t as ee,tt as te,ut as ne,vr as N,wt as P,xn as F,yn as I}from"./frame-D3IhgCFt.js";import{r as L}from"./index-v-k_CVn7.js";import{n as re}from"./segmented-DBqHvZW3.js";import{a as ie,c as R,f as z,i as B,n as V,o as H,r as U,s as W,t as G,u as K}from"./dataParts-D33u08WR.js";var q=r({Requests:()=>Q,TestData:()=>$}),J=i(o(),1),Y=N(),X=[`requests`,`kept`,`specs`,`batches`],Z={fetch:`kept`,request:`requests`,gen:`specs`,files:`specs`,insert:`specs`,batches:`batches`,clean:`batches`},ae=e=>Object.values(e.row_counts||{}).reduce((e,t)=>e+t,0);function oe({e,kept:t,busy:n,act:r}){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 px-1 py-2`,children:[(0,Y.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-[13px]`,children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:`Asked for`}),(0,Y.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:e.need}),(0,Y.jsx)(`dt`,{className:`text-muted`,children:`When`}),(0,Y.jsxs)(`dd`,{className:`m-0`,children:[new Date(e.at).toLocaleString(),e.ms===void 0?``:` · answered in ${(e.ms/1e3).toFixed(1)} s`]}),(0,Y.jsx)(`dt`,{className:`text-muted`,children:`How`}),(0,Y.jsxs)(`dd`,{className:`m-0`,children:[e.source===`fetch`?`A kept request fetched again, with no model`:`Asked the DB agent for ${e.asked===`existing`?`existing rows`:e.asked===`new`?`new rows`:`either`}`,e.name?(0,Y.jsxs)(Y.Fragment,{children:[` · `,(0,Y.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.name})]}):null]}),e.why&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:`The answer`}),(0,Y.jsx)(`dd`,{className:`m-0`,children:e.why})]})]}),e.error&&(0,Y.jsx)(R,{text:e.error}),Object.entries(e.sample||{}).map(([t,n])=>(0,Y.jsx)(K,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:`The query`}),(0,Y.jsx)(V,{label:`SQL`,children:e.sql})]}),e.script_preview?.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script`}),(0,Y.jsx)(V,{label:`INSERT script`,children:e.script_preview.join(`
2
- `)})]}):null,t&&e.name&&(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(I,{size:`sm`,disabled:n,onClick:()=>r(`fetch`,{name:e.name}),"data-tip":`Fetch again`,children:[(0,Y.jsx)(a,{"aria-hidden":`true`}),`Refresh`]})})]})}function Q({view:e,log:t,busy:r,act:i}){let[a,o]=(0,J.useState)(`all`),[s,c]=(0,J.useState)(``),[u,d]=(0,J.useState)(``),[p,m]=(0,J.useState)(``),_=t??[],v=(0,J.useMemo)(()=>[...new Set(_.map(e=>e.requester))].sort(),[t]),y=(0,J.useMemo)(()=>[...new Set(_.map(e=>e.database).filter(Boolean))].sort(),[t]),x=_.filter(e=>!e.ok).length,S=_.filter(e=>(a===`all`||a===`ok`===e.ok)&&(!s||e.requester===s)&&(!u||e.database===u)),j=new Set(e.requests.map(e=>e.name));return t===null?(0,Y.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading the requests…`}):_.length?(0,Y.jsx)(g,{label:`Requests`,resetKey:`${a}|${s}|${u}`,minWidth:760,fixed:!0,placeholder:`Find a request`,tools:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{value:a,onChange:o,items:[{id:`all`,label:`All`,n:_.length},{id:`ok`,label:`Answered`,n:_.length-x},{id:`failed`,label:`Failed`,n:x,alert:!0}]}),v.length>1&&(0,Y.jsxs)(T,{size:`sm`,"aria-label":`Who asked`,value:s,onChange:e=>c(e.target.value),className:`w-[180px]`,children:[(0,Y.jsx)(`option`,{value:``,children:`Anyone`}),v.map(e=>(0,Y.jsx)(`option`,{children:e},e))]}),y.length>1&&(0,Y.jsxs)(T,{size:`sm`,"aria-label":`Database`,value:u,onChange:e=>d(e.target.value),className:`w-[160px]`,children:[(0,Y.jsx)(`option`,{value:``,children:`Any database`}),y.map(e=>(0,Y.jsx)(`option`,{children:e},e))]})]}),head:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`th`,{className:F(k,`w-9`),children:(0,Y.jsx)(`span`,{className:`sr-only`,children:`Open`})}),(0,Y.jsx)(`th`,{className:F(k,`w-[110px]`),children:`When`}),(0,Y.jsx)(`th`,{className:F(k,`w-[150px]`),children:`Who asked`}),(0,Y.jsx)(`th`,{className:k,children:`What for`}),(0,Y.jsx)(`th`,{className:F(k,`w-[110px]`),children:`Database`}),(0,Y.jsx)(`th`,{className:F(k,`w-[140px]`),children:`Answer`}),(0,Y.jsx)(`th`,{className:F(M,`w-[70px]`),children:`Rows`})]}),empty:`No requests match these filters. Pick All and Anyone to see every request.`,children:S.map(e=>{let t=p===e.id;return(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsxs)(`tr`,{className:F(C,t&&`bg-surface-muted`),onClick:()=>m(t?``:e.id),children:[(0,Y.jsx)(`td`,{className:F(E,`pr-0`),children:(0,Y.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":t?`Close the request`:`Open the request`,onClick:n=>(n.stopPropagation(),m(t?``:e.id)),className:`flex cursor-pointer items-center border-0 bg-transparent p-0 text-muted`,children:t?(0,Y.jsx)(l,{size:16,"aria-hidden":`true`}):(0,Y.jsx)(n,{size:16,"aria-hidden":`true`})})}),(0,Y.jsx)(`td`,{className:F(E,`whitespace-nowrap text-muted`),"data-tip":new Date(e.at).toLocaleString(),children:L(e.at)}),(0,Y.jsx)(`td`,{className:F(E,`truncate`),"data-tip":e.requester,children:e.requester}),(0,Y.jsxs)(`td`,{className:F(E,`truncate`),"data-tip":e.need,children:[e.need,e.source===`fetch`?(0,Y.jsx)(`span`,{className:`text-muted`,children:` · fetched again`}):null]}),(0,Y.jsx)(`td`,{className:F(E,`truncate`),"data-tip":e.database,children:e.database||(0,Y.jsx)(`span`,{className:`text-muted`,children:`—`})}),(0,Y.jsx)(`td`,{className:F(E,`whitespace-nowrap`),children:(0,Y.jsx)(O,{tone:e.ok?`pass`:`fail`,children:e.ok?H[e.kind||``]||`Answered`:`Failed`})}),(0,Y.jsx)(`td`,{className:te,children:e.ok?ae(e):``})]}),t&&(0,Y.jsx)(`tr`,{className:`border-t border-line-soft bg-surface-muted/40`,children:(0,Y.jsx)(`td`,{colSpan:7,className:`max-w-0 px-4 py-2`,children:(0,Y.jsx)(oe,{e,kept:!!e.name&&j.has(e.name),busy:r,act:i})})})]},e.id)})}):(0,Y.jsx)(D,{icon:h,title:`No test data asked for yet`,action:(0,Y.jsxs)(`a`,{href:b(`data`,`ask`,`test-data`),"data-tip":`Ask for test data`,className:F(w({size:`sm`}),`no-underline`),children:[(0,Y.jsx)(f,{"aria-hidden":`true`}),`Ask`]}),children:`The agents ask before a test runs, or you can ask yourself.`})}function se({view:e,job:t,busy:n,act:r,onNote:i}){let o=t&&!t.running&&t.kind===`fetch`?t:null,s=o?.result;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`Each request is kept in test-data/requests with its query or INSERT script. Fetch one again to get the same data with no model: a query reads the rows there now, a spec makes the same rows.`}),o&&(0,Y.jsxs)(`section`,{"aria-label":`Fetched ${o.target}`,className:`flex flex-col gap-3 rounded-[14px] card border p-4`,children:[(0,Y.jsx)(`h2`,{className:`m-0 text-base font-semibold [overflow-wrap:anywhere]`,children:o.target}),s&&!s.ok&&(0,Y.jsx)(R,{text:s.error||`It could not fetch the data.`}),s?.ok&&(0,Y.jsx)(G,{r:s,onNote:i})]}),e.requests.length===0?(0,Y.jsxs)(D,{className:`py-3`,children:[`No kept requests yet. Each request the DB agent answers is kept here; `,(0,Y.jsx)(`a`,{href:b(`data`,`ask`,`test-data`),children:`ask for test data`}),` to make the first.`]}):(0,Y.jsx)(W,{items:e.requests,text:e=>`${e.need} ${e.name} ${e.database} ${e.requester||``}`,label:`Kept requests`,size:15,children:e=>(0,Y.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-3 border-t border-line-soft py-2.5 text-sm first:border-t-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`text-[14px] font-medium [overflow-wrap:anywhere]`,children:e.need}),(0,Y.jsxs)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:[(0,Y.jsx)(`span`,{className:`font-mono`,children:e.name}),` · `,e.database,` · `,H[e.kind],e.rows?` · ${x(e.rows,`row`)}`:``,e.created?` · ${L(e.created)}`:``,e.requester?` · asked by ${e.requester}`:``]})]}),(0,Y.jsx)(I,{size:`icon`,variant:`icon`,disabled:n,onClick:()=>r(`fetch`,{name:e.name}),"aria-label":`Fetch ${e.name} again`,"data-tip":`Fetch ${e.name} again`,className:`size-8`,children:(0,Y.jsx)(a,{"aria-hidden":`true`})})]},e.name)})]})}function ce({view:t,job:n,busy:r,act:i,onNote:a}){let[o,c]=(0,J.useState)(t.specs[0]??``),[l,u]=(0,J.useState)(``),[p,g]=(0,J.useState)(``),[v,y]=(0,J.useState)(`csv`),[x,C]=(0,J.useState)(!1),w={spec:o,...l?{db:l}:{},...p?{seed:p}:{}},E=n&&!n.running?n:null,O=E&&[`gen`,`files`,`insert`].includes(E.kind)&&E.target===o?E.result:void 0,k=t.databases.find(e=>e.name===l),A=async()=>{try{let{id:e}=await _.start(`Write a test data spec for this project (a YAML file with tables: under test-data/), from the database's schema. Show me the spec and a preview before you save it.`,{});location.hash=b(`chats`,e)}catch(e){a(e.message)}};return(0,Y.jsxs)(`section`,{"aria-labelledby":`spec-h`,className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Y.jsxs)(`h2`,{id:`spec-h`,className:`m-0 flex flex-1 items-center gap-2 text-lg font-semibold`,children:[(0,Y.jsx)(S,{icon:h,size:18,className:`text-accent-fg`}),`Make test data from a spec`]}),(0,Y.jsxs)(I,{variant:`ghost`,onClick:()=>void A(),"data-tip":`Write a spec in a chat`,children:[(0,Y.jsx)(f,{"aria-hidden":`true`}),`Chat`]})]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`A spec is a YAML file with tables: and what goes in each column. The same spec and seed make the same data again, so a test or a pipeline can rely on it. No model is used.`}),t.specs.length===0?(0,Y.jsx)(D,{className:`py-3`,children:`No specs in this project yet: a YAML file with tables: in test-data/, data/ or specs/. Write one in a chat, from a database's schema.`}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-[14px] card border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,Y.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-1.5 text-sm font-medium`,children:[`Spec`,(0,Y.jsx)(T,{value:o,onChange:e=>c(e.target.value),children:t.specs.map(e=>(0,Y.jsx)(`option`,{children:e},e))})]}),(0,Y.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-1.5 text-sm font-medium`,children:[`Database`,(0,Y.jsxs)(T,{value:l,onChange:e=>u(e.target.value),children:[(0,Y.jsx)(`option`,{value:``,children:`The spec's own`}),t.databases.map(e=>(0,Y.jsxs)(`option`,{value:e.name,children:[e.name,e.writable?``:` (read only)`]},e.name))]})]}),(0,Y.jsxs)(`label`,{className:`flex w-[120px] flex-col gap-1.5 text-sm font-medium`,children:[`Seed`,(0,Y.jsx)(ne,{value:p,inputMode:`numeric`,placeholder:`Random`,onChange:e=>g(e.target.value.replace(/\D/g,``).slice(0,9))})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(I,{variant:x?void 0:`primary`,disabled:r||!o,onClick:()=>i(`gen`,w),children:[(0,Y.jsx)(d,{"aria-hidden":`true`}),`Preview`]}),(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Y.jsxs)(I,{disabled:r||!o,onClick:()=>i(`gen`,{...w,mode:`files`,format:v}),"data-tip":`Write files (${v})`,children:[(0,Y.jsx)(m,{"aria-hidden":`true`}),`Export`]}),(0,Y.jsx)(T,{"aria-label":`File format`,value:v,onChange:e=>y(e.target.value),className:`w-[88px]`,children:[`csv`,`json`,`sql`].map(e=>(0,Y.jsx)(`option`,{children:e},e))})]}),(0,Y.jsxs)(I,{disabled:r||!o||!k?.writable,"data-tip":k?.writable?`Insert into ${k.name}`:`Pick a writable database to insert into`,onClick:()=>C(!0),children:[(0,Y.jsx)(s,{"aria-hidden":`true`}),`Insert`]})]}),x&&k&&(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Insert test data`,className:`flex flex-col gap-3 rounded-[12px] border border-warn bg-warn-soft p-4`,children:[(0,Y.jsxs)(`span`,{className:`font-medium`,children:[`Insert the rows of `,o,` into `,k.name,`?`]}),(0,Y.jsx)(`span`,{className:`text-sm text-ink-2`,children:`They go in as one batch, which you can remove again under Batches. Only on a test database.`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(I,{variant:`primary`,onClick:()=>{C(!1),i(`gen`,{...w,mode:`insert`,confirmed:!0})},children:[(0,Y.jsx)(s,{"aria-hidden":`true`}),`Insert`]}),(0,Y.jsxs)(I,{onClick:()=>C(!1),"data-tip":`Don't insert`,children:[(0,Y.jsx)(e,{"aria-hidden":`true`}),`Cancel`]})]})]}),O&&!O.ok&&(0,Y.jsx)(R,{text:O.error||`It did not make the data.`}),O?.ok&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[O.batch&&(0,Y.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Inserted as batch `,(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:O.batch}),`.`]}),O.files?.length?(0,Y.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Wrote`,O.files.map(e=>(0,Y.jsx)(U,{file:e,onNote:a},e))]}):null,(0,Y.jsx)(B,{r:O})]})]})]})}function le({view:e,job:n,busy:r,act:i}){let a=e.databases.filter(e=>e.writable),[o,s]=(0,J.useState)(a[0]?.name??``),[l,u]=(0,J.useState)(``),f=n&&!n.running?n:null,m=f?.kind===`batches`?(Array.isArray(f.result)?f.result.flatMap(e=>e.batches||[]):f.result?.batches)??[]:null;return(0,Y.jsxs)(`section`,{"aria-labelledby":`batch-h`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`h2`,{id:`batch-h`,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,Y.jsx)(S,{icon:c,size:18,className:`text-accent-fg`}),`Inserted batches`]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`Rows inserted from a spec go in as a batch. Remove a batch to take exactly those rows out again, children first.`}),a.length===0?(0,Y.jsx)(D,{className:`py-3`,children:`No writable database: test data is inserted only into one marked writable in Settings, Databases.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(T,{"aria-label":`Database`,value:o,onChange:e=>s(e.target.value),className:`w-[220px]`,children:a.map(e=>(0,Y.jsx)(`option`,{children:e.name},e.name))}),(0,Y.jsxs)(I,{disabled:r||!o,onClick:()=>i(`batches`,{db:o}),"data-tip":`List batches`,children:[(0,Y.jsx)(d,{"aria-hidden":`true`}),`Show`]})]}),m&&m.length===0&&(0,Y.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`No batches in `,f?.target,`.`]}),m&&m.length>0&&(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:m.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-3 border-t border-line-soft py-2.5 text-sm first:border-t-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.batch}),(0,Y.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[(0,Y.jsx)(`span`,{"data-tip":new Date(e.created).toLocaleString(),children:L(e.created)}),e.spec?` · ${e.spec}`:``,` ·`,` `,Object.entries(e.rows).map(([e,t])=>`${e} ${t}`).join(`, `)]})]}),l===e.batch?(0,Y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Y.jsxs)(`span`,{className:`text-[13px] text-warn`,children:[`Remove its rows from `,f?.target,`?`]}),(0,Y.jsxs)(I,{variant:`danger`,size:`sm`,onClick:()=>{u(``),i(`clean`,{db:f?.target,batch:e.batch,confirmed:!0})},children:[(0,Y.jsx)(p,{"aria-hidden":`true`}),`Remove`]}),(0,Y.jsxs)(I,{size:`sm`,onClick:()=>u(``),children:[(0,Y.jsx)(t,{"aria-hidden":`true`}),`Keep`]})]}):(0,Y.jsx)(I,{size:`icon`,variant:`icon`,disabled:r,onClick:()=>u(e.batch),"aria-label":`Remove batch ${e.batch}`,"data-tip":`Remove batch ${e.batch}`,className:`size-8`,children:(0,Y.jsx)(p,{"aria-hidden":`true`})})]},e.batch))}),f?.kind===`clean`&&f.result?.ok&&(0,Y.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Removed:`,` `,Object.entries(f.result.removed||{}).map(([e,t])=>`${e} ${t}`).join(`, `)]})]})]})}function $({sub:e}){let{view:t,error:n,busy:r,act:i,stop:a,job:o}=z(),[s,c]=(0,J.useState)(null),[l,d]=(0,J.useState)(``),p=X.includes(e)?e:`requests`,m=o&&!o.running?o.endedAt:``;(0,J.useEffect)(()=>{y.log().then(c,e=>d(e.message))},[m]);let h=(s||[]).filter(e=>!e.ok).length,g=new Set((s||[]).map(e=>e.requester)).size,_={requests:`Requests${s?` (${s.length})`:``}`,kept:`Kept${t?` (${t.requests.length})`:``}`,specs:`Specs${t?` (${t.specs.length})`:``}`,batches:`Batches`};return(0,Y.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,Y.jsx)(j,{}),(0,Y.jsxs)(`main`,{className:F(ee,`@container flex-auto gap-4`),children:[(0,Y.jsxs)(`a`,{href:b(`data`,`databases`),className:`inline-flex w-fit items-center gap-1.5 text-sm`,children:[(0,Y.jsx)(u,{size:16,"aria-hidden":`true`}),`All databases`]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Y.jsx)(v,{pixel:P[`test-data`],size:`lg`}),(0,Y.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test data`}),(0,Y.jsxs)(`a`,{href:b(`data`,`ask`,`test-data`),"data-tip":`Ask for test data`,className:F(w(),`no-underline`),children:[(0,Y.jsx)(f,{"aria-hidden":`true`}),`Ask`]})]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-[74ch] text-sm leading-relaxed text-ink-2`,children:`Every request for test data: which agent asked, what for, when, and what the DB agent sent back. Kept requests fetch the same data again with no model; specs make data you can insert as batches and remove again.`}),s&&s.length>0&&(0,Y.jsxs)(`p`,{className:`m-0 text-sm text-ink-2 tabular-nums`,children:[x(s.length,`request`),` · `,x(g,`asker`),` · `,(0,Y.jsxs)(`span`,{className:h?`text-fail`:``,children:[h,` failed`]}),t?` · ${t.requests.length} kept`:``]}),(n||l)&&(0,Y.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:n||l}),!t&&!n&&(0,Y.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(re,{label:`Test data`,current:p,onPick:e=>location.hash=b(`test-data`,e),tabs:X.map(e=>({id:e,label:_[e]}))}),o&&(o.running?Z[o.kind]!==void 0:Z[o.kind]===p)&&(0,Y.jsx)(ie,{job:o,onStop:a}),(0,Y.jsxs)(`div`,{role:`tabpanel`,id:`panel-${p}`,"aria-labelledby":`tab-${p}`,children:[p===`requests`&&(0,Y.jsx)(Q,{view:t,log:s,busy:r,act:i}),p===`kept`&&(0,Y.jsx)(se,{view:t,job:o,busy:r,act:i,onNote:d}),p===`specs`&&(0,Y.jsx)(ce,{view:t,job:o,busy:r,act:i,onNote:d}),p===`batches`&&(0,Y.jsx)(le,{view:t,job:o,busy:r,act:i})]})]})]})]})}export{q as n,Q as t};
@@ -1 +0,0 @@
1
- import{$t as e,Ir as t,J as n,L as ee,M as r,Mn as te,Nr as i,gr as a,j as o,nr as ne,o as s,vr as c}from"./line-icons-CQ-3V8ax.js";import{$ as l,Nn as u,Pn as re,Pt as d,Rt as f,bn as p,dt as m,gt as h,ot as g,r as ie,t as ae,ut as oe,vr as _,wt as se,xn as v,yn as y}from"./frame-D3IhgCFt.js";import{r as b}from"./index-v-k_CVn7.js";import{_ as x,o as S}from"./qualityParts-CN9JVKZN.js";var C=t(i(),1),w={view:()=>u(`GET`,`/api/testdebt`),refresh:()=>u(`POST`,`/api/testdebt/refresh`,{}),readCases:(e,t)=>u(`POST`,`/api/testdebt/cases`,{source:e,scope:t})},T=_(),E=[`untested`,`signal`,`duplicates`,`cases`],D={endpoint:`Endpoint`,screen:`Screen`,file:`Code file`},O={test:`Test`,recording:`Recording`,case:`Test case`},k={azure_devops:`Azure DevOps`,jira:`Jira`,xray:`Xray`,testrail:`TestRail`,zephyr:`Zephyr Scale`,qtest:`qTest`,other:`Other`},A={azure_devops:`plan=12/suite=34`,testrail:`run=7`,zephyr:`cycle=SHOP-R12`,qtest:`cycle=12`,xray:`plan=SHOP-100`},j=e=>`${Math.round(e*100)}%`,M=e=>E.includes(e)?e:`untested`;function N({part:e,what:t,action:n}){return(0,T.jsxs)(h,{icon:a,title:e.state===`empty`?`No ${t} yet`:`${t[0].toUpperCase()}${t.slice(1)}: not connected`,action:(0,T.jsxs)(`a`,{className:p({size:`sm`}),href:n.to,"data-tip":`Open ${n.label}`,children:[(0,T.jsx)(s,{"aria-hidden":`true`}),n.label]}),children:[`To see this list, set `,e.set,`.`]})}function P({text:e,tip:t}){return(0,T.jsx)(`span`,{"data-tip":t??e,className:`block truncate`,children:e})}function F({sub:t}){let[i,a]=(0,C.useState)(null),[u,_]=(0,C.useState)(``),[E,F]=(0,C.useState)(!1),[I,L]=(0,C.useState)(``),R=M(t),[z,B]=(0,C.useState)(`all`),[V,H]=(0,C.useState)(`manual`),[U,W]=(0,C.useState)(``),[G,K]=(0,C.useState)(``);(0,C.useEffect)(()=>{w.view().then(e=>{a(e),_(``)},e=>_(e.message))},[]);let q=(0,C.useCallback)(async(e,t)=>{F(!0),L(``);try{a(await e()),_(``),t&&L(t)}catch(e){_(e.message)}finally{F(!1)}},[]),ce=async e=>{if(e){F(!0);try{let{id:t}=await re.start(e,{});location.hash=f(`chats`,t)}catch(e){_(e.message),F(!1)}}},J=(e,t)=>(0,T.jsx)(y,{size:`icon`,variant:`icon`,className:`size-8`,disabled:E||!e,onClick:()=>void ce(e),"aria-label":`Draft a test for this ${t} in a chat`,"data-tip":e?`Draft a test for this ${t} in a chat`:`Its id or file is not of a plain shape, so no chat request names it: open it where it lives instead.`,children:(0,T.jsx)(ne,{"aria-hidden":`true`})}),Y=i?.sources.filter(e=>e.connected&&e.id!==`jira`)??[],X=U||Y[0]?.id||``,Z=i?.cases.filter(e=>!e.automated).length??0,le=i?.areas.filter(e=>z===`all`||e.kind===z)??[],ue=i?.cases.filter(e=>V===`all`||(V===`manual`?!e.automated:e.automated))??[],Q=`py-2 pr-3 text-right tabular-nums`,$={untested:(i?.areas.length??0)+(i?.rules.length??0),signal:(i?.quiet.length??0)+(i?.gone.length??0),duplicates:i?.duplicates.length??0,cases:Z};return(0,T.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,T.jsx)(ie,{}),(0,T.jsxs)(`main`,{className:v(ae,`@container max-w-[1320px] flex-auto gap-4`),children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,T.jsx)(d,{pixel:se[`test-debt`],size:`lg`}),(0,T.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test debt`}),i&&(0,T.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[13px] text-muted`,children:[(0,T.jsxs)(`span`,{"data-tip":x(i.at),children:[`Worked out `,b(i.at)]}),(0,T.jsxs)(y,{size:`sm`,disabled:E,onClick:()=>void q(w.refresh,`Worked out again.`),children:[(0,T.jsx)(te,{"aria-hidden":`true`}),`Refresh`]})]})]}),(0,T.jsxs)(`p`,{className:`m-0 max-w-[80ch] text-[13px] leading-relaxed text-ink-2`,children:[`What no test checks yet, and tests that tell little: code and business rules no test reaches in the `,(0,T.jsx)(`a`,{href:f(`product`),children:`product graph`}),`, tests that passed every one of their last 30 runs or whose file is gone from `,i?.repo&&i.repo!==`.`?(0,T.jsx)(`code`,{className:`font-mono text-[12.5px]`,children:i.repo}):`the test repository`,`, tests that read alike, and each test case with whether it is automated. It only reads; Draft the test asks in a chat, and nothing changes until you agree there.`]}),u&&(0,T.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:u}),!i&&!u&&(0,T.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),I&&(0,T.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2`,children:I}),i&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-6 @xl:divide-x @xl:divide-line-soft`,children:[(0,T.jsx)(S,{label:`Untested code`,value:i.graph.state===`ok`?i.areas.length:`–`,tone:i.areas.length?`text-warn`:void 0,sub:i.graph.state===`ok`?`of ${i.graph.checked} areas`:`graph not built`}),(0,T.jsx)(S,{label:`Untested rules`,value:i.rules.length,tone:i.rules.length?`text-warn`:void 0,sub:`of ${i.graph.rulesChecked} rules`}),(0,T.jsx)(S,{label:`Never fail`,value:i.quiet.length,sub:`30 passes in a row`}),(0,T.jsx)(S,{label:`Code gone`,value:i.gone.length,tone:i.gone.length?`text-fail`:void 0,sub:`of ${i.files.count} files listed`}),(0,T.jsx)(S,{label:`Near-duplicates`,value:i.duplicates.length,sub:`from ${j(i.threshold)} alike`}),(0,T.jsx)(S,{label:`Not automated`,value:Z,tone:Z?`text-warn`:void 0,sub:`of ${i.cases.length} test cases`})]}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,T.jsx)(g,{items:[{id:`untested`,label:`Untested code and rules`,n:$.untested},{id:`signal`,label:`Low-signal tests`,n:$.signal},{id:`duplicates`,label:`Near-duplicates`,n:$.duplicates},{id:`cases`,label:`Test cases`,n:$.cases}],value:R,onChange:e=>location.hash=f(`test-debt`,e)})}),i.notes.map(e=>(0,T.jsx)(`p`,{className:`m-0 text-[12.5px] text-ink-2`,children:e},e)),R===`untested`&&(0,T.jsxs)(T.Fragment,{children:[i.graph.state===`ok`?(0,T.jsx)(l,{label:`Code no test reaches`,placeholder:`Find an endpoint, screen or file`,resetKey:z,empty:i.areas.length?`Nothing matches.`:`Every endpoint, screen and code file the graph holds is reached by a test.`,tools:(0,T.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,T.jsx)(g,{items:[{id:`all`,label:`All`,n:i.areas.length},...[`endpoint`,`screen`,`file`].map(e=>({id:e,label:`${D[e]}s`,n:i.areas.filter(t=>t.kind===e).length}))],value:z,onChange:B})}),head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[34%] py-1.5 pr-3 pl-3 font-medium`,children:`Code`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Kind`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Where`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @2xl:table-cell`,children:`Used by`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:le.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(r,{size:15,"aria-label":`No test reaches it`,className:`flex-none text-warn`}),(0,T.jsx)(P,{text:e.name,tip:`${e.name} · ${e.known===`observed`?`read in the code`:`worked out from the code`}`})]})}),(0,T.jsx)(`td`,{className:`py-2 pr-3 text-[12.5px] whitespace-nowrap`,children:D[e.kind]}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 font-mono text-[12px] text-ink-2 @xl:table-cell`,children:(0,T.jsx)(P,{text:e.where})}),(0,T.jsx)(`td`,{className:v(Q,`hidden text-muted @2xl:table-cell`),children:e.users}),(0,T.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,D[e.kind].toLowerCase())})]},e.id))}):(0,T.jsx)(N,{part:i.graph,what:`product graph`,action:{label:`Product`,to:f(`product`)}}),(0,T.jsx)(l,{label:`Business rules no test checks`,placeholder:`Find a rule`,empty:i.graph.rulesChecked?`Every business rule found is checked by a test.`:`No business rules found: the product graph's rules come from the code; the knowledge folder's from a business-rules.md file.`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[46%] py-1.5 pr-3 pl-3 font-medium`,children:`Rule`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`From`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Where`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Closest test`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:i.rules.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(r,{size:15,"aria-label":`No test checks it`,className:`flex-none text-warn`}),(0,T.jsx)(P,{text:e.text,tip:e.endpoint?`${e.text} · checked by ${e.endpoint}`:e.text})]})}),(0,T.jsx)(`td`,{className:`py-2 pr-3 text-[12.5px] whitespace-nowrap`,"data-tip":e.from===`graph`?`Found in the code by forgeqe knowledge build`:`A rule of the knowledge folder, matched to tests by its words`,children:e.from===`graph`?`Code`:`Knowledge`}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 font-mono text-[12px] text-ink-2 @xl:table-cell`,children:(0,T.jsx)(P,{text:e.where})}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 text-[12.5px] text-ink-2 @2xl:table-cell`,children:e.nearest?(0,T.jsx)(P,{text:`${e.nearest.name} (${j(e.nearest.score)})`,tip:`${j(e.nearest.score)} of the rule's words are in ${e.nearest.name}`}):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`rule`)})]},e.id))})]}),R===`signal`&&(i.history.state===`ok`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(l,{label:`Tests that never fail`,placeholder:`Find a test`,empty:`No test has passed 30 runs in a row without a failure or a retry.`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[50%] py-1.5 pr-3 pl-3 font-medium`,children:`Test`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Passes`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Since`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:i.quiet.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(o,{size:15,"aria-label":`Always passed`,className:`flex-none text-muted`}),(0,T.jsx)(P,{text:e.name,tip:e.file?`${e.name} · ${e.file}`:e.name})]})}),(0,T.jsx)(`td`,{className:v(Q,`text-muted`),children:e.runs}),(0,T.jsx)(`td`,{className:`hidden py-2 pr-3 text-[12.5px] whitespace-nowrap text-muted @xl:table-cell`,"data-tip":e.since?x(e.since):void 0,children:e.since?b(e.since):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`test`)})]},e.key))}),(0,T.jsx)(l,{label:`Tests whose file is gone`,placeholder:`Find a test or file`,empty:`Every test file the history names is in the test repository (${i.files.count} files, listed by ${i.files.by===`git`?`git`:`walking the folder`}).`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`w-[40%] py-1.5 pr-3 pl-3 font-medium`,children:`Test`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`File`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Last run`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:i.gone.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(ee,{size:15,"aria-label":`Its file is gone`,className:`flex-none text-fail`}),(0,T.jsx)(P,{text:e.name})]})}),(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-3 font-mono text-[12px] text-ink-2`,children:(0,T.jsx)(P,{text:e.file})}),(0,T.jsx)(`td`,{className:`hidden py-2 pr-3 text-[12.5px] whitespace-nowrap text-muted @xl:table-cell`,"data-tip":e.last?x(e.last):void 0,children:e.last?b(e.last):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`test`)})]},e.key))})]}):(0,T.jsx)(N,{part:i.history,what:`test history`,action:{label:`Regression`,to:f(`regression`)}})),R===`duplicates`&&(0,T.jsx)(l,{label:`Tests that read alike`,placeholder:`Find a test, recording or case`,empty:`No two tests, recordings or test cases share ${j(i.threshold)} of their words (${i.compared} pairs compared).`,head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 text-right font-medium`,children:`Alike`}),(0,T.jsx)(`th`,{className:`w-[30%] py-1.5 pr-3 font-medium`,children:`First`}),(0,T.jsx)(`th`,{className:`w-[30%] py-1.5 pr-3 font-medium`,children:`Second`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Shared words`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:i.duplicates.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:v(Q,`pl-3`,e.score>=.85?`text-warn`:`text-muted`),children:(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,T.jsx)(n,{size:14,"aria-hidden":`true`}),j(e.score)]})}),[e.a,e.b].map((e,t)=>(0,T.jsxs)(`td`,{className:`max-w-0 py-2 pr-3`,children:[(0,T.jsx)(P,{text:e.name,tip:`${O[e.kind]}: ${e.name}${e.where?` · ${e.where}`:``}`}),(0,T.jsx)(`span`,{className:`block text-[12px] text-muted`,children:O[e.kind]})]},t)),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 text-[12.5px] text-ink-2 @2xl:table-cell`,children:(0,T.jsx)(P,{text:e.shared.join(`, `)})}),(0,T.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`pair`)})]},`${e.a.kind}:${e.a.key}|${e.b.kind}:${e.b.key}`))}),R===`cases`&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,T.jsx)(`span`,{className:`text-[13px] font-medium`,children:`Test management`}),(0,T.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:i.sources.map(e=>(0,T.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[e.connected?(0,T.jsx)(o,{size:15,"aria-label":`Connected`,className:`flex-none text-pass`}):(0,T.jsx)(r,{size:15,"aria-label":`Not connected`,className:`flex-none text-muted`}),(0,T.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,T.jsx)(`span`,{className:`text-ink-2`,children:e.connected?e.scopes.length?e.scopes.map(e=>`${e.scope}: ${e.cases} read ${b(e.at)}`).join(` · `):e.id===`jira`?`connected: its cases show once ForgeQE has indexed or automated them`:`connected`:`not connected: set ${e.set}`})]},e.id))})]}),Y.length>0&&(0,T.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),X&&q(()=>w.readCases(X,G.trim()),`Test cases read.`)},children:[(0,T.jsx)(m,{size:`sm`,"aria-label":`Source`,value:X,onChange:e=>W(e.target.value),children:Y.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,T.jsx)(oe,{size:`sm`,"aria-label":`Scope`,placeholder:X&&X!==`jira`?A[X]:``,value:G,maxLength:80,onChange:e=>K(e.target.value),className:`w-full max-w-[240px] flex-[0_1_240px]`}),(0,T.jsxs)(y,{size:`sm`,type:`submit`,disabled:E||!G.trim(),"data-tip":`Read the test cases`,children:[(0,T.jsx)(c,{"aria-hidden":`true`}),`Import`]})]}),i.cases.length?(0,T.jsx)(l,{label:`Test cases`,placeholder:`Find a test case by id or title`,resetKey:V,empty:`Nothing matches.`,tools:(0,T.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,T.jsx)(g,{items:[{id:`manual`,label:`Not automated`,n:Z,alert:!0},{id:`automated`,label:`Automated`,n:i.cases.length-Z},{id:`all`,label:`All`,n:i.cases.length}],value:V,onChange:H})}),head:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Case`}),(0,T.jsx)(`th`,{className:`w-[36%] py-1.5 pr-3 font-medium`,children:`Title`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Source`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Automated`}),(0,T.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Test`}),(0,T.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,T.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:ue.map(e=>(0,T.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,T.jsx)(`td`,{className:`py-2 pr-3 pl-3 font-mono text-[12.5px] whitespace-nowrap`,children:/^https?:\/\//i.test(e.url)?(0,T.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id}):e.id}),(0,T.jsx)(`td`,{className:`max-w-0 py-2 pr-3`,children:(0,T.jsx)(P,{text:e.title||`–`})}),(0,T.jsx)(`td`,{className:`hidden py-2 pr-3 text-[12.5px] whitespace-nowrap @xl:table-cell`,"data-tip":`From ${e.scope}`,children:k[e.source]}),(0,T.jsx)(`td`,{className:`py-2 pr-3 text-[12.5px] whitespace-nowrap`,children:(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,"data-tip":e.how===`mapping`?`Its test is in the automated tests' mapping`:e.how===`name`?`A test in the history names its id`:`No automated test names it`,children:[e.automated?(0,T.jsx)(o,{size:15,"aria-hidden":`true`,className:`text-pass`}):(0,T.jsx)(r,{size:15,"aria-hidden":`true`,className:`text-muted`}),e.automated?`Yes`:`No`]})}),(0,T.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 text-[12.5px] text-ink-2 @2xl:table-cell`,children:e.test?(0,T.jsx)(P,{text:e.test,tip:e.file?`${e.test} · ${e.file}`:e.test}):`–`}),(0,T.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:!e.automated&&J(e.draft,`test case`)})]},`${e.source}|${e.id}`))}):(0,T.jsx)(h,{icon:e,title:`No test cases yet`,action:(0,T.jsxs)(`a`,{className:p({size:`sm`}),href:f(`settings`,`integrations`),"data-tip":`Open Settings, Integrations`,children:[(0,T.jsx)(s,{"aria-hidden":`true`}),`Settings`]}),children:`Test cases show here from ForgeQE's case index, the automated tests' mapping (.forgeqe/test-cases.json), and the plans, runs or cycles you read above from a connected source.`})]})]})]})]})}export{F as TestDebt};
@@ -1,2 +0,0 @@
1
- import{$n as e,$t as t,An as n,Ar as r,Bn as i,C as a,Dn as o,Ir as s,Kt as c,Nr as l,T as u,Un as d,a as f,gr as p,gt as m,ht as h,kr as g,lt as _,nn as v,o as y,ot as b,pr as x,tn as S}from"./line-icons-CQ-3V8ax.js";import{$ as C,Ft as w,I as T,Lt as E,Pt as D,R as O,Rt as k,at as A,et as j,ft as M,gr as N,gt as P,ht as F,it as I,lt as ee,r as L,t as R,ut as z,vr as te,wt as ne,xn as B,yn as V}from"./frame-D3IhgCFt.js";import{c as re,f as ie,r as ae,s as oe}from"./index-v-k_CVn7.js";import{t as se}from"./segmented-DBqHvZW3.js";import{n as ce}from"./families-Btjss8bN.js";import{r as le,s as H,t as ue}from"./logos-CfpaNwbY.js";import{d as U,o as de,p as fe,r as W,s as pe,t as me}from"./parts-B7YrlR3a.js";var G=s(l(),1),K=te(),q=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,he={ok:{label:`Ready to start`,tone:`pass`},limits:{label:`Ready, with limits`,tone:`warn`},blocked:{label:`Not possible`,tone:`fail`}},ge={converted:{label:`Converted`,tone:`pass`},partial:{label:`Needs review`,tone:`warn`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`},running:{label:`Running`,tone:`running`}},J={converted:{label:`Converted`,tone:`pass`},written:{label:`Written`,tone:`neutral`},failed:{label:`Failed`,tone:`fail`},blocked:{label:`Not possible`,tone:`warn`},skipped:{label:`Skipped`,tone:`neutral`}},_e={setup:`Set-up`,page:`Page`,test:`Test`},ve={matched:{label:`In the test`,dot:`bg-pass`},missing:{label:`Missing from the test`,dot:`bg-fail`},elided:{label:`Not needed: this branch never runs`,dot:`bg-line-strong`},marked:{label:`Left for a person to finish`,dot:`bg-warn`}},Y={web:`Web`,api:`API`,desktop:`Desktop`,mobile:`Mobile`,data:`Data`,mixed:`Mixed`,unsupported:`Not supported`},ye={prepare:`Prepare`,setup:`Set up`,pages:`Pages`,tests:`Tests`,validate:`Validate`,review:`Review`},X=[`prepare`,`setup`,`pages`,`tests`,`validate`,`review`];function be(e,t){if(!t)return 0;if(t.status===`converted`||t.stages?.review.status===`done`)return 100;let n=t.stages?.validate.status===`done`?8:0,r=Math.min(t.units.length,e.units.length);return Math.min(99,Math.round(r/Math.max(1,e.units.length)*90+n))}function xe(e){let t=e?.status||`pending`,n=e?.startedAt&&e?.endedAt?U(Date.parse(e.endedAt)-Date.parse(e.startedAt)):``;return t===`running`?e?.startedAt?`Running · ${U(Date.now()-Date.parse(e.startedAt))}`:`Running`:t===`done`?e?.note||(n?`Done · ${n}`:`Done`):t===`failed`?e?.note||`Did not finish`:t===`skipped`?e?.note||`Skipped`:`Waiting`}function Se({states:e}){return(0,K.jsx)(`ol`,{"aria-label":`Stages`,className:`m-0 flex w-full min-w-0 list-none items-center gap-1 p-0 @xl:gap-2`,children:X.map((t,n)=>{let i=e?.[t],o=i?.status||`pending`,s=o===`done`||o===`skipped`,c=o===`running`||o===`failed`,l=xe(i);return(0,K.jsxs)(`li`,{"data-tip":`${ye[t]}: ${l}`,className:B(`relative flex items-center gap-1 @xl:gap-2`,n<X.length-1&&`flex-1`),"aria-current":o===`running`?`step`:void 0,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:B(`inline-flex size-5 flex-none items-center justify-center rounded-full text-[11px] font-semibold tabular-nums @xl:size-6`,s?`bg-pass text-white`:o===`running`?`border-2 border-accent bg-accent-soft text-accent-fg`:o===`failed`?`bg-fail text-white`:`border border-line bg-bg text-muted`),children:s?(0,K.jsx)(a,{size:12,strokeWidth:3}):o===`failed`?(0,K.jsx)(r,{size:12,strokeWidth:3}):o===`running`?(0,K.jsx)(v,{size:12,strokeWidth:2.5,className:`animate-spin`}):n+1}),(0,K.jsxs)(`span`,{className:B(`flex-none text-[13px] whitespace-nowrap`,c?`inline`:`hidden @xl:inline`,o===`running`?`font-medium text-accent-fg`:o===`failed`?`font-medium text-fail`:o===`pending`?`text-muted`:`text-ink`),children:[ye[t],c&&(0,K.jsx)(`span`,{className:`ml-1.5 hidden font-normal text-muted @3xl:inline`,children:l})]}),(0,K.jsxs)(`span`,{className:`sr-only`,children:[ye[t],`: `,l]}),n<X.length-1&&(0,K.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,K.jsx)(`span`,{className:B(`block h-full rounded-full bg-pass transition-[width] duration-500`,s?`w-full`:`w-0`)})})]},t)})})}function Z(e){return e?`literal`in e?JSON.stringify(e.literal):`env`in e?`env ${String(e.env)}${e.secret?` (secret)`:``}`:`var`in e?`variable ${String(e.var)}`:`param`in e?`parameter ${String(e.param)}`:`data`in e?`test data ${String(e.data)}`:`expr`in e?`expression ${String(e.expr)}`:`concat`in e&&Array.isArray(e.concat)?e.concat.map(Z).join(` + `):``:``}function Ce(e){let t=e.target?e.target.slice(e.target.indexOf(`.`)+1).replace(/_/g,` `):``;if(e.kind===`action`){let n=e.op===`navigate`?`Open ${Z(e.value)}`:e.op===`close`?`Close the browser`:e.op===`fill`?`Fill ${t} with ${Z(e.value)}`:e.op===`press`?`Press ${e.key} on ${t}`:e.op===`select`?`Select in ${t}`:`${e.op[0].toUpperCase()}${e.op.slice(1)} ${t}`;return e.optional?`${n} (if it is there)`:n}return e.kind===`assert`?`Check ${t} ${e.op===`text`||e.op===`value`?`${e.match===`contains`?`contains`:`is`} ${Z(e.expected)}`:`is ${e.op}`}${e.wait?`, waiting`:``}`:e.kind===`store`?`Read ${t} into ${e.var}`:e.kind===`set_var`?`Set ${e.var} to ${Z(e.value)}`:e.kind===`wait`?`Wait ${e.ms} ms`:e.kind===`unsupported`?e.reason||`Cannot be converted`:e.name||e.kind}var we={before:`Before`,after:`After`,block:`Reusable block`,folder:`Folder`};function Te({nodes:e,status:t,pick:n,onPick:r,depth:i=0}){return(0,K.jsx)(`ul`,{className:B(`m-0 flex list-none flex-col p-0`,i>0&&`ml-3 border-l border-line-soft pl-3`),children:e.map((e,a)=>{if(e.kind===`group`)return(0,K.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,K.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[we[e.role||`folder`]||`Folder`,`: `,(0,K.jsx)(`span`,{className:`text-ink-2`,children:e.name})]}),(0,K.jsx)(Te,{nodes:e.body||[],status:t,pick:n,onPick:r,depth:i+1})]},`g${a}`);if(e.kind===`if`||e.kind===`loop`){let o=e.condition;return(0,K.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,K.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[e.kind===`if`?`If`:`Loop`,` `,e.name,`: `,(0,K.jsx)(`code`,{className:`font-mono text-[12px] text-ink-2`,children:o?.tosca}),o?.constant!==void 0&&(0,K.jsxs)(`span`,{children:[` · always `,o.constant?`true`:`false`]})]}),[`then`,`else`,`loop`].map(a=>e[a]?.length?(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsx)(`span`,{className:`ml-3 text-[12px] text-muted`,children:a===`then`?`Then`:a===`else`?`Else`:`Each time`}),(0,K.jsx)(Te,{nodes:e[a],status:t,pick:n,onPick:r,depth:i+1})]},a):null)]},`i${a}`)}let o=e.id?t.get(e.id):void 0,s=o?ve[o]:void 0;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":n===e.id,onClick:()=>r(e),className:B(`flex w-full min-w-0 cursor-pointer items-start gap-2 rounded-[8px] border-0 px-2 py-1.5 text-left text-[13px]`,n===e.id?`bg-accent-soft`:`bg-transparent hover:bg-surface-muted`),children:[(0,K.jsx)(`span`,{role:`img`,"aria-label":s?.label||`Not converted yet`,"data-tip":s?.label||`Not converted yet`,className:B(`mt-1.5 size-2 flex-none rounded-full`,s?.dot||`bg-line`)}),(0,K.jsx)(`span`,{className:`w-9 flex-none font-mono text-[12px] text-muted`,children:e.id}),(0,K.jsxs)(`span`,{className:B(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`unsupported`?`text-warn`:`text-ink`),children:[Ce(e),e.tosca?.step&&(0,K.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[`Tosca step "`,e.tosca.step,`"`]})]})]})},e.id||a)})})}function Ee(e,t){for(let n of e){if(n.id===t)return n;for(let e of[`body`,`then`,`else`,`loop`]){let r=n[e]&&Ee(n[e],t);if(r)return r}}}function De({view:e,pick:t}){let n=e.target,r=n?.text||``,i=r.split(`
2
- `),a=(0,G.useMemo)(()=>r?ie(r,n?.lang||`plaintext`):null,[r,n?.lang]),o=(0,G.useMemo)(()=>{if(!t)return new Set;let e=RegExp(`tosca:[\\sn\\d,]*\\b${t}\\b`,`i`);return new Set(i.flatMap((t,n)=>e.test(t)?[n]:[]))},[t,r]),s=(0,G.useRef)(null);(0,G.useEffect)(()=>{s.current?.scrollIntoView({block:`center`,behavior:`smooth`})},[t,o.size]);let c=Math.min(...o);return(0,K.jsxs)(`figure`,{className:`m-0 flex min-h-0 min-w-0 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,K.jsxs)(`figcaption`,{className:`flex min-h-10 items-center gap-2 border-b border-line-soft pr-1 pl-3`,children:[(0,K.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[0.04em] text-muted uppercase`,children:`Converted test`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[12px] text-ink-2`,"data-tip":n?.path,children:n?.path||``}),r&&(0,K.jsx)(re,{text:r,label:`Copy ${n?.path||`the test`}`})]}),r?(0,K.jsxs)(`div`,{className:`flex min-h-[260px] flex-1 overflow-auto font-mono text-[12.5px] leading-[1.6]`,children:[(0,K.jsx)(`pre`,{"aria-hidden":`true`,className:`m-0 min-h-full flex-none self-stretch border-r border-line-soft py-3 text-right text-muted select-none`,children:i.map((e,t)=>(0,K.jsx)(`span`,{ref:t===c?s:void 0,className:B(`block px-3`,o.has(t)&&`bg-accent-soft font-semibold text-accent-fg`),children:t+1},t))}),(0,K.jsx)(`pre`,{className:`m-0 min-w-0 flex-1 px-3 py-3`,children:(0,K.jsx)(`code`,{className:`hljs`,children:a})})]}):(0,K.jsx)(`p`,{className:`m-0 flex min-h-[260px] flex-1 items-center justify-center px-4 text-center text-sm text-muted`,children:n?`Not written yet.`:`This test case is left out of the plan.`}),t&&r&&(0,K.jsx)(`p`,{role:`status`,className:`m-0 border-t border-line-soft px-3 py-2 text-[12.5px] text-muted`,children:o.size?`${t} is done on line ${[...o].map(e=>e+1).join(`, `)}.`:`No line of the test is marked ${t}.`})]})}function Oe({view:e,node:t}){if(!t?.target)return null;let[n,r]=t.target.split(`.`),i=e.pages.find(e=>e.id===n),a=i?.elements.find(e=>e.id===r);return a?(0,K.jsxs)(`section`,{"aria-label":`Locators Tosca recorded`,className:`flex flex-col gap-2 rounded-[12px] card border px-4 py-3 text-[13px]`,children:[(0,K.jsxs)(`span`,{className:`font-medium`,children:[a.name,` `,(0,K.jsxs)(`span`,{className:`font-normal text-muted`,children:[`on `,i?.name,a.scope?.length?`, inside ${a.scope.join(` › `)}`:``,a.nth===void 0?``:`, number ${a.nth+1}`]})]}),a.locators.length?(0,K.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:a.locators.slice(0,6).map((e,t)=>(0,K.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`w-14 flex-none text-[12px] text-muted`,children:e.strategy}),(0,K.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:e.strategy===`role`?`${e.role} "${e.name}"`:e.attr?`[${e.attr}="${e.value}"]`:e.value}),e.fragile&&(0,K.jsx)(F,{tone:`warn`,children:`Fragile`})]},t))}):(0,K.jsx)(`span`,{className:`text-muted`,children:`Tosca recorded no locator for it.`})]}):null}function ke({id:e,plan:t,result:n,initial:r}){let i=t.cases.filter(e=>e.included),[a,o]=(0,G.useState)(``),[s,c]=(0,G.useState)(r||i[0]?.id||``),[l,u]=(0,G.useState)(null),[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(``);(0,G.useEffect)(()=>{s&&(m(``),N.case(e,s).then(u,e=>m(e.message)))},[e,s,n?.units.length,n?.status]),(0,G.useEffect)(()=>{f(``)},[s]);let h=new Map((l?.fidelity||[]).map(e=>[e.id,e.status])),g=i.filter(e=>!a||e.name.toLowerCase().includes(a.toLowerCase())),_=e=>n?.units.find(t=>t.kind===`test`&&t.case===e);return i.length?(0,K.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] gap-4 @5xl:h-[calc(var(--screen)-320px)] @5xl:min-h-[540px] @5xl:grid-cols-[220px_minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,K.jsxs)(`nav`,{"aria-label":`Test cases`,className:`flex max-h-[320px] min-h-0 min-w-0 flex-col gap-2 overflow-hidden rounded-[14px] card border p-3 @5xl:max-h-none`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-1`,children:[(0,K.jsx)(`span`,{className:`text-sm font-semibold`,children:`Test cases`}),(0,K.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[i.filter(e=>_(e.id)?.status===`converted`).length,` converted · `,i.filter(e=>[`failed`,`blocked`].includes(_(e.id)?.status||``)).length,` failed · `,q(i.length,`test case`)]})]}),(0,K.jsx)(ee,{id:`find-a-case`,label:`Find a test case`,value:a,onChange:o,className:`max-w-none flex-none`}),(0,K.jsxs)(`ul`,{className:`m-0 flex min-h-0 flex-1 list-none flex-col gap-0.5 overflow-y-auto p-0`,children:[g.map(e=>{let t=_(e.id);return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":s===e.id,onClick:()=>c(e.id),className:B(`flex w-full cursor-pointer items-start gap-2 rounded-[8px] border-0 px-2 py-1.5 text-left text-[13px]`,s===e.id?`bg-accent-soft text-ink`:`bg-transparent text-ink-2 hover:bg-surface-muted`),children:[(0,K.jsx)(`span`,{role:`img`,"aria-label":t?J[t.status].label:`Waiting`,className:B(`mt-1.5 size-2 flex-none rounded-full`,t?.status===`converted`?`bg-pass`:t?.status===`failed`?`bg-fail`:t?.status===`blocked`?`bg-warn`:`bg-line`)}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.name,(0,K.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[q(e.steps,`step`),` · `,q(e.asserts,`check`),t?.fidelity?` · ${t.fidelity.matched}/${t.fidelity.required} in the test`:``]})]})]})},e.id)}),!g.length&&(0,K.jsx)(`li`,{className:`px-2 py-3 text-[13px] text-muted`,children:`No test case matches.`})]})]}),(0,K.jsxs)(`section`,{"aria-label":`Tosca steps`,className:`flex min-h-[360px] min-w-0 flex-col gap-3 overflow-hidden`,children:[p&&(0,K.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:p}),(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,K.jsxs)(`header`,{className:`flex min-h-10 flex-wrap items-center gap-2 border-b border-line-soft px-3 py-1.5`,children:[(0,K.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[0.04em] text-muted uppercase`,children:`Tosca steps`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:l?.name}),l&&t.cases.find(e=>e.id===s)&&(0,K.jsx)(`span`,{className:`text-[12px] text-muted`,children:Y[t.cases.find(e=>e.id===s).route]||``})]}),(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:l?(0,K.jsx)(Te,{nodes:l.body,status:h,pick:d,onPick:e=>f(e.id||``)}):p?(0,K.jsx)(`p`,{className:`m-0 px-2 text-sm text-muted`,children:`Nothing to show.`}):(0,K.jsx)(`p`,{role:`status`,className:`m-0 px-2 text-sm text-muted`,children:`Loading…`})}),l&&(l.env.length>0||l.warnings.length>0)&&(0,K.jsxs)(`footer`,{className:`flex flex-col gap-1 border-t border-line-soft px-3 py-2 text-[12.5px] text-ink-2`,children:[l.env.length>0&&(0,K.jsxs)(`span`,{children:[`Environment variables: `,l.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`.`]}),l.warnings.slice(0,3).map(e=>(0,K.jsx)(`span`,{className:`text-warn`,children:e},e))]})]}),l&&(0,K.jsx)(Oe,{view:l,node:Ee(l.body,d)})]}),l?(0,K.jsx)(De,{view:l,pick:d}):(0,K.jsx)(`p`,{className:`m-0 flex min-h-[260px] items-center justify-center rounded-[12px] card border px-4 text-center text-sm text-muted`,children:p?`Nothing to show.`:`Loading…`})]}):(0,K.jsx)(P,{center:!0,className:`py-6`,children:`No test case of this plan is converted.`})}function Ae(e){if(e.job?.running)return{label:e.job.kind===`fix`?`Fixing`:e.job.kind===`verify`?`Running tests`:`Running`,tone:`running`};let t=e.result;return t?.status===`running`?{label:t.stage===`validate`?`Validating`:`Running`,tone:`running`}:t?ge[t.status]:e.job?.last?{label:`Did not start`,tone:`fail`}:e.confirmed?{label:`Confirmed`,tone:`neutral`}:he[e.plan.feasibility.verdict]}var Q=e=>e.slice(e.lastIndexOf(`/`)+1);function je({id:e,title:t,targetDir:n,onClose:r}){let[i,o]=(0,G.useState)(``),[s,c]=(0,G.useState)(!1),[l,u]=(0,G.useState)(``),d=async()=>{c(!0),u(``);try{await N.delete(e,i),location.hash=k(`tosca`)}catch(e){u(e.message),c(!1)}};return(0,K.jsx)(E,{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,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(V,{variant:`ghost`,onClick:r,"data-tip":`Keep it`,children:[(0,K.jsx)(a,{"aria-hidden":`true`}),`Keep`]}),(0,K.jsxs)(V,{variant:`danger`,disabled:s||i!==e,onClick:()=>void d(),children:[(0,K.jsx)(x,{"aria-hidden":`true`}),`Delete`]})]}),children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,K.jsxs)(`span`,{children:[`Type `,(0,K.jsx)(`span`,{className:`font-mono`,children:e}),` to confirm`]}),(0,K.jsx)(z,{value:i,onChange:e=>o(e.target.value),autoComplete:`off`,spellCheck:!1})]}),l?(0,K.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:l}):null]})})}function Me({d:e,unit:t,onClose:n,onSend:i}){let[a,o]=(0,G.useState)(``),s=e.plan.units.find(e=>e.id===t),c=e.result?.units.find(e=>e.id===t);return(0,K.jsx)(E,{open:!0,onClose:n,title:`Fix ${s?Q(s.target):t}`,description:`The Tosca agent works on this file again, with ForgeQE's last check and your note. It runs in the background.`,footer:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(V,{variant:`ghost`,onClick:n,children:[(0,K.jsx)(r,{"aria-hidden":`true`}),`Cancel`]}),(0,K.jsxs)(V,{variant:`primary`,onClick:()=>i(a.trim()),"data-tip":`Send to the agent`,children:[(0,K.jsx)(d,{"aria-hidden":`true`}),`Send`]})]}),children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[c?.problems?.length?(0,K.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:c.problems[0]}):null,(0,K.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:`What should change? (optional)`}),(0,K.jsx)(M,{value:a,rows:4,maxLength:2e3,placeholder:`The cart badge is a span now, not a button.`,onChange:e=>o(e.target.value)})]})]})})}function Ne({d:e,unit:t,onClose:n}){let i=e.result?.units.find(e=>e.id===t),a=e.plan.units.find(e=>e.id===t);return(0,K.jsx)(E,{open:!0,onClose:n,wide:!0,title:`Output of ${a?Q(a.target):t}`,description:i?.checkedAt?`Run again ${fe(i.checkedAt)}`:`From the conversion's own run`,footer:(0,K.jsxs)(V,{onClick:n,children:[(0,K.jsx)(r,{"aria-hidden":`true`}),`Close`]}),children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[i?.problems?.length?(0,K.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i.problems.join(` `)}):i?.status===`converted`?(0,K.jsx)(`p`,{className:`m-0 text-sm text-pass`,children:`Passes, with every Tosca step in the test.`}):null,i?.command&&(0,K.jsxs)(`code`,{className:`block font-mono text-[12px] text-muted`,children:[`$ `,i.command]}),(0,K.jsx)(`pre`,{className:`m-0 max-h-[60vh] overflow-auto rounded-[12px] bg-surface-muted px-3 py-2 font-mono text-[12.5px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:i?.output||`No output.`})]})})}function Pe(e){let t=Object.fromEntries(X.map(e=>[e,{status:e===`prepare`?`running`:`pending`,...e===`prepare`?{startedAt:new Date().toISOString()}:{}}]));return{status:`running`,plan:e.plan.id,target:e.plan.target,units:[],reverted:[],model:``,startedAt:e.job?.last?.startedAt||new Date().toISOString(),ms:0,stage:`prepare`,stages:t,notes:``}}function Fe({d:e,planView:t,busy:n,onFix:r,onSteps:a,onOutput:s,onRun:c}){let l=e.result||(e.job?.running?Pe(e):null);if(!l)return(0,K.jsx)(K.Fragment,{children:t});let u=new Map(l.units.map(e=>[e.id,e])),d=e.plan.units.filter(e=>e.kind===`test`),f=l.units.filter(e=>e.kind===`test`&&e.status===`converted`).length,p=l.units.reduce((e,t)=>t.fidelity?{m:e.m+t.fidelity.matched,n:e.n+t.fidelity.required}:e,{m:0,n:0}),m=l.units.filter(e=>e.status===`failed`||e.status===`blocked`).length,[h,..._]=e.plan.target.id.split(`-`);return(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsxs)(de,{children:[(0,K.jsx)(W,{label:`Tests passing`,value:`${f} / ${d.length}`,tone:f===d.length&&d.length?`text-pass`:void 0}),(0,K.jsx)(W,{label:`Tosca steps in the tests`,value:p.n?`${p.m} / ${p.n}`:`–`,tone:p.n&&p.m===p.n?`text-pass`:void 0}),(0,K.jsx)(W,{label:`Need attention`,value:m,tone:m?`text-fail`:void 0}),(0,K.jsx)(W,{label:l.status===`running`?`Running for`:`Took`,value:U(l.status===`running`?Date.now()-Date.parse(l.startedAt):l.ms)})]}),l.notes&&(0,K.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:l.notes}),(0,K.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-5 @5xl:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,K.jsx)(C,{label:`Files`,placeholder:`Find a file`,empty:`No files.`,head:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`th`,{className:`py-2 pr-3 pl-3 font-medium`,children:`File`}),(0,K.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:`Status`}),(0,K.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @2xl:table-cell`,children:`Tosca steps`}),(0,K.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @3xl:table-cell`,children:`Note`}),(0,K.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:(0,K.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:e.plan.units.map(t=>{let o=u.get(t.id),c=o?J[o.status]:null,l=t.case?e.plan.cases.find(e=>e.id===t.case):void 0;return(0,K.jsxs)(`tr`,{className:I,children:[(0,K.jsxs)(`td`,{className:j,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:t.kind===`setup`?`Project set-up`:Q(t.target)}),(0,K.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[l?l.name:`${_e[t.kind]} · ${t.target}`,l?.suites?.length?` · ${l.suites.join(`, `)}`:``]})]}),(0,K.jsxs)(`td`,{className:B(j,`whitespace-nowrap`),children:[c?(0,K.jsx)(F,{tone:c.tone,children:c.label}):(0,K.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Waiting`}),o?.checkedAt&&(0,K.jsxs)(`span`,{className:`block pt-1 text-[12px] text-muted`,children:[`Run again `,ae(o.checkedAt)]})]}),(0,K.jsx)(`td`,{className:B(j,`hidden text-[13px] whitespace-nowrap @2xl:table-cell`),children:o?.fidelity?(0,K.jsxs)(`span`,{className:o.fidelity.missing.length?`text-fail`:`text-ink-2`,children:[o.fidelity.matched,` of `,o.fidelity.required]}):(0,K.jsx)(`span`,{className:`text-muted`,children:`–`})}),(0,K.jsx)(`td`,{className:B(j,`hidden text-[13px] text-ink-2 @3xl:table-cell`),children:(0,K.jsx)(`span`,{className:`line-clamp-2`,children:o?.problems?.[0]||o?.reason||``})}),(0,K.jsx)(`td`,{className:B(j,`whitespace-nowrap text-right`),children:(0,K.jsxs)(`span`,{className:`inline-flex gap-1`,children:[t.kind===`test`&&(o?.output||o?.problems?.length)&&(0,K.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Output of ${Q(t.target)}`,"data-tip":`Output of ${Q(t.target)}`,onClick:()=>s(t.id),children:(0,K.jsx)(i,{"aria-hidden":`true`})}),t.case&&(0,K.jsx)(V,{variant:`icon`,size:`icon-sm`,"aria-label":`Steps of ${Q(t.target)}`,"data-tip":`Steps of ${Q(t.target)}`,onClick:()=>a(t.case),children:(0,K.jsx)(S,{"aria-hidden":`true`})}),o&&(o.status===`failed`||o.status===`blocked`)&&t.kind!==`setup`&&(0,K.jsx)(V,{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,K.jsx)(g,{"aria-hidden":`true`})})]})})]},t.id)})}),(0,K.jsxs)(`aside`,{"aria-label":`Details`,className:`flex flex-col gap-4 rounded-[14px] card border p-5 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`From`}),(0,K.jsxs)(`span`,{className:`font-medium`,children:[`Tricentis Tosca`,e.plan.source.project?` · ${e.plan.source.project}`:``]}),(0,K.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:e.plan.source.file})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`To`}),(0,K.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,K.jsx)(H,{framework:h,language:_.join(`-`)}),e.plan.target.title]}),(0,K.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:e.targetPath})]}),(e.plan.suites||[]).length>0&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Suites`}),(0,K.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1.5 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,K.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,K.jsx)(`span`,{className:`truncate`,children:e.name}),(0,K.jsxs)(`span`,{className:B(`text-[12px]`,r===e.cases.length?`text-pass`:`text-muted`),children:[r,` of `,q(e.cases.length,`test`),` pass · @`,e.tag]})]}),(0,K.jsx)(V,{variant:`icon`,size:`icon-sm`,disabled:n,"aria-label":`Run the ${e.name} suite`,"data-tip":`Run the ${e.name} suite`,onClick:()=>c(e.name),children:(0,K.jsx)(o,{"aria-hidden":`true`})})]},e.name)})})]}),e.plan.env.length>0&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Environment variables`}),(0,K.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.plan.env.map(e=>(0,K.jsxs)(`li`,{className:`flex flex-col`,children:[(0,K.jsxs)(`span`,{className:`font-mono text-[12px]`,children:[e.name,e.secret?(0,K.jsx)(`span`,{className:`font-sans text-muted`,children:` · secret`}):null]}),(0,K.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.from})]},e.name))})]}),(0,K.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 border-t border-line-soft pt-4`,children:[(0,K.jsx)(`dt`,{className:`text-muted`,children:`Started`}),(0,K.jsx)(`dd`,{className:`m-0 text-right`,children:fe(l.startedAt)}),l.model&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`dt`,{className:`text-muted`,children:`Agent`}),(0,K.jsx)(`dd`,{className:`m-0 truncate text-right`,"data-tip":l.model,children:l.model})]}),l.reverted.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`dt`,{className:`text-muted`,children:`Put back`}),(0,K.jsxs)(`dd`,{className:`m-0 text-right`,children:[l.reverted.length,` edits outside the target`]})]})]})]})]})]})}var Ie={ok:{mark:`✓`,cls:`text-pass`},fail:{mark:`✗`,cls:`text-fail`},info:{mark:`•`,cls:`text-muted`},agent:{mark:`•`,cls:`text-accent-fg`},tool:{mark:`·`,cls:`text-muted`}};function Le({events:e,running:t}){let n=(0,G.useRef)(null);(0,G.useEffect)(()=>{t&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e.length,t]);let r=e.filter(e=>e.kind!==`tool`);return(0,K.jsxs)(`ol`,{ref:n,"aria-live":t?`polite`:void 0,"aria-label":`Activity`,className:`m-0 flex max-h-[60vh] list-none flex-col overflow-y-auto rounded-[12px] card border p-0`,children:[r.map((e,t)=>(0,K.jsxs)(`li`,{className:`flex gap-3 border-b border-line-soft px-4 py-2 text-[13px] last:border-b-0`,children:[(0,K.jsx)(`span`,{className:`w-[64px] flex-none text-[12px] text-muted tabular-nums`,children:new Date(e.ts).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,K.jsx)(`span`,{"aria-hidden":`true`,className:B(`w-3 flex-none text-center`,Ie[e.kind].cls),children:Ie[e.kind].mark}),(0,K.jsx)(`span`,{className:B(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`fail`?`text-fail`:e.kind===`ok`?`text-ink`:`text-ink-2`),children:e.text})]},t)),!r.length&&(0,K.jsx)(`li`,{className:`px-4 py-8 text-center text-sm text-muted`,children:`Nothing yet.`})]})}function Re({id:t,plan:n}){let[r,i]=(0,G.useState)(null),[a,s]=(0,G.useState)(``),[c,l]=(0,G.useState)(`overview`),[u,d]=(0,G.useState)(),[p,m]=(0,G.useState)(null),[h,g]=(0,G.useState)(null),[_,v]=(0,G.useState)([]),[S,C]=(0,G.useState)(!1),[w,T]=(0,G.useState)(!1),E=(0,G.useRef)(0),D=(0,G.useCallback)(()=>{N.detail(t).then(e=>{i(e),s(``)},e=>s(e.message)),N.events(t,E.current).then(e=>{e.next<E.current?(E.current=0,v([])):(E.current=e.next,e.events.length&&v(t=>[...t,...e.events].slice(-2e3)))},()=>{})},[t]);(0,G.useEffect)(D,[D]);let O=!!(r?.job?.running||r?.result?.status===`running`);(0,G.useEffect)(()=>{if(!O)return;let e=setInterval(D,1500);return()=>clearInterval(e)},[O,D]);let A=(0,G.useCallback)(e=>{i(e),s(``),l(`overview`),setTimeout(D,800)},[D]),j=async e=>{C(!0),s(``);try{i(await e()),setTimeout(D,800)}catch(e){s(e.message)}finally{C(!1)}};if(!r)return a?(0,K.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a}):(0,K.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});let M=Ae(r),P=be(r.plan,r.result),I=r.result,ee=(I?.units||[]).filter(e=>e.kind===`test`&&(e.status===`failed`||e.status===`blocked`)).length,L=r.plan.cases.filter(e=>e.included).length,R=[{id:`overview`,label:`Overview`},{id:`steps`,label:`Steps`,n:L?String(L):void 0,tone:ee?`text-fail`:void 0},{id:`activity`,label:`Activity`}];return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`a`,{href:k(`tosca`),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,K.jsx)(f,{size:16,"aria-hidden":`true`}),`Tosca`]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 @3xl:flex-row @3xl:items-start`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,K.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,K.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:Q(r.plan.source.file)}),(0,K.jsx)(y,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,K.jsx)(H,{framework:r.plan.target.id.split(`-`)[0],language:r.plan.target.id.split(`-`).slice(1).join(`-`),size:20}),r.plan.target.title]})]}),(0,K.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-1.5 text-sm text-muted`,children:[(0,K.jsxs)(`span`,{children:[`Tricentis Tosca`,r.plan.source.project?` · ${r.plan.source.project}`:``]}),(0,K.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,K.jsxs)(`span`,{children:[`into `,(0,K.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:r.plan.target.dir})]})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(F,{tone:M.tone,children:M.label}),O?(0,K.jsxs)(V,{variant:`danger`,disabled:S,onClick:()=>void j(()=>N.stop(t)),children:[(0,K.jsx)(e,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]}):(0,K.jsxs)(K.Fragment,{children:[I?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(V,{variant:`ghost`,onClick:()=>location.hash=k(`tosca`,t,`report`),children:[(0,K.jsx)(b,{"aria-hidden":`true`}),`Report`]}),(0,K.jsxs)(V,{disabled:S,onClick:()=>void j(()=>N.verify(t)),"data-tip":`Run every converted test again, no agent`,children:[(0,K.jsx)(o,{"aria-hidden":`true`}),`Run`]})]}):null,(0,K.jsxs)(V,{variant:`ghost`,disabled:S,onClick:()=>T(!0),"data-tip":`Remove this plan from the list. Converted tests stay.`,children:[(0,K.jsx)(x,{"aria-hidden":`true`}),`Delete`]})]})]})]}),w&&(0,K.jsx)(je,{id:t,title:`${Q(r.plan.source.file)} → ${r.plan.target.title}`,targetDir:r.plan.target.dir,onClose:()=>T(!1)}),I&&(0,K.jsxs)(`div`,{className:`flex items-center gap-3 rounded-[12px] card border px-3 py-2.5 @xl:gap-4 @xl:px-4`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(Se,{states:I.stages})}),O&&(0,K.jsxs)(`span`,{className:`flex-none text-[13px] font-semibold tabular-nums text-accent-fg`,"aria-label":`${Math.round(P)}% done`,children:[Math.round(P),`%`]})]}),a&&(0,K.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a}),(0,K.jsx)(pe,{tabs:R,tab:c,onTab:l,label:`Tosca conversion`}),(0,K.jsxs)(`div`,{role:`tabpanel`,id:`mpanel-${c}`,"aria-labelledby":`mtab-${c}`,className:`flex min-w-0 flex-col gap-4`,children:[c===`overview`&&(0,K.jsx)(Fe,{d:r,planView:n(r,A),busy:S||O,onFix:m,onSteps:e=>(d(e),l(`steps`)),onOutput:g,onRun:e=>void j(()=>N.verify(t,e))}),c===`steps`&&(0,K.jsx)(ke,{id:t,plan:r.plan,result:I,initial:u}),c===`activity`&&(0,K.jsx)(Le,{events:_,running:O})]}),h&&(0,K.jsx)(Ne,{d:r,unit:h,onClose:()=>g(null)}),p&&(0,K.jsx)(Me,{d:r,unit:p,onClose:()=>m(null),onSend:e=>{m(null),j(()=>N.fix(t,[p],e))}})]})}var ze=e=>e.slice(e.lastIndexOf(`/`)+1),Be={prepare:`Prepare`,setup:`Set up`,pages:`Pages`,tests:`Tests`,validate:`Validate`,review:`Review`};function Ve(e){return e===`converted`?J.converted:e===`failed`?J.failed:e===`blocked`?J.blocked:e===`left out`||e===`skipped`||e===`not run`?{label:e===`left out`?`Left out`:e===`not run`?`Not run`:`Skipped`,tone:`neutral`}:{label:e,tone:`neutral`}}function He(e){for(let t of X){let n=e[t];if(n?.status===`failed`)return{id:t,...n.note?{note:n.note}:{}}}return null}function Ue({title:e,children:t,defaultOpen:n}){let[r,i]=(0,G.useState)(!!n),a=(0,G.useId)();return(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,onClick:()=>i(!r),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 self-start rounded-[8px] border-0 bg-transparent px-1 text-sm font-medium text-ink hover:bg-surface-strong`,children:[(0,K.jsx)(u,{size:15,"aria-hidden":`true`,className:B(`transition-transform`,r&&`rotate-180`)}),e]}),(0,K.jsx)(w,{open:r,id:a,children:t})]})}function We({planId:e,unit:t,file:n}){let[r,i]=(0,G.useState)(``),[a,o]=(0,G.useState)(!1),s=/\.(webm|mp4)$/i.test(n);return(0,G.useEffect)(()=>{let r=!1;return i(``),o(!1),N.evidence(e,t,n).then(e=>!r&&i(e),()=>!r&&o(!0)),()=>{r=!0}},[e,t,n]),(0,K.jsxs)(`li`,{className:`flex max-w-[320px] flex-col gap-1`,children:[r?s?(0,K.jsx)(`video`,{controls:!0,src:r,className:`max-h-[220px] w-full rounded-[10px] border border-line-soft bg-surface-muted`}):(0,K.jsx)(`img`,{src:r,alt:n,className:`max-h-[220px] w-full rounded-[10px] border border-line-soft object-contain`}):(0,K.jsx)(`span`,{className:`flex h-[120px] items-center justify-center rounded-[10px] border border-line-soft bg-surface-muted text-[12px] text-muted`,children:a?`Not available`:`Loading…`}),(0,K.jsx)(`span`,{className:`font-mono text-[11px] text-muted`,children:n})]})}function Ge({planId:e,unit:t,files:n}){return!t||!n.length?null:(0,K.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-3 p-0`,children:n.map(n=>(0,K.jsx)(We,{planId:e,unit:t,file:n},n))})}function Ke({planId:e,t}){let n=t.fidelity,r=t.status===`failed`||t.status===`blocked`,i=t.problems?.length?t.problems.join(` `):r&&t.reason?t.reason:``;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-[14px] card border p-5`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:t.name}),(0,K.jsxs)(`p`,{className:`m-0 pt-1 text-[13px] text-muted`,children:[t.file?(0,K.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:t.file}):`No file`,t.suites.length?` · ${t.suites.join(`, `)}`:``,t.folders.length?` · ${t.folders.join(` / `)}`:``]})]}),(0,K.jsx)(F,{tone:Ve(t.status).tone,children:Ve(t.status).label}),t.ms>0&&(0,K.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:U(t.ms)})]}),i&&(0,K.jsx)(`p`,{role:`status`,className:B(`m-0 rounded-[10px] px-3 py-2 text-sm [overflow-wrap:anywhere]`,r?`bg-fail-soft text-fail`:`bg-surface-muted text-ink-2`),children:i}),n&&n.rows.length>0&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[`Tosca steps (`,n.matched,` of `,n.required,`)`]}),(0,K.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[10px] border border-line-soft p-0 text-[13px]`,children:n.rows.map(e=>{let t=ve[e.status]||ve.matched;return(0,K.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-3 border-b border-line-soft px-3 py-2 last:border-b-0`,children:[(0,K.jsx)(`span`,{className:B(`mt-1.5 h-2 w-2 flex-none rounded-full`,t.dot),"aria-hidden":`true`}),(0,K.jsx)(`span`,{className:`w-12 flex-none font-mono text-[12px] text-muted`,children:e.id}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.kind===`assert`?`check ${e.op}`:e.op,` on `,e.element||`—`,(0,K.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[t.label,e.step?` · Tosca “${e.step}”`:``]})]})]},e.id)})})]}),t.media.length>0?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Screenshots and video`}),(0,K.jsx)(Ge,{planId:e,unit:t.unit,files:t.media})]}):r?(0,K.jsx)(`p`,{className:`m-0 text-[12.5px] text-muted`,children:`No screenshot or video was kept for this failure.`}):null,t.command&&(0,K.jsxs)(`code`,{className:`block font-mono text-[12px] text-muted`,children:[`$ `,t.command]}),t.output&&(0,K.jsx)(Ue,{title:`Test output`,defaultOpen:r,children:(0,K.jsx)(`pre`,{className:`m-0 max-h-[40vh] overflow-auto rounded-[10px] bg-surface-muted px-3 py-2 font-mono text-[12.5px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:t.output})})]})}function qe({id:e}){let[t,n]=(0,G.useState)(null),[r,i]=(0,G.useState)(``),[a,o]=(0,G.useState)(!0),[s,c]=(0,G.useState)(`all`),[l,u]=(0,G.useState)(``);(0,G.useEffect)(()=>{o(!0),N.report(e).then(e=>{if(n(e.report),i(e.report?``:`No report yet. Start the conversion first.`),o(!1),e.report){let t=e.report.tests.filter(e=>e.status!==`left out`),n=t.find(e=>e.status===`failed`||e.status===`blocked`);u(n?.case||t[0]?.case||``),c(n?`attention`:`all`)}},e=>{i(e.message),o(!1)})},[e]);let d=(0,G.useMemo)(()=>t?t.tests.filter(e=>e.status!==`left out`):[],[t]),p=(0,G.useMemo)(()=>d.filter(e=>!(s===`attention`&&e.status!==`failed`&&e.status!==`blocked`||s===`converted`&&e.status!==`converted`)),[d,s]);if((0,G.useEffect)(()=>{l&&(p.some(e=>e.case===l)||u(p[0]?.case||``))},[p,l]),a)return(0,K.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading report…`});if(r||!t)return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`a`,{href:k(`tosca`,e),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,K.jsx)(f,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,K.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r||`No report.`})]});let m=d.filter(e=>e.status===`converted`).length,g=d.filter(e=>e.status===`failed`||e.status===`blocked`).length,_=d.reduce((e,t)=>t.fidelity?{m:e.m+t.fidelity.matched,n:e.n+t.fidelity.required}:e,{m:0,n:0}),v=d.reduce((e,t)=>e+t.media.length,0),b=ge[t.status]||{label:t.status,tone:`neutral`},[x,...S]=t.target.id.split(`-`),w=He(t.stages),E=d.find(e=>e.case===l)||null,D=[{id:`all`,label:`All (${d.length})`},{id:`attention`,label:`Needs attention (${g})`},{id:`converted`,label:`Converted (${m})`}];return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`a`,{href:k(`tosca`,e),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,K.jsx)(f,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 @3xl:flex-row @3xl:items-start`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,K.jsx)(`p`,{className:`m-0 text-[12px] font-medium tracking-wide text-muted uppercase`,children:`Conversion report`}),(0,K.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,K.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:ze(t.source.file)}),(0,K.jsx)(y,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,K.jsx)(H,{framework:x,language:S.join(`-`),size:20}),t.target.title]})]}),(0,K.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-1.5 text-sm text-muted`,children:[(0,K.jsxs)(`span`,{children:[`Tricentis Tosca`,t.source.project?` · ${t.source.project}`:``]}),(0,K.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,K.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:t.id}),(0,K.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,K.jsxs)(`span`,{children:[`Started `,fe(t.startedAt)]})]})]}),(0,K.jsx)(F,{tone:b.tone,children:b.label})]}),w&&(0,K.jsxs)(`p`,{role:`status`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[`Failed in `,Be[w.id],w.note?`: ${w.note}`:``]}),(0,K.jsxs)(de,{children:[(0,K.jsx)(W,{label:`Tests passing`,value:`${m} / ${d.length}`,tone:m===d.length&&d.length?`text-pass`:void 0}),(0,K.jsx)(W,{label:`Total time`,value:U(t.ms)}),(0,K.jsx)(W,{label:`Tosca steps`,value:_.n?`${_.m} / ${_.n}`:`–`,tone:_.n&&_.m===_.n?`text-pass`:void 0}),(0,K.jsx)(W,{label:`Media`,value:v,sub:v?`screenshots / video`:`only on failure`})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-5 @5xl:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,K.jsx)(C,{label:`Test cases`,placeholder:`Find a test case`,empty:d.length?`No test case matches.`:`No test cases.`,resetKey:s,tools:(0,K.jsx)(`div`,{role:`group`,"aria-label":`Filter test cases`,className:`flex flex-wrap gap-1`,children:D.map(e=>(0,K.jsx)(`button`,{type:`button`,"aria-pressed":s===e.id,onClick:()=>c(e.id),className:B(`min-h-8 cursor-pointer rounded-[8px] border px-2.5 text-[13px]`,s===e.id?`border-accent bg-accent-soft font-medium text-accent-fg`:`border-line bg-transparent text-ink-2 hover:bg-surface-muted`),children:e.label},e.id))}),head:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`th`,{className:`py-2 pr-3 pl-3 font-medium`,children:`Test case`}),(0,K.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:`Status`}),(0,K.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @2xl:table-cell`,children:`Steps`}),(0,K.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @3xl:table-cell`,children:`Time`})]}),children:p.map(e=>{let t=Ve(e.status),n=l===e.case;return(0,K.jsxs)(`tr`,{className:B(I,`cursor-pointer hover:bg-surface-muted`,n&&`bg-accent-soft`),onClick:()=>u(e.case),"aria-selected":n,children:[(0,K.jsxs)(`td`,{className:j,children:[(0,K.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.name}),(0,K.jsx)(`span`,{className:`block font-mono text-[12px] text-muted`,children:e.file||`No file`})]}),(0,K.jsxs)(`td`,{className:B(j,`whitespace-nowrap`),children:[(0,K.jsx)(F,{tone:t.tone,children:t.label}),e.media.length>0&&(0,K.jsx)(`span`,{className:`block pt-1 text-[12px] text-muted`,children:q(e.media.length,`file`)})]}),(0,K.jsx)(`td`,{className:B(j,`hidden text-[13px] whitespace-nowrap tabular-nums @2xl:table-cell`,e.fidelity?.missing.length?`text-fail`:`text-ink-2`),children:e.fidelity?`${e.fidelity.matched}/${e.fidelity.required}`:`–`}),(0,K.jsx)(`td`,{className:B(j,`hidden text-[13px] whitespace-nowrap text-muted tabular-nums @3xl:table-cell`),children:e.ms>0?U(e.ms):`–`})]},e.case)})}),E?(0,K.jsx)(Ke,{planId:t.id,t:E}):p.length?(0,K.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Select a test case for steps, output, and media.`}):null,t.personSteps.length>0&&(0,K.jsxs)(`section`,{className:`flex flex-col gap-2 rounded-[14px] bg-warn-soft px-5 py-4`,children:[(0,K.jsx)(`h3`,{className:`m-0 text-sm font-semibold text-warn`,children:`Steps a person has to finish`}),(0,K.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-5 text-sm text-ink`,children:t.personSteps.map(e=>(0,K.jsxs)(`li`,{children:[e.case,` / `,e.id,`: Tosca step “`,e.step,`” on “`,e.element,`”`]},`${e.case}-${e.id}`))})]})]}),(0,K.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col gap-4 rounded-[14px] card border p-5 text-sm @5xl:sticky @5xl:top-6`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`From`}),(0,K.jsxs)(`span`,{className:`font-medium`,children:[`Tricentis Tosca`,t.source.project?` · ${t.source.project}`:``]}),(0,K.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:t.source.file}),t.source.baseUrl&&(0,K.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:t.source.baseUrl})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`To`}),(0,K.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,K.jsx)(H,{framework:x,language:S.join(`-`)}),t.target.title]}),(0,K.jsxs)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:[t.target.dir,`/`]})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`LLM`}),(0,K.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:t.model||`—`}),t.usage.input||t.usage.output?(0,K.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-[12.5px]`,children:[(0,K.jsx)(`dt`,{className:`text-muted`,children:`Tokens`}),(0,K.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:O(t.usage.input+t.usage.output)}),(0,K.jsx)(`dt`,{className:`text-muted`,children:`Read`}),(0,K.jsxs)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:[O(t.usage.input),t.usage.cached?(0,K.jsxs)(`span`,{className:`text-muted`,children:[` · `,O(t.usage.cached),` cached`]}):null]}),(0,K.jsx)(`dt`,{className:`text-muted`,children:`Written`}),(0,K.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:O(t.usage.output)}),(0,K.jsx)(`dt`,{className:`text-muted`,children:`Cost`}),(0,K.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:t.cost?(0,K.jsxs)(K.Fragment,{children:[t.cost.estimate?`≈`:``,T(t.cost.amount,t.cost.currency)]}):`—`})]}):(0,K.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`No usage recorded.`})]}),t.env.length>0&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Environment variables`}),(0,K.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:t.env.map(e=>(0,K.jsxs)(`li`,{className:`flex flex-col`,children:[(0,K.jsxs)(`span`,{className:`font-mono text-[12px]`,children:[e.name,e.secret?(0,K.jsx)(`span`,{className:`font-sans text-muted`,children:` · secret`}):null]}),(0,K.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.from})]},e.name))})]}),t.reverted.length>0&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Put back`}),(0,K.jsxs)(`span`,{className:`text-[12.5px] text-ink-2`,children:[t.reverted.length,` edit`,t.reverted.length===1?``:`s`,` outside the target`]})]}),t.notes&&(0,K.jsxs)(`p`,{className:`m-0 border-t border-line-soft pt-4 text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:[(0,K.jsx)(h,{size:14,"aria-hidden":`true`,className:`mr-1 inline align-text-bottom`}),t.notes]})]})]})]})}var Je=[`Export`,`Target`,`Instructions`,`Review`],Ye=[`The Tosca export and its test cases`,`Framework and language`,`Your rules, optional`,`Check and start`],Xe=[`Keep one page object per Tosca module, in pages/.`,`Name each test after its Tosca test case.`,`Read the base URL from BASE_URL.`],Ze={playwright:`Microsoft`,cypress:`JavaScript only`,webdriverio:`WebDriver and BiDi`,selenium:`WebDriver`};function Qe({at:e,reached:t,onGo:n}){return(0,K.jsx)(`nav`,{"aria-label":`Steps`,children:(0,K.jsx)(`ol`,{className:`m-0 flex list-none items-center gap-2 p-0`,children:Je.map((r,i)=>{let o=i<=t,s=i===e,c=i<t&&!s;return(0,K.jsxs)(`li`,{className:B(`flex items-center gap-2`,i<Je.length-1&&`flex-1`),children:[(0,K.jsxs)(`button`,{type:`button`,disabled:!o,"aria-current":s?`step`:void 0,onClick:()=>n(i),"aria-label":r,"data-tip":Ye[i],className:B(`inline-flex min-h-8 flex-none items-center gap-2 rounded-[8px] border-0 bg-transparent px-1 text-[13px] whitespace-nowrap`,o&&!s?`cursor-pointer hover:bg-surface-strong`:``),children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:B(`inline-flex size-6 flex-none items-center justify-center rounded-full text-[11px] font-semibold tabular-nums`,c?`bg-pass text-white`:s?`bg-accent text-accent-ink`:`border border-line bg-bg text-muted`),children:c?(0,K.jsx)(a,{size:13,strokeWidth:3}):i+1}),(0,K.jsx)(`span`,{className:B(s?`font-medium text-ink`:o?`text-ink-2`:`text-muted`,!s&&`hidden @xl:inline`),children:r})]}),i<Je.length-1&&(0,K.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,K.jsx)(`span`,{className:B(`block h-full rounded-full bg-pass transition-[width] duration-500`,i<t?`w-full`:`w-0`)})})]},r)})})})}function $({id:e,label:t,help:n,children:r}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(`label`,{htmlFor:e,className:`text-sm font-medium`,children:t}),r,n&&(0,K.jsx)(`span`,{className:`text-[13px] text-muted`,children:n})]})}function $e({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){return(0,K.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-3 border-t border-line-soft bg-bg py-3`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px]`,children:a}),t&&(0,K.jsxs)(V,{variant:`ghost`,disabled:e,onClick:t,children:[(0,K.jsx)(f,{"aria-hidden":`true`}),`Back`]}),(0,K.jsx)(V,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}function et({on:e,onPick:t,logo:n,title:r,sub:i,label:a}){return(0,K.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e,"aria-label":a,onClick:t,className:B(`flex min-h-[72px] min-w-0 cursor-pointer items-center gap-3 rounded-[12px] border px-3.5 py-3 text-left transition-colors`,e?`border-accent bg-accent-soft ring-1 ring-accent`:`border-line-soft bg-bg hover:border-line hover:bg-surface-muted`),children:[(0,K.jsx)(`span`,{className:`inline-flex size-9 flex-none items-center justify-center rounded-[10px] bg-surface-muted`,children:n}),(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,K.jsx)(`span`,{className:`truncate text-sm font-medium text-ink`,children:r}),i&&(0,K.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:i})]})]})}var tt=e=>e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;function nt({s:e}){return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-[12px] bg-surface-muted px-4 py-3 text-sm`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:e.project||e.file}),(0,K.jsxs)(`span`,{className:`text-ink-2`,children:[q(e.test_cases.length,`test case`),` · `,q(e.pages.length,`module`),` · `,q(e.totals.steps,`step`),` · `,q(e.totals.asserts,`check`)]}),e.suites.length>0&&(0,K.jsxs)(`span`,{className:`text-ink-2`,children:[`· `,q(e.suites.length,`execution list`)]}),e.totals.unsupported>0&&(0,K.jsxs)(`span`,{className:`text-warn`,children:[`· `,e.totals.unsupported===1?`1 step value cannot`:`${e.totals.unsupported} step values cannot`,` be converted`]})]})}function rt({view:e,file:t,setFile:n,found:r,setFound:i,only:a,setOnly:o}){let[s,c]=(0,G.useState)(e.exports.some(e=>e.path===t)?``:t),[l,u]=(0,G.useState)(!1),[d,f]=(0,G.useState)(``),p=async e=>{if(n(e),i(null),f(``),e){u(!0);try{let t=await N.inspect(e);i(t),o(new Set(t.test_cases.filter(e=>e.route===`web`||(e.routes?.web??0)>0).map(e=>e.id)))}catch(e){f(e.message)}finally{u(!1)}}},h=e=>{let t=new Set(a);t.has(e)?t.delete(e):t.add(e),o(t)};return(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[e.exports.length>0?(0,K.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,K.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Tosca exports in this project`}),(0,K.jsx)(`div`,{role:`radiogroup`,"aria-label":`Tosca exports`,className:`grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2.5`,children:e.exports.map(e=>(0,K.jsx)(et,{on:t===e.path,onPick:()=>void p(e.path),logo:(0,K.jsx)(_,{size:18,"aria-hidden":`true`,className:`text-ink-2`}),title:e.path.slice(e.path.lastIndexOf(`/`)+1),sub:`${e.path.includes(`/`)?e.path.slice(0,e.path.lastIndexOf(`/`)):`.`} · ${tt(e.bytes)}`,label:e.path},e.path))})]}):(0,K.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-3 text-sm text-ink-2`,children:[`No Tosca export (.tsu) in this project yet. Export the test cases from Tosca Commander, put the file inside the project, for example `,(0,K.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:`tosca/checkout.tsu`}),`, and type its path below.`]}),(0,K.jsx)($,{id:`tsc-path`,label:e.exports.length?`Or type its path`:`Path of the export`,help:`Inside the project. Secrets in it stay encrypted: they become environment variables.`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(z,{id:`tsc-path`,value:s,spellCheck:!1,maxLength:300,placeholder:`tosca/checkout.tsu`,onChange:e=>c(e.target.value),className:`min-w-0 flex-[1_1_300px]`}),(0,K.jsxs)(V,{disabled:l||!s.trim(),onClick:()=>void p(s.trim()),"data-tip":`Read the export at this path`,children:[(0,K.jsx)(m,{"aria-hidden":`true`}),l?`Reading…`:`Read`]})]})}),d&&(0,K.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:d}),l&&!d&&(0,K.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Reading the export…`}),r&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(nt,{s:r}),(0,K.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,K.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:`Test cases to convert`}),(0,K.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:r.test_cases.map(e=>{let t=e.route===`web`||(e.routes?.web??0)>0;return(0,K.jsx)(`li`,{className:`border-b border-line-soft last:border-b-0`,children:(0,K.jsxs)(`label`,{className:B(`flex min-h-11 items-start gap-3 px-4 py-2.5`,t?`cursor-pointer`:``),children:[(0,K.jsx)(oe,{className:`mt-0.5`,disabled:!t,checked:t&&a.has(e.id),onCheckedChange:()=>h(e.id)}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`font-medium text-ink [overflow-wrap:anywhere]`,children:e.name}),(0,K.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[e.folders.join(` / `)||`–`,` · `,q(e.steps,`step`),` · `,q(e.asserts,`check`),e.unsupported?` · ${e.unsupported} not convertible`:``,e.suites.length?` · in ${e.suites.join(`, `)}`:``]})]}),(0,K.jsx)(F,{tone:t?`neutral`:`warn`,children:e.route===`web`?Y.web:t?`${Y.web} + notes`:`${Y[e.route]||e.route}: later`})]})},e.id)})})]}),r.env.length>0&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:`Environment variables`}),(0,K.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[r.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`. Their values are never in the export; you set them before the tests run.`]})]})]})]})}function it({view:e,to:t,setTo:n,into:r,setInto:i,attr:a,setAttr:o}){let s=e=>e.split(`-`)[0],c=e=>e.split(`-`).slice(1).join(`-`),l=[...new Map(e.targets.map(e=>[s(e.id),e.framework])).entries()],u=e.targets.filter(e=>s(e.id)===s(t));return(0,K.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,K.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Framework`}),(0,K.jsx)(`div`,{role:`radiogroup`,"aria-label":`Framework`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2.5`,children:l.map(([r,i])=>{let a=ue[r];return(0,K.jsx)(et,{on:s(t)===r,onPick:()=>n((e.targets.find(e=>s(e.id)===r&&c(e.id)===c(t))||e.targets.find(e=>s(e.id)===r)).id),logo:a?(0,K.jsx)(a,{width:22,height:22,"aria-hidden":`true`}):null,title:i,sub:Ze[r],label:i},r)})})]}),(0,K.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,K.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Language`}),(0,K.jsx)(`div`,{role:`radiogroup`,"aria-label":`Language`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2.5`,children:u.map(e=>{let r=le[c(e.id)];return(0,K.jsx)(et,{on:t===e.id,onPick:()=>n(e.id),logo:r?(0,K.jsx)(r,{width:22,height:22,"aria-hidden":`true`}):null,title:e.language,label:e.language},e.id)})})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 @2xl:grid-cols-2`,children:[(0,K.jsx)($,{id:`tsc-into`,label:`Output folder`,help:`A new folder. Empty: named after the target.`,children:(0,K.jsx)(z,{id:`tsc-into`,value:r,spellCheck:!1,maxLength:300,placeholder:`tosca-${t}`,onChange:e=>i(e.target.value)})}),(0,K.jsx)($,{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,K.jsx)(z,{id:`tsc-attr`,value:a,spellCheck:!1,maxLength:40,placeholder:`data-automation-id`,onChange:e=>o(e.target.value.replace(/[^A-Za-z0-9_-]/g,``))})})]})]})}function at({view:e,file:t,found:n,only:r,to:i,instructions:a}){let o=e.targets.find(e=>e.id===i),s=(e,t)=>(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-b border-line-soft py-3.5 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:e}),(0,K.jsx)(`div`,{className:`text-sm`,children:t})]});return(0,K.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col rounded-[14px] card border p-5`,children:[s(`Export`,t?(0,K.jsx)(`span`,{className:`font-mono text-[12.5px] [overflow-wrap:anywhere]`,children:t}):(0,K.jsx)(`span`,{className:`text-muted`,children:`Not picked yet`})),s(`Test cases`,n?(0,K.jsxs)(`span`,{children:[r.size,` of `,n.test_cases.length,` picked`]}):(0,K.jsx)(`span`,{className:`text-muted`,children:`–`})),s(`Target`,o?(0,K.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,K.jsx)(H,{framework:o.id.split(`-`)[0],language:o.id.split(`-`).slice(1).join(`-`)}),o.title]}):(0,K.jsx)(`span`,{className:`text-muted`,children:`–`})),s(`Instructions`,a.trim()?(0,K.jsx)(`span`,{className:`line-clamp-3 text-ink-2`,children:a.trim()}):(0,K.jsx)(`span`,{className:`text-muted`,children:`None`}))]})}function ot({view:e,review:r,onStart:i}){let[a,s]=(0,G.useState)(0),[c,l]=(0,G.useState)(0),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(null),[m,h]=(0,G.useState)(new Set),[g,_]=(0,G.useState)(e.targets[0]?.id||``),[v,b]=(0,G.useState)(``),[x,S]=(0,G.useState)(``),[C,w]=(0,G.useState)(``),[T,E]=(0,G.useState)(null),[D,O]=(0,G.useState)(!1),[k,A]=(0,G.useState)(!1),[j,P]=(0,G.useState)(``),F=[...m].sort().join(`,`);(0,G.useEffect)(()=>{E(null),O(!1),l(e=>Math.min(e,2))},[u,F,g,v,x,C]);let I=e=>{s(e),l(t=>Math.max(t,e)),P(``)},ee=async()=>{A(!0),P(``);try{let e=!f||f.test_cases.filter(e=>e.route===`web`||(e.routes?.web??0)>0).every(e=>m.has(e.id)),t=await N.plan({file:u,to:g,...v.trim()?{into:v.trim()}:{},...e?{}:{only:[...m]},...C.trim()?{instructions:C.trim()}:{},...x?{testAttributes:[x]}:{}});E(t),I(3)}catch(e){P(e.message)}finally{A(!1)}},L=T?.plan,R=L?.feasibility.findings.some(e=>e.level===`limit`),z=L?.feasibility.verdict===`blocked`;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,K.jsx)(Qe,{at:a,reached:c,onGo:e=>!k&&(e<3||T)&&s(e)}),(0,K.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,K.jsxs)(`section`,{"aria-labelledby":`tsc-step`,className:`flex min-w-0 flex-col gap-5`,children:[(0,K.jsx)(`h2`,{id:`tsc-step`,className:`m-0 text-[22px] font-semibold tracking-[-0.01em]`,children:[`Which Tosca export?`,`What should the tests become?`,`Anything the agent should know?`,`Review and start`][a]}),j&&(0,K.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:j}),a===0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(rt,{view:e,file:u,setFile:d,found:f,setFound:p,only:m,setOnly:h}),(0,K.jsx)($e,{busy:k,next:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(y,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>I(1),disabled:!f||!m.size,aside:f&&!m.size?(0,K.jsx)(`span`,{className:`text-muted`,children:`Pick at least one web test case.`}):void 0})]}),a===1&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(it,{view:e,to:g,setTo:_,into:v,setInto:b,attr:x,setAttr:S}),(0,K.jsx)($e,{busy:k,onBack:()=>s(0),next:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(y,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>I(2),disabled:!g})]}),a===2&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)($,{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,K.jsx)(M,{id:`tsc-instructions`,value:C,rows:6,maxLength:4e3,placeholder:`Page objects go in pages/, one class per Tosca module.`,onChange:e=>w(e.target.value)})}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Xe.map(e=>(0,K.jsxs)(`button`,{type:`button`,disabled:C.includes(e),onClick:()=>w(C.trim()?`${C.trim()}\n${e}`:e),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-[8px] border-0 bg-surface-strong px-2.5 text-[13px] text-ink hover:bg-line disabled:cursor-default disabled:opacity-50`,children:[(0,K.jsx)(n,{size:13,"aria-hidden":`true`}),e]},e))}),(0,K.jsx)($e,{busy:k,onBack:()=>s(1),next:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(t,{"aria-hidden":`true`}),k?`Checking…`:`Check`]}),onNext:()=>void ee(),aside:(0,K.jsx)(`span`,{className:`text-muted`,children:`Nothing is changed yet.`})})]}),a===3&&L&&(0,K.jsxs)(K.Fragment,{children:[r(L,D,O),(0,K.jsx)($e,{busy:k,onBack:()=>s(2),next:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(o,{"aria-hidden":`true`}),`Start`]}),disabled:z||R&&!D,onNext:()=>i(T,!!R&&D),aside:(0,K.jsx)(`span`,{className:`text-muted`,children:z?`Change what is not possible first.`:R&&!D?`Accept the limits to start.`:`Runs in the background.`})})]})]}),(0,K.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,K.jsx)(at,{view:e,file:u,found:f,only:m,to:g,instructions:C})})]})]})}function st({children:e,wide:t}){return(0,K.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,K.jsx)(L,{}),(0,K.jsx)(`main`,{className:B(R,`@container flex-auto gap-5`,t?`max-w-[1480px]`:`max-w-[1180px]`),children:e})]})}function ct({action:e}){return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(D,{pixel:ne.tosca,size:`lg`}),(0,K.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Tosca`})]}),(0,K.jsx)(se,{label:`Migration`,links:ce,current:`tosca`}),(0,K.jsx)(`span`,{className:`flex-1`}),e]})}function lt({error:e}){return e?(0,K.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e}):null}function ut({title:e,children:t}){let[n,r]=(0,G.useState)(!1),i=(0,G.useId)();return(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":n,"aria-controls":i,onClick:()=>r(!n),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 self-start rounded-[8px] border-0 bg-transparent px-1 text-sm font-medium text-ink hover:bg-surface-strong`,children:[(0,K.jsx)(u,{size:15,"aria-hidden":`true`,className:B(`transition-transform`,n&&`rotate-180`)}),e]}),(0,K.jsx)(w,{open:n,id:i,children:t})]})}function dt({plan:e,accepted:t,onAccept:n}){let r=e.feasibility.findings.filter(e=>e.level===`blocker`),i=e.feasibility.findings.filter(e=>e.level===`limit`),a=e.cases.filter(e=>e.included),o=e.units.filter(e=>e.kind===`page`).length;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsxs)(`dl`,{className:`m-0 grid gap-x-6 gap-y-2.5 rounded-[14px] card border px-5 py-4 text-sm @xl:grid-cols-[auto_1fr]`,children:[(0,K.jsx)(`dt`,{className:`text-muted`,children:`From`}),(0,K.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[`Tricentis Tosca`,(0,K.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,(0,K.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:e.source.file}),e.source.project?` · ${e.source.project}`:``]})]}),(0,K.jsx)(`dt`,{className:`text-muted`,children:`To`}),(0,K.jsxs)(`dd`,{className:`m-0`,children:[e.target.title,(0,K.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.target.dir]})]}),(0,K.jsx)(`dt`,{className:`text-muted`,children:`Files`}),(0,K.jsxs)(`dd`,{className:`m-0`,children:[a.length,` test`,a.length===1?``:`s`,` of `,e.cases.length,` test case`,e.cases.length===1?``:`s`,`, `,o,` page object`,o===1?``:`s`]}),(e.suites||[]).length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`dt`,{className:`text-muted`,children:`Suites`}),(0,K.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[e.suites.map(e=>`${e.name} (${q(e.cases.length,`test`)})`).join(`, `),(0,K.jsxs)(`span`,{className:`block text-[12.5px] text-muted`,children:[`Tosca's execution lists, as tags on the tests: `,e.suites.map(e=>`@${e.tag}`).join(`, `),`.`]})]})]}),e.env.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`dt`,{className:`text-muted`,children:`Environment variables`}),(0,K.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[e.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),(0,K.jsx)(`span`,{className:`block text-[12.5px] text-muted`,children:`Never in the export: you set them before the tests run.`})]})]}),e.instructions&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`dt`,{className:`text-muted`,children:`Instructions`}),(0,K.jsx)(`dd`,{className:`m-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.instructions})]})]}),r.length>0&&(0,K.jsxs)(`section`,{"aria-labelledby":`tsc-blockers`,className:`flex flex-col gap-2 rounded-[14px] bg-fail-soft px-5 py-4`,children:[(0,K.jsxs)(`h3`,{id:`tsc-blockers`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-fail`,children:[(0,K.jsx)(p,{size:16,"aria-hidden":`true`}),`Not possible`]}),(0,K.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-5 text-sm text-ink`,children:r.map(e=>(0,K.jsx)(`li`,{children:e.text},e.code))})]}),i.length>0&&(0,K.jsxs)(`section`,{"aria-labelledby":`tsc-limits`,className:`flex flex-col gap-3 rounded-[14px] bg-warn-soft px-5 py-4`,children:[(0,K.jsxs)(`h3`,{id:`tsc-limits`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-warn`,children:[(0,K.jsx)(p,{size:16,"aria-hidden":`true`}),`Before you start`]}),(0,K.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1.5 pl-5 text-sm text-ink`,children:i.map(e=>(0,K.jsx)(`li`,{children:e.text},e.code))}),n&&!r.length&&(0,K.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center gap-2 text-sm font-medium`,children:[(0,K.jsx)(oe,{checked:!!t,onCheckedChange:n}),`I understand`]})]}),(0,K.jsx)(ut,{title:`Test cases (${e.cases.length})`,children:(0,K.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:e.cases.map(e=>(0,K.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-3 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,K.jsx)(`span`,{className:B(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.included?`text-ink`:`text-muted`),children:e.name}),(0,K.jsx)(`span`,{className:`text-muted`,children:e.included?`${q(e.steps,`step`)} · ${q(e.asserts,`check`)}`:e.why}),(0,K.jsx)(`span`,{className:`w-16 flex-none text-right text-muted`,children:Y[e.route]||e.route})]},e.id))})}),(0,K.jsx)(ut,{title:`Files, in order (${e.units.length})`,children:(0,K.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:e.units.map(e=>(0,K.jsxs)(`li`,{className:`flex flex-wrap gap-x-3 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,K.jsx)(`span`,{className:`w-16 flex-none text-muted`,children:_e[e.kind]}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:e.target})]},e.id))})})]})}function ft({plan:e,acceptLimits:t,onClose:n,onStarted:i}){let[a,s]=(0,G.useState)(``),[c,l]=(0,G.useState)(!1),[u,d]=(0,G.useState)(``),f=async()=>{l(!0),d(``);try{i((await N.start(e.id,a,t)).detail)}catch(e){d(e.message),l(!1)}};return(0,K.jsx)(E,{open:!0,onClose:n,title:`Start the conversion`,description:`The Tosca test cases are written as ${e.target.title} tests in ${e.target.dir}, and ForgeQE runs each one. It runs in the background; the Tosca export is not changed.`,footer:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(V,{variant:`ghost`,onClick:n,children:[(0,K.jsx)(r,{"aria-hidden":`true`}),`Cancel`]}),(0,K.jsxs)(V,{variant:`primary`,disabled:c||a!==e.id,onClick:()=>void f(),"data-tip":`Start the conversion`,children:[(0,K.jsx)(o,{"aria-hidden":`true`}),`Start`]})]}),children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,K.jsxs)(`span`,{children:[`Type `,(0,K.jsx)(`span`,{className:`font-mono`,children:e.id}),` to confirm`]}),(0,K.jsx)(z,{value:a,onChange:e=>s(e.target.value),autoComplete:`off`,spellCheck:!1})]}),(0,K.jsx)(lt,{error:u})]})})}function pt({d:e,onStarted:t}){let[n,r]=(0,G.useState)(!1),[i,a]=(0,G.useState)(!1),s=e.plan.feasibility.findings.some(e=>e.level===`limit`),c=e.plan.feasibility.verdict===`blocked`,l=!!e.job?.running;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[e.job?.last&&!l&&(0,K.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:`The last start did not run. Its job's log on the Jobs page says why.`}),(0,K.jsx)(dt,{plan:e.plan,accepted:e.confirmed||n,onAccept:e.confirmed?void 0:r}),!c&&!l&&(0,K.jsx)(`div`,{children:(0,K.jsxs)(V,{variant:`primary`,disabled:!e.confirmed&&s&&!n,onClick:()=>a(!0),"data-tip":`Start the conversion`,children:[(0,K.jsx)(o,{"aria-hidden":`true`}),`Start`]})}),i&&(0,K.jsx)(ft,{plan:e.plan,acceptLimits:s&&(e.confirmed||n),onClose:()=>a(!1),onStarted:e=>{a(!1),t(e)}})]})}function mt(e){return e.result?.status===`running`?`running`:e.result?.status===`converted`?`done`:e.result?`review`:`planned`}function ht(e){return e.result?ge[e.result.status]:e.confirmed?{label:`Confirmed`,tone:`neutral`}:he[e.verdict]}var gt=e=>e.slice(e.lastIndexOf(`/`)+1);function _t({view:e}){let[t,n]=(0,G.useState)(`all`),r=t=>t===`all`?e.plans.length:e.plans.filter(e=>mt(e)===t).length,i=e.plans.filter(e=>t===`all`||mt(e)===t),a=e=>location.hash=k(`tosca`,e);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(de,{children:[(0,K.jsx)(W,{label:`All`,value:r(`all`),onClick:()=>n(`all`),on:t===`all`}),(0,K.jsx)(W,{label:`Running`,value:r(`running`),onClick:()=>n(`running`),on:t===`running`}),(0,K.jsx)(W,{label:`Converted`,value:r(`done`),tone:r(`done`)?`text-pass`:void 0,onClick:()=>n(`done`),on:t===`done`}),(0,K.jsx)(W,{label:`Needs review`,value:r(`review`),tone:r(`review`)?`text-warn`:void 0,onClick:()=>n(`review`),on:t===`review`})]}),(0,K.jsx)(C,{label:`Conversions`,placeholder:`Find a conversion`,empty:t===`all`?`No conversions.`:`None here.`,resetKey:t,head:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Conversion`}),(0,K.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Tests`}),(0,K.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Status`}),(0,K.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Updated`})]}),children:i.map(e=>{let t=ht(e),n=e.result?e.result.status===`converted`||e.result.endedAt?100:Math.min(99,Math.round(e.result.done/Math.max(1,e.units||e.tests+1)*95)):0;return(0,K.jsxs)(`tr`,{onClick:()=>a(e.id),className:A,children:[(0,K.jsx)(`td`,{className:j,children:(0,K.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`hidden flex-none items-center gap-1 @xl:inline-flex`,"aria-hidden":`true`,children:(0,K.jsx)(H,{framework:e.targetId.split(`-`)[0],language:e.targetId.split(`-`).slice(1).join(`-`),size:18})}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsxs)(`a`,{href:k(`tosca`,e.id),onClick:e=>e.stopPropagation(),className:`font-medium text-ink no-underline hover:underline`,children:[gt(e.file),` to `,e.target]}),(0,K.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[e.project?`${e.project} · `:``,e.into]})]})]})}),(0,K.jsx)(`td`,{className:B(j,`w-[180px] text-[13px]`),children:e.result?.status===`running`?(0,K.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(me,{value:n,label:`${gt(e.file)} to ${e.target}: progress`}),(0,K.jsxs)(`span`,{className:`w-9 flex-none text-right text-[12px] text-muted tabular-nums`,children:[n,`%`]})]}):e.result?(0,K.jsxs)(`span`,{className:e.result.converted===e.tests?`text-pass`:`text-ink-2`,children:[e.result.converted,` of `,e.tests,` pass`]}):(0,K.jsx)(`span`,{className:`text-muted`,children:`Not started`})}),(0,K.jsx)(`td`,{className:B(j,`whitespace-nowrap`),children:(0,K.jsx)(F,{tone:t.tone,children:t.label})}),(0,K.jsx)(`td`,{className:B(j,`hidden text-[12.5px] whitespace-nowrap text-muted @xl:table-cell`),children:ae(e.result?.endedAt||e.result?.at||e.createdAt)})]},e.id)})})]})}function vt({sub:e}){let[t,r]=(0,G.useState)(null),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(null),l=(0,G.useCallback)(()=>{N.list().then(e=>{r(e),a(``)},e=>a(e.message))},[]);(0,G.useEffect)(l,[l,e]);let u=t?.plans.some(e=>e.result?.status===`running`);(0,G.useEffect)(()=>{if(!u||e)return;let t=setInterval(l,3e3);return()=>clearInterval(t)},[u,e,l]);let d=e?.match(/^(tsc-\d{8}-\d{6}-[0-9a-f]{4})\/report$/),f=e&&/^tsc-\d{8}-\d{6}-[0-9a-f]{4}$/.test(e)?e:d?.[1]||``,p=!!d,m=()=>location.hash=k(`tosca`,`new`),h=!t&&!i&&(0,K.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});return e===`new`?(0,K.jsxs)(st,{children:[(0,K.jsx)(ct,{}),(0,K.jsx)(lt,{error:i}),h,t&&(0,K.jsx)(ot,{view:t,review:(e,t,n)=>(0,K.jsx)(dt,{plan:e,accepted:t,onAccept:n}),onStart:(e,t)=>s({d:e,accept:t})}),o&&(0,K.jsx)(ft,{plan:o.d.plan,acceptLimits:o.accept,onClose:()=>s(null),onStarted:e=>{s(null),location.hash=k(`tosca`,e.plan.id)}})]}):f&&p?(0,K.jsxs)(st,{wide:!0,children:[(0,K.jsx)(ct,{}),(0,K.jsx)(qe,{id:f},f)]}):f?(0,K.jsxs)(st,{wide:!0,children:[(0,K.jsx)(ct,{}),(0,K.jsx)(lt,{error:i}),h,t&&(0,K.jsx)(Re,{id:f,plan:(e,t)=>(0,K.jsx)(pt,{d:e,onStarted:t})},f)]}):(0,K.jsxs)(st,{children:[(0,K.jsx)(ct,{action:t&&!t.plans.length?void 0:(0,K.jsxs)(V,{variant:`primary`,disabled:!t,onClick:m,"data-tip":`New conversion`,children:[(0,K.jsx)(n,{"aria-hidden":`true`}),`New`]})}),(0,K.jsx)(lt,{error:i}),h,t&&(t.plans.length?(0,K.jsx)(_t,{view:t}):(0,K.jsx)(P,{icon:c,title:`No Tosca conversions yet`,action:(0,K.jsxs)(V,{size:`sm`,onClick:m,"data-tip":`New conversion`,children:[(0,K.jsx)(n,{"aria-hidden":`true`}),`New`]}),children:`Pick a Tosca export (.tsu) in this project and the framework its test cases become. Every Tosca step and check is kept, and nothing starts until you confirm.`}))]})}export{vt as Tosca};
@@ -1 +0,0 @@
1
- import{D as e,Ir as t,Nr as n,o as r}from"./line-icons-CQ-3V8ax.js";import{Ft as i,Pt as a,Sn as o,ht as s,r as c,t as l,vr as u,wt as d,xn as f}from"./frame-D3IhgCFt.js";import{_ as p,g as m,h,v as g,y as _}from"./index-v-k_CVn7.js";var v=t(n(),1),y=u(),b={new:{label:`New`,tone:`running`},improved:{label:`Improved`,tone:`neutral`},fixed:{label:`Fixed`,tone:`pass`}};function x({change:t,id:n,first:a}){let[o,c]=(0,v.useState)(!1),l=p(t);return(0,y.jsxs)(`li`,{className:f(!a&&`border-t border-line-soft`),children:[(0,y.jsxs)(`button`,{type:`button`,"aria-expanded":o,"aria-controls":n,onClick:()=>c(!o),className:`flex min-h-11 w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-3 py-2.5 text-left text-sm text-ink hover:bg-surface-muted`,children:[(0,y.jsx)(s,{tone:b[t.kind].tone,icon:!1,className:`w-[76px] justify-center`,children:b[t.kind].label}),(0,y.jsx)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:t.title}),(0,y.jsx)(e,{size:16,"aria-hidden":`true`,className:f(`flex-none text-muted transition-transform duration-200`,o&&`rotate-90`)})]}),(0,y.jsx)(i,{open:o,id:n,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-2 px-3 pt-1 pb-3 sm:pl-[100px]`,children:[(0,y.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:t.detail}),l&&(0,y.jsxs)(`a`,{href:l,className:`inline-flex items-center gap-1 self-start text-[13px] font-medium`,children:[`Open`,(0,y.jsx)(r,{size:13,"aria-hidden":`true`})]})]})})]})}function S({release:e}){let t=e===h;return(0,y.jsxs)(`li`,{className:`relative flex gap-4 pb-8`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:f(`relative mt-1.5 size-[15px] flex-none rounded-full border-[3px] border-bg`,t?`bg-accent`:`bg-line`)}),(0,y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,y.jsxs)(`h3`,{className:`m-0 text-[15px] font-semibold`,children:[`ForgeQE `,e.version]}),t&&(0,y.jsx)(s,{tone:`running`,icon:!1,children:`Latest`}),(0,y.jsxs)(`span`,{className:`text-sm text-muted`,children:[(0,y.jsx)(`time`,{dateTime:e.date,children:_(e.date)}),` · `,o(e.changes.length,`change`)]})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:e.summary}),(0,y.jsx)(`ul`,{className:`m-0 flex list-none flex-col overflow-hidden rounded-[12px] card border p-0`,children:e.changes.map((t,n)=>(0,y.jsx)(x,{change:t,first:n===0,id:`change-${e.version}-${n}`},n))})]})]})}function C({embedded:e=!1}={}){(0,v.useEffect)(g,[]);let t=m(),n=(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)(`div`,{className:`relative flex flex-col gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[60px] bottom-10 left-[7px] w-px bg-line`}),t.map(e=>(0,y.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,y.jsx)(`h2`,{className:`m-0 pl-[31px] text-[22px] font-semibold`,children:e.month}),(0,y.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.releases.map(e=>(0,y.jsx)(S,{release:e},e.version))})]},e.month))]})});return e?(0,y.jsx)(`div`,{className:`flex flex-col gap-5`,children:n}):(0,y.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,y.jsx)(c,{}),(0,y.jsxs)(`main`,{className:f(l,`flex-auto gap-5`),children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,y.jsx)(a,{pixel:d[`whats-new`],size:`lg`}),(0,y.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`What's new`})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`What each release of ForgeQE added, improved and fixed. Pick a change to read more.`}),n]})]})}export{b as KIND,C as WhatsNew};
@@ -1,3 +0,0 @@
1
- import{$n as e,Ir as t,Nr as n}from"./line-icons-CQ-3V8ax.js";import{$ as r,It as i,Rn as a,Sn as o,bn as s,ht as c,it as l,lt as u,nt as d,rt as f,st as p,vr as m,xn as h,yn as g}from"./frame-D3IhgCFt.js";import"./index-v-k_CVn7.js";var _=t(n(),1),v=m(),y={test:[`Testing the connection`,`Tested the connection`,`waiting`],tables:[`Reading the tables`,`Read the tables`,`searching`],query:[`Running the query`,`Ran the query`,`working`],gen:[`Making a preview`,`Made a preview`,`writing`],files:[`Writing the files`,`Wrote the files`,`writing`],insert:[`Inserting test data`,`Inserted test data`,`working`],batches:[`Listing the batches`,`Listed the batches`,`searching`],clean:[`Removing a batch`,`Removed a batch`,`working`],request:[`Asking the DB agent for test data`,`Asked the DB agent for test data`,`thinking`],fetch:[`Fetching the request again`,`Fetched the request again`,`searching`],ask:[`Asking the DB agent`,`Asked the DB agent`,`thinking`],checks:[`Running the checks`,`Ran the checks`,`working`],map:[`Reading the schema`,`Read the schema`,`searching`],check:[`Checking the flows`,`Checked the flows`,`working`],trace:[`Following the record`,`Followed the record`,`searching`]};function b(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(``),[i,o]=(0,_.useState)(!1),s=(0,_.useCallback)(()=>{a.view().then(e=>{t(e),r(``)},e=>r(e.message))},[]);(0,_.useEffect)(s,[s]);let c=!!e?.job?.running;return(0,_.useEffect)(()=>{if(!c)return;let e=setInterval(s,1e3);return()=>clearInterval(e)},[c,s]),{view:e,error:n,busy:i||c,running:c,act:async(e,t)=>{o(!0),r(``);try{await a.run(e,t),s()}catch(e){r(e.message)}finally{o(!1)}},stop:()=>void a.stop().then(s),load:s,job:e?.job??null}}var x=e=>e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e);function S({file:e,onNote:t}){return(0,v.jsx)(`button`,{type:`button`,"data-tip":e,onClick:async()=>t(await i(e)),className:h(s({size:`sm`}),`font-mono text-[12px]`),children:e.split(/[\\/]/).pop()})}function C({children:e,label:t}){return(0,v.jsx)(`pre`,{"aria-label":t,className:`m-0 max-h-[320px] overflow-auto rounded-[12px] bg-surface-muted p-3 font-mono text-[12px] leading-relaxed whitespace-pre text-ink-2`,children:e})}function w({job:t,onStop:n}){let[r,i,a]=y[t.kind]??[`Working`,`Done`,`working`],s=(0,_.useRef)(null);(0,_.useEffect)(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[t.lines.length]);let l=t.exitCode===0,u=!l&&(t.kind===`check`||t.kind===`trace`)&&t.result!==void 0&&!t.result.error;return(0,v.jsxs)(`section`,{"aria-label":t.running?r:i,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,v.jsxs)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:[t.running?r:i,t.target?(0,v.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,t.target]}):null]}),(0,v.jsx)(c,{tone:t.running?`running`:l?`pass`:t.exitCode===2||u?`warn`:`fail`,orb:a,children:t.running?`Working`:l?`Done`:u?`Some broken`:t.exitCode===2?`Not done`:`Failed`}),t.running&&(0,v.jsxs)(g,{variant:`danger`,onClick:n,children:[(0,v.jsx)(e,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,v.jsxs)(`details`,{open:t.running||!l&&!t.result,children:[(0,v.jsxs)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:[`Output (`,o(t.lines.length,`line`),`)`]}),(0,v.jsx)(`code`,{className:`mt-2 block font-mono text-[12px] text-muted [overflow-wrap:anywhere]`,children:t.command}),(0,v.jsx)(`pre`,{ref:s,className:`mt-2 max-h-[240px] overflow-auto rounded-[10px] bg-surface-muted p-3 font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:t.lines.join(`
2
- `)||`Starting…`})]})]})}function T({text:e}){return(0,v.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e})}function E({columns: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,v.jsx)(r,{label:`Rows`,resetKey:t,head:e.map((e,t)=>(0,v.jsx)(`th`,{className:n[t]?f:d,children:e},e)),children:t.map((e,t)=>(0,v.jsx)(`tr`,{className:l,children:e.map((e,t)=>(0,v.jsx)(`td`,{"data-tip":x(e),className:h(`px-3 py-1.5 font-mono text-[12px]`,n[t]?`text-right whitespace-nowrap tabular-nums`:`max-w-[320px] truncate`,e==null&&`text-muted`),children:x(e)},t))},t))})}function D({r:e}){return(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(e.order||[]).map(t=>{let n=e.preview?.[t],r=n?.sample||[],i=r.length?Object.keys(r[0]):[];return(0,v.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,v.jsxs)(`span`,{className:`text-sm`,children:[(0,v.jsx)(`span`,{className:`font-medium`,children:t}),` · `,o(e.rows?.[t]??0,`row`),n?.database_fills?.length?(0,v.jsxs)(`span`,{className:`text-muted`,children:[` · the database fills `,n.database_fills.join(`, `)]}):null,e.masked?.[t]?.length?(0,v.jsxs)(`span`,{className:`text-muted`,children:[` · masked `,e.masked[t].join(`, `)]}):null]}),i.length>0&&(0,v.jsx)(E,{columns:i,rows:r.slice(0,3).map(e=>i.map(t=>e[t]))})]},t)}),(e.warnings||[]).map((e,t)=>(0,v.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:e},t))]})}var O={query:`Existing rows`,generate:`New rows`};function k({r:e,onNote:t}){let n=Object.entries(e.rows||{});return(0,v.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(c,{tone:`pass`,children:O[e.kind||``]||`Answered`}),(0,v.jsxs)(`span`,{className:`min-w-0 text-sm text-ink-2 [overflow-wrap:anywhere]`,children:[e.database,e.why?` · ${e.why}`:``]})]}),n.map(([t,n])=>(0,v.jsx)(A,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,v.jsx)(`span`,{className:`text-sm font-medium`,children:`The query, as the database checked it`}),(0,v.jsx)(C,{label:`SQL`,children:e.sql})]}),e.script_preview&&e.script_preview.length>0&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,v.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script for these rows, not run`}),(0,v.jsx)(C,{label:`INSERT script`,children:e.script_preview.join(`
3
- `)})]}),e.files?.length?(0,v.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Kept`,e.files.map(e=>(0,v.jsx)(S,{file:e,onNote:t},e))]}):null,e.replay&&(0,v.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Tests and pipelines get the same data with `,(0,v.jsx)(`code`,{className:`font-mono text-[12px] text-ink-2`,children:e.replay}),`, without a model.`]})]})}function A({title:e,rows:t,total:n}){let r=[...new Set(t.flatMap(e=>Object.keys(e)))];return(0,v.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,v.jsxs)(`span`,{className:`text-sm`,children:[(0,v.jsx)(`span`,{className:`font-medium`,children:e}),` · `,o(n,`row`),n>t.length?(0,v.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.length,` shown`]}):null]}),r.length>0?(0,v.jsx)(E,{columns:r,rows:t.map(e=>r.map(t=>e[t]))}):(0,v.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No rows match.`})]})}function j({items:e,text:t,label:n,size:r=10,children:i}){let[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(0),l=a.toLowerCase().split(/\s+/).filter(Boolean),d=l.length?e.filter(e=>l.every(n=>t(e).toLowerCase().includes(n))):e;(0,_.useEffect)(()=>c(0),[a,e.length]);let f=Math.min(s,Math.max(0,Math.ceil(d.length/r)-1));return(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.length>r&&(0,v.jsx)(u,{id:`find-${n.toLowerCase().replace(/\W+/g,`-`)}`,label:`Find in ${n.toLowerCase()}`,value:a,onChange:o,className:`flex-none`}),d.length?(0,v.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:d.slice(f*r,f*r+r).map(i)}):(0,v.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing matches.`}),d.length>r&&(0,v.jsx)(p,{page:f,size:r,total:d.length,onPage:c,label:`Pages of ${n.toLowerCase()}`})]})}export{w as a,T as c,x as d,b as f,D as i,E as l,C as n,O as o,S as r,j as s,k as t,A as u};
@@ -1 +0,0 @@
1
- import{Rt as e}from"./frame-D3IhgCFt.js";var t=[{id:`runs`,label:`Runs`,href:e(`runs`)},{id:`reports`,label:`Execution reports`,href:e(`reports`)},{id:`reports-project`,label:`Project report`,href:e(`reports`,`project`)},{id:`run-diff`,label:`Run diff`,href:e(`run-diff`)},{id:`flaky`,label:`Flaky tests`,href:e(`flaky`)}],n=[{id:`migration`,label:`Migration`,href:e(`migration`)},{id:`tosca`,label:`Tosca`,href:e(`tosca`)}],r=[{id:`evidence-contracts`,label:`Contracts`,href:e(`evidence-contracts`)},{id:`evidence-releases`,label:`Releases`,href:e(`evidence-releases`)},{id:`evidence-learn`,label:`Learn`,href:e(`evidence-learn`)},{id:`evidence-monitor`,label:`Monitor`,href:e(`evidence-monitor`)}];export{n,t as r,r as t};