@coreplane/switchboard 1.266.0 → 1.266.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/deploy/cloudflare/worker.ts +7 -1
- package/dist/assets/deploy/cloudflare/wrangler.template.jsonc +5 -1
- package/dist/assets/deploy/cloudflare-memory/worker.ts +48 -3
- package/dist/assets/deploy/cloudflare-resident/legacyCredentials.ts +43 -0
- package/dist/assets/deploy/cloudflare-resident/worker.ts +102 -141
- package/dist/assets/package-lock.json +3 -3
- package/dist/assets/package.json +1 -1
- package/dist/assets/source.json +3 -3
- package/dist/assets/src/channels/githubDoorPaths.ts +36 -0
- package/dist/assets/src/core/coordinator/contract.ts +2 -0
- package/dist/assets/src/core/refusal.ts +1 -0
- package/dist/assets/src/core/runEvents.ts +1 -0
- package/dist/assets/src/core/runRecord.ts +41 -0
- package/dist/assets/src/execution/residentReadonly.ts +9 -8
- package/dist/assets/src/execution/residentSteps.ts +2 -1
- package/dist/assets/src/execution/seedPlan.ts +2 -2
- package/dist/assets/web/dist/.vite/manifest.json +49 -49
- package/dist/assets/web/dist/assets/{HomePage-B2Y-Fa9V.js → HomePage-BfpIrKDX.js} +1 -1
- package/dist/assets/web/dist/assets/{PendingTurnRow-DIC86uWA.js → PendingTurnRow-C6hroa00.js} +1 -1
- package/dist/assets/web/dist/assets/{PlanePage-CfrbMh8t.js → PlanePage-C2Cb1mkT.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentDetailPage-DRNwx2--.js → ResidentDetailPage-Bd9_Q87l.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentsIndexPage-EHKMtX69.js → ResidentsIndexPage-C8eS7hxp.js} +1 -1
- package/dist/assets/web/dist/assets/{RunFoldRow-CAdpX4Gn.js → RunFoldRow-DrfFauYJ.js} +1 -1
- package/dist/assets/web/dist/assets/{RunRoutePage-DppLhu79.js → RunRoutePage-B_eXfNAF.js} +3 -3
- package/dist/assets/web/dist/assets/{RunsIndexPage-C7hx5O1X.js → RunsIndexPage-BpQu36Dm.js} +1 -1
- package/dist/assets/web/dist/assets/{ScheduledPage-Dk2kMnYT.js → ScheduledPage-DGHcjcSt.js} +1 -1
- package/dist/assets/web/dist/assets/{SettingsPage-DAf6R383.js → SettingsPage-IfQ71QjN.js} +1 -1
- package/dist/assets/web/dist/assets/{SilentTurn-CPED_XCV.js → SilentTurn-D9ON15a8.js} +1 -1
- package/dist/assets/web/dist/assets/{StatusDot-IkfsHGXg.js → StatusDot-DyFjGg4V.js} +1 -1
- package/dist/assets/web/dist/assets/{Tooltip-CmQVfAl2.js → Tooltip-BvPkV4kZ.js} +1 -1
- package/dist/assets/web/dist/assets/{UnitRoutePage-BjfuZVWr.js → UnitRoutePage-BNe3nBIG.js} +1 -1
- package/dist/assets/web/dist/assets/{dist-Dg6HTzpQ.js → dist-v3Py3_QR.js} +1 -1
- package/dist/assets/web/dist/assets/{main-Bk1L-bNk.js → main-ks3kBojV.js} +2 -2
- package/dist/assets/web/dist/assets/{sseReplay-DGRDRLua.js → sseReplay-DuALaBPq.js} +1 -1
- package/dist/cli.js +1834 -641
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./AppShell-DPJVhUGP.js";import{An as t,Cn as n,Cr as r,Li as i,Mn as ee,Sn as te,Tr as ne,Xr as a,_r as o,bn as s,ji as c,kn as l,ln as u,o as d,xn as f,yn as p}from"./browser-CCImen5O.js";import{_ as m,a as re,c as ie,d as ae,g as oe,l as se,m as h,n as ce,o as g,s as le,u as ue,v as _}from"./main-Bk1L-bNk.js";import{t as v}from"./StatusDot-IkfsHGXg.js";var de={class:`mt-4 first:mt-0`},fe={class:`w-full border-collapse font-mono text-[0.8125rem]`},pe={class:`border-t border-muted`},me={class:`px-2 py-1 align-top`},y={class:`ml-1.5 font-medium`},b={class:`border-t border-muted`},x={class:`break-all px-2 py-1 align-top`},S={key:0},C={key:1,class:`text-dimmed`},w={class:`border-t border-muted`},T={class:`break-all px-2 py-1 align-top`},E={key:0},D={key:1,class:`text-dimmed`},O={class:`border-t border-muted`},k={class:`break-all px-2 py-1 align-top`},A={key:0},j={key:1,class:`text-dimmed`},M={class:`border-t border-muted`},N={class:`break-all px-2 py-1 align-top`},P={key:0},F={key:1,class:`text-dimmed`},I={class:`border-t border-muted`},L={class:`break-all px-2 py-1 align-top`},R={key:1,class:`text-dimmed`},z={class:`mt-4`},he={class:`w-full border-collapse font-mono text-[0.8125rem]`},ge={class:`border-t border-muted`},_e={class:`break-all px-2 py-1 align-top`},ve=[`href`],ye={key:1},be={class:`border-t border-muted`},xe={class:`break-all px-2 py-1 align-top`},Se={class:`border-t border-muted`},Ce={class:`break-all px-2 py-1 align-top`},we=[`href`],Te={key:1},Ee={key:2,class:`text-dimmed`},De={class:`border-t border-muted`},Oe={class:`break-all px-2 py-1 align-top`},ke={key:0},Ae={key:1,class:`text-dimmed`},je={class:`border-t border-muted`},Me={class:`break-all px-2 py-1 align-top`},Ne={key:0},Pe={key:1,class:`text-dimmed`},Fe={class:`border-t border-muted`},Ie={class:`break-all px-2 py-1 align-top`},Le={key:0},Re={key:1,class:`text-dimmed`},ze={class:`mt-4`},Be={class:`w-full border-collapse font-mono text-[0.8125rem]`},Ve={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},He={class:`break-all px-2 py-1 align-top`},Ue={class:`w-full border-collapse font-mono text-[0.8125rem]`},We={class:`w-32 break-all px-2 py-1 align-top text-muted sm:w-96 sm:break-words`},Ge={class:`px-2 py-1 align-top`},Ke={key:1,class:`text-xs text-muted`},qe={class:`mt-4`},Je={key:0,class:`w-full border-collapse font-mono text-[0.8125rem]`},Ye={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},B={class:`break-all px-2 py-1 align-top`},Xe={key:0},Ze={key:1,class:`text-dimmed`},Qe={key:1,class:`text-xs text-muted`},$e={class:`mt-4`},et={class:`mb-1 text-xs text-muted`},tt={class:`overflow-x-auto`},nt={class:`w-full border-collapse font-mono text-[0.8125rem]`},rt={class:`break-all px-2 py-1 align-top`},it={key:0,class:`text-xs text-muted`},at={class:`break-all px-2 py-1 align-top`},ot=[`href`],st={key:1},ct={key:2,class:`text-dimmed`},lt={class:`break-all px-2 py-1 align-top`},ut={key:0},dt={key:1,class:`text-dimmed`},ft={key:2},pt={key:3,class:`text-dimmed`},mt={class:`break-all px-2 py-1 align-top`},ht={key:0},gt={key:1,class:`text-dimmed`},_t={key:2},vt={key:3,class:`text-dimmed`},yt={key:1,class:`text-xs text-muted`},bt={class:`mt-4`},xt={class:`w-full border-collapse font-mono text-[0.8125rem]`},St={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Ct={class:`px-2 py-1 align-top`},wt={class:`mt-4`},Tt={key:0,class:`w-full border-collapse font-mono text-[0.8125rem]`},Et={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Dt={class:`break-all px-2 py-1 align-top`},Ot={class:`text-xs text-muted`},kt={key:1,class:`text-xs text-muted`},At={class:`mt-4`},jt={class:`w-full border-collapse font-mono text-[0.8125rem]`},Mt={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Nt={class:`break-all px-2 py-1 align-top`},Pt={key:0},Ft={key:1,class:`text-dimmed`},It={class:`mt-4 text-xs text-muted`},Lt={class:`rounded bg-elevated px-1 py-0.5`},Rt={class:`rounded bg-elevated px-1 py-0.5`},zt={class:`rounded bg-elevated px-1 py-0.5`},V=ee({__name:`ResidentDetailPage`,setup(ee){let V=d(`resident`),H=p(()=>V?.record??{}),U=p(()=>ie(H.value)),W=p(()=>se(H.value)||(V?.slug??``)),G=p(()=>h(U.value.sha)),K=p(()=>ce.test(W.value)?`https://github.com/${W.value}`:void 0),q=p(()=>K.value&&/^[0-9a-f]{7,40}$/.test(G.value)?`${K.value}/commit/${G.value}`:void 0),J=p(()=>{let e=U.value.snapshot;return e&&typeof e==`object`?g(e):void 0}),Bt=p(()=>g(U.value.schedules)),Y=p(()=>{let e=g(H.value.commands),t=g(H.value.effects);return Object.keys(e).sort().map(n=>({name:n,command:h(e[n]),effect:h(t[n])||`readonly`}))}),X=p(()=>ae(H.value).map(e=>({...e,threadKey:e.threadKey||`?`,ref:e.ref||`?`,sha:e.sha?e.sha.slice(0,8):``,commitHref:K.value&&/^[0-9a-f]{7,40}$/.test(e.sha)?`${K.value}/commit/${e.sha}`:void 0}))),Z=p(()=>X.value.filter(e=>!e.evicted).length),Q=p(()=>{let e=U.value.lastRestore;return e?JSON.stringify(e):``}),$=p(()=>le(H.value)),Vt=p(()=>typeof H.value.diskBudgetMb==`number`?H.value.diskBudgetMb:void 0),Ht=p(()=>{let e=$.value;if(!e)return[];let t=re(e,Vt.value),n=n=>{let r=t.room[n];return r===null?_(e.parts,n)===null?`? (checkout not measured)`:`?`:`${r} more (${m(_(e.parts,n))} each)`};return[[`used / total`,oe(e)],[`free`,`${m(t.freeKiB)}${t.capped?` under the ${m(t.capacityKiB)} diskBudgetMb cap`:``}`],[`reserve`,`${m(t.reserve.totalKiB)} (snapshot staging ${m(t.reserve.stagingKiB)} + floor ${m(t.reserve.floorKiB)})`],[`headroom`,`${m(t.headroomKiB)} — room for ${n(`hardlink`)} hardlinked trees, ${n(`reconcile`)} lockfile-diverged (reconciling)`],[`measured`,e.at||`—`]]}),Ut=p(()=>{let e=$.value;if(!e)return[];let t=[[`mirror`,m(e.parts.mirror)],[`checkout deps (node_modules)`,m(e.parts.deps)],[`checkout (history + tree + build)`,m(e.parts.checkout)]];for(let[n,r]of Object.entries(e.parts.threads).sort((e,t)=>t[1]-e[1]))t.push([`thread ${n}`,m(r)]);for(let[n,r]of Object.entries(e.parts.homes).sort((e,t)=>t[1]-e[1]))r>=1024&&t.push([`home ${n}`,m(r)]);return t.push([`other (image, /tmp, …)`,m(e.parts.other)]),t});return(ee,d)=>{let p=ne(`RouterLink`);return o(),f(e,{title:W.value||`Resident`,nav:`residents`},{leading:a(()=>[t(p,{class:`back text-sm text-muted no-underline hover:text-primary`,to:`/residents`},{default:a(()=>[...d[0]||=[l(`← All residents`,-1)]]),_:1})]),default:a(()=>[s(`section`,de,[d[8]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Lifecycle`,-1),s(`table`,fe,[s(`tbody`,null,[s(`tr`,pe,[d[1]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`state`,-1),s(`td`,me,[t(v,{tone:c(ue)(U.value.state),label:U.value.state},null,8,[`tone`,`label`]),s(`span`,y,i(U.value.state),1)])]),s(`tr`,b,[d[2]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`reason`,-1),s(`td`,x,[U.value.reason?(o(),n(`span`,S,i(U.value.reason),1)):(o(),n(`span`,C,`—`))])]),s(`tr`,w,[d[3]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last refresh error`,-1),s(`td`,T,[c(h)(U.value.lastRefreshError)?(o(),n(`span`,E,i(c(h)(U.value.lastRefreshError)),1)):(o(),n(`span`,D,`—`))])]),s(`tr`,O,[d[4]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last restore`,-1),s(`td`,k,[Q.value?(o(),n(`span`,A,i(Q.value),1)):(o(),n(`span`,j,`—`))])]),s(`tr`,M,[d[5]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`state updated`,-1),s(`td`,N,[c(h)(U.value.updatedAt)?(o(),n(`span`,P,i(c(h)(U.value.updatedAt)),1)):(o(),n(`span`,F,`—`))])]),s(`tr`,I,[d[7]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`idle since`,-1),s(`td`,L,[c(h)(U.value.idleSince)?(o(),n(u,{key:0},[l(i(c(h)(U.value.idleSince))+` `,1),d[6]||=s(`span`,{class:`text-xs text-muted`},`(refresh parked; container may sleep)`,-1)],64)):(o(),n(`span`,R,`awake`))])])])])]),s(`section`,z,[d[15]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Pinned facts`,-1),s(`table`,he,[s(`tbody`,null,[s(`tr`,ge,[d[9]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`repository`,-1),s(`td`,_e,[K.value?(o(),n(`a`,{key:0,class:`text-primary`,href:K.value},i(K.value),9,ve)):(o(),n(`span`,ye,i(c(h)(H.value.resource)||`—`),1))])]),s(`tr`,be,[d[10]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`default ref`,-1),s(`td`,xe,i(c(h)(U.value.defaultRef)||c(h)(H.value.defaultRef)||`—`),1)]),s(`tr`,Se,[d[11]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`pinned sha`,-1),s(`td`,Ce,[q.value?(o(),n(`a`,{key:0,class:`text-primary`,href:q.value},i(G.value),9,we)):G.value?(o(),n(`span`,Te,i(G.value),1)):(o(),n(`span`,Ee,`—`))])]),s(`tr`,De,[d[12]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`lockfile hash`,-1),s(`td`,Oe,[c(h)(U.value.lockfileHash)?(o(),n(`span`,ke,i(c(h)(U.value.lockfileHash)),1)):(o(),n(`span`,Ae,`—`))])]),s(`tr`,je,[d[13]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`provisioned`,-1),s(`td`,Me,[c(h)(U.value.provisionedAt)?(o(),n(`span`,Ne,i(c(h)(U.value.provisionedAt)),1)):(o(),n(`span`,Pe,`—`))])]),s(`tr`,Fe,[d[14]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last refresh`,-1),s(`td`,Ie,[c(h)(U.value.lastRefreshAt)?(o(),n(`span`,Le,i(c(h)(U.value.lastRefreshAt)),1)):(o(),n(`span`,Re,`—`))])])])])]),s(`section`,ze,[d[17]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Disk`,-1),$.value?(o(),n(u,{key:0},[s(`table`,Be,[s(`tbody`,null,[(o(!0),n(u,null,r(Ht.value,([e,t])=>(o(),n(`tr`,{key:e,class:`border-t border-muted`},[s(`td`,Ve,i(e),1),s(`td`,He,i(t),1)]))),128))])]),d[16]||=s(`p`,{class:`mb-1 mt-2 text-xs text-muted`},` components (one du, hardlinks counted once — a thread tree shows only what it does not share with the checkout) `,-1),s(`table`,Ue,[s(`tbody`,null,[(o(!0),n(u,null,r(Ut.value,([e,t])=>(o(),n(`tr`,{key:e,class:`border-t border-muted`},[s(`td`,We,i(e),1),s(`td`,Ge,i(t),1)]))),128))])])],64)):(o(),n(`p`,Ke,` not measured yet — the first refresh cycle or attach of this container measures it `))]),s(`section`,qe,[d[18]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Snapshot stamp`,-1),J.value?(o(),n(`table`,Je,[s(`tbody`,null,[(o(),n(u,null,r([`ref`,`sha`,`lockfileHash`,`createdAt`,`mirrorBackupId`,`checkoutBackupId`],e=>s(`tr`,{key:e,class:`border-t border-muted`},[s(`td`,Ye,i(e),1),s(`td`,B,[c(h)(J.value[e])?(o(),n(`span`,Xe,i(c(h)(J.value[e])),1)):(o(),n(`span`,Ze,`—`))])])),64))])])):(o(),n(`p`,Qe,`no snapshot recorded`))]),s(`section`,$e,[d[22]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Thread worktrees`,-1),X.value.length>0?(o(),n(u,{key:0},[s(`p`,et,i(Z.value)+` live · `+i(X.value.length-Z.value)+` evicted`,1),s(`div`,tt,[s(`table`,nt,[s(`tbody`,null,[d[21]||=s(`tr`,{class:`text-xs text-muted`},[s(`td`,{class:`px-2 py-1`},`thread`),s(`td`,{class:`px-2 py-1`},`ref · sha`),s(`td`,{class:`px-2 py-1`},`user · deps`),s(`td`,{class:`px-2 py-1`},`bound · last attach`)],-1),(o(!0),n(u,null,r(X.value,e=>(o(),n(`tr`,{key:e.threadKey,class:`border-t border-muted`},[s(`td`,rt,[e.evicted?(o(),n(`span`,it,[l(`evicted `+i(e.evictedAt||`—`),1),e.evictedWhy?(o(),n(u,{key:0},[l(` · `+i(e.evictedWhy),1)],64)):te(``,!0)])):(o(),f(v,{key:1,tone:`green`,label:`live`,tip:`live`})),l(` `+i(e.threadKey),1)]),s(`td`,at,[l(i(e.ref)+` · `,1),e.commitHref?(o(),n(`a`,{key:0,class:`text-primary`,href:e.commitHref},i(e.sha),9,ot)):e.sha?(o(),n(`span`,st,i(e.sha),1)):(o(),n(`span`,ct,`—`))]),s(`td`,lt,[e.user?(o(),n(`span`,ut,i(e.user),1)):(o(),n(`span`,dt,`—`)),d[19]||=l(` · `,-1),e.deps?(o(),n(`span`,ft,i(e.deps),1)):(o(),n(`span`,pt,`—`))]),s(`td`,mt,[e.boundAt?(o(),n(`span`,ht,i(e.boundAt),1)):(o(),n(`span`,gt,`—`)),d[20]||=l(` · `,-1),e.lastAttachAt?(o(),n(`span`,_t,i(e.lastAttachAt),1)):(o(),n(`span`,vt,`—`))])]))),128))])])])],64)):(o(),n(`p`,yt,`no thread worktrees`))]),s(`section`,bt,[d[23]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Pending schedules`,-1),s(`table`,xt,[s(`tbody`,null,[(o(),n(u,null,r([[`refresh`,`refresh`],[`provision run`,`provisionRun`],[`provision deadline`,`provisionDeadline`]],([e,t])=>s(`tr`,{key:t,class:`border-t border-muted`},[s(`td`,St,i(e),1),s(`td`,Ct,i(c(h)(Bt.value[t]??0)||`0`),1)])),64))])])]),s(`section`,wt,[d[25]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Command table`,-1),Y.value.length>0?(o(),n(`table`,Tt,[s(`tbody`,null,[(o(!0),n(u,null,r(Y.value,e=>(o(),n(`tr`,{key:e.name,class:`border-t border-muted`},[s(`td`,Et,i(e.name),1),s(`td`,Dt,[s(`code`,null,i(e.command),1),d[24]||=l(),s(`span`,Ot,i(e.effect),1)])]))),128))])])):(o(),n(`p`,kt,`no command table`))]),s(`section`,At,[d[26]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Registry settings`,-1),s(`table`,jt,[s(`tbody`,null,[(o(!0),n(u,null,r([[`onboarded`,c(h)(H.value.onboardedAt)],[`record updated`,c(h)(H.value.updatedAt)],[`provisioning timeout (ms)`,c(h)(H.value.provisioningTimeoutMs)],[`disk budget (MB)`,c(h)(H.value.diskBudgetMb)],[`worktree TTL (days)`,c(h)(H.value.worktreeTtlDays??7)]],([e,t])=>(o(),n(`tr`,{key:e,class:`border-t border-muted`},[s(`td`,Mt,i(e),1),s(`td`,Nt,[t?(o(),n(`span`,Pt,i(t),1)):(o(),n(`span`,Ft,`—`))])]))),128))])])]),s(`p`,It,[d[27]||=l(` Manage from chat: `,-1),s(`code`,Lt,`repo rebuild `+i(W.value),1),d[28]||=l(` · `,-1),s(`code`,Rt,`repo reconfigure `+i(W.value)+` …`,1),d[29]||=l(` · `,-1),s(`code`,zt,`repo offboard `+i(W.value)+` --dry-run`,1)])]),_:1},8,[`title`])}}});export{V as default};
|
|
1
|
+
import{t as e}from"./AppShell-DPJVhUGP.js";import{An as t,Cn as n,Cr as r,Li as i,Mn as ee,Sn as te,Tr as ne,Xr as a,_r as o,bn as s,ji as c,kn as l,ln as u,o as d,xn as f,yn as p}from"./browser-CCImen5O.js";import{_ as m,a as re,c as ie,d as ae,g as oe,l as se,m as h,n as ce,o as g,s as le,u as ue,v as _}from"./main-ks3kBojV.js";import{t as v}from"./StatusDot-DyFjGg4V.js";var de={class:`mt-4 first:mt-0`},fe={class:`w-full border-collapse font-mono text-[0.8125rem]`},pe={class:`border-t border-muted`},me={class:`px-2 py-1 align-top`},y={class:`ml-1.5 font-medium`},b={class:`border-t border-muted`},x={class:`break-all px-2 py-1 align-top`},S={key:0},C={key:1,class:`text-dimmed`},w={class:`border-t border-muted`},T={class:`break-all px-2 py-1 align-top`},E={key:0},D={key:1,class:`text-dimmed`},O={class:`border-t border-muted`},k={class:`break-all px-2 py-1 align-top`},A={key:0},j={key:1,class:`text-dimmed`},M={class:`border-t border-muted`},N={class:`break-all px-2 py-1 align-top`},P={key:0},F={key:1,class:`text-dimmed`},I={class:`border-t border-muted`},L={class:`break-all px-2 py-1 align-top`},R={key:1,class:`text-dimmed`},z={class:`mt-4`},he={class:`w-full border-collapse font-mono text-[0.8125rem]`},ge={class:`border-t border-muted`},_e={class:`break-all px-2 py-1 align-top`},ve=[`href`],ye={key:1},be={class:`border-t border-muted`},xe={class:`break-all px-2 py-1 align-top`},Se={class:`border-t border-muted`},Ce={class:`break-all px-2 py-1 align-top`},we=[`href`],Te={key:1},Ee={key:2,class:`text-dimmed`},De={class:`border-t border-muted`},Oe={class:`break-all px-2 py-1 align-top`},ke={key:0},Ae={key:1,class:`text-dimmed`},je={class:`border-t border-muted`},Me={class:`break-all px-2 py-1 align-top`},Ne={key:0},Pe={key:1,class:`text-dimmed`},Fe={class:`border-t border-muted`},Ie={class:`break-all px-2 py-1 align-top`},Le={key:0},Re={key:1,class:`text-dimmed`},ze={class:`mt-4`},Be={class:`w-full border-collapse font-mono text-[0.8125rem]`},Ve={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},He={class:`break-all px-2 py-1 align-top`},Ue={class:`w-full border-collapse font-mono text-[0.8125rem]`},We={class:`w-32 break-all px-2 py-1 align-top text-muted sm:w-96 sm:break-words`},Ge={class:`px-2 py-1 align-top`},Ke={key:1,class:`text-xs text-muted`},qe={class:`mt-4`},Je={key:0,class:`w-full border-collapse font-mono text-[0.8125rem]`},Ye={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},B={class:`break-all px-2 py-1 align-top`},Xe={key:0},Ze={key:1,class:`text-dimmed`},Qe={key:1,class:`text-xs text-muted`},$e={class:`mt-4`},et={class:`mb-1 text-xs text-muted`},tt={class:`overflow-x-auto`},nt={class:`w-full border-collapse font-mono text-[0.8125rem]`},rt={class:`break-all px-2 py-1 align-top`},it={key:0,class:`text-xs text-muted`},at={class:`break-all px-2 py-1 align-top`},ot=[`href`],st={key:1},ct={key:2,class:`text-dimmed`},lt={class:`break-all px-2 py-1 align-top`},ut={key:0},dt={key:1,class:`text-dimmed`},ft={key:2},pt={key:3,class:`text-dimmed`},mt={class:`break-all px-2 py-1 align-top`},ht={key:0},gt={key:1,class:`text-dimmed`},_t={key:2},vt={key:3,class:`text-dimmed`},yt={key:1,class:`text-xs text-muted`},bt={class:`mt-4`},xt={class:`w-full border-collapse font-mono text-[0.8125rem]`},St={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Ct={class:`px-2 py-1 align-top`},wt={class:`mt-4`},Tt={key:0,class:`w-full border-collapse font-mono text-[0.8125rem]`},Et={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Dt={class:`break-all px-2 py-1 align-top`},Ot={class:`text-xs text-muted`},kt={key:1,class:`text-xs text-muted`},At={class:`mt-4`},jt={class:`w-full border-collapse font-mono text-[0.8125rem]`},Mt={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Nt={class:`break-all px-2 py-1 align-top`},Pt={key:0},Ft={key:1,class:`text-dimmed`},It={class:`mt-4 text-xs text-muted`},Lt={class:`rounded bg-elevated px-1 py-0.5`},Rt={class:`rounded bg-elevated px-1 py-0.5`},zt={class:`rounded bg-elevated px-1 py-0.5`},V=ee({__name:`ResidentDetailPage`,setup(ee){let V=d(`resident`),H=p(()=>V?.record??{}),U=p(()=>ie(H.value)),W=p(()=>se(H.value)||(V?.slug??``)),G=p(()=>h(U.value.sha)),K=p(()=>ce.test(W.value)?`https://github.com/${W.value}`:void 0),q=p(()=>K.value&&/^[0-9a-f]{7,40}$/.test(G.value)?`${K.value}/commit/${G.value}`:void 0),J=p(()=>{let e=U.value.snapshot;return e&&typeof e==`object`?g(e):void 0}),Bt=p(()=>g(U.value.schedules)),Y=p(()=>{let e=g(H.value.commands),t=g(H.value.effects);return Object.keys(e).sort().map(n=>({name:n,command:h(e[n]),effect:h(t[n])||`readonly`}))}),X=p(()=>ae(H.value).map(e=>({...e,threadKey:e.threadKey||`?`,ref:e.ref||`?`,sha:e.sha?e.sha.slice(0,8):``,commitHref:K.value&&/^[0-9a-f]{7,40}$/.test(e.sha)?`${K.value}/commit/${e.sha}`:void 0}))),Z=p(()=>X.value.filter(e=>!e.evicted).length),Q=p(()=>{let e=U.value.lastRestore;return e?JSON.stringify(e):``}),$=p(()=>le(H.value)),Vt=p(()=>typeof H.value.diskBudgetMb==`number`?H.value.diskBudgetMb:void 0),Ht=p(()=>{let e=$.value;if(!e)return[];let t=re(e,Vt.value),n=n=>{let r=t.room[n];return r===null?_(e.parts,n)===null?`? (checkout not measured)`:`?`:`${r} more (${m(_(e.parts,n))} each)`};return[[`used / total`,oe(e)],[`free`,`${m(t.freeKiB)}${t.capped?` under the ${m(t.capacityKiB)} diskBudgetMb cap`:``}`],[`reserve`,`${m(t.reserve.totalKiB)} (snapshot staging ${m(t.reserve.stagingKiB)} + floor ${m(t.reserve.floorKiB)})`],[`headroom`,`${m(t.headroomKiB)} — room for ${n(`hardlink`)} hardlinked trees, ${n(`reconcile`)} lockfile-diverged (reconciling)`],[`measured`,e.at||`—`]]}),Ut=p(()=>{let e=$.value;if(!e)return[];let t=[[`mirror`,m(e.parts.mirror)],[`checkout deps (node_modules)`,m(e.parts.deps)],[`checkout (history + tree + build)`,m(e.parts.checkout)]];for(let[n,r]of Object.entries(e.parts.threads).sort((e,t)=>t[1]-e[1]))t.push([`thread ${n}`,m(r)]);for(let[n,r]of Object.entries(e.parts.homes).sort((e,t)=>t[1]-e[1]))r>=1024&&t.push([`home ${n}`,m(r)]);return t.push([`other (image, /tmp, …)`,m(e.parts.other)]),t});return(ee,d)=>{let p=ne(`RouterLink`);return o(),f(e,{title:W.value||`Resident`,nav:`residents`},{leading:a(()=>[t(p,{class:`back text-sm text-muted no-underline hover:text-primary`,to:`/residents`},{default:a(()=>[...d[0]||=[l(`← All residents`,-1)]]),_:1})]),default:a(()=>[s(`section`,de,[d[8]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Lifecycle`,-1),s(`table`,fe,[s(`tbody`,null,[s(`tr`,pe,[d[1]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`state`,-1),s(`td`,me,[t(v,{tone:c(ue)(U.value.state),label:U.value.state},null,8,[`tone`,`label`]),s(`span`,y,i(U.value.state),1)])]),s(`tr`,b,[d[2]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`reason`,-1),s(`td`,x,[U.value.reason?(o(),n(`span`,S,i(U.value.reason),1)):(o(),n(`span`,C,`—`))])]),s(`tr`,w,[d[3]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last refresh error`,-1),s(`td`,T,[c(h)(U.value.lastRefreshError)?(o(),n(`span`,E,i(c(h)(U.value.lastRefreshError)),1)):(o(),n(`span`,D,`—`))])]),s(`tr`,O,[d[4]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last restore`,-1),s(`td`,k,[Q.value?(o(),n(`span`,A,i(Q.value),1)):(o(),n(`span`,j,`—`))])]),s(`tr`,M,[d[5]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`state updated`,-1),s(`td`,N,[c(h)(U.value.updatedAt)?(o(),n(`span`,P,i(c(h)(U.value.updatedAt)),1)):(o(),n(`span`,F,`—`))])]),s(`tr`,I,[d[7]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`idle since`,-1),s(`td`,L,[c(h)(U.value.idleSince)?(o(),n(u,{key:0},[l(i(c(h)(U.value.idleSince))+` `,1),d[6]||=s(`span`,{class:`text-xs text-muted`},`(refresh parked; container may sleep)`,-1)],64)):(o(),n(`span`,R,`awake`))])])])])]),s(`section`,z,[d[15]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Pinned facts`,-1),s(`table`,he,[s(`tbody`,null,[s(`tr`,ge,[d[9]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`repository`,-1),s(`td`,_e,[K.value?(o(),n(`a`,{key:0,class:`text-primary`,href:K.value},i(K.value),9,ve)):(o(),n(`span`,ye,i(c(h)(H.value.resource)||`—`),1))])]),s(`tr`,be,[d[10]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`default ref`,-1),s(`td`,xe,i(c(h)(U.value.defaultRef)||c(h)(H.value.defaultRef)||`—`),1)]),s(`tr`,Se,[d[11]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`pinned sha`,-1),s(`td`,Ce,[q.value?(o(),n(`a`,{key:0,class:`text-primary`,href:q.value},i(G.value),9,we)):G.value?(o(),n(`span`,Te,i(G.value),1)):(o(),n(`span`,Ee,`—`))])]),s(`tr`,De,[d[12]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`lockfile hash`,-1),s(`td`,Oe,[c(h)(U.value.lockfileHash)?(o(),n(`span`,ke,i(c(h)(U.value.lockfileHash)),1)):(o(),n(`span`,Ae,`—`))])]),s(`tr`,je,[d[13]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`provisioned`,-1),s(`td`,Me,[c(h)(U.value.provisionedAt)?(o(),n(`span`,Ne,i(c(h)(U.value.provisionedAt)),1)):(o(),n(`span`,Pe,`—`))])]),s(`tr`,Fe,[d[14]||=s(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last refresh`,-1),s(`td`,Ie,[c(h)(U.value.lastRefreshAt)?(o(),n(`span`,Le,i(c(h)(U.value.lastRefreshAt)),1)):(o(),n(`span`,Re,`—`))])])])])]),s(`section`,ze,[d[17]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Disk`,-1),$.value?(o(),n(u,{key:0},[s(`table`,Be,[s(`tbody`,null,[(o(!0),n(u,null,r(Ht.value,([e,t])=>(o(),n(`tr`,{key:e,class:`border-t border-muted`},[s(`td`,Ve,i(e),1),s(`td`,He,i(t),1)]))),128))])]),d[16]||=s(`p`,{class:`mb-1 mt-2 text-xs text-muted`},` components (one du, hardlinks counted once — a thread tree shows only what it does not share with the checkout) `,-1),s(`table`,Ue,[s(`tbody`,null,[(o(!0),n(u,null,r(Ut.value,([e,t])=>(o(),n(`tr`,{key:e,class:`border-t border-muted`},[s(`td`,We,i(e),1),s(`td`,Ge,i(t),1)]))),128))])])],64)):(o(),n(`p`,Ke,` not measured yet — the first refresh cycle or attach of this container measures it `))]),s(`section`,qe,[d[18]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Snapshot stamp`,-1),J.value?(o(),n(`table`,Je,[s(`tbody`,null,[(o(),n(u,null,r([`ref`,`sha`,`lockfileHash`,`createdAt`,`mirrorBackupId`,`checkoutBackupId`],e=>s(`tr`,{key:e,class:`border-t border-muted`},[s(`td`,Ye,i(e),1),s(`td`,B,[c(h)(J.value[e])?(o(),n(`span`,Xe,i(c(h)(J.value[e])),1)):(o(),n(`span`,Ze,`—`))])])),64))])])):(o(),n(`p`,Qe,`no snapshot recorded`))]),s(`section`,$e,[d[22]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Thread worktrees`,-1),X.value.length>0?(o(),n(u,{key:0},[s(`p`,et,i(Z.value)+` live · `+i(X.value.length-Z.value)+` evicted`,1),s(`div`,tt,[s(`table`,nt,[s(`tbody`,null,[d[21]||=s(`tr`,{class:`text-xs text-muted`},[s(`td`,{class:`px-2 py-1`},`thread`),s(`td`,{class:`px-2 py-1`},`ref · sha`),s(`td`,{class:`px-2 py-1`},`user · deps`),s(`td`,{class:`px-2 py-1`},`bound · last attach`)],-1),(o(!0),n(u,null,r(X.value,e=>(o(),n(`tr`,{key:e.threadKey,class:`border-t border-muted`},[s(`td`,rt,[e.evicted?(o(),n(`span`,it,[l(`evicted `+i(e.evictedAt||`—`),1),e.evictedWhy?(o(),n(u,{key:0},[l(` · `+i(e.evictedWhy),1)],64)):te(``,!0)])):(o(),f(v,{key:1,tone:`green`,label:`live`,tip:`live`})),l(` `+i(e.threadKey),1)]),s(`td`,at,[l(i(e.ref)+` · `,1),e.commitHref?(o(),n(`a`,{key:0,class:`text-primary`,href:e.commitHref},i(e.sha),9,ot)):e.sha?(o(),n(`span`,st,i(e.sha),1)):(o(),n(`span`,ct,`—`))]),s(`td`,lt,[e.user?(o(),n(`span`,ut,i(e.user),1)):(o(),n(`span`,dt,`—`)),d[19]||=l(` · `,-1),e.deps?(o(),n(`span`,ft,i(e.deps),1)):(o(),n(`span`,pt,`—`))]),s(`td`,mt,[e.boundAt?(o(),n(`span`,ht,i(e.boundAt),1)):(o(),n(`span`,gt,`—`)),d[20]||=l(` · `,-1),e.lastAttachAt?(o(),n(`span`,_t,i(e.lastAttachAt),1)):(o(),n(`span`,vt,`—`))])]))),128))])])])],64)):(o(),n(`p`,yt,`no thread worktrees`))]),s(`section`,bt,[d[23]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Pending schedules`,-1),s(`table`,xt,[s(`tbody`,null,[(o(),n(u,null,r([[`refresh`,`refresh`],[`provision run`,`provisionRun`],[`provision deadline`,`provisionDeadline`]],([e,t])=>s(`tr`,{key:t,class:`border-t border-muted`},[s(`td`,St,i(e),1),s(`td`,Ct,i(c(h)(Bt.value[t]??0)||`0`),1)])),64))])])]),s(`section`,wt,[d[25]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Command table`,-1),Y.value.length>0?(o(),n(`table`,Tt,[s(`tbody`,null,[(o(!0),n(u,null,r(Y.value,e=>(o(),n(`tr`,{key:e.name,class:`border-t border-muted`},[s(`td`,Et,i(e.name),1),s(`td`,Dt,[s(`code`,null,i(e.command),1),d[24]||=l(),s(`span`,Ot,i(e.effect),1)])]))),128))])])):(o(),n(`p`,kt,`no command table`))]),s(`section`,At,[d[26]||=s(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Registry settings`,-1),s(`table`,jt,[s(`tbody`,null,[(o(!0),n(u,null,r([[`onboarded`,c(h)(H.value.onboardedAt)],[`record updated`,c(h)(H.value.updatedAt)],[`provisioning timeout (ms)`,c(h)(H.value.provisioningTimeoutMs)],[`disk budget (MB)`,c(h)(H.value.diskBudgetMb)],[`worktree TTL (days)`,c(h)(H.value.worktreeTtlDays??7)]],([e,t])=>(o(),n(`tr`,{key:e,class:`border-t border-muted`},[s(`td`,Mt,i(e),1),s(`td`,Nt,[t?(o(),n(`span`,Pt,i(t),1)):(o(),n(`span`,Ft,`—`))])]))),128))])])]),s(`p`,It,[d[27]||=l(` Manage from chat: `,-1),s(`code`,Lt,`repo rebuild `+i(W.value),1),d[28]||=l(` · `,-1),s(`code`,Rt,`repo reconfigure `+i(W.value)+` …`,1),d[29]||=l(` · `,-1),s(`code`,zt,`repo offboard `+i(W.value)+` --dry-run`,1)])]),_:1},8,[`title`])}}});export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./AppShell-DPJVhUGP.js";import{An as t,Cn as n,Cr as r,Gr as i,Li as a,Mn as o,Pi as s,Sn as c,Tr as l,Xr as u,_r as d,bn as f,dr as p,hr as m,ji as h,kn as g,ln as _,o as v,rn as y,t as b,xi as x,xn as S,yi as C,yn as w}from"./browser-CCImen5O.js";import{t as T}from"./Tooltip-CmQVfAl2.js";import{_ as E,a as D,c as O,d as k,f as A,g as j,h as M,i as N,l as P,m as F,n as I,p as L,r as R,s as ee,u as te,y as z}from"./main-Bk1L-bNk.js";import{t as B}from"./eventSource-Cv0AFlMi.js";import{t as V}from"./wallClock-x0hjr0J_.js";import{n as ne,r as re}from"./indexFormat-B-pd4r7Y.js";import{A as ie,C as H,D as ae,S as oe,a as se,c as ce,i as le,l as ue,t as de,x as fe}from"./indexRow-BsWcHHVh.js";import"./format-BldUwl_R.js";import{t as U}from"./StatusDot-IkfsHGXg.js";var pe=[`data-slug`,`data-running`],me=[`open`],he={class:`row flex cursor-pointer list-none flex-wrap items-baseline gap-x-2.5 gap-y-1 rounded-md px-2 py-2 hover:bg-elevated [&::-webkit-details-marker]:hidden`},ge={class:`self-center`},_e={class:`font-mono text-[0.9375rem] font-medium text-highlighted`},ve={class:`text-sm text-toned`},ye={key:0,class:`running shrink-0 rounded border border-ok/25 bg-ok/8 px-1.5 font-mono text-[0.68rem] font-medium tabular-nums text-ok`},be=[`title`],xe={key:2,class:`basis-full pl-[1.9rem] text-xs text-warn`},Se={class:`fold pb-3 pl-[1.9rem] pr-2 pt-0.5`},Ce={key:0,class:`m-0 list-none divide-y divide-(--ui-border-muted) p-0`},we=[`data-run-id`,`data-thread`],Te={class:`pt-[0.3rem]`},Ee={class:`what min-w-0`},De={class:`flex min-w-0 items-baseline gap-2`},Oe=[`title`],ke={key:0,class:`who block truncate text-xs text-dimmed`},Ae=[`href`],je={key:1,class:`who block text-xs text-dimmed`},Me={class:`min-w-0 font-mono text-xs max-sm:col-span-2 max-sm:col-start-2 max-sm:row-start-2`},Ne=[`title`],Pe=[`href`],Fe={key:1},Ie={key:1,class:`font-sans text-dimmed`},Le={key:0,class:`facts-tree block truncate text-dimmed`},Re={class:`user`},ze={class:`deps`},Be=[`title`],Ve={class:`flex items-baseline gap-3 justify-self-end max-sm:col-start-3 max-sm:row-start-1`},He=[`title`],Ue={key:1,class:`py-1 text-xs text-dimmed`},We=[`data-idle`],Ge={key:1},W=o({__name:`ResidentRow`,props:{record:{},runs:{},now:{},open:{type:Boolean}},setup(e){let o=e,p=x(o.open===!0);i(()=>o.open,e=>{e&&(p.value=!0)});function m(e){p.value=e.target.open}let v=w(()=>P(o.record)),b=w(()=>v.value||F(o.record.resource)||`?`),C=w(()=>O(o.record)),T=w(()=>te(C.value.state)),A=w(()=>I.test(v.value)?`/residents/${v.value}`:null),L=w(()=>I.test(v.value)?`https://github.com/${v.value}`:void 0),R=e=>L.value&&/^[0-9a-f]{7,40}$/.test(e)?`${L.value}/commit/${e}`:void 0,z=w(()=>F(o.record.defaultRef)||`?`),B=w(()=>F(C.value.sha).slice(0,8)),V=w(()=>F(C.value.lastRefreshAt)),W=e=>{let t=e?Date.parse(e):NaN;return Number.isFinite(t)?ne(t,o.now):e||`—`},G=w(()=>V.value?W(V.value):``),K=w(()=>ee(o.record)),q=w(()=>K.value?j(K.value):``),J=w(()=>{let e=K.value;if(!e)return null;let t=typeof o.record.diskBudgetMb==`number`?o.record.diskBudgetMb:void 0;return D(e,t)}),Y=w(()=>[`ref ${z.value}`,B.value,G.value?`refreshed ${G.value}`:``,q.value?`disk ${q.value}`:``].filter(Boolean).join(` · `)),X=w(()=>[V.value?`refreshed ${V.value}`:``,K.value?.at?`disk measured ${K.value.at}`:``].filter(Boolean).join(` · `)),Z=w(()=>{let e=K.value,t=J.value;if(!e||!t)return``;let n=t.room.hardlink===null?`room not projected (checkout not measured)`:`room for ${t.room.hardlink} more ${t.room.hardlink===1?`tree`:`trees`}`;return[`${E(t.freeKiB)} free${t.capped?` under the ${E(t.capacityKiB)} cap`:``}`,n,`measured ${W(e.at)}`].join(` · `)}),Q=w(()=>k(o.record)),$=w(()=>{let e=o.runs.map(e=>{let t=re(e.label||H(e.id)),n=N(Q.value,e.threadKey),r=ie(e);return{key:`run:${e.id}`,run:e,agent:t.agent,text:t.snippet??t.scope,who:r.identity,surface:le[r.kind]??r.kind,threadUrl:oe(e),href:fe(e),elapsed:ue(e,o.now),binding:n,treeKiB:n?M(K.value,n.threadKey):null}}),t=new Set(o.runs.map(e=>e.threadKey));for(let n of Q.value)n.evicted||t.has(n.threadKey)||e.push({key:`idle:${n.threadKey}`,text:`idle`,who:``,surface:``,threadUrl:``,href:``,elapsed:``,binding:n,treeKiB:M(K.value,n.threadKey)});return e}),Ke=w(()=>$.value.filter(e=>!e.run).length);return(i,o)=>{let x=l(`RouterLink`);return d(),n(`li`,{class:`resident border-b border-muted first:border-t`,"data-slug":v.value,"data-running":e.runs.length},[f(`details`,{class:`group/fold`,open:p.value,onToggle:m},[f(`summary`,he,[o[2]||=f(`span`,{class:`chev w-3 select-none self-center text-xs text-dimmed transition-transform group-open/fold:rotate-90 motion-reduce:transition-none`,"aria-hidden":`true`},`❯`,-1),f(`span`,ge,[t(U,{tone:T.value,label:C.value.state,tip:C.value.state},null,8,[`tone`,`label`,`tip`])]),f(`span`,_e,a(b.value),1),f(`span`,ve,a(C.value.state),1),e.runs.length>0?(d(),n(`span`,ye,a(e.runs.length)+` running`,1)):c(``,!0),f(`span`,{class:`facts font-mono text-xs text-muted max-sm:basis-full max-sm:pl-[1.9rem] sm:ml-2`,title:X.value||void 0},a(Y.value),9,be),A.value?(d(),S(x,{key:1,class:`detail ml-auto shrink-0 text-xs text-muted no-underline hover:text-highlighted hover:underline`,to:A.value,onClick:o[0]||=y(()=>{},[`stop`])},{default:u(()=>[...o[1]||=[g(`detail ↗`,-1)]]),_:1},8,[`to`])):c(``,!0),C.value.reason?(d(),n(`span`,xe,a(C.value.reason),1)):c(``,!0)]),f(`div`,Se,[$.value.length>0?(d(),n(`ul`,Ce,[(d(!0),n(_,null,r($.value,t=>(d(),n(`li`,{key:t.key,class:s([`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-3 gap-y-1 py-2 sm:grid-cols-[auto_minmax(0,1fr)_minmax(14rem,22rem)_auto]`,t.run?`run`:`idle`]),"data-run-id":t.run?.id,"data-thread":t.run?void 0:t.binding?.threadKey},[f(`span`,Te,[t.run?(d(),S(U,{key:0,tone:`green`,label:h(ae)(t.run),tip:h(ce)(t.run),pulse:``},null,8,[`label`,`tip`])):(d(),S(U,{key:1,tone:`grey`,label:`idle`,tip:`no run is using this tree`}))]),f(`span`,Ee,[f(`span`,De,[t.agent?(d(),n(`span`,{key:0,class:s([`agent shrink-0 rounded border px-1.5 font-mono text-[0.65rem] font-medium uppercase tracking-wider`,h(de)[h(se)(t.agent)]])},a(t.agent),3)):c(``,!0),f(`span`,{class:s([`text min-w-0 truncate text-[0.8125rem]`,t.run?`text-highlighted`:`text-dimmed`]),title:t.run?t.text:void 0},a(t.text),11,Oe)]),t.run?(d(),n(`span`,ke,[t.who?(d(),n(_,{key:0},[g(`by `+a(t.who),1)],64)):c(``,!0),t.who&&(t.threadUrl||t.surface)?(d(),n(_,{key:1},[g(a(` · `))],64)):c(``,!0),t.threadUrl?(d(),n(`a`,{key:2,class:`text-muted no-underline hover:text-highlighted hover:underline`,href:t.threadUrl,target:`_blank`,rel:`noopener noreferrer`},a(t.surface)+` thread ↗`,9,Ae)):t.surface?(d(),n(_,{key:3},[g(`via `+a(t.surface),1)],64)):c(``,!0)])):t.binding?(d(),n(`span`,je,`last used `+a(W(t.binding.lastAttachAt)),1)):c(``,!0)]),f(`span`,Me,[f(`span`,{class:`tree block truncate text-toned`,title:t.binding&&t.binding.ref||void 0},[t.binding?(d(),n(_,{key:0},[g(a(t.binding.ref||`?`),1),t.binding.sha?(d(),n(_,{key:0},[o[3]||=g(a(` `),-1),o[4]||=f(`span`,{class:`text-dimmed`},`@`,-1),o[5]||=g(a(` `)+` `,-1),R(t.binding.sha)?(d(),n(`a`,{key:0,class:`text-highlighted no-underline hover:underline`,href:R(t.binding.sha)},a(t.binding.sha.slice(0,8)),9,Pe)):(d(),n(`span`,Fe,a(t.binding.sha.slice(0,8)),1))],64)):c(``,!0)],64)):(d(),n(`span`,Ie,`no worktree bound yet`))],8,Ne),t.binding?(d(),n(`span`,Le,[f(`span`,Re,a(t.binding.user||`—`),1),o[6]||=g(` `+a(` · `),-1),f(`span`,ze,a(t.binding.deps||`—`),1),o[7]||=g(` `+a(` · `),-1),f(`span`,{class:s([`size`,t.treeKiB===null?``:`text-muted`]),title:t.treeKiB===null?`size not measured yet`:`on disk`},a(t.treeKiB===null?`—`:h(E)(t.treeKiB)),11,Be)])):c(``,!0)]),f(`span`,Ve,[t.run?(d(),n(`span`,{key:0,class:`elapsed whitespace-nowrap font-mono text-xs tabular-nums text-ok`,title:`running for · started ${h(ne)(t.run.startedAt,e.now)}`},a(t.elapsed),9,He)):c(``,!0),t.run?(d(),S(x,{key:1,class:`open text-xs text-muted no-underline hover:text-highlighted hover:underline`,to:t.href,"aria-label":`open run ${t.run.label||h(H)(t.run.id)}`},{default:u(()=>[...o[8]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])):c(``,!0)])],10,we))),128))])):(d(),n(`p`,Ue,`nothing on this resident — no run, no worktree`)),f(`p`,{class:`disk mt-2 font-mono text-xs text-dimmed`,"data-idle":Ke.value},[Z.value?(d(),n(_,{key:0},[g(a(Z.value),1)],64)):(d(),n(`span`,Ge,`disk not measured yet`))],8,We)])],40,me)],8,pe)}}}),G={class:`conn flex items-center gap-1.5`},K={id:`state`,class:`text-xs text-muted`},q={class:`mb-2 text-xs text-muted`},J={id:`running`,class:`font-mono tabular-nums`},Y={id:`residents`,class:`m-0 list-none p-0`},X={key:1,class:`px-2 py-1.5 text-muted`},Z=`Resident repos`,Q=o({__name:`ResidentsIndexPage`,setup(o){let s=v(`residents`),c=C({cap:s?.cap,count:s?.count,residents:s?.residents??[],runs:new Map((s?.runs??[]).map(e=>[e.id,e]))}),l=V(s?.now),y=x({tone:`amber`,text:`connecting…`}),E=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,D=w(()=>c.residents.map((e,t)=>{let n=e,r=P(n);return{key:`${r||`?`}-${t}`,record:n,slug:r,runs:L(c.runs.values(),r)}})),O=w(()=>F(c.cap)||`?`),k=w(()=>F(c.count)||String(D.value.length)),j=w(()=>D.value.reduce((e,t)=>e+t.runs.length,0));i([j,()=>c.residents],([e,t])=>{b.setTitle((e>0?`(${e}) `:``)+Z),b.setFavicon(z[A(t)])},{immediate:!0});let M=B(),N=null;return p(()=>{N=M(`/residents?stream=1`);let e=!1;N.onopen=()=>{if(e){b.reload();return}e=!0,y.value={tone:`green`,text:`live`}},N.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}R(c,t)},N.onerror=()=>{N&&N.readyState===2?y.value={tone:`red`,text:`disconnected`}:y.value={tone:`amber`,text:`connecting…`}}}),m(()=>{N?.close()}),(i,o)=>{let s=T;return d(),S(e,{title:Z,nav:`residents`},{status:u(()=>[t(s,{text:`runs arrive from the registry feed; the listing is re-read when a run attaches or ends`},{default:u(()=>[f(`span`,G,[t(U,{tone:y.value.tone,label:y.value.text},null,8,[`tone`,`label`]),f(`span`,K,a(y.value.text),1)])]),_:1})]),default:u(()=>[D.value.length>0?(d(),n(_,{key:0},[f(`p`,q,[g(a(`${k.value}/${O.value} resident slots in use · `),1),f(`span`,J,a(j.value)+` running`,1)]),f(`ul`,Y,[(d(!0),n(_,null,r(D.value,e=>(d(),S(W,{key:e.key,record:e.record,runs:e.runs,now:h(l),open:h(E)!==null&&h(E)===e.slug},null,8,[`record`,`runs`,`now`,`open`]))),128))])],64)):(d(),n(`p`,X,[g(` No repos onboarded (0/`+a(O.value)+`). Onboard one from chat: `,1),o[0]||=f(`code`,{class:`rounded bg-elevated px-1.5 py-0.5`},`repo onboard <owner/name>`,-1),o[1]||=g(`. `,-1)]))]),_:1})}}});export{Q as default};
|
|
1
|
+
import{t as e}from"./AppShell-DPJVhUGP.js";import{An as t,Cn as n,Cr as r,Gr as i,Li as a,Mn as o,Pi as s,Sn as c,Tr as l,Xr as u,_r as d,bn as f,dr as p,hr as m,ji as h,kn as g,ln as _,o as v,rn as y,t as b,xi as x,xn as S,yi as C,yn as w}from"./browser-CCImen5O.js";import{t as T}from"./Tooltip-BvPkV4kZ.js";import{_ as E,a as D,c as O,d as k,f as A,g as j,h as M,i as N,l as P,m as F,n as I,p as L,r as R,s as ee,u as te,y as z}from"./main-ks3kBojV.js";import{t as B}from"./eventSource-Cv0AFlMi.js";import{t as V}from"./wallClock-x0hjr0J_.js";import{n as ne,r as re}from"./indexFormat-B-pd4r7Y.js";import{A as ie,C as H,D as ae,S as oe,a as se,c as ce,i as le,l as ue,t as de,x as fe}from"./indexRow-BsWcHHVh.js";import"./format-BldUwl_R.js";import{t as U}from"./StatusDot-DyFjGg4V.js";var pe=[`data-slug`,`data-running`],me=[`open`],he={class:`row flex cursor-pointer list-none flex-wrap items-baseline gap-x-2.5 gap-y-1 rounded-md px-2 py-2 hover:bg-elevated [&::-webkit-details-marker]:hidden`},ge={class:`self-center`},_e={class:`font-mono text-[0.9375rem] font-medium text-highlighted`},ve={class:`text-sm text-toned`},ye={key:0,class:`running shrink-0 rounded border border-ok/25 bg-ok/8 px-1.5 font-mono text-[0.68rem] font-medium tabular-nums text-ok`},be=[`title`],xe={key:2,class:`basis-full pl-[1.9rem] text-xs text-warn`},Se={class:`fold pb-3 pl-[1.9rem] pr-2 pt-0.5`},Ce={key:0,class:`m-0 list-none divide-y divide-(--ui-border-muted) p-0`},we=[`data-run-id`,`data-thread`],Te={class:`pt-[0.3rem]`},Ee={class:`what min-w-0`},De={class:`flex min-w-0 items-baseline gap-2`},Oe=[`title`],ke={key:0,class:`who block truncate text-xs text-dimmed`},Ae=[`href`],je={key:1,class:`who block text-xs text-dimmed`},Me={class:`min-w-0 font-mono text-xs max-sm:col-span-2 max-sm:col-start-2 max-sm:row-start-2`},Ne=[`title`],Pe=[`href`],Fe={key:1},Ie={key:1,class:`font-sans text-dimmed`},Le={key:0,class:`facts-tree block truncate text-dimmed`},Re={class:`user`},ze={class:`deps`},Be=[`title`],Ve={class:`flex items-baseline gap-3 justify-self-end max-sm:col-start-3 max-sm:row-start-1`},He=[`title`],Ue={key:1,class:`py-1 text-xs text-dimmed`},We=[`data-idle`],Ge={key:1},W=o({__name:`ResidentRow`,props:{record:{},runs:{},now:{},open:{type:Boolean}},setup(e){let o=e,p=x(o.open===!0);i(()=>o.open,e=>{e&&(p.value=!0)});function m(e){p.value=e.target.open}let v=w(()=>P(o.record)),b=w(()=>v.value||F(o.record.resource)||`?`),C=w(()=>O(o.record)),T=w(()=>te(C.value.state)),A=w(()=>I.test(v.value)?`/residents/${v.value}`:null),L=w(()=>I.test(v.value)?`https://github.com/${v.value}`:void 0),R=e=>L.value&&/^[0-9a-f]{7,40}$/.test(e)?`${L.value}/commit/${e}`:void 0,z=w(()=>F(o.record.defaultRef)||`?`),B=w(()=>F(C.value.sha).slice(0,8)),V=w(()=>F(C.value.lastRefreshAt)),W=e=>{let t=e?Date.parse(e):NaN;return Number.isFinite(t)?ne(t,o.now):e||`—`},G=w(()=>V.value?W(V.value):``),K=w(()=>ee(o.record)),q=w(()=>K.value?j(K.value):``),J=w(()=>{let e=K.value;if(!e)return null;let t=typeof o.record.diskBudgetMb==`number`?o.record.diskBudgetMb:void 0;return D(e,t)}),Y=w(()=>[`ref ${z.value}`,B.value,G.value?`refreshed ${G.value}`:``,q.value?`disk ${q.value}`:``].filter(Boolean).join(` · `)),X=w(()=>[V.value?`refreshed ${V.value}`:``,K.value?.at?`disk measured ${K.value.at}`:``].filter(Boolean).join(` · `)),Z=w(()=>{let e=K.value,t=J.value;if(!e||!t)return``;let n=t.room.hardlink===null?`room not projected (checkout not measured)`:`room for ${t.room.hardlink} more ${t.room.hardlink===1?`tree`:`trees`}`;return[`${E(t.freeKiB)} free${t.capped?` under the ${E(t.capacityKiB)} cap`:``}`,n,`measured ${W(e.at)}`].join(` · `)}),Q=w(()=>k(o.record)),$=w(()=>{let e=o.runs.map(e=>{let t=re(e.label||H(e.id)),n=N(Q.value,e.threadKey),r=ie(e);return{key:`run:${e.id}`,run:e,agent:t.agent,text:t.snippet??t.scope,who:r.identity,surface:le[r.kind]??r.kind,threadUrl:oe(e),href:fe(e),elapsed:ue(e,o.now),binding:n,treeKiB:n?M(K.value,n.threadKey):null}}),t=new Set(o.runs.map(e=>e.threadKey));for(let n of Q.value)n.evicted||t.has(n.threadKey)||e.push({key:`idle:${n.threadKey}`,text:`idle`,who:``,surface:``,threadUrl:``,href:``,elapsed:``,binding:n,treeKiB:M(K.value,n.threadKey)});return e}),Ke=w(()=>$.value.filter(e=>!e.run).length);return(i,o)=>{let x=l(`RouterLink`);return d(),n(`li`,{class:`resident border-b border-muted first:border-t`,"data-slug":v.value,"data-running":e.runs.length},[f(`details`,{class:`group/fold`,open:p.value,onToggle:m},[f(`summary`,he,[o[2]||=f(`span`,{class:`chev w-3 select-none self-center text-xs text-dimmed transition-transform group-open/fold:rotate-90 motion-reduce:transition-none`,"aria-hidden":`true`},`❯`,-1),f(`span`,ge,[t(U,{tone:T.value,label:C.value.state,tip:C.value.state},null,8,[`tone`,`label`,`tip`])]),f(`span`,_e,a(b.value),1),f(`span`,ve,a(C.value.state),1),e.runs.length>0?(d(),n(`span`,ye,a(e.runs.length)+` running`,1)):c(``,!0),f(`span`,{class:`facts font-mono text-xs text-muted max-sm:basis-full max-sm:pl-[1.9rem] sm:ml-2`,title:X.value||void 0},a(Y.value),9,be),A.value?(d(),S(x,{key:1,class:`detail ml-auto shrink-0 text-xs text-muted no-underline hover:text-highlighted hover:underline`,to:A.value,onClick:o[0]||=y(()=>{},[`stop`])},{default:u(()=>[...o[1]||=[g(`detail ↗`,-1)]]),_:1},8,[`to`])):c(``,!0),C.value.reason?(d(),n(`span`,xe,a(C.value.reason),1)):c(``,!0)]),f(`div`,Se,[$.value.length>0?(d(),n(`ul`,Ce,[(d(!0),n(_,null,r($.value,t=>(d(),n(`li`,{key:t.key,class:s([`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-3 gap-y-1 py-2 sm:grid-cols-[auto_minmax(0,1fr)_minmax(14rem,22rem)_auto]`,t.run?`run`:`idle`]),"data-run-id":t.run?.id,"data-thread":t.run?void 0:t.binding?.threadKey},[f(`span`,Te,[t.run?(d(),S(U,{key:0,tone:`green`,label:h(ae)(t.run),tip:h(ce)(t.run),pulse:``},null,8,[`label`,`tip`])):(d(),S(U,{key:1,tone:`grey`,label:`idle`,tip:`no run is using this tree`}))]),f(`span`,Ee,[f(`span`,De,[t.agent?(d(),n(`span`,{key:0,class:s([`agent shrink-0 rounded border px-1.5 font-mono text-[0.65rem] font-medium uppercase tracking-wider`,h(de)[h(se)(t.agent)]])},a(t.agent),3)):c(``,!0),f(`span`,{class:s([`text min-w-0 truncate text-[0.8125rem]`,t.run?`text-highlighted`:`text-dimmed`]),title:t.run?t.text:void 0},a(t.text),11,Oe)]),t.run?(d(),n(`span`,ke,[t.who?(d(),n(_,{key:0},[g(`by `+a(t.who),1)],64)):c(``,!0),t.who&&(t.threadUrl||t.surface)?(d(),n(_,{key:1},[g(a(` · `))],64)):c(``,!0),t.threadUrl?(d(),n(`a`,{key:2,class:`text-muted no-underline hover:text-highlighted hover:underline`,href:t.threadUrl,target:`_blank`,rel:`noopener noreferrer`},a(t.surface)+` thread ↗`,9,Ae)):t.surface?(d(),n(_,{key:3},[g(`via `+a(t.surface),1)],64)):c(``,!0)])):t.binding?(d(),n(`span`,je,`last used `+a(W(t.binding.lastAttachAt)),1)):c(``,!0)]),f(`span`,Me,[f(`span`,{class:`tree block truncate text-toned`,title:t.binding&&t.binding.ref||void 0},[t.binding?(d(),n(_,{key:0},[g(a(t.binding.ref||`?`),1),t.binding.sha?(d(),n(_,{key:0},[o[3]||=g(a(` `),-1),o[4]||=f(`span`,{class:`text-dimmed`},`@`,-1),o[5]||=g(a(` `)+` `,-1),R(t.binding.sha)?(d(),n(`a`,{key:0,class:`text-highlighted no-underline hover:underline`,href:R(t.binding.sha)},a(t.binding.sha.slice(0,8)),9,Pe)):(d(),n(`span`,Fe,a(t.binding.sha.slice(0,8)),1))],64)):c(``,!0)],64)):(d(),n(`span`,Ie,`no worktree bound yet`))],8,Ne),t.binding?(d(),n(`span`,Le,[f(`span`,Re,a(t.binding.user||`—`),1),o[6]||=g(` `+a(` · `),-1),f(`span`,ze,a(t.binding.deps||`—`),1),o[7]||=g(` `+a(` · `),-1),f(`span`,{class:s([`size`,t.treeKiB===null?``:`text-muted`]),title:t.treeKiB===null?`size not measured yet`:`on disk`},a(t.treeKiB===null?`—`:h(E)(t.treeKiB)),11,Be)])):c(``,!0)]),f(`span`,Ve,[t.run?(d(),n(`span`,{key:0,class:`elapsed whitespace-nowrap font-mono text-xs tabular-nums text-ok`,title:`running for · started ${h(ne)(t.run.startedAt,e.now)}`},a(t.elapsed),9,He)):c(``,!0),t.run?(d(),S(x,{key:1,class:`open text-xs text-muted no-underline hover:text-highlighted hover:underline`,to:t.href,"aria-label":`open run ${t.run.label||h(H)(t.run.id)}`},{default:u(()=>[...o[8]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])):c(``,!0)])],10,we))),128))])):(d(),n(`p`,Ue,`nothing on this resident — no run, no worktree`)),f(`p`,{class:`disk mt-2 font-mono text-xs text-dimmed`,"data-idle":Ke.value},[Z.value?(d(),n(_,{key:0},[g(a(Z.value),1)],64)):(d(),n(`span`,Ge,`disk not measured yet`))],8,We)])],40,me)],8,pe)}}}),G={class:`conn flex items-center gap-1.5`},K={id:`state`,class:`text-xs text-muted`},q={class:`mb-2 text-xs text-muted`},J={id:`running`,class:`font-mono tabular-nums`},Y={id:`residents`,class:`m-0 list-none p-0`},X={key:1,class:`px-2 py-1.5 text-muted`},Z=`Resident repos`,Q=o({__name:`ResidentsIndexPage`,setup(o){let s=v(`residents`),c=C({cap:s?.cap,count:s?.count,residents:s?.residents??[],runs:new Map((s?.runs??[]).map(e=>[e.id,e]))}),l=V(s?.now),y=x({tone:`amber`,text:`connecting…`}),E=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,D=w(()=>c.residents.map((e,t)=>{let n=e,r=P(n);return{key:`${r||`?`}-${t}`,record:n,slug:r,runs:L(c.runs.values(),r)}})),O=w(()=>F(c.cap)||`?`),k=w(()=>F(c.count)||String(D.value.length)),j=w(()=>D.value.reduce((e,t)=>e+t.runs.length,0));i([j,()=>c.residents],([e,t])=>{b.setTitle((e>0?`(${e}) `:``)+Z),b.setFavicon(z[A(t)])},{immediate:!0});let M=B(),N=null;return p(()=>{N=M(`/residents?stream=1`);let e=!1;N.onopen=()=>{if(e){b.reload();return}e=!0,y.value={tone:`green`,text:`live`}},N.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}R(c,t)},N.onerror=()=>{N&&N.readyState===2?y.value={tone:`red`,text:`disconnected`}:y.value={tone:`amber`,text:`connecting…`}}}),m(()=>{N?.close()}),(i,o)=>{let s=T;return d(),S(e,{title:Z,nav:`residents`},{status:u(()=>[t(s,{text:`runs arrive from the registry feed; the listing is re-read when a run attaches or ends`},{default:u(()=>[f(`span`,G,[t(U,{tone:y.value.tone,label:y.value.text},null,8,[`tone`,`label`]),f(`span`,K,a(y.value.text),1)])]),_:1})]),default:u(()=>[D.value.length>0?(d(),n(_,{key:0},[f(`p`,q,[g(a(`${k.value}/${O.value} resident slots in use · `),1),f(`span`,J,a(j.value)+` running`,1)]),f(`ul`,Y,[(d(!0),n(_,null,r(D.value,e=>(d(),S(W,{key:e.key,record:e.record,runs:e.runs,now:h(l),open:h(E)!==null&&h(E)===e.slug},null,8,[`record`,`runs`,`now`,`open`]))),128))])],64)):(d(),n(`p`,X,[g(` No repos onboarded (0/`+a(O.value)+`). Onboard one from chat: `,1),o[0]||=f(`code`,{class:`rounded bg-elevated px-1.5 py-0.5`},`repo onboard <owner/name>`,-1),o[1]||=g(`. `,-1)]))]),_:1})}}});export{Q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{An as e,Cn as t,Cr as n,Gr as r,Ii as i,Li as a,Mn as o,Pi as s,Sn as c,Tr as l,Xr as u,_r as d,bn as f,dr as p,ir as m,ji as h,kn as g,ln as _,rn as v,t as y,xi as b,xn as x,yn as S}from"./browser-CCImen5O.js";import{r as C,t as w}from"./indexFormat-B-pd4r7Y.js";import{B as T,C as E,D,E as O,G as k,I as A,K as j,L as M,M as N,R as ee,T as te,U as ne,a as P,c as F,l as I,o as L,t as R,x as re,z as ie}from"./indexRow-BsWcHHVh.js";import"./format-BldUwl_R.js";import{n as ae}from"./SlackMark-DB0MGiF5.js";import{c as oe,l as se,n as ce,t as le,w as z}from"./sseReplay-DGRDRLua.js";import{n as ue,t as de}from"./durationTone-CVpX_yIk.js";import{t as B}from"./StatusDot-IkfsHGXg.js";var fe={merged:`merged`,closed:`closed`,already_landed:`merged`,merge_ready:`merge-ready`,held:`held`,merge_refused:`not merged`,round_cap:`round cap reached`,wall_clock_cap:`out of budget`,review_pending:`review pending`,stopped:`stopped`,aborted:`aborted`,transient:`aborted`,continued:`continuing`,no_verdict:`no verdict`,interrupted:`interrupted`,refused:`refused`,idle:`idle`,idle_expired:`idle expired`,blocked:`blocked`,failed:`failed`};function pe(e){return fe[e]??e}var me={},he={viewBox:`0 0 16 16`,class:`inline-block size-[1em] shrink-0`,"aria-hidden":`true`};function ge(e,n){return d(),t(`svg`,he,[...n[0]||=[f(`path`,{fill:`currentColor`,d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z`},null,-1)]])}var _e=ae(me,[[`render`,ge]]),V={"getting ready":`paint-ready`,thinking:`paint-thinking`,"in tools":`paint-tools`,"finishing up":`paint-finishing`,"Switchboard overhead":`paint-overhead`,"not recorded":`paint-lost`,"not loaded":`paint-elided`},ve={getting_ready:`getting ready`,finishing_up:`finishing up`};function ye(e){return V[ve[e]]}var be={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},xe={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Se={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},Ce=[`href`],we={class:`lede font-mono text-sm text-toned`},Te={class:`shape tabular-nums`},Ee={key:0,class:`current text-muted`},De={key:0,class:`note mt-0.5 text-xs text-muted`},Oe=[`aria-label`],ke=[`title`,`data-term`],Ae={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs`},je=[`title`,`data-term`],Me={class:`term text-muted`},Ne={class:`ms tabular-nums text-toned`},Pe=[`title`],Fe={class:`ranked mt-1 flex flex-col gap-1 font-mono text-xs`},Ie={class:`ms w-14 shrink-0 tabular-nums text-toned`},Le=[`href`,`data-anchor`,`onClick`],Re=[`title`],ze={class:`cut mt-1 flex flex-col gap-1 font-mono text-xs`},Be={class:`ms w-14 shrink-0 tabular-nums text-toned`},Ve=[`href`,`data-anchor`,`onClick`],H=o({__name:`TimelineSection`,props:{vm:{},eventsHref:{}},emits:[`reveal`],setup(e,{emit:r}){let o=e,l=r;function u(e){return`${j(e.ms,`clock`)} ${e.term}${e.hatched?` (in flight)`:``}`}function p(){y.copyText(JSON.stringify(o.vm.debug,null,2))}return(r,o)=>(d(),t(`section`,be,[f(`h2`,xe,[o[0]||=f(`span`,null,`Where the time went`,-1),f(`span`,Se,[e.eventsHref?(d(),t(`a`,{key:0,class:`text-dimmed no-underline hover:text-primary hover:underline`,href:e.eventsHref,title:`the stored events, as JSON lines`},`raw events`,8,Ce)):c(``,!0),f(`button`,{type:`button`,class:`debug cursor-pointer text-dimmed hover:text-toned`,title:`the partition and the raw span names, for a bug report`,onClick:p},` Copy debug JSON `)])]),f(`p`,we,[f(`span`,Te,a(e.vm.shown?e.vm.total:e.vm.lede),1),e.vm.current?(d(),t(`span`,Ee,` · `+a(e.vm.current),1)):c(``,!0)]),(d(!0),t(_,null,n(e.vm.captions,e=>(d(),t(`p`,{key:e,class:`caption mt-0.5 text-xs text-muted`},a(e),1))),128)),e.vm.note?(d(),t(`p`,De,a(e.vm.note),1)):c(``,!0),e.vm.shown?(d(),t(_,{key:1},[f(`div`,{class:`bar mt-2.5 flex h-2 w-full overflow-hidden rounded-sm`,role:`img`,"aria-label":e.vm.lede},[(d(!0),t(_,null,n(e.vm.bar,(e,n)=>(d(),t(`div`,{key:n,class:s([`seg h-full`,[h(V)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:i({width:`${e.pct}%`}),title:u(e),"data-term":e.term},null,14,ke))),128))],8,Oe),f(`ul`,Ae,[(d(!0),t(_,null,n(e.vm.legend,e=>(d(),t(`li`,{key:e.term,class:`flex items-baseline gap-1.5 cursor-help`,title:e.definition,"data-term":e.term},[f(`span`,{class:s([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,h(V)[e.term]])},null,2),f(`span`,Me,a(e.term),1),f(`span`,Ne,a(e.text),1)],8,je))),128))]),e.vm.ranked.length>0?(d(),t(_,{key:0},[f(`h3`,{class:`ranked-head mt-3 inline-block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.rankedNote},` Longest steps `,8,Pe),f(`ol`,Fe,[(d(!0),t(_,null,n(e.vm.ranked,(e,r)=>(d(),t(`li`,{key:r,class:`flex items-baseline gap-2`},[f(`span`,Ie,a(h(j)(e.ms,`clock`)),1),f(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:v(t=>l(`reveal`,e.anchor),[`prevent`])},a(e.label),9,Le),(d(!0),t(_,null,n(e.facts,e=>(d(),t(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},a(e),1))),128))]))),128))])],64)):c(``,!0),e.vm.cut.length>0?(d(),t(_,{key:1},[f(`h3`,{class:`cut-head mt-3 block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.cutNote},` Cut steps `,8,Re),f(`ol`,ze,[(d(!0),t(_,null,n(e.vm.cut,(e,r)=>(d(),t(`li`,{key:r,class:`flex items-baseline gap-2`},[f(`span`,Be,a(h(j)(e.ms,`clock`)),1),f(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:v(t=>l(`reveal`,e.anchor),[`prevent`])},a(e.label),9,Ve),(d(!0),t(_,null,n(e.facts,e=>(d(),t(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},a(e),1))),128))]))),128))])],64)):c(``,!0)],64)):c(``,!0)]))}}),U={"getting ready":`before the agent's first turn: reading the thread, finding the repo, checking out, loading tools`,thinking:`the model's turns — from a request to the model until its reply came back`,"in tools":`the commands and tool calls the model ran`,"finishing up":`after the agent's last turn: posting the PR, checking the workspace`,"Switchboard overhead":`orchestration between steps, and moments when only a background read was running — the time no step claims`,"not recorded":`a stretch of the run the record does not carry`,"not loaded":`a stretch of the run this page did not load — the record has the full shape`},W=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,G=`Steps still open when the run ended: closed at the run's terminal event and left out of the ranking — the time shown is the cut, not a measurement.`;function He(e){let t=e===`interrupted`?`the interruption`:e===`failed`?`the failure`:e===`stopped_hard`?`the hard stop`:e===`stopped_soft`?`the stop`:void 0;return t?`cut by ${t}`:`cut at the run's end`}var Ue=`currently delivering`,We=`getting ready: not recorded (too large)`,Ge=`no timing data`,Ke=`not loaded (the record has the full shape)`,K={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function q(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=ee(t,{window:n,owner:r,finished:i,losses:e.losses}),o=ie(a),s=j(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?Je(t,r,n):void 0,u=Ye(e,l),d=l?z(l.name):``,f={window:n,owner:r,phase:e.phase,partition:a,spans:t.map(e=>({spanId:e.spanId,parentSpanId:e.parentSpanId,name:e.name,startedAt:e.startedAt,endedAt:e.endedAt,status:e.status,attrs:e.attrs}))};if(e.untimed)return{total:s,current:u,openStep:d,captions:[],rankedNote:W,cut:[],cutNote:G,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:Ge};let p=qe(c,`restartOfRunId`),m={total:s,current:u,openStep:d,captions:[p===void 0?void 0:`restarted from run ${p}`,A(`before`,J(c,`queuedBeforeMs`)),p===void 0?A(`behind`,J(c,`queuedBehindMs`)):void 0].filter(e=>e!==void 0),rankedNote:W,cutNote:G,debug:f};if(!c)return{...m,lede:s,shown:!1,bar:[],legend:[],ranked:[],cut:[],note:i?We:``};let h=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?Ke:t,g=M(a)&&o.items.length>0,_=g?`${s} — ${o.items.map(({term:e,s:t})=>`${j(t*1e3,`clock`)} ${h(e)}`).join(` · `)}`:a.windowMs>0?`${s} — ${h(Xe(a))}`:s,v=g?o.items.map(({term:t,s:n})=>({term:t,text:j(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${U[t]} (too large)`:U[t]})):[],y=g?Qe(t,c,r,n,e.callTitle,e.phase===`ended`,He(e.endedBy)):{ranked:[],cut:[]};return{...m,lede:_,shown:g,bar:g?Ze(a,l):[],legend:v,ranked:y.ranked,cut:y.cut,note:``}}function J(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function qe(e,t){let n=e?.attrs[t];return typeof n==`string`&&n!==``?n:void 0}function Je(e,t,n){let r=new Map(e.map(e=>[e.spanId,e])),i=e=>{let t=1,n=new Set([e.spanId]),i=e.parentSpanId?r.get(e.parentSpanId):void 0;for(;i&&!n.has(i.spanId);)n.add(i.spanId),t++,i=i.parentSpanId?r.get(i.parentSpanId):void 0;return t},a;for(let o of e){if(o.endedAt!==void 0||o.startedAt>=n.end)continue;let e=T(o.name,t);if(e?.kind!==`counted`||Y(o,r,t))continue;let s=i(o);(!a||s>a.depth||s===a.depth&&o.startedAt>a.span.startedAt)&&(a={span:o,depth:s,bucket:e.bucket})}if(a)return{bucket:a.bucket,name:a.span.name,elapsedMs:Math.max(0,n.end-Math.max(n.start,a.span.startedAt))}}function Y(e,t,n){let r=e,i=new Set;for(;r&&!i.has(r.spanId);){if(i.add(r.spanId),T(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function Ye(e,t){return e.phase===`delivering`?Ue:e.phase===`ended`?se(e.delivery??{}):t?`currently ${K[t.bucket]} ${j(t.elapsedMs,`clock`)}`:``}function X(e){return[[`getting ready`,e.gettingReadyMs],[`thinking`,e.thinkingMs],[`in tools`,e.toolsMs],[`finishing up`,e.finishingUpMs],[`Switchboard overhead`,e.overheadMs],[`not recorded`,e.notRecordedMs],[`not loaded`,e.notLoadedMs]]}function Xe(e){let t=[`getting ready`,-1];for(let n of X(e))n[1]>t[1]&&(t=n);return t[0]}function Ze(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of X(e))if(!(a<=0)){if(t&&K[t.bucket]===i){let e=Math.min(t.elapsedMs,a);a-e>0&&n.push({term:i,ms:a-e,pct:r(a-e),hatched:!1}),e>0&&n.push({term:i,ms:e,pct:r(e),hatched:!0});continue}n.push({term:i,ms:a,pct:r(a),hatched:!1})}return n}function Qe(e,t,n,r,i,a,o){let s=new Map(e.map(e=>[e.spanId,e])),c=new Map;for(let t of e){if(t.parentSpanId===void 0)continue;let e=c.get(t.parentSpanId);e?e.push(t):c.set(t.parentSpanId,[t])}let l=e=>[Math.max(r.start,e.startedAt),Math.min(r.end,e.endedAt??r.end)],u=[],d=[];for(let r of e){if(r===t||r.name===`run.agent`||T(r.name,n)===void 0||Y(r,s,n))continue;let[e,f]=l(r);if(f<=e)continue;let p=(c.get(r.spanId)??[]).map(l).map(([t,n])=>[Math.max(e,t),Math.min(f,n)]).filter(([e,t])=>t>e),m=f-e-$e(p);if(m<=0)continue;let h=r.name.startsWith(`tool.`)&&typeof r.attrs.callId==`string`?r.attrs.callId:void 0,g=h?i?.(h):void 0,_=a&&r.endedAt===void 0;(_?d:u).push({label:g??z(r.name),ms:m,facts:_?[o,...Z(r)]:Z(r),anchor:h?`call-${h}`:`span-${r.spanId}`,startedAt:r.startedAt})}let f=(e,t)=>t.ms-e.ms||e.startedAt-t.startedAt;u.sort(f),d.sort(f);let p=({label:e,ms:t,facts:n,anchor:r})=>({label:e,ms:t,facts:n,anchor:r});return{ranked:u.slice(0,3).map(p),cut:d.map(p)}}function $e(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=0,r;for(let[e,i]of t)!r||e>r[1]?(r&&(n+=r[1]-r[0]),r=[e,i]):i>r[1]&&(r[1]=i);return r&&(n+=r[1]-r[0]),n}function Z(e){let t=e.attrs,n=[];return(t.token===`expired`||t.token===`expiring`)&&n.push(`token ${t.token}`),t.budget===`clipped`&&n.push(`budget clipped`),typeof t.timeoutMs==`number`&&n.push(`timeout ${j(t.timeoutMs,`clock`)}`),typeof t.waitedMs==`number`&&n.push(`waited ${j(t.waitedMs,`clock`)}`),typeof t.exitCode==`number`&&t.exitCode!==0&&n.push(`exit ${t.exitCode}`),t.timedOut===!0&&n.push(`timed out`),typeof t.attempts==`number`&&t.attempts>1&&n.push(`${t.attempts} attempts`),e.status===`error`&&n.length===0&&n.push(`failed`),n}function Q(e){return e===`command`?`command`:`agent`}var et=[`data-state`],tt={key:0,class:`loading py-2 font-mono text-xs text-dimmed`},nt={key:1,class:`failed py-2 font-mono text-xs text-warn`},rt=[`data-turn`,`data-anchor`],it={class:`landing-head flex flex-wrap items-baseline gap-x-2 font-mono text-xs text-muted`},at={class:`turn tabular-nums`},ot={class:`what min-w-0 truncate text-toned`},st={key:0,class:`m-0 mt-1 list-none p-0`},ct=o({__name:`RunTimeline`,props:{run:{},land:{},fetch:{}},setup(n){let i=n,o=b(`loading`),s=oe(),v=S(()=>{if(o.value!==`ready`)return null;s.state.traceVersion;let e=i.run,t=e.receivedAt??e.startedAt,n=k(e)??(e.finishedAt===void 0?0:Math.max(0,e.finishedAt-t));return q({spans:s.spanSet(),losses:s.losses(t),window:{start:t,end:t+n},owner:Q(e.agent),totalMs:n,phase:`ended`,delivery:{finishedAt:e.finishedAt,sealedAt:e.sealedAt,replyOk:e.replyOk},...e.truncated===void 0?{}:{truncated:e.truncated},...(e.schema??0)>=2?{}:{untimed:!0},callTitle:s.callHeadline})}),x=S(()=>`/runs/${encodeURIComponent(i.run.id)}/events`),C=e=>`/runs/${encodeURIComponent(i.run.id)}#${e}`;function w(e){y.navigate(C(e))}let T=S(()=>{if(o.value!==`ready`||i.land===void 0)return null;s.state.traceVersion;let e=i.land,t=i.run.session;if(t&&e===t.request)return{anchor:`request`,what:`the request`};let n=t&&t.range!==`broken`?t.range.to:void 0;if(n!==void 0&&e===n&&s.state.reply)return{anchor:`reply`,what:`the reply`};let r=s.landing(e);return r?{anchor:r.anchor,what:E(r.step),step:r.step}:null});function E(e){let t=e.items.find(e=>e.kind===`call`),n=t?.kind===`call`?t.call.headline:void 0;return[e.turn?`thought ${e.turn.chip}`:void 0,n].filter(e=>e!==void 0).join(` · `)||`step ${e.index+1}`}let D=b(null),O=S(()=>T.value?`${i.land}@${T.value.anchor}`:null);return r(O,e=>{e!==null&&m().then(()=>{let e=(T.value?.step?D.value?.querySelector(`li.step`):null)??D.value;e&&(e.scrollIntoView?.({block:`center`}),e.classList.add(`revealed`),setTimeout(()=>e.classList.remove(`revealed`),1500))})}),p(async()=>{let e=i.fetch??((...e)=>globalThis.fetch(...e));try{let t=await e(x.value,{credentials:`same-origin`});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=le(await t.text()).filter(e=>e.type!==`replay_note`);for(let e of(i.run.schema??0)>=2?ne(n):n)s.handle(e);s.closePhases(),o.value=`ready`}catch{o.value=`failed`}}),(r,i)=>{let p=l(`RouterLink`);return d(),t(`div`,{class:`runtimeline pl-5`,"data-state":o.value},[o.value===`loading`?(d(),t(`p`,tt,`reading the run's record…`)):o.value===`failed`?(d(),t(`p`,nt,[i[2]||=g(` the run's record could not be read — `,-1),e(p,{class:`text-primary no-underline hover:underline`,to:`/runs/${encodeURIComponent(n.run.id)}`},{default:u(()=>[...i[1]||=[g(`open the run`,-1)]]),_:1},8,[`to`])])):v.value?(d(),t(_,{key:2},[e(H,{vm:v.value,"events-href":x.value,onReveal:w},null,8,[`vm`,`events-href`]),T.value?(d(),t(`div`,{key:0,ref_key:`landingEl`,ref:D,class:`landing mb-4 rounded-lg border border-default px-(--sb-gutter) py-2`,"data-turn":n.land,"data-anchor":T.value.anchor},[f(`p`,it,[f(`span`,at,`turn `+a(n.land),1),f(`span`,ot,`· `+a(T.value.what),1),e(p,{class:`page ml-auto shrink-0 text-primary no-underline hover:underline`,to:C(T.value.anchor),title:`the same step on the run's own page`},{default:u(()=>[...i[3]||=[g(`open on the run's page ↗`,-1)]]),_:1},8,[`to`])]),T.value.step?(d(),t(`ol`,st,[e(ce,{step:T.value.step,onToggleGroup:i[0]||=e=>h(s).toggleGroup(T.value.step)},null,8,[`step`])])):c(``,!0)],8,rt)):c(``,!0)],64)):c(``,!0)],8,et)}}}),lt=[`id`,`data-run-id`,`data-round`,`data-thread`],ut=[`open`],dt={class:`row flex min-w-0 cursor-pointer list-none flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted) [&::-webkit-details-marker]:hidden`},ft={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},$={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},pt={key:3,class:`scope min-w-0 flex-1 truncate text-toned`},mt=[`title`],ht=[`data-heat`],gt={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},_t={key:1,class:`row flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted)`},vt={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},yt={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},bt={key:3,class:`scope min-w-0 flex-1 truncate text-highlighted`},xt=[`title`],St={class:`elapsed shrink-0 text-right font-mono text-xs tabular-nums text-ok sm:min-w-[4.5em]`,title:`running for`},Ct={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},wt=o({__name:`RunFoldRow`,props:{run:{},now:{},label:{},open:{type:Boolean},land:{}},setup(n){let o=n,p=b(o.open===!0);r(()=>o.open,e=>{e&&(p.value=!0)});let m=S(()=>C(o.run.label||E(o.run.id))),_=S(()=>te(o.run)),y=S(()=>re(o.run)),T=S(()=>o.run.finished),k=S(()=>o.run.finished&&o.run.status&&o.run.status!==`completed`?O(o.run.status):``),A=S(()=>de(o.run.finished&&typeof o.run.finishedAt==`number`?o.run.finishedAt-o.run.startedAt:void 0,`run`)),j=S(()=>ue(A.value));function M(e){p.value=e.target.open}return(r,o)=>{let b=l(`RouterLink`);return d(),t(`li`,{id:`run-${n.run.id}`,class:s([`fold group border-b border-muted`,n.run.finished?`finished`:`live`]),"data-run-id":n.run.id,"data-round":n.run.round,"data-thread":n.run.thread},[T.value?(d(),t(`details`,{key:0,class:`group/fold`,open:p.value,onToggle:M},[f(`summary`,dt,[o[2]||=f(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open/fold:rotate-90 motion-reduce:transition-none`,"aria-hidden":`true`},`❯`,-1),e(B,{tone:_.value,label:h(D)(n.run),tip:h(F)(n.run)},null,8,[`tone`,`label`,`tip`]),n.label?(d(),t(`span`,ft,a(n.label),1)):c(``,!0),m.value.agent?(d(),t(`span`,{key:1,class:s([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider opacity-55`,h(R)[h(P)(m.value.agent)]])},a(m.value.agent),3)):c(``,!0),m.value.snippet===void 0?(d(),t(`span`,pt,a(m.value.scope),1)):(d(),t(`span`,$,a(m.value.snippet),1)),k.value?(d(),t(`span`,{key:4,class:s([`outcome shrink-0 rounded border px-1.5 font-mono text-[0.7rem]`,_.value===`red`?`border-bad/30 text-bad`:`border-warn/30 text-warn`])},a(k.value),3)):c(``,!0),f(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-dimmed`,title:h(N)(n.run)},a(h(w)(n.run.startedAt,n.now)),9,mt),f(`span`,{class:s([`elapsed shrink-0 text-right font-mono text-xs tabular-nums sm:min-w-[4.5em]`,[j.value?`heat`:`text-muted`,A.value.level>=2?`font-medium`:``]]),style:i(j.value),"data-heat":A.value.level,title:`start to finish`},a(h(I)(n.run,n.now)),15,ht),f(`span`,gt,a(h(L)(n.run)),1),e(b,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,to:y.value,"aria-label":`open run ${n.run.label||h(E)(n.run.id)}`,onClick:o[0]||=v(()=>{},[`stop`])},{default:u(()=>[...o[1]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]),p.value?(d(),x(ct,{key:0,run:n.run,land:n.land},null,8,[`run`,`land`])):c(``,!0)],40,ut)):(d(),t(`div`,_t,[o[4]||=f(`span`,{class:`chev select-none text-xs text-transparent`,"aria-hidden":`true`},`❯`,-1),e(B,{tone:_.value,label:h(D)(n.run),tip:h(F)(n.run),pulse:``},null,8,[`tone`,`label`,`tip`]),n.label?(d(),t(`span`,vt,a(n.label),1)):c(``,!0),m.value.agent?(d(),t(`span`,{key:1,class:s([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider`,h(R)[h(P)(m.value.agent)]])},a(m.value.agent),3)):c(``,!0),m.value.snippet===void 0?(d(),t(`span`,bt,a(m.value.scope),1)):(d(),t(`span`,yt,a(m.value.snippet),1)),f(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-muted`,title:h(N)(n.run)},a(h(w)(n.run.startedAt,n.now)),9,xt),f(`span`,St,a(h(I)(n.run,n.now)),1),f(`span`,Ct,a(h(L)(n.run)),1),e(b,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,to:y.value,"aria-label":`open run ${n.run.label||h(E)(n.run.id)}`},{default:u(()=>[...o[3]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]))],10,lt)}}});export{ye as a,H as i,Q as n,_e as o,q as r,pe as s,wt as t};
|
|
1
|
+
import{An as e,Cn as t,Cr as n,Gr as r,Ii as i,Li as a,Mn as o,Pi as s,Sn as c,Tr as l,Xr as u,_r as d,bn as f,dr as p,ir as m,ji as h,kn as g,ln as _,rn as v,t as y,xi as b,xn as x,yn as S}from"./browser-CCImen5O.js";import{r as C,t as w}from"./indexFormat-B-pd4r7Y.js";import{B as T,C as E,D,E as O,G as k,I as A,K as j,L as M,M as N,R as ee,T as te,U as ne,a as P,c as F,l as I,o as L,t as R,x as re,z as ie}from"./indexRow-BsWcHHVh.js";import"./format-BldUwl_R.js";import{n as ae}from"./SlackMark-DB0MGiF5.js";import{c as oe,l as se,n as ce,t as le,w as z}from"./sseReplay-DuALaBPq.js";import{n as ue,t as de}from"./durationTone-CVpX_yIk.js";import{t as B}from"./StatusDot-DyFjGg4V.js";var fe={merged:`merged`,closed:`closed`,already_landed:`merged`,merge_ready:`merge-ready`,held:`held`,merge_refused:`not merged`,round_cap:`round cap reached`,wall_clock_cap:`out of budget`,review_pending:`review pending`,stopped:`stopped`,aborted:`aborted`,transient:`aborted`,continued:`continuing`,no_verdict:`no verdict`,interrupted:`interrupted`,refused:`refused`,idle:`idle`,idle_expired:`idle expired`,blocked:`blocked`,failed:`failed`};function pe(e){return fe[e]??e}var me={},he={viewBox:`0 0 16 16`,class:`inline-block size-[1em] shrink-0`,"aria-hidden":`true`};function ge(e,n){return d(),t(`svg`,he,[...n[0]||=[f(`path`,{fill:`currentColor`,d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z`},null,-1)]])}var _e=ae(me,[[`render`,ge]]),V={"getting ready":`paint-ready`,thinking:`paint-thinking`,"in tools":`paint-tools`,"finishing up":`paint-finishing`,"Switchboard overhead":`paint-overhead`,"not recorded":`paint-lost`,"not loaded":`paint-elided`},ve={getting_ready:`getting ready`,finishing_up:`finishing up`};function ye(e){return V[ve[e]]}var be={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},xe={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Se={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},Ce=[`href`],we={class:`lede font-mono text-sm text-toned`},Te={class:`shape tabular-nums`},Ee={key:0,class:`current text-muted`},De={key:0,class:`note mt-0.5 text-xs text-muted`},Oe=[`aria-label`],ke=[`title`,`data-term`],Ae={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs`},je=[`title`,`data-term`],Me={class:`term text-muted`},Ne={class:`ms tabular-nums text-toned`},Pe=[`title`],Fe={class:`ranked mt-1 flex flex-col gap-1 font-mono text-xs`},Ie={class:`ms w-14 shrink-0 tabular-nums text-toned`},Le=[`href`,`data-anchor`,`onClick`],Re=[`title`],ze={class:`cut mt-1 flex flex-col gap-1 font-mono text-xs`},Be={class:`ms w-14 shrink-0 tabular-nums text-toned`},Ve=[`href`,`data-anchor`,`onClick`],H=o({__name:`TimelineSection`,props:{vm:{},eventsHref:{}},emits:[`reveal`],setup(e,{emit:r}){let o=e,l=r;function u(e){return`${j(e.ms,`clock`)} ${e.term}${e.hatched?` (in flight)`:``}`}function p(){y.copyText(JSON.stringify(o.vm.debug,null,2))}return(r,o)=>(d(),t(`section`,be,[f(`h2`,xe,[o[0]||=f(`span`,null,`Where the time went`,-1),f(`span`,Se,[e.eventsHref?(d(),t(`a`,{key:0,class:`text-dimmed no-underline hover:text-primary hover:underline`,href:e.eventsHref,title:`the stored events, as JSON lines`},`raw events`,8,Ce)):c(``,!0),f(`button`,{type:`button`,class:`debug cursor-pointer text-dimmed hover:text-toned`,title:`the partition and the raw span names, for a bug report`,onClick:p},` Copy debug JSON `)])]),f(`p`,we,[f(`span`,Te,a(e.vm.shown?e.vm.total:e.vm.lede),1),e.vm.current?(d(),t(`span`,Ee,` · `+a(e.vm.current),1)):c(``,!0)]),(d(!0),t(_,null,n(e.vm.captions,e=>(d(),t(`p`,{key:e,class:`caption mt-0.5 text-xs text-muted`},a(e),1))),128)),e.vm.note?(d(),t(`p`,De,a(e.vm.note),1)):c(``,!0),e.vm.shown?(d(),t(_,{key:1},[f(`div`,{class:`bar mt-2.5 flex h-2 w-full overflow-hidden rounded-sm`,role:`img`,"aria-label":e.vm.lede},[(d(!0),t(_,null,n(e.vm.bar,(e,n)=>(d(),t(`div`,{key:n,class:s([`seg h-full`,[h(V)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:i({width:`${e.pct}%`}),title:u(e),"data-term":e.term},null,14,ke))),128))],8,Oe),f(`ul`,Ae,[(d(!0),t(_,null,n(e.vm.legend,e=>(d(),t(`li`,{key:e.term,class:`flex items-baseline gap-1.5 cursor-help`,title:e.definition,"data-term":e.term},[f(`span`,{class:s([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,h(V)[e.term]])},null,2),f(`span`,Me,a(e.term),1),f(`span`,Ne,a(e.text),1)],8,je))),128))]),e.vm.ranked.length>0?(d(),t(_,{key:0},[f(`h3`,{class:`ranked-head mt-3 inline-block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.rankedNote},` Longest steps `,8,Pe),f(`ol`,Fe,[(d(!0),t(_,null,n(e.vm.ranked,(e,r)=>(d(),t(`li`,{key:r,class:`flex items-baseline gap-2`},[f(`span`,Ie,a(h(j)(e.ms,`clock`)),1),f(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:v(t=>l(`reveal`,e.anchor),[`prevent`])},a(e.label),9,Le),(d(!0),t(_,null,n(e.facts,e=>(d(),t(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},a(e),1))),128))]))),128))])],64)):c(``,!0),e.vm.cut.length>0?(d(),t(_,{key:1},[f(`h3`,{class:`cut-head mt-3 block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.cutNote},` Cut steps `,8,Re),f(`ol`,ze,[(d(!0),t(_,null,n(e.vm.cut,(e,r)=>(d(),t(`li`,{key:r,class:`flex items-baseline gap-2`},[f(`span`,Be,a(h(j)(e.ms,`clock`)),1),f(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:v(t=>l(`reveal`,e.anchor),[`prevent`])},a(e.label),9,Ve),(d(!0),t(_,null,n(e.facts,e=>(d(),t(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},a(e),1))),128))]))),128))])],64)):c(``,!0)],64)):c(``,!0)]))}}),U={"getting ready":`before the agent's first turn: reading the thread, finding the repo, checking out, loading tools`,thinking:`the model's turns — from a request to the model until its reply came back`,"in tools":`the commands and tool calls the model ran`,"finishing up":`after the agent's last turn: posting the PR, checking the workspace`,"Switchboard overhead":`orchestration between steps, and moments when only a background read was running — the time no step claims`,"not recorded":`a stretch of the run the record does not carry`,"not loaded":`a stretch of the run this page did not load — the record has the full shape`},W=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,G=`Steps still open when the run ended: closed at the run's terminal event and left out of the ranking — the time shown is the cut, not a measurement.`;function He(e){let t=e===`interrupted`?`the interruption`:e===`failed`?`the failure`:e===`stopped_hard`?`the hard stop`:e===`stopped_soft`?`the stop`:void 0;return t?`cut by ${t}`:`cut at the run's end`}var Ue=`currently delivering`,We=`getting ready: not recorded (too large)`,Ge=`no timing data`,Ke=`not loaded (the record has the full shape)`,K={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function q(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=ee(t,{window:n,owner:r,finished:i,losses:e.losses}),o=ie(a),s=j(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?Je(t,r,n):void 0,u=Ye(e,l),d=l?z(l.name):``,f={window:n,owner:r,phase:e.phase,partition:a,spans:t.map(e=>({spanId:e.spanId,parentSpanId:e.parentSpanId,name:e.name,startedAt:e.startedAt,endedAt:e.endedAt,status:e.status,attrs:e.attrs}))};if(e.untimed)return{total:s,current:u,openStep:d,captions:[],rankedNote:W,cut:[],cutNote:G,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:Ge};let p=qe(c,`restartOfRunId`),m={total:s,current:u,openStep:d,captions:[p===void 0?void 0:`restarted from run ${p}`,A(`before`,J(c,`queuedBeforeMs`)),p===void 0?A(`behind`,J(c,`queuedBehindMs`)):void 0].filter(e=>e!==void 0),rankedNote:W,cutNote:G,debug:f};if(!c)return{...m,lede:s,shown:!1,bar:[],legend:[],ranked:[],cut:[],note:i?We:``};let h=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?Ke:t,g=M(a)&&o.items.length>0,_=g?`${s} — ${o.items.map(({term:e,s:t})=>`${j(t*1e3,`clock`)} ${h(e)}`).join(` · `)}`:a.windowMs>0?`${s} — ${h(Xe(a))}`:s,v=g?o.items.map(({term:t,s:n})=>({term:t,text:j(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${U[t]} (too large)`:U[t]})):[],y=g?Qe(t,c,r,n,e.callTitle,e.phase===`ended`,He(e.endedBy)):{ranked:[],cut:[]};return{...m,lede:_,shown:g,bar:g?Ze(a,l):[],legend:v,ranked:y.ranked,cut:y.cut,note:``}}function J(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function qe(e,t){let n=e?.attrs[t];return typeof n==`string`&&n!==``?n:void 0}function Je(e,t,n){let r=new Map(e.map(e=>[e.spanId,e])),i=e=>{let t=1,n=new Set([e.spanId]),i=e.parentSpanId?r.get(e.parentSpanId):void 0;for(;i&&!n.has(i.spanId);)n.add(i.spanId),t++,i=i.parentSpanId?r.get(i.parentSpanId):void 0;return t},a;for(let o of e){if(o.endedAt!==void 0||o.startedAt>=n.end)continue;let e=T(o.name,t);if(e?.kind!==`counted`||Y(o,r,t))continue;let s=i(o);(!a||s>a.depth||s===a.depth&&o.startedAt>a.span.startedAt)&&(a={span:o,depth:s,bucket:e.bucket})}if(a)return{bucket:a.bucket,name:a.span.name,elapsedMs:Math.max(0,n.end-Math.max(n.start,a.span.startedAt))}}function Y(e,t,n){let r=e,i=new Set;for(;r&&!i.has(r.spanId);){if(i.add(r.spanId),T(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function Ye(e,t){return e.phase===`delivering`?Ue:e.phase===`ended`?se(e.delivery??{}):t?`currently ${K[t.bucket]} ${j(t.elapsedMs,`clock`)}`:``}function X(e){return[[`getting ready`,e.gettingReadyMs],[`thinking`,e.thinkingMs],[`in tools`,e.toolsMs],[`finishing up`,e.finishingUpMs],[`Switchboard overhead`,e.overheadMs],[`not recorded`,e.notRecordedMs],[`not loaded`,e.notLoadedMs]]}function Xe(e){let t=[`getting ready`,-1];for(let n of X(e))n[1]>t[1]&&(t=n);return t[0]}function Ze(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of X(e))if(!(a<=0)){if(t&&K[t.bucket]===i){let e=Math.min(t.elapsedMs,a);a-e>0&&n.push({term:i,ms:a-e,pct:r(a-e),hatched:!1}),e>0&&n.push({term:i,ms:e,pct:r(e),hatched:!0});continue}n.push({term:i,ms:a,pct:r(a),hatched:!1})}return n}function Qe(e,t,n,r,i,a,o){let s=new Map(e.map(e=>[e.spanId,e])),c=new Map;for(let t of e){if(t.parentSpanId===void 0)continue;let e=c.get(t.parentSpanId);e?e.push(t):c.set(t.parentSpanId,[t])}let l=e=>[Math.max(r.start,e.startedAt),Math.min(r.end,e.endedAt??r.end)],u=[],d=[];for(let r of e){if(r===t||r.name===`run.agent`||T(r.name,n)===void 0||Y(r,s,n))continue;let[e,f]=l(r);if(f<=e)continue;let p=(c.get(r.spanId)??[]).map(l).map(([t,n])=>[Math.max(e,t),Math.min(f,n)]).filter(([e,t])=>t>e),m=f-e-$e(p);if(m<=0)continue;let h=r.name.startsWith(`tool.`)&&typeof r.attrs.callId==`string`?r.attrs.callId:void 0,g=h?i?.(h):void 0,_=a&&r.endedAt===void 0;(_?d:u).push({label:g??z(r.name),ms:m,facts:_?[o,...Z(r)]:Z(r),anchor:h?`call-${h}`:`span-${r.spanId}`,startedAt:r.startedAt})}let f=(e,t)=>t.ms-e.ms||e.startedAt-t.startedAt;u.sort(f),d.sort(f);let p=({label:e,ms:t,facts:n,anchor:r})=>({label:e,ms:t,facts:n,anchor:r});return{ranked:u.slice(0,3).map(p),cut:d.map(p)}}function $e(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=0,r;for(let[e,i]of t)!r||e>r[1]?(r&&(n+=r[1]-r[0]),r=[e,i]):i>r[1]&&(r[1]=i);return r&&(n+=r[1]-r[0]),n}function Z(e){let t=e.attrs,n=[];return(t.token===`expired`||t.token===`expiring`)&&n.push(`token ${t.token}`),t.budget===`clipped`&&n.push(`budget clipped`),typeof t.timeoutMs==`number`&&n.push(`timeout ${j(t.timeoutMs,`clock`)}`),typeof t.waitedMs==`number`&&n.push(`waited ${j(t.waitedMs,`clock`)}`),typeof t.exitCode==`number`&&t.exitCode!==0&&n.push(`exit ${t.exitCode}`),t.timedOut===!0&&n.push(`timed out`),typeof t.attempts==`number`&&t.attempts>1&&n.push(`${t.attempts} attempts`),e.status===`error`&&n.length===0&&n.push(`failed`),n}function Q(e){return e===`command`?`command`:`agent`}var et=[`data-state`],tt={key:0,class:`loading py-2 font-mono text-xs text-dimmed`},nt={key:1,class:`failed py-2 font-mono text-xs text-warn`},rt=[`data-turn`,`data-anchor`],it={class:`landing-head flex flex-wrap items-baseline gap-x-2 font-mono text-xs text-muted`},at={class:`turn tabular-nums`},ot={class:`what min-w-0 truncate text-toned`},st={key:0,class:`m-0 mt-1 list-none p-0`},ct=o({__name:`RunTimeline`,props:{run:{},land:{},fetch:{}},setup(n){let i=n,o=b(`loading`),s=oe(),v=S(()=>{if(o.value!==`ready`)return null;s.state.traceVersion;let e=i.run,t=e.receivedAt??e.startedAt,n=k(e)??(e.finishedAt===void 0?0:Math.max(0,e.finishedAt-t));return q({spans:s.spanSet(),losses:s.losses(t),window:{start:t,end:t+n},owner:Q(e.agent),totalMs:n,phase:`ended`,delivery:{finishedAt:e.finishedAt,sealedAt:e.sealedAt,replyOk:e.replyOk},...e.truncated===void 0?{}:{truncated:e.truncated},...(e.schema??0)>=2?{}:{untimed:!0},callTitle:s.callHeadline})}),x=S(()=>`/runs/${encodeURIComponent(i.run.id)}/events`),C=e=>`/runs/${encodeURIComponent(i.run.id)}#${e}`;function w(e){y.navigate(C(e))}let T=S(()=>{if(o.value!==`ready`||i.land===void 0)return null;s.state.traceVersion;let e=i.land,t=i.run.session;if(t&&e===t.request)return{anchor:`request`,what:`the request`};let n=t&&t.range!==`broken`?t.range.to:void 0;if(n!==void 0&&e===n&&s.state.reply)return{anchor:`reply`,what:`the reply`};let r=s.landing(e);return r?{anchor:r.anchor,what:E(r.step),step:r.step}:null});function E(e){let t=e.items.find(e=>e.kind===`call`),n=t?.kind===`call`?t.call.headline:void 0;return[e.turn?`thought ${e.turn.chip}`:void 0,n].filter(e=>e!==void 0).join(` · `)||`step ${e.index+1}`}let D=b(null),O=S(()=>T.value?`${i.land}@${T.value.anchor}`:null);return r(O,e=>{e!==null&&m().then(()=>{let e=(T.value?.step?D.value?.querySelector(`li.step`):null)??D.value;e&&(e.scrollIntoView?.({block:`center`}),e.classList.add(`revealed`),setTimeout(()=>e.classList.remove(`revealed`),1500))})}),p(async()=>{let e=i.fetch??((...e)=>globalThis.fetch(...e));try{let t=await e(x.value,{credentials:`same-origin`});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=le(await t.text()).filter(e=>e.type!==`replay_note`);for(let e of(i.run.schema??0)>=2?ne(n):n)s.handle(e);s.closePhases(),o.value=`ready`}catch{o.value=`failed`}}),(r,i)=>{let p=l(`RouterLink`);return d(),t(`div`,{class:`runtimeline pl-5`,"data-state":o.value},[o.value===`loading`?(d(),t(`p`,tt,`reading the run's record…`)):o.value===`failed`?(d(),t(`p`,nt,[i[2]||=g(` the run's record could not be read — `,-1),e(p,{class:`text-primary no-underline hover:underline`,to:`/runs/${encodeURIComponent(n.run.id)}`},{default:u(()=>[...i[1]||=[g(`open the run`,-1)]]),_:1},8,[`to`])])):v.value?(d(),t(_,{key:2},[e(H,{vm:v.value,"events-href":x.value,onReveal:w},null,8,[`vm`,`events-href`]),T.value?(d(),t(`div`,{key:0,ref_key:`landingEl`,ref:D,class:`landing mb-4 rounded-lg border border-default px-(--sb-gutter) py-2`,"data-turn":n.land,"data-anchor":T.value.anchor},[f(`p`,it,[f(`span`,at,`turn `+a(n.land),1),f(`span`,ot,`· `+a(T.value.what),1),e(p,{class:`page ml-auto shrink-0 text-primary no-underline hover:underline`,to:C(T.value.anchor),title:`the same step on the run's own page`},{default:u(()=>[...i[3]||=[g(`open on the run's page ↗`,-1)]]),_:1},8,[`to`])]),T.value.step?(d(),t(`ol`,st,[e(ce,{step:T.value.step,onToggleGroup:i[0]||=e=>h(s).toggleGroup(T.value.step)},null,8,[`step`])])):c(``,!0)],8,rt)):c(``,!0)],64)):c(``,!0)],8,et)}}}),lt=[`id`,`data-run-id`,`data-round`,`data-thread`],ut=[`open`],dt={class:`row flex min-w-0 cursor-pointer list-none flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted) [&::-webkit-details-marker]:hidden`},ft={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},$={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},pt={key:3,class:`scope min-w-0 flex-1 truncate text-toned`},mt=[`title`],ht=[`data-heat`],gt={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},_t={key:1,class:`row flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted)`},vt={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},yt={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},bt={key:3,class:`scope min-w-0 flex-1 truncate text-highlighted`},xt=[`title`],St={class:`elapsed shrink-0 text-right font-mono text-xs tabular-nums text-ok sm:min-w-[4.5em]`,title:`running for`},Ct={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},wt=o({__name:`RunFoldRow`,props:{run:{},now:{},label:{},open:{type:Boolean},land:{}},setup(n){let o=n,p=b(o.open===!0);r(()=>o.open,e=>{e&&(p.value=!0)});let m=S(()=>C(o.run.label||E(o.run.id))),_=S(()=>te(o.run)),y=S(()=>re(o.run)),T=S(()=>o.run.finished),k=S(()=>o.run.finished&&o.run.status&&o.run.status!==`completed`?O(o.run.status):``),A=S(()=>de(o.run.finished&&typeof o.run.finishedAt==`number`?o.run.finishedAt-o.run.startedAt:void 0,`run`)),j=S(()=>ue(A.value));function M(e){p.value=e.target.open}return(r,o)=>{let b=l(`RouterLink`);return d(),t(`li`,{id:`run-${n.run.id}`,class:s([`fold group border-b border-muted`,n.run.finished?`finished`:`live`]),"data-run-id":n.run.id,"data-round":n.run.round,"data-thread":n.run.thread},[T.value?(d(),t(`details`,{key:0,class:`group/fold`,open:p.value,onToggle:M},[f(`summary`,dt,[o[2]||=f(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open/fold:rotate-90 motion-reduce:transition-none`,"aria-hidden":`true`},`❯`,-1),e(B,{tone:_.value,label:h(D)(n.run),tip:h(F)(n.run)},null,8,[`tone`,`label`,`tip`]),n.label?(d(),t(`span`,ft,a(n.label),1)):c(``,!0),m.value.agent?(d(),t(`span`,{key:1,class:s([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider opacity-55`,h(R)[h(P)(m.value.agent)]])},a(m.value.agent),3)):c(``,!0),m.value.snippet===void 0?(d(),t(`span`,pt,a(m.value.scope),1)):(d(),t(`span`,$,a(m.value.snippet),1)),k.value?(d(),t(`span`,{key:4,class:s([`outcome shrink-0 rounded border px-1.5 font-mono text-[0.7rem]`,_.value===`red`?`border-bad/30 text-bad`:`border-warn/30 text-warn`])},a(k.value),3)):c(``,!0),f(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-dimmed`,title:h(N)(n.run)},a(h(w)(n.run.startedAt,n.now)),9,mt),f(`span`,{class:s([`elapsed shrink-0 text-right font-mono text-xs tabular-nums sm:min-w-[4.5em]`,[j.value?`heat`:`text-muted`,A.value.level>=2?`font-medium`:``]]),style:i(j.value),"data-heat":A.value.level,title:`start to finish`},a(h(I)(n.run,n.now)),15,ht),f(`span`,gt,a(h(L)(n.run)),1),e(b,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,to:y.value,"aria-label":`open run ${n.run.label||h(E)(n.run.id)}`,onClick:o[0]||=v(()=>{},[`stop`])},{default:u(()=>[...o[1]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]),p.value?(d(),x(ct,{key:0,run:n.run,land:n.land},null,8,[`run`,`land`])):c(``,!0)],40,ut)):(d(),t(`div`,_t,[o[4]||=f(`span`,{class:`chev select-none text-xs text-transparent`,"aria-hidden":`true`},`❯`,-1),e(B,{tone:_.value,label:h(D)(n.run),tip:h(F)(n.run),pulse:``},null,8,[`tone`,`label`,`tip`]),n.label?(d(),t(`span`,vt,a(n.label),1)):c(``,!0),m.value.agent?(d(),t(`span`,{key:1,class:s([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider`,h(R)[h(P)(m.value.agent)]])},a(m.value.agent),3)):c(``,!0),m.value.snippet===void 0?(d(),t(`span`,bt,a(m.value.scope),1)):(d(),t(`span`,yt,a(m.value.snippet),1)),f(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-muted`,title:h(N)(n.run)},a(h(w)(n.run.startedAt,n.now)),9,xt),f(`span`,St,a(h(I)(n.run,n.now)),1),f(`span`,Ct,a(h(L)(n.run)),1),e(b,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,to:y.value,"aria-label":`open run ${n.run.label||h(E)(n.run.id)}`},{default:u(()=>[...o[3]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]))],10,lt)}}});export{ye as a,H as i,Q as n,_e as o,q as r,pe as s,wt as t};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-
|
|
2
|
-
import{D as e,M as t,b as n,d as r,f as i,t as a,v as o,y as s}from"./AppShell-DPJVhUGP.js";import{An as c,Br as l,Cn as u,Cr as d,Ct as f,E as p,Gr as m,I as h,Ii as g,K as _,L as v,Li as y,Mn as b,Oi as x,Pi as S,S as C,Sn as w,Tr as ee,Vr as T,X as E,Xr as D,Zn as O,_ as k,_r as A,b as te,bn as j,dr as M,ft as ne,g as re,gt as ie,h as ae,hr as oe,ht as se,ir as ce,ji as N,kn as P,l as le,ln as F,lt as ue,nn as de,o as fe,qr as pe,r as me,rn as he,rr as I,rt as ge,sr as L,st as _e,t as ve,wi as ye,wr as R,x as z,xi as B,xn as V,y as H,yi as be,yn as U,yr as xe,z as W}from"./browser-CCImen5O.js";import{t as Se}from"./Tooltip-CmQVfAl2.js";import{i as Ce,n as we,r as Te,t as Ee}from"./PendingTurnRow-DIC86uWA.js";import{b as De,t as Oe,x as ke}from"./main-Bk1L-bNk.js";import{t as Ae}from"./eventSource-Cv0AFlMi.js";import{t as je}from"./wallClock-x0hjr0J_.js";import{t as Me}from"./indexFormat-B-pd4r7Y.js";import{E as Ne,F as Pe,K as Fe,j as Ie}from"./indexRow-BsWcHHVh.js";import{i as Le,n as Re,r as ze}from"./format-BldUwl_R.js";import{a as Be,i as Ve,n as He,o as Ue,r as We,s as Ge,t as G}from"./RunFoldRow-CAdpX4Gn.js";import{n as Ke,t as qe}from"./SlackMark-DB0MGiF5.js";import{C as Je,S as Ye,T as K,_ as Xe,a as Ze,b as Qe,c as $e,d as et,g as tt,h as nt,i as rt,l as it,n as at,o as ot,r as st,s as ct,u as lt,v as ut,x as dt,y as ft}from"./sseReplay-DGRDRLua.js";import{n as pt,t as mt}from"./durationTone-CVpX_yIk.js";import{t as ht}from"./NotFoundPage-CDjMfCcj.js";var gt=b({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(t){let r=t,a=i(),l=e(),u=U(()=>r.tabStopId||l),d=U(()=>a.currentTabStopId.value===u.value),{getItems:f,CollectionItem:g}=p();M(()=>{r.focusable&&a.onFocusableItemAdd()}),oe(()=>{r.focusable&&a.onFocusableItemRemove()}),m(()=>r.focusable,(e,t)=>{e!==t&&(e?a.onFocusableItemAdd():a.onFocusableItemRemove())});function _(e){if(e.key===`Tab`&&e.shiftKey){a.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=s(e,a.orientation.value,a.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!r.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...f().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(t===`last`)i.reverse();else if(t===`prev`||t===`next`){t===`prev`&&i.reverse();let r=i.indexOf(e.currentTarget);i=a.loop.value?n(i,r+1):i.slice(r+1)}ce(()=>o(i))}}return(e,t)=>(A(),V(N(g),null,{default:D(()=>[c(N(h),{tabindex:d.value?0:-1,"data-orientation":N(a).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?N(a).onItemFocus(u.value):t.preventDefault()},onFocus:t[1]||=e=>N(a).onItemFocus(u.value),onKeydown:_},{default:D(()=>[R(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[q,_t]=_(`TabsRoot`),vt=b({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(n,{emit:r}){let i=n,a=r,{orientation:o,unmountOnHide:s,dir:c}=x(i),l=t(c);W();let u=ie(i,`modelValue`,a,{defaultValue:i.defaultValue,passive:i.modelValue===void 0}),d=B(),f=ye(new Set);return _t({modelValue:u,changeModelValue:e=>{u.value=e},orientation:o,dir:l,unmountOnHide:s,activationMode:i.activationMode,baseId:e(void 0,`reka-tabs`),tabsList:d,contentIds:f,registerContent:e=>{f.value=new Set([...f.value,e])},unregisterContent:e=>{let t=new Set(f.value);t.delete(e),f.value=t}}),(e,t)=>(A(),V(N(h),{dir:N(l),"data-orientation":N(o),"as-child":e.asChild,as:e.as},{default:D(()=>[R(e.$slots,`default`,{modelValue:N(u)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function J(e,t){return`${e}-trigger-${t}`}function yt(e,t){return`${e}-content-${t}`}var bt=b({__name:`TabsContent`,props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=W(),r=q(),i=U(()=>J(r.baseId,t.value)),a=U(()=>yt(r.baseId,t.value)),o=U(()=>t.value===r.modelValue.value),s=B(o.value);return M(()=>{r.registerContent(t.value),requestAnimationFrame(()=>{s.value=!1})}),L(()=>{r.unregisterContent(t.value)}),(e,t)=>(A(),V(N(v),{present:e.forceMount||o.value,"force-mount":``},{default:D(({present:t})=>[c(N(h),{id:a.value,ref:N(n),"as-child":e.asChild,as:e.as,role:`tabpanel`,"data-state":o.value?`active`:`inactive`,"data-orientation":N(r).orientation.value,"aria-labelledby":i.value,hidden:!t,tabindex:`0`,style:g({animationDuration:s.value?`0s`:void 0})},{default:D(()=>[!N(r).unmountOnHide.value||t?R(e.$slots,`default`,{key:0}):w(`v-if`,!0)]),_:2},1032,[`id`,`as-child`,`as`,`data-state`,`data-orientation`,`aria-labelledby`,`hidden`,`style`])]),_:3},8,[`present`]))}}),xt=b({__name:`TabsIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=q();t({updateIndicatorStyle:s}),W();let i=ne(),a=B({size:null,thickness:null,position:null}),o=B([]);m(()=>[r.modelValue.value,r?.dir.value],()=>{s()},{immediate:!0,flush:`post`}),pe(()=>{o.value=Array.from(r.tabsList.value?.querySelectorAll(`[role="tab"]`)||[])}),se(U(()=>[r.tabsList.value,...o.value]),s);function s(){let e=r.tabsList.value?.querySelector(`[role="tab"][data-state="active"]`);e&&(r.orientation.value===`horizontal`?a.value={size:e.offsetWidth,thickness:e.offsetHeight,position:e.offsetLeft}:a.value={size:e.offsetHeight,thickness:e.offsetWidth,position:e.offsetTop})}return(e,t)=>N(i)&&typeof a.value.size==`number`?(A(),V(N(h),I({key:0},n,{style:{"--reka-tabs-indicator-size":`${a.value.size}px`,"--reka-tabs-indicator-thickness":`${a.value.thickness}px`,"--reka-tabs-indicator-position":`${a.value.position}px`}}),{default:D(()=>[R(e.$slots,`default`)]),_:3},16,[`style`])):w(`v-if`,!0)}}),St=b({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:t}=x(e),{forwardRef:n,currentElement:i}=W(),a=q();return a.tabsList=i,(e,i)=>(A(),V(N(r),{"as-child":``,orientation:N(a).orientation.value,dir:N(a).dir.value,loop:N(t)},{default:D(()=>[c(N(h),{ref:N(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":N(a).orientation.value},{default:D(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),Ct=b({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,{forwardRef:n}=W(),r=q(),i=U(()=>J(r.baseId,t.value)),a=U(()=>r.contentIds.value.has(t.value)?yt(r.baseId,t.value):void 0),o=U(()=>t.value===r.modelValue.value);return(e,t)=>(A(),V(N(gt),{"as-child":``,focusable:!e.disabled,active:o.value},{default:D(()=>[c(N(h),{id:i.value,ref:N(n),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":o.value?`true`:`false`,"aria-controls":a.value,"data-state":o.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":N(r).orientation.value,onMousedown:t[0]||=he(t=>{!e.disabled&&t.ctrlKey===!1?N(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=de(t=>N(r).changeModelValue(e.value),[`enter`,`space`]),onFocus:t[2]||=()=>{let t=N(r).activationMode!==`manual`;!o.value&&!e.disabled&&t&&N(r).changeModelValue(e.value)}},{default:D(()=>[R(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}}),wt=[`data-expanded`,`data-overflowing`],Tt={key:0,class:`fade pointer-events-none absolute inset-x-0 bottom-6 h-10`},Et={key:1,class:`mt-1 flex justify-start`},Y=[`aria-expanded`],Dt=Ke(b({__name:`ExpandableText`,props:{lines:{default:5}},setup(e){let t=e,n=B(!1),r=B(!1),i=B(null),a=`expandable-${Math.random().toString(36).slice(2,8)}`;function o(){let e=i.value;e&&!n.value&&(r.value=e.scrollHeight>e.clientHeight+1)}let s=null;M(()=>{o(),typeof ResizeObserver<`u`&&i.value&&(s=new ResizeObserver(()=>o()),s.observe(i.value))}),L(()=>s?.disconnect()),m(n,e=>{e||Promise.resolve().then(o)});function c(){n.value=!n.value}function l(e){!n.value&&r.value&&(e.target?.closest?.(`a`)||(n.value=!0))}return(e,o)=>(A(),u(`div`,{class:S([`expandable group relative`,!n.value&&r.value?`cursor-pointer`:``]),"data-expanded":n.value?`1`:`0`,"data-overflowing":r.value?`1`:`0`,onClick:l},[j(`div`,{id:a,ref_key:`body`,ref:i,class:S([`body`,n.value?``:`clamped`]),style:g(n.value?void 0:{"--expandable-lines":String(t.lines)})},[R(e.$slots,`default`,{},void 0,!0)],6),!n.value&&r.value?(A(),u(`div`,Tt)):w(``,!0),r.value||n.value?(A(),u(`div`,Et,[j(`button`,{type:`button`,class:`more cursor-pointer text-xs text-dimmed group-hover:text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"aria-expanded":n.value?`true`:`false`,"aria-controls":a,onClick:he(c,[`stop`])},y(n.value?`Show less`:`Show more`),9,Y)])):w(``,!0)],10,wt))}}),[[`__scopeId`,`data-v-ce3bfa89`]]),Ot=[`id`],kt={class:`what`},X={key:0,class:`text-dimmed`},At={key:1,class:`dur tabular-nums text-dimmed`},jt=[`title`],Mt=b({__name:`SpanRow`,props:{item:{}},setup(e){return(t,n)=>(A(),u(`li`,{id:`span-${e.item.spanId}`,class:`span flex items-baseline gap-2 py-0.5 pr-(--sb-gutter) font-mono text-xs text-muted`},[j(`span`,{class:S([`glyph select-none`,e.item.status===`error`?`text-bad`:`text-dimmed`])},y(e.item.open?`◌`:e.item.status===`error`?`✗`:`◷`),3),j(`span`,kt,y(e.item.text),1),e.item.open?(A(),u(`span`,X,`…`)):e.item.durationMs===void 0?w(``,!0):(A(),u(`span`,At,y(N(Fe)(e.item.durationMs,`precise`)),1)),e.item.at===void 0?w(``,!0):(A(),u(`span`,{key:2,class:`ts ml-auto select-none text-dimmed`,title:N(Le)(e.item.at)},y(N(Re)(e.item.at)),9,jt))],8,Ot))}}),Z=[`data-position`],Q={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-ok`},Nt=[`href`],Pt={key:1,class:`caption font-normal normal-case tracking-normal text-dimmed`},Ft=[`title`],It=b({__name:`ReplyBlock`,props:{text:{},caption:{},when:{},whenTitle:{},position:{},files:{}},setup(e){return(t,n)=>(A(),u(`section`,{id:`reply`,class:S([`block rounded-lg border border-ok/40 bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,e.position===`first`?`mb-4`:`mt-6`]),"data-position":e.position},[j(`h2`,Q,[n[0]||=j(`span`,null,`Reply`,-1),e.caption.href?(A(),u(`a`,{key:0,class:`caption font-normal normal-case tracking-normal text-dimmed no-underline hover:text-primary hover:underline`,href:e.caption.href,target:`_blank`,rel:`noopener noreferrer`},y(e.caption.text),9,Nt)):(A(),u(`span`,Pt,y(e.caption.text),1)),j(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:e.whenTitle},y(e.when),9,Ft)]),c(K,{text:e.text},null,8,[`text`]),e.files.length>0?(A(),V(st,{key:0,files:e.files},null,8,[`files`])):w(``,!0)],10,Z))}}),Lt={id:`units`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Rt={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},zt={class:`count font-normal normal-case tracking-normal text-dimmed`},Bt={class:`m-0 list-none p-0`},Vt=[`data-unit`],Ht=[`href`],Ut=b({__name:`RunUnitsBlock`,props:{units:{}},setup(e){let t={merged:`border-ok/30 text-ok`,merge_ready:`border-ok/30 text-ok`,done:`border-ok/30 text-ok`};function n(e){return e.ending?Ge(e.ending.kind):e.idle?`idle · ${Ge(e.idle.why)}`:e.threads.coding===void 0?`not started`:`round ${e.rounds.at(-1)?.index??0} · ${e.rounds.at(-1)?.agent??`in flight`}`}return(r,i)=>{let a=ee(`RouterLink`);return A(),u(`section`,Lt,[j(`h2`,Rt,[i[0]||=j(`span`,null,`Units`,-1),j(`span`,zt,`· `+y(e.units.length)+` unit`+y(e.units.length===1?``:`s`)+` — each opens to its runs in round order`,1)]),j(`ol`,Bt,[(A(!0),u(F,null,d(e.units,e=>(A(),u(`li`,{key:e.unit,class:`unit flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 border-t border-default py-1.5 first:border-t-0`,"data-unit":e.unit},[c(a,{class:`key shrink-0 rounded border border-accented px-1.5 font-mono text-[0.72rem] font-medium text-toned no-underline hover:border-primary hover:text-primary`,to:`/runs/unit/${encodeURIComponent(e.unit)}`},{default:D(()=>[P(y(e.id),1)]),_:2},1032,[`to`]),c(a,{class:`title min-w-0 flex-1 truncate text-sm text-highlighted no-underline hover:underline`,to:`/runs/unit/${encodeURIComponent(e.unit)}`},{default:D(()=>[P(y(e.title??e.branch),1)]),_:2},1032,[`to`]),j(`span`,{class:S([`standing shrink-0 rounded border px-1.5 font-mono text-[0.7rem]`,t[e.ending?.kind??``]??`border-accented text-muted`])},y(n(e)),3),e.pr?(A(),u(`a`,{key:0,class:`prlink shrink-0 whitespace-nowrap font-mono text-xs text-primary no-underline hover:underline`,href:e.pr.url,target:`_blank`,rel:`noopener noreferrer`},[c(Ue,{class:`mr-1 align-[-0.125em]`}),P(`#`+y(e.pr.number),1)],8,Ht)):w(``,!0)],8,Vt))),128))])])}}}),Wt={id:`children`,class:`block mb-4 px-(--sb-gutter)`},Gt={class:`mb-1 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Kt={class:`count font-normal normal-case tracking-normal text-dimmed`},qt={class:`m-0 list-none border-t border-muted p-0`},Jt=b({__name:`RunChildrenBlock`,props:{children:{},now:{}},setup(e){return(t,n)=>(A(),u(`section`,Wt,[j(`h2`,Gt,[n[0]||=j(`span`,null,`Spawned runs`,-1),j(`span`,Kt,`· `+y(e.children.length)+` run`+y(e.children.length===1?``:`s`)+`, in the order they started`,1)]),j(`ol`,qt,[(A(!0),u(F,null,d(e.children,t=>(A(),V(G,{key:t.id,run:t,now:e.now},null,8,[`run`,`now`]))),128))])]))}});function Yt(e){return e.description?.title?e.description.title:e.pr.repo&&e.pr.number!==void 0?`${e.pr.repo}#${e.pr.number}`:e.pr.repo??`PR review`}var Xt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Zt=/^[0-9a-f]{7,40}$/;function Qt(e){if(!e.repo||!Xt.test(e.repo))return{};let t=`https://github.com/${e.repo}`,n={};return e.number!==void 0&&Number.isInteger(e.number)&&e.number>0&&(n.pr=`${t}/pull/${e.number}`,n.files=`${t}/pull/${e.number}/files`),e.headSha&&Zt.test(e.headSha)&&(n.commit=e.number!==void 0&&n.pr?`${t}/pull/${e.number}/commits/${e.headSha}`:`${t}/commit/${e.headSha}`),n}function $t(e){return e.find(e=>e.poweredBy===`meat`)??e.find(e=>e.poweredBy===`git`)??null}function en(e){return e===`meat`?`An abridged reading of the change: a model dropped what a reviewer need not read (style, imports, boilerplate) and kept the concepts`:`The complete change, base…head, as git reports it`}function tn(e){return`The recorded diff was cut at ${e.toLocaleString(`en-US`)} characters; open the full diff on GitHub for the rest`}function nn(e){return e===`meat`?`reading diff · meat`:`full diff · git`}function rn(e){let t=[];return e.origin===`parsed`&&!e.complete&&t.push(`read back from the PR body`),e.truncated&&t.push(`the body was cut before it was read`),t.length>0?t.join(`; `):void 0}var an=e=>typeof e==`object`&&!!e,$=e=>typeof e==`string`&&e!==``,on=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;function sn(e){for(let t of e.split(/\n\s*\n/)){let e=t.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-v3Py3_QR.js","assets/AppShell-DPJVhUGP.js","assets/browser-CCImen5O.js","assets/main-ks3kBojV.js","assets/main-DPB0UO1-.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{D as e,M as t,b as n,d as r,f as i,t as a,v as o,y as s}from"./AppShell-DPJVhUGP.js";import{An as c,Br as l,Cn as u,Cr as d,Ct as f,E as p,Gr as m,I as h,Ii as g,K as _,L as v,Li as y,Mn as b,Oi as x,Pi as S,S as C,Sn as w,Tr as ee,Vr as T,X as E,Xr as D,Zn as O,_ as k,_r as A,b as te,bn as j,dr as M,ft as ne,g as re,gt as ie,h as ae,hr as oe,ht as se,ir as ce,ji as N,kn as P,l as le,ln as F,lt as ue,nn as de,o as fe,qr as pe,r as me,rn as he,rr as I,rt as ge,sr as L,st as _e,t as ve,wi as ye,wr as R,x as z,xi as B,xn as V,y as H,yi as be,yn as U,yr as xe,z as W}from"./browser-CCImen5O.js";import{t as Se}from"./Tooltip-BvPkV4kZ.js";import{i as Ce,n as we,r as Te,t as Ee}from"./PendingTurnRow-C6hroa00.js";import{b as De,t as Oe,x as ke}from"./main-ks3kBojV.js";import{t as Ae}from"./eventSource-Cv0AFlMi.js";import{t as je}from"./wallClock-x0hjr0J_.js";import{t as Me}from"./indexFormat-B-pd4r7Y.js";import{E as Ne,F as Pe,K as Fe,j as Ie}from"./indexRow-BsWcHHVh.js";import{i as Le,n as Re,r as ze}from"./format-BldUwl_R.js";import{a as Be,i as Ve,n as He,o as Ue,r as We,s as Ge,t as G}from"./RunFoldRow-DrfFauYJ.js";import{n as Ke,t as qe}from"./SlackMark-DB0MGiF5.js";import{C as Je,S as Ye,T as K,_ as Xe,a as Ze,b as Qe,c as $e,d as et,g as tt,h as nt,i as rt,l as it,n as at,o as ot,r as st,s as ct,u as lt,v as ut,x as dt,y as ft}from"./sseReplay-DuALaBPq.js";import{n as pt,t as mt}from"./durationTone-CVpX_yIk.js";import{t as ht}from"./NotFoundPage-CDjMfCcj.js";var gt=b({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(t){let r=t,a=i(),l=e(),u=U(()=>r.tabStopId||l),d=U(()=>a.currentTabStopId.value===u.value),{getItems:f,CollectionItem:g}=p();M(()=>{r.focusable&&a.onFocusableItemAdd()}),oe(()=>{r.focusable&&a.onFocusableItemRemove()}),m(()=>r.focusable,(e,t)=>{e!==t&&(e?a.onFocusableItemAdd():a.onFocusableItemRemove())});function _(e){if(e.key===`Tab`&&e.shiftKey){a.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=s(e,a.orientation.value,a.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!r.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...f().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(t===`last`)i.reverse();else if(t===`prev`||t===`next`){t===`prev`&&i.reverse();let r=i.indexOf(e.currentTarget);i=a.loop.value?n(i,r+1):i.slice(r+1)}ce(()=>o(i))}}return(e,t)=>(A(),V(N(g),null,{default:D(()=>[c(N(h),{tabindex:d.value?0:-1,"data-orientation":N(a).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?N(a).onItemFocus(u.value):t.preventDefault()},onFocus:t[1]||=e=>N(a).onItemFocus(u.value),onKeydown:_},{default:D(()=>[R(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[q,_t]=_(`TabsRoot`),vt=b({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(n,{emit:r}){let i=n,a=r,{orientation:o,unmountOnHide:s,dir:c}=x(i),l=t(c);W();let u=ie(i,`modelValue`,a,{defaultValue:i.defaultValue,passive:i.modelValue===void 0}),d=B(),f=ye(new Set);return _t({modelValue:u,changeModelValue:e=>{u.value=e},orientation:o,dir:l,unmountOnHide:s,activationMode:i.activationMode,baseId:e(void 0,`reka-tabs`),tabsList:d,contentIds:f,registerContent:e=>{f.value=new Set([...f.value,e])},unregisterContent:e=>{let t=new Set(f.value);t.delete(e),f.value=t}}),(e,t)=>(A(),V(N(h),{dir:N(l),"data-orientation":N(o),"as-child":e.asChild,as:e.as},{default:D(()=>[R(e.$slots,`default`,{modelValue:N(u)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function J(e,t){return`${e}-trigger-${t}`}function yt(e,t){return`${e}-content-${t}`}var bt=b({__name:`TabsContent`,props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=W(),r=q(),i=U(()=>J(r.baseId,t.value)),a=U(()=>yt(r.baseId,t.value)),o=U(()=>t.value===r.modelValue.value),s=B(o.value);return M(()=>{r.registerContent(t.value),requestAnimationFrame(()=>{s.value=!1})}),L(()=>{r.unregisterContent(t.value)}),(e,t)=>(A(),V(N(v),{present:e.forceMount||o.value,"force-mount":``},{default:D(({present:t})=>[c(N(h),{id:a.value,ref:N(n),"as-child":e.asChild,as:e.as,role:`tabpanel`,"data-state":o.value?`active`:`inactive`,"data-orientation":N(r).orientation.value,"aria-labelledby":i.value,hidden:!t,tabindex:`0`,style:g({animationDuration:s.value?`0s`:void 0})},{default:D(()=>[!N(r).unmountOnHide.value||t?R(e.$slots,`default`,{key:0}):w(`v-if`,!0)]),_:2},1032,[`id`,`as-child`,`as`,`data-state`,`data-orientation`,`aria-labelledby`,`hidden`,`style`])]),_:3},8,[`present`]))}}),xt=b({__name:`TabsIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=q();t({updateIndicatorStyle:s}),W();let i=ne(),a=B({size:null,thickness:null,position:null}),o=B([]);m(()=>[r.modelValue.value,r?.dir.value],()=>{s()},{immediate:!0,flush:`post`}),pe(()=>{o.value=Array.from(r.tabsList.value?.querySelectorAll(`[role="tab"]`)||[])}),se(U(()=>[r.tabsList.value,...o.value]),s);function s(){let e=r.tabsList.value?.querySelector(`[role="tab"][data-state="active"]`);e&&(r.orientation.value===`horizontal`?a.value={size:e.offsetWidth,thickness:e.offsetHeight,position:e.offsetLeft}:a.value={size:e.offsetHeight,thickness:e.offsetWidth,position:e.offsetTop})}return(e,t)=>N(i)&&typeof a.value.size==`number`?(A(),V(N(h),I({key:0},n,{style:{"--reka-tabs-indicator-size":`${a.value.size}px`,"--reka-tabs-indicator-thickness":`${a.value.thickness}px`,"--reka-tabs-indicator-position":`${a.value.position}px`}}),{default:D(()=>[R(e.$slots,`default`)]),_:3},16,[`style`])):w(`v-if`,!0)}}),St=b({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:t}=x(e),{forwardRef:n,currentElement:i}=W(),a=q();return a.tabsList=i,(e,i)=>(A(),V(N(r),{"as-child":``,orientation:N(a).orientation.value,dir:N(a).dir.value,loop:N(t)},{default:D(()=>[c(N(h),{ref:N(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":N(a).orientation.value},{default:D(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),Ct=b({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,{forwardRef:n}=W(),r=q(),i=U(()=>J(r.baseId,t.value)),a=U(()=>r.contentIds.value.has(t.value)?yt(r.baseId,t.value):void 0),o=U(()=>t.value===r.modelValue.value);return(e,t)=>(A(),V(N(gt),{"as-child":``,focusable:!e.disabled,active:o.value},{default:D(()=>[c(N(h),{id:i.value,ref:N(n),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":o.value?`true`:`false`,"aria-controls":a.value,"data-state":o.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":N(r).orientation.value,onMousedown:t[0]||=he(t=>{!e.disabled&&t.ctrlKey===!1?N(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=de(t=>N(r).changeModelValue(e.value),[`enter`,`space`]),onFocus:t[2]||=()=>{let t=N(r).activationMode!==`manual`;!o.value&&!e.disabled&&t&&N(r).changeModelValue(e.value)}},{default:D(()=>[R(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}}),wt=[`data-expanded`,`data-overflowing`],Tt={key:0,class:`fade pointer-events-none absolute inset-x-0 bottom-6 h-10`},Et={key:1,class:`mt-1 flex justify-start`},Y=[`aria-expanded`],Dt=Ke(b({__name:`ExpandableText`,props:{lines:{default:5}},setup(e){let t=e,n=B(!1),r=B(!1),i=B(null),a=`expandable-${Math.random().toString(36).slice(2,8)}`;function o(){let e=i.value;e&&!n.value&&(r.value=e.scrollHeight>e.clientHeight+1)}let s=null;M(()=>{o(),typeof ResizeObserver<`u`&&i.value&&(s=new ResizeObserver(()=>o()),s.observe(i.value))}),L(()=>s?.disconnect()),m(n,e=>{e||Promise.resolve().then(o)});function c(){n.value=!n.value}function l(e){!n.value&&r.value&&(e.target?.closest?.(`a`)||(n.value=!0))}return(e,o)=>(A(),u(`div`,{class:S([`expandable group relative`,!n.value&&r.value?`cursor-pointer`:``]),"data-expanded":n.value?`1`:`0`,"data-overflowing":r.value?`1`:`0`,onClick:l},[j(`div`,{id:a,ref_key:`body`,ref:i,class:S([`body`,n.value?``:`clamped`]),style:g(n.value?void 0:{"--expandable-lines":String(t.lines)})},[R(e.$slots,`default`,{},void 0,!0)],6),!n.value&&r.value?(A(),u(`div`,Tt)):w(``,!0),r.value||n.value?(A(),u(`div`,Et,[j(`button`,{type:`button`,class:`more cursor-pointer text-xs text-dimmed group-hover:text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"aria-expanded":n.value?`true`:`false`,"aria-controls":a,onClick:he(c,[`stop`])},y(n.value?`Show less`:`Show more`),9,Y)])):w(``,!0)],10,wt))}}),[[`__scopeId`,`data-v-ce3bfa89`]]),Ot=[`id`],kt={class:`what`},X={key:0,class:`text-dimmed`},At={key:1,class:`dur tabular-nums text-dimmed`},jt=[`title`],Mt=b({__name:`SpanRow`,props:{item:{}},setup(e){return(t,n)=>(A(),u(`li`,{id:`span-${e.item.spanId}`,class:`span flex items-baseline gap-2 py-0.5 pr-(--sb-gutter) font-mono text-xs text-muted`},[j(`span`,{class:S([`glyph select-none`,e.item.status===`error`?`text-bad`:`text-dimmed`])},y(e.item.open?`◌`:e.item.status===`error`?`✗`:`◷`),3),j(`span`,kt,y(e.item.text),1),e.item.open?(A(),u(`span`,X,`…`)):e.item.durationMs===void 0?w(``,!0):(A(),u(`span`,At,y(N(Fe)(e.item.durationMs,`precise`)),1)),e.item.at===void 0?w(``,!0):(A(),u(`span`,{key:2,class:`ts ml-auto select-none text-dimmed`,title:N(Le)(e.item.at)},y(N(Re)(e.item.at)),9,jt))],8,Ot))}}),Z=[`data-position`],Q={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-ok`},Nt=[`href`],Pt={key:1,class:`caption font-normal normal-case tracking-normal text-dimmed`},Ft=[`title`],It=b({__name:`ReplyBlock`,props:{text:{},caption:{},when:{},whenTitle:{},position:{},files:{}},setup(e){return(t,n)=>(A(),u(`section`,{id:`reply`,class:S([`block rounded-lg border border-ok/40 bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,e.position===`first`?`mb-4`:`mt-6`]),"data-position":e.position},[j(`h2`,Q,[n[0]||=j(`span`,null,`Reply`,-1),e.caption.href?(A(),u(`a`,{key:0,class:`caption font-normal normal-case tracking-normal text-dimmed no-underline hover:text-primary hover:underline`,href:e.caption.href,target:`_blank`,rel:`noopener noreferrer`},y(e.caption.text),9,Nt)):(A(),u(`span`,Pt,y(e.caption.text),1)),j(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:e.whenTitle},y(e.when),9,Ft)]),c(K,{text:e.text},null,8,[`text`]),e.files.length>0?(A(),V(st,{key:0,files:e.files},null,8,[`files`])):w(``,!0)],10,Z))}}),Lt={id:`units`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Rt={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},zt={class:`count font-normal normal-case tracking-normal text-dimmed`},Bt={class:`m-0 list-none p-0`},Vt=[`data-unit`],Ht=[`href`],Ut=b({__name:`RunUnitsBlock`,props:{units:{}},setup(e){let t={merged:`border-ok/30 text-ok`,merge_ready:`border-ok/30 text-ok`,done:`border-ok/30 text-ok`};function n(e){return e.ending?Ge(e.ending.kind):e.idle?`idle · ${Ge(e.idle.why)}`:e.threads.coding===void 0?`not started`:`round ${e.rounds.at(-1)?.index??0} · ${e.rounds.at(-1)?.agent??`in flight`}`}return(r,i)=>{let a=ee(`RouterLink`);return A(),u(`section`,Lt,[j(`h2`,Rt,[i[0]||=j(`span`,null,`Units`,-1),j(`span`,zt,`· `+y(e.units.length)+` unit`+y(e.units.length===1?``:`s`)+` — each opens to its runs in round order`,1)]),j(`ol`,Bt,[(A(!0),u(F,null,d(e.units,e=>(A(),u(`li`,{key:e.unit,class:`unit flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 border-t border-default py-1.5 first:border-t-0`,"data-unit":e.unit},[c(a,{class:`key shrink-0 rounded border border-accented px-1.5 font-mono text-[0.72rem] font-medium text-toned no-underline hover:border-primary hover:text-primary`,to:`/runs/unit/${encodeURIComponent(e.unit)}`},{default:D(()=>[P(y(e.id),1)]),_:2},1032,[`to`]),c(a,{class:`title min-w-0 flex-1 truncate text-sm text-highlighted no-underline hover:underline`,to:`/runs/unit/${encodeURIComponent(e.unit)}`},{default:D(()=>[P(y(e.title??e.branch),1)]),_:2},1032,[`to`]),j(`span`,{class:S([`standing shrink-0 rounded border px-1.5 font-mono text-[0.7rem]`,t[e.ending?.kind??``]??`border-accented text-muted`])},y(n(e)),3),e.pr?(A(),u(`a`,{key:0,class:`prlink shrink-0 whitespace-nowrap font-mono text-xs text-primary no-underline hover:underline`,href:e.pr.url,target:`_blank`,rel:`noopener noreferrer`},[c(Ue,{class:`mr-1 align-[-0.125em]`}),P(`#`+y(e.pr.number),1)],8,Ht)):w(``,!0)],8,Vt))),128))])])}}}),Wt={id:`children`,class:`block mb-4 px-(--sb-gutter)`},Gt={class:`mb-1 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Kt={class:`count font-normal normal-case tracking-normal text-dimmed`},qt={class:`m-0 list-none border-t border-muted p-0`},Jt=b({__name:`RunChildrenBlock`,props:{children:{},now:{}},setup(e){return(t,n)=>(A(),u(`section`,Wt,[j(`h2`,Gt,[n[0]||=j(`span`,null,`Spawned runs`,-1),j(`span`,Kt,`· `+y(e.children.length)+` run`+y(e.children.length===1?``:`s`)+`, in the order they started`,1)]),j(`ol`,qt,[(A(!0),u(F,null,d(e.children,t=>(A(),V(G,{key:t.id,run:t,now:e.now},null,8,[`run`,`now`]))),128))])]))}});function Yt(e){return e.description?.title?e.description.title:e.pr.repo&&e.pr.number!==void 0?`${e.pr.repo}#${e.pr.number}`:e.pr.repo??`PR review`}var Xt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Zt=/^[0-9a-f]{7,40}$/;function Qt(e){if(!e.repo||!Xt.test(e.repo))return{};let t=`https://github.com/${e.repo}`,n={};return e.number!==void 0&&Number.isInteger(e.number)&&e.number>0&&(n.pr=`${t}/pull/${e.number}`,n.files=`${t}/pull/${e.number}/files`),e.headSha&&Zt.test(e.headSha)&&(n.commit=e.number!==void 0&&n.pr?`${t}/pull/${e.number}/commits/${e.headSha}`:`${t}/commit/${e.headSha}`),n}function $t(e){return e.find(e=>e.poweredBy===`meat`)??e.find(e=>e.poweredBy===`git`)??null}function en(e){return e===`meat`?`An abridged reading of the change: a model dropped what a reviewer need not read (style, imports, boilerplate) and kept the concepts`:`The complete change, base…head, as git reports it`}function tn(e){return`The recorded diff was cut at ${e.toLocaleString(`en-US`)} characters; open the full diff on GitHub for the rest`}function nn(e){return e===`meat`?`reading diff · meat`:`full diff · git`}function rn(e){let t=[];return e.origin===`parsed`&&!e.complete&&t.push(`read back from the PR body`),e.truncated&&t.push(`the body was cut before it was read`),t.length>0?t.join(`; `):void 0}var an=e=>typeof e==`object`&&!!e,$=e=>typeof e==`string`&&e!==``,on=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;function sn(e){for(let t of e.split(/\n\s*\n/)){let e=t.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e!==``);if(!(e.length===0||e.every(e=>e.startsWith(`#`))))return e.join(`
|
|
4
4
|
`)}}function cn(e,t){let n=t.trim().toLowerCase(),r=[],i=!1,a=!1;for(let t of e.split(`
|
|
5
5
|
`)){/^\s*```/.test(t)&&(i=!i);let e=i?null:/^##\s+(.+?)\s*$/.exec(t);if(e){if(a)break;a=e[1].toLowerCase()===n;continue}a&&r.push(t)}let o=r.join(`
|
|
6
6
|
`).trim();return o===``?void 0:o}function ln(e,t){let n=t.trim().toLowerCase(),r=[],i=!1,a=!1;for(let t of e.split(`
|
|
7
7
|
`)){/^\s*```/.test(t)&&(i=!i);let e=t.trim();if(!i&&a&&e===`<details>`)break;let o=i?null:/^\*\*([^*]+?):?\*\*\s*(.*)$/.exec(e);if(o){let e=o[1].trim().toLowerCase(),t=[`why`,`where to look`,`feedback wanted`,`risk`,`verified`].includes(e);if(a&&t)break;if(e===n){a=!0,o[2]&&r.push(o[2]);continue}}a&&r.push(t)}let o=r.join(`
|
|
8
|
-
`).trim();return o===``?void 0:o}function un(e){if(!$(e.title)||e.origin!==`submitted`&&e.origin!==`parsed`)return;let t=typeof e.body==`string`?e.body:``,n=$(e.tldr)?e.tldr:sn(t),r=$(e.why)?e.why:ln(t,`Why`)??cn(t,`What & why`);return{title:e.title,...n===void 0?{}:{tldr:n},...r===void 0?{}:{why:r},origin:e.origin,complete:e.complete===!0,truncated:e.truncated===!0}}function dn(){let e=be({pr:{},readingDiffs:[],ready:!1});return{state:e,handle(t){if(!an(t))return;let n=t;if(n.type===`run_meta`)$(n.repo)&&(e.pr.repo=n.repo),on(n.pr)&&(e.pr.number=n.pr),typeof n.headSha==`string`&&Zt.test(n.headSha)&&(e.pr.headSha=n.headSha);else if(n.type===`review_artifact`&&n.artifact===`reading_diff`){if(!$(n.diff)||n.poweredBy!==`git`&&n.poweredBy!==`meat`)return;let t={poweredBy:n.poweredBy,baseRef:$(n.baseRef)?n.baseRef:`HEAD`,diff:n.diff,truncated:n.truncated===!0,...$(n.summary)?{summary:n.summary}:{}},r=e.readingDiffs.findIndex(e=>e.poweredBy===t.poweredBy);r>=0?e.readingDiffs.splice(r,1,t):e.readingDiffs.push(t),e.ready=!0}else if(n.type===`review_artifact`&&n.artifact===`pr_description`){let t=un(n);t&&(e.description=t)}}}}var fn=3e3,pn={fetch:(...e)=>globalThis.fetch(...e),delay:e=>new Promise(t=>setTimeout(t,e))};function mn(e,t,n={}){let{fetch:r,delay:i}={...pn,...n},a=be({state:{state:`absent`}}),o=!1,s=!1;async function c(t){let n=await r(`/api/review.abridge`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e,...t?{force:!0}:{}})}),i=await n.json().catch(()=>null);if(!n.ok)throw Error(typeof i?.error==`string`?i.error:`HTTP ${n.status}`);return i??{}}async function l(){let n=!1,i;for(let a=0;a<50;a++){let a=`id=${encodeURIComponent(e)}${i===void 0?``:`&after-seq=${i}`}`,s=await r(`/api/runs.events?${a}`,{credentials:`same-origin`});if(o)return`disposed`;if(!s.ok)throw Error(`HTTP ${s.status}`);let c=await s.json();if(o)return`disposed`;for(let e of c.events??[]){t(e);let r=e;r.type===`review_artifact`&&r.artifact===`reading_diff`&&r.poweredBy===`meat`&&(n=!0)}if(typeof c.nextAfterSeq!=`number`)return n?`found`:`missing`;if(i!==void 0&&c.nextAfterSeq<=i)return`stuck`;i=c.nextAfterSeq}return`stuck`}async function u(e){try{let t=await c(e);for(let e=0;t.state===`running`;e++){if(e>=200){s=!1,a.state={state:`failed`,reason:`still running after the page stopped waiting; ask again later`};return}if(await i(fn),o)return;t=await c(!1)}if(o)return;if(t.state===`failed`)s=!0,a.state={state:`failed`,reason:typeof t.reason==`string`?t.reason:`unknown reason`};else if(t.state===`done`){let e=await l();if(e===`disposed`)return;s=!1,a.state=e===`found`?{state:`done`}:{state:`failed`,reason:e===`stuck`?`the run's record did not page to its end`:`the abridged diff did not appear on the run's record`}}else s=!1,a.state={state:`failed`,reason:`unexpected answer: ${String(t.state)}`}}catch(e){if(o)return;s=!1,a.state={state:`failed`,reason:e instanceof Error?e.message:String(e)}}}return{get state(){return a.state},start(){if(a.state.state===`running`||o)return;let e=a.state.state===`failed`&&s;a.state={state:`running`},u(e)},dispose(){o=!0}}}var hn={slots:{base:`font-medium inline-flex items-center`,label:`truncate`,leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailingIcon:`shrink-0`},variants:{fieldGroup:{horizontal:`not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]`,vertical:`not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},variant:{solid:``,outline:``,soft:``,subtle:``},size:{xs:{base:`text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},sm:{base:`text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},md:{base:`text-xs px-2 py-1 gap-1 rounded-md`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`},lg:{base:`text-sm px-2 py-1 gap-1.5 rounded-md`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`},xl:{base:`text-base px-2.5 py-1 gap-1.5 rounded-md`,leadingIcon:`size-6`,leadingAvatarSize:`2xs`,trailingIcon:`size-6`}},square:{true:``}},compoundVariants:[{color:`primary`,variant:`solid`,class:`bg-primary text-inverted`},{color:`secondary`,variant:`solid`,class:`bg-secondary text-inverted`},{color:`success`,variant:`solid`,class:`bg-success text-inverted`},{color:`info`,variant:`solid`,class:`bg-info text-inverted`},{color:`warning`,variant:`solid`,class:`bg-warning text-inverted`},{color:`error`,variant:`solid`,class:`bg-error text-inverted`},{color:`primary`,variant:`outline`,class:`text-primary ring ring-inset ring-primary/50`},{color:`secondary`,variant:`outline`,class:`text-secondary ring ring-inset ring-secondary/50`},{color:`success`,variant:`outline`,class:`text-success ring ring-inset ring-success/50`},{color:`info`,variant:`outline`,class:`text-info ring ring-inset ring-info/50`},{color:`warning`,variant:`outline`,class:`text-warning ring ring-inset ring-warning/50`},{color:`error`,variant:`outline`,class:`text-error ring ring-inset ring-error/50`},{color:`primary`,variant:`soft`,class:`bg-primary/10 text-primary`},{color:`secondary`,variant:`soft`,class:`bg-secondary/10 text-secondary`},{color:`success`,variant:`soft`,class:`bg-success/10 text-success`},{color:`info`,variant:`soft`,class:`bg-info/10 text-info`},{color:`warning`,variant:`soft`,class:`bg-warning/10 text-warning`},{color:`error`,variant:`soft`,class:`bg-error/10 text-error`},{color:`primary`,variant:`subtle`,class:`bg-primary/10 text-primary ring ring-inset ring-primary/25`},{color:`secondary`,variant:`subtle`,class:`bg-secondary/10 text-secondary ring ring-inset ring-secondary/25`},{color:`success`,variant:`subtle`,class:`bg-success/10 text-success ring ring-inset ring-success/25`},{color:`info`,variant:`subtle`,class:`bg-info/10 text-info ring ring-inset ring-info/25`},{color:`warning`,variant:`subtle`,class:`bg-warning/10 text-warning ring ring-inset ring-warning/25`},{color:`error`,variant:`subtle`,class:`bg-error/10 text-error ring ring-inset ring-error/25`},{color:`neutral`,variant:`solid`,class:`text-inverted bg-inverted`},{color:`neutral`,variant:`outline`,class:`ring ring-inset ring-accented text-default bg-default`},{color:`neutral`,variant:`soft`,class:`text-default bg-elevated`},{color:`neutral`,variant:`subtle`,class:`ring ring-inset ring-accented text-default bg-elevated`},{size:`xs`,square:!0,class:`p-0.5`},{size:`sm`,square:!0,class:`p-1`},{size:`md`,square:!0,class:`p-1`},{size:`lg`,square:!0,class:`p-1`},{size:`xl`,square:!0,class:`p-1`}],defaultVariants:{color:`primary`,variant:`solid`,size:`md`}},gn={__name:`Badge`,props:{as:{type:null,required:!1,default:`span`},label:{type:[String,Number],required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1}},setup(e){let t=e,n=l(),r=C(`badge`,t),i=ge(),{orientation:a,size:o}=ae(t),{isLeading:s,isTrailing:c,leadingIconName:d,trailingIconName:f}=re(r),p=U(()=>te({extend:hn,...i.ui?.badge||{}})({color:r.color,variant:r.variant,size:o.value??r.size,square:r.square||!n.default&&!r.label,fieldGroup:a.value}));return(e,t)=>(A(),V(N(h),{as:N(r).as,"data-slot":`base`,class:S(p.value.base({class:[N(r).ui?.base,N(r).class]}))},{default:D(()=>[R(e.$slots,`leading`,{ui:p.value},()=>[N(s)&&N(d)?(A(),V(H,{key:0,name:N(d),"data-slot":`leadingIcon`,class:S(p.value.leadingIcon({class:N(r).ui?.leadingIcon}))},null,8,[`name`,`class`])):N(r).avatar?(A(),V(k,I({key:1,size:N(r).ui?.leadingAvatarSize||p.value.leadingAvatarSize()},N(r).avatar,{"data-slot":`leadingAvatar`,class:p.value.leadingAvatar({class:N(r).ui?.leadingAvatar})}),null,16,[`size`,`class`])):w(``,!0)]),R(e.$slots,`default`,{ui:p.value},()=>[N(r).label!==void 0&&N(r).label!==null?(A(),u(`span`,{key:0,"data-slot":`label`,class:S(p.value.label({class:N(r).ui?.label}))},y(N(r).label),3)):w(``,!0)]),R(e.$slots,`trailing`,{ui:p.value},()=>[N(c)&&N(f)?(A(),V(H,{key:0,name:N(f),"data-slot":`trailingIcon`,class:S(p.value.trailingIcon({class:N(r).ui?.trailingIcon}))},null,8,[`name`,`class`])):w(``,!0)])]),_:3},8,[`as`,`class`]))}},_n={slots:{root:`flex items-center gap-2`,list:`relative flex p-1 group`,indicator:`absolute transition-[translate,width] duration-200 ease-out motion-reduce:transition-none`,trigger:[`group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75`,`transition-colors`],leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,label:`truncate`,trailingBadge:`shrink-0`,trailingBadgeSize:`sm`,content:`w-full rounded-md focus-visible:outline-3`},variants:{color:{primary:{content:`outline-primary/25`},secondary:{content:`outline-secondary/25`},success:{content:`outline-success/25`},info:{content:`outline-info/25`},warning:{content:`outline-warning/25`},error:{content:`outline-error/25`},neutral:{content:`outline-inverted/25`}},variant:{pill:{list:`bg-elevated rounded-lg`,trigger:[`grow`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate`],indicator:`rounded-md shadow-xs`},link:{list:`border-default`,indicator:`rounded-full`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full`}},orientation:{horizontal:{root:`flex-col`,list:`w-full`,indicator:`left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)`,trigger:`justify-center`},vertical:{list:`flex-col`,indicator:`top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)`}},size:{xs:{trigger:`px-2 py-1 text-xs gap-1`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},sm:{trigger:`px-2.5 py-1.5 text-xs gap-1.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},md:{trigger:`px-3 py-1.5 text-sm gap-1.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},lg:{trigger:`px-3 py-2 text-sm gap-2`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},xl:{trigger:`px-3 py-2 text-base gap-2`,leadingIcon:`size-6`,leadingAvatarSize:`xs`}}},compoundVariants:[{orientation:`horizontal`,variant:`pill`,class:{indicator:`inset-y-1`}},{orientation:`horizontal`,variant:`link`,class:{list:`border-b -mb-px`,indicator:`-bottom-px h-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px`}},{orientation:`vertical`,variant:`pill`,class:{indicator:`inset-x-1`,list:`items-center`,trigger:`w-full justify-center`}},{orientation:`vertical`,variant:`link`,class:{list:`border-s -ms-px`,indicator:`-start-px w-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px`}},{color:`primary`,variant:`pill`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary`]}},{color:`secondary`,variant:`pill`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary`]}},{color:`success`,variant:`pill`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success`]}},{color:`info`,variant:`pill`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info`]}},{color:`warning`,variant:`pill`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning`]}},{color:`error`,variant:`pill`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error`]}},{color:`neutral`,variant:`pill`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted`]}},{color:`primary`,variant:`link`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary`]}},{color:`secondary`,variant:`link`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary`]}},{color:`success`,variant:`link`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-success outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success`]}},{color:`info`,variant:`link`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-info outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info`]}},{color:`warning`,variant:`link`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning`]}},{color:`error`,variant:`link`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-error outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error`]}},{color:`neutral`,variant:`link`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted`]}}],defaultVariants:{color:`primary`,variant:`pill`,size:`md`}},vn={__name:`Tabs`,props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:`horizontal`},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:`value`},labelKey:{type:null,required:!1,default:`label`},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:`0`},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=l(),o=C(`tabs`,r),s=ge(),p=z(f(o,`as`,`unmountOnHide`),i),m=U(()=>te({extend:_n,...s.ui?.tabs||{}})({color:o.color,variant:o.variant,size:o.size,orientation:o.orientation})),h=B([]);function g(e,t){h.value[e]=t}return t({triggersRef:h}),(e,t)=>(A(),V(N(vt),I(N(p),{"model-value":N(o).modelValue,"default-value":N(o).defaultValue,orientation:N(o).orientation,"activation-mode":N(o).activationMode,"data-slot":`root`,class:m.value.root({class:[N(o).ui?.root,N(o).class]})}),{default:D(()=>[c(N(St),{"data-slot":`list`,class:S(m.value.list({class:N(o).ui?.list}))},{default:D(()=>[c(N(xt),{"data-slot":`indicator`,class:S(m.value.indicator({class:N(o).ui?.indicator}))},null,8,[`class`]),R(e.$slots,`list-leading`),(A(!0),u(F,null,d(N(o).items,(t,n)=>(A(),V(N(Ct),{key:N(E)(t,N(o).valueKey)??n,ref_for:!0,ref:e=>g(n,e),value:N(E)(t,N(o).valueKey)??String(n),disabled:t.disabled,"data-slot":`trigger`,class:S(m.value.trigger({class:[N(o).ui?.trigger,t.ui?.trigger]}))},{default:D(()=>[R(e.$slots,`leading`,{item:t,index:n,ui:m.value},()=>[t.icon?(A(),V(H,{key:0,name:t.icon,"data-slot":`leadingIcon`,class:S(m.value.leadingIcon({class:[N(o).ui?.leadingIcon,t.ui?.leadingIcon]}))},null,8,[`name`,`class`])):t.avatar?(A(),V(k,I({key:1,size:t.ui?.leadingAvatarSize||N(o).ui?.leadingAvatarSize||m.value.leadingAvatarSize()},{ref_for:!0},t.avatar,{"data-slot":`leadingAvatar`,class:m.value.leadingAvatar({class:[N(o).ui?.leadingAvatar,t.ui?.leadingAvatar]})}),null,16,[`size`,`class`])):w(``,!0)]),N(E)(t,N(o).labelKey)||a.default?(A(),u(`span`,{key:0,"data-slot":`label`,class:S(m.value.label({class:[N(o).ui?.label,t.ui?.label]}))},[R(e.$slots,`default`,{item:t,index:n},()=>[P(y(N(E)(t,N(o).labelKey)),1)])],2)):w(``,!0),R(e.$slots,`trailing`,{item:t,index:n,ui:m.value},()=>[t.badge||t.badge===0?(A(),V(gn,I({key:0,color:`neutral`,variant:`outline`,size:t.ui?.trailingBadgeSize||N(o).ui?.trailingBadgeSize||m.value.trailingBadgeSize()},{ref_for:!0},typeof t.badge==`string`||typeof t.badge==`number`?{label:t.badge}:t.badge,{"data-slot":`trailingBadge`,class:m.value.trailingBadge({class:[N(o).ui?.trailingBadge,t.ui?.trailingBadge]})}),null,16,[`size`,`class`])):w(``,!0)])]),_:2},1032,[`value`,`disabled`,`class`]))),128)),R(e.$slots,`list-trailing`)]),_:3},8,[`class`]),N(o).content?(A(!0),u(F,{key:0},d(N(o).items,(t,n)=>(A(),V(N(bt),{key:N(E)(t,N(o).valueKey)??n,value:N(E)(t,N(o).valueKey)??String(n),"data-slot":`content`,class:S(m.value.content({class:[N(o).ui?.content,t.ui?.content,t.class]}))},{default:D(()=>[R(e.$slots,t.slot||`content`,{item:t,index:n,ui:m.value},()=>[P(y(t.content),1)])]),_:2},1032,[`value`,`class`]))),128)):w(``,!0)]),_:3},16,[`model-value`,`default-value`,`orientation`,`activation-mode`,`class`]))}},yn;function bn(){return yn??=Oe(()=>import(`./dist-Dg6HTzpQ.js`),__vite__mapDeps([0,1,2,3,4])),yn}var xn={key:0,class:`overflow-x-auto rounded-lg border border-(--ui-border) p-3 font-mono text-xs whitespace-pre text-(--ui-text)`,"data-testid":`diff-raw`},Sn=b({__name:`FileDiffs`,props:{diff:{},theme:{},diffStyle:{}},setup(e){let t=e,n=B(null),r=B(!1),i=[],a=0;function o(){for(let e of i)try{e.cleanUp()}catch{}i=[],n.value&&(n.value.innerHTML=``)}async function s(){let e=++a;r.value=!1;try{let{FileDiff:r,parsePatchFiles:s}=await bn();if(e!==a||!n.value)return;o();let c=s(t.diff).flatMap(e=>e.files);for(let e of c){let a=document.createElement(`diffs-container`);a.dataset.file=e.name,n.value.appendChild(a);let o=new r({themeType:t.theme,diffStyle:t.diffStyle??`unified`});o.render({fileDiff:e,fileContainer:a}),i.push(o)}}catch{e===a&&(r.value=!0)}}return M(s),m(()=>t.diff,s),m(()=>t.theme,s),m(()=>t.diffStyle,s),oe(()=>{a++,o()}),(t,i)=>r.value?(A(),u(`pre`,xn,y(e.diff),1)):(A(),u(`div`,{key:1,ref_key:`container`,ref:n,class:`space-y-4`,"data-testid":`file-diffs`},null,512))}});async function Cn(e){let{parsePatchFiles:t}=await bn(),n=t(e).flatMap(e=>e.files).map(e=>({path:e.name,additions:e.hunks.reduce((e,t)=>e+t.additionLines,0),deletions:e.hunks.reduce((e,t)=>e+t.deletionLines,0)}));return{files:n,additions:n.reduce((e,t)=>e+t.additions,0),deletions:n.reduce((e,t)=>e+t.deletions,0)}}function wn(e,t){if(e.length<=t)return e;let n=Math.max(1,t-1),r=Math.ceil(n/2),i=Math.floor(n/2);return`${e.slice(0,r)}…${e.slice(e.length-i)}`}var Tn={dockerfile:`docker`,makefile:`makefile`,"go.mod":`go`,"go.sum":`go`,".gitignore":`gitignore`,".dockerignore":`dockerignore`},En={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,vue:`vue`,svelte:`svelte`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,scala:`scala`,ex:`elixir`,exs:`elixir`,json:`json`,jsonc:`json`,yaml:`yaml`,yml:`yaml`,toml:`toml`,xml:`xml`,html:`html`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,md:`markdown`,mdx:`mdx`,sh:`bash`,bash:`bash`,zsh:`zsh`,sql:`sql`,tf:`terraform`,hcl:`hcl`,dockerfile:`docker`};function Dn(e){let t=(e.split(`/`).pop()||e).toLowerCase(),n=Tn[t];if(n)return n;let r=t.lastIndexOf(`.`);return r===-1?`text`:En[t.slice(r+1)]??`text`}var On={javascript:`i-simple-icons-javascript`,typescript:`i-simple-icons-typescript`,vue:`i-simple-icons-vuedotjs`,jsx:`i-simple-icons-react`,tsx:`i-simple-icons-react`,svelte:`i-simple-icons-svelte`,html:`i-simple-icons-html5`,css:`i-simple-icons-css`,scss:`i-simple-icons-sass`,sass:`i-simple-icons-sass`,less:`i-simple-icons-less`,python:`i-simple-icons-python`,go:`i-simple-icons-go`,rust:`i-simple-icons-rust`,java:`i-simple-icons-openjdk`,c:`i-simple-icons-c`,cpp:`i-simple-icons-cplusplus`,csharp:`i-simple-icons-csharp`,php:`i-simple-icons-php`,ruby:`i-simple-icons-ruby`,elixir:`i-simple-icons-elixir`,scala:`i-simple-icons-scala`,swift:`i-simple-icons-swift`,kotlin:`i-simple-icons-kotlin`,json:`i-simple-icons-json`,yaml:`i-simple-icons-yaml`,toml:`i-simple-icons-toml`,xml:`i-simple-icons-xml`,sql:`i-lucide-database`,markdown:`i-simple-icons-markdown`,mdx:`i-simple-icons-mdx`,bash:`i-simple-icons-gnubash`,zsh:`i-simple-icons-gnubash`,docker:`i-simple-icons-docker`,dockerignore:`i-simple-icons-docker`,terraform:`i-simple-icons-terraform`,hcl:`i-simple-icons-terraform`,makefile:`i-lucide-hammer`,gitignore:`i-simple-icons-git`,text:`i-lucide-file-text`};function kn(e){return On[e]??On.text}function An(e){return kn(Dn(e))}var jn={key:0,class:`flex items-center gap-2 p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`files-loading`},Mn={key:1,class:`p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`no-files`},Nn={class:`shrink-0 border-b border-(--ui-border) @2xl:w-72 @2xl:border-b-0 @2xl:border-r`,"data-testid":`file-list`},Pn={class:`@2xl:sticky @2xl:top-0 @2xl:max-h-[calc(100dvh-11rem)] @2xl:overflow-y-auto @2xl:py-3`},Fn=[`aria-expanded`],In={class:`ml-auto tabular-nums`,"data-testid":`pr-totals`},Ln={class:`text-(--ui-success)`},Rn={class:`text-(--ui-error)`},zn={key:1,class:`flex items-center justify-between gap-2 px-3 pb-2 text-xs text-(--ui-text-dimmed)`},Bn={"data-testid":`file-count`},Vn={class:`tabular-nums`,"data-testid":`pr-totals`},Hn={class:`text-(--ui-success)`},Un={class:`text-(--ui-error)`},Wn=[`title`,`aria-current`,`onClick`],Gn={class:`min-w-0 flex-1 whitespace-nowrap`},Kn={class:`shrink-0 text-[11px] tabular-nums`},qn={class:`text-(--ui-success)`},Jn={class:`text-(--ui-error)`},Yn=34,Xn=b({__name:`FilesChanged`,props:{diff:{},notes:{},diffStyle:{}},setup(e){let t=e,n=_e(),r=U(()=>n.value===`dark`?`dark`:`light`),i=B([]),a=B(!0),o=B(null),s=T(`panel`),l=T(`root`),{width:f}=ue(l);m(l,e=>{e&&(f.value=e.getBoundingClientRect().width)});let p=U(()=>f.value>0&&f.value<672),h=B(!1),g=U(()=>p.value?`unified`:t.diffStyle??`unified`),_=0;async function v(){let e=++_;a.value=!0;let n=await Cn(t.diff);e===_&&(i.value=n.files,o.value=null,a.value=!1)}m(()=>t.diff,v,{immediate:!0});let b=U(()=>i.value.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}));function x(e){o.value=e,p.value&&(h.value=!1);let t=s.value?.querySelectorAll(`[data-file]`)??[];Array.from(t).find(t=>t.dataset.file===e)?.scrollIntoView({block:`start`,behavior:`smooth`})}return(t,n)=>{let f=H;return a.value?(A(),u(`div`,jn,[c(f,{name:`i-lucide-loader-circle`,class:`size-4 animate-spin`}),n[1]||=j(`span`,null,`Loading diff…`,-1)])):i.value.length===0?(A(),u(`p`,Mn,` Nothing in this diff parsed as a file. `)):(A(),u(`div`,{key:2,ref_key:`root`,ref:l,class:`@container flex min-h-full flex-col @2xl:flex-row`,"data-testid":`files-changed`},[j(`aside`,Nn,[j(`div`,Pn,[p.value?(A(),u(`button`,{key:0,type:`button`,class:`flex w-full items-center gap-2 px-3 py-2.5 text-xs text-(--ui-text-muted)`,"aria-expanded":h.value,"data-testid":`files-fold`,onClick:n[0]||=e=>h.value=!h.value},[c(f,{name:h.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`,class:`size-3.5 shrink-0 text-(--ui-text-dimmed)`},null,8,[`name`]),j(`span`,null,y(i.value.length)+` `+y(i.value.length===1?`file`:`files`)+` changed`,1),j(`span`,In,[j(`span`,Ln,`+`+y(b.value.additions),1),j(`span`,Rn,`−`+y(b.value.deletions),1)])],8,Fn)):(A(),u(`div`,zn,[j(`span`,Bn,y(i.value.length)+` `+y(i.value.length===1?`file`:`files`),1),j(`span`,Vn,[j(`span`,Hn,`+`+y(b.value.additions),1),j(`span`,Un,`−`+y(b.value.deletions),1)])])),!p.value||h.value?(A(),u(`ul`,{key:2,class:S([`flex flex-col`,p.value?`pb-2`:``])},[(A(!0),u(F,null,d(i.value,e=>(A(),u(`li`,{key:e.path},[j(`button`,{type:`button`,class:S([`flex w-full min-w-0 items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors hover:bg-accented/50 dark:hover:bg-(--ui-bg)`,o.value===e.path?`bg-accented/50 text-(--ui-text) dark:bg-(--ui-bg)`:`text-(--ui-text-muted)`]),title:e.path,"aria-current":o.value===e.path?`true`:void 0,"data-testid":`file-entry`,onClick:t=>x(e.path)},[c(f,{name:N(An)(e.path),class:`size-3.5 shrink-0`},null,8,[`name`]),j(`span`,Gn,y(N(wn)(e.path,Yn)),1),j(`span`,Kn,[j(`span`,qn,`+`+y(e.additions),1),j(`span`,Jn,`−`+y(e.deletions),1)])],10,Wn)]))),128))],2)):w(``,!0)])]),j(`div`,{ref_key:`panel`,ref:s,class:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`diff-column`},[(A(!0),u(F,null,d(e.notes,e=>(A(),u(`p`,{key:e,class:`px-3 pt-3 text-xs text-(--ui-text-muted)`,"data-testid":`diff-note`},y(e),1))),128)),c(Sn,{diff:e.diff,theme:r.value,"diff-style":g.value},null,8,[`diff`,`theme`,`diff-style`])],512)],512))}}}),Zn=b({__name:`LabelTip`,props:{text:{},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>{let r=Se;return A(),V(r,{text:e.text,disabled:e.disabled,"delay-duration":250,content:{side:`bottom`,align:`end`,sideOffset:6,collisionPadding:8},ui:{content:`h-auto max-w-[28rem] px-2.5 py-1.5`,text:`text-clip whitespace-normal leading-snug`}},{default:D(()=>[R(t.$slots,`default`)]),_:3},8,[`text`,`disabled`])}}}),Qn={class:`pr-review-panel @container flex h-full min-h-0 min-w-0 flex-col`,"data-testid":`pr-review-panel`},$n={class:`shrink-0 border-b border-(--ui-border) px-4 pt-5 pb-4 sm:px-6`},er={class:`flex flex-col gap-3 @2xl:flex-row @2xl:items-start @2xl:justify-between @2xl:gap-4`},tr={class:`min-w-0`},nr={class:`line-clamp-2 text-lg leading-snug font-semibold text-(--ui-text) @2xl:line-clamp-none @2xl:truncate`,"data-testid":`pr-title`},rr={class:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-(--ui-text-muted)`,"data-testid":`pr-facts`},ir=[`href`],ar={key:1,class:`inline-flex items-center gap-1.5`},or=[`href`],sr={title:`the base the diff is against`},cr={"data-testid":`producer-label`},lr={class:`inline-flex items-center gap-1 text-(--ui-warning)`,"data-testid":`truncated-label`},ur={class:`flex shrink-0 flex-wrap items-center gap-2`},dr={key:1,class:`inline-flex shrink-0 items-center gap-1.5 text-xs text-(--ui-text-muted)`,"data-testid":`abridge-running`},fr={key:2,class:`inline-flex min-w-0 shrink items-center gap-1.5 text-xs text-(--ui-error)`,"data-testid":`abridge-failed`},pr=[`title`],mr={key:0,class:`flex shrink-0 items-center justify-between gap-3 border-b border-(--ui-border) px-4 py-2 sm:px-6`},hr={class:`tabs-scroll min-w-0 overflow-x-auto`},gr={class:`min-h-0 flex-1 overflow-y-auto`},_r={key:1,class:`mx-auto max-w-3xl p-4 sm:p-6`,"data-testid":`pr-description`},vr={key:2,class:`mt-4 text-xs text-(--ui-text-dimmed) italic`,"data-testid":`description-origin`},yr={key:2,class:`px-4 py-3 text-sm text-(--ui-text-muted) sm:px-6`,"data-testid":`no-diff`},br=`switchboard:diffStyle`,xr=`Abridge the full diff with meat.dev: a model keeps the concepts and drops what a reviewer need not read. One model call; usually a minute or three.`,Sr=b({__name:`PrReviewPanel`,props:{data:{},closable:{type:Boolean,default:!1},abridge:{default:void 0}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=U(()=>Qt(n.data.pr)),a=U(()=>Yt(n.data)),o=U(()=>n.data.readingDiffs),s=U(()=>n.data.description),l=U(()=>o.value.find(e=>e.poweredBy===`git`)),d=U(()=>o.value.find(e=>e.poweredBy===`meat`)),f=U(()=>n.data.pr.headSha?.slice(0,7)),p=U(()=>{let e=[];return l.value&&e.push({label:`Files changed`,value:`files`}),d.value&&e.push({label:`Reading diff`,value:`reading`}),(s.value?.tldr||s.value?.why)&&e.push({label:`Description`,value:`description`}),e}),h=()=>$t(o.value)?.poweredBy===`meat`?`reading`:`files`,g=B(h());m(()=>$t(o.value),()=>g.value=h()),m(p,e=>{e.some(e=>e.value===g.value)||(g.value=e[0]?.value??`files`)},{immediate:!0});let _=U(()=>g.value===`files`?l.value:g.value===`reading`?d.value:void 0),v=U(()=>{let e=_.value;if(!e)return[];let t=[];return e.summary&&t.push(e.summary),e.truncated&&t.push(`${tn(e.diff.length)}.`),t}),b=U(()=>s.value?rn(s.value):void 0),x=[{label:`Inline`,value:`unified`,icon:`i-lucide-rows-3`},{label:`Side by side`,value:`split`,icon:`i-lucide-columns-2`}],S=B(`unified`);M(()=>{try{localStorage.getItem(br)===`split`&&(S.value=`split`)}catch{}});function C(e){S.value=e===`split`?`split`:`unified`;try{localStorage.setItem(br,S.value)}catch{}}let ee=U(()=>n.abridge!==void 0&&n.abridge.state.state!==`done`&&l.value!==void 0&&!d.value);return(t,n)=>{let o=H,l=le,d=vn;return A(),u(`div`,Qn,[j(`header`,$n,[j(`div`,er,[j(`div`,tr,[j(`h1`,nr,y(a.value),1),j(`div`,rr,[i.value.pr?(A(),u(`a`,{key:0,href:i.value.pr,target:`_blank`,rel:`noopener noreferrer`,class:`inline-flex items-center gap-1.5 hover:text-(--ui-text)`,"data-testid":`pr-link`},[c(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),j(`span`,null,y(e.data.pr.repo)+`#`+y(e.data.pr.number),1)],8,ir)):e.data.pr.repo?(A(),u(`span`,ar,[c(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),j(`span`,null,y(e.data.pr.repo),1)])):w(``,!0),i.value.commit?(A(),u(`a`,{key:2,href:i.value.commit,target:`_blank`,rel:`noopener noreferrer`,class:`font-mono hover:text-(--ui-text)`,"data-testid":`commit-link`},y(f.value),9,or)):w(``,!0),_.value?(A(),u(F,{key:3},[j(`span`,sr,`against origin/`+y(_.value.baseRef),1),c(Zn,{text:N(en)(_.value.poweredBy)},{default:D(()=>[j(`span`,cr,y(N(nn)(_.value.poweredBy)),1)]),_:1},8,[`text`]),_.value.truncated?(A(),V(Zn,{key:0,text:N(tn)(_.value.diff.length)},{default:D(()=>[j(`span`,lr,[c(o,{name:`i-lucide-scissors`,class:`size-3.5`}),n[4]||=P(`truncated `,-1)])]),_:1},8,[`text`])):w(``,!0)],64)):w(``,!0)])]),j(`div`,ur,[i.value.pr?(A(),V(l,{key:0,label:`View on GitHub`,icon:`i-simple-icons-github`,color:`neutral`,variant:`ghost`,size:`sm`,to:i.value.pr,target:`_blank`,"data-testid":`github-button`},null,8,[`to`])):w(``,!0),ee.value&&e.abridge?(A(),u(F,{key:1},[e.abridge.state.state===`absent`?(A(),V(Zn,{key:0,text:xr},{default:D(()=>[c(l,{label:`Abridge with meat`,icon:`i-lucide-scissors`,size:`sm`,"data-testid":`abridge-button`,onClick:n[0]||=t=>e.abridge.start()})]),_:1})):e.abridge.state.state===`running`?(A(),u(`span`,dr,[c(o,{name:`i-lucide-loader-circle`,class:`size-3.5 animate-spin`}),n[5]||=P(` Abridging… usually 1–3 minutes `,-1)])):e.abridge.state.state===`failed`?(A(),u(`span`,fr,[c(o,{name:`i-lucide-circle-alert`,class:`size-3.5 shrink-0`}),j(`span`,{class:`truncate`,title:e.abridge.state.reason},`Abridging failed: `+y(e.abridge.state.reason),9,pr),c(l,{size:`xs`,color:`neutral`,variant:`outline`,label:`Retry`,"data-testid":`abridge-retry`,onClick:n[1]||=t=>e.abridge.start()})])):w(``,!0)],64)):w(``,!0),e.closable?(A(),V(l,{key:2,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,"aria-label":`Close`,"data-testid":`panel-close`,onClick:n[2]||=e=>r(`close`)})):w(``,!0)])])]),p.value.length>0?(A(),u(`div`,mr,[j(`div`,hr,[c(d,{modelValue:g.value,"onUpdate:modelValue":n[3]||=e=>g.value=e,items:p.value,size:`sm`,class:`w-fit gap-0`,content:!1,"data-testid":`panel-tabs`},null,8,[`modelValue`,`items`])]),_.value?(A(),V(d,{key:0,"model-value":S.value,items:x,color:`neutral`,size:`xs`,content:!1,class:`hidden w-fit @2xl:flex`,"data-testid":`diff-style`,"onUpdate:modelValue":C},null,8,[`model-value`])):w(``,!0)])):w(``,!0),j(`div`,gr,[_.value?(A(),V(Xn,{key:_.value.poweredBy,diff:_.value.diff,notes:v.value,"diff-style":S.value},null,8,[`diff`,`notes`,`diff-style`])):g.value===`description`&&s.value?(A(),u(`div`,_r,[n[7]||=j(`div`,{class:`mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`What the pull request says about itself`,-1),s.value.tldr?(A(),V(K,{key:0,text:s.value.tldr,class:`text-sm`,"data-testid":`description-tldr`},null,8,[`text`])):w(``,!0),s.value.why?(A(),u(F,{key:1},[n[6]||=j(`div`,{class:`mt-4 mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`Why`,-1),c(K,{text:s.value.why,class:`text-sm`,"data-testid":`description-why`},null,8,[`text`])],64)):w(``,!0),b.value?(A(),u(`p`,vr,y(b.value),1)):w(``,!0)])):(A(),u(`p`,yr,` No reading diff was produced for this review. `))])])}}}),Cr={class:`conn flex items-center gap-2 font-mono`},wr={key:0,class:`ok text-ok`,role:`img`,"aria-label":`succeeded`},Tr=[`data-heat`],Er=[`title`],Dr={key:3,id:`delivery`,class:`text-xs text-muted`},Or=[`title`],kr={key:0,id:`actions`,class:`actions flex gap-1.5`},Ar={class:`mx-auto max-w-6xl`},jr={key:0,id:`lineage`,class:`lineage facts mb-2 flex flex-wrap items-baseline gap-x-3 gap-y-1 px-(--sb-gutter) font-mono text-xs text-dimmed`},Mr={key:2,class:`threadkind`},Nr={key:1,id:`runmeta`,class:`runmeta facts mb-3 flex flex-wrap items-baseline gap-x-3 gap-y-1.5 px-(--sb-gutter) font-mono text-xs text-dimmed`},Pr={class:`agent text-[0.68rem] font-medium uppercase tracking-wider text-toned`},Fr={class:`model`},Ir={key:0,class:`effort`},Lr={key:1,class:`harness`},Rr=[`href`],zr={key:3,class:`repo`},Br=[`href`],Vr={key:5,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned`},Hr=[`href`,`title`],Ur=[`href`],Wr={key:2,id:`request`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Gr={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Kr={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},qr=[`href`],Jr={key:1},Yr={key:1},Xr=[`href`],Zr=[`title`],Qr={key:6,id:`references`,class:`group mb-4 px-(--sb-gutter)`},$r={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},ei={class:`count font-normal normal-case tracking-normal text-dimmed`},ti={id:`referencedthreads`,class:`pb-1 pl-5`},ni={class:`flex items-baseline gap-2 font-mono text-xs text-dimmed`},ri=[`href`],ii=[`title`],ai={class:`quoted mt-1 whitespace-pre-wrap break-words font-mono text-xs opacity-85`},oi={key:7,id:`context`,class:`group mb-4 px-(--sb-gutter)`},si={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},ci={class:`count font-normal normal-case tracking-normal text-dimmed`},li={id:`contextturns`,class:`pb-1 pl-5`},ui=[`title`],di={id:`thisrun`,class:`mb-2 flex items-baseline gap-2.5 px-(--sb-gutter) font-mono text-xs font-medium uppercase tracking-wider text-muted`},fi={key:0,class:`count font-normal normal-case tracking-normal text-dimmed`},pi=[`aria-pressed`,`data-open`,`title`],mi={id:`log`,class:`m-0 list-none p-0`},hi={key:0,id:`placeholder`,class:`empty text-muted`},gi=[`id`],_i={class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 pr-(--sb-gutter) font-mono text-xs tabular-nums text-dimmed`},vi=[`title`],yi=[`title`],bi=[`title`],xi=[`href`],Si={key:3,class:`nonar font-sans italic`},Ci=[`title`],wi=[`data-phase`],Ti=[`aria-expanded`,`onClick`],Ei={class:`glyph select-none text-dimmed`},Di={class:`what`},Oi={key:0,class:`m-0 list-none p-0 pl-4`},ki={key:4,class:`followup block mt-5 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Ai={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},ji={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},Mi=[`href`],Ni={key:1},Pi=[`title`],Fi={key:5,class:`mt-5`},Ii=[`open`],Li={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},Ri={key:0,class:`font-normal normal-case tracking-normal text-dimmed`},zi=[`title`],Bi=[`title`],Vi=b({__name:`RunPage`,setup(e){let t=fe(`run`),n=t?.mode===`history`,r=n?`Run`:`Live run`,i=n,o=t?.artifacts??null,s=t?.children??[],l=(t?.mode===`history`?t.units:void 0)??[],f=t?.mode===`history`?t.findingsLedger:void 0,p=U(()=>f?`/runs/unit/${encodeURIComponent(f.unit)}#findings`:void 0),h=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,_=$e({openTags:h?h.split(`,`).map(e=>e.trim()).filter(Boolean):void 0});t?.mode===`live`&&_.seedClock(t.serverNow);let v=_.state,b=B(n?`ended`:`connecting`),x=B(``),C=je(),T=t?.mode===`live`?ct(t,C.value):null,E=B(void 0),O=B({}),k=U(()=>{if(n&&t?.mode===`history`)return t.queued?{ok:!1,cls:`amber`,word:t.queued.state===`waiting`?`queued at position ${t.queued.position} — waiting on ${t.queued.waiting}`:t.queued.state}:t.status===`completed`?{ok:!0,cls:``,word:`succeeded`}:t.provisional?{ok:!1,cls:`amber`,word:Pe}:{ok:!1,cls:t.status===`failed`||t.status===`stopped_hard`||t.status===`interrupted`?`red`:t.status===`stopped_soft`?`amber`:`grey`,word:t.status?Ne(t.status):`ended`};let e=v.stopMode;return{ok:!1,cls:e===`hard`?`red`:e===`soft`?`amber`:`grey`,word:e===`hard`?`killed`:e===`soft`?`stopped early`:`ended`}}),te=U(()=>n&&t?.mode===`history`?t.durationMs:E.value),ne=U(()=>it(n&&t?.mode===`history`?{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk}:O.value)),re=U(()=>te.value===void 0?``:Fe(te.value,`clock`)),ie=U(()=>n&&t?.mode===`history`?t.cost:void 0),ae=e=>e===null?`unpriced`:ze(e),se=U(()=>ie.value?ae(ie.value.usd):``),ue=U(()=>ie.value?Object.entries(ie.value.byModel).map(([e,t])=>`${e} ${ae(t.usd)}`).join(`
|
|
8
|
+
`).trim();return o===``?void 0:o}function un(e){if(!$(e.title)||e.origin!==`submitted`&&e.origin!==`parsed`)return;let t=typeof e.body==`string`?e.body:``,n=$(e.tldr)?e.tldr:sn(t),r=$(e.why)?e.why:ln(t,`Why`)??cn(t,`What & why`);return{title:e.title,...n===void 0?{}:{tldr:n},...r===void 0?{}:{why:r},origin:e.origin,complete:e.complete===!0,truncated:e.truncated===!0}}function dn(){let e=be({pr:{},readingDiffs:[],ready:!1});return{state:e,handle(t){if(!an(t))return;let n=t;if(n.type===`run_meta`)$(n.repo)&&(e.pr.repo=n.repo),on(n.pr)&&(e.pr.number=n.pr),typeof n.headSha==`string`&&Zt.test(n.headSha)&&(e.pr.headSha=n.headSha);else if(n.type===`review_artifact`&&n.artifact===`reading_diff`){if(!$(n.diff)||n.poweredBy!==`git`&&n.poweredBy!==`meat`)return;let t={poweredBy:n.poweredBy,baseRef:$(n.baseRef)?n.baseRef:`HEAD`,diff:n.diff,truncated:n.truncated===!0,...$(n.summary)?{summary:n.summary}:{}},r=e.readingDiffs.findIndex(e=>e.poweredBy===t.poweredBy);r>=0?e.readingDiffs.splice(r,1,t):e.readingDiffs.push(t),e.ready=!0}else if(n.type===`review_artifact`&&n.artifact===`pr_description`){let t=un(n);t&&(e.description=t)}}}}var fn=3e3,pn={fetch:(...e)=>globalThis.fetch(...e),delay:e=>new Promise(t=>setTimeout(t,e))};function mn(e,t,n={}){let{fetch:r,delay:i}={...pn,...n},a=be({state:{state:`absent`}}),o=!1,s=!1;async function c(t){let n=await r(`/api/review.abridge`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e,...t?{force:!0}:{}})}),i=await n.json().catch(()=>null);if(!n.ok)throw Error(typeof i?.error==`string`?i.error:`HTTP ${n.status}`);return i??{}}async function l(){let n=!1,i;for(let a=0;a<50;a++){let a=`id=${encodeURIComponent(e)}${i===void 0?``:`&after-seq=${i}`}`,s=await r(`/api/runs.events?${a}`,{credentials:`same-origin`});if(o)return`disposed`;if(!s.ok)throw Error(`HTTP ${s.status}`);let c=await s.json();if(o)return`disposed`;for(let e of c.events??[]){t(e);let r=e;r.type===`review_artifact`&&r.artifact===`reading_diff`&&r.poweredBy===`meat`&&(n=!0)}if(typeof c.nextAfterSeq!=`number`)return n?`found`:`missing`;if(i!==void 0&&c.nextAfterSeq<=i)return`stuck`;i=c.nextAfterSeq}return`stuck`}async function u(e){try{let t=await c(e);for(let e=0;t.state===`running`;e++){if(e>=200){s=!1,a.state={state:`failed`,reason:`still running after the page stopped waiting; ask again later`};return}if(await i(fn),o)return;t=await c(!1)}if(o)return;if(t.state===`failed`)s=!0,a.state={state:`failed`,reason:typeof t.reason==`string`?t.reason:`unknown reason`};else if(t.state===`done`){let e=await l();if(e===`disposed`)return;s=!1,a.state=e===`found`?{state:`done`}:{state:`failed`,reason:e===`stuck`?`the run's record did not page to its end`:`the abridged diff did not appear on the run's record`}}else s=!1,a.state={state:`failed`,reason:`unexpected answer: ${String(t.state)}`}}catch(e){if(o)return;s=!1,a.state={state:`failed`,reason:e instanceof Error?e.message:String(e)}}}return{get state(){return a.state},start(){if(a.state.state===`running`||o)return;let e=a.state.state===`failed`&&s;a.state={state:`running`},u(e)},dispose(){o=!0}}}var hn={slots:{base:`font-medium inline-flex items-center`,label:`truncate`,leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailingIcon:`shrink-0`},variants:{fieldGroup:{horizontal:`not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]`,vertical:`not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},variant:{solid:``,outline:``,soft:``,subtle:``},size:{xs:{base:`text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},sm:{base:`text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},md:{base:`text-xs px-2 py-1 gap-1 rounded-md`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`},lg:{base:`text-sm px-2 py-1 gap-1.5 rounded-md`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`},xl:{base:`text-base px-2.5 py-1 gap-1.5 rounded-md`,leadingIcon:`size-6`,leadingAvatarSize:`2xs`,trailingIcon:`size-6`}},square:{true:``}},compoundVariants:[{color:`primary`,variant:`solid`,class:`bg-primary text-inverted`},{color:`secondary`,variant:`solid`,class:`bg-secondary text-inverted`},{color:`success`,variant:`solid`,class:`bg-success text-inverted`},{color:`info`,variant:`solid`,class:`bg-info text-inverted`},{color:`warning`,variant:`solid`,class:`bg-warning text-inverted`},{color:`error`,variant:`solid`,class:`bg-error text-inverted`},{color:`primary`,variant:`outline`,class:`text-primary ring ring-inset ring-primary/50`},{color:`secondary`,variant:`outline`,class:`text-secondary ring ring-inset ring-secondary/50`},{color:`success`,variant:`outline`,class:`text-success ring ring-inset ring-success/50`},{color:`info`,variant:`outline`,class:`text-info ring ring-inset ring-info/50`},{color:`warning`,variant:`outline`,class:`text-warning ring ring-inset ring-warning/50`},{color:`error`,variant:`outline`,class:`text-error ring ring-inset ring-error/50`},{color:`primary`,variant:`soft`,class:`bg-primary/10 text-primary`},{color:`secondary`,variant:`soft`,class:`bg-secondary/10 text-secondary`},{color:`success`,variant:`soft`,class:`bg-success/10 text-success`},{color:`info`,variant:`soft`,class:`bg-info/10 text-info`},{color:`warning`,variant:`soft`,class:`bg-warning/10 text-warning`},{color:`error`,variant:`soft`,class:`bg-error/10 text-error`},{color:`primary`,variant:`subtle`,class:`bg-primary/10 text-primary ring ring-inset ring-primary/25`},{color:`secondary`,variant:`subtle`,class:`bg-secondary/10 text-secondary ring ring-inset ring-secondary/25`},{color:`success`,variant:`subtle`,class:`bg-success/10 text-success ring ring-inset ring-success/25`},{color:`info`,variant:`subtle`,class:`bg-info/10 text-info ring ring-inset ring-info/25`},{color:`warning`,variant:`subtle`,class:`bg-warning/10 text-warning ring ring-inset ring-warning/25`},{color:`error`,variant:`subtle`,class:`bg-error/10 text-error ring ring-inset ring-error/25`},{color:`neutral`,variant:`solid`,class:`text-inverted bg-inverted`},{color:`neutral`,variant:`outline`,class:`ring ring-inset ring-accented text-default bg-default`},{color:`neutral`,variant:`soft`,class:`text-default bg-elevated`},{color:`neutral`,variant:`subtle`,class:`ring ring-inset ring-accented text-default bg-elevated`},{size:`xs`,square:!0,class:`p-0.5`},{size:`sm`,square:!0,class:`p-1`},{size:`md`,square:!0,class:`p-1`},{size:`lg`,square:!0,class:`p-1`},{size:`xl`,square:!0,class:`p-1`}],defaultVariants:{color:`primary`,variant:`solid`,size:`md`}},gn={__name:`Badge`,props:{as:{type:null,required:!1,default:`span`},label:{type:[String,Number],required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1}},setup(e){let t=e,n=l(),r=C(`badge`,t),i=ge(),{orientation:a,size:o}=ae(t),{isLeading:s,isTrailing:c,leadingIconName:d,trailingIconName:f}=re(r),p=U(()=>te({extend:hn,...i.ui?.badge||{}})({color:r.color,variant:r.variant,size:o.value??r.size,square:r.square||!n.default&&!r.label,fieldGroup:a.value}));return(e,t)=>(A(),V(N(h),{as:N(r).as,"data-slot":`base`,class:S(p.value.base({class:[N(r).ui?.base,N(r).class]}))},{default:D(()=>[R(e.$slots,`leading`,{ui:p.value},()=>[N(s)&&N(d)?(A(),V(H,{key:0,name:N(d),"data-slot":`leadingIcon`,class:S(p.value.leadingIcon({class:N(r).ui?.leadingIcon}))},null,8,[`name`,`class`])):N(r).avatar?(A(),V(k,I({key:1,size:N(r).ui?.leadingAvatarSize||p.value.leadingAvatarSize()},N(r).avatar,{"data-slot":`leadingAvatar`,class:p.value.leadingAvatar({class:N(r).ui?.leadingAvatar})}),null,16,[`size`,`class`])):w(``,!0)]),R(e.$slots,`default`,{ui:p.value},()=>[N(r).label!==void 0&&N(r).label!==null?(A(),u(`span`,{key:0,"data-slot":`label`,class:S(p.value.label({class:N(r).ui?.label}))},y(N(r).label),3)):w(``,!0)]),R(e.$slots,`trailing`,{ui:p.value},()=>[N(c)&&N(f)?(A(),V(H,{key:0,name:N(f),"data-slot":`trailingIcon`,class:S(p.value.trailingIcon({class:N(r).ui?.trailingIcon}))},null,8,[`name`,`class`])):w(``,!0)])]),_:3},8,[`as`,`class`]))}},_n={slots:{root:`flex items-center gap-2`,list:`relative flex p-1 group`,indicator:`absolute transition-[translate,width] duration-200 ease-out motion-reduce:transition-none`,trigger:[`group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75`,`transition-colors`],leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,label:`truncate`,trailingBadge:`shrink-0`,trailingBadgeSize:`sm`,content:`w-full rounded-md focus-visible:outline-3`},variants:{color:{primary:{content:`outline-primary/25`},secondary:{content:`outline-secondary/25`},success:{content:`outline-success/25`},info:{content:`outline-info/25`},warning:{content:`outline-warning/25`},error:{content:`outline-error/25`},neutral:{content:`outline-inverted/25`}},variant:{pill:{list:`bg-elevated rounded-lg`,trigger:[`grow`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate`],indicator:`rounded-md shadow-xs`},link:{list:`border-default`,indicator:`rounded-full`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full`}},orientation:{horizontal:{root:`flex-col`,list:`w-full`,indicator:`left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)`,trigger:`justify-center`},vertical:{list:`flex-col`,indicator:`top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)`}},size:{xs:{trigger:`px-2 py-1 text-xs gap-1`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},sm:{trigger:`px-2.5 py-1.5 text-xs gap-1.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},md:{trigger:`px-3 py-1.5 text-sm gap-1.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},lg:{trigger:`px-3 py-2 text-sm gap-2`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},xl:{trigger:`px-3 py-2 text-base gap-2`,leadingIcon:`size-6`,leadingAvatarSize:`xs`}}},compoundVariants:[{orientation:`horizontal`,variant:`pill`,class:{indicator:`inset-y-1`}},{orientation:`horizontal`,variant:`link`,class:{list:`border-b -mb-px`,indicator:`-bottom-px h-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px`}},{orientation:`vertical`,variant:`pill`,class:{indicator:`inset-x-1`,list:`items-center`,trigger:`w-full justify-center`}},{orientation:`vertical`,variant:`link`,class:{list:`border-s -ms-px`,indicator:`-start-px w-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px`}},{color:`primary`,variant:`pill`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary`]}},{color:`secondary`,variant:`pill`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary`]}},{color:`success`,variant:`pill`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success`]}},{color:`info`,variant:`pill`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info`]}},{color:`warning`,variant:`pill`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning`]}},{color:`error`,variant:`pill`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error`]}},{color:`neutral`,variant:`pill`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted`]}},{color:`primary`,variant:`link`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary`]}},{color:`secondary`,variant:`link`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary`]}},{color:`success`,variant:`link`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-success outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success`]}},{color:`info`,variant:`link`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-info outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info`]}},{color:`warning`,variant:`link`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning`]}},{color:`error`,variant:`link`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-error outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error`]}},{color:`neutral`,variant:`link`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted`]}}],defaultVariants:{color:`primary`,variant:`pill`,size:`md`}},vn={__name:`Tabs`,props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:`horizontal`},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:`value`},labelKey:{type:null,required:!1,default:`label`},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:`0`},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=l(),o=C(`tabs`,r),s=ge(),p=z(f(o,`as`,`unmountOnHide`),i),m=U(()=>te({extend:_n,...s.ui?.tabs||{}})({color:o.color,variant:o.variant,size:o.size,orientation:o.orientation})),h=B([]);function g(e,t){h.value[e]=t}return t({triggersRef:h}),(e,t)=>(A(),V(N(vt),I(N(p),{"model-value":N(o).modelValue,"default-value":N(o).defaultValue,orientation:N(o).orientation,"activation-mode":N(o).activationMode,"data-slot":`root`,class:m.value.root({class:[N(o).ui?.root,N(o).class]})}),{default:D(()=>[c(N(St),{"data-slot":`list`,class:S(m.value.list({class:N(o).ui?.list}))},{default:D(()=>[c(N(xt),{"data-slot":`indicator`,class:S(m.value.indicator({class:N(o).ui?.indicator}))},null,8,[`class`]),R(e.$slots,`list-leading`),(A(!0),u(F,null,d(N(o).items,(t,n)=>(A(),V(N(Ct),{key:N(E)(t,N(o).valueKey)??n,ref_for:!0,ref:e=>g(n,e),value:N(E)(t,N(o).valueKey)??String(n),disabled:t.disabled,"data-slot":`trigger`,class:S(m.value.trigger({class:[N(o).ui?.trigger,t.ui?.trigger]}))},{default:D(()=>[R(e.$slots,`leading`,{item:t,index:n,ui:m.value},()=>[t.icon?(A(),V(H,{key:0,name:t.icon,"data-slot":`leadingIcon`,class:S(m.value.leadingIcon({class:[N(o).ui?.leadingIcon,t.ui?.leadingIcon]}))},null,8,[`name`,`class`])):t.avatar?(A(),V(k,I({key:1,size:t.ui?.leadingAvatarSize||N(o).ui?.leadingAvatarSize||m.value.leadingAvatarSize()},{ref_for:!0},t.avatar,{"data-slot":`leadingAvatar`,class:m.value.leadingAvatar({class:[N(o).ui?.leadingAvatar,t.ui?.leadingAvatar]})}),null,16,[`size`,`class`])):w(``,!0)]),N(E)(t,N(o).labelKey)||a.default?(A(),u(`span`,{key:0,"data-slot":`label`,class:S(m.value.label({class:[N(o).ui?.label,t.ui?.label]}))},[R(e.$slots,`default`,{item:t,index:n},()=>[P(y(N(E)(t,N(o).labelKey)),1)])],2)):w(``,!0),R(e.$slots,`trailing`,{item:t,index:n,ui:m.value},()=>[t.badge||t.badge===0?(A(),V(gn,I({key:0,color:`neutral`,variant:`outline`,size:t.ui?.trailingBadgeSize||N(o).ui?.trailingBadgeSize||m.value.trailingBadgeSize()},{ref_for:!0},typeof t.badge==`string`||typeof t.badge==`number`?{label:t.badge}:t.badge,{"data-slot":`trailingBadge`,class:m.value.trailingBadge({class:[N(o).ui?.trailingBadge,t.ui?.trailingBadge]})}),null,16,[`size`,`class`])):w(``,!0)])]),_:2},1032,[`value`,`disabled`,`class`]))),128)),R(e.$slots,`list-trailing`)]),_:3},8,[`class`]),N(o).content?(A(!0),u(F,{key:0},d(N(o).items,(t,n)=>(A(),V(N(bt),{key:N(E)(t,N(o).valueKey)??n,value:N(E)(t,N(o).valueKey)??String(n),"data-slot":`content`,class:S(m.value.content({class:[N(o).ui?.content,t.ui?.content,t.class]}))},{default:D(()=>[R(e.$slots,t.slot||`content`,{item:t,index:n,ui:m.value},()=>[P(y(t.content),1)])]),_:2},1032,[`value`,`class`]))),128)):w(``,!0)]),_:3},16,[`model-value`,`default-value`,`orientation`,`activation-mode`,`class`]))}},yn;function bn(){return yn??=Oe(()=>import(`./dist-v3Py3_QR.js`),__vite__mapDeps([0,1,2,3,4])),yn}var xn={key:0,class:`overflow-x-auto rounded-lg border border-(--ui-border) p-3 font-mono text-xs whitespace-pre text-(--ui-text)`,"data-testid":`diff-raw`},Sn=b({__name:`FileDiffs`,props:{diff:{},theme:{},diffStyle:{}},setup(e){let t=e,n=B(null),r=B(!1),i=[],a=0;function o(){for(let e of i)try{e.cleanUp()}catch{}i=[],n.value&&(n.value.innerHTML=``)}async function s(){let e=++a;r.value=!1;try{let{FileDiff:r,parsePatchFiles:s}=await bn();if(e!==a||!n.value)return;o();let c=s(t.diff).flatMap(e=>e.files);for(let e of c){let a=document.createElement(`diffs-container`);a.dataset.file=e.name,n.value.appendChild(a);let o=new r({themeType:t.theme,diffStyle:t.diffStyle??`unified`});o.render({fileDiff:e,fileContainer:a}),i.push(o)}}catch{e===a&&(r.value=!0)}}return M(s),m(()=>t.diff,s),m(()=>t.theme,s),m(()=>t.diffStyle,s),oe(()=>{a++,o()}),(t,i)=>r.value?(A(),u(`pre`,xn,y(e.diff),1)):(A(),u(`div`,{key:1,ref_key:`container`,ref:n,class:`space-y-4`,"data-testid":`file-diffs`},null,512))}});async function Cn(e){let{parsePatchFiles:t}=await bn(),n=t(e).flatMap(e=>e.files).map(e=>({path:e.name,additions:e.hunks.reduce((e,t)=>e+t.additionLines,0),deletions:e.hunks.reduce((e,t)=>e+t.deletionLines,0)}));return{files:n,additions:n.reduce((e,t)=>e+t.additions,0),deletions:n.reduce((e,t)=>e+t.deletions,0)}}function wn(e,t){if(e.length<=t)return e;let n=Math.max(1,t-1),r=Math.ceil(n/2),i=Math.floor(n/2);return`${e.slice(0,r)}…${e.slice(e.length-i)}`}var Tn={dockerfile:`docker`,makefile:`makefile`,"go.mod":`go`,"go.sum":`go`,".gitignore":`gitignore`,".dockerignore":`dockerignore`},En={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,vue:`vue`,svelte:`svelte`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,scala:`scala`,ex:`elixir`,exs:`elixir`,json:`json`,jsonc:`json`,yaml:`yaml`,yml:`yaml`,toml:`toml`,xml:`xml`,html:`html`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,md:`markdown`,mdx:`mdx`,sh:`bash`,bash:`bash`,zsh:`zsh`,sql:`sql`,tf:`terraform`,hcl:`hcl`,dockerfile:`docker`};function Dn(e){let t=(e.split(`/`).pop()||e).toLowerCase(),n=Tn[t];if(n)return n;let r=t.lastIndexOf(`.`);return r===-1?`text`:En[t.slice(r+1)]??`text`}var On={javascript:`i-simple-icons-javascript`,typescript:`i-simple-icons-typescript`,vue:`i-simple-icons-vuedotjs`,jsx:`i-simple-icons-react`,tsx:`i-simple-icons-react`,svelte:`i-simple-icons-svelte`,html:`i-simple-icons-html5`,css:`i-simple-icons-css`,scss:`i-simple-icons-sass`,sass:`i-simple-icons-sass`,less:`i-simple-icons-less`,python:`i-simple-icons-python`,go:`i-simple-icons-go`,rust:`i-simple-icons-rust`,java:`i-simple-icons-openjdk`,c:`i-simple-icons-c`,cpp:`i-simple-icons-cplusplus`,csharp:`i-simple-icons-csharp`,php:`i-simple-icons-php`,ruby:`i-simple-icons-ruby`,elixir:`i-simple-icons-elixir`,scala:`i-simple-icons-scala`,swift:`i-simple-icons-swift`,kotlin:`i-simple-icons-kotlin`,json:`i-simple-icons-json`,yaml:`i-simple-icons-yaml`,toml:`i-simple-icons-toml`,xml:`i-simple-icons-xml`,sql:`i-lucide-database`,markdown:`i-simple-icons-markdown`,mdx:`i-simple-icons-mdx`,bash:`i-simple-icons-gnubash`,zsh:`i-simple-icons-gnubash`,docker:`i-simple-icons-docker`,dockerignore:`i-simple-icons-docker`,terraform:`i-simple-icons-terraform`,hcl:`i-simple-icons-terraform`,makefile:`i-lucide-hammer`,gitignore:`i-simple-icons-git`,text:`i-lucide-file-text`};function kn(e){return On[e]??On.text}function An(e){return kn(Dn(e))}var jn={key:0,class:`flex items-center gap-2 p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`files-loading`},Mn={key:1,class:`p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`no-files`},Nn={class:`shrink-0 border-b border-(--ui-border) @2xl:w-72 @2xl:border-b-0 @2xl:border-r`,"data-testid":`file-list`},Pn={class:`@2xl:sticky @2xl:top-0 @2xl:max-h-[calc(100dvh-11rem)] @2xl:overflow-y-auto @2xl:py-3`},Fn=[`aria-expanded`],In={class:`ml-auto tabular-nums`,"data-testid":`pr-totals`},Ln={class:`text-(--ui-success)`},Rn={class:`text-(--ui-error)`},zn={key:1,class:`flex items-center justify-between gap-2 px-3 pb-2 text-xs text-(--ui-text-dimmed)`},Bn={"data-testid":`file-count`},Vn={class:`tabular-nums`,"data-testid":`pr-totals`},Hn={class:`text-(--ui-success)`},Un={class:`text-(--ui-error)`},Wn=[`title`,`aria-current`,`onClick`],Gn={class:`min-w-0 flex-1 whitespace-nowrap`},Kn={class:`shrink-0 text-[11px] tabular-nums`},qn={class:`text-(--ui-success)`},Jn={class:`text-(--ui-error)`},Yn=34,Xn=b({__name:`FilesChanged`,props:{diff:{},notes:{},diffStyle:{}},setup(e){let t=e,n=_e(),r=U(()=>n.value===`dark`?`dark`:`light`),i=B([]),a=B(!0),o=B(null),s=T(`panel`),l=T(`root`),{width:f}=ue(l);m(l,e=>{e&&(f.value=e.getBoundingClientRect().width)});let p=U(()=>f.value>0&&f.value<672),h=B(!1),g=U(()=>p.value?`unified`:t.diffStyle??`unified`),_=0;async function v(){let e=++_;a.value=!0;let n=await Cn(t.diff);e===_&&(i.value=n.files,o.value=null,a.value=!1)}m(()=>t.diff,v,{immediate:!0});let b=U(()=>i.value.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}));function x(e){o.value=e,p.value&&(h.value=!1);let t=s.value?.querySelectorAll(`[data-file]`)??[];Array.from(t).find(t=>t.dataset.file===e)?.scrollIntoView({block:`start`,behavior:`smooth`})}return(t,n)=>{let f=H;return a.value?(A(),u(`div`,jn,[c(f,{name:`i-lucide-loader-circle`,class:`size-4 animate-spin`}),n[1]||=j(`span`,null,`Loading diff…`,-1)])):i.value.length===0?(A(),u(`p`,Mn,` Nothing in this diff parsed as a file. `)):(A(),u(`div`,{key:2,ref_key:`root`,ref:l,class:`@container flex min-h-full flex-col @2xl:flex-row`,"data-testid":`files-changed`},[j(`aside`,Nn,[j(`div`,Pn,[p.value?(A(),u(`button`,{key:0,type:`button`,class:`flex w-full items-center gap-2 px-3 py-2.5 text-xs text-(--ui-text-muted)`,"aria-expanded":h.value,"data-testid":`files-fold`,onClick:n[0]||=e=>h.value=!h.value},[c(f,{name:h.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`,class:`size-3.5 shrink-0 text-(--ui-text-dimmed)`},null,8,[`name`]),j(`span`,null,y(i.value.length)+` `+y(i.value.length===1?`file`:`files`)+` changed`,1),j(`span`,In,[j(`span`,Ln,`+`+y(b.value.additions),1),j(`span`,Rn,`−`+y(b.value.deletions),1)])],8,Fn)):(A(),u(`div`,zn,[j(`span`,Bn,y(i.value.length)+` `+y(i.value.length===1?`file`:`files`),1),j(`span`,Vn,[j(`span`,Hn,`+`+y(b.value.additions),1),j(`span`,Un,`−`+y(b.value.deletions),1)])])),!p.value||h.value?(A(),u(`ul`,{key:2,class:S([`flex flex-col`,p.value?`pb-2`:``])},[(A(!0),u(F,null,d(i.value,e=>(A(),u(`li`,{key:e.path},[j(`button`,{type:`button`,class:S([`flex w-full min-w-0 items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors hover:bg-accented/50 dark:hover:bg-(--ui-bg)`,o.value===e.path?`bg-accented/50 text-(--ui-text) dark:bg-(--ui-bg)`:`text-(--ui-text-muted)`]),title:e.path,"aria-current":o.value===e.path?`true`:void 0,"data-testid":`file-entry`,onClick:t=>x(e.path)},[c(f,{name:N(An)(e.path),class:`size-3.5 shrink-0`},null,8,[`name`]),j(`span`,Gn,y(N(wn)(e.path,Yn)),1),j(`span`,Kn,[j(`span`,qn,`+`+y(e.additions),1),j(`span`,Jn,`−`+y(e.deletions),1)])],10,Wn)]))),128))],2)):w(``,!0)])]),j(`div`,{ref_key:`panel`,ref:s,class:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`diff-column`},[(A(!0),u(F,null,d(e.notes,e=>(A(),u(`p`,{key:e,class:`px-3 pt-3 text-xs text-(--ui-text-muted)`,"data-testid":`diff-note`},y(e),1))),128)),c(Sn,{diff:e.diff,theme:r.value,"diff-style":g.value},null,8,[`diff`,`theme`,`diff-style`])],512)],512))}}}),Zn=b({__name:`LabelTip`,props:{text:{},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>{let r=Se;return A(),V(r,{text:e.text,disabled:e.disabled,"delay-duration":250,content:{side:`bottom`,align:`end`,sideOffset:6,collisionPadding:8},ui:{content:`h-auto max-w-[28rem] px-2.5 py-1.5`,text:`text-clip whitespace-normal leading-snug`}},{default:D(()=>[R(t.$slots,`default`)]),_:3},8,[`text`,`disabled`])}}}),Qn={class:`pr-review-panel @container flex h-full min-h-0 min-w-0 flex-col`,"data-testid":`pr-review-panel`},$n={class:`shrink-0 border-b border-(--ui-border) px-4 pt-5 pb-4 sm:px-6`},er={class:`flex flex-col gap-3 @2xl:flex-row @2xl:items-start @2xl:justify-between @2xl:gap-4`},tr={class:`min-w-0`},nr={class:`line-clamp-2 text-lg leading-snug font-semibold text-(--ui-text) @2xl:line-clamp-none @2xl:truncate`,"data-testid":`pr-title`},rr={class:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-(--ui-text-muted)`,"data-testid":`pr-facts`},ir=[`href`],ar={key:1,class:`inline-flex items-center gap-1.5`},or=[`href`],sr={title:`the base the diff is against`},cr={"data-testid":`producer-label`},lr={class:`inline-flex items-center gap-1 text-(--ui-warning)`,"data-testid":`truncated-label`},ur={class:`flex shrink-0 flex-wrap items-center gap-2`},dr={key:1,class:`inline-flex shrink-0 items-center gap-1.5 text-xs text-(--ui-text-muted)`,"data-testid":`abridge-running`},fr={key:2,class:`inline-flex min-w-0 shrink items-center gap-1.5 text-xs text-(--ui-error)`,"data-testid":`abridge-failed`},pr=[`title`],mr={key:0,class:`flex shrink-0 items-center justify-between gap-3 border-b border-(--ui-border) px-4 py-2 sm:px-6`},hr={class:`tabs-scroll min-w-0 overflow-x-auto`},gr={class:`min-h-0 flex-1 overflow-y-auto`},_r={key:1,class:`mx-auto max-w-3xl p-4 sm:p-6`,"data-testid":`pr-description`},vr={key:2,class:`mt-4 text-xs text-(--ui-text-dimmed) italic`,"data-testid":`description-origin`},yr={key:2,class:`px-4 py-3 text-sm text-(--ui-text-muted) sm:px-6`,"data-testid":`no-diff`},br=`switchboard:diffStyle`,xr=`Abridge the full diff with meat.dev: a model keeps the concepts and drops what a reviewer need not read. One model call; usually a minute or three.`,Sr=b({__name:`PrReviewPanel`,props:{data:{},closable:{type:Boolean,default:!1},abridge:{default:void 0}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=U(()=>Qt(n.data.pr)),a=U(()=>Yt(n.data)),o=U(()=>n.data.readingDiffs),s=U(()=>n.data.description),l=U(()=>o.value.find(e=>e.poweredBy===`git`)),d=U(()=>o.value.find(e=>e.poweredBy===`meat`)),f=U(()=>n.data.pr.headSha?.slice(0,7)),p=U(()=>{let e=[];return l.value&&e.push({label:`Files changed`,value:`files`}),d.value&&e.push({label:`Reading diff`,value:`reading`}),(s.value?.tldr||s.value?.why)&&e.push({label:`Description`,value:`description`}),e}),h=()=>$t(o.value)?.poweredBy===`meat`?`reading`:`files`,g=B(h());m(()=>$t(o.value),()=>g.value=h()),m(p,e=>{e.some(e=>e.value===g.value)||(g.value=e[0]?.value??`files`)},{immediate:!0});let _=U(()=>g.value===`files`?l.value:g.value===`reading`?d.value:void 0),v=U(()=>{let e=_.value;if(!e)return[];let t=[];return e.summary&&t.push(e.summary),e.truncated&&t.push(`${tn(e.diff.length)}.`),t}),b=U(()=>s.value?rn(s.value):void 0),x=[{label:`Inline`,value:`unified`,icon:`i-lucide-rows-3`},{label:`Side by side`,value:`split`,icon:`i-lucide-columns-2`}],S=B(`unified`);M(()=>{try{localStorage.getItem(br)===`split`&&(S.value=`split`)}catch{}});function C(e){S.value=e===`split`?`split`:`unified`;try{localStorage.setItem(br,S.value)}catch{}}let ee=U(()=>n.abridge!==void 0&&n.abridge.state.state!==`done`&&l.value!==void 0&&!d.value);return(t,n)=>{let o=H,l=le,d=vn;return A(),u(`div`,Qn,[j(`header`,$n,[j(`div`,er,[j(`div`,tr,[j(`h1`,nr,y(a.value),1),j(`div`,rr,[i.value.pr?(A(),u(`a`,{key:0,href:i.value.pr,target:`_blank`,rel:`noopener noreferrer`,class:`inline-flex items-center gap-1.5 hover:text-(--ui-text)`,"data-testid":`pr-link`},[c(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),j(`span`,null,y(e.data.pr.repo)+`#`+y(e.data.pr.number),1)],8,ir)):e.data.pr.repo?(A(),u(`span`,ar,[c(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),j(`span`,null,y(e.data.pr.repo),1)])):w(``,!0),i.value.commit?(A(),u(`a`,{key:2,href:i.value.commit,target:`_blank`,rel:`noopener noreferrer`,class:`font-mono hover:text-(--ui-text)`,"data-testid":`commit-link`},y(f.value),9,or)):w(``,!0),_.value?(A(),u(F,{key:3},[j(`span`,sr,`against origin/`+y(_.value.baseRef),1),c(Zn,{text:N(en)(_.value.poweredBy)},{default:D(()=>[j(`span`,cr,y(N(nn)(_.value.poweredBy)),1)]),_:1},8,[`text`]),_.value.truncated?(A(),V(Zn,{key:0,text:N(tn)(_.value.diff.length)},{default:D(()=>[j(`span`,lr,[c(o,{name:`i-lucide-scissors`,class:`size-3.5`}),n[4]||=P(`truncated `,-1)])]),_:1},8,[`text`])):w(``,!0)],64)):w(``,!0)])]),j(`div`,ur,[i.value.pr?(A(),V(l,{key:0,label:`View on GitHub`,icon:`i-simple-icons-github`,color:`neutral`,variant:`ghost`,size:`sm`,to:i.value.pr,target:`_blank`,"data-testid":`github-button`},null,8,[`to`])):w(``,!0),ee.value&&e.abridge?(A(),u(F,{key:1},[e.abridge.state.state===`absent`?(A(),V(Zn,{key:0,text:xr},{default:D(()=>[c(l,{label:`Abridge with meat`,icon:`i-lucide-scissors`,size:`sm`,"data-testid":`abridge-button`,onClick:n[0]||=t=>e.abridge.start()})]),_:1})):e.abridge.state.state===`running`?(A(),u(`span`,dr,[c(o,{name:`i-lucide-loader-circle`,class:`size-3.5 animate-spin`}),n[5]||=P(` Abridging… usually 1–3 minutes `,-1)])):e.abridge.state.state===`failed`?(A(),u(`span`,fr,[c(o,{name:`i-lucide-circle-alert`,class:`size-3.5 shrink-0`}),j(`span`,{class:`truncate`,title:e.abridge.state.reason},`Abridging failed: `+y(e.abridge.state.reason),9,pr),c(l,{size:`xs`,color:`neutral`,variant:`outline`,label:`Retry`,"data-testid":`abridge-retry`,onClick:n[1]||=t=>e.abridge.start()})])):w(``,!0)],64)):w(``,!0),e.closable?(A(),V(l,{key:2,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,"aria-label":`Close`,"data-testid":`panel-close`,onClick:n[2]||=e=>r(`close`)})):w(``,!0)])])]),p.value.length>0?(A(),u(`div`,mr,[j(`div`,hr,[c(d,{modelValue:g.value,"onUpdate:modelValue":n[3]||=e=>g.value=e,items:p.value,size:`sm`,class:`w-fit gap-0`,content:!1,"data-testid":`panel-tabs`},null,8,[`modelValue`,`items`])]),_.value?(A(),V(d,{key:0,"model-value":S.value,items:x,color:`neutral`,size:`xs`,content:!1,class:`hidden w-fit @2xl:flex`,"data-testid":`diff-style`,"onUpdate:modelValue":C},null,8,[`model-value`])):w(``,!0)])):w(``,!0),j(`div`,gr,[_.value?(A(),V(Xn,{key:_.value.poweredBy,diff:_.value.diff,notes:v.value,"diff-style":S.value},null,8,[`diff`,`notes`,`diff-style`])):g.value===`description`&&s.value?(A(),u(`div`,_r,[n[7]||=j(`div`,{class:`mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`What the pull request says about itself`,-1),s.value.tldr?(A(),V(K,{key:0,text:s.value.tldr,class:`text-sm`,"data-testid":`description-tldr`},null,8,[`text`])):w(``,!0),s.value.why?(A(),u(F,{key:1},[n[6]||=j(`div`,{class:`mt-4 mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`Why`,-1),c(K,{text:s.value.why,class:`text-sm`,"data-testid":`description-why`},null,8,[`text`])],64)):w(``,!0),b.value?(A(),u(`p`,vr,y(b.value),1)):w(``,!0)])):(A(),u(`p`,yr,` No reading diff was produced for this review. `))])])}}}),Cr={class:`conn flex items-center gap-2 font-mono`},wr={key:0,class:`ok text-ok`,role:`img`,"aria-label":`succeeded`},Tr=[`data-heat`],Er=[`title`],Dr={key:3,id:`delivery`,class:`text-xs text-muted`},Or=[`title`],kr={key:0,id:`actions`,class:`actions flex gap-1.5`},Ar={class:`mx-auto max-w-6xl`},jr={key:0,id:`lineage`,class:`lineage facts mb-2 flex flex-wrap items-baseline gap-x-3 gap-y-1 px-(--sb-gutter) font-mono text-xs text-dimmed`},Mr={key:2,class:`threadkind`},Nr={key:1,id:`runmeta`,class:`runmeta facts mb-3 flex flex-wrap items-baseline gap-x-3 gap-y-1.5 px-(--sb-gutter) font-mono text-xs text-dimmed`},Pr={class:`agent text-[0.68rem] font-medium uppercase tracking-wider text-toned`},Fr={class:`model`},Ir={key:0,class:`effort`},Lr={key:1,class:`harness`},Rr=[`href`],zr={key:3,class:`repo`},Br=[`href`],Vr={key:5,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned`},Hr=[`href`,`title`],Ur=[`href`],Wr={key:2,id:`request`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Gr={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Kr={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},qr=[`href`],Jr={key:1},Yr={key:1},Xr=[`href`],Zr=[`title`],Qr={key:6,id:`references`,class:`group mb-4 px-(--sb-gutter)`},$r={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},ei={class:`count font-normal normal-case tracking-normal text-dimmed`},ti={id:`referencedthreads`,class:`pb-1 pl-5`},ni={class:`flex items-baseline gap-2 font-mono text-xs text-dimmed`},ri=[`href`],ii=[`title`],ai={class:`quoted mt-1 whitespace-pre-wrap break-words font-mono text-xs opacity-85`},oi={key:7,id:`context`,class:`group mb-4 px-(--sb-gutter)`},si={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},ci={class:`count font-normal normal-case tracking-normal text-dimmed`},li={id:`contextturns`,class:`pb-1 pl-5`},ui=[`title`],di={id:`thisrun`,class:`mb-2 flex items-baseline gap-2.5 px-(--sb-gutter) font-mono text-xs font-medium uppercase tracking-wider text-muted`},fi={key:0,class:`count font-normal normal-case tracking-normal text-dimmed`},pi=[`aria-pressed`,`data-open`,`title`],mi={id:`log`,class:`m-0 list-none p-0`},hi={key:0,id:`placeholder`,class:`empty text-muted`},gi=[`id`],_i={class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 pr-(--sb-gutter) font-mono text-xs tabular-nums text-dimmed`},vi=[`title`],yi=[`title`],bi=[`title`],xi=[`href`],Si={key:3,class:`nonar font-sans italic`},Ci=[`title`],wi=[`data-phase`],Ti=[`aria-expanded`,`onClick`],Ei={class:`glyph select-none text-dimmed`},Di={class:`what`},Oi={key:0,class:`m-0 list-none p-0 pl-4`},ki={key:4,class:`followup block mt-5 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Ai={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},ji={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},Mi=[`href`],Ni={key:1},Pi=[`title`],Fi={key:5,class:`mt-5`},Ii=[`open`],Li={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},Ri={key:0,class:`font-normal normal-case tracking-normal text-dimmed`},zi=[`title`],Bi=[`title`],Vi=b({__name:`RunPage`,setup(e){let t=fe(`run`),n=t?.mode===`history`,r=n?`Run`:`Live run`,i=n,o=t?.artifacts??null,s=t?.children??[],l=(t?.mode===`history`?t.units:void 0)??[],f=t?.mode===`history`?t.findingsLedger:void 0,p=U(()=>f?`/runs/unit/${encodeURIComponent(f.unit)}#findings`:void 0),h=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,_=$e({openTags:h?h.split(`,`).map(e=>e.trim()).filter(Boolean):void 0});t?.mode===`live`&&_.seedClock(t.serverNow);let v=_.state,b=B(n?`ended`:`connecting`),x=B(``),C=je(),T=t?.mode===`live`?ct(t,C.value):null,E=B(void 0),O=B({}),k=U(()=>{if(n&&t?.mode===`history`)return t.queued?{ok:!1,cls:`amber`,word:t.queued.state===`waiting`?`queued at position ${t.queued.position} — waiting on ${t.queued.waiting}`:t.queued.state}:t.status===`completed`?{ok:!0,cls:``,word:`succeeded`}:t.provisional?{ok:!1,cls:`amber`,word:Pe}:{ok:!1,cls:t.status===`failed`||t.status===`stopped_hard`||t.status===`interrupted`?`red`:t.status===`stopped_soft`?`amber`:`grey`,word:t.status?Ne(t.status):`ended`};let e=v.stopMode;return{ok:!1,cls:e===`hard`?`red`:e===`soft`?`amber`:`grey`,word:e===`hard`?`killed`:e===`soft`?`stopped early`:`ended`}}),te=U(()=>n&&t?.mode===`history`?t.durationMs:E.value),ne=U(()=>it(n&&t?.mode===`history`?{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk}:O.value)),re=U(()=>te.value===void 0?``:Fe(te.value,`clock`)),ie=U(()=>n&&t?.mode===`history`?t.cost:void 0),ae=e=>e===null?`unpriced`:ze(e),se=U(()=>ie.value?ae(ie.value.usd):``),ue=U(()=>ie.value?Object.entries(ie.value.byModel).map(([e,t])=>`${e} ${ae(t.usd)}`).join(`
|
|
9
9
|
`):void 0),de=U(()=>mt(te.value,`run`)),pe=U(()=>pt(de.value)),me={red:`border-bad/30 text-bad`,amber:`border-warn/30 text-warn`,grey:`border-accented text-muted`},I=U(()=>x.value?x.value:b.value===`connecting`?`connecting…`:b.value===`disconnected`?`disconnected`:b.value===`stopping`?`stopping (${v.stopMode??`soft`})`:b.value===`finished`?E.value===void 0?`delivering…`:`delivering… · ${Fe(E.value,`clock`)}`:T?`running · ${Fe(T.elapsedMs(C.value),`clock`)}`:`running`),ge=U(()=>x.value||b.value===`disconnected`?`text-bad`:b.value===`running`?`text-ok motion-safe:animate-pulse`:b.value===`finished`?`text-ok`:`text-warn motion-safe:animate-pulse`),L=U(()=>{if(!t||t.mode!==`live`&&t.mode!==`history`)return null;v.traceVersion;let e=t.receivedAt??t.startedAt,n=He(v.meta?.agent);if(t.mode===`history`){let r=t.durationMs??(t.finishedAt===void 0?0:Math.max(0,t.finishedAt-e));return We({spans:_.spanSet(),losses:_.losses(e),window:{start:e,end:e+r},owner:n,totalMs:r,phase:`ended`,delivery:{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk},...t.status?{endedBy:t.status}:{},...t.truncated===void 0?{}:{truncated:t.truncated},...t.untimed?{untimed:!0}:{},callTitle:_.callHeadline})}if(!T)return null;let r=b.value===`ended`?`ended`:b.value===`finished`?`delivering`:`live`,i=r===`live`?T.elapsedMs(C.value):E.value??T.elapsedMs(C.value);return We({spans:_.spanSet(),losses:_.losses(e),window:{start:e,end:e+i},owner:n,totalMs:i,phase:r,delivery:O.value,...r===`ended`&&v.stopMode?{endedBy:`stopped_${v.stopMode}`}:{},callTitle:_.callHeadline})}),_e=n&&t?.mode===`history`?`/runs/${encodeURIComponent(t.id)}/events`:void 0;function ye(e){_.reveal(e)&&ce().then(()=>{let t=document.getElementById(e);t&&(t.scrollIntoView?.({block:`center`}),t.classList.add(`revealed`),setTimeout(()=>t.classList.remove(`revealed`),1500))})}let R=B(n||t?.mode!==`live`||t.stopUrl===void 0),z=B(!1);function be(e){t?.mode===`live`&&t.stopUrl!==void 0&&(e!==`hard`||ve.confirm(`Hard stop: abort the run now with no summary and free its sandbox?`))&&(z.value=!0,fetch(`${t.stopUrl}&mode=${encodeURIComponent(e)}`,{method:`POST`,credentials:`same-origin`}).then(async t=>{if(!t.ok){let e=await t.json?.().catch(()=>null);throw Error(typeof e?.message==`string`?e.message:`HTTP ${t.status}`)}W(e)}).catch(e=>{z.value=!1,x.value=`stop failed: ${e instanceof Error?e.message:`error`}`}))}function W(e){_.markStopping(e),R.value=!0,(b.value===`connecting`||b.value===`running`)&&(b.value=`stopping`)}m(()=>v.stopMode,e=>{e&&b.value!==`ended`&&b.value!==`disconnected`&&b.value!==`finished`&&W(e)}),n||m(b,e=>ve.setFavicon(e===`ended`||e===`disconnected`||e===`finished`?De:ke),{immediate:!0});let Oe=U(()=>!n&&b.value!==`ended`&&b.value!==`disconnected`&&b.value!==`finished`),Ge=U(()=>Oe.value?ut(v,C.value):null);xe(ot,Ge),xe(rt,o),xe(Ze,U(()=>v.reply!==null));let G=U(()=>Oe.value?lt(v,_.pendingCall(),C.value):null),Ke=U(()=>G.value?.kind===`thinking`?L.value?.openStep||we(G.value.elapsedMs):``);function ht(){_.setAllOpen(!v.allOpen)}let gt=U(()=>v.log.filter(e=>e.kind===`step`).length),q=U(()=>{for(let e=v.log.length-1;e>=0;e--){let t=v.log[e];if(t.kind===`note`&&t.noteKind===`notes`)return t.key}}),_t=B(null);function vt(){return window.innerHeight+window.scrollY>=document.body.scrollHeight-60}let J=dn(),yt=B(!1),bt=t?.mode===`history`&&t.capabilities.readingDiffAbridge?mn(t.id,e=>J.handle(e)):void 0;oe(()=>bt?.dispose());function xt(e){let t=vt();_.handle(e),J.handle(e),t&&requestAnimationFrame(()=>_t.value?.scrollIntoView?.({block:`nearest`}))}let St=Ae(),Ct=null;if(t?.mode===`history`){for(let e of t.events)_.handle(e),J.handle(e);_.closePhases()}M(()=>{t?.mode===`live`&&(Ct=Te({url:t.eventsUrl,factory:St,model:_,handle:xt,onFinished:e=>{R.value=!0,e&&(T&&(E.value=T.elapsedAt(e.finishedAt)),O.value={...O.value,finishedAt:e.finishedAt})},onEnd:e=>{R.value=!0,E.value??=T?.elapsedMs(C.value),O.value={...O.value,...e}}}),m(Ct.phase,e=>{(b.value!==`stopping`||e!==`running`&&e!==`connecting`)&&(b.value=e)},{immediate:!0}))}),oe(()=>{Ct?.close()});function wt(e){return e&&/^https?:\/\//.test(e)?e:``}let Tt=U(()=>wt(v.request?.source?.url)),Et=U(()=>t&&(t.mode===`live`||t.mode===`history`)&&t.threadKey?Ie(t.threadKey):null),Y=t&&(t.mode===`live`||t.mode===`history`)?t.lineage??null:null,Ot=Y?.parent?`/runs/${encodeURIComponent(Y.parent.id)}${Y.parent.token?`?t=${encodeURIComponent(Y.parent.token)}`:``}`:``,kt=Y?.unit?`/runs/unit/${encodeURIComponent(Y.unit.key)}`:``,X=U(()=>{let e=v.meta;return{repo:dt(e?.repo),tree:Ye(e?.repo,e?.ref),commit:ft(e?.repo,e?.headSha),pr:Qe(e?.repo,e?.pr)}}),At=U(()=>{let e=v.meta;if(!e?.harness)return``;let t=e.harnessScope===`defaults`?`defaults`:e.harnessScope?`${e.harnessScope} scope`:``;return t?`${e.harness} harness (${t})`:`${e.harness} harness`}),jt=U(()=>Xe({meta:v.meta,requestText:v.request?.text??``,prOpened:v.prOpened}));function Z(e){return typeof e==`number`?Me(e,C.value):``}function Q(e){return typeof e==`number`?Le(e):void 0}return(e,t)=>{let n=ee(`RouterLink`),o=le,m=Se,h=H,T=Ce;return A(),V(a,{title:N(r),nav:`runs`},{leading:D(()=>[c(n,{class:`back text-sm text-primary no-underline hover:underline`,to:`/runs`},{default:D(()=>[...t[4]||=[P(`← All runs`,-1)]]),_:1})]),status:D(()=>[j(`span`,Cr,[b.value===`ended`?(A(),u(F,{key:0},[k.value.ok?(A(),u(`span`,wr,`✓`)):(A(),u(`span`,{key:1,class:S([`chip rounded border px-1.5 text-[0.7rem]`,me[k.value.cls]])},y(k.value.word),3)),j(`span`,{id:`state`,class:S([`dur text-xs tabular-nums`,[pe.value?`heat`:`text-muted`,de.value.level>=2?`font-medium`:``]]),style:g(pe.value),"data-heat":de.value.level},y(re.value),15,Tr),se.value?(A(),u(`span`,{key:2,id:`cost`,class:`cost text-xs tabular-nums text-muted`,title:ue.value},`· `+y(se.value),9,Er)):w(``,!0),ne.value?(A(),u(`span`,Dr,`· `+y(ne.value),1)):w(``,!0)],64)):(A(),u(F,{key:1},[j(`span`,{id:`statedot`,class:S([`pulse text-[1.1em] leading-none`,ge.value])},`∿`,2),j(`span`,{id:`state`,class:S([`text-xs tabular-nums`,x.value?`text-bad`:`text-muted`]),title:b.value===`running`&&!x.value?`the whole run, since we received the message`:b.value===`finished`?`the agent stopped; the reply is being posted`:void 0},y(I.value),11,Or)],64))])]),actions:D(()=>[R.value?w(``,!0):(A(),u(`span`,kr,[c(m,{text:`Soft stop: no new steps, the agent writes up what it has`},{default:D(()=>[c(o,{size:`xs`,color:`neutral`,variant:`outline`,label:`Stop`,disabled:z.value,onClick:t[0]||=e=>be(`soft`)},null,8,[`disabled`])]),_:1}),c(m,{text:`Hard stop: abort now, no summary, free the sandbox`},{default:D(()=>[c(o,{size:`xs`,color:`error`,variant:`outline`,label:`Kill`,disabled:z.value,onClick:t[1]||=e=>be(`hard`)},null,8,[`disabled`])]),_:1})]))]),default:D(()=>[j(`div`,Ar,[N(Y)?(A(),u(`div`,jr,[t[5]||=j(`span`,{class:`text-[0.68rem] font-medium uppercase tracking-wider`},`part of`,-1),N(Ot)&&N(Y).parent?(A(),V(n,{key:0,class:`parent text-primary no-underline hover:underline`,to:N(Ot),"data-testid":`lineage-parent`,title:N(Y).unit?`the pipeline this run belongs to`:`the run that spawned this one`},{default:D(()=>[P(y(N(Y).unit?`pipeline`:`parent run`)+` ›`,1)]),_:1},8,[`to`,`title`])):w(``,!0),N(kt)&&N(Y).unit?(A(),V(n,{key:1,class:`unit text-primary no-underline hover:underline`,to:N(kt),"data-testid":`lineage-unit`,title:`the unit this run's thread belongs to`},{default:D(()=>[P(`unit `+y(N(Y).unit.id)+y(N(Y).unit.title?` · ${N(Y).unit.title}`:``)+` ›`,1)]),_:1},8,[`to`])):w(``,!0),N(Y).unit?.thread?(A(),u(`span`,Mr,y(N(Y).unit.thread)+` thread`,1)):w(``,!0)])):w(``,!0),N(v).meta?(A(),u(`div`,Nr,[j(`span`,Pr,y(N(v).meta.agent),1),j(`span`,Fr,y(N(v).meta.model),1),N(v).meta.effort?(A(),u(`span`,Ir,y(N(v).meta.effort)+` effort`,1)):w(``,!0),At.value?(A(),u(`span`,Lr,y(At.value),1)):w(``,!0),X.value.repo?(A(),u(`a`,{key:2,class:`text-primary no-underline hover:underline`,href:X.value.repo,target:`_blank`,rel:`noopener noreferrer`},y(N(v).meta.repo),9,Rr)):N(v).meta.repo?(A(),u(`span`,zr,y(N(v).meta.repo),1)):w(``,!0),X.value.tree?(A(),u(`a`,{key:4,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned no-underline hover:border-primary hover:text-primary`,href:X.value.tree,target:`_blank`,rel:`noopener noreferrer`,title:`the branch on GitHub`},y(N(v).meta.ref),9,Br)):N(v).meta.ref?(A(),u(`span`,Vr,y(N(v).meta.ref),1)):w(``,!0),X.value.commit&&N(v).meta.headSha?(A(),u(`a`,{key:6,class:`sha tabular-nums text-toned no-underline hover:text-primary hover:underline`,href:X.value.commit,target:`_blank`,rel:`noopener noreferrer`,title:`the head commit ${N(v).meta.headSha}`},y(N(Je)(N(v).meta.headSha)),9,Hr)):w(``,!0),X.value.pr?(A(),u(`a`,{key:7,class:`prlink whitespace-nowrap text-primary no-underline hover:underline`,href:X.value.pr,target:`_blank`,rel:`noopener noreferrer`},[c(Ue,{class:`mr-1 align-[-0.125em]`}),P(`#`+y(N(v).meta.pr),1)],8,Ur)):w(``,!0),p.value&&N(f)?(A(),V(n,{key:8,class:`findings whitespace-nowrap text-primary no-underline hover:underline`,to:p.value,title:`the pull request's findings ledger on its unit's page`},{default:D(()=>[P(`Findings · `+y(N(f).rows),1)]),_:1},8,[`to`])):w(``,!0),N(J).state.ready?(A(),u(`button`,{key:9,type:`button`,class:`reading-diff ml-auto inline-flex cursor-pointer items-center gap-1 whitespace-nowrap text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"data-testid":`reading-diff-button`,onClick:t[2]||=e=>yt.value=!0},[c(h,{name:`i-lucide-git-compare`,class:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[6]||=P(` Reading diff `,-1)])):w(``,!0)])):w(``,!0),N(v).request?(A(),u(`section`,Wr,[j(`h2`,Gr,[t[7]||=j(`span`,null,`Request`,-1),N(v).request.source?(A(),u(`span`,Kr,[N(v).request.source.channel?(A(),u(F,{key:0},[c(qe),Tt.value?(A(),u(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:Tt.value,target:`_blank`,rel:`noopener noreferrer`,title:`open the thread`},`#`+y(N(v).request.source.channel),9,qr)):(A(),u(`span`,Jr,`#`+y(N(v).request.source.channel),1))],64)):w(``,!0),N(v).request.source.user?(A(),u(`span`,Yr,y(N(v).request.source.user),1)):w(``,!0)])):w(``,!0),Et.value?(A(),u(`a`,{key:1,class:`thread font-normal normal-case tracking-normal text-muted no-underline hover:text-primary hover:underline`,href:Et.value,title:`the thread this run is a turn of`,"data-testid":`thread-link`},`in thread ›`,8,Xr)):w(``,!0),j(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:Q(N(v).request.at)},y(Z(N(v).request.at)),9,Zr)]),c(Dt,{lines:3},{default:D(()=>[c(K,{text:N(v).request.text},null,8,[`text`])]),_:1}),N(v).request.files.length>0?(A(),V(st,{key:0,files:N(v).request.files},null,8,[`files`])):w(``,!0)])):w(``,!0),N(v).reply&&N(i)?(A(),V(It,{key:3,position:`first`,text:N(v).reply.text,caption:jt.value,when:Z(N(v).reply.at),"when-title":Q(N(v).reply.at),files:N(v).reply.files},null,8,[`text`,`caption`,`when`,`when-title`,`files`])):w(``,!0),N(l).length>0?(A(),V(Ut,{key:4,units:N(l)},null,8,[`units`])):w(``,!0),N(s).length>0?(A(),V(Jt,{key:5,children:N(s),now:N(C)},null,8,[`children`,`now`])):w(``,!0),N(v).references.length>0?(A(),u(`details`,Qr,[j(`summary`,$r,[t[8]||=j(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),j(`span`,null,`Referenced thread`+y(N(v).references.length===1?``:`s`),1),j(`span`,ei,`· `+y(N(v).references.length)+` thread`+y(N(v).references.length===1?``:`s`),1)]),j(`div`,ti,[(A(!0),u(F,null,d(N(v).references,e=>(A(),u(`div`,{key:e.key,class:`reference border-t border-default py-1.5 first-of-type:border-t-0`},[j(`div`,ni,[j(`a`,{class:`text-muted no-underline hover:text-primary hover:underline`,href:e.url,target:`_blank`,rel:`noopener noreferrer`},`#`+y(e.channelName),9,ri),j(`span`,null,`· `+y(e.messages)+` message`+y(e.messages===1?``:`s`),1),j(`span`,{class:`ts ml-auto shrink-0 select-none`,title:Q(e.at)},y(Z(e.at)),9,ii)]),j(`div`,ai,[(A(!0),u(F,null,d(N(tt)(e.text),(e,t)=>(A(),u(`div`,{key:t},y(e),1))),128))])]))),128))])])):w(``,!0),N(v).context.length>0?(A(),u(`details`,oi,[j(`summary`,si,[t[9]||=j(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),t[10]||=j(`span`,null,`Earlier in this thread`,-1),j(`span`,ci,`· `+y(N(v).context.length)+` turn`+y(N(v).context.length===1?``:`s`),1)]),j(`div`,li,[(A(!0),u(F,null,d(N(v).context,e=>(A(),u(`div`,{key:e.key,class:`turn flex items-baseline gap-3 border-t border-default py-1.5 opacity-85 first-of-type:border-t-0`},[c(K,{text:e.text},null,8,[`text`]),j(`span`,{class:`ts ml-auto shrink-0 select-none font-mono text-xs text-dimmed`,title:Q(e.at)},y(Z(e.at)),9,ui)]))),128))])])):w(``,!0),j(`h2`,di,[t[11]||=j(`span`,null,`This run`,-1),gt.value>0?(A(),u(`span`,fi,`· `+y(gt.value)+` step`+y(gt.value===1?``:`s`),1)):w(``,!0),j(`button`,{id:`fold`,type:`button`,class:`ml-auto cursor-pointer font-normal normal-case tracking-normal text-dimmed hover:text-toned focus-visible:outline-2 focus-visible:outline-primary`,"aria-pressed":N(v).allOpen?`true`:`false`,"data-open":N(v).allOpen?`1`:`0`,title:N(v).allOpen?`Close every call card`:`Open every call card`,onClick:ht},y(N(v).allOpen?`Collapse all`:`Expand all`),9,pi)]),L.value?(A(),V(Ve,{key:8,vm:L.value,"events-href":N(_e),onReveal:ye},null,8,[`vm`,`events-href`])):w(``,!0),j(`ol`,mi,[N(v).placeholder?(A(),u(`li`,hi,`Waiting for activity…`)):w(``,!0),(A(!0),u(F,null,d(N(v).log,e=>(A(),u(F,{key:e.key},[e.kind===`step`?(A(),V(at,{key:0,step:e,class:`mt-5 first:mt-0`,onToggleGroup:t=>N(_).toggleGroup(e)},null,8,[`step`,`onToggleGroup`])):e.kind===`turn`?(A(),u(`li`,{key:1,id:`span-${e.turn.spanId}`,class:`turn mt-5 border-l-2 border-(--ui-border-accented)/50 pb-3 pl-3 pt-2`},[j(`div`,_i,[j(`span`,{class:S([`thought`,e.turn.quick?``:`text-warn`]),title:e.turn.label},`thought `+y(e.turn.chip),11,vi),e.turn.switched?(A(),u(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-medium text-warn`,title:`model changed: this turn ran on ${e.turn.model}`},`⇄ `+y(N(et)(e.turn.model)),9,yi)):e.turn.showModel?(A(),u(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:e.turn.model},y(N(et)(e.turn.model)),9,bi)):w(``,!0),(A(!0),u(F,null,d(e.turn.facts,(e,t)=>(A(),u(`span`,{key:t,class:`fact`},y(e),1))),128)),e.note&&e.noteHref?(A(),u(`a`,{key:2,class:`nonar font-sans italic text-dimmed no-underline hover:text-primary hover:underline`,href:e.noteHref},y(e.note),9,xi)):e.note?(A(),u(`span`,Si,y(e.note),1)):w(``,!0),e.turn.at===void 0?w(``,!0):(A(),u(`span`,{key:4,class:`ts ml-auto select-none`,title:N(Le)(e.turn.at)},y(N(Re)(e.turn.at)),9,Ci))])],8,gi)):e.kind===`span`?(A(),V(Mt,{key:2,item:e},null,8,[`item`])):e.kind===`phase`?(A(),u(`li`,{key:3,class:`phase py-0.5 font-mono text-xs`,"data-phase":e.phase},[j(`button`,{type:`button`,class:`phase-head flex w-full cursor-pointer items-baseline gap-2 text-left text-muted hover:text-toned`,"aria-expanded":e.open,onClick:he(t=>N(_).togglePhase(e),[`prevent`])},[j(`span`,Ei,y(e.open?`▾`:`▸`),1),j(`span`,{class:S([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,N(Be)(e.phase)]),"aria-hidden":`true`},null,2),j(`span`,Di,y(N(nt)(e)),1)],8,Ti),e.open?(A(),u(`ul`,Oi,[(A(!0),u(F,null,d(e.rows,e=>(A(),V(Mt,{key:e.key,item:e},null,8,[`item`]))),128))])):w(``,!0)],8,wi)):e.kind===`followup`?(A(),u(`li`,ki,[j(`h2`,Ai,[t[12]||=j(`span`,null,`↪ Follow-up`,-1),e.input.source?.user?(A(),u(`span`,ji,[wt(e.input.source.url)?(A(),u(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:e.input.source.url,target:`_blank`,rel:`noopener noreferrer`,title:`open the message`},y(e.input.source.user),9,Mi)):(A(),u(`span`,Ni,y(e.input.source.user),1))])):w(``,!0),j(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:Q(e.input.at)},y(Z(e.input.at)),9,Pi)]),c(K,{text:e.input.text},null,8,[`text`]),e.input.files.length>0?(A(),V(st,{key:0,files:e.input.files},null,8,[`files`])):w(``,!0)])):e.noteKind===`notes`?(A(),u(`li`,Fi,[j(`details`,{class:`notepad group rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-2`,open:e.key===q.value},[j(`summary`,Li,[t[13]||=j(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),t[14]||=j(`span`,null,`📝 Notes for this thread`,-1),e.key===q.value?w(``,!0):(A(),u(`span`,Ri,`· superseded`)),e.at===void 0?w(``,!0):(A(),u(`span`,{key:1,class:`ts ml-auto select-none font-normal normal-case tracking-normal text-dimmed`,title:N(Le)(e.at)},y(N(Re)(e.at)),9,zi))]),c(K,{text:e.text,class:`mt-1 [&_h1]:mb-1.5 [&_h1]:mt-4 [&_h1]:font-mono [&_h1]:text-xs [&_h1]:font-medium [&_h1]:uppercase [&_h1]:tracking-wider [&_h1]:text-muted [&_h2]:mb-1.5 [&_h2]:mt-4 [&_h2]:font-mono [&_h2]:text-xs [&_h2]:font-medium [&_h2]:uppercase [&_h2]:tracking-wider [&_h2]:text-muted [&_h3]:mb-1.5 [&_h3]:mt-4 [&_h3]:font-mono [&_h3]:text-xs [&_h3]:font-medium [&_h3]:uppercase [&_h3]:tracking-wider [&_h3]:text-muted [&>:first-child]:mt-1`},null,8,[`text`])],8,Ii)])):(A(),u(`li`,{key:6,class:S([`note mt-4 flex items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1.5`,e.replay?`text-dimmed`:`bg-warn/10 text-warn`])},[j(`span`,null,y((e.replay?`… `:`⏱ `)+e.text),1),e.at===void 0?w(``,!0):(A(),u(`span`,{key:0,class:`ts ml-auto select-none font-mono text-xs text-dimmed`,title:N(Le)(e.at)},y(N(Re)(e.at)),9,Bi))],2))],64))),128)),G.value?.kind===`thinking`?(A(),V(Ee,{key:1,id:`thinking`,class:`ml-3.5 mt-5 first:mt-0`,verb:Ke.value,"elapsed-ms":G.value.elapsedMs,slow:G.value.slow,model:N(v).model},null,8,[`verb`,`elapsed-ms`,`slow`,`model`])):w(``,!0),j(`li`,{ref_key:`logEnd`,ref:_t,"aria-hidden":`true`},null,512)]),N(v).reply&&!N(i)?(A(),V(It,{key:9,position:`last`,text:N(v).reply.text,caption:jt.value,when:Z(N(v).reply.at),"when-title":Q(N(v).reply.at),files:N(v).reply.files},null,8,[`text`,`caption`,`when`,`when-title`,`files`])):w(``,!0)]),c(T,{open:yt.value,"onUpdate:open":t[3]||=e=>yt.value=e,title:N(Yt)(N(J).state),ui:{overlay:`z-30`,content:`z-30 w-[min(96vw,90rem)] max-w-none`}},{content:D(({close:e})=>[c(Sr,{data:N(J).state,abridge:N(bt),closable:``,onClose:t=>e()},null,8,[`data`,`abridge`,`onClose`])]),_:1},8,[`open`,`title`])]),_:1},8,[`title`])}}}),Hi=b({__name:`RunRoutePage`,setup(e){let t=O(me,null);return(e,n)=>!N(t)||N(t).page===`runNotFound`?(A(),V(ht,{key:0})):(A(),V(Vi,{key:1}))}});export{Hi as default};
|