@aoagents/ao-web 0.4.0 → 0.5.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 +146 -146
- package/.next/app-path-routes-manifest.json +8 -8
- package/.next/build-manifest.json +6 -6
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +19 -19
- package/.next/react-loadable-manifest.json +3 -3
- 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 +7 -7
- 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 +1 -1
- 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/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/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 +4 -4
- 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 +8 -8
- 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.js.nft.json +1 -1
- 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 +8 -8
- package/.next/server/app-paths-manifest.json +8 -8
- package/.next/server/chunks/1172.js +1 -1
- package/.next/server/chunks/1271.js +1 -1
- package/.next/server/chunks/1876.js +2 -2
- package/.next/server/chunks/3131.js +3 -0
- package/.next/server/chunks/4520.js +1 -1
- package/.next/server/chunks/7167.js +1 -1
- package/.next/server/chunks/7173.js +1 -1
- package/.next/server/chunks/{9381.js → 801.js} +7 -7
- package/.next/server/chunks/9223.js +10 -10
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-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/{1383.faf35b62c555f5a1.js → 1383.c891a8ba72ee600c.js} +1 -1
- package/.next/static/chunks/3764.89a5955e46eb74b4.js +1 -0
- package/.next/static/chunks/{3780-e20898ff49ddc867.js → 3780-52c4733ce6591b8d.js} +1 -1
- package/.next/static/chunks/{4465-0c7772f1499dffa4.js → 4465-17154f7a01abfe85.js} +1 -1
- package/.next/static/chunks/app/dev/terminal-test/page-5819e40b3d4754ef.js +1 -0
- package/.next/static/chunks/app/{error-3ebcf3275d91d60a.js → error-da1d10c96ff5dd29.js} +1 -1
- package/.next/static/chunks/app/global-error-ca06d2b1be2d4ae0.js +1 -0
- package/.next/static/chunks/app/{layout-be776dec5531d47b.js → layout-bb6db479523cb3d6.js} +1 -1
- package/.next/static/chunks/app/{not-found-0eb78483b8277b8d.js → not-found-824d5d3c6e296eeb.js} +1 -1
- package/.next/static/chunks/app/orchestrators/page-f07983413ed1a44b.js +1 -0
- package/.next/static/chunks/app/page-6aa506a579ac9949.js +1 -0
- package/.next/static/chunks/app/projects/[projectId]/page-49eb5b990c74ca8f.js +1 -0
- package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-2450704c6b66a4b4.js +1 -0
- package/.next/static/chunks/app/projects/[projectId]/settings/{page-ce2e904def1bef9c.js → page-d1da671e72a7bd5e.js} +1 -1
- package/.next/static/chunks/app/prs/{page-95dbbebb4d372535.js → page-2332a7180a47f28c.js} +1 -1
- package/.next/static/chunks/app/sessions/[id]/{error-5468aace23fd8872.js → error-8de5b24e86eeae7b.js} +1 -1
- package/.next/static/chunks/app/sessions/[id]/{not-found-0eb78483b8277b8d.js → not-found-824d5d3c6e296eeb.js} +1 -1
- package/.next/static/chunks/app/sessions/[id]/page-b60b49ccbafe51c9.js +1 -0
- package/.next/static/chunks/app/test-direct/{page-ab98dc9b04bacaa5.js → page-eb366dde03fab6a7.js} +1 -1
- package/.next/static/chunks/{main-app-4b27cdf1baf203ad.js → main-app-690acf9d5d2050c9.js} +1 -1
- package/.next/static/chunks/{webpack-ab12779265bdb8f9.js → webpack-d2dfbd3e9262b74e.js} +1 -1
- package/.next/static/css/fcafd381715071b8.css +1 -0
- package/dist-server/mux-websocket.js +5 -6
- package/package.json +12 -12
- package/.next/server/chunks/8539.js +0 -3
- package/.next/static/chunks/3764.ba81c7b8d5b21136.js +0 -1
- package/.next/static/chunks/app/dev/terminal-test/page-095511c7a110fbc9.js +0 -1
- package/.next/static/chunks/app/global-error-8f082029a4cf6af1.js +0 -1
- package/.next/static/chunks/app/orchestrators/page-406e530b0d4ad46f.js +0 -1
- package/.next/static/chunks/app/page-a92f3646b54545b0.js +0 -1
- package/.next/static/chunks/app/projects/[projectId]/page-d14fdcff4998d3bf.js +0 -1
- package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-96fc04db76c65761.js +0 -1
- package/.next/static/chunks/app/sessions/[id]/page-8ef744531757185e.js +0 -1
- package/.next/static/css/397ea3e60645d3f3.css +0 -1
- /package/.next/static/{5nmlY5IOwz-Od3p2SB2hh → YR6Xi4DC5A7S7E2PoZuif}/_buildManifest.js +0 -0
- /package/.next/static/{5nmlY5IOwz-Od3p2SB2hh → YR6Xi4DC5A7S7E2PoZuif}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{2466:(e,s,r)=>{r.d(s,{I:()=>a});let a=(0,r(6749).createContext)(null)},4465:(e,s,r)=>{r.d(s,{Dashboard:()=>O});var a=r(3817),t=r(6749),n=r(8713),o=r.n(n),l=r(7594),i=r(9120),c=r(545),d=r(4901),h=r(7387),u=r(4906),x=r(1237),p=r(8450);let m=new Set,v=(0,t.memo)(function(e){var s,r,n,o,l,i;let{session:v,onSend:g,onKill:b,onMerge:j,onRestore:f}=e,[k,_]=(0,t.useState)(!1),[N,w]=(0,t.useState)(null),[y,C]=(0,t.useState)(null),[M,S]=(0,t.useState)(null),[P,R]=(0,t.useState)(null),[W,I]=(0,t.useState)(!1),[T,A]=(0,t.useState)(""),B=(0,t.useRef)(null),D=(0,t.useRef)(null),[O]=(0,t.useState)(()=>m.has(v.id));(0,t.useEffect)(()=>{if(O)return;let e=window.requestAnimationFrame(()=>{m.add(v.id)});return()=>{window.cancelAnimationFrame(e)}},[O,v.id]);let F=(0,c.ng)(v),L=v.pr,E=async e=>{let s=e.trim();if(!s||null!==M)return!1;S(s),R(null);try{return await Promise.resolve(null==g?void 0:g(v.id,s)),R(s),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>R(null),2e3),!0}catch(e){return!1}finally{S(null)}},H=async e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),await E(T)&&A(""))};(0,t.useEffect)(()=>()=>{B.current&&clearTimeout(B.current),D.current&&clearTimeout(D.current)},[]);let K=async(e,s)=>{if(null===N){w(e),C(null);try{await Promise.resolve(null==g?void 0:g(v.id,s)),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>w(null),2e3)}catch(s){w(null),C(e),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>C(null),2e3)}}},Z=!!L&&(0,c.fZ)(L),q=!!L&&(0,c.sZ)(L),U=function(e){var s,r,t,n,o;let l=e.pr;if(!l||"open"!==l.state||(0,c.fZ)(l)||(0,c.sZ)(l))return[];let i=e.metadata,d=[],h=null!=(r=null==(s=e.lifecycle)?void 0:s.prReason)?r:null,u=i.status,x=l.ciStatus===c.U1.FAILING||"ci_failing"===h||"ci_failed"===u,p="changes_requested"===l.reviewDecision||"changes_requested"===h||"changes_requested"===u,m=!l.mergeability.noConflicts;if(x){let e=l.ciChecks.find(e=>"failed"===e.status),s=l.ciChecks.filter(e=>"failed"===e.status).length;0===s&&l.ciStatus!==c.U1.FAILING?d.push({key:"ci-fail",type:"ci",icon:"✗",label:"CI failing",url:l.url+"/checks",notified:!!i.lastCIFailureDispatchHash,actionLabel:"Ask to fix",actionMessage:"Please fix the failing CI checks on ".concat(l.url)}):0===s?d.push({key:"ci-unknown",type:"ci",icon:"?",label:"CI unknown",url:l.url+"/checks"}):d.push({key:"ci-fail",type:"ci",icon:"✗",count:s,label:"check".concat(s>1?"s":""," failing"),url:null!=(t=null==e?void 0:e.url)?t:l.url+"/checks",notified:!!i.lastCIFailureDispatchHash,actionLabel:"Ask to fix",actionMessage:"Please fix the failing CI checks on ".concat(l.url)})}if(p?d.push({key:"changes",type:"changes",icon:"↻",label:"changes requested",url:l.url,notified:!!i.lastPendingReviewDispatchHash,actionLabel:"Ask to address",actionMessage:"Please address the requested changes on ".concat(l.url)}):l.isDraft||"pending"!==l.reviewDecision&&"none"!==l.reviewDecision||d.push({key:"review",type:"review",icon:(0,a.jsxs)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),(0,a.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,a.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:l.url,actionLabel:"Ask to post",actionMessage:"Post ".concat(l.url," on slack asking for a review.")}),m&&d.push({key:"conflict",type:"conflict",icon:"⚠",label:"merge conflict",url:l.url,notified:"true"===i.lastMergeConflictDispatched,actionLabel:"Ask to fix",actionMessage:"Please resolve the merge conflicts on ".concat(l.url," by rebasing on the base branch")}),l.unresolvedThreads>0){let e=null!=(o=null==(n=l.unresolvedComments[0])?void 0:n.url)?o:l.url+"/files";d.push({key:"comments",type:"comment",icon:"\uD83D\uDCAC",label:"unresolved comments",count:l.unresolvedThreads,url:e,actionLabel:"Ask to resolve",actionMessage:"Please address all unresolved review comments on ".concat(l.url)})}return d}(v),z=!Z&&(null==L?void 0:L.mergeability.mergeable)&&"open"===L.state,V=(0,c.nH)(v),G=(0,c.wy)(v),J=(0,h.Pn)(v),Q=(n=v,o=F,z||"merge"===o?"mergeable":(null==(l=n.lifecycle)?void 0:l.sessionState)==="detecting"?"detecting":"respond"===o?(0,c.Ou)(n):(null==(i=n.lifecycle)?void 0:i.prReason)==="ci_failing"||"ci_failed"===n.status?"ci failing":"review"===o?(0,c.of)(n):(0,c.Ou)(n)),$=Z||!L||q?[]:L.ciChecks.filter(e=>"passed"===e.status).slice(0,3),X=(0,c.dG)(v)||"done"===F,Y=v.lifecycle?["Session ".concat((0,c.Ou)(v)),"PR ".concat((0,c.of)(v)),"Runtime ".concat((0,c.Kw)(v))].join(" \xb7 "):null,ee=v.issueLabel?"".concat(v.issueLabel).concat(v.issueTitle?" \xb7 ".concat(v.issueTitle):""):null!=(s=v.issueTitle)?s:v.summary&&v.summary!==J?v.summary:null,es=z?"session-card--merge-frame":U.length>0?"session-card--alert-frame":"session-card--fixed",er=z?"session-card--accent-merge":"working"===F?"session-card--accent-working":"respond"===F?"session-card--accent-respond":"review"===F||"pending"===F?"session-card--accent-attention":"session-card--accent-default";if(X){let e=function(e){var s,r,t,n;let o=e.activity,l=e.status,i=null!=(n=null==(s=e.lifecycle)?void 0:s.prState)?n:null==(r=e.pr)?void 0:r.state;return"merged"===i||"merged"===l?{label:"merged",pillClass:"done-status-pill--merged",icon:(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,a.jsx)("path",{d:"M20 6 9 17l-5-5"})})}:"closed"===i?{label:"closed",pillClass:"done-status-pill--exited",icon:(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,a.jsx)("path",{d:"M9 12h6"})]})}:(null==(t=e.lifecycle)?void 0:t.sessionState)==="terminated"||"killed"===l||"terminated"===l?{label:(0,c.Ou)(e),pillClass:"done-status-pill--killed",icon:(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,a.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}:{label:"exited"===o?"exited":(0,c.Ou)(e),pillClass:"done-status-pill--exited",icon:(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,a.jsx)("path",{d:"M9 12h6"})]})}}(v);return(0,a.jsxs)("div",{className:(0,d.cn)("session-card-done",k&&"done-expanded"),onClick:e=>{e.target.closest("a, button, textarea")||_(!k)},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,a.jsxs)("span",{className:(0,d.cn)("done-status-pill",e.pillClass),children:[e.icon,e.label]}),(0,a.jsx)("span",{className:"font-[var(--font-mono)] text-[10px] tracking-wide text-[var(--color-text-muted)]",children:v.id}),(0,a.jsx)("div",{className:"flex-1"}),G&&(0,a.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==f||f(v.id)},className:"done-restore-btn",children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,a.jsx)("polyline",{points:"1 4 1 10 7 10"}),(0,a.jsx)("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),"restore"]})]}),(0,a.jsx)("div",{className:"px-3.5 pb-2",children:(0,a.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:J})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 px-3.5 pb-3",children:[v.branch&&(0,a.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-2.5 w-2.5 opacity-50",children:[(0,a.jsx)("path",{d:"M6 3v12M18 9a3 3 0 0 1-3 3H9a3 3 0 0 0-3 3"}),(0,a.jsx)("circle",{cx:"18",cy:"6",r:"3"})]}),v.branch]}),L&&(0,a.jsxs)("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-bold text-[var(--color-text-primary)] no-underline underline-offset-2 hover:underline",children:["#",L.number]}),L&&!Z&&(q?(0,a.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,a.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,a.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",L.additions]})," ",(0,a.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",L.deletions]})," ",(0,x.i_)(L.additions,L.deletions),(0,a.jsx)("span",{className:"sr-only",children:"+".concat(L.additions," -").concat(L.deletions," ").concat((0,x.i_)(L.additions,L.deletions))})]})),(0,a.jsx)("a",{href:(0,p.Nc)(v.projectId,v.id),onClick:e=>e.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-semibold text-[var(--color-accent)] no-underline hover:underline",children:"View current context"})]}),k&&(0,a.jsxs)("div",{className:"done-expand-section px-3.5 py-3",children:[v.summary&&(null==L?void 0:L.title)&&v.summary!==L.title&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("div",{className:"done-detail-heading",children:[(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M4 6h16M4 12h16M4 18h10"})}),"Summary"]}),(0,a.jsx)("p",{className:"text-[12px] leading-relaxed text-[var(--color-text-secondary)]",children:v.summary})]}),v.issueUrl&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("div",{className:"done-detail-heading",children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"Issue"]}),(0,a.jsxs)("a",{href:v.issueUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"text-[12px] text-[var(--color-accent)] hover:underline",children:[v.issueLabel||v.issueUrl,v.issueTitle&&": ".concat(v.issueTitle)]})]}),L&&L.ciChecks.length>0&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("div",{className:"done-detail-heading",children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M9 12l2 2 4-4"}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"})]}),"CI Checks"]}),(0,a.jsx)(u.zm,{checks:L.ciChecks})]}),L&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("div",{className:"done-detail-heading",children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.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,a.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]}),"PR"]}),(0,a.jsxs)("p",{className:"text-[12px] text-[var(--color-text-secondary)]",children:[(0,a.jsx)("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"hover:underline",children:L.title}),q?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2 text-[10px] text-[var(--color-text-muted)]",children:[(0,a.jsx)("span",{className:"inline-block h-3 w-12 animate-pulse rounded bg-[var(--color-bg-subtle)]"}),(0,a.jsx)("span",{children:"PR details loading..."})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,a.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",L.additions]})," ",(0,a.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",L.deletions]})]}),(0,a.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,a.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["mergeable: ",L.mergeability.mergeable?"yes":"no"]}),(0,a.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,a.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["review: ",L.reviewDecision]})]})]})]})]}),!L&&(0,a.jsx)("p",{className:"text-[12px] text-[var(--color-text-tertiary)]",children:"No PR associated with this session."})]})]})}let ea=V?"exited":z||"merge"===F||"review"===F?"ready":"respond"===F?"waiting":"pending"===F?"idle":"working"===F?"working":"idle";return(0,a.jsxs)("div",{className:(0,d.cn)("session-card border",!O&&"kanban-card-enter",es,er,z&&"card-merge-ready"),children:[(0,a.jsxs)("div",{className:"session-card__header",children:[(0,a.jsx)("span",{className:(0,d.cn)("card__adot","working"===ea&&"card__adot--working","ready"===ea&&"card__adot--ready","idle"===ea&&"card__adot--idle","waiting"===ea&&"card__adot--waiting","exited"===ea&&"card__adot--exited")}),(0,a.jsx)("span",{className:"card__id",children:v.id}),(0,a.jsx)("div",{className:"flex-1"}),G&&(0,a.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==f||f(v.id)},className:"session-card__control session-card__restore-control",children:[(0,a.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M20 11a8 8 0 0 0-14.9-3.98"}),(0,a.jsx)("path",{d:"M4 5v4h4"}),(0,a.jsx)("path",{d:"M4 13a8 8 0 0 0 14.9 3.98"}),(0,a.jsx)("path",{d:"M20 19v-4h-4"})]}),"restore"]}),!V&&(0,a.jsxs)("a",{href:(0,p.$l)(v.projectId,v.id,"#session-terminal-section"),onClick:e=>e.stopPropagation(),className:"session-card__control session-card__terminal-link",children:[(0,a.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),(0,a.jsx)("path",{d:"M6 10l4 2-4 2"}),(0,a.jsx)("path",{d:"M14 14h4"})]}),"terminal"]})]}),(0,a.jsxs)("div",{className:"session-card__body flex min-h-0 flex-1 flex-col",children:[(0,a.jsx)("div",{className:"card__title-wrap",children:(0,a.jsx)("p",{className:"card__title",children:J})}),(0,a.jsxs)("div",{className:"card__meta",children:[v.branch&&(0,a.jsx)("span",{className:"card__branch",children:v.branch}),v.branch&&L?(0,a.jsx)("span",{className:"card__meta-sep","aria-hidden":"true",children:"\xb7"}):null,L&&(0,a.jsxs)("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"card__pr",children:["#",L.number]}),L&&!Z&&(q?(0,a.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,a.jsxs)("span",{className:"card__diff inline-flex items-center",children:[(0,a.jsxs)("span",{className:"card__diff-add",children:["+",L.additions]})," ",(0,a.jsxs)("span",{className:"card__diff-del",children:["-",L.deletions]})," ",(0,a.jsx)("span",{className:"card__diff-size",children:(0,x.i_)(L.additions,L.deletions)}),(0,a.jsx)("span",{className:"sr-only",children:"+".concat(L.additions," -").concat(L.deletions," ").concat((0,x.i_)(L.additions,L.deletions))})]}))]}),ee&&(0,a.jsx)("div",{className:"px-[10px] pb-[5px]",children:"merge"===F||z?(0,a.jsxs)("p",{className:"session-card__secondary session-card__secondary--merge",children:[(0,a.jsx)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M20 6 9 17l-5-5"})}),(0,a.jsx)("span",{children:ee})]}):(0,a.jsx)("p",{className:"session-card__secondary",children:ee})}),Y&&(0,a.jsx)("div",{className:"px-[10px] pb-[5px]",children:(0,a.jsx)("p",{className:"text-[10px] leading-relaxed text-[var(--color-text-tertiary)]",children:Y})}),Z&&(null==L?void 0:L.state)==="open"&&(0,a.jsx)("div",{className:"px-[10px] pb-[5px]",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--color-text-muted)]",children:[(0,a.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,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"PR data rate limited"]})}),$.length>0&&(0,a.jsx)("div",{className:"card__ci",children:$.map(e=>{let s=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("svg",{width:"8",height:"8",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M20 6 9 17l-5-5"})}),e.name]});return e.url?(0,a.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"ci-chip ci-chip--pass",onClick:e=>e.stopPropagation(),children:s},e.name):(0,a.jsx)("span",{className:"ci-chip ci-chip--pass",children:s},e.name)})}),!Z&&U.length>0&&(0,a.jsx)("div",{className:"card__alerts flex flex-col",children:U.slice(0,3).map(e=>(0,a.jsxs)("div",{className:(0,d.cn)("alert-row","alert-row--".concat(e.type)),children:[(0,a.jsx)("span",{className:"alert-row__icon",children:e.icon}),(0,a.jsxs)("span",{className:"alert-row__text",children:[(0,a.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:[void 0!==e.count&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-bold",children:e.count})," "]}),e.label]}),e.notified&&(0,a.jsxs)("span",{className:"alert-row__notified",title:"Agent has been notified",children:[" ","\xb7 notified"]})]}),e.actionLabel&&(0,a.jsx)("button",{onClick:s=>{var r;s.stopPropagation(),K(e.key,null!=(r=e.actionMessage)?r:"")},disabled:N===e.key,className:"alert-row__action",children:N===e.key?"sent!":y===e.key?"failed":e.actionLabel})]},e.key))}),"respond"===F&&(0,a.jsxs)("div",{className:"quick-reply",onClick:e=>e.stopPropagation(),children:[v.summary&&!v.summaryIsFallback&&(0,a.jsxs)("div",{className:"card__agent-msg",children:[(0,a.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,a.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,a.jsx)("span",{children:v.summary})]}),(0,a.jsx)("a",{href:(0,p.Nc)(v.projectId,v.id),onClick:e=>e.stopPropagation(),className:"card__view-context",children:"View current context →"}),!V&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"card__presets",children:[(0,a.jsx)("button",{className:"card__preset",onClick:()=>void E("continue"),disabled:null!==M,children:"continue"===M?"Sending...":"continue"===P?"Sent":"Continue"}),(0,a.jsx)("button",{className:"card__preset",onClick:()=>void E("abort"),disabled:null!==M,children:"abort"===M?"Sending...":"abort"===P?"Sent":"Abort"}),(0,a.jsx)("button",{className:"card__preset",onClick:()=>void E("skip"),disabled:null!==M,children:"skip"===M?"Sending...":"skip"===P?"Sent":"Skip"})]}),(0,a.jsx)("div",{className:"card__reply-wrap",children:(0,a.jsx)("textarea",{className:"card__reply",placeholder:null!==M?"Sending...":"Type a reply... (Enter to send)","aria-label":"Type a reply to the agent",value:T,onChange:e=>A(e.target.value),onKeyDown:e=>{H(e)},rows:1,disabled:null!==M})})]})]}),(0,a.jsxs)("div",{className:"session-card__footer",children:[(0,a.jsx)("span",{className:"card__status min-w-0 truncate",title:null!=(r=v.userPrompt)?r:void 0,children:!v.issueUrl&&v.userPrompt?v.userPrompt.length>60?v.userPrompt.slice(0,60)+"…":v.userPrompt:Q}),z&&L?(0,a.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==j||j(L.number)},className:"session-card__control session-card__merge-control",children:[(0,a.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"6",cy:"6",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"18",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"6",r:"2"}),(0,a.jsx)("path",{d:"M8 6h5a3 3 0 0 1 3 3v7"})]}),"Merge PR #",L.number]}):!V&&(0,a.jsx)("button",{onClick:e=>{if(e.stopPropagation(),!W)return void I(!0);I(!1),null==b||b(v.id)},onMouseLeave:()=>I(!1),onBlur:()=>I(!1),"aria-label":W?"Confirm terminate session":"Terminate session",className:(0,d.cn)("session-card__control session-card__terminate btn--danger",W&&"is-confirming"),children:W?(0,a.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:"kill?"}):(0,a.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M3 6h18"}),(0,a.jsx)("path",{d:"M8 6V4h8v2"}),(0,a.jsx)("path",{d:"M19 6l-1 14H6L5 6"})]})})]})]})]})},function(e,s){return e.session===s.session&&e.onSend===s.onSend&&e.onKill===s.onKill&&e.onMerge===s.onMerge&&e.onRestore===s.onRestore}),g={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."}},b=(0,t.memo)(function(e){let{level:s,sessions:r,onSend:n,onKill:o,onMerge:l,onRestore:i,collapsed:c,onToggle:d,compactMobile:h,onPreview:u,resetKey:x}=e,p=g[s],m=void 0!==d,[b,f]=(0,t.useState)(!1),k=m&&h&&!b?r.slice(0,5):r,_=r.length-k.length;return((0,t.useEffect)(()=>{c&&f(!1)},[c]),(0,t.useEffect)(()=>{f(!1)},[x]),m)?(0,a.jsxs)("div",{className:"accordion-section".concat(c?" accordion-section--collapsed":" accordion-section--expanded"),"data-level":s,children:[(0,a.jsxs)("button",{type:"button",className:"accordion-header",onClick:()=>d(s),"aria-expanded":!c,"aria-controls":"accordion-body-".concat(s),children:[(0,a.jsx)("span",{className:"accordion-header__dot","data-level":s}),(0,a.jsx)("span",{className:"accordion-header__label",children:p.label}),(0,a.jsx)("span",{className:"accordion-header__count",children:r.length}),(0,a.jsx)("span",{className:"accordion-header__chevron","aria-hidden":"true",children:"▶"})]}),(0,a.jsx)("div",{id:"accordion-body-".concat(s),className:"accordion-body",children:r.length>0?(0,a.jsxs)("div",{className:h?"mobile-session-list":"flex flex-col gap-2 p-3",children:[k.map(e=>h?(0,a.jsx)(j,{session:e,level:s,onPreview:u},e.id):(0,a.jsx)(v,{session:e,onSend:n,onKill:o,onMerge:l,onRestore:i},e.id)),h&&_>0?(0,a.jsxs)("button",{type:"button",className:"mobile-session-list__view-all",onClick:()=>f(!0),children:["View all ",r.length]}):null]}):h?(0,a.jsx)("div",{className:"mobile-session-list",children:(0,a.jsx)("div",{className:"mobile-session-list__empty",children:p.emptyMessage})}):null})]}):(0,a.jsxs)("div",{className:"kanban-column","data-level":s,children:[(0,a.jsx)("div",{className:"kanban-column__header",children:(0,a.jsxs)("div",{className:"kanban-column__title-row",children:[(0,a.jsx)("div",{className:"kanban-column__dot","data-level":s}),(0,a.jsx)("span",{className:"kanban-column__title",children:p.label}),(0,a.jsx)("span",{className:"kanban-column__count",children:r.length})]})}),(0,a.jsx)("div",{className:"kanban-column-body",children:r.length>0?(0,a.jsx)("div",{className:"kanban-column__stack",children:r.map(e=>(0,a.jsx)(v,{session:e,onSend:n,onKill:o,onMerge:l,onRestore:i},e.id))}):null})]})},function(e,s){return e.level===s.level&&e.collapsed===s.collapsed&&e.onToggle===s.onToggle&&e.onSend===s.onSend&&e.onKill===s.onKill&&e.onMerge===s.onMerge&&e.onRestore===s.onRestore&&e.compactMobile===s.compactMobile&&e.onPreview===s.onPreview&&e.resetKey===s.resetKey&&e.sessions.length===s.sessions.length&&e.sessions.every((e,r)=>e===s.sessions[r])});function j(e){let{session:s,level:r,onPreview:t}=e,n=[s.branch,s.pr?"PR #".concat(s.pr.number):null,s.issueLabel].filter(Boolean);return(0,a.jsxs)("div",{className:"mobile-session-row",children:[(0,a.jsxs)("button",{type:"button",className:"mobile-session-row__preview",onClick:()=>null==t?void 0:t(s),"aria-label":"Open ".concat((0,h.Pn)(s)),children:[(0,a.jsxs)("div",{className:"mobile-session-row__line",children:[(0,a.jsx)("span",{className:"mobile-session-row__dot","data-level":r,"aria-hidden":"true"}),(0,a.jsx)("span",{className:"mobile-session-row__title",children:(0,h.Pn)(s)})]}),(0,a.jsx)("div",{className:"mobile-session-row__meta",children:n.length>0?n.join(" \xb7 "):"No branch or PR metadata"})]}),(0,a.jsxs)("div",{className:"mobile-session-row__side",children:[(0,a.jsx)(f,{session:s,level:r}),(0,a.jsx)("a",{href:(0,p.Nc)(s.projectId,s.id),className:"mobile-session-row__open","aria-label":"Go to ".concat((0,h.Pn)(s)),children:(0,a.jsxs)("svg",{className:"mobile-session-row__open-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.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,a.jsx)("path",{d:"m8 10 2 2-2 2M12 14h4"})]})})]})]})}function f(e){var s,r,t,n;let{session:o,level:l}=e,i=g[l].label.toLowerCase();return"merge"===l&&o.pr&&(0,c.QN)(o.pr)?i="ready":"action"===l?i="needs_input"===o.status?"needs input":"stuck"===o.status?"stuck":"errored"===o.status?"errored":"waiting_input"===o.activity?"waiting":"exited"===o.activity?"crashed":"blocked"===o.activity?"blocked":"ci_failed"===o.status?"ci failed":"changes_requested"===o.status?"changes":(null==(t=o.pr)?void 0:t.ciStatus)==="failing"?"ci failed":(null==(n=o.pr)?void 0:n.reviewDecision)==="changes_requested"?"changes":o.pr&&!o.pr.mergeability.noConflicts?"conflicts":"action":"respond"===l?i="waiting_input"===o.activity?"waiting":"needs input":"review"===l?i=(null==(s=o.pr)?void 0:s.reviewDecision)==="changes_requested"?"changes":"review":"pending"===l?i=(null==(r=o.pr)?void 0:r.unresolvedThreads)?"threads":"pending":"working"===l&&(i="idle"===o.activity?"idle":"active"),(0,a.jsx)("span",{className:"mobile-session-row__chip",children:i})}var k=r(7848),_=r(5309),N=r(5184),w=r(9293);let y=["Working","Pending","Review","Respond","Merge"];function C(e){let{message:s,orchestratorHref:r,onSpawnOrchestrator:t=null,spawnLabel:n="Spawn Orchestrator",spawnDisabled:o=!1}=e;return(0,a.jsxs)("div",{className:"board-wrapper",children:[(0,a.jsx)("div",{className:"kanban-ghost","aria-hidden":"true",children:y.map(e=>(0,a.jsx)("div",{className:"kanban-ghost__col",children:(0,a.jsx)("div",{className:"kanban-ghost__head",children:e})},e))}),(0,a.jsx)("div",{className:"board-center",children:(0,a.jsxs)("div",{className:"empty-state",role:"status",children:[(0,a.jsx)("div",{className:"empty-state__icon",children:(0,a.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"5.5",r:"2.5",fill:"rgba(249,115,22,0.18)",stroke:"#f97316",strokeWidth:"1.5"}),(0,a.jsx)("circle",{cx:"5.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,a.jsx)("circle",{cx:"18.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,a.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,a.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,a.jsx)("line",{x1:"7.8",y1:"17",x2:"16.2",y2:"17",stroke:"var(--color-border-subtle)",strokeWidth:"1",strokeDasharray:"2.5 2"})]})}),s?(0,a.jsx)("p",{className:"empty-state__text",children:s}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"empty-state__headline",children:"Ready to orchestrate"}),(0,a.jsx)("p",{className:"empty-state__hint",children:"Open the main orchestrator to start a session and fan out parallel agents across your codebase."}),r?(0,a.jsxs)("a",{href:r,className:"empty-state__cta",children:[(0,a.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,a.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,a.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Open Orchestrator"]}):t?(0,a.jsxs)("button",{type:"button",className:"empty-state__cta",onClick:t,disabled:o,children:[(0,a.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,a.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,a.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),n]}):null]})]})})]})}var M=r(2446);function S(e){let{status:s}=e;return"connected"===s?null:"disconnected"===s?(0,a.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,a.jsx)("div",{className:"connection-bar connection-bar--reconnecting",role:"status","aria-live":"polite","aria-atomic":"true",children:"Reconnecting…"})}let P=[/\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 R(e){let{projectId:s}=e,{showToast:r}=(0,M.d)(),[n,o]=(0,t.useState)(!1),l=(0,t.useCallback)(async()=>{if(!n){o(!0);try{let e,a=await fetch("/api/observability",{credentials:"same-origin"});if(!a.ok)return void r("Could not fetch observability snapshot","error");let t=a.headers.get("x-correlation-id");try{e=await a.json()}catch(e){r("Could not parse observability snapshot","error");return}let n=function e(s){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakSet;if("string"==typeof s)return P.reduce((e,s)=>e.replace(s,"[REDACTED]"),s);if(Array.isArray(s))return s.map(s=>e(s,r));if(s&&"object"==typeof s){if(r.has(s))return"[Circular]";r.add(s);let a={};for(let[t,n]of Object.entries(s))a[t]=e(n,r);return a}return s}(function(e,s){if(!s||!e||"object"!=typeof e)return e;let r={...e},a=r.projects;if(a&&"object"==typeof a&&!Array.isArray(a)){let e=a[s];r.projects=void 0===e?{}:{[s]:e}}return r}(e,s)),o={copiedAt:new Date().toISOString(),pageHref:"".concat(window.location.origin).concat(window.location.pathname),projectId:null!=s?s:null,correlationId:t,userAgent:navigator.userAgent,observability:n};await navigator.clipboard.writeText(JSON.stringify(o,null,2)),r("Debug bundle copied to clipboard","success")}catch(e){r("Could not copy debug bundle","error")}finally{o(!1)}}},[n,s,r]);return(0,a.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 l(),disabled:n,"aria-label":"Copy debug bundle for issue reports",children:[(0,a.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,a.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 W=r(2466);let I=["working","pending","action","merge"],T=["working","pending","review","respond","merge"],A=[];function B(e){var s;let{session:r,onRestore:t}=e,n=!r.summaryIsFallback&&r.summary||r.issueTitle||r.summary||r.id,o=(null==(s=r.pr)?void 0:s.state)==="merged"||"merged"===r.status,l="killed"===r.status||"terminated"===r.status,i=!c.N_.has(r.status);return(0,a.jsxs)("div",{className:"done-card",children:[(0,a.jsx)("p",{className:"done-card__title",children:n}),(0,a.jsxs)("div",{className:"done-card__meta",children:[(0,a.jsx)("span",{className:"done-card__badge ".concat(l?"done-card__badge--terminated":"done-card__badge--merged"),children:o?"merged":l?"terminated":"done"}),r.pr?(0,a.jsxs)("a",{href:r.pr.url,target:"_blank",rel:"noopener noreferrer",className:"done-card__pr",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,a.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,a.jsx)("path",{d:"M6 9v3a6 6 0 0 0 6 6h3"})]}),"#",r.pr.number]}):null,(0,a.jsx)("span",{className:"done-card__age",children:function(e){if(!e)return"just now";let s=new Date(e).getTime();if(!Number.isFinite(s))return"just now";let r=Date.now()-s;if(r<=0)return"just now";let a=Math.floor(r/1e3),t=Math.floor(a/60),n=Math.floor(t/60),o=Math.floor(n/24);return a<60?"".concat(a,"s ago"):t<60?"".concat(t,"m ago"):n<24?"".concat(n,"h ago"):"".concat(o,"d ago")}(r.lastActivityAt)}),i?(0,a.jsx)("button",{type:"button",className:"done-card__restore",onClick:e=>{e.stopPropagation(),t(r.id)},children:"Restore"}):null]})]})}function D(e){var s,r,n,d;let{initialSessions:h,projectId:u,projectName:x,projects:m=[],orchestrators:v,attentionZones:g="simple",dashboardLoadError:j}=e,f=null!=v?v:A,y=(0,N.eT)(),P="detailed"===g?T:I,D=(0,t.useMemo)(()=>{let e={};for(let s of h)e[s.id]=(0,c.ng)(s,g);return e},[h,g]),{sessions:O,attentionLevels:L,liveSessionsResolved:E,loadError:H}=(0,_.D)({initialSessions:h,muxSessions:(null==y?void 0:y.status)==="connected"?y.sessions:void 0,muxLastError:null==y?void 0:y.lastError,initialAttentionLevels:D,attentionZones:g}),K=(0,t.useMemo)(()=>u?O.filter(e=>e.projectId===u):O,[O,u]),Z=(null==y?void 0:y.status)==="disconnected"?"disconnected":(null==y?void 0:y.status)==="connected"?"connected":"reconnecting",q=null!=H?H:j&&E?void 0:j,U=(0,l.useSearchParams)(),z=(0,l.useRouter)(),V=(0,t.useRef)(z);V.current=z;let G=null!=(s=U.get("session"))?s:void 0,[J,Q]=(0,t.useState)(!1),[$,X]=(0,t.useState)(f),[Y,ee]=(0,t.useState)([]),[es,er]=(0,t.useState)({}),[ea,et]=(0,t.useState)(!1),[en,eo]=(0,t.useState)(!1),el=(0,i.U)(i.D),ei=U.get("debug"),ec=m.length>=1,{showToast:ed}=(0,M.d)(),[eh,eu]=(0,t.useState)(!1),ex=(0,t.useRef)(O);ex.current=O;let ep=m.length>1&&ec&&void 0===u,em=(0,t.useMemo)(()=>{var e;return u&&null!=(e=$.find(e=>e.projectId===u))?e:null},[$,u]),ev=em?(0,p.Nc)(em.projectId,em.id):null,eg=!ep&&!!u&&m.some(e=>e.id===u&&!e.resolveError)&&!ev,eb=u&&null!=(r=m.find(e=>e.id===u))?r:null,ej=!!u&&Y.includes(u),ef=u&&null!=(n=es[u])?n:null,ek=(0,t.useMemo)(()=>ep||!G?K:K.filter(e=>e.id===G),[K,ep,G]);(0,t.useEffect)(()=>{X(e=>(function(e,s){let r=new Map(e.map(e=>[e.projectId,e]));for(let e of s)r.set(e.projectId,e);return[...r.values()]})(e,f))},[f]),(0,t.useEffect)(()=>{let e=(0,k.S)(L),s=null!=x?x:"ao";document.title=e>0?"".concat(s," (").concat(e," need attention)"):s},[L,x]),(0,t.useEffect)(()=>{eo(!1)},[U]);let e_=(0,t.useMemo)(()=>{let e={merge:[],action:[],respond:[],review:[],pending:[],working:[],done:[]};for(let s of ek)e[(0,c.ng)(s,g)].push(s);return e},[ek,g]),eN=(0,t.useMemo)(()=>{let e=new Map;for(let s of O){let r=e.get(s.projectId);if(r){r.push(s);continue}e.set(s.projectId,[s])}return e},[O]),ew=(0,t.useMemo)(()=>ep?m.map(e=>{var s,r;let a=null!=(s=eN.get(e.id))?s:[],t={merge:0,action:0,respond:0,review:0,pending:0,working:0,done:0};for(let e of a)t[(0,c.ng)(e,g)]++;return{project:e,orchestrator:null!=(r=$.find(s=>s.projectId===e.id))?r:null,sessionCount:a.length,openPRCount:a.filter(e=>{var s;return(null==(s=e.pr)?void 0:s.state)==="open"}).length,counts:t}}):[],[$,ep,g,m,eN]),ey=(0,t.useCallback)(async(e,s)=>{try{let r=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:s})});if(!r.ok){let s=await r.text()||"Unknown error";console.error("Failed to send message to ".concat(e,":"),s),ed("Send failed: ".concat(s),"error");let a=Error(s);throw a.toastShown=!0,a}}catch(s){throw s instanceof Error&&"toastShown"in s&&s.toastShown||(console.error("Network error sending message to ".concat(e,":"),s),ed("Network error while sending message","error")),s}},[ed]),eC=(0,t.useCallback)(async e=>{try{let s=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/kill"),{method:"POST"});if(s.ok)ed("Session terminated","success");else{let r=await s.text();console.error("Failed to kill ".concat(e,":"),r),ed("Terminate failed: ".concat(r),"error")}}catch(s){console.error("Network error killing ".concat(e,":"),s),ed("Network error while terminating session","error")}},[ed]),eM=(0,t.useCallback)(e=>{var s;let r=null!=(s=ex.current.find(s=>s.id===e))?s:null;r&&eC(r.id)},[eC]),eS=(0,t.useCallback)(async e=>{try{let s=await fetch("/api/prs/".concat(e,"/merge"),{method:"POST"});if(s.ok)ed("PR #".concat(e," merged"),"success");else{let r=await s.text();console.error("Failed to merge PR #".concat(e,":"),r),ed("Merge failed: ".concat(r),"error");return}}catch(s){console.error("Network error merging PR #".concat(e,":"),s),ed("Network error while merging PR","error")}},[ed]),eP=(0,t.useCallback)(async e=>{try{let s=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/restore"),{method:"POST"});if(s.ok)ed("Session restored","success"),V.current.refresh();else{let r=await s.text();console.error("Failed to restore ".concat(e,":"),r),ed("Restore failed: ".concat(r),"error")}}catch(s){console.error("Network error restoring ".concat(e,":"),s),ed("Network error while restoring session","error")}},[ed]),eR=async e=>{ee(s=>s.includes(e.id)?s:[...s,e.id]),er(s=>{let{[e.id]:r,...a}=s;return a});try{let r=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e.id})}),a=await r.json().catch(()=>null);if(!r.ok||!(null==a?void 0:a.orchestrator)){var s;throw Error(null!=(s=null==a?void 0:a.error)?s:"Failed to spawn orchestrator for ".concat(e.name))}let t=a.orchestrator;X(s=>{let r=s.filter(s=>s.projectId!==e.id);return r.push(t),r})}catch(r){let s=r instanceof Error?r.message:"Failed to spawn orchestrator";er(r=>({...r,[e.id]:s})),console.error("Failed to spawn orchestrator for ".concat(e.id,":"),r)}finally{ee(s=>s.filter(s=>s!==e.id))}},eW=P.some(e=>e_[e].length>0),eI=!ep&&!eW&&!q,eT=q?(0,a.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,a.jsx)("span",{className:"font-semibold text-[var(--color-status-error)]",children:"Orchestrator failed to load"}),(0,a.jsx)("span",{className:"break-words text-[var(--color-text-secondary)]",children:q}),(0,a.jsxs)("span",{className:"text-[var(--color-text-secondary)]",children:["Confirm ",(0,a.jsx)("span",{className:"font-mono text-[10px]",children:"agent-orchestrator.yaml"})," exists and is valid, then run ",(0,a.jsx)("span",{className:"font-mono text-[10px]",children:"ao doctor"})," for diagnostics."]})]}):null,eA=(0,t.useMemo)(()=>O.some(e=>e.pr&&(0,c.fZ)(e.pr)),[O]),eB="agent orchestrator"===(null==x?void 0:x.trim().toLowerCase())?null!=(d=null!=u?u:x)?d:ep?"All projects":"Dashboard":null!=x?x:ep?"All projects":"Dashboard",eD=!ep&&eB.trim().length>0,eO=()=>{window.innerWidth<768?eo(e=>!e):et(e=>!e)};return(0,a.jsx)(W.I.Provider,{value:{onToggleSidebar:eO,mobileSidebarOpen:en},children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S,{status:Z}),(0,a.jsxs)("div",{className:"dashboard-app-shell",children:[(0,a.jsxs)("header",{className:"dashboard-app-header",children:[ec?(0,a.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:eO,"aria-label":"Toggle sidebar",children:el?(0,a.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,a.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,a.jsx)("path",{d:"M9 3v18"})]})}):null,(0,a.jsxs)("div",{className:"dashboard-app-header__brand",children:[(0,a.jsx)("span",{className:"dashboard-app-header__brand-dot","aria-hidden":"true"}),(0,a.jsx)("span",{children:"Agent Orchestrator"})]}),eD?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"dashboard-app-header__sep","aria-hidden":"true"}),(0,a.jsx)("span",{className:"dashboard-app-header__project",children:eB})]}):null,el||"1"!==ei&&"true"!==ei?null:(0,a.jsx)(R,{projectId:u}),(0,a.jsx)("div",{className:"dashboard-app-header__spacer"}),(0,a.jsx)("div",{className:"dashboard-app-header__actions",children:!ep&&ev?(0,a.jsxs)(o(),{href:ev,className:"dashboard-app-btn dashboard-app-btn--amber","aria-label":"Orchestrator",children:[(0,a.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,a.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,a.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Orchestrator"]}):eg&&eb?(0,a.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--amber","aria-label":"Spawn Orchestrator",onClick:()=>void eR(eb),disabled:ej,children:[(0,a.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,a.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,a.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),ej?"Spawning...":"Spawn Orchestrator"]}):null})]}),(0,a.jsxs)("div",{className:"dashboard-shell dashboard-shell--desktop".concat(ea?" dashboard-shell--sidebar-collapsed":""),children:[ec&&(0,a.jsx)("div",{className:"sidebar-wrapper".concat(en?" sidebar-wrapper--mobile-open":""),children:(0,a.jsx)(w.u,{projects:m,sessions:O,orchestrators:$,activeProjectId:u,activeSessionId:G,collapsed:ea,onToggleCollapsed:()=>et(e=>!e),onMobileClose:()=>eo(!1)})}),en&&(0,a.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>eo(!1)}),(0,a.jsxs)("main",{className:"dashboard-main dashboard-main--desktop",children:[(0,a.jsx)(k.u,{attentionLevels:L,projectName:x}),(0,a.jsxs)("div",{className:"dashboard-main__subhead",children:[(0,a.jsx)("h1",{className:"dashboard-main__title",children:"Dashboard"}),(0,a.jsx)("p",{className:"dashboard-main__subtitle",children:"Live agent sessions, pull requests, and merge status."})]}),(0,a.jsxs)("div",{className:"dashboard-main__body",children:[eT,eA&&!J&&(0,a.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,a.jsxs)("svg",{className:"h-3.5 w-3.5 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),(0,a.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,a.jsx)("button",{onClick:()=>Q(!0),className:"ml-1 shrink-0 opacity-60 hover:opacity-100","aria-label":"Dismiss",children:(0,a.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),ep&&(0,a.jsx)(F,{overviews:ew,onSpawnOrchestrator:eR,spawningProjectIds:Y,spawnErrors:es,attentionZones:g}),!ep&&eW&&(0,a.jsx)("div",{className:"kanban-board-wrap",children:(0,a.jsx)("div",{className:"kanban-board","data-columns":P.length,style:{"--kanban-column-count":P.length},children:P.map(e=>(0,a.jsx)(b,{level:e,sessions:e_[e],onSend:ey,onKill:eM,onMerge:eS,onRestore:eP},e))})}),eI?(0,a.jsx)(C,{orchestratorHref:ev,onSpawnOrchestrator:eg&&eb?()=>{eR(eb)}:null,spawnLabel:ej?"Spawning...":"Spawn Orchestrator",spawnDisabled:ej}):null,!ep&&ef?(0,a.jsx)("p",{className:"mt-3 text-[11px] text-[var(--color-status-error)]",children:ef}):null,!ep&&e_.done.length>0&&(0,a.jsxs)("div",{className:"done-bar mt-6",children:[(0,a.jsxs)("button",{type:"button",className:"done-bar__toggle",onClick:()=>eu(e=>!e),"aria-expanded":eh,children:[(0,a.jsx)("svg",{className:"done-bar__chevron".concat(eh?" done-bar__chevron--open":""),fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"m9 18 6-6-6-6"})}),(0,a.jsx)("span",{className:"done-bar__label",children:"Done / Terminated"}),(0,a.jsx)("span",{className:"done-bar__count",children:e_.done.length})]}),eh&&(0,a.jsx)("div",{className:"done-bar__cards",children:e_.done.map(e=>(0,a.jsx)(B,{session:e,onRestore:eP},e.id))})]})]})]})]})]})]})})}function O(e){return(0,a.jsx)(M.t,{children:(0,a.jsx)(D,{...e})})}function F(e){let{overviews:s,onSpawnOrchestrator:r,spawningProjectIds:t,spawnErrors:n,attentionZones:l}=e;return(0,a.jsx)("div",{className:"mb-8 grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:s.map(e=>{let{project:s,orchestrator:i,sessionCount:c,openPRCount:d,counts:h}=e,u=!!s.resolveError,x=(0,p.bn)(s.id);return(0,a.jsxs)("section",{className:"border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] p-4",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-[14px] font-semibold text-[var(--color-text-primary)]",children:s.name}),(0,a.jsx)("div",{className:"mt-1 text-[11px] text-[var(--color-text-muted)]",children:u?"Config needs repair":(0,a.jsxs)(a.Fragment,{children:[c," active session",1!==c?"s":"",d>0?" \xb7 ".concat(d," open PR").concat(1!==d?"s":""):""]})})]}),(0,a.jsx)(o(),{href:x,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,a.jsxs)("div",{className:"mb-4 flex flex-wrap gap-2",children:[(0,a.jsx)(L,{label:"Merge",value:h.merge,tone:"ready"}),"detailed"===l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{label:"Respond",value:h.respond,tone:"error"}),(0,a.jsx)(L,{label:"Review",value:h.review,tone:"orange"})]}):(0,a.jsx)(L,{label:"Action",value:h.action,tone:"orange"}),(0,a.jsx)(L,{label:"Pending",value:h.pending,tone:"attention"}),(0,a.jsx)(L,{label:"Working",value:h.working,tone:"working"})]}),(0,a.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("div",{className:"text-[11px] text-[var(--color-text-muted)]",children:u?"Project config could not be resolved":i?"Per-project orchestrator available":"No running orchestrator"}),u?(0,a.jsx)(o(),{href:x,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"}):i?(0,a.jsxs)(o(),{href:(0,p.Nc)(i.projectId,i.id),className:"orchestrator-btn flex items-center gap-2 px-3 py-1.5 text-[11px] font-semibold hover:no-underline",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--color-accent)] opacity-80"}),"orchestrator"]}):(0,a.jsx)("button",{type:"button",onClick:()=>void r(s),disabled:t.includes(s.id),className:"orchestrator-btn px-3 py-1.5 text-[11px] font-semibold disabled:cursor-wait disabled:opacity-70",children:t.includes(s.id)?"Spawning...":"Spawn Orchestrator"})]}),n[s.id]?(0,a.jsx)("p",{className:"mt-2 text-[11px] text-[var(--color-status-error)]",children:n[s.id]}):null]})]},s.id)})})}function L(e){let{label:s,value:r,tone:t}=e;return(0,a.jsxs)("div",{className:"min-w-[78px] border border-[var(--color-border-subtle)] px-2.5 py-2",children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-[0.08em] text-[var(--color-text-tertiary)]",children:s}),(0,a.jsx)("div",{className:"project-metric__value mt-1 text-[18px] font-semibold tabular-nums","data-tone":t,children:r})]})}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4465],{2466:(e,s,r)=>{r.d(s,{I:()=>a});let a=(0,r(6749).createContext)(null)},4465:(e,s,r)=>{r.d(s,{Dashboard:()=>O});var a=r(3817),t=r(6749),n=r(8713),o=r.n(n),l=r(7594),i=r(9120),c=r(545),d=r(4901),h=r(7387),u=r(4906),x=r(1237),p=r(8450);let m=new Set,v=(0,t.memo)(function(e){var s,r,n,o,l,i;let{session:v,onSend:g,onKill:b,onMerge:j,onRestore:f}=e,[k,_]=(0,t.useState)(!1),[N,w]=(0,t.useState)(null),[y,C]=(0,t.useState)(null),[M,S]=(0,t.useState)(null),[P,R]=(0,t.useState)(null),[W,I]=(0,t.useState)(!1),[T,A]=(0,t.useState)(""),B=(0,t.useRef)(null),D=(0,t.useRef)(null),[O]=(0,t.useState)(()=>m.has(v.id));(0,t.useEffect)(()=>{if(O)return;let e=window.requestAnimationFrame(()=>{m.add(v.id)});return()=>{window.cancelAnimationFrame(e)}},[O,v.id]);let F=(0,c.ng)(v),L=v.pr,E=async e=>{let s=e.trim();if(!s||null!==M)return!1;S(s),R(null);try{return await Promise.resolve(null==g?void 0:g(v.id,s)),R(s),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>R(null),2e3),!0}catch(e){return!1}finally{S(null)}},H=async e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),await E(T)&&A(""))};(0,t.useEffect)(()=>()=>{B.current&&clearTimeout(B.current),D.current&&clearTimeout(D.current)},[]);let K=async(e,s)=>{if(null===N){w(e),C(null);try{await Promise.resolve(null==g?void 0:g(v.id,s)),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>w(null),2e3)}catch(s){w(null),C(e),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>C(null),2e3)}}},Z=!!L&&(0,c.fZ)(L),q=!!L&&(0,c.sZ)(L),U=function(e){var s,r,t,n,o;let l=e.pr;if(!l||"open"!==l.state||(0,c.fZ)(l)||(0,c.sZ)(l))return[];let i=e.metadata,d=[],h=null!=(r=null==(s=e.lifecycle)?void 0:s.prReason)?r:null,u=i.status,x=l.ciStatus===c.U1.FAILING||"ci_failing"===h||"ci_failed"===u,p="changes_requested"===l.reviewDecision||"changes_requested"===h||"changes_requested"===u,m=!l.mergeability.noConflicts;if(x){let e=l.ciChecks.find(e=>"failed"===e.status),s=l.ciChecks.filter(e=>"failed"===e.status).length;0===s&&l.ciStatus!==c.U1.FAILING?d.push({key:"ci-fail",type:"ci",icon:"✗",label:"CI failing",url:l.url+"/checks",notified:!!i.lastCIFailureDispatchHash,actionLabel:"Ask to fix",actionMessage:"Please fix the failing CI checks on ".concat(l.url)}):0===s?d.push({key:"ci-unknown",type:"ci",icon:"?",label:"CI unknown",url:l.url+"/checks"}):d.push({key:"ci-fail",type:"ci",icon:"✗",count:s,label:"check".concat(s>1?"s":""," failing"),url:null!=(t=null==e?void 0:e.url)?t:l.url+"/checks",notified:!!i.lastCIFailureDispatchHash,actionLabel:"Ask to fix",actionMessage:"Please fix the failing CI checks on ".concat(l.url)})}if(p?d.push({key:"changes",type:"changes",icon:"↻",label:"changes requested",url:l.url,notified:!!i.lastPendingReviewDispatchHash,actionLabel:"Ask to address",actionMessage:"Please address the requested changes on ".concat(l.url)}):l.isDraft||"pending"!==l.reviewDecision&&"none"!==l.reviewDecision||d.push({key:"review",type:"review",icon:(0,a.jsxs)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),(0,a.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,a.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:l.url,actionLabel:"Ask to post",actionMessage:"Post ".concat(l.url," on slack asking for a review.")}),m&&d.push({key:"conflict",type:"conflict",icon:"⚠",label:"merge conflict",url:l.url,notified:"true"===i.lastMergeConflictDispatched,actionLabel:"Ask to fix",actionMessage:"Please resolve the merge conflicts on ".concat(l.url," by rebasing on the base branch")}),l.unresolvedThreads>0){let e=null!=(o=null==(n=l.unresolvedComments[0])?void 0:n.url)?o:l.url+"/files";d.push({key:"comments",type:"comment",icon:"\uD83D\uDCAC",label:"unresolved comments",count:l.unresolvedThreads,url:e,actionLabel:"Ask to resolve",actionMessage:"Please address all unresolved review comments on ".concat(l.url)})}return d}(v),z=!Z&&(null==L?void 0:L.mergeability.mergeable)&&"open"===L.state,V=(0,c.nH)(v),G=(0,c.wy)(v),J=(0,h.Pn)(v),Q=(n=v,o=F,z||"merge"===o?"mergeable":(null==(l=n.lifecycle)?void 0:l.sessionState)==="detecting"?"detecting":"respond"===o?(0,c.Ou)(n):(null==(i=n.lifecycle)?void 0:i.prReason)==="ci_failing"||"ci_failed"===n.status?"ci failing":"review"===o?(0,c.of)(n):(0,c.Ou)(n)),$=Z||!L||q?[]:L.ciChecks.filter(e=>"passed"===e.status).slice(0,3),X=(0,c.dG)(v)||"done"===F,Y=v.lifecycle?["Session ".concat((0,c.Ou)(v)),"PR ".concat((0,c.of)(v)),"Runtime ".concat((0,c.Kw)(v))].join(" \xb7 "):null,ee=v.issueLabel?"".concat(v.issueLabel).concat(v.issueTitle?" \xb7 ".concat(v.issueTitle):""):null!=(s=v.issueTitle)?s:v.summary&&v.summary!==J?v.summary:null,es=z?"session-card--merge-frame":U.length>0?"session-card--alert-frame":"session-card--fixed",er=z?"session-card--accent-merge":"working"===F?"session-card--accent-working":"respond"===F?"session-card--accent-respond":"review"===F||"pending"===F?"session-card--accent-attention":"session-card--accent-default";if(X){let e=function(e){var s,r,t,n;let o=e.activity,l=e.status,i=null!=(n=null==(s=e.lifecycle)?void 0:s.prState)?n:null==(r=e.pr)?void 0:r.state;return"merged"===i||"merged"===l?{label:"merged",pillClass:"done-status-pill--merged",icon:(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,a.jsx)("path",{d:"M20 6 9 17l-5-5"})})}:"closed"===i?{label:"closed",pillClass:"done-status-pill--exited",icon:(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,a.jsx)("path",{d:"M9 12h6"})]})}:(null==(t=e.lifecycle)?void 0:t.sessionState)==="terminated"||"killed"===l||"terminated"===l?{label:(0,c.Ou)(e),pillClass:"done-status-pill--killed",icon:(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,a.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}:{label:"exited"===o?"exited":(0,c.Ou)(e),pillClass:"done-status-pill--exited",icon:(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,a.jsx)("path",{d:"M9 12h6"})]})}}(v);return(0,a.jsxs)("div",{className:(0,d.cn)("session-card-done",k&&"done-expanded"),onClick:e=>{e.target.closest("a, button, textarea")||_(!k)},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,a.jsxs)("span",{className:(0,d.cn)("done-status-pill",e.pillClass),children:[e.icon,e.label]}),(0,a.jsx)("span",{className:"font-[var(--font-mono)] text-[10px] tracking-wide text-[var(--color-text-muted)]",children:v.id}),(0,a.jsx)("div",{className:"flex-1"}),G&&(0,a.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==f||f(v.id)},className:"done-restore-btn",children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,a.jsx)("polyline",{points:"1 4 1 10 7 10"}),(0,a.jsx)("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),"restore"]})]}),(0,a.jsx)("div",{className:"px-3.5 pb-2",children:(0,a.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:J})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 px-3.5 pb-3",children:[v.branch&&(0,a.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-2.5 w-2.5 opacity-50",children:[(0,a.jsx)("path",{d:"M6 3v12M18 9a3 3 0 0 1-3 3H9a3 3 0 0 0-3 3"}),(0,a.jsx)("circle",{cx:"18",cy:"6",r:"3"})]}),v.branch]}),L&&(0,a.jsxs)("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-bold text-[var(--color-text-primary)] no-underline underline-offset-2 hover:underline",children:["#",L.number]}),L&&!Z&&(q?(0,a.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,a.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,a.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",L.additions]})," ",(0,a.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",L.deletions]})," ",(0,x.i_)(L.additions,L.deletions),(0,a.jsx)("span",{className:"sr-only",children:"+".concat(L.additions," -").concat(L.deletions," ").concat((0,x.i_)(L.additions,L.deletions))})]})),(0,a.jsx)("a",{href:(0,p.Nc)(v.projectId,v.id),onClick:e=>e.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-semibold text-[var(--color-accent)] no-underline hover:underline",children:"View current context"})]}),k&&(0,a.jsxs)("div",{className:"done-expand-section px-3.5 py-3",children:[v.summary&&(null==L?void 0:L.title)&&v.summary!==L.title&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("div",{className:"done-detail-heading",children:[(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M4 6h16M4 12h16M4 18h10"})}),"Summary"]}),(0,a.jsx)("p",{className:"text-[12px] leading-relaxed text-[var(--color-text-secondary)]",children:v.summary})]}),v.issueUrl&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("div",{className:"done-detail-heading",children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"Issue"]}),(0,a.jsxs)("a",{href:v.issueUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"text-[12px] text-[var(--color-accent)] hover:underline",children:[v.issueLabel||v.issueUrl,v.issueTitle&&": ".concat(v.issueTitle)]})]}),L&&L.ciChecks.length>0&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("div",{className:"done-detail-heading",children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M9 12l2 2 4-4"}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"})]}),"CI Checks"]}),(0,a.jsx)(u.zm,{checks:L.ciChecks})]}),L&&(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("div",{className:"done-detail-heading",children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.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,a.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]}),"PR"]}),(0,a.jsxs)("p",{className:"text-[12px] text-[var(--color-text-secondary)]",children:[(0,a.jsx)("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"hover:underline",children:L.title}),q?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2 text-[10px] text-[var(--color-text-muted)]",children:[(0,a.jsx)("span",{className:"inline-block h-3 w-12 animate-pulse rounded bg-[var(--color-bg-subtle)]"}),(0,a.jsx)("span",{children:"PR details loading..."})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,a.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",L.additions]})," ",(0,a.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",L.deletions]})]}),(0,a.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,a.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["mergeable: ",L.mergeability.mergeable?"yes":"no"]}),(0,a.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,a.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["review: ",L.reviewDecision]})]})]})]})]}),!L&&(0,a.jsx)("p",{className:"text-[12px] text-[var(--color-text-tertiary)]",children:"No PR associated with this session."})]})]})}let ea=V?"exited":z||"merge"===F||"review"===F?"ready":"respond"===F?"waiting":"pending"===F?"idle":"working"===F?"working":"idle";return(0,a.jsxs)("div",{className:(0,d.cn)("session-card border",!O&&"kanban-card-enter",es,er,z&&"card-merge-ready"),children:[(0,a.jsxs)("div",{className:"session-card__header",children:[(0,a.jsx)("span",{className:(0,d.cn)("card__adot","working"===ea&&"card__adot--working","ready"===ea&&"card__adot--ready","idle"===ea&&"card__adot--idle","waiting"===ea&&"card__adot--waiting","exited"===ea&&"card__adot--exited")}),(0,a.jsx)("span",{className:"card__id",children:v.id}),(0,a.jsx)("div",{className:"flex-1"}),G&&(0,a.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==f||f(v.id)},className:"session-card__control session-card__restore-control",children:[(0,a.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M20 11a8 8 0 0 0-14.9-3.98"}),(0,a.jsx)("path",{d:"M4 5v4h4"}),(0,a.jsx)("path",{d:"M4 13a8 8 0 0 0 14.9 3.98"}),(0,a.jsx)("path",{d:"M20 19v-4h-4"})]}),"restore"]}),!V&&(0,a.jsxs)("a",{href:(0,p.$l)(v.projectId,v.id,"#session-terminal-section"),onClick:e=>e.stopPropagation(),className:"session-card__control session-card__terminal-link",children:[(0,a.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),(0,a.jsx)("path",{d:"M6 10l4 2-4 2"}),(0,a.jsx)("path",{d:"M14 14h4"})]}),"terminal"]})]}),(0,a.jsxs)("div",{className:"session-card__body flex min-h-0 flex-1 flex-col",children:[(0,a.jsx)("div",{className:"card__title-wrap",children:(0,a.jsx)("p",{className:"card__title",children:J})}),(0,a.jsxs)("div",{className:"card__meta",children:[v.branch&&(0,a.jsx)("span",{className:"card__branch",children:v.branch}),v.branch&&L?(0,a.jsx)("span",{className:"card__meta-sep","aria-hidden":"true",children:"\xb7"}):null,L&&(0,a.jsxs)("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"card__pr",children:["#",L.number]}),L&&!Z&&(q?(0,a.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,a.jsxs)("span",{className:"card__diff inline-flex items-center",children:[(0,a.jsxs)("span",{className:"card__diff-add",children:["+",L.additions]})," ",(0,a.jsxs)("span",{className:"card__diff-del",children:["-",L.deletions]})," ",(0,a.jsx)("span",{className:"card__diff-size",children:(0,x.i_)(L.additions,L.deletions)}),(0,a.jsx)("span",{className:"sr-only",children:"+".concat(L.additions," -").concat(L.deletions," ").concat((0,x.i_)(L.additions,L.deletions))})]}))]}),ee&&(0,a.jsx)("div",{className:"px-[10px] pb-[5px]",children:"merge"===F||z?(0,a.jsxs)("p",{className:"session-card__secondary session-card__secondary--merge",children:[(0,a.jsx)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M20 6 9 17l-5-5"})}),(0,a.jsx)("span",{children:ee})]}):(0,a.jsx)("p",{className:"session-card__secondary",children:ee})}),Y&&(0,a.jsx)("div",{className:"px-[10px] pb-[5px]",children:(0,a.jsx)("p",{className:"text-[10px] leading-relaxed text-[var(--color-text-tertiary)]",children:Y})}),Z&&(null==L?void 0:L.state)==="open"&&(0,a.jsx)("div",{className:"px-[10px] pb-[5px]",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--color-text-muted)]",children:[(0,a.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,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"PR data rate limited"]})}),$.length>0&&(0,a.jsx)("div",{className:"card__ci",children:$.map(e=>{let s=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("svg",{width:"8",height:"8",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M20 6 9 17l-5-5"})}),e.name]});return e.url?(0,a.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"ci-chip ci-chip--pass",onClick:e=>e.stopPropagation(),children:s},e.name):(0,a.jsx)("span",{className:"ci-chip ci-chip--pass",children:s},e.name)})}),!Z&&U.length>0&&(0,a.jsx)("div",{className:"card__alerts flex flex-col",children:U.slice(0,3).map(e=>(0,a.jsxs)("div",{className:(0,d.cn)("alert-row","alert-row--".concat(e.type)),children:[(0,a.jsx)("span",{className:"alert-row__icon",children:e.icon}),(0,a.jsxs)("span",{className:"alert-row__text",children:[(0,a.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:[void 0!==e.count&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-bold",children:e.count})," "]}),e.label]}),e.notified&&(0,a.jsxs)("span",{className:"alert-row__notified",title:"Agent has been notified",children:[" ","\xb7 notified"]})]}),e.actionLabel&&(0,a.jsx)("button",{onClick:s=>{var r;s.stopPropagation(),K(e.key,null!=(r=e.actionMessage)?r:"")},disabled:N===e.key,className:"alert-row__action",children:N===e.key?"sent!":y===e.key?"failed":e.actionLabel})]},e.key))}),"respond"===F&&(0,a.jsxs)("div",{className:"quick-reply",onClick:e=>e.stopPropagation(),children:[v.summary&&!v.summaryIsFallback&&(0,a.jsxs)("div",{className:"card__agent-msg",children:[(0,a.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,a.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,a.jsx)("span",{children:v.summary})]}),(0,a.jsx)("a",{href:(0,p.Nc)(v.projectId,v.id),onClick:e=>e.stopPropagation(),className:"card__view-context",children:"View current context →"}),!V&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"card__presets",children:[(0,a.jsx)("button",{className:"card__preset",onClick:()=>void E("continue"),disabled:null!==M,children:"continue"===M?"Sending...":"continue"===P?"Sent":"Continue"}),(0,a.jsx)("button",{className:"card__preset",onClick:()=>void E("abort"),disabled:null!==M,children:"abort"===M?"Sending...":"abort"===P?"Sent":"Abort"}),(0,a.jsx)("button",{className:"card__preset",onClick:()=>void E("skip"),disabled:null!==M,children:"skip"===M?"Sending...":"skip"===P?"Sent":"Skip"})]}),(0,a.jsx)("div",{className:"card__reply-wrap",children:(0,a.jsx)("textarea",{className:"card__reply",placeholder:null!==M?"Sending...":"Type a reply... (Enter to send)","aria-label":"Type a reply to the agent",value:T,onChange:e=>A(e.target.value),onKeyDown:e=>{H(e)},rows:1,disabled:null!==M})})]})]}),(0,a.jsxs)("div",{className:"session-card__footer",children:[(0,a.jsx)("span",{className:"card__status min-w-0 truncate",title:null!=(r=v.userPrompt)?r:void 0,children:!v.issueUrl&&v.userPrompt?v.userPrompt.length>60?v.userPrompt.slice(0,60)+"…":v.userPrompt:Q}),z&&L?(0,a.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==j||j(L.number)},className:"session-card__control session-card__merge-control",children:[(0,a.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"6",cy:"6",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"18",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"6",r:"2"}),(0,a.jsx)("path",{d:"M8 6h5a3 3 0 0 1 3 3v7"})]}),"Merge PR #",L.number]}):!V&&(0,a.jsx)("button",{onClick:e=>{if(e.stopPropagation(),!W)return void I(!0);I(!1),null==b||b(v.id)},onMouseLeave:()=>I(!1),onBlur:()=>I(!1),"aria-label":W?"Confirm terminate session":"Terminate session",className:(0,d.cn)("session-card__control session-card__terminate btn--danger",W&&"is-confirming"),children:W?(0,a.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:"kill?"}):(0,a.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{d:"M3 6h18"}),(0,a.jsx)("path",{d:"M8 6V4h8v2"}),(0,a.jsx)("path",{d:"M19 6l-1 14H6L5 6"})]})})]})]})]})},function(e,s){return e.session===s.session&&e.onSend===s.onSend&&e.onKill===s.onKill&&e.onMerge===s.onMerge&&e.onRestore===s.onRestore}),g={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."}},b=(0,t.memo)(function(e){let{level:s,sessions:r,onSend:n,onKill:o,onMerge:l,onRestore:i,collapsed:c,onToggle:d,compactMobile:h,onPreview:u,resetKey:x}=e,p=g[s],m=void 0!==d,[b,f]=(0,t.useState)(!1),k=m&&h&&!b?r.slice(0,5):r,_=r.length-k.length;return((0,t.useEffect)(()=>{c&&f(!1)},[c]),(0,t.useEffect)(()=>{f(!1)},[x]),m)?(0,a.jsxs)("div",{className:"accordion-section".concat(c?" accordion-section--collapsed":" accordion-section--expanded"),"data-level":s,children:[(0,a.jsxs)("button",{type:"button",className:"accordion-header",onClick:()=>d(s),"aria-expanded":!c,"aria-controls":"accordion-body-".concat(s),children:[(0,a.jsx)("span",{className:"accordion-header__dot","data-level":s}),(0,a.jsx)("span",{className:"accordion-header__label",children:p.label}),(0,a.jsx)("span",{className:"accordion-header__count",children:r.length}),(0,a.jsx)("span",{className:"accordion-header__chevron","aria-hidden":"true",children:"▶"})]}),(0,a.jsx)("div",{id:"accordion-body-".concat(s),className:"accordion-body",children:r.length>0?(0,a.jsxs)("div",{className:h?"mobile-session-list":"flex flex-col gap-2 p-3",children:[k.map(e=>h?(0,a.jsx)(j,{session:e,level:s,onPreview:u},e.id):(0,a.jsx)(v,{session:e,onSend:n,onKill:o,onMerge:l,onRestore:i},e.id)),h&&_>0?(0,a.jsxs)("button",{type:"button",className:"mobile-session-list__view-all",onClick:()=>f(!0),children:["View all ",r.length]}):null]}):h?(0,a.jsx)("div",{className:"mobile-session-list",children:(0,a.jsx)("div",{className:"mobile-session-list__empty",children:p.emptyMessage})}):null})]}):(0,a.jsxs)("div",{className:"kanban-column","data-level":s,children:[(0,a.jsx)("div",{className:"kanban-column__header",children:(0,a.jsxs)("div",{className:"kanban-column__title-row",children:[(0,a.jsx)("div",{className:"kanban-column__dot","data-level":s}),(0,a.jsx)("span",{className:"kanban-column__title",children:p.label}),(0,a.jsx)("span",{className:"kanban-column__count",children:r.length})]})}),(0,a.jsx)("div",{className:"kanban-column-body",children:r.length>0?(0,a.jsx)("div",{className:"kanban-column__stack",children:r.map(e=>(0,a.jsx)(v,{session:e,onSend:n,onKill:o,onMerge:l,onRestore:i},e.id))}):null})]})},function(e,s){return e.level===s.level&&e.collapsed===s.collapsed&&e.onToggle===s.onToggle&&e.onSend===s.onSend&&e.onKill===s.onKill&&e.onMerge===s.onMerge&&e.onRestore===s.onRestore&&e.compactMobile===s.compactMobile&&e.onPreview===s.onPreview&&e.resetKey===s.resetKey&&e.sessions.length===s.sessions.length&&e.sessions.every((e,r)=>e===s.sessions[r])});function j(e){let{session:s,level:r,onPreview:t}=e,n=[s.branch,s.pr?"PR #".concat(s.pr.number):null,s.issueLabel].filter(Boolean);return(0,a.jsxs)("div",{className:"mobile-session-row",children:[(0,a.jsxs)("button",{type:"button",className:"mobile-session-row__preview",onClick:()=>null==t?void 0:t(s),"aria-label":"Open ".concat((0,h.Pn)(s)),children:[(0,a.jsxs)("div",{className:"mobile-session-row__line",children:[(0,a.jsx)("span",{className:"mobile-session-row__dot","data-level":r,"aria-hidden":"true"}),(0,a.jsx)("span",{className:"mobile-session-row__title",children:(0,h.Pn)(s)})]}),(0,a.jsx)("div",{className:"mobile-session-row__meta",children:n.length>0?n.join(" \xb7 "):"No branch or PR metadata"})]}),(0,a.jsxs)("div",{className:"mobile-session-row__side",children:[(0,a.jsx)(f,{session:s,level:r}),(0,a.jsx)("a",{href:(0,p.Nc)(s.projectId,s.id),className:"mobile-session-row__open","aria-label":"Go to ".concat((0,h.Pn)(s)),children:(0,a.jsxs)("svg",{className:"mobile-session-row__open-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.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,a.jsx)("path",{d:"m8 10 2 2-2 2M12 14h4"})]})})]})]})}function f(e){var s,r,t,n;let{session:o,level:l}=e,i=g[l].label.toLowerCase();return"merge"===l&&o.pr&&(0,c.QN)(o.pr)?i="ready":"action"===l?i="needs_input"===o.status?"needs input":"stuck"===o.status?"stuck":"errored"===o.status?"errored":"waiting_input"===o.activity?"waiting":"exited"===o.activity?"crashed":"blocked"===o.activity?"blocked":"ci_failed"===o.status?"ci failed":"changes_requested"===o.status?"changes":(null==(t=o.pr)?void 0:t.ciStatus)==="failing"?"ci failed":(null==(n=o.pr)?void 0:n.reviewDecision)==="changes_requested"?"changes":o.pr&&!o.pr.mergeability.noConflicts?"conflicts":"action":"respond"===l?i="waiting_input"===o.activity?"waiting":"needs input":"review"===l?i=(null==(s=o.pr)?void 0:s.reviewDecision)==="changes_requested"?"changes":"review":"pending"===l?i=(null==(r=o.pr)?void 0:r.unresolvedThreads)?"threads":"pending":"working"===l&&(i="idle"===o.activity?"idle":"active"),(0,a.jsx)("span",{className:"mobile-session-row__chip",children:i})}var k=r(7848),_=r(5309),N=r(5184),w=r(9293);let y=["Working","Pending","Review","Respond","Merge"];function C(e){let{message:s,orchestratorHref:r,onSpawnOrchestrator:t=null,spawnLabel:n="Spawn Orchestrator",spawnDisabled:o=!1}=e;return(0,a.jsxs)("div",{className:"board-wrapper",children:[(0,a.jsx)("div",{className:"kanban-ghost","aria-hidden":"true",children:y.map(e=>(0,a.jsx)("div",{className:"kanban-ghost__col",children:(0,a.jsx)("div",{className:"kanban-ghost__head",children:e})},e))}),(0,a.jsx)("div",{className:"board-center",children:(0,a.jsxs)("div",{className:"empty-state",role:"status",children:[(0,a.jsx)("div",{className:"empty-state__icon",children:(0,a.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"5.5",r:"2.5",fill:"rgba(249,115,22,0.18)",stroke:"#f97316",strokeWidth:"1.5"}),(0,a.jsx)("circle",{cx:"5.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,a.jsx)("circle",{cx:"18.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,a.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,a.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,a.jsx)("line",{x1:"7.8",y1:"17",x2:"16.2",y2:"17",stroke:"var(--color-border-subtle)",strokeWidth:"1",strokeDasharray:"2.5 2"})]})}),s?(0,a.jsx)("p",{className:"empty-state__text",children:s}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"empty-state__headline",children:"Ready to orchestrate"}),(0,a.jsx)("p",{className:"empty-state__hint",children:"Open the main orchestrator to start a session and fan out parallel agents across your codebase."}),r?(0,a.jsxs)("a",{href:r,className:"empty-state__cta",children:[(0,a.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,a.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,a.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Open Orchestrator"]}):t?(0,a.jsxs)("button",{type:"button",className:"empty-state__cta",onClick:t,disabled:o,children:[(0,a.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,a.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,a.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),n]}):null]})]})})]})}var M=r(2446);function S(e){let{status:s}=e;return"connected"===s?null:"disconnected"===s?(0,a.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,a.jsx)("div",{className:"connection-bar connection-bar--reconnecting",role:"status","aria-live":"polite","aria-atomic":"true",children:"Reconnecting…"})}let P=[/\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 R(e){let{projectId:s}=e,{showToast:r}=(0,M.d)(),[n,o]=(0,t.useState)(!1),l=(0,t.useCallback)(async()=>{if(!n){o(!0);try{let e,a=await fetch("/api/observability",{credentials:"same-origin"});if(!a.ok)return void r("Could not fetch observability snapshot","error");let t=a.headers.get("x-correlation-id");try{e=await a.json()}catch(e){r("Could not parse observability snapshot","error");return}let n=function e(s){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakSet;if("string"==typeof s)return P.reduce((e,s)=>e.replace(s,"[REDACTED]"),s);if(Array.isArray(s))return s.map(s=>e(s,r));if(s&&"object"==typeof s){if(r.has(s))return"[Circular]";r.add(s);let a={};for(let[t,n]of Object.entries(s))a[t]=e(n,r);return a}return s}(function(e,s){if(!s||!e||"object"!=typeof e)return e;let r={...e},a=r.projects;if(a&&"object"==typeof a&&!Array.isArray(a)){let e=a[s];r.projects=void 0===e?{}:{[s]:e}}return r}(e,s)),o={copiedAt:new Date().toISOString(),pageHref:"".concat(window.location.origin).concat(window.location.pathname),projectId:null!=s?s:null,correlationId:t,userAgent:navigator.userAgent,observability:n};await navigator.clipboard.writeText(JSON.stringify(o,null,2)),r("Debug bundle copied to clipboard","success")}catch(e){r("Could not copy debug bundle","error")}finally{o(!1)}}},[n,s,r]);return(0,a.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 l(),disabled:n,"aria-label":"Copy debug bundle for issue reports",children:[(0,a.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,a.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 W=r(2466);let I=["working","pending","action","merge"],T=["working","pending","review","respond","merge"],A=[];function B(e){var s;let{session:r,onRestore:t}=e,n=!r.summaryIsFallback&&r.summary||r.issueTitle||r.summary||r.id,o=(null==(s=r.pr)?void 0:s.state)==="merged"||"merged"===r.status,l="killed"===r.status||"terminated"===r.status,i=!c.N_.has(r.status);return(0,a.jsxs)("div",{className:"done-card",children:[(0,a.jsx)("p",{className:"done-card__title",children:n}),(0,a.jsxs)("div",{className:"done-card__meta",children:[(0,a.jsx)("span",{className:"done-card__badge ".concat(l?"done-card__badge--terminated":"done-card__badge--merged"),children:o?"merged":l?"terminated":"done"}),r.pr?(0,a.jsxs)("a",{href:r.pr.url,target:"_blank",rel:"noopener noreferrer",className:"done-card__pr",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,a.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,a.jsx)("path",{d:"M6 9v3a6 6 0 0 0 6 6h3"})]}),"#",r.pr.number]}):null,(0,a.jsx)("span",{className:"done-card__age",children:function(e){if(!e)return"just now";let s=new Date(e).getTime();if(!Number.isFinite(s))return"just now";let r=Date.now()-s;if(r<=0)return"just now";let a=Math.floor(r/1e3),t=Math.floor(a/60),n=Math.floor(t/60),o=Math.floor(n/24);return a<60?"".concat(a,"s ago"):t<60?"".concat(t,"m ago"):n<24?"".concat(n,"h ago"):"".concat(o,"d ago")}(r.lastActivityAt)}),i?(0,a.jsx)("button",{type:"button",className:"done-card__restore",onClick:e=>{e.stopPropagation(),t(r.id)},children:"Restore"}):null]})]})}function D(e){var s,r,n,d;let{initialSessions:h,projectId:u,projectName:x,projects:m=[],orchestrators:v,attentionZones:g="simple",dashboardLoadError:j}=e,f=null!=v?v:A,y=(0,N.eT)(),P="detailed"===g?T:I,D=(0,t.useMemo)(()=>{let e={};for(let s of h)e[s.id]=(0,c.ng)(s,g);return e},[h,g]),{sessions:O,attentionLevels:L,liveSessionsResolved:E,loadError:H}=(0,_.D)({initialSessions:h,muxSessions:(null==y?void 0:y.status)==="connected"?y.sessions:void 0,muxLastError:null==y?void 0:y.lastError,initialAttentionLevels:D,attentionZones:g}),K=(0,t.useMemo)(()=>u?O.filter(e=>e.projectId===u):O,[O,u]),Z=(null==y?void 0:y.status)==="disconnected"?"disconnected":(null==y?void 0:y.status)==="connected"?"connected":"reconnecting",q=null!=H?H:j&&E?void 0:j,U=(0,l.useSearchParams)(),z=(0,l.useRouter)(),V=(0,t.useRef)(z);V.current=z;let G=null!=(s=U.get("session"))?s:void 0,[J,Q]=(0,t.useState)(!1),[$,X]=(0,t.useState)(f),[Y,ee]=(0,t.useState)([]),[es,er]=(0,t.useState)({}),[ea,et]=(0,t.useState)(!1),[en,eo]=(0,t.useState)(!1),el=(0,i.U)(i.D),ei=U.get("debug"),{showToast:ec}=(0,M.d)(),[ed,eh]=(0,t.useState)(!1),eu=(0,t.useRef)(O);eu.current=O;let ex=m.length>1&&void 0===u,ep=(0,t.useMemo)(()=>{var e;return u&&null!=(e=$.find(e=>e.projectId===u))?e:null},[$,u]),em=ep?(0,p.Nc)(ep.projectId,ep.id):null,ev=!ex&&!!u&&m.some(e=>e.id===u&&!e.resolveError)&&!em,eg=u&&null!=(r=m.find(e=>e.id===u))?r:null,eb=!!u&&Y.includes(u),ej=u&&null!=(n=es[u])?n:null,ef=(0,t.useMemo)(()=>ex||!G?K:K.filter(e=>e.id===G),[K,ex,G]);(0,t.useEffect)(()=>{X(e=>(function(e,s){let r=new Map(e.map(e=>[e.projectId,e]));for(let e of s)r.set(e.projectId,e);return[...r.values()]})(e,f))},[f]),(0,t.useEffect)(()=>{let e=(0,k.S)(L),s=null!=x?x:"ao";document.title=e>0?"".concat(s," (").concat(e," need attention)"):s},[L,x]),(0,t.useEffect)(()=>{eo(!1)},[U]);let ek=(0,t.useMemo)(()=>{let e={merge:[],action:[],respond:[],review:[],pending:[],working:[],done:[]};for(let s of ef)e[(0,c.ng)(s,g)].push(s);return e},[ef,g]),e_=(0,t.useMemo)(()=>{let e=new Map;for(let s of O){let r=e.get(s.projectId);if(r){r.push(s);continue}e.set(s.projectId,[s])}return e},[O]),eN=(0,t.useMemo)(()=>ex?m.map(e=>{var s,r;let a=null!=(s=e_.get(e.id))?s:[],t={merge:0,action:0,respond:0,review:0,pending:0,working:0,done:0};for(let e of a)t[(0,c.ng)(e,g)]++;return{project:e,orchestrator:null!=(r=$.find(s=>s.projectId===e.id))?r:null,sessionCount:a.length,openPRCount:a.filter(e=>{var s;return(null==(s=e.pr)?void 0:s.state)==="open"}).length,counts:t}}):[],[$,ex,g,m,e_]),ew=(0,t.useCallback)(async(e,s)=>{try{let r=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:s})});if(!r.ok){let s=await r.text()||"Unknown error";console.error("Failed to send message to ".concat(e,":"),s),ec("Send failed: ".concat(s),"error");let a=Error(s);throw a.toastShown=!0,a}}catch(s){throw s instanceof Error&&"toastShown"in s&&s.toastShown||(console.error("Network error sending message to ".concat(e,":"),s),ec("Network error while sending message","error")),s}},[ec]),ey=(0,t.useCallback)(async e=>{try{let s=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/kill"),{method:"POST"});if(s.ok)ec("Session terminated","success");else{let r=await s.text();console.error("Failed to kill ".concat(e,":"),r),ec("Terminate failed: ".concat(r),"error")}}catch(s){console.error("Network error killing ".concat(e,":"),s),ec("Network error while terminating session","error")}},[ec]),eC=(0,t.useCallback)(e=>{var s;let r=null!=(s=eu.current.find(s=>s.id===e))?s:null;r&&ey(r.id)},[ey]),eM=(0,t.useCallback)(async e=>{try{let s=await fetch("/api/prs/".concat(e,"/merge"),{method:"POST"});if(s.ok)ec("PR #".concat(e," merged"),"success");else{let r=await s.text();console.error("Failed to merge PR #".concat(e,":"),r),ec("Merge failed: ".concat(r),"error");return}}catch(s){console.error("Network error merging PR #".concat(e,":"),s),ec("Network error while merging PR","error")}},[ec]),eS=(0,t.useCallback)(async e=>{try{let s=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/restore"),{method:"POST"});if(s.ok)ec("Session restored","success"),V.current.refresh();else{let r=await s.text();console.error("Failed to restore ".concat(e,":"),r),ec("Restore failed: ".concat(r),"error")}}catch(s){console.error("Network error restoring ".concat(e,":"),s),ec("Network error while restoring session","error")}},[ec]),eP=async e=>{ee(s=>s.includes(e.id)?s:[...s,e.id]),er(s=>{let{[e.id]:r,...a}=s;return a});try{let r=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e.id})}),a=await r.json().catch(()=>null);if(!r.ok||!(null==a?void 0:a.orchestrator)){var s;throw Error(null!=(s=null==a?void 0:a.error)?s:"Failed to spawn orchestrator for ".concat(e.name))}let t=a.orchestrator;X(s=>{let r=s.filter(s=>s.projectId!==e.id);return r.push(t),r})}catch(r){let s=r instanceof Error?r.message:"Failed to spawn orchestrator";er(r=>({...r,[e.id]:s})),console.error("Failed to spawn orchestrator for ".concat(e.id,":"),r)}finally{ee(s=>s.filter(s=>s!==e.id))}},eR=P.some(e=>ek[e].length>0),eW=!ex&&!eR&&!q,eI=q?(0,a.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,a.jsx)("span",{className:"font-semibold text-[var(--color-status-error)]",children:"Orchestrator failed to load"}),(0,a.jsx)("span",{className:"break-words text-[var(--color-text-secondary)]",children:q}),(0,a.jsxs)("span",{className:"text-[var(--color-text-secondary)]",children:["Confirm ",(0,a.jsx)("span",{className:"font-mono text-[10px]",children:"agent-orchestrator.yaml"})," exists and is valid, then run ",(0,a.jsx)("span",{className:"font-mono text-[10px]",children:"ao doctor"})," for diagnostics."]})]}):null,eT=(0,t.useMemo)(()=>O.some(e=>e.pr&&(0,c.fZ)(e.pr)),[O]),eA="agent orchestrator"===(null==x?void 0:x.trim().toLowerCase())?null!=(d=null!=u?u:x)?d:ex?"All projects":"Dashboard":null!=x?x:ex?"All projects":"Dashboard",eB=!ex&&eA.trim().length>0,eD=()=>{window.innerWidth<768?eo(e=>!e):et(e=>!e)};return(0,a.jsx)(W.I.Provider,{value:{onToggleSidebar:eD,mobileSidebarOpen:en},children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S,{status:Z}),(0,a.jsxs)("div",{className:"dashboard-app-shell",children:[(0,a.jsxs)("header",{className:"dashboard-app-header",children:[(0,a.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:eD,"aria-label":"Toggle sidebar",children:el?(0,a.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,a.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,a.jsx)("path",{d:"M9 3v18"})]})}),(0,a.jsxs)("div",{className:"dashboard-app-header__brand",children:[(0,a.jsx)("span",{className:"dashboard-app-header__brand-dot","aria-hidden":"true"}),(0,a.jsx)("span",{children:"Agent Orchestrator"})]}),eB?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"dashboard-app-header__sep","aria-hidden":"true"}),(0,a.jsx)("span",{className:"dashboard-app-header__project",children:eA})]}):null,el||"1"!==ei&&"true"!==ei?null:(0,a.jsx)(R,{projectId:u}),(0,a.jsx)("div",{className:"dashboard-app-header__spacer"}),(0,a.jsx)("div",{className:"dashboard-app-header__actions",children:!ex&&em?(0,a.jsxs)(o(),{href:em,className:"dashboard-app-btn dashboard-app-btn--amber","aria-label":"Orchestrator",children:[(0,a.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,a.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,a.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Orchestrator"]}):ev&&eg?(0,a.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--amber","aria-label":"Spawn Orchestrator",onClick:()=>void eP(eg),disabled:eb,children:[(0,a.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,a.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,a.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,a.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),eb?"Spawning...":"Spawn Orchestrator"]}):null})]}),(0,a.jsxs)("div",{className:"dashboard-shell dashboard-shell--desktop".concat(ea?" dashboard-shell--sidebar-collapsed":""),children:[(0,a.jsx)("div",{className:"sidebar-wrapper".concat(en?" sidebar-wrapper--mobile-open":""),children:(0,a.jsx)(w.u,{projects:m,sessions:O,orchestrators:$,activeProjectId:u,activeSessionId:G,collapsed:ea,onToggleCollapsed:()=>et(e=>!e),onMobileClose:()=>eo(!1)})}),en&&(0,a.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>eo(!1)}),(0,a.jsxs)("main",{className:"dashboard-main dashboard-main--desktop",children:[(0,a.jsx)(k.u,{attentionLevels:L,projectName:x}),(0,a.jsxs)("div",{className:"dashboard-main__subhead",children:[(0,a.jsx)("h1",{className:"dashboard-main__title",children:"Dashboard"}),(0,a.jsx)("p",{className:"dashboard-main__subtitle",children:"Live agent sessions, pull requests, and merge status."})]}),(0,a.jsxs)("div",{className:"dashboard-main__body",children:[eI,eT&&!J&&(0,a.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,a.jsxs)("svg",{className:"h-3.5 w-3.5 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),(0,a.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,a.jsx)("button",{onClick:()=>Q(!0),className:"ml-1 shrink-0 opacity-60 hover:opacity-100","aria-label":"Dismiss",children:(0,a.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),ex&&(0,a.jsx)(F,{overviews:eN,onSpawnOrchestrator:eP,spawningProjectIds:Y,spawnErrors:es,attentionZones:g}),!ex&&eR&&(0,a.jsx)("div",{className:"kanban-board-wrap",children:(0,a.jsx)("div",{className:"kanban-board","data-columns":P.length,style:{"--kanban-column-count":P.length},children:P.map(e=>(0,a.jsx)(b,{level:e,sessions:ek[e],onSend:ew,onKill:eC,onMerge:eM,onRestore:eS},e))})}),eW?(0,a.jsx)(C,{orchestratorHref:em,onSpawnOrchestrator:ev&&eg?()=>{eP(eg)}:null,spawnLabel:eb?"Spawning...":"Spawn Orchestrator",spawnDisabled:eb}):null,!ex&&ej?(0,a.jsx)("p",{className:"mt-3 text-[11px] text-[var(--color-status-error)]",children:ej}):null,!ex&&ek.done.length>0&&(0,a.jsxs)("div",{className:"done-bar mt-6",children:[(0,a.jsxs)("button",{type:"button",className:"done-bar__toggle",onClick:()=>eh(e=>!e),"aria-expanded":ed,children:[(0,a.jsx)("svg",{className:"done-bar__chevron".concat(ed?" done-bar__chevron--open":""),fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"m9 18 6-6-6-6"})}),(0,a.jsx)("span",{className:"done-bar__label",children:"Done / Terminated"}),(0,a.jsx)("span",{className:"done-bar__count",children:ek.done.length})]}),ed&&(0,a.jsx)("div",{className:"done-bar__cards",children:ek.done.map(e=>(0,a.jsx)(B,{session:e,onRestore:eS},e.id))})]})]})]})]})]})]})})}function O(e){return(0,a.jsx)(M.t,{children:(0,a.jsx)(D,{...e})})}function F(e){let{overviews:s,onSpawnOrchestrator:r,spawningProjectIds:t,spawnErrors:n,attentionZones:l}=e;return(0,a.jsx)("div",{className:"mb-8 grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:s.map(e=>{let{project:s,orchestrator:i,sessionCount:c,openPRCount:d,counts:h}=e,u=!!s.resolveError,x=(0,p.bn)(s.id);return(0,a.jsxs)("section",{className:"border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] p-4",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-[14px] font-semibold text-[var(--color-text-primary)]",children:s.name}),(0,a.jsx)("div",{className:"mt-1 text-[11px] text-[var(--color-text-muted)]",children:u?"Config needs repair":(0,a.jsxs)(a.Fragment,{children:[c," active session",1!==c?"s":"",d>0?" \xb7 ".concat(d," open PR").concat(1!==d?"s":""):""]})})]}),(0,a.jsx)(o(),{href:x,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,a.jsxs)("div",{className:"mb-4 flex flex-wrap gap-2",children:[(0,a.jsx)(L,{label:"Merge",value:h.merge,tone:"ready"}),"detailed"===l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{label:"Respond",value:h.respond,tone:"error"}),(0,a.jsx)(L,{label:"Review",value:h.review,tone:"orange"})]}):(0,a.jsx)(L,{label:"Action",value:h.action,tone:"orange"}),(0,a.jsx)(L,{label:"Pending",value:h.pending,tone:"attention"}),(0,a.jsx)(L,{label:"Working",value:h.working,tone:"working"})]}),(0,a.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("div",{className:"text-[11px] text-[var(--color-text-muted)]",children:u?"Project config could not be resolved":i?"Per-project orchestrator available":"No running orchestrator"}),u?(0,a.jsx)(o(),{href:x,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"}):i?(0,a.jsxs)(o(),{href:(0,p.Nc)(i.projectId,i.id),className:"orchestrator-btn flex items-center gap-2 px-3 py-1.5 text-[11px] font-semibold hover:no-underline",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--color-accent)] opacity-80"}),"orchestrator"]}):(0,a.jsx)("button",{type:"button",onClick:()=>void r(s),disabled:t.includes(s.id),className:"orchestrator-btn px-3 py-1.5 text-[11px] font-semibold disabled:cursor-wait disabled:opacity-70",children:t.includes(s.id)?"Spawning...":"Spawn Orchestrator"})]}),n[s.id]?(0,a.jsx)("p",{className:"mt-2 text-[11px] text-[var(--color-status-error)]",children:n[s.id]}):null]})]},s.id)})})}function L(e){let{label:s,value:r,tone:t}=e;return(0,a.jsxs)("div",{className:"min-w-[78px] border border-[var(--color-border-subtle)] px-2.5 py-2",children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-[0.08em] text-[var(--color-text-tertiary)]",children:s}),(0,a.jsx)("div",{className:"project-metric__value mt-1 text-[18px] font-semibold tabular-nums","data-tone":t,children:r})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9170],{519:(e,r,s)=>{Promise.resolve().then(s.bind(s,4255))},1712:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let t=s(1903)._(s(5864));function a(e,r){var s;let a={};"function"==typeof e&&(a.loader=e);let n={...a,...r};return(0,t.default)({...n,modules:null==(s=n.loadableGenerated)?void 0:s.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},4255:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>x,dynamic:()=>c});var t=s(3817),a=s(9891),n=s(7594),l=s(6749);let i=(0,a.default)(()=>Promise.all([s.e(8944),s.e(3764)]).then(s.bind(s,3764)).then(e=>({default:e.DirectTerminal})),{loadableGenerated:{webpack:()=>[3764]},ssr:!1}),o=(0,a.default)(()=>s.e(7317).then(s.bind(s,7317)).then(e=>({default:e.Terminal})),{loadableGenerated:{webpack:()=>[7317]},ssr:!1}),c="force-dynamic";function d(){let e=(0,n.useSearchParams)(),[r,s]=(0,l.useState)([]),[a,c]=(0,l.useState)(!0);(0,l.useEffect)(()=>{fetch("/api/sessions?active=true").then(e=>e.json()).then(e=>{e.sessions&&Array.isArray(e.sessions)&&s(e.sessions.map(e=>e.id))}).catch(e=>{console.error("Failed to fetch sessions:",e)})},[]);let d=e.get("session"),x=e.get("old_session"),m=e.get("new_session"),h=r[0]||"ao-orchestrator",p=r[1]||r[0]||"ao-orchestrator",u=x||d||h,b=m||d||p;return(0,t.jsx)("div",{className:"min-h-screen bg-[var(--color-bg-primary)] p-8",children:(0,t.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)("h1",{className:"mb-2 text-3xl font-bold text-[var(--color-text-primary)]",children:"Terminal Implementation Test & Documentation"}),(0,t.jsxs)("p",{className:"text-sm text-[var(--color-text-muted)]",children:["Comparing sessions:",(0,t.jsxs)("span",{className:"ml-2 font-mono text-[var(--color-accent-red)]",children:["OLD: ",u]}),(0,t.jsxs)("span",{className:"ml-2 font-mono text-[var(--color-accent-green)]",children:["NEW: ",b]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDC1B The Problem"}),(0,t.jsxs)("div",{className:"space-y-3 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Issue:"})," Browser clipboard (Cmd+C/Ctrl+C) only worked when an iTerm2 client was attached to the tmux session."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Impact:"})," Users had to keep iTerm2 tabs open in the background for clipboard to work in the web dashboard."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Investigation time:"})," 12+ hours of debugging across tmux, ttyd, xterm.js, and macOS clipboard systems."]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDD0D Root Cause Analysis"}),(0,t.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"1. How tmux Clipboard Works (OSC 52)"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"tmux uses OSC 52 escape sequences to synchronize clipboard with terminals"}),(0,t.jsxs)("li",{children:["Format:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"\\x1b]52;c;<base64>\\x07"})]}),(0,t.jsx)("li",{children:"Terminal must support OSC 52 and have proper capabilities declared"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"2. tmux Capability Detection (XDA)"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"tmux queries terminal capabilities using Device Attributes (DA/XDA)"}),(0,t.jsxs)("li",{children:["XDA query: ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"CSI > q"})," ","(also called XTVERSION)"]}),(0,t.jsx)("li",{children:'Terminal responds with identification string containing terminal type (e.g., "XTerm(370)", "iTerm2 ")'}),(0,t.jsx)("li",{children:"Based on response, tmux enables features like TTYC_MS (clipboard support)"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"3. The Missing Piece"}),(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-accent-red)] bg-[var(--color-bg-tertiary)] p-4",children:[(0,t.jsx)("p",{className:"font-semibold text-[var(--color-accent-red)]",children:"xterm.js does NOT implement XDA (Extended Device Attributes)"}),(0,t.jsxs)("ul",{className:"ml-6 mt-2 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:["XDA is marked as TODO in xterm.js codebase:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"test.skip('CSI > Ps q - Report xterm name and version (XTVERSION)')"})]}),(0,t.jsx)("li",{children:"Without XDA response, tmux doesn't recognize the terminal as clipboard-capable"}),(0,t.jsx)("li",{children:"tmux never emits OSC 52 sequences → clipboard doesn't work"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:'4. Why iTerm2 "Fixed" It'}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:["iTerm2 sends proper XDA response identifying itself as"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:'"iTerm2 "'})]}),(0,t.jsx)("li",{children:"tmux detects this and enables clipboard for the entire session"}),(0,t.jsx)("li",{children:"OSC 52 sequences are then sent to ALL clients, including browser (ttyd/xterm.js)"}),(0,t.jsx)("li",{children:'This is why clipboard "magically worked" when iTerm2 was attached'})]})]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"✅ The Solution"}),(0,t.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"DirectTerminal Implementation"}),(0,t.jsx)("p",{className:"mb-2 text-[var(--color-text-secondary)]",children:"Created custom terminal component that registers an XDA handler using xterm.js parser API:"}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-[2px] bg-black p-4 text-xs",children:(0,t.jsx)("code",{className:"text-[var(--color-accent-green)]",children:'terminal.parser.registerCsiHandler(\n { prefix: ">", final: "q" }, // CSI > q is XDA query\n () => {\n // Respond with XTerm identification\n terminal.write("\\x1bP>|XTerm(370)\\x1b\\\\");\n return true;\n }\n);'})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"What This Does"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"Intercepts XDA queries from tmux"}),(0,t.jsxs)("li",{children:["Responds with"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"XTerm(370)"})," ","identification"]}),(0,t.jsx)("li",{children:'tmux detects "XTerm(" in response and enables TTYC_MS capability'}),(0,t.jsx)("li",{children:"OSC 52 sequences now flow: tmux → WebSocket → xterm.js → navigator.clipboard"}),(0,t.jsx)("li",{children:(0,t.jsx)("strong",{className:"text-[var(--color-accent-green)]",children:"Clipboard works without iTerm2!"})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"Architecture Changes"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Old:"})," Browser → ttyd (iframe) → tmux"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"New:"})," Browser → Custom WebSocket (node-pty) → tmux"]}),(0,t.jsx)("li",{children:"Bypasses ttyd for direct control over terminal initialization"}),(0,t.jsx)("li",{children:"Full control over escape sequence handling and capabilities"})]})]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"⚠️ Node Version Requirement"}),(0,t.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,t.jsx)("div",{className:"rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-tertiary)] p-4",children:(0,t.jsx)("p",{className:"font-semibold text-[var(--color-accent-orange)]",children:"CRITICAL: This implementation requires Node 20.x (currently 20.20.0)"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"Why Node 20?"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:(0,t.jsx)("strong",{children:"node-pty 1.1.0 is incompatible with Node 25+"})}),(0,t.jsxs)("li",{children:["Error on Node 25.6.1:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"posix_spawnp failed"})]}),(0,t.jsx)("li",{children:"Root cause: node-pty's native module (darwin-arm64 prebuild) fails to spawn processes on Node 25"}),(0,t.jsx)("li",{children:"No darwin-arm64 prebuilds available that work with Node 25"}),(0,t.jsx)("li",{children:"Building from source also fails with the same error"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"When Can We Upgrade?"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Option 1:"})," Wait for node-pty 1.2.0 stable release with Node 25+ support"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Option 2:"})," Test node-pty beta versions (currently 1.2.0-beta.11)"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Option 3:"})," Switch to alternative PTY library (e.g., xterm-pty, node-child-pty)"]})]})]}),(0,t.jsxs)("div",{className:"rounded-[2px] bg-[var(--color-bg-tertiary)] p-4",children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"⚡ Testing Instructions for Upgrades"}),(0,t.jsx)("p",{className:"mb-2 text-[var(--color-text-secondary)]",children:"Before upgrading Node or node-pty:"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-1 text-xs text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:["Test node-pty directly:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"node -e \"const pty = require('node-pty'); pty.spawn('/bin/bash', [], {})\""})]}),(0,t.jsxs)("li",{children:["If no"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"posix_spawnp failed"})," ","error, proceed"]}),(0,t.jsx)("li",{children:"Start dev servers and open this page"}),(0,t.jsx)("li",{children:"Test DirectTerminal: verify connection, clipboard, resize"}),(0,t.jsx)("li",{children:"Test multiple sessions to ensure stability"}),(0,t.jsx)("li",{children:"If all tests pass, upgrade is safe"})]})]})]})]}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("button",{onClick:()=>c(!a),className:"rounded-[2px] bg-[var(--color-accent-blue)] px-4 py-2 text-sm font-semibold text-white transition-opacity hover:opacity-80",children:[a?"Hide":"Show"," Side-by-Side Comparison"]}),(0,t.jsx)("span",{className:"text-sm text-[var(--color-text-secondary)]",children:"Compare old (ttyd iframe) vs new (DirectTerminal with XDA)"})]}),u===b&&(0,t.jsxs)("div",{className:"mt-2 rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-tertiary)] p-2 text-xs text-[var(--color-text-secondary)]",children:["⚠️ Using same session for both terminals. To avoid port conflicts, use different sessions:",(0,t.jsx)("code",{className:"ml-1 rounded-[2px] bg-black px-1",children:"?old_session=ao-orchestrator&new_session=ao-20"})]})]}),a&&(0,t.jsxs)("section",{className:"mb-8",children:[(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-4",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"rounded-[2px] bg-[var(--color-accent-red)] px-2 py-1 text-xs font-semibold text-white",children:"OLD"}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-[var(--color-text-primary)]",children:"ttyd iframe (no XDA)"})]}),(0,t.jsxs)("div",{className:"mb-2 rounded bg-[var(--color-bg-tertiary)] p-2 text-xs text-[var(--color-text-secondary)]",children:["❌ Clipboard requires iTerm2 attached",(0,t.jsx)("br",{}),"✅ Battle-tested (ttyd)",(0,t.jsx)("br",{}),"❌ No control over capabilities"]}),(0,t.jsx)(o,{sessionId:u})]}),(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-4",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"rounded-[2px] bg-[var(--color-accent-green)] px-2 py-1 text-xs font-semibold text-white",children:"NEW"}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-[var(--color-text-primary)]",children:"DirectTerminal (with XDA)"})]}),(0,t.jsxs)("div",{className:"mb-2 rounded bg-[var(--color-bg-tertiary)] p-2 text-xs text-[var(--color-text-secondary)]",children:["✅ Clipboard works standalone",(0,t.jsx)("br",{}),"✅ Full control over terminal",(0,t.jsx)("br",{}),"⚠️ Requires Node 20.x (node-pty)"]}),(0,t.jsx)(i,{sessionId:b,tmuxName:b})]})]}),(0,t.jsxs)("div",{className:"mt-4 rounded-[2px] border border-[var(--color-accent-blue)] bg-[var(--color-bg-secondary)] p-4",children:[(0,t.jsx)("h3",{className:"mb-2 text-sm font-semibold text-[var(--color-text-primary)]",children:"\uD83E\uDDEA How to Test Clipboard"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-1 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"Drag-select text in BOTH terminals above"}),(0,t.jsx)("li",{children:"Press Cmd+C (macOS) or Ctrl+Shift+C (Linux/Windows)"}),(0,t.jsx)("li",{children:"Paste in another application (Notes, VS Code, etc.)"}),(0,t.jsx)("li",{children:(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Expected: RIGHT terminal works, LEFT may not (unless iTerm2 is attached)"})})]})]})]}),(0,t.jsxs)("section",{className:"rounded-[2px] border border-[var(--color-accent)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDD2C The Debugging Journey"}),(0,t.jsxs)("div",{className:"space-y-4 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsx)("div",{className:"rounded-[2px] bg-[var(--color-bg-tertiary)] p-4",children:(0,t.jsx)("p",{className:"font-semibold text-[var(--color-accent-red)]",children:"Total Time Wasted: 12+ hours across Feb 15-16, 2026"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"❌ What We Tried (That Didn't Work)"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-2",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Suspected ttyd clipboard handling"})," - Spent hours analyzing ttyd source code, checking OSC 52 passthrough. ttyd was innocent - it passes escape sequences correctly."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Blamed xterm.js configuration"})," - Tried every possible xterm.js option, clipboard addon configurations, terminal type settings. None made a difference."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Investigated macOS clipboard permissions"})," - Checked browser permissions, sandbox attributes, navigator.clipboard API. All were correct."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Suspected WebSocket encoding issues"})," - Checked binary vs text mode, UTF-8 encoding, base64 handling. All correct."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Tried force-enabling tmux clipboard"})," - Used"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"set-option -s set-clipboard on"})," ","in tmux.conf. Didn't help - tmux needs the terminal to declare support."]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"\uD83D\uDCA1 The Breakthrough"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"What finally worked:"})," Registering an XDA (Extended Device Attributes) handler in xterm.js using"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"terminal.parser.registerCsiHandler()"})]}),(0,t.jsx)("pre",{className:"mt-2 overflow-x-auto rounded-[2px] bg-black p-3 text-xs",children:(0,t.jsx)("code",{className:"text-[var(--color-accent-green)]",children:'terminal.parser.registerCsiHandler(\n { prefix: ">", final: "q" },\n () => {\n terminal.write("\\x1bP>|XTerm(370)\\x1b\\\\");\n return true;\n }\n);'})}),(0,t.jsx)("p",{className:"mt-2",children:"This single handler made tmux recognize our terminal as clipboard-capable. Clipboard immediately started working."})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"\uD83C\uDFAF How We Finally Figured It Out"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-2",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Deep-dive into tmux source code"})," - Used DeepWiki.com to analyze tmux's terminal capability detection logic in"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tty-keys.c"})," and"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tty.c"})]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Discovered XDA queries"})," - Found that tmux sends"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"CSI > q"})," (XTVERSION) to detect terminal type"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:'Traced the "iTerm2 magic"'})," - Realized why clipboard worked when iTerm2 was attached: iTerm2 responds to XDA queries, enabling clipboard for the entire tmux session"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Checked xterm.js implementation"})," - Found that XDA is marked as TODO in xterm.js tests:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"test.skip('CSI > Ps q - Report xterm name and version (XTVERSION)')"})]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Implemented custom handler"})," - Used xterm.js parser API to register our own XDA handler"]})]})]}),(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-tertiary)] p-4",children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"⚡ How We Could Have Figured It Out Faster"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-2 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Start with tmux source code first"})," - Instead of debugging xterm.js and ttyd, we should have immediately checked how tmux detects terminal capabilities"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Monitor escape sequences"})," - Running"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tmux -vvv"})," or using a terminal protocol analyzer would have revealed the XDA queries being sent"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Compare working vs broken scenarios"})," - Should have captured and diffed the escape sequences when iTerm2 was attached vs not attached earlier"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Check xterm.js issues/limitations first"}),' - A GitHub search for "xterm.js XDA" or "xterm.js device attributes" would have revealed it\'s unimplemented']}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Read tmux documentation on terminal types"})," - tmux man page mentions terminal capability detection, but we focused on clipboard settings instead"]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"\uD83D\uDCDA Key Resources"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,t.jsx)("li",{children:"tmux source analysis: DeepWiki.com (Feb 15, 2026)"}),(0,t.jsx)("li",{children:"xterm.js parser API documentation"}),(0,t.jsx)("li",{children:"XTerm Control Sequences: XTVERSION / Device Attributes"}),(0,t.jsxs)("li",{children:["tmux ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tty-keys.c"}),": Terminal type detection logic"]})]})]})]})]}),(0,t.jsxs)("section",{className:"mt-6 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDCC1 Implementation Files"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"packages/web/src/components/DirectTerminal.tsx"})," ","- Main component with XDA handler"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"packages/web/server/direct-terminal-ws.ts"})," ","- WebSocket server using node-pty"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"packages/web/src/app/dev/terminal-test/page.tsx"})," ","- This test page"]})]})]}),(0,t.jsxs)("div",{className:"mt-8 border-t border-[var(--color-border-default)] pt-4 text-center text-xs text-[var(--color-text-secondary)]",children:[(0,t.jsx)("p",{children:"Investigation: Feb 15-16, 2026 • Duration: 12+ hours • Status: ✅ Resolved"}),(0,t.jsx)("p",{className:"mt-1",children:"Node 20.20.0 • node-pty 1.1.0 • xterm.js 5.3.0"})]})]})})}function x(){return(0,t.jsx)(l.Suspense,{fallback:(0,t.jsx)("div",{className:"flex min-h-screen items-center justify-center",children:"Loading..."}),children:(0,t.jsx)(d,{})})}},5468:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,r){for(var s in r)Object.defineProperty(e,s,{enumerable:!0,get:r[s]})}(r,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return n},createSnapshot:function(){return i}});let s=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class t{disable(){throw s}getStore(){}run(){throw s}exit(){throw s}enterWith(){throw s}static bind(e){return e}}let a="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function n(){return a?new a:new t}function l(e){return a?a.bind(e):t.bind(e)}function i(){return a?a.snapshot():function(e,...r){return e(...r)}}},5864:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let t=s(3817),a=s(6749),n=s(6943);function l(e){return{default:e&&"default"in e?e.default:e}}s(6418);let i={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},o=function(e){let r={...i,...e},s=(0,a.lazy)(()=>r.loader().then(l)),o=r.loading;function c(e){let l=o?(0,t.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,i=!r.ssr||!!r.loading,c=i?a.Suspense:a.Fragment,d=r.ssr?(0,t.jsxs)(t.Fragment,{children:[null,(0,t.jsx)(s,{...e})]}):(0,t.jsx)(n.BailoutToCSR,{reason:"next/dynamic",children:(0,t.jsx)(s,{...e})});return(0,t.jsx)(c,{...i?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},6313:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return t.workAsyncStorageInstance}});let t=s(8394)},6418:(e,r,s)=>{"use strict";function t(e){let{moduleIds:r}=e;return null}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return t}}),s(3817),s(4768),s(6313),s(5152)},6943:(e,r,s)=>{"use strict";function t(e){let{reason:r,children:s}=e;return s}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return t}}),s(1763)},7594:(e,r,s)=>{"use strict";var t=s(9582);s.o(t,"useParams")&&s.d(r,{useParams:function(){return t.useParams}}),s.o(t,"usePathname")&&s.d(r,{usePathname:function(){return t.usePathname}}),s.o(t,"useRouter")&&s.d(r,{useRouter:function(){return t.useRouter}}),s.o(t,"useSearchParams")&&s.d(r,{useSearchParams:function(){return t.useSearchParams}})},8394:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return t}});let t=(0,s(5468).createAsyncLocalStorage)()},9891:(e,r,s)=>{"use strict";s.d(r,{default:()=>a.a});var t=s(1712),a=s.n(t)}},e=>{e.O(0,[131,1461,7358],()=>e(e.s=519)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8039],{3464:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>s});var a=o(3817),t=o(7594),l=o(6749),n=o(9789);function s(r){let{error:e,reset:o}=r,s=(0,t.useRouter)();return(0,l.useEffect)(()=>{console.error(e)},[e]),(0,a.jsx)(n.ErrorDisplay,{title:"Something went wrong",message:"The dashboard hit an unexpected error. Try reloading the route data or head back to the main dashboard.",tone:"warning",primaryAction:{label:"Try again",onClick:()=>{o(),s.refresh()}},secondaryAction:{label:"Back to dashboard",href:"/"},error:e,compact:!0,chrome:"card"})}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8039],{3464:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>s});var a=o(3817),t=o(7594),l=o(6749),n=o(9789);function s(r){let{error:e,reset:o}=r,s=(0,t.useRouter)();return(0,l.useEffect)(()=>{console.error(e)},[e]),(0,a.jsx)(n.ErrorDisplay,{title:"Something went wrong",message:"The dashboard hit an unexpected error. Try reloading the route data or head back to the main dashboard.",tone:"warning",primaryAction:{label:"Try again",onClick:()=>{o(),s.refresh()}},secondaryAction:{label:"Back to dashboard",href:"/"},error:e,compact:!0,chrome:"card"})}},6514:(r,e,o)=>{Promise.resolve().then(o.bind(o,3464))},7594:(r,e,o)=>{"use strict";var a=o(9582);o.o(a,"useParams")&&o.d(e,{useParams:function(){return a.useParams}}),o.o(a,"usePathname")&&o.d(e,{usePathname:function(){return a.usePathname}}),o.o(a,"useRouter")&&o.d(e,{useRouter:function(){return a.useRouter}}),o.o(a,"useSearchParams")&&o.d(e,{useSearchParams:function(){return a.useSearchParams}})},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var a=o(3817),t=o(8713),l=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,a.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,a.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,a.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,a.jsx)(l(),{href:e.href,className:t,style:n,children:e.label}):(0,a.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:l="Technical details",error:i,primaryAction:d,secondaryAction:u,compact:x=!1,chrome:m="page",children:b}=r,v=n[t],h=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,a.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(x?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,a.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,a.jsx)(s,{accent:v.accent}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,a.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,a.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||u)&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,a.jsx)(c,{action:d,primary:!0}):null,u?(0,a.jsx)(c,{action:u}):null]}),b,h?(0,a.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,a.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:l}),(0,a.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,a.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,a.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,a.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=6514)),_N_E=r.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4219],{7494:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>n});var l=o(3817),t=o(6749),a=o(9789);function n(r){let{error:e,reset:o}=r;return(0,t.useEffect)(()=>{console.error(e)},[e]),(0,l.jsx)("html",{lang:"en",className:"dark",children:(0,l.jsx)("body",{className:"bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased",children:(0,l.jsx)(a.ErrorDisplay,{title:"Something broke at the app shell",message:"The dashboard could not recover from this error at the layout level. Try again first, then reload the page if it still fails.",tone:"error",primaryAction:{label:"Try again",onClick:o},secondaryAction:{label:"Reload page",onClick:()=>window.location.reload()},error:e})})})}},9576:(r,e,o)=>{Promise.resolve().then(o.bind(o,7494))},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var l=o(3817),t=o(8713),a=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,l.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,l.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,l.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,l.jsx)(a(),{href:e.href,className:t,style:n,children:e.label}):(0,l.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:a="Technical details",error:i,primaryAction:d,secondaryAction:x,compact:b=!1,chrome:m="page",children:u}=r,v=n[t],p=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,l.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(b?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,l.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,l.jsx)(s,{accent:v.accent}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,l.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,l.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||x)&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,l.jsx)(c,{action:d,primary:!0}):null,x?(0,l.jsx)(c,{action:x}):null]}),u,p?(0,l.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,l.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:a}),(0,l.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,l.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,l.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,l.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=9576)),_N_E=r.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{1012:(e,t,r)=>{"use strict";r.d(t,{Providers:()=>s});var n=r(3817),o=r(2286),c=r(5184);function s(e){let{children:t}=e;return(0,n.jsx)(o.N,{attribute:"class",defaultTheme:"dark",enableSystem:!1,children:(0,n.jsx)(c.i2,{children:t})})}},2286:(e,t,r)=>{"use strict";r.d(t,{D:()=>u,N:()=>d});var n=r(6749),o=(e,t,r,n,o,c,s,a)=>{let i=document.documentElement,l=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&c?o.map(e=>c[e]||e):o;r?(i.classList.remove(...n),i.classList.add(c&&c[t]?c[t]:t)):i.setAttribute(e,t)}),r=t,a&&l.includes(r)&&(i.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=s&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},c=["light","dark"],s="(prefers-color-scheme: dark)",a="undefined"==typeof window,i=n.createContext(void 0),l={setTheme:e=>{},themes:[]},u=()=>{var e;return null!=(e=n.useContext(i))?e:l},d=e=>n.useContext(i)?n.createElement(n.Fragment,null,e.children):n.createElement(f,{...e}),m=["light","dark"],f=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:o=!0,enableColorScheme:a=!0,storageKey:l="theme",themes:u=m,defaultTheme:d=o?"system":"light",attribute:f="data-theme",value:g,children:b,nonce:S,scriptProps:w}=e,[k,E]=n.useState(()=>p(l,d)),[x,P]=n.useState(()=>"system"===k?v():k),T=g?Object.values(g):u,C=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&o&&(t=v());let n=g?g[t]:t,s=r?y(S):null,i=document.documentElement,l=e=>{"class"===e?(i.classList.remove(...T),n&&i.classList.add(n)):e.startsWith("data-")&&(n?i.setAttribute(e,n):i.removeAttribute(e))};if(Array.isArray(f)?f.forEach(l):l(f),a){let e=c.includes(d)?d:null,r=c.includes(t)?t:e;i.style.colorScheme=r}null==s||s()},[S]),N=n.useCallback(e=>{let t="function"==typeof e?e(k):e;E(t);try{localStorage.setItem(l,t)}catch(e){}},[k]),M=n.useCallback(e=>{P(v(e)),"system"===k&&o&&!t&&C("system")},[k,t]);n.useEffect(()=>{let e=window.matchMedia(s);return e.addListener(M),M(e),()=>e.removeListener(M)},[M]),n.useEffect(()=>{let e=e=>{e.key===l&&(e.newValue?E(e.newValue):N(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[N]),n.useEffect(()=>{C(null!=t?t:k)},[t,k]);let I=n.useMemo(()=>({theme:k,setTheme:N,forcedTheme:t,resolvedTheme:"system"===k?x:k,themes:o?[...u,"system"]:u,systemTheme:o?x:void 0}),[k,N,t,x,o,u]);return n.createElement(i.Provider,{value:I},n.createElement(h,{forcedTheme:t,storageKey:l,attribute:f,enableSystem:o,enableColorScheme:a,defaultTheme:d,value:g,themes:u,nonce:S,scriptProps:w}),b)},h=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:c,enableSystem:s,enableColorScheme:a,defaultTheme:i,value:l,themes:u,nonce:d,scriptProps:m}=e,f=JSON.stringify([c,r,i,t,u,l,s,a]).slice(1,-1);return n.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?d:"",dangerouslySetInnerHTML:{__html:"(".concat(o.toString(),")(").concat(f,")")}})}),p=(e,t)=>{let r;if(!a){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},y=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},v=e=>(e||(e=window.matchMedia(s)),e.matches?"dark":"light")},2490:()=>{},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{1012:(e,t,r)=>{"use strict";r.d(t,{Providers:()=>s});var n=r(3817),o=r(2286),c=r(5184);function s(e){let{children:t}=e;return(0,n.jsx)(o.N,{attribute:"class",defaultTheme:"dark",enableSystem:!1,children:(0,n.jsx)(c.i2,{children:t})})}},2286:(e,t,r)=>{"use strict";r.d(t,{D:()=>u,N:()=>d});var n=r(6749),o=(e,t,r,n,o,c,s,a)=>{let i=document.documentElement,l=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&c?o.map(e=>c[e]||e):o;r?(i.classList.remove(...n),i.classList.add(c&&c[t]?c[t]:t)):i.setAttribute(e,t)}),r=t,a&&l.includes(r)&&(i.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=s&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},c=["light","dark"],s="(prefers-color-scheme: dark)",a="undefined"==typeof window,i=n.createContext(void 0),l={setTheme:e=>{},themes:[]},u=()=>{var e;return null!=(e=n.useContext(i))?e:l},d=e=>n.useContext(i)?n.createElement(n.Fragment,null,e.children):n.createElement(f,{...e}),m=["light","dark"],f=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:o=!0,enableColorScheme:a=!0,storageKey:l="theme",themes:u=m,defaultTheme:d=o?"system":"light",attribute:f="data-theme",value:g,children:b,nonce:S,scriptProps:w}=e,[k,E]=n.useState(()=>p(l,d)),[x,P]=n.useState(()=>"system"===k?v():k),T=g?Object.values(g):u,C=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&o&&(t=v());let n=g?g[t]:t,s=r?y(S):null,i=document.documentElement,l=e=>{"class"===e?(i.classList.remove(...T),n&&i.classList.add(n)):e.startsWith("data-")&&(n?i.setAttribute(e,n):i.removeAttribute(e))};if(Array.isArray(f)?f.forEach(l):l(f),a){let e=c.includes(d)?d:null,r=c.includes(t)?t:e;i.style.colorScheme=r}null==s||s()},[S]),N=n.useCallback(e=>{let t="function"==typeof e?e(k):e;E(t);try{localStorage.setItem(l,t)}catch(e){}},[k]),M=n.useCallback(e=>{P(v(e)),"system"===k&&o&&!t&&C("system")},[k,t]);n.useEffect(()=>{let e=window.matchMedia(s);return e.addListener(M),M(e),()=>e.removeListener(M)},[M]),n.useEffect(()=>{let e=e=>{e.key===l&&(e.newValue?E(e.newValue):N(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[N]),n.useEffect(()=>{C(null!=t?t:k)},[t,k]);let I=n.useMemo(()=>({theme:k,setTheme:N,forcedTheme:t,resolvedTheme:"system"===k?x:k,themes:o?[...u,"system"]:u,systemTheme:o?x:void 0}),[k,N,t,x,o,u]);return n.createElement(i.Provider,{value:I},n.createElement(h,{forcedTheme:t,storageKey:l,attribute:f,enableSystem:o,enableColorScheme:a,defaultTheme:d,value:g,themes:u,nonce:S,scriptProps:w}),b)},h=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:c,enableSystem:s,enableColorScheme:a,defaultTheme:i,value:l,themes:u,nonce:d,scriptProps:m}=e,f=JSON.stringify([c,r,i,t,u,l,s,a]).slice(1,-1);return n.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?d:"",dangerouslySetInnerHTML:{__html:"(".concat(o.toString(),")(").concat(f,")")}})}),p=(e,t)=>{let r;if(!a){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},y=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},v=e=>(e||(e=window.matchMedia(s)),e.matches?"dark":"light")},2490:()=>{},3652:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,2490,23)),Promise.resolve().then(r.bind(r,1012)),Promise.resolve().then(r.bind(r,7285))},5184:(e,t,r)=>{"use strict";r.d(t,{Ug:()=>a,eT:()=>i,i2:()=>u});var n=r(3817),o=r(6749),c=r(1806);let s=o.createContext(void 0);function a(){let e=o.useContext(s);if(!e)throw Error("useMux() must be used within <MuxProvider>");return e}function i(){return o.useContext(s)}function l(e,t){return t?"".concat(t,":").concat(e):e}function u(e){let{children:t}=e,r=(0,o.useRef)(null),a=(0,o.useRef)(new Map),i=(0,o.useRef)(new Map),[u,d]=(0,o.useState)("connecting"),[m,f]=(0,o.useState)([]),[h,p]=(0,o.useState)(null),y=(0,o.useRef)(0),v=(0,o.useRef)(null),g=(0,o.useRef)({}),b=(0,o.useRef)(!1),S=(0,o.useCallback)(()=>{if(!r.current){d("connecting");try{let e=function(e){var t,r,n;let o=window.location,s="https:"===o.protocol?"wss:":"ws:",a=null!=(t=e.proxyWsPath)?t:c.env.NEXT_PUBLIC_TERMINAL_WS_PATH;if(a){let e=a.replace(/\/ws\/?$/,"");return"".concat(s,"//").concat(o.host).concat(e,"/mux")}if(""===o.port||"443"===o.port||"80"===o.port)return"".concat(s,"//").concat(o.hostname,"/ao-terminal-mux");let i=null!=(n=null!=(r=e.directTerminalPort)?r:c.env.NEXT_PUBLIC_DIRECT_TERMINAL_PORT)?n:"14801";return"".concat(s,"//").concat(o.hostname,":").concat(i,"/mux")}(g.current);console.log("[MuxProvider] Connecting to",e);let t=new WebSocket(e);r.current=t,t.addEventListener("open",()=>{if(b.current)return void t.close();for(let e of(console.log("[MuxProvider] Connected"),d("connected"),y.current=0,i.current.values())){let r={ch:"terminal",id:e.id,type:"open",...e.projectId&&{projectId:e.projectId},...e.tmuxName&&{tmuxName:e.tmuxName}};t.send(JSON.stringify(r))}t.send(JSON.stringify({ch:"subscribe",topics:["sessions"]}))}),t.addEventListener("message",e=>{try{let t=JSON.parse(e.data);if("terminal"===t.ch){let e=l(t.id,"projectId"in t?t.projectId:void 0);if("data"===t.type){let r=a.current.get(e);if(r)for(let e of r)e(t.data)}else if("opened"===t.type)i.current.has(e)||i.current.set(e,{id:t.id,..."projectId"in t&&t.projectId?{projectId:t.projectId}:{}});else if("exited"===t.type){i.current.delete(e);let r=a.current.get(e);if(r){let e="\r\n\x1b[31m[Terminal exited with code ".concat(t.code,"]\x1b[0m\r\n");for(let t of r)t(e)}}else"error"===t.type&&console.error("[MuxProvider] Terminal error for ".concat(t.id,":"),t.message)}else"sessions"===t.ch&&("snapshot"===t.type?(f(t.sessions),p(null)):"error"===t.type&&p(t.error))}catch(e){console.error("[MuxProvider] Error processing message:",e)}}),t.addEventListener("error",e=>{console.error("[MuxProvider] WebSocket error:",e)}),t.addEventListener("close",()=>{if(console.log("[MuxProvider] Disconnected"),r.current===t&&(r.current=null),b.current)return;let e=Math.min(1e3*Math.pow(2,y.current),3e4);y.current+=1,d("reconnecting"),v.current=setTimeout(()=>{console.log("[MuxProvider] Reconnecting (attempt ".concat(y.current,")...")),S()},e)})}catch(e){console.error("[MuxProvider] Failed to create WebSocket:",e),d("disconnected")}}},[]);(0,o.useEffect)(()=>{b.current=!1;let e=!1;return(async()=>{try{let e=await fetch("/api/runtime/terminal");if(e.ok){let t=await e.json();g.current={directTerminalPort:function(e){if("string"!=typeof e&&"number"!=typeof e)return;let t=Number.parseInt(String(e),10);if(Number.isInteger(t)&&!(t<=0)&&!(t>65535))return String(t)}(t.directTerminalPort),proxyWsPath:function(e){if("string"!=typeof e)return;let t=e.trim();if(t.startsWith("/"))return t}(t.proxyWsPath)}}}catch(e){}e||S()})(),()=>{var t;e=!0,b.current=!0,v.current&&clearTimeout(v.current),null==(t=r.current)||t.close()}},[S]);let w=(0,o.useCallback)((e,t,n)=>{var o;let c=l(e,n),s=a.current.get(c);if(s||(s=new Set,a.current.set(c,s)),s.add(t),!i.current.has(c)&&(null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let t={ch:"terminal",id:e,type:"open",...n&&{projectId:n}};r.current.send(JSON.stringify(t))}return()=>{let e=a.current.get(c);e&&(e.delete(t),0===e.size&&a.current.delete(c))}},[]),k=(0,o.useCallback)((e,t,n)=>{var o;if((null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let o={ch:"terminal",id:e,type:"data",data:t,...n&&{projectId:n}};r.current.send(JSON.stringify(o))}},[]),E=(0,o.useCallback)((e,t,n)=>{var o;if(i.current.set(l(e,t),{id:e,projectId:t,tmuxName:n}),(null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let o={ch:"terminal",id:e,type:"open",...t&&{projectId:t},...n&&{tmuxName:n}};r.current.send(JSON.stringify(o))}},[]),x=(0,o.useCallback)((e,t)=>{var n;if(i.current.delete(l(e,t)),(null==(n=r.current)?void 0:n.readyState)===WebSocket.OPEN){let n={ch:"terminal",id:e,type:"close",...t&&{projectId:t}};r.current.send(JSON.stringify(n))}},[]),P=(0,o.useCallback)((e,t,n,o)=>{var c;if((null==(c=r.current)?void 0:c.readyState)===WebSocket.OPEN){let c={ch:"terminal",id:e,type:"resize",cols:t,rows:n,...o&&{projectId:o}};r.current.send(JSON.stringify(c))}},[]),T=(0,o.useMemo)(()=>({subscribeTerminal:w,writeTerminal:k,openTerminal:E,closeTerminal:x,resizeTerminal:P,status:u,sessions:m,lastError:h}),[w,k,E,x,P,u,m,h]);return(0,n.jsx)(s.Provider,{value:T,children:t})}},7285:(e,t,r)=>{"use strict";r.d(t,{ServiceWorkerRegistrar:()=>o});var n=r(6749);function o(){return(0,n.useEffect)(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(e=>{console.error("Service worker registration failed:",e)})},[]),null}}},e=>{e.O(0,[3906,131,1461,7358],()=>e(e.s=3652)),_N_E=e.O()}]);
|
package/.next/static/chunks/app/{not-found-0eb78483b8277b8d.js → not-found-824d5d3c6e296eeb.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4345,7927],{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4345,7927],{9660:(r,e,o)=>{Promise.resolve().then(o.bind(o,9789))},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var l=o(3817),t=o(8713),a=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,l.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,l.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,l.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,l.jsx)(a(),{href:e.href,className:t,style:n,children:e.label}):(0,l.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:a="Technical details",error:i,primaryAction:d,secondaryAction:x,compact:b=!1,chrome:u="page",children:m}=r,v=n[t],p=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,l.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(b?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===u?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,l.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,l.jsx)(s,{accent:v.accent}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,l.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,l.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||x)&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,l.jsx)(c,{action:d,primary:!0}):null,x?(0,l.jsx)(c,{action:x}):null]}),m,p?(0,l.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,l.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:a}),(0,l.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,l.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,l.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,l.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=9660)),_N_E=r.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9428],{2900:(e,r,t)=>{Promise.resolve().then(t.bind(t,9574))},4901:(e,r,t)=>{"use strict";function s(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.filter(Boolean).join(" ")}t.d(r,{cn:()=>s})},7594:(e,r,t)=>{"use strict";var s=t(9582);t.o(s,"useParams")&&t.d(r,{useParams:function(){return s.useParams}}),t.o(s,"usePathname")&&t.d(r,{usePathname:function(){return s.usePathname}}),t.o(s,"useRouter")&&t.d(r,{useRouter:function(){return s.useRouter}}),t.o(s,"useSearchParams")&&t.d(r,{useSearchParams:function(){return s.useSearchParams}})},8450:(e,r,t)=>{"use strict";function s(e){return"/projects/".concat(encodeURIComponent(e))}function a(e,r){return"".concat(s(e),"/sessions/").concat(encodeURIComponent(r))}function c(e,r,t){return"".concat(a(e,r)).concat(t)}t.d(r,{$l:()=>c,Nc:()=>a,bn:()=>s})},9574:(e,r,t)=>{"use strict";t.d(r,{OrchestratorSelector:()=>u});var s=t(3817),a=t(6749),c=t(7594),n=t(8713),o=t.n(n),i=t(4901),l=t(8450);function d(e){if(!e)return"Unknown";let r=new Date(e).getTime();if(!Number.isFinite(r))return"Unknown";let t=new Date().getTime()-r;if(t<0)return"Just now";let s=Math.floor(t/6e4),a=Math.floor(s/60),c=Math.floor(a/24);return s<1?"Just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):"".concat(c,"d ago")}function u(e){let{orchestrators:r,projectId:t,projectName:n,error:u}=e,x=(0,c.useRouter)(),[m,h]=(0,a.useState)(!1),[p,v]=(0,a.useState)(null),f=(0,a.useRef)(!1),b=async()=>{if(!f.current){f.current=!0,h(!0),v(null);try{let e=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:t})});if(!e.ok){let r=await e.json();throw Error(r.error||"Failed to spawn orchestrator")}let r=await e.json();x.push((0,l.Nc)(t,r.orchestrator.id))}catch(e){v(e instanceof Error?e.message:"Failed to spawn orchestrator")}finally{h(!1),f.current=!1}}};return u?(0,s.jsx)("div",{className:"flex h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-[var(--color-text-primary)]",children:"Error"}),(0,s.jsx)("p",{className:"mt-2 text-[var(--color-text-secondary)]",children:u}),(0,s.jsx)(o(),{href:"/",className:"orchestrator-btn mt-4 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium",children:"Go to Dashboard"})]})}):(0,s.jsxs)("div",{className:"flex min-h-screen flex-col bg-[var(--color-bg-base)]",children:[(0,s.jsx)("header",{className:"nav-glass sticky top-0 z-10 border-b border-[var(--color-border-subtle)] px-6 py-4",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-3xl items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-semibold text-[var(--color-text-primary)]",children:n}),(0,s.jsx)("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Project orchestrator"})]}),(0,s.jsx)(o(),{href:(0,l.bn)(t),className:"text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]",children:"Dashboard"})]})}),(0,s.jsx)("main",{className:"flex-1 px-6 py-8",children:(0,s.jsxs)("div",{className:"mx-auto max-w-3xl",children:[(0,s.jsx)("div",{className:"mb-6 rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)] p-4",children:(0,s.jsx)("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"AO keeps one main orchestrator per project. Opening or spawning here reuses that canonical session instead of creating another duplicate."})}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-secondary)]",children:"Main Session"}),(0,s.jsx)("div",{className:"space-y-2",children:r.map(e=>(0,s.jsxs)(o(),{href:(0,l.Nc)(e.projectId,e.id),className:(0,i.cn)("flex items-center justify-between rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)] p-4","transition-all hover:border-[var(--color-border-default)] hover:shadow-sm"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:function(e){switch(e){case"working":return"var(--color-status-working)";case"spawning":return"var(--color-status-attention)";case"pr_open":case"review_pending":case"approved":case"mergeable":return"var(--color-status-ready)";case"ci_failed":case"changes_requested":return"var(--color-status-error)";case"merged":case"done":case"killed":case"terminated":return"var(--color-text-tertiary)";default:return"var(--color-text-secondary)"}}(e.status)}}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-[var(--color-text-primary)]",children:e.id}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-secondary)]",children:[(0,s.jsx)("span",{className:"capitalize",children:e.status.replace(/_/g," ")}),e.activity&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[var(--color-text-tertiary)]",children:"\xb7"}),(0,s.jsx)("span",{children:function(e){if(!e)return"";switch(e){case"active":return"Active";case"ready":return"Ready";case"idle":return"Idle";case"waiting_input":return"Waiting";case"blocked":return"Blocked";case"exited":return"Exited";default:return e}}(e.activity)})]})]})]})]}),(0,s.jsxs)("div",{className:"text-right text-xs text-[var(--color-text-tertiary)]",children:[(0,s.jsxs)("div",{children:["Created ",d(e.createdAt)]}),e.lastActivityAt&&(0,s.jsxs)("div",{children:["Active ",d(e.lastActivityAt)]})]})]},e.id))})]}),(0,s.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-6",children:[(0,s.jsx)("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-secondary)]",children:"Open Orchestrator"}),(0,s.jsx)("button",{type:"button",onClick:b,disabled:m,className:(0,i.cn)("orchestrator-btn w-full px-4 py-3 text-sm font-medium","disabled:cursor-wait disabled:opacity-70"),children:m?(0,s.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,s.jsxs)("svg",{className:"h-4 w-4 animate-spin",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Opening orchestrator..."]}):"Open Orchestrator"}),p&&(0,s.jsx)("p",{className:"mt-2 text-sm text-[var(--color-status-error)]",children:p})]})]})})]})}}},e=>{e.O(0,[8713,131,1461,7358],()=>e(e.s=2900)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{5619:(e,s,_)=>{Promise.resolve().then(_.bind(_,4465))}},e=>{e.O(0,[8713,3780,7008,4465,131,1461,7358],()=>e(e.s=5619)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1332],{5275:(e,r,t)=>{"use strict";t.d(r,{RepairDegradedProjectButton:()=>l});var o=t(3817),n=t(6749),a=t(7594);function l(e){let{projectId:r}=e,t=(0,a.useRouter)(),[l,c]=(0,n.useState)(!1),[i,s]=(0,n.useState)(null),d=async()=>{c(!0),s(null);try{let o=await fetch("/api/projects/".concat(encodeURIComponent(r)),{method:"POST"}),n=await o.json().catch(()=>null);if(!o.ok){var e;s(null!=(e=null==n?void 0:n.error)?e:"Failed to repair project config.");return}t.refresh()}catch(e){s("Network error while repairing project config.")}finally{c(!1)}};return(0,o.jsxs)("div",{className:"mt-6",children:[(0,o.jsx)("button",{type:"button",onClick:()=>void d(),disabled:l,className:"rounded-lg border border-[var(--color-accent)] bg-[var(--color-tint-blue)] px-4 py-2 text-sm font-semibold text-[var(--color-accent)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-accent)_14%,transparent)] disabled:cursor-not-allowed disabled:opacity-60",children:l?"Repairing...":"Repair config"}),i?(0,o.jsx)("p",{className:"mt-3 text-sm text-[var(--color-status-error)]",children:i}):null]})}},7242:(e,r,t)=>{Promise.resolve().then(t.t.bind(t,8713,23)),Promise.resolve().then(t.bind(t,4465)),Promise.resolve().then(t.bind(t,5275))}},e=>{e.O(0,[8713,3780,7008,4465,131,1461,7358],()=>e(e.s=7242)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3610],{7738:(e,s,_)=>{Promise.resolve().then(_.bind(_,5795))}},e=>{e.O(0,[8713,3780,5795,131,1461,7358],()=>e(e.s=7738)),_N_E=e.O()}]);
|