@capagents/forgeqe 2.6.7 → 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.
- package/HOW_TO_USE.md +2 -2
- package/dist/docs-site/docs/index.html +3 -3
- package/dist/docs-site/docs/model-routing/index.html +1 -1
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/docs-site/docs/web-app/index.html +14 -9
- package/dist/forgeqe.js +1211 -1210
- package/dist/web/assets/Agent-BM6E-VB0.js +4 -0
- package/dist/web/assets/ApiTests-C5d7bkXm.js +10 -0
- package/dist/web/assets/Chat-D9JQ9cu_.js +3 -0
- package/dist/web/assets/Data-DDbhee1a.js +3 -0
- package/dist/web/assets/Evidence-_lZ3esVH.js +1 -0
- package/dist/web/assets/Features-B66ac5MV.js +1 -0
- package/dist/web/assets/Jobs-DYk-sYUM.js +5 -0
- package/dist/web/assets/KindPage-CxnmiL82.js +6 -0
- package/dist/web/assets/Migration-B_U_b1nf.js +2 -0
- package/dist/web/assets/Product-DGNdstwf.js +1 -0
- package/dist/web/assets/Quality-B4EhNeTq.js +1 -0
- package/dist/web/assets/Record-CVMQ4Hjt.js +2 -0
- package/dist/web/assets/Regression-CvHEFhiq.js +5 -0
- package/dist/web/assets/Reports-BHaomqX9.js +2 -0
- package/dist/web/assets/Response-DW5m211p.js +4 -0
- package/dist/web/assets/Runs-hbJakq0Q.js +2 -0
- package/dist/web/assets/Shell-S47lWQWa.js +3 -0
- package/dist/web/assets/TestCases-DYCsex4G.js +1 -0
- package/dist/web/assets/TestData-C7_npkCW.js +2 -0
- package/dist/web/assets/{WhatsNew-CDUGGomx.js → WhatsNew-BnuvSOPs.js} +1 -1
- package/dist/web/assets/{arrow-down-DNipP8bN.js → arrow-down-dgw_SWAN.js} +1 -1
- package/dist/web/assets/{arrow-right-3diDdbrG.js → arrow-right-NAWkj6gQ.js} +1 -1
- package/dist/web/assets/circle-Cg6_419C.js +1 -0
- package/dist/web/assets/{circle-dashed-KlSRxdRt.js → circle-dashed-CBDGSDRm.js} +1 -1
- package/dist/web/assets/{circle-dot-CyXWfSFI.js → circle-dot-KBCD8ZM0.js} +1 -1
- package/dist/web/assets/dataParts-RK75MdJ3.js +3 -0
- package/dist/web/assets/index-BiJ_Nvm1.css +2 -0
- package/dist/web/assets/index-Dxug1-bt.js +43 -0
- package/dist/web/assets/{keyboard-DLO6H_RC.js → keyboard-D1hh9hbZ.js} +1 -1
- package/dist/web/assets/{pencil-q2eQBct0.js → pencil-BgW3hRhM.js} +1 -1
- package/dist/web/assets/{productParts-CCIZ-xzs.js → productParts-E2GeSekc.js} +1 -1
- package/dist/web/assets/qualityParts-ejfvRM41.js +1 -0
- package/dist/web/assets/segmented-DkcA7fWs.js +1 -0
- package/dist/web/assets/{thread-DJKWZFQL.js → thread-D64HDvgz.js} +1 -1
- package/dist/web/assets/{upload-OfrEvr0l.js → upload-a2jTB_Hi.js} +1 -1
- package/dist/web/assets/{usePageChat-BaearoXT.js → usePageChat-cEyYdC42.js} +1 -1
- package/dist/web/index.html +3 -3
- package/docs/MODEL_ROUTING.md +1 -1
- package/docs/WEB_APP.md +14 -9
- package/docs/user-guide.html +3 -3
- package/forgeqe.example.yaml +2 -1
- package/package.json +1 -1
- package/dist/web/assets/Agent-CwOEhl3M.js +0 -4
- package/dist/web/assets/ApiTests-ebwSDQ5F.js +0 -10
- package/dist/web/assets/Chat-fc4s0KBG.js +0 -3
- package/dist/web/assets/Data-BBSVyXif.js +0 -3
- package/dist/web/assets/Evidence-xQn-8UJ5.js +0 -1
- package/dist/web/assets/Features-DMprjJBi.js +0 -1
- package/dist/web/assets/Jobs-C5JjDoQC.js +0 -5
- package/dist/web/assets/KindPage-Gf-RWsx6.js +0 -6
- package/dist/web/assets/Migration-Cbc7TAP9.js +0 -2
- package/dist/web/assets/Product-B6SRmrz4.js +0 -1
- package/dist/web/assets/Quality-DfcLg8mD.js +0 -1
- package/dist/web/assets/Record-BDZoXfKO.js +0 -2
- package/dist/web/assets/Regression-F1U3vWLw.js +0 -5
- package/dist/web/assets/Reports-C2r9-5sZ.js +0 -2
- package/dist/web/assets/Response-BGXyV_fV.js +0 -4
- package/dist/web/assets/Runs--yZ27eAW.js +0 -2
- package/dist/web/assets/Shell-DFE3OHxz.js +0 -3
- package/dist/web/assets/TestCases-BE_KAXkn.js +0 -1
- package/dist/web/assets/TestData-BY-Uy6yE.js +0 -2
- package/dist/web/assets/circle-2Nb63Bbk.js +0 -1
- package/dist/web/assets/dataParts-CqEfwqh-.js +0 -3
- package/dist/web/assets/index-j5ulUL9f.js +0 -43
- package/dist/web/assets/index-tEriRdXB.css +0 -2
- package/dist/web/assets/qualityParts-Bhq6Zhdf.js +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{An as e,Bt as t,Cn as n,Ct as r,Di as i,Et as a,Gt as o,Ht as s,Jn as c,Kt as l,Lr as u,Lt as d,Mt as f,Qn as p,Si as m,Sr as h,St as g,Un as _,Ut as ee,Wt as v,Xn as y,at as te,cn as ne,dn as b,er as re,fn as ie,gr as ae,jn as oe,ln as se,ot as ce,qt as le,rn as ue,sr as de,tn as x,un as fe,wi as pe,xr as S,yt as C}from"./Shell-DFE3OHxz.js";import{B as w,F as me,U as he,a as ge,i as T,r as E}from"./index-j5ulUL9f.js";import{c as _e,i as ve,o as ye,r as be,s as D,t as xe}from"./thread-DJKWZFQL.js";var O={name:`crosshair`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]};O.node;var Se=u(O),k={name:`file-pen`,size:24,node:[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]],aliases:[`file-edit`]};k.node;var A=u(k),j={name:`file-search`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]};j.node;var Ce=u(j),M={name:`forward`,size:24,node:[[`path`,{d:`m15 17 5-5-5-5`,key:`nf172w`}],[`path`,{d:`M4 18v-2a4 4 0 0 1 4-4h12`,key:`jmiej9`}]]};M.node;var we=u(M),N={name:`git-fork`,size:24,node:[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]};N.node;var Te=u(N),P={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};P.node;var Ee=u(P),F=i(pe(),1),I=m();function L({diff:e,className:t}){let n=0,r=0,i=e.split(`
|
|
2
|
-
`).flatMap((e,t)=>{if(/^(diff |index |--- |\+\+\+ )/.test(e))return[];let i=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(e);return i?(n=Number(i[1]),r=Number(i[2]),[{key:t,kind:`hunk`,text:e,a:``,b:``}]):e.startsWith(`+`)?[{key:t,kind:`add`,text:e.slice(1),a:``,b:String(r++)}]:e.startsWith(`-`)?[{key:t,kind:`del`,text:e.slice(1),a:String(n++),b:``}]:e.startsWith(`\\`)?[{key:t,kind:`hunk`,text:e,a:``,b:``}]:[{key:t,kind:`same`,text:e.startsWith(` `)?e.slice(1):e,a:String(n++),b:String(r++)}]});return(0,I.jsx)(`div`,{className:v(`max-h-[420px] overflow-auto rounded-[10px] border border-line-soft bg-bg font-mono text-[12px] leading-[1.6]`,t),children:(0,I.jsx)(`table`,{className:`w-full border-collapse`,children:(0,I.jsx)(`tbody`,{children:i.map(e=>(0,I.jsxs)(`tr`,{className:e.kind===`add`?`bg-pass-soft`:e.kind===`del`?`bg-fail-soft`:e.kind===`hunk`?`bg-surface-muted`:void 0,children:[(0,I.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.a}),(0,I.jsx)(`td`,{className:`w-10 px-2 text-right align-top text-muted tabular-nums select-none`,children:e.b}),(0,I.jsx)(`td`,{"aria-hidden":`true`,className:v(`w-4 align-top select-none`,e.kind===`add`?`text-pass`:e.kind===`del`?`text-fail`:`text-muted`),children:e.kind===`add`?`+`:e.kind===`del`?`−`:``}),(0,I.jsxs)(`td`,{className:v(`pr-3 align-top whitespace-pre`,e.kind===`hunk`?`text-muted`:`text-ink`),children:[(0,I.jsx)(`span`,{className:`sr-only`,children:e.kind===`add`?`added: `:e.kind===`del`?`removed: `:``}),e.text||` `]})]},e.key))})})})}function R({review:e,className:t}){return(0,I.jsxs)(`div`,{className:v(`flex flex-col gap-2 text-[13px] leading-relaxed`,t),children:[e.summary&&(0,I.jsx)(`p`,{className:`m-0 text-ink-2 [overflow-wrap:anywhere]`,children:e.summary}),e.issues.length>0&&(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.issues.map((e,t)=>(0,I.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,I.jsx)(`span`,{className:v(`mt-px flex-none rounded-full px-2 py-px text-[11.5px] font-medium`,e.kind===`correctness`?`bg-fail-soft text-fail`:`bg-surface-strong text-ink-2`),children:e.kind===`correctness`?`Correctness`:`Standards`}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[e.file&&(0,I.jsx)(`span`,{className:`font-mono text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.file}),(0,I.jsx)(`span`,{className:`text-ink [overflow-wrap:anywhere]`,children:e.problem}),e.fix&&(0,I.jsxs)(`span`,{className:`text-muted [overflow-wrap:anywhere]`,children:[`Fix: `,e.fix]})]})]},t))})]})}var De={done:`border-pass/35`,active:`border-accent/35`,pending:`border-line-strong`,failed:`border-fail/35`,skipped:`border-line-strong`,note:`border-line-strong`};function z({status:t,orb:n,px:r=20,spin:i=!1}){let a={width:r,height:r};return t===`active`&&i?(0,I.jsx)(`span`,{role:`img`,"aria-label":`At work`,className:`flex flex-none items-center justify-center`,style:a,children:(0,I.jsx)(e,{size:r-2,strokeWidth:2.5,"aria-hidden":`true`,className:`animate-spin text-accent-fg motion-reduce:animate-none`})}):t===`active`?(0,I.jsx)(g,{state:n,px:r,label:`At work`}):t===`done`?(0,I.jsx)(`span`,{role:`img`,"aria-label":`Done`,className:`flex flex-none items-center justify-center rounded-full bg-pass`,style:a,children:(0,I.jsx)(h,{size:r*.6,strokeWidth:3,"aria-hidden":`true`,className:`text-bg`})}):t===`failed`?(0,I.jsx)(`span`,{role:`img`,"aria-label":`Failed`,className:`flex flex-none items-center justify-center rounded-full bg-fail`,style:a,children:(0,I.jsx)(l,{size:r*.6,strokeWidth:3,"aria-hidden":`true`,className:`text-bg`})}):t===`note`?(0,I.jsx)(`span`,{role:`img`,"aria-label":`Note`,className:`flex flex-none items-center justify-center`,style:a,children:(0,I.jsx)(`span`,{className:`size-1.5 rounded-full bg-line-strong`})}):(0,I.jsx)(`span`,{role:`img`,"aria-label":t===`skipped`?`Skipped`:`To come`,className:v(`box-border block flex-none rounded-full border-2 border-line-strong`,t===`skipped`&&`border-dashed`),style:a})}var Oe=(e,t)=>e.status===`running`?t?`active`:`done`:e.status===`ok`?`done`:e.status===`fail`?`failed`:`note`,ke={read:p,search:b,list:c,edit:A,run:x,element:Se,outline:oe,references:Te,impact:n,find:Ce,testfile:y,web:_,environment:se,cases:ae,browser:_,post:fe,test:y,retry:me,review:ne,task:we,work:le},Ae={done:`text-pass`,failed:`text-fail`,active:`text-accent-fg animate-pulse motion-reduce:animate-none`,pending:`text-muted`,skipped:`text-muted`,note:`text-muted`},B={done:`Done`,failed:`Failed`,active:`At work`,pending:`To come`,skipped:`Skipped`,note:`Note`};function je({kind:e,status:t}){let n=v(`mt-px flex size-4 flex-none items-center justify-center`,Ae[t]);if(e===`skill`)return(0,I.jsxs)(`span`,{role:`img`,"aria-label":B[t],className:v(n,`relative`),children:[(0,I.jsx)(ee,{name:ce.skills,px:15}),(t===`done`||t===`failed`)&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:v(`absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full ring-1 ring-bg`,t===`done`?`bg-pass`:`bg-fail`)})]});let r=ke[e];return(0,I.jsx)(`span`,{role:`img`,"aria-label":B[t],className:n,children:(0,I.jsx)(r,{size:15,strokeWidth:2,"aria-hidden":`true`})})}function Me({status:t}){return t===`active`?(0,I.jsx)(e,{size:12,strokeWidth:2.5,"aria-label":`At work`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}):(0,I.jsx)(`span`,{role:`img`,"aria-label":B[t],className:v(`mt-[7px] size-2 flex-none rounded-full`,t===`done`?`bg-pass`:t===`failed`?`bg-fail`:`bg-line-strong`)})}function V({text:e,label:t}){let[n,r]=(0,F.useState)(!1);return(0,I.jsx)(`button`,{type:`button`,"aria-label":n?`Copied`:t,"data-tip":n?`Copied`:t,onClick:async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)}catch{}},className:`flex size-6 flex-none cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted opacity-0 group-hover:opacity-100 hover:bg-surface-strong hover:text-ink focus-visible:opacity-100`,children:n?(0,I.jsx)(h,{size:13,"aria-hidden":`true`,className:`text-pass`}):(0,I.jsx)(w,{size:13,"aria-hidden":`true`})})}function Ne({step:e,failed:t}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1 py-0.5 font-mono text-[12px] leading-relaxed`,children:[e.command&&(0,I.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2 text-muted`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none select-none`,children:`$`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.command}),(0,I.jsx)(V,{text:e.command,label:`Copy the command`})]}),e.output&&(0,I.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none text-muted select-none`,children:`⎿`}),(0,I.jsx)(`pre`,{className:v(`m-0 max-h-56 min-w-0 flex-1 overflow-auto font-mono text-[12px] leading-relaxed whitespace-pre-wrap [overflow-wrap:anywhere]`,t?`text-fail`:`text-ink-2`),children:e.output}),(0,I.jsx)(V,{text:e.output,label:`Copy the output`})]})]})}var Pe=e=>/[/\\]|\.\w{1,5}$|^\$ /.test(e)&&!/\s{2,}/.test(e);function H({text:e}){return(0,I.jsx)(`span`,{className:v(`min-w-0 max-w-full truncate rounded-md bg-surface-strong px-1.5 py-0.5 text-[12.5px] text-ink-2`,Pe(e)&&`font-mono text-[12px]`),children:e})}function Fe({step:e}){return(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] leading-relaxed`,children:e.lines.map((e,t)=>(0,I.jsxs)(`li`,{className:v(`flex gap-1.5 [overflow-wrap:anywhere]`,e.ok===!0?`text-pass`:e.ok===!1?`text-fail`:`text-ink-2`),children:[e.ok!==void 0&&(0,I.jsx)(`span`,{"aria-hidden":`true`,children:e.ok?`✓`:`✗`}),(0,I.jsx)(T,{text:e.text,className:`min-w-0 text-[13px] leading-relaxed text-inherit [&_p]:my-0`})]},t))})}function U({agent:e,named:t=!0,working:n=!1}){let i=f(e);return(0,I.jsxs)(`span`,{className:`inline-flex flex-none items-center gap-1.5`,"data-tip":i.name,children:[(0,I.jsx)(r,{agent:e,px:18,decorative:t,working:n}),t&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`font-medium`,style:{color:i.hue},children:i.name}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`·`})]})]})}function W({step:e,from:t,live:n}){let i=e.handoff.agent,a=f(i);return(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5`,children:[(0,I.jsx)(r,{agent:t,px:18}),(0,I.jsxs)(`span`,{role:`img`,"aria-label":`hands off to`,className:v(`handoff-flow flex-none`,n&&`is-live`),style:{color:a.hue},children:[(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{})]}),(0,I.jsx)(r,{agent:i,px:20,decorative:!0,working:n,className:`handoff-in`}),(0,I.jsx)(`span`,{className:`font-medium`,style:{color:a.hue},children:a.name}),e.arg&&(0,I.jsx)(H,{text:e.arg})]})}function G({step:e,working:t,from:n=a}){let r=e.agent||n,i=K(e),o=Oe(e,t),[s,c]=(0,F.useState)(null),l=s??((!!e.handoff||!!e.agent||e.key.startsWith(`try:`))&&o===`active`),u=(0,I.jsxs)(I.Fragment,{children:[e.handoff?(0,I.jsx)(z,{status:o,orb:e.orb,px:14,spin:!0}):!(e.icon&&r===n)&&(0,I.jsx)(Me,{status:o}),e.handoff?(0,I.jsx)(W,{step:e,from:n,live:o===`active`}):(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5`,children:[r!==n||!e.icon?(0,I.jsx)(U,{agent:r,named:r!==n,working:o===`active`}):(0,I.jsx)(je,{kind:e.icon,status:o}),(0,I.jsx)(`span`,{className:v(`[overflow-wrap:anywhere]`,o===`active`?`text-ink`:`text-ink-2`),children:e.label}),e.arg&&(0,I.jsx)(H,{text:e.arg}),e.change&&(0,I.jsxs)(`span`,{className:`font-mono text-[12px] tabular-nums`,children:[(0,I.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.change.added]}),` `,(0,I.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.change.removed]})]})]}),i&&(0,I.jsx)(S,{size:14,"aria-hidden":`true`,className:v(`mt-0.5 ml-auto flex-none text-muted transition-transform`,l&&`rotate-180`)})]});return(0,I.jsxs)(`li`,{className:`flex flex-col`,children:[i?(0,I.jsx)(`button`,{type:`button`,"aria-expanded":l,onClick:()=>c(!l),className:`flex min-h-8 w-full cursor-pointer items-start gap-2 rounded-lg border-0 bg-transparent px-1.5 py-1.5 text-left text-[13.5px] hover:bg-surface-muted`,children:u}):(0,I.jsx)(`div`,{className:`flex min-h-8 items-start gap-2 px-1.5 py-1.5 text-[13.5px]`,children:u}),i&&(0,I.jsx)(C,{open:l,children:(0,I.jsx)(q,{step:e,working:t,from:n,className:`mb-1 ml-[13px]`})})]})}var K=e=>e.lines.length>0||(e.children?.length??0)>0||!!e.handoff?.result||!!e.change||!!e.output||!!e.command||!!e.review;function q({step:e,working:t,from:n,className:r}){let i=e.children||[],a=e.handoff?.agent||e.agent;return(0,I.jsxs)(`div`,{className:v(`flex flex-col gap-1.5 border-l border-dotted py-1 pl-3`,r),style:{borderColor:a?`${f(a).hue}59`:`var(--color-line-strong)`},children:[(e.output||e.command)&&(0,I.jsx)(Ne,{step:e,failed:e.status===`fail`}),e.review&&(0,I.jsx)(R,{review:e.review}),e.lines.length>0&&(0,I.jsx)(Fe,{step:e}),e.change&&(0,I.jsx)(L,{diff:e.change.diff}),i.length>0&&(0,I.jsx)(`ul`,{"aria-label":a?`What ${d(f(a).name)} did`:`Steps`,className:`m-0 flex list-none flex-col p-0`,children:i.map(e=>(0,I.jsx)(G,{step:e,working:t,from:a||n},e.key))}),e.handoff?.result&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-0.5 text-[13px]`,children:[(0,I.jsxs)(`span`,{className:`text-muted`,children:[d(f(e.handoff.agent).name,!0),` answered`]}),(0,I.jsx)(T,{text:e.handoff.result.length>1200?`${e.handoff.result.slice(0,1199)}…`:e.handoff.result,className:`text-[13px] text-ink-2 [&_p]:my-0`})]})]})}function Ie({node:e,last:t,working:n,now:r,orbed:i}){let a=e.step?[]:e.steps,o=e.step,s=a.length>0||!!r||!!o&&K(o),[c,l]=(0,F.useState)(null),u=c??(e.status===`active`||e.status===`failed`),d=o?.orb??[...a].reverse().find(e=>e.status===`running`)?.orb??r?.orb??`thinking`;return(0,I.jsxs)(`li`,{className:`flex gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-none flex-col items-center`,children:[(0,I.jsx)(`span`,{className:`mt-[3px]`,children:(0,I.jsx)(z,{status:e.status,orb:d,spin:!i})}),!t&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:v(`mt-1.5 min-h-4 w-0 flex-1 border-l border-dotted`,De[e.status])})]}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col pb-2`,children:[s?(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":u,onClick:()=>l(!u),className:`flex min-h-7 w-full cursor-pointer items-start gap-1.5 border-0 bg-transparent p-0 text-left`,children:[(0,I.jsx)(J,{node:e}),(0,I.jsx)(S,{size:14,"aria-hidden":`true`,className:v(`mt-1 flex-none text-muted transition-transform`,u&&`rotate-180`)}),e.status===`active`&&(0,I.jsx)(`span`,{className:`mt-0.5 ml-1 flex-none rounded-full border border-accent-line bg-accent-soft px-2 py-px text-[11.5px] font-medium text-accent-fg`,children:`In progress`})]}):(0,I.jsx)(`div`,{className:`min-h-7`,children:(0,I.jsx)(J,{node:e})}),s&&(0,I.jsx)(C,{open:u,className:`mt-0.5`,children:o?(0,I.jsx)(q,{step:o,working:n,from:`forgeqe`,className:`mt-1`}):(0,I.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[a.map(e=>(0,I.jsx)(G,{step:e,working:n},e.key)),r&&(0,I.jsx)(`li`,{children:(0,I.jsx)(Y,{live:r,className:`px-1.5`})})]})})]})]})}function J({node:e}){let t=e.status===`active`?`text-ink`:e.status===`pending`||e.status===`skipped`?`text-muted`:e.status===`failed`?`text-fail`:`text-ink-2`,n=e.step;return n?.handoff?(0,I.jsx)(W,{step:n,from:a,live:e.status===`active`}):(0,I.jsxs)(`span`,{className:v(`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 text-sm font-medium`,t,e.status===`skipped`&&`line-through`),children:[n&&(0,I.jsx)(U,{agent:n.agent||`forgeqe`,named:!!n.agent&&n.agent!==`forgeqe`,working:e.status===`active`}),e.status===`active`?(0,I.jsx)(`span`,{className:`shimmer [overflow-wrap:anywhere]`,children:(0,I.jsx)(`span`,{children:e.label})}):(0,I.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.label}),n?.arg&&(0,I.jsx)(H,{text:n.arg})]})}var Le={info:`text-ink-2`,ok:`text-pass`,fail:`text-fail`,warn:`text-warn`,dim:`text-muted`,say:`text-ink-2`,you:`text-accent-fg`,think:`text-muted italic`};function Re(e){let[t,n]=(0,F.useState)(()=>Date.now());(0,F.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]);let r=e?Date.parse(e):NaN;if(Number.isNaN(r))return``;let i=Math.max(0,Math.round((t-r)/1e3));return i<2?`just now`:i<60?`${i}s ago`:`${Math.floor(i/60)} min ago`}function Y({live:e,orb:t=!1,className:n}){let r=Re(e.latest?.at);return(0,I.jsxs)(`div`,{className:v(`flex min-h-8 items-start gap-2 py-1`,n),children:[(0,I.jsx)(`span`,{className:`mt-0.5 flex size-4 flex-none items-center justify-center`,children:t?(0,I.jsx)(g,{state:e.orb,px:20,label:`At work`}):(0,I.jsxs)(`span`,{"aria-hidden":`true`,className:`relative flex size-2`,children:[(0,I.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-accent opacity-60 motion-reduce:animate-none`}),(0,I.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-accent`})]})}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,I.jsx)(`span`,{className:`shimmer text-[13.5px] font-medium text-muted`,children:(0,I.jsx)(`span`,{"aria-live":`polite`,children:e.text})}),e.latest&&(0,I.jsxs)(`button`,{type:`button`,onClick:e.onLog,"data-tip":`Open the activity log`,className:`flex w-full min-w-0 cursor-pointer items-baseline gap-2 border-0 bg-transparent p-0 text-left hover:underline`,children:[(0,I.jsx)(`span`,{className:v(`min-w-0 truncate font-mono text-[12px]`,Le[e.latest.tone]),children:e.latest.plain}),(0,I.jsxs)(`span`,{className:`flex-none text-[11.5px] whitespace-nowrap text-muted tabular-nums`,children:[r,r&&` · `,e.events,` `,e.events===1?`event`:`events`]})]})]})]})}function ze({turn:e,working:t,live:n,folded:r=!1}){if(r)return(0,I.jsx)(Y,{live:n,orb:!0});let i=be(e,t),a=e.plan.length>0&&t?i.find(e=>e.status===`active`)??null:null,o=t&&!a?[{key:`now`,label:n.text,status:`active`,steps:[]}]:[],s=[...i,...o],c=[...i].reverse().find(e=>e.status===`active`);return(0,I.jsx)(`ol`,{"aria-label":`What ForgeQE did`,className:`m-0 flex list-none flex-col p-0 pt-1`,children:s.map((e,r)=>e.key===`now`?(0,I.jsx)(`li`,{className:`flex gap-3`,children:(0,I.jsx)(Y,{live:n,orb:!c,className:`-mt-1 min-w-0 flex-1 py-0`})},`now`):(0,I.jsx)(Ie,{node:e,last:r===s.length-1,working:t,now:a===e?n:void 0,orbed:c===e},e.key))})}var Be={passed:`Passed`,failed:`Failed`,stopped:`Stopped`,blocked:`Blocked`};function X({label:e,children:t}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`dt`,{className:`pt-0.5 text-[13px] text-muted`,children:e}),(0,I.jsx)(`dd`,{className:`m-0 min-w-0 text-[13px] [overflow-wrap:anywhere]`,children:t})]})}function Z({text:e}){let[t,n]=(0,F.useState)(!1);return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 rounded-[10px] bg-surface-muted px-3 py-2`,children:[(0,I.jsx)(s,{icon:ue,size:14,className:`mt-0.5 flex-none text-muted`}),(0,I.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[12.5px] break-all whitespace-pre-wrap text-ink`,children:e}),(0,I.jsx)(`button`,{type:`button`,"aria-label":t?`Copied`:`Copy the command`,onClick:async()=>{await ge(e)&&(n(!0),setTimeout(()=>n(!1),1500))},className:`inline-flex size-7 flex-none cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-surface-strong hover:text-ink`,children:t?(0,I.jsx)(h,{size:14,"aria-hidden":`true`,className:`text-pass`}):(0,I.jsx)(w,{size:14,"aria-hidden":`true`})})]})}function Ve(e){if(e.runs===void 0)return e.attempts===void 0?``:o(e.attempts,`attempt`);let t=`${o(e.runs,`test run`)}${e.failedRuns?` (${e.failedRuns} failed)`:``}`;return e.reviews?`${t} · ${o(e.reviews,`review`)}`:t}function He({name:e}){let t=e.lastIndexOf(`.`),n=t>0?e.slice(t+1):e,r=t>0?e.slice(0,t):``;return(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col`,"data-tip":e,children:[(0,I.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink [overflow-wrap:anywhere]`,children:n}),r&&(0,I.jsx)(`span`,{className:`font-mono text-[11.5px] text-muted [overflow-wrap:anywhere]`,children:r})]})}function Ue({t:e}){let t=Ve(e);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,I.jsx)(y,{size:17,strokeWidth:2,"aria-hidden":`true`,className:e.ok?`text-pass`:e.status===`stopped`?`text-muted`:`text-fail`}),(0,I.jsx)(`span`,{className:`text-[15px] font-semibold`,children:e.ok?`Test written`:`Test not finished`}),(0,I.jsx)(te,{tone:e.ok?`pass`:e.status===`stopped`?`neutral`:`fail`,children:Be[e.status]||e.status||`Not written`}),t&&(0,I.jsx)(`span`,{className:`text-[13px] text-muted`,children:t})]}),(0,I.jsxs)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-5 gap-y-1 sm:grid-cols-[96px_minmax(0,1fr)] sm:gap-y-3`,children:[(e.testFile||e.testName)&&(0,I.jsx)(X,{label:`Test`,children:(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[e.testFile&&(0,I.jsx)(E,{path:e.testFile}),e.testName&&(0,I.jsx)(He,{name:e.testName})]})}),e.command&&(0,I.jsx)(X,{label:`Run it`,children:(0,I.jsx)(Z,{text:e.command})}),e.review&&(0,I.jsx)(X,{label:e.review.approved?`Review`:`Review asked`,children:(0,I.jsx)(R,{review:e.review})}),e.runDir&&(0,I.jsx)(X,{label:`From the run`,children:(0,I.jsx)(E,{path:e.runDir})}),e.reused.length>0&&(0,I.jsx)(X,{label:`Reused`,children:(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.reused.map(e=>(0,I.jsx)(`li`,{className:`min-w-0`,children:(0,I.jsx)(E,{path:e})},e))})})]}),e.error&&(0,I.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:e.error})]})}function We({c:e}){let[t,n]=(0,F.useState)(!1);return(0,I.jsxs)(`li`,{className:`flex flex-col`,children:[(0,I.jsxs)(`div`,{className:`flex min-h-9 items-center gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} the changes to ${e.path}`,onClick:()=>n(!t),className:`inline-flex size-7 flex-none cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-surface-strong hover:text-ink`,children:(0,I.jsx)(S,{size:15,"aria-hidden":`true`,className:v(`transition-transform`,!t&&`-rotate-90`)})}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,I.jsx)(E,{path:e.path})}),(0,I.jsxs)(`span`,{className:`flex-none font-mono text-[12px] tabular-nums`,children:[(0,I.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,I.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,I.jsx)(C,{open:t,children:(0,I.jsx)(L,{diff:e.diff,className:`mb-2 ml-9`})})]})}function Ge({turn:e}){let t=e.reports.filter((e,t,n)=>n.findIndex(t=>t.path===e.path)===t),n=new Set(e.changes.map(e=>e.path)),r=[...new Set(e.tests.flatMap(e=>e.changed))].filter(e=>!n.has(e)&&![...n].some(t=>t.endsWith(e)||e.endsWith(t)));return!e.tests.length&&!t.length&&!e.changes.length&&!r.length?null:(0,I.jsxs)(`section`,{"aria-label":`Result`,className:`flex flex-col gap-4 border-t border-line-soft pt-4`,children:[e.tests.map((e,t)=>(0,I.jsx)(Ue,{t:e},t)),t.length>0&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:`Reports`}),(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-sm`,children:t.map(e=>(0,I.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,I.jsx)(`span`,{className:`text-ink-2`,children:e.label}),(0,I.jsx)(E,{path:e.path})]},e.path))})]}),(e.changes.length>0||r.length>0)&&(0,I.jsxs)(`div`,{className:v(`flex flex-col gap-1`,(e.tests.length>0||t.length>0)&&`border-t border-line-soft pt-3`),children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-medium`,children:[(0,I.jsx)(re,{size:15,"aria-hidden":`true`,className:`text-muted`}),`Files changed`,(0,I.jsxs)(`span`,{className:`font-normal text-muted`,children:[o(e.changes.length+r.length,`file`),e.changes.length>0&&(0,I.jsxs)(I.Fragment,{children:[` · `,(0,I.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.changes.reduce((e,t)=>e+t.added,0)]}),` `,(0,I.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.changes.reduce((e,t)=>e+t.removed,0)]})]})]})]}),(0,I.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[e.changes.map(e=>(0,I.jsx)(We,{c:e},e.path)),r.map(e=>(0,I.jsx)(`li`,{className:`flex min-h-9 items-center gap-2 pl-9`,children:(0,I.jsx)(E,{path:e})},e))]})]})]})}var Q={info:`text-ink-2`,ok:`text-pass`,fail:`text-fail`,warn:`text-warn`,dim:`text-muted`,say:`text-ink`,you:`text-accent-fg`,think:`text-muted italic`};function Ke({line:e,start:t}){let[n,r]=(0,F.useState)(!1),i=e.plain.length>160;return e.kind===`head`?(0,I.jsxs)(`li`,{className:`mt-3 flex items-baseline gap-3 border-b border-line-soft pb-1 first:mt-0`,children:[(0,I.jsx)(`span`,{className:`w-12 flex-none font-mono text-[11.5px] text-muted tabular-nums`,children:D(t,e.at)}),(0,I.jsx)(T,{text:e.md,className:`min-w-0 text-[13px] font-semibold text-ink [&_p]:my-0`})]}):(0,I.jsxs)(`li`,{className:v(`flex items-baseline gap-3 py-1`,e.kind===`sub`&&`pl-4`),children:[(0,I.jsx)(`span`,{className:`w-12 flex-none font-mono text-[11.5px] text-muted tabular-nums`,children:D(t,e.at)}),e.kind===`out`?(0,I.jsx)(`pre`,{className:`m-0 min-w-0 flex-1 font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:e.plain}):(0,I.jsx)(`button`,{type:`button`,disabled:!i,"aria-expanded":i?n:void 0,onClick:()=>r(!n),"data-tip":i&&!n?`Show all of it`:void 0,className:v(`min-w-0 flex-1 border-0 bg-transparent p-0 text-left`,i&&`cursor-pointer`),children:(0,I.jsx)(T,{text:e.md,className:v(`text-[13px] leading-relaxed [overflow-wrap:anywhere] [&_code]:text-[12px] [&_p]:my-0`,Q[e.tone],i&&!n&&`line-clamp-2`)})})]})}function $({lines:e,start:t,live:n,name:r,timeline:i=!1}){let a=(0,F.useRef)(null),o=(0,F.useRef)(!0),[c,l]=(0,F.useState)(!1),u=(0,F.useMemo)(()=>ye(e,t),[e,t]);(0,F.useEffect)(()=>{o.current&&a.current&&(a.current.scrollTop=a.current.scrollHeight)},[u]);let d=`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-lg border-0 bg-transparent px-2 text-[12px] font-medium text-muted hover:bg-surface-strong hover:text-ink`;return(0,I.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,I.jsxs)(`div`,{className:`flex min-h-9 items-center gap-1 border-b border-line-soft text-[12px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`flex-1`,children:[i?``:`Markdown · `,e.length,` event`,e.length===1?``:`s`,n&&` · live`]}),(0,I.jsxs)(`button`,{type:`button`,"aria-label":c?`Copied`:`Copy the activity log as Markdown`,onClick:async()=>{try{await navigator.clipboard.writeText(u),l(!0),setTimeout(()=>l(!1),1500)}catch{}},className:d,children:[c?(0,I.jsx)(h,{size:14,"aria-hidden":`true`,className:`text-pass`}):(0,I.jsx)(w,{size:14,"aria-hidden":`true`}),c?`Copied`:`Copy`]}),(0,I.jsxs)(`button`,{type:`button`,"aria-label":`Download the activity log as a Markdown file`,onClick:()=>{let e=URL.createObjectURL(new Blob([u],{type:`text/markdown;charset=utf-8`})),t=document.createElement(`a`);t.href=e,t.download=r,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)},className:d,children:[(0,I.jsx)(s,{icon:de,size:14}),`.md`]})]}),(0,I.jsx)(`div`,{ref:a,role:`log`,"aria-label":`Activity log`,onScroll:e=>{let t=e.currentTarget;o.current=t.scrollTop+t.clientHeight>=t.scrollHeight-24},className:v(`overflow-y-auto py-2`,i?`max-h-[calc(100vh-260px)] min-h-[320px]`:`max-h-[360px] border-b border-line-soft`),children:i?(0,I.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.map((e,n)=>(0,I.jsx)(Ke,{line:e,start:t},n))}):(0,I.jsx)(T,{text:u,className:`text-[13px] leading-[1.6] [&_code]:text-[12px] [&_h4]:mt-3 [&_h4]:mb-1 [&_li]:my-0.5 [&_pre]:text-[12px] [&_ul]:my-1`})})]})}function qe({ask:e,live:n,onAnswer:r}){let i=n&&e.answer===void 0;return(0,I.jsxs)(`div`,{className:v(`flex flex-col gap-3`,i?`rounded-[14px] border border-accent-line bg-accent-soft px-4 py-3`:`py-1`),children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(Ee,{size:18,"aria-hidden":`true`,className:`mt-0.5 flex-none text-accent-fg`}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:e.title}),e.detail&&(0,I.jsx)(`span`,{className:`text-sm text-ink-2`,children:e.detail}),e.lines.map((e,t)=>(0,I.jsx)(`span`,{className:`text-sm text-ink-2 [overflow-wrap:anywhere]`,children:e},t))]})]}),i?(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.options.map(e=>(0,I.jsx)(t,{size:`sm`,onClick:()=>r(e.id),children:e.label},e.id)),!e.options.some(e=>e.id===`cancel`||e.label.trim().toLowerCase()===`cancel`)&&(0,I.jsx)(t,{size:`sm`,variant:`ghost`,onClick:()=>r(null),children:`Cancel`})]}):(0,I.jsx)(`span`,{className:`text-sm text-muted`,children:e.answer===void 0?`Not answered`:`You chose: ${e.answer}`})]})}function Je({wait:e,live:n,onProceed:r}){let i=n&&e.answer===void 0;return(0,I.jsxs)(`div`,{className:v(`flex flex-col gap-3`,i?`rounded-[14px] border border-accent-line bg-accent-soft px-4 py-3`:`py-1`),children:[(0,I.jsxs)(`span`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(he,{size:18,"aria-hidden":`true`,className:`mt-0.5 flex-none text-accent-fg`}),(0,I.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.prompt})]}),i?(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(t,{size:`sm`,variant:`primary`,onClick:()=>r(!0),children:`Done, continue`}),(0,I.jsx)(t,{size:`sm`,onClick:()=>r(!1),children:`Cancel`})]}):(0,I.jsx)(`span`,{className:`text-sm text-muted`,children:e.answer===void 0?`Not done`:e.answer?`You continued`:`You cancelled`})]})}function Ye({turn:e,live:t,onAnswer:n,onProceed:i}){let a=t&&!e.outcome,[o,c]=(0,F.useState)(null),l=o??a,u=xe(e),d=a?u.text:ve(e),f=e.parts.map(e=>_e(e.text)).filter(Boolean),[p,m]=(0,F.useState)(!1),h=[...e.log].reverse().find(e=>e.tone!==`you`&&e.tone!==`say`);return(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(`div`,{className:`size-9 flex-none`,"aria-hidden":`true`,children:(0,I.jsx)(r,{agent:`forgeqe`,px:34,working:a,className:`mt-0.5`})}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 pt-1.5`,children:[(e.steps.length>0||a||e.log.length>0)&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":l,disabled:!e.steps.length&&!e.plan.length,onClick:()=>c(!l),className:v(`flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 text-sm font-medium text-muted hover:text-ink disabled:cursor-default`,a&&`shimmer`),children:[(0,I.jsx)(`span`,{"aria-live":`polite`,children:d}),(e.steps.length>0||e.plan.length>0)&&(0,I.jsx)(S,{size:16,"aria-hidden":`true`,className:v(`transition-transform`,l&&`rotate-180`)})]}),e.log.length>0&&(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":p,onClick:()=>m(!p),className:`ml-auto inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-lg border-0 bg-transparent px-2 text-[13px] font-medium text-muted hover:bg-surface-muted hover:text-ink`,children:[(0,I.jsx)(s,{icon:ie,size:14}),`Activity log`,(0,I.jsx)(`span`,{className:`tabular-nums`,children:e.log.length})]})]}),(0,I.jsx)(C,{open:(l||a)&&(e.steps.length>0||e.plan.length>0||a),children:(0,I.jsx)(ze,{turn:e,working:a,folded:!l,live:{...u,latest:h,events:e.log.length,onLog:()=>m(!0)}})}),(0,I.jsx)(C,{open:p,children:(0,I.jsx)($,{lines:e.log,start:e.started||e.log[0]?.at,live:a,name:`forgeqe-activity-${e.id}.md`})})]}),e.asks.map(e=>(0,I.jsx)(qe,{ask:e,live:a,onAnswer:t=>n(e.id,t)},e.id)),e.waits.map(e=>(0,I.jsx)(Je,{wait:e,live:a,onProceed:t=>i(e.id,t)},e.id)),e.outcome&&e.reply?(0,I.jsx)(T,{text:e.reply}):f.length>0&&(0,I.jsx)(T,{text:f.join(`
|
|
3
|
-
|
|
4
|
-
`)}),(0,I.jsx)(Ge,{turn:e}),e.error&&(0,I.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e.error}),e.outcome===`stopped`&&!e.reply&&(0,I.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Stopped.`})]})]})}export{L as i,Ye as n,Z as r,$ as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{An as e,Ar as t,Bt as n,Di as r,En as i,Er as a,Gn as o,Gt as s,Hn as c,Ht as l,Lr as u,Mt as d,Nn as f,Si as p,Wt as m,Xn as h,Xt as g,_n as _,an as v,at as y,br as b,bt as x,ct as S,dn as C,et as ee,gt as w,hi as T,ir as E,k as D,mr as O,n as k,ot as A,qr as te,qt as j,tn as M,tt as N,vr as P,vt as F,wi as ne,wr as re,yr as ie,yt as ae}from"./Shell-DFE3OHxz.js";import{t as oe}from"./circle-dashed-KlSRxdRt.js";import{r as se,t as ce}from"./Response-BGXyV_fV.js";import{F as le,G as ue,H as de,N as fe,i as I,r as L,t as pe,z as me}from"./index-j5ulUL9f.js";import{n as R,t as he}from"./when-CHnpLdYw.js";import{a as ge,c as z}from"./thread-DJKWZFQL.js";var _e={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`}]]};_e.node;var ve=u(_e),B=r(ne(),1),V=p(),H={execution:`Execution`,report:`Report`,coding:`Coding`,chat:`Chat`},ye={execution:h,report:E,coding:O,chat:i};function be({kind:e}){let t=ye[e];return(0,V.jsx)(l,{icon:t,size:14,className:`flex-none text-muted`})}var xe={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=>xe[e]||{label:e?e.charAt(0).toUpperCase()+e.slice(1).replace(/_/g,` `):`–`,tone:`neutral`},Se={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploration`,api:`API run`,desktop:`Desktop run`,mobile:`App run`},Ce=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}){return(0,V.jsxs)(`section`,{className:`flex flex-col gap-3 border-t border-line-soft pt-6 first:border-t-0 first:pt-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`h3`,{className:`m-0 flex flex-1 items-center gap-2 text-base font-semibold`,children:[(0,V.jsx)(`span`,{className:`text-accent-fg`,children:t}),e]}),r]}),n]})}function we({path:e,label:t=`Open report`}){let[r,i]=(0,B.useState)(``);return(0,V.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(n,{onClick:async()=>i(await x(e)),children:[(0,V.jsx)(me,{size:16,"aria-hidden":`true`}),t]}),r&&(0,V.jsx)(`span`,{className:`text-[13px] text-fail`,children:r})]})}function Te({items:e,first:t,render:n}){let[r,i]=(0,B.useState)(!1);return(0,V.jsxs)(V.Fragment,{children:[(r?e:e.slice(0,t)).map(n),e.length>t&&(0,V.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 Ee({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 De({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-3 border-t border-line-soft pt-3 first:border-t-0 first:pt-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,V.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:[Se[e.scope]||e.scope,Ce(e.ms),e.tokens?`${D(e.tokens)} tokens`:``,e.stopped?`stopped early`:``].filter(Boolean).join(` · `)})]}),e.report&&(0,V.jsx)(we,{path:e.report})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,V.jsxs)(`span`,{className:`text-[22px] font-semibold tabular-nums`,children:[t,`%`]}),(0,V.jsx)(`span`,{className:`text-muted`,children:`passed`}),(0,V.jsxs)(y,{tone:`pass`,children:[e.counts.passed,` passed`]}),e.counts.failed>0&&(0,V.jsxs)(y,{tone:`fail`,children:[e.counts.failed,` failed`]}),e.counts.other>0&&(0,V.jsxs)(y,{tone:`warn`,children:[e.counts.other,` other`]}),(0,V.jsxs)(`span`,{className:`text-muted`,children:[`of `,e.counts.total]})]}),(0,V.jsx)(Ee,{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)(Te,{items:[...e.cases].sort((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-3 border-t border-line-soft py-2 text-sm`,children:[(0,V.jsx)(`span`,{className:`w-[76px] flex-none`,children:(0,V.jsx)(y,{tone:U(e.status).tone,children:U(e.status).label})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,V.jsxs)(`span`,{className:`[overflow-wrap:anywhere]`,children:[e.id&&(0,V.jsx)(`span`,{className:`mr-1.5 font-mono text-[12px] 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:Ce(e.ms)})]},`${e.id}-${t}`)})}),e.folder&&!e.report&&(0,V.jsxs)(`span`,{className:`text-sm`,children:[`Kept in `,(0,V.jsx)(L,{path:e.folder})]})]})}function Oe({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,V.jsx)(W,{title:`Execution summary`,icon:(0,V.jsx)(l,{icon:h,size:18}),aside:e.length>1?(0,V.jsxs)(`span`,{className:`text-sm text-muted`,children:[s(e.length,`run`),` · `,t.passed,` of `,t.total,` passed`]}):void 0,children:e.length?e.map((e,t)=>(0,V.jsx)(De,{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 ke({list:e}){return(0,V.jsxs)(W,{title:`Report summary`,icon:(0,V.jsx)(l,{icon:E,size:18}),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-3 border-t border-line-soft pt-3 first:border-t-0 first:pt-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,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)(we,{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-3 py-2`,children:[(0,V.jsx)(`dt`,{className:`text-[12px] text-muted`,children:e.label}),(0,V.jsx)(`dd`,{className:`m-0 text-[18px] font-semibold tabular-nums`,children:e.value})]},e.label))}),e.markdown&&(0,V.jsx)(Ae,{text:e.markdown})]},`${e.path||e.title}-${t}`))]})}function Ae({text:e,height:t=220}){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(!0),[o,s]=(0,B.useState)(t),c=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{c.current&&!n&&a(c.current.scrollHeight>t+8)},[e,t,n]),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.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,V.jsx)(I,{text:e,className:`text-sm`}),!n&&i&&(0,V.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,V.jsx)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>{let e=c.current?.scrollHeight??t;if(r(!n),w())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 je(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 Me({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-1.5 text-sm`,children:[(0,V.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,V.jsx)(ie,{size:16,"aria-hidden":`true`,className:m(`transition-transform duration-200`,t&&`rotate-90`)})}),(0,V.jsx)(`span`,{className:`w-[52px] flex-none text-[12px] text-muted`,children:r}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,V.jsx)(L,{path:e.path})}),(0,V.jsxs)(`span`,{className:`flex-none font-mono text-[12px] 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-3 pl-10 [&_pre]:max-h-[420px] [&_pre]:overflow-auto`,children:e.diffs.length?(0,V.jsx)(I,{text:je(e.diffs)}):null})]})}var Ne={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-0.5 text-[13px] text-muted`,children:e}),(0,V.jsx)(`dd`,{className:`m-0 min-w-0 text-sm [overflow-wrap:anywhere]`,children:t})]})}function Pe({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,V.jsxs)(W,{title:`Code changes`,icon:(0,V.jsx)(l,{icon:O,size:18}),aside:e.edits.length?(0,V.jsxs)(`span`,{className:`font-mono text-[13px] tabular-nums`,children:[s(e.edits.length,`file`),` · `,(0,V.jsxs)(`span`,{className:`text-pass`,children:[`+`,n]}),` `,(0,V.jsxs)(`span`,{className:`text-fail`,children:[`−`,r]})]}):o.length?(0,V.jsx)(`span`,{className:`text-[13px] text-muted`,children:s(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,V.jsxs)(`div`,{className:`flex flex-col gap-3 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)(h,{size:17,strokeWidth:2,"aria-hidden":`true`,className:r?`text-pass`:o?`text-fail`:`text-warn`}),(0,V.jsx)(`span`,{className:`text-[15px] font-semibold`,children:r?`Test written`:o?`Test not finished`:U(t.status).label}),(0,V.jsx)(y,{tone:r?`pass`:o?`fail`:`warn`,children:U(t.status).label}),e.tests.length>0&&(0,V.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[s(e.tests.length,`test run`),i?` (${i} failed)`:``,e.reviews.length?` · ${s(e.reviews.length,`review`)}`:``]})]}),(0,V.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,V.jsx)(G,{label:`Test`,children:(0,V.jsx)(L,{path:t.testFile})}),t.command&&(0,V.jsx)(G,{label:`Run it`,children:(0,V.jsx)(se,{text:t.command})}),(t.review||a)&&(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)(y,{tone:(t.review??a).approved?`pass`:`warn`,children:(t.review??a).approved?`Approved`:`Changes asked`})}),(t.review?.summary||a?.summary)&&(0,V.jsx)(`span`,{className:`text-ink-2`,children:t.review?.summary||a?.summary})]})}),t.notes&&(0,V.jsx)(G,{label:`Notes`,children:(0,V.jsx)(I,{text:t.notes,className:`text-sm text-ink-2 [&_p]:my-0 [&_p+p]:mt-2`})})]}),t.error&&(0,V.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,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)(Te,{items:e.edits,first:8,render:e=>(0,V.jsx)(Me,{e},e.path)})})]}),o.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:o.map(e=>(0,V.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,V.jsx)(`span`,{className:`w-[52px] flex-none text-[12px] text-muted`,children:Ne[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)(L,{path:e.path})})]},e.path))}),(0,V.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,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 Fe({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,V.jsxs)(W,{title:`Final message`,icon:(0,V.jsx)(ve,{size:18,"aria-hidden":`true`}),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)(Ae,{text:r?`${a}text\n${e.text}\n${a}`:z(e.text),height:420}),n.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:`}),n.map(e=>(0,V.jsx)(L,{path:e},e))]})]})}var Ie={rule:{icon:t,label:`Rulebook`},decision:{icon:o,label:`Test decisions`},memory:{icon:a,label:`Page memory`},replay:{icon:_,label:`Replays`},model:{icon:v,label:`Model`},skill:{icon:c,label:`Skills`}};function Le({list:e}){let t=Object.keys(Ie).filter(t=>e.some(e=>e.kind===t));return(0,V.jsx)(W,{title:`Learnings`,icon:(0,V.jsx)(l,{icon:f,size:18}),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-3`,children:t.map(t=>{let{icon:n,label:r}=Ie[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-1.5 text-[13px] font-medium text-muted`,children:[(0,V.jsx)(l,{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-0.5 border-t border-line-soft py-1.5 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 Re({run:e}){let t=[];return(e.executions.length||e.kind===`execution`)&&t.push({kind:`execution`,node:(0,V.jsx)(Oe,{list:e.executions},`e`)}),(e.reports.length||e.kind===`report`)&&t.push({kind:`report`,node:(0,V.jsx)(ke,{list:e.reports},`r`)}),e.coding&&(e.coding.edits.length||e.coding.results.length||e.kind===`coding`)&&t.push({kind:`coding`,node:(0,V.jsx)(Pe,{c:e.coding,files:e.files},`c`)}),t.sort((t,n)=>Number(n.kind===e.kind)-Number(t.kind===e.kind)),(0,V.jsx)(V.Fragment,{children:t.map(e=>e.node)})}var ze={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`}},Be={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`},Ve=e=>Be[e]||e.charAt(0).toUpperCase()+e.slice(1),K=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 He(e){let[t,n]=(0,B.useState)(Date.now());return(0,B.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function Ue({r:e}){return e.origin.kind===`web`?(0,V.jsxs)(`a`,{href:S(`chats`,e.origin.chat),className:`inline-flex items-center gap-1.5`,children:[(0,V.jsx)(l,{icon:i,size:14}),`Web chat`]}):e.origin.kind===`job`?(0,V.jsxs)(`a`,{href:S(`jobs`,encodeURIComponent(e.origin.job)),className:`inline-flex items-center gap-1.5`,children:[(0,V.jsx)(l,{icon:re,size:14}),`Job`]}):(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-muted`,children:[(0,V.jsx)(l,{icon:M,size:14}),`Terminal`]})}function We({status:t}){let n=ze[t].label;return t===`running`?(0,V.jsx)(e,{size:16,"aria-label":n,className:`flex-none animate-spin text-accent-fg`}):t===`done`?(0,V.jsx)(de,{size:16,"aria-label":n,className:`flex-none text-pass`}):t===`failed`?(0,V.jsx)(P,{size:16,"aria-label":n,className:`flex-none text-fail`}):(0,V.jsx)(oe,{size:16,"aria-label":n,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 Ge(e){return/^forgeqe(-|$)|^engine$/.test(e)?d(e).name:e&&e.charAt(0).toUpperCase()+e.slice(1)}function Z({label:e,children:t}){return(0,V.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,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,children:t}){return(0,V.jsxs)(`section`,{className:`flex min-w-0 flex-col`,children:[(0,V.jsx)(`h3`,{className:`m-0 mb-1 text-[14px] font-semibold`,children:e}),t]})}var Ke={rerun:le,write_test:g,investigate:C,fix_test:j};function qe({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 te.start(e.prompt,{});location.hash=S(`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)=>{let r=Ke[e.kind];return(0,V.jsxs)(`button`,{type:`button`,disabled:!!t,onClick:()=>void a(e),className:m(`flex min-h-[52px] max-w-full cursor-pointer items-center gap-3 rounded-[14px] border px-3 py-2 text-left disabled:cursor-default disabled:opacity-60`,n===0?`border-accent bg-accent-soft hover:bg-accent-soft/70`:`border-line-soft bg-bg hover:bg-surface-muted`),children:[(0,V.jsx)(l,{icon:r,size:18,className:`flex-none text-accent-fg`}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,V.jsx)(`span`,{className:`text-sm font-medium text-ink`,children:t===e.prompt?`Opening a chat…`:e.label}),(0,V.jsx)(`span`,{className:`max-w-[320px] truncate text-[12px] text-muted`,children:e.note})]})]},n)})}),(0,V.jsx)(`span`,{className:`text-[12px] 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 Je=e=>`\`${e.replace(/`/g,``)}\``;function Ye({name:e}){let[t,r]=(0,B.useState)(null),[i,a]=(0,B.useState)(``),[o,c]=(0,B.useState)(!1),[l,u]=(0,B.useState)(`summary`),d=(0,B.useCallback)(()=>{T.detail(e).then(e=>{r(e),a(``)},e=>a(e.message))},[e]);(0,B.useEffect)(d,[d]);let f=t?.status===`running`;(0,B.useEffect)(()=>{if(!f)return;let e=setInterval(d,2e3);return()=>clearInterval(e)},[d,f]);let p=He(f),h=(0,B.useMemo)(()=>(t?.events??[]).map(ge).filter(e=>!!e),[t?.events]),g=async()=>{c(!0),a(``);try{await T.cancel(e),d()}catch(e){a(e.message)}finally{c(!1)}},_=(0,V.jsxs)(`a`,{href:S(`runs`),className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,V.jsx)(ue,{size:16,"aria-hidden":`true`}),`All runs`]});if(!t)return(0,V.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[_,i?(0,V.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:i}):(0,V.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`})]});let v=ze[t.status],b=!t.replies.length,x=!!t.final||t.executions.length>0||t.reports.length>0||!!(t.coding&&(t.coding.edits.length||t.coding.results.length))||t.learnings.length>0||t.outputs.length>0,C=[{id:`summary`,label:`Summary`},{id:`conversation`,label:b?`Command`:`Conversation`,n:t.replies.length||void 0},{id:`activity`,label:`Activity`,n:h.length||void 0},{id:`details`,label:`Details`}],ee=new Set([...t.reports.map(e=>e.path),...t.executions.flatMap(e=>[e.report,e.folder])].filter(Boolean)),w=t.outputs.filter(e=>!ee.has(e.path)),E=t.context?.limit?Math.round(t.context.tokens/t.context.limit*100):null;return(0,V.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[_,(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1.5`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,V.jsx)(`h2`,{className:`m-0 min-w-0 text-[22px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:t.title}),(0,V.jsx)(y,{tone:v.tone,children:v.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-1.5`,children:[(0,V.jsx)(be,{kind:t.kind}),H[t.kind]]}),`· `,(0,V.jsx)(Ue,{r:t}),`· `,K(t.startedAt),` · `,f?`running for `:`took `,J(q(t,p)),` · `,D(Y(t)),` tokens`,t.profile?.model?` · ${t.profile.model}`:``]})]}),t.cancel&&(0,V.jsxs)(n,{disabled:o,onClick:()=>void g(),className:`border-fail text-fail hover:bg-fail-soft`,children:[(0,V.jsx)(fe,{size:14,fill:`currentColor`,"aria-hidden":`true`}),o?`Stopping…`:t.cancel===`chat`?`Stop this chat's work`:`Cancel this job's run`]})]}),i&&(0,V.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}),t.error&&(0,V.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[(0,V.jsx)(`strong`,{children:`What went wrong:`}),` `,t.error]}),!f&&(0,V.jsx)(qe,{actions:t.actions??[]}),(0,V.jsx)(`div`,{role:`tablist`,"aria-label":`This run`,className:`flex gap-1 overflow-x-auto border-b border-line-soft`,children:C.map(e=>(0,V.jsxs)(`button`,{type:`button`,role:`tab`,id:`run-tab-${e.id}`,"aria-selected":l===e.id,"aria-controls":`run-panel-${e.id}`,onClick:()=>u(e.id),className:m(`-mb-px inline-flex min-h-10 cursor-pointer items-center gap-1.5 border-0 border-b-2 bg-transparent px-3 text-sm font-medium whitespace-nowrap`,l===e.id?`border-accent text-ink`:`border-transparent text-muted hover:text-ink`),children:[e.label,e.n!==void 0&&(0,V.jsx)(`span`,{className:`text-[12px] text-muted tabular-nums`,children:e.n})]},e.id))}),(0,V.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,V.jsxs)(V.Fragment,{children:[t.final&&(0,V.jsx)(Fe,{final:t.final,answer:t.answer}),(0,V.jsx)(Re,{run:t}),w.length>0&&(0,V.jsx)(Q,{title:`What it produced (${w.length})`,children:w.map(e=>(0,V.jsx)(Z,{label:e.label,children:(0,V.jsx)(L,{path:e.path})},e.path))}),t.learnings.length>0&&(0,V.jsx)(Le,{list:t.learnings}),!x&&(0,V.jsx)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-3 text-sm text-ink-2`,children:f?`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`&&(b?(0,V.jsx)(I,{text:Je(t.prompt),className:`text-sm [&_p]:my-0`}):(0,V.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:t.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.5 text-sm max-w-[85%]`,children:(0,V.jsx)(I,{text:e.ask,className:`[&_p]:my-0.5`})}),e.text&&(0,V.jsx)(I,{text:z(e.text),className:`text-sm`}),e.error&&(0,V.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`&&(t.archived?(0,V.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,V.jsx)(`code`,{className:`font-mono text-[13px]`,children:`.forgeqe/runs`}),`; its step-by-step activity was not.`]}):h.length?(0,V.jsx)(ce,{timeline:!0,lines:h,start:t.startedAt,live:f,name:`forgeqe-run-${t.name.replace(/\.log$/,``)}.md`}):(0,V.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing logged yet.`})),l===`details`&&(0,V.jsxs)(`div`,{className:`grid items-start gap-x-12 gap-y-8 @3xl:grid-cols-2`,children:[(0,V.jsxs)(Q,{title:`Numbers`,children:[(0,V.jsx)(Z,{label:f?`Running for`:`Took`,children:J(q(t,p))}),(0,V.jsx)(Z,{label:`Tokens`,children:(0,V.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,V.jsxs)(`span`,{children:[D(Y(t)),` `,(0,V.jsxs)(`span`,{className:`text-muted`,children:[`· `,D(t.usage.input),` read · `,D(t.usage.output),` written`,t.usage.cached?` · ${D(t.usage.cached)} cached`:``]})]}),(t.byAgent?.length??0)>1&&(0,V.jsx)(`span`,{className:`flex flex-col gap-0.5 text-[13px]`,children:t.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:Ge(e.agent)}),(0,V.jsx)(`span`,{className:`text-muted tabular-nums`,children:D(e.input+e.output)})]},e.agent))})]})}),(0,V.jsxs)(Z,{label:`Context`,children:[t.context?D(t.context.tokens):`–`,E!==null&&(0,V.jsxs)(`span`,{className:`text-muted`,children:[` of `,D(t.context.limit),` (`,E,`%)`]})]}),(0,V.jsxs)(Z,{label:`Tool calls`,children:[t.tools,` `,(0,V.jsxs)(`span`,{className:`text-muted`,children:[`in `,s(t.turns,`turn`)]})]})]}),(0,V.jsxs)(Q,{title:`Session`,children:[(0,V.jsx)(Z,{label:`Started by`,children:(0,V.jsx)(Ue,{r:t})}),(0,V.jsx)(Z,{label:`Command`,children:Ve(t.command)}),(0,V.jsx)(Z,{label:`Model`,children:t.profile?[t.profile.name,t.profile.model].filter(Boolean).join(` · `):`–`}),(0,V.jsx)(Z,{label:`Agents`,children:t.agents.length?(0,V.jsx)(`span`,{className:`flex flex-col gap-0.5`,children:t.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:Ge(e.name)}),(0,V.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:s(e.calls,`call`)})]},e.name))}):(0,V.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,V.jsxs)(Z,{label:`Log`,children:[t.archived?(0,V.jsx)(`span`,{className:`text-muted`,children:`No longer kept: ForgeQE keeps the newest logs only`}):(0,V.jsx)(L,{path:`.forgeqe/logs/${t.name}`}),t.truncated&&(0,V.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Very long: only its start is shown.`})]})]}),t.job&&(0,V.jsxs)(Q,{title:`Job`,children:[(0,V.jsx)(Z,{label:`Job`,children:(0,V.jsx)(`a`,{href:S(`jobs`,encodeURIComponent(t.origin.kind===`job`?t.origin.job:t.job.name)),children:t.job.name})}),(0,V.jsx)(Z,{label:`Runs`,children:(0,V.jsx)(I,{text:Je(t.job.command),className:`text-sm [&_p]:my-0`})}),(0,V.jsxs)(Z,{label:`Schedule`,children:[t.job.schedule,!t.job.enabled&&` (disabled)`,t.job.nextAt&&t.job.enabled?` · next ${K(t.job.nextAt)}`:``]}),t.job.run&&(0,V.jsxs)(Z,{label:`This run`,children:[t.job.run.reason===`asked`?`Asked for`:`On schedule`,`, `,t.job.run.status.replace(`_`,` `),t.job.run.exitCode!==void 0&&t.job.run.exitCode!==null?`, exit ${t.job.run.exitCode}`:``]})]}),(0,V.jsx)(Q,{title:`Files worked on (${t.files.length})`,children:t.files.length?[...t.files].sort((e,t)=>Number(e.action===`read`)-Number(t.action===`read`)).map(e=>(0,V.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,V.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.path}):(0,V.jsx)(L,{path:e.path})},e.path)):(0,V.jsx)(`p`,{className:`m-0 py-1 text-sm text-muted`,children:`No files changed.`})}),(0,V.jsx)(Q,{title:`Notifications`,children:t.notifications.length?t.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:t.origin.kind===`terminal`||t.origin.kind===`web`?`None: notify channels go with jobs, suites and the monitor.`:`No notify channels are set up (Settings, Notify).`})})]})]})]})}var $=25;function Xe({runs:e}){let t=He(e.some(e=>e.status===`running`)),[r,i]=(0,B.useState)(``),[a,o]=(0,B.useState)(`all`),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(!1),[h,g]=(0,B.useState)(0);(0,B.useEffect)(()=>g(0),[r,a,c,u,f]);let _=e.filter(X).length,v=r.toLowerCase().split(/\s+/).filter(Boolean),y=e.filter(e=>(f||!X(e))&&(!c||e.kind===c)&&(!u||e.origin.kind===u)&&v.every(t=>`${e.title} ${e.command} ${e.error||``}`.toLowerCase().includes(t))),x={all:y.length,running:y.filter(e=>e.status===`running`).length,failed:y.filter(e=>e.status===`failed`).length},w=a===`all`?y:y.filter(e=>e.status===a),T=Math.max(1,Math.ceil(w.length/$)),E=Math.min(h,T-1),O=w.slice(E*$,E*$+$),k=e.filter(e=>e.status!==`running`&&!X(e)),A=k.filter(e=>e.status===`failed`).length,te=k.length?k.reduce((e,n)=>e+q(n,t),0)/k.length:NaN,j=e.reduce((e,t)=>e+Y(t),0),M=[...new Set(e.map(e=>e.kind))],P=[...new Set(e.map(e=>e.origin.kind))],F={web:`Web chat`,job:`Job`,terminal:`Terminal`};return e.length===0?(0,V.jsx)(`p`,{className:`m-0 rounded-[14px] bg-surface-muted px-5 py-4 text-sm leading-relaxed text-ink-2`,children:`No runs yet. A chat here, a job, or a ForgeQE command in this project adds one.`}):(0,V.jsxs)(`div`,{className:`flex flex-col gap-3`,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-_}),` 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`,A?`text-fail`:`text-ink`),children:A}),` failed`,k.length?` (${Math.round(A/k.length*100)}%)`:``]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:`text-ink tabular-nums`,children:D(j)}),` tokens`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{className:`text-ink tabular-nums`,children:J(Math.round(te))}),` on average`]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`div`,{className:`relative min-w-0 w-full max-w-[320px] flex-[0_1_320px]`,children:[(0,V.jsx)(C,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted`}),(0,V.jsx)(`label`,{htmlFor:`run-search`,className:`sr-only`,children:`Find a run`}),(0,V.jsx)(ee,{id:`run-search`,type:`search`,value:r,onChange:e=>i(e.target.value),placeholder:`Find a run by what was asked`,className:`h-9 pl-9`})]}),[[`all`,`All`],[`running`,`Running`],[`failed`,`Failed`]].map(([e,t])=>(0,V.jsxs)(`button`,{type:`button`,"aria-pressed":a===e,onClick:()=>o(e),className:m(`inline-flex min-h-8 cursor-pointer items-center gap-1 rounded-[8px] border px-3 text-[13px] font-medium`,a===e?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:bg-line hover:text-ink`),children:[t,(0,V.jsx)(`span`,{className:m(`tabular-nums`,e===`failed`&&x.failed?`text-fail`:``),children:x[e]})]},e)),M.length>1&&(0,V.jsxs)(N,{"aria-label":`What it did`,value:c,onChange:e=>l(e.target.value),className:`h-8 w-auto py-0 pr-7 pl-3 text-[13px]`,children:[(0,V.jsx)(`option`,{value:``,children:`Any kind`}),M.map(e=>(0,V.jsx)(`option`,{value:e,children:H[e]},e))]}),P.length>1&&(0,V.jsxs)(N,{"aria-label":`Started by`,value:u,onChange:e=>d(e.target.value),className:`h-8 w-auto py-0 pr-7 pl-3 text-[13px]`,children:[(0,V.jsx)(`option`,{value:``,children:`Started anywhere`}),P.map(e=>(0,V.jsx)(`option`,{value:e,children:F[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-[12px] 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-1.5`,children:[O.length===0&&(0,V.jsx)(`li`,{className:`px-3 py-4 text-sm text-muted`,children:`Nothing matches.`}),O.map((e,n)=>{let r=R(e.startedAt);return(0,V.jsxs)(`li`,{className:`contents`,children:[(n===0||R(O[n-1].startedAt)!==r)&&(0,V.jsx)(`span`,{className:`block px-3 pt-3 pb-1 text-[12px] font-semibold text-muted`,children:r}),(0,V.jsxs)(`a`,{href:S(`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,V.jsx)(We,{status:e.status}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,V.jsx)(`span`,{className:`truncate text-[14px] font-medium`,"data-tip":e.title,children:e.title}),e.error?(0,V.jsx)(`span`,{className:`truncate text-[12px] text-fail`,children:e.error}):(0,V.jsx)(`span`,{className:`truncate text-[12px] text-muted @3xl:hidden`,children:[H[e.kind],F[e.origin.kind],J(q(e,t)),`${D(Y(e))} tokens`].join(` · `)})]}),(0,V.jsxs)(`span`,{className:`hidden min-w-0 items-center gap-1.5 text-[13px] text-ink-2 @3xl:inline-flex`,children:[(0,V.jsx)(be,{kind:e.kind}),H[e.kind]]}),(0,V.jsx)(`span`,{className:`hidden text-[13px] text-ink-2 @3xl:block`,children:F[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:D(Y(e))}),(0,V.jsx)(`span`,{className:`text-right text-[12.5px] text-muted tabular-nums`,"data-tip":K(e.startedAt),children:he(e.startedAt)})]})]},e.name)})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-t border-line-soft px-4 py-2.5 text-[13px] text-muted`,children:[(0,V.jsxs)(`span`,{className:`flex-1`,children:[w.length?`${E*$+1}–${Math.min(w.length,E*$+$)} of ${w.length}`:`0 runs`,_>0&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>p(!f),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:f?`Hide the ${s(_,`empty session`)}`:`${s(_,`empty session`)} hidden`})]})]}),T>1&&(0,V.jsxs)(`nav`,{"aria-label":`Pages of runs`,className:`flex items-center gap-1`,children:[(0,V.jsx)(n,{size:`sm`,variant:`ghost`,disabled:E===0,onClick:()=>g(E-1),"aria-label":`Newer runs`,children:(0,V.jsx)(b,{size:16,"aria-hidden":`true`})}),(0,V.jsxs)(`span`,{className:`px-1 tabular-nums`,children:[`Page `,E+1,` of `,T]}),(0,V.jsx)(n,{size:`sm`,variant:`ghost`,disabled:E>=T-1,onClick:()=>g(E+1),"aria-label":`Older runs`,children:(0,V.jsx)(ie,{size:16,"aria-hidden":`true`})})]})]})]})]})}function Ze({sub:e}){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(``),a=(0,B.useCallback)(()=>{T.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=setInterval(a,o?3e3:2e4);return()=>clearInterval(t)},[a,o,e]);let s=e?decodeURIComponent(e):``;return(0,V.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,V.jsx)(k,{}),(0,V.jsx)(`main`,{className:m(pe,`@container flex-auto gap-4`),children:s?(0,V.jsx)(Ye,{name:s},s):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(F,{pixel:A.runs,size:`lg`}),(0,V.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Runs`})]}),(0,V.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-muted`,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-3 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)(Xe,{runs:t})]})})]})}export{Ze as Runs,We as StatusIcon};
|