@aoagents/ao-web 0.7.0 → 0.8.0
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/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +138 -138
- package/.next/app-path-routes-manifest.json +13 -13
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +9 -9
- package/.next/required-server-files.json +3 -3
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +6 -6
- package/.next/server/app/api/backlog/route.js +1 -1
- package/.next/server/app/api/backlog/route.js.nft.json +1 -1
- package/.next/server/app/api/backlog/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/browse-directory/route.js +1 -1
- package/.next/server/app/api/browse-directory/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/filesystem/browse/route.js +1 -1
- package/.next/server/app/api/filesystem/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/issues/route.js +1 -1
- package/.next/server/app/api/issues/route.js.nft.json +1 -1
- package/.next/server/app/api/issues/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/observability/route.js +1 -1
- package/.next/server/app/api/observability/route.js.nft.json +1 -1
- package/.next/server/app/api/observability/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/orchestrators/route.js +1 -1
- package/.next/server/app/api/orchestrators/route.js.nft.json +1 -1
- package/.next/server/app/api/orchestrators/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/projects/[id]/route.js +2 -2
- package/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/projects/reload/route.js +1 -1
- package/.next/server/app/api/projects/reload/route.js.nft.json +1 -1
- package/.next/server/app/api/projects/reload/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/projects/route.js +1 -1
- package/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/prs/[id]/merge/route.js +1 -1
- package/.next/server/app/api/prs/[id]/merge/route.js.nft.json +1 -1
- package/.next/server/app/api/prs/[id]/merge/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/runtime/terminal/route.js +1 -1
- package/.next/server/app/api/runtime/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/kill/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/kill/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/kill/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/message/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/message/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/message/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/remap/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/remap/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/remap/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/restore/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/send/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/patches/route.js +1 -1
- package/.next/server/app/api/sessions/patches/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/patches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/setup-labels/route.js +1 -1
- package/.next/server/app/api/setup-labels/route.js.nft.json +1 -1
- package/.next/server/app/api/setup-labels/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/spawn/route.js +1 -1
- package/.next/server/app/api/spawn/route.js.nft.json +1 -1
- package/.next/server/app/api/spawn/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/update/route.js +1 -1
- package/.next/server/app/api/update/route.js.nft.json +1 -1
- package/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verify/route.js +1 -1
- package/.next/server/app/api/verify/route.js.nft.json +1 -1
- package/.next/server/app/api/verify/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/api/version/route.js.nft.json +1 -1
- package/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/webhooks/[...slug]/route.js +1 -1
- package/.next/server/app/api/webhooks/[...slug]/route.js.nft.json +1 -1
- package/.next/server/app/api/webhooks/[...slug]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/apple-icon/route.js +1 -1
- package/.next/server/app/apple-icon/route.js.nft.json +1 -1
- package/.next/server/app/apple-icon/route_client-reference-manifest.js +1 -1
- package/.next/server/app/dev/terminal-test/page.js +3 -3
- package/.next/server/app/dev/terminal-test/page.js.nft.json +1 -1
- package/.next/server/app/dev/terminal-test/page_client-reference-manifest.js +1 -1
- package/.next/server/app/dev/terminal-test.html +1 -1
- package/.next/server/app/dev/terminal-test.rsc +7 -7
- package/.next/server/app/icon/route.js +1 -1
- package/.next/server/app/icon/route.js.nft.json +1 -1
- package/.next/server/app/icon/route_client-reference-manifest.js +1 -1
- package/.next/server/app/icon-192/route.js +1 -1
- package/.next/server/app/icon-192/route.js.nft.json +1 -1
- package/.next/server/app/icon-192/route_client-reference-manifest.js +1 -1
- package/.next/server/app/icon-512/route.js +1 -1
- package/.next/server/app/icon-512/route.js.nft.json +1 -1
- package/.next/server/app/icon-512/route_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route.js +2 -2
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/orchestrators/page.js +2 -2
- package/.next/server/app/orchestrators/page.js.nft.json +1 -1
- package/.next/server/app/orchestrators/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/projects/[projectId]/page.js +2 -2
- package/.next/server/app/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/server/app/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/projects/[projectId]/sessions/[id]/page.js +2 -2
- package/.next/server/app/projects/[projectId]/sessions/[id]/page.js.nft.json +1 -1
- package/.next/server/app/projects/[projectId]/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/projects/[projectId]/settings/page.js +2 -2
- package/.next/server/app/projects/[projectId]/settings/page.js.nft.json +1 -1
- package/.next/server/app/projects/[projectId]/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/prs/page.js +2 -2
- package/.next/server/app/prs/page.js.nft.json +1 -1
- package/.next/server/app/prs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/[id]/page.js +2 -2
- package/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
- package/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/test-direct/page.js +2 -2
- package/.next/server/app/test-direct/page.js.nft.json +1 -1
- package/.next/server/app/test-direct/page_client-reference-manifest.js +1 -1
- package/.next/server/app/test-direct.html +1 -1
- package/.next/server/app/test-direct.rsc +7 -7
- package/.next/server/app-paths-manifest.json +13 -13
- package/.next/server/chunks/1876.js +2 -2
- package/.next/server/chunks/4520.js +1 -1
- package/.next/server/chunks/6013.js +8 -8
- package/.next/server/chunks/6848.js +1 -1
- package/.next/server/chunks/7173.js +1 -1
- package/.next/server/chunks/7227.js +3 -3
- package/.next/server/chunks/9291.js +3 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/app/dev/terminal-test/page-a6f86436c4a06eeb.js +1 -0
- package/.next/static/chunks/app/{error-65c526052680c0dc.js → error-d4f7c3a8dd722e8f.js} +1 -1
- package/.next/static/chunks/app/{global-error-63dcb797b2c3ee60.js → global-error-cb3a4148c223622a.js} +1 -1
- package/.next/static/chunks/app/layout-e4c02836878bea2d.js +1 -0
- package/.next/static/chunks/app/{not-found-a693bed1f9e1893f.js → not-found-982c28ba7f6492be.js} +1 -1
- package/.next/static/chunks/app/orchestrators/{page-376a92db51deb112.js → page-11a10c8b0bea320d.js} +1 -1
- package/.next/static/chunks/app/page-31df8f5f0d079eba.js +1 -0
- package/.next/static/chunks/app/projects/[projectId]/page-f076731a5810b255.js +1 -0
- package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-7e46ee5c902c28aa.js +1 -0
- package/.next/static/chunks/app/projects/[projectId]/settings/{page-11facc471a63de50.js → page-40047db90c406c9e.js} +1 -1
- package/.next/static/chunks/app/prs/page-5015d39fb7984d26.js +1 -0
- package/.next/static/chunks/app/sessions/[id]/{error-df65e7b626bbb713.js → error-147fb962bda03d23.js} +1 -1
- package/.next/static/chunks/app/sessions/[id]/{not-found-a693bed1f9e1893f.js → not-found-982c28ba7f6492be.js} +1 -1
- package/.next/static/chunks/app/sessions/[id]/page-0a74680de719ca58.js +1 -0
- package/.next/static/chunks/app/test-direct/page-cbca94d9a5985aea.js +1 -0
- package/.next/static/chunks/{main-app-decbc53736801215.js → main-app-113c48dd1c080c52.js} +1 -1
- package/package.json +13 -13
- package/.next/server/chunks/303.js +0 -3
- package/.next/static/chunks/app/dev/terminal-test/page-9aa423dfd54c8325.js +0 -1
- package/.next/static/chunks/app/layout-36ab0168ddb22083.js +0 -1
- package/.next/static/chunks/app/page-587d546e62c0796f.js +0 -1
- package/.next/static/chunks/app/projects/[projectId]/page-bd8fc2a1decb649d.js +0 -1
- package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-bd33f6ffda513080.js +0 -1
- package/.next/static/chunks/app/prs/page-f34f66ad51106080.js +0 -1
- package/.next/static/chunks/app/sessions/[id]/page-3ea4aa79275ea449.js +0 -1
- package/.next/static/chunks/app/test-direct/page-edfc701a9300105b.js +0 -1
- /package/.next/static/{9nr0fNWbZcuWTqhM2HhrH → 9ARsRA8WlFgsAl-7NPrHh}/_buildManifest.js +0 -0
- /package/.next/static/{9nr0fNWbZcuWTqhM2HhrH → 9ARsRA8WlFgsAl-7NPrHh}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6848,exports.ids=[6848],exports.modules={4022:(a,b,c)=>{c.d(b,{Dashboard:()=>Q});var d=c(33666),e=c(81115),f=c(47489),g=c.n(f),h=c(50436),i=c(52754),j=c(37155),k=c(85489),l=c(61875),m=c(82732),n=c(37501),o=c(88950);let p=new Set,q=(0,e.memo)(function({session:a,onSend:b,onKill:c,onMerge:f,onRestore:g}){var h,i;let[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(""),E=(0,e.useRef)(null),F=(0,e.useRef)(null),[G]=(0,e.useState)(()=>p.has(a.id)),H=(0,j.ng)(a),I=a.pr,J=async c=>{let d=c.trim();if(!d||null!==w)return!1;x(d),z(null);try{return await Promise.resolve(b?.(a.id,d)),z(d),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>z(null),2e3),!0}catch{return!1}finally{x(null)}},K=async a=>{"Enter"===a.key&&!a.shiftKey&&(a.preventDefault(),await J(C)&&D(""))},L=async(c,d)=>{if(null===s){t(c),v(null);try{await Promise.resolve(b?.(a.id,d)),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>t(null),2e3)}catch{t(null),v(c),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>v(null),2e3)}}},M=!!I&&(0,j.fZ)(I),N=!!I&&(0,j.sZ)(I),O=function(a){let b=a.pr;if(!b||"open"!==b.state||(0,j.fZ)(b)||(0,j.sZ)(b))return[];let c=a.metadata,e=[],f=a.lifecycle?.prReason??null,g=c.status,h=b.ciStatus===j.U1.FAILING||"ci_failing"===f||"ci_failed"===g,i="changes_requested"===b.reviewDecision||"changes_requested"===f||"changes_requested"===g,k=!b.mergeability.noConflicts;if(h){let a=b.ciChecks.find(a=>"failed"===a.status),d=b.ciChecks.filter(a=>"failed"===a.status).length;0===d&&b.ciStatus!==j.U1.FAILING?e.push({key:"ci-fail",type:"ci",icon:"✗",label:"CI failing",url:b.url+"/checks",notified:!!c.lastCIFailureDispatchHash,actionLabel:"Ask to fix",actionMessage:`Please fix the failing CI checks on ${b.url}`}):0===d?e.push({key:"ci-unknown",type:"ci",icon:"?",label:"CI unknown",url:b.url+"/checks"}):e.push({key:"ci-fail",type:"ci",icon:"✗",count:d,label:`check${d>1?"s":""} failing`,url:a?.url??b.url+"/checks",notified:!!c.lastCIFailureDispatchHash,actionLabel:"Ask to fix",actionMessage:`Please fix the failing CI checks on ${b.url}`})}if(i?e.push({key:"changes",type:"changes",icon:"↻",label:"changes requested",url:b.url,notified:!!c.lastPendingReviewDispatchHash,actionLabel:"Ask to address",actionMessage:`Please address the requested changes on ${b.url}`}):b.isDraft||"pending"!==b.reviewDecision&&"none"!==b.reviewDecision||e.push({key:"review",type:"review",icon:(0,d.jsxs)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),(0,d.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,d.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75"})]}),label:"needs review",url:b.url,actionLabel:"Ask to post",actionMessage:`Post ${b.url} on slack asking for a review.`}),k&&e.push({key:"conflict",type:"conflict",icon:"⚠",label:"merge conflict",url:b.url,notified:"true"===c.lastMergeConflictDispatched,actionLabel:"Ask to fix",actionMessage:`Please resolve the merge conflicts on ${b.url} by rebasing on the base branch`}),b.unresolvedThreads>0){let a=b.unresolvedComments[0]?.url??b.url+"/files";e.push({key:"comments",type:"comment",icon:"\uD83D\uDCAC",label:"unresolved comments",count:b.unresolvedThreads,url:a,actionLabel:"Ask to resolve",actionMessage:`Please address all unresolved review comments on ${b.url}`})}return e}(a),P=!M&&I?.mergeability.mergeable&&"open"===I.state,Q=(0,j.nH)(a),R=(0,j.wy)(a),S=(0,l.Pn)(a),T=(h=a,i=H,P||"merge"===i?"mergeable":h.lifecycle?.sessionState==="detecting"?"detecting":"respond"===i?(0,j.Ou)(h):h.lifecycle?.prReason==="ci_failing"||"ci_failed"===h.status?"ci failing":"review"===i?(0,j.of)(h):(0,j.Ou)(h)),U=M||!I||N?[]:I.ciChecks.filter(a=>"passed"===a.status).slice(0,3),V=(0,j.dG)(a)||"done"===H,W=a.lifecycle?`Session ${(0,j.Ou)(a)} \xb7 PR ${(0,j.of)(a)} \xb7 Runtime ${(0,j.Kw)(a)}`:null,X=a.issueLabel?`${a.issueLabel}${a.issueTitle?` \xb7 ${a.issueTitle}`:""}`:a.issueTitle??(a.summary&&a.summary!==S?a.summary:null),Y=P?"session-card--merge-frame":O.length>0?"session-card--alert-frame":"session-card--fixed",Z=P?"session-card--accent-merge":"working"===H?"session-card--accent-working":"respond"===H?"session-card--accent-respond":"review"===H||"pending"===H?"session-card--accent-attention":"session-card--accent-default";if(V){let b=function(a){let b=a.activity,c=a.status,e=a.lifecycle?.prState??a.pr?.state;return"merged"===e||"merged"===c?{label:"merged",pillClass:"done-status-pill--merged",icon:(0,d.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})})}:"closed"===e?{label:"closed",pillClass:"done-status-pill--exited",icon:(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,d.jsx)("path",{d:"M9 12h6"})]})}:a.lifecycle?.sessionState==="terminated"||"killed"===c||"terminated"===c?{label:(0,j.Ou)(a),pillClass:"done-status-pill--killed",icon:(0,d.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,d.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}:{label:"exited"===b?"exited":(0,j.Ou)(a),pillClass:"done-status-pill--exited",icon:(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,d.jsx)("path",{d:"M9 12h6"})]})}}(a);return(0,d.jsxs)("div",{className:(0,k.cn)("session-card-done",q&&"done-expanded"),onClick:a=>{a.target.closest("a, button, textarea")||r(!q)},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,d.jsxs)("span",{className:(0,k.cn)("done-status-pill",b.pillClass),children:[b.icon,b.label]}),(0,d.jsx)("span",{className:"font-[var(--font-mono)] text-[10px] tracking-wide text-[var(--color-text-muted)]",children:a.id}),(0,d.jsx)("div",{className:"flex-1"}),R&&(0,d.jsxs)("button",{onClick:b=>{b.stopPropagation(),g?.(a.id)},className:"done-restore-btn",children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,d.jsx)("polyline",{points:"1 4 1 10 7 10"}),(0,d.jsx)("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),"restore"]})]}),(0,d.jsx)("div",{className:"px-3.5 pb-2",children:(0,d.jsx)("p",{className:"session-card-done__title text-[13px] font-semibold leading-snug [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2] overflow-hidden",children:S})}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 px-3.5 pb-3",children:[a.branch&&(0,d.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-2.5 w-2.5 opacity-50",children:[(0,d.jsx)("path",{d:"M6 3v12M18 9a3 3 0 0 1-3 3H9a3 3 0 0 0-3 3"}),(0,d.jsx)("circle",{cx:"18",cy:"6",r:"3"})]}),a.branch]}),I&&(0,d.jsxs)("a",{href:I.url,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-bold text-[var(--color-text-primary)] no-underline underline-offset-2 hover:underline",children:["#",I.number]}),I&&!M&&(N?(0,d.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,d.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,d.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",I.additions]})," ",(0,d.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",I.deletions]})," ",(0,n.i_)(I.additions,I.deletions),(0,d.jsx)("span",{className:"sr-only",children:`+${I.additions} -${I.deletions} ${(0,n.i_)(I.additions,I.deletions)}`})]})),(0,d.jsx)("a",{href:(0,o.Nc)(a.projectId,a.id),onClick:a=>a.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-semibold text-[var(--color-accent)] no-underline hover:underline",children:"View current context"})]}),q&&(0,d.jsxs)("div",{className:"done-expand-section px-3.5 py-3",children:[a.summary&&I?.title&&a.summary!==I.title&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsxs)("div",{className:"done-detail-heading",children:[(0,d.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M4 6h16M4 12h16M4 18h10"})}),"Summary"]}),(0,d.jsx)("p",{className:"text-[12px] leading-relaxed text-[var(--color-text-secondary)]",children:a.summary})]}),a.issueUrl&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsxs)("div",{className:"done-detail-heading",children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"Issue"]}),(0,d.jsxs)("a",{href:a.issueUrl,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"text-[12px] text-[var(--color-accent)] hover:underline",children:[a.issueLabel||a.issueUrl,a.issueTitle&&`: ${a.issueTitle}`]})]}),I&&I.ciChecks.length>0&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsxs)("div",{className:"done-detail-heading",children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("path",{d:"M9 12l2 2 4-4"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"})]}),"CI Checks"]}),(0,d.jsx)(m.zm,{checks:I.ciChecks})]}),I&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsxs)("div",{className:"done-detail-heading",children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65S8.93 17.38 9 18v4"}),(0,d.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]}),"PR"]}),(0,d.jsxs)("p",{className:"text-[12px] text-[var(--color-text-secondary)]",children:[(0,d.jsx)("a",{href:I.url,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"hover:underline",children:I.title}),N?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("br",{}),(0,d.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2 text-[10px] text-[var(--color-text-muted)]",children:[(0,d.jsx)("span",{className:"inline-block h-3 w-12 animate-pulse rounded bg-[var(--color-bg-subtle)]"}),(0,d.jsx)("span",{children:"PR details loading..."})]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("br",{}),(0,d.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2",children:[(0,d.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,d.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",I.additions]})," ",(0,d.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",I.deletions]})]}),(0,d.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,d.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["mergeable: ",I.mergeability.mergeable?"yes":"no"]}),(0,d.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,d.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["review: ",I.reviewDecision]})]})]})]})]}),!I&&(0,d.jsx)("p",{className:"text-[12px] text-[var(--color-text-tertiary)]",children:"No PR associated with this session."})]})]})}let $=Q?"exited":P||"merge"===H||"review"===H?"ready":"respond"===H?"waiting":"pending"===H?"idle":"working"===H?"working":"idle";return(0,d.jsxs)("div",{className:(0,k.cn)("session-card border",!G&&"kanban-card-enter",Y,Z,P&&"card-merge-ready"),children:[(0,d.jsxs)("div",{className:"session-card__header",children:[(0,d.jsx)("span",{className:(0,k.cn)("card__adot","working"===$&&"card__adot--working","ready"===$&&"card__adot--ready","idle"===$&&"card__adot--idle","waiting"===$&&"card__adot--waiting","exited"===$&&"card__adot--exited")}),(0,d.jsx)("span",{className:"card__id",children:a.id}),(0,d.jsx)("div",{className:"flex-1"}),R&&(0,d.jsxs)("button",{onClick:b=>{b.stopPropagation(),g?.(a.id)},className:"session-card__control session-card__restore-control",children:[(0,d.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("path",{d:"M20 11a8 8 0 0 0-14.9-3.98"}),(0,d.jsx)("path",{d:"M4 5v4h4"}),(0,d.jsx)("path",{d:"M4 13a8 8 0 0 0 14.9 3.98"}),(0,d.jsx)("path",{d:"M20 19v-4h-4"})]}),"restore"]}),!Q&&(0,d.jsxs)("a",{href:(0,o.$l)(a.projectId,a.id,"#session-terminal-section"),onClick:a=>a.stopPropagation(),className:"session-card__control session-card__terminal-link",children:[(0,d.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),(0,d.jsx)("path",{d:"M6 10l4 2-4 2"}),(0,d.jsx)("path",{d:"M14 14h4"})]}),"terminal"]})]}),(0,d.jsxs)("div",{className:"session-card__body flex min-h-0 flex-1 flex-col",children:[(0,d.jsx)("div",{className:"card__title-wrap",children:(0,d.jsx)("p",{className:"card__title",children:S})}),(0,d.jsxs)("div",{className:"card__meta",children:[a.branch&&(0,d.jsx)("span",{className:"card__branch",children:a.branch}),a.branch&&I?(0,d.jsx)("span",{className:"card__meta-sep","aria-hidden":"true",children:"\xb7"}):null,I&&(0,d.jsxs)("a",{href:I.url,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"card__pr",children:["#",I.number]}),I&&!M&&(N?(0,d.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,d.jsxs)("span",{className:"card__diff inline-flex items-center",children:[(0,d.jsxs)("span",{className:"card__diff-add",children:["+",I.additions]})," ",(0,d.jsxs)("span",{className:"card__diff-del",children:["-",I.deletions]})," ",(0,d.jsx)("span",{className:"card__diff-size",children:(0,n.i_)(I.additions,I.deletions)}),(0,d.jsx)("span",{className:"sr-only",children:`+${I.additions} -${I.deletions} ${(0,n.i_)(I.additions,I.deletions)}`})]}))]}),X&&(0,d.jsx)("div",{className:"px-[10px] pb-[5px]",children:"merge"===H||P?(0,d.jsxs)("p",{className:"session-card__secondary session-card__secondary--merge",children:[(0,d.jsx)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})}),(0,d.jsx)("span",{children:X})]}):(0,d.jsx)("p",{className:"session-card__secondary",children:X})}),W&&(0,d.jsx)("div",{className:"px-[10px] pb-[5px]",children:(0,d.jsx)("p",{className:"text-[10px] leading-relaxed text-[var(--color-text-tertiary)]",children:W})}),M&&I?.state==="open"&&(0,d.jsx)("div",{className:"px-[10px] pb-[5px]",children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--color-text-muted)]",children:[(0,d.jsxs)("svg",{className:"h-3 w-3 text-[var(--color-text-tertiary)]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"PR data rate limited"]})}),U.length>0&&(0,d.jsx)("div",{className:"card__ci",children:U.map(a=>{let b=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("svg",{width:"8",height:"8",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})}),a.name]});return a.url?(0,d.jsx)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"ci-chip ci-chip--pass",onClick:a=>a.stopPropagation(),children:b},a.name):(0,d.jsx)("span",{className:"ci-chip ci-chip--pass",children:b},a.name)})}),!M&&O.length>0&&(0,d.jsx)("div",{className:"card__alerts flex flex-col",children:O.slice(0,3).map(a=>(0,d.jsxs)("div",{className:(0,k.cn)("alert-row",`alert-row--${a.type}`),children:[(0,d.jsx)("span",{className:"alert-row__icon",children:a.icon}),(0,d.jsxs)("span",{className:"alert-row__text",children:[(0,d.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),children:[void 0!==a.count&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"font-bold",children:a.count})," "]}),a.label]}),a.notified&&(0,d.jsxs)("span",{className:"alert-row__notified",title:"Agent has been notified",children:[" ","\xb7 notified"]})]}),a.actionLabel&&(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),L(a.key,a.actionMessage??"")},disabled:s===a.key,className:"alert-row__action",children:s===a.key?"sent!":u===a.key?"failed":a.actionLabel})]},a.key))}),"respond"===H&&(0,d.jsxs)("div",{className:"quick-reply",onClick:a=>a.stopPropagation(),children:[a.summary&&!a.summaryIsFallback&&(0,d.jsxs)("div",{className:"card__agent-msg",children:[(0,d.jsx)("svg",{className:"card__agent-msg-icon",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),(0,d.jsx)("span",{children:a.summary})]}),(0,d.jsx)("a",{href:(0,o.Nc)(a.projectId,a.id),onClick:a=>a.stopPropagation(),className:"card__view-context",children:"View current context →"}),!Q&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"card__presets",children:[(0,d.jsx)("button",{className:"card__preset",onClick:()=>void J("continue"),disabled:null!==w,children:"continue"===w?"Sending...":"continue"===y?"Sent":"Continue"}),(0,d.jsx)("button",{className:"card__preset",onClick:()=>void J("abort"),disabled:null!==w,children:"abort"===w?"Sending...":"abort"===y?"Sent":"Abort"}),(0,d.jsx)("button",{className:"card__preset",onClick:()=>void J("skip"),disabled:null!==w,children:"skip"===w?"Sending...":"skip"===y?"Sent":"Skip"})]}),(0,d.jsx)("div",{className:"card__reply-wrap",children:(0,d.jsx)("textarea",{className:"card__reply",placeholder:null!==w?"Sending...":"Type a reply... (Enter to send)","aria-label":"Type a reply to the agent",value:C,onChange:a=>D(a.target.value),onKeyDown:a=>{K(a)},rows:1,disabled:null!==w})})]})]}),(0,d.jsxs)("div",{className:"session-card__footer",children:[(0,d.jsx)("span",{className:"card__status min-w-0 truncate",title:a.userPrompt??void 0,children:!a.issueUrl&&a.userPrompt?a.userPrompt.length>60?a.userPrompt.slice(0,60)+"…":a.userPrompt:T}),P&&I?(0,d.jsxs)("button",{onClick:a=>{a.stopPropagation(),f?.(I.number)},className:"session-card__control session-card__merge-control",children:[(0,d.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{cx:"6",cy:"6",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"18",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"6",r:"2"}),(0,d.jsx)("path",{d:"M8 6h5a3 3 0 0 1 3 3v7"})]}),"Merge PR #",I.number]}):!Q&&(0,d.jsx)("button",{onClick:b=>{if(b.stopPropagation(),!A)return void B(!0);B(!1),c?.(a.id)},onMouseLeave:()=>B(!1),onBlur:()=>B(!1),"aria-label":A?"Confirm terminate session":"Terminate session",className:(0,k.cn)("session-card__control session-card__terminate btn--danger",A&&"is-confirming"),children:A?(0,d.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:"kill?"}):(0,d.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("path",{d:"M3 6h18"}),(0,d.jsx)("path",{d:"M8 6V4h8v2"}),(0,d.jsx)("path",{d:"M19 6l-1 14H6L5 6"})]})})]})]})]})},function(a,b){return a.session===b.session&&a.onSend===b.onSend&&a.onKill===b.onKill&&a.onMerge===b.onMerge&&a.onRestore===b.onRestore}),r={merge:{label:"Ready",emptyMessage:"Nothing cleared to land yet."},action:{label:"Action",emptyMessage:"No agents need your input."},respond:{label:"Respond",emptyMessage:"No agents need your input."},review:{label:"Review",emptyMessage:"No code waiting for review."},pending:{label:"Pending",emptyMessage:"Nothing blocked."},working:{label:"Working",emptyMessage:"No agents running."},done:{label:"Done",emptyMessage:"No completed sessions."}},s=(0,e.memo)(function({level:a,sessions:b,onSend:c,onKill:f,onMerge:g,onRestore:h,collapsed:i,onToggle:j,compactMobile:k,onPreview:l,resetKey:m}){let n=r[a],o=void 0!==j,[p,s]=(0,e.useState)(!1),u=o&&k&&!p?b.slice(0,5):b,v=b.length-u.length;return o?(0,d.jsxs)("div",{className:`accordion-section${i?" accordion-section--collapsed":" accordion-section--expanded"}`,"data-level":a,children:[(0,d.jsxs)("button",{type:"button",className:"accordion-header",onClick:()=>j(a),"aria-expanded":!i,"aria-controls":`accordion-body-${a}`,children:[(0,d.jsx)("span",{className:"accordion-header__dot","data-level":a}),(0,d.jsx)("span",{className:"accordion-header__label",children:n.label}),(0,d.jsx)("span",{className:"accordion-header__count",children:b.length}),(0,d.jsx)("span",{className:"accordion-header__chevron","aria-hidden":"true",children:"▶"})]}),(0,d.jsx)("div",{id:`accordion-body-${a}`,className:"accordion-body",children:b.length>0?(0,d.jsxs)("div",{className:k?"mobile-session-list":"flex flex-col gap-2 p-3",children:[u.map(b=>k?(0,d.jsx)(t,{session:b,level:a,onPreview:l},b.id):(0,d.jsx)(q,{session:b,onSend:c,onKill:f,onMerge:g,onRestore:h},b.id)),k&&v>0?(0,d.jsxs)("button",{type:"button",className:"mobile-session-list__view-all",onClick:()=>s(!0),children:["View all ",b.length]}):null]}):k?(0,d.jsx)("div",{className:"mobile-session-list",children:(0,d.jsx)("div",{className:"mobile-session-list__empty",children:n.emptyMessage})}):null})]}):(0,d.jsxs)("div",{className:"kanban-column","data-level":a,children:[(0,d.jsx)("div",{className:"kanban-column__header",children:(0,d.jsxs)("div",{className:"kanban-column__title-row",children:[(0,d.jsx)("div",{className:"kanban-column__dot","data-level":a}),(0,d.jsx)("span",{className:"kanban-column__title",children:n.label}),(0,d.jsx)("span",{className:"kanban-column__count",children:b.length})]})}),(0,d.jsx)("div",{className:"kanban-column-body",children:b.length>0?(0,d.jsx)("div",{className:"kanban-column__stack",children:b.map(a=>(0,d.jsx)(q,{session:a,onSend:c,onKill:f,onMerge:g,onRestore:h},a.id))}):null})]})},function(a,b){return a.level===b.level&&a.collapsed===b.collapsed&&a.onToggle===b.onToggle&&a.onSend===b.onSend&&a.onKill===b.onKill&&a.onMerge===b.onMerge&&a.onRestore===b.onRestore&&a.compactMobile===b.compactMobile&&a.onPreview===b.onPreview&&a.resetKey===b.resetKey&&a.sessions.length===b.sessions.length&&a.sessions.every((a,c)=>a===b.sessions[c])});function t({session:a,level:b,onPreview:c}){let e=[a.branch,a.pr?`PR #${a.pr.number}`:null,a.issueLabel].filter(Boolean);return(0,d.jsxs)("div",{className:"mobile-session-row",children:[(0,d.jsxs)("button",{type:"button",className:"mobile-session-row__preview",onClick:()=>c?.(a),"aria-label":`Open ${(0,l.Pn)(a)}`,children:[(0,d.jsxs)("div",{className:"mobile-session-row__line",children:[(0,d.jsx)("span",{className:"mobile-session-row__dot","data-level":b,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"mobile-session-row__title",children:(0,l.Pn)(a)})]}),(0,d.jsx)("div",{className:"mobile-session-row__meta",children:e.length>0?e.join(" \xb7 "):"No branch or PR metadata"})]}),(0,d.jsxs)("div",{className:"mobile-session-row__side",children:[(0,d.jsx)(u,{session:a,level:b}),(0,d.jsx)("a",{href:(0,o.Nc)(a.projectId,a.id),className:"mobile-session-row__open","aria-label":`Go to ${(0,l.Pn)(a)}`,children:(0,d.jsxs)("svg",{className:"mobile-session-row__open-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M4 17V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2Z"}),(0,d.jsx)("path",{d:"m8 10 2 2-2 2M12 14h4"})]})})]})]})}function u({session:a,level:b}){let c=r[b].label.toLowerCase();if("merge"===b&&a.pr&&(0,j.QN)(a.pr))c="ready";else if("action"===b)c="needs_input"===a.status?"needs input":"stuck"===a.status?"stuck":"errored"===a.status?"errored":"waiting_input"===a.activity?"waiting":"exited"===a.activity?"crashed":"blocked"===a.activity?"blocked":"ci_failed"===a.status?"ci failed":"changes_requested"===a.status?"changes":a.pr?.ciStatus==="failing"?"ci failed":a.pr?.reviewDecision==="changes_requested"?"changes":a.pr&&!a.pr.mergeability.noConflicts?"conflicts":"action";else"respond"===b?c="waiting_input"===a.activity?"waiting":"needs input":"review"===b?c=a.pr?.reviewDecision==="changes_requested"?"changes":"review":"pending"===b?c=a.pr?.unresolvedThreads?"threads":"pending":"working"===b&&(c="idle"===a.activity?"idle":"active");return(0,d.jsx)("span",{className:"mobile-session-row__chip",children:c})}var v=c(18768),w=c(20057),x=c(58976),y=c(31849);let z=["Working","Pending","Review","Respond","Merge"];function A({message:a,orchestratorHref:b,onSpawnOrchestrator:c=null,spawnLabel:e="Spawn Orchestrator",spawnDisabled:f=!1}){return(0,d.jsxs)("div",{className:"board-wrapper",children:[(0,d.jsx)("div",{className:"kanban-ghost","aria-hidden":"true",children:z.map(a=>(0,d.jsx)("div",{className:"kanban-ghost__col",children:(0,d.jsx)("div",{className:"kanban-ghost__head",children:a})},a))}),(0,d.jsx)("div",{className:"board-center",children:(0,d.jsxs)("div",{className:"empty-state",role:"status",children:[(0,d.jsx)("div",{className:"empty-state__icon",children:(0,d.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"5.5",r:"2.5",fill:"rgba(249,115,22,0.18)",stroke:"#f97316",strokeWidth:"1.5"}),(0,d.jsx)("circle",{cx:"5.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,d.jsx)("circle",{cx:"18.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,d.jsx)("line",{x1:"12",y1:"8",x2:"6.7",y2:"14.8",stroke:"rgba(249,115,22,0.22)",strokeWidth:"1",strokeDasharray:"2.5 2"}),(0,d.jsx)("line",{x1:"12",y1:"8",x2:"17.3",y2:"14.8",stroke:"rgba(249,115,22,0.22)",strokeWidth:"1",strokeDasharray:"2.5 2"}),(0,d.jsx)("line",{x1:"7.8",y1:"17",x2:"16.2",y2:"17",stroke:"var(--color-border-subtle)",strokeWidth:"1",strokeDasharray:"2.5 2"})]})}),a?(0,d.jsx)("p",{className:"empty-state__text",children:a}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"empty-state__headline",children:"Ready to orchestrate"}),(0,d.jsx)("p",{className:"empty-state__hint",children:"Open the main orchestrator to start a session and fan out parallel agents across your codebase."}),b?(0,d.jsxs)("a",{href:b,className:"empty-state__cta",children:[(0,d.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,d.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,d.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Open Orchestrator"]}):c?(0,d.jsxs)("button",{type:"button",className:"empty-state__cta",onClick:c,disabled:f,children:[(0,d.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,d.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,d.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),e]}):null]})]})})]})}var B=c(71276);function C({status:a}){return"connected"===a?null:"disconnected"===a?(0,d.jsx)("button",{type:"button",className:"connection-bar connection-bar--disconnected","aria-live":"assertive","aria-atomic":"true",onClick:()=>window.location.reload(),children:"Offline \xb7 tap to retry"}):(0,d.jsx)("div",{className:"connection-bar connection-bar--reconnecting",role:"status","aria-live":"polite","aria-atomic":"true",children:"Reconnecting…"})}function D(){let[a,b]=(0,e.useState)(null),[c,f]=(0,e.useState)("idle"),[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(null),k=(0,e.useCallback)(()=>{if(a?.latest){try{window.localStorage.setItem("ao.updateBanner.dismissedFor",a.latest)}catch{}j(a.latest),f("idle"),h(null)}},[a]),l=(0,e.useCallback)(async()=>{f("starting"),h(null);try{let a=await fetch("/api/update",{method:"POST"}),b=await a.json();if(a.ok)return void f("started");if(409===a.status){f("blocked"),h(b.message);return}f("error"),h(b.message??"Update failed")}catch(a){f("error"),h(a instanceof Error?a.message:String(a))}},[]);if(!a||!a.isOutdated||!a.latest||"manual"===a.channel||i===a.latest&&"idle"===c||"started"===c)return null;let m="nightly"===a.channel?" (nightly)":"";return(0,d.jsxs)("div",{role:"status","aria-live":"polite",className:"flex w-full items-center justify-between gap-3 border-b border-[var(--color-border-default)] bg-[var(--color-accent-amber-dim)] px-4 py-2 text-sm text-[var(--color-text-primary)]",children:[(0,d.jsxs)("div",{className:"flex flex-1 items-center gap-3",children:[(0,d.jsx)("span",{"aria-hidden":"true",className:"inline-block h-2 w-2 flex-shrink-0 rounded-full bg-[var(--color-accent-amber)]"}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 sm:flex-row sm:items-baseline sm:gap-2",children:[(0,d.jsxs)("span",{className:"font-medium",children:["Update available",m,": ",a.current," → ",a.latest]}),"blocked"===c&&g||"error"===c&&g?(0,d.jsx)("span",{className:"text-xs text-[var(--color-status-error)]",children:g}):"starting"===c?(0,d.jsx)("span",{className:"text-xs text-[var(--color-text-secondary)]",children:"Starting…"}):(0,d.jsx)("span",{className:"text-xs text-[var(--color-text-secondary)]",children:"Click Update to install. The dashboard will restart."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>void l(),disabled:"starting"===c,className:"rounded-sm border border-[var(--color-accent-amber-border)] bg-[var(--color-accent-amber)] px-3 py-1 text-xs font-medium text-[var(--color-text-inverse)] hover:bg-[color-mix(in_srgb,var(--color-accent-amber)_85%,black)] disabled:cursor-wait disabled:opacity-60",children:"starting"===c?"Updating…":"Update"}),(0,d.jsx)("button",{type:"button",onClick:k,"aria-label":"Dismiss",className:"rounded-sm px-2 py-1 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)]",children:"Dismiss"})]})]})}let E=[/\bBearer\s+[A-Za-z0-9._\-+/=]+\b/gi,/\bsk-[A-Za-z0-9]{10,}\b/g,/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g];function F({projectId:a}){let{showToast:b}=(0,B.d)(),[c,f]=(0,e.useState)(!1),g=(0,e.useCallback)(async()=>{if(!c){f(!0);try{let c,d=await fetch("/api/observability",{credentials:"same-origin"});if(!d.ok)return void b("Could not fetch observability snapshot","error");let e=d.headers.get("x-correlation-id");try{c=await d.json()}catch{b("Could not parse observability snapshot","error");return}let f=function a(b,c=new WeakSet){if("string"==typeof b)return E.reduce((a,b)=>a.replace(b,"[REDACTED]"),b);if(Array.isArray(b))return b.map(b=>a(b,c));if(b&&"object"==typeof b){if(c.has(b))return"[Circular]";c.add(b);let d={};for(let[e,f]of Object.entries(b))d[e]=a(f,c);return d}return b}(function(a,b){if(!b||!a||"object"!=typeof a)return a;let c={...a},d=c.projects;if(d&&"object"==typeof d&&!Array.isArray(d)){let a=d[b];c.projects=void 0===a?{}:{[b]:a}}return c}(c,a)),g={copiedAt:new Date().toISOString(),pageHref:`${window.location.origin}${window.location.pathname}`,projectId:a??null,correlationId:e,userAgent:navigator.userAgent,observability:f};await navigator.clipboard.writeText(JSON.stringify(g,null,2)),b("Debug bundle copied to clipboard","success")}catch{b("Could not copy debug bundle","error")}finally{f(!1)}}},[c,a,b]);return(0,d.jsxs)("button",{type:"button",className:"orchestrator-btn flex min-h-[44px] min-w-[44px] items-center gap-2 px-4 py-2 text-[12px] font-semibold text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-bg-hover)] disabled:opacity-50",onClick:()=>void g(),disabled:c,"aria-label":"Copy debug bundle for issue reports",children:[(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[(0,d.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,d.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy debug info"]})}var G=c(70162);function H(a){let b=Date.now(),c=Math.floor((b-new Date(a).getTime())/1e3);if(c<60)return`${c}s ago`;let d=Math.floor(c/60);if(d<60)return`${d}m ago`;let e=Math.floor(d/60);if(e<24)return`${e}h ago`;let f=Math.floor(e/24);return`${f}d ago`}function I(a){return a.replaceAll("_"," ")}function J(a){return null!==a}function K({session:a,mode:b,onCancel:c,onConfirm:f,onRequestKill:g,onMerge:h,isMergeReady:i=!1}){let k=(0,e.useRef)(null),m=(0,e.useRef)(null);(0,e.useRef)(null);let n=a?.pr?.number??null;if(!a)return null;let p=(0,l.Pn)(a),q=(0,j.ng)(a),r=a.summary&&!a.summaryIsFallback?a.summary:null,s="done"!==q&&"merge"!==q&&"terminated"!==a.status,t=a.pr,u=!!(t&&!(0,j.fZ)(t)&&!(0,j.sZ)(t)),v="done"===q||"terminated"===a.status||"exited"===a.activity,w=[{label:I(q),tone:"accent"},{label:I(a.status),tone:"neutral"},a.activity?{label:I(a.activity),tone:"neutral"}:null,a.branch?{label:a.branch,tone:"mono"}:null,a.pr?{label:`PR #${a.pr.number}`,tone:"neutral"}:null,a.issueLabel?{label:a.issueLabel,tone:"neutral"}:null].filter(J);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"bottom-sheet-backdrop",onClick:c,"aria-hidden":"true"}),(0,d.jsxs)("div",{ref:m,className:"bottom-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"bottom-sheet-title",onTouchStart:function(a){k.current=a.touches[0]?.clientY??null},onTouchEnd:function(a){if(null===k.current)return;let b=(a.changedTouches[0]?.clientY??0)-k.current;k.current=null,b>80&&c()},children:[(0,d.jsx)("div",{className:"bottom-sheet__handle","aria-hidden":"true"}),"confirm-kill"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"bottom-sheet__header",children:[(0,d.jsx)("h2",{id:"bottom-sheet-title",className:"bottom-sheet__title",children:"Terminate session?"}),(0,d.jsx)("p",{className:"bottom-sheet__subtitle",children:"This action cannot be undone."})]}),(0,d.jsxs)("div",{className:"bottom-sheet__session-info",children:[(0,d.jsx)("div",{className:"bottom-sheet__session-name",children:p}),(0,d.jsx)("div",{className:"bottom-sheet__session-meta",children:w.map(a=>(0,d.jsx)("span",{className:`bottom-sheet__tag bottom-sheet__tag--${a.tone}`,children:a.label},`${a.tone}-${a.label}`))}),r?(0,d.jsx)("p",{className:"bottom-sheet__summary",children:r}):null]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"bottom-sheet__preview-card",children:[(0,d.jsx)("div",{className:"bottom-sheet__preview-strip","data-level":q}),(0,d.jsxs)("div",{className:"bottom-sheet__preview-content",children:[(0,d.jsxs)("div",{className:"bottom-sheet__preview-header",children:[(0,d.jsx)("span",{className:"bottom-sheet__preview-id",children:a.id}),(0,d.jsx)("span",{className:"bottom-sheet__preview-time",children:H(a.lastActivityAt)})]}),(0,d.jsx)("h2",{id:"bottom-sheet-title",className:"bottom-sheet__title",children:p}),(0,d.jsxs)("p",{className:"bottom-sheet__subtitle",children:[I(q)," \xb7 started ",H(a.createdAt)]}),(0,d.jsxs)("div",{className:"bottom-sheet__preview-meta",children:[a.branch?(0,d.jsx)("span",{className:"bottom-sheet__preview-branch",children:a.branch}):null,t?(0,d.jsxs)("span",{className:"bottom-sheet__preview-pr",children:["#",t.number]}):null,u&&t?(0,d.jsxs)("span",{className:"bottom-sheet__preview-diff",children:[(0,d.jsxs)("span",{className:"bottom-sheet__preview-diff-add",children:["+",t.additions]})," ",(0,d.jsxs)("span",{className:"bottom-sheet__preview-diff-del",children:["-",t.deletions]})]}):null]}),u&&t?(0,d.jsxs)("div",{className:"bottom-sheet__preview-pills",children:[(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:"passing"===t.ciStatus?"CI passing":"failing"===t.ciStatus?"CI failed":"CI pending"}),(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:"approved"===t.reviewDecision?"approved":"changes_requested"===t.reviewDecision?"changes requested":"needs review"}),v?(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:I(a.status)}):null,v&&a.activity?(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:I(a.activity)}):null]}):(0,d.jsxs)("div",{className:"bottom-sheet__preview-pills",children:[(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:I(a.status)}),a.activity?(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:I(a.activity)}):null]})]})]}),r?(0,d.jsx)("p",{className:"bottom-sheet__summary",children:r}):null]}),(0,d.jsx)("div",{className:"bottom-sheet__actions",children:"confirm-kill"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--cancel",onClick:c,children:"Cancel"}),(0,d.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--danger",onClick:f,children:"Terminate"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("a",{href:(0,o.Nc)(a.projectId,a.id),className:"bottom-sheet__btn bottom-sheet__btn--primary",children:"Open session"}),i&&a.pr&&h?(0,d.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--secondary",onClick:()=>{null!==n&&h(n)},children:"Merge"}):s&&g?(0,d.jsxs)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--danger",onClick:g,children:[(0,d.jsxs)("svg",{className:"bottom-sheet__btn-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M3 6h18"}),(0,d.jsx)("path",{d:"M8 6V4h8v2"}),(0,d.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,d.jsx)("path",{d:"M10 11v6M14 11v6"})]}),"Terminate"]}):null]})})]})]})}let L=["working","pending","action","merge"],M=["working","pending","review","respond","merge"],N=[];function O({session:a,onRestore:b}){let c=!a.summaryIsFallback&&a.summary||a.issueTitle||a.summary||a.id,e=a.pr?.state==="merged"||"merged"===a.status,f="killed"===a.status||"terminated"===a.status,g=!j.N_.has(a.status),h=`done-card__badge ${f?"done-card__badge--terminated":"done-card__badge--merged"}`;return(0,d.jsxs)("div",{className:"done-card",children:[(0,d.jsx)("p",{className:"done-card__title",children:c}),(0,d.jsxs)("div",{className:"done-card__meta",children:[(0,d.jsx)("span",{className:h,children:e?"merged":f?"terminated":"done"}),a.pr?(0,d.jsxs)("a",{href:a.pr.url,target:"_blank",rel:"noopener noreferrer",className:"done-card__pr",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,d.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,d.jsx)("path",{d:"M6 9v3a6 6 0 0 0 6 6h3"})]}),"#",a.pr.number]}):null,(0,d.jsx)("span",{className:"done-card__age",children:function(a){if(!a)return"just now";let b=new Date(a).getTime();if(!Number.isFinite(b))return"just now";let c=Date.now()-b;if(c<=0)return"just now";let d=Math.floor(c/1e3),e=Math.floor(d/60),f=Math.floor(e/60),g=Math.floor(f/24);return d<60?`${d}s ago`:e<60?`${e}m ago`:f<24?`${f}h ago`:`${g}d ago`}(a.lastActivityAt)}),g&&!e?(0,d.jsx)("button",{type:"button",className:"done-card__restore",onClick:c=>{c.stopPropagation(),b(a.id)},children:"Restore"}):null]})]})}function P({initialSessions:a,projectId:b,projectName:c,projects:f=[],orchestrators:k,attentionZones:l="simple",dashboardLoadError:m}){let n=(0,x.eT)(),p="detailed"===l?M:L,q=(0,e.useMemo)(()=>{let b={};for(let c of a)b[c.id]=(0,j.ng)(c,l);return b},[a,l]),{sessions:r,attentionLevels:t,liveSessionsResolved:u,loadError:z}=(0,w.D)({initialSessions:a,muxSessions:n?.status==="connected"?n.sessions:void 0,muxLastError:n?.lastError,initialAttentionLevels:q,attentionZones:l}),E=(0,e.useMemo)(()=>b?r.filter(a=>a.projectId===b):r,[r,b]),H=n?.status==="disconnected"?"disconnected":n?.status==="connected"?"connected":"reconnecting",I=z??(m&&u?void 0:m),J=(0,h.useSearchParams)(),P=(0,h.useRouter)(),Q=(0,e.useRef)(P);Q.current=P;let S=J.get("session")??void 0,[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(k??N),[X,Y]=(0,e.useState)([]),[Z,$]=(0,e.useState)({}),[_,aa]=(0,e.useState)(!1),[ab,ac]=(0,e.useState)(!1),ad=(0,i.U)(i.D),[ae,af]=(0,e.useState)(()=>new Set(["done","working"])),[ag,ah]=(0,e.useState)(null),[ai,aj]=(0,e.useState)("preview"),ak=J.get("debug"),al=!ad&&("1"===ak||"true"===ak),{showToast:am}=(0,B.d)(),[an,ao]=(0,e.useState)(!1),ap=(0,e.useRef)(r);ap.current=r;let aq=f.length>1&&void 0===b,ar=(0,e.useMemo)(()=>b?V.find(a=>a.projectId===b)??null:null,[V,b]),as=ar?(0,o.Nc)(ar.projectId,ar.id):null,at=!aq&&!!b&&f.some(a=>a.id===b&&!a.resolveError)&&!as,au=b?f.find(a=>a.id===b)??null:null,av=!!b&&X.includes(b),aw=b?Z[b]??null:null,ax=(0,e.useMemo)(()=>aq||!S?E:E.filter(a=>a.id===S),[E,aq,S]),ay=(0,e.useMemo)(()=>{let a={merge:[],action:[],respond:[],review:[],pending:[],working:[],done:[]};for(let b of ax)a[(0,j.ng)(b,l)].push(b);return a},[ax,l]),az=(0,e.useMemo)(()=>{let a=new Map;for(let b of r){let c=a.get(b.projectId);if(c){c.push(b);continue}a.set(b.projectId,[b])}return a},[r]),aA=(0,e.useMemo)(()=>aq?f.map(a=>{let b=az.get(a.id)??[],c={merge:0,action:0,respond:0,review:0,pending:0,working:0,done:0};for(let a of b)c[(0,j.ng)(a,l)]++;return{project:a,orchestrator:V.find(b=>b.projectId===a.id)??null,sessionCount:b.length,openPRCount:b.filter(a=>a.pr?.state==="open").length,counts:c}}):[],[V,aq,l,f,az]),aB=(0,e.useCallback)(async(a,b)=>{try{let c=await fetch(`/api/sessions/${encodeURIComponent(a)}/send`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:b})});if(!c.ok){let b=await c.text()||"Unknown error";console.error(`Failed to send message to ${a}:`,b),am(`Send failed: ${b}`,"error");let d=Error(b);throw d.toastShown=!0,d}}catch(b){throw b instanceof Error&&"toastShown"in b&&b.toastShown||(console.error(`Network error sending message to ${a}:`,b),am("Network error while sending message","error")),b}},[am]),aC=(0,e.useCallback)(async a=>{try{let b=await fetch(`/api/sessions/${encodeURIComponent(a)}/kill`,{method:"POST"});if(b.ok)am("Session terminated","success");else{let c=await b.text();console.error(`Failed to kill ${a}:`,c),am(`Terminate failed: ${c}`,"error")}}catch(b){console.error(`Network error killing ${a}:`,b),am("Network error while terminating session","error")}},[am]),aD=(0,e.useCallback)(a=>{let b=ap.current.find(b=>b.id===a)??null;b&&aC(b.id)},[aC]),aE=(0,e.useCallback)(a=>{ah(a),aj("preview")},[]),aF=(0,e.useCallback)(()=>{aj("confirm-kill")},[]),aG=(0,e.useCallback)(()=>{ah(null),aj("preview")},[]),aH=(0,e.useCallback)(()=>{ag&&aC(ag.id),ah(null),aj("preview")},[ag,aC]),aI=(0,e.useCallback)(async a=>{try{let b=await fetch(`/api/prs/${a}/merge`,{method:"POST"});if(b.ok)am(`PR #${a} merged`,"success");else{let c=await b.text();console.error(`Failed to merge PR #${a}:`,c),am(`Merge failed: ${c}`,"error");return}}catch(b){console.error(`Network error merging PR #${a}:`,b),am("Network error while merging PR","error")}},[am]),aJ=(0,e.useCallback)(async a=>{try{let b=await fetch(`/api/sessions/${encodeURIComponent(a)}/restore`,{method:"POST"});if(b.ok)am("Session restored","success"),Q.current.refresh();else{let c=await b.text();console.error(`Failed to restore ${a}:`,c),am(`Restore failed: ${c}`,"error")}}catch(b){console.error(`Network error restoring ${a}:`,b),am("Network error while restoring session","error")}},[am]),aK=async a=>{Y(b=>b.includes(a.id)?b:[...b,a.id]),$(({[a.id]:b,...c})=>c);try{let b=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:a.id})}),c=await b.json().catch(()=>null);if(!b.ok||!c?.orchestrator)throw Error(c?.error??`Failed to spawn orchestrator for ${a.name}`);let d=c.orchestrator;W(b=>{let c=b.filter(b=>b.projectId!==a.id);return c.push(d),c})}catch(c){let b=c instanceof Error?c.message:"Failed to spawn orchestrator";$(c=>({...c,[a.id]:b})),console.error(`Failed to spawn orchestrator for ${a.id}:`,c)}finally{Y(b=>b.filter(b=>b!==a.id))}},aL=p.some(a=>ay[a].length>0),aM=!aq&&!aL&&!I,aN=I?(0,d.jsxs)("div",{className:"dashboard-alert mb-6 flex flex-col gap-1.5 border border-[color-mix(in_srgb,var(--color-status-error)_28%,transparent)] bg-[color-mix(in_srgb,var(--color-status-error)_10%,transparent)] px-3.5 py-2.5 text-[11px] md:mb-4",role:"alert","aria-live":"assertive",children:[(0,d.jsx)("span",{className:"font-semibold text-[var(--color-status-error)]",children:"Orchestrator failed to load"}),(0,d.jsx)("span",{className:"break-words text-[var(--color-text-secondary)]",children:I}),(0,d.jsxs)("span",{className:"text-[var(--color-text-secondary)]",children:["Confirm ",(0,d.jsx)("span",{className:"font-mono text-[10px]",children:"agent-orchestrator.yaml"})," exists and is valid, then run ",(0,d.jsx)("span",{className:"font-mono text-[10px]",children:"ao doctor"})," for diagnostics."]})]}):null,aO=(0,e.useMemo)(()=>r.some(a=>a.pr&&(0,j.fZ)(a.pr)),[r]),aP="agent orchestrator"===c?.trim().toLowerCase()?b??c??(aq?"All projects":"Dashboard"):c??(aq?"All projects":"Dashboard"),aQ=!aq&&aP.trim().length>0,aR=a=>{af(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},aS=()=>{aa(a=>!a)};return(0,d.jsx)(G.I.Provider,{value:{onToggleSidebar:aS,mobileSidebarOpen:ab},children:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(D,{}),(0,d.jsx)(C,{status:H}),(0,d.jsxs)("div",{className:"dashboard-app-shell",children:[(0,d.jsxs)("header",{className:"dashboard-app-header",children:[(0,d.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:aS,"aria-label":"Toggle sidebar",children:ad?(0,d.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,d.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,d.jsx)("path",{d:"M9 3v18"})]})}),(0,d.jsxs)("div",{className:"dashboard-app-header__brand",children:[(0,d.jsx)("span",{className:"dashboard-app-header__brand-dot","aria-hidden":"true"}),(0,d.jsx)("span",{children:"Agent Orchestrator"})]}),aQ?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"dashboard-app-header__sep","aria-hidden":"true"}),(0,d.jsx)("span",{className:"dashboard-app-header__project",children:aP})]}):null,al?(0,d.jsx)(F,{projectId:b}):null,(0,d.jsx)("div",{className:"dashboard-app-header__spacer"}),(0,d.jsx)("div",{className:"dashboard-app-header__actions",children:!aq&&as?(0,d.jsxs)(g(),{href:as,className:"dashboard-app-btn dashboard-app-btn--amber","aria-label":"Orchestrator",children:[(0,d.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,d.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,d.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Orchestrator"]}):at&&au?(0,d.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--amber","aria-label":"Spawn Orchestrator",onClick:()=>void aK(au),disabled:av,children:[(0,d.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,d.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,d.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),av?"Spawning...":"Spawn Orchestrator"]}):null})]}),(0,d.jsxs)("div",{className:`dashboard-shell dashboard-shell--desktop${_?" dashboard-shell--sidebar-collapsed":""}`,children:[(0,d.jsx)("div",{className:`sidebar-wrapper${ab?" sidebar-wrapper--mobile-open":""}`,children:(0,d.jsx)(y.u,{projects:f,sessions:r,orchestrators:V,activeProjectId:b,activeSessionId:S,collapsed:_,onToggleCollapsed:()=>aa(a=>!a),onMobileClose:()=>ac(!1)})}),ab&&(0,d.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>ac(!1)}),(0,d.jsxs)("main",{className:"dashboard-main dashboard-main--desktop",children:[(0,d.jsx)(v.u,{attentionLevels:t,projectName:c}),(0,d.jsxs)("div",{className:"dashboard-main__subhead",children:[(0,d.jsx)("h1",{className:"dashboard-main__title",children:"Dashboard"}),(0,d.jsx)("p",{className:"dashboard-main__subtitle",children:"Live agent sessions, pull requests, and merge status."})]}),(0,d.jsxs)("div",{className:"dashboard-main__body",children:[aN,aO&&!T&&(0,d.jsxs)("div",{className:"dashboard-alert mb-4 flex items-center gap-2.5 border border-[color-mix(in_srgb,var(--color-status-attention)_25%,transparent)] bg-[var(--color-tint-yellow)] px-3.5 py-2.5 text-[11px] text-[var(--color-status-attention)]",children:[(0,d.jsxs)("svg",{className:"h-3.5 w-3.5 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),(0,d.jsx)("span",{className:"flex-1",children:"GitHub API rate limited — PR data (CI status, review state, sizes) may be stale. Will retry automatically on next refresh."}),(0,d.jsx)("button",{onClick:()=>U(!0),className:"ml-1 shrink-0 opacity-60 hover:opacity-100","aria-label":"Dismiss",children:(0,d.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),aq&&(0,d.jsx)(R,{overviews:aA,onSpawnOrchestrator:aK,spawningProjectIds:X,spawnErrors:Z,attentionZones:l}),!aq&&aL&&(0,d.jsx)("div",{className:"kanban-board-wrap",children:(0,d.jsx)("div",{className:"kanban-board","data-columns":p.length,style:{"--kanban-column-count":p.length},children:p.map(a=>(0,d.jsx)(s,{level:a,sessions:ay[a],onSend:aB,onKill:aD,onMerge:aI,onRestore:aJ,compactMobile:ad,collapsed:ad&&ae.has(a),onToggle:ad?aR:void 0,onPreview:ad?aE:void 0},a))})}),aM?(0,d.jsx)(A,{orchestratorHref:as,onSpawnOrchestrator:at&&au?()=>{aK(au)}:null,spawnLabel:av?"Spawning...":"Spawn Orchestrator",spawnDisabled:av}):null,!aq&&aw?(0,d.jsx)("p",{className:"mt-3 text-[11px] text-[var(--color-status-error)]",children:aw}):null,!aq&&ay.done.length>0&&(0,d.jsxs)("div",{className:"done-bar mt-6",children:[(0,d.jsxs)("button",{type:"button",className:"done-bar__toggle",onClick:()=>ao(a=>!a),"aria-expanded":an,children:[(0,d.jsx)("svg",{className:`done-bar__chevron${an?" done-bar__chevron--open":""}`,fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m9 18 6-6-6-6"})}),(0,d.jsx)("span",{className:"done-bar__label",children:"Done / Terminated"}),(0,d.jsx)("span",{className:"done-bar__count",children:ay.done.length})]}),an&&(0,d.jsx)("div",{className:"done-bar__cards",children:ay.done.map(a=>(0,d.jsx)(O,{session:a,onRestore:aJ},a.id))})]})]})]})]})]}),(0,d.jsx)(K,{session:ag,mode:ai,onCancel:aG,onConfirm:aH,onRequestKill:aF,onMerge:aI,isMergeReady:!!ag&&"merge"===t[ag.id]})]})})}function Q(a){return(0,d.jsx)(B.t,{children:(0,d.jsx)(P,{...a})})}function R({overviews:a,onSpawnOrchestrator:b,spawningProjectIds:c,spawnErrors:e,attentionZones:f}){return(0,d.jsx)("div",{className:"mb-8 grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:a.map(({project:a,orchestrator:h,sessionCount:i,openPRCount:j,counts:k})=>(()=>{let l=!!a.resolveError,m=(0,o.bn)(a.id);return(0,d.jsxs)("section",{className:"border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] p-4",children:[(0,d.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-[14px] font-semibold text-[var(--color-text-primary)]",children:a.name}),(0,d.jsx)("div",{className:"mt-1 text-[11px] text-[var(--color-text-muted)]",children:l?"Config needs repair":(0,d.jsxs)(d.Fragment,{children:[i," active session",1!==i?"s":"",j>0?` \xb7 ${j} open PR${1!==j?"s":""}`:""]})})]}),(0,d.jsx)(g(),{href:m,className:"border border-[var(--color-border-default)] px-3 py-1.5 text-[11px] font-medium text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:no-underline",children:"Open project"})]}),(0,d.jsxs)("div",{className:"mb-4 flex flex-wrap gap-2",children:[(0,d.jsx)(S,{label:"Merge",value:k.merge,tone:"ready"}),"detailed"===f?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(S,{label:"Respond",value:k.respond,tone:"error"}),(0,d.jsx)(S,{label:"Review",value:k.review,tone:"orange"})]}):(0,d.jsx)(S,{label:"Action",value:k.action,tone:"orange"}),(0,d.jsx)(S,{label:"Pending",value:k.pending,tone:"attention"}),(0,d.jsx)(S,{label:"Working",value:k.working,tone:"working"})]}),(0,d.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,d.jsx)("div",{className:"text-[11px] text-[var(--color-text-muted)]",children:l?"Project config could not be resolved":h?"Per-project orchestrator available":"No running orchestrator"}),l?(0,d.jsx)(g(),{href:m,className:"border border-[var(--color-border-default)] px-3 py-1.5 text-[11px] font-semibold text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:no-underline",children:"Repair project"}):h?(0,d.jsxs)(g(),{href:(0,o.Nc)(h.projectId,h.id),className:"orchestrator-btn flex items-center gap-2 px-3 py-1.5 text-[11px] font-semibold hover:no-underline",children:[(0,d.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--color-accent)] opacity-80"}),"orchestrator"]}):(0,d.jsx)("button",{type:"button",onClick:()=>void b(a),disabled:c.includes(a.id),className:"orchestrator-btn px-3 py-1.5 text-[11px] font-semibold disabled:cursor-wait disabled:opacity-70",children:c.includes(a.id)?"Spawning...":"Spawn Orchestrator"})]}),e[a.id]?(0,d.jsx)("p",{className:"mt-2 text-[11px] text-[var(--color-status-error)]",children:e[a.id]}):null]})]},a.id)})())})}function S({label:a,value:b,tone:c}){return(0,d.jsxs)("div",{className:"min-w-[78px] border border-[var(--color-border-subtle)] px-2.5 py-2",children:[(0,d.jsx)("div",{className:"text-[10px] uppercase tracking-[0.08em] text-[var(--color-text-tertiary)]",children:a}),(0,d.jsx)("div",{className:"project-metric__value mt-1 text-[18px] font-semibold tabular-nums","data-tone":c,children:b})]})}},13219:(a,b,c)=>{c.d(b,{Dashboard:()=>d});let d=(0,c(10864).registerClientReference)(function(){throw Error("Attempted to call Dashboard() from the server but Dashboard is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/tmp/ao-publish-stable/packages/web/src/components/Dashboard.tsx","Dashboard")},70162:(a,b,c)=>{c.d(b,{I:()=>d});let d=(0,c(81115).createContext)(null)}};
|
|
1
|
+
"use strict";exports.id=6848,exports.ids=[6848],exports.modules={4022:(a,b,c)=>{c.d(b,{Dashboard:()=>Q});var d=c(33666),e=c(81115),f=c(47489),g=c.n(f),h=c(50436),i=c(52754),j=c(37155),k=c(85489),l=c(61875),m=c(82732),n=c(37501),o=c(88950);let p=new Set,q=(0,e.memo)(function({session:a,onSend:b,onKill:c,onMerge:f,onRestore:g}){var h,i;let[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(""),E=(0,e.useRef)(null),F=(0,e.useRef)(null),[G]=(0,e.useState)(()=>p.has(a.id)),H=(0,j.ng)(a),I=a.pr,J=async c=>{let d=c.trim();if(!d||null!==w)return!1;x(d),z(null);try{return await Promise.resolve(b?.(a.id,d)),z(d),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>z(null),2e3),!0}catch{return!1}finally{x(null)}},K=async a=>{"Enter"===a.key&&!a.shiftKey&&(a.preventDefault(),await J(C)&&D(""))},L=async(c,d)=>{if(null===s){t(c),v(null);try{await Promise.resolve(b?.(a.id,d)),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>t(null),2e3)}catch{t(null),v(c),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>v(null),2e3)}}},M=!!I&&(0,j.fZ)(I),N=!!I&&(0,j.sZ)(I),O=function(a){let b=a.pr;if(!b||"open"!==b.state||(0,j.fZ)(b)||(0,j.sZ)(b))return[];let c=a.metadata,e=[],f=a.lifecycle?.prReason??null,g=c.status,h=b.ciStatus===j.U1.FAILING||"ci_failing"===f||"ci_failed"===g,i="changes_requested"===b.reviewDecision||"changes_requested"===f||"changes_requested"===g,k=!b.mergeability.noConflicts;if(h){let a=b.ciChecks.find(a=>"failed"===a.status),d=b.ciChecks.filter(a=>"failed"===a.status).length;0===d&&b.ciStatus!==j.U1.FAILING?e.push({key:"ci-fail",type:"ci",icon:"✗",label:"CI failing",url:b.url+"/checks",notified:!!c.lastCIFailureDispatchHash,actionLabel:"Ask to fix",actionMessage:`Please fix the failing CI checks on ${b.url}`}):0===d?e.push({key:"ci-unknown",type:"ci",icon:"?",label:"CI unknown",url:b.url+"/checks"}):e.push({key:"ci-fail",type:"ci",icon:"✗",count:d,label:`check${d>1?"s":""} failing`,url:a?.url??b.url+"/checks",notified:!!c.lastCIFailureDispatchHash,actionLabel:"Ask to fix",actionMessage:`Please fix the failing CI checks on ${b.url}`})}if(i?e.push({key:"changes",type:"changes",icon:"↻",label:"changes requested",url:b.url,notified:!!c.lastPendingReviewDispatchHash,actionLabel:"Ask to address",actionMessage:`Please address the requested changes on ${b.url}`}):b.isDraft||"pending"!==b.reviewDecision&&"none"!==b.reviewDecision||e.push({key:"review",type:"review",icon:(0,d.jsxs)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),(0,d.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,d.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75"})]}),label:"needs review",url:b.url,actionLabel:"Ask to post",actionMessage:`Post ${b.url} on slack asking for a review.`}),k&&e.push({key:"conflict",type:"conflict",icon:"⚠",label:"merge conflict",url:b.url,notified:"true"===c.lastMergeConflictDispatched,actionLabel:"Ask to fix",actionMessage:`Please resolve the merge conflicts on ${b.url} by rebasing on the base branch`}),b.unresolvedThreads>0){let a=b.unresolvedComments[0]?.url??b.url+"/files";e.push({key:"comments",type:"comment",icon:"\uD83D\uDCAC",label:"unresolved comments",count:b.unresolvedThreads,url:a,actionLabel:"Ask to resolve",actionMessage:`Please address all unresolved review comments on ${b.url}`})}return e}(a),P=!M&&I?.mergeability.mergeable&&"open"===I.state,Q=(0,j.nH)(a),R=(0,j.wy)(a),S=(0,l.Pn)(a),T=(h=a,i=H,P||"merge"===i?"mergeable":h.lifecycle?.sessionState==="detecting"?"detecting":"respond"===i?(0,j.Ou)(h):h.lifecycle?.prReason==="ci_failing"||"ci_failed"===h.status?"ci failing":"review"===i?(0,j.of)(h):(0,j.Ou)(h)),U=M||!I||N?[]:I.ciChecks.filter(a=>"passed"===a.status).slice(0,3),V=(0,j.dG)(a)||"done"===H,W=a.lifecycle?`Session ${(0,j.Ou)(a)} \xb7 PR ${(0,j.of)(a)} \xb7 Runtime ${(0,j.Kw)(a)}`:null,X=a.issueLabel?`${a.issueLabel}${a.issueTitle?` \xb7 ${a.issueTitle}`:""}`:a.issueTitle??(a.summary&&a.summary!==S?a.summary:null),Y=P?"session-card--merge-frame":O.length>0?"session-card--alert-frame":"session-card--fixed",Z=P?"session-card--accent-merge":"working"===H?"session-card--accent-working":"respond"===H?"session-card--accent-respond":"review"===H||"pending"===H?"session-card--accent-attention":"session-card--accent-default";if(V){let b=function(a){let b=a.activity,c=a.status,e=a.lifecycle?.prState??a.pr?.state;return"merged"===e||"merged"===c?{label:"merged",pillClass:"done-status-pill--merged",icon:(0,d.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})})}:"closed"===e?{label:"closed",pillClass:"done-status-pill--exited",icon:(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,d.jsx)("path",{d:"M9 12h6"})]})}:a.lifecycle?.sessionState==="terminated"||"killed"===c||"terminated"===c?{label:(0,j.Ou)(a),pillClass:"done-status-pill--killed",icon:(0,d.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,d.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}:{label:"exited"===b?"exited":(0,j.Ou)(a),pillClass:"done-status-pill--exited",icon:(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,d.jsx)("path",{d:"M9 12h6"})]})}}(a);return(0,d.jsxs)("div",{className:(0,k.cn)("session-card-done",q&&"done-expanded"),onClick:a=>{a.target.closest("a, button, textarea")||r(!q)},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,d.jsxs)("span",{className:(0,k.cn)("done-status-pill",b.pillClass),children:[b.icon,b.label]}),(0,d.jsx)("span",{className:"font-[var(--font-mono)] text-[10px] tracking-wide text-[var(--color-text-muted)]",children:a.id}),(0,d.jsx)("div",{className:"flex-1"}),R&&(0,d.jsxs)("button",{onClick:b=>{b.stopPropagation(),g?.(a.id)},className:"done-restore-btn",children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,d.jsx)("polyline",{points:"1 4 1 10 7 10"}),(0,d.jsx)("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),"restore"]})]}),(0,d.jsx)("div",{className:"px-3.5 pb-2",children:(0,d.jsx)("p",{className:"session-card-done__title text-[13px] font-semibold leading-snug [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2] overflow-hidden",children:S})}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 px-3.5 pb-3",children:[a.branch&&(0,d.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-2.5 w-2.5 opacity-50",children:[(0,d.jsx)("path",{d:"M6 3v12M18 9a3 3 0 0 1-3 3H9a3 3 0 0 0-3 3"}),(0,d.jsx)("circle",{cx:"18",cy:"6",r:"3"})]}),a.branch]}),I&&(0,d.jsxs)("a",{href:I.url,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-bold text-[var(--color-text-primary)] no-underline underline-offset-2 hover:underline",children:["#",I.number]}),I&&!M&&(N?(0,d.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,d.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,d.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",I.additions]})," ",(0,d.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",I.deletions]})," ",(0,n.i_)(I.additions,I.deletions),(0,d.jsx)("span",{className:"sr-only",children:`+${I.additions} -${I.deletions} ${(0,n.i_)(I.additions,I.deletions)}`})]})),(0,d.jsx)("a",{href:(0,o.Nc)(a.projectId,a.id),onClick:a=>a.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-semibold text-[var(--color-accent)] no-underline hover:underline",children:"View current context"})]}),q&&(0,d.jsxs)("div",{className:"done-expand-section px-3.5 py-3",children:[a.summary&&I?.title&&a.summary!==I.title&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsxs)("div",{className:"done-detail-heading",children:[(0,d.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M4 6h16M4 12h16M4 18h10"})}),"Summary"]}),(0,d.jsx)("p",{className:"text-[12px] leading-relaxed text-[var(--color-text-secondary)]",children:a.summary})]}),a.issueUrl&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsxs)("div",{className:"done-detail-heading",children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"Issue"]}),(0,d.jsxs)("a",{href:a.issueUrl,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"text-[12px] text-[var(--color-accent)] hover:underline",children:[a.issueLabel||a.issueUrl,a.issueTitle&&`: ${a.issueTitle}`]})]}),I&&I.ciChecks.length>0&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsxs)("div",{className:"done-detail-heading",children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("path",{d:"M9 12l2 2 4-4"}),(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"})]}),"CI Checks"]}),(0,d.jsx)(m.zm,{checks:I.ciChecks})]}),I&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsxs)("div",{className:"done-detail-heading",children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65S8.93 17.38 9 18v4"}),(0,d.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]}),"PR"]}),(0,d.jsxs)("p",{className:"text-[12px] text-[var(--color-text-secondary)]",children:[(0,d.jsx)("a",{href:I.url,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"hover:underline",children:I.title}),N?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("br",{}),(0,d.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2 text-[10px] text-[var(--color-text-muted)]",children:[(0,d.jsx)("span",{className:"inline-block h-3 w-12 animate-pulse rounded bg-[var(--color-bg-subtle)]"}),(0,d.jsx)("span",{children:"PR details loading..."})]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("br",{}),(0,d.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2",children:[(0,d.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,d.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",I.additions]})," ",(0,d.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",I.deletions]})]}),(0,d.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,d.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["mergeable: ",I.mergeability.mergeable?"yes":"no"]}),(0,d.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,d.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["review: ",I.reviewDecision]})]})]})]})]}),!I&&(0,d.jsx)("p",{className:"text-[12px] text-[var(--color-text-tertiary)]",children:"No PR associated with this session."})]})]})}let $=Q?"exited":P||"merge"===H||"review"===H?"ready":"respond"===H?"waiting":"pending"===H?"idle":"working"===H?"working":"idle";return(0,d.jsxs)("div",{className:(0,k.cn)("session-card border",!G&&"kanban-card-enter",Y,Z,P&&"card-merge-ready"),children:[(0,d.jsxs)("div",{className:"session-card__header",children:[(0,d.jsx)("span",{className:(0,k.cn)("card__adot","working"===$&&"card__adot--working","ready"===$&&"card__adot--ready","idle"===$&&"card__adot--idle","waiting"===$&&"card__adot--waiting","exited"===$&&"card__adot--exited")}),(0,d.jsx)("span",{className:"card__id",children:a.id}),(0,d.jsx)("div",{className:"flex-1"}),R&&(0,d.jsxs)("button",{onClick:b=>{b.stopPropagation(),g?.(a.id)},className:"session-card__control session-card__restore-control",children:[(0,d.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("path",{d:"M20 11a8 8 0 0 0-14.9-3.98"}),(0,d.jsx)("path",{d:"M4 5v4h4"}),(0,d.jsx)("path",{d:"M4 13a8 8 0 0 0 14.9 3.98"}),(0,d.jsx)("path",{d:"M20 19v-4h-4"})]}),"restore"]}),!Q&&(0,d.jsxs)("a",{href:(0,o.$l)(a.projectId,a.id,"#session-terminal-section"),onClick:a=>a.stopPropagation(),className:"session-card__control session-card__terminal-link",children:[(0,d.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),(0,d.jsx)("path",{d:"M6 10l4 2-4 2"}),(0,d.jsx)("path",{d:"M14 14h4"})]}),"terminal"]})]}),(0,d.jsxs)("div",{className:"session-card__body flex min-h-0 flex-1 flex-col",children:[(0,d.jsx)("div",{className:"card__title-wrap",children:(0,d.jsx)("p",{className:"card__title",children:S})}),(0,d.jsxs)("div",{className:"card__meta",children:[a.branch&&(0,d.jsx)("span",{className:"card__branch",children:a.branch}),a.branch&&I?(0,d.jsx)("span",{className:"card__meta-sep","aria-hidden":"true",children:"\xb7"}):null,I&&(0,d.jsxs)("a",{href:I.url,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"card__pr",children:["#",I.number]}),I&&!M&&(N?(0,d.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,d.jsxs)("span",{className:"card__diff inline-flex items-center",children:[(0,d.jsxs)("span",{className:"card__diff-add",children:["+",I.additions]})," ",(0,d.jsxs)("span",{className:"card__diff-del",children:["-",I.deletions]})," ",(0,d.jsx)("span",{className:"card__diff-size",children:(0,n.i_)(I.additions,I.deletions)}),(0,d.jsx)("span",{className:"sr-only",children:`+${I.additions} -${I.deletions} ${(0,n.i_)(I.additions,I.deletions)}`})]}))]}),X&&(0,d.jsx)("div",{className:"px-[10px] pb-[5px]",children:"merge"===H||P?(0,d.jsxs)("p",{className:"session-card__secondary session-card__secondary--merge",children:[(0,d.jsx)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})}),(0,d.jsx)("span",{children:X})]}):(0,d.jsx)("p",{className:"session-card__secondary",children:X})}),W&&(0,d.jsx)("div",{className:"px-[10px] pb-[5px]",children:(0,d.jsx)("p",{className:"text-[10px] leading-relaxed text-[var(--color-text-tertiary)]",children:W})}),M&&I?.state==="open"&&(0,d.jsx)("div",{className:"px-[10px] pb-[5px]",children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--color-text-muted)]",children:[(0,d.jsxs)("svg",{className:"h-3 w-3 text-[var(--color-text-tertiary)]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"PR data rate limited"]})}),U.length>0&&(0,d.jsx)("div",{className:"card__ci",children:U.map(a=>{let b=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("svg",{width:"8",height:"8",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M20 6 9 17l-5-5"})}),a.name]});return a.url?(0,d.jsx)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"ci-chip ci-chip--pass",onClick:a=>a.stopPropagation(),children:b},a.name):(0,d.jsx)("span",{className:"ci-chip ci-chip--pass",children:b},a.name)})}),!M&&O.length>0&&(0,d.jsx)("div",{className:"card__alerts flex flex-col",children:O.slice(0,3).map(a=>(0,d.jsxs)("div",{className:(0,k.cn)("alert-row",`alert-row--${a.type}`),children:[(0,d.jsx)("span",{className:"alert-row__icon",children:a.icon}),(0,d.jsxs)("span",{className:"alert-row__text",children:[(0,d.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),children:[void 0!==a.count&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"font-bold",children:a.count})," "]}),a.label]}),a.notified&&(0,d.jsxs)("span",{className:"alert-row__notified",title:"Agent has been notified",children:[" ","\xb7 notified"]})]}),a.actionLabel&&(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),L(a.key,a.actionMessage??"")},disabled:s===a.key,className:"alert-row__action",children:s===a.key?"sent!":u===a.key?"failed":a.actionLabel})]},a.key))}),"respond"===H&&(0,d.jsxs)("div",{className:"quick-reply",onClick:a=>a.stopPropagation(),children:[a.summary&&!a.summaryIsFallback&&(0,d.jsxs)("div",{className:"card__agent-msg",children:[(0,d.jsx)("svg",{className:"card__agent-msg-icon",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),(0,d.jsx)("span",{children:a.summary})]}),(0,d.jsx)("a",{href:(0,o.Nc)(a.projectId,a.id),onClick:a=>a.stopPropagation(),className:"card__view-context",children:"View current context →"}),!Q&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"card__presets",children:[(0,d.jsx)("button",{className:"card__preset",onClick:()=>void J("continue"),disabled:null!==w,children:"continue"===w?"Sending...":"continue"===y?"Sent":"Continue"}),(0,d.jsx)("button",{className:"card__preset",onClick:()=>void J("abort"),disabled:null!==w,children:"abort"===w?"Sending...":"abort"===y?"Sent":"Abort"}),(0,d.jsx)("button",{className:"card__preset",onClick:()=>void J("skip"),disabled:null!==w,children:"skip"===w?"Sending...":"skip"===y?"Sent":"Skip"})]}),(0,d.jsx)("div",{className:"card__reply-wrap",children:(0,d.jsx)("textarea",{className:"card__reply",placeholder:null!==w?"Sending...":"Type a reply... (Enter to send)","aria-label":"Type a reply to the agent",value:C,onChange:a=>D(a.target.value),onKeyDown:a=>{K(a)},rows:1,disabled:null!==w})})]})]}),(0,d.jsxs)("div",{className:"session-card__footer",children:[(0,d.jsx)("span",{className:"card__status min-w-0 truncate",title:a.userPrompt??void 0,children:!a.issueUrl&&a.userPrompt?a.userPrompt.length>60?a.userPrompt.slice(0,60)+"…":a.userPrompt:T}),P&&I?(0,d.jsxs)("button",{onClick:a=>{a.stopPropagation(),f?.(I.number)},className:"session-card__control session-card__merge-control",children:[(0,d.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{cx:"6",cy:"6",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"18",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"6",r:"2"}),(0,d.jsx)("path",{d:"M8 6h5a3 3 0 0 1 3 3v7"})]}),"Merge PR #",I.number]}):!Q&&(0,d.jsx)("button",{onClick:b=>{if(b.stopPropagation(),!A)return void B(!0);B(!1),c?.(a.id)},onMouseLeave:()=>B(!1),onBlur:()=>B(!1),"aria-label":A?"Confirm terminate session":"Terminate session",className:(0,k.cn)("session-card__control session-card__terminate btn--danger",A&&"is-confirming"),children:A?(0,d.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:"kill?"}):(0,d.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("path",{d:"M3 6h18"}),(0,d.jsx)("path",{d:"M8 6V4h8v2"}),(0,d.jsx)("path",{d:"M19 6l-1 14H6L5 6"})]})})]})]})]})},function(a,b){return a.session===b.session&&a.onSend===b.onSend&&a.onKill===b.onKill&&a.onMerge===b.onMerge&&a.onRestore===b.onRestore}),r={merge:{label:"Ready",emptyMessage:"Nothing cleared to land yet."},action:{label:"Action",emptyMessage:"No agents need your input."},respond:{label:"Respond",emptyMessage:"No agents need your input."},review:{label:"Review",emptyMessage:"No code waiting for review."},pending:{label:"Pending",emptyMessage:"Nothing blocked."},working:{label:"Working",emptyMessage:"No agents running."},done:{label:"Done",emptyMessage:"No completed sessions."}},s=(0,e.memo)(function({level:a,sessions:b,onSend:c,onKill:f,onMerge:g,onRestore:h,collapsed:i,onToggle:j,compactMobile:k,onPreview:l,resetKey:m}){let n=r[a],o=void 0!==j,[p,s]=(0,e.useState)(!1),u=o&&k&&!p?b.slice(0,5):b,v=b.length-u.length;return o?(0,d.jsxs)("div",{className:`accordion-section${i?" accordion-section--collapsed":" accordion-section--expanded"}`,"data-level":a,children:[(0,d.jsxs)("button",{type:"button",className:"accordion-header",onClick:()=>j(a),"aria-expanded":!i,"aria-controls":`accordion-body-${a}`,children:[(0,d.jsx)("span",{className:"accordion-header__dot","data-level":a}),(0,d.jsx)("span",{className:"accordion-header__label",children:n.label}),(0,d.jsx)("span",{className:"accordion-header__count",children:b.length}),(0,d.jsx)("span",{className:"accordion-header__chevron","aria-hidden":"true",children:"▶"})]}),(0,d.jsx)("div",{id:`accordion-body-${a}`,className:"accordion-body",children:b.length>0?(0,d.jsxs)("div",{className:k?"mobile-session-list":"flex flex-col gap-2 p-3",children:[u.map(b=>k?(0,d.jsx)(t,{session:b,level:a,onPreview:l},b.id):(0,d.jsx)(q,{session:b,onSend:c,onKill:f,onMerge:g,onRestore:h},b.id)),k&&v>0?(0,d.jsxs)("button",{type:"button",className:"mobile-session-list__view-all",onClick:()=>s(!0),children:["View all ",b.length]}):null]}):k?(0,d.jsx)("div",{className:"mobile-session-list",children:(0,d.jsx)("div",{className:"mobile-session-list__empty",children:n.emptyMessage})}):null})]}):(0,d.jsxs)("div",{className:"kanban-column","data-level":a,children:[(0,d.jsx)("div",{className:"kanban-column__header",children:(0,d.jsxs)("div",{className:"kanban-column__title-row",children:[(0,d.jsx)("div",{className:"kanban-column__dot","data-level":a}),(0,d.jsx)("span",{className:"kanban-column__title",children:n.label}),(0,d.jsx)("span",{className:"kanban-column__count",children:b.length})]})}),(0,d.jsx)("div",{className:"kanban-column-body",children:b.length>0?(0,d.jsx)("div",{className:"kanban-column__stack",children:b.map(a=>(0,d.jsx)(q,{session:a,onSend:c,onKill:f,onMerge:g,onRestore:h},a.id))}):null})]})},function(a,b){return a.level===b.level&&a.collapsed===b.collapsed&&a.onToggle===b.onToggle&&a.onSend===b.onSend&&a.onKill===b.onKill&&a.onMerge===b.onMerge&&a.onRestore===b.onRestore&&a.compactMobile===b.compactMobile&&a.onPreview===b.onPreview&&a.resetKey===b.resetKey&&a.sessions.length===b.sessions.length&&a.sessions.every((a,c)=>a===b.sessions[c])});function t({session:a,level:b,onPreview:c}){let e=[a.branch,a.pr?`PR #${a.pr.number}`:null,a.issueLabel].filter(Boolean);return(0,d.jsxs)("div",{className:"mobile-session-row",children:[(0,d.jsxs)("button",{type:"button",className:"mobile-session-row__preview",onClick:()=>c?.(a),"aria-label":`Open ${(0,l.Pn)(a)}`,children:[(0,d.jsxs)("div",{className:"mobile-session-row__line",children:[(0,d.jsx)("span",{className:"mobile-session-row__dot","data-level":b,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"mobile-session-row__title",children:(0,l.Pn)(a)})]}),(0,d.jsx)("div",{className:"mobile-session-row__meta",children:e.length>0?e.join(" \xb7 "):"No branch or PR metadata"})]}),(0,d.jsxs)("div",{className:"mobile-session-row__side",children:[(0,d.jsx)(u,{session:a,level:b}),(0,d.jsx)("a",{href:(0,o.Nc)(a.projectId,a.id),className:"mobile-session-row__open","aria-label":`Go to ${(0,l.Pn)(a)}`,children:(0,d.jsxs)("svg",{className:"mobile-session-row__open-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M4 17V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2Z"}),(0,d.jsx)("path",{d:"m8 10 2 2-2 2M12 14h4"})]})})]})]})}function u({session:a,level:b}){let c=r[b].label.toLowerCase();if("merge"===b&&a.pr&&(0,j.QN)(a.pr))c="ready";else if("action"===b)c="needs_input"===a.status?"needs input":"stuck"===a.status?"stuck":"errored"===a.status?"errored":"waiting_input"===a.activity?"waiting":"exited"===a.activity?"crashed":"blocked"===a.activity?"blocked":"ci_failed"===a.status?"ci failed":"changes_requested"===a.status?"changes":a.pr?.ciStatus==="failing"?"ci failed":a.pr?.reviewDecision==="changes_requested"?"changes":a.pr&&!a.pr.mergeability.noConflicts?"conflicts":"action";else"respond"===b?c="waiting_input"===a.activity?"waiting":"needs input":"review"===b?c=a.pr?.reviewDecision==="changes_requested"?"changes":"review":"pending"===b?c=a.pr?.unresolvedThreads?"threads":"pending":"working"===b&&(c="idle"===a.activity?"idle":"active");return(0,d.jsx)("span",{className:"mobile-session-row__chip",children:c})}var v=c(18768),w=c(20057),x=c(58976),y=c(31849);let z=["Working","Pending","Review","Respond","Merge"];function A({message:a,orchestratorHref:b,onSpawnOrchestrator:c=null,spawnLabel:e="Spawn Orchestrator",spawnDisabled:f=!1}){return(0,d.jsxs)("div",{className:"board-wrapper",children:[(0,d.jsx)("div",{className:"kanban-ghost","aria-hidden":"true",children:z.map(a=>(0,d.jsx)("div",{className:"kanban-ghost__col",children:(0,d.jsx)("div",{className:"kanban-ghost__head",children:a})},a))}),(0,d.jsx)("div",{className:"board-center",children:(0,d.jsxs)("div",{className:"empty-state",role:"status",children:[(0,d.jsx)("div",{className:"empty-state__icon",children:(0,d.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"5.5",r:"2.5",fill:"rgba(249,115,22,0.18)",stroke:"#f97316",strokeWidth:"1.5"}),(0,d.jsx)("circle",{cx:"5.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,d.jsx)("circle",{cx:"18.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,d.jsx)("line",{x1:"12",y1:"8",x2:"6.7",y2:"14.8",stroke:"rgba(249,115,22,0.22)",strokeWidth:"1",strokeDasharray:"2.5 2"}),(0,d.jsx)("line",{x1:"12",y1:"8",x2:"17.3",y2:"14.8",stroke:"rgba(249,115,22,0.22)",strokeWidth:"1",strokeDasharray:"2.5 2"}),(0,d.jsx)("line",{x1:"7.8",y1:"17",x2:"16.2",y2:"17",stroke:"var(--color-border-subtle)",strokeWidth:"1",strokeDasharray:"2.5 2"})]})}),a?(0,d.jsx)("p",{className:"empty-state__text",children:a}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"empty-state__headline",children:"Ready to orchestrate"}),(0,d.jsx)("p",{className:"empty-state__hint",children:"Open the main orchestrator to start a session and fan out parallel agents across your codebase."}),b?(0,d.jsxs)("a",{href:b,className:"empty-state__cta",children:[(0,d.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,d.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,d.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Open Orchestrator"]}):c?(0,d.jsxs)("button",{type:"button",className:"empty-state__cta",onClick:c,disabled:f,children:[(0,d.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,d.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,d.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),e]}):null]})]})})]})}var B=c(71276);function C({status:a}){return"connected"===a?null:"disconnected"===a?(0,d.jsx)("button",{type:"button",className:"connection-bar connection-bar--disconnected","aria-live":"assertive","aria-atomic":"true",onClick:()=>window.location.reload(),children:"Offline \xb7 tap to retry"}):(0,d.jsx)("div",{className:"connection-bar connection-bar--reconnecting",role:"status","aria-live":"polite","aria-atomic":"true",children:"Reconnecting…"})}function D(){let[a,b]=(0,e.useState)(null),[c,f]=(0,e.useState)("idle"),[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(null),k=(0,e.useCallback)(()=>{if(a?.latest){try{window.localStorage.setItem("ao.updateBanner.dismissedFor",a.latest)}catch{}j(a.latest),f("idle"),h(null)}},[a]),l=(0,e.useCallback)(async()=>{f("starting"),h(null);try{let a=await fetch("/api/update",{method:"POST"}),b=await a.json();if(a.ok)return void f("started");if(409===a.status){f("blocked"),h(b.message);return}f("error"),h(b.message??"Update failed")}catch(a){f("error"),h(a instanceof Error?a.message:String(a))}},[]);if(!a||!a.isOutdated||!a.latest||"manual"===a.channel||i===a.latest&&"idle"===c||"started"===c)return null;let m="nightly"===a.channel?" (nightly)":"";return(0,d.jsxs)("div",{role:"status","aria-live":"polite",className:"flex w-full items-center justify-between gap-3 border-b border-[var(--color-border-default)] bg-[var(--color-accent-amber-dim)] px-4 py-2 text-sm text-[var(--color-text-primary)]",children:[(0,d.jsxs)("div",{className:"flex flex-1 items-center gap-3",children:[(0,d.jsx)("span",{"aria-hidden":"true",className:"inline-block h-2 w-2 flex-shrink-0 rounded-full bg-[var(--color-accent-amber)]"}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 sm:flex-row sm:items-baseline sm:gap-2",children:[(0,d.jsxs)("span",{className:"font-medium",children:["Update available",m,": ",a.current," → ",a.latest]}),"blocked"===c&&g||"error"===c&&g?(0,d.jsx)("span",{className:"text-xs text-[var(--color-status-error)]",children:g}):"starting"===c?(0,d.jsx)("span",{className:"text-xs text-[var(--color-text-secondary)]",children:"Starting…"}):(0,d.jsx)("span",{className:"text-xs text-[var(--color-text-secondary)]",children:"Click Update to install. The dashboard will restart."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>void l(),disabled:"starting"===c,className:"rounded-sm border border-[var(--color-accent-amber-border)] bg-[var(--color-accent-amber)] px-3 py-1 text-xs font-medium text-[var(--color-text-inverse)] hover:bg-[color-mix(in_srgb,var(--color-accent-amber)_85%,black)] disabled:cursor-wait disabled:opacity-60",children:"starting"===c?"Updating…":"Update"}),(0,d.jsx)("button",{type:"button",onClick:k,"aria-label":"Dismiss",className:"rounded-sm px-2 py-1 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)]",children:"Dismiss"})]})]})}let E=[/\bBearer\s+[A-Za-z0-9._\-+/=]+\b/gi,/\bsk-[A-Za-z0-9]{10,}\b/g,/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g];function F({projectId:a}){let{showToast:b}=(0,B.d)(),[c,f]=(0,e.useState)(!1),g=(0,e.useCallback)(async()=>{if(!c){f(!0);try{let c,d=await fetch("/api/observability",{credentials:"same-origin"});if(!d.ok)return void b("Could not fetch observability snapshot","error");let e=d.headers.get("x-correlation-id");try{c=await d.json()}catch{b("Could not parse observability snapshot","error");return}let f=function a(b,c=new WeakSet){if("string"==typeof b)return E.reduce((a,b)=>a.replace(b,"[REDACTED]"),b);if(Array.isArray(b))return b.map(b=>a(b,c));if(b&&"object"==typeof b){if(c.has(b))return"[Circular]";c.add(b);let d={};for(let[e,f]of Object.entries(b))d[e]=a(f,c);return d}return b}(function(a,b){if(!b||!a||"object"!=typeof a)return a;let c={...a},d=c.projects;if(d&&"object"==typeof d&&!Array.isArray(d)){let a=d[b];c.projects=void 0===a?{}:{[b]:a}}return c}(c,a)),g={copiedAt:new Date().toISOString(),pageHref:`${window.location.origin}${window.location.pathname}`,projectId:a??null,correlationId:e,userAgent:navigator.userAgent,observability:f};await navigator.clipboard.writeText(JSON.stringify(g,null,2)),b("Debug bundle copied to clipboard","success")}catch{b("Could not copy debug bundle","error")}finally{f(!1)}}},[c,a,b]);return(0,d.jsxs)("button",{type:"button",className:"orchestrator-btn flex min-h-[44px] min-w-[44px] items-center gap-2 px-4 py-2 text-[12px] font-semibold text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-bg-hover)] disabled:opacity-50",onClick:()=>void g(),disabled:c,"aria-label":"Copy debug bundle for issue reports",children:[(0,d.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[(0,d.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,d.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy debug info"]})}var G=c(70162);function H(a){let b=Date.now(),c=Math.floor((b-new Date(a).getTime())/1e3);if(c<60)return`${c}s ago`;let d=Math.floor(c/60);if(d<60)return`${d}m ago`;let e=Math.floor(d/60);if(e<24)return`${e}h ago`;let f=Math.floor(e/24);return`${f}d ago`}function I(a){return a.replaceAll("_"," ")}function J(a){return null!==a}function K({session:a,mode:b,onCancel:c,onConfirm:f,onRequestKill:g,onMerge:h,isMergeReady:i=!1}){let k=(0,e.useRef)(null),m=(0,e.useRef)(null);(0,e.useRef)(null);let n=a?.pr?.number??null;if(!a)return null;let p=(0,l.Pn)(a),q=(0,j.ng)(a),r=a.summary&&!a.summaryIsFallback?a.summary:null,s="done"!==q&&"merge"!==q&&"terminated"!==a.status,t=a.pr,u=!!(t&&!(0,j.fZ)(t)&&!(0,j.sZ)(t)),v="done"===q||"terminated"===a.status||"exited"===a.activity,w=[{label:I(q),tone:"accent"},{label:I(a.status),tone:"neutral"},a.activity?{label:I(a.activity),tone:"neutral"}:null,a.branch?{label:a.branch,tone:"mono"}:null,a.pr?{label:`PR #${a.pr.number}`,tone:"neutral"}:null,a.issueLabel?{label:a.issueLabel,tone:"neutral"}:null].filter(J);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"bottom-sheet-backdrop",onClick:c,"aria-hidden":"true"}),(0,d.jsxs)("div",{ref:m,className:"bottom-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"bottom-sheet-title",onTouchStart:function(a){k.current=a.touches[0]?.clientY??null},onTouchEnd:function(a){if(null===k.current)return;let b=(a.changedTouches[0]?.clientY??0)-k.current;k.current=null,b>80&&c()},children:[(0,d.jsx)("div",{className:"bottom-sheet__handle","aria-hidden":"true"}),"confirm-kill"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"bottom-sheet__header",children:[(0,d.jsx)("h2",{id:"bottom-sheet-title",className:"bottom-sheet__title",children:"Terminate session?"}),(0,d.jsx)("p",{className:"bottom-sheet__subtitle",children:"This action cannot be undone."})]}),(0,d.jsxs)("div",{className:"bottom-sheet__session-info",children:[(0,d.jsx)("div",{className:"bottom-sheet__session-name",children:p}),(0,d.jsx)("div",{className:"bottom-sheet__session-meta",children:w.map(a=>(0,d.jsx)("span",{className:`bottom-sheet__tag bottom-sheet__tag--${a.tone}`,children:a.label},`${a.tone}-${a.label}`))}),r?(0,d.jsx)("p",{className:"bottom-sheet__summary",children:r}):null]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"bottom-sheet__preview-card",children:[(0,d.jsx)("div",{className:"bottom-sheet__preview-strip","data-level":q}),(0,d.jsxs)("div",{className:"bottom-sheet__preview-content",children:[(0,d.jsxs)("div",{className:"bottom-sheet__preview-header",children:[(0,d.jsx)("span",{className:"bottom-sheet__preview-id",children:a.id}),(0,d.jsx)("span",{className:"bottom-sheet__preview-time",children:H(a.lastActivityAt)})]}),(0,d.jsx)("h2",{id:"bottom-sheet-title",className:"bottom-sheet__title",children:p}),(0,d.jsxs)("p",{className:"bottom-sheet__subtitle",children:[I(q)," \xb7 started ",H(a.createdAt)]}),(0,d.jsxs)("div",{className:"bottom-sheet__preview-meta",children:[a.branch?(0,d.jsx)("span",{className:"bottom-sheet__preview-branch",children:a.branch}):null,t?(0,d.jsxs)("span",{className:"bottom-sheet__preview-pr",children:["#",t.number]}):null,u&&t?(0,d.jsxs)("span",{className:"bottom-sheet__preview-diff",children:[(0,d.jsxs)("span",{className:"bottom-sheet__preview-diff-add",children:["+",t.additions]})," ",(0,d.jsxs)("span",{className:"bottom-sheet__preview-diff-del",children:["-",t.deletions]})]}):null]}),u&&t?(0,d.jsxs)("div",{className:"bottom-sheet__preview-pills",children:[(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:"passing"===t.ciStatus?"CI passing":"failing"===t.ciStatus?"CI failed":"CI pending"}),(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:"approved"===t.reviewDecision?"approved":"changes_requested"===t.reviewDecision?"changes requested":"needs review"}),v?(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:I(a.status)}):null,v&&a.activity?(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:I(a.activity)}):null]}):(0,d.jsxs)("div",{className:"bottom-sheet__preview-pills",children:[(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:I(a.status)}),a.activity?(0,d.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:I(a.activity)}):null]})]})]}),r?(0,d.jsx)("p",{className:"bottom-sheet__summary",children:r}):null]}),(0,d.jsx)("div",{className:"bottom-sheet__actions",children:"confirm-kill"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--cancel",onClick:c,children:"Cancel"}),(0,d.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--danger",onClick:f,children:"Terminate"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("a",{href:(0,o.Nc)(a.projectId,a.id),className:"bottom-sheet__btn bottom-sheet__btn--primary",children:"Open session"}),i&&a.pr&&h?(0,d.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--secondary",onClick:()=>{null!==n&&h(n)},children:"Merge"}):s&&g?(0,d.jsxs)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--danger",onClick:g,children:[(0,d.jsxs)("svg",{className:"bottom-sheet__btn-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M3 6h18"}),(0,d.jsx)("path",{d:"M8 6V4h8v2"}),(0,d.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,d.jsx)("path",{d:"M10 11v6M14 11v6"})]}),"Terminate"]}):null]})})]})]})}let L=["working","pending","action","merge"],M=["working","pending","review","respond","merge"],N=[];function O({session:a,onRestore:b}){let c=!a.summaryIsFallback&&a.summary||a.issueTitle||a.summary||a.id,e=a.pr?.state==="merged"||"merged"===a.status,f="killed"===a.status||"terminated"===a.status,g=!j.N_.has(a.status),h=`done-card__badge ${f?"done-card__badge--terminated":"done-card__badge--merged"}`;return(0,d.jsxs)("div",{className:"done-card",children:[(0,d.jsx)("p",{className:"done-card__title",children:c}),(0,d.jsxs)("div",{className:"done-card__meta",children:[(0,d.jsx)("span",{className:h,children:e?"merged":f?"terminated":"done"}),a.pr?(0,d.jsxs)("a",{href:a.pr.url,target:"_blank",rel:"noopener noreferrer",className:"done-card__pr",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,d.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,d.jsx)("path",{d:"M6 9v3a6 6 0 0 0 6 6h3"})]}),"#",a.pr.number]}):null,(0,d.jsx)("span",{className:"done-card__age",children:function(a){if(!a)return"just now";let b=new Date(a).getTime();if(!Number.isFinite(b))return"just now";let c=Date.now()-b;if(c<=0)return"just now";let d=Math.floor(c/1e3),e=Math.floor(d/60),f=Math.floor(e/60),g=Math.floor(f/24);return d<60?`${d}s ago`:e<60?`${e}m ago`:f<24?`${f}h ago`:`${g}d ago`}(a.lastActivityAt)}),g&&!e?(0,d.jsx)("button",{type:"button",className:"done-card__restore",onClick:c=>{c.stopPropagation(),b(a.id)},children:"Restore"}):null]})]})}function P({initialSessions:a,projectId:b,projectName:c,projects:f=[],orchestrators:k,attentionZones:l="simple",dashboardLoadError:m}){let n=(0,x.eT)(),p="detailed"===l?M:L,q=(0,e.useMemo)(()=>{let b={};for(let c of a)b[c.id]=(0,j.ng)(c,l);return b},[a,l]),{sessions:r,attentionLevels:t,liveSessionsResolved:u,loadError:z}=(0,w.D)({initialSessions:a,muxSessions:n?.status==="connected"?n.sessions:void 0,muxLastError:n?.lastError,initialAttentionLevels:q,attentionZones:l}),E=(0,e.useMemo)(()=>b?r.filter(a=>a.projectId===b):r,[r,b]),H=n?.status==="disconnected"?"disconnected":n?.status==="connected"?"connected":"reconnecting",I=z??(m&&u?void 0:m),J=(0,h.useSearchParams)(),P=(0,h.useRouter)(),Q=(0,e.useRef)(P);Q.current=P;let S=J.get("session")??void 0,[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(k??N),[X,Y]=(0,e.useState)([]),[Z,$]=(0,e.useState)({}),[_,aa]=(0,e.useState)(!1),[ab,ac]=(0,e.useState)(!1),ad=(0,i.U)(i.D),[ae,af]=(0,e.useState)(()=>new Set(["done","working"])),[ag,ah]=(0,e.useState)(null),[ai,aj]=(0,e.useState)("preview"),ak=J.get("debug"),al=!ad&&("1"===ak||"true"===ak),{showToast:am}=(0,B.d)(),[an,ao]=(0,e.useState)(!1),ap=(0,e.useRef)(r);ap.current=r;let aq=f.length>1&&void 0===b,ar=(0,e.useMemo)(()=>b?V.find(a=>a.projectId===b)??null:null,[V,b]),as=ar?(0,o.Nc)(ar.projectId,ar.id):null,at=!aq&&!!b&&f.some(a=>a.id===b&&!a.resolveError)&&!as,au=b?f.find(a=>a.id===b)??null:null,av=!!b&&X.includes(b),aw=b?Z[b]??null:null,ax=(0,e.useMemo)(()=>aq||!S?E:E.filter(a=>a.id===S),[E,aq,S]),ay=(0,e.useMemo)(()=>{let a={merge:[],action:[],respond:[],review:[],pending:[],working:[],done:[]};for(let b of ax)a[(0,j.ng)(b,l)].push(b);return a},[ax,l]),az=(0,e.useMemo)(()=>{let a=new Map;for(let b of r){let c=a.get(b.projectId);if(c){c.push(b);continue}a.set(b.projectId,[b])}return a},[r]),aA=(0,e.useMemo)(()=>aq?f.map(a=>{let b=az.get(a.id)??[],c={merge:0,action:0,respond:0,review:0,pending:0,working:0,done:0};for(let a of b)c[(0,j.ng)(a,l)]++;return{project:a,orchestrator:V.find(b=>b.projectId===a.id)??null,sessionCount:b.length,openPRCount:b.filter(a=>a.pr?.state==="open").length,counts:c}}):[],[V,aq,l,f,az]),aB=(0,e.useCallback)(async(a,b)=>{try{let c=await fetch(`/api/sessions/${encodeURIComponent(a)}/send`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:b})});if(!c.ok){let b=await c.text()||"Unknown error";console.error(`Failed to send message to ${a}:`,b),am(`Send failed: ${b}`,"error");let d=Error(b);throw d.toastShown=!0,d}}catch(b){throw b instanceof Error&&"toastShown"in b&&b.toastShown||(console.error(`Network error sending message to ${a}:`,b),am("Network error while sending message","error")),b}},[am]),aC=(0,e.useCallback)(async a=>{try{let b=await fetch(`/api/sessions/${encodeURIComponent(a)}/kill`,{method:"POST"});if(b.ok)am("Session terminated","success");else{let c=await b.text();console.error(`Failed to kill ${a}:`,c),am(`Terminate failed: ${c}`,"error")}}catch(b){console.error(`Network error killing ${a}:`,b),am("Network error while terminating session","error")}},[am]),aD=(0,e.useCallback)(a=>{let b=ap.current.find(b=>b.id===a)??null;b&&aC(b.id)},[aC]),aE=(0,e.useCallback)(a=>{ah(a),aj("preview")},[]),aF=(0,e.useCallback)(()=>{aj("confirm-kill")},[]),aG=(0,e.useCallback)(()=>{ah(null),aj("preview")},[]),aH=(0,e.useCallback)(()=>{ag&&aC(ag.id),ah(null),aj("preview")},[ag,aC]),aI=(0,e.useCallback)(async a=>{try{let b=await fetch(`/api/prs/${a}/merge`,{method:"POST"});if(b.ok)am(`PR #${a} merged`,"success");else{let c=await b.text();console.error(`Failed to merge PR #${a}:`,c),am(`Merge failed: ${c}`,"error");return}}catch(b){console.error(`Network error merging PR #${a}:`,b),am("Network error while merging PR","error")}},[am]),aJ=(0,e.useCallback)(async a=>{try{let b=await fetch(`/api/sessions/${encodeURIComponent(a)}/restore`,{method:"POST"});if(b.ok)am("Session restored","success"),Q.current.refresh();else{let c=await b.text();console.error(`Failed to restore ${a}:`,c),am(`Restore failed: ${c}`,"error")}}catch(b){console.error(`Network error restoring ${a}:`,b),am("Network error while restoring session","error")}},[am]),aK=async a=>{Y(b=>b.includes(a.id)?b:[...b,a.id]),$(({[a.id]:b,...c})=>c);try{let b=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:a.id})}),c=await b.json().catch(()=>null);if(!b.ok||!c?.orchestrator)throw Error(c?.error??`Failed to spawn orchestrator for ${a.name}`);let d=c.orchestrator;W(b=>{let c=b.filter(b=>b.projectId!==a.id);return c.push(d),c})}catch(c){let b=c instanceof Error?c.message:"Failed to spawn orchestrator";$(c=>({...c,[a.id]:b})),console.error(`Failed to spawn orchestrator for ${a.id}:`,c)}finally{Y(b=>b.filter(b=>b!==a.id))}},aL=p.some(a=>ay[a].length>0),aM=!aq&&!aL&&!I,aN=I?(0,d.jsxs)("div",{className:"dashboard-alert mb-6 flex flex-col gap-1.5 border border-[color-mix(in_srgb,var(--color-status-error)_28%,transparent)] bg-[color-mix(in_srgb,var(--color-status-error)_10%,transparent)] px-3.5 py-2.5 text-[11px] md:mb-4",role:"alert","aria-live":"assertive",children:[(0,d.jsx)("span",{className:"font-semibold text-[var(--color-status-error)]",children:"Orchestrator failed to load"}),(0,d.jsx)("span",{className:"break-words text-[var(--color-text-secondary)]",children:I}),(0,d.jsxs)("span",{className:"text-[var(--color-text-secondary)]",children:["Confirm ",(0,d.jsx)("span",{className:"font-mono text-[10px]",children:"agent-orchestrator.yaml"})," exists and is valid, then run ",(0,d.jsx)("span",{className:"font-mono text-[10px]",children:"ao doctor"})," for diagnostics."]})]}):null,aO=(0,e.useMemo)(()=>r.some(a=>a.pr&&(0,j.fZ)(a.pr)),[r]),aP="agent orchestrator"===c?.trim().toLowerCase()?b??c??(aq?"All projects":"Dashboard"):c??(aq?"All projects":"Dashboard"),aQ=!aq&&aP.trim().length>0,aR=a=>{af(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},aS=()=>{aa(a=>!a)};return(0,d.jsx)(G.I.Provider,{value:{onToggleSidebar:aS,mobileSidebarOpen:ab},children:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(D,{}),(0,d.jsx)(C,{status:H}),(0,d.jsxs)("div",{className:"dashboard-app-shell",children:[(0,d.jsxs)("header",{className:"dashboard-app-header",children:[(0,d.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:aS,"aria-label":"Toggle sidebar",children:ad?(0,d.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,d.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,d.jsx)("path",{d:"M9 3v18"})]})}),(0,d.jsxs)("div",{className:"dashboard-app-header__brand",children:[(0,d.jsx)("span",{className:"dashboard-app-header__brand-dot","aria-hidden":"true"}),(0,d.jsx)("span",{children:"Agent Orchestrator"})]}),aQ?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"dashboard-app-header__sep","aria-hidden":"true"}),(0,d.jsx)("span",{className:"dashboard-app-header__project",children:aP})]}):null,al?(0,d.jsx)(F,{projectId:b}):null,(0,d.jsx)("div",{className:"dashboard-app-header__spacer"}),(0,d.jsx)("div",{className:"dashboard-app-header__actions",children:!aq&&as?(0,d.jsxs)(g(),{href:as,className:"dashboard-app-btn dashboard-app-btn--amber","aria-label":"Orchestrator",children:[(0,d.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,d.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,d.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Orchestrator"]}):at&&au?(0,d.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--amber","aria-label":"Spawn Orchestrator",onClick:()=>void aK(au),disabled:av,children:[(0,d.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,d.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,d.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),av?"Spawning...":"Spawn Orchestrator"]}):null})]}),(0,d.jsxs)("div",{className:`dashboard-shell dashboard-shell--desktop${_?" dashboard-shell--sidebar-collapsed":""}`,children:[(0,d.jsx)("div",{className:`sidebar-wrapper${ab?" sidebar-wrapper--mobile-open":""}`,children:(0,d.jsx)(y.u,{projects:f,sessions:r,orchestrators:V,activeProjectId:b,activeSessionId:S,collapsed:_,onToggleCollapsed:()=>aa(a=>!a),onMobileClose:()=>ac(!1)})}),ab&&(0,d.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>ac(!1)}),(0,d.jsxs)("main",{className:"dashboard-main dashboard-main--desktop",children:[(0,d.jsx)(v.u,{attentionLevels:t,projectName:c}),(0,d.jsxs)("div",{className:"dashboard-main__subhead",children:[(0,d.jsx)("h1",{className:"dashboard-main__title",children:"Dashboard"}),(0,d.jsx)("p",{className:"dashboard-main__subtitle",children:"Live agent sessions, pull requests, and merge status."})]}),(0,d.jsxs)("div",{className:"dashboard-main__body",children:[aN,aO&&!T&&(0,d.jsxs)("div",{className:"dashboard-alert mb-4 flex items-center gap-2.5 border border-[color-mix(in_srgb,var(--color-status-attention)_25%,transparent)] bg-[var(--color-tint-yellow)] px-3.5 py-2.5 text-[11px] text-[var(--color-status-attention)]",children:[(0,d.jsxs)("svg",{className:"h-3.5 w-3.5 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,d.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),(0,d.jsx)("span",{className:"flex-1",children:"GitHub API rate limited — PR data (CI status, review state, sizes) may be stale. Will retry automatically on next refresh."}),(0,d.jsx)("button",{onClick:()=>U(!0),className:"ml-1 shrink-0 opacity-60 hover:opacity-100","aria-label":"Dismiss",children:(0,d.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),aq&&(0,d.jsx)(R,{overviews:aA,onSpawnOrchestrator:aK,spawningProjectIds:X,spawnErrors:Z,attentionZones:l}),!aq&&aL&&(0,d.jsx)("div",{className:"kanban-board-wrap",children:(0,d.jsx)("div",{className:"kanban-board","data-columns":p.length,style:{"--kanban-column-count":p.length},children:p.map(a=>(0,d.jsx)(s,{level:a,sessions:ay[a],onSend:aB,onKill:aD,onMerge:aI,onRestore:aJ,compactMobile:ad,collapsed:ad&&ae.has(a),onToggle:ad?aR:void 0,onPreview:ad?aE:void 0},a))})}),aM?(0,d.jsx)(A,{orchestratorHref:as,onSpawnOrchestrator:at&&au?()=>{aK(au)}:null,spawnLabel:av?"Spawning...":"Spawn Orchestrator",spawnDisabled:av}):null,!aq&&aw?(0,d.jsx)("p",{className:"mt-3 text-[11px] text-[var(--color-status-error)]",children:aw}):null,!aq&&ay.done.length>0&&(0,d.jsxs)("div",{className:"done-bar mt-6",children:[(0,d.jsxs)("button",{type:"button",className:"done-bar__toggle",onClick:()=>ao(a=>!a),"aria-expanded":an,children:[(0,d.jsx)("svg",{className:`done-bar__chevron${an?" done-bar__chevron--open":""}`,fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m9 18 6-6-6-6"})}),(0,d.jsx)("span",{className:"done-bar__label",children:"Done / Terminated"}),(0,d.jsx)("span",{className:"done-bar__count",children:ay.done.length})]}),an&&(0,d.jsx)("div",{className:"done-bar__cards",children:ay.done.map(a=>(0,d.jsx)(O,{session:a,onRestore:aJ},a.id))})]})]})]})]})]}),(0,d.jsx)(K,{session:ag,mode:ai,onCancel:aG,onConfirm:aH,onRequestKill:aF,onMerge:aI,isMergeReady:!!ag&&"merge"===t[ag.id]})]})})}function Q(a){return(0,d.jsx)(B.t,{children:(0,d.jsx)(P,{...a})})}function R({overviews:a,onSpawnOrchestrator:b,spawningProjectIds:c,spawnErrors:e,attentionZones:f}){return(0,d.jsx)("div",{className:"mb-8 grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:a.map(({project:a,orchestrator:h,sessionCount:i,openPRCount:j,counts:k})=>(()=>{let l=!!a.resolveError,m=(0,o.bn)(a.id);return(0,d.jsxs)("section",{className:"border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] p-4",children:[(0,d.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-[14px] font-semibold text-[var(--color-text-primary)]",children:a.name}),(0,d.jsx)("div",{className:"mt-1 text-[11px] text-[var(--color-text-muted)]",children:l?"Config needs repair":(0,d.jsxs)(d.Fragment,{children:[i," active session",1!==i?"s":"",j>0?` \xb7 ${j} open PR${1!==j?"s":""}`:""]})})]}),(0,d.jsx)(g(),{href:m,className:"border border-[var(--color-border-default)] px-3 py-1.5 text-[11px] font-medium text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:no-underline",children:"Open project"})]}),(0,d.jsxs)("div",{className:"mb-4 flex flex-wrap gap-2",children:[(0,d.jsx)(S,{label:"Merge",value:k.merge,tone:"ready"}),"detailed"===f?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(S,{label:"Respond",value:k.respond,tone:"error"}),(0,d.jsx)(S,{label:"Review",value:k.review,tone:"orange"})]}):(0,d.jsx)(S,{label:"Action",value:k.action,tone:"orange"}),(0,d.jsx)(S,{label:"Pending",value:k.pending,tone:"attention"}),(0,d.jsx)(S,{label:"Working",value:k.working,tone:"working"})]}),(0,d.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,d.jsx)("div",{className:"text-[11px] text-[var(--color-text-muted)]",children:l?"Project config could not be resolved":h?"Per-project orchestrator available":"No running orchestrator"}),l?(0,d.jsx)(g(),{href:m,className:"border border-[var(--color-border-default)] px-3 py-1.5 text-[11px] font-semibold text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:no-underline",children:"Repair project"}):h?(0,d.jsxs)(g(),{href:(0,o.Nc)(h.projectId,h.id),className:"orchestrator-btn flex items-center gap-2 px-3 py-1.5 text-[11px] font-semibold hover:no-underline",children:[(0,d.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--color-accent)] opacity-80"}),"orchestrator"]}):(0,d.jsx)("button",{type:"button",onClick:()=>void b(a),disabled:c.includes(a.id),className:"orchestrator-btn px-3 py-1.5 text-[11px] font-semibold disabled:cursor-wait disabled:opacity-70",children:c.includes(a.id)?"Spawning...":"Spawn Orchestrator"})]}),e[a.id]?(0,d.jsx)("p",{className:"mt-2 text-[11px] text-[var(--color-status-error)]",children:e[a.id]}):null]})]},a.id)})())})}function S({label:a,value:b,tone:c}){return(0,d.jsxs)("div",{className:"min-w-[78px] border border-[var(--color-border-subtle)] px-2.5 py-2",children:[(0,d.jsx)("div",{className:"text-[10px] uppercase tracking-[0.08em] text-[var(--color-text-tertiary)]",children:a}),(0,d.jsx)("div",{className:"project-metric__value mt-1 text-[18px] font-semibold tabular-nums","data-tone":c,children:b})]})}},13219:(a,b,c)=>{c.d(b,{Dashboard:()=>d});let d=(0,c(10864).registerClientReference)(function(){throw Error("Attempted to call Dashboard() from the server but Dashboard is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/tmp/ao-publish-work/packages/web/src/components/Dashboard.tsx","Dashboard")},70162:(a,b,c)=>{c.d(b,{I:()=>d});let d=(0,c(81115).createContext)(null)}};
|
|
@@ -6,4 +6,4 @@ Description: ${v(c,7500)}
|
|
|
6
6
|
|
|
7
7
|
Resolve the comment at ${a.url} after fixing it.`;return v(d,9500)}(b),e=await fetch(`/api/sessions/${encodeURIComponent(a)}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:d})});if(!e.ok)throw Error(`HTTP ${e.status}`);c()}catch(a){console.error("Failed to send message to agent:",a),d()}}function x({zones:a}){let b=[{value:a.merge,label:"merge",toneClass:"topbar-zone-pill--merge"},{value:a.respond,label:"respond",toneClass:"topbar-zone-pill--respond"},{value:a.review,label:"review",toneClass:"topbar-zone-pill--review"},{value:a.working,label:"working",toneClass:"topbar-zone-pill--working"},{value:a.pending,label:"pending",toneClass:"topbar-zone-pill--pending"},{value:a.done,label:"done",toneClass:"topbar-zone-pill--done"}].filter(a=>a.value>0);return 0===b.length?null:(0,d.jsx)(d.Fragment,{children:b.map(a=>(0,d.jsxs)("span",{className:(0,p.cn)("topbar-zone-pill",a.toneClass),children:[(0,d.jsx)("span",{className:"topbar-zone-pill__value",children:a.value}),(0,d.jsx)("span",{className:"topbar-zone-pill__label",children:a.label})]},a.label))})}function y({session:a,isOrchestrator:b,isMobile:c,terminalEnded:f,isRestorable:h,activity:j,headline:k,projects:l,orchestratorHref:m,orchestratorZones:n,onToggleSidebar:o,onRestore:q,onKill:r}){let s=a.pr,t=!!s&&(0,i.QN)(s),[v,y]=(0,e.useState)(!1),z=(0,e.useRef)(null),A=l.find(b=>b.id===a.projectId)?.name??a.projectId,B="agent orchestrator"!==A.trim().toLowerCase();return(0,d.jsxs)("header",{className:"dashboard-app-header",children:[l.length>0?(0,d.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:o,"aria-label":"Toggle sidebar",children:c?(0,d.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,d.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,d.jsx)("path",{d:"M9 3v18"})]})}):null,(0,d.jsx)("div",{className:"dashboard-app-header__brand dashboard-app-header__brand--hide-mobile",children:(0,d.jsx)("span",{children:"Agent Orchestrator"})}),B&&(0,d.jsx)("span",{className:"dashboard-app-header__sep topbar-desktop-only","aria-hidden":"true"}),(0,d.jsxs)("div",{className:"topbar-project-pills-group",children:[(0,d.jsxs)("div",{className:"topbar-project-line",children:[B&&(0,d.jsx)("span",{className:"dashboard-app-header__project",children:A}),(0,d.jsx)("span",{className:"dashboard-app-header__session-id topbar-mobile-only",children:a.id}),b&&(0,d.jsx)("span",{className:"session-detail-mode-badge",children:"orchestrator"})]}),(0,d.jsxs)("div",{className:"topbar-session-pills",children:[(0,d.jsxs)("div",{className:(0,p.cn)("topbar-status-pill",`topbar-status-pill--${j.label.toLowerCase().replace(/\s+/g,"-")}`),children:[(0,d.jsx)("span",{className:"topbar-status-pill__dot",style:{background:j.color}}),(0,d.jsx)("span",{className:"topbar-status-pill__label",children:j.label})]}),a.branch?s?(0,d.jsx)("a",{href:function(a){let b="https://github.com";try{b=new URL(a.url).origin}catch{}return`${b}/${a.owner}/${a.repo}/tree/${a.branch}`}(s),target:"_blank",rel:"noopener noreferrer",className:"topbar-branch-pill topbar-branch-pill--link",children:a.branch}):(0,d.jsx)("span",{className:"topbar-branch-pill",children:a.branch}):null,b&&n?(0,d.jsx)(x,{zones:n}):null]})]}),(0,d.jsx)("span",{className:"dashboard-app-header__sep topbar-desktop-only","aria-hidden":"true"}),(0,d.jsx)("span",{className:"dashboard-app-header__session-title topbar-desktop-only",children:k}),(0,d.jsx)("span",{className:"dashboard-app-header__session-id topbar-desktop-only",children:a.id}),(0,d.jsx)("div",{className:"dashboard-app-header__spacer"}),(0,d.jsxs)("div",{className:"dashboard-app-header__actions",children:[s?(0,d.jsxs)("div",{className:"topbar-pr-btn-wrap",ref:z,children:[(0,d.jsxs)("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:(0,p.cn)("dashboard-app-btn topbar-pr-btn",v&&"topbar-pr-btn--open"),onClick:a=>{a.metaKey||a.ctrlKey||a.shiftKey||1===a.button||(a.preventDefault(),y(a=>!a))},"aria-expanded":v,"aria-label":`PR #${s.number}`,children:[(0,d.jsx)("span",{className:(0,p.cn)("topbar-pr-dot",t?"topbar-pr-dot--green":s.ciStatus===g.U1.FAILING||"changes_requested"===s.reviewDecision?"topbar-pr-dot--red":"topbar-pr-dot--amber")}),"PR #",s.number,(0,d.jsx)("svg",{width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:v?"M18 15l-6-6-6 6":"M6 9l6 6 6-6"})})]}),v&&(0,d.jsx)("div",{className:"topbar-pr-popover",children:(0,d.jsx)(u,{pr:s,metadata:a.metadata,lifecyclePrReason:a.lifecycle?.prReason??void 0,onAskAgentToFix:(b,c,d)=>w(a.id,b,c,d)})})]}):null,h?(0,d.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--restore",onClick:q,children:[(0,d.jsxs)("svg",{className:"topbar-action-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,d.jsx)("path",{d:"M20 11a8 8 0 0 0-14.9-3.98"}),(0,d.jsx)("path",{d:"M4 5v4h4"}),(0,d.jsx)("path",{d:"M4 13a8 8 0 0 0 14.9 3.98"}),(0,d.jsx)("path",{d:"M20 19v-4h-4"})]}),(0,d.jsx)("span",{className:"topbar-btn-label",children:"Restore"})]}):b||f?null:(0,d.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--danger",onClick:r,children:[(0,d.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})}),(0,d.jsx)("span",{className:"topbar-btn-label",children:"Kill"})]}),m?(0,d.jsxs)("a",{href:m,className:"dashboard-app-btn dashboard-app-btn--amber topbar-desktop-only","aria-label":"Orchestrator",children:[(0,d.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,d.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,d.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,d.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),(0,d.jsx)("span",{className:"topbar-btn-label",children:"Orchestrator"})]}):null]})]})}function z({session:a,headline:b,pr:c,dashboardHref:e}){let f=a.lifecycle?.runtime.reasonLabel?a.lifecycle.runtime.reasonLabel:"killed"===a.status?"Manually stopped":"terminated"===a.status?"Runtime unavailable":"done"===a.status||"merged"===a.status?"Work completed":"Terminal ended",g=function(a,b){let c=a.metadata.pinnedSummary;return c||(a.summary&&!a.summaryIsFallback?a.summary:a.lifecycle?.summary?a.lifecycle.summary:a.userPrompt?a.userPrompt:a.summary?a.summary:b)}(a,b),h=a.lifecycle?.session.terminatedAt??a.lifecycle?.session.completedAt??a.lifecycle?.session.lastTransitionAt??a.lastActivityAt,i=a.lifecycle?.runtime.label??"Unavailable",j=c?"merged"===c.state?"Merged":"closed"===c.state?"Closed":c.mergeability.mergeable?"Open, merge-ready":"Open":"No PR";return(0,d.jsx)("section",{className:"session-ended-summary","aria-label":"Session ended summary",children:(0,d.jsxs)("div",{className:"session-ended-summary__panel",children:[(0,d.jsx)("div",{className:"session-ended-summary__eyebrow",children:"Terminal ended"}),(0,d.jsxs)("div",{className:"session-ended-summary__header",children:[(0,d.jsx)("div",{className:"session-ended-summary__icon","aria-hidden":"true",children:(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:[(0,d.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"3"}),(0,d.jsx)("path",{d:"M7 10l3 2-3 2"}),(0,d.jsx)("path",{d:"M13 15h4"})]})}),(0,d.jsxs)("div",{className:"session-ended-summary__title-group",children:[(0,d.jsx)("h2",{className:"session-ended-summary__title",children:b}),(0,d.jsxs)("p",{className:"session-ended-summary__subtitle",children:[f,". The live terminal is gone, but the session context is still available."]})]})]}),(0,d.jsxs)("div",{className:"session-ended-summary__body",children:[(0,d.jsxs)("div",{className:"session-ended-summary__section",children:[(0,d.jsx)("div",{className:"session-ended-summary__label",children:"What happened"}),(0,d.jsx)("p",{className:"session-ended-summary__copy",children:g})]}),(0,d.jsxs)("div",{className:"session-ended-summary__facts","aria-label":"Session facts",children:[(0,d.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,d.jsx)("span",{children:"Session"}),(0,d.jsx)("strong",{children:a.id})]}),(0,d.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,d.jsx)("span",{children:"Ended"}),(0,d.jsx)("strong",{children:function(a){if(!a)return"Unknown";let b=new Date(a).getTime();return Number.isFinite(b)?(0,k.fw)(b):"Unknown"}(h)})]}),(0,d.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,d.jsx)("span",{children:"Runtime"}),(0,d.jsx)("strong",{children:i})]}),(0,d.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,d.jsx)("span",{children:"PR"}),(0,d.jsx)("strong",{children:j})]})]}),(0,d.jsxs)("div",{className:"session-ended-summary__links",children:[c?(0,d.jsxs)("a",{href:c.url,target:"_blank",rel:"noopener noreferrer",className:"session-ended-summary__primary",children:["Open PR #",c.number]}):null,(0,d.jsx)("a",{href:e,className:"session-ended-summary__secondary",children:"Back to dashboard"})]}),a.lifecycle?.evidence?(0,d.jsxs)("div",{className:"session-ended-summary__evidence",children:[(0,d.jsx)("span",{children:"Evidence"}),(0,d.jsx)("code",{children:a.lifecycle.evidence})]}):null]})]})})}let A=(0,j.default)(async()=>{},{loadableGenerated:{modules:["components/SessionDetail.tsx -> ./DirectTerminal"]},ssr:!1,loading:()=>(0,d.jsx)("div",{className:"h-full w-full animate-pulse rounded bg-[var(--color-bg-primary)]"})});function B({session:a,isOrchestrator:b=!1,orchestratorZones:c,projectOrchestratorId:g=null,projects:j=[],sidebarSessions:p=[],sidebarOrchestrators:r,sidebarLoading:s=!1,sidebarError:t=!1,onRetrySidebar:u}){let v=(0,f.useRouter)(),w=(0,f.useSearchParams)(),x=(0,h.U)(h.D),B="true"===w.get("fullscreen"),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),I=a.pr,J=i.CM.has(a.status),K=J&&!i.N_.has(a.status),L=(a.activity&&q[a.activity])??{label:a.activity??"unknown",color:"var(--color-text-muted)"},M=(0,k.Pn)(a),N=b?"orchestrator":"agent",O="opencode"===a.metadata.agent,P="string"==typeof a.metadata.opencodeSessionId&&a.metadata.opencodeSessionId.length>0?a.metadata.opencodeSessionId:void 0,Q=P?`/exit
|
|
8
8
|
opencode --session ${P}
|
|
9
|
-
`:void 0,R=a.projectId?(0,m.bn)(a.projectId):"/",S=(0,e.useCallback)(async()=>{try{let b=await fetch(`/api/sessions/${encodeURIComponent(a.id)}/kill`,{method:"POST"});if(!b.ok)throw Error(`HTTP ${b.status}`);if(g)return void v.push((0,m.Nc)(a.projectId,g));v.push(R)}catch(a){console.error("Failed to kill session:",a)}},[R,g,v,a.id,a.projectId]),T=(0,e.useCallback)(async()=>{try{let b=await fetch(`/api/sessions/${encodeURIComponent(a.id)}/restore`,{method:"POST"});if(!b.ok){let a=await b.text().catch(()=>"");throw Error(a||`HTTP ${b.status}`)}window.location.reload()}catch(a){console.error("Failed to restore session:",a)}},[a.id]),U=(0,e.useMemo)(()=>b?(0,m.Nc)(a.projectId,a.id):g?(0,m.Nc)(a.projectId,g):null,[b,g,a.id,a.projectId]),V=(0,e.useCallback)(()=>{x?F(a=>!a):D(a=>!a)},[x]);return(0,d.jsx)(l.I.Provider,{value:{onToggleSidebar:V,mobileSidebarOpen:E},children:(0,d.jsxs)("div",{className:"dashboard-app-shell",children:[(0,d.jsx)(y,{session:a,isOrchestrator:b,isMobile:x,terminalEnded:J,isRestorable:K,activity:L,headline:M,projects:j,orchestratorHref:U,orchestratorZones:c,onToggleSidebar:V,onRestore:T,onKill:S}),(0,d.jsxs)("div",{className:`dashboard-shell dashboard-shell--desktop${C?" dashboard-shell--sidebar-collapsed":""}`,children:[j.length>0?(0,d.jsx)("div",{className:`sidebar-wrapper${E?" sidebar-wrapper--mobile-open":""}`,children:(0,d.jsx)(n.u,{projects:j,sessions:p,orchestrators:r,loading:s,error:t,onRetry:u,activeProjectId:a.projectId,activeSessionId:a.id,collapsed:C,onToggleCollapsed:()=>D(a=>!a),onMobileClose:()=>F(!1)})}):null,E&&(0,d.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>F(!1)}),(0,d.jsx)("div",{className:"dashboard-main dashboard-main--desktop",children:(0,d.jsx)("main",{className:"session-detail-page flex-1 min-h-0 flex flex-col bg-[var(--color-bg-base)]",children:(0,d.jsx)("div",{className:"flex-1 min-h-0 flex flex-col",children:G?J?(0,d.jsx)(z,{session:a,headline:M,pr:I,dashboardHref:R}):(0,d.jsx)(A,{sessionId:a.id,projectId:a.projectId,tmuxName:a.metadata?.tmuxName,startFullscreen:B,variant:N,appearance:"dark",height:"100%",isOpenCodeSession:O,reloadCommand:O?Q:void 0,autoFocus:!0}):(0,d.jsx)("div",{className:"session-detail-terminal-placeholder h-full"})})})})]}),(0,d.jsx)(o.X,{ariaLabel:"Session navigation",activeTab:b?"orchestrator":void 0,dashboardHref:R,prsHref:a.projectId?`/?project=${encodeURIComponent(a.projectId)}&tab=prs`:"/",showOrchestrator:!!U,orchestratorHref:U})]})})}var C=c(23041),D=c(58976),E=c(20902);let F=null,G=null,H=new Set(Object.values(g.SB)),I=new Set(Object.values(g.u3)),J=new Set;function K(a){if(a instanceof DOMException)return"AbortError"===a.name;if(a instanceof Error){let b=a.message.toLowerCase();return b.includes("aborted")||b.includes("aborterror")}return!1}function L({message:a}){return(0,d.jsx)("div",{className:"project-sidebar h-full",children:(0,d.jsxs)("div",{className:"space-y-3 px-3 py-4",children:[(0,d.jsx)("div",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-[var(--color-text-tertiary)]",children:"Projects"}),(0,d.jsx)("div",{className:"space-y-2",children:Array.from({length:3},(a,b)=>(0,d.jsx)("div",{className:"h-10 animate-pulse border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)]"},`sidebar-placeholder-${b}`))}),(0,d.jsx)("div",{className:"pt-2 text-[12px] text-[var(--color-text-tertiary)]",children:a})]})})}function M({projects:a,projectsLoading:b,sidebarSessions:c,sidebarOrchestrators:f,sidebarLoading:g,sidebarError:i,onRetrySidebar:j,activeProjectId:k,activeSessionId:l,children:m}){let o=(0,h.U)(h.D),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),t=(0,e.useCallback)(()=>{if(o)return void s(a=>!a);q(a=>!a)},[o]);return(0,d.jsxs)("div",{className:"dashboard-app-shell",children:[(0,d.jsxs)("header",{className:"dashboard-app-header",children:[(0,d.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:t,"aria-label":"Toggle sidebar",children:o?(0,d.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,d.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,d.jsx)("path",{d:"M9 3v18"})]})}),(0,d.jsx)("div",{className:"dashboard-app-header__brand",children:(0,d.jsx)("span",{children:"Agent Orchestrator"})}),(0,d.jsx)("div",{className:"dashboard-app-header__spacer"})]}),(0,d.jsxs)("div",{className:`dashboard-shell dashboard-shell--desktop${p?" dashboard-shell--sidebar-collapsed":""}`,children:[(0,d.jsx)("div",{className:`sidebar-wrapper${r?" sidebar-wrapper--mobile-open":""}`,children:a.length>0?(0,d.jsx)(n.u,{projects:a,sessions:c,orchestrators:f,loading:g,error:i,onRetry:j,activeProjectId:k,activeSessionId:l,collapsed:p,onToggleCollapsed:()=>q(a=>!a),onMobileClose:()=>s(!1)}):(0,d.jsx)(L,{message:b?"Loading projects...":"Projects unavailable."})}),r&&(0,d.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>s(!1)}),(0,d.jsx)("div",{className:"dashboard-main dashboard-main--desktop",children:(0,d.jsx)("main",{className:"session-detail-page flex-1 min-h-0 flex flex-col bg-[var(--color-bg-base)]",children:(0,d.jsx)("div",{className:"flex-1 min-h-0",children:m})})})]})]})}function N(){let a=(0,f.useParams)();(0,f.usePathname)(),(0,f.useRouter)();let b=a.id,c="string"==typeof a.projectId?a.projectId:Array.isArray(a.projectId)?a.projectId[0]:null;(0,D.eT)();let h=(()=>{if("undefined"==typeof sessionStorage)return null;try{let a=sessionStorage.getItem(`ao-session-nav:${b}`);if(a)return sessionStorage.removeItem(`ao-session-nav:${b}`),JSON.parse(a)}catch{}return null})(),[j,k]=(0,e.useState)(h),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(void 0),[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(null===F),[t,u]=(0,e.useState)(()=>G),[v,w]=(0,e.useState)(void 0),[x,y]=(0,e.useState)(null===h),[z,A]=(0,e.useState)(null),[L,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)(new Map);j?.projectId;let S=[...Q.values()],T=!!j&&(0,g.tT)(j,Q.get(j.projectId),S),U=(0,e.useRef)(null),V=(0,e.useRef)(!1),W=(0,e.useRef)(null),X=(0,e.useRef)(new Map),Y=(0,e.useRef)(null!==h),Z=(0,e.useRef)(null),$=(0,e.useRef)(!1),_=(0,e.useRef)(!1),aa=(0,e.useRef)(!1),ab=(0,e.useRef)(null),ac=(0,e.useRef)(null),ad=(0,e.useRef)(null),ae=(0,e.useRef)(!1),af=(0,e.useCallback)(async()=>{F&&(q(F),R(new Map(F.map(a=>[a.id,a.sessionPrefix??a.id]))),s(!1));try{var a,b;let c=await (0,E.u)("/api/projects",{timeoutMs:5e3,timeoutMessage:"Projects request timed out after 5000ms"});if(!c?.projects)return;a=F,b=c.projects,a&&a.length===b.length&&a.every((a,c)=>{let d=b[c];return JSON.stringify(a)===JSON.stringify(d)})||(F=c.projects,q(c.projects),R(new Map(c.projects.map(a=>[a.id,a.sessionPrefix??a.id]))))}catch(a){console.error("Failed to fetch projects:",a)}finally{s(!1)}},[]);var ag=b;let ah=(0,D.eT)(),ai=ah?.sessions.find(a=>a.id===ag);(0,e.useMemo)(()=>ai?{activity:ai.activity??null}:null,[ai]);let aj=(0,e.useCallback)(async()=>{if($.current)return;$.current=!0;let a=new AbortController;ab.current=a;try{let c=await (0,E.u)(`/api/sessions/${encodeURIComponent(b)}`,{signal:a.signal,timeoutMs:8e3,timeoutMessage:"Session request timed out after 8000ms"});k(c),A(null),N(!1),Y.current=!0}catch(c){if(ae.current||a.signal.aborted||K(c))return;let b=(c instanceof Error?c.message:"Failed to load session").toLowerCase();if(b.includes("session not found")||b.includes("http 404")){Y.current||N(!0),y(!1);return}console.error("Failed to fetch session:",c),Y.current||A(c instanceof Error?c:Error("Failed to load session"))}finally{y(!1),$.current=!1,ab.current===a&&(ab.current=null)}},[b]);(0,e.useCallback)(async()=>{if(_.current)return;let a=U.current;if(!a)return;let b=V.current,c=`${a}:${b?"orchestrator":"worker"}`;if(!b&&W.current===c)return;_.current=!0;let d=new AbortController;ac.current=d;try{let e=b?`/api/sessions?project=${encodeURIComponent(a)}&fresh=true`:`/api/sessions?project=${encodeURIComponent(a)}&orchestratorOnly=true&fresh=true`,f=await (0,E.u)(e,{signal:d.signal,timeoutMs:5e3,timeoutMessage:"Project sessions request timed out after 5000ms"}),h=f.sessions??[],j=f.orchestratorId??f.orchestrators?.find(b=>b.projectId===a)?.id??null;if(o(a=>a===j?a:j),!b){W.current=c;return}let k={merge:0,respond:0,review:0,pending:0,working:0,done:0},l=[...X.current.values()];for(let a of h)if(!(0,g.tT)(a,X.current.get(a.projectId),l)){let b=(0,i.ng)(a);if("action"===b)continue;k[b]++}m(k)}catch(a){if(ae.current||d.signal.aborted||K(a))return;console.error("Failed to fetch project sessions:",a)}finally{_.current=!1,ac.current===d&&(ac.current=null)}},[]);let ak=(0,e.useCallback)(async()=>{if(aa.current)return;aa.current=!0;let a=new AbortController;ad.current=a;try{let b=await (0,E.u)("/api/sessions?fresh=true",{signal:a.signal,timeoutMs:5e3,timeoutMessage:"Sidebar sessions request timed out after 5000ms"}),c=b?.sessions??[],d=function(a,b){if(!a||0===b.length)return a;let c=new Map(b.map(a=>[a.id,a])),d=!1,e=a.map(a=>{var b,e;let f=c.get(a.id);if(!f)return a;if(b=f.status,!H.has(b)){let b=`status:${f.status}`;return J.has(b)||(J.add(b),console.warn("Ignoring mux session patch with unknown status",{sessionId:f.id,status:f.status})),a}if(null!==f.activity&&(e=f.activity,!I.has(e))){let b=`activity:${f.activity}`;return J.has(b)||(J.add(b),console.warn("Ignoring mux session patch with unknown activity",{sessionId:f.id,activity:f.activity})),a}return a.status===f.status&&a.activity===f.activity&&a.lastActivityAt===f.lastActivityAt?a:(d=!0,{...a,status:f.status,activity:f.activity,lastActivityAt:f.lastActivityAt})});return d?e:a}(c,Z.current??[])??c;G=d,w(b?.orchestrators),P(!1),u(a=>a&&a.length===d.length&&a.every((a,b)=>{let c=d[b];return JSON.stringify(a)===JSON.stringify(c)})?a:d)}catch(b){if(ae.current||a.signal.aborted||K(b))return;console.error("Failed to fetch sidebar sessions:",b),P(!0),u(a=>null===a?[]:a)}finally{aa.current=!1,ad.current===a&&(ad.current=null)}},[]);return x?(0,d.jsx)(M,{projects:p,projectsLoading:r,sidebarSessions:t,sidebarOrchestrators:v,sidebarLoading:null===t,sidebarError:O,onRetrySidebar:ak,activeProjectId:c??void 0,activeSessionId:b,children:(0,d.jsx)("div",{className:"flex h-full min-h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,d.jsx)("svg",{className:"h-5 w-5 animate-spin text-[var(--color-text-tertiary)]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9"})}),(0,d.jsx)("div",{className:"text-[13px] text-[var(--color-text-tertiary)]",children:"Loading session…"})]})})}):L?(0,d.jsx)(M,{projects:p,projectsLoading:r,sidebarSessions:t,sidebarOrchestrators:v,sidebarLoading:null===t,sidebarError:O,onRetrySidebar:ak,activeProjectId:c??void 0,activeSessionId:b,children:(0,d.jsx)(C.ErrorDisplay,{title:"Session not found",message:"This session is no longer available. It may have been removed, renamed, or already cleaned up.",tone:"not-found",primaryAction:{label:"Back to dashboard",href:c?`/projects/${c}`:"/"},secondaryAction:{label:"Retry",onClick:()=>void aj()},compact:!0,chrome:"card"})}):z?(0,d.jsx)(M,{projects:p,projectsLoading:r,sidebarSessions:t,sidebarOrchestrators:v,sidebarLoading:null===t,sidebarError:O,onRetrySidebar:ak,activeProjectId:j?.projectId??c??void 0,activeSessionId:b,children:(0,d.jsx)(C.ErrorDisplay,{title:"Failed to load session",message:function(a){let b=a.message.toLowerCase();return b.includes("timed out")?"The session request is taking too long, so the page stopped waiting instead of spinning forever. You can retry, or return to the project and reopen a different session.":b.includes("network")?"The session request failed before the dashboard got a response. Check the local server connection and try again.":b.includes("404")?"This session is no longer available. It may have been removed while the page was open.":b.includes("500")?"The server returned an internal error while loading this session. Try again to re-fetch the latest state.":"The dashboard could not load this session cleanly. Try again to re-fetch the latest state."}(z),tone:"error",primaryAction:{label:"Try again",onClick:()=>{A(null),N(!1),y(!0),Promise.all([af(),aj(),ak()])}},secondaryAction:{label:"Back to dashboard",href:j?.projectId?`/projects/${j.projectId}`:"/"},error:z,compact:!0,chrome:"card"})}):j?(0,d.jsx)(B,{session:j,isOrchestrator:T,orchestratorZones:l??void 0,projectOrchestratorId:n,projects:p,sidebarSessions:t,sidebarOrchestrators:v,sidebarLoading:null===t,sidebarError:O,onRetrySidebar:ak}):(0,d.jsx)(M,{projects:p,projectsLoading:r,sidebarSessions:t,sidebarOrchestrators:v,sidebarLoading:null===t,sidebarError:O,onRetrySidebar:ak,activeProjectId:c??void 0,activeSessionId:b,children:(0,d.jsx)(C.ErrorDisplay,{title:"Session unavailable",message:"The backend has not returned this session yet. This can happen right after spawning an orchestrator; retry once the terminal registers the session.",tone:"error",primaryAction:{label:"Retry",onClick:()=>void aj()},secondaryAction:{label:"Back to dashboard",href:c?`/projects/${c}`:"/"},compact:!0,chrome:"card"})})}},18287:(a,b,c)=>{c.d(b,{default:()=>e.a});var d=c(26050),e=c.n(d)},26050:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"default",{enumerable:!0,get:function(){return e}});let d=c(32697)._(c(90994));function e(a,b){var c;let e={};"function"==typeof a&&(e.loader=a);let f={...e,...b};return(0,d.default)({...f,modules:null==(c=f.loadableGenerated)?void 0:c.modules})}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},26745:(a,b,c)=>{c.r(b),c.d(b,{default:()=>d});let d=(0,c(10864).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/tmp/ao-publish-stable/packages/web/src/app/sessions/[id]/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/tmp/ao-publish-stable/packages/web/src/app/sessions/[id]/page.tsx","default")},54170:(a,b)=>{function c(a){return a.split("/").map(a=>encodeURIComponent(a)).join("/")}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"encodeURIPath",{enumerable:!0,get:function(){return c}})},70162:(a,b,c)=>{c.d(b,{I:()=>d});let d=(0,c(81115).createContext)(null)},70424:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"PreloadChunks",{enumerable:!0,get:function(){return h}});let d=c(33666),e=c(51538),f=c(29294),g=c(54170);function h(a){let{moduleIds:b}=a,c=f.workAsyncStorage.getStore();if(void 0===c)return null;let h=[];if(c.reactLoadableManifest&&b){let a=c.reactLoadableManifest;for(let c of b){if(!a[c])continue;let b=a[c].files;h.push(...b)}}return 0===h.length?null:(0,d.jsx)(d.Fragment,{children:h.map(a=>{let b=c.assetPrefix+"/_next/"+(0,g.encodeURIPath)(a);return a.endsWith(".css")?(0,d.jsx)("link",{precedence:"dynamic",href:b,rel:"stylesheet",as:"style"},a):((0,e.preload)(b,{as:"script",fetchPriority:"low"}),null)})})}},88087:(a,b,c)=>{c.d(b,{X:()=>g});var d=c(33666),e=c(47489),f=c.n(e);function g({ariaLabel:a,activeTab:b,dashboardHref:c,prsHref:e,showOrchestrator:g=!0,orchestratorHref:h=null}){return(0,d.jsxs)("nav",{className:"mobile-bottom-nav","aria-label":a,children:[(0,d.jsxs)(f(),{href:c,className:"mobile-bottom-nav__item","data-active":"dashboard"===b?"true":"false","aria-current":"dashboard"===b?"page":void 0,children:[(0,d.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M3 13h8V3H3zm10 8h8V11h-8zM3 21h8v-6H3zm10-10h8V3h-8z"})}),(0,d.jsx)("span",{children:"Dashboard"})]}),(0,d.jsxs)(f(),{href:e,className:"mobile-bottom-nav__item","data-active":"prs"===b?"true":"false","aria-current":"prs"===b?"page":void 0,children:[(0,d.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})}),(0,d.jsx)("span",{children:"PRs"})]}),g?h?(0,d.jsxs)(f(),{href:h,className:"mobile-bottom-nav__item","data-active":"orchestrator"===b?"true":"false","aria-current":"orchestrator"===b?"page":void 0,children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,d.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,d.jsx)("span",{children:"Orchestrator"})]}):(0,d.jsxs)("button",{type:"button",className:"mobile-bottom-nav__item",disabled:!0,children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,d.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,d.jsx)("span",{children:"Orchestrator"})]}):null]})}},90994:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"default",{enumerable:!0,get:function(){return j}});let d=c(33666),e=c(81115),f=c(97053),g=c(70424);function h(a){return{default:a&&"default"in a?a.default:a}}let i={loader:()=>Promise.resolve(h(()=>null)),loading:null,ssr:!0},j=function(a){let b={...i,...a},c=(0,e.lazy)(()=>b.loader().then(h)),j=b.loading;function k(a){let h=j?(0,d.jsx)(j,{isLoading:!0,pastDelay:!0,error:null}):null,i=!b.ssr||!!b.loading,k=i?e.Suspense:e.Fragment,l=b.ssr?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.PreloadChunks,{moduleIds:b.modules}),(0,d.jsx)(c,{...a})]}):(0,d.jsx)(f.BailoutToCSR,{reason:"next/dynamic",children:(0,d.jsx)(c,{...a})});return(0,d.jsx)(k,{...i?{fallback:h}:{},children:l})}return k.displayName="LoadableComponent",k}},97053:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"BailoutToCSR",{enumerable:!0,get:function(){return e}});let d=c(35945);function e(a){let{reason:b,children:c}=a;throw Object.defineProperty(new d.BailoutToCSRError(b),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}};
|
|
9
|
+
`:void 0,R=a.projectId?(0,m.bn)(a.projectId):"/",S=(0,e.useCallback)(async()=>{try{let b=await fetch(`/api/sessions/${encodeURIComponent(a.id)}/kill`,{method:"POST"});if(!b.ok)throw Error(`HTTP ${b.status}`);if(g)return void v.push((0,m.Nc)(a.projectId,g));v.push(R)}catch(a){console.error("Failed to kill session:",a)}},[R,g,v,a.id,a.projectId]),T=(0,e.useCallback)(async()=>{try{let b=await fetch(`/api/sessions/${encodeURIComponent(a.id)}/restore`,{method:"POST"});if(!b.ok){let a=await b.text().catch(()=>"");throw Error(a||`HTTP ${b.status}`)}window.location.reload()}catch(a){console.error("Failed to restore session:",a)}},[a.id]),U=(0,e.useMemo)(()=>b?(0,m.Nc)(a.projectId,a.id):g?(0,m.Nc)(a.projectId,g):null,[b,g,a.id,a.projectId]),V=(0,e.useCallback)(()=>{x?F(a=>!a):D(a=>!a)},[x]);return(0,d.jsx)(l.I.Provider,{value:{onToggleSidebar:V,mobileSidebarOpen:E},children:(0,d.jsxs)("div",{className:"dashboard-app-shell",children:[(0,d.jsx)(y,{session:a,isOrchestrator:b,isMobile:x,terminalEnded:J,isRestorable:K,activity:L,headline:M,projects:j,orchestratorHref:U,orchestratorZones:c,onToggleSidebar:V,onRestore:T,onKill:S}),(0,d.jsxs)("div",{className:`dashboard-shell dashboard-shell--desktop${C?" dashboard-shell--sidebar-collapsed":""}`,children:[j.length>0?(0,d.jsx)("div",{className:`sidebar-wrapper${E?" sidebar-wrapper--mobile-open":""}`,children:(0,d.jsx)(n.u,{projects:j,sessions:p,orchestrators:r,loading:s,error:t,onRetry:u,activeProjectId:a.projectId,activeSessionId:a.id,collapsed:C,onToggleCollapsed:()=>D(a=>!a),onMobileClose:()=>F(!1)})}):null,E&&(0,d.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>F(!1)}),(0,d.jsx)("div",{className:"dashboard-main dashboard-main--desktop",children:(0,d.jsx)("main",{className:"session-detail-page flex-1 min-h-0 flex flex-col bg-[var(--color-bg-base)]",children:(0,d.jsx)("div",{className:"flex-1 min-h-0 flex flex-col",children:G?J?(0,d.jsx)(z,{session:a,headline:M,pr:I,dashboardHref:R}):(0,d.jsx)(A,{sessionId:a.id,projectId:a.projectId,tmuxName:a.metadata?.tmuxName,startFullscreen:B,variant:N,appearance:"dark",height:"100%",isOpenCodeSession:O,reloadCommand:O?Q:void 0,autoFocus:!0}):(0,d.jsx)("div",{className:"session-detail-terminal-placeholder h-full"})})})})]}),(0,d.jsx)(o.X,{ariaLabel:"Session navigation",activeTab:b?"orchestrator":void 0,dashboardHref:R,prsHref:a.projectId?`/?project=${encodeURIComponent(a.projectId)}&tab=prs`:"/",showOrchestrator:!!U,orchestratorHref:U})]})})}var C=c(23041),D=c(58976),E=c(20902);let F=null,G=null,H=new Set(Object.values(g.SB)),I=new Set(Object.values(g.u3)),J=new Set;function K(a){if(a instanceof DOMException)return"AbortError"===a.name;if(a instanceof Error){let b=a.message.toLowerCase();return b.includes("aborted")||b.includes("aborterror")}return!1}function L({message:a}){return(0,d.jsx)("div",{className:"project-sidebar h-full",children:(0,d.jsxs)("div",{className:"space-y-3 px-3 py-4",children:[(0,d.jsx)("div",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-[var(--color-text-tertiary)]",children:"Projects"}),(0,d.jsx)("div",{className:"space-y-2",children:Array.from({length:3},(a,b)=>(0,d.jsx)("div",{className:"h-10 animate-pulse border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)]"},`sidebar-placeholder-${b}`))}),(0,d.jsx)("div",{className:"pt-2 text-[12px] text-[var(--color-text-tertiary)]",children:a})]})})}function M({projects:a,projectsLoading:b,sidebarSessions:c,sidebarOrchestrators:f,sidebarLoading:g,sidebarError:i,onRetrySidebar:j,activeProjectId:k,activeSessionId:l,children:m}){let o=(0,h.U)(h.D),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(!1),t=(0,e.useCallback)(()=>{if(o)return void s(a=>!a);q(a=>!a)},[o]);return(0,d.jsxs)("div",{className:"dashboard-app-shell",children:[(0,d.jsxs)("header",{className:"dashboard-app-header",children:[(0,d.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:t,"aria-label":"Toggle sidebar",children:o?(0,d.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,d.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,d.jsx)("path",{d:"M9 3v18"})]})}),(0,d.jsx)("div",{className:"dashboard-app-header__brand",children:(0,d.jsx)("span",{children:"Agent Orchestrator"})}),(0,d.jsx)("div",{className:"dashboard-app-header__spacer"})]}),(0,d.jsxs)("div",{className:`dashboard-shell dashboard-shell--desktop${p?" dashboard-shell--sidebar-collapsed":""}`,children:[(0,d.jsx)("div",{className:`sidebar-wrapper${r?" sidebar-wrapper--mobile-open":""}`,children:a.length>0?(0,d.jsx)(n.u,{projects:a,sessions:c,orchestrators:f,loading:g,error:i,onRetry:j,activeProjectId:k,activeSessionId:l,collapsed:p,onToggleCollapsed:()=>q(a=>!a),onMobileClose:()=>s(!1)}):(0,d.jsx)(L,{message:b?"Loading projects...":"Projects unavailable."})}),r&&(0,d.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>s(!1)}),(0,d.jsx)("div",{className:"dashboard-main dashboard-main--desktop",children:(0,d.jsx)("main",{className:"session-detail-page flex-1 min-h-0 flex flex-col bg-[var(--color-bg-base)]",children:(0,d.jsx)("div",{className:"flex-1 min-h-0",children:m})})})]})]})}function N(){let a=(0,f.useParams)();(0,f.usePathname)(),(0,f.useRouter)();let b=a.id,c="string"==typeof a.projectId?a.projectId:Array.isArray(a.projectId)?a.projectId[0]:null;(0,D.eT)();let h=(()=>{if("undefined"==typeof sessionStorage)return null;try{let a=sessionStorage.getItem(`ao-session-nav:${b}`);if(a)return sessionStorage.removeItem(`ao-session-nav:${b}`),JSON.parse(a)}catch{}return null})(),[j,k]=(0,e.useState)(h),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(void 0),[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(null===F),[t,u]=(0,e.useState)(()=>G),[v,w]=(0,e.useState)(void 0),[x,y]=(0,e.useState)(null===h),[z,A]=(0,e.useState)(null),[L,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)(new Map);j?.projectId;let S=[...Q.values()],T=!!j&&(0,g.tT)(j,Q.get(j.projectId),S),U=(0,e.useRef)(null),V=(0,e.useRef)(!1),W=(0,e.useRef)(null),X=(0,e.useRef)(new Map),Y=(0,e.useRef)(null!==h),Z=(0,e.useRef)(null),$=(0,e.useRef)(!1),_=(0,e.useRef)(!1),aa=(0,e.useRef)(!1),ab=(0,e.useRef)(null),ac=(0,e.useRef)(null),ad=(0,e.useRef)(null),ae=(0,e.useRef)(!1),af=(0,e.useCallback)(async()=>{F&&(q(F),R(new Map(F.map(a=>[a.id,a.sessionPrefix??a.id]))),s(!1));try{var a,b;let c=await (0,E.u)("/api/projects",{timeoutMs:5e3,timeoutMessage:"Projects request timed out after 5000ms"});if(!c?.projects)return;a=F,b=c.projects,a&&a.length===b.length&&a.every((a,c)=>{let d=b[c];return JSON.stringify(a)===JSON.stringify(d)})||(F=c.projects,q(c.projects),R(new Map(c.projects.map(a=>[a.id,a.sessionPrefix??a.id]))))}catch(a){console.error("Failed to fetch projects:",a)}finally{s(!1)}},[]);var ag=b;let ah=(0,D.eT)(),ai=ah?.sessions.find(a=>a.id===ag);(0,e.useMemo)(()=>ai?{activity:ai.activity??null}:null,[ai]);let aj=(0,e.useCallback)(async()=>{if($.current)return;$.current=!0;let a=new AbortController;ab.current=a;try{let c=await (0,E.u)(`/api/sessions/${encodeURIComponent(b)}`,{signal:a.signal,timeoutMs:8e3,timeoutMessage:"Session request timed out after 8000ms"});k(c),A(null),N(!1),Y.current=!0}catch(c){if(ae.current||a.signal.aborted||K(c))return;let b=(c instanceof Error?c.message:"Failed to load session").toLowerCase();if(b.includes("session not found")||b.includes("http 404")){Y.current||N(!0),y(!1);return}console.error("Failed to fetch session:",c),Y.current||A(c instanceof Error?c:Error("Failed to load session"))}finally{y(!1),$.current=!1,ab.current===a&&(ab.current=null)}},[b]);(0,e.useCallback)(async()=>{if(_.current)return;let a=U.current;if(!a)return;let b=V.current,c=`${a}:${b?"orchestrator":"worker"}`;if(!b&&W.current===c)return;_.current=!0;let d=new AbortController;ac.current=d;try{let e=b?`/api/sessions?project=${encodeURIComponent(a)}&fresh=true`:`/api/sessions?project=${encodeURIComponent(a)}&orchestratorOnly=true&fresh=true`,f=await (0,E.u)(e,{signal:d.signal,timeoutMs:5e3,timeoutMessage:"Project sessions request timed out after 5000ms"}),h=f.sessions??[],j=f.orchestratorId??f.orchestrators?.find(b=>b.projectId===a)?.id??null;if(o(a=>a===j?a:j),!b){W.current=c;return}let k={merge:0,respond:0,review:0,pending:0,working:0,done:0},l=[...X.current.values()];for(let a of h)if(!(0,g.tT)(a,X.current.get(a.projectId),l)){let b=(0,i.ng)(a);if("action"===b)continue;k[b]++}m(k)}catch(a){if(ae.current||d.signal.aborted||K(a))return;console.error("Failed to fetch project sessions:",a)}finally{_.current=!1,ac.current===d&&(ac.current=null)}},[]);let ak=(0,e.useCallback)(async()=>{if(aa.current)return;aa.current=!0;let a=new AbortController;ad.current=a;try{let b=await (0,E.u)("/api/sessions?fresh=true",{signal:a.signal,timeoutMs:5e3,timeoutMessage:"Sidebar sessions request timed out after 5000ms"}),c=b?.sessions??[],d=function(a,b){if(!a||0===b.length)return a;let c=new Map(b.map(a=>[a.id,a])),d=!1,e=a.map(a=>{var b,e;let f=c.get(a.id);if(!f)return a;if(b=f.status,!H.has(b)){let b=`status:${f.status}`;return J.has(b)||(J.add(b),console.warn("Ignoring mux session patch with unknown status",{sessionId:f.id,status:f.status})),a}if(null!==f.activity&&(e=f.activity,!I.has(e))){let b=`activity:${f.activity}`;return J.has(b)||(J.add(b),console.warn("Ignoring mux session patch with unknown activity",{sessionId:f.id,activity:f.activity})),a}return a.status===f.status&&a.activity===f.activity&&a.lastActivityAt===f.lastActivityAt?a:(d=!0,{...a,status:f.status,activity:f.activity,lastActivityAt:f.lastActivityAt})});return d?e:a}(c,Z.current??[])??c;G=d,w(b?.orchestrators),P(!1),u(a=>a&&a.length===d.length&&a.every((a,b)=>{let c=d[b];return JSON.stringify(a)===JSON.stringify(c)})?a:d)}catch(b){if(ae.current||a.signal.aborted||K(b))return;console.error("Failed to fetch sidebar sessions:",b),P(!0),u(a=>null===a?[]:a)}finally{aa.current=!1,ad.current===a&&(ad.current=null)}},[]);return x?(0,d.jsx)(M,{projects:p,projectsLoading:r,sidebarSessions:t,sidebarOrchestrators:v,sidebarLoading:null===t,sidebarError:O,onRetrySidebar:ak,activeProjectId:c??void 0,activeSessionId:b,children:(0,d.jsx)("div",{className:"flex h-full min-h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,d.jsx)("svg",{className:"h-5 w-5 animate-spin text-[var(--color-text-tertiary)]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9"})}),(0,d.jsx)("div",{className:"text-[13px] text-[var(--color-text-tertiary)]",children:"Loading session…"})]})})}):L?(0,d.jsx)(M,{projects:p,projectsLoading:r,sidebarSessions:t,sidebarOrchestrators:v,sidebarLoading:null===t,sidebarError:O,onRetrySidebar:ak,activeProjectId:c??void 0,activeSessionId:b,children:(0,d.jsx)(C.ErrorDisplay,{title:"Session not found",message:"This session is no longer available. It may have been removed, renamed, or already cleaned up.",tone:"not-found",primaryAction:{label:"Back to dashboard",href:c?`/projects/${c}`:"/"},secondaryAction:{label:"Retry",onClick:()=>void aj()},compact:!0,chrome:"card"})}):z?(0,d.jsx)(M,{projects:p,projectsLoading:r,sidebarSessions:t,sidebarOrchestrators:v,sidebarLoading:null===t,sidebarError:O,onRetrySidebar:ak,activeProjectId:j?.projectId??c??void 0,activeSessionId:b,children:(0,d.jsx)(C.ErrorDisplay,{title:"Failed to load session",message:function(a){let b=a.message.toLowerCase();return b.includes("timed out")?"The session request is taking too long, so the page stopped waiting instead of spinning forever. You can retry, or return to the project and reopen a different session.":b.includes("network")?"The session request failed before the dashboard got a response. Check the local server connection and try again.":b.includes("404")?"This session is no longer available. It may have been removed while the page was open.":b.includes("500")?"The server returned an internal error while loading this session. Try again to re-fetch the latest state.":"The dashboard could not load this session cleanly. Try again to re-fetch the latest state."}(z),tone:"error",primaryAction:{label:"Try again",onClick:()=>{A(null),N(!1),y(!0),Promise.all([af(),aj(),ak()])}},secondaryAction:{label:"Back to dashboard",href:j?.projectId?`/projects/${j.projectId}`:"/"},error:z,compact:!0,chrome:"card"})}):j?(0,d.jsx)(B,{session:j,isOrchestrator:T,orchestratorZones:l??void 0,projectOrchestratorId:n,projects:p,sidebarSessions:t,sidebarOrchestrators:v,sidebarLoading:null===t,sidebarError:O,onRetrySidebar:ak}):(0,d.jsx)(M,{projects:p,projectsLoading:r,sidebarSessions:t,sidebarOrchestrators:v,sidebarLoading:null===t,sidebarError:O,onRetrySidebar:ak,activeProjectId:c??void 0,activeSessionId:b,children:(0,d.jsx)(C.ErrorDisplay,{title:"Session unavailable",message:"The backend has not returned this session yet. This can happen right after spawning an orchestrator; retry once the terminal registers the session.",tone:"error",primaryAction:{label:"Retry",onClick:()=>void aj()},secondaryAction:{label:"Back to dashboard",href:c?`/projects/${c}`:"/"},compact:!0,chrome:"card"})})}},18287:(a,b,c)=>{c.d(b,{default:()=>e.a});var d=c(26050),e=c.n(d)},26050:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"default",{enumerable:!0,get:function(){return e}});let d=c(32697)._(c(90994));function e(a,b){var c;let e={};"function"==typeof a&&(e.loader=a);let f={...e,...b};return(0,d.default)({...f,modules:null==(c=f.loadableGenerated)?void 0:c.modules})}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},26745:(a,b,c)=>{c.r(b),c.d(b,{default:()=>d});let d=(0,c(10864).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/tmp/ao-publish-work/packages/web/src/app/sessions/[id]/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/tmp/ao-publish-work/packages/web/src/app/sessions/[id]/page.tsx","default")},54170:(a,b)=>{function c(a){return a.split("/").map(a=>encodeURIComponent(a)).join("/")}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"encodeURIPath",{enumerable:!0,get:function(){return c}})},70162:(a,b,c)=>{c.d(b,{I:()=>d});let d=(0,c(81115).createContext)(null)},70424:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"PreloadChunks",{enumerable:!0,get:function(){return h}});let d=c(33666),e=c(51538),f=c(29294),g=c(54170);function h(a){let{moduleIds:b}=a,c=f.workAsyncStorage.getStore();if(void 0===c)return null;let h=[];if(c.reactLoadableManifest&&b){let a=c.reactLoadableManifest;for(let c of b){if(!a[c])continue;let b=a[c].files;h.push(...b)}}return 0===h.length?null:(0,d.jsx)(d.Fragment,{children:h.map(a=>{let b=c.assetPrefix+"/_next/"+(0,g.encodeURIPath)(a);return a.endsWith(".css")?(0,d.jsx)("link",{precedence:"dynamic",href:b,rel:"stylesheet",as:"style"},a):((0,e.preload)(b,{as:"script",fetchPriority:"low"}),null)})})}},88087:(a,b,c)=>{c.d(b,{X:()=>g});var d=c(33666),e=c(47489),f=c.n(e);function g({ariaLabel:a,activeTab:b,dashboardHref:c,prsHref:e,showOrchestrator:g=!0,orchestratorHref:h=null}){return(0,d.jsxs)("nav",{className:"mobile-bottom-nav","aria-label":a,children:[(0,d.jsxs)(f(),{href:c,className:"mobile-bottom-nav__item","data-active":"dashboard"===b?"true":"false","aria-current":"dashboard"===b?"page":void 0,children:[(0,d.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M3 13h8V3H3zm10 8h8V11h-8zM3 21h8v-6H3zm10-10h8V3h-8z"})}),(0,d.jsx)("span",{children:"Dashboard"})]}),(0,d.jsxs)(f(),{href:e,className:"mobile-bottom-nav__item","data-active":"prs"===b?"true":"false","aria-current":"prs"===b?"page":void 0,children:[(0,d.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})}),(0,d.jsx)("span",{children:"PRs"})]}),g?h?(0,d.jsxs)(f(),{href:h,className:"mobile-bottom-nav__item","data-active":"orchestrator"===b?"true":"false","aria-current":"orchestrator"===b?"page":void 0,children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,d.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,d.jsx)("span",{children:"Orchestrator"})]}):(0,d.jsxs)("button",{type:"button",className:"mobile-bottom-nav__item",disabled:!0,children:[(0,d.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,d.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,d.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,d.jsx)("span",{children:"Orchestrator"})]}):null]})}},90994:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"default",{enumerable:!0,get:function(){return j}});let d=c(33666),e=c(81115),f=c(97053),g=c(70424);function h(a){return{default:a&&"default"in a?a.default:a}}let i={loader:()=>Promise.resolve(h(()=>null)),loading:null,ssr:!0},j=function(a){let b={...i,...a},c=(0,e.lazy)(()=>b.loader().then(h)),j=b.loading;function k(a){let h=j?(0,d.jsx)(j,{isLoading:!0,pastDelay:!0,error:null}):null,i=!b.ssr||!!b.loading,k=i?e.Suspense:e.Fragment,l=b.ssr?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.PreloadChunks,{moduleIds:b.modules}),(0,d.jsx)(c,{...a})]}):(0,d.jsx)(f.BailoutToCSR,{reason:"next/dynamic",children:(0,d.jsx)(c,{...a})});return(0,d.jsx)(k,{...i?{fallback:h}:{},children:l})}return k.displayName="LoadableComponent",k}},97053:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"BailoutToCSR",{enumerable:!0,get:function(){return e}});let d=c(35945);function e(a){let{reason:b,children:c}=a;throw Object.defineProperty(new d.BailoutToCSRError(b),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}};
|