@capagents/forgeqe 3.3.7 → 3.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HOW_TO_USE.md +92 -0
- package/dist/a11y-runtime.mjs +3204 -0
- package/dist/docs-site/docs/area-quality/index.html +90 -2
- package/dist/docs-site/docs/overview/index.html +1 -1
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/forgeqe.js +2215 -2094
- package/dist/template.html +69 -70
- package/dist/web/assets/{3d-force-graph-Bsispdm1.js → 3d-force-graph-BPsVSYjw.js} +1 -1
- package/dist/web/assets/Agent-DY6pRvcD.js +10 -0
- package/dist/web/assets/{AgentWork-BugEUl60.js → AgentWork-Brch_Mn3.js} +1 -1
- package/dist/web/assets/ApiTests-BtWKVPw5.js +17 -0
- package/dist/web/assets/{Browse-Dl2Lneca.js → Browse-DbIFxsy8.js} +1 -1
- package/dist/web/assets/Chat-BWiH0XGV.js +3 -0
- package/dist/web/assets/{CommandPalette-B7YPDCOk.js → CommandPalette-DfoEUEL6.js} +1 -1
- package/dist/web/assets/{Compare-D6XsFmmb.js → Compare-DTZ_BW1P.js} +1 -1
- package/dist/web/assets/Cost-DDghPWch.js +1 -0
- package/dist/web/assets/Data-DZlKsTwA.js +6 -0
- package/dist/web/assets/Desktop-DTIZ62Pi.js +1 -0
- package/dist/web/assets/DesktopReview-B8-dSGJH.js +2 -0
- package/dist/web/assets/Evidence-BYw_Q4Ul.js +1 -0
- package/dist/web/assets/Explore-BL_c5WK1.js +2 -0
- package/dist/web/assets/{Features-N3_77mz-.js → Features-DrFNrvbh.js} +1 -1
- package/dist/web/assets/Flags-CHrDwhqG.js +2 -0
- package/dist/web/assets/Flaky-DtcLf8h6.js +1 -0
- package/dist/web/assets/Impact-CMU_ijo2.js +3 -0
- package/dist/web/assets/Jobs-BjybdQb_.js +5 -0
- package/dist/web/assets/KindPage-VK-Vgkzv.js +6 -0
- package/dist/web/assets/{LiveDevice-j7NZXIJZ.js → LiveDevice-BqL1P33F.js} +1 -1
- package/dist/web/assets/Migration-7BI7iXIv.js +8 -0
- package/dist/web/assets/Mobile-AgAhvlVL.js +1 -0
- package/dist/web/assets/Observability-5r36Xf3d.js +1 -0
- package/dist/web/assets/{OwnItems-BdiPfdTw.js → OwnItems-CqCOuvba.js} +4 -4
- package/dist/web/assets/PageAgent-00NQxK49.js +1 -0
- package/dist/web/assets/Product-B75ztJFn.js +6 -0
- package/dist/web/assets/Production-lIUlcjf0.js +1 -0
- package/dist/web/assets/Quality-BlRpB6mx.js +1 -0
- package/dist/web/assets/Readiness-CesaSDtp.js +1 -0
- package/dist/web/assets/Record-CLy9jQ5N.js +1 -0
- package/dist/web/assets/Regression-BjpZrkfK.js +5 -0
- package/dist/web/assets/{RelationGraph-Blfs7PhK.js → RelationGraph-ClPBGuMw.js} +1 -1
- package/dist/web/assets/{Reports-HQkTX4Kr.js → Reports-Du8SNiHM.js} +2 -2
- package/dist/web/assets/Requirements-Dr1iLoMc.js +2 -0
- package/dist/web/assets/Responsive-DcD6MLzG.js +3 -0
- package/dist/web/assets/{RunDiff-75a-smeg.js → RunDiff-cLSFOsfC.js} +1 -1
- package/dist/web/assets/{Settings-BaodIliH.js → Settings-CUT5ggDd.js} +16 -16
- package/dist/web/assets/SiteScan-iUfWBeLV.js +5 -0
- package/dist/web/assets/{Steps-ZPH_rTJh.js → Steps-DJYwIiDu.js} +2 -2
- package/dist/web/assets/{TestData-DUlTo5qt.js → TestData-DqEcL5o4.js} +2 -2
- package/dist/web/assets/TestManagement-mBcfWTVH.js +4 -0
- package/dist/web/assets/{WhatsNew-BrVNacPl.js → WhatsNew-DrPf6l9-.js} +1 -1
- package/dist/web/assets/{agentSettingsSheet-UCqUtdjq.js → agentSettingsSheet-DyaVNewv.js} +1 -1
- package/dist/web/assets/api-Dr3U7W5w.js +1 -0
- package/dist/web/assets/{choice-C4-yW2x9.js → choice-W0qOx_1k.js} +1 -1
- package/dist/web/assets/{coverage-pqIlfEP0.js → coverage-DbHm8BUP.js} +3 -3
- package/dist/web/assets/{dataParts-C0C67bVQ.js → dataParts-Bdf97ZOD.js} +3 -3
- package/dist/web/assets/{desktopAppPath-B89LKvjx.js → desktopAppPath-kQmQOW6a.js} +1 -1
- package/dist/web/assets/{flowTheme-BNKwRxun.js → flowTheme-CVnIjV_m.js} +1 -1
- package/dist/web/assets/frame-CavkQick.js +13 -0
- package/dist/web/assets/index-BaEsXdFc.css +2 -0
- package/dist/web/assets/index-C1kXcI0E.js +57 -0
- package/dist/web/assets/line-icons-Cwj9OmCz.js +1 -0
- package/dist/web/assets/{logos-P2LOMyTK.js → logos-Cf-Wf5ex.js} +1 -1
- package/dist/web/assets/{markdown-CxsWgpYs.js → markdown-Bvv6oj4v.js} +3 -3
- package/dist/web/assets/{nav-DYgvAJu-.js → nav-DVPiPhOy.js} +1 -1
- package/dist/web/assets/pageBack-Blig1Uqs.js +3 -0
- package/dist/web/assets/{palette-BgJTq_Ot.js → palette-DwrGI2Fp.js} +1 -1
- package/dist/web/assets/{paletteCommands-Isq1rLs-.js → paletteCommands-DOF2o-rv.js} +1 -1
- package/dist/web/assets/parts-DgJ2y_ic.js +1 -0
- package/dist/web/assets/{productParts-ZEi0sPIk.js → productParts-B78jij3z.js} +1 -1
- package/dist/web/assets/qualityParts-t5t9kEKG.js +2 -0
- package/dist/web/assets/{recordTest-Bz5ryzpS.js → recordTest-BbXVOuGZ.js} +1 -1
- package/dist/web/assets/{route-oDy8sV6H.js → route-9BkoTWUE.js} +1 -1
- package/dist/web/assets/{sectionList-B651VPon.js → sectionList-DMyhAqst.js} +1 -1
- package/dist/web/assets/{step-mark-CaKf4dAR.js → step-mark-Bu6fNKW8.js} +1 -1
- package/dist/web/assets/stepper-CE4yOLqn.js +1 -0
- package/dist/web/assets/wizardParts-Bxb9UG5k.js +1 -0
- package/dist/web/index.html +11 -11
- package/docs/ForgeQE-Static-Analysis-Report-4008e9ee.html +207 -0
- package/docs/ForgeQE-Static-Analysis-Report-4008e9ee.pdf +0 -0
- package/docs/{ForgeQE-Static-Analysis-Report-5bbf0da7.html → ForgeQE-Static-Analysis-Report-ccbdac00.html} +33 -33
- package/docs/ForgeQE-Static-Analysis-Report-ccbdac00.pdf +0 -0
- package/docs/user-guide.html +89 -1
- package/forgeqe.example.yaml +1 -1
- package/package.json +2 -2
- package/prompts/brain.md +7 -0
- package/py/forgeqe_engine/cli.py +57 -0
- package/py/forgeqe_engine/diagnostics.py +32 -2
- package/py/forgeqe_engine/logins.py +11 -0
- package/py/forgeqe_engine/persona.py +90 -1
- package/py/forgeqe_engine/scan.py +202 -0
- package/py/forgeqe_engine/seo.py +95 -0
- package/py/forgeqe_engine/seo_analytics.mjs +59 -0
- package/py/forgeqe_engine/seo_facts.mjs +63 -0
- package/py/forgeqe_engine/seo_site.mjs +36 -0
- package/py/forgeqe_engine/service.py +3 -2
- package/dist/web/assets/Agent-39FbaH7G.js +0 -10
- package/dist/web/assets/ApiTests-B9rtwCbe.js +0 -17
- package/dist/web/assets/Chat-DocT7FlH.js +0 -3
- package/dist/web/assets/Cost-DvbuXS6u.js +0 -1
- package/dist/web/assets/Data-BmZHJkfj.js +0 -6
- package/dist/web/assets/Desktop-DD3F69ih.js +0 -1
- package/dist/web/assets/DesktopReview-BR0LtVFw.js +0 -2
- package/dist/web/assets/Evidence-OqAiYzrl.js +0 -1
- package/dist/web/assets/Explore-QNyusEFo.js +0 -2
- package/dist/web/assets/Flags-Yv4Ttmmh.js +0 -2
- package/dist/web/assets/Flaky-Bg2f2K1U.js +0 -1
- package/dist/web/assets/Impact-CpxvVnKj.js +0 -3
- package/dist/web/assets/Jobs-_gZTxoaG.js +0 -5
- package/dist/web/assets/KindPage-Amr6R7Ym.js +0 -6
- package/dist/web/assets/Migration-DfPYzTfk.js +0 -8
- package/dist/web/assets/Mobile-fIhhQPsp.js +0 -1
- package/dist/web/assets/Observability-13DkrRp2.js +0 -1
- package/dist/web/assets/PageAgent-CC8Ha6vu.js +0 -1
- package/dist/web/assets/Product-CnXkqwQm.js +0 -6
- package/dist/web/assets/Production-5mTIt4sr.js +0 -1
- package/dist/web/assets/Quality-DbLcbP1X.js +0 -1
- package/dist/web/assets/Readiness-BG1xmC09.js +0 -1
- package/dist/web/assets/Record-sFth-2I1.js +0 -1
- package/dist/web/assets/Regression-Dd4y8I1z.js +0 -5
- package/dist/web/assets/Requirements-DmhUNCIP.js +0 -2
- package/dist/web/assets/Responsive-D18eYdCh.js +0 -3
- package/dist/web/assets/TestManagement-DUMGdHDw.js +0 -4
- package/dist/web/assets/api-D8-lxyQi.js +0 -1
- package/dist/web/assets/frame-C8sL1yo-.js +0 -13
- package/dist/web/assets/index-BFG13fbg.js +0 -55
- package/dist/web/assets/index-DBnWgocz.css +0 -2
- package/dist/web/assets/line-icons-CwCZidXs.js +0 -1
- package/dist/web/assets/pageBack-BefA2rh7.js +0 -3
- package/dist/web/assets/parts-BNpm4gXC.js +0 -1
- package/dist/web/assets/qualityParts-DtsD70Qh.js +0 -1
- package/dist/web/assets/stepper-CONWT_tv.js +0 -1
- package/dist/web/assets/wizardParts-CulZqqjz.js +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{n,r}from"./route-9BkoTWUE.js";import{L as i,R as a,l as o}from"./preload-helper-BupTYkQW.js";import{t as s}from"./utils-DJRAScIl.js";import{t as c}from"./jsx-runtime-LKYXHABd.js";import{tt as l,v as u,y as d}from"./api-Dr3U7W5w.js";import{C as f,S as p,f as m,g as h,r as g,v as _,x as v}from"./pageBack-Blig1Uqs.js";import{E as y,Er as b,Gr as x,N as S,Wn as C,Xn as w,ft as T,it as E,kr as D,nn as O,ur as k,xt as A,z as j}from"./line-icons-Cwj9OmCz.js";import{Ct as M,Mt as N,Xt as P,Yt as F,_t as I,bt as L,ft as ee}from"./frame-CavkQick.js";import{t as te}from"./when-BuWCTaKm.js";import{t as ne}from"./code-Jek8uWUO.js";import{H as R,U as re,V as z,X as ie,Z as ae}from"./index-C1kXcI0E.js";import{a as oe,b as se,d as ce,f as le,m as ue,p as de,t as fe,v as B,y as pe}from"./qualityParts-t5t9kEKG.js";var V=e(t(),1),H=e=>`/api/scans/${encodeURIComponent(e)}`,U=(e,t)=>`?${new URLSearchParams({...e?{standard:e}:{},...t?{engine:t}:{}})}`,W={view:()=>u(`GET`,`/api/scans`),start:e=>u(`POST`,`/api/scans/start`,e),stop:()=>u(`POST`,`/api/scans/stop`,{}),answer:(e,t)=>u(`POST`,`/api/scans/answer`,{id:e,choice:t}),scan:e=>u(`GET`,H(e)),print:e=>u(`POST`,`${H(e)}/pdf`,{}),reportHtml:e=>d(`GET`,`${H(e)}/report.html`),reportPdf:e=>d(`GET`,`${H(e)}/report.pdf`),coverageCsv:e=>d(`GET`,`${H(e)}/coverage.csv`)},me={view:(e,t)=>u(`GET`,`/api/coverage${U(e,t)}`),csv:(e,t)=>d(`GET`,`/api/coverage.csv${U(e,t)}`),html:(e,t)=>d(`GET`,`/api/coverage.html${U(e,t)}`),pdf:(e,t)=>d(`POST`,`/api/coverage.pdf${U(e,t)}`),session:e=>u(`GET`,`/api/a11y/sessions/${encodeURIComponent(e)}/coverage`),sessionCsv:e=>d(`GET`,`/api/a11y/sessions/${encodeURIComponent(e)}/coverage.csv`),sessionHtml:e=>d(`GET`,`/api/a11y/sessions/${encodeURIComponent(e)}/coverage.html`)},he={view:e=>u(`GET`,`/api/dashboard?range=${encodeURIComponent(e)}`)};function ge(e){return e.split(/\r?\n/).flatMap(e=>e.split(/[,;\t]/)).map(e=>e.trim().replace(/^"(.*)"$/,`$1`).trim()).filter(e=>/^https?:\/\/\S+$/i.test(e))}function _e(e){return[...new Set(e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean))]}var G=e=>`/api/a11y/suites/${encodeURIComponent(e)}`,ve={view:()=>u(`GET`,`/api/a11y/suites`),create:e=>u(`POST`,`/api/a11y/suites`,e),run:(e,t)=>u(`POST`,`${G(e)}/run`,{heal:t}),stop:()=>u(`POST`,`/api/a11y/suites/stop`,{}),answer:(e,t)=>u(`POST`,`/api/a11y/suites/answer`,{id:e,choice:t}),runDetail:(e,t)=>u(`GET`,`${G(e)}/runs/${encodeURIComponent(t)}`),report:(e,t)=>d(`GET`,`${G(e)}/runs/${encodeURIComponent(t)}/report.html`),baseline:(e,t,n)=>u(`POST`,`${G(e)}/baseline`,{run:t,confirm:n}),tests:e=>u(`POST`,`${G(e)}/tests`,{})};function ye(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,48).replace(/-+$/g,``)}var be=/^[a-z0-9][a-z0-9-]{0,47}$/;function xe(e,t){let n=Object.values(e.journeys).some(e=>!e.ok&&!e.healed);return e.worse.length?`worse`:n?`broken`:t?e.better.length?`better`:`same`:`no-baseline`}function Se(e){let t=Object.values(e.journeys);return{ok:t.filter(e=>e.ok).length,healed:t.filter(e=>!e.ok&&e.healed).length,broken:t.filter(e=>!e.ok&&!e.healed).length}}function Ce(e){if(!e)return{};let t=/^(scan|session):([A-Za-z0-9][\w.-]{0,120})$/.exec(e);return t?t[1]===`scan`?{scan:t[2]}:{session:t[2]}:{}}var K=c(),q={failed:{label:`Failed`,tone:`fail`,cell:`bg-fail-soft text-fail shadow-[inset_0_0_0_1px_var(--color-fail-dot)]`,dot:`fail`},review:{label:`Needs review`,tone:`warn`,cell:`bg-warn-soft text-warn`,dot:`warn`},exercised:{label:`Exercised by a persona`,tone:`running`,cell:`bg-accent-soft text-accent-fg`,dot:`running`},passed:{label:`Rules passed`,tone:`pass`,cell:`bg-pass-soft text-pass`,dot:`pass`},not_tested:{label:`Not tested`,tone:`neutral`,cell:`bg-surface-strong text-muted`,dot:`neutral`}},J={rules:{label:`Rules check part`,tone:`pass`,cell:`bg-pass-soft text-pass`,dot:`pass`},people:{label:`Personas exercise it`,tone:`running`,cell:`bg-accent-soft text-accent-fg`,dot:`running`},manual:{label:`A person must review`,tone:`neutral`,cell:`bg-nest text-muted shadow-[inset_0_0_0_1px_var(--color-line-strong)]`,dot:`neutral`}},Y=[`failed`,`review`,`exercised`,`passed`,`not_tested`],X=[`rules`,`people`,`manual`],Z=(e,t)=>t?q[e.result||`not_tested`]:J[e.automation],we=e=>e.split(`.`).slice(0,2).join(`.`),Te=(e,t)=>t?Math.round(e/t*100):0;function Ee({r:e,withResults:t,on:n,onPick:r}){let i=Z(e,t);return(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":n,"aria-label":`${e.id} ${e.title}, level ${e.level}: ${i.label}`,"data-tip":`${e.id} ${e.title} (${e.level}): ${i.label}`,onClick:r,className:s(`flex w-14 cursor-pointer flex-col items-center rounded-base border-0 px-1 py-1 font-mono text-body-sm leading-tight font-medium transition-[box-shadow] duration-150 hover:shadow-md focus-visible:shadow-focus focus-visible:outline-none`,i.cell,n&&`shadow-focus`),children:[e.id,(0,K.jsx)(`span`,{className:`font-sans text-label-sm font-normal opacity-80`,children:e.level})]})}function De({r:e,withResults:t}){let n=Z(e,t);return(0,K.jsxs)(`section`,{"aria-label":`${e.id} ${e.title}`,className:s(o,`flex flex-col gap-2 p-4`),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-body-sm text-muted`,children:e.id}),(0,K.jsx)(`h3`,{className:`m-0 text-body-lg font-medium`,children:e.title}),(0,K.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`Level `,e.level,` · WCAG `,e.since,` · `,e.principle]}),(0,K.jsx)(h,{tone:n.tone,icon:n.tone!==`running`,children:n.label})]}),(0,K.jsx)(Oe,{r:e})]})}function Oe({r:e}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1 text-body-sm text-ink-2`,children:[(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`span`,{className:`text-muted`,children:`Rules: `}),e.rules.length?(0,K.jsx)(`span`,{className:`font-mono [overflow-wrap:anywhere]`,children:e.rules.join(`, `)}):`none`]}),e.people.length>0&&(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`span`,{className:`text-muted`,children:`Exercised by: `}),e.people.join(`, `)]}),e.failed?.length?(0,K.jsxs)(`span`,{className:`text-fail`,children:[`Failed: `,(0,K.jsx)(`span`,{className:`font-mono`,children:e.failed.map(e=>`${e.rule} (${e.count})`).join(`, `)})]}):null,e.review?.length?(0,K.jsxs)(`span`,{className:`text-warn`,children:[`Could not decide, a person looks: `,(0,K.jsx)(`span`,{className:`font-mono`,children:e.review.join(`, `)})]}):null,e.barriers?.map((e,t)=>(0,K.jsxs)(`span`,{className:`text-fail [overflow-wrap:anywhere]`,children:[e.persona,`: `,e.title,` (`,e.severity,`)`]},t)),e.exercisedBy?.length?(0,K.jsxs)(`span`,{className:`text-accent-fg`,children:[`Reached the goal past it with no barrier: `,e.exercisedBy.join(`, `)]}):null]})}function ke({c:e,withResults:t,picked:n,onPick:r}){let i=[...new Set(e.rows.map(e=>e.principle))];return(0,K.jsx)(`div`,{className:`grid grid-cols-1 gap-4 @2xl:grid-cols-2 @6xl:grid-cols-4`,children:i.map(i=>{let a=e.rows.filter(e=>e.principle===i),o=[...new Set(a.map(e=>we(e.id)))];return(0,K.jsxs)(`section`,{"aria-label":i,className:`flex min-w-0 flex-col gap-2 rounded-lg bg-surface-muted p-4`,children:[(0,K.jsxs)(`h3`,{className:`m-0 flex items-baseline gap-2 text-body-sm font-medium`,children:[a[0].id[0],`. `,i,` `,(0,K.jsx)(`span`,{className:`font-normal text-muted tabular-nums`,children:a.length})]}),o.map(e=>(0,K.jsx)(`div`,{role:`group`,"aria-label":`Guideline ${e}`,className:`flex flex-wrap gap-1`,children:a.filter(t=>we(t.id)===e).map(e=>(0,K.jsx)(Ee,{r:e,withResults:t,on:n===e.id,onPick:()=>r(n===e.id?``:e.id)},e.id))},e))]},i)})})}function Ae({c:e}){let t=e.summary;return t.results?(0,K.jsxs)(z,{label:`The criteria's results`,children:[Y.map(e=>(0,K.jsx)(R,{dot:q[e].dot,value:t.results[e],label:q[e].label.toLowerCase()},e)),(0,K.jsx)(R,{dot:`neutral`,value:t.total,label:`criteria of ${e.label}`})]}):(0,K.jsxs)(z,{label:`What covers the criteria`,children:[X.map(e=>(0,K.jsx)(R,{dot:J[e].dot,value:t[e],label:`${J[e].label.toLowerCase()} (${Te(t[e],t.total)}%)`},e)),(0,K.jsx)(R,{dot:`neutral`,value:`${t.rules+t.people} of ${t.total}`,label:`covered in some way, ${Te(t.rules+t.people,t.total)}%`})]})}function je({c:e,engineLabel:t}){let n=!!e.summary.results,[r,i]=(0,V.useState)(``),[a,o]=(0,V.useState)(`all`),c=e.rows.find(e=>e.id===r),l=e=>n?e.result||`not_tested`:e.automation,u=n?Y.map(t=>({id:t,label:q[t].label,n:e.rows.filter(e=>l(e)===t).length,...t===`failed`?{alert:!0}:{}})):X.map(t=>({id:t,label:J[t].label,n:e.rows.filter(e=>l(e)===t).length})),d=e.rows.filter(e=>a===`all`||l(e)===a);return(0,K.jsxs)(`div`,{className:`@container flex min-w-0 flex-col gap-4`,children:[(0,K.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[e.summary.total,` success criteria of `,e.label,t?`, checked with ${t}`:``,`. Pick a criterion to see what checks it`,n?` and what was found`:``,`.`]}),(0,K.jsx)(Ae,{c:e}),(0,K.jsx)(`ul`,{"aria-label":`Legend`,className:`m-0 flex list-none flex-wrap gap-x-4 gap-y-1 p-0 text-body-sm text-ink-2`,children:(n?Y.map(e=>q[e]):X.map(e=>J[e])).map(e=>(0,K.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:s(`size-4 rounded-sm shadow-[inset_0_0_0_1px_var(--color-line-strong)]`,e.cell)}),e.label]},e.label))}),(0,K.jsx)(ke,{c:e,withResults:n,picked:r,onPick:i}),c&&(0,K.jsx)(De,{r:c,withResults:n}),(0,K.jsx)(`p`,{className:s(f.info,`m-0`),children:e.note}),(0,K.jsx)(I,{label:`Every criterion`,placeholder:`Find a criterion, rule or persona`,resetKey:a,empty:`Nothing matches.`,tools:(0,K.jsx)(m,{items:[{id:`all`,label:`All`,n:e.rows.length},...u.filter(e=>e.n>0)],value:a,onChange:o}),head:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`th`,{scope:`col`,className:s(M,`w-[88px]`),children:`Criterion`}),(0,K.jsx)(`th`,{scope:`col`,className:M,children:`Title`}),(0,K.jsx)(`th`,{scope:`col`,className:M,children:n?`Result`:`Coverage`}),(0,K.jsxs)(`th`,{scope:`col`,className:s(M,`hidden @3xl:table-cell`),children:[`What checks it`,n?`, and the evidence`:``]})]}),children:d.map(e=>{let t=Z(e,n);return(0,K.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,K.jsx)(`td`,{className:s(L,`font-mono text-body-sm`),"data-sort":e.id.split(`.`).map(e=>e.padStart(2,`0`)).join(`.`),children:e.id}),(0,K.jsxs)(`td`,{className:L,children:[(0,K.jsx)(`span`,{className:`block text-ink`,children:e.title}),(0,K.jsxs)(`span`,{className:`block text-body-sm text-muted`,children:[`Level `,e.level,` · WCAG `,e.since]})]}),(0,K.jsx)(`td`,{className:L,"data-sort":n?Y.indexOf(e.result||`not_tested`):X.indexOf(e.automation),children:(0,K.jsx)(h,{tone:t.tone,icon:t.tone!==`running`,className:`min-h-5 px-2 text-body-sm`,children:t.label})}),(0,K.jsx)(`td`,{className:s(L,`hidden @3xl:table-cell`),children:(0,K.jsx)(Oe,{r:e})})]},e.id)})})]})}var Q=e=>e===`axe`?`axe-core`:e===`ibm`?`IBM Equal Access`:e===`basic`?`ForgeQE's built-in checks`:e,$=e=>[...new Set(e.map(e=>{try{return new URL(e).host}catch{return``}}).filter(Boolean))],Me={title:`Site scan`,working:e=>{let t=e.filter(e=>/^Scanned /.test(e)).length;return`Scanning${t?`, ${t} done`:``}`},done:[`Scanned, nothing failed`,`Scanned, with problems`,`Did not finish`],output:`each page as it is scanned`};function Ne({job:e,onStop:t,onAnswer:n,words:r=Me}){let i=(0,V.useRef)(null);(0,V.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e.lines.length]);let a=e.exitCode===0?r.done[0]:e.exitCode===1?r.done[1]:r.done[2];return(0,K.jsxs)(`section`,{"aria-label":r.title,className:s(o,`flex flex-col gap-2`),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:r.title}),(0,K.jsx)(h,{orb:`working`,tone:e.running?`running`:e.exitCode===0?`pass`:e.exitCode===1?`warn`:`fail`,children:e.running?e.question?`Waiting for you`:r.working(e.lines):a}),e.running&&(0,K.jsxs)(v,{variant:`danger`,onClick:t,children:[(0,K.jsx)(k,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),e.running&&e.question&&(0,K.jsxs)(`fieldset`,{className:s(`panel rounded-md bg-(--page-surface-strong) p-6`,`m-0 flex flex-col gap-2 border-0`),children:[(0,K.jsx)(`legend`,{className:`float-left mb-1 text-body-sm font-medium`,children:e.question.title}),e.question.detail&&(0,K.jsx)(`p`,{className:`clear-left m-0 text-body-sm text-ink-2`,children:e.question.detail}),(0,K.jsx)(`div`,{className:`clear-left flex flex-wrap gap-2`,children:e.question.options.map((t,r)=>(0,K.jsx)(v,{size:`sm`,variant:r===0&&t.id!==`cancel`?`primary`:`outline`,onClick:()=>n(e.question.id,t.id),children:t.label},t.id))})]}),(0,K.jsxs)(`details`,{open:e.running,children:[(0,K.jsxs)(`summary`,{className:`cursor-pointer text-body-sm text-muted`,children:[`Output (`,e.lines.length,` lines): `,r.output]}),(0,K.jsx)(`pre`,{ref:i,className:s(ne,`mt-2 max-h-[340px]`),children:(0,K.jsx)(g,{text:e.lines.join(`
|
|
2
|
+
`)||`Starting the browser…`})})]})]})}function Pe({view:e,onStarted:t}){let[n,r]=(0,V.useState)(``),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(e.standard),[m,h]=(0,V.useState)(e.engine),[g,_]=(0,V.useState)(!1),[y,b]=(0,V.useState)(!1),[S,C]=(0,V.useState)(!1),[T,E]=(0,V.useState)(``),O=_e(n),k=O.length+(c?.urls??0),j=k>e.max,M=k>0&&!j&&!S,P=async e=>{if(E(``),!e)return l(null);if(e.size>262144)return E(`The CSV is larger than 256 KB.`);let t=await e.text(),n=ge(t).length;if(!n)return E(`${e.name} holds no http(s) address.`);l({name:e.name,text:t,urls:n})},F=async()=>{C(!0);try{t(await W.start({urls:O,...c?{csv:c.text}:{},engine:m,standard:u,best_practice:g,pdf:y})),r(``),l(null),E(``)}catch(e){E(e.message)}finally{C(!1)}};return(0,K.jsxs)(`form`,{"aria-labelledby":`scan-new`,className:s(o,`flex flex-col gap-4`),onSubmit:e=>{e.preventDefault(),M&&F()},children:[(0,K.jsx)(ae,{id:`scan-new`,icon:w,title:`New scan`}),(0,K.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm font-medium`,children:[`Pages`,(0,K.jsx)(a,{value:n,onChange:e=>r(e.target.value),rows:4,spellCheck:!1,placeholder:`https://www.example.com/
|
|
3
|
+
https://www.example.com/pricing`,"aria-describedby":`scan-pages-help`,className:`font-mono text-body-sm`}),(0,K.jsxs)(`span`,{id:`scan-pages-help`,className:s(`font-normal`,j?`text-fail`:`text-muted`),children:[`One address a line, up to `,e.max,`. `,k?`${B(k,`page`)} to scan.`:``,` Signed-in pages use the saved logins' sessions; nothing is clicked or typed.`]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(`label`,{className:s(p({size:`sm`,variant:`outline`}),`cursor-pointer`),children:[(0,K.jsx)(D,{"aria-hidden":`true`}),c?`Another CSV`:`Add a CSV`,(0,K.jsx)(`input`,{type:`file`,accept:`.csv,text/csv,text/plain`,className:`sr-only`,onChange:e=>void P(e.target.files?.[0])})]}),c&&(0,K.jsxs)(`span`,{className:`flex items-center gap-2 text-body-sm text-ink-2`,children:[(0,K.jsx)(A,{size:14,"aria-hidden":`true`}),c.name,`: `,c.urls,` `,c.urls===1?`address`:`addresses`,(0,K.jsx)(v,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove the CSV`,"data-tip":`Remove the CSV`,onClick:()=>l(null),children:(0,K.jsx)(x,{"aria-hidden":`true`})})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4`,children:[(0,K.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_200px] flex-col gap-1 text-body-sm font-medium`,children:[`Standard`,(0,K.jsx)(i,{size:`sm`,value:u,onChange:e=>d(e.target.value),children:e.standards.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,K.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-1 text-body-sm font-medium`,children:[`Rule engine`,(0,K.jsx)(i,{size:`sm`,value:m,onChange:e=>h(e.target.value),children:e.engines.map(e=>(0,K.jsx)(`option`,{value:e,children:Q(e)},e))})]})]}),(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-2`,children:[(0,K.jsx)(N,{checked:g,onChange:_,label:`Best-practice rules too`}),(0,K.jsx)(`span`,{className:`text-body-sm font-medium`,children:`Best-practice rules too`})]}),(0,K.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(N,{checked:y,onChange:b,label:`Also make a PDF`}),(0,K.jsx)(`span`,{className:`text-body-sm font-medium`,children:`Also make a PDF`})]})]}),T&&(0,K.jsx)(`p`,{role:`alert`,className:s(f.fail,`m-0`),children:T}),(0,K.jsx)(`div`,{children:(0,K.jsxs)(v,{size:`sm`,variant:`primary`,type:`submit`,disabled:!M,"data-tip":`Open each page and check it`,children:[(0,K.jsx)(w,{"aria-hidden":`true`}),S?`Starting…`:`Scan`]})})]})}var Fe=[`coverage`,`accessibility`,`seo`,`analytics`,`performance`];function Ie(e){return{id:e.id,goal:``,at:e.at,dir:e.dir||``,report:e.quality?{...e.quality,budgets:{accessibility:!1,performance:!1},breaches:[],performance:{pages:e.quality.performance.pages.map(e=>({...e,over:e.over??[]}))}}:null,examples:e.examples??{},visual:null,captured:0,...e.ledger?{ledger:e.ledger}:{}}}function Le({id:e,asked:t}){let[n,i]=(0,V.useState)(null),[a,o]=(0,V.useState)(``),[c,u]=(0,V.useState)(``),[d,m]=(0,V.useState)(``);(0,V.useEffect)(()=>{let t=!1;return i(null),W.scan(e).then(e=>!t&&(i(e),o(``)),e=>!t&&o(e.message)),()=>{t=!0}},[e]);let g=(0,K.jsxs)(`a`,{href:r(`quality`,`scans`),className:s(p({variant:`link`,size:`inline`}),`gap-1 self-start`),children:[(0,K.jsx)(y,{size:14,"aria-hidden":`true`,className:`rotate-90`}),`Scan history`]});if(!n)return(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[g,a?(0,K.jsx)(`p`,{role:`alert`,className:s(f.fail,`m-0`),children:a}):(0,K.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`})]});let x=n.quality?.accessibility,S=x?ue.reduce((e,t)=>e+x.byImpact[t],0):0,D=n.coverage.summary.results,O=n.perf.map(e=>e.lcp).filter(e=>typeof e==`number`),k=O.filter(e=>e<=2500).length,A=n.seo?.analytics.findings.filter(e=>e.status===`fail`).length??0,j=n.pages.filter(e=>e.error),M=D?.failed?`coverage`:n.seo?.pages.some(e=>e.checks.some(e=>e.status===`fail`))?`seo`:A?`analytics`:`coverage`,N=Fe.includes(t||``)?t:M,P=t=>location.hash=r(`quality`,`scans`,encodeURIComponent(e),t),F=async(e,t)=>{m(e),u(``);try{await t()}catch(e){u(e.message)}finally{m(``)}},I=()=>F(`html`,async()=>{if(n.dir){let e=await _(`${n.dir}/scan-report.html`);if(e)throw Error(e)}else l(await W.reportHtml(e),`site-scan-${e}.html`)}),L=()=>F(`pdf`,async()=>{n.pdf||i(await W.print(e)),l(await W.reportPdf(e),`site-scan-${e}.pdf`)}),te=()=>F(`csv`,async()=>l(await W.coverageCsv(e),`wcag-coverage-${e}.csv`)),ne=$(n.urls);return(0,K.jsxs)(`section`,{"aria-labelledby":`scan-h`,className:`flex min-w-0 flex-col gap-4`,children:[g,(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,K.jsx)(ae,{id:`scan-h`,icon:w,title:(0,K.jsx)(`span`,{"data-tip":n.urls.join(`
|
|
4
|
+
`),className:`block truncate`,children:ne.join(`, `)||`Site scan`})}),(0,K.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-body-sm text-muted`,children:[ce(n.at),` · `,B(n.urls.length,`page`),` · `,Q(n.checks.engine),`, `,n.checks.label]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,K.jsxs)(v,{size:`sm`,variant:`ghost`,disabled:d===`html`,"data-tip":`Open the HTML report`,onClick:()=>void I(),children:[(0,K.jsx)(T,{"aria-hidden":`true`}),`Report`]}),(0,K.jsxs)(v,{size:`sm`,variant:`ghost`,disabled:d===`pdf`,"data-tip":n.pdf?`Download the PDF`:`Print the report to PDF, then download it`,onClick:()=>void L(),children:[(0,K.jsx)(E,{"aria-hidden":`true`}),d===`pdf`&&!n.pdf?`Printing…`:`PDF`]}),(0,K.jsxs)(v,{size:`sm`,variant:`ghost`,disabled:d===`csv`,"data-tip":`Download the coverage matrix as CSV`,onClick:()=>void te(),children:[(0,K.jsx)(E,{"aria-hidden":`true`}),`CSV`]}),(0,K.jsxs)(`a`,{href:r(`accessibility`,`suites`,`new`,`scan:${encodeURIComponent(e)}`),className:p({size:`sm`,variant:`ghost`}),"data-tip":`Check these pages again later with no model, against a baseline`,children:[(0,K.jsx)(C,{"aria-hidden":`true`}),`Save as regression suite`]})]})]}),c&&(0,K.jsx)(`p`,{role:`alert`,className:`m-0 text-body-sm text-fail`,children:c}),j.length>0&&(0,K.jsxs)(`p`,{className:s(f.warn,`m-0`),children:[B(j.length,`page`),` could not be opened: `,j.map(e=>`${se(e.url)} (${e.error})`).join(`; `)]}),(0,K.jsxs)(z,{label:`What the scan found`,children:[(0,K.jsx)(R,{dot:S?`fail`:`pass`,value:S,label:x?`violations (${x.byImpact.critical} critical, ${x.byImpact.serious} serious)`:`violations`}),D&&(0,K.jsx)(R,{dot:D.failed?`fail`:`pass`,value:`${D.failed} of ${n.coverage.summary.total}`,label:`WCAG criteria failed`}),D&&(0,K.jsx)(R,{dot:D.review?`warn`:`neutral`,value:D.review,label:`need a person's review`}),n.seo&&(0,K.jsx)(R,{dot:n.seo.score>=90?`pass`:n.seo.score>=60?`warn`:`fail`,value:n.seo.score,label:`SEO score`}),n.seo&&(0,K.jsx)(R,{dot:A?`fail`:`neutral`,value:n.seo.analytics.tools.length,label:A?`analytics tools, ${B(A,`problem`)}`:`analytics tools`}),O.length>0&&(0,K.jsx)(R,{dot:k===O.length?`pass`:`warn`,value:`${k} of ${O.length}`,label:`pages with a good LCP`})]}),(0,K.jsx)(ee,{label:`Results`,className:`mb-0`,current:N,onPick:P,tabs:[{id:`coverage`,label:`Coverage`,n:D?`${D.failed} failed`:``,...D?.failed?{tone:`text-fail`}:{}},{id:`accessibility`,label:`Accessibility`,n:x?`${x.failed.length} rules failed`:`not measured`,...x?.failed.length?{tone:`text-fail`}:{}},{id:`seo`,label:`SEO`,n:n.seo?String(n.seo.score):`not collected`,...n.seo?{tone:pe(n.seo.score)}:{}},{id:`analytics`,label:`Analytics`,n:n.seo?B(n.seo.analytics.tools.length,`tool`):`not collected`,...A?{tone:`text-fail`}:{}},{id:`performance`,label:`Performance`,n:O.length?`${k} of ${O.length} good`:`not measured`}]}),(0,K.jsxs)(`div`,{role:`tabpanel`,id:`panel-${N}`,"aria-labelledby":`tab-${N}`,className:`@container flex min-w-0 flex-col gap-4`,children:[N===`coverage`&&(0,K.jsx)(je,{c:n.coverage,engineLabel:Q(n.checks.engine)}),N===`accessibility`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(fe,{run:Ie(n),standard:n.checks.label,disclaimer:`Automated checks find a part of the WCAG problems; they are a pre-check, not conformance. A manual review still matters.`}),n.review.length>0&&(0,K.jsx)(ie,{level:3,icon:b,title:`Needs a person's review`,n:n.review.length,description:`The engine ran these rules but could not decide: a person looks at the elements they found.`,children:(0,K.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-1 p-0`,children:n.review.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsxs)(h,{tone:`warn`,className:`font-mono`,children:[e.rule,(0,K.jsxs)(`span`,{className:`font-sans text-muted`,children:[` · `,B(e.pages,`page`)]})]})},e.rule))})})]}),N===`seo`&&(n.seo?(0,K.jsx)(de,{seo:n.seo}):(0,K.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`This scan collected no SEO facts.`})),N===`analytics`&&(n.seo?(0,K.jsx)(le,{seo:n.seo}):(0,K.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`This scan collected no analytics tags.`})),N===`performance`&&(0,K.jsx)(oe,{run:Ie(n)})]})]})}function Re({id:e,asked:t}){let[i,a]=(0,V.useState)(null),[o,c]=(0,V.useState)(``),[l,u]=(0,V.useState)(`all`),d=(0,V.useCallback)(()=>{W.view().then(e=>(a(e),c(``)),e=>c(e.message))},[]);(0,V.useEffect)(d,[d]);let p=!!i?.job?.running;(0,V.useEffect)(()=>{if(!p)return;let e=P(d,2e3);return()=>F(e)},[p,d]);let h=async e=>{try{a(await e())}catch(e){c(e.message)}};if(e)return(0,K.jsx)(Le,{id:n(e),asked:t},e);let g=e=>e.failedRules>0||e.seo!==void 0&&e.seo<90,_=i?l===`attention`?i.scans.filter(g):i.scans:[],v=e=>location.hash=r(`quality`,`scans`,encodeURIComponent(e));return(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsx)(re,{more:(0,K.jsx)(K.Fragment,{children:`Each page opens in ForgeQE's browser with no model, and nothing is clicked or typed. Accessibility uses the rule engine and standard you pick, and the rules that cannot decide are listed for a person. SEO checks the title, description, headings, canonical address, indexing, robots.txt, sitemap, structured data, social preview, mobile viewport and mixed content. Analytics lists each tag with its ids and hits, and flags tags missing on some pages, loaded twice, or sending hits before a consent banner was answered. Core Web Vitals are timed on each page's first load.`}),children:`Accessibility, WCAG coverage, SEO, analytics tags and Core Web Vitals of a list of pages, with no journey to write.`}),o&&(0,K.jsx)(`p`,{role:`alert`,className:s(f.fail,`m-0`),children:o}),!i&&!o&&(0,K.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`}),i?.job&&(0,K.jsx)(Ne,{job:i.job,onStop:()=>void h(W.stop),onAnswer:(e,t)=>void h(()=>W.answer(e,t))}),i&&!p&&(0,K.jsx)(Pe,{view:i,onStarted:a}),i&&(0,K.jsx)(ie,{icon:O,title:`Scan history`,n:i.scans.length,children:(0,K.jsx)(I,{label:`Scan history`,placeholder:`Find a scan by a site or page`,resetKey:l,empty:`No scans yet. Give a few addresses above and scan them: what each page shows for accessibility, SEO, analytics and timings lands here.`,tools:(0,K.jsx)(m,{items:[{id:`all`,label:`All`,n:i.scans.length},{id:`attention`,label:`Needs a look`,n:i.scans.filter(g).length,alert:!0}],value:l,onChange:u}),head:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`th`,{scope:`col`,className:s(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`w-[38%]`),children:`Sites`}),(0,K.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,children:`Pages`}),(0,K.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,children:`Violations`}),(0,K.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,children:`SEO`}),(0,K.jsx)(`th`,{scope:`col`,className:s(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Analytics`}),(0,K.jsx)(`th`,{scope:`col`,className:s(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`When`})]}),children:_.map(e=>{let t=e.failedRules?j:g(e)?b:S,n=$(e.urls);return(0,K.jsxs)(`tr`,{onClick:()=>v(e.id),className:`h-12 cursor-pointer border-t border-line-soft align-middle transition-colors duration-150 hover:bg-tint data-[state=selected]:bg-tint-hover`,children:[(0,K.jsx)(`td`,{className:s(`px-4 py-2`,`max-w-0`),children:(0,K.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(t,{size:15,"aria-label":e.failedRules?`WCAG rules failed`:g(e)?`Needs a look`:`Nothing failed`,className:s(`flex-none`,e.failedRules?`text-fail`:g(e)?`text-warn`:`text-pass`)}),(0,K.jsx)(`a`,{href:r(`quality`,`scans`,encodeURIComponent(e.id)),onClick:e=>e.stopPropagation(),"data-tip":e.urls.join(`
|
|
5
|
+
`),className:`truncate text-ink no-underline hover:underline`,children:n.join(`, `)||e.id})]})}),(0,K.jsx)(`td`,{className:s(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,`text-muted`),children:e.pages}),(0,K.jsx)(`td`,{className:s(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,e.violations?`text-fail`:`text-muted`),children:e.violations}),(0,K.jsx)(`td`,{className:s(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,e.seo===void 0?`text-muted`:pe(e.seo)),"data-sort":e.seo??-1,children:e.seo??`–`}),(0,K.jsx)(`td`,{className:s(`px-4 py-2`,`hidden text-body-sm text-ink-2 @2xl:table-cell`),children:(0,K.jsx)(`span`,{className:`line-clamp-1`,"data-tip":e.tools.join(`, `),children:e.tools.join(`, `)||(0,K.jsx)(`span`,{className:`text-muted`,children:`none found`})})}),(0,K.jsx)(`td`,{className:s(`px-4 py-2`,`hidden whitespace-nowrap text-body-sm text-muted @xl:table-cell`),"data-tip":ce(e.at),"data-sort":new Date(e.at).getTime()||0,children:te(e.at)})]},e.id)})})})]})}export{Q as a,he as c,W as d,ve as f,je as i,Se as l,Ce as m,Re as n,be as o,ye as p,$ as r,me as s,Ne as t,xe as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-
|
|
2
|
-
`).flatMap((t,n)=>e.test(t)?[n]:[]))},[t,a]),c=i?.path?i.path.slice(i.path.lastIndexOf(`/`)+1):n?N({kind:`test`,engine:n}):`Converted test`;return(0,E.jsx)(S,{label:`Converted test`,className:o(`pane-swap`,r),files:[{name:c,code:a,lang:i?.lang||`plaintext`,...i?.path?{title:i.path}:{},marked:s}],empty:i?`Not written yet.`:`This test case is left out of the plan.`,footer:t&&a?s.size?`${t} is done on line ${[...s].map(e=>e+1).join(`, `)}.`:`No line of the test is marked ${t}.`:void 0})}function ie({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,E.jsxs)(`section`,{"aria-label":`Locators Tosca recorded`,className:`flex flex-col gap-2 pt-4 text-body-sm`,children:[(0,E.jsxs)(`span`,{className:`font-medium`,children:[a.name,` `,(0,E.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,E.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:a.locators.slice(0,6).map((e,t)=>(0,E.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`w-14 flex-none text-body-sm text-muted`,children:e.strategy}),(0,E.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-body-sm 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,E.jsx)(f,{tone:`warn`,children:`Fragile`})]},t))}):(0,E.jsx)(`span`,{className:`text-muted`,children:`Tosca recorded no locator for it.`})]}):null}function ae({id:e,plan:t,result:n,initial:s,full:S,onPick:w}){let D=t.cases.filter(e=>e.included),[k,A]=(0,T.useState)(``),[M,N]=(0,T.useState)(s||D[0]?.id||``),[P,F]=(0,T.useState)(null),[I,R]=(0,T.useState)(``),[z,B]=(0,T.useState)(``);(0,T.useEffect)(()=>{M&&(B(``),c.case(e,M).then(F,e=>B(e.message)))},[e,M,n?.units.length,n?.status]),(0,T.useEffect)(()=>{R(``),M&&w?.(M)},[M]);let V=new Map((P?.fidelity||[]).map(e=>[e.id,e.status])),H=D.filter(e=>!k||e.name.toLowerCase().includes(k.toLowerCase())),[U,W]=(0,T.useState)(0);(0,T.useEffect)(()=>W(0),[k]),(0,T.useEffect)(()=>{let e=H.findIndex(e=>e.id===M);e>=0&&Math.floor(e/X)!==U&&W(Math.floor(e/X))},[M]);let G=H.slice(U*X,U*X+X),K=e=>n?.units.find(t=>t.kind===`test`&&t.case===e),q=e=>D.filter(t=>e.includes(K(t.id)?.status||``)).length,J=[`${q([`converted`])} converted`,...q([`written`])?[`${q([`written`])} written`]:[],`${q([`failed`,`blocked`])} failed`,`of ${O(D.length,`test case`)}`].join(`, `);if(!D.length)return(0,E.jsx)(d,{center:!0,className:`py-6`,children:`No test case of this plan is converted.`});if(S){let e=t.cases.find(e=>e.id===M),n=K(M),i=P?.fidelity,s=i?i.filter(e=>e.status===`matched`).length:0;return(0,E.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 @5xl:flex-row`,children:[(0,E.jsxs)(`nav`,{"aria-label":`Test cases`,className:o(a,`flex max-h-[360px] min-h-0 w-full flex-none flex-col overflow-hidden p-0 @5xl:max-h-none @5xl:w-80`),children:[(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-line-soft px-4 py-4`,children:[(0,E.jsx)(C,{level:3,icon:h,title:`Test cases`,description:`${J}. Pick one to see its Tosca steps beside its test.`}),(0,E.jsx)(p,{id:`find-a-case`,label:`Find a test case`,value:k,onChange:A,className:`max-w-none flex-none`})]}),(0,E.jsxs)(`ul`,{className:`m-0 flex min-h-0 flex-1 list-none flex-col overflow-y-auto p-2`,children:[G.map(e=>{let t=K(e.id),n=t?.status===`converted`?{icon:
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-9BkoTWUE.js";import{H as r,L as i,l as a}from"./preload-helper-BupTYkQW.js";import{t as o}from"./utils-DJRAScIl.js";import{t as s}from"./jsx-runtime-LKYXHABd.js";import{ft as c}from"./api-Dr3U7W5w.js";import{C as l,S as u,_ as d,g as f,h as p,p as m}from"./pageBack-Blig1Uqs.js";import{B as h,Er as g,N as _,P as v,cn as y,ct as b,z as x}from"./line-icons-Cwj9OmCz.js";import{l as S}from"./markdown-Bvv6oj4v.js";import{Z as C}from"./index-C1kXcI0E.js";import"./step-mark-Bu6fNKW8.js";import{d as w}from"./parts-DgJ2y_ic.js";var T=e(t(),1),E=s();function D({error:e}){return e?(0,E.jsx)(`p`,{role:`alert`,className:o(l.fail,`m-0`),children:e}):null}var O=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,k={ok:{label:`Ready to start`,tone:`pass`},limits:{label:`Ready, with limits`,tone:`warn`},blocked:{label:`Not possible`,tone:`fail`}},A={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`}},M={setup:`Set-up`,page:`Page`,test:`Test`},N=e=>e.engine?e.engine===`mobile`?`Mobile workflow`:`Desktop workflow`:M[e.kind],P={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`}},F=e=>e.route===`web`||e.route===`api`||(e.routes?.web??0)>0||(e.routes?.api??0)>0||(e.workflow?.steps??0)>0;function I(e){if(e.workflow&&e.workflow.steps>0)return`${e.workflow.engine===`mobile`?`Mobile`:`Desktop`} workflow${e.workflow.skipped?` + notes`:``}`;let t=e.route===`web`||(e.routes?.web??0)>0,n=e.route===`api`||(e.routes?.api??0)>0,r=(e.unsupported??0)>0||(e.routes?.unsupported??0)>0;return`${t&&n?`Web and API`:n?`API`:`Web`}${r?` + notes`:``}`}var L={web:`Web`,api:`API`,desktop:`Desktop`,mobile:`Mobile`,data:`Data`,mixed:`Mixed`,unsupported:`Not supported`},R={prepare:`Prepare`,setup:`Set up`,pages:`Pages`,tests:`Tests`,validate:`Validate`,review:`Review`},z=[`prepare`,`setup`,`pages`,`tests`,`validate`,`review`];function B(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 V(e){let t=e?.status||`pending`,n=e?.startedAt&&e?.endedAt?w(Date.parse(e.endedAt)-Date.parse(e.startedAt)):``;return t===`running`?e?.startedAt?`Running for ${w(Date.now()-Date.parse(e.startedAt))}`:`Running`:t===`done`?e?.note||(n?`Done in ${n}`:`Done`):t===`failed`?e?.note||`Did not finish`:t===`skipped`?e?.note||`Skipped`:`Waiting`}function H(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(H).join(` + `):``:``}var U={exact:`is`,contains:`contains`,not:`is not`,gt:`is more than`,gte:`is at least`,lt:`is less than`,lte:`is at most`,exists:`is there`,absent:`is not there`},W=new Set([`gt`,`gte`,`lt`,`lte`]);function G(e){let t=e.expected;return t&&`literal`in t&&/^-?\d+(\.\d+)?$/.test(String(t.literal))&&(W.has(e.match||``)||e.op===`api_status`)?String(t.literal):H(t)}function K(e,t,n){return e===`api_status`||t===`status`?`the status`:e===`api_header`||t===`header`?`the header ${n}`:e===`api_body`||t===`body`?`the body`:`the JSON value ${n}`}function q(e){if(e.op===`api_request`){let t=e.method&&`literal`in e.method?String(e.method.literal):``,n=[e.endpoint,e.resource].filter(Boolean).map(e=>H(e)).join(` + `),r=(e,t,n)=>{let r=e?Object.keys(e).length:0;return r?`${r} ${r===1?t:n}`:``},i=[e.payload?.fields?.length?`${e.payload.fields.length} body ${e.payload.fields.length===1?`field`:`fields`}`:e.payload?.raw?`a body`:``,r(e.pathParams,`path parameter`,`path parameters`),r(e.query,`query parameter`,`query parameters`),r(e.headers,`header`,`headers`)].filter(Boolean);return`Call ${t?`${t} `:e.method?`(method ${H(e.method)}) `:``}${n||`with no address`}${i.length?`, with ${i.join(`, `)}`:``}`}if(e.kind===`assert`&&(e.op===`api_status`||e.op===`api_header`||e.op===`api_json`||e.op===`api_body`)){let t=K(e.op,void 0,e.target),n=e.match||`exact`;return`Check ${t} of the response ${U[n]||`is`}${n===`exists`||n===`absent`?``:` ${G(e)}`}`}return e.op===`api_store`?`Read ${K(void 0,e.property,e.target)} of the response into ${e.var}`:null}function J(e){let t=q(e);if(t!==null)return t;let n=e.target?e.target.slice(e.target.indexOf(`.`)+1).replace(/_/g,` `):``;if(e.kind===`action`){let t=e.op===`navigate`?`Open ${H(e.value)}`:e.op===`close`?`Close the browser`:e.op===`fill`?`Fill ${n} with ${H(e.value)}`:e.op===`press`?`Press ${e.key} on ${n}`:e.op===`select`?`Select in ${n}`:`${e.op[0].toUpperCase()}${e.op.slice(1)} ${n}`;return e.optional?`${t} (if it is there)`:t}return e.kind===`assert`?`Check ${n} ${e.op===`text`||e.op===`value`?`${e.match===`contains`?`contains`:`is`} ${H(e.expected)}`:`is ${e.op}`}${e.wait?`, waiting`:``}`:e.kind===`store`?`Read ${n} into ${e.var}`:e.kind===`set_var`?`Set ${e.var} to ${H(e.value)}`:e.kind===`wait`?`Wait ${e.ms} ms`:e.kind===`unsupported`?e.reason||`Cannot be converted`:e.name||e.kind}var ee={prepare:`Read the plan and the Tosca exports.`,setup:`Set up the new project and its packages.`,pages:`Write a page object for each Tosca module.`,tests:`Write each test case from its Tosca steps.`,validate:`Run every converted test, and fix what fails.`,review:`Check each test against its Tosca steps.`};function te(e){return z.map(t=>({id:t,name:R[t],about:ee[t],status:e?.[t]?.status||`pending`,line:V(e?.[t])}))}function ne({icon:e,title:t,aside:n,children:r}){return(0,E.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,E.jsxs)(`h4`,{className:`m-0 flex items-center gap-2 text-body-lg font-medium`,children:[(0,E.jsx)(e,{size:18,"aria-hidden":`true`,className:`flex-none text-muted`}),(0,E.jsx)(`span`,{className:`flex-1`,children:t}),n&&(0,E.jsx)(`span`,{className:`text-body-sm font-normal text-muted tabular-nums`,children:n})]}),r]})}var Y=(e,t)=>t?n(`tosca`,e,`compare`,encodeURIComponent(t)):n(`tosca`,e,`compare`),X=50,re={before:`Before`,after:`After`,block:`Reusable block`,folder:`Folder`};function Z({nodes:e,status:t,pick:n,onPick:i,depth:a=0}){return(0,E.jsx)(`ul`,{className:o(`m-0 flex list-none flex-col p-0`,a>0&&`ml-4 border-l border-line-soft pl-4`),children:e.map((e,s)=>{if(e.kind===`group`)return(0,E.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,E.jsxs)(`span`,{className:`text-body-sm font-medium text-muted`,children:[re[e.role||`folder`]||`Folder`,`: `,(0,E.jsx)(`span`,{className:`text-ink-2`,children:e.name})]}),(0,E.jsx)(Z,{nodes:e.body||[],status:t,pick:n,onPick:i,depth:a+1})]},`g${s}`);if(e.kind===`if`||e.kind===`loop`){let r=e.condition;return(0,E.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,E.jsxs)(`span`,{className:`text-body-sm font-medium text-muted`,children:[e.kind===`if`?`If`:`Loop`,` `,e.name,`: `,(0,E.jsx)(`code`,{className:`font-mono text-body-sm text-ink-2`,children:r?.tosca}),r?.constant!==void 0&&(0,E.jsxs)(`span`,{children:[`, always `,r.constant?`true`:`false`]})]}),[`then`,`else`,`loop`].map(r=>e[r]?.length?(0,E.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,E.jsx)(`span`,{className:`ml-4 text-body-sm text-muted`,children:r===`then`?`Then`:r===`else`?`Else`:`Each time`}),(0,E.jsx)(Z,{nodes:e[r],status:t,pick:n,onPick:i,depth:a+1})]},r):null)]},`i${s}`)}let c=e.id?t.get(e.id):void 0,l=c?P[c]:void 0;return(0,E.jsx)(`li`,{children:(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":n===e.id,onClick:()=>i(e),className:o(r,`min-w-0 items-start gap-2`),children:[(0,E.jsx)(`span`,{role:`img`,"aria-label":l?.label||`Not converted yet`,"data-tip":l?.label||`Not converted yet`,className:o(`mt-2 size-2 flex-none rounded-full`,l?.dot||`bg-line`)}),(0,E.jsx)(`span`,{className:`w-9 flex-none font-mono text-body-sm text-muted`,children:e.id}),(0,E.jsxs)(`span`,{className:o(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`unsupported`?`text-warn`:`text-ink`),children:[J(e),e.tosca?.step&&(0,E.jsxs)(`span`,{className:`block text-body-sm text-muted`,children:[`Tosca step "`,e.tosca.step,`"`]})]})]})},e.id||s)})})}function Q(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]&&Q(n[e],t);if(r)return r}}}function $({view:e,pick:t,engine:n,className:r}){let i=e.target,a=i?.text||``,s=(0,T.useMemo)(()=>{if(!t||!a)return new Set;let e=RegExp(`tosca:[\\sn\\d,]*\\b${t}\\b`,`i`);return new Set(a.split(`
|
|
2
|
+
`).flatMap((t,n)=>e.test(t)?[n]:[]))},[t,a]),c=i?.path?i.path.slice(i.path.lastIndexOf(`/`)+1):n?N({kind:`test`,engine:n}):`Converted test`;return(0,E.jsx)(S,{label:`Converted test`,className:o(`pane-swap`,r),files:[{name:c,code:a,lang:i?.lang||`plaintext`,...i?.path?{title:i.path}:{},marked:s}],empty:i?`Not written yet.`:`This test case is left out of the plan.`,footer:t&&a?s.size?`${t} is done on line ${[...s].map(e=>e+1).join(`, `)}.`:`No line of the test is marked ${t}.`:void 0})}function ie({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,E.jsxs)(`section`,{"aria-label":`Locators Tosca recorded`,className:`flex flex-col gap-2 pt-4 text-body-sm`,children:[(0,E.jsxs)(`span`,{className:`font-medium`,children:[a.name,` `,(0,E.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,E.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:a.locators.slice(0,6).map((e,t)=>(0,E.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`w-14 flex-none text-body-sm text-muted`,children:e.strategy}),(0,E.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-body-sm 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,E.jsx)(f,{tone:`warn`,children:`Fragile`})]},t))}):(0,E.jsx)(`span`,{className:`text-muted`,children:`Tosca recorded no locator for it.`})]}):null}function ae({id:e,plan:t,result:n,initial:s,full:S,onPick:w}){let D=t.cases.filter(e=>e.included),[k,A]=(0,T.useState)(``),[M,N]=(0,T.useState)(s||D[0]?.id||``),[P,F]=(0,T.useState)(null),[I,R]=(0,T.useState)(``),[z,B]=(0,T.useState)(``);(0,T.useEffect)(()=>{M&&(B(``),c.case(e,M).then(F,e=>B(e.message)))},[e,M,n?.units.length,n?.status]),(0,T.useEffect)(()=>{R(``),M&&w?.(M)},[M]);let V=new Map((P?.fidelity||[]).map(e=>[e.id,e.status])),H=D.filter(e=>!k||e.name.toLowerCase().includes(k.toLowerCase())),[U,W]=(0,T.useState)(0);(0,T.useEffect)(()=>W(0),[k]),(0,T.useEffect)(()=>{let e=H.findIndex(e=>e.id===M);e>=0&&Math.floor(e/X)!==U&&W(Math.floor(e/X))},[M]);let G=H.slice(U*X,U*X+X),K=e=>n?.units.find(t=>t.kind===`test`&&t.case===e),q=e=>D.filter(t=>e.includes(K(t.id)?.status||``)).length,J=[`${q([`converted`])} converted`,...q([`written`])?[`${q([`written`])} written`]:[],`${q([`failed`,`blocked`])} failed`,`of ${O(D.length,`test case`)}`].join(`, `);if(!D.length)return(0,E.jsx)(d,{center:!0,className:`py-6`,children:`No test case of this plan is converted.`});if(S){let e=t.cases.find(e=>e.id===M),n=K(M),i=P?.fidelity,s=i?i.filter(e=>e.status===`matched`).length:0;return(0,E.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 @5xl:flex-row`,children:[(0,E.jsxs)(`nav`,{"aria-label":`Test cases`,className:o(a,`flex max-h-[360px] min-h-0 w-full flex-none flex-col overflow-hidden p-0 @5xl:max-h-none @5xl:w-80`),children:[(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-line-soft px-4 py-4`,children:[(0,E.jsx)(C,{level:3,icon:h,title:`Test cases`,description:`${J}. Pick one to see its Tosca steps beside its test.`}),(0,E.jsx)(p,{id:`find-a-case`,label:`Find a test case`,value:k,onChange:A,className:`max-w-none flex-none`})]}),(0,E.jsxs)(`ul`,{className:`m-0 flex min-h-0 flex-1 list-none flex-col overflow-y-auto p-2`,children:[G.map(e=>{let t=K(e.id),n=t?.status===`converted`?{icon:_,tone:`text-pass`}:t?.status===`failed`?{icon:x,tone:`text-fail`}:t?.status===`blocked`?{icon:g,tone:`text-warn`}:t?.status===`written`?{icon:_,tone:`text-muted`}:{icon:v,tone:`text-muted`},i=M===e.id;return(0,E.jsx)(`li`,{children:(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":i,onClick:()=>N(e.id),className:o(r,`relative items-start gap-2 overflow-hidden`),children:[i&&(0,E.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-y-0 left-0 w-1 bg-accent`}),(0,E.jsx)(n.icon,{size:16,"aria-label":t?j[t.status].label:`Waiting`,className:o(`translate-y-0.5 flex-none`,n.tone)}),(0,E.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,E.jsx)(`span`,{className:`font-medium text-ink [overflow-wrap:anywhere]`,children:e.name}),(0,E.jsxs)(`span`,{className:`text-muted`,children:[O(e.steps,`step`),`, `,O(e.asserts,`check`),t?.fidelity?`, ${t.fidelity.matched}/${t.fidelity.required} kept`:``]})]})]})},e.id)}),!G.length&&(0,E.jsx)(`li`,{className:`px-4 py-4 text-body-sm text-muted`,children:`No test case matches.`})]}),H.length>X&&(0,E.jsx)(m,{page:U,size:X,total:H.length,onPage:W,label:`Test case pages`})]}),(0,E.jsxs)(`section`,{"aria-label":`Comparison`,className:o(a,`flex min-h-[480px] min-w-0 flex-1 flex-col overflow-hidden p-0`),children:[(0,E.jsx)(`header`,{className:`border-b border-line-soft px-4 py-4`,children:(0,E.jsx)(C,{level:3,icon:h,title:P?.name||e?.name||`Test case`,actions:(0,E.jsxs)(E.Fragment,{children:[e&&L[e.route]&&(0,E.jsx)(f,{tone:`neutral`,icon:!1,children:L[e.route]}),i&&i.length>0&&(0,E.jsxs)(`span`,{className:`text-body-sm text-ink-2 tabular-nums`,children:[s,` of `,i.length,` Tosca steps in the test`]}),n&&(0,E.jsx)(f,{tone:j[n.status].tone,children:j[n.status].label})]})})}),z&&(0,E.jsx)(`p`,{role:`alert`,className:o(`mx-4 mt-2 mb-0`,l.fail),children:z}),(0,E.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 @5xl:grid-cols-2`,children:[(0,E.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col border-line-soft @5xl:border-r`,children:[(0,E.jsxs)(`div`,{className:`flex min-h-12 items-center gap-2 border-b border-line-soft px-4 text-body-sm`,children:[(0,E.jsx)(y,{size:16,"aria-hidden":`true`,className:`flex-none text-muted`}),(0,E.jsx)(`span`,{className:`font-medium text-ink`,children:`Tosca steps`}),(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted`,children:`Pick a step to find it in the test`})]}),(0,E.jsx)(`div`,{className:`pane-swap min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:P?(0,E.jsx)(Z,{nodes:P.body,status:V,pick:I,onPick:e=>R(e.id||``)}):(0,E.jsx)(`p`,{role:`status`,className:`m-0 px-2 text-body-sm text-muted`,children:z?`Nothing to show.`:`Loading…`})},P?.case||``),P&&(P.env.length>0||P.warnings.length>0)&&(0,E.jsxs)(`footer`,{className:`flex flex-col gap-1 border-t border-line-soft px-4 py-2 text-body-sm text-ink-2`,children:[P.env.length>0&&(0,E.jsxs)(`span`,{children:[`Environment variables: `,P.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`.`]}),P.warnings.slice(0,3).map(e=>(0,E.jsx)(`span`,{className:`text-warn`,children:e},e))]}),P&&Q(P.body,I)?.target&&(0,E.jsx)(`div`,{className:`px-4 pb-4`,children:(0,E.jsx)(ie,{view:P,node:Q(P.body,I)})})]}),(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col`,children:P?(0,E.jsx)($,{view:P,pick:I,engine:t.units.find(e=>e.kind===`test`&&e.case===P.case)?.engine,className:`h-full rounded-none bg-bg`},P.case):(0,E.jsx)(`p`,{className:`m-0 flex flex-1 items-center justify-center px-4 text-center text-body-sm text-muted`,children:z?`Nothing to show.`:`Loading…`})})]})]})]})}return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4`,children:[(0,E.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-2 text-body-sm font-medium`,children:[`Test case`,(0,E.jsx)(i,{value:M,onChange:e=>N(e.target.value),children:D.map(e=>{let t=K(e.id);return(0,E.jsxs)(`option`,{value:e.id,children:[e.name,t?` (${j[t.status].label.toLowerCase()})`:``]},e.id)})})]}),(0,E.jsx)(`span`,{className:`pb-2 text-body-sm text-muted`,children:J}),(0,E.jsx)(`span`,{className:`flex-1`}),(0,E.jsxs)(`a`,{href:Y(e,M),target:`_blank`,rel:`noopener noreferrer`,"data-tip":`Tosca steps beside the converted test, in a tab of their own`,className:u({variant:`ghost`,size:`sm`}),children:[(0,E.jsx)(b,{"aria-hidden":`true`}),`Compare in a new tab`]})]}),z&&(0,E.jsx)(`p`,{role:`alert`,className:o(l.fail,`m-0`),children:z}),P?(0,E.jsx)($,{view:P,pick:``,engine:t.units.find(e=>e.kind===`test`&&e.case===P.case)?.engine,className:`max-h-[calc(var(--screen)-360px)] min-h-[320px]`},P.case):(0,E.jsx)(`p`,{role:`status`,className:`m-0 flex min-h-[260px] items-center justify-center px-4 text-center text-body-sm text-muted`,children:z?`Nothing to show.`:`Loading…`})]})}export{te as _,D as a,z as c,k as d,I as f,B as g,N as h,P as i,R as l,O as m,Y as n,A as o,F as p,ne as r,L as s,ae as t,j as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-
|
|
2
|
-
`)})]}):null,t&&e.name&&(0,J.jsx)(`div`,{children:(0,J.jsxs)(v,{size:`sm`,disabled:n,onClick:()=>r(`fetch`,{name:e.name}),"data-tip":`Fetch again`,children:[(0,J.jsx)(N,{"aria-hidden":`true`}),`Refresh`]})})]})}function Q({view:e,log:t,busy:r,act:a}){let[o,c]=(0,q.useState)(`all`),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(``),[_,b]=(0,q.useState)(``),S=t??[],w=(0,q.useMemo)(()=>[...new Set(S.map(e=>e.requester))].sort(),[t]),T=(0,q.useMemo)(()=>[...new Set(S.map(e=>e.database).filter(Boolean))].sort(),[t]),E=S.filter(e=>!e.ok).length,O=S.filter(e=>(o===`all`||o===`ok`===e.ok)&&(!l||e.requester===l)&&(!d||e.database===d)),k=new Set(e.requests.map(e=>e.name));return t===null?(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading the requests…`}):S.length?(0,J.jsx)(te,{label:`Requests`,resetKey:`${o}|${l}|${d}`,minWidth:760,fixed:!0,height:ae,placeholder:`Find a request`,tools:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(h,{value:o,onChange:c,items:[{id:`all`,label:`All`,n:S.length},{id:`ok`,label:`Answered`,n:S.length-E},{id:`failed`,label:`Failed`,n:E,alert:!0}]}),w.length>1&&(0,J.jsxs)(i,{size:`sm`,"aria-label":`Who asked`,value:l,onChange:e=>u(e.target.value),className:`w-[180px]`,children:[(0,J.jsx)(`option`,{value:``,children:`Anyone`}),w.map(e=>(0,J.jsx)(`option`,{children:e},e))]}),T.length>1&&(0,J.jsxs)(i,{size:`sm`,"aria-label":`Database`,value:d,onChange:e=>f(e.target.value),className:`w-[160px]`,children:[(0,J.jsx)(`option`,{value:``,children:`Any database`}),T.map(e=>(0,J.jsx)(`option`,{children:e},e))]})]}),head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{scope:`col`,className:s(P,`w-9`),children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Open`})}),(0,J.jsx)(`th`,{scope:`col`,className:s(P,`w-[110px]`),children:`When`}),(0,J.jsx)(`th`,{scope:`col`,className:s(P,`w-[150px]`),children:`Who asked`}),(0,J.jsx)(`th`,{scope:`col`,className:P,children:`What for`}),(0,J.jsx)(`th`,{scope:`col`,className:s(P,`w-[110px]`),children:`Database`}),(0,J.jsx)(`th`,{scope:`col`,className:s(P,`w-[140px]`),children:`Answer`}),(0,J.jsx)(`th`,{scope:`col`,className:s(oe,`w-[70px]`),children:`Rows`})]}),empty:`No requests match these filters. Pick All and Anyone to see every request.`,children:O.map(e=>{let t=_===e.id;return(0,J.jsxs)(q.Fragment,{children:[(0,J.jsxs)(`tr`,{className:s(F,t&&`bg-surface-muted`),onClick:()=>b(t?``:e.id),children:[(0,J.jsx)(`td`,{className:s(I,`pr-0`),children:(0,J.jsx)(v,{variant:`icon`,size:`icon-xs`,"aria-expanded":t,"aria-label":t?`Close the request`:`Open the request`,onClick:n=>(n.stopPropagation(),b(t?``:e.id)),children:t?(0,J.jsx)(y,{"aria-hidden":`true`}):(0,J.jsx)(x,{"aria-hidden":`true`})})}),(0,J.jsx)(`td`,{className:s(I,`whitespace-nowrap text-muted`),"data-tip":new Date(e.at).toLocaleString(),"data-sort":new Date(e.at).getTime()||0,children:L(e.at)}),(0,J.jsx)(`td`,{className:s(I,`truncate`),"data-tip":e.requester,children:e.requester}),(0,J.jsxs)(`td`,{className:s(I,`truncate`),"data-tip":e.need,children:[e.need,e.source===`fetch`?(0,J.jsx)(`span`,{className:`text-muted`,children:` · fetched again`}):null]}),(0,J.jsx)(`td`,{className:s(I,`truncate`),"data-tip":e.database,children:e.database||(0,J.jsx)(`span`,{className:`text-muted`,children:`—`})}),(0,J.jsx)(`td`,{className:s(I,`whitespace-nowrap`),children:(0,J.jsx)(g,{tone:e.ok?`pass`:`fail`,children:e.ok?K[e.kind||``]||`Answered`:`Failed`})}),(0,J.jsx)(`td`,{className:ee,"data-sort":e.ok?Z(e):-1,children:e.ok?Z(e):``})]}),t&&(0,J.jsx)(`tr`,{className:`border-t border-line-soft bg-surface-muted/40`,children:(0,J.jsx)(`td`,{colSpan:7,className:s(`px-4 py-2`,`max-w-0`),children:(0,J.jsx)(he,{e,kept:!!e.name&&k.has(e.name),busy:r,act:a})})})]},e.id)})}):(0,J.jsx)(m,{page:!0,icon:C,title:`No test data asked for yet`,action:(0,J.jsxs)(`a`,{href:n(`data`,`ask`,`test-data`),"data-tip":`Ask for test data`,className:s(p({size:`sm`}),`no-underline`),children:[(0,J.jsx)(D,{"aria-hidden":`true`}),`Ask`]}),children:`The agents ask before a test runs, or you can ask yourself.`})}function ge({view:e,job:t,busy:r,act:i,onNote:a}){let s=t&&!t.running&&t.kind===`fetch`?t:null,c=s?.result;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsx)(`p`,{className:`m-0 text-body-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.`}),s&&(0,J.jsxs)(z,{level:3,icon:N,title:s.target,className:`surface rounded-lg bg-bg p-6 shadow-sm`,children:[c&&!c.ok&&(0,J.jsx)(W,{text:c.error||`It could not fetch the data.`}),c?.ok&&(0,J.jsx)(pe,{r:c,onNote:a})]}),e.requests.length===0?(0,J.jsxs)(m,{className:`py-4`,children:[`No kept requests yet. Each request Miner answers is kept here; `,(0,J.jsx)(`a`,{href:n(`data`,`ask`,`test-data`),children:`ask for test data`}),` to make the first.`]}):(0,J.jsx)(H,{items:e.requests,text:e=>`${e.need} ${e.name} ${e.database} ${e.requester||``}`,label:`Kept requests`,size:15,children:e=>(0,J.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-4 border-t border-line-soft py-2 text-body-sm first:border-t-0`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-body-sm font-medium [overflow-wrap:anywhere]`,children:e.need}),(0,J.jsxs)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:[(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` · `,e.database,` · `,K[e.kind],e.rows?` · ${o(e.rows,`row`)}`:``,e.created?` · ${L(e.created)}`:``,e.requester?` · asked by ${e.requester}`:``]})]}),(0,J.jsx)(v,{size:`icon`,variant:`icon`,disabled:r,onClick:()=>i(`fetch`,{name:e.name}),"aria-label":`Fetch ${e.name} again`,"data-tip":`Fetch ${e.name} again`,className:`size-8`,children:(0,J.jsx)(N,{"aria-hidden":`true`})})]},e.name)})]})}function $({view:e,job:t,busy:o,act:c,onNote:l}){let[u,p]=(0,q.useState)(e.specs[0]??``),[h,g]=(0,q.useState)(``),[_,y]=(0,q.useState)(``),[b,x]=(0,q.useState)(`csv`),[w,T]=(0,q.useState)(!1),O={spec:u,...h?{db:h}:{},..._?{seed:_}:{}},j=t&&!t.running?t:null,M=j&&[`gen`,`files`,`insert`].includes(j.kind)&&j.target===u?j.result:void 0,N=e.databases.find(e=>e.name===h),P=async()=>{try{let{id:e}=await d.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=n(`chats`,e)}catch(e){l(e.message)}};return(0,J.jsx)(z,{id:`spec`,icon:C,title:`Make test data from a spec`,actions:(0,J.jsxs)(v,{variant:`ghost`,onClick:()=>void P(),"data-tip":`Write a spec in a chat`,children:[(0,J.jsx)(D,{"aria-hidden":`true`}),`Chat`]}),description:`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.`,children:e.specs.length===0?(0,J.jsx)(m,{className:`py-4`,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,J.jsxs)(`div`,{className:s(a,`flex flex-col gap-4`),children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-4`,children:[(0,J.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-2 text-body-sm font-medium`,children:[`Spec`,(0,J.jsx)(i,{value:u,onChange:e=>p(e.target.value),children:e.specs.map(e=>(0,J.jsx)(`option`,{children:e},e))})]}),(0,J.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-2 text-body-sm font-medium`,children:[`Database`,(0,J.jsxs)(i,{value:h,onChange:e=>g(e.target.value),children:[(0,J.jsx)(`option`,{value:``,children:`The spec's own`}),e.databases.map(e=>(0,J.jsxs)(`option`,{value:e.name,children:[e.name,e.writable?``:` (read only)`]},e.name))]})]}),(0,J.jsxs)(`label`,{className:`flex w-[120px] flex-col gap-2 text-body-sm font-medium`,children:[`Seed`,(0,J.jsx)(r,{value:_,inputMode:`numeric`,placeholder:`Random`,onChange:e=>y(e.target.value.replace(/\D/g,``).slice(0,9))})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(v,{variant:w?void 0:`primary`,disabled:o||!u,onClick:()=>c(`gen`,O),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Preview`]}),(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,J.jsxs)(v,{disabled:o||!u,onClick:()=>c(`gen`,{...O,mode:`files`,format:b}),"data-tip":`Write files (${b})`,children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Export`]}),(0,J.jsx)(i,{"aria-label":`File format`,value:b,onChange:e=>x(e.target.value),className:`w-[88px]`,children:[`csv`,`json`,`sql`].map(e=>(0,J.jsx)(`option`,{children:e},e))})]}),(0,J.jsxs)(v,{disabled:o||!u||!N?.writable,"data-tip":N?.writable?`Insert into ${N.name}`:`Pick a writable database to insert into`,onClick:()=>T(!0),children:[(0,J.jsx)(E,{"aria-hidden":`true`}),`Insert`]})]}),w&&N&&(0,J.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Insert test data`,className:s(f.warn,`flex flex-col gap-4`),children:[(0,J.jsxs)(`span`,{className:`font-medium`,children:[`Insert the rows of `,u,` into `,N.name,`?`]}),(0,J.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:`They go in as one batch, which you can remove again under Batches. Only on a test database.`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsxs)(v,{variant:`primary`,onClick:()=>{T(!1),c(`gen`,{...O,mode:`insert`,confirmed:!0})},children:[(0,J.jsx)(E,{"aria-hidden":`true`}),`Insert`]}),(0,J.jsxs)(v,{onClick:()=>T(!1),"data-tip":`Don't insert`,children:[(0,J.jsx)(S,{"aria-hidden":`true`}),`Cancel`]})]})]}),M&&!M.ok&&(0,J.jsx)(W,{text:M.error||`It did not make the data.`}),M?.ok&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[M.batch&&(0,J.jsxs)(`p`,{className:s(f.pass,`m-0`),children:[`Inserted as batch `,(0,J.jsx)(`span`,{className:`font-mono text-body-sm`,children:M.batch}),`.`]}),M.files?.length?(0,J.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-body-sm`,children:[`Wrote`,M.files.map(e=>(0,J.jsx)(ue,{file:e,onNote:l},e))]}):null,(0,J.jsx)(V,{r:M})]})]})})}function _e({view:e,job:t,busy:r,act:a}){let o=e.databases.filter(e=>e.writable),[c,l]=(0,q.useState)(o[0]?.name??``),[u,d]=(0,q.useState)(``),h=t&&!t.running?t:null,g=h?.kind===`batches`?(Array.isArray(h.result)?h.result.flatMap(e=>e.batches||[]):h.result?.batches)??[]:null;return(0,J.jsx)(z,{id:`batch`,icon:T,title:`Inserted batches`,description:`Rows inserted from a spec go in as a batch. Remove a batch to take exactly those rows out again, children first.`,children:o.length===0?(0,J.jsx)(m,{className:`py-4`,action:(0,J.jsxs)(`a`,{href:n(`settings`,`databases`),className:p({size:`sm`}),children:[(0,J.jsx)(O,{"aria-hidden":`true`}),`Settings, Databases`]}),children:`No writable database: test data is inserted only into one marked writable in Settings.`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(i,{"aria-label":`Database`,value:c,onChange:e=>l(e.target.value),className:`w-[220px]`,children:o.map(e=>(0,J.jsx)(`option`,{children:e.name},e.name))}),(0,J.jsxs)(v,{disabled:r||!c,onClick:()=>a(`batches`,{db:c}),"data-tip":`List batches`,children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Show`]})]}),g&&g.length===0&&(0,J.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`No batches in `,h?.target,`.`]}),g&&g.length>0&&(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:g.map(e=>(0,J.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-4 border-t border-line-soft py-2 text-body-sm first:border-t-0`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-mono text-body-sm`,children:e.batch}),(0,J.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[(0,J.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(`, `)]})]}),u===e.batch?(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`text-body-sm text-warn`,children:[`Remove its rows from `,h?.target,`?`]}),(0,J.jsxs)(v,{variant:`danger`,size:`sm`,onClick:()=>{d(``),a(`clean`,{db:h?.target,batch:e.batch,confirmed:!0})},children:[(0,J.jsx)(M,{"aria-hidden":`true`}),`Remove`]}),(0,J.jsxs)(v,{size:`sm`,onClick:()=>d(``),children:[(0,J.jsx)(j,{"aria-hidden":`true`}),`Keep`]})]}):(0,J.jsx)(v,{size:`icon`,variant:`icon`,disabled:r,onClick:()=>d(e.batch),"aria-label":`Remove batch ${e.batch}`,"data-tip":`Remove batch ${e.batch}`,className:`size-8`,children:(0,J.jsx)(M,{"aria-hidden":`true`})})]},e.batch))}),h?.kind===`clean`&&h.result?.ok&&(0,J.jsxs)(`p`,{className:s(f.pass,`m-0`),children:[`Removed:`,` `,Object.entries(h.result.removed||{}).map(([e,t])=>`${e} ${t}`).join(`, `)]})]})})}function ve({sub:e}){let{view:t,error:r,busy:i,act:a,stop:o,job:c}=de(),[d,m]=(0,q.useState)(null),[h,g]=(0,q.useState)(``),v=Y.includes(e)?e:`requests`;B(`test-data`,v,Y,!e,e=>location.replace(n(`test-data`,e)));let y=c&&!c.running?c.endedAt:``;(0,q.useEffect)(()=>{u.log().then(m,e=>g(e.message))},[y]);let b=(d||[]).filter(e=>!e.ok).length,x=new Set((d||[]).map(e=>e.requester)).size,S={requests:`Requests`,kept:`Kept`,specs:`Specs`,batches:`Batches`},C={requests:d?.length,kept:t?.requests.length,specs:t?.specs.length};return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ne,{}),(0,J.jsxs)(`main`,{className:s(re,`@container flex-auto gap-4`),children:[(0,J.jsx)(_,{to:{href:n(`data`,`databases`),label:`All databases`}}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,J.jsx)(se,{pixel:l[`test-data`],size:`lg`}),(0,J.jsx)(`h1`,{className:`m-0 text-headline-lg`,children:`Test data`}),t&&(0,J.jsx)(ie,{label:`Test data`,className:`mb-0`,current:v,hrefOf:e=>n(`test-data`,e),tabs:Y.map(e=>({id:e,label:S[e],icon:me[e],...C[e]===void 0?{}:{n:C[e]}}))}),(0,J.jsx)(`span`,{className:`flex-auto`}),(0,J.jsxs)(`a`,{href:n(`data`,`ask`,`test-data`),"data-tip":`Ask for test data`,className:s(p(),`no-underline`),children:[(0,J.jsx)(D,{"aria-hidden":`true`}),`Ask`]})]}),(0,J.jsx)(ce,{more:(0,J.jsx)(J.Fragment,{children:`Kept requests fetch the same data again with no model; specs make data you can insert as batches and remove again.`}),children:`Every request for test data: which agent asked, what for, when, and what Miner sent back.`}),d&&d.length>0&&(0,J.jsxs)(le,{label:`Test data requests`,children:[(0,J.jsx)(R,{dot:`neutral`,value:d.length,label:d.length===1?`request`:`requests`}),(0,J.jsx)(R,{dot:`neutral`,value:x,label:x===1?`asker`:`askers`}),(0,J.jsx)(R,{dot:`fail`,value:b,label:`failed`}),t&&(0,J.jsx)(R,{dot:`pass`,value:t.requests.length,label:`kept`})]}),(r||h)&&(0,J.jsx)(`p`,{role:`alert`,className:s(f.fail,`m-0`),children:r||h}),!t&&!r&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`}),t&&(0,J.jsxs)(J.Fragment,{children:[c&&(c.running?X[c.kind]!==void 0:X[c.kind]===v)&&(0,J.jsx)(fe,{job:c,onStop:o}),(0,J.jsxs)(`div`,{id:`panel-${v}`,children:[v===`requests`&&(0,J.jsx)(Q,{view:t,log:d,busy:i,act:a}),v===`kept`&&(0,J.jsx)(ge,{view:t,job:c,busy:i,act:a,onNote:g}),v===`specs`&&(0,J.jsx)($,{view:t,job:c,busy:i,act:a,onNote:g}),v===`batches`&&(0,J.jsx)(_e,{view:t,job:c,busy:i,act:a})]})]})]})]})}export{Q as Requests,ve as TestData};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-9BkoTWUE.js";import{F as r,L as i,l as a}from"./preload-helper-BupTYkQW.js";import{n as o,t as s}from"./utils-DJRAScIl.js";import{t as c}from"./jsx-runtime-LKYXHABd.js";import{L as l}from"./palette-DwrGI2Fp.js";import{b as u,w as d}from"./api-Dr3U7W5w.js";import{C as f,S as p,_ as m,f as h,g,n as _,x as v}from"./pageBack-Blig1Uqs.js";import{Cr as y,E as b,Gr as x,O as S,Tt as C,Un as w,it as T,lr as E,lt as D,o as O,qn as k,tt as A,vn as j,w as M,zn as N}from"./line-icons-Cwj9OmCz.js";import{Ct as P,Et as F,St as ee,_t as te,bt as I,s as ne,t as re,ut as ie,vt as ae,wt as oe,zt as se}from"./frame-CavkQick.js";import{t as L}from"./when-BuWCTaKm.js";import{H as R,U as ce,V as le,X as z,o as B}from"./index-C1kXcI0E.js";import{a as V,c as H,d as U,i as ue,l as W,m as de,n as G,o as fe,s as K,t as pe}from"./dataParts-Bdf97ZOD.js";var q=e(t(),1),J=c(),Y=[`requests`,`kept`,`specs`,`batches`],me={requests:N,kept:k,specs:C,batches:E},X={fetch:`kept`,request:`requests`,gen:`specs`,files:`specs`,insert:`specs`,batches:`batches`,clean:`batches`},Z=e=>Object.values(e.row_counts||{}).reduce((e,t)=>e+t,0);function he({e,kept:t,busy:n,act:r}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 px-1 py-2`,children:[(0,J.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-body-sm`,children:[(0,J.jsx)(`dt`,{className:`text-muted`,children:`Asked for`}),(0,J.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:e.need}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`When`}),(0,J.jsxs)(`dd`,{className:`m-0`,children:[new Date(e.at).toLocaleString(),e.ms===void 0?``:` · answered in ${(e.ms/1e3).toFixed(1)} s`]}),(0,J.jsx)(`dt`,{className:`text-muted`,children:`How`}),(0,J.jsxs)(`dd`,{className:`m-0`,children:[e.source===`fetch`?`A kept request fetched again, with no model`:`Asked Miner for ${e.asked===`existing`?`existing rows`:e.asked===`new`?`new rows`:`either`}`,e.name?(0,J.jsxs)(J.Fragment,{children:[` · `,(0,J.jsx)(`span`,{className:`font-mono text-body-sm`,children:e.name})]}):null]}),e.why&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`dt`,{className:`text-muted`,children:`The answer`}),(0,J.jsx)(`dd`,{className:`m-0`,children:e.why})]})]}),e.error&&(0,J.jsx)(W,{text:e.error}),Object.entries(e.sample||{}).map(([t,n])=>(0,J.jsx)(U,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`text-body-sm font-medium`,children:`The query`}),(0,J.jsx)(G,{label:`SQL`,children:e.sql})]}),e.script_preview?.length?(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`span`,{className:`text-body-sm font-medium`,children:`INSERT script`}),(0,J.jsx)(G,{label:`INSERT script`,children:e.script_preview.join(`
|
|
2
|
+
`)})]}):null,t&&e.name&&(0,J.jsx)(`div`,{children:(0,J.jsxs)(v,{size:`sm`,disabled:n,onClick:()=>r(`fetch`,{name:e.name}),"data-tip":`Fetch again`,children:[(0,J.jsx)(w,{"aria-hidden":`true`}),`Refresh`]})})]})}function Q({view:e,log:t,busy:r,act:a}){let[o,c]=(0,q.useState)(`all`),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(``),[_,y]=(0,q.useState)(``),x=t??[],w=(0,q.useMemo)(()=>[...new Set(x.map(e=>e.requester))].sort(),[t]),T=(0,q.useMemo)(()=>[...new Set(x.map(e=>e.database).filter(Boolean))].sort(),[t]),E=x.filter(e=>!e.ok).length,D=x.filter(e=>(o===`all`||o===`ok`===e.ok)&&(!l||e.requester===l)&&(!d||e.database===d)),O=new Set(e.requests.map(e=>e.name));return t===null?(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading the requests…`}):x.length?(0,J.jsx)(te,{label:`Requests`,resetKey:`${o}|${l}|${d}`,minWidth:760,fixed:!0,height:ae,placeholder:`Find a request`,tools:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(h,{value:o,onChange:c,items:[{id:`all`,label:`All`,n:x.length},{id:`ok`,label:`Answered`,n:x.length-E},{id:`failed`,label:`Failed`,n:E,alert:!0}]}),w.length>1&&(0,J.jsxs)(i,{size:`sm`,"aria-label":`Who asked`,value:l,onChange:e=>u(e.target.value),className:`w-[180px]`,children:[(0,J.jsx)(`option`,{value:``,children:`Anyone`}),w.map(e=>(0,J.jsx)(`option`,{children:e},e))]}),T.length>1&&(0,J.jsxs)(i,{size:`sm`,"aria-label":`Database`,value:d,onChange:e=>f(e.target.value),className:`w-[160px]`,children:[(0,J.jsx)(`option`,{value:``,children:`Any database`}),T.map(e=>(0,J.jsx)(`option`,{children:e},e))]})]}),head:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`th`,{scope:`col`,className:s(P,`w-9`),children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Open`})}),(0,J.jsx)(`th`,{scope:`col`,className:s(P,`w-[110px]`),children:`When`}),(0,J.jsx)(`th`,{scope:`col`,className:s(P,`w-[150px]`),children:`Who asked`}),(0,J.jsx)(`th`,{scope:`col`,className:P,children:`What for`}),(0,J.jsx)(`th`,{scope:`col`,className:s(P,`w-[110px]`),children:`Database`}),(0,J.jsx)(`th`,{scope:`col`,className:s(P,`w-[140px]`),children:`Answer`}),(0,J.jsx)(`th`,{scope:`col`,className:s(oe,`w-[70px]`),children:`Rows`})]}),empty:`No requests match these filters. Pick All and Anyone to see every request.`,children:D.map(e=>{let t=_===e.id;return(0,J.jsxs)(q.Fragment,{children:[(0,J.jsxs)(`tr`,{className:s(F,t&&`bg-surface-muted`),onClick:()=>y(t?``:e.id),children:[(0,J.jsx)(`td`,{className:s(I,`pr-0`),children:(0,J.jsx)(v,{variant:`icon`,size:`icon-xs`,"aria-expanded":t,"aria-label":t?`Close the request`:`Open the request`,onClick:n=>(n.stopPropagation(),y(t?``:e.id)),children:t?(0,J.jsx)(b,{"aria-hidden":`true`}):(0,J.jsx)(S,{"aria-hidden":`true`})})}),(0,J.jsx)(`td`,{className:s(I,`whitespace-nowrap text-muted`),"data-tip":new Date(e.at).toLocaleString(),"data-sort":new Date(e.at).getTime()||0,children:L(e.at)}),(0,J.jsx)(`td`,{className:s(I,`truncate`),"data-tip":e.requester,children:e.requester}),(0,J.jsxs)(`td`,{className:s(I,`truncate`),"data-tip":e.need,children:[e.need,e.source===`fetch`?(0,J.jsx)(`span`,{className:`text-muted`,children:` · fetched again`}):null]}),(0,J.jsx)(`td`,{className:s(I,`truncate`),"data-tip":e.database,children:e.database||(0,J.jsx)(`span`,{className:`text-muted`,children:`—`})}),(0,J.jsx)(`td`,{className:s(I,`whitespace-nowrap`),children:(0,J.jsx)(g,{tone:e.ok?`pass`:`fail`,children:e.ok?K[e.kind||``]||`Answered`:`Failed`})}),(0,J.jsx)(`td`,{className:ee,"data-sort":e.ok?Z(e):-1,children:e.ok?Z(e):``})]}),t&&(0,J.jsx)(`tr`,{className:`border-t border-line-soft bg-surface-muted/40`,children:(0,J.jsx)(`td`,{colSpan:7,className:s(`px-4 py-2`,`max-w-0`),children:(0,J.jsx)(he,{e,kept:!!e.name&&O.has(e.name),busy:r,act:a})})})]},e.id)})}):(0,J.jsx)(m,{page:!0,icon:C,title:`No test data asked for yet`,action:(0,J.jsxs)(`a`,{href:n(`data`,`ask`,`test-data`),"data-tip":`Ask for test data`,className:s(p({size:`sm`}),`no-underline`),children:[(0,J.jsx)(j,{"aria-hidden":`true`}),`Ask`]}),children:`The agents ask before a test runs, or you can ask yourself.`})}function ge({view:e,job:t,busy:r,act:i,onNote:a}){let s=t&&!t.running&&t.kind===`fetch`?t:null,c=s?.result;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsx)(`p`,{className:`m-0 text-body-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.`}),s&&(0,J.jsxs)(z,{level:3,icon:w,title:s.target,className:`surface rounded-lg bg-bg p-6 shadow-sm`,children:[c&&!c.ok&&(0,J.jsx)(W,{text:c.error||`It could not fetch the data.`}),c?.ok&&(0,J.jsx)(pe,{r:c,onNote:a})]}),e.requests.length===0?(0,J.jsxs)(m,{className:`py-4`,children:[`No kept requests yet. Each request Miner answers is kept here; `,(0,J.jsx)(`a`,{href:n(`data`,`ask`,`test-data`),children:`ask for test data`}),` to make the first.`]}):(0,J.jsx)(H,{items:e.requests,text:e=>`${e.need} ${e.name} ${e.database} ${e.requester||``}`,label:`Kept requests`,size:15,children:e=>(0,J.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-4 border-t border-line-soft py-2 text-body-sm first:border-t-0`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-body-sm font-medium [overflow-wrap:anywhere]`,children:e.need}),(0,J.jsxs)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:[(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` · `,e.database,` · `,K[e.kind],e.rows?` · ${o(e.rows,`row`)}`:``,e.created?` · ${L(e.created)}`:``,e.requester?` · asked by ${e.requester}`:``]})]}),(0,J.jsx)(v,{size:`icon`,variant:`icon`,disabled:r,onClick:()=>i(`fetch`,{name:e.name}),"aria-label":`Fetch ${e.name} again`,"data-tip":`Fetch ${e.name} again`,className:`size-8`,children:(0,J.jsx)(w,{"aria-hidden":`true`})})]},e.name)})]})}function $({view:e,job:t,busy:o,act:c,onNote:l}){let[d,p]=(0,q.useState)(e.specs[0]??``),[h,g]=(0,q.useState)(``),[_,y]=(0,q.useState)(``),[b,S]=(0,q.useState)(`csv`),[w,E]=(0,q.useState)(!1),O={spec:d,...h?{db:h}:{},..._?{seed:_}:{}},k=t&&!t.running?t:null,M=k&&[`gen`,`files`,`insert`].includes(k.kind)&&k.target===d?k.result:void 0,N=e.databases.find(e=>e.name===h),P=async()=>{try{let{id:e}=await u.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=n(`chats`,e)}catch(e){l(e.message)}};return(0,J.jsx)(z,{id:`spec`,icon:C,title:`Make test data from a spec`,actions:(0,J.jsxs)(v,{variant:`ghost`,onClick:()=>void P(),"data-tip":`Write a spec in a chat`,children:[(0,J.jsx)(j,{"aria-hidden":`true`}),`Chat`]}),description:`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.`,children:e.specs.length===0?(0,J.jsx)(m,{className:`py-4`,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,J.jsxs)(`div`,{className:s(a,`flex flex-col gap-4`),children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-4`,children:[(0,J.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-2 text-body-sm font-medium`,children:[`Spec`,(0,J.jsx)(i,{value:d,onChange:e=>p(e.target.value),children:e.specs.map(e=>(0,J.jsx)(`option`,{children:e},e))})]}),(0,J.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-2 text-body-sm font-medium`,children:[`Database`,(0,J.jsxs)(i,{value:h,onChange:e=>g(e.target.value),children:[(0,J.jsx)(`option`,{value:``,children:`The spec's own`}),e.databases.map(e=>(0,J.jsxs)(`option`,{value:e.name,children:[e.name,e.writable?``:` (read only)`]},e.name))]})]}),(0,J.jsxs)(`label`,{className:`flex w-[120px] flex-col gap-2 text-body-sm font-medium`,children:[`Seed`,(0,J.jsx)(r,{value:_,inputMode:`numeric`,placeholder:`Random`,onChange:e=>y(e.target.value.replace(/\D/g,``).slice(0,9))})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(v,{variant:w?void 0:`primary`,disabled:o||!d,onClick:()=>c(`gen`,O),children:[(0,J.jsx)(D,{"aria-hidden":`true`}),`Preview`]}),(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,J.jsxs)(v,{disabled:o||!d,onClick:()=>c(`gen`,{...O,mode:`files`,format:b}),"data-tip":`Write files (${b})`,children:[(0,J.jsx)(T,{"aria-hidden":`true`}),`Export`]}),(0,J.jsx)(i,{"aria-label":`File format`,value:b,onChange:e=>S(e.target.value),className:`w-[88px]`,children:[`csv`,`json`,`sql`].map(e=>(0,J.jsx)(`option`,{children:e},e))})]}),(0,J.jsxs)(v,{disabled:o||!d||!N?.writable,"data-tip":N?.writable?`Insert into ${N.name}`:`Pick a writable database to insert into`,onClick:()=>E(!0),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Insert`]})]}),w&&N&&(0,J.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Insert test data`,className:s(f.warn,`flex flex-col gap-4`),children:[(0,J.jsxs)(`span`,{className:`font-medium`,children:[`Insert the rows of `,d,` into `,N.name,`?`]}),(0,J.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:`They go in as one batch, which you can remove again under Batches. Only on a test database.`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsxs)(v,{variant:`primary`,onClick:()=>{E(!1),c(`gen`,{...O,mode:`insert`,confirmed:!0})},children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Insert`]}),(0,J.jsxs)(v,{onClick:()=>E(!1),"data-tip":`Don't insert`,children:[(0,J.jsx)(x,{"aria-hidden":`true`}),`Cancel`]})]})]}),M&&!M.ok&&(0,J.jsx)(W,{text:M.error||`It did not make the data.`}),M?.ok&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[M.batch&&(0,J.jsxs)(`p`,{className:s(f.pass,`m-0`),children:[`Inserted as batch `,(0,J.jsx)(`span`,{className:`font-mono text-body-sm`,children:M.batch}),`.`]}),M.files?.length?(0,J.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-body-sm`,children:[`Wrote`,M.files.map(e=>(0,J.jsx)(ue,{file:e,onNote:l},e))]}):null,(0,J.jsx)(V,{r:M})]})]})})}function _e({view:e,job:t,busy:r,act:a}){let o=e.databases.filter(e=>e.writable),[c,l]=(0,q.useState)(o[0]?.name??``),[u,d]=(0,q.useState)(``),h=t&&!t.running?t:null,g=h?.kind===`batches`?(Array.isArray(h.result)?h.result.flatMap(e=>e.batches||[]):h.result?.batches)??[]:null;return(0,J.jsx)(z,{id:`batch`,icon:E,title:`Inserted batches`,description:`Rows inserted from a spec go in as a batch. Remove a batch to take exactly those rows out again, children first.`,children:o.length===0?(0,J.jsx)(m,{className:`py-4`,action:(0,J.jsxs)(`a`,{href:n(`settings`,`databases`),className:p({size:`sm`}),children:[(0,J.jsx)(O,{"aria-hidden":`true`}),`Settings, Databases`]}),children:`No writable database: test data is inserted only into one marked writable in Settings.`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(i,{"aria-label":`Database`,value:c,onChange:e=>l(e.target.value),className:`w-[220px]`,children:o.map(e=>(0,J.jsx)(`option`,{children:e.name},e.name))}),(0,J.jsxs)(v,{disabled:r||!c,onClick:()=>a(`batches`,{db:c}),"data-tip":`List batches`,children:[(0,J.jsx)(D,{"aria-hidden":`true`}),`Show`]})]}),g&&g.length===0&&(0,J.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`No batches in `,h?.target,`.`]}),g&&g.length>0&&(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:g.map(e=>(0,J.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-4 border-t border-line-soft py-2 text-body-sm first:border-t-0`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`font-mono text-body-sm`,children:e.batch}),(0,J.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[(0,J.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(`, `)]})]}),u===e.batch?(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`text-body-sm text-warn`,children:[`Remove its rows from `,h?.target,`?`]}),(0,J.jsxs)(v,{variant:`danger`,size:`sm`,onClick:()=>{d(``),a(`clean`,{db:h?.target,batch:e.batch,confirmed:!0})},children:[(0,J.jsx)(y,{"aria-hidden":`true`}),`Remove`]}),(0,J.jsxs)(v,{size:`sm`,onClick:()=>d(``),children:[(0,J.jsx)(M,{"aria-hidden":`true`}),`Keep`]})]}):(0,J.jsx)(v,{size:`icon`,variant:`icon`,disabled:r,onClick:()=>d(e.batch),"aria-label":`Remove batch ${e.batch}`,"data-tip":`Remove batch ${e.batch}`,className:`size-8`,children:(0,J.jsx)(y,{"aria-hidden":`true`})})]},e.batch))}),h?.kind===`clean`&&h.result?.ok&&(0,J.jsxs)(`p`,{className:s(f.pass,`m-0`),children:[`Removed:`,` `,Object.entries(h.result.removed||{}).map(([e,t])=>`${e} ${t}`).join(`, `)]})]})})}function ve({sub:e}){let{view:t,error:r,busy:i,act:a,stop:o,job:c}=de(),[u,m]=(0,q.useState)(null),[h,g]=(0,q.useState)(``),v=Y.includes(e)?e:`requests`;B(`test-data`,v,Y,!e,e=>location.replace(n(`test-data`,e)));let y=c&&!c.running?c.endedAt:``;(0,q.useEffect)(()=>{d.log().then(m,e=>g(e.message))},[y]);let b=(u||[]).filter(e=>!e.ok).length,x=new Set((u||[]).map(e=>e.requester)).size,S={requests:`Requests`,kept:`Kept`,specs:`Specs`,batches:`Batches`},C={requests:u?.length,kept:t?.requests.length,specs:t?.specs.length};return(0,J.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,J.jsx)(ne,{}),(0,J.jsxs)(`main`,{className:s(re,`@container flex-auto gap-4`),children:[(0,J.jsx)(_,{to:{href:n(`data`,`databases`),label:`All databases`}}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,J.jsx)(se,{pixel:l[`test-data`],size:`lg`,head:!0}),(0,J.jsx)(`h1`,{className:`m-0 text-headline-md`,children:`Test data`}),t&&(0,J.jsx)(ie,{label:`Test data`,className:`mb-0`,current:v,hrefOf:e=>n(`test-data`,e),tabs:Y.map(e=>({id:e,label:S[e],icon:me[e],...C[e]===void 0?{}:{n:C[e]}}))}),(0,J.jsx)(`span`,{className:`flex-auto`}),(0,J.jsxs)(`a`,{href:n(`data`,`ask`,`test-data`),"data-tip":`Ask for test data`,className:s(p(),`no-underline`),children:[(0,J.jsx)(j,{"aria-hidden":`true`}),`Ask`]})]}),(0,J.jsx)(ce,{more:(0,J.jsx)(J.Fragment,{children:`Kept requests fetch the same data again with no model; specs make data you can insert as batches and remove again.`}),children:`Every request for test data: which agent asked, what for, when, and what Miner sent back.`}),u&&u.length>0&&(0,J.jsxs)(le,{label:`Test data requests`,children:[(0,J.jsx)(R,{dot:`neutral`,value:u.length,label:u.length===1?`request`:`requests`}),(0,J.jsx)(R,{dot:`neutral`,value:x,label:x===1?`asker`:`askers`}),(0,J.jsx)(R,{dot:`fail`,value:b,label:`failed`}),t&&(0,J.jsx)(R,{dot:`pass`,value:t.requests.length,label:`kept`})]}),(r||h)&&(0,J.jsx)(`p`,{role:`alert`,className:s(f.fail,`m-0`),children:r||h}),!t&&!r&&(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`}),t&&(0,J.jsxs)(J.Fragment,{children:[c&&(c.running?X[c.kind]!==void 0:X[c.kind]===v)&&(0,J.jsx)(fe,{job:c,onStop:o}),(0,J.jsxs)(`div`,{id:`panel-${v}`,children:[v===`requests`&&(0,J.jsx)(Q,{view:t,log:u,busy:i,act:a}),v===`kept`&&(0,J.jsx)(ge,{view:t,job:c,busy:i,act:a,onNote:g}),v===`specs`&&(0,J.jsx)($,{view:t,job:c,busy:i,act:a,onNote:g}),v===`batches`&&(0,J.jsx)(_e,{view:t,job:c,busy:i,act:a})]})]})]})]})}export{Q as Requests,ve as TestData};
|