@capagents/forgeqe 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HOW_TO_USE.md +8 -7
- package/dist/docs-site/docs/get-started/index.html +8 -7
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/forgeqe.js +1731 -1731
- package/dist/web/assets/{3d-force-graph-ByL874l5.js → 3d-force-graph-CTC0tr_c.js} +1 -1
- package/dist/web/assets/{Agent-Drs4mcil.js → Agent-wRS-AWzy.js} +1 -1
- package/dist/web/assets/{AgentWork-DLcCZTgu.js → AgentWork-GXWfoD_Z.js} +1 -1
- package/dist/web/assets/{ApiTests-BcrTspwJ.js → ApiTests-BH_mbOVX.js} +1 -1
- package/dist/web/assets/{Browse-D9eaDrZT.js → Browse-B5RXYaB5.js} +1 -1
- package/dist/web/assets/{Chat-CMNf9-ys.js → Chat-CVF0hHdk.js} +1 -1
- package/dist/web/assets/{CommandPalette-Bcf1Muan.js → CommandPalette-BipNmH6a.js} +1 -1
- package/dist/web/assets/{Compare-V5xKnwGO.js → Compare-FHtKxtLJ.js} +1 -1
- package/dist/web/assets/{Cost-DC3DYthD.js → Cost-BDwt86M-.js} +1 -1
- package/dist/web/assets/{Data-DzrP-MdL.js → Data-Ctg96el3.js} +1 -1
- package/dist/web/assets/{Desktop-DjTq9eAr.js → Desktop-B2k0qH7c.js} +1 -1
- package/dist/web/assets/{DesktopReview-Buecn3n5.js → DesktopReview-CE65JglI.js} +1 -1
- package/dist/web/assets/{Evidence-D6VvlFNK.js → Evidence-D_90W10z.js} +1 -1
- package/dist/web/assets/{Explore-YkonRPmA.js → Explore-CD7Mq4il.js} +1 -1
- package/dist/web/assets/{Features-BKB4iSRj.js → Features-CLHC2bGL.js} +1 -1
- package/dist/web/assets/{Flags-4GGW38Xu.js → Flags-FpR9O_13.js} +1 -1
- package/dist/web/assets/{Flaky-BRcLjYrP.js → Flaky-Bzt9VcYv.js} +1 -1
- package/dist/web/assets/{Impact-CvuahLDQ.js → Impact-BC8w7uQ5.js} +1 -1
- package/dist/web/assets/{Jobs-DBCw8Z8I.js → Jobs-DeBncFIN.js} +1 -1
- package/dist/web/assets/{KindPage-Ige-qO2t.js → KindPage-CJcRnrTe.js} +1 -1
- package/dist/web/assets/{LiveDevice-DI7Bq6ag.js → LiveDevice-BP47IrPa.js} +1 -1
- package/dist/web/assets/{Migration-CEwXGs4c.js → Migration-BaVfcEYa.js} +1 -1
- package/dist/web/assets/{Mobile-BqyFTBeG.js → Mobile-CLoZlBuq.js} +1 -1
- package/dist/web/assets/{Observability-B2Y1pHpD.js → Observability-CaRIhlKg.js} +1 -1
- package/dist/web/assets/{PageAgent-BRhWi7LL.js → PageAgent-C_oSStNT.js} +1 -1
- package/dist/web/assets/{Product-CXIbmmMF.js → Product-BdY0j-z8.js} +3 -3
- package/dist/web/assets/{Production-BOy7ew7l.js → Production-BhDff1v6.js} +1 -1
- package/dist/web/assets/{Quality-Dtcq2AWE.js → Quality-EATW3zGE.js} +1 -1
- package/dist/web/assets/{Readiness-B53Drc7i.js → Readiness-D4nY3Nr1.js} +1 -1
- package/dist/web/assets/{Record-BuCIDb1d.js → Record-CIf6M72U.js} +1 -1
- package/dist/web/assets/{Regression-BpPXCQIv.js → Regression-DhNAgDgD.js} +1 -1
- package/dist/web/assets/{Reports-CWCa9uof.js → Reports-D4-y2w-2.js} +1 -1
- package/dist/web/assets/{Response-C6EmnnQz.js → Response-CpHrRtzJ.js} +1 -1
- package/dist/web/assets/{Responsive-Bl6i7kB3.js → Responsive-DljiUZXJ.js} +1 -1
- package/dist/web/assets/{RunDiff-CWf9Bkmu.js → RunDiff-DjUiMBsq.js} +1 -1
- package/dist/web/assets/{Runs-C0tfrB_j.js → Runs-DC0tJWvX.js} +1 -1
- package/dist/web/assets/{Settings-tgCcBEwu.js → Settings-CD1RbHXf.js} +4 -4
- package/dist/web/assets/{Steps-xASPoq1N.js → Steps-DG1WYfYK.js} +1 -1
- package/dist/web/assets/{TestCases-Cm4KwWIP.js → TestCases-BfZzshUI.js} +1 -1
- package/dist/web/assets/{TestData-DMV5S00V.js → TestData-BoyXYHtp.js} +1 -1
- package/dist/web/assets/{TestDebt-D54mt0ZT.js → TestDebt-CX1XT-CA.js} +1 -1
- package/dist/web/assets/{TestManagement-DBFlK8Xe.js → TestManagement-BTdMN3Bl.js} +1 -1
- package/dist/web/assets/{WhatsNew-Dp-zP-jw.js → WhatsNew-ZorWOqDL.js} +1 -1
- package/dist/web/assets/{dataParts-BPff7ClX.js → dataParts-CeMHTXLx.js} +1 -1
- package/dist/web/assets/{highlight-DCCKhwHj.js → highlight-Cd5aQvev.js} +1 -1
- package/dist/web/assets/{index-BsAaOk_G.js → index-F95avSUY.js} +5 -5
- package/dist/web/assets/{paletteCommands-C3knXWbA.js → paletteCommands-DferMQDH.js} +1 -1
- package/dist/web/assets/{productParts-CrAb3-j0.js → productParts-PERPm-xD.js} +1 -1
- package/dist/web/assets/{qualityParts-BQTnBwPs.js → qualityParts-BRZOCiQs.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/user-guide.html +28 -15
- package/package.json +1 -1
- package/py/forgeqe_engine/copilot_gateway.py +8 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Ct as n,Et as r,Gn as i,H as a,Hr as o,I as s,J as c,Kr as l,L as u,Ln as d,M as f,N as p,Pt as m,S as h,Tr as g,Tt as _,Un as v,Vr as y,Xn as b,Xt as x,Zn as S,_ as C,_n as w,dn as T,dt as E,fr as D,ft as O,in as k,lr as ee,m as te,n as ne,pr as A,r as j,sr as re,tn as ie,w as ae,xt as oe,yr as se,zt as ce}from"./route-D8G-pTdk.js";import{f as le}from"./agents-DPabR9dS.js";import{t as ue}from"./jsx-runtime-LKYXHABd.js";import{A as M,At as de,Z as fe,i as pe,j as N,n as me}from"./input-BmJ7dt1C.js";import{D as he,E as ge,S as _e,a as ve,c as P,i as ye,l as be,n as xe,s as Se,t as Ce,w as F}from"./pageBack-BNLSF2VR.js";import{L as we}from"./palette-BS9ixqiJ.js";import{$ as Te,$t as Ee,C as De,Cn as Oe,F as ke,Fn as Ae,Ft as je,In as Me,It as Ne,Ln as Pe,Lt as Fe,Pt as I,Qt as Ie,S as L,X as Le,Xt as Re,Yt as ze,dt as Be,ft as R,x as z,z as Ve}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Ct as n,Et as r,Gn as i,H as a,Hr as o,I as s,J as c,Kr as l,L as u,Ln as d,M as f,N as p,Pt as m,S as h,Tr as g,Tt as _,Un as v,Vr as y,Xn as b,Xt as x,Zn as S,_ as C,_n as w,dn as T,dt as E,fr as D,ft as O,in as k,lr as ee,m as te,n as ne,pr as A,r as j,sr as re,tn as ie,w as ae,xt as oe,yr as se,zt as ce}from"./route-D8G-pTdk.js";import{f as le}from"./agents-DPabR9dS.js";import{t as ue}from"./jsx-runtime-LKYXHABd.js";import{A as M,At as de,Z as fe,i as pe,j as N,n as me}from"./input-BmJ7dt1C.js";import{D as he,E as ge,S as _e,a as ve,c as P,i as ye,l as be,n as xe,s as Se,t as Ce,w as F}from"./pageBack-BNLSF2VR.js";import{L as we}from"./palette-BS9ixqiJ.js";import{$ as Te,$t as Ee,C as De,Cn as Oe,F as ke,Fn as Ae,Ft as je,In as Me,It as Ne,Ln as Pe,Lt as Fe,Pt as I,Qt as Ie,S as L,X as Le,Xt as Re,Yt as ze,dt as Be,ft as R,x as z,z as Ve}from"./index-F95avSUY.js";import{r as He,t as Ue}from"./Response-CpHrRtzJ.js";import{n as We}from"./families-CrnKBjis.js";var B=e(l(),1),V=ue(),H={execution:`Execution`,report:`Report`,coding:`Coding`,chat:`Chat`},Ge={execution:_,report:E,coding:c,chat:w};function Ke({kind:e}){let t=Ge[e];return(0,V.jsx)(F,{icon:t,size:14,className:`flex-none text-muted`})}var qe={passed:{label:`Passed`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},error:{label:`Error`,tone:`fail`},skipped:{label:`Skipped`,tone:`neutral`},stopped:{label:`Stopped`,tone:`neutral`},blocked:{label:`Blocked`,tone:`warn`}},U=e=>qe[e]||{label:e?e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g,` `):`–`,tone:`neutral`},Je={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`App run`},Ye=e=>{if(!e)return``;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`};function W({title:e,icon:t,children:n,aside:r,className:i}){return(0,V.jsx)(Ie,{level:3,icon:t,title:e,actions:r,className:M(`border-t border-line-soft pt-6`,i),children:n})}function Xe({path:e,label:t=`Report`}){let[n,r]=(0,B.useState)(``);return(0,V.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(ge,{"data-tip":`Open the report`,onClick:async()=>r(await _e(e)),children:[(0,V.jsx)(O,{"aria-hidden":`true`}),t]}),n&&(0,V.jsx)(`span`,{className:`text-[13px] text-fail`,children:n})]})}function Ze({items:e,first:n,render:r}){let[i,a]=(0,B.useState)(!1);return(0,V.jsxs)(V.Fragment,{children:[(i?e:e.slice(0,n)).map(r),e.length>n&&(0,V.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(!i),className:`inline-flex min-h-8 cursor-pointer items-center gap-1 self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:[i?(0,V.jsx)(p,{size:14,"aria-hidden":`true`}):(0,V.jsx)(t,{size:14,"aria-hidden":`true`}),i?`Less`:`All (${e.length})`]})]})}function Qe({c:e}){if(!e.total)return null;let t=t=>`${t/e.total*100}%`;return(0,V.jsxs)(`div`,{role:`img`,"aria-label":`${e.passed} passed, ${e.failed} failed, ${e.other} other, of ${e.total}`,className:`flex h-2 overflow-hidden rounded-full bg-surface-strong`,children:[(0,V.jsx)(`div`,{className:`bg-pass transition-[width] duration-200 ease-out`,style:{width:t(e.passed)}}),(0,V.jsx)(`div`,{className:`bg-fail transition-[width] duration-200 ease-out`,style:{width:t(e.failed)}}),(0,V.jsx)(`div`,{className:`bg-warn transition-[width] duration-200 ease-out`,style:{width:t(e.other)}})]})}function $e({e}){let t=e.counts.total?Math.round(e.counts.passed/e.counts.total*100):0;return(0,V.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-line-soft pt-4 first:border-t-0 first:pt-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,V.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:[Je[e.scope]||e.scope,Ye(e.ms),e.tokens?`${R(e.tokens)} tokens`:``,e.stopped?`stopped early`:``].filter(Boolean).join(` · `)})]}),e.report&&(0,V.jsx)(Xe,{path:e.report})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,V.jsxs)(`span`,{className:`text-[20px] font-semibold tabular-nums`,children:[t,`%`]}),(0,V.jsx)(`span`,{className:`text-muted`,children:`passed`}),(0,V.jsxs)(P,{tone:`pass`,children:[e.counts.passed,` passed`]}),e.counts.failed>0&&(0,V.jsxs)(P,{tone:`fail`,children:[e.counts.failed,` failed`]}),e.counts.other>0&&(0,V.jsxs)(P,{tone:`warn`,children:[e.counts.other,` other`]}),(0,V.jsxs)(`span`,{className:`text-muted`,children:[`of `,e.counts.total]})]}),(0,V.jsx)(Qe,{c:e.counts}),e.cases.length>0&&(0,V.jsx)(`ul`,{"aria-label":`Cases of ${e.title}`,className:`m-0 flex list-none flex-col p-0`,children:(0,V.jsx)(Ze,{items:e.cases.toSorted((e,t)=>Number(U(t.status).tone===`fail`)-Number(U(e.status).tone===`fail`)),first:6,render:(e,t)=>(0,V.jsxs)(`li`,{className:`flex min-w-0 items-start gap-4 border-t border-line-soft py-2 text-sm`,children:[(0,V.jsx)(`span`,{className:`w-[76px] flex-none`,children:(0,V.jsx)(P,{tone:U(e.status).tone,children:U(e.status).label})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,V.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[e.id&&(0,V.jsx)(`span`,{className:`mr-2 font-mono text-[13px] text-muted`,children:e.id}),e.title,e.device&&(0,V.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.device]})]}),e.summary&&(0,V.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted`,children:e.summary})]}),(0,V.jsx)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:Ye(e.ms)})]},`${e.id}-${t}`)})}),e.folder&&!e.report&&(0,V.jsxs)(`span`,{className:`text-sm`,children:[`Kept in `,(0,V.jsx)(z,{path:e.folder})]})]})}function et({list:e,className:t}){let n=e.reduce((e,t)=>({total:e.total+t.counts.total,passed:e.passed+t.counts.passed,failed:e.failed+t.counts.failed}),{total:0,passed:0,failed:0});return(0,V.jsx)(W,{...t?{className:t}:{},title:`Execution summary`,icon:_,aside:e.length>1?(0,V.jsxs)(`span`,{className:`text-sm text-muted`,children:[N(e.length,`run`),` · `,n.passed,` of `,n.total,` passed`]}):void 0,children:e.length?e.map((e,t)=>(0,V.jsx)($e,{e},`${e.folder||e.title}-${t}`)):(0,V.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No results found for this run yet: they appear once its report is written.`})})}function tt({list:e,className:t}){return(0,V.jsxs)(W,{...t?{className:t}:{},title:`Report summary`,icon:E,children:[e.length===0&&(0,V.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No report was written in this run.`}),e.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-line-soft pt-4 first:border-t-0 first:pt-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,V.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.builtAt?`Written ${new Date(e.builtAt).toLocaleString([],{dateStyle:`medium`,timeStyle:`short`})}`:e.path?``:`Its page is not there any more`})]}),e.path&&(0,V.jsx)(Xe,{path:e.path})]}),e.stats&&(0,V.jsx)(`dl`,{className:`m-0 grid grid-cols-[repeat(auto-fit,minmax(110px,1fr))] gap-2`,children:e.stats.map(e=>(0,V.jsxs)(`div`,{className:`rounded-[10px] bg-surface-muted px-4 py-2`,children:[(0,V.jsx)(`dt`,{className:`text-[13px] text-muted`,children:e.label}),(0,V.jsx)(`dd`,{className:`m-0 text-[20px] font-semibold tabular-nums`,children:e.value})]},e.label))}),e.markdown&&(0,V.jsx)(nt,{text:e.markdown})]},`${e.path||e.title}-${t}`))]})}function nt({text:e,height:n=220}){let[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(!0),[s,c]=(0,B.useState)(n),l=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{l.current&&!r&&o(l.current.scrollHeight>n+8)},[e,n,r]),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsxs)(`div`,{ref:l,style:s===void 0?void 0:{maxHeight:s},onTransitionEnd:e=>e.target===e.currentTarget&&r&&c(void 0),className:M(`transition-[max-height] duration-200 ease-out`,s!==void 0&&`relative overflow-hidden`),children:[(0,V.jsx)(L,{text:e,className:M(`text-sm`,De)}),!r&&a&&(0,V.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-bg to-transparent`})]}),(r||a)&&(0,V.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>{let e=l.current?.scrollHeight??n;if(i(!r),pe())return c(r?n:void 0);c(e),r&&requestAnimationFrame(()=>requestAnimationFrame(()=>c(n)))},className:`inline-flex min-h-8 cursor-pointer items-center gap-1 self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:[r?(0,V.jsx)(p,{size:14,"aria-hidden":`true`}):(0,V.jsx)(t,{size:14,"aria-hidden":`true`}),r?`Less`:`More`]})]})}function rt(e){let t=e.join(`
|
|
2
2
|
`),n=Math.max(2,...(t.match(/`+/g)||[]).map(e=>e.length)),r="`".repeat(n+1);return`${r}diff\n${t}\n${r}`}function it({e}){let[t,n]=(0,B.useState)(!1),r=e.action===`write`?`New`:`Edited`;return(0,V.jsxs)(`li`,{className:`border-t border-line-soft`,children:[(0,V.jsxs)(`div`,{className:`flex min-h-[44px] min-w-0 items-center gap-2 py-2 text-sm`,children:[(0,V.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} the diff of ${e.path}`,"data-tip":`${t?`Hide`:`Show`} the diff of ${e.path}`,disabled:!e.diffs.length,onClick:()=>n(!t),className:`inline-flex size-8 flex-none cursor-pointer items-center justify-center rounded-lg border-0 bg-transparent text-muted hover:bg-surface-strong disabled:cursor-default disabled:opacity-40`,children:(0,V.jsx)(f,{size:16,"aria-hidden":`true`,className:M(`transition-transform duration-200`,t&&`rotate-90`)})}),(0,V.jsx)(`span`,{className:`w-[52px] flex-none text-[13px] text-muted`,children:r}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,V.jsx)(z,{path:e.path})}),(0,V.jsxs)(`span`,{className:`flex-none font-mono text-[13px] tabular-nums`,children:[(0,V.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,V.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,V.jsx)(Ae,{open:t,className:`pb-4 pl-10 [&_pre]:max-h-[420px] [&_pre]:overflow-auto`,children:e.diffs.length?(0,V.jsx)(L,{text:rt(e.diffs),className:De}):null})]})}var at={write:`New`,edit:`Edited`,delete:`Deleted`,"test written":`Test`};function G({label:e,children:t}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`pt-1 text-[13px] text-muted`,children:e}),(0,V.jsx)(`dd`,{className:`m-0 min-w-0 text-sm [overflow-wrap:anywhere]`,children:t})]})}function ot({c:e,files:t,className:n}){let r=e.edits.reduce((e,t)=>e+t.added,0),i=e.edits.reduce((e,t)=>e+t.removed,0),a=e.tests.filter(e=>!e.ok).length,o=e.reviews.at(-1),s=e.edits.length?[]:t.filter(e=>e.action&&e.action!==`read`);return(0,V.jsxs)(W,{...n?{className:n}:{},title:`Code changes`,icon:c,aside:e.edits.length?(0,V.jsxs)(`span`,{className:`font-mono text-[13px] tabular-nums`,children:[N(e.edits.length,`file`),` · `,(0,V.jsxs)(`span`,{className:`text-pass`,children:[`+`,r]}),` `,(0,V.jsxs)(`span`,{className:`text-fail`,children:[`−`,i]})]}):s.length?(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:N(s.length,`file`)}):void 0,children:[e.results.map((t,n)=>{let r=t.status===`passed`||t.status===`done`,i=t.status===`error`||t.status===`failed`;return(0,V.jsxs)(`div`,{className:`flex flex-col gap-4 border-b border-line-soft pb-4 last:border-b-0 last:pb-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,V.jsx)(_,{size:17,strokeWidth:2,"aria-hidden":`true`,className:r?`text-pass`:i?`text-fail`:`text-warn`}),(0,V.jsx)(`span`,{className:`text-[16px] font-semibold`,children:r?`Test written`:i?`Test not finished`:U(t.status).label}),(0,V.jsx)(P,{tone:r?`pass`:i?`fail`:`warn`,children:U(t.status).label}),e.tests.length>0&&(0,V.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[N(e.tests.length,`test run`),a?` (${a} failed)`:``,e.reviews.length?` · ${N(e.reviews.length,`review`)}`:``]})]}),(0,V.jsxs)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-6 gap-y-1 sm:grid-cols-[110px_minmax(0,1fr)] sm:gap-y-4`,children:[t.testFile&&(0,V.jsx)(G,{label:`Test`,children:(0,V.jsx)(z,{path:t.testFile})}),t.command&&(0,V.jsx)(G,{label:`Run it`,children:(0,V.jsx)(He,{text:t.command})}),(t.review||o)&&(0,V.jsx)(G,{label:`Review`,children:(0,V.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,V.jsx)(`span`,{children:(0,V.jsx)(P,{tone:(t.review??o).approved?`pass`:`warn`,children:(t.review??o).approved?`Approved`:`Changes asked`})}),(t.review?.summary||o?.summary)&&(0,V.jsx)(`span`,{className:`text-ink-2`,children:t.review?.summary||o?.summary})]})}),t.notes&&(0,V.jsx)(G,{label:`Notes`,children:(0,V.jsx)(L,{text:t.notes,className:M(`text-sm text-ink-2 [&_p]:my-0 [&_p+p]:mt-2`,`[&_p]:max-w-none [&_ul]:max-w-none [&_ol]:max-w-none [&_blockquote]:max-w-none [&_h1]:max-w-none [&_h2]:max-w-none [&_h3]:max-w-none [&_h4]:max-w-none [&_h5]:max-w-none [&_h6]:max-w-none`)})})]}),t.error&&(0,V.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:t.error})]},n)}),e.edits.length>0&&(0,V.jsxs)(`div`,{className:`flex flex-col`,children:[(0,V.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,V.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:(0,V.jsx)(Ze,{items:e.edits,first:8,render:e=>(0,V.jsx)(it,{e},e.path)})})]}),s.length>0&&(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,V.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:s.map(e=>(0,V.jsxs)(`li`,{className:`flex min-h-9 min-w-0 items-center gap-4 border-t border-line-soft text-sm first:border-t-0`,children:[(0,V.jsx)(`span`,{className:`w-[52px] flex-none text-[13px] text-muted`,children:at[e.action]||e.action.charAt(0).toUpperCase()+e.action.slice(1)}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,V.jsx)(z,{path:e.path})})]},e.path))}),(0,V.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Their diffs were not kept for this run.`})]}),!e.edits.length&&!s.length&&!e.results.length&&(0,V.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No files changed.`}),e.edits.some(e=>!e.diffs.length)&&(0,V.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`A file without a diff was changed before ForgeQE kept diffs, or is a hidden or credential file, whose text is not kept.`})]})}function st({final:e,answer:t,className:r}){let i=e.from===`agent`?t?.files??[]:[],a=e.from!==`agent`,o=Math.max(2,...(e.text.match(/`+/g)||[]).map(e=>e.length)),s="`".repeat(o+1);return(0,V.jsxs)(W,{...r?{className:r}:{},title:`Final message`,icon:n,aside:(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.from===`agent`?`The agent's last reply`:e.from===`job`?`The end of the job's output`:`What the command said at the end`}),children:[(0,V.jsx)(nt,{text:a?`${s}text\n${e.text}\n${s}`:Te(e.text),height:420}),i.length>0&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,V.jsx)(`span`,{className:`text-muted`,children:`Files it names:`}),i.map(e=>(0,V.jsx)(z,{path:e},e))]})]})}var ct={rule:{icon:C,label:`Rulebook`},decision:{icon:m,label:`Test decisions`},memory:{icon:h,label:`Page memory`},replay:{icon:v,label:`Replays`},model:{icon:re,label:`Model`},skill:{icon:ce,label:`Skills`}};function lt({list:e,className:t}){let n=Object.keys(ct).filter(t=>e.some(e=>e.kind===t));return(0,V.jsx)(W,{...t?{className:t}:{},title:`Learnings`,icon:k,aside:e.length?(0,V.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[e.length,` from this session`]}):void 0,children:e.length===0?(0,V.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing learned or decided in this session: no rules, test decisions, page memory or model switches in its log.`}):(0,V.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(280px,1fr))] gap-x-6 gap-y-4`,children:n.map(t=>{let{icon:n,label:r}=ct[t];return(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,V.jsxs)(`h4`,{className:`m-0 flex items-center gap-2 text-[13px] font-medium text-muted`,children:[(0,V.jsx)(F,{icon:n,size:14}),r]}),(0,V.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.filter(e=>e.kind===t).map((e,t)=>(0,V.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,V.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.text}),e.note&&(0,V.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.note})]},t))})]},t)})})})}function ut({run:e,className:t}){let n=[],r=t?{className:t}:{};return(e.executions.length||e.kind===`execution`)&&n.push({kind:`execution`,node:(0,V.jsx)(et,{list:e.executions,...r},`e`)}),(e.reports.length||e.kind===`report`)&&n.push({kind:`report`,node:(0,V.jsx)(tt,{list:e.reports,...r},`r`)}),e.coding&&(e.coding.edits.length||e.coding.results.length||e.kind===`coding`)&&n.push({kind:`coding`,node:(0,V.jsx)(ot,{c:e.coding,files:e.files,...r},`c`)}),n.sort((t,n)=>Number(n.kind===e.kind)-Number(t.kind===e.kind)),(0,V.jsx)(V.Fragment,{children:n.map(e=>e.node)})}var K={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`}},dt={chat:`Chat`,suite:`Suite`,monitor:`Monitor`,run:`Browser run`,start:`Chat`,heal:`Heal`,"pr-tests":`PR tests`,pack:`Pack`,pipeline:`Pipeline watch`,explore:`Explore`,api:`API tests`,generate:`Generate`,jobs:`Jobs service`},ft=e=>dt[e]||e.charAt(0).toUpperCase()+e.slice(1),pt=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`})},q=(e,t)=>Math.max(0,Math.round(((e.status===`running`?t:Date.parse(e.lastAt))-Date.parse(e.startedAt))/1e3)),J=e=>Number.isFinite(e)?e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m ${e%60}s`:`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`:`–`,Y=e=>e.usage.input+e.usage.output;function mt(e){let[t,n]=(0,B.useState)(Date.now());return(0,B.useEffect)(()=>{if(!e)return;let t=Pe(()=>n(Date.now()),1e3);return()=>Me(t)},[e]),t}function ht({r:e}){return e.origin.kind===`web`?(0,V.jsxs)(`a`,{href:j(`chats`,e.origin.chat),className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(F,{icon:w,size:14}),`Web chat`]}):e.origin.kind===`job`?(0,V.jsxs)(`a`,{href:j(`jobs`,encodeURIComponent(e.origin.job)),className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(F,{icon:ae,size:14}),`Job`]}):(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-muted`,children:[(0,V.jsx)(F,{icon:se,size:14}),`Terminal`]})}var gt=e=>K[e].label;function _t({status:e}){let t=K[e].label;return e===`running`?(0,V.jsx)(T,{size:16,"aria-label":t,className:`flex-none animate-spin text-accent-fg`}):e===`done`?(0,V.jsx)(s,{size:16,"aria-label":t,className:`flex-none text-pass`}):e===`failed`?(0,V.jsx)(a,{size:16,"aria-label":t,className:`flex-none text-fail`}):(0,V.jsx)(u,{size:16,"aria-label":t,className:`flex-none text-muted`})}var X=e=>e.status!==`running`&&!e.tools&&!e.turns&&!Y(e)&&!e.files.length&&!e.outputs.length&&q(e,0)<2;function vt(e){return/^forgeqe(-|$)|^engine$/.test(e)?le(e).name:e&&e.charAt(0).toUpperCase()+e.slice(1)}function Z({label:e,children:t,stacked:n=!1}){return n?(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-col border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,V.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:t})]}):(0,V.jsxs)(`div`,{className:`grid grid-cols-[120px_minmax(0,1fr)] items-baseline gap-4 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,V.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:t})]})}function Q({title:e,icon:t,children:n}){return(0,V.jsx)(Ie,{level:3,icon:t,title:e,className:`gap-2`,children:(0,V.jsx)(`div`,{className:`flex min-w-0 flex-col`,children:n})})}var yt=8,bt=e=>e===`write`?`Written`:e===`edit`?`Edited`:e===`delete`?`Deleted`:e?e.charAt(0).toUpperCase()+e.slice(1):`Changed`;function xt({run:e,now:t,running:n,events:r}){let i=K[e.status],a=e.executions.reduce((e,t)=>({total:e.total+t.counts.total,passed:e.passed+t.counts.passed,failed:e.failed+t.counts.failed}),{total:0,passed:0,failed:0}),o=e.coding?.results.at(-1),s=e.coding?.tests.length??0,c=e.coding?.tests.filter(e=>!e.ok).length??0,l=e.coding?.edits??[],u=l.reduce((e,t)=>e+t.added,0),d=l.reduce((e,t)=>e+t.removed,0),f=l.length||e.files.filter(e=>e.action&&e.action!==`read`).length;return(0,V.jsxs)(je,{label:`How this run went`,children:[(0,V.jsx)(I,{compact:!0,label:`Outcome`,value:i.label,tone:i.tone===`fail`?`text-fail`:i.tone===`pass`?`text-pass`:void 0,...o?.attempts?{note:`attempt ${o.attempts}${o.maxAttempts?` of ${o.maxAttempts}`:``}`}:{}}),(0,V.jsx)(I,{label:n?`Running for`:`Took`,value:J(q(e,t)),...r?{note:N(r,`event`)}:{}}),a.total>0&&(0,V.jsx)(I,{label:`Cases`,value:`${a.passed}/${a.total}`,...a.failed?{tone:`text-fail`}:a.passed===a.total?{tone:`text-pass`}:{},note:`passed`}),s>0&&(0,V.jsx)(I,{label:`Test runs`,value:s,...c?{note:`${c} failed`}:{}}),f>0&&(0,V.jsx)(I,{label:`Files changed`,value:f,...u+d?{note:`+${u} −${d}`}:{}}),Y(e)>0&&(0,V.jsx)(I,{label:`Tokens`,value:R(Y(e)),note:`${R(e.usage.input)} in · ${R(e.usage.output)} out`})]})}var St={rerun:i,write_test:D,investigate:S,fix_test:y},Ct={rerun:`Retry`,write_test:`Write`,investigate:`Investigate`,fix_test:`Fix`};function wt({actions:e}){let[t,n]=(0,B.useState)(``),[r,i]=(0,B.useState)(``);if(!e.length)return null;let a=async e=>{n(e.prompt),i(``);try{let{id:t}=await fe.start(e.prompt,{});location.hash=j(`chats`,t)}catch(e){i(e.message),n(``)}};return(0,V.jsxs)(`section`,{"aria-label":`Next steps`,className:`flex flex-col gap-2`,children:[(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map((e,n)=>(0,V.jsxs)(ge,{disabled:!!t,onClick:()=>void a(e),"data-tip":e.note?`${e.label}: ${e.note}`:e.label,className:`max-w-full min-w-0`,children:[(0,V.jsx)(F,{icon:St[e.kind],size:16,className:`flex-none`}),(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:t===e.prompt?`Opening…`:Ct[e.kind]}),e.note&&(0,V.jsx)(`span`,{className:`min-w-0 flex-[1_1_0] truncate font-normal text-ink-2`,children:e.note})]},n))}),(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Each opens a chat with the request; it asks before it changes anything.`}),r&&(0,V.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:r})]})}var Tt=e=>`\`${e.replace(/`/g,``)}\``,Et=[`summary`,`conversation`,`activity`,`details`],Dt=e=>Et.find(t=>t===e)??`summary`;function Ot({name:e,tab:t}){let[n,i]=(0,B.useState)(null),[a,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(!1),u=Dt(t),f=t=>location.hash=t===`summary`?j(`runs`,encodeURIComponent(e)):j(`runs`,encodeURIComponent(e),t),p=(0,B.useCallback)(()=>{de.detail(e).then(e=>{i(e),s(``)},e=>s(e.message))},[e]);(0,B.useEffect)(p,[p]);let m=n?.status===`running`;(0,B.useEffect)(()=>{if(!m)return;let e=Pe(p,2e3);return()=>Me(e)},[p,m]);let h=mt(m),_=(0,B.useMemo)(()=>(n?.events??[]).map(Le).filter(e=>!!e),[n?.events]),v=async()=>{l(!0),s(``);try{await de.cancel(e),p()}catch(e){s(e.message)}finally{l(!1)}},y=(0,V.jsx)(Ce,{href:j(`runs`),label:`All runs`});if(!n)return(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[y,a?(0,V.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:a}):(0,V.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})]});let S=K[n.status],C=!n.replies.length,T=!!n.final||n.executions.length>0||n.reports.length>0||!!(n.coding&&(n.coding.edits.length||n.coding.results.length))||n.learnings.length>0||n.outputs.length>0||n.files.length>0,E=[{id:`summary`,label:`Summary`,icon:ie},{id:`conversation`,label:C?`Command`:`Conversation`,icon:C?A:w,n:n.replies.length||void 0},{id:`activity`,label:`Activity`,icon:b,n:_.length||void 0},{id:`details`,label:`Details`,icon:x}],D=new Set([...n.reports.map(e=>e.path),...n.executions.flatMap(e=>[e.report,e.folder])].filter(Boolean)),O=n.outputs.filter(e=>!D.has(e.path)),k=n.context?.limit?Math.round(n.context.tokens/n.context.limit*100):null,ne=O.length>0||n.files.length>0?`@3xl:col-span-3`:`@3xl:col-span-4`;return(0,V.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[y,(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-2`,children:[(0,V.jsx)(Ee,{icon:d,title:n.title,actions:(0,V.jsx)(P,{tone:S.tone,children:S.label})}),(0,V.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-muted`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(Ke,{kind:n.kind}),H[n.kind]]}),`· `,(0,V.jsx)(ht,{r:n}),`· `,pt(n.startedAt),` · `,m?`running for `:`took `,J(q(n,h)),` · `,R(Y(n)),` tokens`,n.profile?.model?` · ${n.profile.model}`:``]})]}),n.cancel&&(0,V.jsxs)(ge,{variant:`danger`,disabled:c,"data-tip":n.cancel===`chat`?`Stop this chat's work`:`Cancel this job's run`,onClick:()=>void v(),children:[n.cancel===`chat`?(0,V.jsx)(ee,{fill:`currentColor`,"aria-hidden":`true`}):(0,V.jsx)(o,{"aria-hidden":`true`}),c?`Stopping…`:n.cancel===`chat`?`Stop`:`Cancel`]})]}),a&&(0,V.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a}),n.error&&(0,V.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[(0,V.jsx)(`strong`,{children:`What went wrong:`}),` `,n.error]}),!m&&(0,V.jsx)(wt,{actions:n.actions??[]}),(0,V.jsx)(Fe,{prefix:`run`,label:`This run`,className:`mb-0`,current:u,onPick:f,tabs:E}),(0,V.jsxs)(`div`,{role:`tabpanel`,id:`run-panel-${u}`,"aria-labelledby":`run-${u}`,className:`flex min-w-0 flex-col gap-6`,children:[u===`summary`&&(0,V.jsxs)(V.Fragment,{children:[T&&(0,V.jsx)(xt,{run:n,now:h,running:m,events:_.length}),(0,V.jsxs)(`div`,{className:`grid items-start gap-x-12 gap-y-6 @3xl:grid-cols-4 @3xl:[grid-auto-flow:dense]`,children:[n.final&&(0,V.jsx)(st,{final:n.final,answer:n.answer,className:ne}),(0,V.jsx)(ut,{run:n,className:ne}),O.length>0&&(0,V.jsx)(`div`,{className:`flex min-w-0 flex-col border-t border-line-soft pt-6 @3xl:col-span-1`,children:(0,V.jsx)(Q,{title:`What it produced (${O.length})`,icon:oe,children:O.map(e=>(0,V.jsx)(Z,{label:e.label,stacked:!0,children:(0,V.jsx)(z,{path:e.path,children:e.path.split(`/`).pop()})},e.path))})}),n.files.length>0&&(0,V.jsx)(`div`,{className:`flex min-w-0 flex-col border-t border-line-soft pt-6 @3xl:col-span-1`,children:(0,V.jsx)(Q,{title:`Files worked on (${n.files.length})`,icon:r,children:(0,V.jsx)(Ze,{items:[...n.files].sort((e,t)=>Number(e.action===`read`)-Number(t.action===`read`)),first:yt,render:e=>(0,V.jsx)(Z,{label:bt(e.action),stacked:!0,children:e.action===`delete`?(0,V.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.path.split(`/`).pop()}):(0,V.jsx)(z,{path:e.path,children:e.path.split(`/`).pop()})},e.path)})})}),n.learnings.length>0&&(0,V.jsx)(lt,{list:n.learnings,className:`@3xl:col-span-4`})]}),!T&&(0,V.jsx)(be,{className:`py-4`,children:m?`Still working: its answer and what it produces show here when it ends.`:`This run left no answer, results or files. Its Activity shows what it did.`})]}),u===`conversation`&&(C?(0,V.jsx)(L,{text:Tt(n.prompt),className:`text-sm [&_p]:my-0`}):(0,V.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:n.replies.map((e,t)=>(0,V.jsxs)(`li`,{className:`flex flex-col gap-2`,children:[(0,V.jsx)(`div`,{className:`self-end rounded-[14px] bg-surface-strong px-4 py-2 text-sm max-w-[85%]`,children:(0,V.jsx)(L,{text:e.ask,className:`[&_p]:my-1`})}),e.text&&(0,V.jsx)(L,{text:Te(e.text),className:`text-sm`}),e.error&&(0,V.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e.error})]},t))})),u===`activity`&&(n.archived?(0,V.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-4 text-sm text-ink-2`,children:[`ForgeQE keeps the newest session logs only, and this run's is gone. Its summary, final message and learnings were kept in `,(0,V.jsx)(`code`,{className:`font-mono text-[13px]`,children:`.forgeqe/runs`}),`; its step-by-step activity was not.`]}):_.length?(0,V.jsx)(Ue,{timeline:!0,lines:_,start:n.startedAt,live:m,name:`forgeqe-run-${n.name.replace(/\.log$/,``)}.md`}):(0,V.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing logged yet.`})),u===`details`&&(0,V.jsxs)(kt,{children:[(0,V.jsxs)(Q,{title:`Numbers`,icon:g,children:[(0,V.jsx)(Z,{label:m?`Running for`:`Took`,children:J(q(n,h))}),(0,V.jsx)(Z,{label:`Tokens`,children:(0,V.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,V.jsxs)(`span`,{children:[R(Y(n)),` `,(0,V.jsxs)(`span`,{className:`text-muted`,children:[`· `,Be(n.usage)]})]}),(n.byAgent?.length??0)>1&&(0,V.jsx)(`span`,{className:`flex flex-col gap-1 text-[13px]`,children:n.byAgent.map(e=>(0,V.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-2`,children:vt(e.agent)}),(0,V.jsx)(`span`,{className:`text-muted tabular-nums`,children:R(e.input+e.output)})]},e.agent))})]})}),(0,V.jsxs)(Z,{label:`Context`,children:[n.context?R(n.context.tokens):`–`,k!==null&&(0,V.jsxs)(`span`,{className:`text-muted`,children:[` of `,R(n.context.limit),` (`,k,`%)`]})]}),(0,V.jsxs)(Z,{label:`Tool calls`,children:[n.tools,` `,(0,V.jsxs)(`span`,{className:`text-muted`,children:[`in `,N(n.turns,`turn`)]})]})]}),(0,V.jsxs)(Q,{title:`Session`,icon:A,children:[(0,V.jsx)(Z,{label:`Started by`,children:(0,V.jsx)(ht,{r:n})}),(0,V.jsx)(Z,{label:`Command`,children:ft(n.command)}),(0,V.jsx)(Z,{label:`Model`,children:n.profile?[n.profile.name,n.profile.model].filter(Boolean).join(` · `):`–`}),(0,V.jsx)(Z,{label:`Agents`,children:n.agents.length?(0,V.jsx)(`span`,{className:`flex flex-col gap-1`,children:n.agents.map(e=>(0,V.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:vt(e.name)}),(0,V.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:N(e.calls,`call`)})]},e.name))}):(0,V.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,V.jsxs)(Z,{label:`Log`,children:[n.archived?(0,V.jsx)(`span`,{className:`text-muted`,children:`No longer kept: ForgeQE keeps the newest logs only`}):(0,V.jsx)(z,{path:`.forgeqe/logs/${n.name}`}),n.truncated&&(0,V.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Very long: only its start is shown.`})]})]}),n.job&&(0,V.jsxs)(Q,{title:`Job`,icon:ae,children:[(0,V.jsx)(Z,{label:`Job`,children:(0,V.jsx)(`a`,{href:j(`jobs`,encodeURIComponent(n.origin.kind===`job`?n.origin.job:n.job.name)),children:n.job.name})}),(0,V.jsx)(Z,{label:`Runs`,children:(0,V.jsx)(L,{text:Tt(n.job.command),className:`text-sm [&_p]:my-0`})}),(0,V.jsxs)(Z,{label:`Schedule`,children:[n.job.schedule,!n.job.enabled&&` (disabled)`,n.job.nextAt&&n.job.enabled?` · next ${pt(n.job.nextAt)}`:``]}),n.job.run&&(0,V.jsxs)(Z,{label:`This run`,children:[n.job.run.reason===`asked`?`Asked for`:`On schedule`,`, `,n.job.run.status.replace(`_`,` `),n.job.run.exitCode!==void 0&&n.job.run.exitCode!==null?`, exit ${n.job.run.exitCode}`:``]})]}),(0,V.jsx)(Q,{title:`Notifications`,icon:te,children:n.notifications.length?n.notifications.map(e=>(0,V.jsx)(Z,{label:e.event.replace(/_/g,` `),children:e.channels.length?e.channels.join(`, `):(0,V.jsx)(`span`,{className:`text-muted`,children:`No channel takes it`})},e.event)):(0,V.jsx)(`p`,{className:`m-0 py-1 text-sm text-muted`,children:n.origin.kind===`terminal`||n.origin.kind===`web`?`None: notify channels go with jobs, suites and the monitor.`:`No notify channels are set up (Settings, Notify).`})})]})]})]})}function kt({children:e}){let t=B.Children.toArray(e).filter(Boolean),n=t.length%2==1;return(0,V.jsx)(`div`,{className:`grid items-start gap-x-12 gap-y-6 @3xl:grid-cols-4 @3xl:[grid-auto-flow:dense]`,children:t.map((e,r)=>(0,V.jsx)(`div`,{className:M(`flex min-w-0 flex-col border-t border-line-soft pt-6`,n&&r===t.length-1?`@3xl:col-span-4`:`@3xl:col-span-2`),children:e},r))})}var $=25;function At({runs:e}){let t=mt(e.some(e=>e.status===`running`)),[n,r]=(0,B.useState)(``),[i,a]=(0,B.useState)(`all`),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(0);(0,B.useEffect)(()=>p(0),[n,i,o,c,u]);let m=e.filter(X).length,h=n.toLowerCase().split(/\s+/).filter(Boolean),g=e.filter(e=>(u||!X(e))&&(!o||e.kind===o)&&(!c||e.origin.kind===c)&&h.every(t=>`${e.title} ${e.command} ${e.error||``}`.toLowerCase().includes(t))),_={all:g.length,running:g.filter(e=>e.status===`running`).length,failed:g.filter(e=>e.status===`failed`).length},v=i===`all`?g:g.filter(e=>e.status===i),y=Math.max(1,Math.ceil(v.length/$)),b=Math.min(f,y-1),x=v.slice(b*$,b*$+$),S=e.filter(e=>e.status!==`running`&&!X(e)),C=S.filter(e=>e.status===`failed`).length,T=S.length?S.reduce((e,n)=>e+q(n,t),0)/S.length:NaN,E=e.reduce((e,t)=>e+Y(t),0),D=[...new Set(e.map(e=>e.kind))],O=[...new Set(e.map(e=>e.origin.kind))],k={web:`Web chat`,job:`Job`,terminal:`Terminal`};return e.length===0?(0,V.jsx)(be,{icon:A,title:`No runs yet`,action:(0,V.jsxs)(`a`,{className:he({size:`sm`}),href:j(),"data-tip":`Start a chat`,children:[(0,V.jsx)(w,{"aria-hidden":`true`}),`Chat`]}),children:`A chat here, a job, or a ForgeQE command in this project adds one.`}):(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-1 text-[13px] text-muted`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:`text-ink tabular-nums`,children:e.length-m}),` runs`]}),e.some(e=>e.status===`running`)&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:`text-accent-fg tabular-nums`,children:e.filter(e=>e.status===`running`).length}),` running now`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:M(`tabular-nums`,C?`text-fail`:`text-ink`),children:C}),` failed`,S.length?` (${Math.round(C/S.length*100)}%)`:``]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:`text-ink tabular-nums`,children:R(E)}),` tokens`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:`text-ink tabular-nums`,children:J(Math.round(T))}),` on average`]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(Se,{id:`run-search`,label:`Find a run`,value:n,onChange:r,placeholder:`Find a run by what was asked`}),(0,V.jsx)(ye,{items:[{id:`all`,label:`All`,n:_.all},{id:`running`,label:`Running`,n:_.running},{id:`failed`,label:`Failed`,n:_.failed,alert:!0}],value:i,onChange:a}),D.length>1&&(0,V.jsxs)(me,{size:`sm`,"aria-label":`What it did`,value:o,onChange:e=>s(e.target.value),className:`w-auto pr-8 pl-4`,children:[(0,V.jsx)(`option`,{value:``,children:`Any kind`}),D.map(e=>(0,V.jsx)(`option`,{value:e,children:H[e]},e))]}),O.length>1&&(0,V.jsxs)(me,{size:`sm`,"aria-label":`Started by`,value:c,onChange:e=>l(e.target.value),className:`w-auto pr-8 pl-4`,children:[(0,V.jsx)(`option`,{value:``,children:`Started anywhere`}),O.map(e=>(0,V.jsx)(`option`,{value:e,children:k[e]||e},e))]})]}),(0,V.jsxs)(`div`,{className:`rounded-[14px] card border`,children:[(0,V.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[auto_minmax(0,1fr)_104px_104px_72px_64px_92px] items-center gap-x-4 border-b border-line-soft px-4 py-2 text-[13px] font-semibold text-muted @3xl:grid`,children:[(0,V.jsx)(`span`,{className:`w-4`}),(0,V.jsx)(`span`,{children:`Run`}),(0,V.jsx)(`span`,{children:`Kind`}),(0,V.jsx)(`span`,{children:`Started by`}),(0,V.jsx)(`span`,{className:`text-right`,children:`Took`}),(0,V.jsx)(`span`,{className:`text-right`,children:`Tokens`}),(0,V.jsx)(`span`,{className:`text-right`,children:`When`})]}),(0,V.jsxs)(`ul`,{"aria-label":`Runs`,className:`m-0 list-none p-2`,children:[x.length===0&&(0,V.jsx)(`li`,{className:`px-4 py-4 text-sm text-muted`,children:`Nothing matches.`}),x.map((e,n)=>{let r=Re(e.startedAt);return(0,V.jsxs)(`li`,{className:`contents`,children:[(n===0||Re(x[n-1].startedAt)!==r)&&(0,V.jsx)(`span`,{className:`block px-4 pt-4 pb-1 text-[13px] font-semibold text-muted`,children:r}),(0,V.jsxs)(`a`,{href:j(`runs`,encodeURIComponent(e.name)),className:`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-4 rounded-[10px] px-4 py-2 text-ink no-underline hover:bg-surface-muted hover:text-ink @3xl:grid-cols-[auto_minmax(0,1fr)_104px_104px_72px_64px_92px] @3xl:gap-x-4`,children:[(0,V.jsx)(_t,{status:e.status}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,V.jsx)(`span`,{className:`truncate text-[13px] font-medium`,"data-tip":e.title,children:e.title}),e.error?(0,V.jsx)(`span`,{className:`truncate text-[13px] text-fail`,children:e.error}):(0,V.jsx)(`span`,{className:`truncate text-[13px] text-muted @3xl:hidden`,children:[H[e.kind],k[e.origin.kind],J(q(e,t)),`${R(Y(e))} tokens`].join(` · `)})]}),(0,V.jsxs)(`span`,{className:`hidden min-w-0 items-center gap-2 text-[13px] text-ink-2 @3xl:inline-flex`,children:[(0,V.jsx)(Ke,{kind:e.kind}),H[e.kind]]}),(0,V.jsx)(`span`,{className:`hidden text-[13px] text-ink-2 @3xl:block`,children:k[e.origin.kind]||e.origin.kind}),(0,V.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:J(q(e,t))}),(0,V.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:R(Y(e))}),(0,V.jsx)(`span`,{className:`text-right text-[13px] text-muted tabular-nums`,"data-tip":pt(e.startedAt),children:ze(e.startedAt)})]})]},e.name)})]}),(0,V.jsx)(ve,{page:b,size:$,total:v.length,onPage:p,label:`Pages of runs`,children:m>0&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>d(!u),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:u?`Hide the ${N(m,`empty session`)}`:`${N(m,`empty session`)} hidden`})]})})]})]})}function jt({sub:e}){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(``),a=(0,B.useCallback)(()=>{de.list().then(e=>{n(e.runs),i(``)},e=>i(e.message))},[]);(0,B.useEffect)(a,[a]);let o=t?.some(e=>e.status===`running`);(0,B.useEffect)(()=>{if(e)return;let t=Pe(a,o?3e3:2e4);return()=>Me(t)},[a,o,e]);let[s,c]=(e||``).split(`/`),l=s?ne(s):``;return(0,V.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,V.jsx)(Ve,{}),(0,V.jsx)(`main`,{className:M(ke,`@container flex-auto gap-4`),children:l?(0,V.jsx)(Ot,{name:l,tab:c},l):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(xe,{}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,V.jsx)(Oe,{pixel:we.runs,size:`lg`}),(0,V.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Runs`})]}),(0,V.jsx)(Ne,{label:`Runs and reports`,links:We,current:`runs`})]}),(0,V.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:`Every ForgeQE session in this project: chats here, jobs' runs, and commands typed in a terminal, newest first. Open one for how it went and what it produced.`}),r&&(0,V.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r}),!t&&!r&&(0,V.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,V.jsx)(At,{runs:t})]})})]})}export{jt as Runs,_t as StatusIcon,X as empty,Dt as runTab,gt as statusLabel};
|