@capagents/forgeqe 2.6.8 → 2.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/HOW_TO_USE.md +2 -2
  2. package/dist/docs-site/docs/index.html +2 -2
  3. package/dist/forgeqe.js +1006 -1005
  4. package/dist/web/assets/Agent-BM6E-VB0.js +4 -0
  5. package/dist/web/assets/ApiTests-C5d7bkXm.js +10 -0
  6. package/dist/web/assets/Chat-D9JQ9cu_.js +3 -0
  7. package/dist/web/assets/Data-DDbhee1a.js +3 -0
  8. package/dist/web/assets/Evidence-_lZ3esVH.js +1 -0
  9. package/dist/web/assets/{Features-Dnm-0jGR.js → Features-B66ac5MV.js} +1 -1
  10. package/dist/web/assets/Jobs-DYk-sYUM.js +5 -0
  11. package/dist/web/assets/KindPage-CxnmiL82.js +6 -0
  12. package/dist/web/assets/Migration-B_U_b1nf.js +2 -0
  13. package/dist/web/assets/Product-DGNdstwf.js +1 -0
  14. package/dist/web/assets/Quality-B4EhNeTq.js +1 -0
  15. package/dist/web/assets/Record-CVMQ4Hjt.js +2 -0
  16. package/dist/web/assets/Regression-CvHEFhiq.js +5 -0
  17. package/dist/web/assets/Reports-BHaomqX9.js +2 -0
  18. package/dist/web/assets/{Response-C1tTSHsN.js → Response-DW5m211p.js} +2 -2
  19. package/dist/web/assets/Runs-hbJakq0Q.js +2 -0
  20. package/dist/web/assets/{Shell-CKaocbu7.js → Shell-S47lWQWa.js} +3 -3
  21. package/dist/web/assets/TestCases-DYCsex4G.js +1 -0
  22. package/dist/web/assets/TestData-C7_npkCW.js +2 -0
  23. package/dist/web/assets/{WhatsNew-CtsRchIh.js → WhatsNew-BnuvSOPs.js} +1 -1
  24. package/dist/web/assets/{arrow-down-0cv3vB9X.js → arrow-down-dgw_SWAN.js} +1 -1
  25. package/dist/web/assets/{arrow-right-8jR1e3xK.js → arrow-right-NAWkj6gQ.js} +1 -1
  26. package/dist/web/assets/circle-Cg6_419C.js +1 -0
  27. package/dist/web/assets/{circle-dashed-B35QPBE0.js → circle-dashed-CBDGSDRm.js} +1 -1
  28. package/dist/web/assets/{circle-dot-YVC9se3l.js → circle-dot-KBCD8ZM0.js} +1 -1
  29. package/dist/web/assets/dataParts-RK75MdJ3.js +3 -0
  30. package/dist/web/assets/index-BiJ_Nvm1.css +2 -0
  31. package/dist/web/assets/index-Dxug1-bt.js +43 -0
  32. package/dist/web/assets/{keyboard-upxBgRLw.js → keyboard-D1hh9hbZ.js} +1 -1
  33. package/dist/web/assets/{pencil-ChwP3XCl.js → pencil-BgW3hRhM.js} +1 -1
  34. package/dist/web/assets/{productParts-DM2tQgcG.js → productParts-E2GeSekc.js} +1 -1
  35. package/dist/web/assets/{qualityParts-CRwmRPN3.js → qualityParts-ejfvRM41.js} +1 -1
  36. package/dist/web/assets/segmented-DkcA7fWs.js +1 -0
  37. package/dist/web/assets/{thread-DDRLr61v.js → thread-D64HDvgz.js} +1 -1
  38. package/dist/web/assets/{upload-CKHTvh9O.js → upload-a2jTB_Hi.js} +1 -1
  39. package/dist/web/assets/{usePageChat-DJzFBDJZ.js → usePageChat-cEyYdC42.js} +1 -1
  40. package/dist/web/index.html +3 -3
  41. package/docs/user-guide.html +2 -2
  42. package/package.json +1 -1
  43. package/dist/web/assets/Agent-CMgVDCSS.js +0 -4
  44. package/dist/web/assets/ApiTests-DJavOQxD.js +0 -10
  45. package/dist/web/assets/Chat-DIo_9sT1.js +0 -3
  46. package/dist/web/assets/Data-DkhpEE9h.js +0 -3
  47. package/dist/web/assets/Evidence-C5Utzq94.js +0 -1
  48. package/dist/web/assets/Jobs-B2DgnEEr.js +0 -5
  49. package/dist/web/assets/KindPage--1TCQHnp.js +0 -6
  50. package/dist/web/assets/Migration-Bcg4R--0.js +0 -2
  51. package/dist/web/assets/Product-CWiWEhhS.js +0 -1
  52. package/dist/web/assets/Quality-BKNgZnHJ.js +0 -1
  53. package/dist/web/assets/Record-Bz8zM33z.js +0 -2
  54. package/dist/web/assets/Regression-QpO2PwLK.js +0 -5
  55. package/dist/web/assets/Reports-1NYvEpuj.js +0 -2
  56. package/dist/web/assets/Runs-DbrTSgrS.js +0 -2
  57. package/dist/web/assets/TestCases-LQ8brhre.js +0 -1
  58. package/dist/web/assets/TestData-Ch6duuIn.js +0 -2
  59. package/dist/web/assets/circle-BJ4LM2OB.js +0 -1
  60. package/dist/web/assets/dataParts-DXy8Szhq.js +0 -3
  61. package/dist/web/assets/index-O1OF4vQJ.css +0 -2
  62. package/dist/web/assets/index-lrQIFWZq.js +0 -43
@@ -0,0 +1,2 @@
1
+ import{$ as e,$t as t,A as n,An as r,Ar as i,Cr as a,Ct as o,Ei as s,Ft as c,Gt as l,Jt as u,Kn as d,Ln as f,Oi as p,Or as m,Pn as h,Pr as g,Q as _,Sr as v,St as y,Ut as b,Vr as x,Xt as S,Yn as C,Zr as w,an as T,cr as E,ct as ee,dt as D,er as O,hn as te,ji as ne,ln as k,lt as A,n as j,qt as M,rt as N,sn as re,st as P,tt as ie,vr as ae,xn as oe,xt as se,yi as F,yt as ce}from"./Shell-S47lWQWa.js";import{t as le}from"./circle-dashed-CBDGSDRm.js";import{r as ue,t as de}from"./Response-DW5m211p.js";import{F as fe,G as pe,H as me,N as he,i as I,r as L,t as ge,z as _e}from"./index-Dxug1-bt.js";import{n as R,t as ve}from"./when-CHnpLdYw.js";import{n as ye,r as be}from"./segmented-DkcA7fWs.js";import{a as xe,c as Se}from"./thread-D64HDvgz.js";var Ce={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Ce.node;var we=x(Ce),z=ne(p(),1),B=s(),V={execution:`Execution`,report:`Report`,coding:`Coding`,chat:`Chat`},Te={execution:O,report:E,coding:ae,chat:r};function Ee({kind:e}){let t=Te[e];return(0,B.jsx)(l,{icon:t,size:14,className:`flex-none text-muted`})}var De={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`}},H=e=>De[e]||{label:e?e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g,` `):`–`,tone:`neutral`},Oe={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`App run`},ke=e=>{if(!e)return``;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`};function U({title:e,icon:t,children:n,aside:r}){return(0,B.jsxs)(`section`,{className:`flex flex-col gap-3 border-t border-line-soft pt-6 first:border-t-0 first:pt-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`h3`,{className:`m-0 flex flex-1 items-center gap-2 text-base font-semibold`,children:[(0,B.jsx)(`span`,{className:`text-accent-fg`,children:t}),e]}),r]}),n]})}function Ae({path:e,label:t=`Open report`}){let[n,r]=(0,z.useState)(``);return(0,B.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(b,{onClick:async()=>r(await o(e)),children:[(0,B.jsx)(_e,{"aria-hidden":`true`}),t]}),n&&(0,B.jsx)(`span`,{className:`text-[13px] text-fail`,children:n})]})}function je({items:e,first:t,render:n}){let[r,i]=(0,z.useState)(!1);return(0,B.jsxs)(B.Fragment,{children:[(r?e:e.slice(0,t)).map(n),e.length>t&&(0,B.jsx)(`button`,{type:`button`,"aria-expanded":r,onClick:()=>i(!r),className:`min-h-8 cursor-pointer self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:r?`Show fewer`:`Show all ${e.length}`})]})}function Me({c:e}){if(!e.total)return null;let t=t=>`${t/e.total*100}%`;return(0,B.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,B.jsx)(`div`,{className:`bg-pass transition-[width] duration-200 ease-out`,style:{width:t(e.passed)}}),(0,B.jsx)(`div`,{className:`bg-fail transition-[width] duration-200 ease-out`,style:{width:t(e.failed)}}),(0,B.jsx)(`div`,{className:`bg-warn transition-[width] duration-200 ease-out`,style:{width:t(e.other)}})]})}function Ne({e}){let t=e.counts.total?Math.round(e.counts.passed/e.counts.total*100):0;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-line-soft pt-3 first:border-t-0 first:pt-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,B.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:[Oe[e.scope]||e.scope,ke(e.ms),e.tokens?`${n(e.tokens)} tokens`:``,e.stopped?`stopped early`:``].filter(Boolean).join(` · `)})]}),e.report&&(0,B.jsx)(Ae,{path:e.report})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,B.jsxs)(`span`,{className:`text-[22px] font-semibold tabular-nums`,children:[t,`%`]}),(0,B.jsx)(`span`,{className:`text-muted`,children:`passed`}),(0,B.jsxs)(P,{tone:`pass`,children:[e.counts.passed,` passed`]}),e.counts.failed>0&&(0,B.jsxs)(P,{tone:`fail`,children:[e.counts.failed,` failed`]}),e.counts.other>0&&(0,B.jsxs)(P,{tone:`warn`,children:[e.counts.other,` other`]}),(0,B.jsxs)(`span`,{className:`text-muted`,children:[`of `,e.counts.total]})]}),(0,B.jsx)(Me,{c:e.counts}),e.cases.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Cases of ${e.title}`,className:`m-0 flex list-none flex-col p-0`,children:(0,B.jsx)(je,{items:[...e.cases].sort((e,t)=>Number(H(t.status).tone===`fail`)-Number(H(e.status).tone===`fail`)),first:6,render:(e,t)=>(0,B.jsxs)(`li`,{className:`flex min-w-0 items-start gap-3 border-t border-line-soft py-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`w-[76px] flex-none`,children:(0,B.jsx)(P,{tone:H(e.status).tone,children:H(e.status).label})}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,B.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[e.id&&(0,B.jsx)(`span`,{className:`mr-1.5 font-mono text-[12px] text-muted`,children:e.id}),e.title,e.device&&(0,B.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.device]})]}),e.summary&&(0,B.jsx)(`span`,{className:`line-clamp-2 text-[13px] text-muted`,children:e.summary})]}),(0,B.jsx)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:ke(e.ms)})]},`${e.id}-${t}`)})}),e.folder&&!e.report&&(0,B.jsxs)(`span`,{className:`text-sm`,children:[`Kept in `,(0,B.jsx)(L,{path:e.folder})]})]})}function Pe({list:e}){let t=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,B.jsx)(U,{title:`Execution summary`,icon:(0,B.jsx)(l,{icon:O,size:18}),aside:e.length>1?(0,B.jsxs)(`span`,{className:`text-sm text-muted`,children:[u(e.length,`run`),` · `,t.passed,` of `,t.total,` passed`]}):void 0,children:e.length?e.map((e,t)=>(0,B.jsx)(Ne,{e},`${e.folder||e.title}-${t}`)):(0,B.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 Fe({list:e}){return(0,B.jsxs)(U,{title:`Report summary`,icon:(0,B.jsx)(l,{icon:E,size:18}),children:[e.length===0&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No report was written in this run.`}),e.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-line-soft pt-3 first:border-t-0 first:pt-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,B.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,B.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,B.jsx)(Ae,{path:e.path})]}),e.stats&&(0,B.jsx)(`dl`,{className:`m-0 grid grid-cols-[repeat(auto-fit,minmax(110px,1fr))] gap-2`,children:e.stats.map(e=>(0,B.jsxs)(`div`,{className:`rounded-[10px] bg-surface-muted px-3 py-2`,children:[(0,B.jsx)(`dt`,{className:`text-[12px] text-muted`,children:e.label}),(0,B.jsx)(`dd`,{className:`m-0 text-[18px] font-semibold tabular-nums`,children:e.value})]},e.label))}),e.markdown&&(0,B.jsx)(Ie,{text:e.markdown})]},`${e.path||e.title}-${t}`))]})}function Ie({text:e,height:t=220}){let[n,r]=(0,z.useState)(!1),[i,a]=(0,z.useState)(!0),[o,s]=(0,z.useState)(t),c=(0,z.useRef)(null);return(0,z.useLayoutEffect)(()=>{c.current&&!n&&a(c.current.scrollHeight>t+8)},[e,t,n]),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsxs)(`div`,{ref:c,style:o===void 0?void 0:{maxHeight:o},onTransitionEnd:e=>e.target===e.currentTarget&&n&&s(void 0),className:M(`transition-[max-height] duration-200 ease-[cubic-bezier(0.2,0.7,0.2,1)]`,o!==void 0&&`relative overflow-hidden`),children:[(0,B.jsx)(I,{text:e,className:`text-sm`}),!n&&i&&(0,B.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-bg to-transparent`})]}),(n||i)&&(0,B.jsx)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>{let e=c.current?.scrollHeight??t;if(r(!n),ce())return s(n?t:void 0);s(e),n&&requestAnimationFrame(()=>requestAnimationFrame(()=>s(t)))},className:`min-h-8 cursor-pointer self-start border-0 bg-transparent px-0 text-[13px] font-medium text-accent-fg hover:underline`,children:n?`Show less`:`Show all of it`})]})}function Le(e){let t=e.join(`
2
+ `),n=Math.max(2,...(t.match(/`+/g)||[]).map(e=>e.length)),r="`".repeat(n+1);return`${r}diff\n${t}\n${r}`}function Re({e}){let[t,n]=(0,z.useState)(!1),r=e.action===`write`?`New`:`Edited`;return(0,B.jsxs)(`li`,{className:`border-t border-line-soft`,children:[(0,B.jsxs)(`div`,{className:`flex min-h-[44px] min-w-0 items-center gap-2 py-1.5 text-sm`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":`${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,B.jsx)(a,{size:16,"aria-hidden":`true`,className:M(`transition-transform duration-200`,t&&`rotate-90`)})}),(0,B.jsx)(`span`,{className:`w-[52px] flex-none text-[12px] text-muted`,children:r}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,B.jsx)(L,{path:e.path})}),(0,B.jsxs)(`span`,{className:`flex-none font-mono text-[12px] tabular-nums`,children:[(0,B.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,B.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,B.jsx)(y,{open:t,className:`pb-3 pl-10 [&_pre]:max-h-[420px] [&_pre]:overflow-auto`,children:e.diffs.length?(0,B.jsx)(I,{text:Le(e.diffs)}):null})]})}var ze={write:`New`,edit:`Edited`,delete:`Deleted`,"test written":`Test`};function W({label:e,children:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{className:`pt-0.5 text-[13px] text-muted`,children:e}),(0,B.jsx)(`dd`,{className:`m-0 min-w-0 text-sm [overflow-wrap:anywhere]`,children:t})]})}function Be({c:e,files:t}){let n=e.edits.reduce((e,t)=>e+t.added,0),r=e.edits.reduce((e,t)=>e+t.removed,0),i=e.tests.filter(e=>!e.ok).length,a=e.reviews.at(-1),o=e.edits.length?[]:t.filter(e=>e.action&&e.action!==`read`);return(0,B.jsxs)(U,{title:`Code changes`,icon:(0,B.jsx)(l,{icon:ae,size:18}),aside:e.edits.length?(0,B.jsxs)(`span`,{className:`font-mono text-[13px] tabular-nums`,children:[u(e.edits.length,`file`),` · `,(0,B.jsxs)(`span`,{className:`text-pass`,children:[`+`,n]}),` `,(0,B.jsxs)(`span`,{className:`text-fail`,children:[`−`,r]})]}):o.length?(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:u(o.length,`file`)}):void 0,children:[e.results.map((t,n)=>{let r=t.status===`passed`||t.status===`done`,o=t.status===`error`||t.status===`failed`;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-line-soft pb-4 last:border-b-0 last:pb-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,B.jsx)(O,{size:17,strokeWidth:2,"aria-hidden":`true`,className:r?`text-pass`:o?`text-fail`:`text-warn`}),(0,B.jsx)(`span`,{className:`text-[15px] font-semibold`,children:r?`Test written`:o?`Test not finished`:H(t.status).label}),(0,B.jsx)(P,{tone:r?`pass`:o?`fail`:`warn`,children:H(t.status).label}),e.tests.length>0&&(0,B.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[u(e.tests.length,`test run`),i?` (${i} failed)`:``,e.reviews.length?` · ${u(e.reviews.length,`review`)}`:``]})]}),(0,B.jsxs)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-5 gap-y-1 sm:grid-cols-[110px_minmax(0,1fr)] sm:gap-y-3`,children:[t.testFile&&(0,B.jsx)(W,{label:`Test`,children:(0,B.jsx)(L,{path:t.testFile})}),t.command&&(0,B.jsx)(W,{label:`Run it`,children:(0,B.jsx)(ue,{text:t.command})}),(t.review||a)&&(0,B.jsx)(W,{label:`Review`,children:(0,B.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)(P,{tone:(t.review??a).approved?`pass`:`warn`,children:(t.review??a).approved?`Approved`:`Changes asked`})}),(t.review?.summary||a?.summary)&&(0,B.jsx)(`span`,{className:`text-ink-2`,children:t.review?.summary||a?.summary})]})}),t.notes&&(0,B.jsx)(W,{label:`Notes`,children:(0,B.jsx)(I,{text:t.notes,className:`text-sm text-ink-2 [&_p]:my-0 [&_p+p]:mt-2`})})]}),t.error&&(0,B.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:t.error})]},n)}),e.edits.length>0&&(0,B.jsxs)(`div`,{className:`flex flex-col`,children:[(0,B.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,B.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:(0,B.jsx)(je,{items:e.edits,first:8,render:e=>(0,B.jsx)(Re,{e},e.path)})})]}),o.length>0&&(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`h4`,{className:`m-0 text-[13px] font-medium text-muted`,children:`Files changed`}),(0,B.jsx)(`ul`,{"aria-label":`Files changed`,className:`m-0 flex list-none flex-col p-0`,children:o.map(e=>(0,B.jsxs)(`li`,{className:`flex min-h-9 min-w-0 items-center gap-3 border-t border-line-soft text-sm first:border-t-0`,children:[(0,B.jsx)(`span`,{className:`w-[52px] flex-none text-[12px] text-muted`,children:ze[e.action]||e.action.charAt(0).toUpperCase()+e.action.slice(1)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,B.jsx)(L,{path:e.path})})]},e.path))}),(0,B.jsx)(`p`,{className:`m-0 text-[12.5px] text-muted`,children:`Their diffs were not kept for this run.`})]}),!e.edits.length&&!o.length&&!e.results.length&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No files changed.`}),e.edits.some(e=>!e.diffs.length)&&(0,B.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 Ve({final:e,answer:t}){let n=e.from===`agent`?t?.files??[]:[],r=e.from!==`agent`,i=Math.max(2,...(e.text.match(/`+/g)||[]).map(e=>e.length)),a="`".repeat(i+1);return(0,B.jsxs)(U,{title:`Final message`,icon:(0,B.jsx)(we,{size:18,"aria-hidden":`true`}),aside:(0,B.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,B.jsx)(Ie,{text:r?`${a}text\n${e.text}\n${a}`:Se(e.text),height:420}),n.length>0&&(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`text-muted`,children:`Files it names:`}),n.map(e=>(0,B.jsx)(L,{path:e},e))]})]})}var He={rule:{icon:g,label:`Rulebook`},decision:{icon:C,label:`Test decisions`},memory:{icon:i,label:`Page memory`},replay:{icon:oe,label:`Replays`},model:{icon:k,label:`Model`},skill:{icon:d,label:`Skills`}};function Ue({list:e}){let t=Object.keys(He).filter(t=>e.some(e=>e.kind===t));return(0,B.jsx)(U,{title:`Learnings`,icon:(0,B.jsx)(l,{icon:f,size:18}),aside:e.length?(0,B.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[e.length,` from this session`]}):void 0,children:e.length===0?(0,B.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,B.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(280px,1fr))] gap-x-6 gap-y-3`,children:t.map(t=>{let{icon:n,label:r}=He[t];return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,B.jsxs)(`h4`,{className:`m-0 flex items-center gap-1.5 text-[13px] font-medium text-muted`,children:[(0,B.jsx)(l,{icon:n,size:14}),r]}),(0,B.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.filter(e=>e.kind===t).map((e,t)=>(0,B.jsxs)(`li`,{className:`flex flex-col gap-0.5 border-t border-line-soft py-1.5 text-sm first:border-t-0`,children:[(0,B.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.text}),e.note&&(0,B.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.note})]},t))})]},t)})})})}function We({run:e}){let t=[];return(e.executions.length||e.kind===`execution`)&&t.push({kind:`execution`,node:(0,B.jsx)(Pe,{list:e.executions},`e`)}),(e.reports.length||e.kind===`report`)&&t.push({kind:`report`,node:(0,B.jsx)(Fe,{list:e.reports},`r`)}),e.coding&&(e.coding.edits.length||e.coding.results.length||e.kind===`coding`)&&t.push({kind:`coding`,node:(0,B.jsx)(Be,{c:e.coding,files:e.files},`c`)}),t.sort((t,n)=>Number(n.kind===e.kind)-Number(t.kind===e.kind)),(0,B.jsx)(B.Fragment,{children:t.map(e=>e.node)})}var Ge={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`}},Ke={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`},qe=e=>Ke[e]||e.charAt(0).toUpperCase()+e.slice(1),G=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`})},K=(e,t)=>Math.max(0,Math.round(((e.status===`running`?t:Date.parse(e.lastAt))-Date.parse(e.startedAt))/1e3)),q=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`:`–`,J=e=>e.usage.input+e.usage.output;function Je(e){let[t,n]=(0,z.useState)(Date.now());return(0,z.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function Y({r:e}){return e.origin.kind===`web`?(0,B.jsxs)(`a`,{href:D(`chats`,e.origin.chat),className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(l,{icon:r,size:14}),`Web chat`]}):e.origin.kind===`job`?(0,B.jsxs)(`a`,{href:D(`jobs`,encodeURIComponent(e.origin.job)),className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(l,{icon:m,size:14}),`Job`]}):(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-muted`,children:[(0,B.jsx)(l,{icon:T,size:14}),`Terminal`]})}function Ye({status:e}){let t=Ge[e].label;return e===`running`?(0,B.jsx)(h,{size:16,"aria-label":t,className:`flex-none animate-spin text-accent-fg`}):e===`done`?(0,B.jsx)(me,{size:16,"aria-label":t,className:`flex-none text-pass`}):e===`failed`?(0,B.jsx)(v,{size:16,"aria-label":t,className:`flex-none text-fail`}):(0,B.jsx)(le,{size:16,"aria-label":t,className:`flex-none text-muted`})}var X=e=>e.status!==`running`&&!e.tools&&!e.turns&&!J(e)&&!e.files.length&&!e.outputs.length&&K(e,0)<2;function Xe(e){return/^forgeqe(-|$)|^engine$/.test(e)?c(e).name:e&&e.charAt(0).toUpperCase()+e.slice(1)}function Z({label:e,children:t}){return(0,B.jsxs)(`div`,{className:`grid grid-cols-[120px_minmax(0,1fr)] items-baseline gap-3 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,B.jsx)(`span`,{className:`text-[13px] text-muted`,children:e}),(0,B.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:t})]})}function Q({title:e,children:t}){return(0,B.jsxs)(`section`,{className:`flex min-w-0 flex-col`,children:[(0,B.jsx)(`h3`,{className:`m-0 mb-1 text-[14px] font-semibold`,children:e}),t]})}var Ze={rerun:fe,write_test:t,investigate:te,fix_test:S};function Qe({actions:e}){let[t,n]=(0,z.useState)(``),[r,i]=(0,z.useState)(``);if(!e.length)return null;let a=async e=>{n(e.prompt),i(``);try{let{id:t}=await w.start(e.prompt,{});location.hash=D(`chats`,t)}catch(e){i(e.message),n(``)}};return(0,B.jsxs)(`section`,{"aria-label":`Next steps`,className:`flex flex-col gap-2`,children:[(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map((e,n)=>(0,B.jsxs)(b,{disabled:!!t,onClick:()=>void a(e),"data-tip":e.note||void 0,className:`max-w-full min-w-0`,children:[(0,B.jsx)(l,{icon:Ze[e.kind],size:16,className:`flex-none`}),(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:t===e.prompt?`Opening a chat…`:e.label}),e.note&&(0,B.jsx)(`span`,{className:`min-w-0 flex-[1_1_0] truncate font-normal text-ink-2`,children:e.note})]},n))}),(0,B.jsx)(`span`,{className:`text-[12px] text-muted`,children:`Each opens a chat with the request; it asks before it changes anything.`}),r&&(0,B.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:r})]})}var $e=e=>`\`${e.replace(/`/g,``)}\``,et=[`summary`,`conversation`,`activity`,`details`],tt=e=>et.find(t=>t===e)??`summary`;function nt({name:e,tab:t}){let[r,i]=(0,z.useState)(null),[a,o]=(0,z.useState)(``),[s,c]=(0,z.useState)(!1),l=tt(t),d=t=>location.hash=t===`summary`?D(`runs`,encodeURIComponent(e)):D(`runs`,encodeURIComponent(e),t),f=(0,z.useCallback)(()=>{F.detail(e).then(e=>{i(e),o(``)},e=>o(e.message))},[e]);(0,z.useEffect)(f,[f]);let p=r?.status===`running`;(0,z.useEffect)(()=>{if(!p)return;let e=setInterval(f,2e3);return()=>clearInterval(e)},[f,p]);let m=Je(p),h=(0,z.useMemo)(()=>(r?.events??[]).map(xe).filter(e=>!!e),[r?.events]),g=async()=>{c(!0),o(``);try{await F.cancel(e),f()}catch(e){o(e.message)}finally{c(!1)}},_=(0,B.jsxs)(`a`,{href:D(`runs`),className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,B.jsx)(pe,{size:16,"aria-hidden":`true`}),`All runs`]});if(!r)return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[_,a?(0,B.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:a}):(0,B.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})]});let v=Ge[r.status],y=!r.replies.length,x=!!r.final||r.executions.length>0||r.reports.length>0||!!(r.coding&&(r.coding.edits.length||r.coding.results.length))||r.learnings.length>0||r.outputs.length>0,S=[{id:`summary`,label:`Summary`},{id:`conversation`,label:y?`Command`:`Conversation`,n:r.replies.length||void 0},{id:`activity`,label:`Activity`,n:h.length||void 0},{id:`details`,label:`Details`}],C=new Set([...r.reports.map(e=>e.path),...r.executions.flatMap(e=>[e.report,e.folder])].filter(Boolean)),w=r.outputs.filter(e=>!C.has(e.path)),T=r.context?.limit?Math.round(r.context.tokens/r.context.limit*100):null;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[_,(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-3`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,B.jsx)(`h2`,{className:`m-0 min-w-0 text-[22px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:r.title}),(0,B.jsx)(P,{tone:v.tone,children:v.label})]}),(0,B.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-muted`,children:[(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(Ee,{kind:r.kind}),V[r.kind]]}),`· `,(0,B.jsx)(Y,{r}),`· `,G(r.startedAt),` · `,p?`running for `:`took `,q(K(r,m)),` · `,n(J(r)),` tokens`,r.profile?.model?` · ${r.profile.model}`:``]})]}),r.cancel&&(0,B.jsxs)(b,{variant:`danger`,disabled:s,onClick:()=>void g(),children:[(0,B.jsx)(he,{fill:`currentColor`,"aria-hidden":`true`}),s?`Stopping…`:r.cancel===`chat`?`Stop this chat's work`:`Cancel this job's run`]})]}),a&&(0,B.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a}),r.error&&(0,B.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[(0,B.jsx)(`strong`,{children:`What went wrong:`}),` `,r.error]}),!p&&(0,B.jsx)(Qe,{actions:r.actions??[]}),(0,B.jsx)(`div`,{role:`tablist`,"aria-label":`This run`,className:ye,children:S.map(e=>(0,B.jsxs)(`button`,{type:`button`,role:`tab`,id:`run-tab-${e.id}`,"aria-selected":l===e.id,"aria-controls":`run-panel-${e.id}`,onClick:()=>d(e.id),className:be(l===e.id),children:[e.label,e.n!==void 0&&(0,B.jsx)(`span`,{className:`text-[12px] text-muted tabular-nums`,children:e.n})]},e.id))}),(0,B.jsxs)(`div`,{role:`tabpanel`,id:`run-panel-${l}`,"aria-labelledby":`run-tab-${l}`,className:`flex min-w-0 flex-col gap-6`,children:[l===`summary`&&(0,B.jsxs)(B.Fragment,{children:[r.final&&(0,B.jsx)(Ve,{final:r.final,answer:r.answer}),(0,B.jsx)(We,{run:r}),w.length>0&&(0,B.jsx)(Q,{title:`What it produced (${w.length})`,children:w.map(e=>(0,B.jsx)(Z,{label:e.label,children:(0,B.jsx)(L,{path:e.path})},e.path))}),r.learnings.length>0&&(0,B.jsx)(Ue,{list:r.learnings}),!x&&(0,B.jsx)(ee,{className:`py-4`,children:p?`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.`})]}),l===`conversation`&&(y?(0,B.jsx)(I,{text:$e(r.prompt),className:`text-sm [&_p]:my-0`}):(0,B.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:r.replies.map((e,t)=>(0,B.jsxs)(`li`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`div`,{className:`self-end rounded-[14px] bg-surface-strong px-4 py-2.5 text-sm max-w-[85%]`,children:(0,B.jsx)(I,{text:e.ask,className:`[&_p]:my-0.5`})}),e.text&&(0,B.jsx)(I,{text:Se(e.text),className:`text-sm`}),e.error&&(0,B.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e.error})]},t))})),l===`activity`&&(r.archived?(0,B.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-3 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,B.jsx)(`code`,{className:`font-mono text-[13px]`,children:`.forgeqe/runs`}),`; its step-by-step activity was not.`]}):h.length?(0,B.jsx)(de,{timeline:!0,lines:h,start:r.startedAt,live:p,name:`forgeqe-run-${r.name.replace(/\.log$/,``)}.md`}):(0,B.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing logged yet.`})),l===`details`&&(0,B.jsxs)(`div`,{className:`grid items-start gap-x-12 gap-y-8 @3xl:grid-cols-2`,children:[(0,B.jsxs)(Q,{title:`Numbers`,children:[(0,B.jsx)(Z,{label:p?`Running for`:`Took`,children:q(K(r,m))}),(0,B.jsx)(Z,{label:`Tokens`,children:(0,B.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,B.jsxs)(`span`,{children:[n(J(r)),` `,(0,B.jsxs)(`span`,{className:`text-muted`,children:[`· `,n(r.usage.input),` read · `,n(r.usage.output),` written`,r.usage.cached?` · ${n(r.usage.cached)} cached`:``]})]}),(r.byAgent?.length??0)>1&&(0,B.jsx)(`span`,{className:`flex flex-col gap-0.5 text-[13px]`,children:r.byAgent.map(e=>(0,B.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-2`,children:Xe(e.agent)}),(0,B.jsx)(`span`,{className:`text-muted tabular-nums`,children:n(e.input+e.output)})]},e.agent))})]})}),(0,B.jsxs)(Z,{label:`Context`,children:[r.context?n(r.context.tokens):`–`,T!==null&&(0,B.jsxs)(`span`,{className:`text-muted`,children:[` of `,n(r.context.limit),` (`,T,`%)`]})]}),(0,B.jsxs)(Z,{label:`Tool calls`,children:[r.tools,` `,(0,B.jsxs)(`span`,{className:`text-muted`,children:[`in `,u(r.turns,`turn`)]})]})]}),(0,B.jsxs)(Q,{title:`Session`,children:[(0,B.jsx)(Z,{label:`Started by`,children:(0,B.jsx)(Y,{r})}),(0,B.jsx)(Z,{label:`Command`,children:qe(r.command)}),(0,B.jsx)(Z,{label:`Model`,children:r.profile?[r.profile.name,r.profile.model].filter(Boolean).join(` · `):`–`}),(0,B.jsx)(Z,{label:`Agents`,children:r.agents.length?(0,B.jsx)(`span`,{className:`flex flex-col gap-0.5`,children:r.agents.map(e=>(0,B.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:Xe(e.name)}),(0,B.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:u(e.calls,`call`)})]},e.name))}):(0,B.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,B.jsxs)(Z,{label:`Log`,children:[r.archived?(0,B.jsx)(`span`,{className:`text-muted`,children:`No longer kept: ForgeQE keeps the newest logs only`}):(0,B.jsx)(L,{path:`.forgeqe/logs/${r.name}`}),r.truncated&&(0,B.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Very long: only its start is shown.`})]})]}),r.job&&(0,B.jsxs)(Q,{title:`Job`,children:[(0,B.jsx)(Z,{label:`Job`,children:(0,B.jsx)(`a`,{href:D(`jobs`,encodeURIComponent(r.origin.kind===`job`?r.origin.job:r.job.name)),children:r.job.name})}),(0,B.jsx)(Z,{label:`Runs`,children:(0,B.jsx)(I,{text:$e(r.job.command),className:`text-sm [&_p]:my-0`})}),(0,B.jsxs)(Z,{label:`Schedule`,children:[r.job.schedule,!r.job.enabled&&` (disabled)`,r.job.nextAt&&r.job.enabled?` · next ${G(r.job.nextAt)}`:``]}),r.job.run&&(0,B.jsxs)(Z,{label:`This run`,children:[r.job.run.reason===`asked`?`Asked for`:`On schedule`,`, `,r.job.run.status.replace(`_`,` `),r.job.run.exitCode!==void 0&&r.job.run.exitCode!==null?`, exit ${r.job.run.exitCode}`:``]})]}),(0,B.jsx)(Q,{title:`Files worked on (${r.files.length})`,children:r.files.length?[...r.files].sort((e,t)=>Number(e.action===`read`)-Number(t.action===`read`)).map(e=>(0,B.jsx)(Z,{label:e.action===`write`?`Written`:e.action===`edit`?`Edited`:e.action===`delete`?`Deleted`:e.action?e.action.charAt(0).toUpperCase()+e.action.slice(1):`Changed`,children:e.action===`delete`?(0,B.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.path}):(0,B.jsx)(L,{path:e.path})},e.path)):(0,B.jsx)(`p`,{className:`m-0 py-1 text-sm text-muted`,children:`No files changed.`})}),(0,B.jsx)(Q,{title:`Notifications`,children:r.notifications.length?r.notifications.map(e=>(0,B.jsx)(Z,{label:e.event.replace(/_/g,` `),children:e.channels.length?e.channels.join(`, `):(0,B.jsx)(`span`,{className:`text-muted`,children:`No channel takes it`})},e.event)):(0,B.jsx)(`p`,{className:`m-0 py-1 text-sm text-muted`,children:r.origin.kind===`terminal`||r.origin.kind===`web`?`None: notify channels go with jobs, suites and the monitor.`:`No notify channels are set up (Settings, Notify).`})})]})]})]})}var $=25;function rt({runs:t}){let r=Je(t.some(e=>e.status===`running`)),[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(`all`),[c,l]=(0,z.useState)(``),[d,f]=(0,z.useState)(``),[p,m]=(0,z.useState)(!1),[h,g]=(0,z.useState)(0);(0,z.useEffect)(()=>g(0),[i,o,c,d,p]);let v=t.filter(X).length,y=i.toLowerCase().split(/\s+/).filter(Boolean),b=t.filter(e=>(p||!X(e))&&(!c||e.kind===c)&&(!d||e.origin.kind===d)&&y.every(t=>`${e.title} ${e.command} ${e.error||``}`.toLowerCase().includes(t))),x={all:b.length,running:b.filter(e=>e.status===`running`).length,failed:b.filter(e=>e.status===`failed`).length},S=o===`all`?b:b.filter(e=>e.status===o),C=Math.max(1,Math.ceil(S.length/$)),w=Math.min(h,C-1),T=S.slice(w*$,w*$+$),E=t.filter(e=>e.status!==`running`&&!X(e)),O=E.filter(e=>e.status===`failed`).length,te=E.length?E.reduce((e,t)=>e+K(t,r),0)/E.length:NaN,ne=t.reduce((e,t)=>e+J(t),0),k=[...new Set(t.map(e=>e.kind))],A=[...new Set(t.map(e=>e.origin.kind))],j={web:`Web chat`,job:`Job`,terminal:`Terminal`};return t.length===0?(0,B.jsx)(ee,{icon:re,title:`No runs yet`,children:`A chat here, a job, or a ForgeQE command in this project adds one.`}):(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-1 text-[13px] text-muted`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-ink tabular-nums`,children:t.length-v}),` runs`]}),t.some(e=>e.status===`running`)&&(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-accent-fg tabular-nums`,children:t.filter(e=>e.status===`running`).length}),` running now`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:M(`tabular-nums`,O?`text-fail`:`text-ink`),children:O}),` failed`,E.length?` (${Math.round(O/E.length*100)}%)`:``]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-ink tabular-nums`,children:n(ne)}),` tokens`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{className:`text-ink tabular-nums`,children:q(Math.round(te))}),` on average`]})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(ie,{id:`run-search`,label:`Find a run`,value:i,onChange:a,placeholder:`Find a run by what was asked`}),(0,B.jsx)(_,{items:[{id:`all`,label:`All`,n:x.all},{id:`running`,label:`Running`,n:x.running},{id:`failed`,label:`Failed`,n:x.failed,alert:!0}],value:o,onChange:s}),k.length>1&&(0,B.jsxs)(N,{size:`sm`,"aria-label":`What it did`,value:c,onChange:e=>l(e.target.value),className:`w-auto pr-7 pl-3`,children:[(0,B.jsx)(`option`,{value:``,children:`Any kind`}),k.map(e=>(0,B.jsx)(`option`,{value:e,children:V[e]},e))]}),A.length>1&&(0,B.jsxs)(N,{size:`sm`,"aria-label":`Started by`,value:d,onChange:e=>f(e.target.value),className:`w-auto pr-7 pl-3`,children:[(0,B.jsx)(`option`,{value:``,children:`Started anywhere`}),A.map(e=>(0,B.jsx)(`option`,{value:e,children:j[e]||e},e))]})]}),(0,B.jsxs)(`div`,{className:`rounded-[14px] card border`,children:[(0,B.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-[12px] font-semibold text-muted @3xl:grid`,children:[(0,B.jsx)(`span`,{className:`w-4`}),(0,B.jsx)(`span`,{children:`Run`}),(0,B.jsx)(`span`,{children:`Kind`}),(0,B.jsx)(`span`,{children:`Started by`}),(0,B.jsx)(`span`,{className:`text-right`,children:`Took`}),(0,B.jsx)(`span`,{className:`text-right`,children:`Tokens`}),(0,B.jsx)(`span`,{className:`text-right`,children:`When`})]}),(0,B.jsxs)(`ul`,{"aria-label":`Runs`,className:`m-0 list-none p-1.5`,children:[T.length===0&&(0,B.jsx)(`li`,{className:`px-3 py-4 text-sm text-muted`,children:`Nothing matches.`}),T.map((e,t)=>{let i=R(e.startedAt);return(0,B.jsxs)(`li`,{className:`contents`,children:[(t===0||R(T[t-1].startedAt)!==i)&&(0,B.jsx)(`span`,{className:`block px-3 pt-3 pb-1 text-[12px] font-semibold text-muted`,children:i}),(0,B.jsxs)(`a`,{href:D(`runs`,encodeURIComponent(e.name)),className:`grid min-h-12 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 rounded-[10px] px-3 py-1.5 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,B.jsx)(Ye,{status:e.status}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,B.jsx)(`span`,{className:`truncate text-[14px] font-medium`,"data-tip":e.title,children:e.title}),e.error?(0,B.jsx)(`span`,{className:`truncate text-[12px] text-fail`,children:e.error}):(0,B.jsx)(`span`,{className:`truncate text-[12px] text-muted @3xl:hidden`,children:[V[e.kind],j[e.origin.kind],q(K(e,r)),`${n(J(e))} tokens`].join(` · `)})]}),(0,B.jsxs)(`span`,{className:`hidden min-w-0 items-center gap-1.5 text-[13px] text-ink-2 @3xl:inline-flex`,children:[(0,B.jsx)(Ee,{kind:e.kind}),V[e.kind]]}),(0,B.jsx)(`span`,{className:`hidden text-[13px] text-ink-2 @3xl:block`,children:j[e.origin.kind]||e.origin.kind}),(0,B.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:q(K(e,r))}),(0,B.jsx)(`span`,{className:`hidden text-right text-[13px] text-muted tabular-nums @3xl:block`,children:n(J(e))}),(0,B.jsx)(`span`,{className:`text-right text-[12.5px] text-muted tabular-nums`,"data-tip":G(e.startedAt),children:ve(e.startedAt)})]})]},e.name)})]}),(0,B.jsx)(e,{page:w,size:$,total:S.length,onPage:g,label:`Pages of runs`,children:v>0&&(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`button`,{type:`button`,onClick:()=>m(!p),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:p?`Hide the ${u(v,`empty session`)}`:`${u(v,`empty session`)} hidden`})]})})]})]})}function it({sub:e}){let[t,n]=(0,z.useState)(null),[r,i]=(0,z.useState)(``),a=(0,z.useCallback)(()=>{F.list().then(e=>{n(e.runs),i(``)},e=>i(e.message))},[]);(0,z.useEffect)(a,[a]);let o=t?.some(e=>e.status===`running`);(0,z.useEffect)(()=>{if(e)return;let t=setInterval(a,o?3e3:2e4);return()=>clearInterval(t)},[a,o,e]);let[s,c]=(e||``).split(`/`),l=s?decodeURIComponent(s):``;return(0,B.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,B.jsx)(j,{}),(0,B.jsx)(`main`,{className:M(ge,`@container flex-auto gap-4`),children:l?(0,B.jsx)(nt,{name:l,tab:c},l):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(se,{pixel:A.runs,size:`lg`}),(0,B.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Runs`})]}),(0,B.jsx)(`p`,{className:`m-0 max-w-[70ch] 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,B.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r}),!t&&!r&&(0,B.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,B.jsx)(rt,{runs:t})]})})]})}export{it as Runs,Ye as StatusIcon,tt as runTab};