@straiffi/archon 1.13.1 → 1.13.3
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/client/assets/{ActivityView-BUI6n3Xm.js → ActivityView-DRD09JTc.js} +1 -1
- package/dist/client/assets/{ApprovalRequestPanel-BLQpUi-k.js → ApprovalRequestPanel-CRfb4jzF.js} +1 -1
- package/dist/client/assets/{ConversationMarkdown-D82tqKzW.js → ConversationMarkdown-D8iVeRE1.js} +3 -3
- package/dist/client/assets/DemonstrationDialog-D01TLRCK.js +1 -0
- package/dist/client/assets/GitHubActionsDialog-BmIcsS_L.js +1 -0
- package/dist/client/assets/{IconDocument-CePtRoIw.js → IconDocument-DINFwIj-.js} +1 -1
- package/dist/client/assets/IconGitHubActions-CjswQj_b.js +1 -0
- package/dist/client/assets/{IconPlay-clLSJ5aH.js → IconPlay-B8gyjngb.js} +1 -1
- package/dist/client/assets/IconStop-BN5mT2U1.js +1 -0
- package/dist/client/assets/{IconX-TosfRQdR.js → IconX-sSpA2ejo.js} +1 -1
- package/dist/client/assets/{LifecycleProvider-DrROQ0mW.js → LifecycleProvider-ei6VLwTM.js} +1 -1
- package/dist/client/assets/{LifecycleTimelineDialog-BzLUSgQH.js → LifecycleTimelineDialog-C0H6bvI5.js} +1 -1
- package/dist/client/assets/MediaPreviewDialog-B5yPPi0T.js +1 -0
- package/dist/client/assets/VerificationDialog-Cke3OC3c.js +4 -0
- package/dist/client/assets/{WorkspaceReviewModal-B5nSkK2I.js → WorkspaceReviewModal-CLcm4NoU.js} +7 -7
- package/dist/client/assets/{arc-DLm4ZDPa.js → arc-BR2KXlwD.js} +1 -1
- package/dist/client/assets/architecture-7EHR7CIX-DTZWkxfd.js +1 -0
- package/dist/client/assets/{architectureDiagram-3BPJPVTR-CpuAmBUP.js → architectureDiagram-3BPJPVTR-Pkhiqt5r.js} +1 -1
- package/dist/client/assets/{artifactPresentation-B2cVmrHY.js → artifactPresentation-CY7_iPcf.js} +1 -1
- package/dist/client/assets/{badge-D4QSKcZA.js → badge-Bnvptskz.js} +1 -1
- package/dist/client/assets/{blockDiagram-GPEHLZMM-w0sI3yUo.js → blockDiagram-GPEHLZMM-ruvMsQHK.js} +1 -1
- package/dist/client/assets/bootstrap-CKROdR45.js +98 -0
- package/dist/client/assets/bootstrap-CX5EVEtc.css +2 -0
- package/dist/client/assets/{c4Diagram-AAUBKEIU-B7IcliPY.js → c4Diagram-AAUBKEIU-D1brmJbD.js} +1 -1
- package/dist/client/assets/channel-B01NDmbu.js +1 -0
- package/dist/client/assets/{chunk-2J33WTMH-CD1KJm7N.js → chunk-2J33WTMH-CLreEKG8.js} +1 -1
- package/dist/client/assets/{chunk-3OPIFGDE-CWNDFW47.js → chunk-3OPIFGDE-DCODI-Rc.js} +1 -1
- package/dist/client/assets/{chunk-4BX2VUAB-j6qim-YB.js → chunk-4BX2VUAB-BEdmpAM4.js} +1 -1
- package/dist/client/assets/{chunk-4EGX6M5U-C7opoYrE.js → chunk-4EGX6M5U-C5SHZY5t.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-4YpmINBj.js → chunk-55IACEB6-B_T45HbU.js} +1 -1
- package/dist/client/assets/{chunk-5DO6E6H7-B44Az2Vm.js → chunk-5DO6E6H7-BvRtJG-b.js} +1 -1
- package/dist/client/assets/{chunk-5ZQYHXKU-CAmg-Amo.js → chunk-5ZQYHXKU-Czv3sEec.js} +1 -1
- package/dist/client/assets/{chunk-727SXJPM-QT6vkxfw.js → chunk-727SXJPM-CUS5BAia.js} +1 -1
- package/dist/client/assets/{chunk-AQP2D5EJ-C5J_PkKZ.js → chunk-AQP2D5EJ-DuU68eY2.js} +1 -1
- package/dist/client/assets/{chunk-BR22UD5L-BeGGfGKP.js → chunk-BR22UD5L-CMbA_7zi.js} +1 -1
- package/dist/client/assets/{chunk-BSJP7CBP-cLht0MXH.js → chunk-BSJP7CBP-D9C1bNga.js} +1 -1
- package/dist/client/assets/{chunk-CSCIHK7Q-CgdjKrdr.js → chunk-CSCIHK7Q-BFj36ajn.js} +2 -2
- package/dist/client/assets/{chunk-FHYWG6QK-DPU-Vm7B.js → chunk-FHYWG6QK-DpLqOkK7.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-D0714kyI.js → chunk-FMBD7UC4-B_i-fBOm.js} +1 -1
- package/dist/client/assets/{chunk-KSCS5N6A-DNsbWXPN.js → chunk-KSCS5N6A-iU27-eSU.js} +1 -1
- package/dist/client/assets/{chunk-L5ZTLDWV-D7HoN5ML.js → chunk-L5ZTLDWV-Dkr_XhvY.js} +1 -1
- package/dist/client/assets/{chunk-LZXEDZCA-BzMkcBOY.js → chunk-LZXEDZCA-CvWOZMMQ.js} +2 -2
- package/dist/client/assets/{chunk-MPE355IW-CpGJ_GQ8.js → chunk-MPE355IW-Bm6LdhAi.js} +1 -1
- package/dist/client/assets/{chunk-MZUSXYTE-CkH88bj3.js → chunk-MZUSXYTE-v7h2c1h1.js} +1 -1
- package/dist/client/assets/{chunk-N66VUXT2-DTStVk4C.js → chunk-N66VUXT2-CX1fso4R.js} +1 -1
- package/dist/client/assets/{chunk-ND2GUHAM-_4lXPs4v.js → chunk-ND2GUHAM-BkfiFlFO.js} +1 -1
- package/dist/client/assets/{chunk-NZK2D7GU-4vnXS7O-.js → chunk-NZK2D7GU-Ci8pOVdE.js} +1 -1
- package/dist/client/assets/{chunk-O5CBEL6O-BRXaTllh.js → chunk-O5CBEL6O-DQWScC0A.js} +1 -1
- package/dist/client/assets/{chunk-PUPMXCY4-CLXvBvAX.js → chunk-PUPMXCY4-9anN8Uz5.js} +1 -1
- package/dist/client/assets/chunk-QZHKN3VN-CJfHEZGy.js +1 -0
- package/dist/client/assets/{chunk-UIBZB4QT-tZrOU_9W.js → chunk-UIBZB4QT-DIG38ead.js} +1 -1
- package/dist/client/assets/{chunk-WCWK7LTN-KPm7BsrY.js → chunk-WCWK7LTN-Doy8-Vhx.js} +1 -1
- package/dist/client/assets/chunk-WU5MYG2G-NCbD6q3J.js +1 -0
- package/dist/client/assets/{chunk-XPW4576I-wD8YVX6M.js → chunk-XPW4576I-DXkP_JdL.js} +1 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-D_Jv2gIy.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CcxVBrx5.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-3J7dPSP2.js → cose-bilkent-S5V4N54A-HrZ-5MDk.js} +1 -1
- package/dist/client/assets/{dagre-BM42HDAG-FWdldae4.js → dagre-BM42HDAG-DRbkGBBP.js} +1 -1
- package/dist/client/assets/{dagre-KM9_oZrv.js → dagre-pjdcQX-8.js} +1 -1
- package/dist/client/assets/{diagram-2AECGRRQ-BumhjLsb.js → diagram-2AECGRRQ-D_TKwNab.js} +1 -1
- package/dist/client/assets/{diagram-5GNKFQAL-Cb33KbTb.js → diagram-5GNKFQAL-DqgxdJ2S.js} +1 -1
- package/dist/client/assets/{diagram-KO2AKTUF-BlOjzhnN.js → diagram-KO2AKTUF-DC36WkSM.js} +1 -1
- package/dist/client/assets/{diagram-LMA3HP47-CHwtw61J.js → diagram-LMA3HP47-CfgPkQ74.js} +1 -1
- package/dist/client/assets/{diagram-OG6HWLK6-CGVINNIx.js → diagram-OG6HWLK6-BecH_4Uu.js} +1 -1
- package/dist/client/assets/{erDiagram-TEJ5UH35-U0syd0R8.js → erDiagram-TEJ5UH35-gVKjPSTy.js} +1 -1
- package/dist/client/assets/eventmodeling-FCH6USID-CpYTyxuZ.js +1 -0
- package/dist/client/assets/{flowDiagram-I6XJVG4X-DxBd0T98.js → flowDiagram-I6XJVG4X-BI4w94Db.js} +1 -1
- package/dist/client/assets/{ganttDiagram-6RSMTGT7-CtZJykQf.js → ganttDiagram-6RSMTGT7-CEwscd0z.js} +1 -1
- package/dist/client/assets/gitGraph-WXDBUCRP-Z83aCG2F.js +1 -0
- package/dist/client/assets/{gitGraphDiagram-PVQCEYII-r4iyFj98.js → gitGraphDiagram-PVQCEYII-BzYnzfZU.js} +1 -1
- package/dist/client/assets/{index-CdbmiAlF.js → index-C2JPbj12.js} +2 -2
- package/dist/client/assets/info-J43DQDTF-BedCRFEx.js +1 -0
- package/dist/client/assets/{infoDiagram-5YYISTIA-DkgQtYrf.js → infoDiagram-5YYISTIA-CPYAdvo1.js} +1 -1
- package/dist/client/assets/{IconLoader-D1xRRX9B.js → input-AZAw9vJs.js} +3 -3
- package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-3CITKdXW.js → ishikawaDiagram-YF4QCWOH-Ctpfd7Fa.js} +1 -1
- package/dist/client/assets/{journeyDiagram-JHISSGLW-DRxIgjvH.js → journeyDiagram-JHISSGLW-CmpICCRR.js} +1 -1
- package/dist/client/assets/{kanban-definition-UN3LZRKU-FyHviky4.js → kanban-definition-UN3LZRKU-BvrG2MaR.js} +1 -1
- package/dist/client/assets/{line-CtX9AQrF.js → line-BuEChOFl.js} +1 -1
- package/dist/client/assets/{linear-DAl7bclq.js → linear-CnfNbUsu.js} +1 -1
- package/dist/client/assets/{mermaid-parser.core-CCjwz4zI.js → mermaid-parser.core-Cc66WWhM.js} +2 -2
- package/dist/client/assets/{mermaid.core-BrPCXQ_-.js → mermaid.core-01K66m6d.js} +3 -3
- package/dist/client/assets/{mindmap-definition-RKZ34NQL-KN_4OT4O.js → mindmap-definition-RKZ34NQL-BuyfpCKJ.js} +1 -1
- package/dist/client/assets/{ordinal-BqEhkPyh.js → ordinal-v4prQcuq.js} +1 -1
- package/dist/client/assets/packet-YPE3B663-BYqLN6U1.js +1 -0
- package/dist/client/assets/pie-LRSECV5Y-Do8rN5H2.js +1 -0
- package/dist/client/assets/{pieDiagram-4H26LBE5-COG0VOTI.js → pieDiagram-4H26LBE5-CgGRmchd.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-W4KKPZXB-B_EXaE5F.js → quadrantDiagram-W4KKPZXB-BbiyoZff.js} +1 -1
- package/dist/client/assets/radar-GUYGQ44K-CsSj531M.js +1 -0
- package/dist/client/assets/{realtimeContextBase-7GM4HUov.js → realtimeContextBase-DZt86QHH.js} +1 -1
- package/dist/client/assets/{requirementDiagram-4Y6WPE33-B2q4x9QC.js → requirementDiagram-4Y6WPE33-BlYwYv8f.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-5OEKKPKP-DDm6ZbE7.js → sankeyDiagram-5OEKKPKP-Bp_j3oV6.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-3UESZ5HK-rhRn0IfH.js → sequenceDiagram-3UESZ5HK-DqC_KQou.js} +1 -1
- package/dist/client/assets/{stateDiagram-AJRCARHV-BvW4JPLu.js → stateDiagram-AJRCARHV-BrG7IGOM.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-rcRVsbsd.js +1 -0
- package/dist/client/assets/{tabActivation-CyuKtcl3.js → tabActivation-8_2uxVyZ.js} +1 -1
- package/dist/client/assets/{timeline-definition-PNZ67QCA-L9zYQso9.js → timeline-definition-PNZ67QCA-BDe3IkOy.js} +1 -1
- package/dist/client/assets/treeView-BLDUP644-BKfPh_cj.js +1 -0
- package/dist/client/assets/treemap-LRROVOQU-LOA1qPfa.js +1 -0
- package/dist/client/assets/{vennDiagram-CIIHVFJN-DgR_mHYj.js → vennDiagram-CIIHVFJN-DECIVR7V.js} +1 -1
- package/dist/client/assets/wardley-L42UT6IY-Cskczdw0.js +1 -0
- package/dist/client/assets/{wardleyDiagram-YWT4CUSO-CGyXvCpC.js → wardleyDiagram-YWT4CUSO-Bx3AJaN9.js} +1 -1
- package/dist/client/assets/{xychartDiagram-2RQKCTM6-r7Cs3EPg.js → xychartDiagram-2RQKCTM6-152u9kKH.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/db.js +2 -0
- package/dist/server/db.js.map +1 -1
- package/dist/server/index.js +2 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/lib/executionRuns.js +1 -0
- package/dist/server/lib/executionRuns.js.map +1 -1
- package/dist/server/lib/integrations/githubActionsDismissal.js +18 -0
- package/dist/server/lib/integrations/githubActionsDismissal.js.map +1 -0
- package/dist/server/lib/integrations/githubActionsDismissalRoutes.js +28 -0
- package/dist/server/lib/integrations/githubActionsDismissalRoutes.js.map +1 -0
- package/dist/server/lib/integrations/githubActionsSessions.js +3 -0
- package/dist/server/lib/integrations/githubActionsSessions.js.map +1 -1
- package/package.json +1 -1
- package/dist/client/assets/DemonstrationDialog-7SZhZFOL.js +0 -1
- package/dist/client/assets/GitHubActionsDialog-DkqbUlig.js +0 -1
- package/dist/client/assets/IconGitHubActions-Cv492Ebx.js +0 -1
- package/dist/client/assets/IconStop-BLAfFOPH.js +0 -1
- package/dist/client/assets/VerificationDialog-1yHfx-wA.js +0 -4
- package/dist/client/assets/architecture-7EHR7CIX-BOD0E418.js +0 -1
- package/dist/client/assets/bootstrap-CKpfFcGm.js +0 -97
- package/dist/client/assets/bootstrap-D_E9KrRf.css +0 -2
- package/dist/client/assets/channel-Fotke1Kp.js +0 -1
- package/dist/client/assets/chunk-QZHKN3VN-CqiyA9aj.js +0 -1
- package/dist/client/assets/chunk-WU5MYG2G-D_ijPbiv.js +0 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-BrrVv3qj.js +0 -1
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CN553QTp.js +0 -1
- package/dist/client/assets/eventmodeling-FCH6USID-FL7NzS0V.js +0 -1
- package/dist/client/assets/gitGraph-WXDBUCRP-EVJUD9sy.js +0 -1
- package/dist/client/assets/info-J43DQDTF-ZaEaI3nN.js +0 -1
- package/dist/client/assets/packet-YPE3B663-B48GA82s.js +0 -1
- package/dist/client/assets/pie-LRSECV5Y-yjxDIzfa.js +0 -1
- package/dist/client/assets/radar-GUYGQ44K-DHhlAE_N.js +0 -1
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-Dv4glvR0.js +0 -1
- package/dist/client/assets/treeView-BLDUP644-tkSf2sjH.js +0 -1
- package/dist/client/assets/treemap-LRROVOQU-d_NYOcwt.js +0 -1
- package/dist/client/assets/wardley-L42UT6IY-DWTbPrAt.js +0 -1
- /package/dist/client/assets/{array-BwJyW1Dp.js → array-DqLCdDFv.js} +0 -0
- /package/dist/client/assets/{chunk-NNHCCRGN-aoK3dxcc.js → chunk-NNHCCRGN-R8lmejY6.js} +0 -0
- /package/dist/client/assets/{cytoscape.esm-GKcJVh1-.js → cytoscape.esm-DwdZnGOm.js} +0 -0
- /package/dist/client/assets/{defaultLocale-kiwRz9Au.js → defaultLocale-CrJzLgRD.js} +0 -0
- /package/dist/client/assets/{dist-DFYFtMst.js → dist-DsfB3EIl.js} +0 -0
- /package/dist/client/assets/{graphlib-CGnxpMsl.js → graphlib-CAISHZh4.js} +0 -0
- /package/dist/client/assets/{init-CKZirZ49.js → init-C0r9Gk5G.js} +0 -0
- /package/dist/client/assets/{katex-CzE2uFQ0.js → katex-BlgnTlTx.js} +0 -0
- /package/dist/client/assets/{path-B0d9ncVi.js → path-DIKpVbHL.js} +0 -0
- /package/dist/client/assets/{rough.esm-JX0wREDd.js → rough.esm-BWqoIFNR.js} +0 -0
- /package/dist/client/assets/{src-8KvjbQeR.js → src-HpmPWpNc.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-BNv3lrIs.js";import{H as t,L as n,a as r,c as i,i as a,m as o,n as s,nt as c,p as l,q as u,r as d,t as f,u as p}from"./IconX-TosfRQdR.js";import{a as m,c as h,d as g,n as _,o as v,r as y,u as b}from"./realtimeContextBase-7GM4HUov.js";import{n as ee,t as x}from"./ApprovalRequestPanel-BLQpUi-k.js";import{t as S}from"./badge-D4QSKcZA.js";import{t as C}from"./IconDocument-CePtRoIw.js";import{a as w,i as T,n as E,o as te,t as D}from"./executionEnvironmentEvidence-CICFT5py.js";import{n as O,t as ne}from"./artifactPresentation-B2cVmrHY.js";var k=e(c(),1),A=n(),j=e=>typeof e==`object`&&!!e&&!Array.isArray(e),M=e=>e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase()),N=(e,t)=>typeof e==`string`?t(`activityView.details.capabilityDetails.values.${e}`,{defaultValue:e}):String(e),re=(e,t)=>Array.isArray(e)?e.length===0?t(`activityView.details.none`):e.map(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`?N(e,t):t(`activityView.details.unknown`)).join(`, `):typeof e==`string`||typeof e==`number`||typeof e==`boolean`?N(e,t):t(`activityView.details.unknown`),P=(e,t)=>t(`activityView.details.capabilityDetails.labels.${e}`,{defaultValue:M(e)}),ie=({value:e,path:t,t:n})=>{let r=Object.entries(e);if(r.length===0)return(0,A.jsx)(`span`,{children:n(`activityView.details.capabilityDetails.empty`)});let i=r.filter(e=>j(e[1])),a=r.filter(([,e])=>!j(e));return(0,A.jsxs)(`div`,{className:`space-y-2`,children:[i.map(([e,r])=>(0,A.jsxs)(`section`,{className:`space-y-1.5`,children:[(0,A.jsx)(`h4`,{className:`text-xs font-medium text-foreground`,children:P(e,n)}),(0,A.jsx)(ie,{value:r,path:`${t}.${e}`,t:n})]},`${t}.${e}`)),a.length>0&&(0,A.jsx)(`dl`,{className:`grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-[minmax(8rem,0.45fr)_minmax(0,1fr)]`,children:a.map(([e,r])=>(0,A.jsxs)(k.Fragment,{children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:P(e,n)}),(0,A.jsx)(`dd`,{className:`min-w-0 break-words text-sm text-foreground`,children:re(r,n)})]},`${t}.${e}`))})]})},ae=({value:e})=>{let{t}=g(`common`);return e==null||!j(e)?(0,A.jsx)(A.Fragment,{children:t(`activityView.details.unknown`)}):(0,A.jsx)(ie,{value:e,path:`capabilities`,t})},F=[`analyzing`,`correcting`,`validating`],oe=e=>typeof e==`object`&&!!e&&!Array.isArray(e),I=e=>Number.isSafeInteger(e)&&e>=0,L=e=>typeof e==`string`&&/^\d{4}-\d{2}-\d{2}T/.test(e)&&Number.isFinite(Date.parse(e)),se=e=>{if(!oe(e)||e.version!==1||!F.includes(e.phase)||!L(e.started_at)||!L(e.phase_started_at)||!L(e.last_activity_at)||e.completed_at!==null&&!L(e.completed_at)||!I(e.elapsed_ms)||!I(e.input_bytes)||!I(e.output_bytes)||!oe(e.phase_elapsed_ms))return null;let t=e.phase_elapsed_ms;return F.every(e=>I(t[e]))?{version:1,phase:e.phase,started_at:e.started_at,phase_started_at:e.phase_started_at,last_activity_at:e.last_activity_at,completed_at:e.completed_at,elapsed_ms:e.elapsed_ms,input_bytes:e.input_bytes,output_bytes:e.output_bytes,phase_elapsed_ms:{analyzing:t.analyzing,correcting:t.correcting,validating:t.validating}}:null},ce=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},R=(e,t)=>{let n=ce(e);return t.flatMap(e=>typeof n[e]==`number`&&Number.isFinite(n[e])&&n[e]>=0?[{key:e,value:n[e]}]:[])},z=({value:e})=>{let{t}=g(`common`,{keyPrefix:`epicReadinessProgress`}),n=ce(e);if(n.version!==1||n.scope!==`latest_worker_attempt`)return null;let r=R(n.phase_elapsed_ms,[`preparation`,`provider`,`correction`,`validation`,`cleanup`]),i=R(n,[`provider_calls`,`correction_calls`]),a=R(n.context,[`constraint_count`,`hard_edge_count`,`inspection_bytes`]);return(0,A.jsxs)(`details`,{className:`mt-3 text-xs text-muted-foreground`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:t(`lifecycleMetrics`)}),(0,A.jsx)(`p`,{className:`mt-2`,children:t(`latestAttempt`)}),(0,A.jsxs)(`ul`,{className:`mt-2 space-y-1 tabular-nums`,children:[r.map(e=>(0,A.jsx)(`li`,{children:t(`phaseTime`,{phase:t(`lifecyclePhases.${e.key}`),seconds:Math.floor(e.value/1e3)})},e.key)),[...i,...a].map(e=>(0,A.jsx)(`li`,{children:t(`counts.${e.key}`,{count:e.value})},e.key))]})]})},B=({run:e})=>{let{t}=g(`common`,{keyPrefix:`epicReadinessProgress`}),n=se(e.metadata?.epic_readiness_progress),r=![`queued`,`running`,`waiting`].includes(e.status),i=e.kind===`epic_plan`&&!!n&&!n?.completed_at&&!r,[a,o]=(0,k.useState)(()=>Date.now());if((0,k.useEffect)(()=>{if(!i)return;let e=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(e)},[i]),e.kind!==`epic_plan`)return null;if(!n)return(0,A.jsx)(z,{value:e.metadata?.epic_readiness_measurements});let s=n.completed_at??(r?e.completed_at??e.updated_at:null),c=Math.max(0,(s?Date.parse(s):a)-Date.parse(n.last_activity_at)),l=n.elapsed_ms+c,u=n.completed_at?t(`finished`):t(r?`stopped`:`phases.${n.phase}`);return(0,A.jsxs)(`section`,{className:`mt-4 border-t border-border/50 pt-3`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(`title`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,role:`status`,children:u}),(0,A.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs tabular-nums text-muted-foreground`,children:[(0,A.jsx)(`span`,{children:t(`elapsed`,{seconds:Math.floor(l/1e3)})}),i&&(0,A.jsx)(`span`,{children:t(`lastActivity`,{seconds:Math.floor(c/1e3)})})]}),(0,A.jsxs)(`details`,{className:`mt-3 text-xs text-muted-foreground`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:t(`metrics`)}),(0,A.jsxs)(`ul`,{className:`mt-2 space-y-1 tabular-nums`,children:[F.map(e=>(0,A.jsx)(`li`,{children:t(`phaseTime`,{phase:t(`phases.${e}`),seconds:Math.floor((n.phase_elapsed_ms[e]+(e===n.phase?c:0))/1e3)})},e)),(0,A.jsx)(`li`,{children:t(`inputBytes`,{bytes:n.input_bytes})}),(0,A.jsx)(`li`,{children:t(`outputBytes`,{bytes:n.output_bytes})})]})]}),(0,A.jsx)(z,{value:e.metadata?.epic_readiness_measurements})]})},V=(e,t)=>{if(!e||!t)return null;let n=Date.parse(e),r=Date.parse(t);return!Number.isFinite(n)||!Number.isFinite(r)||r<n?null:r-n},le=e=>e===`completed`?`success`:e===`failed`||e===`interrupted`?`destructive`:e===`cancelled`?`warning`:e===`running`||e===`waiting`||e===`queued`?`info`:`outline`,H=(e,t)=>{if(e<1e3)return t(`automationLoop.duration.milliseconds`,{count:e});let n=Math.floor(e/1e3),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60;return r>0?[t(`automationLoop.duration.hours`,{count:r}),t(`automationLoop.duration.minutes`,{count:i}),t(`automationLoop.duration.seconds`,{count:a})].join(` `):i>0?[t(`automationLoop.duration.minutes`,{count:i}),t(`automationLoop.duration.seconds`,{count:a})].join(` `):t(`automationLoop.duration.seconds`,{count:n})},U=({actionLabel:e,completedAt:t,controlId:n,onNavigate:r,role:i,runId:a,startedAt:o,stateLabel:s,status:c})=>{let{t:u}=g(`common`,{keyPrefix:`activityView`}),d=V(o,t),f=d===null?null:H(d,u);return(0,A.jsxs)(`div`,{className:`min-w-0 border-t border-border/50 py-3 first:border-t-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h4`,{className:`text-xs font-semibold text-foreground`,children:i}),c?(0,A.jsx)(S,{variant:le(c),children:u(`status.${c}`)}):(0,A.jsx)(S,{variant:`outline`,children:s}),f&&(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:u(`automationLoop.completedIn`,{duration:f})})]}),a&&(0,A.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,A.jsx)(`code`,{className:`min-w-0 break-all text-[11px] text-muted-foreground`,children:a}),r&&(0,A.jsx)(l,{id:n,type:`button`,variant:`link`,size:`xs`,className:`h-auto shrink-0 p-0`,onClick:r,children:e})]})]})},ue=new Set([`completed`,`failed`,`cancelled`,`interrupted`]),de=(e,t)=>{if(e<1e3)return t(`duration.milliseconds`,{count:e});let n=Math.floor(e/1e3),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60;return r>0?[t(`duration.hours`,{count:r}),t(`duration.minutes`,{count:i}),t(`duration.seconds`,{count:a})].join(` `):i>0?[t(`duration.minutes`,{count:i}),t(`duration.seconds`,{count:a})].join(` `):t(`duration.seconds`,{count:n})},fe=({details:e,loopDuration:t})=>{let{t:n}=g(`common`,{keyPrefix:`activityView.details.autoFix`});return(0,A.jsxs)(`dl`,{className:`mt-4 grid grid-cols-2 gap-x-4 gap-y-3 border-y border-border/60 py-3 sm:grid-cols-4`,children:[[[n(`budget.consumed`),e.attempt_count],[n(`budget.maximum`),e.max_attempts],[n(`budget.remaining`),e.remaining_attempts],[n(`cancellation.label`),n(e.cancellation_requested?`cancellation.requested`:`cancellation.notRequested`)]].map(([e,t])=>(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,A.jsx)(`dd`,{className:`mt-1 break-words text-sm font-medium text-foreground`,children:t})]},String(e))),t&&(0,A.jsxs)(`div`,{className:`col-span-2 min-w-0 sm:col-span-4`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`loopDuration`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-sm font-medium text-foreground`,children:t})]})]})},pe=({attempt:e,details:t,onNavigate:n,isProjectActivity:r})=>{let{t:i}=g(`common`,{keyPrefix:`activityView.details.autoFix`}),a=[e.child_status,e.rerun_status].some(e=>e!==null&&!ue.has(e))?i(`attemptOutcome.active`):e.terminal_reason?i(`attemptOutcome.${e.terminal_reason}`):i(`attemptOutcome.pending`),o=e.child_run_id?i(`state.unavailable`):e.terminal_reason===`dispatch_rejected`?i(`attemptOutcome.dispatch_rejected`):i(`state.notStarted`),s=e.rerun_batch_run_id?i(`state.unavailable`):i(`state.notStarted`),c=`auto-fix-${t.execution_run_id}-${e.ordinal}-source`,l=`auto-fix-${t.execution_run_id}-${e.ordinal}-action`,u=`auto-fix-${t.execution_run_id}-${e.ordinal}-verification`,d=e.source_batch_destination,f=e.child_destination,p=e.rerun_destination,m=r&&d?.surface===`checks`&&d.state===`available`&&d.batch_run_id!==null,h=f?.surface===`activity`&&f.state===`available`,_=r&&p?.surface===`checks`&&p.state===`available`&&p.batch_run_id!==null;return(0,A.jsxs)(`li`,{className:`min-w-0 rounded-xl border border-border/70 bg-background/30 px-3 sm:px-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 py-3`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:i(`attempt`,{current:e.ordinal,total:t.max_attempts})}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a})]}),(0,A.jsxs)(`div`,{className:`border-t border-border/50`,children:[(0,A.jsx)(U,{role:i(`role.observation`),status:e.source_batch_status,startedAt:e.source_batch_started_at,completedAt:e.source_batch_completed_at,runId:e.source_batch_run_id,stateLabel:i(r?`state.unavailable`:`state.projectActivityOnly`),actionLabel:i(`navigation.openSourceChecks`),controlId:c,onNavigate:n&&m?()=>n({surface:`checks`,state:`available`,batchRunId:d.batch_run_id,attemptRunId:d.attempt_run_id,kind:`source_batch`,focusTargetId:c}):void 0}),(0,A.jsx)(U,{role:i(`role.action`),status:e.child_status,startedAt:e.child_started_at,completedAt:e.child_completed_at,runId:e.child_run_id,stateLabel:o,actionLabel:i(`navigation.openRepairRun`),controlId:l,onNavigate:h&&n?()=>n({surface:`activity`,state:`available`,runId:f.run_id,kind:`repair_child`,focusTargetId:l}):void 0}),(0,A.jsx)(U,{role:i(`role.verification`),status:e.rerun_status,startedAt:e.rerun_started_at,completedAt:e.rerun_completed_at,runId:e.rerun_batch_run_id,stateLabel:r?s:i(`state.projectActivityOnly`),actionLabel:i(`navigation.openVerificationChecks`),controlId:u,onNavigate:_&&n?()=>n({surface:`checks`,state:`available`,batchRunId:p.batch_run_id,attemptRunId:p.attempt_run_id,kind:`verification_batch`,focusTargetId:u}):void 0})]}),(0,A.jsxs)(`dl`,{className:`border-t border-border/50 py-3 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`launchMode.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:e.continuation?i(`launchMode.${e.continuation}`):i(`state.notStarted`)})]}),e.fallback_used&&(0,A.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`fallback.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:i(`fallback.used`)})]}),(0,A.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`outcome.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:a})]})]}),e.terminal_message&&(0,A.jsxs)(`details`,{className:`border-t border-border/50 py-3 text-xs text-muted-foreground`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium text-muted-foreground`,children:i(`diagnostics.attempt`)}),(0,A.jsx)(`p`,{className:`mt-2 max-w-[70ch] break-words`,children:e.terminal_message})]})]})},me=({details:e,isProjectActivity:t=!0,onNavigate:n})=>{let{t:r}=g(`common`,{keyPrefix:`activityView.details.autoFix`}),i=V(e.started_at,e.completed_at),a=ue.has(e.execution_status)&&i!==null?de(i,r):null,o=`automatic-repair-${e.execution_run_id}`,s=e.terminal_reason?r(`overallOutcome.${e.terminal_reason}`,{count:e.max_attempts}):r(`overallOutcome.active`),c=`auto-fix-${e.execution_run_id}-causal`,u=e.causal_destination,d=u?.surface===`activity`&&u.state===`available`;return(0,A.jsxs)(`section`,{"aria-labelledby":o,className:`mt-5 min-w-0 rounded-2xl border border-sky-400/20 bg-sky-500/5 p-4`,children:[(0,A.jsxs)(`header`,{className:`min-w-0`,children:[(0,A.jsx)(`h2`,{id:o,className:`text-sm font-semibold text-foreground`,children:r(`title`)}),(0,A.jsx)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:e.attempt_count>0?r(`phaseWithAttempt`,{phase:r(`phase.${e.phase}`),current:e.attempt_count,total:e.max_attempts}):r(`phase.${e.phase}`)})]}),(0,A.jsx)(fe,{details:e,loopDuration:a}),!t&&(0,A.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:r(`state.projectActivityOnly`)}),(0,A.jsxs)(`dl`,{className:`mt-3 space-y-2 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`outcome.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:s})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`source.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:r(`source.${e.owner_type}`)})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`causalExecution`)}),(0,A.jsxs)(`dd`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-foreground`,children:[(0,A.jsx)(`code`,{className:`min-w-0 break-all text-[11px] text-muted-foreground`,children:e.causal_execution_run_id}),n&&d&&(0,A.jsx)(l,{id:c,type:`button`,variant:`link`,size:`xs`,className:`h-auto shrink-0 p-0`,onClick:()=>n({surface:`activity`,state:`available`,runId:u.run_id,kind:`causal_execution`,focusTargetId:c}),children:r(`navigation.openCausalRun`)})]})]})]}),e.attempts.length>0&&(0,A.jsx)(`ol`,{"aria-label":r(`attemptsAriaLabel`),className:`mt-4 space-y-3`,children:e.attempts.map(r=>(0,A.jsx)(pe,{attempt:r,details:e,onNavigate:n,isProjectActivity:t},r.ordinal))}),e.terminal_message&&(0,A.jsxs)(`details`,{className:`mt-4 rounded-xl border border-border/60 bg-background/25 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium text-muted-foreground`,children:r(`diagnostics.loop`)}),(0,A.jsx)(`p`,{className:`mt-2 max-w-[70ch] break-words`,children:e.terminal_message})]})]})},W=e=>`state.${e}`,he=({evidence:e,label:t})=>{let{t:n}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),r=e.model?e.variant?n(`evaluator.modelVariant`,{model:e.model,variant:e.variant}):e.model:n(W(e.state));return(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:t}),(0,A.jsx)(`dd`,{className:`mt-1 break-words text-sm font-medium text-foreground`,children:r})]})},ge=({agent:e})=>{let{t}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),n=e.response_truncated||e.failure_truncated;return(0,A.jsxs)(`article`,{className:`min-w-0 border-t border-border/50 py-3 first:border-t-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h5`,{className:`break-words text-xs font-semibold text-foreground`,children:e.label}),(0,A.jsx)(S,{variant:e.status===`done`?`success`:e.status===`error`?`destructive`:e.status===`stopped`?`warning`:`info`,children:t(`agentStatus.${e.status}`)}),(0,A.jsx)(`span`,{className:`break-words text-xs text-muted-foreground`,children:e.role})]}),e.response_summary&&(0,A.jsx)(`p`,{className:`mt-2 max-w-[70ch] whitespace-pre-wrap break-words text-xs text-foreground/80`,children:e.response_summary}),e.failure_summary&&(0,A.jsx)(`p`,{role:`alert`,className:`mt-2 max-w-[70ch] whitespace-pre-wrap break-words text-xs text-red-200`,children:e.failure_summary}),n&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-amber-200`,children:t(`agentEvidence.truncated`)})]})},G=({config:e})=>{let{t}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`});return(0,A.jsxs)(`dl`,{className:`mt-3 grid gap-x-4 gap-y-3 sm:grid-cols-2`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`policy.depth`)}),(0,A.jsx)(`dd`,{className:`mt-1 break-words text-foreground`,children:t(`policy.depthValue.${e.depth}`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`policy.maximum`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:e.reviewMaxIterations})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`policy.fixEnabled`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:t(e.reviewFixEnabled?`value.enabled`:`value.disabled`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`policy.pauseOnQuestions`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:t(e.pauseOnOpenQuestions?`value.enabled`:`value.disabled`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`policy.severity`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:t(`policy.severityValue.${e.reviewSeverity}`)})]})]})},_e=({iteration:e,onNavigate:t})=>{let{t:n}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),r=e.claim_policy;return(0,A.jsxs)(`details`,{className:`border-t border-border/50 py-3 text-xs`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium text-muted-foreground`,children:n(`policy.title`)}),(0,A.jsx)(`p`,{className:`mt-2 max-w-[70ch] text-muted-foreground`,children:n(`policy.historicalNotice`)}),(0,A.jsx)(G,{config:r}),e.decisions.length>0&&(0,A.jsx)(`div`,{role:`list`,"aria-label":n(`policy.decisionsAriaLabel`),className:`mt-3 space-y-2`,children:e.decisions.map(r=>{let i=r.operation.destination,a=`review-loop-${e.id}-decision-${r.sequence}`,o=i?.surface===`activity`&&i.state===`available`;return(0,A.jsxs)(`div`,{role:`listitem`,className:`min-w-0 rounded-lg border border-border/50 bg-background/25 p-2.5`,children:[(0,A.jsx)(`p`,{className:`break-words font-medium text-foreground`,children:n(`decisionPoint.${r.decision_point}`)}),(0,A.jsx)(`p`,{className:`mt-1 break-words text-muted-foreground`,children:n(`decisionCode.${r.decision_code}`,{defaultValue:n(`decisionCode.unknown`)})}),(0,A.jsx)(G,{config:r.effective_automation_config}),o&&t&&(0,A.jsx)(`button`,{id:a,type:`button`,className:`mt-2 text-xs font-medium text-primary underline-offset-4 hover:underline`,onClick:()=>t({surface:`activity`,state:`available`,runId:i.run_id,kind:`decision_operation`,focusTargetId:a}),children:n(`navigation.openDecisionOperation`)})]},r.sequence)})})]})},ve=({isProjectActivity:e,iteration:t,onNavigate:n})=>{let{t:r}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),{t:i}=g(`common`,{keyPrefix:`activityView`}),a=t.gate_evidence;return a.required_checks.length===0&&a.reason_codes.length===0&&!a.evaluation_id?null:(0,A.jsxs)(`details`,{className:`border-t border-border/50 py-3 text-xs`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium text-muted-foreground`,children:r(`gateEvidence.title`)}),(0,A.jsxs)(`dl`,{className:`mt-3 grid gap-x-4 gap-y-3 sm:grid-cols-2`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`gateEvidence.decision`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:a.decision?r(`gateDecision.${a.decision}`):r(W(a.state))})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`gateEvidence.policy`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:a.policy_status?r(`policyStatus.${a.policy_status}`):r(`state.unavailable`)})]})]}),a.reason_codes.length>0&&(0,A.jsx)(`p`,{className:`mt-3 max-w-[70ch] break-words text-muted-foreground`,children:r(`gateEvidence.reasons`,{reasons:a.reason_codes.map(e=>r(`gateReason.${e}`,{defaultValue:r(`gateReason.unknown`)})).join(`, `)})}),a.required_checks.length>0&&(0,A.jsx)(`div`,{role:`list`,"aria-label":r(`gateEvidence.checksAriaLabel`),className:`mt-3 space-y-2`,children:a.required_checks.map(a=>{let o=a.destination,s=`review-loop-${t.id}-check-${a.execution_run_id}`,c=e&&o?.state===`available`&&o.batch_run_id!==null;return(0,A.jsxs)(`div`,{role:`listitem`,className:`min-w-0 rounded-lg border border-border/50 bg-background/25 p-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`break-all font-medium text-foreground`,children:a.definition_id}),(0,A.jsx)(S,{variant:a.status===`completed`?`success`:a.status===`failed`?`destructive`:`outline`,children:i(`status.${a.status}`)}),(0,A.jsx)(S,{variant:a.currency===`current`?`info`:`warning`,children:r(`currency.${a.currency}`)})]}),a.outcome&&(0,A.jsx)(`p`,{className:`mt-1 break-words text-muted-foreground`,children:r(`gateCheckOutcome.${a.outcome}`,{defaultValue:r(`gateCheckOutcome.unknown`)})}),c&&n&&(0,A.jsx)(`button`,{id:s,type:`button`,className:`mt-2 font-medium text-primary underline-offset-4 hover:underline`,onClick:()=>n({surface:`checks`,state:`available`,batchRunId:o.batch_run_id,attemptRunId:o.attempt_run_id,kind:`required_check_attempt`,focusTargetId:s}),children:r(`navigation.openCheckAttempt`)})]},a.execution_run_id)})}),!e&&a.required_checks.length>0&&(0,A.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:r(`navigation.projectActivityOnly`)})]})},ye=({isProjectActivity:e,iteration:t,onNavigate:n})=>{let{t:r}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),i=t.runs.gate.run_id??t.gate_evidence.source_batch_run_id,a=t.outcome?r(`outcome.${t.outcome}`):r(`outcome.pending`),o=t.stop_reason===`verification_failed`||t.runs.verification.status===`failed`||t.runs.verification.status===`cancelled`||t.runs.verification.status===`interrupted`||t.resulting_review.status===`error`||t.resulting_review.status===`parse_failed`||t.resulting_review.status===`stopped`,s=o||t.phase===`verifying`||t.runs.verification.state!==`not_started`||t.resulting_review.state!==`not_started`,c=t.resulting_blocking_count??r(o?`blocking.failedResult`:s?`state.unavailable`:`state.not_started`),l=r(`phase.label`,{presentation:r(`phase.presentation.${t.phase}`),authoritative:r(`phase.authoritative.${t.authoritative_phase}`)}),u=(e,t,r)=>{let i=e.destination;if(!(!n||i?.surface!==`activity`||i.state!==`available`))return()=>n({surface:`activity`,state:`available`,runId:i.run_id,kind:t,focusTargetId:r})},d=t.runs.gate.destination,f=`review-loop-${t.id}-gate`,p=e&&n&&d?.surface===`checks`&&d.state===`available`&&d.batch_run_id?()=>n({surface:`checks`,state:`available`,batchRunId:d.batch_run_id,attemptRunId:d.attempt_run_id,kind:`required_check_gate`,focusTargetId:f}):void 0;return(0,A.jsxs)(`li`,{className:`min-w-0 rounded-xl border border-border/70 bg-background/30 px-3 sm:px-4`,children:[(0,A.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2 py-3`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:r(`iteration`,{current:t.ordinal,total:t.historical_max_iterations})}),(0,A.jsx)(S,{variant:`info`,children:l})]}),(0,A.jsx)(S,{variant:t.outcome===`repaired`?`success`:t.outcome===`failed`||t.outcome===`exhausted`?`destructive`:`outline`,children:a})]}),(0,A.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-3 border-t border-border/50 py-3 sm:grid-cols-2`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:r(`blocking.triggering`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-sm font-medium text-foreground`,children:t.triggering_blocking_count})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:r(`blocking.resulting`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-sm font-medium text-foreground`,children:c})]}),(0,A.jsx)(he,{label:r(`evaluator.observation`),evidence:t.triggering_review}),(0,A.jsx)(he,{label:r(`evaluator.verification`),evidence:t.resulting_review})]}),(0,A.jsxs)(`div`,{className:`border-t border-border/50`,children:[(0,A.jsx)(U,{role:r(`role.observation`),status:t.runs.triggering_review.status,stateLabel:r(W(t.runs.triggering_review.state)),runId:t.runs.triggering_review.run_id,startedAt:t.runs.triggering_review.started_at,completedAt:t.runs.triggering_review.completed_at,actionLabel:r(`navigation.openReview`),controlId:`review-loop-${t.id}-observation`,onNavigate:u(t.runs.triggering_review,`triggering_review`,`review-loop-${t.id}-observation`)}),(0,A.jsx)(U,{role:r(`role.actionEnvelope`),status:t.runs.action_envelope.status,stateLabel:r(W(t.runs.action_envelope.state)),runId:t.runs.action_envelope.run_id,startedAt:t.runs.action_envelope.started_at,completedAt:t.runs.action_envelope.completed_at,actionLabel:r(`navigation.openActionEnvelope`),controlId:`review-loop-${t.id}-envelope`,onNavigate:u(t.runs.action_envelope,`action_envelope`,`review-loop-${t.id}-envelope`)}),(0,A.jsx)(U,{role:r(`role.action`),status:t.runs.action.status,stateLabel:r(W(t.runs.action.state)),runId:t.runs.action.run_id,startedAt:t.runs.action.started_at,completedAt:t.runs.action.completed_at,actionLabel:r(`navigation.openAction`),controlId:`review-loop-${t.id}-action`,onNavigate:u(t.runs.action,`review_action`,`review-loop-${t.id}-action`)}),(0,A.jsx)(U,{role:r(`role.gate`),status:t.runs.gate.status,stateLabel:r(e?W(t.runs.gate.state):`navigation.projectActivityOnly`),runId:i,startedAt:t.runs.gate.started_at,completedAt:t.runs.gate.completed_at,actionLabel:r(`navigation.openGate`),controlId:f,onNavigate:p}),(0,A.jsx)(U,{role:r(`role.verification`),status:t.runs.verification.status,stateLabel:r(W(t.runs.verification.state)),runId:t.runs.verification.run_id,startedAt:t.runs.verification.started_at,completedAt:t.runs.verification.completed_at,actionLabel:r(`navigation.openVerification`),controlId:`review-loop-${t.id}-verification`,onNavigate:u(t.runs.verification,`review_verification`,`review-loop-${t.id}-verification`)})]}),(0,A.jsxs)(`dl`,{className:`border-t border-border/50 py-3 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`outcome.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:a})]}),t.stop_reason&&(0,A.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`stopReason.label`)}),(0,A.jsx)(`dd`,{className:`break-words text-foreground`,children:r(`stopReason.${t.stop_reason}`)})]})]}),(0,A.jsx)(ve,{iteration:t,isProjectActivity:e,onNavigate:n}),(0,A.jsx)(_e,{iteration:t,onNavigate:n}),t.action_agents.length>0&&(0,A.jsxs)(`details`,{className:`border-t border-border/50 py-3`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:r(`agentEvidence.title`,{count:t.action_agents.length})}),(0,A.jsx)(`p`,{className:`mt-2 max-w-[70ch] text-xs text-muted-foreground`,children:r(`agentEvidence.boundedNotice`)}),(0,A.jsx)(`div`,{className:`mt-2`,children:t.action_agents.map((e,t)=>(0,A.jsx)(ge,{agent:e},`${e.label}-${t}`))})]})]})},K=({isProjectActivity:e=!0,loop:t,onNavigate:n})=>{let{t:r}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),i=`review-loop-${t.owner_run_id}`;return(0,A.jsxs)(`section`,{"aria-labelledby":i,className:`mt-5 min-w-0 rounded-2xl border border-violet-400/20 bg-violet-500/5 p-4`,children:[(0,A.jsxs)(`header`,{children:[(0,A.jsx)(`h2`,{id:i,className:`text-sm font-semibold text-foreground`,children:r(`title`)}),(0,A.jsx)(`p`,{className:`mt-1 max-w-[70ch] break-words text-xs text-muted-foreground`,children:r(`description`)})]}),(0,A.jsx)(`ol`,{"aria-label":r(`iterationsAriaLabel`),className:`mt-4 space-y-3`,children:t.iterations.map(t=>(0,A.jsx)(ye,{iteration:t,onNavigate:n,isProjectActivity:e},t.id))})]})},be=p(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),q=({className:e})=>(0,A.jsx)(be,{"aria-hidden":`true`,className:e}),xe=e=>{let t=e.metadata?.post_build_finalization;if(!t||typeof t!=`object`||!(`check_skip_reason`in t))return null;let n=t.check_skip_reason;return n===`rebase_conflict_resolution`||n===`rebase_in_progress`||n===`git_state_unavailable`?n:null},J=(e,t)=>typeof e==`string`&&t.includes(e)?e:`unknown`,Se=e=>e===`host`||e===`docker_sandbox`?e:`unknown`,Ce=e=>Array.isArray(e)?e.map(e=>{let t=e&&typeof e==`object`?e:{},n=t.capability&&typeof t.capability==`object`?t.capability:null;return{requirement_id:typeof t.requirement_id==`string`?t.requirement_id:``,model_provider:typeof t.model_provider==`string`?t.model_provider:``,authentication_mode:J(t.authentication_mode,[`api_key`,`oauth`]),delivery:J(t.delivery,[`host_environment_inheritance`,`docker_brokered`,`none_required`]),...n?{capability:{classification:J(n.classification,[`brokered_api_key`,`brokered_oauth`,`file_exposed`,`environment_exposed`,`guest_stored`,`unavailable`,`legacy_host_inherited`])}}:{}}}):null,Y=(e,t,n)=>{if(e.kind!==`build`&&e.kind!==`build_follow_up`)return null;let r=t?.relationship===`execution`?t:null,i=r?.authority,a=i?.run_authority,o=e.metadata?.build_execution_provider,s=Array.isArray(e.failure?.details?.unsupported_requirement_ids)?e.failure.details.unsupported_requirement_ids.filter(e=>typeof e==`string`):null;return{provider:a?Se(a.effective.provider):r?Se(i?.provider):o===`host`?`host`:`unknown`,environmentId:i?.environment_id??null,environmentRevision:i?.environment_revision??null,providerVersion:i?.provider_version??null,validationFingerprint:i?.environment_validation_fingerprint??null,agent:i?.agent?J(i.agent,[`opencode`,`claude`,`codex`]):null,targetKind:i?.target.kind??null,targetKey:i?.target.key??null,targetWorkspacePath:i?.target.workspace_path??null,capabilities:i?.capabilities??null,effectiveCapabilities:a?{filesystem:a.effective.filesystem,integration_access:a.effective.integration_access,remote_git:a.effective.remote_git,resources:a.effective.resources}:null,network:a?.effective.network??null,authenticationMode:i?.authentication_mode?J(i.authentication_mode,[`validated_guest`]):null,credentialDelivery:i?.credential_delivery?J(i.credential_delivery,[`sandbox_template`]):null,profileFingerprint:typeof e.metadata?.execution_profile_fingerprint==`string`?e.metadata.execution_profile_fingerprint:a?.selected_profile.fingerprint??null,profileRevisionId:typeof e.metadata?.execution_profile_revision_id==`string`?e.metadata.execution_profile_revision_id:a?.selected_profile.revision_id??null,profileSelectionReason:e.metadata?.execution_profile_selection_reason===`project_active_at_acceptance`||e.metadata?.execution_profile_selection_reason===`historical_lineage`?e.metadata.execution_profile_selection_reason:typeof e.metadata?.execution_profile_selection_reason==`string`?`unknown`:null,worktreePreparation:a?J(a.orchestration.host_disclosure,[`worktree_and_sync_only`,`host_orchestration_and_execution`]):null,setupPlacement:a?Se(a.setup.placement):null,setupLauncher:a?J(a.setup.launcher,[`host_shell`,`docker_sandbox_exec`]):null,setupEvidence:n??null,agentPlacement:a?Se(a.agent.placement):null,agentLauncher:a?J(a.agent.launcher,[`host_process`,`docker_sandbox_exec`]):null,runtimeCredentials:a?Ce(a.runtime_credentials):null,unsupportedRequirements:s??a?.unsupported_requirements??null,degradationReasons:a?.degradations??i?.degradation_reasons??null,fallback:a?.fallback?{policy:J(a.fallback.policy,[`block`,`explicit_host`]),used:a.fallback.used===!0,from:a.fallback.from===null?null:Se(a.fallback.from),reason:typeof a.fallback.reason==`string`?a.fallback.reason:null}:null}},we=e=>e!==`repository_graph_scan`,X=(e,t)=>e.sensitivity===`sensitive`?t.sensitiveTitle:e.title??t.untitledTitle,Te=(e,t)=>{let n=[{minimum:1e9,divisor:1e9,unit:`gigabyte`},{minimum:1e6,divisor:1e6,unit:`megabyte`},{minimum:1e3,divisor:1e3,unit:`kilobyte`},{minimum:0,divisor:1,unit:`byte`}],r=n.find(t=>e>=t.minimum)??n[n.length-1];return new Intl.NumberFormat(t,{style:`unit`,unit:r.unit,unitDisplay:`short`,maximumFractionDigits:r.divisor===1?0:1}).format(e/r.divisor)},Ee=({artifactCount:e,artifacts:t})=>{let{t:n}=g(`common`,{keyPrefix:`activityView.artifacts`});if(e===0)return null;let r={sensitiveTitle:n(`sensitiveTitle`),untitledTitle:n(`untitledTitle`)},i=Math.max(0,e-t.length);return(0,A.jsxs)(`div`,{className:`mt-3`,"aria-label":n(`summaryAriaLabel`,{count:e}),children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1`,children:[(0,A.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:n(`evidence`)}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`count`,{count:e})})]}),(0,A.jsxs)(`ul`,{className:`mt-1.5 flex min-w-0 flex-wrap gap-1.5`,children:[t.map(e=>(0,A.jsx)(`li`,{className:`max-w-full truncate rounded-full border border-border/60 bg-background/35 px-2 py-0.5 text-[11px] text-muted-foreground`,children:X(e,r)},e.id)),i>0&&(0,A.jsx)(`li`,{className:`rounded-full border border-border/60 bg-background/35 px-2 py-0.5 text-[11px] text-muted-foreground`,children:n(`overflow`,{count:i})})]})]})},De=({artifactCount:e,artifacts:t,projectId:n,runId:r})=>{let{t:i,i18n:a}=g(`common`,{keyPrefix:`activityView.artifacts`}),o=O(t);if(e===0)return null;let s={sensitiveTitle:i(`sensitiveTitle`),untitledTitle:i(`untitledTitle`)},c=Math.max(0,e-t.length);return(0,A.jsxs)(`section`,{className:`mt-6`,"aria-labelledby":`artifacts-heading-${r}`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-2`,children:[(0,A.jsx)(`h3`,{id:`artifacts-heading-${r}`,className:`text-sm font-semibold text-foreground`,children:i(`title`)}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i(`count`,{count:e})})]}),(0,A.jsx)(`ul`,{className:`mt-3 space-y-2`,children:t.map(e=>{let t=X(e,s),{availability:c,isAvailable:u,canDownload:d,canOpen:f}=ne(e,o),p=d||f,m=y(n,r,e.id);return(0,A.jsxs)(`li`,{className:`min-w-0 rounded-xl border border-border/60 bg-background/30 p-3`,children:[(0,A.jsx)(`strong`,{className:`line-clamp-2 break-words text-sm font-medium text-foreground`,children:t}),(0,A.jsxs)(`dl`,{className:`mt-2 grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,A.jsx)(`dt`,{children:i(`kindLabel`)}),(0,A.jsx)(`dd`,{children:i(`kind.${e.kind}`)}),(0,A.jsx)(`dt`,{children:i(`mediaType`)}),(0,A.jsx)(`dd`,{className:`min-w-0 break-words`,children:e.media_type}),e.byte_size!=null&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{children:i(`size`)}),(0,A.jsx)(`dd`,{children:Te(e.byte_size,a.language)})]}),(0,A.jsx)(`dt`,{children:i(`expires`)}),(0,A.jsx)(`dd`,{children:new Intl.DateTimeFormat(a.language,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.expires_at))}),(0,A.jsx)(`dt`,{children:i(`sensitivityLabel`)}),(0,A.jsx)(`dd`,{children:e.sensitivity===`sensitive`?i(`sensitivity.sensitive`):i(`sensitivity.normal`)}),(0,A.jsx)(`dt`,{children:i(`availabilityLabel`)}),(0,A.jsx)(`dd`,{children:i(`availability.${c}`)})]}),e.sensitivity===`sensitive`&&d&&(0,A.jsx)(`p`,{className:`mt-2 text-xs font-medium text-amber-200`,children:i(`downloadOnly`)}),p&&(0,A.jsxs)(`div`,{className:`mt-3`,children:[d&&(0,A.jsx)(l,{asChild:!0,variant:`outline`,size:`sm`,children:(0,A.jsx)(`a`,{href:m,download:!0,"aria-label":i(`actions.downloadAriaLabel`,{title:t}),children:i(`actions.download`)})}),f&&(0,A.jsx)(l,{asChild:!0,variant:`outline`,size:`sm`,children:(0,A.jsx)(`a`,{href:m,target:`_blank`,rel:`noreferrer`,"aria-label":i(`actions.openAriaLabel`,{title:t}),children:i(`actions.open`)})})]}),!p&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:i(u?`unavailable.noAction`:`unavailable.${c}`)})]},e.id)})}),c>0&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:i(`overflowDescription`,{count:c})})]})},Oe=(e,t)=>{let n=e.item?.run??e.context;return(t.item?.run??t.context).created_at.localeCompare(n.created_at)||t.id.localeCompare(e.id)},ke=e=>`${e.childRunId}:${e.parentRunId}:${e.code}`,Z=(e,t,n)=>{let r=new Set(n.map(e=>e.run.id)),i=new Map;for(let n of[...e.context_nodes,...t.context_nodes])r.has(n.id)||i.set(n.id,n);let a=new Map,o=new Set([...r,...i.keys()]);for(let n of[...e.boundaries,...t.boundaries])(n.code===`missing_parent`||n.code===`depth_limited`)&&o.has(n.parent_run_id)||a.set(`${n.child_run_id}:${n.parent_run_id}:${n.code}`,n);return{context_nodes:[...i.values()],boundaries:[...a.values()]}},Ae=(e,t)=>{let n=new Map,r=new Set;for(let e of t.context_nodes){if(!we(e.kind)){r.add(e.id);continue}n.set(e.id,{id:e.id,key:e.id,kind:`context`,runKind:e.kind,item:null,context:e,children:[],boundaries:[],depth:0,ancestorKinds:[]})}for(let t of e){if(!we(t.run.kind)){r.add(t.run.id),n.delete(t.run.id);continue}r.delete(t.run.id),n.set(t.run.id,{id:t.run.id,key:t.run.id,kind:`primary`,runKind:t.run.kind,item:t,context:null,children:[],boundaries:[],depth:0,ancestorKinds:[]})}let i=new Map;for(let e of t.boundaries){let t={childRunId:e.child_run_id,parentRunId:e.parent_run_id,code:e.code},n=i.get(e.child_run_id)??[];n.some(e=>ke(e)===ke(t))||n.push(t),i.set(e.child_run_id,n)}let a=e=>e.item?.run.parent_run_id??e.context?.parent_run_id??null,o=[...n.values()].filter(e=>e.kind===`primary`).map(e=>e.id),s=new Set(o);for(let e of o){let t=new Set([e]),o=n.get(e);for(;o&&!i.has(o.id);){let e=a(o);if(!e||r.has(e)||t.has(e))break;let i=n.get(e);if(!i)break;s.add(e),t.add(e),o=i}}for(let e of n.values())e.kind===`context`&&!s.has(e.id)&&n.delete(e.id);let c=new Set;for(let e of n.values()){let t=[e.id],r=new Map([[e.id,0]]),o=e;for(;!i.has(o.id);){let e=a(o);if(!e||!n.has(e))break;let i=r.get(e);if(i!==void 0){for(let e of t.slice(i))c.add(e);break}r.set(e,t.length),t.push(e),o=n.get(e)}}let l=[];for(let e of n.values()){let t=a(e),o=i.get(e.id)??[];if(e.boundaries.push(...o),!t){l.push(e);continue}if(c.has(e.id)){e.boundaries.push({childRunId:e.id,parentRunId:t,code:`invalid_hierarchy`}),l.push(e);continue}if(o.length>0){l.push(e);continue}if(r.has(t)){e.boundaries.push({childRunId:e.id,parentRunId:t,code:`feature_hidden`}),l.push(e);continue}let s=n.get(t);if(!s){e.boundaries.push({childRunId:e.id,parentRunId:t,code:`invalid_hierarchy`}),l.push(e);continue}s.children.push(e)}let u=(e,t,n)=>{e.depth=t,e.ancestorKinds=n,e.children.sort(Oe);for(let r of e.children)u(r,t+1,[...n,e.runKind])};l.sort(Oe);for(let e of l)u(e,0,[]);return{roots:l,representedRunIds:new Set(n.keys())}},je=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Me=e=>[`opencode_approval_decided`,`opencode_approval_cancelled`,`opencode_approval_expired`].includes(e.event_type)||e.event_type===`opencode_approval_invalidated`&&je(e.metadata)&&Object.prototype.hasOwnProperty.call(e.metadata,`opencode_approval`),Ne=e=>typeof e==`string`&&e.trim().length>0&&Number.isFinite(Date.parse(e)),Pe=e=>{if(!Me(e)||e.metadata_schema_version!==1||!je(e.metadata))return null;let t=e.metadata.opencode_approval;if(!je(t)||![`id`,`permission`,`parentId`,`nativeSessionId`,`nativeRequestId`].every(e=>typeof t[e]==`string`&&t[e].trim().length>0)||!Array.isArray(t.patterns)||!t.patterns.every(e=>typeof e==`string`)||!(t.command===null||typeof t.command==`string`)||!(t.description===null||typeof t.description==`string`)||![`parentKind`,`status`,`source`,`reason`].every(e=>typeof t[e]==`string`)||!(t.decision===null||typeof t.decision==`string`)||![`ticket`,`chat`,`spec`].includes(String(t.parentKind))||![`approved`,`rejected`,`cancelled`,`invalidated`].includes(String(t.status))||![`operator`,`native`,`system`].includes(String(t.source))||![`operator_decision`,`native_reply`,`transport_cancelled`,`approval_expired`,`server_restart`,`binding_unavailable`].includes(String(t.reason))||!(t.decision===null||[`once`,`session`,`reject`].includes(String(t.decision)))||!Ne(t.createdAt)||!Ne(t.resolvedAt)||Date.parse(t.resolvedAt)<Date.parse(t.createdAt)||!(t.evidenceTruncated===void 0||t.evidenceTruncated===!0))return null;let n=t,r=n.reason===`operator_decision`?`operator`:n.reason===`native_reply`?`native`:`system`,i=n.reason===`approval_expired`?`opencode_approval_expired`:n.status===`invalidated`?`opencode_approval_invalidated`:n.status===`cancelled`?`opencode_approval_cancelled`:`opencode_approval_decided`,a=n.status===`approved`||n.status===`rejected`;return n.source!==r||e.event_type!==i||a&&n.source===`system`||!a&&n.source!==`system`||n.status===`approved`&&n.decision!==`once`&&n.decision!==`session`||n.status===`rejected`&&n.decision!==`reject`||!a&&n.decision!==null?null:n},Fe=(e,t)=>{if(!Me(e))return null;let n=Pe(e);return n?t(`opencodeApproval.summary`,{outcome:t(`opencodeApproval.outcome.${n.reason===`approval_expired`?`expired`:n.status===`approved`?n.decision:n.status}`),source:t(`opencodeApproval.source.${n.source}`),permission:n.permission}):t(`opencodeApproval.unavailable`)},Ie=e=>e===`failed`||e===`interrupted`?`border-red-400/30 bg-red-500/10 text-red-200`:e===`completed`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e===`running`||e===`waiting`||e===`queued`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border bg-muted/40 text-muted-foreground`,Le=({summary:e})=>{let{t}=g(`common`,{keyPrefix:`activityView.automationLoop`}),n=e.current_iteration??e.iteration_count,r=n>0,i=e.stop_reason??e.outcome,a=i?t(`${e.stop_reason?`stopReason`:`outcome`}.${e.kind}.${i}`,{defaultValue:t(`state.unavailable`)}):null;return(0,A.jsxs)(`div`,{className:`mt-3 min-w-0 rounded-xl border border-border/60 bg-background/30 px-3 py-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:t(`kind.${e.kind}`)}),(0,A.jsx)(S,{variant:e.phase===`terminal`?`outline`:e.phase===`paused`?`warning`:`info`,children:t(`phase.${e.phase}`)}),r&&(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`iteration`,{current:n,total:e.historical_max_iterations})})]}),a&&(0,A.jsx)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:a})]})},Re=({item:e,isChild:t=!1,isSelected:n,ancestryLabel:r,onFocusRun:i,onSelectRun:a})=>{let{t:s,i18n:c}=g(`common`,{keyPrefix:`activityView`}),{run:l,latest_event:u,latest_outcome:d}=e,f=u?Fe(u,s):null,p=f??d?.text,m=s(`kind.${l.kind}`,{defaultValue:s(`kind.unknown`)}),h=s(`status.${l.status}`,{defaultValue:s(`status.unknown`)}),_=new Intl.DateTimeFormat(c.language,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(u?.created_at??l.updated_at)),v=l.retry_of_run_id?s(`details.retryLineage`,{count:l.attempt}):null,y=l.kind===`environment_validation`?e.environment_context:null,b=Y(l,e.environment_context),x=E(e.environment_context),S=y?.live_environment,C=y?s(`environmentContext.summary`,{target:S?.target_key??s(`environmentContext.unknown`),revision:S?.environment_revision??s(`environmentContext.unknown`),provider:S?.provider_kind??s(`environmentContext.unknown`)}):l.source_reference?.label??s(`details.sourceUnavailable`),w=(e.loop_summaries??[]).filter(e=>e.owner_run_id===l.id&&(e.kind===`review_auto_fix`&&l.kind===`automation_progression`||e.kind===`check_auto_fix`&&l.kind===`check_auto_fix`)),T=s(`actions.viewDetailsForRun`,{kind:m,count:l.attempt}),te=w.map(e=>{let t=e.current_iteration??e.iteration_count,n=e.stop_reason??e.outcome,r=n?s(`automationLoop.${e.stop_reason?`stopReason`:`outcome`}.${e.kind}.${n}`,{defaultValue:s(`automationLoop.state.unavailable`)}):null;return[s(`automationLoop.kind.${e.kind}`),s(`automationLoop.phase.${e.phase}`),t>0?s(`automationLoop.iteration`,{current:t,total:e.historical_max_iterations}):null,r].filter(e=>e!==null).join(`, `)}),D=te.length>0?s(`actions.viewDetailsForRunWithLoopSummary`,{run:T,summary:te.join(`; `)}):T,O=r?s(`hierarchy.accessiblePath`,{row:D,path:r}):D;return(0,A.jsx)(`article`,{role:`button`,tabIndex:0,"aria-current":n?`true`:void 0,"aria-label":O,"data-activity-run-id":l.id,onFocus:()=>i(l.id),onClick:e=>a(l.id,e.currentTarget),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a(l.id,e.currentTarget))},className:o(`rounded-2xl border bg-card/55 p-4 transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,n?`border-primary/60`:`border-border/70 hover:border-border`,t&&`rounded-xl bg-background/35`),children:(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:s(`runAttemptTitle`,{kind:m,count:l.attempt})}),(0,A.jsx)(`span`,{className:o(`rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em]`,Ie(l.status)),children:h})]}),(0,A.jsxs)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:[C,` · `,_]}),x&&(0,A.jsx)(ee,{evidence:x,showDegraded:x.provider!==`host`,className:`mt-2`}),b&&(0,A.jsxs)(`div`,{className:`mt-1 space-y-1 text-xs font-medium text-sky-200`,children:[(0,A.jsx)(`p`,{children:s(`buildEvidence.timeline.${b.provider}`,{revision:b.environmentRevision??s(`buildEvidence.unknown`)})}),b.profileFingerprint&&(0,A.jsx)(`p`,{className:`break-all font-mono text-[11px] font-normal text-sky-100/80`,children:s(`buildEvidence.profileSelection`,{fingerprint:b.profileFingerprint,reason:s(`buildEvidence.selectionReason.${b.profileSelectionReason??`unknown`}`)})}),b.network&&(0,A.jsx)(`p`,{className:`font-normal text-sky-100/80`,children:s(`buildEvidence.network.summary`,{mode:s(`buildEvidence.network.mode.${b.network.requested_mode}`),enforcement:s(`buildEvidence.network.enforcement.${b.network.enforcement}`)})})]}),v&&(0,A.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:v}),p&&(0,A.jsx)(`p`,{className:o(`mt-2 line-clamp-2 break-words text-sm`,!f&&d?.source===`failure_message`?`text-red-300`:`text-foreground/80`),children:p}),w.map(e=>(0,A.jsx)(Le,{summary:e},e.kind)),(0,A.jsx)(Ee,{artifacts:e.artifacts,artifactCount:e.artifact_count})]})})},ze=({attempt:e,isSelected:t,onFocusRun:n,onSelectRun:r})=>{let{t:i}=g(`common`,{keyPrefix:`activityView`}),a=i(`kind.check_attempt`);return(0,A.jsx)(`article`,{role:`button`,tabIndex:0,"aria-current":t?`true`:void 0,"aria-label":i(`actions.viewDetailsForCheck`,{name:e.command_snapshot.name}),"data-activity-run-id":e.execution_run_id,onFocus:()=>n(e.execution_run_id),onClick:t=>r(e.execution_run_id,t.currentTarget),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e.execution_run_id,t.currentTarget))},className:o(`rounded-xl border bg-background/35 p-3 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,t?`border-primary/60`:`border-border/70`),children:(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground`,children:e.command_snapshot.name}),(0,A.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[a,` · `,i(`status.${e.execution_status}`)]})]})})},Be=({node:e,ancestryLabel:t})=>{let{t:n,i18n:r}=g(`common`,{keyPrefix:`activityView`}),i=e.context,a=n(`kind.${i.kind}`,{defaultValue:n(`kind.unknown`)}),s=n(`status.${i.status}`,{defaultValue:n(`status.unknown`)}),c=new Intl.DateTimeFormat(r.language,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(i.completed_at??i.created_at));return(0,A.jsxs)(`article`,{"aria-label":n(`hierarchy.contextAccessibleLabel`,{kind:a,count:i.attempt,path:t??n(`hierarchy.topLevel`)}),className:`rounded-xl border border-dashed border-border/70 bg-muted/15 px-3 py-3`,children:[(0,A.jsx)(`p`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:n(`hierarchy.contextOnly`)}),(0,A.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h2`,{className:`text-sm font-medium text-foreground/90`,children:n(`runAttemptTitle`,{kind:a,count:i.attempt})}),(0,A.jsx)(`span`,{className:o(`rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em]`,Ie(i.status)),children:s})]}),(0,A.jsxs)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:[i.source_reference?.label??n(`details.sourceUnavailable`),` · `,c]})]})},Q=({boundary:e})=>{let{t}=g(`common`,{keyPrefix:`activityView.hierarchy`});return(0,A.jsxs)(`div`,{role:`note`,className:`mb-2 rounded-lg border border-amber-400/25 bg-amber-500/8 px-3 py-2 text-xs text-amber-100`,children:[(0,A.jsx)(`p`,{className:`font-medium`,children:t(`boundary.${e.code}`)}),(0,A.jsx)(`p`,{className:`mt-0.5 text-amber-100/75`,children:t(`partialBranch`)})]})},Ve=e=>e<3?`mt-2 space-y-2 border-l border-border/70 pl-2 lg:pl-3`:e<6?`mt-2 space-y-2 lg:border-l lg:border-border/70 lg:pl-3`:`mt-2 space-y-2`,He=(e,t)=>(e.item?.check_batch?.attempts??[]).filter(e=>!t.has(e.execution_run_id)),Ue=(e,t)=>e.children.length>0||He(e,t).length>0,We=({node:e,representedRunIds:t,selectedRunId:n,onFocusRun:r,onSelectRun:i})=>{let{t:a}=g(`common`,{keyPrefix:`activityView`}),o=e.ancestorKinds.map(e=>a(`kind.${e}`,{defaultValue:a(`kind.unknown`)})),s=o.length>0?o.join(` › `):null,c=He(e,t),l=Ue(e,t);return(0,A.jsxs)(A.Fragment,{children:[e.depth>=3&&s&&(0,A.jsx)(`p`,{className:`mb-1.5 break-words text-[11px] text-muted-foreground lg:sr-only`,children:a(`hierarchy.nestedUnder`,{path:s})}),e.boundaries.map(e=>(0,A.jsx)(Q,{boundary:e},`${e.parentRunId}:${e.code}`)),e.item?(0,A.jsx)(Re,{item:e.item,isChild:e.depth>0,isSelected:n===e.id,ancestryLabel:s,onFocusRun:r,onSelectRun:i}):(0,A.jsx)(Be,{node:e,ancestryLabel:s}),l&&(0,A.jsxs)(`ol`,{className:Ve(e.depth),children:[c.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsx)(ze,{attempt:e,isSelected:n===e.execution_run_id,onFocusRun:r,onSelectRun:i})},e.execution_run_id)),e.children.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsx)(We,{node:e,representedRunIds:t,selectedRunId:n,onFocusRun:r,onSelectRun:i})},e.key))]})]})},Ge=({node:e,representedRunIds:t,selectedRunId:n,onFocusRun:r,onSelectRun:i})=>{let{t:a}=g(`common`,{keyPrefix:`activityView`}),o=(0,A.jsx)(We,{node:e,representedRunIds:t,selectedRunId:n,onFocusRun:r,onSelectRun:i});return Ue(e,t)?(0,A.jsx)(`section`,{"aria-label":a(`group.ariaLabel`),className:`min-w-0 rounded-2xl border border-border/70 bg-card/25 p-3`,children:o}):o},Ke=({items:e,hierarchy:t={context_nodes:[],boundaries:[]},scope:n,selectedRunId:r,isLoading:i,isLoadingMore:a,isReconnecting:o,hasMore:s,error:c,onLoadMore:u,onRefresh:d,onSelectRun:f,focusRef:p})=>{let{t:m}=g(`common`,{keyPrefix:`activityView`}),h=Ae(e,t),_=(0,k.useRef)(null);return(0,k.useLayoutEffect)(()=>{!_.current||document.activeElement!==document.body||[...document.querySelectorAll(`[data-activity-run-id]`)].find(e=>e.dataset.activityRunId===_.current)?.focus()}),(0,A.jsxs)(`section`,{ref:p,tabIndex:-1,"aria-label":m(`timelineAriaLabel`),className:`min-h-0 min-w-0 overflow-x-hidden px-4 py-5 sm:px-6`,children:[o&&(0,A.jsx)(`p`,{role:`status`,className:`mb-3 rounded-xl border border-amber-400/25 bg-amber-500/8 px-3 py-2 text-xs text-amber-200`,children:m(`states.reconnecting`)}),c&&e.length>0&&(0,A.jsxs)(`div`,{role:`alert`,className:`mb-3 flex flex-col gap-2 rounded-xl border border-red-400/25 bg-red-500/8 px-3 py-2 text-xs text-red-200 sm:flex-row sm:items-center sm:justify-between`,children:[(0,A.jsx)(`span`,{children:c}),(0,A.jsx)(l,{type:`button`,variant:`ghost`,size:`xs`,onClick:d,children:m(`actions.tryAgain`)})]}),i&&e.length===0&&(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:m(`states.loading`)}),c&&e.length===0&&(0,A.jsxs)(`div`,{className:`rounded-2xl border border-red-400/25 bg-red-500/8 p-4`,role:`alert`,children:[(0,A.jsx)(`p`,{className:`text-sm text-red-200`,children:c}),(0,A.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,className:`mt-3`,onClick:d,children:m(`actions.tryAgain`)})]}),!i&&!c&&e.length===0&&!s&&(0,A.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-card/30 p-6 text-center`,children:[(0,A.jsx)(`h2`,{className:`text-base font-medium text-foreground`,children:m(`scope.${n.type}.emptyTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:m(`scope.${n.type}.emptyDescription`)})]}),(0,A.jsx)(`ol`,{className:`space-y-3`,children:h.roots.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsx)(Ge,{node:e,representedRunIds:h.representedRunIds,selectedRunId:r,onFocusRun:e=>{_.current=e},onSelectRun:f})},e.key))}),s&&(0,A.jsx)(l,{type:`button`,variant:`outline`,className:`mt-4 w-full`,disabled:i||a,onClick:u,children:m(`actions.loadMore`)})]})},qe=({evidence:e})=>{let{t,i18n:n}=g(`common`,{keyPrefix:`activityView.opencodeApproval`}),r=e=>new Intl.DateTimeFormat(n.language,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e));return(0,A.jsxs)(`div`,{className:`mt-2 min-w-0 text-xs`,children:[(0,A.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-muted-foreground`,children:[[{key:`id`,value:e.id},{key:`permission`,value:e.permission},{key:`source`,value:t(`source.${e.source}`)},{key:`reason`,value:t(`reason.${e.reason}`)},{key:`scope`,value:e.decision&&t(`scope.${e.decision}`)},{key:`command`,value:e.command},{key:`description`,value:e.description}].filter(e=>e.value).map(e=>(0,A.jsxs)(`div`,{className:`contents`,children:[(0,A.jsx)(`dt`,{children:t(`fields.${e.key}`)}),(0,A.jsx)(`dd`,{className:`min-w-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.value})]},e.key)),e.patterns.length>0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{children:t(`fields.patterns`)}),(0,A.jsx)(`dd`,{className:`min-w-0`,children:(0,A.jsx)(`ul`,{className:`space-y-1 font-mono`,children:e.patterns.map((e,t)=>(0,A.jsx)(`li`,{className:`whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e},t))})})]}),(0,A.jsx)(`dt`,{children:t(`fields.createdAt`)}),(0,A.jsx)(`dd`,{children:(0,A.jsx)(`time`,{dateTime:e.createdAt,children:r(e.createdAt)})}),(0,A.jsx)(`dt`,{children:t(`fields.resolvedAt`)}),(0,A.jsx)(`dd`,{children:(0,A.jsx)(`time`,{dateTime:e.resolvedAt,children:r(e.resolvedAt)})})]}),e.evidenceTruncated&&(0,A.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:t(`truncated`)}),(0,A.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:t(`executionNotice`)})]})},Je=(e,t)=>!e||!Number.isFinite(Date.parse(e))?null:new Intl.DateTimeFormat(t,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e)),Ye=e=>{if(e==null)return null;if(e<1e3)return`${e} ms`;let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m ${i}s`:r>0?`${r}m ${i}s`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`},Xe=20,Ze=({events:e,selectedEventId:t})=>{let{t:n,i18n:r}=g(`common`,{keyPrefix:`activityView`}),i=(0,k.useRef)(null),a=e.filter(e=>!e.event_type.startsWith(`artifact_`)||e.id===t),s=a.slice(-Xe),c=t?a.find(e=>e.id===t):null,l=c&&!s.some(e=>e.id===c.id)?[c,...s.slice(-(Xe-1))]:s;return(0,k.useEffect)(()=>{t&&(i.current?.scrollIntoView?.({block:`center`}),i.current?.focus({preventScroll:!0}))},[e,t]),(0,A.jsx)(`ol`,{className:`space-y-2`,"aria-label":n(`details.evidenceAriaLabel`),children:l.map((e,a)=>{let s=Pe(e),c=Fe(e,n)??(e.message||n(`events.fallback`)),u=l[a+1],d=u?Date.parse(u.created_at)-Date.parse(e.created_at):null;return(0,A.jsxs)(`li`,{ref:e.id===t?i:void 0,"aria-current":e.id===t?`true`:void 0,tabIndex:e.id===t?-1:void 0,className:o(`rounded-xl border border-border/60 bg-background/30 px-3 py-2 outline-none`,e.id===t&&`border-sky-300/70 bg-sky-500/10 ring-2 ring-sky-300/40`),children:[(0,A.jsx)(`span`,{className:`block text-xs font-medium text-foreground [overflow-wrap:anywhere]`,children:c}),s&&(0,A.jsx)(qe,{evidence:s}),(0,A.jsxs)(`dl`,{className:`mt-2 grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,A.jsx)(`dt`,{children:n(`events.sequence`)}),(0,A.jsx)(`dd`,{children:e.sequence}),e.to_status&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{children:n(`events.transition`)}),(0,A.jsx)(`dd`,{children:e.from_status?n(`events.transitionValue`,{from:n(`status.${e.from_status}`),to:n(`status.${e.to_status}`)}):n(`status.${e.to_status}`)})]}),e.domain_status&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{children:n(`events.outcome`)}),(0,A.jsx)(`dd`,{className:`break-words`,children:e.domain_status})]}),d!=null&&d>=0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{children:n(`events.timeInState`)}),(0,A.jsx)(`dd`,{children:Ye(d)})]})]}),(0,A.jsx)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:Je(e.created_at,r.language)})]},e.id)})})},Qe=50,$e=100,et={context_nodes:[],boundaries:[]},tt=(e,t)=>e===`project`?{type:`project`}:{type:e,id:t},nt=(e,t)=>t.run.created_at.localeCompare(e.run.created_at)||t.run.id.localeCompare(e.run.id),rt=(e,t)=>{let n=new Map(e.map(e=>[e.run.id,e]));for(let e of t){if(!we(e.run.kind))continue;let t=n.get(e.run.id),r=e.parent&&!we(e.parent.kind)?{...e,parent:null}:e;(!t||r.run.updated_at>=t.run.updated_at)&&n.set(r.run.id,r)}return[...n.values()].sort(nt)},it=(e,n,r,i)=>{let{t:a}=g(`common`,{keyPrefix:`activityView`}),o=_(),s=n.type===`project`?null:n.id,c=JSON.stringify([e,n.type,s,r,i]),[l,d]=(0,k.useState)({key:c,items:[],hierarchy:et,nextCursor:null,loadedPages:1}),[f,p]=(0,k.useState)(!1),[m,v]=(0,k.useState)(!1),[y,b]=(0,k.useState)(null),[ee,x]=(0,k.useState)(0),S=(0,k.useRef)(0),C=(0,k.useRef)(null),w=(0,k.useRef)(null),T=(0,k.useRef)(c),E=l.key===c?l.items:[],te=l.key===c?l.hierarchy:et,D=l.key===c?l.nextCursor:null;return(0,k.useEffect)(()=>{T.current=c},[c]),(0,k.useEffect)(()=>{let o=l.key===c?l.loadedPages:1,f=S.current+1;if(S.current=f,C.current?.abort(),v(!1),p(!0),b(null),d(e=>e.key===c?e:{key:c,items:[],hierarchy:et,nextCursor:null,loadedPages:1}),!e){d({key:c,items:[],hierarchy:et,nextCursor:null,loadedPages:1}),p(!1);return}let m=new AbortController;return(async()=>{let t=[],c=et,l=null,u=0;do{let o=await h(e,{scope:tt(n.type,s),kind:r===`all`?void 0:r,statuses:i===`all`||i===`approval_required`?void 0:[i],domainStatus:i===`approval_required`?i:void 0,cursor:l,limit:Qe,signal:m.signal,fallbackErrorMessage:a(`errors.list`)});t=rt(t,o.items),c=Z(c,o.hierarchy,t),l=o.next_cursor,u+=1}while(l&&u<o);return{items:t,hierarchy:c,nextCursor:l,loadedPages:u}})().then(e=>{!m.signal.aborted&&f===S.current&&d({key:c,...e})}).catch(e=>{!u(e)&&f===S.current&&b(e instanceof t?e.message:a(`errors.list`))}).finally(()=>{!m.signal.aborted&&f===S.current&&p(!1)}),()=>m.abort()},[r,e,c,ee,s,n.type,i,a]),(0,k.useEffect)(()=>{let t=t=>{t&&typeof t==`object`&&`project_id`in t&&t.project_id!==e||(w.current||=setTimeout(()=>{w.current=null,x(e=>e+1)},$e))};return o.on(`execution-run:updated`,t),o.on(`lifecycle-event:created`,t),o.on(`review-loop-iteration:updated`,t),o.on(`connect`,t),()=>{o.off(`execution-run:updated`,t),o.off(`lifecycle-event:created`,t),o.off(`review-loop-iteration:updated`,t),o.off(`connect`,t)}},[e,o]),(0,k.useEffect)(()=>()=>{C.current?.abort(),w.current&&clearTimeout(w.current)},[]),{items:E,hierarchy:te,runs:E.map(e=>e.run),error:y,isLoading:f,isLoadingMore:m,hasMoreRuns:D!==null,loadMore:()=>{if(!e||!D||f||m)return;let o=new AbortController;C.current?.abort(),C.current=o;let l=c,p=S.current;v(!0),b(null),h(e,{scope:tt(n.type,s),kind:r===`all`?void 0:r,statuses:i===`all`||i===`approval_required`?void 0:[i],domainStatus:i===`approval_required`?i:void 0,cursor:D,limit:Qe,signal:o.signal,fallbackErrorMessage:a(`errors.list`)}).then(e=>{T.current===l&&S.current===p&&d(t=>{if(t.key!==l)return t;let n=rt(t.items,e.items);return{...t,items:n,hierarchy:Z(t.hierarchy,e.hierarchy,n),nextCursor:e.next_cursor,loadedPages:t.loadedPages+1}})}).catch(e=>{!u(e)&&T.current===l&&S.current===p&&b(e instanceof t?e.message:a(`errors.list`))}).finally(()=>{!o.signal.aborted&&T.current===l&&S.current===p&&v(!1)})},refresh:()=>x(e=>e+1)}},at=`test.check_batch.check_attempt.check_repair.check_auto_fix.github_actions.plan.planning_agent.epic_plan.epic_build.build.review.chat_turn.spec_turn.spec_review.build_follow_up.plan_follow_up.automation_progression.automation_review_fix.automation_commit.automation_push.automation_pull_request.repository_graph_scan.environment_validation.git_push.service`.split(`.`),ot=100,st=`(max-width: 1023px)`,ct=e=>{if(!e||typeof e!=`object`)return null;let t=e.activityRelatedOrigin;if(!t||typeof t!=`object`)return null;let n=t;return typeof n.runId==`string`&&typeof n.focusTargetId==`string`?{runId:n.runId,focusTargetId:n.focusTargetId}:null},lt=e=>{let t=window.history.state&&typeof window.history.state==`object`?window.history.state:{};window.history.replaceState({...t,activityRelatedOrigin:e},``)},ut=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(st).matches,$=({label:e,value:t,stacked:n=!1})=>t==null||t===``?null:(0,A.jsxs)(`div`,{className:n?`border-b border-border/50 py-2 last:border-0`:`grid grid-cols-[minmax(6rem,0.35fr)_minmax(0,1fr)] gap-3 border-b border-border/50 py-2 last:border-0`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,A.jsx)(`dd`,{className:n?`mt-2 min-w-0 break-words text-sm text-foreground`:`min-w-0 break-words text-sm text-foreground`,children:t})]}),dt=({detail:e,detailError:t,events:n,selectedEventId:r,isLoading:i,isRetrying:a,isProjectActivity:o,isRelatedActivity:s,onClose:c,onNavigateToLifecycleSource:u,onNavigateToRelatedReference:d,onRetry:p,projectId:m,retryError:h,retryEligibility:_,retrySourceAttempt:v,run:y,titleRef:b})=>{let{t:S,i18n:C}=g(`common`,{keyPrefix:`activityView`}),w=e?.details,te=w?.kind===`build`?w.setup_authority??null:null,O=_,ne=O.eligible,k=y.kind===`check_batch`,j=y.kind===`environment_validation`?e?.environment_context:null,M=Y(y,e?.environment_context,te),N=xe(y),re=E(e?.environment_context),P=j?.live_environment,ie=j?S(`environmentContext.summary`,{target:P?.target_key??S(`environmentContext.unknown`),revision:P?.environment_revision??S(`environmentContext.unknown`),provider:P?.provider_kind??S(`environmentContext.unknown`)}):null,F=y.metadata?.requested_network_mode===`allowlist`||y.metadata?.requested_network_mode===`unrestricted`?y.metadata.requested_network_mode:null,oe=typeof y.metadata?.observed_network_posture==`string`?y.metadata.observed_network_posture:null,I=typeof y.metadata?.network_enforcement==`string`?y.metadata.network_enforcement:null,L=w?.kind===`github_actions`&&w.available?w.html_url:null,se=!j&&y.source_reference?.available&&(y.source_reference.kind===`ticket`||y.source_reference.kind===`chat_session`||y.source_reference.kind===`spec_session`)?y.source_reference:null,ce=null;return y.retry_of_run_id&&(ce=v==null?S(`details.priorAttemptUnavailable`):S(`details.retryOfAttempt`,{count:v})),(0,A.jsxs)(`aside`,{"aria-label":S(`details.ariaLabel`),className:`min-w-0 p-4 lg:p-5`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:S(`kind.${y.kind}`)}),(0,A.jsx)(`h2`,{ref:b,tabIndex:-1,className:`mt-1 text-lg font-semibold text-foreground`,children:S(`details.title`)})]}),(0,A.jsx)(l,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":S(s?`actions.back`:`actions.close`),className:`shrink-0 text-muted-foreground hover:text-foreground`,onClick:c,children:s?(0,A.jsx)(q,{className:`h-4 w-4`}):(0,A.jsx)(f,{className:`h-4 w-4`})})]}),(0,A.jsxs)(`dl`,{className:`mt-4`,children:[(0,A.jsx)($,{label:S(`details.status`),value:S(`status.${y.status}`)}),N&&(0,A.jsx)($,{label:S(`details.postBuildChecks`),value:S(`checkSkipReason.${N}`)}),(0,A.jsx)($,{label:S(`details.attempt`),value:S(`details.attemptValue`,{count:y.attempt})}),(0,A.jsx)($,{label:S(`details.lineage`),value:ce}),(0,A.jsx)($,{label:S(j?`details.environment`:`details.source`),value:ie??y.source_reference?.label??S(`details.sourceUnavailable`)}),(0,A.jsx)($,{label:S(`details.created`),value:Je(y.created_at,C.language)}),(0,A.jsx)($,{label:S(`details.started`),value:Je(y.started_at,C.language)}),(0,A.jsx)($,{label:S(`details.completed`),value:Je(y.completed_at,C.language)})]}),re&&(0,A.jsx)(ee,{evidence:re,showDegraded:re.provider!==`host`,className:`mt-3`}),(0,A.jsx)(B,{run:y}),y.failure&&(0,A.jsxs)(`div`,{className:`mt-4 rounded-xl border border-red-400/25 bg-red-500/8 p-3`,children:[(0,A.jsx)(`p`,{className:`text-xs font-semibold text-red-200`,children:S(`details.failureReason`)}),(0,A.jsx)(`p`,{className:`mt-1 break-words text-sm text-red-100/90`,children:y.failure.message})]}),y.kind===`environment_validation`&&j&&(0,A.jsxs)(`section`,{className:`mt-4 rounded-xl border border-sky-400/20 bg-sky-500/7 p-3`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-semibold text-sky-100`,children:S(`details.environmentValidationEvidence`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.agent`),value:typeof y.metadata?.agent==`string`?y.metadata.agent:S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.environmentRevision`),value:P?.environment_revision??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.environmentLifecycle`),value:S(P?`environmentLifecycle.${P.lifecycle_state}`:`details.unknown`)}),(0,A.jsx)($,{label:S(`details.networkMode`),value:S(F?`buildEvidence.network.mode.${F}`:`details.unknown`)}),(0,A.jsx)($,{label:S(`details.networkPosture`),value:S(oe?`buildEvidence.network.posture.${oe}`:`details.unknown`)}),(0,A.jsx)($,{label:S(`details.networkEnforcement`),value:S(I?`buildEvidence.network.enforcement.${I}`:`details.unknown`)})]}),y.failure?.code===`server_restarted`&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-amber-100`,children:S(`details.restartInterruptionEvidence`)})]}),M&&(0,A.jsxs)(`section`,{className:`mt-4 rounded-xl border border-sky-400/20 bg-sky-500/7 p-3`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-semibold text-sky-100`,children:S(`details.buildExecutionEvidence`)}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:S(`details.buildExecutionEvidenceNotice`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.buildProvider`),value:S(`buildEvidence.provider.${M.provider}`)}),(0,A.jsx)($,{label:S(`details.profileFingerprint`),value:M.profileFingerprint??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.profileRevision`),value:M.profileRevisionId??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.profileSelected`),value:S(`buildEvidence.selectionReason.${M.profileSelectionReason??`unknown`}`)}),(0,A.jsx)($,{label:S(`details.worktreePreparation`),value:S(`buildEvidence.worktreePreparation.${M.worktreePreparation??`unknown`}`)}),(0,A.jsx)($,{label:S(`details.setupExecution`),value:M.setupEvidence?S(`buildEvidence.setupOutcome.${M.setupEvidence.outcome}`,{count:M.setupEvidence.command_count}):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.setupPlacement`),value:M.setupPlacement?S(`buildEvidence.provider.${M.setupPlacement}`):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.setupLauncher`),value:S(`buildEvidence.launcher.${M.setupLauncher??`unknown`}`)}),M.setupEvidence?.reused_from_evidence_id&&(0,A.jsx)($,{label:S(`details.setupReusedFrom`),value:M.setupEvidence.reused_from_evidence_id}),(0,A.jsx)($,{label:S(`details.agentPlacement`),value:M.agentPlacement?S(`buildEvidence.provider.${M.agentPlacement}`):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.agentLauncher`),value:S(`buildEvidence.launcher.${M.agentLauncher??`unknown`}`)}),(0,A.jsx)($,{label:S(`details.networkEnforcement`),value:M.network?S(`buildEvidence.network.enforcement.${M.network.enforcement}`):S(`details.unknown`)}),M.network&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($,{label:S(`details.networkMode`),value:S(`buildEvidence.network.mode.${M.network.requested_mode}`)}),(0,A.jsx)($,{label:S(`details.networkPosture`),value:S(`buildEvidence.network.posture.${M.network.observed_global_posture}`)}),(0,A.jsx)($,{label:S(`details.networkDestinations`),value:M.network.destinations.length>0?M.network.destinations.map(e=>`${e.target}: ${e.decision}`).join(`, `):S(`details.none`)})]}),(0,A.jsx)($,{label:S(`details.effectiveCapabilities`),stacked:!0,value:(0,A.jsx)(ae,{value:M.effectiveCapabilities})}),(0,A.jsx)($,{label:S(`details.runtimeCredentials`),value:M.runtimeCredentials?M.runtimeCredentials.length>0?M.runtimeCredentials.map(e=>S(`buildEvidence.credential`,{agent:e.model_provider,authentication:S(`buildEvidence.authentication.${e.authentication_mode}`),delivery:e.capability?S(`buildEvidence.credentialClassification.${e.capability.classification}`,{defaultValue:e.capability.classification}):S(`buildEvidence.credentialDelivery.${e.delivery}`)})).join(`; `):S(`buildEvidence.noCredentialRequirements`):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.unsupportedRequirements`),value:M.unsupportedRequirements?M.unsupportedRequirements.length>0?M.unsupportedRequirements.join(`, `):S(`details.none`):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.fallbackEvidence`),value:M.fallback?S(M.fallback.used?`buildEvidence.fallback.used`:`buildEvidence.fallback.${M.fallback.policy}`):S(`details.unknown`)}),M.fallback?.used&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($,{label:S(`details.fallbackSource`),value:M.fallback.from?S(`buildEvidence.provider.${M.fallback.from}`):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.fallbackReason`),value:M.fallback.reason??S(`details.unknown`)})]}),M.provider!==`host`&&(0,A.jsx)($,{label:S(`details.degradation`),value:M.degradationReasons?.length?M.degradationReasons.join(`, `):M.degradationReasons?S(`details.none`):S(`details.unknown`)}),M.provider===`docker_sandbox`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($,{label:S(`details.environmentId`),value:M.environmentId??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.environmentRevision`),value:M.environmentRevision??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.providerVersion`),value:M.providerVersion??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.agent`),value:M.agent??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.target`),value:M.targetKind&&M.targetKey?S(`buildEvidence.target`,{kind:M.targetKind,key:M.targetKey}):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.targetWorkspace`),value:M.targetWorkspacePath??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.validationFingerprint`),value:M.validationFingerprint??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.capabilities`),stacked:!0,value:(0,A.jsx)(ae,{value:M.capabilities})})]})]}),M.provider===`unknown`&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-amber-100`,children:S(`details.buildExecutionUnknown`)})]}),i&&(0,A.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:S(`details.loading`)}),t&&(0,A.jsx)(`p`,{className:`mt-4 text-sm text-red-300`,role:`alert`,children:t}),w?.available&&w.kind===`test`&&(0,A.jsxs)(`section`,{className:`mt-5`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:S(`details.testEvidence`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.command`),value:w.command_name}),(0,A.jsx)($,{label:S(`details.target`),value:w.target_label}),(0,A.jsx)($,{label:S(`details.exitCode`),value:w.exit_code}),(0,A.jsx)($,{label:S(`details.duration`),value:Ye(w.duration_ms)})]}),(0,A.jsx)(`h4`,{className:`mt-3 text-xs font-medium text-muted-foreground`,children:S(`details.output`)}),w.output_retention_state===`expired`?(0,A.jsx)(`p`,{className:`mt-2 rounded-xl border border-border/60 bg-background/30 p-3 text-xs text-muted-foreground`,children:S(`details.outputExpired`)}):(0,A.jsx)(`pre`,{className:`mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-xl border border-border/60 bg-background/30 p-3 font-mono text-xs text-foreground`,children:T(w.output)||S(`details.outputEmpty`)}),w.output_truncated&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:S(`details.outputTruncated`)})]}),w?.available&&w.kind===`github_actions`&&(0,A.jsxs)(`section`,{className:`mt-5`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:S(`details.providerEvidence`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.workflow`),value:w.workflow_name}),(0,A.jsx)($,{label:S(`details.branch`),value:w.head_branch??w.ref}),(0,A.jsx)($,{label:S(`details.conclusion`),value:w.conclusion})]}),w.jobs.length>0&&(0,A.jsx)(`ul`,{className:`mt-3 space-y-2`,children:w.jobs.map(e=>(0,A.jsxs)(`li`,{className:`min-w-0 rounded-xl border border-border/60 bg-background/30 px-3 py-2 text-xs`,children:[(0,A.jsx)(`span`,{className:`break-words font-medium text-foreground`,children:e.name??S(`details.unnamedJob`)}),(0,A.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:e.conclusion??e.status})]},e.id))}),w.jobs_retention_state===`expired`&&(0,A.jsx)(`p`,{className:`mt-3 rounded-xl border border-border/60 bg-background/30 p-3 text-xs text-muted-foreground`,children:S(`details.jobsExpired`)})]}),w?.available&&w.kind===`check_batch`&&w.batch&&(0,A.jsxs)(`section`,{className:`mt-5`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:S(`details.checkBatchEvidence`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.target`),value:w.batch.target_label}),(0,A.jsx)($,{label:S(`details.selectedChecks`),value:w.batch.selected_definition_snapshots.map(e=>e.name).join(`, `)}),(0,A.jsx)($,{label:S(`details.outcome`),value:S(`details.batchCounts`,{passed:w.batch.passed_count,failed:w.batch.failed_count,running:w.batch.running_count,queued:w.batch.queued_count})}),(0,A.jsx)($,{label:S(`details.rerunSource`),value:w.batch.rerun_of_batch_run_id})]}),D(w.batch)&&(0,A.jsx)(ee,{evidence:D(w.batch),className:`mt-3`}),(0,A.jsx)(`ul`,{className:`mt-3 space-y-2`,children:w.attempts.map(e=>(0,A.jsxs)(`li`,{className:`rounded-xl border border-border/60 bg-background/30 px-3 py-2 text-xs`,children:[(0,A.jsx)(`span`,{className:`font-medium text-foreground`,children:e.command_snapshot.name}),(0,A.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:S(`status.${e.execution_status}`)})]},e.execution_run_id))})]}),w?.available&&w.kind===`check_attempt`&&w.attempt&&(0,A.jsxs)(`section`,{className:`mt-5`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:S(`details.checkAttemptEvidence`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.outcome`),value:w.attempt.outcome?S(`checkOutcome.${w.attempt.outcome}`):S(`status.${w.attempt.execution_status}`)}),(0,A.jsx)($,{label:S(`details.command`),value:w.attempt.command_snapshot.command}),(0,A.jsx)($,{label:S(`details.directory`),value:w.attempt.command_snapshot.cwd??`.`}),(0,A.jsx)($,{label:S(`details.timeout`),value:Ye(w.attempt.command_snapshot.timeout_ms)}),(0,A.jsx)($,{label:S(`details.target`),value:w.batch?.target_label??null}),(0,A.jsx)($,{label:S(`details.currency`),value:w.attempt.currency?S(`currency.${w.attempt.currency}`):null}),(0,A.jsx)($,{label:S(`details.exitCode`),value:w.attempt.exit_code}),(0,A.jsx)($,{label:S(`details.rerunSource`),value:w.attempt.rerun_of_attempt_run_id})]}),w.batch&&D(w.batch,w.attempt)&&(0,A.jsx)(ee,{evidence:D(w.batch,w.attempt),className:`mt-3`}),(0,A.jsx)(`h4`,{className:`mt-3 text-xs font-medium text-muted-foreground`,children:S(`details.output`)}),w.attempt.output_retention_state===`expired`?(0,A.jsx)(`p`,{className:`mt-2 rounded-xl border border-border/60 bg-background/30 p-3 text-xs text-muted-foreground`,children:S(`details.outputExpired`)}):(0,A.jsx)(`pre`,{className:`mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-xl border border-border/60 bg-background/30 p-3 font-mono text-xs text-foreground`,children:T(w.attempt.retained_output)||S(`details.outputEmpty`)}),w.attempt.retained_start_offset>0&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:S(`details.outputTruncated`)})]}),w?.available&&w.kind===`check_repair`&&w.check_repair&&(0,A.jsxs)(`section`,{className:`mt-5 rounded-2xl border border-sky-400/20 bg-sky-500/5 p-4`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:S(`details.checkRepairEvidence`)}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:S(`details.deterministicEvidenceNotice`)}),(0,A.jsxs)(`dl`,{className:`mt-3`,children:[(0,A.jsx)($,{label:S(`details.repairWrapper`),value:w.check_repair.execution_run_id}),(0,A.jsx)($,{label:S(`details.sourceBatch`),value:w.check_repair.source_batch_run_id}),(0,A.jsx)($,{label:S(`details.sourceAttempts`),value:w.check_repair.source_attempt_run_ids.join(`, `)}),(0,A.jsx)($,{label:S(`details.sourceDiagnostics`),value:w.check_repair.diagnostic_ids.join(`, `)}),(0,A.jsx)($,{label:S(`details.sourceRawOutputAttempts`),value:w.check_repair.raw_output_attempt_run_ids.join(`, `)}),(0,A.jsx)($,{label:S(`details.followUpRun`),value:w.check_repair.follow_up_run_id}),(0,A.jsx)($,{label:S(`details.rerunBatch`),value:w.check_repair.rerun_batch_run_id}),(0,A.jsx)($,{label:S(`details.configurationFingerprint`),value:w.check_repair.configuration_fingerprint}),(0,A.jsx)($,{label:S(`details.policyFingerprint`),value:w.check_repair.effective_policy_fingerprint}),(0,A.jsx)($,{label:S(`details.nextBoundary`),value:S(`details.boundary.${w.check_repair.automation_boundary_purpose??`unknown`}`)}),(0,A.jsx)($,{label:S(`details.repairResult`),value:w.check_repair.terminal_result??S(`details.repairPending`)})]}),w.check_repair.terminal_message&&(0,A.jsx)(`p`,{className:`mt-3 rounded-xl border border-border/60 bg-background/35 p-3 text-xs text-muted-foreground`,children:w.check_repair.terminal_message})]}),w?.available&&w.kind===`check_auto_fix`&&w.check_auto_fix&&(0,A.jsx)(me,{details:w.check_auto_fix,isProjectActivity:o,onNavigate:d}),(e?.automation_loops??[]).filter(e=>e.kind===`review_auto_fix`&&e.owner_run_id===y.id).map(e=>(0,A.jsx)(K,{loop:e,isProjectActivity:o,onNavigate:d},e.owner_run_id)),w&&!w.available&&(0,A.jsx)(`p`,{className:`mt-4 rounded-xl border border-border/60 bg-background/30 p-3 text-xs text-muted-foreground`,children:S(`details.evidenceUnavailable`)}),(0,A.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[ne&&(0,A.jsx)(l,{type:`button`,size:`sm`,disabled:a,onClick:()=>p(y),children:S(a?k?`actions.rerunning`:`actions.retrying`:k?`actions.rerun`:`actions.retry`)}),se&&u&&(0,A.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>u(se),children:S(`actions.openSource`)}),L&&(0,A.jsx)(l,{asChild:!0,variant:`outline`,size:`sm`,children:(0,A.jsx)(`a`,{href:L,target:`_blank`,rel:`noreferrer`,children:S(`actions.openProvider`)})})]}),ne&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:S(k?`rerun.retentionNotice`:`retry.retentionNotice`)}),!O.eligible&&!i&&!t&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:S(`retryDenial.${O.reason}`,{defaultValue:S(`retryDenial.unknown`)})}),!j&&y.source_reference&&!y.source_reference.available&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:S(`details.sourceNoLongerAvailable`)}),h&&(0,A.jsx)(`p`,{className:`mt-3 text-sm text-red-300`,role:`alert`,children:h}),(0,A.jsx)(De,{artifacts:e?.artifacts??[],artifactCount:e?.artifact_count??0,projectId:m,runId:y.id}),e?.links?.some(e=>e.entity_type===`approval_request`&&e.relationship===`context`)&&(0,A.jsx)(x,{projectId:m,executionRunId:y.id}),(0,A.jsxs)(`section`,{className:`mt-6`,children:[(0,A.jsx)(`h3`,{className:`mb-3 text-sm font-semibold text-foreground`,children:S(`details.transitions`)}),n.length>0?(0,A.jsx)(Ze,{events:n,selectedEventId:r}):(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:S(`details.noTransitions`)})]})]})},ft=({error:e,isRelatedActivity:t,onBack:n,onRetry:r,titleRef:i})=>{let{t:a}=g(`common`,{keyPrefix:`activityView`});return(0,A.jsxs)(`aside`,{"aria-label":a(`details.ariaLabel`),className:`min-w-0 p-4 lg:p-5`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsx)(`h2`,{ref:i,tabIndex:-1,className:`text-lg font-semibold text-foreground`,children:a(`details.title`)}),(0,A.jsx)(l,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":a(t?`actions.back`:`actions.close`),className:`shrink-0 text-muted-foreground hover:text-foreground`,onClick:n,children:t?(0,A.jsx)(q,{className:`h-4 w-4`}):(0,A.jsx)(f,{className:`h-4 w-4`})})]}),e?(0,A.jsxs)(`div`,{className:`mt-4`,children:[(0,A.jsx)(`p`,{className:`text-sm text-red-300`,role:`alert`,children:e}),(0,A.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,className:`mt-4`,onClick:r,children:a(`actions.tryAgain`)})]}):(0,A.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:a(`details.loading`)})]})},pt=({onCancel:e,onConfirm:t,open:n,isRerun:o})=>{let{t:c}=g(`common`,{keyPrefix:`activityView`}),u=(0,k.useRef)(null),f=(0,k.useRef)(null);return(0,A.jsx)(s,{open:n,onOpenChange:t=>{t||e()},children:(0,A.jsxs)(a,{role:`alertdialog`,"aria-modal":`true`,showCloseButton:!1,className:`max-w-md gap-0`,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.stopPropagation(),onOpenAutoFocus:e=>{e.preventDefault(),f.current=document.activeElement instanceof HTMLElement?document.activeElement:null,u.current?.focus()},onCloseAutoFocus:e=>{e.preventDefault(),f.current?.focus()},children:[(0,A.jsx)(i,{children:c(o?`rerun.confirmTitle`:`retry.confirmTitle`)}),(0,A.jsx)(r,{className:`mt-3`,children:c(o?`rerun.confirmDescription`:`retry.confirmDescription`)}),(0,A.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,A.jsx)(d,{asChild:!0,children:(0,A.jsx)(l,{ref:u,type:`button`,variant:`ghost`,children:c(`actions.cancel`)})}),(0,A.jsx)(l,{type:`button`,onClick:t,children:c(o?`rerun.confirmAction`:`retry.confirmAction`)})]})]})})},mt=({projectId:e,onClose:n,onDetailsClose:c,onNavigateToLifecycleSource:p,initialRunId:h=null,initialEventId:y=null,hasActivityParent:ee=!1,onRunSelectionChange:x,onRelatedReferenceSelection:S,onUnavailable:T,scope:E={type:`project`}})=>{let{t:D}=g(`common`,{keyPrefix:`activityView`}),O=_(),ne=(0,k.useRef)(typeof document<`u`&&document.activeElement instanceof HTMLElement?document.activeElement:null),[j,M]=(0,k.useState)(`all`),[N,re]=(0,k.useState)(`all`),{items:P,hierarchy:ie,runs:ae,isLoading:F,isLoadingMore:oe,hasMoreRuns:I,error:L,loadMore:se,refresh:ce}=it(e,E,j,N),[R,z]=(0,k.useState)(y?null:h),[B,V]=(0,k.useState)(null),[le,H]=(0,k.useState)(null),[U,ue]=(0,k.useState)(null),[de,fe]=(0,k.useState)(!1),[pe,me]=(0,k.useState)(0),[W,he]=(0,k.useState)(!1),[ge,G]=(0,k.useState)(null),[_e,ve]=(0,k.useState)(null),[ye,K]=(0,k.useState)(null),[be,q]=(0,k.useState)(null),[xe,J]=(0,k.useState)(!1),[Se,Ce]=(0,k.useState)(0),Y=(0,k.useRef)(null),X=(0,k.useRef)(0),Te=(0,k.useRef)(!1),Ee=(0,k.useRef)(!1),De=(0,k.useRef)(null),Oe=(0,k.useRef)(null),ke=(0,k.useRef)(null),Z=(0,k.useRef)(!1),Ae=(0,k.useRef)(!1),je=(0,k.useRef)(h),Me=(0,k.useRef)({kind:j,projectId:e,scopeId:E.type===`project`?null:E.id,scopeType:E.type,status:N}),Ne=(0,k.useRef)(ct(window.history.state)),Pe=(0,k.useRef)([]),Fe=(0,k.useRef)(null),Ie=(0,k.useRef)(!1),Le=(0,k.useRef)(!1),Re=(0,k.useRef)(!1);Y.current=B;let ze=E.type===`project`?null:E.id,Be=B?.run.id===R?B:null,Q=Be?Be.run:ae.find(e=>e.id===R)??null,Ve=P.find(e=>e.run.id===R),He=Be?.events??[],Ue=Q?.retry_of_run_id?ae.find(e=>e.id===Q.retry_of_run_id)?.attempt??null:null;(0,k.useEffect)(()=>()=>{ne.current?.isConnected&&ne.current.focus()},[]),(0,k.useEffect)(()=>{!R||!Q&&!le||!le&&ge!==R||!Z.current||(Z.current=!1,De.current?.focus())},[le,ge,Q,R]),(0,k.useEffect)(()=>{if(R!==null||!Ae.current)return;Ae.current=!1;let e=ke.current;if(e?.isConnected){e.focus();return}Oe.current?.focus()},[R]),(0,k.useEffect)(()=>{let t=je.current,n=Me.current,r=n.kind!==j||n.projectId!==e||n.scopeId!==ze||n.scopeType!==E.type||n.status!==N;r&&(Pe.current=[],Fe.current=null);let i=Ne.current,a=ct(window.history.state);!r&&t&&h&&t!==h&&(i?.runId===h?(Fe.current=i,Z.current=!1):a?.runId===t&&!Ie.current&&(Z.current=!0)),Ie.current=!1,Ne.current=a,Me.current={kind:j,projectId:e,scopeId:ze,scopeType:E.type,status:N},je.current=h,z(y?null:h),Y.current=null,V(null),G(null),H(null),q(null),Le.current=Re.current,Re.current=!1,ue(null)},[y,h,j,e,E.type,ze,N]),(0,k.useEffect)(()=>{let e=Fe.current;if(!e||R!==e.runId||ge!==e.runId)return;Fe.current=null;let t=document.getElementById(e.focusTargetId);if(t instanceof HTMLElement&&t.isConnected){let e=t.parentElement?.closest(`details`);for(;e;)e.open=!0,e=e.parentElement?.closest(`details`);if(t.focus(),document.activeElement===t)return}if(De.current?.isConnected){De.current.focus();return}if(ke.current?.isConnected){ke.current.focus();return}Oe.current?.focus()},[B,le,ge,R]),(0,k.useEffect)(()=>{h&&!y&&z(h)},[y,h]),(0,k.useEffect)(()=>{if(!y||!h)return;let n=new AbortController;return fe(!0),ue(null),v(e,y,n.signal).then(e=>{if(e.execution_run_id!==h){T?.();return}z(h)}).catch(e=>{if(!u(e)){if(e instanceof t&&e.status===404){T?.();return}ue(D(`errors.event`))}}).finally(()=>{n.signal.aborted||fe(!1)}),()=>n.abort()},[pe,y,h,T,e,D]),(0,k.useEffect)(()=>{Le.current||h||F||L||I||P.length!==1||R!==null||(Le.current=!0,z(P[0].run.id))},[L,I,h,F,P,R]),(0,k.useEffect)(()=>{let t=null,n=()=>{!R||t||(t=setTimeout(()=>{if(t=null,Te.current){Ee.current=!0;return}Ce(e=>e+1)},ot))},r=()=>J(!0),i=()=>{J(!1),n()},a=()=>{let e=new Set;R&&e.add(R);let t=Y.current;if(t?.run.id!==R||!t.details.available)return e;if(t.details.kind===`check_batch`&&t.details.attempts.forEach(t=>e.add(t.execution_run_id)),t.details.kind===`check_auto_fix`&&t.details.check_auto_fix){let n=t.details.check_auto_fix;e.add(n.execution_run_id),e.add(n.originating_batch_run_id),e.add(n.causal_execution_run_id),n.final_batch_run_id&&e.add(n.final_batch_run_id),n.attempts.forEach(t=>{e.add(t.source_batch_run_id),t.child_run_id&&e.add(t.child_run_id),t.rerun_batch_run_id&&e.add(t.rerun_batch_run_id)})}return(t.automation_loops??[]).forEach(t=>{t.iterations.forEach(t=>{Object.values(t.runs).forEach(t=>{t.run_id&&e.add(t.run_id)}),t.gate_evidence.source_batch_run_id&&e.add(t.gate_evidence.source_batch_run_id),t.gate_evidence.required_checks.forEach(t=>e.add(t.execution_run_id))})}),e},o=()=>{let e=Y.current;return e?.run.id===R?new Set((e.automation_loops??[]).flatMap(e=>e.kind===`review_auto_fix`?e.iterations.map(e=>e.runs.action.run_id).filter(e=>e!==null):[])):new Set},s=t=>{if(!t||typeof t!=`object`)return;let r=t;if(typeof r.project_id==`string`&&r.project_id!==e)return;let i=a();[r.id,r.execution_run_id,r.batch_run_id,r.run_id,r.attempt_run_id].some(e=>typeof e==`string`&&i.has(e))&&n()},c=t=>{if(!t||typeof t!=`object`)return;let r=t;if(r.project_id!==e)return;let i=typeof r.id==`string`?r.id:r.execution_run_id;typeof i==`string`&&a().has(i)&&n()},l=t=>{if(!t||typeof t!=`object`)return;let r=t;r.project_id===e&&r.automation_progression_run_id===R&&n()},u=e=>{if(!e||typeof e!=`object`||!(`runs`in e)||!Array.isArray(e.runs))return;let t=o();e.runs.some(e=>!e||typeof e!=`object`||!(`execution_run_id`in e)?!1:typeof e.execution_run_id==`string`&&t.has(e.execution_run_id))&&n()},d=t=>{if(t.project_id!==e||t.attempt_run_id!==R)return;let r=Y.current;if(!r||r.run.id!==R||r.details.kind!==`check_attempt`||!r.details.available||!r.details.attempt||r.details.attempt.execution_run_id!==t.attempt_run_id||r.details.attempt.batch_run_id!==t.batch_run_id){n();return}let i=te(w(r.details.attempt),t);if(i.status===`ignored`)return;if(i.status===`refetch`){n();return}let a={...r,details:{...r.details,attempt:{...r.details.attempt,output_revision:i.snapshot.revision,retained_start_offset:i.snapshot.retainedStartOffset,retained_end_offset:i.snapshot.totalByteCount,total_persisted_bytes:i.snapshot.totalByteCount,retained_output:i.snapshot.retainedText,output_retention_state:i.snapshot.retentionState}}};Y.current=a,V(a)};return O.on(`disconnect`,r),O.on(`connect`,i),O.on(`execution-run:updated`,c),O.on(`review-loop-iteration:updated`,l),O.on(`agent-runs:updated`,u),O.on(`github-actions:updated`,s),O.on(`test-session:updated`,s),O.on(`lifecycle-event:created`,s),O.on(`check-attempt:output`,d),()=>{t&&clearTimeout(t),O.off(`disconnect`,r),O.off(`connect`,i),O.off(`execution-run:updated`,c),O.off(`review-loop-iteration:updated`,l),O.off(`agent-runs:updated`,u),O.off(`github-actions:updated`,s),O.off(`test-session:updated`,s),O.off(`lifecycle-event:created`,s),O.off(`check-attempt:output`,d)}},[e,R,O]),(0,k.useEffect)(()=>{if(!e||!R)return;let n=new AbortController,r=X.current+1;return X.current=r,Te.current=!0,he(!0),G(null),H(null),m(e,R,E.type===`project`?{type:`project`}:{type:E.type,id:ze},n.signal,D(`errors.details`)).then(e=>{if(!(n.signal.aborted||X.current!==r||e.run.id!==R)){if(h&&(e.run.kind===`check_batch`||e.run.kind===`check_attempt`)){T?.();return}if(!we(e.run.kind)){z(null),T?.();return}Y.current=e,V(e)}}).catch(e=>{n.signal.aborted||X.current!==r||u(e)||(e instanceof t&&e.status===404&&T?.(),H(e instanceof t?e.message:D(`errors.details`)))}).finally(()=>{n.signal.aborted||X.current!==r||(Te.current=!1,he(!1),G(R),Ee.current&&(Ee.current=!1,Ce(e=>e+1)))}),()=>{n.abort(),X.current===r&&(Te.current=!1,Ee.current=!1)}},[Se,y,h,T,e,E.type,ze,R,D]);let We=async n=>{if(e){ve(n.id),K(null);try{let t=await b(e,n.id),r=`batch`in t?t.batch.execution_run_id:t.execution_run_id,i=n.kind===`check_attempt`&&B?.details.kind===`check_attempt`&&B.details.available?B.details.attempt?.batch_run_id:void 0;Z.current=!0,H(null),z(r),x?.({...n,id:r},i),ce()}catch(e){let r=e instanceof t&&e.data&&typeof e.data==`object`?e.data:null,i=r&&typeof r.reason==`string`?r.reason:null,a=r&&typeof r.error==`string`?r.error.slice(0,300):null;K(i?D(`retryDenial.${i}`,{defaultValue:a??D(`retryDenial.unknown`)}):a??(e instanceof t?e.message:D(`errors.retry`))),e instanceof t&&e.status===409&&(z(n.id),Ce(e=>e+1),ce())}finally{ve(null)}}},Ge=()=>{se()},qe=(e,t)=>{ke.current=t,Z.current=ut(),z(e),K(null);let n=P.find(t=>t.run.id===e);n&&x?.(n.run,n.check_attempt?.batch_run_id)},Je=e=>{if(e.state!==`available`||e.surface===`checks`&&E.type!==`project`)return;if(e.surface===`activity`&&(Z.current=ut(),E.type!==`project`&&R)){Pe.current.push({runId:R,focusTargetId:e.focusTargetId}),z(e.runId),Y.current=null,V(null),G(null),H(null),K(null);return}K(null);let t=window.location.pathname;if(S?.(e,R),e.surface===`activity`&&R&&window.location.pathname!==t){let t={runId:R,focusTargetId:e.focusTargetId};lt(t),Ne.current=t,Ie.current=!0}},Ye=()=>{let e=Pe.current[Pe.current.length-1];if(R&&e){Pe.current.pop(),Fe.current=e,Z.current=!1,z(e.runId),Y.current=null,V(null),G(null),H(null),K(null);return}(h||y)&&(Re.current=!0),Ae.current=!0,z(null),Y.current=null,V(null),G(null),H(null),ue(null),fe(!1),q(null),K(null),c?.()},Xe=()=>{Ce(e=>e+1)},Ze=R!==null||!!(y&&(de||U)),Qe=ee||Pe.current.length>0;return(0,A.jsx)(s,{open:!0,onOpenChange:e=>{e||n()},children:(0,A.jsxs)(a,{showCloseButton:!1,overlayClassName:`duration-0 data-open:animate-none data-closed:animate-none`,className:`flex h-[calc(100vh-1rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl border border-border bg-card p-0 shadow-2xl duration-0 data-open:animate-none data-closed:animate-none sm:h-[calc(100vh-2rem)] sm:max-w-6xl`,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.stopPropagation(),children:[(0,A.jsx)(i,{className:`sr-only`,children:D(`scope.${E.type}.srTitle`)}),(0,A.jsx)(r,{className:`sr-only`,children:D(`scope.${E.type}.srDescription`)}),(0,A.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-border/70 px-4 py-4 sm:px-6`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-rose-200`,children:(0,A.jsx)(C,{className:`h-5 w-5`})}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-foreground sm:text-2xl`,children:D(`scope.${E.type}.title`)}),(0,A.jsx)(`p`,{className:`mt-0.5 hidden max-w-2xl text-sm text-muted-foreground sm:block`,children:D(`scope.${E.type}.description`)})]})]}),(0,A.jsx)(d,{asChild:!0,children:(0,A.jsx)(l,{type:`button`,"aria-label":D(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,children:(0,A.jsx)(f,{className:`h-4 w-4`})})})]}),(0,A.jsx)(`div`,{className:o(`shrink-0 border-b border-border/70 px-4 py-3 sm:px-6`,Ze&&`hidden lg:block`),children:(0,A.jsxs)(`form`,{"aria-label":D(`filters.ariaLabel`),className:`flex flex-col gap-3 sm:flex-row sm:flex-wrap`,children:[(0,A.jsxs)(`label`,{className:`flex min-w-0 flex-1 flex-col gap-1 text-xs text-muted-foreground sm:max-w-56`,children:[D(`filters.kind`),(0,A.jsxs)(`select`,{value:j,onChange:e=>M(e.target.value),className:`h-10 rounded-xl border border-border bg-card px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring/50`,children:[(0,A.jsx)(`option`,{value:`all`,children:D(`filters.allKinds`)}),at.filter(e=>we(e)).map(e=>(0,A.jsx)(`option`,{value:e,children:D(`kind.${e}`)},e))]})]}),(0,A.jsxs)(`label`,{className:`flex min-w-0 flex-1 flex-col gap-1 text-xs text-muted-foreground sm:max-w-56`,children:[D(`filters.status`),(0,A.jsxs)(`select`,{value:N,onChange:e=>re(e.target.value),className:`h-10 rounded-xl border border-border bg-card px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring/50`,children:[(0,A.jsx)(`option`,{value:`all`,children:D(`filters.allStatuses`)}),(0,A.jsx)(`option`,{value:`approval_required`,children:D(`status.approval_required`)}),[`running`,`waiting`,`queued`,`failed`,`interrupted`,`cancelled`,`completed`].map(e=>(0,A.jsx)(`option`,{value:e,children:D(`status.${e}`)},e))]})]})]})}),(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 overflow-hidden lg:grid-cols-[minmax(0,1fr)_minmax(20rem,0.72fr)]`,children:[(0,A.jsx)(`div`,{className:o(`min-h-0 min-w-0 overflow-y-auto`,Ze&&`hidden lg:block`),children:(0,A.jsx)(Ke,{focusRef:Oe,items:P,hierarchy:ie,scope:E,selectedRunId:R,isLoading:F,isLoadingMore:oe,isReconnecting:xe,hasMore:I,error:L,onLoadMore:Ge,onRefresh:ce,onSelectRun:qe})}),(0,A.jsx)(`div`,{className:o(`min-h-0 min-w-0 overflow-y-auto border-border/70 lg:border-l`,!Ze&&`hidden lg:block`),children:Q?(0,A.jsx)(dt,{run:Q,detail:Be,events:He,selectedEventId:Q.id===h?y:null,isLoading:W,detailError:le,isRetrying:_e===Q.id,isProjectActivity:E.type===`project`,isRelatedActivity:Qe,retryError:ye,projectId:e,retryEligibility:Be?.details.retry_eligibility??Ve?.retry_eligibility??{eligible:!1,reason:`status_not_retryable`},retrySourceAttempt:Ue,titleRef:De,onClose:Ye,onRetry:q,onNavigateToRelatedReference:S||E.type!==`project`?Je:void 0,onNavigateToLifecycleSource:p}):Ze?(0,A.jsx)(ft,{error:U??le,isRelatedActivity:Qe,titleRef:De,onBack:Ye,onRetry:U?()=>me(e=>e+1):Xe}):(0,A.jsx)(`aside`,{"aria-label":D(`details.ariaLabel`),className:`m-5 rounded-2xl border border-dashed border-border/70 bg-background/20 p-6 text-sm text-muted-foreground`,children:D(`details.selectPrompt`)})})]}),(0,A.jsx)(pt,{open:be!==null,isRerun:be?.kind===`check_batch`,onCancel:()=>q(null),onConfirm:()=>{if(!be)return;let e=be;q(null),We(e)}})]})})};export{se as i,Je as n,q as r,mt as t};
|
|
1
|
+
import{a as e}from"./chunk-BNv3lrIs.js";import{H as t,L as n,a as r,c as i,i as a,m as o,n as s,nt as c,p as l,q as u,r as d,t as f,u as p}from"./IconX-sSpA2ejo.js";import{a as m,c as h,d as g,n as _,o as v,r as y,u as b}from"./realtimeContextBase-DZt86QHH.js";import{n as ee,t as x}from"./ApprovalRequestPanel-CRfb4jzF.js";import{t as S}from"./badge-Bnvptskz.js";import{t as C}from"./IconDocument-DINFwIj-.js";import{a as w,i as T,n as E,o as te,t as D}from"./executionEnvironmentEvidence-CICFT5py.js";import{n as O,t as ne}from"./artifactPresentation-CY7_iPcf.js";var k=e(c(),1),A=n(),j=e=>typeof e==`object`&&!!e&&!Array.isArray(e),M=e=>e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase()),N=(e,t)=>typeof e==`string`?t(`activityView.details.capabilityDetails.values.${e}`,{defaultValue:e}):String(e),re=(e,t)=>Array.isArray(e)?e.length===0?t(`activityView.details.none`):e.map(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`?N(e,t):t(`activityView.details.unknown`)).join(`, `):typeof e==`string`||typeof e==`number`||typeof e==`boolean`?N(e,t):t(`activityView.details.unknown`),P=(e,t)=>t(`activityView.details.capabilityDetails.labels.${e}`,{defaultValue:M(e)}),ie=({value:e,path:t,t:n})=>{let r=Object.entries(e);if(r.length===0)return(0,A.jsx)(`span`,{children:n(`activityView.details.capabilityDetails.empty`)});let i=r.filter(e=>j(e[1])),a=r.filter(([,e])=>!j(e));return(0,A.jsxs)(`div`,{className:`space-y-2`,children:[i.map(([e,r])=>(0,A.jsxs)(`section`,{className:`space-y-1.5`,children:[(0,A.jsx)(`h4`,{className:`text-xs font-medium text-foreground`,children:P(e,n)}),(0,A.jsx)(ie,{value:r,path:`${t}.${e}`,t:n})]},`${t}.${e}`)),a.length>0&&(0,A.jsx)(`dl`,{className:`grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-[minmax(8rem,0.45fr)_minmax(0,1fr)]`,children:a.map(([e,r])=>(0,A.jsxs)(k.Fragment,{children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:P(e,n)}),(0,A.jsx)(`dd`,{className:`min-w-0 break-words text-sm text-foreground`,children:re(r,n)})]},`${t}.${e}`))})]})},ae=({value:e})=>{let{t}=g(`common`);return e==null||!j(e)?(0,A.jsx)(A.Fragment,{children:t(`activityView.details.unknown`)}):(0,A.jsx)(ie,{value:e,path:`capabilities`,t})},F=[`analyzing`,`correcting`,`validating`],oe=e=>typeof e==`object`&&!!e&&!Array.isArray(e),I=e=>Number.isSafeInteger(e)&&e>=0,L=e=>typeof e==`string`&&/^\d{4}-\d{2}-\d{2}T/.test(e)&&Number.isFinite(Date.parse(e)),se=e=>{if(!oe(e)||e.version!==1||!F.includes(e.phase)||!L(e.started_at)||!L(e.phase_started_at)||!L(e.last_activity_at)||e.completed_at!==null&&!L(e.completed_at)||!I(e.elapsed_ms)||!I(e.input_bytes)||!I(e.output_bytes)||!oe(e.phase_elapsed_ms))return null;let t=e.phase_elapsed_ms;return F.every(e=>I(t[e]))?{version:1,phase:e.phase,started_at:e.started_at,phase_started_at:e.phase_started_at,last_activity_at:e.last_activity_at,completed_at:e.completed_at,elapsed_ms:e.elapsed_ms,input_bytes:e.input_bytes,output_bytes:e.output_bytes,phase_elapsed_ms:{analyzing:t.analyzing,correcting:t.correcting,validating:t.validating}}:null},ce=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},R=(e,t)=>{let n=ce(e);return t.flatMap(e=>typeof n[e]==`number`&&Number.isFinite(n[e])&&n[e]>=0?[{key:e,value:n[e]}]:[])},z=({value:e})=>{let{t}=g(`common`,{keyPrefix:`epicReadinessProgress`}),n=ce(e);if(n.version!==1||n.scope!==`latest_worker_attempt`)return null;let r=R(n.phase_elapsed_ms,[`preparation`,`provider`,`correction`,`validation`,`cleanup`]),i=R(n,[`provider_calls`,`correction_calls`]),a=R(n.context,[`constraint_count`,`hard_edge_count`,`inspection_bytes`]);return(0,A.jsxs)(`details`,{className:`mt-3 text-xs text-muted-foreground`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:t(`lifecycleMetrics`)}),(0,A.jsx)(`p`,{className:`mt-2`,children:t(`latestAttempt`)}),(0,A.jsxs)(`ul`,{className:`mt-2 space-y-1 tabular-nums`,children:[r.map(e=>(0,A.jsx)(`li`,{children:t(`phaseTime`,{phase:t(`lifecyclePhases.${e.key}`),seconds:Math.floor(e.value/1e3)})},e.key)),[...i,...a].map(e=>(0,A.jsx)(`li`,{children:t(`counts.${e.key}`,{count:e.value})},e.key))]})]})},B=({run:e})=>{let{t}=g(`common`,{keyPrefix:`epicReadinessProgress`}),n=se(e.metadata?.epic_readiness_progress),r=![`queued`,`running`,`waiting`].includes(e.status),i=e.kind===`epic_plan`&&!!n&&!n?.completed_at&&!r,[a,o]=(0,k.useState)(()=>Date.now());if((0,k.useEffect)(()=>{if(!i)return;let e=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(e)},[i]),e.kind!==`epic_plan`)return null;if(!n)return(0,A.jsx)(z,{value:e.metadata?.epic_readiness_measurements});let s=n.completed_at??(r?e.completed_at??e.updated_at:null),c=Math.max(0,(s?Date.parse(s):a)-Date.parse(n.last_activity_at)),l=n.elapsed_ms+c,u=n.completed_at?t(`finished`):t(r?`stopped`:`phases.${n.phase}`);return(0,A.jsxs)(`section`,{className:`mt-4 border-t border-border/50 pt-3`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(`title`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,role:`status`,children:u}),(0,A.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs tabular-nums text-muted-foreground`,children:[(0,A.jsx)(`span`,{children:t(`elapsed`,{seconds:Math.floor(l/1e3)})}),i&&(0,A.jsx)(`span`,{children:t(`lastActivity`,{seconds:Math.floor(c/1e3)})})]}),(0,A.jsxs)(`details`,{className:`mt-3 text-xs text-muted-foreground`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:t(`metrics`)}),(0,A.jsxs)(`ul`,{className:`mt-2 space-y-1 tabular-nums`,children:[F.map(e=>(0,A.jsx)(`li`,{children:t(`phaseTime`,{phase:t(`phases.${e}`),seconds:Math.floor((n.phase_elapsed_ms[e]+(e===n.phase?c:0))/1e3)})},e)),(0,A.jsx)(`li`,{children:t(`inputBytes`,{bytes:n.input_bytes})}),(0,A.jsx)(`li`,{children:t(`outputBytes`,{bytes:n.output_bytes})})]})]}),(0,A.jsx)(z,{value:e.metadata?.epic_readiness_measurements})]})},V=(e,t)=>{if(!e||!t)return null;let n=Date.parse(e),r=Date.parse(t);return!Number.isFinite(n)||!Number.isFinite(r)||r<n?null:r-n},le=e=>e===`completed`?`success`:e===`failed`||e===`interrupted`?`destructive`:e===`cancelled`?`warning`:e===`running`||e===`waiting`||e===`queued`?`info`:`outline`,H=(e,t)=>{if(e<1e3)return t(`automationLoop.duration.milliseconds`,{count:e});let n=Math.floor(e/1e3),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60;return r>0?[t(`automationLoop.duration.hours`,{count:r}),t(`automationLoop.duration.minutes`,{count:i}),t(`automationLoop.duration.seconds`,{count:a})].join(` `):i>0?[t(`automationLoop.duration.minutes`,{count:i}),t(`automationLoop.duration.seconds`,{count:a})].join(` `):t(`automationLoop.duration.seconds`,{count:n})},U=({actionLabel:e,completedAt:t,controlId:n,onNavigate:r,role:i,runId:a,startedAt:o,stateLabel:s,status:c})=>{let{t:u}=g(`common`,{keyPrefix:`activityView`}),d=V(o,t),f=d===null?null:H(d,u);return(0,A.jsxs)(`div`,{className:`min-w-0 border-t border-border/50 py-3 first:border-t-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h4`,{className:`text-xs font-semibold text-foreground`,children:i}),c?(0,A.jsx)(S,{variant:le(c),children:u(`status.${c}`)}):(0,A.jsx)(S,{variant:`outline`,children:s}),f&&(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:u(`automationLoop.completedIn`,{duration:f})})]}),a&&(0,A.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,A.jsx)(`code`,{className:`min-w-0 break-all text-[11px] text-muted-foreground`,children:a}),r&&(0,A.jsx)(l,{id:n,type:`button`,variant:`link`,size:`xs`,className:`h-auto shrink-0 p-0`,onClick:r,children:e})]})]})},ue=new Set([`completed`,`failed`,`cancelled`,`interrupted`]),de=(e,t)=>{if(e<1e3)return t(`duration.milliseconds`,{count:e});let n=Math.floor(e/1e3),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60;return r>0?[t(`duration.hours`,{count:r}),t(`duration.minutes`,{count:i}),t(`duration.seconds`,{count:a})].join(` `):i>0?[t(`duration.minutes`,{count:i}),t(`duration.seconds`,{count:a})].join(` `):t(`duration.seconds`,{count:n})},fe=({details:e,loopDuration:t})=>{let{t:n}=g(`common`,{keyPrefix:`activityView.details.autoFix`});return(0,A.jsxs)(`dl`,{className:`mt-4 grid grid-cols-2 gap-x-4 gap-y-3 border-y border-border/60 py-3 sm:grid-cols-4`,children:[[[n(`budget.consumed`),e.attempt_count],[n(`budget.maximum`),e.max_attempts],[n(`budget.remaining`),e.remaining_attempts],[n(`cancellation.label`),n(e.cancellation_requested?`cancellation.requested`:`cancellation.notRequested`)]].map(([e,t])=>(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,A.jsx)(`dd`,{className:`mt-1 break-words text-sm font-medium text-foreground`,children:t})]},String(e))),t&&(0,A.jsxs)(`div`,{className:`col-span-2 min-w-0 sm:col-span-4`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`loopDuration`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-sm font-medium text-foreground`,children:t})]})]})},pe=({attempt:e,details:t,onNavigate:n,isProjectActivity:r})=>{let{t:i}=g(`common`,{keyPrefix:`activityView.details.autoFix`}),a=[e.child_status,e.rerun_status].some(e=>e!==null&&!ue.has(e))?i(`attemptOutcome.active`):e.terminal_reason?i(`attemptOutcome.${e.terminal_reason}`):i(`attemptOutcome.pending`),o=e.child_run_id?i(`state.unavailable`):e.terminal_reason===`dispatch_rejected`?i(`attemptOutcome.dispatch_rejected`):i(`state.notStarted`),s=e.rerun_batch_run_id?i(`state.unavailable`):i(`state.notStarted`),c=`auto-fix-${t.execution_run_id}-${e.ordinal}-source`,l=`auto-fix-${t.execution_run_id}-${e.ordinal}-action`,u=`auto-fix-${t.execution_run_id}-${e.ordinal}-verification`,d=e.source_batch_destination,f=e.child_destination,p=e.rerun_destination,m=r&&d?.surface===`checks`&&d.state===`available`&&d.batch_run_id!==null,h=f?.surface===`activity`&&f.state===`available`,_=r&&p?.surface===`checks`&&p.state===`available`&&p.batch_run_id!==null;return(0,A.jsxs)(`li`,{className:`min-w-0 rounded-xl border border-border/70 bg-background/30 px-3 sm:px-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 py-3`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:i(`attempt`,{current:e.ordinal,total:t.max_attempts})}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a})]}),(0,A.jsxs)(`div`,{className:`border-t border-border/50`,children:[(0,A.jsx)(U,{role:i(`role.observation`),status:e.source_batch_status,startedAt:e.source_batch_started_at,completedAt:e.source_batch_completed_at,runId:e.source_batch_run_id,stateLabel:i(r?`state.unavailable`:`state.projectActivityOnly`),actionLabel:i(`navigation.openSourceChecks`),controlId:c,onNavigate:n&&m?()=>n({surface:`checks`,state:`available`,batchRunId:d.batch_run_id,attemptRunId:d.attempt_run_id,kind:`source_batch`,focusTargetId:c}):void 0}),(0,A.jsx)(U,{role:i(`role.action`),status:e.child_status,startedAt:e.child_started_at,completedAt:e.child_completed_at,runId:e.child_run_id,stateLabel:o,actionLabel:i(`navigation.openRepairRun`),controlId:l,onNavigate:h&&n?()=>n({surface:`activity`,state:`available`,runId:f.run_id,kind:`repair_child`,focusTargetId:l}):void 0}),(0,A.jsx)(U,{role:i(`role.verification`),status:e.rerun_status,startedAt:e.rerun_started_at,completedAt:e.rerun_completed_at,runId:e.rerun_batch_run_id,stateLabel:r?s:i(`state.projectActivityOnly`),actionLabel:i(`navigation.openVerificationChecks`),controlId:u,onNavigate:_&&n?()=>n({surface:`checks`,state:`available`,batchRunId:p.batch_run_id,attemptRunId:p.attempt_run_id,kind:`verification_batch`,focusTargetId:u}):void 0})]}),(0,A.jsxs)(`dl`,{className:`border-t border-border/50 py-3 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`launchMode.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:e.continuation?i(`launchMode.${e.continuation}`):i(`state.notStarted`)})]}),e.fallback_used&&(0,A.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`fallback.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:i(`fallback.used`)})]}),(0,A.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`outcome.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:a})]})]}),e.terminal_message&&(0,A.jsxs)(`details`,{className:`border-t border-border/50 py-3 text-xs text-muted-foreground`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium text-muted-foreground`,children:i(`diagnostics.attempt`)}),(0,A.jsx)(`p`,{className:`mt-2 max-w-[70ch] break-words`,children:e.terminal_message})]})]})},me=({details:e,isProjectActivity:t=!0,onNavigate:n})=>{let{t:r}=g(`common`,{keyPrefix:`activityView.details.autoFix`}),i=V(e.started_at,e.completed_at),a=ue.has(e.execution_status)&&i!==null?de(i,r):null,o=`automatic-repair-${e.execution_run_id}`,s=e.terminal_reason?r(`overallOutcome.${e.terminal_reason}`,{count:e.max_attempts}):r(`overallOutcome.active`),c=`auto-fix-${e.execution_run_id}-causal`,u=e.causal_destination,d=u?.surface===`activity`&&u.state===`available`;return(0,A.jsxs)(`section`,{"aria-labelledby":o,className:`mt-5 min-w-0 rounded-2xl border border-sky-400/20 bg-sky-500/5 p-4`,children:[(0,A.jsxs)(`header`,{className:`min-w-0`,children:[(0,A.jsx)(`h2`,{id:o,className:`text-sm font-semibold text-foreground`,children:r(`title`)}),(0,A.jsx)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:e.attempt_count>0?r(`phaseWithAttempt`,{phase:r(`phase.${e.phase}`),current:e.attempt_count,total:e.max_attempts}):r(`phase.${e.phase}`)})]}),(0,A.jsx)(fe,{details:e,loopDuration:a}),!t&&(0,A.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:r(`state.projectActivityOnly`)}),(0,A.jsxs)(`dl`,{className:`mt-3 space-y-2 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`outcome.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:s})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`source.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:r(`source.${e.owner_type}`)})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`causalExecution`)}),(0,A.jsxs)(`dd`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-foreground`,children:[(0,A.jsx)(`code`,{className:`min-w-0 break-all text-[11px] text-muted-foreground`,children:e.causal_execution_run_id}),n&&d&&(0,A.jsx)(l,{id:c,type:`button`,variant:`link`,size:`xs`,className:`h-auto shrink-0 p-0`,onClick:()=>n({surface:`activity`,state:`available`,runId:u.run_id,kind:`causal_execution`,focusTargetId:c}),children:r(`navigation.openCausalRun`)})]})]})]}),e.attempts.length>0&&(0,A.jsx)(`ol`,{"aria-label":r(`attemptsAriaLabel`),className:`mt-4 space-y-3`,children:e.attempts.map(r=>(0,A.jsx)(pe,{attempt:r,details:e,onNavigate:n,isProjectActivity:t},r.ordinal))}),e.terminal_message&&(0,A.jsxs)(`details`,{className:`mt-4 rounded-xl border border-border/60 bg-background/25 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium text-muted-foreground`,children:r(`diagnostics.loop`)}),(0,A.jsx)(`p`,{className:`mt-2 max-w-[70ch] break-words`,children:e.terminal_message})]})]})},W=e=>`state.${e}`,he=({evidence:e,label:t})=>{let{t:n}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),r=e.model?e.variant?n(`evaluator.modelVariant`,{model:e.model,variant:e.variant}):e.model:n(W(e.state));return(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:t}),(0,A.jsx)(`dd`,{className:`mt-1 break-words text-sm font-medium text-foreground`,children:r})]})},ge=({agent:e})=>{let{t}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),n=e.response_truncated||e.failure_truncated;return(0,A.jsxs)(`article`,{className:`min-w-0 border-t border-border/50 py-3 first:border-t-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h5`,{className:`break-words text-xs font-semibold text-foreground`,children:e.label}),(0,A.jsx)(S,{variant:e.status===`done`?`success`:e.status===`error`?`destructive`:e.status===`stopped`?`warning`:`info`,children:t(`agentStatus.${e.status}`)}),(0,A.jsx)(`span`,{className:`break-words text-xs text-muted-foreground`,children:e.role})]}),e.response_summary&&(0,A.jsx)(`p`,{className:`mt-2 max-w-[70ch] whitespace-pre-wrap break-words text-xs text-foreground/80`,children:e.response_summary}),e.failure_summary&&(0,A.jsx)(`p`,{role:`alert`,className:`mt-2 max-w-[70ch] whitespace-pre-wrap break-words text-xs text-red-200`,children:e.failure_summary}),n&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-amber-200`,children:t(`agentEvidence.truncated`)})]})},G=({config:e})=>{let{t}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`});return(0,A.jsxs)(`dl`,{className:`mt-3 grid gap-x-4 gap-y-3 sm:grid-cols-2`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`policy.depth`)}),(0,A.jsx)(`dd`,{className:`mt-1 break-words text-foreground`,children:t(`policy.depthValue.${e.depth}`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`policy.maximum`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:e.reviewMaxIterations})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`policy.fixEnabled`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:t(e.reviewFixEnabled?`value.enabled`:`value.disabled`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`policy.pauseOnQuestions`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:t(e.pauseOnOpenQuestions?`value.enabled`:`value.disabled`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:t(`policy.severity`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:t(`policy.severityValue.${e.reviewSeverity}`)})]})]})},_e=({iteration:e,onNavigate:t})=>{let{t:n}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),r=e.claim_policy;return(0,A.jsxs)(`details`,{className:`border-t border-border/50 py-3 text-xs`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium text-muted-foreground`,children:n(`policy.title`)}),(0,A.jsx)(`p`,{className:`mt-2 max-w-[70ch] text-muted-foreground`,children:n(`policy.historicalNotice`)}),(0,A.jsx)(G,{config:r}),e.decisions.length>0&&(0,A.jsx)(`div`,{role:`list`,"aria-label":n(`policy.decisionsAriaLabel`),className:`mt-3 space-y-2`,children:e.decisions.map(r=>{let i=r.operation.destination,a=`review-loop-${e.id}-decision-${r.sequence}`,o=i?.surface===`activity`&&i.state===`available`;return(0,A.jsxs)(`div`,{role:`listitem`,className:`min-w-0 rounded-lg border border-border/50 bg-background/25 p-2.5`,children:[(0,A.jsx)(`p`,{className:`break-words font-medium text-foreground`,children:n(`decisionPoint.${r.decision_point}`)}),(0,A.jsx)(`p`,{className:`mt-1 break-words text-muted-foreground`,children:n(`decisionCode.${r.decision_code}`,{defaultValue:n(`decisionCode.unknown`)})}),(0,A.jsx)(G,{config:r.effective_automation_config}),o&&t&&(0,A.jsx)(`button`,{id:a,type:`button`,className:`mt-2 text-xs font-medium text-primary underline-offset-4 hover:underline`,onClick:()=>t({surface:`activity`,state:`available`,runId:i.run_id,kind:`decision_operation`,focusTargetId:a}),children:n(`navigation.openDecisionOperation`)})]},r.sequence)})})]})},ve=({isProjectActivity:e,iteration:t,onNavigate:n})=>{let{t:r}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),{t:i}=g(`common`,{keyPrefix:`activityView`}),a=t.gate_evidence;return a.required_checks.length===0&&a.reason_codes.length===0&&!a.evaluation_id?null:(0,A.jsxs)(`details`,{className:`border-t border-border/50 py-3 text-xs`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer font-medium text-muted-foreground`,children:r(`gateEvidence.title`)}),(0,A.jsxs)(`dl`,{className:`mt-3 grid gap-x-4 gap-y-3 sm:grid-cols-2`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`gateEvidence.decision`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:a.decision?r(`gateDecision.${a.decision}`):r(W(a.state))})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`gateEvidence.policy`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-foreground`,children:a.policy_status?r(`policyStatus.${a.policy_status}`):r(`state.unavailable`)})]})]}),a.reason_codes.length>0&&(0,A.jsx)(`p`,{className:`mt-3 max-w-[70ch] break-words text-muted-foreground`,children:r(`gateEvidence.reasons`,{reasons:a.reason_codes.map(e=>r(`gateReason.${e}`,{defaultValue:r(`gateReason.unknown`)})).join(`, `)})}),a.required_checks.length>0&&(0,A.jsx)(`div`,{role:`list`,"aria-label":r(`gateEvidence.checksAriaLabel`),className:`mt-3 space-y-2`,children:a.required_checks.map(a=>{let o=a.destination,s=`review-loop-${t.id}-check-${a.execution_run_id}`,c=e&&o?.state===`available`&&o.batch_run_id!==null;return(0,A.jsxs)(`div`,{role:`listitem`,className:`min-w-0 rounded-lg border border-border/50 bg-background/25 p-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`break-all font-medium text-foreground`,children:a.definition_id}),(0,A.jsx)(S,{variant:a.status===`completed`?`success`:a.status===`failed`?`destructive`:`outline`,children:i(`status.${a.status}`)}),(0,A.jsx)(S,{variant:a.currency===`current`?`info`:`warning`,children:r(`currency.${a.currency}`)})]}),a.outcome&&(0,A.jsx)(`p`,{className:`mt-1 break-words text-muted-foreground`,children:r(`gateCheckOutcome.${a.outcome}`,{defaultValue:r(`gateCheckOutcome.unknown`)})}),c&&n&&(0,A.jsx)(`button`,{id:s,type:`button`,className:`mt-2 font-medium text-primary underline-offset-4 hover:underline`,onClick:()=>n({surface:`checks`,state:`available`,batchRunId:o.batch_run_id,attemptRunId:o.attempt_run_id,kind:`required_check_attempt`,focusTargetId:s}),children:r(`navigation.openCheckAttempt`)})]},a.execution_run_id)})}),!e&&a.required_checks.length>0&&(0,A.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:r(`navigation.projectActivityOnly`)})]})},ye=({isProjectActivity:e,iteration:t,onNavigate:n})=>{let{t:r}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),i=t.runs.gate.run_id??t.gate_evidence.source_batch_run_id,a=t.outcome?r(`outcome.${t.outcome}`):r(`outcome.pending`),o=t.stop_reason===`verification_failed`||t.runs.verification.status===`failed`||t.runs.verification.status===`cancelled`||t.runs.verification.status===`interrupted`||t.resulting_review.status===`error`||t.resulting_review.status===`parse_failed`||t.resulting_review.status===`stopped`,s=o||t.phase===`verifying`||t.runs.verification.state!==`not_started`||t.resulting_review.state!==`not_started`,c=t.resulting_blocking_count??r(o?`blocking.failedResult`:s?`state.unavailable`:`state.not_started`),l=r(`phase.label`,{presentation:r(`phase.presentation.${t.phase}`),authoritative:r(`phase.authoritative.${t.authoritative_phase}`)}),u=(e,t,r)=>{let i=e.destination;if(!(!n||i?.surface!==`activity`||i.state!==`available`))return()=>n({surface:`activity`,state:`available`,runId:i.run_id,kind:t,focusTargetId:r})},d=t.runs.gate.destination,f=`review-loop-${t.id}-gate`,p=e&&n&&d?.surface===`checks`&&d.state===`available`&&d.batch_run_id?()=>n({surface:`checks`,state:`available`,batchRunId:d.batch_run_id,attemptRunId:d.attempt_run_id,kind:`required_check_gate`,focusTargetId:f}):void 0;return(0,A.jsxs)(`li`,{className:`min-w-0 rounded-xl border border-border/70 bg-background/30 px-3 sm:px-4`,children:[(0,A.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2 py-3`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:r(`iteration`,{current:t.ordinal,total:t.historical_max_iterations})}),(0,A.jsx)(S,{variant:`info`,children:l})]}),(0,A.jsx)(S,{variant:t.outcome===`repaired`?`success`:t.outcome===`failed`||t.outcome===`exhausted`?`destructive`:`outline`,children:a})]}),(0,A.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-3 border-t border-border/50 py-3 sm:grid-cols-2`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:r(`blocking.triggering`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-sm font-medium text-foreground`,children:t.triggering_blocking_count})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:r(`blocking.resulting`)}),(0,A.jsx)(`dd`,{className:`mt-1 text-sm font-medium text-foreground`,children:c})]}),(0,A.jsx)(he,{label:r(`evaluator.observation`),evidence:t.triggering_review}),(0,A.jsx)(he,{label:r(`evaluator.verification`),evidence:t.resulting_review})]}),(0,A.jsxs)(`div`,{className:`border-t border-border/50`,children:[(0,A.jsx)(U,{role:r(`role.observation`),status:t.runs.triggering_review.status,stateLabel:r(W(t.runs.triggering_review.state)),runId:t.runs.triggering_review.run_id,startedAt:t.runs.triggering_review.started_at,completedAt:t.runs.triggering_review.completed_at,actionLabel:r(`navigation.openReview`),controlId:`review-loop-${t.id}-observation`,onNavigate:u(t.runs.triggering_review,`triggering_review`,`review-loop-${t.id}-observation`)}),(0,A.jsx)(U,{role:r(`role.actionEnvelope`),status:t.runs.action_envelope.status,stateLabel:r(W(t.runs.action_envelope.state)),runId:t.runs.action_envelope.run_id,startedAt:t.runs.action_envelope.started_at,completedAt:t.runs.action_envelope.completed_at,actionLabel:r(`navigation.openActionEnvelope`),controlId:`review-loop-${t.id}-envelope`,onNavigate:u(t.runs.action_envelope,`action_envelope`,`review-loop-${t.id}-envelope`)}),(0,A.jsx)(U,{role:r(`role.action`),status:t.runs.action.status,stateLabel:r(W(t.runs.action.state)),runId:t.runs.action.run_id,startedAt:t.runs.action.started_at,completedAt:t.runs.action.completed_at,actionLabel:r(`navigation.openAction`),controlId:`review-loop-${t.id}-action`,onNavigate:u(t.runs.action,`review_action`,`review-loop-${t.id}-action`)}),(0,A.jsx)(U,{role:r(`role.gate`),status:t.runs.gate.status,stateLabel:r(e?W(t.runs.gate.state):`navigation.projectActivityOnly`),runId:i,startedAt:t.runs.gate.started_at,completedAt:t.runs.gate.completed_at,actionLabel:r(`navigation.openGate`),controlId:f,onNavigate:p}),(0,A.jsx)(U,{role:r(`role.verification`),status:t.runs.verification.status,stateLabel:r(W(t.runs.verification.state)),runId:t.runs.verification.run_id,startedAt:t.runs.verification.started_at,completedAt:t.runs.verification.completed_at,actionLabel:r(`navigation.openVerification`),controlId:`review-loop-${t.id}-verification`,onNavigate:u(t.runs.verification,`review_verification`,`review-loop-${t.id}-verification`)})]}),(0,A.jsxs)(`dl`,{className:`border-t border-border/50 py-3 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`outcome.label`)}),(0,A.jsx)(`dd`,{className:`text-foreground`,children:a})]}),t.stop_reason&&(0,A.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:[(0,A.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`stopReason.label`)}),(0,A.jsx)(`dd`,{className:`break-words text-foreground`,children:r(`stopReason.${t.stop_reason}`)})]})]}),(0,A.jsx)(ve,{iteration:t,isProjectActivity:e,onNavigate:n}),(0,A.jsx)(_e,{iteration:t,onNavigate:n}),t.action_agents.length>0&&(0,A.jsxs)(`details`,{className:`border-t border-border/50 py-3`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:r(`agentEvidence.title`,{count:t.action_agents.length})}),(0,A.jsx)(`p`,{className:`mt-2 max-w-[70ch] text-xs text-muted-foreground`,children:r(`agentEvidence.boundedNotice`)}),(0,A.jsx)(`div`,{className:`mt-2`,children:t.action_agents.map((e,t)=>(0,A.jsx)(ge,{agent:e},`${e.label}-${t}`))})]})]})},K=({isProjectActivity:e=!0,loop:t,onNavigate:n})=>{let{t:r}=g(`common`,{keyPrefix:`activityView.details.reviewLoop`}),i=`review-loop-${t.owner_run_id}`;return(0,A.jsxs)(`section`,{"aria-labelledby":i,className:`mt-5 min-w-0 rounded-2xl border border-violet-400/20 bg-violet-500/5 p-4`,children:[(0,A.jsxs)(`header`,{children:[(0,A.jsx)(`h2`,{id:i,className:`text-sm font-semibold text-foreground`,children:r(`title`)}),(0,A.jsx)(`p`,{className:`mt-1 max-w-[70ch] break-words text-xs text-muted-foreground`,children:r(`description`)})]}),(0,A.jsx)(`ol`,{"aria-label":r(`iterationsAriaLabel`),className:`mt-4 space-y-3`,children:t.iterations.map(t=>(0,A.jsx)(ye,{iteration:t,onNavigate:n,isProjectActivity:e},t.id))})]})},be=p(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),q=({className:e})=>(0,A.jsx)(be,{"aria-hidden":`true`,className:e}),xe=e=>{let t=e.metadata?.post_build_finalization;if(!t||typeof t!=`object`||!(`check_skip_reason`in t))return null;let n=t.check_skip_reason;return n===`rebase_conflict_resolution`||n===`rebase_in_progress`||n===`git_state_unavailable`?n:null},J=(e,t)=>typeof e==`string`&&t.includes(e)?e:`unknown`,Se=e=>e===`host`||e===`docker_sandbox`?e:`unknown`,Ce=e=>Array.isArray(e)?e.map(e=>{let t=e&&typeof e==`object`?e:{},n=t.capability&&typeof t.capability==`object`?t.capability:null;return{requirement_id:typeof t.requirement_id==`string`?t.requirement_id:``,model_provider:typeof t.model_provider==`string`?t.model_provider:``,authentication_mode:J(t.authentication_mode,[`api_key`,`oauth`]),delivery:J(t.delivery,[`host_environment_inheritance`,`docker_brokered`,`none_required`]),...n?{capability:{classification:J(n.classification,[`brokered_api_key`,`brokered_oauth`,`file_exposed`,`environment_exposed`,`guest_stored`,`unavailable`,`legacy_host_inherited`])}}:{}}}):null,Y=(e,t,n)=>{if(e.kind!==`build`&&e.kind!==`build_follow_up`)return null;let r=t?.relationship===`execution`?t:null,i=r?.authority,a=i?.run_authority,o=e.metadata?.build_execution_provider,s=Array.isArray(e.failure?.details?.unsupported_requirement_ids)?e.failure.details.unsupported_requirement_ids.filter(e=>typeof e==`string`):null;return{provider:a?Se(a.effective.provider):r?Se(i?.provider):o===`host`?`host`:`unknown`,environmentId:i?.environment_id??null,environmentRevision:i?.environment_revision??null,providerVersion:i?.provider_version??null,validationFingerprint:i?.environment_validation_fingerprint??null,agent:i?.agent?J(i.agent,[`opencode`,`claude`,`codex`]):null,targetKind:i?.target.kind??null,targetKey:i?.target.key??null,targetWorkspacePath:i?.target.workspace_path??null,capabilities:i?.capabilities??null,effectiveCapabilities:a?{filesystem:a.effective.filesystem,integration_access:a.effective.integration_access,remote_git:a.effective.remote_git,resources:a.effective.resources}:null,network:a?.effective.network??null,authenticationMode:i?.authentication_mode?J(i.authentication_mode,[`validated_guest`]):null,credentialDelivery:i?.credential_delivery?J(i.credential_delivery,[`sandbox_template`]):null,profileFingerprint:typeof e.metadata?.execution_profile_fingerprint==`string`?e.metadata.execution_profile_fingerprint:a?.selected_profile.fingerprint??null,profileRevisionId:typeof e.metadata?.execution_profile_revision_id==`string`?e.metadata.execution_profile_revision_id:a?.selected_profile.revision_id??null,profileSelectionReason:e.metadata?.execution_profile_selection_reason===`project_active_at_acceptance`||e.metadata?.execution_profile_selection_reason===`historical_lineage`?e.metadata.execution_profile_selection_reason:typeof e.metadata?.execution_profile_selection_reason==`string`?`unknown`:null,worktreePreparation:a?J(a.orchestration.host_disclosure,[`worktree_and_sync_only`,`host_orchestration_and_execution`]):null,setupPlacement:a?Se(a.setup.placement):null,setupLauncher:a?J(a.setup.launcher,[`host_shell`,`docker_sandbox_exec`]):null,setupEvidence:n??null,agentPlacement:a?Se(a.agent.placement):null,agentLauncher:a?J(a.agent.launcher,[`host_process`,`docker_sandbox_exec`]):null,runtimeCredentials:a?Ce(a.runtime_credentials):null,unsupportedRequirements:s??a?.unsupported_requirements??null,degradationReasons:a?.degradations??i?.degradation_reasons??null,fallback:a?.fallback?{policy:J(a.fallback.policy,[`block`,`explicit_host`]),used:a.fallback.used===!0,from:a.fallback.from===null?null:Se(a.fallback.from),reason:typeof a.fallback.reason==`string`?a.fallback.reason:null}:null}},we=e=>e!==`repository_graph_scan`,X=(e,t)=>e.sensitivity===`sensitive`?t.sensitiveTitle:e.title??t.untitledTitle,Te=(e,t)=>{let n=[{minimum:1e9,divisor:1e9,unit:`gigabyte`},{minimum:1e6,divisor:1e6,unit:`megabyte`},{minimum:1e3,divisor:1e3,unit:`kilobyte`},{minimum:0,divisor:1,unit:`byte`}],r=n.find(t=>e>=t.minimum)??n[n.length-1];return new Intl.NumberFormat(t,{style:`unit`,unit:r.unit,unitDisplay:`short`,maximumFractionDigits:r.divisor===1?0:1}).format(e/r.divisor)},Ee=({artifactCount:e,artifacts:t})=>{let{t:n}=g(`common`,{keyPrefix:`activityView.artifacts`});if(e===0)return null;let r={sensitiveTitle:n(`sensitiveTitle`),untitledTitle:n(`untitledTitle`)},i=Math.max(0,e-t.length);return(0,A.jsxs)(`div`,{className:`mt-3`,"aria-label":n(`summaryAriaLabel`,{count:e}),children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1`,children:[(0,A.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:n(`evidence`)}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`count`,{count:e})})]}),(0,A.jsxs)(`ul`,{className:`mt-1.5 flex min-w-0 flex-wrap gap-1.5`,children:[t.map(e=>(0,A.jsx)(`li`,{className:`max-w-full truncate rounded-full border border-border/60 bg-background/35 px-2 py-0.5 text-[11px] text-muted-foreground`,children:X(e,r)},e.id)),i>0&&(0,A.jsx)(`li`,{className:`rounded-full border border-border/60 bg-background/35 px-2 py-0.5 text-[11px] text-muted-foreground`,children:n(`overflow`,{count:i})})]})]})},De=({artifactCount:e,artifacts:t,projectId:n,runId:r})=>{let{t:i,i18n:a}=g(`common`,{keyPrefix:`activityView.artifacts`}),o=O(t);if(e===0)return null;let s={sensitiveTitle:i(`sensitiveTitle`),untitledTitle:i(`untitledTitle`)},c=Math.max(0,e-t.length);return(0,A.jsxs)(`section`,{className:`mt-6`,"aria-labelledby":`artifacts-heading-${r}`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-2`,children:[(0,A.jsx)(`h3`,{id:`artifacts-heading-${r}`,className:`text-sm font-semibold text-foreground`,children:i(`title`)}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i(`count`,{count:e})})]}),(0,A.jsx)(`ul`,{className:`mt-3 space-y-2`,children:t.map(e=>{let t=X(e,s),{availability:c,isAvailable:u,canDownload:d,canOpen:f}=ne(e,o),p=d||f,m=y(n,r,e.id);return(0,A.jsxs)(`li`,{className:`min-w-0 rounded-xl border border-border/60 bg-background/30 p-3`,children:[(0,A.jsx)(`strong`,{className:`line-clamp-2 break-words text-sm font-medium text-foreground`,children:t}),(0,A.jsxs)(`dl`,{className:`mt-2 grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,A.jsx)(`dt`,{children:i(`kindLabel`)}),(0,A.jsx)(`dd`,{children:i(`kind.${e.kind}`)}),(0,A.jsx)(`dt`,{children:i(`mediaType`)}),(0,A.jsx)(`dd`,{className:`min-w-0 break-words`,children:e.media_type}),e.byte_size!=null&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{children:i(`size`)}),(0,A.jsx)(`dd`,{children:Te(e.byte_size,a.language)})]}),(0,A.jsx)(`dt`,{children:i(`expires`)}),(0,A.jsx)(`dd`,{children:new Intl.DateTimeFormat(a.language,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.expires_at))}),(0,A.jsx)(`dt`,{children:i(`sensitivityLabel`)}),(0,A.jsx)(`dd`,{children:e.sensitivity===`sensitive`?i(`sensitivity.sensitive`):i(`sensitivity.normal`)}),(0,A.jsx)(`dt`,{children:i(`availabilityLabel`)}),(0,A.jsx)(`dd`,{children:i(`availability.${c}`)})]}),e.sensitivity===`sensitive`&&d&&(0,A.jsx)(`p`,{className:`mt-2 text-xs font-medium text-amber-200`,children:i(`downloadOnly`)}),p&&(0,A.jsxs)(`div`,{className:`mt-3`,children:[d&&(0,A.jsx)(l,{asChild:!0,variant:`outline`,size:`sm`,children:(0,A.jsx)(`a`,{href:m,download:!0,"aria-label":i(`actions.downloadAriaLabel`,{title:t}),children:i(`actions.download`)})}),f&&(0,A.jsx)(l,{asChild:!0,variant:`outline`,size:`sm`,children:(0,A.jsx)(`a`,{href:m,target:`_blank`,rel:`noreferrer`,"aria-label":i(`actions.openAriaLabel`,{title:t}),children:i(`actions.open`)})})]}),!p&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:i(u?`unavailable.noAction`:`unavailable.${c}`)})]},e.id)})}),c>0&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:i(`overflowDescription`,{count:c})})]})},Oe=(e,t)=>{let n=e.item?.run??e.context;return(t.item?.run??t.context).created_at.localeCompare(n.created_at)||t.id.localeCompare(e.id)},ke=e=>`${e.childRunId}:${e.parentRunId}:${e.code}`,Z=(e,t,n)=>{let r=new Set(n.map(e=>e.run.id)),i=new Map;for(let n of[...e.context_nodes,...t.context_nodes])r.has(n.id)||i.set(n.id,n);let a=new Map,o=new Set([...r,...i.keys()]);for(let n of[...e.boundaries,...t.boundaries])(n.code===`missing_parent`||n.code===`depth_limited`)&&o.has(n.parent_run_id)||a.set(`${n.child_run_id}:${n.parent_run_id}:${n.code}`,n);return{context_nodes:[...i.values()],boundaries:[...a.values()]}},Ae=(e,t)=>{let n=new Map,r=new Set;for(let e of t.context_nodes){if(!we(e.kind)){r.add(e.id);continue}n.set(e.id,{id:e.id,key:e.id,kind:`context`,runKind:e.kind,item:null,context:e,children:[],boundaries:[],depth:0,ancestorKinds:[]})}for(let t of e){if(!we(t.run.kind)){r.add(t.run.id),n.delete(t.run.id);continue}r.delete(t.run.id),n.set(t.run.id,{id:t.run.id,key:t.run.id,kind:`primary`,runKind:t.run.kind,item:t,context:null,children:[],boundaries:[],depth:0,ancestorKinds:[]})}let i=new Map;for(let e of t.boundaries){let t={childRunId:e.child_run_id,parentRunId:e.parent_run_id,code:e.code},n=i.get(e.child_run_id)??[];n.some(e=>ke(e)===ke(t))||n.push(t),i.set(e.child_run_id,n)}let a=e=>e.item?.run.parent_run_id??e.context?.parent_run_id??null,o=[...n.values()].filter(e=>e.kind===`primary`).map(e=>e.id),s=new Set(o);for(let e of o){let t=new Set([e]),o=n.get(e);for(;o&&!i.has(o.id);){let e=a(o);if(!e||r.has(e)||t.has(e))break;let i=n.get(e);if(!i)break;s.add(e),t.add(e),o=i}}for(let e of n.values())e.kind===`context`&&!s.has(e.id)&&n.delete(e.id);let c=new Set;for(let e of n.values()){let t=[e.id],r=new Map([[e.id,0]]),o=e;for(;!i.has(o.id);){let e=a(o);if(!e||!n.has(e))break;let i=r.get(e);if(i!==void 0){for(let e of t.slice(i))c.add(e);break}r.set(e,t.length),t.push(e),o=n.get(e)}}let l=[];for(let e of n.values()){let t=a(e),o=i.get(e.id)??[];if(e.boundaries.push(...o),!t){l.push(e);continue}if(c.has(e.id)){e.boundaries.push({childRunId:e.id,parentRunId:t,code:`invalid_hierarchy`}),l.push(e);continue}if(o.length>0){l.push(e);continue}if(r.has(t)){e.boundaries.push({childRunId:e.id,parentRunId:t,code:`feature_hidden`}),l.push(e);continue}let s=n.get(t);if(!s){e.boundaries.push({childRunId:e.id,parentRunId:t,code:`invalid_hierarchy`}),l.push(e);continue}s.children.push(e)}let u=(e,t,n)=>{e.depth=t,e.ancestorKinds=n,e.children.sort(Oe);for(let r of e.children)u(r,t+1,[...n,e.runKind])};l.sort(Oe);for(let e of l)u(e,0,[]);return{roots:l,representedRunIds:new Set(n.keys())}},je=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Me=e=>[`opencode_approval_decided`,`opencode_approval_cancelled`,`opencode_approval_expired`].includes(e.event_type)||e.event_type===`opencode_approval_invalidated`&&je(e.metadata)&&Object.prototype.hasOwnProperty.call(e.metadata,`opencode_approval`),Ne=e=>typeof e==`string`&&e.trim().length>0&&Number.isFinite(Date.parse(e)),Pe=e=>{if(!Me(e)||e.metadata_schema_version!==1||!je(e.metadata))return null;let t=e.metadata.opencode_approval;if(!je(t)||![`id`,`permission`,`parentId`,`nativeSessionId`,`nativeRequestId`].every(e=>typeof t[e]==`string`&&t[e].trim().length>0)||!Array.isArray(t.patterns)||!t.patterns.every(e=>typeof e==`string`)||!(t.command===null||typeof t.command==`string`)||!(t.description===null||typeof t.description==`string`)||![`parentKind`,`status`,`source`,`reason`].every(e=>typeof t[e]==`string`)||!(t.decision===null||typeof t.decision==`string`)||![`ticket`,`chat`,`spec`].includes(String(t.parentKind))||![`approved`,`rejected`,`cancelled`,`invalidated`].includes(String(t.status))||![`operator`,`native`,`system`].includes(String(t.source))||![`operator_decision`,`native_reply`,`transport_cancelled`,`approval_expired`,`server_restart`,`binding_unavailable`].includes(String(t.reason))||!(t.decision===null||[`once`,`session`,`reject`].includes(String(t.decision)))||!Ne(t.createdAt)||!Ne(t.resolvedAt)||Date.parse(t.resolvedAt)<Date.parse(t.createdAt)||!(t.evidenceTruncated===void 0||t.evidenceTruncated===!0))return null;let n=t,r=n.reason===`operator_decision`?`operator`:n.reason===`native_reply`?`native`:`system`,i=n.reason===`approval_expired`?`opencode_approval_expired`:n.status===`invalidated`?`opencode_approval_invalidated`:n.status===`cancelled`?`opencode_approval_cancelled`:`opencode_approval_decided`,a=n.status===`approved`||n.status===`rejected`;return n.source!==r||e.event_type!==i||a&&n.source===`system`||!a&&n.source!==`system`||n.status===`approved`&&n.decision!==`once`&&n.decision!==`session`||n.status===`rejected`&&n.decision!==`reject`||!a&&n.decision!==null?null:n},Fe=(e,t)=>{if(!Me(e))return null;let n=Pe(e);return n?t(`opencodeApproval.summary`,{outcome:t(`opencodeApproval.outcome.${n.reason===`approval_expired`?`expired`:n.status===`approved`?n.decision:n.status}`),source:t(`opencodeApproval.source.${n.source}`),permission:n.permission}):t(`opencodeApproval.unavailable`)},Ie=e=>e===`failed`||e===`interrupted`?`border-red-400/30 bg-red-500/10 text-red-200`:e===`completed`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e===`running`||e===`waiting`||e===`queued`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border bg-muted/40 text-muted-foreground`,Le=({summary:e})=>{let{t}=g(`common`,{keyPrefix:`activityView.automationLoop`}),n=e.current_iteration??e.iteration_count,r=n>0,i=e.stop_reason??e.outcome,a=i?t(`${e.stop_reason?`stopReason`:`outcome`}.${e.kind}.${i}`,{defaultValue:t(`state.unavailable`)}):null;return(0,A.jsxs)(`div`,{className:`mt-3 min-w-0 rounded-xl border border-border/60 bg-background/30 px-3 py-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:t(`kind.${e.kind}`)}),(0,A.jsx)(S,{variant:e.phase===`terminal`?`outline`:e.phase===`paused`?`warning`:`info`,children:t(`phase.${e.phase}`)}),r&&(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`iteration`,{current:n,total:e.historical_max_iterations})})]}),a&&(0,A.jsx)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:a})]})},Re=({item:e,isChild:t=!1,isSelected:n,ancestryLabel:r,onFocusRun:i,onSelectRun:a})=>{let{t:s,i18n:c}=g(`common`,{keyPrefix:`activityView`}),{run:l,latest_event:u,latest_outcome:d}=e,f=u?Fe(u,s):null,p=f??d?.text,m=s(`kind.${l.kind}`,{defaultValue:s(`kind.unknown`)}),h=s(`status.${l.status}`,{defaultValue:s(`status.unknown`)}),_=new Intl.DateTimeFormat(c.language,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(u?.created_at??l.updated_at)),v=l.retry_of_run_id?s(`details.retryLineage`,{count:l.attempt}):null,y=l.kind===`environment_validation`?e.environment_context:null,b=Y(l,e.environment_context),x=E(e.environment_context),S=y?.live_environment,C=y?s(`environmentContext.summary`,{target:S?.target_key??s(`environmentContext.unknown`),revision:S?.environment_revision??s(`environmentContext.unknown`),provider:S?.provider_kind??s(`environmentContext.unknown`)}):l.source_reference?.label??s(`details.sourceUnavailable`),w=(e.loop_summaries??[]).filter(e=>e.owner_run_id===l.id&&(e.kind===`review_auto_fix`&&l.kind===`automation_progression`||e.kind===`check_auto_fix`&&l.kind===`check_auto_fix`)),T=s(`actions.viewDetailsForRun`,{kind:m,count:l.attempt}),te=w.map(e=>{let t=e.current_iteration??e.iteration_count,n=e.stop_reason??e.outcome,r=n?s(`automationLoop.${e.stop_reason?`stopReason`:`outcome`}.${e.kind}.${n}`,{defaultValue:s(`automationLoop.state.unavailable`)}):null;return[s(`automationLoop.kind.${e.kind}`),s(`automationLoop.phase.${e.phase}`),t>0?s(`automationLoop.iteration`,{current:t,total:e.historical_max_iterations}):null,r].filter(e=>e!==null).join(`, `)}),D=te.length>0?s(`actions.viewDetailsForRunWithLoopSummary`,{run:T,summary:te.join(`; `)}):T,O=r?s(`hierarchy.accessiblePath`,{row:D,path:r}):D;return(0,A.jsx)(`article`,{role:`button`,tabIndex:0,"aria-current":n?`true`:void 0,"aria-label":O,"data-activity-run-id":l.id,onFocus:()=>i(l.id),onClick:e=>a(l.id,e.currentTarget),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a(l.id,e.currentTarget))},className:o(`rounded-2xl border bg-card/55 p-4 transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,n?`border-primary/60`:`border-border/70 hover:border-border`,t&&`rounded-xl bg-background/35`),children:(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:s(`runAttemptTitle`,{kind:m,count:l.attempt})}),(0,A.jsx)(`span`,{className:o(`rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em]`,Ie(l.status)),children:h})]}),(0,A.jsxs)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:[C,` · `,_]}),x&&(0,A.jsx)(ee,{evidence:x,showDegraded:x.provider!==`host`,className:`mt-2`}),b&&(0,A.jsxs)(`div`,{className:`mt-1 space-y-1 text-xs font-medium text-sky-200`,children:[(0,A.jsx)(`p`,{children:s(`buildEvidence.timeline.${b.provider}`,{revision:b.environmentRevision??s(`buildEvidence.unknown`)})}),b.profileFingerprint&&(0,A.jsx)(`p`,{className:`break-all font-mono text-[11px] font-normal text-sky-100/80`,children:s(`buildEvidence.profileSelection`,{fingerprint:b.profileFingerprint,reason:s(`buildEvidence.selectionReason.${b.profileSelectionReason??`unknown`}`)})}),b.network&&(0,A.jsx)(`p`,{className:`font-normal text-sky-100/80`,children:s(`buildEvidence.network.summary`,{mode:s(`buildEvidence.network.mode.${b.network.requested_mode}`),enforcement:s(`buildEvidence.network.enforcement.${b.network.enforcement}`)})})]}),v&&(0,A.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:v}),p&&(0,A.jsx)(`p`,{className:o(`mt-2 line-clamp-2 break-words text-sm`,!f&&d?.source===`failure_message`?`text-red-300`:`text-foreground/80`),children:p}),w.map(e=>(0,A.jsx)(Le,{summary:e},e.kind)),(0,A.jsx)(Ee,{artifacts:e.artifacts,artifactCount:e.artifact_count})]})})},ze=({attempt:e,isSelected:t,onFocusRun:n,onSelectRun:r})=>{let{t:i}=g(`common`,{keyPrefix:`activityView`}),a=i(`kind.check_attempt`);return(0,A.jsx)(`article`,{role:`button`,tabIndex:0,"aria-current":t?`true`:void 0,"aria-label":i(`actions.viewDetailsForCheck`,{name:e.command_snapshot.name}),"data-activity-run-id":e.execution_run_id,onFocus:()=>n(e.execution_run_id),onClick:t=>r(e.execution_run_id,t.currentTarget),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e.execution_run_id,t.currentTarget))},className:o(`rounded-xl border bg-background/35 p-3 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,t?`border-primary/60`:`border-border/70`),children:(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground`,children:e.command_snapshot.name}),(0,A.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[a,` · `,i(`status.${e.execution_status}`)]})]})})},Be=({node:e,ancestryLabel:t})=>{let{t:n,i18n:r}=g(`common`,{keyPrefix:`activityView`}),i=e.context,a=n(`kind.${i.kind}`,{defaultValue:n(`kind.unknown`)}),s=n(`status.${i.status}`,{defaultValue:n(`status.unknown`)}),c=new Intl.DateTimeFormat(r.language,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(i.completed_at??i.created_at));return(0,A.jsxs)(`article`,{"aria-label":n(`hierarchy.contextAccessibleLabel`,{kind:a,count:i.attempt,path:t??n(`hierarchy.topLevel`)}),className:`rounded-xl border border-dashed border-border/70 bg-muted/15 px-3 py-3`,children:[(0,A.jsx)(`p`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:n(`hierarchy.contextOnly`)}),(0,A.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h2`,{className:`text-sm font-medium text-foreground/90`,children:n(`runAttemptTitle`,{kind:a,count:i.attempt})}),(0,A.jsx)(`span`,{className:o(`rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.12em]`,Ie(i.status)),children:s})]}),(0,A.jsxs)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:[i.source_reference?.label??n(`details.sourceUnavailable`),` · `,c]})]})},Q=({boundary:e})=>{let{t}=g(`common`,{keyPrefix:`activityView.hierarchy`});return(0,A.jsxs)(`div`,{role:`note`,className:`mb-2 rounded-lg border border-amber-400/25 bg-amber-500/8 px-3 py-2 text-xs text-amber-100`,children:[(0,A.jsx)(`p`,{className:`font-medium`,children:t(`boundary.${e.code}`)}),(0,A.jsx)(`p`,{className:`mt-0.5 text-amber-100/75`,children:t(`partialBranch`)})]})},Ve=e=>e<3?`mt-2 space-y-2 border-l border-border/70 pl-2 lg:pl-3`:e<6?`mt-2 space-y-2 lg:border-l lg:border-border/70 lg:pl-3`:`mt-2 space-y-2`,He=(e,t)=>(e.item?.check_batch?.attempts??[]).filter(e=>!t.has(e.execution_run_id)),Ue=(e,t)=>e.children.length>0||He(e,t).length>0,We=({node:e,representedRunIds:t,selectedRunId:n,onFocusRun:r,onSelectRun:i})=>{let{t:a}=g(`common`,{keyPrefix:`activityView`}),o=e.ancestorKinds.map(e=>a(`kind.${e}`,{defaultValue:a(`kind.unknown`)})),s=o.length>0?o.join(` › `):null,c=He(e,t),l=Ue(e,t);return(0,A.jsxs)(A.Fragment,{children:[e.depth>=3&&s&&(0,A.jsx)(`p`,{className:`mb-1.5 break-words text-[11px] text-muted-foreground lg:sr-only`,children:a(`hierarchy.nestedUnder`,{path:s})}),e.boundaries.map(e=>(0,A.jsx)(Q,{boundary:e},`${e.parentRunId}:${e.code}`)),e.item?(0,A.jsx)(Re,{item:e.item,isChild:e.depth>0,isSelected:n===e.id,ancestryLabel:s,onFocusRun:r,onSelectRun:i}):(0,A.jsx)(Be,{node:e,ancestryLabel:s}),l&&(0,A.jsxs)(`ol`,{className:Ve(e.depth),children:[c.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsx)(ze,{attempt:e,isSelected:n===e.execution_run_id,onFocusRun:r,onSelectRun:i})},e.execution_run_id)),e.children.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsx)(We,{node:e,representedRunIds:t,selectedRunId:n,onFocusRun:r,onSelectRun:i})},e.key))]})]})},Ge=({node:e,representedRunIds:t,selectedRunId:n,onFocusRun:r,onSelectRun:i})=>{let{t:a}=g(`common`,{keyPrefix:`activityView`}),o=(0,A.jsx)(We,{node:e,representedRunIds:t,selectedRunId:n,onFocusRun:r,onSelectRun:i});return Ue(e,t)?(0,A.jsx)(`section`,{"aria-label":a(`group.ariaLabel`),className:`min-w-0 rounded-2xl border border-border/70 bg-card/25 p-3`,children:o}):o},Ke=({items:e,hierarchy:t={context_nodes:[],boundaries:[]},scope:n,selectedRunId:r,isLoading:i,isLoadingMore:a,isReconnecting:o,hasMore:s,error:c,onLoadMore:u,onRefresh:d,onSelectRun:f,focusRef:p})=>{let{t:m}=g(`common`,{keyPrefix:`activityView`}),h=Ae(e,t),_=(0,k.useRef)(null);return(0,k.useLayoutEffect)(()=>{!_.current||document.activeElement!==document.body||[...document.querySelectorAll(`[data-activity-run-id]`)].find(e=>e.dataset.activityRunId===_.current)?.focus()}),(0,A.jsxs)(`section`,{ref:p,tabIndex:-1,"aria-label":m(`timelineAriaLabel`),className:`min-h-0 min-w-0 overflow-x-hidden px-4 py-5 sm:px-6`,children:[o&&(0,A.jsx)(`p`,{role:`status`,className:`mb-3 rounded-xl border border-amber-400/25 bg-amber-500/8 px-3 py-2 text-xs text-amber-200`,children:m(`states.reconnecting`)}),c&&e.length>0&&(0,A.jsxs)(`div`,{role:`alert`,className:`mb-3 flex flex-col gap-2 rounded-xl border border-red-400/25 bg-red-500/8 px-3 py-2 text-xs text-red-200 sm:flex-row sm:items-center sm:justify-between`,children:[(0,A.jsx)(`span`,{children:c}),(0,A.jsx)(l,{type:`button`,variant:`ghost`,size:`xs`,onClick:d,children:m(`actions.tryAgain`)})]}),i&&e.length===0&&(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:m(`states.loading`)}),c&&e.length===0&&(0,A.jsxs)(`div`,{className:`rounded-2xl border border-red-400/25 bg-red-500/8 p-4`,role:`alert`,children:[(0,A.jsx)(`p`,{className:`text-sm text-red-200`,children:c}),(0,A.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,className:`mt-3`,onClick:d,children:m(`actions.tryAgain`)})]}),!i&&!c&&e.length===0&&!s&&(0,A.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-card/30 p-6 text-center`,children:[(0,A.jsx)(`h2`,{className:`text-base font-medium text-foreground`,children:m(`scope.${n.type}.emptyTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:m(`scope.${n.type}.emptyDescription`)})]}),(0,A.jsx)(`ol`,{className:`space-y-3`,children:h.roots.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsx)(Ge,{node:e,representedRunIds:h.representedRunIds,selectedRunId:r,onFocusRun:e=>{_.current=e},onSelectRun:f})},e.key))}),s&&(0,A.jsx)(l,{type:`button`,variant:`outline`,className:`mt-4 w-full`,disabled:i||a,onClick:u,children:m(`actions.loadMore`)})]})},qe=({evidence:e})=>{let{t,i18n:n}=g(`common`,{keyPrefix:`activityView.opencodeApproval`}),r=e=>new Intl.DateTimeFormat(n.language,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e));return(0,A.jsxs)(`div`,{className:`mt-2 min-w-0 text-xs`,children:[(0,A.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-muted-foreground`,children:[[{key:`id`,value:e.id},{key:`permission`,value:e.permission},{key:`source`,value:t(`source.${e.source}`)},{key:`reason`,value:t(`reason.${e.reason}`)},{key:`scope`,value:e.decision&&t(`scope.${e.decision}`)},{key:`command`,value:e.command},{key:`description`,value:e.description}].filter(e=>e.value).map(e=>(0,A.jsxs)(`div`,{className:`contents`,children:[(0,A.jsx)(`dt`,{children:t(`fields.${e.key}`)}),(0,A.jsx)(`dd`,{className:`min-w-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.value})]},e.key)),e.patterns.length>0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{children:t(`fields.patterns`)}),(0,A.jsx)(`dd`,{className:`min-w-0`,children:(0,A.jsx)(`ul`,{className:`space-y-1 font-mono`,children:e.patterns.map((e,t)=>(0,A.jsx)(`li`,{className:`whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e},t))})})]}),(0,A.jsx)(`dt`,{children:t(`fields.createdAt`)}),(0,A.jsx)(`dd`,{children:(0,A.jsx)(`time`,{dateTime:e.createdAt,children:r(e.createdAt)})}),(0,A.jsx)(`dt`,{children:t(`fields.resolvedAt`)}),(0,A.jsx)(`dd`,{children:(0,A.jsx)(`time`,{dateTime:e.resolvedAt,children:r(e.resolvedAt)})})]}),e.evidenceTruncated&&(0,A.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:t(`truncated`)}),(0,A.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:t(`executionNotice`)})]})},Je=(e,t)=>!e||!Number.isFinite(Date.parse(e))?null:new Intl.DateTimeFormat(t,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e)),Ye=e=>{if(e==null)return null;if(e<1e3)return`${e} ms`;let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m ${i}s`:r>0?`${r}m ${i}s`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`},Xe=20,Ze=({events:e,selectedEventId:t})=>{let{t:n,i18n:r}=g(`common`,{keyPrefix:`activityView`}),i=(0,k.useRef)(null),a=e.filter(e=>!e.event_type.startsWith(`artifact_`)||e.id===t),s=a.slice(-Xe),c=t?a.find(e=>e.id===t):null,l=c&&!s.some(e=>e.id===c.id)?[c,...s.slice(-(Xe-1))]:s;return(0,k.useEffect)(()=>{t&&(i.current?.scrollIntoView?.({block:`center`}),i.current?.focus({preventScroll:!0}))},[e,t]),(0,A.jsx)(`ol`,{className:`space-y-2`,"aria-label":n(`details.evidenceAriaLabel`),children:l.map((e,a)=>{let s=Pe(e),c=Fe(e,n)??(e.message||n(`events.fallback`)),u=l[a+1],d=u?Date.parse(u.created_at)-Date.parse(e.created_at):null;return(0,A.jsxs)(`li`,{ref:e.id===t?i:void 0,"aria-current":e.id===t?`true`:void 0,tabIndex:e.id===t?-1:void 0,className:o(`rounded-xl border border-border/60 bg-background/30 px-3 py-2 outline-none`,e.id===t&&`border-sky-300/70 bg-sky-500/10 ring-2 ring-sky-300/40`),children:[(0,A.jsx)(`span`,{className:`block text-xs font-medium text-foreground [overflow-wrap:anywhere]`,children:c}),s&&(0,A.jsx)(qe,{evidence:s}),(0,A.jsxs)(`dl`,{className:`mt-2 grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,A.jsx)(`dt`,{children:n(`events.sequence`)}),(0,A.jsx)(`dd`,{children:e.sequence}),e.to_status&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{children:n(`events.transition`)}),(0,A.jsx)(`dd`,{children:e.from_status?n(`events.transitionValue`,{from:n(`status.${e.from_status}`),to:n(`status.${e.to_status}`)}):n(`status.${e.to_status}`)})]}),e.domain_status&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{children:n(`events.outcome`)}),(0,A.jsx)(`dd`,{className:`break-words`,children:e.domain_status})]}),d!=null&&d>=0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{children:n(`events.timeInState`)}),(0,A.jsx)(`dd`,{children:Ye(d)})]})]}),(0,A.jsx)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:Je(e.created_at,r.language)})]},e.id)})})},Qe=50,$e=100,et={context_nodes:[],boundaries:[]},tt=(e,t)=>e===`project`?{type:`project`}:{type:e,id:t},nt=(e,t)=>t.run.created_at.localeCompare(e.run.created_at)||t.run.id.localeCompare(e.run.id),rt=(e,t)=>{let n=new Map(e.map(e=>[e.run.id,e]));for(let e of t){if(!we(e.run.kind))continue;let t=n.get(e.run.id),r=e.parent&&!we(e.parent.kind)?{...e,parent:null}:e;(!t||r.run.updated_at>=t.run.updated_at)&&n.set(r.run.id,r)}return[...n.values()].sort(nt)},it=(e,n,r,i)=>{let{t:a}=g(`common`,{keyPrefix:`activityView`}),o=_(),s=n.type===`project`?null:n.id,c=JSON.stringify([e,n.type,s,r,i]),[l,d]=(0,k.useState)({key:c,items:[],hierarchy:et,nextCursor:null,loadedPages:1}),[f,p]=(0,k.useState)(!1),[m,v]=(0,k.useState)(!1),[y,b]=(0,k.useState)(null),[ee,x]=(0,k.useState)(0),S=(0,k.useRef)(0),C=(0,k.useRef)(null),w=(0,k.useRef)(null),T=(0,k.useRef)(c),E=l.key===c?l.items:[],te=l.key===c?l.hierarchy:et,D=l.key===c?l.nextCursor:null;return(0,k.useEffect)(()=>{T.current=c},[c]),(0,k.useEffect)(()=>{let o=l.key===c?l.loadedPages:1,f=S.current+1;if(S.current=f,C.current?.abort(),v(!1),p(!0),b(null),d(e=>e.key===c?e:{key:c,items:[],hierarchy:et,nextCursor:null,loadedPages:1}),!e){d({key:c,items:[],hierarchy:et,nextCursor:null,loadedPages:1}),p(!1);return}let m=new AbortController;return(async()=>{let t=[],c=et,l=null,u=0;do{let o=await h(e,{scope:tt(n.type,s),kind:r===`all`?void 0:r,statuses:i===`all`||i===`approval_required`?void 0:[i],domainStatus:i===`approval_required`?i:void 0,cursor:l,limit:Qe,signal:m.signal,fallbackErrorMessage:a(`errors.list`)});t=rt(t,o.items),c=Z(c,o.hierarchy,t),l=o.next_cursor,u+=1}while(l&&u<o);return{items:t,hierarchy:c,nextCursor:l,loadedPages:u}})().then(e=>{!m.signal.aborted&&f===S.current&&d({key:c,...e})}).catch(e=>{!u(e)&&f===S.current&&b(e instanceof t?e.message:a(`errors.list`))}).finally(()=>{!m.signal.aborted&&f===S.current&&p(!1)}),()=>m.abort()},[r,e,c,ee,s,n.type,i,a]),(0,k.useEffect)(()=>{let t=t=>{t&&typeof t==`object`&&`project_id`in t&&t.project_id!==e||(w.current||=setTimeout(()=>{w.current=null,x(e=>e+1)},$e))};return o.on(`execution-run:updated`,t),o.on(`lifecycle-event:created`,t),o.on(`review-loop-iteration:updated`,t),o.on(`connect`,t),()=>{o.off(`execution-run:updated`,t),o.off(`lifecycle-event:created`,t),o.off(`review-loop-iteration:updated`,t),o.off(`connect`,t)}},[e,o]),(0,k.useEffect)(()=>()=>{C.current?.abort(),w.current&&clearTimeout(w.current)},[]),{items:E,hierarchy:te,runs:E.map(e=>e.run),error:y,isLoading:f,isLoadingMore:m,hasMoreRuns:D!==null,loadMore:()=>{if(!e||!D||f||m)return;let o=new AbortController;C.current?.abort(),C.current=o;let l=c,p=S.current;v(!0),b(null),h(e,{scope:tt(n.type,s),kind:r===`all`?void 0:r,statuses:i===`all`||i===`approval_required`?void 0:[i],domainStatus:i===`approval_required`?i:void 0,cursor:D,limit:Qe,signal:o.signal,fallbackErrorMessage:a(`errors.list`)}).then(e=>{T.current===l&&S.current===p&&d(t=>{if(t.key!==l)return t;let n=rt(t.items,e.items);return{...t,items:n,hierarchy:Z(t.hierarchy,e.hierarchy,n),nextCursor:e.next_cursor,loadedPages:t.loadedPages+1}})}).catch(e=>{!u(e)&&T.current===l&&S.current===p&&b(e instanceof t?e.message:a(`errors.list`))}).finally(()=>{!o.signal.aborted&&T.current===l&&S.current===p&&v(!1)})},refresh:()=>x(e=>e+1)}},at=`test.check_batch.check_attempt.check_repair.check_auto_fix.github_actions.plan.planning_agent.epic_plan.epic_build.build.review.chat_turn.spec_turn.spec_review.build_follow_up.plan_follow_up.automation_progression.automation_review_fix.automation_commit.automation_push.automation_pull_request.repository_graph_scan.environment_validation.git_push.service`.split(`.`),ot=100,st=`(max-width: 1023px)`,ct=e=>{if(!e||typeof e!=`object`)return null;let t=e.activityRelatedOrigin;if(!t||typeof t!=`object`)return null;let n=t;return typeof n.runId==`string`&&typeof n.focusTargetId==`string`?{runId:n.runId,focusTargetId:n.focusTargetId}:null},lt=e=>{let t=window.history.state&&typeof window.history.state==`object`?window.history.state:{};window.history.replaceState({...t,activityRelatedOrigin:e},``)},ut=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(st).matches,$=({label:e,value:t,stacked:n=!1})=>t==null||t===``?null:(0,A.jsxs)(`div`,{className:n?`border-b border-border/50 py-2 last:border-0`:`grid grid-cols-[minmax(6rem,0.35fr)_minmax(0,1fr)] gap-3 border-b border-border/50 py-2 last:border-0`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,A.jsx)(`dd`,{className:n?`mt-2 min-w-0 break-words text-sm text-foreground`:`min-w-0 break-words text-sm text-foreground`,children:t})]}),dt=({detail:e,detailError:t,events:n,selectedEventId:r,isLoading:i,isRetrying:a,isProjectActivity:o,isRelatedActivity:s,onClose:c,onNavigateToLifecycleSource:u,onNavigateToRelatedReference:d,onRetry:p,projectId:m,retryError:h,retryEligibility:_,retrySourceAttempt:v,run:y,titleRef:b})=>{let{t:S,i18n:C}=g(`common`,{keyPrefix:`activityView`}),w=e?.details,te=w?.kind===`build`?w.setup_authority??null:null,O=_,ne=O.eligible,k=y.kind===`check_batch`,j=y.kind===`environment_validation`?e?.environment_context:null,M=Y(y,e?.environment_context,te),N=xe(y),re=E(e?.environment_context),P=j?.live_environment,ie=j?S(`environmentContext.summary`,{target:P?.target_key??S(`environmentContext.unknown`),revision:P?.environment_revision??S(`environmentContext.unknown`),provider:P?.provider_kind??S(`environmentContext.unknown`)}):null,F=y.metadata?.requested_network_mode===`allowlist`||y.metadata?.requested_network_mode===`unrestricted`?y.metadata.requested_network_mode:null,oe=typeof y.metadata?.observed_network_posture==`string`?y.metadata.observed_network_posture:null,I=typeof y.metadata?.network_enforcement==`string`?y.metadata.network_enforcement:null,L=w?.kind===`github_actions`&&w.available?w.html_url:null,se=!j&&y.source_reference?.available&&(y.source_reference.kind===`ticket`||y.source_reference.kind===`chat_session`||y.source_reference.kind===`spec_session`)?y.source_reference:null,ce=null;return y.retry_of_run_id&&(ce=v==null?S(`details.priorAttemptUnavailable`):S(`details.retryOfAttempt`,{count:v})),(0,A.jsxs)(`aside`,{"aria-label":S(`details.ariaLabel`),className:`min-w-0 p-4 lg:p-5`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:S(`kind.${y.kind}`)}),(0,A.jsx)(`h2`,{ref:b,tabIndex:-1,className:`mt-1 text-lg font-semibold text-foreground`,children:S(`details.title`)})]}),(0,A.jsx)(l,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":S(s?`actions.back`:`actions.close`),className:`shrink-0 text-muted-foreground hover:text-foreground`,onClick:c,children:s?(0,A.jsx)(q,{className:`h-4 w-4`}):(0,A.jsx)(f,{className:`h-4 w-4`})})]}),(0,A.jsxs)(`dl`,{className:`mt-4`,children:[(0,A.jsx)($,{label:S(`details.status`),value:S(`status.${y.status}`)}),N&&(0,A.jsx)($,{label:S(`details.postBuildChecks`),value:S(`checkSkipReason.${N}`)}),(0,A.jsx)($,{label:S(`details.attempt`),value:S(`details.attemptValue`,{count:y.attempt})}),(0,A.jsx)($,{label:S(`details.lineage`),value:ce}),(0,A.jsx)($,{label:S(j?`details.environment`:`details.source`),value:ie??y.source_reference?.label??S(`details.sourceUnavailable`)}),(0,A.jsx)($,{label:S(`details.created`),value:Je(y.created_at,C.language)}),(0,A.jsx)($,{label:S(`details.started`),value:Je(y.started_at,C.language)}),(0,A.jsx)($,{label:S(`details.completed`),value:Je(y.completed_at,C.language)})]}),re&&(0,A.jsx)(ee,{evidence:re,showDegraded:re.provider!==`host`,className:`mt-3`}),(0,A.jsx)(B,{run:y}),y.failure&&(0,A.jsxs)(`div`,{className:`mt-4 rounded-xl border border-red-400/25 bg-red-500/8 p-3`,children:[(0,A.jsx)(`p`,{className:`text-xs font-semibold text-red-200`,children:S(`details.failureReason`)}),(0,A.jsx)(`p`,{className:`mt-1 break-words text-sm text-red-100/90`,children:y.failure.message})]}),y.kind===`environment_validation`&&j&&(0,A.jsxs)(`section`,{className:`mt-4 rounded-xl border border-sky-400/20 bg-sky-500/7 p-3`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-semibold text-sky-100`,children:S(`details.environmentValidationEvidence`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.agent`),value:typeof y.metadata?.agent==`string`?y.metadata.agent:S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.environmentRevision`),value:P?.environment_revision??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.environmentLifecycle`),value:S(P?`environmentLifecycle.${P.lifecycle_state}`:`details.unknown`)}),(0,A.jsx)($,{label:S(`details.networkMode`),value:S(F?`buildEvidence.network.mode.${F}`:`details.unknown`)}),(0,A.jsx)($,{label:S(`details.networkPosture`),value:S(oe?`buildEvidence.network.posture.${oe}`:`details.unknown`)}),(0,A.jsx)($,{label:S(`details.networkEnforcement`),value:S(I?`buildEvidence.network.enforcement.${I}`:`details.unknown`)})]}),y.failure?.code===`server_restarted`&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-amber-100`,children:S(`details.restartInterruptionEvidence`)})]}),M&&(0,A.jsxs)(`section`,{className:`mt-4 rounded-xl border border-sky-400/20 bg-sky-500/7 p-3`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-semibold text-sky-100`,children:S(`details.buildExecutionEvidence`)}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:S(`details.buildExecutionEvidenceNotice`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.buildProvider`),value:S(`buildEvidence.provider.${M.provider}`)}),(0,A.jsx)($,{label:S(`details.profileFingerprint`),value:M.profileFingerprint??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.profileRevision`),value:M.profileRevisionId??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.profileSelected`),value:S(`buildEvidence.selectionReason.${M.profileSelectionReason??`unknown`}`)}),(0,A.jsx)($,{label:S(`details.worktreePreparation`),value:S(`buildEvidence.worktreePreparation.${M.worktreePreparation??`unknown`}`)}),(0,A.jsx)($,{label:S(`details.setupExecution`),value:M.setupEvidence?S(`buildEvidence.setupOutcome.${M.setupEvidence.outcome}`,{count:M.setupEvidence.command_count}):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.setupPlacement`),value:M.setupPlacement?S(`buildEvidence.provider.${M.setupPlacement}`):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.setupLauncher`),value:S(`buildEvidence.launcher.${M.setupLauncher??`unknown`}`)}),M.setupEvidence?.reused_from_evidence_id&&(0,A.jsx)($,{label:S(`details.setupReusedFrom`),value:M.setupEvidence.reused_from_evidence_id}),(0,A.jsx)($,{label:S(`details.agentPlacement`),value:M.agentPlacement?S(`buildEvidence.provider.${M.agentPlacement}`):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.agentLauncher`),value:S(`buildEvidence.launcher.${M.agentLauncher??`unknown`}`)}),(0,A.jsx)($,{label:S(`details.networkEnforcement`),value:M.network?S(`buildEvidence.network.enforcement.${M.network.enforcement}`):S(`details.unknown`)}),M.network&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($,{label:S(`details.networkMode`),value:S(`buildEvidence.network.mode.${M.network.requested_mode}`)}),(0,A.jsx)($,{label:S(`details.networkPosture`),value:S(`buildEvidence.network.posture.${M.network.observed_global_posture}`)}),(0,A.jsx)($,{label:S(`details.networkDestinations`),value:M.network.destinations.length>0?M.network.destinations.map(e=>`${e.target}: ${e.decision}`).join(`, `):S(`details.none`)})]}),(0,A.jsx)($,{label:S(`details.effectiveCapabilities`),stacked:!0,value:(0,A.jsx)(ae,{value:M.effectiveCapabilities})}),(0,A.jsx)($,{label:S(`details.runtimeCredentials`),value:M.runtimeCredentials?M.runtimeCredentials.length>0?M.runtimeCredentials.map(e=>S(`buildEvidence.credential`,{agent:e.model_provider,authentication:S(`buildEvidence.authentication.${e.authentication_mode}`),delivery:e.capability?S(`buildEvidence.credentialClassification.${e.capability.classification}`,{defaultValue:e.capability.classification}):S(`buildEvidence.credentialDelivery.${e.delivery}`)})).join(`; `):S(`buildEvidence.noCredentialRequirements`):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.unsupportedRequirements`),value:M.unsupportedRequirements?M.unsupportedRequirements.length>0?M.unsupportedRequirements.join(`, `):S(`details.none`):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.fallbackEvidence`),value:M.fallback?S(M.fallback.used?`buildEvidence.fallback.used`:`buildEvidence.fallback.${M.fallback.policy}`):S(`details.unknown`)}),M.fallback?.used&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($,{label:S(`details.fallbackSource`),value:M.fallback.from?S(`buildEvidence.provider.${M.fallback.from}`):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.fallbackReason`),value:M.fallback.reason??S(`details.unknown`)})]}),M.provider!==`host`&&(0,A.jsx)($,{label:S(`details.degradation`),value:M.degradationReasons?.length?M.degradationReasons.join(`, `):M.degradationReasons?S(`details.none`):S(`details.unknown`)}),M.provider===`docker_sandbox`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($,{label:S(`details.environmentId`),value:M.environmentId??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.environmentRevision`),value:M.environmentRevision??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.providerVersion`),value:M.providerVersion??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.agent`),value:M.agent??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.target`),value:M.targetKind&&M.targetKey?S(`buildEvidence.target`,{kind:M.targetKind,key:M.targetKey}):S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.targetWorkspace`),value:M.targetWorkspacePath??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.validationFingerprint`),value:M.validationFingerprint??S(`details.unknown`)}),(0,A.jsx)($,{label:S(`details.capabilities`),stacked:!0,value:(0,A.jsx)(ae,{value:M.capabilities})})]})]}),M.provider===`unknown`&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-amber-100`,children:S(`details.buildExecutionUnknown`)})]}),i&&(0,A.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:S(`details.loading`)}),t&&(0,A.jsx)(`p`,{className:`mt-4 text-sm text-red-300`,role:`alert`,children:t}),w?.available&&w.kind===`test`&&(0,A.jsxs)(`section`,{className:`mt-5`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:S(`details.testEvidence`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.command`),value:w.command_name}),(0,A.jsx)($,{label:S(`details.target`),value:w.target_label}),(0,A.jsx)($,{label:S(`details.exitCode`),value:w.exit_code}),(0,A.jsx)($,{label:S(`details.duration`),value:Ye(w.duration_ms)})]}),(0,A.jsx)(`h4`,{className:`mt-3 text-xs font-medium text-muted-foreground`,children:S(`details.output`)}),w.output_retention_state===`expired`?(0,A.jsx)(`p`,{className:`mt-2 rounded-xl border border-border/60 bg-background/30 p-3 text-xs text-muted-foreground`,children:S(`details.outputExpired`)}):(0,A.jsx)(`pre`,{className:`mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-xl border border-border/60 bg-background/30 p-3 font-mono text-xs text-foreground`,children:T(w.output)||S(`details.outputEmpty`)}),w.output_truncated&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:S(`details.outputTruncated`)})]}),w?.available&&w.kind===`github_actions`&&(0,A.jsxs)(`section`,{className:`mt-5`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:S(`details.providerEvidence`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.workflow`),value:w.workflow_name}),(0,A.jsx)($,{label:S(`details.branch`),value:w.head_branch??w.ref}),(0,A.jsx)($,{label:S(`details.conclusion`),value:w.conclusion})]}),w.jobs.length>0&&(0,A.jsx)(`ul`,{className:`mt-3 space-y-2`,children:w.jobs.map(e=>(0,A.jsxs)(`li`,{className:`min-w-0 rounded-xl border border-border/60 bg-background/30 px-3 py-2 text-xs`,children:[(0,A.jsx)(`span`,{className:`break-words font-medium text-foreground`,children:e.name??S(`details.unnamedJob`)}),(0,A.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:e.conclusion??e.status})]},e.id))}),w.jobs_retention_state===`expired`&&(0,A.jsx)(`p`,{className:`mt-3 rounded-xl border border-border/60 bg-background/30 p-3 text-xs text-muted-foreground`,children:S(`details.jobsExpired`)})]}),w?.available&&w.kind===`check_batch`&&w.batch&&(0,A.jsxs)(`section`,{className:`mt-5`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:S(`details.checkBatchEvidence`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.target`),value:w.batch.target_label}),(0,A.jsx)($,{label:S(`details.selectedChecks`),value:w.batch.selected_definition_snapshots.map(e=>e.name).join(`, `)}),(0,A.jsx)($,{label:S(`details.outcome`),value:S(`details.batchCounts`,{passed:w.batch.passed_count,failed:w.batch.failed_count,running:w.batch.running_count,queued:w.batch.queued_count})}),(0,A.jsx)($,{label:S(`details.rerunSource`),value:w.batch.rerun_of_batch_run_id})]}),D(w.batch)&&(0,A.jsx)(ee,{evidence:D(w.batch),className:`mt-3`}),(0,A.jsx)(`ul`,{className:`mt-3 space-y-2`,children:w.attempts.map(e=>(0,A.jsxs)(`li`,{className:`rounded-xl border border-border/60 bg-background/30 px-3 py-2 text-xs`,children:[(0,A.jsx)(`span`,{className:`font-medium text-foreground`,children:e.command_snapshot.name}),(0,A.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:S(`status.${e.execution_status}`)})]},e.execution_run_id))})]}),w?.available&&w.kind===`check_attempt`&&w.attempt&&(0,A.jsxs)(`section`,{className:`mt-5`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:S(`details.checkAttemptEvidence`)}),(0,A.jsxs)(`dl`,{className:`mt-2`,children:[(0,A.jsx)($,{label:S(`details.outcome`),value:w.attempt.outcome?S(`checkOutcome.${w.attempt.outcome}`):S(`status.${w.attempt.execution_status}`)}),(0,A.jsx)($,{label:S(`details.command`),value:w.attempt.command_snapshot.command}),(0,A.jsx)($,{label:S(`details.directory`),value:w.attempt.command_snapshot.cwd??`.`}),(0,A.jsx)($,{label:S(`details.timeout`),value:Ye(w.attempt.command_snapshot.timeout_ms)}),(0,A.jsx)($,{label:S(`details.target`),value:w.batch?.target_label??null}),(0,A.jsx)($,{label:S(`details.currency`),value:w.attempt.currency?S(`currency.${w.attempt.currency}`):null}),(0,A.jsx)($,{label:S(`details.exitCode`),value:w.attempt.exit_code}),(0,A.jsx)($,{label:S(`details.rerunSource`),value:w.attempt.rerun_of_attempt_run_id})]}),w.batch&&D(w.batch,w.attempt)&&(0,A.jsx)(ee,{evidence:D(w.batch,w.attempt),className:`mt-3`}),(0,A.jsx)(`h4`,{className:`mt-3 text-xs font-medium text-muted-foreground`,children:S(`details.output`)}),w.attempt.output_retention_state===`expired`?(0,A.jsx)(`p`,{className:`mt-2 rounded-xl border border-border/60 bg-background/30 p-3 text-xs text-muted-foreground`,children:S(`details.outputExpired`)}):(0,A.jsx)(`pre`,{className:`mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-xl border border-border/60 bg-background/30 p-3 font-mono text-xs text-foreground`,children:T(w.attempt.retained_output)||S(`details.outputEmpty`)}),w.attempt.retained_start_offset>0&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:S(`details.outputTruncated`)})]}),w?.available&&w.kind===`check_repair`&&w.check_repair&&(0,A.jsxs)(`section`,{className:`mt-5 rounded-2xl border border-sky-400/20 bg-sky-500/5 p-4`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:S(`details.checkRepairEvidence`)}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:S(`details.deterministicEvidenceNotice`)}),(0,A.jsxs)(`dl`,{className:`mt-3`,children:[(0,A.jsx)($,{label:S(`details.repairWrapper`),value:w.check_repair.execution_run_id}),(0,A.jsx)($,{label:S(`details.sourceBatch`),value:w.check_repair.source_batch_run_id}),(0,A.jsx)($,{label:S(`details.sourceAttempts`),value:w.check_repair.source_attempt_run_ids.join(`, `)}),(0,A.jsx)($,{label:S(`details.sourceDiagnostics`),value:w.check_repair.diagnostic_ids.join(`, `)}),(0,A.jsx)($,{label:S(`details.sourceRawOutputAttempts`),value:w.check_repair.raw_output_attempt_run_ids.join(`, `)}),(0,A.jsx)($,{label:S(`details.followUpRun`),value:w.check_repair.follow_up_run_id}),(0,A.jsx)($,{label:S(`details.rerunBatch`),value:w.check_repair.rerun_batch_run_id}),(0,A.jsx)($,{label:S(`details.configurationFingerprint`),value:w.check_repair.configuration_fingerprint}),(0,A.jsx)($,{label:S(`details.policyFingerprint`),value:w.check_repair.effective_policy_fingerprint}),(0,A.jsx)($,{label:S(`details.nextBoundary`),value:S(`details.boundary.${w.check_repair.automation_boundary_purpose??`unknown`}`)}),(0,A.jsx)($,{label:S(`details.repairResult`),value:w.check_repair.terminal_result??S(`details.repairPending`)})]}),w.check_repair.terminal_message&&(0,A.jsx)(`p`,{className:`mt-3 rounded-xl border border-border/60 bg-background/35 p-3 text-xs text-muted-foreground`,children:w.check_repair.terminal_message})]}),w?.available&&w.kind===`check_auto_fix`&&w.check_auto_fix&&(0,A.jsx)(me,{details:w.check_auto_fix,isProjectActivity:o,onNavigate:d}),(e?.automation_loops??[]).filter(e=>e.kind===`review_auto_fix`&&e.owner_run_id===y.id).map(e=>(0,A.jsx)(K,{loop:e,isProjectActivity:o,onNavigate:d},e.owner_run_id)),w&&!w.available&&(0,A.jsx)(`p`,{className:`mt-4 rounded-xl border border-border/60 bg-background/30 p-3 text-xs text-muted-foreground`,children:S(`details.evidenceUnavailable`)}),(0,A.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[ne&&(0,A.jsx)(l,{type:`button`,size:`sm`,disabled:a,onClick:()=>p(y),children:S(a?k?`actions.rerunning`:`actions.retrying`:k?`actions.rerun`:`actions.retry`)}),se&&u&&(0,A.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>u(se),children:S(`actions.openSource`)}),L&&(0,A.jsx)(l,{asChild:!0,variant:`outline`,size:`sm`,children:(0,A.jsx)(`a`,{href:L,target:`_blank`,rel:`noreferrer`,children:S(`actions.openProvider`)})})]}),ne&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:S(k?`rerun.retentionNotice`:`retry.retentionNotice`)}),!O.eligible&&!i&&!t&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:S(`retryDenial.${O.reason}`,{defaultValue:S(`retryDenial.unknown`)})}),!j&&y.source_reference&&!y.source_reference.available&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:S(`details.sourceNoLongerAvailable`)}),h&&(0,A.jsx)(`p`,{className:`mt-3 text-sm text-red-300`,role:`alert`,children:h}),(0,A.jsx)(De,{artifacts:e?.artifacts??[],artifactCount:e?.artifact_count??0,projectId:m,runId:y.id}),e?.links?.some(e=>e.entity_type===`approval_request`&&e.relationship===`context`)&&(0,A.jsx)(x,{projectId:m,executionRunId:y.id}),(0,A.jsxs)(`section`,{className:`mt-6`,children:[(0,A.jsx)(`h3`,{className:`mb-3 text-sm font-semibold text-foreground`,children:S(`details.transitions`)}),n.length>0?(0,A.jsx)(Ze,{events:n,selectedEventId:r}):(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:S(`details.noTransitions`)})]})]})},ft=({error:e,isRelatedActivity:t,onBack:n,onRetry:r,titleRef:i})=>{let{t:a}=g(`common`,{keyPrefix:`activityView`});return(0,A.jsxs)(`aside`,{"aria-label":a(`details.ariaLabel`),className:`min-w-0 p-4 lg:p-5`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsx)(`h2`,{ref:i,tabIndex:-1,className:`text-lg font-semibold text-foreground`,children:a(`details.title`)}),(0,A.jsx)(l,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":a(t?`actions.back`:`actions.close`),className:`shrink-0 text-muted-foreground hover:text-foreground`,onClick:n,children:t?(0,A.jsx)(q,{className:`h-4 w-4`}):(0,A.jsx)(f,{className:`h-4 w-4`})})]}),e?(0,A.jsxs)(`div`,{className:`mt-4`,children:[(0,A.jsx)(`p`,{className:`text-sm text-red-300`,role:`alert`,children:e}),(0,A.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,className:`mt-4`,onClick:r,children:a(`actions.tryAgain`)})]}):(0,A.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:a(`details.loading`)})]})},pt=({onCancel:e,onConfirm:t,open:n,isRerun:o})=>{let{t:c}=g(`common`,{keyPrefix:`activityView`}),u=(0,k.useRef)(null),f=(0,k.useRef)(null);return(0,A.jsx)(s,{open:n,onOpenChange:t=>{t||e()},children:(0,A.jsxs)(a,{role:`alertdialog`,"aria-modal":`true`,showCloseButton:!1,className:`max-w-md gap-0`,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.stopPropagation(),onOpenAutoFocus:e=>{e.preventDefault(),f.current=document.activeElement instanceof HTMLElement?document.activeElement:null,u.current?.focus()},onCloseAutoFocus:e=>{e.preventDefault(),f.current?.focus()},children:[(0,A.jsx)(i,{children:c(o?`rerun.confirmTitle`:`retry.confirmTitle`)}),(0,A.jsx)(r,{className:`mt-3`,children:c(o?`rerun.confirmDescription`:`retry.confirmDescription`)}),(0,A.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,A.jsx)(d,{asChild:!0,children:(0,A.jsx)(l,{ref:u,type:`button`,variant:`ghost`,children:c(`actions.cancel`)})}),(0,A.jsx)(l,{type:`button`,onClick:t,children:c(o?`rerun.confirmAction`:`retry.confirmAction`)})]})]})})},mt=({projectId:e,onClose:n,onDetailsClose:c,onNavigateToLifecycleSource:p,initialRunId:h=null,initialEventId:y=null,hasActivityParent:ee=!1,onRunSelectionChange:x,onRelatedReferenceSelection:S,onUnavailable:T,scope:E={type:`project`}})=>{let{t:D}=g(`common`,{keyPrefix:`activityView`}),O=_(),ne=(0,k.useRef)(typeof document<`u`&&document.activeElement instanceof HTMLElement?document.activeElement:null),[j,M]=(0,k.useState)(`all`),[N,re]=(0,k.useState)(`all`),{items:P,hierarchy:ie,runs:ae,isLoading:F,isLoadingMore:oe,hasMoreRuns:I,error:L,loadMore:se,refresh:ce}=it(e,E,j,N),[R,z]=(0,k.useState)(y?null:h),[B,V]=(0,k.useState)(null),[le,H]=(0,k.useState)(null),[U,ue]=(0,k.useState)(null),[de,fe]=(0,k.useState)(!1),[pe,me]=(0,k.useState)(0),[W,he]=(0,k.useState)(!1),[ge,G]=(0,k.useState)(null),[_e,ve]=(0,k.useState)(null),[ye,K]=(0,k.useState)(null),[be,q]=(0,k.useState)(null),[xe,J]=(0,k.useState)(!1),[Se,Ce]=(0,k.useState)(0),Y=(0,k.useRef)(null),X=(0,k.useRef)(0),Te=(0,k.useRef)(!1),Ee=(0,k.useRef)(!1),De=(0,k.useRef)(null),Oe=(0,k.useRef)(null),ke=(0,k.useRef)(null),Z=(0,k.useRef)(!1),Ae=(0,k.useRef)(!1),je=(0,k.useRef)(h),Me=(0,k.useRef)({kind:j,projectId:e,scopeId:E.type===`project`?null:E.id,scopeType:E.type,status:N}),Ne=(0,k.useRef)(ct(window.history.state)),Pe=(0,k.useRef)([]),Fe=(0,k.useRef)(null),Ie=(0,k.useRef)(!1),Le=(0,k.useRef)(!1),Re=(0,k.useRef)(!1);Y.current=B;let ze=E.type===`project`?null:E.id,Be=B?.run.id===R?B:null,Q=Be?Be.run:ae.find(e=>e.id===R)??null,Ve=P.find(e=>e.run.id===R),He=Be?.events??[],Ue=Q?.retry_of_run_id?ae.find(e=>e.id===Q.retry_of_run_id)?.attempt??null:null;(0,k.useEffect)(()=>()=>{ne.current?.isConnected&&ne.current.focus()},[]),(0,k.useEffect)(()=>{!R||!Q&&!le||!le&&ge!==R||!Z.current||(Z.current=!1,De.current?.focus())},[le,ge,Q,R]),(0,k.useEffect)(()=>{if(R!==null||!Ae.current)return;Ae.current=!1;let e=ke.current;if(e?.isConnected){e.focus();return}Oe.current?.focus()},[R]),(0,k.useEffect)(()=>{let t=je.current,n=Me.current,r=n.kind!==j||n.projectId!==e||n.scopeId!==ze||n.scopeType!==E.type||n.status!==N;r&&(Pe.current=[],Fe.current=null);let i=Ne.current,a=ct(window.history.state);!r&&t&&h&&t!==h&&(i?.runId===h?(Fe.current=i,Z.current=!1):a?.runId===t&&!Ie.current&&(Z.current=!0)),Ie.current=!1,Ne.current=a,Me.current={kind:j,projectId:e,scopeId:ze,scopeType:E.type,status:N},je.current=h,z(y?null:h),Y.current=null,V(null),G(null),H(null),q(null),Le.current=Re.current,Re.current=!1,ue(null)},[y,h,j,e,E.type,ze,N]),(0,k.useEffect)(()=>{let e=Fe.current;if(!e||R!==e.runId||ge!==e.runId)return;Fe.current=null;let t=document.getElementById(e.focusTargetId);if(t instanceof HTMLElement&&t.isConnected){let e=t.parentElement?.closest(`details`);for(;e;)e.open=!0,e=e.parentElement?.closest(`details`);if(t.focus(),document.activeElement===t)return}if(De.current?.isConnected){De.current.focus();return}if(ke.current?.isConnected){ke.current.focus();return}Oe.current?.focus()},[B,le,ge,R]),(0,k.useEffect)(()=>{h&&!y&&z(h)},[y,h]),(0,k.useEffect)(()=>{if(!y||!h)return;let n=new AbortController;return fe(!0),ue(null),v(e,y,n.signal).then(e=>{if(e.execution_run_id!==h){T?.();return}z(h)}).catch(e=>{if(!u(e)){if(e instanceof t&&e.status===404){T?.();return}ue(D(`errors.event`))}}).finally(()=>{n.signal.aborted||fe(!1)}),()=>n.abort()},[pe,y,h,T,e,D]),(0,k.useEffect)(()=>{Le.current||h||F||L||I||P.length!==1||R!==null||(Le.current=!0,z(P[0].run.id))},[L,I,h,F,P,R]),(0,k.useEffect)(()=>{let t=null,n=()=>{!R||t||(t=setTimeout(()=>{if(t=null,Te.current){Ee.current=!0;return}Ce(e=>e+1)},ot))},r=()=>J(!0),i=()=>{J(!1),n()},a=()=>{let e=new Set;R&&e.add(R);let t=Y.current;if(t?.run.id!==R||!t.details.available)return e;if(t.details.kind===`check_batch`&&t.details.attempts.forEach(t=>e.add(t.execution_run_id)),t.details.kind===`check_auto_fix`&&t.details.check_auto_fix){let n=t.details.check_auto_fix;e.add(n.execution_run_id),e.add(n.originating_batch_run_id),e.add(n.causal_execution_run_id),n.final_batch_run_id&&e.add(n.final_batch_run_id),n.attempts.forEach(t=>{e.add(t.source_batch_run_id),t.child_run_id&&e.add(t.child_run_id),t.rerun_batch_run_id&&e.add(t.rerun_batch_run_id)})}return(t.automation_loops??[]).forEach(t=>{t.iterations.forEach(t=>{Object.values(t.runs).forEach(t=>{t.run_id&&e.add(t.run_id)}),t.gate_evidence.source_batch_run_id&&e.add(t.gate_evidence.source_batch_run_id),t.gate_evidence.required_checks.forEach(t=>e.add(t.execution_run_id))})}),e},o=()=>{let e=Y.current;return e?.run.id===R?new Set((e.automation_loops??[]).flatMap(e=>e.kind===`review_auto_fix`?e.iterations.map(e=>e.runs.action.run_id).filter(e=>e!==null):[])):new Set},s=t=>{if(!t||typeof t!=`object`)return;let r=t;if(typeof r.project_id==`string`&&r.project_id!==e)return;let i=a();[r.id,r.execution_run_id,r.batch_run_id,r.run_id,r.attempt_run_id].some(e=>typeof e==`string`&&i.has(e))&&n()},c=t=>{if(!t||typeof t!=`object`)return;let r=t;if(r.project_id!==e)return;let i=typeof r.id==`string`?r.id:r.execution_run_id;typeof i==`string`&&a().has(i)&&n()},l=t=>{if(!t||typeof t!=`object`)return;let r=t;r.project_id===e&&r.automation_progression_run_id===R&&n()},u=e=>{if(!e||typeof e!=`object`||!(`runs`in e)||!Array.isArray(e.runs))return;let t=o();e.runs.some(e=>!e||typeof e!=`object`||!(`execution_run_id`in e)?!1:typeof e.execution_run_id==`string`&&t.has(e.execution_run_id))&&n()},d=t=>{if(t.project_id!==e||t.attempt_run_id!==R)return;let r=Y.current;if(!r||r.run.id!==R||r.details.kind!==`check_attempt`||!r.details.available||!r.details.attempt||r.details.attempt.execution_run_id!==t.attempt_run_id||r.details.attempt.batch_run_id!==t.batch_run_id){n();return}let i=te(w(r.details.attempt),t);if(i.status===`ignored`)return;if(i.status===`refetch`){n();return}let a={...r,details:{...r.details,attempt:{...r.details.attempt,output_revision:i.snapshot.revision,retained_start_offset:i.snapshot.retainedStartOffset,retained_end_offset:i.snapshot.totalByteCount,total_persisted_bytes:i.snapshot.totalByteCount,retained_output:i.snapshot.retainedText,output_retention_state:i.snapshot.retentionState}}};Y.current=a,V(a)};return O.on(`disconnect`,r),O.on(`connect`,i),O.on(`execution-run:updated`,c),O.on(`review-loop-iteration:updated`,l),O.on(`agent-runs:updated`,u),O.on(`github-actions:updated`,s),O.on(`test-session:updated`,s),O.on(`lifecycle-event:created`,s),O.on(`check-attempt:output`,d),()=>{t&&clearTimeout(t),O.off(`disconnect`,r),O.off(`connect`,i),O.off(`execution-run:updated`,c),O.off(`review-loop-iteration:updated`,l),O.off(`agent-runs:updated`,u),O.off(`github-actions:updated`,s),O.off(`test-session:updated`,s),O.off(`lifecycle-event:created`,s),O.off(`check-attempt:output`,d)}},[e,R,O]),(0,k.useEffect)(()=>{if(!e||!R)return;let n=new AbortController,r=X.current+1;return X.current=r,Te.current=!0,he(!0),G(null),H(null),m(e,R,E.type===`project`?{type:`project`}:{type:E.type,id:ze},n.signal,D(`errors.details`)).then(e=>{if(!(n.signal.aborted||X.current!==r||e.run.id!==R)){if(h&&(e.run.kind===`check_batch`||e.run.kind===`check_attempt`)){T?.();return}if(!we(e.run.kind)){z(null),T?.();return}Y.current=e,V(e)}}).catch(e=>{n.signal.aborted||X.current!==r||u(e)||(e instanceof t&&e.status===404&&T?.(),H(e instanceof t?e.message:D(`errors.details`)))}).finally(()=>{n.signal.aborted||X.current!==r||(Te.current=!1,he(!1),G(R),Ee.current&&(Ee.current=!1,Ce(e=>e+1)))}),()=>{n.abort(),X.current===r&&(Te.current=!1,Ee.current=!1)}},[Se,y,h,T,e,E.type,ze,R,D]);let We=async n=>{if(e){ve(n.id),K(null);try{let t=await b(e,n.id),r=`batch`in t?t.batch.execution_run_id:t.execution_run_id,i=n.kind===`check_attempt`&&B?.details.kind===`check_attempt`&&B.details.available?B.details.attempt?.batch_run_id:void 0;Z.current=!0,H(null),z(r),x?.({...n,id:r},i),ce()}catch(e){let r=e instanceof t&&e.data&&typeof e.data==`object`?e.data:null,i=r&&typeof r.reason==`string`?r.reason:null,a=r&&typeof r.error==`string`?r.error.slice(0,300):null;K(i?D(`retryDenial.${i}`,{defaultValue:a??D(`retryDenial.unknown`)}):a??(e instanceof t?e.message:D(`errors.retry`))),e instanceof t&&e.status===409&&(z(n.id),Ce(e=>e+1),ce())}finally{ve(null)}}},Ge=()=>{se()},qe=(e,t)=>{ke.current=t,Z.current=ut(),z(e),K(null);let n=P.find(t=>t.run.id===e);n&&x?.(n.run,n.check_attempt?.batch_run_id)},Je=e=>{if(e.state!==`available`||e.surface===`checks`&&E.type!==`project`)return;if(e.surface===`activity`&&(Z.current=ut(),E.type!==`project`&&R)){Pe.current.push({runId:R,focusTargetId:e.focusTargetId}),z(e.runId),Y.current=null,V(null),G(null),H(null),K(null);return}K(null);let t=window.location.pathname;if(S?.(e,R),e.surface===`activity`&&R&&window.location.pathname!==t){let t={runId:R,focusTargetId:e.focusTargetId};lt(t),Ne.current=t,Ie.current=!0}},Ye=()=>{let e=Pe.current[Pe.current.length-1];if(R&&e){Pe.current.pop(),Fe.current=e,Z.current=!1,z(e.runId),Y.current=null,V(null),G(null),H(null),K(null);return}(h||y)&&(Re.current=!0),Ae.current=!0,z(null),Y.current=null,V(null),G(null),H(null),ue(null),fe(!1),q(null),K(null),c?.()},Xe=()=>{Ce(e=>e+1)},Ze=R!==null||!!(y&&(de||U)),Qe=ee||Pe.current.length>0;return(0,A.jsx)(s,{open:!0,onOpenChange:e=>{e||n()},children:(0,A.jsxs)(a,{showCloseButton:!1,overlayClassName:`duration-0 data-open:animate-none data-closed:animate-none`,className:`flex h-[calc(100vh-1rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl border border-border bg-card p-0 shadow-2xl duration-0 data-open:animate-none data-closed:animate-none sm:h-[calc(100vh-2rem)] sm:max-w-6xl`,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.stopPropagation(),children:[(0,A.jsx)(i,{className:`sr-only`,children:D(`scope.${E.type}.srTitle`)}),(0,A.jsx)(r,{className:`sr-only`,children:D(`scope.${E.type}.srDescription`)}),(0,A.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-border/70 px-4 py-4 sm:px-6`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-rose-200`,children:(0,A.jsx)(C,{className:`h-5 w-5`})}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-foreground sm:text-2xl`,children:D(`scope.${E.type}.title`)}),(0,A.jsx)(`p`,{className:`mt-0.5 hidden max-w-2xl text-sm text-muted-foreground sm:block`,children:D(`scope.${E.type}.description`)})]})]}),(0,A.jsx)(d,{asChild:!0,children:(0,A.jsx)(l,{type:`button`,"aria-label":D(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,children:(0,A.jsx)(f,{className:`h-4 w-4`})})})]}),(0,A.jsx)(`div`,{className:o(`shrink-0 border-b border-border/70 px-4 py-3 sm:px-6`,Ze&&`hidden lg:block`),children:(0,A.jsxs)(`form`,{"aria-label":D(`filters.ariaLabel`),className:`flex flex-col gap-3 sm:flex-row sm:flex-wrap`,children:[(0,A.jsxs)(`label`,{className:`flex min-w-0 flex-1 flex-col gap-1 text-xs text-muted-foreground sm:max-w-56`,children:[D(`filters.kind`),(0,A.jsxs)(`select`,{value:j,onChange:e=>M(e.target.value),className:`h-10 rounded-xl border border-border bg-card px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring/50`,children:[(0,A.jsx)(`option`,{value:`all`,children:D(`filters.allKinds`)}),at.filter(e=>we(e)).map(e=>(0,A.jsx)(`option`,{value:e,children:D(`kind.${e}`)},e))]})]}),(0,A.jsxs)(`label`,{className:`flex min-w-0 flex-1 flex-col gap-1 text-xs text-muted-foreground sm:max-w-56`,children:[D(`filters.status`),(0,A.jsxs)(`select`,{value:N,onChange:e=>re(e.target.value),className:`h-10 rounded-xl border border-border bg-card px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring/50`,children:[(0,A.jsx)(`option`,{value:`all`,children:D(`filters.allStatuses`)}),(0,A.jsx)(`option`,{value:`approval_required`,children:D(`status.approval_required`)}),[`running`,`waiting`,`queued`,`failed`,`interrupted`,`cancelled`,`completed`].map(e=>(0,A.jsx)(`option`,{value:e,children:D(`status.${e}`)},e))]})]})]})}),(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 overflow-hidden lg:grid-cols-[minmax(0,1fr)_minmax(20rem,0.72fr)]`,children:[(0,A.jsx)(`div`,{className:o(`min-h-0 min-w-0 overflow-y-auto`,Ze&&`hidden lg:block`),children:(0,A.jsx)(Ke,{focusRef:Oe,items:P,hierarchy:ie,scope:E,selectedRunId:R,isLoading:F,isLoadingMore:oe,isReconnecting:xe,hasMore:I,error:L,onLoadMore:Ge,onRefresh:ce,onSelectRun:qe})}),(0,A.jsx)(`div`,{className:o(`min-h-0 min-w-0 overflow-y-auto border-border/70 lg:border-l`,!Ze&&`hidden lg:block`),children:Q?(0,A.jsx)(dt,{run:Q,detail:Be,events:He,selectedEventId:Q.id===h?y:null,isLoading:W,detailError:le,isRetrying:_e===Q.id,isProjectActivity:E.type===`project`,isRelatedActivity:Qe,retryError:ye,projectId:e,retryEligibility:Be?.details.retry_eligibility??Ve?.retry_eligibility??{eligible:!1,reason:`status_not_retryable`},retrySourceAttempt:Ue,titleRef:De,onClose:Ye,onRetry:q,onNavigateToRelatedReference:S||E.type!==`project`?Je:void 0,onNavigateToLifecycleSource:p}):Ze?(0,A.jsx)(ft,{error:U??le,isRelatedActivity:Qe,titleRef:De,onBack:Ye,onRetry:U?()=>me(e=>e+1):Xe}):(0,A.jsx)(`aside`,{"aria-label":D(`details.ariaLabel`),className:`m-5 rounded-2xl border border-dashed border-border/70 bg-background/20 p-6 text-sm text-muted-foreground`,children:D(`details.selectPrompt`)})})]}),(0,A.jsx)(pt,{open:be!==null,isRerun:be?.kind===`check_batch`,onCancel:()=>q(null),onConfirm:()=>{if(!be)return;let e=be;q(null),We(e)}})]})})};export{se as i,Je as n,q as r,mt as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-BNv3lrIs.js";import{L as t,a as n,c as r,i,n as a,nt as o,p as s,r as c,t as l}from"./IconX-sSpA2ejo.js";var u=e(o(),1),d=t(),f=({src:e,alt:t,onError:n})=>(0,d.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center bg-black/35 p-2 sm:p-3`,children:(0,d.jsx)(`img`,{src:e,alt:t,onError:n,className:`h-auto max-h-full w-auto max-w-full rounded-xl object-contain`})}),p=({name:e,title:t,description:o,closeLabel:f,metadata:p,actions:m,children:h,onClose:g})=>{let _=(0,u.useRef)(null);return(0,d.jsx)(a,{open:!0,onOpenChange:e=>{e||g()},children:(0,d.jsxs)(i,{showCloseButton:!1,overlayClassName:`bg-black/80`,className:`flex h-[calc(100vh-1rem)] max-h-[calc(100vh-1rem)] w-[calc(100vw-1rem)] max-w-[calc(100vw-1rem)] sm:max-w-[calc(100vw-1rem)] flex-col gap-0 overflow-hidden border-border/80 bg-background/95 p-0 shadow-2xl`,onOpenAutoFocus:()=>{_.current=document.activeElement instanceof HTMLElement?document.activeElement:null},onCloseAutoFocus:e=>{_.current?.isConnected&&(e.preventDefault(),_.current.focus())},children:[(0,d.jsx)(r,{className:`sr-only`,children:t}),(0,d.jsx)(n,{className:`sr-only`,children:o}),(0,d.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border/70 px-4 py-2.5 sm:px-5`,children:[(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground sm:text-base`,children:e}),p&&(0,d.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:p})]}),(0,d.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[m,(0,d.jsx)(c,{asChild:!0,children:(0,d.jsx)(s,{type:`button`,"aria-label":f,variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,d.jsx)(l,{className:`h-4 w-4`})})})]})]}),h]})})};export{f as n,p as t};
|