@capagents/forgeqe 3.2.7 → 3.2.8
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/dist/forgeqe.js +2 -2
- package/dist/web/assets/{3d-force-graph-CUGt_TSW.js → 3d-force-graph-CbGbqGhp.js} +1 -1
- package/dist/web/assets/Agent-g57O0gf2.js +8 -0
- package/dist/web/assets/{AgentWork-BpfMY_xu.js → AgentWork-DEZxLOeM.js} +1 -1
- package/dist/web/assets/ApiTests-DhxqD5GK.js +15 -0
- package/dist/web/assets/Browse-DfvSk_5f.js +1 -0
- package/dist/web/assets/Chat-CuuX_MnF.js +3 -0
- package/dist/web/assets/{CommandPalette-CKJHtRjo.js → CommandPalette-DLXhO1e4.js} +1 -1
- package/dist/web/assets/{Compare-DtW2g-qb.js → Compare-DFRzCXyA.js} +1 -1
- package/dist/web/assets/{Cost-DW-kVEL8.js → Cost-CZ1xMPze.js} +1 -1
- package/dist/web/assets/Data-jxeBry5m.js +6 -0
- package/dist/web/assets/Desktop-4S45Nhc5.js +1 -0
- package/dist/web/assets/DesktopReview-CUyNT0Hl.js +2 -0
- package/dist/web/assets/{DeviceScreen-DzVNfMwl.js → DeviceScreen-DlJqIxZ-.js} +1 -1
- package/dist/web/assets/Evidence-BP-fY7HX.js +1 -0
- package/dist/web/assets/{Explore-ChpAuezG.js → Explore-DY5e98Jz.js} +2 -2
- package/dist/web/assets/Features-CKpQ7ilm.js +1 -0
- package/dist/web/assets/{Flags-Do-pvmCF.js → Flags-CLm40jFw.js} +2 -2
- package/dist/web/assets/Flaky-CQx5RPZt.js +1 -0
- package/dist/web/assets/Impact-DsvECtFV.js +3 -0
- package/dist/web/assets/Jobs-Dzgeugby.js +5 -0
- package/dist/web/assets/KindPage-Dy8mhe14.js +6 -0
- package/dist/web/assets/{LiveDevice-OyxEiqBt.js → LiveDevice-DGXIulGh.js} +1 -1
- package/dist/web/assets/Migration-ecdFw6JR.js +8 -0
- package/dist/web/assets/Mobile-89JRhyfb.js +1 -0
- package/dist/web/assets/{Observability-DdTOLp2C.js → Observability-BTxPNYcK.js} +1 -1
- package/dist/web/assets/PageAgent-CtHfmMj1.js +1 -0
- package/dist/web/assets/Product-DutzjAnI.js +12 -0
- package/dist/web/assets/{Production-oTXhv40a.js → Production-DVc4vly0.js} +1 -1
- package/dist/web/assets/Quality-DDRPOOgr.js +1 -0
- package/dist/web/assets/{Readiness-Bv9uTTiI.js → Readiness-BRtsOnY7.js} +1 -1
- package/dist/web/assets/Record-BgX9IgVU.js +1 -0
- package/dist/web/assets/Regression-B5TZmljh.js +5 -0
- package/dist/web/assets/{RelationGraph-BQl3M4zd.js → RelationGraph-Bf7JxnoO.js} +1 -1
- package/dist/web/assets/Reports-Ckul-6_Z.js +2 -0
- package/dist/web/assets/Responsive-BuFvnY-7.js +3 -0
- package/dist/web/assets/{RunDiff-BBT1sQLh.js → RunDiff-lbzcjQPB.js} +1 -1
- package/dist/web/assets/Settings-DICPHvyS.js +21 -0
- package/dist/web/assets/{Steps-C_vL6-8p.js → Steps-Bgta9n5a.js} +3 -3
- package/dist/web/assets/TestData-DhzYxkRb.js +2 -0
- package/dist/web/assets/TestManagement-DOTikKBJ.js +4 -0
- package/dist/web/assets/{WhatsNew-DTcaqdOJ.js → WhatsNew-BNpscacD.js} +1 -1
- package/dist/web/assets/{agentSettingsSheet-DM1aa237.js → agentSettingsSheet-CE2-cOUE.js} +1 -1
- package/dist/web/assets/{choice-B6z9CWyZ.js → choice-DPE-97iI.js} +1 -1
- package/dist/web/assets/{coverage-BhtF065n.js → coverage-8y4Ntf5j.js} +4 -4
- package/dist/web/assets/{dataParts-BNDVxwFb.js → dataParts-BWLBAktB.js} +3 -3
- package/dist/web/assets/desktopAppPath-CNgKUGx-.js +1 -0
- package/dist/web/assets/frame-CILGAQMi.js +13 -0
- package/dist/web/assets/index-CAiu49as.css +2 -0
- package/dist/web/assets/index-jQktxp_0.js +56 -0
- package/dist/web/assets/{markdown-BhU7ng6c.js → markdown-C3_rYFsI.js} +4 -4
- package/dist/web/assets/pageBack-CpPsn9m9.js +3 -0
- package/dist/web/assets/{palette-BsY8OLxd.js → palette-B4gvOIk7.js} +1 -1
- package/dist/web/assets/{paletteCommands-DflHQ05x.js → paletteCommands-Df6J2Ddx.js} +1 -1
- package/dist/web/assets/parts-CoaptHZw.js +1 -0
- package/dist/web/assets/{preload-helper-qorOEK5q.js → preload-helper-Bjdk4wEa.js} +1 -1
- package/dist/web/assets/{productParts-Dxl-TQKY.js → productParts-yX7pkb5g.js} +1 -1
- package/dist/web/assets/{qualityParts-ClGKtjEv.js → qualityParts-DfUjhv4u.js} +1 -1
- package/dist/web/assets/{radio-DDxnnflQ.js → radio-BerZ8bce.js} +1 -1
- package/dist/web/assets/{recordTest-B33rIncn.js → recordTest-CYjGtHjQ.js} +1 -1
- package/dist/web/assets/{route-D9uPlFWw.js → route-M6BKgobp.js} +1 -1
- package/dist/web/assets/{sectionList-e5mFDaS2.js → sectionList-K06uJ9W7.js} +1 -1
- package/dist/web/assets/{stepper-DSDz0uu8.js → stepper-yRhSVs0I.js} +1 -1
- package/dist/web/index.html +9 -9
- package/package.json +1 -1
- package/dist/web/assets/Agent-DiX8ljlC.js +0 -8
- package/dist/web/assets/ApiTests-4jfzlfVd.js +0 -15
- package/dist/web/assets/Browse-ByDemInL.js +0 -1
- package/dist/web/assets/Chat-C3wKV0CI.js +0 -3
- package/dist/web/assets/Data--HGneNun.js +0 -6
- package/dist/web/assets/Desktop-DQf5gv7D.js +0 -1
- package/dist/web/assets/DesktopReview-BaPYt0kl.js +0 -2
- package/dist/web/assets/Evidence-CxRMnZch.js +0 -1
- package/dist/web/assets/Features-VsLb8QTH.js +0 -1
- package/dist/web/assets/Flaky-CyhTszAg.js +0 -1
- package/dist/web/assets/Impact-BWBAXRuw.js +0 -3
- package/dist/web/assets/Jobs-C_MjXv0_.js +0 -5
- package/dist/web/assets/KindPage-Bb3Kp4-q.js +0 -6
- package/dist/web/assets/Migration-C80mGA3h.js +0 -8
- package/dist/web/assets/Mobile-C4wVBYfr.js +0 -1
- package/dist/web/assets/PageAgent-Bi53-H99.js +0 -1
- package/dist/web/assets/Product-0LXndvp-.js +0 -12
- package/dist/web/assets/Quality-CY0CJF9e.js +0 -1
- package/dist/web/assets/Record-C-kyOkYq.js +0 -1
- package/dist/web/assets/Regression-CwKxvG1h.js +0 -5
- package/dist/web/assets/Reports-Ck8rc3br.js +0 -2
- package/dist/web/assets/Responsive-COmV2NXo.js +0 -3
- package/dist/web/assets/Settings-7aMk9Sqx.js +0 -21
- package/dist/web/assets/TestData-KzMy9N9f.js +0 -2
- package/dist/web/assets/TestManagement-BCEhOGB9.js +0 -4
- package/dist/web/assets/desktopAppPath-D4hHP56R.js +0 -1
- package/dist/web/assets/frame-CNYHTG4T.js +0 -13
- package/dist/web/assets/index-B1Q2Dlqw.js +0 -56
- package/dist/web/assets/index-sxUpjgyw.css +0 -2
- package/dist/web/assets/pageBack-BoSbGSU6.js +0 -3
- package/dist/web/assets/parts-C4QMgN_N.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Br as t,Hr as n,In as r,Ir as i,L as a,O as o,Rn as s,Sn as c,U as l,Ur as u,Vn as d,Wt as f,dt as p,g as m,it as h,l as g,ln as ee,qr as _,r as te,vn as v,wr as ne}from"./route-D9uPlFWw.js";import{D as y,E as b,Gt as re,Ht as x,Q as S,St as C,Vt as w,q as ie}from"./preload-helper-qorOEK5q.js";import{t as T}from"./jsx-runtime-LKYXHABd.js";import{U as ae}from"./palette-BsY8OLxd.js";import{F as E,N as D,O,c as k,i as oe,l as A,s as j}from"./pageBack-BoSbGSU6.js";import{Gt as se,Kt as ce,dt as M,kt as le,ut as ue}from"./frame-CNYHTG4T.js";import{t as N}from"./when-BuWCTaKm.js";import{t as de}from"./code-DzYywAs5.js";import{n as fe}from"./markdown-BhU7ng6c.js";import{G as pe,W as P}from"./index-B1Q2Dlqw.js";import{o as F}from"./dataParts-BNDVxwFb.js";var I=e(_(),1),L=T(),me={click:[`target`,`timeout`,`note`],double_click:[`target`,`timeout`,`note`],type:[`target`,`text`,`timeout`,`note`],select:[`target`,`value`,`timeout`,`note`],keys:[`keys`,`note`],expect:[`target`,`text`,`timeout`,`note`],wait:[`seconds`,`note`],wait_for:[`target`,`text`,`timeout`,`note`],launch:[`timeout`,`note`],close:[`note`],expect_image:[`timeout`,`note`]};function R({p:e}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-6 text-body-sm text-ink-2`,children:e.summary.map((e,t)=>(0,L.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}),(0,L.jsx)(`pre`,{className:w(de,`m-0 max-h-[200px]`),children:e.diff.map((e,t)=>(0,L.jsx)(`span`,{className:w(`block`,e.startsWith(`+`)?`text-pass`:e.startsWith(`-`)?`text-fail`:`text-muted`),children:e},t))})]})}function z({label:e,children:t}){return(0,L.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1 text-body-sm font-medium`,children:[e,t]})}function he({workflow:e,step:t,mode:n,onDone:i,onCancel:a}){let s=me[t.op]??[`note`],c=t.fields??{},[l,d]=(0,I.useState)({automation_id:c.target?.automation_id??``,name:c.target?.name??``,control_type:c.target?.control_type??``}),[f,p]=(0,I.useState)(c.text??``),[m,h]=(0,I.useState)(c.value??``),[g,ee]=(0,I.useState)(c.keys??``),[_,te]=(0,I.useState)(c.seconds===void 0?``:String(c.seconds)),[v,y]=(0,I.useState)(c.timeout===void 0?``:String(c.timeout)),[re,x]=(0,I.useState)(c.note??``),[C,ie]=(0,I.useState)(null),[T,ae]=(0,I.useState)(``),[O,k]=(0,I.useState)(!1),oe=()=>{let e={};return s.includes(`target`)&&(l.automation_id!==(c.target?.automation_id??``)||l.name!==(c.target?.name??``)||l.control_type!==(c.target?.control_type??``))&&(e.target=l),s.includes(`text`)&&f!==(c.text??``)&&(e.text=f),s.includes(`value`)&&m!==(c.value??``)&&(e.value=m),s.includes(`keys`)&&g!==(c.keys??``)&&(e.keys=g),s.includes(`seconds`)&&_!==(c.seconds===void 0?``:String(c.seconds))&&(e.seconds=Number(_)),s.includes(`timeout`)&&v!==(c.timeout===void 0?``:String(c.timeout))&&v.trim()&&(e.timeout=Number(v)),s.includes(`note`)&&re!==(c.note??``)&&(e.note=re),e},A=async r=>{k(!0),ae(``);try{let a=await S.editStep({workflow:e,step:t.n,action:n,...n===`edit`?{fields:oe()}:{},...r?{version:r}:{}});a.written?i():ie(a)}catch(e){ae(e.message)}finally{k(!1)}};(0,I.useEffect)(()=>{n===`remove`&&A()},[]);let j=()=>ie(null);return(0,L.jsxs)(`div`,{className:`mb-2 ml-10 flex flex-col gap-4 rounded-base bg-surface-muted p-4`,children:[n===`edit`&&!C&&(0,L.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,180px),1fr))] gap-2`,children:[s.includes(`target`)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(z,{label:`Control's name`,children:(0,L.jsx)(b,{size:`sm`,value:l.name,maxLength:300,onChange:e=>(d({...l,name:e.target.value}),j()),className:`bg-bg`})}),(0,L.jsx)(z,{label:`Automation id`,children:(0,L.jsx)(b,{size:`sm`,value:l.automation_id,maxLength:300,spellCheck:!1,onChange:e=>(d({...l,automation_id:e.target.value}),j()),className:`bg-bg font-mono text-body-sm`})}),(0,L.jsx)(z,{label:`Control type`,children:(0,L.jsx)(b,{size:`sm`,value:l.control_type,maxLength:60,spellCheck:!1,placeholder:`Button`,onChange:e=>(d({...l,control_type:e.target.value}),j()),className:`bg-bg`})})]}),s.includes(`text`)&&(0,L.jsx)(z,{label:t.op===`type`?`Text to type`:`Text it shows`,children:(0,L.jsx)(b,{size:`sm`,value:f,maxLength:500,onChange:e=>p(e.target.value),className:`bg-bg`})}),s.includes(`value`)&&(0,L.jsx)(z,{label:`Item to choose`,children:(0,L.jsx)(b,{size:`sm`,value:m,maxLength:500,onChange:e=>h(e.target.value),className:`bg-bg`})}),s.includes(`keys`)&&(0,L.jsx)(z,{label:`Keys`,children:(0,L.jsx)(b,{size:`sm`,value:g,maxLength:100,spellCheck:!1,placeholder:`ctrl+s`,onChange:e=>ee(e.target.value),className:`bg-bg font-mono text-body-sm`})}),s.includes(`seconds`)&&(0,L.jsx)(z,{label:`Wait (seconds)`,children:(0,L.jsx)(b,{size:`sm`,type:`number`,min:0,max:600,value:_,onChange:e=>te(e.target.value),className:`bg-bg`})}),s.includes(`timeout`)&&(0,L.jsx)(z,{label:`Timeout (seconds)`,children:(0,L.jsx)(b,{size:`sm`,type:`number`,min:0,max:600,value:v,placeholder:`default`,onChange:e=>y(e.target.value),className:`bg-bg`})}),s.includes(`note`)&&(0,L.jsx)(z,{label:`Note`,children:(0,L.jsx)(b,{size:`sm`,value:re,maxLength:200,onChange:e=>x(e.target.value),className:`bg-bg`})})]}),n===`remove`&&!C&&!T&&(0,L.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Working out the change…`}),C&&(0,L.jsx)(R,{p:C}),T&&(0,L.jsx)(`p`,{role:`alert`,className:w(E.fail,`m-0`),children:T}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[C?(0,L.jsxs)(D,{size:`sm`,variant:n===`remove`?`destructive`:`primary`,disabled:O,onClick:()=>void A(C.version),children:[n===`remove`?(0,L.jsx)(ne,{"aria-hidden":`true`}):(0,L.jsx)(o,{"aria-hidden":`true`}),O?`Saving…`:n===`remove`?`Delete step ${t.n}`:`Save the change`]}):n===`edit`&&(0,L.jsx)(D,{size:`sm`,variant:`primary`,disabled:O||!Object.keys(oe()).length,onClick:()=>void A(),children:O?`Checking…`:`Preview the change`}),C&&n===`edit`&&(0,L.jsxs)(D,{size:`sm`,onClick:()=>ie(null),children:[(0,L.jsx)(r,{"aria-hidden":`true`}),`Change it more`]}),(0,L.jsxs)(D,{size:`sm`,variant:`ghost`,onClick:a,children:[(0,L.jsx)(u,{"aria-hidden":`true`}),`Cancel`]})]})]})}function B(e,t){let n={values:{},secrets:{}};for(let r of e?.inputs??[])r.kind!==`data`&&r.env&&t.includes(r.env)&&(n.secrets[r.name]=r.env);return n}function ge(e,t){return(e?.inputs??[]).every(e=>e.kind===`data`?e.default!==void 0||!!t.values[e.name]?.trim():!!t.secrets[e.name])}function V(e){return{values:Object.fromEntries(Object.entries(e.values).filter(([,e])=>e.trim())),secrets:e.secrets}}function H({block:e,secrets:t,use:n,onChange:r,disabled:i,unset:a=[]}){return e.inputs.length?(0,L.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-2 border-0 p-0`,children:[(0,L.jsx)(`legend`,{className:`mb-1 p-0 text-body-sm font-medium text-ink-2`,children:`What the block types`}),e.inputs.map(e=>{let o=e.label||e.name;return e.kind===`data`?(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm text-ink-2`,children:[o,` `,(0,L.jsx)(`span`,{className:`text-muted`,children:`(test data)`}),(0,L.jsx)(b,{value:n.values[e.name]??``,maxLength:300,disabled:i,placeholder:e.default===void 0?`A value`:e.default||`(empty)`,onChange:t=>r({...n,values:{...n.values,[e.name]:t.target.value}})})]},e.name):(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm text-ink-2`,children:[o,` `,(0,L.jsxs)(`span`,{className:`text-muted`,children:[`(`,e.kind===`totp`?`authenticator secret`:`secret`,`)`]}),(0,L.jsxs)(y,{value:n.secrets[e.name]??``,disabled:i||!t.length,onChange:t=>r({...n,secrets:{...n.secrets,[e.name]:t.target.value}}),children:[(0,L.jsx)(`option`,{value:``,children:t.length?`Pick a saved secret`:`No saved secrets yet`}),t.map(e=>(0,L.jsxs)(`option`,{value:e,children:[e,a.includes(e)?` (no value here)`:``]},e))]}),n.secrets[e.name]&&a.includes(n.secrets[e.name])&&(0,L.jsxs)(`span`,{className:`text-warn`,children:[n.secrets[e.name],` has no value on this computer: save it in Settings › Secrets, or the step that types it fails.`]}),!t.length&&(0,L.jsx)(`span`,{className:`text-muted`,children:`Save one in Settings › Secrets, then come back.`}),e.env&&!t.includes(e.env)&&(0,L.jsxs)(`span`,{className:`text-muted`,children:[`The block was made with `,e.env,`, which has no saved value here.`]})]},e.name)})]}):null}function _e({block:e}){return e.lines.length?(0,L.jsxs)(`details`,{className:`text-body-sm text-ink-2`,children:[(0,L.jsxs)(`summary`,{className:`cursor-pointer select-none text-muted`,children:[`See its `,e.steps,` `,e.steps===1?`step`:`steps`]}),(0,L.jsxs)(`ol`,{className:`m-0 mt-1 flex list-decimal flex-col gap-1 pl-6`,children:[e.lines.map((e,t)=>(0,L.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t)),e.steps>e.lines.length&&(0,L.jsxs)(`li`,{className:`list-none text-muted`,children:[`and `,e.steps-e.lines.length,` more`]})]})]}):null}var U=[{id:`typed`,label:`As typed`,note:`The workflow types exactly this.`},{id:`data`,label:`Test data`,note:`A named value the replay fills in: its own value, a row of a data file, or one you give when it runs.`},{id:`secret`,label:`Secret`,note:`Read from an environment variable when it replays; what was typed leaves the workflow.`},{id:`unique`,label:`New on each run`,note:`A fresh value each time, like this one: for an email or a name that must not repeat.`},{id:`date`,label:`A date from today`,note:`Counted from today, the same number of days ahead on each replay, so a day that has passed is never clicked.`},{id:`any`,label:`Any free one`,note:`Each replay clicks the first control of this kind there that is not greyed out (an open slot); later checks compare with what it picked.`}],W={label:`As clicked`,note:`The workflow clicks exactly this one.`},G={replay:[`Replaying the workflow`,`Replayed the workflow`,`working`],validate:[`Checking the workflow`,`Checked the workflow`,`searching`]};async function K(e){let t=await S.editStep(e);await S.editStep({...e,version:t.version})}var ve=[{id:`check_text`,label:`Check a control shows a text`,control:!0,text:`need`},{id:`check_present`,label:`Check a control is there`,control:!0},{id:`wait_for`,label:`Wait for a control`,control:!0,text:`may`},{id:`wait_gone`,label:`Wait until a control is gone`,control:!0},{id:`wait`,label:`Wait some seconds`,control:!1},{id:`keys`,label:`Press keys`,control:!1}];function ye({step:e,blocks:t,secrets:n,unset:r,onAdd:i}){let[a,o]=(0,I.useState)(t[0]?.id??``),s=t.find(e=>e.id===a)??t[0],[c,l]=(0,I.useState)(()=>B(s,n)),[u,f]=(0,I.useState)(!1);return s?u?(0,L.jsxs)(`form`,{className:`flex flex-col gap-2 border-t border-line-soft p-4`,onSubmit:e=>{e.preventDefault(),ge(s,c)&&i(s.id,V(c))},children:[(0,L.jsxs)(`p`,{className:`m-0 text-body-sm font-medium`,children:[`Or put in a block after step `,e.n]}),(0,L.jsx)(y,{size:`sm`,"aria-label":`The block to put in after step ${e.n}`,value:s.id,onChange:e=>{o(e.target.value),l(B(t.find(t=>t.id===e.target.value),n))},children:t.map(e=>(0,L.jsxs)(`option`,{value:e.id,children:[e.section?`${e.section} › `:``,e.name,` · `,e.steps,` `,e.steps===1?`step`:`steps`]},e.id))}),(0,L.jsx)(_e,{block:s}),(0,L.jsx)(H,{block:s,secrets:n,use:c,onChange:l,unset:r}),(0,L.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`Its steps go in after this one, marked as the block's; its test data become variables of this workflow.`}),(0,L.jsxs)(D,{type:`submit`,size:`sm`,variant:`accent`,disabled:!ge(s,c),className:`self-start`,"data-tip":`Put the block in after this step`,children:[(0,L.jsx)(d,{"aria-hidden":`true`}),`Add`]})]}):(0,L.jsx)(`div`,{className:`border-t border-line-soft px-4 py-2`,children:(0,L.jsxs)(D,{size:`sm`,variant:`ghost`,onClick:()=>f(!0),"data-tip":`Put a saved block of this app in after step ${e.n}`,children:[(0,L.jsx)(m,{"aria-hidden":`true`}),`Put in a block instead`]})}):null}function be({f:e,block:t,secrets:n,unset:r,busy:i,onUpdate:a}){let[s,c]=(0,I.useState)(!1),[l,u]=(0,I.useState)({values:{},secrets:{}});return(0,L.jsxs)(`div`,{role:`status`,className:w(E.info,`flex flex-col gap-2`),children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,L.jsxs)(`span`,{className:`min-w-0 flex-[1_1_240px]`,children:[`Steps `,e.from,` to `,e.to,` are `,e.version?`version ${e.version}`:`an older version`,` of the block `,(0,L.jsx)(`strong`,{className:`font-medium`,children:e.name}),`; version `,e.latest,` is saved now.`]}),(0,L.jsxs)(D,{size:`sm`,disabled:i,onClick:()=>void a(s?V(l):void 0).then(e=>{!e&&t?.inputs.length&&c(!0)}),"data-tip":`Put the saved version in their place, with the same values`,children:[(0,L.jsx)(o,{"aria-hidden":`true`}),s?`Update with these`:`Update`]})]}),s&&t&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:`Not every value of the old copy could be found: give the ones it needs. Empty ones keep the old copy's or the block's own.`}),(0,L.jsx)(H,{block:t,secrets:n,use:l,onChange:u,disabled:i,unset:r})]})]})}function xe({blocks:e,busy:t,act:n}){let[i,a]=(0,I.useState)(null),[s,c]=(0,I.useState)(null);return e.length?(0,L.jsx)(P,{level:3,icon:m,title:`Blocks of this app`,className:`gap-2`,children:(0,L.jsx)(`ul`,{className:w(O,`m-0 flex list-none flex-col p-0`),children:e.map((e,l)=>(0,L.jsxs)(`li`,{className:w(`flex flex-col gap-2 px-4 py-2`,l>0&&`border-t border-line-soft`),children:[i?.id===e.id?(0,L.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:t=>{t.preventDefault(),n(async()=>(await C.updateBlock(e.id,{name:i.name,section:i.section}),a(null),`The block "${i.name}" is saved as a new version.`))},children:[(0,L.jsxs)(`label`,{className:`flex min-w-[160px] flex-1 flex-col gap-1 text-body-sm font-medium text-ink-2`,children:[`Name`,(0,L.jsx)(b,{size:`sm`,value:i.name,maxLength:80,onChange:e=>a({...i,name:e.target.value})})]}),(0,L.jsxs)(`label`,{className:`flex min-w-[120px] flex-col gap-1 text-body-sm font-medium text-ink-2`,children:[`Section`,(0,L.jsx)(b,{size:`sm`,value:i.section,maxLength:40,onChange:e=>a({...i,section:e.target.value})})]}),(0,L.jsxs)(D,{type:`submit`,size:`sm`,variant:`primary`,disabled:t||!i.name.trim(),"data-tip":`Save the block as a new version`,children:[(0,L.jsx)(o,{"aria-hidden":`true`}),`Save`]}),(0,L.jsxs)(D,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>a(null),children:[(0,L.jsx)(u,{"aria-hidden":`true`}),`Cancel`]})]}):(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_220px] flex-col`,children:[(0,L.jsxs)(`span`,{className:`text-body-sm font-medium text-ink [overflow-wrap:anywhere]`,children:[e.section?`${e.section} › `:``,e.name,` `,(0,L.jsxs)(`span`,{className:`font-normal text-muted`,children:[`v`,e.version,` · `,x(e.steps,`step`)]})]}),e.inputs.length>0&&(0,L.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`Takes `,e.inputs.map(e=>`${e.label||e.name}${e.kind===`data`?``:` (secret)`}`).join(`, `)]}),(0,L.jsx)(_e,{block:e})]}),(0,L.jsx)(D,{size:`icon`,variant:`icon`,disabled:t,"aria-label":`Change the block ${e.name}`,"data-tip":`Change the block ${e.name}`,onClick:()=>a({id:e.id,name:e.name,section:e.section??``}),className:`size-8`,children:(0,L.jsx)(r,{"aria-hidden":`true`})}),(0,L.jsx)(D,{size:`icon`,variant:`icon`,disabled:t,"aria-label":s?.id===e.id?`Delete the block ${e.name} anyway`:`Delete the block ${e.name}`,"data-tip":s?.id===e.id?`Delete it anyway`:`Delete the block ${e.name}`,onClick:()=>n(async()=>{try{await C.deleteBlock(e.id,s?.id===e.id)}catch(t){let n=t;if(n.status!==409)throw n;c({id:e.id,why:n.message});return}return c(null),`The block "${e.name}" is deleted; the steps workflows have of it stay.`}),className:`size-8`,children:(0,L.jsx)(ne,{"aria-hidden":`true`})})]}),s?.id===e.id&&(0,L.jsxs)(`p`,{className:w(E.warn,`m-0`),children:[s.why,` Click delete again to delete it anyway.`]})]},e.id))})}):null}function Se({history:e,busy:t,onPreview:n,onBack:r}){let[i,a]=(0,I.useState)(null);return e.length?(0,L.jsxs)(P,{level:3,icon:f,title:`Earlier versions`,className:`gap-2`,children:[(0,L.jsx)(`ol`,{className:w(O,`m-0 flex list-none flex-col p-0`),children:e.slice(0,10).map((e,r)=>(0,L.jsxs)(`li`,{className:w(`flex items-center gap-4 px-4 py-2`,r>0&&`border-t border-line-soft`),children:[(0,L.jsxs)(`span`,{className:`min-w-0 flex-1 text-body-sm text-ink-2`,children:[`Before the change of `,N(e.at)||e.name.slice(0,19)]}),(0,L.jsxs)(D,{size:`sm`,variant:`ghost`,disabled:t,onClick:()=>void n(e.name).then(t=>t&&a({name:e.name,...t})),"data-tip":`See what going back to this version changes`,children:[(0,L.jsx)(p,{"aria-hidden":`true`}),`Go back`]})]},e.name))}),i&&(0,L.jsxs)(`div`,{role:`status`,className:w(`rounded-lg bg-bg p-6 shadow-sm`,`flex flex-col gap-2`),children:[(0,L.jsx)(`p`,{className:`m-0 text-body-sm font-medium`,children:`Going back changes this:`}),(0,L.jsx)(`pre`,{className:w(`overflow-auto rounded-base bg-surface-muted p-4 font-mono text-body-sm leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,`m-0 max-h-[240px]`),children:i.diff.join(`
|
|
2
|
-
`)||`Nothing: the workflow is already that version.`}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsxs)(D,{size:`sm`,variant:`primary`,disabled:t,onClick:()=>(r(i.name,i.version),a(null)),"data-tip":`Write the workflow back at this version`,children:[(0,L.jsx)(o,{"aria-hidden":`true`}),`Go back to it`]}),(0,L.jsxs)(D,{size:`sm`,variant:`ghost`,onClick:()=>a(null),children:[(0,L.jsx)(u,{"aria-hidden":`true`}),`Cancel`]})]})]})]}):null}function Ce({steps:e,busy:t,onKeep:n}){let[r,i]=(0,I.useState)(2),[a,s]=(0,I.useState)(2),[c,l]=(0,I.useState)(``),[u,d]=(0,I.useState)(``),f=e.filter(e=>e.n>1);if(!f.length)return null;let p=f[f.length-1].n,m=Math.min(Math.max(r,2),p),h=Math.min(Math.max(a,m),p);return(0,L.jsxs)(`form`,{"aria-label":`Keep steps as a block`,className:w(O,`flex flex-wrap items-end gap-2`),onSubmit:e=>{e.preventDefault(),c.trim()&&n(m,h,c.trim(),u.trim()).then(e=>{e&&l(``)})},children:[(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm font-medium text-ink-2`,children:[`Keep steps`,(0,L.jsx)(y,{value:m,onChange:e=>(i(Number(e.target.value)),s(Math.max(h,Number(e.target.value)))),className:`w-[84px]`,children:f.map(e=>(0,L.jsx)(`option`,{value:e.n,children:e.n},e.n))})]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm font-medium text-ink-2`,children:[`to`,(0,L.jsx)(y,{value:h,onChange:e=>s(Number(e.target.value)),className:`w-[84px]`,children:f.filter(e=>e.n>=m).map(e=>(0,L.jsx)(`option`,{value:e.n,children:e.n},e.n))})]}),(0,L.jsxs)(`label`,{className:`flex min-w-[160px] flex-1 flex-col gap-1 text-body-sm font-medium text-ink-2`,children:[`as the block`,(0,L.jsx)(b,{value:c,maxLength:80,placeholder:`Sign in`,onChange:e=>l(e.target.value)})]}),(0,L.jsxs)(`label`,{className:`flex min-w-[120px] flex-col gap-1 text-body-sm font-medium text-ink-2`,children:[`in the section`,(0,L.jsx)(b,{value:u,maxLength:40,placeholder:`Account`,onChange:e=>d(e.target.value)})]}),(0,L.jsxs)(D,{type:`submit`,disabled:t||!c.trim(),"data-tip":`Keep these steps as a block of this app`,children:[(0,L.jsx)(o,{"aria-hidden":`true`}),`Keep`]}),(0,L.jsx)(`span`,{className:`basis-full text-body-sm text-muted`,children:`Put it into other workflows of this app from a step's +. What it types becomes its inputs: test data, or a secret picked each time.`})]})}function we({step:e,onAdd:t}){let[n,r]=(0,I.useState)(`check_text`),i=e.fields?.target,[a,o]=(0,I.useState)({name:i?.name??``,automation_id:i?.automation_id??``,control_type:i?.control_type??``}),[s,c]=(0,I.useState)(``),[l,u]=(0,I.useState)(`2`),[f,p]=(0,I.useState)(``),m=ve.find(e=>e.id===n),h=m.control?!!(a.name.trim()||a.automation_id.trim())&&(m.text!==`need`||!!s.trim()):n===`wait`?Number(l)>0:!!f.trim();return(0,L.jsxs)(`form`,{className:`flex flex-col gap-2 p-4`,onSubmit:e=>{e.preventDefault(),h&&t({kind:n,...m.control?{target:a}:{},...m.text&&s.trim()?{text:s}:{},...n===`wait`?{seconds:Number(l)}:{},...n===`keys`?{keys:f}:{}})},children:[(0,L.jsxs)(`p`,{className:`m-0 text-body-sm font-medium`,children:[`After step `,e.n]}),(0,L.jsx)(y,{size:`sm`,"aria-label":`What to add`,value:n,onChange:e=>r(e.target.value),children:ve.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.label},e.id))}),m.control&&(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm font-medium`,children:[`Control's name`,(0,L.jsx)(b,{size:`sm`,value:a.name,maxLength:300,onChange:e=>o({...a,name:e.target.value})})]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm font-medium`,children:[`Automation id`,(0,L.jsx)(b,{size:`sm`,value:a.automation_id,maxLength:300,spellCheck:!1,onChange:e=>o({...a,automation_id:e.target.value}),className:`font-mono text-body-sm`})]})]}),m.text&&(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm font-medium`,children:[m.text===`need`?`The text it shows`:`Showing the text (optional)`,(0,L.jsx)(b,{size:`sm`,value:s,maxLength:500,placeholder:`Invoice saved`,onChange:e=>c(e.target.value)})]}),n===`wait`&&(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm font-medium`,children:[`Seconds`,(0,L.jsx)(b,{size:`sm`,type:`number`,min:1,max:600,value:l,onChange:e=>u(e.target.value)})]}),n===`keys`&&(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm font-medium`,children:[`Keys`,(0,L.jsx)(b,{size:`sm`,value:f,maxLength:100,spellCheck:!1,placeholder:`ctrl+s`,onChange:e=>p(e.target.value),className:`font-mono text-body-sm`})]}),(0,L.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`The control is filled from this step's; change it for another. A wait for a control is better than a fixed wait.`}),(0,L.jsxs)(D,{type:`submit`,size:`sm`,variant:`accent`,disabled:!h,className:`self-start`,children:[(0,L.jsx)(d,{"aria-hidden":`true`}),`Add`]})]})}var Te=e=>e.name||e.automation_id||`the control`;function Ee({pictures:e,step:t,busy:n,onPick:r}){let[i,a]=(0,I.useState)(0),o=e[Math.min(i,e.length-1)],[s,c]=(0,I.useState)(``),[l,u]=(0,I.useState)(``),[d,f]=(0,I.useState)(null);(0,I.useEffect)(()=>{let e=!1;return c(``),u(``),f(null),S.shot(o.run,o.n).then(t=>!e&&c(t),t=>!e&&u(t.message)),S.controls(o.run,o.n).then(t=>!e&&f(t),()=>{}),()=>{e=!0}},[o.run,o.n]);let p=(e,t)=>`${Math.max(0,Math.min(100,e/t*100))}%`,[m,h]=(0,I.useState)(!1),g=d&&d.w>0?d.controls.toSorted((e,t)=>t.w*t.h-e.w*e.h):[];return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 pr-4 pb-4 pl-4 sm:pl-20`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e.length>1&&(0,L.jsx)(M,{label:`Pictures of step ${t}`,value:String(i),onChange:e=>a(Number(e)),options:e.map((e,t)=>({id:String(t),label:e.label}))}),(0,L.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[o.note,g.length>0?` Click a control to check that it shows its text, or that it is there.`:``]})]}),l&&(0,L.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:l}),!s&&!l&&(0,L.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`Loading the picture…`}),s&&(0,L.jsxs)(`div`,{className:w(`rounded-base bg-surface-muted object-cover`,`relative w-full overflow-hidden`,m?`max-w-[360px]`:`max-w-[720px]`),style:g.length?{aspectRatio:`${d.w} / ${d.h}`}:void 0,children:[(0,L.jsx)(`img`,{src:s,alt:`The app after step ${t}, ${o.label.toLowerCase()}`,onLoad:e=>h(e.currentTarget.naturalHeight>e.currentTarget.naturalWidth),className:g.length?`absolute inset-0 size-full object-fill`:`block w-full`}),g.map((e,t)=>{let i=e.text?`Check ${Te(e)} shows "${e.text}"`:`Check ${Te(e)} is there`;return(0,L.jsx)(`button`,{type:`button`,disabled:n,"aria-label":i,"data-tip":i,onClick:()=>r({target:{...e.automation_id?{automation_id:e.automation_id}:{},...e.name?{name:e.name}:{},...e.control_type?{control_type:e.control_type}:{}},...e.text?{text:e.text}:{}}),className:`absolute cursor-pointer rounded-[3px] border-0 bg-transparent p-0 outline-none hover:bg-accent/15 hover:ring-2 hover:ring-accent focus-visible:bg-accent/15 focus-visible:ring-2 focus-visible:ring-accent`,style:{left:p(e.x,d.w),top:p(e.y,d.h),width:p(e.w,d.w),height:p(e.h,d.h)}},`${t}-${e.automation_id||e.name}`)})]})]})}function De({v:e,secrets:t,onSave:n,busy:r,mobile:i=!1}){let[a,s]=(0,I.useState)(e.as),[c,l]=(0,I.useState)(e.name??``),[u,d]=(0,I.useState)(e.value??``);(0,I.useEffect)(()=>{s(e.as),l(e.name??``),d(e.value??``)},[e]);let f=[`click`,`double_click`,`tap`,`double_tap`].includes(e.op),p=U.filter(t=>e.choices?e.choices.includes(t.id):t.id!==`date`&&t.id!==`any`&&t.id!==`unique`&&(e.op===`type`||t.id!==`secret`)),m=a===`data`||a===`secret`||f&&a!==`typed`,h=a!==e.as||m&&c!==(e.name??``)||!f&&u!==(e.value??``),g=m?a===`secret`?/^[A-Z_][A-Z0-9_]{0,63}$/.test(c):/^[A-Za-z_][A-Za-z0-9_]{0,63}$/.test(c):a===`typed`||f||u.trim()!==``,ee=e=>f&&e===`typed`?W.label:U.find(t=>t.id===e)?.label,_=f&&a===`typed`?W.note:U.find(e=>e.id===a)?.note;return(0,L.jsxs)(`li`,{className:`flex flex-wrap items-start gap-x-4 gap-y-2 border-t border-line-soft px-4 py-2 first:border-t-0`,children:[(0,L.jsx)(`span`,{className:`w-6 flex-none pt-2 text-right font-mono text-body-sm text-muted tabular-nums`,children:e.n}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_220px] flex-col pt-2`,children:[(0,L.jsx)(`span`,{className:`text-body-sm text-ink [overflow-wrap:anywhere]`,children:e.line}),(0,L.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:_})]}),(0,L.jsxs)(`span`,{className:`flex flex-[1_1_360px] flex-wrap items-center gap-2`,children:[(0,L.jsx)(y,{"aria-label":`Where the value of step ${e.n} comes from`,value:a,disabled:r,onChange:e=>s(e.target.value),className:`w-[150px] flex-none`,children:p.map(e=>(0,L.jsx)(`option`,{value:e.id,children:ee(e.id)},e.id))}),m&&(0,L.jsx)(b,{"aria-label":a===`secret`?`The secret's environment variable`:`The test data's name`,value:c,maxLength:64,spellCheck:!1,list:a===`secret`?`desktop-secrets`:void 0,placeholder:a===`secret`?`BILLING_PASSWORD`:f?a===`date`?`date`:`slot`:`customer`,onChange:e=>l(a===`secret`?e.target.value.toUpperCase():e.target.value),className:`w-[170px] flex-none font-mono text-body-sm`}),a!==`secret`&&!f&&(0,L.jsx)(b,{"aria-label":a===`data`?`Its value`:a===`date`?`The date (counted from today)`:`The value`,value:u,maxLength:500,onChange:e=>d(e.target.value),className:`min-w-[140px] flex-1`}),a===`secret`&&!t.includes(c)&&c&&(0,L.jsxs)(`span`,{className:`text-body-sm text-warn`,children:[`Not in `,i?`mobile.secrets`:`desktop.secrets`,` yet`]}),(0,L.jsxs)(D,{size:`sm`,variant:`primary`,disabled:r||!h||!g,onClick:()=>n(a,m?c:void 0,a===`secret`||f?void 0:u),children:[(0,L.jsx)(o,{"aria-hidden":`true`}),`Save`]})]}),(0,L.jsx)(`datalist`,{id:`desktop-secrets`,children:t.map(e=>(0,L.jsx)(`option`,{value:e},e))})]})}function Oe({view:e,job:t,rows:n,onRun:r,busy:i,heal:a}){let[o,c]=(0,I.useState)(()=>Object.fromEntries(e.variables.map(e=>[e.name,e.value]))),[l,u]=(0,I.useState)(``),[d,f]=(0,I.useState)(a),[p,m]=(0,I.useState)(!1),h=e.lastRun,g=l.startsWith(`file:`)?{file:l.slice(5)}:l.startsWith(`request:`)?{request:l.slice(8)}:void 0,ee=t&&t.kind===`replay`&&t.target===e.workflow.path;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:`Replay plays the steps in the app with no model, as a scheduled run or CI will, and takes over the mouse and keyboard while it runs: use a test machine and a test account.`}),(0,L.jsxs)(`form`,{className:w(O,`flex flex-col gap-4`),onSubmit:e=>{e.preventDefault(),r({variables:o,...g?{rows:g}:{},heal:d,updateBaselines:p})},children:[e.variables.length>0&&(0,L.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,180px),1fr))] gap-4`,children:e.variables.map(e=>(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm font-medium text-ink-2`,children:[e.name,(0,L.jsx)(b,{value:o[e.name]??``,onChange:t=>c({...o,[e.name]:t.target.value})})]},e.name))}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4`,children:[(0,L.jsxs)(`label`,{className:`flex min-w-[220px] flex-col gap-1 text-body-sm font-medium text-ink-2`,children:[`Test data`,(0,L.jsxs)(y,{value:l,onChange:e=>u(e.target.value),children:[(0,L.jsx)(`option`,{value:``,children:`Once, with the values above`}),n.files.map(e=>(0,L.jsxs)(`option`,{value:`file:${e}`,children:[`Each row of `,e]},e)),n.requests.map(e=>(0,L.jsxs)(`option`,{value:`request:${e}`,children:[`Each row of request `,e]},e))]})]}),(0,L.jsxs)(`label`,{className:`flex min-h-10 items-center gap-2 text-body-sm text-ink-2`,children:[(0,L.jsx)(le,{checked:d,onChange:f,label:`Heal a step whose control moved`}),`Heal a moved control`]}),(0,L.jsxs)(`label`,{className:`flex min-h-10 items-center gap-2 text-body-sm text-ink-2`,children:[(0,L.jsx)(le,{checked:p,onChange:m,label:`Take new image baselines`}),`New image baselines`]}),(0,L.jsx)(`span`,{className:`flex-1`}),(0,L.jsxs)(D,{type:`submit`,variant:`primary`,disabled:i,children:[(0,L.jsx)(s,{"aria-hidden":`true`}),`Replay`]})]})]}),ee&&(0,L.jsx)(F,{job:t,onStop:()=>void S.stop(),words:G}),h?(0,L.jsx)(P,{id:`desktop-last-run`,level:3,icon:s,title:`Last replay`,className:`gap-2`,children:(0,L.jsxs)(`div`,{className:w(O,`flex flex-wrap items-center gap-4 text-body-sm`),children:[(0,L.jsx)(k,{tone:h.ok?`pass`:`fail`,children:h.many?`${h.many.passed} of ${h.many.total} passed`:h.ok?`Passed`:`Failed`}),(0,L.jsxs)(`span`,{className:`text-muted`,children:[N(h.at),` · `,x(e.replays,`replay`),` in all`]}),h.failed&&(0,L.jsxs)(`span`,{className:`min-w-0 flex-[1_1_240px] text-body-sm text-fail [overflow-wrap:anywhere]`,children:[`Step `,h.failed.index,`: `,h.failed.error]}),(0,L.jsx)(`span`,{className:`flex-1`}),h.report&&(0,L.jsx)(fe,{path:h.report,children:`Report`})]})}):(0,L.jsx)(A,{className:`py-4`,children:`Not replayed yet.`})]})}function ke({workflow:e,onClose:f,backLabel:_=`Back`,notices:y}){let[b,C]=(0,I.useState)(null),[T,O]=(0,I.useState)(``),[M,le]=(0,I.useState)(!1),[N,de]=(0,I.useState)(`steps`),[fe,P]=(0,I.useState)(``),[F,me]=(0,I.useState)(`all`),[R,z]=(0,I.useState)(null),[B,ge]=(0,I.useState)(null),[V,H]=(0,I.useState)(null),[U,W]=(0,I.useState)(``),[G,ve]=(0,I.useState)(null),[Te,ke]=(0,I.useState)({files:[],requests:[]}),[Ae,je]=(0,I.useState)(!0),q=(0,I.useCallback)(()=>{S.review(e).then(e=>{C(e),O(``)},e=>O(e.message))},[e]);(0,I.useEffect)(q,[q]);let J=(0,I.useCallback)(()=>{S.view().then(e=>{ve(e.job),ke(e.rows),je(e.heal)},()=>{})},[]);(0,I.useEffect)(J,[J]);let Y=!!G?.running;(0,I.useEffect)(()=>{if(!Y)return;let e=ce(J,1e3);return()=>se(e)},[Y,J]);let Me=G&&!G.running?G.endedAt:``;(0,I.useEffect)(()=>{Me&&q()},[Me,q]);let X=async(e,t)=>{le(!0),O(``),W(``);try{await e(),q(),t&&W(t)}catch(e){O(e.message)}finally{le(!1)}},Ne=e=>void ie.start(e,{}).then(({id:e})=>location.hash=te(`chats`,e),e=>O(e.message));if(!b)return T?(0,L.jsx)(`p`,{role:`alert`,className:w(E.fail,`m-0`),children:T}):(0,L.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Opening the workflow…`});let Z=b.workflow.kind===`mobile`,Q=b.lastRun,Pe=new Map((Q?.results??[]).map(e=>[e.n,e])),Fe=!!Q&&Date.parse(b.workflow.modified)>Date.parse(Q.at),Ie=b.steps.filter(e=>e.op.startsWith(`expect`)).length,$=Q&&!Q.ok?Q.failed?.index??0:0,Le=$?b.steps[$-1]:void 0,Re=(Q?.results??[]).filter(e=>!e.ok).length,ze=fe.toLowerCase().split(/\s+/).filter(Boolean),Be=b.steps.filter(e=>ze.every(t=>`${e.n} ${e.text} ${e.fields?.note||``}`.toLowerCase().includes(t))&&(F===`all`||(F===`checks`?e.op.startsWith(`expect`):Pe.get(e.n)?.ok===!1))),Ve=e=>{de(`steps`),me(`all`),P(``),requestAnimationFrame(()=>document.getElementById(`dstep-${e}`)?.scrollIntoView({block:`center`,behavior:re()}))},He=e=>void X(async()=>{await S.replay({workflow:b.workflow.path,...e}),J()},Z?`Replaying on the device: a device cloud can take a minute or two to start it.`:`Replaying: the app opens on this computer.`),Ue=[{id:`steps`,label:`Steps`,icon:ee,n:b.steps.length},{id:`data`,label:`Test data`,icon:h,n:b.values.length},{id:`run`,label:`Last run`,icon:s}];return(0,L.jsxs)(`section`,{"aria-labelledby":`dreview-title`,className:`flex min-w-0 flex-col gap-4`,children:[(0,L.jsxs)(`div`,{className:`sticky top-0 z-20 -mx-1 flex flex-col gap-4 border-b border-line bg-canvas px-1 py-4`,children:[f&&(0,L.jsx)(`div`,{children:(0,L.jsxs)(D,{size:`sm`,variant:`ghost`,onClick:f,className:`-ml-2 text-ink-2`,children:[(0,L.jsx)(g,{"aria-hidden":`true`}),_]})}),(0,L.jsx)(pe,{id:`dreview-title`,icon:t,title:(0,L.jsx)(`span`,{"data-tip":b.workflow.name,children:b.workflow.name}),description:(0,L.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsxs)(`span`,{children:[b.workflow.app||`no app`,` · `,x(b.steps.length,`step`),` · `,x(Ie,`check`)]}),Y&&G?.target===b.workflow.path?(0,L.jsx)(k,{tone:`running`,children:`Replaying…`}):Q?(0,L.jsx)(k,{tone:Q.ok?`pass`:`fail`,children:Q.ok?`Last replay passed`:$?`Last replay failed at step ${$}`:`Last replay did not get through`}):(0,L.jsx)(k,{tone:`neutral`,icon:!1,children:`Not replayed yet`}),Fe&&(0,L.jsx)(`span`,{children:`· you changed it since`})]}),actions:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(D,{onClick:()=>Ne(`${Z?`Look at the mobile workflow`:`DeskPilot: look at the desktop workflow`} ${b.workflow.path} and tell me what to fix or add (a wait, a timeout, a dialog to dismiss, checks of the outcome); change it with desktop_edit_workflow only after showing me the change.`),"data-tip":Z?`Ask the agent to improve it`:`Ask DeskPilot to improve it`,children:[(0,L.jsx)(i,{"aria-hidden":`true`}),`Improve`]}),(0,L.jsxs)(D,{variant:`primary`,disabled:Y,onClick:()=>de(`run`),"data-tip":Y?`A replay is going`:`Replay it with no model`,children:[(0,L.jsx)(s,{"aria-hidden":`true`}),`Replay`]})]})})]}),y,T&&(0,L.jsx)(`p`,{role:`alert`,className:w(E.fail,`m-0`),children:T}),U&&(0,L.jsx)(`p`,{role:`status`,className:w(E.pass,`m-0`),children:U}),Q&&!Q.ok&&(0,L.jsxs)(`div`,{role:`alert`,className:w(E.fail,`flex flex-col gap-2`),children:[(0,L.jsxs)(`p`,{className:`m-0 font-medium text-fail`,children:[$?`Step ${$} failed`:`The replay did not get through`,Fe&&(0,L.jsx)(`span`,{className:`font-normal text-ink-2`,children:` · before your last change`})]}),Le&&(0,L.jsx)(`p`,{className:`m-0 font-medium text-ink [overflow-wrap:anywhere]`,children:Le.text}),(0,L.jsx)(`p`,{className:`m-0 line-clamp-3 text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:Q.failed?.error||Q.error||`It failed.`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[Le&&(0,L.jsxs)(D,{size:`sm`,onClick:()=>Ve($),children:[(0,L.jsx)(p,{"aria-hidden":`true`}),`Show`]}),Le&&$>1&&(0,L.jsxs)(D,{size:`sm`,onClick:()=>(Ve($),H({n:$,mode:`edit`})),"data-tip":`Change the failed step: its control, text or timeout`,children:[(0,L.jsx)(r,{"aria-hidden":`true`}),`Change`]}),(0,L.jsxs)(D,{size:`sm`,variant:`ghost`,onClick:()=>Ne(`${Z?`The`:`DeskPilot: the`} last replay of ${b.workflow.path} failed${$?` at step ${$}`:``}. Read its report (${Q.dir}), tell me why, and offer a fix.`),children:[(0,L.jsx)(v,{"aria-hidden":`true`}),`Ask why`]})]})]}),Q&&Q.ok&&Q.heals>0&&!Q.healsAccepted&&(0,L.jsxs)(`div`,{role:`status`,className:w(E.info,`flex flex-wrap items-center gap-4`),children:[(0,L.jsxs)(`span`,{className:`min-w-0 flex-[1_1_240px]`,children:[`The last replay found `,x(Q.heals,`moved control`),` and healed `,Q.heals===1?`it`:`them`,`: write the new locators into the workflow?`]}),(0,L.jsxs)(D,{size:`sm`,disabled:M,onClick:()=>void X(()=>S.acceptHeals(Q.dir),`The healed locators are in the workflow.`),children:[(0,L.jsx)(n,{"aria-hidden":`true`}),`Accept`]})]}),b.blocksStale?.map(e=>(0,L.jsx)(be,{f:e,block:b.blocks?.find(t=>t.id===e.block),secrets:b.blockSecrets??[],unset:b.unsetSecrets??[],busy:M,onUpdate:async t=>{let n=!1;return await X(async()=>{await K({workflow:b.workflow.path,step:e.from,action:`refresh_block`,block:e.block,...t||{}}),n=!0},`Steps ${e.from} to ${e.to} are version ${e.latest} of "${e.name}" now.`),n}},`stale-${e.block}-${e.from}`)),b.blocksFound?.map(e=>(0,L.jsxs)(`div`,{role:`status`,className:w(E.info,`flex flex-wrap items-center gap-4`),children:[(0,L.jsxs)(`span`,{className:`min-w-0 flex-[1_1_240px]`,children:[`Steps `,e.from,` to `,e.to,` do what the block `,(0,L.jsx)(`strong`,{className:`font-medium`,children:e.name}),` does: mark them as the block's, and this workflow hears of its newer versions.`]}),(e=>e?(0,L.jsx)(`span`,{className:`basis-full`,children:(0,L.jsx)(_e,{block:e})}):null)(b.blocks?.find(t=>t.id===e.block)),(0,L.jsxs)(D,{size:`sm`,disabled:M,onClick:()=>void X(()=>K({workflow:b.workflow.path,step:e.from,action:`use_block`,block:e.block}),`Steps ${e.from} to ${e.to} are the block "${e.name}" now.`),"data-tip":`Mark these steps as the block's`,children:[(0,L.jsx)(o,{"aria-hidden":`true`}),`Use`]})]},`found-${e.block}-${e.from}`)),(0,L.jsx)(ue,{prefix:`dreview`,label:`This workflow`,className:`mb-0`,current:N,onPick:de,tabs:Ue.map(e=>({id:e.id,label:e.label,icon:e.icon,...e.n===void 0?{}:{n:e.n},...e.id===`run`&&Q?{n:Q.ok?(0,L.jsx)(a,{size:12,role:`img`,"aria-label":`passed`,className:`text-pass`}):(0,L.jsx)(l,{size:12,role:`img`,"aria-label":`failed`,className:`text-fail`})}:{}}))}),(0,L.jsxs)(`div`,{role:`tabpanel`,id:`dreview-panel-${N}`,"aria-labelledby":`dreview-${N}`,className:`flex min-w-0 flex-col gap-4`,children:[N===`steps`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(j,{id:`dreview-step-search`,label:`Find a step`,value:fe,onChange:P}),(0,L.jsx)(oe,{items:[{id:`all`,label:`All`,n:b.steps.length},{id:`checks`,label:`Checks`,n:Ie},...Re?[{id:`failed`,label:`Failed`,n:Re,alert:!0}]:[]],value:F,onChange:me})]}),Ie===0&&(0,L.jsx)(`p`,{className:w(E.warn,`m-0`),children:`No checks of the outcome: a replay passes when its steps run. Add one with + after the step whose result matters.`}),Be.length===0?(0,L.jsx)(`p`,{className:w(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 text-body-sm text-muted`),children:`No step matches.`}):(0,L.jsx)(`ol`,{className:w(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 flex list-none flex-col p-0 [&>li:first-child]:rounded-t-base [&>li:last-child]:rounded-b-base`),children:Be.map((e,t)=>{let n=Pe.get(e.n),i=e.op.startsWith(`expect`),s=b.recorded?.shots[e.n],l=[...s&&b.recorded?[{label:`When recorded`,run:b.recorded.run,n:s,note:`The app after step ${e.n} as you recorded it.`}]:[],...n?.shot&&Q?[{label:`Last replay`,run:Q.dir,n:e.n,note:`The app after step ${e.n} on the last replay${Fe?`, before your last change`:``}.`}]:[]];return(0,L.jsxs)(`li`,{id:`dstep-${e.n}`,className:w(`flex scroll-mt-48 flex-col`,t>0&&`border-t border-line-soft`,n&&!n.ok&&`bg-fail-soft`),children:[(0,L.jsxs)(`div`,{className:`group flex min-h-11 items-start gap-4 px-4 py-2`,children:[(0,L.jsx)(`span`,{className:`w-6 flex-none pt-1 text-right font-mono text-body-sm text-muted tabular-nums`,children:e.n}),(0,L.jsx)(`span`,{className:`flex w-4 flex-none justify-center pt-1`,children:n?n.ok?(0,L.jsx)(o,{size:14,strokeWidth:2.5,"aria-label":`Passed on the last replay`,className:`text-pass`}):(0,L.jsx)(u,{size:14,strokeWidth:2.5,"aria-label":`Failed on the last replay`,className:`text-fail`}):Q?(0,L.jsx)(c,{size:14,"aria-label":`Not replayed`,className:`text-muted`}):i?(0,L.jsx)(a,{size:14,"aria-hidden":`true`,className:`text-pass`}):(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`mt-1 size-1.5 rounded-full bg-line-strong`})}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[i&&(0,L.jsx)(k,{tone:`pass`,icon:!1,className:`min-h-5 px-2 text-body-sm`,children:`Check`}),e.op.startsWith(`wait`)&&(0,L.jsx)(k,{tone:`neutral`,icon:!1,className:`min-h-5 px-2 text-body-sm`,children:`Wait`}),(0,L.jsx)(`span`,{className:`min-w-0 text-body-sm text-ink [overflow-wrap:anywhere]`,children:e.text}),e.block&&(0,L.jsxs)(k,{tone:`neutral`,icon:!1,children:[(0,L.jsx)(m,{"aria-hidden":`true`,className:`size-[11px]`}),b.blocks?.find(t=>t.id===e.block)?.name||e.block]}),n?.healed&&(0,L.jsx)(k,{tone:`warn`,icon:!1,className:`min-h-5 px-2 text-body-sm`,children:`Healed`})]}),e.fields?.note&&(0,L.jsxs)(`span`,{className:`text-body-sm text-ink-2`,children:[`Note: `,e.fields.note]}),n&&!n.ok&&n.error&&(0,L.jsx)(`span`,{className:`line-clamp-2 text-body-sm text-fail [overflow-wrap:anywhere]`,"data-tip":n.error,children:n.error})]}),(0,L.jsxs)(`span`,{className:`relative flex flex-none items-center gap-1`,children:[(0,L.jsx)(D,{size:`icon`,variant:`icon`,disabled:M,"aria-haspopup":`dialog`,"aria-expanded":R===e.n,"aria-label":`Add a check, wait${b.blocks?.length?` or block`:``} after step ${e.n}`,"data-tip":`Add a check, wait${b.blocks?.length?` or block`:``} after step ${e.n}`,onClick:()=>z(R===e.n?null:e.n),className:`size-8`,children:(0,L.jsx)(d,{"aria-hidden":`true`})}),(0,L.jsxs)(ae,{open:R===e.n,onClose:()=>z(null),label:`Add after step ${e.n}`,role:`dialog`,align:`end`,className:`w-[min(360px,calc(100vw-48px))]`,children:[(0,L.jsx)(we,{step:e,onAdd:t=>{z(null),X(()=>K({workflow:b.workflow.path,step:e.n,action:`insert`,...t}),`Added after step ${e.n}.`)}}),(b.blocks?.length??0)>0&&(0,L.jsx)(ye,{step:e,blocks:b.blocks??[],secrets:b.blockSecrets??[],unset:b.unsetSecrets??[],onAdd:(t,n)=>{z(null),X(()=>K({workflow:b.workflow.path,step:e.n,action:`block`,block:t,...n}),`Put in the block after step ${e.n}.`)}})]}),l.length>0&&(0,L.jsx)(D,{size:`icon`,variant:`icon`,"aria-label":`See the app after step ${e.n}`,"aria-expanded":B===e.n,"data-tip":`See the app after step ${e.n}`,onClick:()=>ge(B===e.n?null:e.n),className:`size-8`,children:(0,L.jsx)(p,{"aria-hidden":`true`})}),(0,L.jsx)(D,{size:`icon`,variant:`icon`,"aria-label":`Change step ${e.n}`,"data-tip":`Change step ${e.n}`,onClick:()=>H({n:e.n,mode:`edit`}),className:`size-8`,children:(0,L.jsx)(r,{"aria-hidden":`true`})}),e.n>1&&(0,L.jsx)(D,{size:`icon`,variant:`icon`,"aria-label":`Drop step ${e.n}`,"data-tip":`Drop step ${e.n}`,onClick:()=>H({n:e.n,mode:`remove`}),className:`size-8 hover:text-fail`,children:(0,L.jsx)(ne,{"aria-hidden":`true`})})]})]}),V&&V.n===e.n&&(0,L.jsx)(`div`,{className:`pr-4`,children:(0,L.jsx)(he,{workflow:b.workflow.path,step:e,mode:V.mode,onCancel:()=>H(null),onDone:()=>{W(V.mode===`remove`?`Step ${e.n} dropped.`:`Step ${e.n} changed.`),H(null),q()}},`${e.n}-${V.mode}`)}),B===e.n&&l.length>0&&(0,L.jsx)(Ee,{pictures:l,step:e.n,busy:M,onPick:t=>void X(()=>K({workflow:b.workflow.path,step:e.n,action:`insert`,kind:t.text?`check_text`:`check_present`,target:t.target,...t.text?{text:t.text}:{}}),t.text?`Added after step ${e.n}: a check that ${t.target.name||t.target.automation_id} shows "${t.text}".`:`Added after step ${e.n}: a check that ${t.target.name||t.target.automation_id} is there.`)})]},`${e.n}-${e.text}`)})}),(0,L.jsx)(Ce,{steps:b.steps,busy:M,onKeep:async(e,t,n,r)=>{let i=!1;return await X(async()=>{await S.saveBlock(b.workflow.path,e,t,n,r),i=!0},`Kept steps ${e} to ${t} as the block "${n}": put it into other workflows of ${b.workflow.app} from a step's +.`),i}}),(0,L.jsx)(xe,{blocks:b.blocks??[],busy:M,act:e=>{let t;X(async()=>{t=await e()}).then(()=>t&&W(t))}}),(0,L.jsx)(Se,{history:b.history??[],busy:M,onPreview:async e=>{O(``);try{let t=await S.restore(b.workflow.path,e);return{diff:t.diff,version:t.version}}catch(e){return O(e.message),null}},onBack:(e,t)=>void X(()=>S.restore(b.workflow.path,e,t),`The workflow is back at that version: the version before going back is kept too.`)})]}),N===`data`&&(b.values.length===0?(0,L.jsx)(A,{className:`py-4`,children:`Nothing is typed, chosen or clicked as data in this workflow, so it has no test data.`}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:`Where each value typed, chosen or clicked comes from when it replays. A slot or a day that cannot be used twice can be any free one or a date from today. Test data can come from a data file's rows on the Last run tab.`}),(0,L.jsx)(`ul`,{className:w(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 flex list-none flex-col p-0`),children:b.values.map(e=>(0,L.jsx)(De,{v:e,secrets:b.secrets,mobile:Z,busy:M,onSave:(t,n,r)=>void X(()=>K({workflow:b.workflow.path,step:e.n,action:`data`,as:t,...n===void 0?{}:{name:n},...r===void 0?{}:{value:r}}),t===`secret`?`Step ${e.n} types the secret ${n}; what was typed left the workflow.`:`Step ${e.n} saved.`)},e.n))})]})),N===`run`&&(0,L.jsx)(Oe,{view:b,job:G,rows:Z?{...Te,requests:[]}:Te,heal:Ae,busy:M||Y,onRun:He})]})]})}export{ge as a,B as i,H as n,V as o,_e as r,ke as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Dr as n,Et as r,H as i,Hr as a,Jn as o,L as s,M as c,N as l,O as u,Pt as d,St as f,T as p,U as m,Ur as h,Vn as g,W as _,Yn as v,Zt as ee,cn as y,cr as b,ir as x,j as te,mt as S,n as C,on as w,qr as T,r as E,st as D,vn as ne,x as re,yn as ie}from"./route-D9uPlFWw.js";import{D as O,E as ae,Ht as k,O as A,Vt as j,qt as oe,tt as M}from"./preload-helper-qorOEK5q.js";import{t as se}from"./jsx-runtime-LKYXHABd.js";import{L as ce}from"./palette-BsY8OLxd.js";import{D as le,F as ue,N,O as P,c as F,i as de,j as fe,l as I,n as pe,s as me}from"./pageBack-BoSbGSU6.js";import{It as he,St as ge,bt as _e,ht as L,lt as ve,s as ye,t as be,vt as xe,xt as Se,yt as Ce}from"./frame-CNYHTG4T.js";import{n as we,t as R}from"./when-BuWCTaKm.js";import{t as Te}from"./code-DzYywAs5.js";import{o as Ee}from"./markdown-BhU7ng6c.js";import{G as De,M as Oe,U as ke}from"./index-B1Q2Dlqw.js";import{i as z,r as B}from"./productParts-Dxl-TQKY.js";var V=e(T(),1),H=se(),Ae={"forgeqe-session":`ForgeQE session`,otlp:`OpenTelemetry trace`,jsonl:`the agent's own log`,langfuse:`Langfuse`,langsmith:`LangSmith`},je={tool:a,model:b,say:ne,plan:y,handoff:o,ask:ne,policy:x,error:n},Me={text:`What it said`,file_change:`A file it changed`,report:`A report`,test_result:`A test result`,message:`A message it sent`},Ne={request:`the request`,tool_result:`a tool's result`,file:`a file`,document:`a document`,memory:`memory`,agent:`another agent's answer`,person:`a person`},U=e=>e.replace(/[\u0000-\u0008\u000b-\u001f\u007f-\u009f\u2028\u2029]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`),W=e=>{if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,...t.getFullYear()===new Date().getFullYear()?{}:{year:`numeric`},hour:`numeric`,minute:`2-digit`,second:`2-digit`})},G=25,K={PASS:{tone:`pass`,label:`Pass`},WARN:{tone:`warn`,label:`Warning`},FAIL:{tone:`fail`,label:`Fail`},UNKNOWN:{tone:`neutral`,label:`Not known`}},q={required_steps:`Required steps`,allowed_actions:`Allowed actions`,tool_inputs:`Tool inputs`,limits:`Limits`,handover:`Hand-over`,statements:`What it said`,grounded_decisions:`Grounded decisions`,data_allowed:`Data allowed`,data_used:`Facts from its data`,stated_reasons:`Stated reasons`,instructions_in_data:`Instructions in data`,business_rules:`Business rules`,architecture:`Architecture`,dependencies:`Dependencies`,regression:`Regression`,security:`Security`,acceptance:`Acceptance criteria`,build_and_test:`Build and test`,content_rules:`Answer rules`,grounded:`Grounded in its inputs`,rubric:`Owner's rubric`},Pe={build:{title:`Does the change work?`,icon:r},behaviour:{title:`Did it work the agreed way?`,icon:_},decisions:{title:`Did it decide on the right grounds, with data it may use?`,icon:v},content:{title:`Was its answer right: on topic, grounded, complete?`,icon:S},domain:{title:`Was its change right for the product?`,icon:re}},J=200;function Y({id:e,back:t=!0,children:n}){let r=Oe.some(t=>t.id===e);return(0,H.jsxs)(H.Fragment,{children:[t&&(0,H.jsx)(pe,{}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,H.jsx)(he,{pixel:ce[e],size:`lg`}),(0,H.jsx)(`h1`,{className:`m-0 text-headline-lg`,children:n})]}),r&&(0,H.jsx)(ve,{label:`Governance`,links:Oe,current:e})]})]})}function X(){return(0,H.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`})}function Z(){return(0,H.jsxs)(I,{icon:r,title:`No agent run recorded yet`,children:[`Receive an agent's OpenTelemetry traces while it runs with `,(0,H.jsx)(`code`,{children:`forgeqe evidence receive`}),`; record a file with `,(0,H.jsx)(`code`,{children:`forgeqe evidence record`}),`: an OpenTelemetry export, a Langfuse or LangSmith export, an agent's own JSON log with `,(0,H.jsx)(`code`,{children:`--mapping mapping.yaml`}),`, or ForgeQE's own last session with `,(0,H.jsx)(`code`,{children:`--latest`}),`.`]})}function Fe({refused:e}){return e.length?(0,H.jsxs)(`section`,{"aria-label":`Files that are not run records`,className:j(ue.warn,`flex flex-col gap-1`),children:[(0,H.jsxs)(`span`,{className:`font-medium`,children:[k(e.length,`file`),` in the runs folder `,e.length===1?`is`:`are`,` not a run record and `,e.length===1?`is`:`are`,` not shown:`]}),e.slice(0,10).map(e=>(0,H.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e},e))]}):null}function Ie(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(``);return(0,V.useEffect)(()=>{M.overview().then(t,e=>r(e.message))},[]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Y,{id:`evidence`,children:`Evidence`}),(0,H.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:`What AI agents did, how, what they decided and why, and what data they used, from the records of their runs. What an agent says about its own work is kept as a claim, to be checked against what it did; what a record cannot say is listed, never guessed.`}),n&&(0,H.jsx)(B,{text:n}),!e&&!n&&(0,H.jsx)(X,{}),e&&(0,H.jsx)(Fe,{refused:e.refused}),e&&!e.runs&&(0,H.jsx)(Z,{}),e&&e.runs>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-1 text-body-sm text-muted`,children:[(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:e.runs}),` `,e.runs===1?`run`:`runs`,` recorded`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:e.agents.length}),` `,e.agents.length===1?`agent`:`agents`]})]}),(0,H.jsx)(`h2`,{className:`sr-only`,children:`What is recorded`}),(0,H.jsx)(z,{id:`agents`,title:`Agents`,icon:b,n:e.agents.length,children:(0,H.jsx)(`ul`,{"aria-label":`Agents`,className:j(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 list-none`),children:e.agents.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`a`,{href:E(`evidence`,encodeURIComponent(e.name)),className:j(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`min-h-12 flex-wrap gap-x-4 gap-y-1`),children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_320px] flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-sm font-medium`,children:U(e.name)}),(0,H.jsxs)(`span`,{className:`truncate text-body-sm text-muted`,children:[e.versions.length?`versions ${e.versions.slice(0,4).join(`, `)}${e.versions.length>4?`, …`:``} · `:``,`from `,e.sources.map(e=>Ae[e]||e).join(`, `)]})]}),(0,H.jsx)(`span`,{className:`text-body-sm text-ink-2 tabular-nums`,children:k(e.runs,`run`)}),(0,H.jsx)(`span`,{className:`text-body-sm text-ink-2 tabular-nums`,children:k(e.decisions,`decision`)}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted tabular-nums`,children:[k(e.gaps,`thing`,`things`),` not known`]}),(0,H.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:e.contract?`${e.contract.approved?`Contract approved`:`Contract not approved`}: ${[`FAIL`,`WARN`,`UNKNOWN`,`PASS`].filter(t=>e.verdicts[t]).map(t=>k(e.verdicts[t],{FAIL:`failed run`,WARN:`warning`,UNKNOWN:`not known`,PASS:`passed run`}[t],{FAIL:`failed runs`,WARN:`warnings`,UNKNOWN:`not known`,PASS:`passed runs`}[t])).join(`, `)}`:`No contract`}),(0,H.jsx)(`span`,{className:`text-body-sm text-muted tabular-nums`,"data-tip":W(e.last),children:e.last?R(e.last):``})]})},e.name))})})]})]})}var Le={PASS:`Passed`,WARN:`Warned`,FAIL:`Failed`,UNKNOWN:`Not known`,NONE:`Not judged`};function Re({t:e,label:t,on:n,onToggle:r,fail:i}){return e.n?(0,H.jsx)(N,{variant:`link`,size:`inline`,"aria-pressed":n,"aria-label":`${e.n}: ${t}. Show the runs`,onClick:r,className:j(`min-h-7 min-w-7 justify-end rounded-full px-2 tabular-nums aria-pressed:bg-accent-soft`,i&&!n&&`text-fail`),children:e.n}):(0,H.jsx)(`span`,{className:`inline-flex min-h-7 items-center justify-end px-2 text-muted tabular-nums`,children:`0`})}function ze({pick:e,d:n,onClose:r}){let[i,a]=(0,V.useState)(!1),o=i?e.runs:e.runs.slice(0,25);return(0,H.jsxs)(`div`,{className:j(le,`flex flex-col gap-2`),children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsxs)(`span`,{className:`text-body-sm font-medium text-ink [overflow-wrap:anywhere]`,children:[k(e.runs.length,`run`),` behind `,U(e.label)]}),(0,H.jsxs)(N,{size:`sm`,variant:`ghost`,onClick:r,children:[(0,H.jsx)(h,{"aria-hidden":`true`}),`Close`]})]}),(0,H.jsx)(`ul`,{"aria-label":`Runs behind ${e.label}`,className:`m-0 list-none border-t border-line-soft py-1`,children:o.map(e=>{let t=n.brief[e];return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`a`,{href:E(`evidence-runs`,encodeURIComponent(e)),className:j(oe,`grid min-h-10 grid-cols-[auto_minmax(0,1fr)_auto] gap-x-4`),children:[t&&t.status!==`NONE`?(0,H.jsx)(F,{tone:K[t.status].tone,children:K[t.status].label}):(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Not judged`}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-sm`,children:U(t?.request||e)}),(0,H.jsxs)(`span`,{className:`truncate font-mono text-body-sm text-muted`,children:[e,t?.version?` · ${U(t.version)}`:``]})]}),(0,H.jsx)(`span`,{className:`text-right text-body-sm text-muted tabular-nums`,"data-tip":W(t?.started),children:t?.started?R(t.started):``})]})},e)})}),e.runs.length>o.length&&(0,H.jsxs)(N,{size:`sm`,variant:`ghost`,onClick:()=>a(!0),children:[(0,H.jsx)(t,{"aria-hidden":`true`}),`All (`,e.runs.length,`)`]})]})}function Be({agent:e}){let[t,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(null);(0,V.useEffect)(()=>{M.dashboard(e).then(r,e=>a(e.message))},[e]);let u=e=>e?U(e):`no version`,f=t?t.versions.find(e=>e.version===o)||t.versions[0]:void 0,m=e=>c&&t&&c.key.startsWith(`${e}|`)?(0,H.jsx)(ze,{pick:c,d:t,onClose:()=>l(null)},c.key):null,h=(e,t,n,r)=>{let i=`${e}|${n}`;return(0,H.jsx)(Re,{t,label:n,on:c?.key===i,onToggle:()=>l(c?.key===i?null:{key:i,label:n,runs:t.runs}),fail:r})};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(pe,{to:{href:E(`evidence`),label:`Evidence`}}),(0,H.jsx)(Y,{id:`evidence`,back:!1,children:U(e)}),(0,H.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:`How this agent's runs were judged, version by version and week by week. Every number opens the runs it counts; not known and not judged are never counted as passed. Worked out now from the runs and their verdicts, with people's overrules applied.`}),i&&(0,H.jsx)(B,{text:i}),!t&&!i&&(0,H.jsx)(X,{}),t?.problems.map(e=>(0,H.jsx)(B,{text:e},e)),t&&f&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-1 text-body-sm text-muted`,children:[(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:t.runs.n}),` `,t.runs.n===1?`run`:`runs`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:t.versions.length}),` `,t.versions.length===1?`version`:`versions`]}),(0,H.jsx)(`a`,{href:E(`evidence-runs`,`agent`,encodeURIComponent(e)),children:`All its runs`}),(0,H.jsx)(`a`,{href:E(`evidence-learn`,encodeURIComponent(e)),children:`What to change`})]}),(0,H.jsx)(`h2`,{className:`sr-only`,children:`Its numbers`}),(0,H.jsxs)(z,{id:`versions`,title:`Versions`,icon:d,n:t.versions.length,children:[(0,H.jsx)(L,{label:`Versions of ${e}`,search:!1,minWidth:640,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Version`}),[`Runs`,`Passed`,`Warned`,`Failed`,`Not known`,`Not judged`].map(e=>(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:e},e)),(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Last run`})]}),children:t.versions.map(e=>(0,H.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,H.jsx)(`th`,{scope:`row`,className:j(`px-4 py-2`,`text-left font-medium`),children:u(e.version)}),(0,H.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,"data-sort":e.runs.n,children:h(`versions`,e.runs,`${u(e.version)}: runs`)}),[`PASS`,`WARN`,`FAIL`,`UNKNOWN`,`NONE`].map(t=>(0,H.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,"data-sort":e.outcome[t].n,children:h(`versions`,e.outcome[t],`${u(e.version)}: ${Le[t].toLowerCase()}`,t===`FAIL`)},t)),(0,H.jsx)(`td`,{className:j(`px-4 py-2`,`text-muted`),"data-tip":W(e.last),"data-sort":e.last&&Date.parse(e.last)||0,children:e.last?R(e.last):``})]},e.version))}),m(`versions`)]}),t.versions.length>1&&t.benchmark.length>0&&(0,H.jsxs)(z,{id:`benchmark`,title:`Versions side by side`,icon:v,children:[(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`Each check: the share of a version's runs that passed it, of the runs it judged. The number after it opens the runs that did not pass.`}),(0,H.jsx)(L,{label:`Versions side by side`,search:!1,minWidth:480,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Check`}),t.versions.map(e=>(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:u(e.version)},e.version))]}),children:t.benchmark.map(e=>(0,H.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,H.jsx)(`th`,{scope:`row`,className:j(`px-4 py-2`,`text-left font-medium`),children:q[e.check]}),e.versions.map(t=>{let n={n:t.judged.n-t.pass.n,runs:t.judged.runs.filter(e=>!t.pass.runs.includes(e))};return(0,H.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,"data-sort":t.rate??-1,children:t.rate===null?(0,H.jsx)(`span`,{className:`text-muted`,children:`not judged`}):(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,H.jsxs)(`span`,{className:j(t.rate<1&&`text-ink`),children:[Math.round(t.rate*100),`% of `,t.judged.n]}),n.n>0&&(0,H.jsx)(`span`,{className:`text-muted`,children:`·`}),n.n>0&&h(`benchmark`,n,`${q[e.check]} on ${u(t.version)}: not passed`,!0)]})},t.version)})]},`${e.lens}-${e.check}`))}),m(`benchmark`)]}),(0,H.jsxs)(z,{id:`checks`,title:`Checks`,icon:y,n:f.checks.length,children:[t.versions.length>1&&(0,H.jsxs)(`label`,{className:`flex w-fit items-center gap-2 text-body-sm text-ink-2`,children:[`Version`,(0,H.jsx)(O,{value:f.version,onChange:e=>{s(e.target.value),l(null)},children:t.versions.map(e=>(0,H.jsx)(`option`,{value:e.version,children:e.version||`no version`},e.version))})]}),f.checks.length?(0,H.jsx)(L,{label:`Checks of ${u(f.version)}`,search:!1,minWidth:600,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Check`}),(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Lens`}),[`Passed`,`Warned`,`Failed`,`Not known`,`Overruled`].map(e=>(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:e},e))]}),children:f.checks.map(e=>(0,H.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,H.jsx)(`th`,{scope:`row`,className:j(`px-4 py-2`,`text-left font-medium`),children:q[e.check]}),(0,H.jsx)(`td`,{className:j(`px-4 py-2`,`text-muted`),children:Xe[e.lens]}),[`PASS`,`WARN`,`FAIL`,`UNKNOWN`].map(t=>(0,H.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,"data-sort":e.outcome[t].n,children:h(`checks`,e.outcome[t],`${q[e.check]}: ${Le[t].toLowerCase()}`,t===`FAIL`)},t)),(0,H.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,"data-sort":e.overruled.n,children:h(`checks`,e.overruled,`${q[e.check]}: overruled`)})]},`${e.lens}-${e.check}`))}):(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`No contract judged these runs: `,(0,H.jsx)(`a`,{href:E(`evidence-contracts`),children:`Contracts`}),` says what one agrees.`]}),m(`checks`)]}),f.rules.length>0&&(0,H.jsxs)(z,{id:`recurring`,title:`What keeps going wrong`,icon:n,n:f.rules.length,children:[(0,H.jsx)(`ul`,{"aria-label":`What keeps going wrong`,className:j(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 list-none`),children:f.rules.slice(0,20).map(e=>(0,H.jsxs)(`li`,{className:`flex flex-col gap-1 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(F,{tone:K[e.status].tone,children:K[e.status].label}),(0,H.jsxs)(`span`,{className:`text-body-sm font-medium`,children:[q[e.check],`: `,U(e.rule)]}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-body-sm text-muted`,children:[`in `,h(`recurring`,e.runs,`${q[e.check]}: ${e.rule}`),` `,e.runs.n===1?`run`:`runs`]})]}),(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[`For example: `,U(e.example)]})]},`${e.check}-${e.rule}`))}),m(`recurring`)]}),(0,H.jsxs)(z,{id:`weeks`,title:`Week by week`,icon:p,n:t.weeks.length,children:[(0,H.jsx)(L,{label:`Week by week`,search:!1,minWidth:520,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Week`}),[`PASS`,`WARN`,`FAIL`,`UNKNOWN`,`NONE`].map(e=>(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:Le[e]},e))]}),children:t.weeks.toReversed().map(e=>(0,H.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,H.jsx)(`th`,{scope:`row`,className:j(`px-4 py-2`,`text-left font-medium tabular-nums`),children:e.week===`undated`?`No date`:e.week}),[`PASS`,`WARN`,`FAIL`,`UNKNOWN`,`NONE`].map(t=>(0,H.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,"data-sort":e.outcome[t].n,children:h(`weeks`,e.outcome[t],`${e.week}: ${Le[t].toLowerCase()}`,t===`FAIL`)},t))]},e.week))}),m(`weeks`)]})]})]})}function Ve({agent:e}){let[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)([]),[a,o]=(0,V.useState)(``),[l,u]=(0,V.useState)(``),[d,f]=(0,V.useState)(e),[p,h]=(0,V.useState)(`all`),[g,_]=(0,V.useState)(0);(0,V.useEffect)(()=>{M.runs().then(e=>{n(e.runs),i(e.refused)},e=>o(e.message))},[]),(0,V.useEffect)(()=>f(e),[e]);let v=(0,V.useMemo)(()=>[...new Set((t||[]).map(e=>e.agent))].sort(),[t]),ee=l.toLowerCase().split(/\s+/).filter(Boolean),y=(t||[]).filter(e=>(!d||e.agent===d)&&ee.every(t=>`${e.agent} ${e.request||``} ${e.id} ${e.source.name}`.toLowerCase().includes(t))),b=p===`failed`?y.filter(e=>e.failed):y,x={all:y.length,failed:y.filter(e=>e.failed).length},S=Math.max(1,Math.ceil(b.length/G)),C=Math.min(g,S-1),w=b.slice(C*G,C*G+G);(0,V.useEffect)(()=>_(0),[l,d,p]);let T=t||[],D=T.filter(e=>e.failed).length;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Y,{id:`evidence-runs`,children:`Agent runs`}),(0,H.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:`Every agent run recorded here, newest first. Open one for its timeline: each step, the data it took in, what it decided and the reason it gave, and what the record cannot say.`}),a&&(0,H.jsx)(B,{text:a}),!t&&!a&&(0,H.jsx)(X,{}),(0,H.jsx)(Fe,{refused:r}),t&&!t.length&&(0,H.jsx)(Z,{}),t&&t.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-1 text-body-sm text-muted`,children:[(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:T.length}),` `,T.length===1?`run`:`runs`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:j(`tabular-nums`,D?`text-fail`:`text-ink`),children:D}),` with a failed step (`,Math.round(D/T.length*100),`%)`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:T.reduce((e,t)=>e+t.decisions,0)}),` `,T.reduce((e,t)=>e+t.decisions,0)===1?`decision`:`decisions`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:new Set(T.map(e=>e.agent)).size}),` `,new Set(T.map(e=>e.agent)).size===1?`agent`:`agents`]})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(me,{id:`evidence-search`,label:`Find a run`,value:l,onChange:u,placeholder:`Find a run by what was asked`}),(0,H.jsx)(de,{items:[{id:`all`,label:`All`,n:x.all},{id:`failed`,label:`Failed`,n:x.failed,alert:!0}],value:p,onChange:h}),v.length>1&&(0,H.jsxs)(O,{size:`sm`,"aria-label":`Agent`,value:d,onChange:e=>f(e.target.value),className:`w-auto pr-8 pl-4`,children:[(0,H.jsx)(`option`,{value:``,children:`Every agent`}),v.map(e=>(0,H.jsx)(`option`,{value:e,children:U(e)},e))]})]}),(0,H.jsxs)(`div`,{className:`rounded-lg bg-bg p-6 shadow-sm`,children:[(0,H.jsxs)(`ul`,{"aria-label":`Agent runs`,className:`m-0 list-none p-2`,children:[!w.length&&(0,H.jsx)(`li`,{className:`px-4 py-4 text-body-sm text-muted`,children:`Nothing matches.`}),w.map((e,t)=>(0,H.jsxs)(`li`,{className:`contents`,children:[(t===0||we(w[t-1].started)!==we(e.started))&&(0,H.jsx)(`span`,{className:`block px-4 pt-4 pb-1 text-body-sm font-medium text-muted`,children:we(e.started)}),(0,H.jsxs)(`a`,{href:E(`evidence-runs`,encodeURIComponent(e.id)),className:j(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] gap-x-4`),children:[e.failed?(0,H.jsx)(m,{size:16,"aria-label":`${e.failed} failed ${e.failed===1?`step`:`steps`}`,className:`flex-none text-fail`}):(0,H.jsx)(s,{size:16,"aria-label":`No failed step`,className:`flex-none text-muted`}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-sm font-medium`,"data-tip":e.request||e.agent,children:U(e.request||`${e.agent}: request not recorded`)}),(0,H.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:[U(`${e.agent}${e.version?` ${e.version}`:``}`),k(e.steps,`step`),k(e.decisions,`decision`),`${k(e.gaps,`thing`,`things`)} not known`,Ae[e.source.kind],e.content?`content kept`:`inputs as fingerprints`,e.verdict?`verdict: ${K[e.verdict].label.toLowerCase()}`:`no contract`].join(` · `)})]}),(0,H.jsx)(`span`,{className:`text-right text-body-sm text-muted tabular-nums`,"data-tip":W(e.started),children:e.started?R(e.started):``})]})]},e.id))]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 border-t border-line-soft px-4 py-2 text-body-sm text-muted`,children:[(0,H.jsx)(`span`,{className:`flex-1`,children:b.length?`${C*G+1}–${Math.min(b.length,C*G+G)} of ${b.length}`:`0 runs`}),S>1&&(0,H.jsxs)(`nav`,{"aria-label":`Pages of agent runs`,className:`flex items-center gap-1`,children:[(0,H.jsx)(N,{size:`sm`,variant:`ghost`,disabled:C===0,onClick:()=>_(C-1),"aria-label":`Newer runs`,"data-tip":`Newer runs`,children:(0,H.jsx)(te,{"aria-hidden":`true`})}),(0,H.jsxs)(`span`,{className:`px-1 tabular-nums`,children:[`Page `,C+1,` of `,S]}),(0,H.jsx)(N,{size:`sm`,variant:`ghost`,disabled:C>=S-1,onClick:()=>_(C+1),"aria-label":`Older runs`,"data-tip":`Older runs`,children:(0,H.jsx)(c,{"aria-hidden":`true`})})]})]})]})]})]})}function Q({t:e,label:n}){let[r,i]=(0,V.useState)(!1);if(e.text===void 0)return(0,H.jsxs)(`span`,{className:`font-mono text-body-sm text-muted`,children:[n,`: fingerprint only, `,e.chars.toLocaleString(),` characters, sha256 `,e.sha256.slice(0,12),`…`]});let a=e.text.length>600;return(0,H.jsxs)(`span`,{className:`flex flex-col items-start gap-1`,children:[(0,H.jsx)(`span`,{className:`text-body-sm whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:U(a&&!r?`${e.text.slice(0,600)}…`:e.text)}),a&&(0,H.jsxs)(N,{variant:`link`,size:`inline`,onClick:()=>i(!r),"data-tip":r?void 0:`Show all ${e.text.length.toLocaleString()} characters`,className:`gap-1`,children:[r?(0,H.jsx)(l,{size:12,"aria-hidden":`true`}):(0,H.jsx)(t,{size:12,"aria-hidden":`true`}),r?`Less`:`More`]})]})}function He({d:e}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1 border-l-2 border-accent-line pl-4`,children:[(0,H.jsxs)(`span`,{className:`text-body-sm font-medium text-muted`,children:[`Decided`,e.by?` · by ${U(e.by)}`:``]}),(0,H.jsxs)(`span`,{className:`text-body-sm text-ink [overflow-wrap:anywhere]`,children:[U(e.what),`: `,(0,H.jsx)(`b`,{className:`font-medium`,children:U(e.chose)})]}),e.options&&e.options.length>0&&(0,H.jsxs)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:[`Options: `,U(e.options.join(`, `))]}),e.reason?(0,H.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:`The reason given (a claim, not checked yet):`}),(0,H.jsx)(Q,{t:e.reason,label:`reason`})]}):(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:`No reason given.`})]})}function Ue({s:e,r:t}){let n=(e.inputs||[]).map(e=>t.inputs.find(t=>t.id===e)).filter(e=>!!e),r=t.decisions.filter(t=>t.step===e.seq),i=t.statements.filter(t=>t.step===e.seq),o=Object.entries(e.facts||{});return(0,H.jsxs)(`li`,{id:`evidence-step-${e.seq}`,tabIndex:-1,className:`grid scroll-mt-4 grid-cols-[36px_minmax(0,1fr)] gap-x-2 border-b border-line-soft py-2 outline-none last:border-b-0 focus-visible:bg-accent-soft`,children:[(0,H.jsx)(`span`,{className:`pt-1 text-right text-body-sm text-muted tabular-nums`,children:e.seq}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,H.jsx)(fe,{icon:je[e.kind]||a,size:14,className:`flex-none`}),(0,H.jsx)(`span`,{className:`text-body-sm font-medium [overflow-wrap:anywhere]`,children:U(e.name)}),(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.kind}),e.agent&&(0,H.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`· by `,U(e.agent)]}),e.ok===!1&&(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-body-sm text-fail`,children:[(0,H.jsx)(m,{size:13,"aria-hidden":`true`}),`failed`]}),e.ms!==void 0&&(0,H.jsxs)(`span`,{className:`text-body-sm text-muted tabular-nums`,children:[`· `,e.ms.toLocaleString(),` ms`]})]}),o.length>0&&(0,H.jsx)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:U(o.map(([e,t])=>`${e}: ${String(t)}`).join(` · `))}),e.detail&&(0,H.jsx)(Q,{t:e.detail,label:`details`}),e.instructions&&(0,H.jsxs)(`details`,{className:`border-l-2 border-line pl-4`,children:[(0,H.jsx)(`summary`,{className:`cursor-pointer text-body-sm font-medium text-muted`,children:(()=>{let n=t.steps.filter(t=>t.seq<e.seq&&t.instructions?.sha256===e.instructions.sha256);return n.length?`Instructions, the same as step ${n[n.length-1].seq}`:`Instructions given to the model`})()}),(0,H.jsx)(`div`,{className:`mt-1`,children:(0,H.jsx)(Q,{t:e.instructions,label:`instructions`})})]}),n.map(e=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-1 border-l-2 border-line pl-4`,children:[(0,H.jsxs)(`span`,{className:`text-body-sm font-medium text-muted [overflow-wrap:anywhere]`,children:[`Took in `,Ne[e.kind]||e.kind,` from `,U(e.source)]}),(0,H.jsx)(Q,{t:e.kind===`request`&&e.data.text===void 0&&t.request?.text?.text!==void 0&&t.request.text.sha256===e.data.sha256?t.request.text:e.data,label:`content`})]},e.id)),r.map(e=>(0,H.jsx)(He,{d:e},e.seq)),i.map(e=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-1 border-l-2 border-line pl-4`,children:[(0,H.jsx)(`span`,{className:`text-body-sm font-medium text-muted`,children:`Said (a claim about its own work, not checked yet)`}),(0,H.jsx)(Q,{t:e.text,label:`statement`})]},e.seq))]})]})}function We({r:e,goTo:t}){let n=e.steps.filter(e=>e.kind===`model`),r=n.find(e=>e.instructions),i=new Set(n.filter(e=>e.instructions).map(e=>e.instructions.sha256)).size,a=e.outputs.filter(e=>e.kind===`text`),o=a[a.length-1],s=a.slice(0,-1),c=e.outputs.filter(e=>e.kind!==`text`),l=e=>n.reduce((t,n)=>t+(typeof n.facts?.[e]==`number`?n.facts[e]:0),0),u=l(`tokens_in`),d=l(`tokens_out`),f=[...new Set(n.map(e=>e.name))],p=({children:e})=>(0,H.jsx)(`span`,{className:`text-body-sm font-medium text-muted`,children:e}),m=({seq:e})=>(0,H.jsxs)(N,{variant:`link`,size:`inline`,onClick:()=>t(e),children:[`step `,e]});return(0,H.jsx)(z,{id:`evidence-io`,title:`Prompt and output`,icon:ie,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(n.length>0||u+d>0)&&(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:[n.length,` model `,n.length===1?`call`:`calls`,f.length?` (${U(f.join(`, `))})`:``,u+d>0?` · ${u.toLocaleString()} tokens in, ${d.toLocaleString()} out`:``]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(p,{children:[`Instructions (system prompt)`,r?(0,H.jsxs)(H.Fragment,{children:[` · from `,(0,H.jsx)(m,{seq:r.seq})]}):null,i>1?` · ${i} different ones in this run`:``]}),(0,H.jsx)(`div`,{className:`rounded-base bg-surface-muted px-4 py-2`,children:r?.instructions?(0,H.jsx)(Q,{t:r.instructions,label:`instructions`}):(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Not in the record: its source did not hold the instructions the model was given.`})})]}),(0,H.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(p,{children:[`Request`,e.request?.by?` · from ${U(e.request.by)}`:``,e.request?.from?` · read from the ${U(e.request.from)}`:``]}),(0,H.jsx)(`div`,{className:`rounded-base bg-surface-muted px-4 py-2`,children:e.request?.text?(0,H.jsx)(Q,{t:e.request.text,label:`request`}):(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Not in the record: its source did not say what the agent was asked.`})})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(p,{children:[`Final answer`,o?(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsx)(m,{seq:o.step})]}):null]}),(0,H.jsx)(`div`,{className:`rounded-base bg-surface-muted px-4 py-2`,children:o?.data?(0,H.jsx)(Q,{t:o.data,label:`answer`}):(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Not in the record: its source did not say what the agent answered.`})})]})]}),c.length>0&&(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(p,{children:[`What it produced (`,c.length,`)`]}),(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:c.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 text-body-sm text-ink-2`,children:[Me[e.kind]||e.kind,e.target?(0,H.jsx)(`span`,{className:`font-mono text-body-sm [overflow-wrap:anywhere]`,children:U(e.target)}):null,`· `,(0,H.jsx)(m,{seq:e.step})]},e.id))})]}),s.length>0&&(0,H.jsxs)(`details`,{className:`group flex flex-col gap-2`,children:[(0,H.jsxs)(`summary`,{className:`cursor-pointer text-body-sm font-medium text-muted`,children:[`What it said on the way (`,s.length,`)`]}),(0,H.jsx)(`ol`,{className:`m-0 mt-2 flex list-none flex-col gap-2 p-0`,children:s.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-col gap-1 border-l-2 border-line pl-4`,children:[(0,H.jsx)(m,{seq:e.step}),e.data?(0,H.jsx)(Q,{t:e.data,label:`said`}):null]},e.id))})]})]})})}function Ge({id:e}){let[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),[s,c]=(0,V.useState)(J);(0,V.useEffect)(()=>{M.run(e).then(r,e=>a(e.message))},[e]);let l=(0,H.jsx)(pe,{to:{href:E(`evidence-runs`),label:`All agent runs`}});if(!n)return(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[l,i?(0,H.jsx)(B,{text:i}):(0,H.jsx)(X,{})]});let u=n.decisions.filter(e=>!e.step),d=n.steps.filter(e=>e.ok===!1).length,p=e=>{e>s&&c(Math.ceil(e/J)*J),requestAnimationFrame(()=>{let t=document.getElementById(`evidence-step-${e}`);t?.scrollIntoView({block:`start`}),t?.focus({preventScroll:!0})})},m=[...n.gaps,...n.truncated?[n.truncated]:[]];return(0,H.jsxs)(`section`,{"aria-labelledby":`evidence-run-h`,className:`flex flex-col gap-6`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,(0,H.jsx)(De,{id:`evidence-run-h`,icon:o,title:U(n.request?.text?.text?n.request.text.text.slice(0,200):`${n.agent.name}: request not recorded`)}),(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[U(`${n.agent.name}${n.agent.version?` ${n.agent.version}`:``}${n.agent.model?` · ${n.agent.model}`:``}${n.agent.provider?` (${n.agent.provider})`:``}`),` · from `,Ae[n.source.kind],`, `,U(n.source.name),n.started?` · ${W(n.started)}`:``,n.ended&&n.ended!==n.started?` to ${W(n.ended)}`:``]}),(0,H.jsx)(`p`,{className:`m-0 font-mono text-body-sm text-muted`,children:n.id})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-1 text-body-sm text-muted`,children:[(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:n.steps.length}),` `,n.steps.length===1?`step`:`steps`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:j(`tabular-nums`,d?`text-fail`:`text-ink`),children:d}),` failed`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:n.inputs.length}),` `,n.inputs.length===1?`input`:`inputs`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:n.decisions.length}),` `,n.decisions.length===1?`decision`:`decisions`]}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`b`,{className:`text-ink tabular-nums`,children:n.statements.length}),` `,n.statements.length===1?`claim`:`claims`]}),(0,H.jsx)(`span`,{children:n.content?`Content kept, with secrets cut out`:`Inputs kept as fingerprints only`})]}),(0,H.jsx)(We,{r:n,goTo:p}),(0,H.jsx)(Ke,{id:n.id,goTo:p}),(0,H.jsx)(z,{id:`evidence-gaps`,title:`What the record cannot say`,icon:ee,n:m.length,children:m.length?(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:m.map(e=>(0,H.jsx)(`li`,{className:`border-b border-line-soft py-2 text-body-sm text-ink-2 last:border-b-0 [overflow-wrap:anywhere]`,children:U(e)},e))}):(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`Nothing: the source said everything the record holds.`})}),(0,H.jsxs)(z,{id:`evidence-timeline`,title:`Timeline`,icon:o,n:n.steps.length,children:[(0,H.jsx)(`ol`,{"aria-label":`Steps`,className:`m-0 flex list-none flex-col p-0`,children:n.steps.slice(0,s).map(e=>(0,H.jsx)(Ue,{s:e,r:n},e.seq))}),n.steps.length>s&&(0,H.jsxs)(N,{size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>c(s+J),"data-tip":`Show ${Math.min(J,n.steps.length-s)} more of ${n.steps.length-s}`,children:[(0,H.jsx)(t,{"aria-hidden":`true`}),`More (`,Math.min(J,n.steps.length-s),`)`]})]}),u.length>0&&(0,H.jsx)(z,{id:`evidence-loose`,title:`Decisions not tied to a step`,icon:v,n:u.length,children:(0,H.jsx)(`div`,{className:`flex flex-col gap-4`,children:u.map(e=>(0,H.jsx)(He,{d:e},e.seq))})}),(0,H.jsx)(z,{id:`evidence-inputs`,title:`Data it took in`,icon:f,n:n.inputs.length,children:n.inputs.length?(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:n.inputs.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-4 gap-y-1 border-b border-line-soft py-2 last:border-b-0`,children:[(0,H.jsxs)(`span`,{className:`min-w-0 flex-[1_1_320px] text-body-sm [overflow-wrap:anywhere]`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:Ne[e.kind]||e.kind}),` `,(0,H.jsx)(`span`,{className:`text-muted`,children:`from`}),` `,U(e.source)]}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted tabular-nums`,children:[`step `,e.step]}),(0,H.jsx)(`span`,{className:`font-mono text-body-sm text-muted`,children:e.data.text===void 0?`${e.data.chars.toLocaleString()} chars · ${e.data.sha256.slice(0,12)}`:`kept`})]},e.id))}):(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`The record holds no input.`})})]})}function Ke({id:e,goTo:t}){let[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(0),c=()=>s(e=>e+1);if((0,V.useEffect)(()=>{M.verdict(e).then(r,e=>a(e.message))},[e,o]),i)return(0,H.jsx)(B,{text:i});if(!n)return(0,H.jsx)(X,{});let l=n.why||!n.verdicts.length?(0,H.jsx)(z,{id:`evidence-behaviour`,title:Pe.behaviour.title,icon:_,children:(0,H.jsxs)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:[`Not judged: `,U(n.why||`no contract judges this agent.`),` A contract says what was agreed for an agent; `,(0,H.jsx)(`a`,{href:E(`evidence-contracts`),children:`Contracts`}),` lists them.`]})}):null;return(0,H.jsxs)(H.Fragment,{children:[n.work&&(0,H.jsxs)(`p`,{className:j(`m-0`,ue[n.work.personTakesOver?`warn`:`info`]),children:[n.work.attempt?`Fix attempt ${n.work.attempt} of 2 at `:`The first run of work tried again in `,n.work.attempt?(0,H.jsx)(`a`,{href:E(`evidence-runs`,encodeURIComponent(n.work.first)),children:n.work.first}):`${n.work.runs.length-1} ${n.work.runs.length===2?`fix attempt`:`fix attempts`}`,n.work.personTakesOver?`: findings are still open after the last attempt, so a person takes over.`:`.`]}),l,n.verdicts.map(e=>(0,H.jsx)(z,{id:`evidence-${e.lens}`,title:Pe[e.lens].title,icon:Pe[e.lens].icon,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(F,{tone:K[e.status].tone,children:K[e.status].label}),(0,H.jsx)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:e.contract?(0,H.jsxs)(H.Fragment,{children:[`By contract `,U(e.contract.name),`, version `,U(e.contract.version),`, `,e.contract.approved?`approved`:`not approved: it can only warn`]}):`Against the product graph: advisory, it can only warn`})]}),e.notes.map(e=>(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted [overflow-wrap:anywhere]`,children:U(e)},e)),(0,H.jsx)(`ul`,{"aria-label":`Checks`,className:j(P,`m-0 flex list-none flex-col`),children:e.checks.map(n=>(0,H.jsxs)(`li`,{className:`flex flex-col gap-2 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(`span`,{className:`min-w-[152px] text-body-sm font-medium`,children:q[n.check]}),(0,H.jsx)(F,{tone:K[n.status].tone,children:K[n.status].label}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:[U(n.checked),n.gating?` · can fail a run`:n.advisory&&e.contract?.approved?` · ${n.advisory}`:``]})]}),n.findings.map(n=>(0,H.jsx)(Je,{f:n,run:e.run,goTo:t,onOverruled:c},n.id))]},n.check))}),e.lens===`content`&&n.rubric&&(0,H.jsx)(qe,{run:e.run,rubric:n.rubric,onGraded:c})]})},e.lens))]})}function qe({run:e,rubric:t,onGraded:n}){let[r,i]=(0,V.useState)(null),[a,o]=(0,V.useState)(``),[s,c]=(0,V.useState)(!1),[l,d]=(0,V.useState)(``),f=a.trim().length>=10&&a.trim().length<=500,p=async()=>{if(r){c(!0),d(``);try{await M.grade(e,r.id,r.grade,a.trim()),i(null),o(``),n()}catch(e){d(e.message)}finally{c(!1)}}};return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`h4`,{className:`m-0 text-body-sm font-medium`,children:`Grade the answer`}),(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[t.criteria.some(e=>e.id===`scenario`)?`Its scenario is graded by a person: the release gate counts it only once you have graded it. `:``,t.criteria.some(e=>e.id!==`scenario`)?`The judge's misses count only once it agrees with people's grades. `:``,`Read the answer, then say whether it meets each criterion; your grade is kept with your name.`]}),t.answer!==void 0&&(0,H.jsx)(`p`,{className:`m-0 whitespace-pre-wrap rounded-base bg-surface-muted px-4 py-2 text-body-sm text-ink [overflow-wrap:anywhere]`,children:U(t.answer)}),(0,H.jsx)(`ul`,{"aria-label":`Rubric criteria`,className:j(P,`m-0 flex list-none flex-col`),children:t.criteria.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-col gap-2 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsxs)(`span`,{className:`text-body-sm text-ink [overflow-wrap:anywhere]`,children:[(0,H.jsx)(`span`,{className:`font-mono text-muted`,children:e.id}),` `,U(e.text)]}),e.grade&&(0,H.jsx)(F,{tone:e.grade.grade===`meets`?`pass`:`warn`,children:e.grade.grade===`meets`?`Meets`:`Misses`}),(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.grade?`Grade again:`:`Grade:`}),[`meets`,`misses`].map(t=>(0,H.jsx)(N,{variant:`link`,size:`inline`,"aria-label":`${e.id} ${t===`meets`?`meets`:`misses`}`,onClick:()=>i({id:e.id,grade:t}),className:`min-h-7 px-2`,children:t===`meets`?`Meets`:`Misses`},t))]}),e.grade&&(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[`Graded by `,U(e.grade.by),` `,W(e.grade.at),`: `,U(e.grade.reason)]}),r?.id===e.id&&(0,H.jsxs)(`div`,{className:j(`panel rounded-md bg-(--page-surface-strong) p-6`,`flex max-w-[640px] flex-col gap-2`),children:[(0,H.jsxs)(`label`,{htmlFor:`grade-${e.id}`,className:`text-body-sm font-medium text-ink-2`,children:[`Why does the answer `,r.grade===`meets`?`meet`:`miss`,` it?`]}),(0,H.jsx)(A,{id:`grade-${e.id}`,value:a,onChange:e=>o(e.target.value),rows:2,maxLength:500,placeholder:`For example: it says the customer must send a photo by Friday.`}),l&&(0,H.jsx)(B,{text:l}),(0,H.jsxs)(`span`,{className:`flex gap-2`,children:[(0,H.jsxs)(N,{size:`sm`,disabled:!f||s,onClick:p,"data-tip":r.grade===`meets`?`Keep the grade: meets`:`Keep the grade: misses`,children:[(0,H.jsx)(u,{"aria-hidden":`true`}),s?`Keeping…`:`Keep`]}),(0,H.jsxs)(N,{size:`sm`,variant:`ghost`,onClick:()=>i(null),children:[(0,H.jsx)(h,{"aria-hidden":`true`}),`Cancel`]})]})]})]},e.id))})]})}function Je({f:e,run:t,goTo:n,onOverruled:r}){let[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(``),[l,u]=(0,V.useState)(!1),[d,f]=(0,V.useState)(``),p=s.trim().length>=10&&s.trim().length<=500,m=async()=>{u(!0),f(``);try{await M.overrule(t,e.id,s.trim()),o(!1),r()}catch(e){f(e.message)}finally{u(!1)}};return(0,H.jsxs)(`div`,{className:j(`flex flex-col gap-1 border-l-2 pl-4`,e.overruled?`border-line opacity-80`:e.status===`FAIL`?`border-fail`:e.status===`WARN`?`border-warn`:`border-line`),children:[(0,H.jsx)(`span`,{className:j(`text-body-sm [overflow-wrap:anywhere]`,e.overruled?`text-ink-2`:`text-ink`),children:U(e.what)}),e.fix&&!e.overruled&&(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[`Fix: `,U(e.fix)]}),e.overruled&&(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[`Overruled by `,U(e.overruled.by),` `,W(e.overruled.at),` (`,e.overruled.via===`web`?`on this page`:`at a terminal`,`): `,U(e.overruled.reason)]}),(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-body-sm text-muted`,children:[(0,H.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:U(e.source)}),e.location&&(0,H.jsx)(`span`,{className:`font-mono [overflow-wrap:anywhere]`,children:U(`${e.location.repo?`${e.location.repo}/`:``}${e.location.file}${e.location.line?`:${e.location.line}`:``}`)}),[...new Set(e.steps)].slice(0,12).map(e=>(0,H.jsxs)(N,{variant:`link`,size:`inline`,onClick:()=>n(e),className:`min-h-7 px-2 tabular-nums`,children:[`step `,e]},e)),!e.overruled&&e.status!==`UNKNOWN`&&!a&&(0,H.jsxs)(N,{variant:`link`,size:`inline`,onClick:()=>o(!0),className:`min-h-7 gap-1 px-2`,children:[(0,H.jsx)(i,{size:12,"aria-hidden":`true`}),`Overrule`]})]}),a&&(0,H.jsxs)(`div`,{className:j(`panel rounded-md bg-(--page-surface-strong) p-6`,`flex max-w-[640px] flex-col gap-2`),children:[(0,H.jsx)(`label`,{htmlFor:`overrule-${e.id}`,className:`text-body-sm font-medium text-ink-2`,children:`Why is this finding wrong, or right to accept? It is kept with your name, and the finding stops counting.`}),(0,H.jsx)(A,{id:`overrule-${e.id}`,value:s,onChange:e=>c(e.target.value),rows:2,maxLength:500,placeholder:`For example: the owner agreed this removal in the change's review.`}),d&&(0,H.jsx)(B,{text:d}),(0,H.jsxs)(`span`,{className:`flex gap-2`,children:[(0,H.jsxs)(N,{size:`sm`,disabled:!p||l,onClick:m,children:[(0,H.jsx)(i,{"aria-hidden":`true`}),l?`Overruling…`:`Overrule`]}),(0,H.jsxs)(N,{size:`sm`,variant:`ghost`,onClick:()=>o(!1),children:[(0,H.jsx)(h,{"aria-hidden":`true`}),`Cancel`]})]})]})]})}function Ye(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(``);return(0,V.useEffect)(()=>{M.review().then(t,e=>r(e.message))},[]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Y,{id:`evidence-review`,children:`Review queue`}),(0,H.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:`Runs whose findings are still open, the failed first, then work whose two fix attempts are used, where a person takes over. Open a run to read its findings, and overrule one with a reason where it is wrong or right to accept. Then the answers the rubric's judge could not settle, for a person to grade, and every finding people overruled, and why.`}),n&&(0,H.jsx)(B,{text:n}),!e&&!n&&(0,H.jsx)(X,{}),e?.problems.map(e=>(0,H.jsx)(B,{text:e},e)),e&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h2`,{className:`sr-only`,children:`What waits, what to grade, and what was overruled`}),(0,H.jsx)(z,{id:`waiting`,title:`Waiting for a person`,icon:_,n:e.waiting.length,children:e.waiting.length?(0,H.jsx)(`ul`,{"aria-label":`Waiting for a person`,className:j(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 list-none`),children:e.waiting.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`a`,{href:E(`evidence-runs`,encodeURIComponent(e.run)),className:j(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] gap-x-4`),children:[(0,H.jsx)(F,{tone:K[e.status].tone,children:K[e.status].label}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-sm font-medium`,children:U(e.request||`${e.agent}: request not recorded`)}),(0,H.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:[U(e.agent),k(e.open,`open finding`),e.failed?`${e.failed} failing`:``,e.attempt?`fix attempt ${e.attempt} of 2`:``,e.personTakesOver?`a person takes over`:``].filter(Boolean).join(` · `)})]}),(0,H.jsx)(`span`,{className:`text-right text-body-sm text-muted tabular-nums`,"data-tip":W(e.started),children:e.started?R(e.started):``})]})},e.run))}):(0,H.jsx)(I,{className:`py-4`,children:`Nothing waits: no run has an open finding.`})}),e.grade.length>0&&(0,H.jsxs)(z,{id:`grade`,title:`Answers to grade`,icon:y,n:e.grade.length,children:[(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`The rubric's judge could not settle these answers: it is not yet calibrated against people's grades, or it disagreed with itself. Grading them settles each one and calibrates the judge.`}),(0,H.jsx)(`ul`,{"aria-label":`Answers to grade`,className:j(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 list-none`),children:e.grade.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`a`,{href:E(`evidence-runs`,encodeURIComponent(e.run)),className:j(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`grid min-h-12 grid-cols-[minmax(0,1fr)_auto] gap-x-4`),children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-sm font-medium`,children:U(e.request||`${e.agent}: request not recorded`)}),(0,H.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:[U(e.agent),`${e.ungraded} of ${e.criteria} ${e.criteria===1?`criterion`:`criteria`} not graded`].join(` · `)})]}),(0,H.jsx)(`span`,{className:`text-right text-body-sm text-muted tabular-nums`,"data-tip":W(e.started),children:e.started?R(e.started):``})]})},e.run))})]}),(0,H.jsx)(z,{id:`overruled`,title:`Overruled by people`,icon:v,n:e.overruled.length,children:e.overruled.length?(0,H.jsx)(`ul`,{"aria-label":`Overruled findings`,className:j(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 list-none`),children:e.overruled.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-col gap-1 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,H.jsxs)(`span`,{className:`text-body-sm [overflow-wrap:anywhere]`,children:[(0,H.jsx)(`a`,{href:E(`evidence-runs`,encodeURIComponent(e.run)),children:U(e.agent||e.run)}),` · `,U(`${e.check}/${e.rule}`),e.what?`: ${U(e.what)}`:``]}),(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[U(e.by),` `,W(e.at),` (`,e.via===`web`?`on the page`:`at a terminal`,`): `,U(e.reason)]})]},`${e.run}-${e.finding}-${e.at}`))}):(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No finding has been overruled.`})})]})]})}var Xe={build:`Build and test`,behaviour:`Behaviour`,decisions:`Decisions and data`,content:`Content`,domain:`Domain`};function Ze({s:e}){let[t,n]=(0,V.useState)(e.versions[0]||``),[r,i]=(0,V.useState)(e.versions[1]||``),[a,o]=(0,V.useState)(null),[s,c]=(0,V.useState)(``);(0,V.useEffect)(()=>{e.agent&&t&&(c(``),M.release(e.agent,t,r===t?``:r).then(o,e=>c(e.message)))},[e.agent,t,r]);let l=e=>{if(e===void 0)return``;if(e===null)return`Not run`;let t=e.runs.filter(e=>e.pass).length;return e.short?`Too few runs (${e.runs.length})`:e.pass?e.runs.length===1?`Pass`:t===e.runs.length?`Pass ×${e.runs.length}`:`Pass (${t} of ${e.runs.length})`:e.runs.length>1?`Fail (${e.runs.length-t} of ${e.runs.length} failed)`:`Fail`},u=a?[...new Set([...Object.keys(a.candidate.lensPass),...Object.keys(a.live?.lensPass||{})])]:[];return(0,H.jsxs)(`li`,{className:j(P,`flex flex-col gap-4`),children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(`span`,{className:`text-body-lg font-medium [overflow-wrap:anywhere]`,children:U(e.agent||e.name)}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[U(`${e.name}.yaml`),` · `,k(e.scenarios.length,`scenario`)]})]}),e.problem&&(0,H.jsx)(B,{text:e.problem}),e.agent&&!e.versions.length&&(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`No run of `,U(e.agent),` is recorded yet: run each scenario's request through a version and record it (forgeqe evidence scenarios lists them).`]}),e.versions.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-body-sm`,children:[(0,H.jsx)(`label`,{htmlFor:`cand-${e.name}`,children:`Candidate`}),(0,H.jsx)(O,{size:`sm`,id:`cand-${e.name}`,value:t,onChange:e=>n(e.target.value),className:`w-auto pr-8 pl-4`,children:e.versions.map(e=>(0,H.jsx)(`option`,{value:e,children:U(e)},e))}),(0,H.jsx)(`label`,{htmlFor:`live-${e.name}`,children:`against live`}),(0,H.jsxs)(O,{size:`sm`,id:`live-${e.name}`,value:r,onChange:e=>i(e.target.value),className:`w-auto pr-8 pl-4`,children:[(0,H.jsx)(`option`,{value:``,children:`No live version`}),e.versions.filter(e=>e!==t).map(e=>(0,H.jsx)(`option`,{value:e,children:U(e)},e))]})]}),s&&(0,H.jsx)(B,{text:s}),a&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(F,{tone:a.status===`ready`?`pass`:`fail`,children:a.status===`ready`?`Ready`:`Held`}),(0,H.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:a.status===`ready`?`Not worse on any lens, and every misuse and injection test passed. A person releases it.`:`Held: a person decides, with what follows.`})]}),a.reasons.length>0&&(0,H.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-6 text-body-sm text-ink-2`,children:a.reasons.map(e=>(0,H.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:U(e)},e))}),(0,H.jsxs)(L,{label:`Scenarios of ${e.agent}`,search:!1,sortable:!1,minWidth:520,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Scenario`}),(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Kind`}),a.live&&(0,H.jsxs)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:[U(a.live.version),` (live)`]}),(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:U(a.candidate.version)})]}),children:[e.scenarios.map(e=>(0,H.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,H.jsx)(`th`,{scope:`row`,className:j(`px-4 py-2`,`text-left font-medium`),"data-tip":e.request,children:U(e.id)}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.kind}),a.live&&(0,H.jsx)(`td`,{className:j(`px-4 py-2`,a.live.cells[e.id]&&!a.live.cells[e.id].pass&&`text-fail`),children:l(a.live.cells[e.id])}),(0,H.jsx)(`td`,{className:j(`px-4 py-2`,(a.candidate.cells[e.id]===null||a.candidate.cells[e.id]&&!a.candidate.cells[e.id].pass)&&`text-fail`),children:l(a.candidate.cells[e.id])})]},e.id)),u.map(e=>(0,H.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,H.jsxs)(`th`,{scope:`row`,className:j(`px-4 py-2`,`text-left text-muted`),children:[Xe[e],`: scenarios passed`]}),(0,H.jsx)(`td`,{className:`px-4 py-2`}),a.live&&(0,H.jsx)(`td`,{className:j(`px-4 py-2`,`tabular-nums`),children:a.live.lensPass[e]??0}),(0,H.jsx)(`td`,{className:j(`px-4 py-2`,`tabular-nums`,a.live&&(a.candidate.lensPass[e]??0)<(a.live.lensPass[e]??0)&&`text-fail`),children:a.candidate.lensPass[e]??0})]},e)),(0,H.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,H.jsx)(`th`,{scope:`row`,className:j(`px-4 py-2`,`text-left text-muted`),children:`The owners' expectations met`}),(0,H.jsx)(`td`,{className:`px-4 py-2`}),a.live&&(0,H.jsx)(`td`,{className:j(`px-4 py-2`,`tabular-nums`),children:a.live.golden}),(0,H.jsx)(`td`,{className:j(`px-4 py-2`,`tabular-nums`,a.live&&a.candidate.golden<a.live.golden&&`text-fail`),children:a.candidate.golden})]})]}),(0,H.jsx)(nt,{g:a}),(0,H.jsx)(Qe,{g:a}),(0,H.jsx)(rt,{g:a,ids:e.scenarios.map(e=>e.id)})]}),e.history.length>0&&(0,H.jsxs)(`details`,{className:`text-body-sm`,children:[(0,H.jsxs)(`summary`,{className:`cursor-pointer text-ink-2`,children:[`Gates kept (`,e.history.length,`)`]}),(0,H.jsx)(`ul`,{className:`m-0 mt-1 flex list-none flex-col gap-1 p-0`,children:e.history.map(e=>(0,H.jsxs)(`li`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[W(e.at),` · `,U(e.by),` · `,U(e.candidate),e.live?` against ${U(e.live)}`:``,`: `,e.status===`ready`?`ready`:`held`,e.reasons.length?` (${U(e.reasons[0])}${e.reasons.length>1?`, and ${e.reasons.length-1} more`:``})`:``]},e.at))})]})]})}function Qe({g:e}){let t=Object.entries(e.candidate.cells).flatMap(([e,t])=>(t?.runs??[]).filter(e=>e.awaitingGrade).map(t=>({sid:e,run:t.run})));return t.length?(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsxs)(`h4`,{className:`m-0 text-body-sm font-medium`,children:[`Answers waiting for your grade (`,t.length,`)`]}),(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`These scenarios are graded by a person: until an answer is graded, it is not known, and the scenario does not pass.`}),(0,H.jsx)(`ul`,{"aria-label":`Answers waiting for a grade`,className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm`,children:t.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`a`,{href:E(`evidence-runs`,encodeURIComponent(e.run)),className:`text-accent-fg hover:underline`,children:[U(e.sid),`: `,e.run]})},e.run))})]}):null}function $e({f:e}){return(0,H.jsxs)(`li`,{className:j(P,`flex flex-col gap-2`),children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(F,{tone:e.applied||e.proven?`pass`:`fail`,children:e.applied?`Applied`:e.proven?`Proven`:`Not proven`}),(0,H.jsx)(`span`,{className:`text-body-sm font-medium [overflow-wrap:anywhere]`,children:U(e.instruction)}),(0,H.jsx)(`span`,{className:`font-mono text-body-sm text-muted`,children:e.id})]}),(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[`Adds it to `,U(e.file),`, for `,U(e.cause),` of `,(0,H.jsx)(`a`,{href:E(`evidence-runs`,encodeURIComponent(e.run)),className:`font-mono`,children:e.run}),` (scenario `,U(e.scenario),`, `,U(e.version),`).`]}),(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[`The cause: `,e.proof.replace(`-`,` `),` (`,U(e.why),`)`,e.replays.length?(0,H.jsxs)(H.Fragment,{children:[`; replays `,_t(e.replays)]}):null,`.`]}),(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[`The suite, run from the patched copy against `,U(e.version),`: `,e.gate.status===`ready`?`no worse`:`held: ${U(e.gate.reasons.join(` `))}`]}),e.applied&&(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[`Applied by `,U(e.applied.by),` `,W(e.applied.at),`: `,U(e.applied.reason)]}),(0,H.jsxs)(`details`,{className:`text-body-sm`,children:[(0,H.jsx)(`summary`,{className:`cursor-pointer text-ink-2`,children:`The patch`}),(0,H.jsx)(`pre`,{className:j(Te,`m-0 mt-1 overflow-x-auto`),children:U(e.patch)})]})]})}function et({d:e,onDecided:t}){let n=e.scenario,r=n.expect||{},a=e.source.kind===`run`?`a run that failed`:e.source.kind===`story`?`an acceptance criterion`:e.source.kind===`rule`?`a business rule of the product, at`:`a defect`,o=e=>(e||[]).map(e=>U(e)).join(`, `);return(0,H.jsxs)(`li`,{className:`flex flex-col gap-2 border-b border-line-soft px-4 py-4 last:border-b-0`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(`span`,{className:`font-mono text-body-sm text-muted`,children:e.id}),(0,H.jsxs)(`span`,{className:`text-body-sm font-medium [overflow-wrap:anywhere]`,children:[U(n.id),` for `,U(e.agent)]}),(0,H.jsx)(F,{tone:`neutral`,children:n.kind}),n.held_out&&(0,H.jsx)(F,{tone:`neutral`,children:`Held out`}),e.decided&&(0,H.jsx)(F,{tone:e.decided.decision===`accepted`?`pass`:`warn`,children:e.decided.decision===`accepted`?`Accepted`:`Rejected`})]}),(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[`Drafted by `,e.by===`code`?`code`:`a model`,` from `,a,` `,e.source.url&&Ee(e.source.url)===`web`?(0,H.jsx)(`a`,{href:e.source.url,target:`_blank`,rel:`noreferrer noopener`,className:`text-accent-fg hover:underline`,children:U(e.source.ref)}):U(e.source.ref),e.source.criterion?` ${U(e.source.criterion)}`:``,e.source.quote?(0,H.jsxs)(H.Fragment,{children:[`: “`,U(e.source.quote),`”`]}):e.source.why?(0,H.jsxs)(H.Fragment,{children:[`: `,U(e.source.why)]}):null]}),(0,H.jsx)(`p`,{className:`m-0 whitespace-pre-wrap rounded-base bg-surface-muted px-4 py-2 text-body-sm text-ink [overflow-wrap:anywhere]`,children:U(n.request)}),(0,H.jsxs)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-6 text-body-sm text-ink-2`,children:[r.chose&&(0,H.jsxs)(`li`,{children:[`Expects it to choose `,o(r.chose)]}),r.not_chose&&(0,H.jsxs)(`li`,{children:[`Expects it never to choose `,o(r.not_chose)]}),r.says&&(0,H.jsxs)(`li`,{children:[`Expects it to say: `,o(r.says)]}),r.not_says&&(0,H.jsxs)(`li`,{children:[`Expects it never to say: `,o(r.not_says)]}),r.graded&&(0,H.jsx)(`li`,{children:`A person grades each answer`}),(0,H.jsx)(`li`,{children:r.clean?`Every lens must find nothing`:`The lenses are counted lens by lens`})]}),e.decided?(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[e.decided.decision===`accepted`?`Accepted`:`Rejected`,` by `,U(e.decided.by),` `,W(e.decided.at),e.decided.scenario?` as ${U(e.decided.scenario)}`:``,`: `,U(e.decided.reason)]}):(0,H.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(gt,{agent:e.id,uid:`${e.id}-accept`,label:`Add`,icon:g,tip:`Add to the suite`,action:(t,n)=>M.decideDraft(e.id,`accepted`,t,n),onDone:t}),(0,H.jsx)(gt,{agent:e.id,uid:`${e.id}-reject`,label:`Reject`,icon:i,action:(t,n)=>M.decideDraft(e.id,`rejected`,t,n),onDone:t})]})]})}function tt({onDecided:e}){let[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(``),a=()=>M.drafts().then(n,e=>i(e.message));(0,V.useEffect)(()=>{a()},[]);let o=t?.drafts.filter(e=>!e.decided).length??0;return(0,H.jsxs)(z,{id:`drafts`,title:`Drafted scenarios`,icon:y,n:o,children:[(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`Drafted from work items' acceptance criteria and defects (`,(0,H.jsx)(`code`,{children:`forgeqe evidence draft <agent> --from ado:N`}),`) or the product graph's business rules (`,(0,H.jsx)(`code`,{children:`--from-product`}),`), each resting on a quote of its source, or from a run that failed (`,(0,H.jsx)(`code`,{children:`--run <id>`}),`). Nothing is added by itself: add each to the suite, or reject it. About one in five is held out by ForgeQE, so the team tuning the agent does not choose what it is measured on.`]}),r&&(0,H.jsx)(B,{text:r}),t?.problems.map(e=>(0,H.jsx)(B,{text:e},e)),t&&!t.drafts.length&&(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No draft yet.`}),t&&t.drafts.length>0&&(0,H.jsx)(`ul`,{"aria-label":`Drafted scenarios`,className:j(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 flex list-none flex-col`),children:t.drafts.map(t=>(0,H.jsx)(et,{d:t,onDecided:()=>{a(),e()}},t.id))})]})}function nt({g:e}){let t=[...e.live?[e.live]:[],e.candidate],n=e=>e&&e.n?`${Math.round(e.pass/e.n*100)}% of ${e.n}`:`-`,r=[...[...new Set(t.flatMap(e=>Object.keys(e.pooled.lens)))].map(e=>[Xe[e],t=>n(t.pooled.lens[e])]),[`The owners' expectations`,e=>n(e.pooled.golden)],[`Weakest lens (the summary)`,e=>e.pooled.weakest?`${Math.round(e.pooled.weakest.score*100)}% (${Xe[e.pooled.weakest.lens]})`:`-`],...t.some(e=>e.pooled.heldOut.n)?[[`Held-out scenarios`,e=>n(e.pooled.heldOut)]]:[],[`Steps per run`,e=>e.pooled.effort.runs?e.pooled.effort.steps.toFixed(1):`-`],[`Tool calls per run`,e=>e.pooled.effort.runs?e.pooled.effort.tools.toFixed(1):`-`],[`Time per run`,e=>e.pooled.effort.ms===null?`-`:`${(e.pooled.effort.ms/1e3).toFixed(1)} s`]];return(0,H.jsxs)(`details`,{className:`text-body-sm`,children:[(0,H.jsx)(`summary`,{className:`cursor-pointer text-ink-2`,children:`Scores: runs passed, lens by lens`}),(0,H.jsx)(`p`,{className:`m-0 mt-1 text-body-sm text-muted`,children:`A lens's score is its runs passed of the runs it judged. The summary is the weakest lens, never an average: one lens cannot make up for another. Effort is shown, never held against a version on its own.`}),(0,H.jsx)(L,{label:`Scores`,search:!1,sortable:!1,minWidth:420,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{scope:`col`,className:_e,children:`Score`}),t.map(t=>(0,H.jsxs)(`th`,{scope:`col`,className:Se,children:[U(t.version),e.live&&t===e.live?` (live)`:``]},t.version))]}),children:r.map(([e,n])=>(0,H.jsxs)(`tr`,{className:ge,children:[(0,H.jsx)(`th`,{scope:`row`,className:j(xe,`text-left font-medium`),children:e}),t.map(e=>(0,H.jsx)(`td`,{className:Ce,children:n(e)},e.version))]},e))})]})}function rt({g:e,ids:t}){let n=e=>e?e.runs.find(e=>e.path?.unmet.length)??e.runs.find(e=>e.path):void 0,r=t.flatMap(t=>{let r=n(e.candidate.cells[t]),i=e.live?n(e.live.cells[t]):void 0;return r?.path||i?.path?[{id:t,cand:r,live:i}]:[]});if(!r.length)return null;let i={same:``,missing:`expected, not done`,extra:`done, not expected`},a=(e,t)=>t?.path?(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[e,`: `,(0,H.jsx)(`a`,{href:E(`evidence-runs`,encodeURIComponent(t.run)),className:`font-mono`,children:t.run}),t.path.match===null?``:` · match ${Math.round(t.path.match*100)}%, efficiency ${Math.round((t.path.efficiency??0)*100)}%`]}),(0,H.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1 p-0 font-mono text-body-sm`,children:(t.path.alignment.length?t.path.alignment:t.path.actual.map(e=>({kind:`same`,step:e}))).map((e,t)=>(0,H.jsxs)(`li`,{className:j(`[overflow-wrap:anywhere]`,e.kind===`missing`&&`text-fail`,e.kind===`extra`&&`text-warn`),children:[e.kind===`missing`?`− `:e.kind===`extra`?`+ `:` `,U(e.step),e.kind!==`same`&&(0,H.jsxs)(`span`,{className:`font-sans text-body-sm text-muted`,children:[` (`,i[e.kind],`)`]})]},`${t}-${e.step}`))}),t.path.unmet.map(e=>(0,H.jsx)(`span`,{className:`text-body-sm text-fail [overflow-wrap:anywhere]`,children:U(e)},e))]}):(0,H.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[e,`: not run`]});return(0,H.jsxs)(`details`,{className:`text-body-sm`,children:[(0,H.jsxs)(`summary`,{className:`cursor-pointer text-ink-2`,children:[`Paths: expected against actual (`,r.length,`)`]}),(0,H.jsx)(`ul`,{className:`m-0 mt-2 flex list-none flex-col gap-4 p-0`,children:r.map(t=>(0,H.jsxs)(`li`,{className:j(P,`flex flex-col gap-2`),children:[(0,H.jsx)(`span`,{className:`text-body-sm font-medium`,children:U(t.id)}),(0,H.jsxs)(`div`,{className:`grid gap-4 @[640px]:grid-cols-2`,children:[e.live&&a(`${e.live.version} (live)`,t.live),a(e.candidate.version,t.cand)]})]},t.id))})]})}function it(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(``),i=()=>M.releases().then(t,e=>r(e.message));return(0,V.useEffect)(()=>{i()},[]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Y,{id:`evidence-releases`,children:`Releases`}),(0,H.jsxs)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:[`Before a version is released: its runs of the agent's scenario suite (stories, past defects, misuse and injection tests, each with what its owners expect) against the live version's. It is held when it is worse on any lens, meets fewer expectations, or fails a misuse or injection test; not run, or not known, is never a pass. A person releases; `,(0,H.jsx)(`code`,{children:`forgeqe evidence release`}),` keeps each gate.`]}),n&&(0,H.jsx)(B,{text:n}),!e&&!n&&(0,H.jsx)(X,{}),e&&!e.suites.length&&(0,H.jsx)(I,{className:`py-4`,children:`No scenario suite yet: write one in .forgeqe/evidence/scenarios/<agent>.yaml (docs/EVIDENCE.md has its form), or add drafted scenarios below.`}),e&&e.suites.length>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h2`,{className:`sr-only`,children:`Each agent's scenario suite and release gate`}),(0,H.jsx)(z,{id:`suites`,title:`Scenario suites`,icon:y,n:e.suites.length,children:(0,H.jsx)(`ul`,{"aria-label":`Scenario suites`,className:`m-0 flex list-none flex-col gap-4 p-0`,children:e.suites.map(e=>(0,H.jsx)(Ze,{s:e},e.name))})})]}),e&&(0,H.jsx)(tt,{onDecided:i})]})}var at={approved:{tone:`pass`,label:`Approved`},changed:{tone:`warn`,label:`Changed since approved`},draft:{tone:`neutral`,label:`Not approved`},invalid:{tone:`fail`,label:`Cannot be read`}};function ot(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(``);(0,V.useEffect)(()=>{M.contracts().then(t,e=>r(e.message))},[]);let i=e=>e===null?`–`:`${Math.round(e*100)}%`;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Y,{id:`evidence-contracts`,children:`Contracts`}),(0,H.jsxs)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:[`What each agent's owner agreed for it: the steps it must take, what it may and may never do, its limits, what a person decides, and what its statements need behind them. Each run is checked against its agent's approved contract. A contract nobody approved, or a check not yet measured well enough on labelled runs, only warns. Start one with `,(0,H.jsx)(`code`,{children:`forgeqe evidence contract new "<agent>"`}),`; a person approves it at a terminal with `,(0,H.jsx)(`code`,{children:`forgeqe evidence contract approve <name>`}),`.`]}),n&&(0,H.jsx)(B,{text:n}),!e&&!n&&(0,H.jsx)(X,{}),e&&!e.contracts.length&&(0,H.jsx)(I,{className:`py-4`,children:`No contract yet. Without one, a run's record is kept, but nothing checks it against what was agreed.`}),e&&(0,H.jsx)(`h2`,{className:`sr-only`,children:`The contracts and how each check is measured`}),e&&e.contracts.length>0&&(0,H.jsx)(z,{id:`contracts`,title:`Contracts`,icon:f,n:e.contracts.length,children:(0,H.jsx)(`ul`,{"aria-label":`Contracts`,className:`m-0 flex list-none flex-col gap-4 p-0`,children:e.contracts.map(e=>(0,H.jsxs)(`li`,{className:j(`rounded-lg bg-bg p-6 shadow-sm`,`flex flex-col gap-2`),children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(`span`,{className:`text-body-lg font-medium [overflow-wrap:anywhere]`,children:U(e.agent||e.name)}),(0,H.jsx)(F,{tone:at[e.state].tone,children:at[e.state].label}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:[U(`${e.name}.yaml`),e.version?` · version ${U(e.version)}`:``,e.approved?` · approved ${W(e.approved.at)} by ${U(e.approved.by)}`:``]})]}),e.problem&&(0,H.jsx)(B,{text:e.problem}),e.says.length>0&&(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.says.map(e=>(0,H.jsx)(`li`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:U(e)},e))}),(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.gates.length?`Can fail a run: ${e.gates.map(e=>q[e]).join(`, `)}.`:`No check can fail a run under it yet: what they find is a warning.`})]},e.name))})}),e&&(0,H.jsxs)(z,{id:`measured`,title:`How well each check is measured`,icon:d,children:[(0,H.jsxs)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:[`On `,k(e.measured.records,`labelled run`),`: runs whose right findings a person wrote down (ForgeQE's own, and the project's in .forgeqe/evidence/labelled). A check may fail a run only when its owner's bar is met on at least `,e.measured.min,` labelled findings.`]}),e.measured.problems.map(e=>(0,H.jsx)(B,{text:`Not measured: ${e}`},e)),(0,H.jsx)(`div`,{className:`@container`,children:(0,H.jsx)(L,{label:`How well each check is measured`,search:!1,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Check`}),[`Labelled`,`Found right`,`Found wrong`,`Missed`,`Precision`,`Recall`].map(e=>(0,H.jsx)(`th`,{scope:`col`,className:j(`px-4 py-2 text-right text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,`whitespace-normal`,st.has(e)&&`hidden @lg:table-cell`),children:e},e))]}),children:Object.keys(q).filter(t=>e.measured.checks[t]).map(t=>{let n=e.measured.checks[t];return(0,H.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,H.jsx)(`th`,{scope:`row`,className:j(`px-4 py-2`,`text-left font-medium`),children:q[t]}),(0,H.jsx)(`td`,{className:j(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,n.labelled<e.measured.min&&`text-muted`),children:n.labelled}),(0,H.jsx)(`td`,{className:j(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,`hidden @lg:table-cell`),children:n.tp}),(0,H.jsx)(`td`,{className:j(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,`hidden @lg:table-cell`,n.fp>0&&`text-fail`),children:n.fp}),(0,H.jsx)(`td`,{className:j(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,`hidden @lg:table-cell`,n.fn>0&&`text-fail`),children:n.fn}),(0,H.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:i(n.precision)}),(0,H.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:i(n.recall)})]},t)})})})]})]})}var st=new Set([`Found right`,`Found wrong`,`Missed`]),ct={proven:{tone:`pass`,label:`Proven`},promising:{tone:`neutral`,label:`Promising`},"not-replayed":{tone:`neutral`,label:`Not replayed`},refuted:{tone:`fail`,label:`Refuted`},"side-effects":{tone:`warn`,label:`Side effects`}},lt={instruction:`Its instructions`,tool:`A tool`,data:`Its data`};function ut({p:e,onDecided:t}){let[n,r]=(0,V.useState)(null),[a,o]=(0,V.useState)(``),[c,l]=(0,V.useState)(!1),[u,d]=(0,V.useState)(``),f=a.trim().length>=10&&a.trim().length<=500,p=async()=>{if(n){l(!0),d(``);try{await M.decide(e.agent,e.id,n,a.trim()),r(null),t()}catch(e){d(e.message)}finally{l(!1)}}};return(0,H.jsxs)(`li`,{className:`flex flex-col gap-1 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(F,{tone:e.state===`approved`?`pass`:e.state===`declined`?`neutral`:`warn`,children:e.state===`approved`?`Approved`:e.state===`declined`?`Declined`:`Open`}),(0,H.jsx)(`span`,{className:`text-body-sm font-medium text-ink-2`,children:e.kind===`fix`?`Fix, proven by replay`:`Guidance for its instructions`}),(0,H.jsx)(`span`,{className:`font-mono text-body-sm text-muted`,children:e.id})]}),(0,H.jsx)(`span`,{className:`text-body-sm text-ink [overflow-wrap:anywhere]`,children:U(e.text)}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:[`Because `,U(e.because),`. `,k(e.runs.length,`run`),e.replays?`, ${k(e.replays.length,`replay`)}`:``,`:`,` `,[...e.runs,...e.replays??[]].slice(0,8).map((e,t)=>(0,H.jsxs)(`span`,{children:[t?`, `:``,(0,H.jsx)(`a`,{href:E(`evidence-runs`,encodeURIComponent(e)),className:`font-mono`,children:e})]},e))]}),e.decision&&(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[e.state===`approved`?`Approved`:`Declined`,` by `,U(e.decision.by),` `,W(e.decision.at),` (`,e.decision.via===`web`?`on this page`:`at a terminal`,`): `,U(e.decision.reason)]}),e.state===`open`&&!n&&(0,H.jsxs)(`span`,{className:`flex gap-2`,children:[(0,H.jsxs)(N,{size:`sm`,onClick:()=>r(`approved`),children:[(0,H.jsx)(s,{"aria-hidden":`true`}),`Approve`]}),(0,H.jsxs)(N,{size:`sm`,variant:`ghost`,onClick:()=>r(`declined`),children:[(0,H.jsx)(i,{"aria-hidden":`true`}),`Decline`]})]}),n&&(0,H.jsxs)(`div`,{className:j(`panel rounded-md bg-(--page-surface-strong) p-6`,`flex max-w-[640px] flex-col gap-2`),children:[(0,H.jsx)(`label`,{htmlFor:`decide-${e.id}`,className:`text-body-sm font-medium text-ink-2`,children:n===`approved`?`Why approve it? It is kept with your name; the team then puts it into the agent: Evidence changes nothing itself.`:`Why decline it? It is kept with your name.`}),(0,H.jsx)(A,{id:`decide-${e.id}`,value:a,onChange:e=>o(e.target.value),rows:2,maxLength:500,placeholder:`For example: the replays show the claim data is the cause.`}),u&&(0,H.jsx)(B,{text:u}),(0,H.jsxs)(`span`,{className:`flex gap-2`,children:[(0,H.jsxs)(N,{size:`sm`,disabled:!f||c,onClick:p,children:[n===`approved`?(0,H.jsx)(s,{"aria-hidden":`true`}):(0,H.jsx)(i,{"aria-hidden":`true`}),c?`Keeping…`:n===`approved`?`Approve`:`Decline`]}),(0,H.jsxs)(N,{size:`sm`,variant:`ghost`,onClick:()=>r(null),children:[(0,H.jsx)(h,{"aria-hidden":`true`}),`Cancel`]})]})]})]})}function dt({agent:e,run:t,c:n,candidates:r,onLinked:i}){let a=r,[o,s]=(0,V.useState)(!1),[c,l]=(0,V.useState)([]),[u,d]=(0,V.useState)(!1),[f,p]=(0,V.useState)(``);return(0,H.jsxs)(`div`,{className:j(`flex flex-col gap-1 border-l-2 pl-4`,n.status===`proven`?`border-pass`:n.status===`refuted`?`border-fail`:n.status===`side-effects`?`border-warn`:`border-line`),children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(F,{tone:ct[n.status].tone,children:ct[n.status].label}),(0,H.jsxs)(`span`,{className:`text-body-sm font-medium`,children:[n.id,` · `,lt[n.kind],`: `,U(n.where)]}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`of `,q[n.finding.check],`: `,U(n.finding.rule)]})]}),(0,H.jsxs)(`span`,{className:`text-body-sm text-ink [overflow-wrap:anywhere]`,children:[`Change: `,U(n.change)]}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:[U(n.why),`.`]}),n.replays.map(e=>(0,H.jsxs)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[`Replay `,(0,H.jsx)(`a`,{href:E(`evidence-runs`,encodeURIComponent(e.run)),className:`font-mono`,children:e.run}),`: `,e.gone&&!e.broke.length&&e.changeSeen!==!1?`the finding is gone`:U(e.why.join(`; `))]},e.run)),!o&&a.length>0&&n.status!==`proven`&&(0,H.jsx)(`span`,{children:(0,H.jsxs)(N,{variant:`link`,size:`inline`,onClick:()=>s(!0),"data-tip":`Link replays`,className:`min-h-7 gap-1`,children:[(0,H.jsx)(w,{size:12,"aria-hidden":`true`}),`Link`]})}),o&&(0,H.jsxs)(`fieldset`,{className:j(`panel rounded-md bg-(--page-surface-strong) p-6`,`m-0 flex max-w-[640px] flex-col gap-2 border-0`),children:[(0,H.jsxs)(`legend`,{className:`sr-only`,children:[`Replays of `,n.id]}),(0,H.jsx)(`span`,{className:`text-body-sm font-medium text-ink-2`,children:`Which runs are this request run again with this change? Only runs of the same agent and request, after this one, are listed.`}),a.map(e=>(0,H.jsxs)(`label`,{className:`flex min-h-8 items-center gap-2 text-body-sm`,children:[(0,H.jsx)(ke,{checked:c.includes(e),onCheckedChange:t=>l(n=>t?[...n,e]:n.filter(t=>t!==e))}),(0,H.jsx)(`span`,{className:`font-mono`,children:e})]},e)),f&&(0,H.jsx)(B,{text:f}),(0,H.jsxs)(`span`,{className:`flex gap-2`,children:[(0,H.jsxs)(N,{size:`sm`,disabled:!c.length||u,onClick:async()=>{d(!0),p(``);try{await M.replay(e,t,n.id,c),s(!1),l([]),i()}catch(e){p(e.message)}finally{d(!1)}},"data-tip":`Link the picked replays`,children:[(0,H.jsx)(w,{"aria-hidden":`true`}),u?`Linking…`:c.length?`Link (${c.length})`:`Link`]}),(0,H.jsxs)(N,{size:`sm`,variant:`ghost`,onClick:()=>s(!1),children:[(0,H.jsx)(h,{"aria-hidden":`true`}),`Cancel`]})]})]})]})}function ft({sub:e}){let[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(e?C(e):``),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(``),[d,f]=(0,V.useState)(0);(0,V.useEffect)(()=>{M.overview().then(e=>{let t=e.agents.map(e=>e.name);n(t),i(e=>e||t[0]||``)},e=>u(e.message))},[]),(0,V.useEffect)(()=>{r&&(c(null),M.learn(r).then(c,e=>u(e.message)))},[r,d]);let p=()=>f(e=>e+1);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Y,{id:`evidence-learn`,children:`Learn`}),(0,H.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:`What to change in an agent, from what its runs got wrong. Each open finding has its possible causes (its instructions, a tool, the data it took in); a cause is proven when the same request, run again three times with that one change, no longer gives the finding and breaks nothing else. Proven causes and rules broken again and again are proposed; a person approves or declines each, and the team puts what is approved into the agent. Evidence changes nothing itself.`}),l&&(0,H.jsx)(B,{text:l}),t&&!t.length&&(0,H.jsx)(Z,{}),t&&t.length>1&&(0,H.jsxs)(`label`,{className:`flex w-fit items-center gap-2 text-body-sm text-ink-2`,children:[`Agent`,(0,H.jsx)(O,{value:r,onChange:e=>i(e.target.value),children:t.map(e=>(0,H.jsx)(`option`,{value:e,children:U(e)},e))})]}),r&&!s&&!l&&(0,H.jsx)(X,{}),s?.problems.map(e=>(0,H.jsx)(B,{text:e},e)),s&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`h2`,{className:`sr-only`,children:[`Proposals and causes of `,U(s.agent)]}),(0,H.jsxs)(z,{id:`proposals`,title:`Proposals`,icon:b,n:s.proposals.length,children:[s.proposals.length?(0,H.jsx)(`ul`,{"aria-label":`Proposals`,className:j(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 list-none`),children:s.proposals.map(e=>(0,H.jsx)(ut,{p:e,onDecided:p},e.id))}):(0,H.jsx)(I,{className:`py-4`,children:`Nothing to propose yet. A rule broken in three runs of the agent's latest version is proposed as guidance; a cause proven by replay, as a fix.`}),s.proposals.some(e=>e.state===`approved`)&&(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[(0,H.jsxs)(`code`,{children:[`forgeqe evidence guidance `,U(s.agent)]}),` writes what was approved as Markdown, to put into the agent.`]})]}),(0,H.jsxs)(z,{id:`fixes`,title:`Fixes proven by the harness`,icon:a,n:s.fixes.length,children:[(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`A cause in the agent's instructions, added to a copy of them and run by ForgeQE's harness: proven on 3 clean replays and a suite that is no worse. The project is not changed: a person applies a proven fix at a terminal (`,(0,H.jsx)(`code`,{children:`forgeqe evidence fix apply <fix>`}),`), or puts its patch on a branch for a pull request.`]}),s.fixes.length?(0,H.jsx)(`ul`,{"aria-label":`Fixes`,className:`m-0 flex list-none flex-col gap-2 p-0`,children:s.fixes.map(e=>(0,H.jsx)($e,{f:e},`${e.id}-${e.at}`))}):(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`No fix proven yet: `,(0,H.jsx)(`code`,{children:`forgeqe evidence fix <run> H1`}),` proves one of a cause below.`]})]}),(0,H.jsx)(z,{id:`causes`,title:`Causes of its findings`,icon:o,n:s.runs.length,children:s.runs.length?(0,H.jsx)(`ul`,{"aria-label":`Runs and their causes`,className:`m-0 flex list-none flex-col gap-2 p-0`,children:s.runs.map(e=>(0,H.jsxs)(`li`,{className:j(`rounded-lg bg-bg p-6 shadow-sm`,`flex flex-col gap-2`),children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(`a`,{href:E(`evidence-runs`,encodeURIComponent(e.run)),className:`text-body-sm font-medium [overflow-wrap:anywhere]`,children:U(e.request||e.run)}),(0,H.jsxs)(`span`,{className:`font-mono text-body-sm text-muted`,children:[e.run,e.version?` · ${U(e.version)}`:``]})]}),e.causes.map(t=>(0,H.jsx)(dt,{agent:s.agent,run:e.run,c:t,candidates:e.candidates,onLinked:p},t.key)),!e.candidates.length&&(0,H.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`No run of the same request is recorded after it yet: `,(0,H.jsxs)(`code`,{children:[`forgeqe evidence replay-kit `,e.run,` H1`]}),` says what to change for a replay.`]})]},e.run))}):(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No run of this agent has an open finding.`})})]})]})}var $={observe:`Observe`,assist:`Assist`,act:`Act`,autonomous:`Autonomous`},pt={observe:`a person reviews everything it does`,assist:`a person approves each change it makes`,act:`it acts alone within its contract; people review its findings`,autonomous:`it acts alone; only alerts reach people`},mt={model:`Model`,tool:`Tool`,knowledge:`Knowledge`,check:`Check`,judge:`Judge`,trust:`Trust`},ht=[`observe`,`assist`,`act`,`autonomous`];function gt({agent:e,label:t,icon:n,tip:r,action:i,children:a,onDone:o,uid:s}){let[c,l]=(0,V.useState)(!1),[u,d]=(0,V.useState)(``),[f,p]=(0,V.useState)(``),[m,g]=(0,V.useState)(!1),[_,v]=(0,V.useState)(``),ee=u.trim().length>=10&&u.trim().length<=500&&f===e,y=async()=>{g(!0),v(``);try{await i(f,u.trim()),l(!1),d(``),p(``),o()}catch(e){v(e.message)}finally{g(!1)}};if(!c)return(0,H.jsx)(`span`,{children:(0,H.jsxs)(N,{size:`sm`,onClick:()=>l(!0),"data-tip":r,children:[(0,H.jsx)(n,{"aria-hidden":`true`}),t]})});let b=`${t}${s?`-${s}`:``}`.toLowerCase().replace(/[^a-z0-9]+/g,`-`);return(0,H.jsxs)(`div`,{className:j(le,`flex max-w-[640px] flex-col gap-2`),children:[a,(0,H.jsx)(`label`,{htmlFor:`${b}-reason`,className:`text-body-sm font-medium text-ink-2`,children:`Why? It is kept with your name and in the audit.`}),(0,H.jsx)(A,{id:`${b}-reason`,value:u,onChange:e=>d(e.target.value),rows:2,maxLength:500}),(0,H.jsxs)(`label`,{htmlFor:`${b}-confirm`,className:`text-body-sm font-medium text-ink-2`,children:[`Type `,U(e),` to confirm`]}),(0,H.jsx)(ae,{id:`${b}-confirm`,value:f,onChange:e=>p(e.target.value),autoComplete:`off`}),_&&(0,H.jsx)(B,{text:_}),(0,H.jsxs)(`span`,{className:`flex gap-2`,children:[(0,H.jsxs)(N,{size:`sm`,disabled:!ee||m,onClick:y,"data-tip":r,children:[(0,H.jsx)(n,{"aria-hidden":`true`}),m?`Keeping…`:t]}),(0,H.jsxs)(N,{size:`sm`,variant:`ghost`,onClick:()=>l(!1),children:[(0,H.jsx)(h,{"aria-hidden":`true`}),`Cancel`]})]})]})}function _t(e){return(0,H.jsxs)(H.Fragment,{children:[e.slice(0,8).map((e,t)=>(0,H.jsxs)(`span`,{children:[t?`, `:``,(0,H.jsx)(`a`,{href:E(`evidence-runs`,encodeURIComponent(e)),className:`font-mono`,children:e})]},e)),e.length>8?`, and ${e.length-8} more`:``]})}function vt({sub:e}){let t=e?C(e):``,[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),[o,c]=(0,V.useState)(0),[l,p]=(0,V.useState)(`observe`),h=()=>c(e=>e+1);(0,V.useEffect)(()=>{a(``),M.monitor(t||void 0).then(r,e=>a(e.message))},[t,o]);let g=async()=>{try{let e=await M.audit(t),n=URL.createObjectURL(new Blob([`${JSON.stringify(e,null,2)}\n`],{type:`application/json`})),r=document.createElement(`a`);r.href=n,r.download=`${t.replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^[-.]+/,``).slice(0,60)||`agent`}.audit.json`,r.click(),URL.revokeObjectURL(n)}catch(e){a(e.message)}},_=n?.agent;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Y,{id:`evidence-monitor`,children:`Monitor`}),(0,H.jsxs)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:[`Every agent evaluated, and for each: what changed since its baseline (a model, a tool, the documents it reads, a check doing worse, its contract or judge), how much autonomy its evidence supports and what a person granted it, and every decision people made about it, to export. The nightly job is `,(0,H.jsx)(`code`,{children:`forgeqe evidence drift --all`}),`.`]}),i&&(0,H.jsx)(B,{text:i}),!n&&!i&&(0,H.jsx)(X,{}),n?.problems.map(e=>(0,H.jsx)(B,{text:e},e)),n&&!n.inventory.length&&(0,H.jsx)(Z,{}),n&&n.inventory.length>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h2`,{className:`sr-only`,children:`Agents and their governance`}),(0,H.jsxs)(z,{id:`inventory`,title:`Inventory`,icon:re,n:n.inventory.length,children:[(0,H.jsx)(L,{label:`Agents evaluated`,search:!1,minWidth:760,head:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Agent`}),(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Versions`}),(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Models`}),(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Tools`}),(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Contract`}),(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Trust`}),(0,H.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Alerts`})]}),children:n.inventory.map(e=>(0,H.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,H.jsx)(`th`,{scope:`row`,className:j(`px-4 py-2`,`text-left font-medium`),children:(0,H.jsx)(`a`,{href:E(`evidence-monitor`,encodeURIComponent(e.agent)),"aria-current":e.agent===t?`page`:void 0,children:U(e.agent)})}),(0,H.jsx)(`td`,{className:j(`px-4 py-2`,`text-muted`),children:e.versions.slice(0,3).map(U).join(`, `)||`none named`}),(0,H.jsx)(`td`,{className:j(`px-4 py-2`,`text-muted [overflow-wrap:anywhere]`),children:e.models.slice(0,3).map(U).join(`, `)||`none named`}),(0,H.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:e.tools.length}),(0,H.jsx)(`td`,{className:j(`px-4 py-2`,`text-muted`),children:e.contract?e.contract.approved?`Approved`:`Not approved`:`None`}),(0,H.jsx)(`td`,{className:`px-4 py-2`,children:e.granted?`${$[e.granted]} (supports ${$[e.supported].toLowerCase()})`:`Not granted (supports ${$[e.supported].toLowerCase()})`}),(0,H.jsx)(`td`,{className:j(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,e.alerts>0&&`text-fail`),"data-sort":e.baseline||e.alerts?e.alerts:-1,children:e.baseline||e.alerts?e.alerts:(0,H.jsx)(`span`,{className:`text-muted`,children:`no baseline`})})]},e.agent))}),!t&&(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`Open an agent to see its drift, its trust and its audit.`})]}),_&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(z,{id:`drift`,title:`Drift of ${_.name}`,icon:d,n:_.drift.alerts.length,children:[_.drift.baseline?(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`Since its baseline (`,_.drift.baseline.version?U(_.drift.baseline.version):`no version`,`, `,k(_.drift.baseline.runs,`run`),`, set by `,U(_.drift.baseline.by),` `,W(_.drift.baseline.at),`): `,k(_.drift.since.length,`run`),`.`]}):(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No baseline is set: what changed cannot be said. Set one when a version is released.`}),_.drift.alerts.length>0&&(0,H.jsx)(`ul`,{"aria-label":`Drift alerts`,className:j(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 list-none`),children:_.drift.alerts.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-col gap-1 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.jsx)(F,{tone:`warn`,children:mt[e.kind]}),(0,H.jsx)(`span`,{className:`text-body-sm [overflow-wrap:anywhere]`,children:U(e.what)})]}),e.runs.length>0&&(0,H.jsxs)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:[`In `,_t(e.runs)]})]},`${e.kind}-${e.subject}`))}),_.drift.baseline&&!_.drift.alerts.length&&(0,H.jsx)(I,{className:`py-4`,children:`Nothing changed since the baseline.`}),(0,H.jsx)(gt,{agent:_.name,label:`Set baseline`,icon:u,tip:_.drift.baseline?`Set a new baseline`:`Set the baseline`,action:(e,t)=>M.baseline(_.name,e,t),onDone:h,children:(0,H.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:`The baseline becomes its latest version's runs as they are judged now: their models, tools, documents and each check's pass rate.`})})]}),(0,H.jsxs)(z,{id:`trust`,title:`Trust in ${_.name}`,icon:x,children:[(0,H.jsxs)(`p`,{className:`m-0 text-body-sm`,children:[`Its evidence supports `,(0,H.jsx)(`b`,{children:$[_.trust.supported]}),`: `,pt[_.trust.supported],`.`,` `,_.trust.granted?(0,H.jsxs)(H.Fragment,{children:[`Granted: `,(0,H.jsx)(`b`,{children:$[_.trust.granted.level]}),`, by `,U(_.trust.granted.by),` `,W(_.trust.granted.at),`: `,U(_.trust.granted.reason)]}):`No level is granted.`]}),(0,H.jsx)(`ul`,{"aria-label":`What each level needs`,className:j(`rounded-lg bg-bg p-6 shadow-sm`,`m-0 list-none`),children:_.trust.criteria.filter(e=>e.level!==`observe`).map(e=>(0,H.jsxs)(`li`,{className:`flex items-start gap-2 border-b border-line-soft px-4 py-2 text-body-sm last:border-b-0`,children:[(0,H.jsx)(fe,{icon:e.met?s:m,size:15,className:e.met?`mt-1 text-pass`:`mt-1 text-muted`}),(0,H.jsx)(`span`,{className:`w-[96px] shrink-0 font-medium`,children:$[e.level]}),(0,H.jsxs)(`span`,{className:`text-ink-2 [overflow-wrap:anywhere]`,children:[(0,H.jsx)(`span`,{className:`sr-only`,children:e.met?`Met: `:`Not met: `}),U(e.what)]})]},`${e.level}-${e.what}`))}),(0,H.jsx)(gt,{agent:_.name,label:`Grant`,icon:s,tip:`Grant a trust level`,action:(e,t)=>M.trust(_.name,l,e,t),onDone:h,children:(0,H.jsxs)(`label`,{className:`flex w-fit items-center gap-2 text-body-sm font-medium text-ink-2`,children:[`Level`,(0,H.jsx)(O,{value:l,onChange:e=>p(e.target.value),children:ht.slice(0,ht.indexOf(_.trust.supported)+1).map(e=>(0,H.jsxs)(`option`,{value:e,children:[$[e],`: `,pt[e]]},e))})]})})]}),(0,H.jsxs)(z,{id:`audit`,title:`Audit`,icon:f,children:[(0,H.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`Every decision people made about `,U(_.name),` (its contract's approval, overrules, grades, replays, proposals, release gates, baselines and trust), each with who made it, when, why, and the runs it rested on as they are recorded now.`]}),(0,H.jsx)(`span`,{children:(0,H.jsxs)(N,{size:`sm`,onClick:g,"data-tip":`Download the audit`,children:[(0,H.jsx)(D,{"aria-hidden":`true`}),`Download`]})})]})]})]})]})}function yt({page:e,sub:t}){let n=(t||``).split(`/`),r=n[0]===`agent`&&n[1]?C(n[1]):``,i=e===`evidence-runs`&&n[0]&&n[0]!==`agent`?C(n[0]):``;return(0,H.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,H.jsx)(ye,{}),(0,H.jsx)(`main`,{className:j(be,`@container flex-auto gap-4`),children:e===`evidence`?t?(0,H.jsx)(Be,{agent:C(t)},t):(0,H.jsx)(Ie,{}):e===`evidence-contracts`?(0,H.jsx)(ot,{}):e===`evidence-review`?(0,H.jsx)(Ye,{}):e===`evidence-releases`?(0,H.jsx)(it,{}):e===`evidence-learn`?(0,H.jsx)(ft,{sub:t}):e===`evidence-monitor`?(0,H.jsx)(vt,{sub:t},t||``):i?(0,H.jsx)(Ge,{id:i},i):(0,H.jsx)(Ve,{agent:r})})]})}export{yt as Evidence};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,B as n,Cn as r,Dn as i,Gn as a,H as o,N as s,Pt as c,R as l,Rt as u,Ur as d,W as f,Y as p,it as m,nr as h,or as g,p as _,qr as v,r as y,tr as b,vn as x,wt as S,zn as C,zt as w}from"./route-D9uPlFWw.js";import{D as T,Ht as E,Vt as D,q as O,rt as k}from"./preload-helper-qorOEK5q.js";import{t as A}from"./jsx-runtime-LKYXHABd.js";import{L as j}from"./palette-BsY8OLxd.js";import{F as M,N,O as ee,c as P,n as F,s as I}from"./pageBack-BoSbGSU6.js";import{It as L,Wt as R,at as z,dt as B,ot as V,qt as H,s as U,t as W}from"./frame-CNYHTG4T.js";import{r as G}from"./markdown-BhU7ng6c.js";import{G as K,W as q}from"./index-B1Q2Dlqw.js";var J=e(v(),1),Y=A(),X={API:C,"Automated tests":p,Browser:w,Data:m,Desktop:r,Mobile:g,Operations:b,"Pull requests":u,Quality:c,Release:a,Setup:h,Systems:i,"Test cases":f},Z={ready:{label:`Ready`,tone:`pass`,icon:_,color:`text-pass`},partial:{label:`Partly set up`,tone:`warn`,icon:n,color:`text-warn`},needs_setup:{label:`Needs setup`,tone:`neutral`,icon:l,color:`text-muted`}},Q={models:`Models`,integrations:`Integrations`,monitor:`Monitor`,notifications:`Notifications`,agents:`Agents`,environments:`Environments`,containers:`Containers`,databases:`Databases`},$=4;async function te(e,t){try{let{id:t}=await O.start(e,{});location.hash=y(`chats`,t)}catch(e){t(e.message)}}function ne({f:e,onScope:t,busy:n}){let[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)(``),[s,c]=(0,J.useState)(``);(0,J.useEffect)(()=>{k.detail(e.id).then(i,e=>o(e.message))},[e.id]);let l=e.gaps.filter(e=>!e.optional),u=e.gaps.filter(e=>e.optional);return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 py-4`,children:[(0,Y.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:e.summary}),[[l,`Needs`],[u,`Would do more with`]].map(([e,t])=>e.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-body-sm font-medium`,children:t}),(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.map((e,n)=>(0,Y.jsxs)(`li`,{className:D(ee,`flex flex-col gap-1 text-body-sm`),children:[(0,Y.jsx)(`span`,{className:D(t===`Needs`?`text-ink`:`text-ink-2`),children:e.missing}),(0,Y.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.fix}),e.settings&&(0,Y.jsxs)(`a`,{href:y(`settings`,e.settings),className:`inline-flex items-center gap-1 self-start text-body-sm font-medium`,children:[(0,Y.jsx)(h,{size:13,"aria-hidden":`true`}),`Set it up in Settings, `,Q[e.settings]||e.settings]})]},n))})]},t):null),e.inputs.length>0&&(0,Y.jsxs)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:[`From your request: `,e.inputs.join(`; `),`.`]}),a&&(0,Y.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:a}),r&&(0,Y.jsxs)(Y.Fragment,{children:[r.examples.length>0&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-body-sm font-medium`,children:`Ask for it like this`}),(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.examples.slice(0,4).map(t=>(0,Y.jsxs)(N,{size:`sm`,disabled:e.state===`needs_setup`,"data-tip":e.state===`needs_setup`?`Set it up first`:`Start a chat with this request`,onClick:()=>void te(t,c),className:`h-auto min-h-8 max-w-full py-2 text-left whitespace-normal`,children:[(0,Y.jsx)(x,{"aria-hidden":`true`}),t]},t))}),s&&(0,Y.jsx)(`span`,{className:`text-body-sm text-fail`,children:s})]}),r.limits.length>0&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`text-body-sm font-medium`,children:`What it does not do`}),(0,Y.jsx)(`ul`,{className:`m-0 list-disc pl-6 text-body-sm text-ink-2`,children:r.limits.map(e=>(0,Y.jsx)(`li`,{children:e},e))})]}),r.docs.length>0&&(0,Y.jsxs)(`details`,{children:[(0,Y.jsxs)(`summary`,{className:`cursor-pointer text-body-sm font-medium`,children:[`How it works (`,E(r.docs.length,`section`),`)`]}),(0,Y.jsx)(`div`,{className:`mt-2 flex flex-col gap-4`,children:r.docs.map(e=>(0,Y.jsxs)(`section`,{className:`rounded-lg bg-bg p-6 shadow-sm`,children:[(0,Y.jsx)(`h4`,{className:`m-0 mb-1 text-body-sm font-medium`,children:e.heading}),(0,Y.jsx)(G,{text:e.text,className:`text-body-sm`})]},e.heading))})]}),(0,Y.jsxs)(`span`,{className:`font-mono text-body-sm text-muted [overflow-wrap:anywhere]`,children:[`Tools: `,r.tools.join(`, `)]})]}),(0,Y.jsxs)(`label`,{className:`flex flex-wrap items-center gap-4 pt-4 text-body-sm`,children:[(0,Y.jsxs)(`span`,{className:`flex-[1_1_240px]`,children:[`The agent gets its tools`,(0,Y.jsx)(`span`,{className:`block text-body-sm text-muted`,children:`agent.capabilities in forgeqe.yaml`})]}),(0,Y.jsxs)(T,{value:e.scope,disabled:n,onChange:e=>t(e.target.value),className:`w-[240px]`,children:[(0,Y.jsx)(`option`,{value:`auto`,children:`When a request is about it`}),(0,Y.jsx)(`option`,{value:`always`,children:`Always`}),(0,Y.jsx)(`option`,{value:`off`,children:`Never, in this project`})]})]})]})}function re({embedded:e=!1}={}){let[n,r]=(0,J.useState)(null),[i,a]=(0,J.useState)(``),[c,l]=(0,J.useState)(``),[u,f]=(0,J.useState)(`all`),[p,m]=(0,J.useState)(``),[h,g]=(0,J.useState)(!1),[_,v]=(0,J.useState)([]),[y,b]=(0,J.useState)(!1),x=(0,J.useCallback)(()=>k.view().then(r,e=>a(e.message)),[]);(0,J.useEffect)(()=>void x(),[x]);let C=(0,J.useMemo)(()=>{let e=p.toLowerCase().split(/\s+/).filter(Boolean);return(n?.areas||[]).map(t=>({...t,features:t.features.filter(n=>(u===`all`||(u===`ready`?n.state!==`needs_setup`:n.state!==`ready`))&&e.every(e=>`${n.title} ${n.summary} ${t.area}`.toLowerCase().includes(e)))})).filter(e=>e.features.length)},[n,u,p]),w=async(e,t)=>{g(!0);try{r(await k.scope(e,t)),a(``)}catch(e){a(e.message)}finally{g(!1)}},T=n?.counts,E=n?.areas.flatMap(e=>e.features).find(e=>e.id===c),O=(0,Y.jsxs)(Y.Fragment,{children:[i&&(0,Y.jsx)(`p`,{role:`alert`,className:D(M.fail,`m-0`),children:i}),!n&&!i&&(0,Y.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`}),n&&T&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(V,{label:`Features`,children:[(0,Y.jsx)(z,{icon:Z.ready.icon,label:`Ready`,value:String(T.ready)}),(0,Y.jsx)(z,{icon:Z.partial.icon,label:`Partly set up`,value:String(T.partial)}),(0,Y.jsx)(z,{icon:Z.needs_setup.icon,label:`Need setup`,value:String(T.needs_setup)})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(B,{label:`Show`,value:u,onChange:f,options:[{id:`all`,label:`All`},{id:`needs`,label:`Needs setup`},{id:`ready`,label:`Ready`}]}),(0,Y.jsx)(I,{id:`find-a-feature`,label:`Find a feature`,value:p,onChange:m})]}),C.length===0&&(0,Y.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`Nothing matches.`}),(0,Y.jsx)(`div`,{className:`@container`,children:(0,Y.jsx)(`div`,{className:`grid auto-rows-fr grid-cols-1 items-stretch gap-4 @2xl:grid-cols-2 @5xl:grid-cols-3`,children:C.map((e,n)=>{let r=u!==`all`||p.trim()!==``||_.includes(e.area),i=r?e.features:e.features.slice(0,$),a=e.features.length-$,o=`area-list-${n}`;return(0,Y.jsxs)(`section`,{"aria-labelledby":`area-${n}`,className:D(`rounded-lg bg-bg p-6 shadow-sm`,`@container/col flex min-w-0 flex-col`),children:[(0,Y.jsx)(K,{id:`area-${n}`,icon:X[e.area]||S,title:e.area,n:e.features.length,className:`px-2 pt-2 pb-4`}),(0,Y.jsx)(`ul`,{id:o,className:`m-0 flex list-none flex-col gap-1 p-0`,children:i.map(e=>{let t=Z[e.state];return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>l(e.id),className:D(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`gap-2`),children:[(0,Y.jsx)(t.icon,{size:16,"aria-hidden":`true`,className:D(`flex-none`,t.color)}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1`,children:e.title}),(0,Y.jsxs)(`span`,{className:`sr-only`,children:[`, `,t.label]}),e.scope!==`auto`&&(0,Y.jsx)(`span`,{className:`flex-none text-body-sm text-muted`,children:e.scope===`always`?`Always given`:`Off here`}),(0,Y.jsx)(`span`,{className:`flex-none text-body-sm font-medium text-accent`,children:`More`})]})},e.id)})}),a>0&&u===`all`&&!p.trim()&&(0,Y.jsxs)(N,{variant:`ghost`,size:`sm`,"aria-expanded":r,"aria-controls":o,onClick:()=>v(r?_.filter(t=>t!==e.area):[..._,e.area]),"data-tip":r?`Fewer features`:`More features (${a})`,className:`mt-auto w-full justify-center gap-2 text-muted`,children:[r?(0,Y.jsx)(s,{"aria-hidden":`true`}):(0,Y.jsx)(t,{"aria-hidden":`true`}),r?`Less`:`More (${a})`]})]},e.area)})})}),(0,Y.jsx)(H,{open:!!E,wide:!0,onClose:()=>l(``),title:E?.title||``,description:E&&(0,Y.jsx)(P,{tone:Z[E.state].tone,icon:E.state!==`needs_setup`,children:Z[E.state].label}),footer:(0,Y.jsxs)(N,{onClick:()=>l(``),children:[(0,Y.jsx)(d,{"aria-hidden":`true`}),`Close`]}),children:E&&(0,Y.jsx)(ne,{f:E,busy:h,onScope:e=>void w(E.id,e)})}),n.outOfScope.length>0&&(0,Y.jsx)(q,{icon:o,title:`Not what ForgeQE does`,n:n.outOfScope.length,actions:(0,Y.jsxs)(N,{size:`sm`,variant:`ghost`,"aria-expanded":y,"aria-controls":`out-of-scope`,onClick:()=>b(!y),children:[y?(0,Y.jsx)(s,{"aria-hidden":`true`}):(0,Y.jsx)(t,{"aria-hidden":`true`}),y?`Hide`:`Show`]}),children:(0,Y.jsx)(R,{open:y,id:`out-of-scope`,children:(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm`,children:n.outOfScope.map(e=>(0,Y.jsxs)(`li`,{children:[e.what,e.instead?(0,Y.jsxs)(`span`,{className:`text-muted`,children:[`; instead: `,e.instead]}):null]},e.what))})})})]})]});return e?(0,Y.jsx)(`div`,{className:`flex flex-col gap-6`,children:O}):(0,Y.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,Y.jsx)(U,{}),(0,Y.jsxs)(`main`,{className:D(W,`flex-auto gap-6`),children:[(0,Y.jsx)(F,{}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Y.jsx)(L,{pixel:j.features,size:`lg`}),(0,Y.jsx)(`h1`,{className:`m-0 flex-1 text-headline-lg`,children:`What's ready`})]}),(0,Y.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:`What ForgeQE can do here. Pick one to see what it needs.`}),O]})]})}export{re as Features};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Dr as t,Hr as n,Kn as r,L as ee,U as i,Ur as a,ir as o,qr as s,r as c,u as l}from"./route-D9uPlFWw.js";import{E as te,Vt as u,ot as d,vt as f}from"./preload-helper-qorOEK5q.js";import{t as p}from"./jsx-runtime-LKYXHABd.js";import{L as m}from"./palette-BsY8OLxd.js";import{F as ne,N as h,P as re,i as g,l as _,n as v}from"./pageBack-BoSbGSU6.js";import{It as y,ht as b,lt as x,s as S,t as C}from"./frame-CNYHTG4T.js";import{N as w,U as T}from"./index-B1Q2Dlqw.js";import{o as E}from"./qualityParts-ClGKtjEv.js";var D=e(s(),1),O=p(),k={timing:`Timing`,locator:`Locator`,overlay:`Overlay`,data:`Data`,network:`Network`,environment:`Environment`,unknown:`No pattern`};function A(e,t,n){return e.filter(e=>(t===`all`||t===`flaky`&&(e.flaky||e.quarantined)||t===`quarantined`&&e.quarantined||t===`release`&&e.releasable)&&(n===`all`||e.cause===n))}var j=e=>e>=60?`${(e/60).toFixed(1)}m`:`${e.toFixed(+(e<10))}s`;function ie({trail:e}){return(0,O.jsx)(`span`,{className:`font-mono text-body-sm tracking-[0.08em]`,"aria-label":`Last results, oldest first: ${e}`,children:[...e].map((e,t)=>(0,O.jsx)(`span`,{className:e===`✓`?`text-pass`:e===`✗`?`text-fail`:e===`↻`?`text-warn`:`text-muted`,children:e},t))})}function M(){let[e,s]=(0,D.useState)(null),[p,M]=(0,D.useState)(``),[N,ae]=(0,D.useState)(`flaky`),[P,F]=(0,D.useState)(`all`),[I,L]=(0,D.useState)(new Set),[R,z]=(0,D.useState)(null),[B,V]=(0,D.useState)(``),[H,U]=(0,D.useState)(!1),[W,G]=(0,D.useState)(``),K=(0,D.useCallback)(()=>{d.view().then(e=>{s(e),M(``)},e=>M(e.message))},[]);(0,D.useEffect)(K,[K]);let q=e?.tests??[],oe=A(q,N,P),J=q.filter(e=>e.flaky&&!e.quarantined).length,se=q.filter(e=>e.quarantined).length,Y=q.filter(e=>e.releasable).length,X=Object.keys(k).filter(t=>e?.causes[t]),Z=X.sort((t,n)=>(e.causes[n]??0)-(e.causes[t]??0))[0],Q=q.filter(e=>I.has(e.name)),ce=Q.some(e=>!e.quarantined),le=Q.some(e=>e.quarantined),$=(e,t)=>{let n=new Set(I);t?n.add(e):n.delete(e),L(n)},ue=async()=>{if(!R)return;let e=R===`release`,t=Q.filter(t=>e?t.quarantined:!t.quarantined).map(e=>e.name);U(!0);try{s(await d.quarantine(t,e,B.trim()||void 0)),G(`${t.length} test${t.length===1?``:`s`} ${e?`released from`:`put in`} quarantine.`),L(new Set),z(null),V(``)}catch(e){G(e.message)}finally{U(!1)}},de=async e=>{let t=e.healIn[0];if(t){U(!0);try{await f.heal(t,[e.name]),location.hash=c(`regression`,encodeURIComponent(t))}catch(e){G(e.message),U(!1)}}};return(0,O.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,O.jsx)(S,{}),(0,O.jsxs)(`main`,{className:u(C,`@container flex-auto gap-4`),children:[(0,O.jsx)(v,{}),(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,O.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,O.jsx)(y,{pixel:m.flaky,size:`lg`}),(0,O.jsx)(`h1`,{className:`m-0 text-headline-lg`,children:`Flaky tests`})]}),(0,O.jsx)(x,{label:`Runs and reports`,links:w,current:`flaky`})]}),(0,O.jsxs)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:[`Each automated test of `,e?.repo&&e.repo!==`.`?(0,O.jsx)(`code`,{className:`font-mono text-body-sm`,children:e.repo}):`the test repository`,` scored from its last 20 results: flips between passing and failing, passes on a retry, and how much its run time varies. A test counts as flaky from a score of `,e?.flakyAfter??2,` (flaky.flaky_after). Quarantine changes no test code: the test still runs, but its failure does not fail the run. Heal sends a test the last `,(0,O.jsx)(`a`,{href:c(`regression`),children:`Regression`}),` run sent to healing.`]}),p&&(0,O.jsx)(`p`,{role:`alert`,className:u(ne.fail,`m-0`),children:p}),!e&&!p&&(0,O.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`}),e&&!q.length&&(0,O.jsx)(_,{icon:t,title:`No test history yet`,action:(0,O.jsxs)(`a`,{className:re({size:`sm`}),href:c(`regression`),"data-tip":`Open Regression`,children:[(0,O.jsx)(l,{"aria-hidden":`true`}),`Regression`]}),children:`ForgeQE keeps each automated test's results in .forgeqe/test-history.json whenever it runs the repository's tests: run a regression pack, or ask in a chat to run the tests, and their history shows here.`}),e&&q.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-5 @xl:divide-x @xl:divide-line-soft`,children:[(0,O.jsx)(E,{label:`Tests tracked`,value:q.length,sub:`with a history`}),(0,O.jsx)(E,{label:`Flaky`,value:J,tone:J?`text-warn`:`text-pass`,sub:`not in quarantine`}),(0,O.jsx)(E,{label:`In quarantine`,value:se,sub:`still run, not counted`}),(0,O.jsx)(E,{label:`Ready to release`,value:Y,tone:Y?`text-pass`:void 0,sub:`5 clean runs in a row`}),(0,O.jsx)(E,{label:`Most common cause`,value:Z?k[Z]:`–`,sub:Z?`${e.causes[Z]} test${e.causes[Z]===1?``:`s`}`:`nothing flaky`})]}),X.length>0&&(0,O.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,O.jsx)(`span`,{className:`text-body-sm font-medium`,children:`Likely cause`}),(0,O.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,O.jsx)(g,{items:[{id:`all`,label:`All causes`},...X.map(t=>({id:t,label:k[t],n:e.causes[t]}))],value:P,onChange:F})}),P!==`all`&&(0,O.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:e.causeText[P]})]}),W&&(0,O.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-ink-2`,children:W}),(0,O.jsx)(b,{label:`Tests`,placeholder:`Find a test by name`,resetKey:`${N}-${P}`,empty:`Nothing matches.`,height:`max(320px, calc(var(--screen) - 288px))`,selection:{count:Q.length,onClear:()=>{L(new Set),z(null)},actions:R?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`text-body-sm`,children:[R===`release`?`Release`:`Quarantine`,` `,Q.filter(e=>R===`release`?e.quarantined:!e.quarantined).length,` test(s)?`]}),R===`quarantine`&&(0,O.jsx)(te,{size:`sm`,"aria-label":`Reason`,placeholder:`Reason (optional)`,value:B,maxLength:200,onChange:e=>V(e.target.value),className:`w-full max-w-[320px] flex-[0_1_320px]`}),(0,O.jsxs)(h,{size:`sm`,disabled:H,onClick:()=>void ue(),children:[R===`release`?(0,O.jsx)(r,{"aria-hidden":`true`}):(0,O.jsx)(o,{"aria-hidden":`true`}),R===`release`?`Release`:`Quarantine`]}),(0,O.jsxs)(h,{size:`sm`,variant:`ghost`,disabled:H,onClick:()=>z(null),children:[(0,O.jsx)(a,{"aria-hidden":`true`}),`Cancel`]})]}):(0,O.jsxs)(O.Fragment,{children:[ce&&(0,O.jsxs)(h,{size:`sm`,onClick:()=>z(`quarantine`),children:[(0,O.jsx)(o,{"aria-hidden":`true`}),`Quarantine`]}),le&&(0,O.jsxs)(h,{size:`sm`,onClick:()=>z(`release`),"data-tip":`Release from quarantine`,children:[(0,O.jsx)(r,{"aria-hidden":`true`}),`Release`]})]})},tools:(0,O.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,O.jsx)(g,{items:[{id:`flaky`,label:`Flaky`,n:A(q,`flaky`,P).length,alert:!0},{id:`quarantined`,label:`In quarantine`,n:A(q,`quarantined`,P).length},{id:`release`,label:`Ready to release`,n:A(q,`release`,P).length},{id:`all`,label:`All`,n:A(q,`all`,P).length}],value:N,onChange:ae})}),head:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`th`,{scope:`col`,className:u(`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,`w-8`),children:(0,O.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,O.jsx)(`th`,{scope:`col`,className:u(`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,`w-[38%]`),children:`Test`}),(0,O.jsx)(`th`,{scope:`col`,className:u(`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,`hidden @xl:table-cell`),children:`Last results`}),(0,O.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Passed`}),(0,O.jsx)(`th`,{scope:`col`,className:u(`px-4 py-2 text-right text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,`hidden @2xl:table-cell`),children:`Flips`}),(0,O.jsx)(`th`,{scope:`col`,className:u(`px-4 py-2 text-right text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,`hidden @2xl:table-cell`),children:`Retry passes`}),(0,O.jsx)(`th`,{scope:`col`,className:u(`px-4 py-2 text-right text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,`hidden @3xl:table-cell`),children:`Run time`}),(0,O.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:`Cause`}),(0,O.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium tracking-wide whitespace-nowrap text-muted uppercase`,children:(0,O.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:oe.map(r=>{let a=r.quarantined?o:r.flaky?t:r.passRate===1?ee:i,s=r.quarantined?r.releasable?`In quarantine, ready to release`:`In quarantine`:r.flaky?`Flaky`:r.passRate===1?`Steady`:`Failing`;return(0,O.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,"data-state":I.has(r.name)?`selected`:void 0,children:[(0,O.jsx)(`td`,{className:`px-4 py-2`,children:(0,O.jsx)(T,{"aria-label":`Pick ${r.name}`,checked:I.has(r.name),onCheckedChange:e=>$(r.name,e)})}),(0,O.jsx)(`td`,{className:u(`px-4 py-2`,`max-w-0`),children:(0,O.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(a,{size:15,"aria-label":s,className:u(`flex-none`,r.quarantined?`text-muted`:r.flaky?`text-warn`:r.passRate===1?`text-pass`:`text-fail`)}),(0,O.jsx)(`span`,{"data-tip":r.quarantined?`${r.name} · quarantined: ${r.quarantined.reason}`:r.name,className:`truncate`,children:r.name})]})}),(0,O.jsx)(`td`,{className:u(`px-4 py-2`,`hidden @xl:table-cell`),"data-sort":r.trail.length?[...r.trail].filter(e=>e===`✓`).length/[...r.trail].length:-1,children:(0,O.jsx)(ie,{trail:r.trail})}),(0,O.jsxs)(`td`,{className:u(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,r.passRate<.8?`text-fail`:`text-muted`),children:[Math.round(r.passRate*100),`%`]}),(0,O.jsx)(`td`,{className:u(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,`hidden @2xl:table-cell`,r.flips?`text-warn`:`text-muted`),children:r.flips}),(0,O.jsx)(`td`,{className:u(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,`hidden @2xl:table-cell`,r.retryPasses?`text-warn`:`text-muted`),children:r.retryPasses}),(0,O.jsx)(`td`,{className:u(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,`hidden @3xl:table-cell`,r.timing&&r.timing.spread>1?`text-warn`:`text-muted`),"data-sort":r.timing?r.timing.median:-1,"data-tip":r.timing?`fastest ${j(r.timing.min)}, slowest ${j(r.timing.max)}`:void 0,children:r.timing?`${j(r.timing.median)} ±${Math.round(r.timing.spread*50)}%`:`–`}),(0,O.jsx)(`td`,{className:u(`px-4 py-2`,`whitespace-nowrap text-body-sm`),"data-tip":r.example?`${e.causeText[r.cause]} · e.g. ${r.example}`:e.causeText[r.cause],children:r.flaky||r.quarantined||r.passRate<1?k[r.cause]:`–`}),(0,O.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:r.healIn.length>0&&(0,O.jsx)(h,{variant:`icon`,size:`icon-sm`,disabled:H,onClick:()=>void de(r),"aria-label":`Heal ${r.name} with forgeqe pack heal in pack ${r.healIn[0]}`,"data-tip":`Heal ${r.name} with forgeqe pack heal in pack ${r.healIn[0]}`,children:(0,O.jsx)(n,{"aria-hidden":`true`})})})]},r.name)})})]})]})]})}export{k as CAUSE_LABEL,M as Flaky,A as shown};
|