@aoagents/ao-web 0.5.0 → 0.6.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.
Files changed (172) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +137 -137
  3. package/.next/app-path-routes-manifest.json +8 -8
  4. package/.next/build-manifest.json +6 -6
  5. package/.next/next-server.js.nft.json +1 -1
  6. package/.next/prerender-manifest.json +31 -31
  7. package/.next/react-loadable-manifest.json +3 -3
  8. package/.next/required-server-files.json +3 -3
  9. package/.next/server/app/_not-found/page.js +2 -2
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +7 -7
  14. package/.next/server/app/api/backlog/route.js +1 -1
  15. package/.next/server/app/api/backlog/route.js.nft.json +1 -1
  16. package/.next/server/app/api/backlog/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/browse-directory/route.js +1 -1
  18. package/.next/server/app/api/browse-directory/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/filesystem/browse/route.js +1 -1
  20. package/.next/server/app/api/filesystem/browse/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/issues/route.js +1 -1
  22. package/.next/server/app/api/issues/route.js.nft.json +1 -1
  23. package/.next/server/app/api/issues/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/observability/route.js +1 -1
  25. package/.next/server/app/api/observability/route.js.nft.json +1 -1
  26. package/.next/server/app/api/observability/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/orchestrators/route.js +1 -1
  28. package/.next/server/app/api/orchestrators/route.js.nft.json +1 -1
  29. package/.next/server/app/api/orchestrators/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/projects/[id]/route.js +1 -1
  31. package/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  32. package/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/projects/reload/route.js +1 -1
  34. package/.next/server/app/api/projects/reload/route.js.nft.json +1 -1
  35. package/.next/server/app/api/projects/reload/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/projects/route.js +1 -1
  37. package/.next/server/app/api/projects/route.js.nft.json +1 -1
  38. package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/prs/[id]/merge/route.js +1 -1
  40. package/.next/server/app/api/prs/[id]/merge/route.js.nft.json +1 -1
  41. package/.next/server/app/api/prs/[id]/merge/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/runtime/terminal/route.js +1 -1
  43. package/.next/server/app/api/runtime/terminal/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/sessions/[id]/kill/route.js +1 -1
  45. package/.next/server/app/api/sessions/[id]/kill/route.js.nft.json +1 -1
  46. package/.next/server/app/api/sessions/[id]/kill/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/sessions/[id]/message/route.js +1 -1
  48. package/.next/server/app/api/sessions/[id]/message/route.js.nft.json +1 -1
  49. package/.next/server/app/api/sessions/[id]/message/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/sessions/[id]/remap/route.js +1 -1
  51. package/.next/server/app/api/sessions/[id]/remap/route.js.nft.json +1 -1
  52. package/.next/server/app/api/sessions/[id]/remap/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/sessions/[id]/restore/route.js +1 -1
  54. package/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -1
  55. package/.next/server/app/api/sessions/[id]/restore/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  57. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  58. package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/sessions/[id]/send/route.js +1 -1
  60. package/.next/server/app/api/sessions/[id]/send/route.js.nft.json +1 -1
  61. package/.next/server/app/api/sessions/[id]/send/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/sessions/patches/route.js +1 -1
  63. package/.next/server/app/api/sessions/patches/route.js.nft.json +1 -1
  64. package/.next/server/app/api/sessions/patches/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/sessions/route.js +1 -1
  66. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  67. package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/setup-labels/route.js +1 -1
  69. package/.next/server/app/api/setup-labels/route.js.nft.json +1 -1
  70. package/.next/server/app/api/setup-labels/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/spawn/route.js +1 -1
  72. package/.next/server/app/api/spawn/route.js.nft.json +1 -1
  73. package/.next/server/app/api/spawn/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/verify/route.js +1 -1
  75. package/.next/server/app/api/verify/route.js.nft.json +1 -1
  76. package/.next/server/app/api/verify/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/webhooks/[...slug]/route.js +1 -1
  78. package/.next/server/app/api/webhooks/[...slug]/route.js.nft.json +1 -1
  79. package/.next/server/app/api/webhooks/[...slug]/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/apple-icon/route.js +1 -1
  81. package/.next/server/app/apple-icon/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/dev/terminal-test/page.js +3 -3
  83. package/.next/server/app/dev/terminal-test/page.js.nft.json +1 -1
  84. package/.next/server/app/dev/terminal-test/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/dev/terminal-test.html +1 -1
  86. package/.next/server/app/dev/terminal-test.rsc +8 -8
  87. package/.next/server/app/icon/route.js +1 -1
  88. package/.next/server/app/icon/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/icon-192/route.js +1 -1
  90. package/.next/server/app/icon-192/route.js.nft.json +1 -1
  91. package/.next/server/app/icon-192/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/icon-512/route.js +1 -1
  93. package/.next/server/app/icon-512/route.js.nft.json +1 -1
  94. package/.next/server/app/icon-512/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  96. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  97. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/orchestrators/page.js +2 -2
  99. package/.next/server/app/orchestrators/page.js.nft.json +1 -1
  100. package/.next/server/app/orchestrators/page_client-reference-manifest.js +1 -1
  101. package/.next/server/app/page.js +2 -2
  102. package/.next/server/app/page.js.nft.json +1 -1
  103. package/.next/server/app/page_client-reference-manifest.js +1 -1
  104. package/.next/server/app/projects/[projectId]/page.js +2 -2
  105. package/.next/server/app/projects/[projectId]/page.js.nft.json +1 -1
  106. package/.next/server/app/projects/[projectId]/page_client-reference-manifest.js +1 -1
  107. package/.next/server/app/projects/[projectId]/sessions/[id]/page.js +2 -2
  108. package/.next/server/app/projects/[projectId]/sessions/[id]/page.js.nft.json +1 -1
  109. package/.next/server/app/projects/[projectId]/sessions/[id]/page_client-reference-manifest.js +1 -1
  110. package/.next/server/app/projects/[projectId]/settings/page.js +2 -2
  111. package/.next/server/app/projects/[projectId]/settings/page.js.nft.json +1 -1
  112. package/.next/server/app/projects/[projectId]/settings/page_client-reference-manifest.js +1 -1
  113. package/.next/server/app/prs/page.js +2 -2
  114. package/.next/server/app/prs/page.js.nft.json +1 -1
  115. package/.next/server/app/prs/page_client-reference-manifest.js +1 -1
  116. package/.next/server/app/sessions/[id]/page.js +2 -2
  117. package/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  118. package/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  119. package/.next/server/app/test-direct/page.js +2 -2
  120. package/.next/server/app/test-direct/page.js.nft.json +1 -1
  121. package/.next/server/app/test-direct/page_client-reference-manifest.js +1 -1
  122. package/.next/server/app/test-direct.html +1 -1
  123. package/.next/server/app/test-direct.rsc +8 -8
  124. package/.next/server/app-paths-manifest.json +8 -8
  125. package/.next/server/chunks/1172.js +1 -1
  126. package/.next/server/chunks/1876.js +2 -2
  127. package/.next/server/chunks/4520.js +1 -1
  128. package/.next/server/chunks/6811.js +3 -0
  129. package/.next/server/chunks/7173.js +1 -1
  130. package/.next/server/chunks/801.js +5 -5
  131. package/.next/server/chunks/9223.js +2 -2
  132. package/.next/server/middleware-build-manifest.js +1 -1
  133. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  134. package/.next/server/pages/404.html +1 -1
  135. package/.next/server/pages/500.html +1 -1
  136. package/.next/server/server-reference-manifest.json +1 -1
  137. package/.next/static/chunks/{1383.c891a8ba72ee600c.js → 1383.8f5f7d4606d356cc.js} +1 -1
  138. package/.next/static/chunks/3764.88619fb0d047cae8.js +1 -0
  139. package/.next/static/chunks/app/dev/terminal-test/page-59decd1aad4e02ad.js +1 -0
  140. package/.next/static/chunks/app/{error-da1d10c96ff5dd29.js → error-684a1c5596fa1e14.js} +1 -1
  141. package/.next/static/chunks/app/{global-error-ca06d2b1be2d4ae0.js → global-error-1a79bacfbd9b1ba4.js} +1 -1
  142. package/.next/static/chunks/app/layout-0cda720d75f111b8.js +1 -0
  143. package/.next/static/chunks/app/not-found-315f4e5c106b425d.js +1 -0
  144. package/.next/static/chunks/app/orchestrators/{page-f07983413ed1a44b.js → page-e3a2c53b57dd8391.js} +1 -1
  145. package/.next/static/chunks/app/page-e2e589ea11a0780a.js +1 -0
  146. package/.next/static/chunks/app/projects/[projectId]/{page-49eb5b990c74ca8f.js → page-19a6d4cc9951a9e4.js} +1 -1
  147. package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-75c536c9755754f7.js +1 -0
  148. package/.next/static/chunks/app/projects/[projectId]/settings/{page-d1da671e72a7bd5e.js → page-f8c323b91978efff.js} +1 -1
  149. package/.next/static/chunks/app/prs/page-08f17d7dc341b6f1.js +1 -0
  150. package/.next/static/chunks/app/sessions/[id]/{error-8de5b24e86eeae7b.js → error-62e9972b39d9cd16.js} +1 -1
  151. package/.next/static/chunks/app/sessions/[id]/not-found-315f4e5c106b425d.js +1 -0
  152. package/.next/static/chunks/app/sessions/[id]/page-d0b08722dec5a04a.js +1 -0
  153. package/.next/static/chunks/app/test-direct/{page-eb366dde03fab6a7.js → page-ee0944bcd355194e.js} +1 -1
  154. package/.next/static/chunks/main-app-b95f197c38e3b0a3.js +1 -0
  155. package/.next/static/chunks/{webpack-d2dfbd3e9262b74e.js → webpack-83d2d8248a30259c.js} +1 -1
  156. package/.next/static/css/cf9226160e230bf4.css +1 -0
  157. package/dist-server/mux-websocket.js +49 -6
  158. package/package.json +12 -12
  159. package/.next/server/chunks/3131.js +0 -3
  160. package/.next/static/chunks/3764.89a5955e46eb74b4.js +0 -1
  161. package/.next/static/chunks/app/dev/terminal-test/page-5819e40b3d4754ef.js +0 -1
  162. package/.next/static/chunks/app/layout-bb6db479523cb3d6.js +0 -1
  163. package/.next/static/chunks/app/not-found-824d5d3c6e296eeb.js +0 -1
  164. package/.next/static/chunks/app/page-6aa506a579ac9949.js +0 -1
  165. package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-2450704c6b66a4b4.js +0 -1
  166. package/.next/static/chunks/app/prs/page-2332a7180a47f28c.js +0 -1
  167. package/.next/static/chunks/app/sessions/[id]/not-found-824d5d3c6e296eeb.js +0 -1
  168. package/.next/static/chunks/app/sessions/[id]/page-b60b49ccbafe51c9.js +0 -1
  169. package/.next/static/chunks/main-app-690acf9d5d2050c9.js +0 -1
  170. package/.next/static/css/fcafd381715071b8.css +0 -1
  171. /package/.next/static/{YR6Xi4DC5A7S7E2PoZuif → h0RXs0prE87a8wlbEXQKM}/_buildManifest.js +0 -0
  172. /package/.next/static/{YR6Xi4DC5A7S7E2PoZuif → h0RXs0prE87a8wlbEXQKM}/_ssgManifest.js +0 -0
@@ -1,3 +0,0 @@
1
- exports.id=3131,exports.ids=[3131],exports.modules={2191:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f}),c(81249),c(13081);var d=c(6181);let e={size:{width:32,height:32},contentType:"image/png"};async function f(a){let{__metadata_id__:b,...c}=await a.params,f=(0,d.fillMetadataSegment)(".",c,"icon"),{generateImageMetadata:g}=e;function h(a,b){let c={alt:a.alt,type:a.contentType||"image/png",url:f+(b?"/"+b:"")+"?fde4afff4688df3a"},{size:d}=a;return d&&(c.sizes=d.width+"x"+d.height),c}return g?(await g({params:c})).map((a,b)=>{let c=(a.id||b)+"";return h(a,c)}):[h(e,"")]}},3964:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,57035,23)),Promise.resolve().then(c.t.bind(c,57543,23)),Promise.resolve().then(c.t.bind(c,970,23)),Promise.resolve().then(c.t.bind(c,84702,23)),Promise.resolve().then(c.t.bind(c,18706,23)),Promise.resolve().then(c.t.bind(c,11194,23)),Promise.resolve().then(c.t.bind(c,33151,23)),Promise.resolve().then(c.t.bind(c,75210,23))},8556:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(68844);function e(){return(0,d.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,d.jsx)("svg",{className:"h-5 w-5 animate-spin text-[var(--color-text-tertiary)]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9"})}),(0,d.jsx)("p",{className:"text-[13px] text-[var(--color-text-tertiary)]",children:"Loading…"})]})})}},13081:(a,b,c)=>{"use strict";c.d(b,{Kk:()=>f,uy:()=>e});var d=c(68844);function e(a){return a.replace(/[^\w\s-]/g,"").slice(0,50)||"AO"}function f(a,b){let c=(b.charAt(0)||"A").toUpperCase(),e=function(a){let b=0;for(let c=0;c<a.length;c++)b=a.charCodeAt(c)+((b<<5)-b);return(b%360+360)%360}(b),f=Math.round(.19*a),g=Math.round(.625*a);return(0,d.jsx)("div",{style:{width:`${a}px`,height:`${a}px`,borderRadius:`${f}px`,background:`hsl(${e}, 60%, 45%)`,display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:`${g}px`,fontWeight:700,fontFamily:"sans-serif"},children:c})}},16819:(a,b,c)=>{"use strict";c.d(b,{ErrorDisplay:()=>d});let d=(0,c(10864).registerClientReference)(function(){throw Error("Attempted to call ErrorDisplay() from the server but ErrorDisplay is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/equinox/agent-orchestrator/packages/web/src/components/ErrorDisplay.tsx","ErrorDisplay")},23041:(a,b,c)=>{"use strict";c.d(b,{ErrorDisplay:()=>j});var d=c(33666),e=c(47489),f=c.n(e);let g={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 h({accent:a}){return(0,d.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:`linear-gradient(180deg, color-mix(in srgb, ${a} 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)`,borderColor:`color-mix(in srgb, ${a} 18%, var(--color-border-default))`,boxShadow:"var(--detail-card-shadow)"},children:(0,d.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:a},viewBox:"0 0 24 24",children:[(0,d.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,d.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function i({action:a,primary:b=!1}){let c=b?"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",e=b?{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 a.href?(0,d.jsx)(f(),{href:a.href,className:c,style:e,children:a.label}):(0,d.jsx)("button",{type:"button",onClick:a.onClick,className:c,style:e,children:a.label})}function j({title:a,message:b,tone:c="error",detailsTitle:e="Technical details",error:f,primaryAction:j,secondaryAction:k,compact:l=!1,chrome:m="page",children:n}){let o=g[c],p=!!(f?.digest||f?.message||f?.stack);return(0,d.jsx)("div",{className:`flex w-full items-center justify-center px-6 py-10 ${l?"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,d.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,d.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,d.jsx)(h,{accent:o.accent}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.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:o.accent,background:o.bg,borderColor:o.border},children:o.label}),(0,d.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:a}),(0,d.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:b})]})]}),(j||k)&&(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[j?(0,d.jsx)(i,{action:j,primary:!0}):null,k?(0,d.jsx)(i,{action:k}):null]}),n,p?(0,d.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,d.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:e}),(0,d.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[f?.digest?(0,d.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",f.digest]}):null,f?.message?(0,d.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:f.message}):null,f?.stack?(0,d.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:f.stack}):null]})]}):null]})})})}},24553:()=>{},26400:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(33666);c(81115);var e=c(23041);function f({error:a,reset:b}){return(0,d.jsx)("html",{lang:"en",className:"dark",children:(0,d.jsx)("body",{className:"bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased",children:(0,d.jsx)(e.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:b},secondaryAction:{label:"Reload page",onClick:()=>window.location.reload()},error:a})})})}},27926:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(10864).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/equinox/agent-orchestrator/packages/web/src/app/global-error.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/equinox/agent-orchestrator/packages/web/src/app/global-error.tsx","default")},37728:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f}),c(81249),c(13081);var d=c(6181);let e={size:{width:180,height:180},contentType:"image/png"};async function f(a){let{__metadata_id__:b,...c}=await a.params,f=(0,d.fillMetadataSegment)(".",c,"apple-icon"),{generateImageMetadata:g}=e;function h(a,b){let c={alt:a.alt,type:a.contentType||"image/png",url:f+(b?"/"+b:"")+"?95aeb60ec7acf330"},{size:d}=a;return d&&(c.sizes=d.width+"x"+d.height),c}return g?(await g({params:c})).map((a,b)=>{let c=(a.id||b)+"";return h(a,c)}):[h(e,"")]}},41936:(a,b,c)=>{Promise.resolve().then(c.bind(c,27926))},49905:(a,b,c)=>{"use strict";function d(){return null}c.d(b,{ServiceWorkerRegistrar:()=>d}),c(81115)},51664:(a,b,c)=>{Promise.resolve().then(c.bind(c,26400))},54433:(a,b,c)=>{Promise.resolve().then(c.bind(c,16819))},58976:(a,b,c)=>{"use strict";c.d(b,{eT:()=>h,i2:()=>j});var d=c(33666),e=c(81115),f=c.n(e);let g=f().createContext(void 0);function h(){return f().useContext(g)}function i(a,b){return b?`${b}:${a}`:a}function j({children:a}){let b=(0,e.useRef)(null),c=(0,e.useRef)(new Map),f=(0,e.useRef)(new Map),[h,j]=(0,e.useState)("connecting"),[k,l]=(0,e.useState)([]),[m,n]=(0,e.useState)(null),o=(0,e.useRef)(0),p=(0,e.useRef)(null),q=(0,e.useRef)({}),r=(0,e.useRef)(!1),s=(0,e.useCallback)(()=>{if(!b.current){j("connecting");try{let a=function(a){let b=window.location,c="https:"===b.protocol?"wss:":"ws:",d=a.proxyWsPath??process.env.NEXT_PUBLIC_TERMINAL_WS_PATH;if(d){let a=d.replace(/\/ws\/?$/,"");return`${c}//${b.host}${a}/mux`}if(""===b.port||"443"===b.port||"80"===b.port)return`${c}//${b.hostname}/ao-terminal-mux`;let e=a.directTerminalPort??process.env.NEXT_PUBLIC_DIRECT_TERMINAL_PORT??"14801";return`${c}//${b.hostname}:${e}/mux`}(q.current);console.log("[MuxProvider] Connecting to",a);let d=new WebSocket(a);b.current=d,d.addEventListener("open",()=>{if(r.current)return void d.close();for(let a of(console.log("[MuxProvider] Connected"),j("connected"),o.current=0,f.current.values())){let b={ch:"terminal",id:a.id,type:"open",...a.projectId&&{projectId:a.projectId},...a.tmuxName&&{tmuxName:a.tmuxName}};d.send(JSON.stringify(b))}d.send(JSON.stringify({ch:"subscribe",topics:["sessions"]}))}),d.addEventListener("message",a=>{try{let b=JSON.parse(a.data);if("terminal"===b.ch){let a=i(b.id,"projectId"in b?b.projectId:void 0);if("data"===b.type){let d=c.current.get(a);if(d)for(let a of d)a(b.data)}else if("opened"===b.type)f.current.has(a)||f.current.set(a,{id:b.id,..."projectId"in b&&b.projectId?{projectId:b.projectId}:{}});else if("exited"===b.type){f.current.delete(a);let d=c.current.get(a);if(d){let a=`\r
2
- \x1b[31m[Terminal exited with code ${b.code}]\x1b[0m\r
3
- `;for(let b of d)b(a)}}else"error"===b.type&&console.error(`[MuxProvider] Terminal error for ${b.id}:`,b.message)}else"sessions"===b.ch&&("snapshot"===b.type?(l(b.sessions),n(null)):"error"===b.type&&n(b.error))}catch(a){console.error("[MuxProvider] Error processing message:",a)}}),d.addEventListener("error",a=>{console.error("[MuxProvider] WebSocket error:",a)}),d.addEventListener("close",()=>{if(console.log("[MuxProvider] Disconnected"),b.current===d&&(b.current=null),r.current)return;let a=Math.min(1e3*Math.pow(2,o.current),3e4);o.current+=1,j("reconnecting"),p.current=setTimeout(()=>{console.log(`[MuxProvider] Reconnecting (attempt ${o.current})...`),s()},a)})}catch(a){console.error("[MuxProvider] Failed to create WebSocket:",a),j("disconnected")}}},[]),t=(0,e.useCallback)((a,d,e)=>{let g=i(a,e),h=c.current.get(g);if(h||(h=new Set,c.current.set(g,h)),h.add(d),!f.current.has(g)&&b.current?.readyState===WebSocket.OPEN){let c={ch:"terminal",id:a,type:"open",...e&&{projectId:e}};b.current.send(JSON.stringify(c))}return()=>{let a=c.current.get(g);a&&(a.delete(d),0===a.size&&c.current.delete(g))}},[]),u=(0,e.useCallback)((a,c,d)=>{if(b.current?.readyState===WebSocket.OPEN){let e={ch:"terminal",id:a,type:"data",data:c,...d&&{projectId:d}};b.current.send(JSON.stringify(e))}},[]),v=(0,e.useCallback)((a,c,d)=>{if(f.current.set(i(a,c),{id:a,projectId:c,tmuxName:d}),b.current?.readyState===WebSocket.OPEN){let e={ch:"terminal",id:a,type:"open",...c&&{projectId:c},...d&&{tmuxName:d}};b.current.send(JSON.stringify(e))}},[]),w=(0,e.useCallback)((a,c)=>{if(f.current.delete(i(a,c)),b.current?.readyState===WebSocket.OPEN){let d={ch:"terminal",id:a,type:"close",...c&&{projectId:c}};b.current.send(JSON.stringify(d))}},[]),x=(0,e.useCallback)((a,c,d,e)=>{if(b.current?.readyState===WebSocket.OPEN){let f={ch:"terminal",id:a,type:"resize",cols:c,rows:d,...e&&{projectId:e}};b.current.send(JSON.stringify(f))}},[]),y=(0,e.useMemo)(()=>({subscribeTerminal:t,writeTerminal:u,openTerminal:v,closeTerminal:w,resizeTerminal:x,status:h,sessions:k,lastError:m}),[t,u,v,w,x,h,k,m]);return(0,d.jsx)(g.Provider,{value:y,children:a})}},62108:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,8125,23)),Promise.resolve().then(c.t.bind(c,6125,23)),Promise.resolve().then(c.t.bind(c,74148,23)),Promise.resolve().then(c.t.bind(c,10236,23)),Promise.resolve().then(c.t.bind(c,97760,23)),Promise.resolve().then(c.t.bind(c,9528,23)),Promise.resolve().then(c.t.bind(c,20225,23)),Promise.resolve().then(c.bind(c,23240))},62886:(a,b,c)=>{Promise.resolve().then(c.bind(c,89252))},63028:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(68844),e=c(16819);function f(){return(0,d.jsx)(e.ErrorDisplay,{title:"Page not found",message:"This route does not exist in the dashboard. Return to the main view to pick an active project or session.",tone:"not-found",primaryAction:{label:"Back to dashboard",href:"/"}})}},69648:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>j,generateMetadata:()=>i,viewport:()=>h});var d=c(68844),e=c(81249),f=c(81871),g=c(94666);c(24553);let h={width:"device-width",initialScale:1,viewportFit:"cover",themeColor:[{media:"(prefers-color-scheme: light)",color:"#f5f3f0"},{media:"(prefers-color-scheme: dark)",color:"#121110"}]};async function i(){let a=(0,e.P_)();return{title:{template:`%s | ${a}`,default:`ao | ${a}`},description:"Dashboard for managing parallel AI coding agents",appleWebApp:{capable:!0,statusBarStyle:"black-translucent",title:`ao | ${a}`}}}function j({children:a}){return(0,d.jsx)("html",{lang:"en",className:"dark",suppressHydrationWarning:!0,children:(0,d.jsxs)("body",{className:"h-screen overflow-hidden bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased",children:[(0,d.jsx)(g.Providers,{children:a}),(0,d.jsx)(f.ServiceWorkerRegistrar,{})]})})}},71134:(a,b,c)=>{Promise.resolve().then(c.bind(c,82834))},71241:(a,b,c)=>{Promise.resolve().then(c.bind(c,88496)),Promise.resolve().then(c.bind(c,49905))},80969:(a,b,c)=>{Promise.resolve().then(c.bind(c,94666)),Promise.resolve().then(c.bind(c,81871))},81249:(a,b,c)=>{"use strict";c.d(b,{Bq:()=>m,P_:()=>l,cf:()=>n});var d=c(29685),e=c(73024),f=c(76760),g=c(35217);function h(){let a=(0,g.NoB)();try{return(0,g.Z9L)(a)}catch(a){if(a instanceof g.kw3||a instanceof Error&&"code"in a&&"ENOENT"===a.code)return(0,g.Z9L)();throw a}}function i(a){try{return(0,e.realpathSync)(a)}catch{return(0,f.resolve)(a)}}function j(a,b){let c=i(a);for(let[a,d]of Object.entries(b.projects))if("string"==typeof d.path&&i(d.path)===c)return a}function k(a=h()){try{let b=function(a){try{let b=function(a){let b=(0,f.resolve)(a);for(;;){for(let a of["agent-orchestrator.yaml","agent-orchestrator.yml"]){let c=(0,f.resolve)(b,a);if((0,e.existsSync)(c))return c}let a=(0,f.dirname)(b);if(a===b)return;b=a}}(process.cwd());if(!b)return;let c=(0,g.Z9L)(b),d=i((0,g.NoB)());if(i(c.configPath)!==d){for(let b of Object.values(c.projects)){if("string"!=typeof b.path)continue;let c=j(b.path,a);if(c)return c}return j((0,f.dirname)(c.configPath),a)}}catch{}}(a);if(b)return b;let c=i(process.cwd());return j(c,a)}catch{return}}let l=(0,d.cache)(()=>{try{let a=h(),b=k(a);if(b){let c=a.projects[b];return c?.name??b}let c=Object.keys(a.projects)[0];if(c)return(a.projects[c].name??c)||c||"ao"}catch{}return"ao"}),m=(0,d.cache)(()=>{try{let a=h(),b=k(a);if(b)return b;let c=Object.keys(a.projects)[0];if(c)return c}catch{}return"ao"}),n=(0,d.cache)(()=>{try{let a=h();return[...Object.entries(a.projects).map(([a,b])=>({id:a,name:b.name??a,sessionPrefix:b.sessionPrefix??a})),...Object.entries(a.degradedProjects).map(([a,b])=>({id:a,name:a,sessionPrefix:a,resolveError:b.resolveError}))]}catch{return[]}})},81871:(a,b,c)=>{"use strict";c.d(b,{ServiceWorkerRegistrar:()=>d});let d=(0,c(10864).registerClientReference)(function(){throw Error("Attempted to call ServiceWorkerRegistrar() from the server but ServiceWorkerRegistrar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/equinox/agent-orchestrator/packages/web/src/components/ServiceWorkerRegistrar.tsx","ServiceWorkerRegistrar")},82834:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(10864).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/equinox/agent-orchestrator/packages/web/src/app/error.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/equinox/agent-orchestrator/packages/web/src/app/error.tsx","default")},88496:(a,b,c)=>{"use strict";c.d(b,{Providers:()=>g});var d=c(33666),e=c(93463),f=c(58976);function g({children:a}){return(0,d.jsx)(e.N,{attribute:"class",defaultTheme:"dark",enableSystem:!1,children:(0,d.jsx)(f.i2,{children:a})})}},89252:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g});var d=c(33666),e=c(50436);c(81115);var f=c(23041);function g({error:a,reset:b}){let c=(0,e.useRouter)();return(0,d.jsx)(f.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:()=>{b(),c.refresh()}},secondaryAction:{label:"Back to dashboard",href:"/"},error:a,compact:!0,chrome:"card"})}},90881:(a,b,c)=>{Promise.resolve().then(c.bind(c,23041))},94666:(a,b,c)=>{"use strict";c.d(b,{Providers:()=>d});let d=(0,c(10864).registerClientReference)(function(){throw Error("Attempted to call Providers() from the server but Providers is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/equinox/agent-orchestrator/packages/web/src/app/providers.tsx","Providers")}};
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1383,3764],{2286:(e,t,r)=>{"use strict";r.d(t,{D:()=>u,N:()=>d});var n=r(6749),o=(e,t,r,n,o,a,l,s)=>{let i=document.documentElement,c=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&a?o.map(e=>a[e]||e):o;r?(i.classList.remove(...n),i.classList.add(a&&a[t]?a[t]:t)):i.setAttribute(e,t)}),r=t,s&&c.includes(r)&&(i.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=l&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},a=["light","dark"],l="(prefers-color-scheme: dark)",s="undefined"==typeof window,i=n.createContext(void 0),c={setTheme:e=>{},themes:[]},u=()=>{var e;return null!=(e=n.useContext(i))?e:c},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:s=!0,storageKey:c="theme",themes:u=m,defaultTheme:d=o?"system":"light",attribute:f="data-theme",value:g,children:x,nonce:y,scriptProps:w}=e,[S,k]=n.useState(()=>p(c,d)),[E,C]=n.useState(()=>"system"===S?b():S),T=g?Object.values(g):u,N=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&o&&(t=b());let n=g?g[t]:t,l=r?v(y):null,i=document.documentElement,c=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(c):c(f),s){let e=a.includes(d)?d:null,r=a.includes(t)?t:e;i.style.colorScheme=r}null==l||l()},[y]),j=n.useCallback(e=>{let t="function"==typeof e?e(S):e;k(t);try{localStorage.setItem(c,t)}catch(e){}},[S]),M=n.useCallback(e=>{C(b(e)),"system"===S&&o&&!t&&N("system")},[S,t]);n.useEffect(()=>{let e=window.matchMedia(l);return e.addListener(M),M(e),()=>e.removeListener(M)},[M]),n.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?k(e.newValue):j(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[j]),n.useEffect(()=>{N(null!=t?t:S)},[t,S]);let P=n.useMemo(()=>({theme:S,setTheme:j,forcedTheme:t,resolvedTheme:"system"===S?E:S,themes:o?[...u,"system"]:u,systemTheme:o?E:void 0}),[S,j,t,E,o,u]);return n.createElement(i.Provider,{value:P},n.createElement(h,{forcedTheme:t,storageKey:c,attribute:f,enableSystem:o,enableColorScheme:s,defaultTheme:d,value:g,themes:u,nonce:y,scriptProps:w}),x)},h=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:a,enableSystem:l,enableColorScheme:s,defaultTheme:i,value:c,themes:u,nonce:d,scriptProps:m}=e,f=JSON.stringify([a,r,i,t,u,c,l,s]).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(!s){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},v=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)}},b=e=>(e||(e=window.matchMedia(l)),e.matches?"dark":"light")},3764:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DirectTerminal:()=>p,buildTerminalThemes:()=>h,resolveMonoFontFamily:()=>u});var n=r(3817),o=r(6749),a=r(7594),l=r(2286),s=r(4901);let i="ao-terminal-font-size",c='"JetBrains Mono", "SF Mono", Menlo, Monaco, "Courier New", monospace';function u(){try{let e=getComputedStyle(document.documentElement).getPropertyValue("--font-jetbrains-mono").trim();return e?"".concat(e,", ").concat(c):c}catch(e){return c}}function d(e){let{sessionId:t,chromeless:r,isOpenCodeSession:a,reloadCommand:l,fontSize:i,setFontSize:c,fullscreen:u,toggleFullscreen:d,muxStatus:m,error:f}=e,[h,p]=(0,o.useState)(!1),[v,b]=(0,o.useState)(null);async function g(){if(a&&!h){b(null),p(!0);try{let e=l;if(!e){let r=await fetch("/api/sessions/".concat(encodeURIComponent(t),"/remap"),{method:"POST"});if(!r.ok)throw Error("Failed to remap OpenCode session: ".concat(r.status));let n=await r.json();if("string"!=typeof n.opencodeSessionId||0===n.opencodeSessionId.length)throw Error("Missing OpenCode session id after remap");e="/exit\nopencode --session ".concat(n.opencodeSessionId,"\n")}let r=await fetch("/api/sessions/".concat(encodeURIComponent(t),"/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})});if(!r.ok)throw Error("Failed to send reload command: ".concat(r.status))}catch(e){b(e instanceof Error?e.message:"Failed to reload OpenCode session")}finally{p(!1)}}}let x=f?"error":m,y="var(--color-accent)",w=(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("button",{onClick:()=>c(e=>Math.max(9,e-1)),disabled:i<=9,className:"w-5 h-5 text-xs flex items-center justify-center rounded hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":"Decrease font size",children:"−"}),(0,n.jsxs)("span",{className:"w-9 text-center text-xs font-medium text-[var(--color-text-secondary)]",children:[i,"px"]}),(0,n.jsx)("button",{onClick:()=>c(e=>Math.min(18,e+1)),disabled:i>=18,className:"w-5 h-5 text-xs flex items-center justify-center rounded hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":"Increase font size",children:"+"})]}),S=a?(0,n.jsx)("button",{onClick:g,disabled:h||"connected"!==m,title:"Restart OpenCode session (/exit then resume mapped session)","aria-label":"Restart OpenCode session",className:"flex items-center gap-1 px-2 py-0.5 text-[11px] text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-subtle)] hover:text-[var(--color-text-primary)] disabled:cursor-not-allowed disabled:opacity-70",children:h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3 animate-spin",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M12 3a9 9 0 109 9"})}),"restarting"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{d:"M21 12a9 9 0 11-2.64-6.36"}),(0,n.jsx)("path",{d:"M21 3v6h-6"})]}),"restart"]})}):null,k=(0,n.jsx)("button",{onClick:d,className:(0,s.cn)("flex items-center gap-1 px-2 py-0.5 text-[11px] text-[var(--color-text-tertiary)] transition-colors hover:bg-[var(--color-bg-subtle)] hover:text-[var(--color-text-primary)]",!a&&!r&&"ml-auto"),"aria-label":u?"exit fullscreen":"fullscreen",children:u?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3"})}),"exit fullscreen"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3"})}),"fullscreen"]})});return r?(0,n.jsxs)("div",{className:"absolute right-3 top-3 z-10 flex items-center gap-1 rounded-[6px] border border-[var(--color-border-subtle)] bg-[color-mix(in_srgb,var(--color-bg-elevated)_92%,transparent)] px-1.5 py-1 shadow-[0_8px_24px_rgba(0,0,0,0.18)] backdrop-blur-sm",children:[S,k]}):(0,n.jsxs)("div",{className:"terminal-chrome-bar flex items-center gap-2 border-b border-[var(--color-border-subtle)] bg-[var(--color-bg-elevated)] px-3 py-2",children:[(0,n.jsx)("span",{className:"terminal-chrome-pane-label",children:"TERMINAL"}),(0,n.jsxs)("div",{className:"terminal-chrome-identity",children:[(0,n.jsx)("span",{className:"terminal-chrome-session-id font-[var(--font-mono)] text-[11px]",style:{color:y},children:t}),(0,n.jsxs)("div",{className:"terminal-chrome-status-row",children:[(0,n.jsx)("div",{className:(0,s.cn)("h-2 w-2 shrink-0 rounded-full","connected"===x?"bg-[var(--color-status-ready)]":"error"===x||"disconnected"===x?"bg-[var(--color-status-error)]":"bg-[var(--color-status-attention)] animate-[pulse_1.5s_ease-in-out_infinite]")}),(0,n.jsx)("span",{className:(0,s.cn)("text-[10px] font-medium uppercase tracking-[0.06em]","connected"===x?"text-[var(--color-status-ready)]":"error"===x||"disconnected"===x?"text-[var(--color-status-error)]":"text-[var(--color-text-tertiary)]"),children:"connected"===x?"Connected":"error"===x?null!=f?f:"Error":"disconnected"===x?"Disconnected":"Connecting…"}),(0,n.jsx)("span",{className:"px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-[0.06em]",style:{color:y,background:"color-mix(in srgb, ".concat(y," 12%, transparent)")},children:"XDA"})]})]}),(0,n.jsx)("div",{className:"flex-1"}),w,S,v?(0,n.jsx)("span",{className:"max-w-[40ch] truncate text-[10px] font-medium text-[var(--color-status-error)]",title:v,children:v}):null,k]})}var m=r(5184);r(5611);let f={deadZone:8,verticalDominance:1.5,maxLinesPerEvent:6,speedMultiplier:3,tmuxPrefix:"\x02"};function h(e){let t="#5b7ef8";return{dark:{background:"#0a0a0f",foreground:"#d4d4d8",cursor:t,cursorAccent:"#0a0a0f",selectionBackground:"rgba(91, 126, 248, 0.30)",selectionInactiveBackground:"rgba(128, 128, 128, 0.2)",black:"#1a1a24",red:"#ef4444",green:"#22c55e",yellow:"#f59e0b",blue:"#5b7ef8",magenta:"#a371f7",cyan:"#22d3ee",white:"#d4d4d8",brightBlack:"#50506a",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#fbbf24",brightBlue:"#7b9cfb",brightMagenta:"#c084fc",brightCyan:"#67e8f9",brightWhite:"#eeeef5"},light:{background:"#fafafa",foreground:"#24292f",cursor:t,cursorAccent:"#fafafa",selectionBackground:"rgba(91, 126, 248, 0.25)",selectionInactiveBackground:"rgba(128, 128, 128, 0.15)",black:"#24292f",red:"#b42318",green:"#1f7a3d",yellow:"#8a5a00",blue:"#175cd3",magenta:"#8e24aa",cyan:"#0b7285",white:"#4b5563",brightBlack:"#374151",brightRed:"#912018",brightGreen:"#176639",brightYellow:"#6f4a00",brightBlue:"#1d4ed8",brightMagenta:"#7b1fa2",brightCyan:"#155e75",brightWhite:"#374151"}}}function p(e){let{sessionId:t,projectId:c,tmuxName:p,startFullscreen:v=!1,variant:b="agent",appearance:g="theme",height:x="max(440px, calc(100dvh - 440px))",isOpenCodeSession:y=!1,reloadCommand:w,chromeless:S=!1,autoFocus:k=!1}=e,E=(0,a.useRouter)(),C=(0,a.usePathname)(),T=(0,a.useSearchParams)(),{resolvedTheme:N}=(0,l.D)(),j=(0,o.useRef)(null),[M,P]=(0,o.useState)(v),[L,I]=(0,o.useState)(function(){try{let e=localStorage.getItem(i);if(e){let t=parseInt(e,10);if(!Number.isNaN(t))return Math.max(9,Math.min(18,t))}}catch(e){}return 13}()),{error:A,followOutput:R,scrollToLatest:O,muxStatus:F,terminalInstance:W,fitAddon:B}=function(e,t,n){let{appearance:a,variant:s,fontSize:c,autoFocus:d,projectId:p,tmuxName:v}=n,{resolvedTheme:b}=(0,l.D)(),g=(0,o.useMemo)(()=>h(s),[s]),{subscribeTerminal:x,writeTerminal:y,resizeTerminal:w,openTerminal:S,closeTerminal:k,status:E}=(0,m.Ug)(),C=(0,o.useRef)(null),T=(0,o.useRef)(null),[N,j]=(0,o.useState)(null),M=(0,o.useRef)(!0),[P,L]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{if(!e.current)return;j(null);let n=!0,o=null,l=null,s=null;return Promise.all([r.e(4560).then(r.bind(r,5627)).then(e=>e.Terminal),r.e(2529).then(r.bind(r,2529)).then(e=>e.FitAddon),r.e(5491).then(r.bind(r,5491)).then(e=>e.WebLinksAddon),document.fonts.ready]).then(r=>{let[i,m,h]=r;if(!n||!e.current)return;let E="dark"===a||"light"!==b,N=E?g.dark:g.light,j=new i({cursorBlink:!0,fontSize:c,fontFamily:u(),lineHeight:1.2,theme:N,minimumContrastRatio:E?1:7,scrollback:1e4,allowProposedApi:!0,fastScrollSensitivity:3,scrollSensitivity:1}),P=new m;j.loadAddon(P),T.current=P;let I=new h;j.loadAddon(I),j.parser.registerCsiHandler({prefix:">",final:"q"},()=>(j.write("\x1bP>|XTerm(370)\x1b\\"),!0)),j.parser.registerOscHandler(52,e=>{let t=e.split(";");if(t.length<2)return!1;let r=t[t.length-1];try{var n;let e=atob(r),t=Uint8Array.from(e,e=>e.charCodeAt(0)),o=new TextDecoder().decode(t);null==(n=navigator.clipboard)||n.writeText(o).catch(()=>{})}catch(e){}return!0}),j.attachCustomKeyEventHandler(e=>{if("keydown"!==e.type)return!0;if((e.metaKey&&!e.ctrlKey&&!e.altKey&&"KeyC"===e.code||e.ctrlKey&&e.shiftKey&&"KeyC"===e.code)&&j.hasSelection()){var t;return null==(t=navigator.clipboard)||t.writeText(j.getSelection()).catch(()=>{}),j.clearSelection(),!1}return!0}),j.open(e.current),C.current=j,d&&j.focus(),P.fit();let A=setTimeout(()=>{if(n&&T.current)try{T.current.fit(),w(t,j.cols,j.rows,p)}catch(e){}},100),R=()=>{if(n&&T.current&&C.current)try{var e,r;C.current.options.fontFamily=u(),null==(e=(r=C.current).clearTextureAtlas)||e.call(r),T.current.fit(),w(t,C.current.cols,C.current.rows,p)}catch(e){}},O="undefined"!=typeof document?document.fonts:void 0,F=!!O&&"function"==typeof O.addEventListener;F&&O.addEventListener("loadingdone",R);let W=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={...f,...r},o=e.element;if(!o)return()=>{};let a=o.style.touchAction;o.style.touchAction="none";let l=o.querySelector(".xterm-viewport");l&&(l.style.touchAction="none");let s=0,i=0,c=0,u=null,d=!1,m=e=>{"touch"===e.pointerType&&(s=e.clientX,i=e.clientY,c=e.clientY,u=null,d=!1)},h=a=>{var l,m,f;if("touch"!==a.pointerType)return;let h=a.clientX-s,p=a.clientY-i,v=Math.abs(h),b=Math.abs(p);if(null===u){if(Math.max(v,b)<n.deadZone)return;if(b<n.verticalDominance*v){u=!1;return}u=!0;try{o.setPointerCapture(a.pointerId)}catch(e){}}if(!0!==u)return;a.preventDefault();let g=Math.round((a.clientY-c)/((null!=(f=e.options.fontSize)?f:13)*1.2));if(g>n.maxLinesPerEvent&&(g=n.maxLinesPerEvent),g<-n.maxLinesPerEvent&&(g=-n.maxLinesPerEvent),0===g)return;c=a.clientY;let x=g*n.speedMultiplier;if(g>0?null==(l=r.onScrollAway)||l.call(r):null==(m=r.onScrollTowardLatest)||m.call(r),"normal"===e.buffer.active.type)e.scrollLines(-x);else{d||(d=!0,t(n.tmuxPrefix+"["));let e=g>0?"\x1b[A":"\x1b[B",r=Math.abs(x);for(let n=0;n<r;n++)t(e)}},p=e=>{if("touch"===e.pointerType){try{o.hasPointerCapture(e.pointerId)&&o.releasePointerCapture(e.pointerId)}catch(e){}u=null}},v={capture:!0},b={capture:!0,passive:!1};return o.addEventListener("pointerdown",m,v),o.addEventListener("pointermove",h,b),o.addEventListener("pointerup",p,v),o.addEventListener("pointercancel",p,v),()=>{o.removeEventListener("pointerdown",m,v),o.removeEventListener("pointermove",h,b),o.removeEventListener("pointerup",p,v),o.removeEventListener("pointercancel",p,v),o.style.touchAction=a}}(j,e=>{y(t,e,p)},{onScrollAway:()=>{M.current=!1,L(!1)}}),B=null;e.current&&(B=new ResizeObserver(()=>{if(n&&T.current)try{T.current.fit(),w(t,j.cols,j.rows,p)}catch(e){}})).observe(e.current);let _=[],z=!1,D=null,J=0,K=()=>{D&&(clearTimeout(D),D=null),_.length>0&&(j.write(_.join("")),_.length=0,J=0)},H=j.onSelectionChange(()=>{j.hasSelection()?(z=!0,D||(D=setTimeout(()=>{z=!1,K()},5e3))):(z=!1,K())}),U=!1;S(t,p,v),s=x(t,e=>{z?(_.push(e),(J+=e.length)>1048576&&(z=!1,K())):(j.write(e),M.current&&(U=!0,j.scrollToBottom()))},p);let Y=j.onScroll(()=>{if(U){U=!1;return}let e=j.buffer.active;e.viewportY+j.rows>=e.length?(M.current=!0,L(!0)):(M.current=!1,L(!1))}),q=()=>{P&&(P.fit(),w(t,j.cols,j.rows,p))};window.addEventListener("resize",q),l=j.onData(e=>{y(t,e,p)}),w(t,j.cols,j.rows,p),o=()=>{clearTimeout(A),null==B||B.disconnect(),W(),H.dispose(),D&&clearTimeout(D),window.removeEventListener("resize",q),F&&O&&O.removeEventListener("loadingdone",R),Y.dispose(),null==l||l.dispose(),l=null,null==s||s(),k(t,p),j.dispose()}}).catch(e=>{console.error("[DirectTerminal] Failed to load xterm.js:",e),j("Failed to load terminal")}),()=>{n=!1,null==o||o()}},[a,t,p,v,s,b,g,x,y,w,S,k]),(0,o.useEffect)(()=>{if("connected"!==E)return;let e=T.current,r=C.current;e&&r&&(e.fit(),w(t,r.cols,r.rows,p))},[E,t,p,w]),(0,o.useEffect)(()=>{let e=C.current;if(!e)return;let t="dark"===a||"light"!==b;e.options.theme=t?g.dark:g.light,e.options.minimumContrastRatio=t?1:7},[a,b,g]),(0,o.useEffect)(()=>{let e=C.current,r=T.current;if(e&&r){e.options.fontSize=c;try{localStorage.setItem(i,String(c))}catch(e){}r.fit(),w(t,e.cols,e.rows,p)}},[c,t,p,w]),{error:N,followOutput:P,scrollToLatest:()=>{let e=C.current;e&&("normal"===e.buffer.active.type?e.scrollToBottom():y(t,"q",p)),M.current=!0,L(!0)},muxStatus:E,terminalInstance:C,fitAddon:T}}(j,t,{appearance:g,variant:b,fontSize:L,autoFocus:k,projectId:c,tmuxName:p}),{resizeTerminal:_,status:z}=(0,m.Ug)(),D=(0,o.useRef)(z);D.current=z,(0,o.useEffect)(()=>{let e=B.current,r=W.current,n=j.current;if(!e||!r||"connected"!==D.current||!n)return;let o=0,a=!1,l=0,s=-1,i=()=>{if(a)return;o++;let u=n.getBoundingClientRect().height,d=s>=0&&1>Math.abs(u-s);if(s=u,!d&&o<60){l=requestAnimationFrame(i);return}r.refresh(0,r.rows-1),e.fit(),r.refresh(0,r.rows-1),_(t,r.cols,r.rows,c)};l=requestAnimationFrame(i);let u=e=>{a||e.target===n.parentElement&&(o=0,s=-1,setTimeout(()=>{a||(l=requestAnimationFrame(i))},50))},d=n.parentElement;null==d||d.addEventListener("transitionend",u);let m=setTimeout(()=>{a||(o=0,s=-1,i())},300),f=setTimeout(()=>{a||(o=0,s=-1,i())},600);return()=>{a=!0,cancelAnimationFrame(l),null==d||d.removeEventListener("transitionend",u),clearTimeout(m),clearTimeout(f)}},[M,t,c,_,j,B,W]),(0,o.useEffect)(()=>{let e=new URLSearchParams(T.toString());M?e.set("fullscreen","true"):e.delete("fullscreen");let t=e.toString()?"".concat(C,"?").concat(e.toString()):C;E.replace(t,{scroll:!1})},[M,C,E,T]);let J="dark"===g||"light"!==N;return(0,n.jsxs)("div",{className:(0,s.cn)("overflow-hidden border border-[var(--color-border-default)] flex flex-col",M?"fixed inset-0 z-50 rounded-none border-0":"relative h-full",J?"bg-[#0a0a0f]":"bg-[#fafafa]",S&&"border-0"),children:[(0,n.jsx)(d,{sessionId:t,chromeless:S,isOpenCodeSession:y,reloadCommand:w,fontSize:L,setFontSize:I,fullscreen:M,toggleFullscreen:()=>P(e=>!e),muxStatus:F,error:A}),(0,n.jsxs)("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[R?null:(0,n.jsx)("button",{type:"button",onClick:O,className:"absolute bottom-3 right-3 z-20 flex h-8 w-8 items-center justify-center rounded-full border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] text-[var(--color-text-primary)] shadow-md active:scale-95","aria-label":"Jump to latest",title:"Jump to latest",children:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})}),(0,n.jsx)("div",{ref:j,className:"w-full flex flex-col flex-1 min-h-0 overflow-hidden"})]})]})}},4901:(e,t,r)=>{"use strict";function n(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}r.d(t,{cn:()=>n})},5184:(e,t,r)=>{"use strict";r.d(t,{Ug:()=>s,eT:()=>i,i2:()=>u});var n=r(3817),o=r(6749),a=r(1806);let l=o.createContext(void 0);function s(){let e=o.useContext(l);if(!e)throw Error("useMux() must be used within <MuxProvider>");return e}function i(){return o.useContext(l)}function c(e,t){return t?"".concat(t,":").concat(e):e}function u(e){let{children:t}=e,r=(0,o.useRef)(null),s=(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),v=(0,o.useRef)(0),b=(0,o.useRef)(null),g=(0,o.useRef)({}),x=(0,o.useRef)(!1),y=(0,o.useCallback)(()=>{if(!r.current){d("connecting");try{let e=function(e){var t,r,n;let o=window.location,l="https:"===o.protocol?"wss:":"ws:",s=null!=(t=e.proxyWsPath)?t:a.env.NEXT_PUBLIC_TERMINAL_WS_PATH;if(s){let e=s.replace(/\/ws\/?$/,"");return"".concat(l,"//").concat(o.host).concat(e,"/mux")}if(""===o.port||"443"===o.port||"80"===o.port)return"".concat(l,"//").concat(o.hostname,"/ao-terminal-mux");let i=null!=(n=null!=(r=e.directTerminalPort)?r:a.env.NEXT_PUBLIC_DIRECT_TERMINAL_PORT)?n:"14801";return"".concat(l,"//").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(x.current)return void t.close();for(let e of(console.log("[MuxProvider] Connected"),d("connected"),v.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=c(t.id,"projectId"in t?t.projectId:void 0);if("data"===t.type){let r=s.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=s.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),x.current)return;let e=Math.min(1e3*Math.pow(2,v.current),3e4);v.current+=1,d("reconnecting"),b.current=setTimeout(()=>{console.log("[MuxProvider] Reconnecting (attempt ".concat(v.current,")...")),y()},e)})}catch(e){console.error("[MuxProvider] Failed to create WebSocket:",e),d("disconnected")}}},[]);(0,o.useEffect)(()=>{x.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||y()})(),()=>{var t;e=!0,x.current=!0,b.current&&clearTimeout(b.current),null==(t=r.current)||t.close()}},[y]);let w=(0,o.useCallback)((e,t,n)=>{var o;let a=c(e,n),l=s.current.get(a);if(l||(l=new Set,s.current.set(a,l)),l.add(t),!i.current.has(a)&&(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=s.current.get(a);e&&(e.delete(t),0===e.size&&s.current.delete(a))}},[]),S=(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))}},[]),k=(0,o.useCallback)((e,t,n)=>{var o;if(i.current.set(c(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))}},[]),E=(0,o.useCallback)((e,t)=>{var n;if(i.current.delete(c(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))}},[]),C=(0,o.useCallback)((e,t,n,o)=>{var a;if((null==(a=r.current)?void 0:a.readyState)===WebSocket.OPEN){let a={ch:"terminal",id:e,type:"resize",cols:t,rows:n,...o&&{projectId:o}};r.current.send(JSON.stringify(a))}},[]),T=(0,o.useMemo)(()=>({subscribeTerminal:w,writeTerminal:S,openTerminal:k,closeTerminal:E,resizeTerminal:C,status:u,sessions:m,lastError:h}),[w,S,k,E,C,u,m,h]);return(0,n.jsx)(l.Provider,{value:T,children:t})}},5611:()=>{}}]);
@@ -1 +0,0 @@
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 +0,0 @@
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()}]);
@@ -1 +0,0 @@
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()}]);
@@ -1 +0,0 @@
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()}]);
@@ -1 +0,0 @@
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()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6450],{2537:(e,s,r)=>{"use strict";r.d(s,{X:()=>o});var a=r(3817),t=r(8713),l=r.n(t);function o(e){let{ariaLabel:s,activeTab:r,dashboardHref:t,prsHref:o,showOrchestrator:n=!0,orchestratorHref:c=null}=e;return(0,a.jsxs)("nav",{className:"mobile-bottom-nav","aria-label":s,children:[(0,a.jsxs)(l(),{href:t,className:"mobile-bottom-nav__item","data-active":"dashboard"===r?"true":"false","aria-current":"dashboard"===r?"page":void 0,children:[(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M3 13h8V3H3zm10 8h8V11h-8zM3 21h8v-6H3zm10-10h8V3h-8z"})}),(0,a.jsx)("span",{children:"Dashboard"})]}),(0,a.jsxs)(l(),{href:o,className:"mobile-bottom-nav__item","data-active":"prs"===r?"true":"false","aria-current":"prs"===r?"page":void 0,children:[(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})}),(0,a.jsx)("span",{children:"PRs"})]}),n?c?(0,a.jsxs)(l(),{href:c,className:"mobile-bottom-nav__item","data-active":"orchestrator"===r?"true":"false","aria-current":"orchestrator"===r?"page":void 0,children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,a.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,a.jsx)("span",{children:"Orchestrator"})]}):(0,a.jsxs)("button",{type:"button",className:"mobile-bottom-nav__item",disabled:!0,children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,a.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,a.jsx)("span",{children:"Orchestrator"})]}):null]})}},4579:(e,s,r)=>{Promise.resolve().then(r.bind(r,6802))},6802:(e,s,r)=>{"use strict";r.d(s,{PullRequestsPage:()=>g});var a=r(3817),t=r(6749),l=r(7594),o=r(9120),n=r(545),c=r(5309),d=r(5184),i=r(9293),p=r(6004),h=r(7848),m=r(1237),x=r(2537);function b(e,s){return s?"".concat(e,"?project=").concat(encodeURIComponent(s)):"".concat(e,"?project=all")}r(5425);var u=r(8450);let j=[];function v(e){return"open"===e?"Open PRs":"merged"===e?"Merged PRs":"closed"===e?"Closed PRs":"All PRs"}function g(e){let{initialSessions:s,projectId:r,projectName:g,projects:N=[],orchestrators:f,attentionZones:_="simple"}=e,M=null!=f?f:j,k=(0,d.eT)(),y=(0,t.useMemo)(()=>{let e={};for(let r of s)e[r.id]=(0,n.ng)(r,_);return e},[s,_]),{sessions:w,attentionLevels:C}=(0,c.D)({initialSessions:s,project:r,muxSessions:(null==k?void 0:k.status)==="connected"?k.sessions:void 0,initialAttentionLevels:y,attentionZones:_}),P=(0,l.useSearchParams)(),[R,O]=(0,t.useState)(!1),[q,S]=(0,t.useState)(!1),H=(0,o.U)(o.D),z=N.length>1,I=z&&void 0===r,B=(0,t.useMemo)(()=>{var e;return r&&null!=(e=M.find(e=>e.projectId===r))?e:null},[M,r]),[W,T]=(0,t.useState)("all"),V=(0,t.useMemo)(()=>w.filter(e=>!!e.pr).map(e=>e.pr).sort((e,s)=>s.number-e.number),[w]),E=(0,t.useMemo)(()=>V.filter(e=>"open"===e.state),[V]),F=(0,t.useMemo)(()=>V.filter(e=>"merged"===e.state),[V]),G=(0,t.useMemo)(()=>V.filter(e=>"closed"===e.state),[V]),A=r?(0,u.bn)(r):b("/",r),D=b("/prs",r),U=B?(0,u.Nc)(B.projectId,B.id):null,L="open"===W?E:"merged"===W?F:"closed"===W?G:V;return(0,t.useEffect)(()=>{S(!1)},[P]),(0,a.jsxs)("div",{className:"dashboard-shell flex h-screen".concat(!H&&R?" dashboard-shell--sidebar-collapsed":""),children:[z?(0,a.jsx)("div",{className:"sidebar-wrapper".concat(q?" sidebar-wrapper--mobile-open":""),children:(0,a.jsx)(i.u,{projects:N,sessions:w,orchestrators:M,activeProjectId:r,activeSessionId:void 0,collapsed:R,onToggleCollapsed:()=>O(e=>!e),onMobileClose:()=>S(!1)})}):null,q&&(0,a.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>S(!1)}),(0,a.jsxs)("div",{className:"dashboard-main flex-1 overflow-y-auto px-4 py-4 md:px-7 md:py-6",children:[(0,a.jsx)(h.u,{attentionLevels:C,projectName:g?"".concat(g," PRs"):"Pull Requests"}),H?(0,a.jsxs)("section",{className:"mobile-pr-page-header",children:[(0,a.jsxs)("div",{className:"mobile-pr-page-header__top",children:[(0,a.jsxs)("div",{className:"mobile-pr-page-header__title-row",children:[z?(0,a.jsx)("button",{type:"button",className:"mobile-menu-toggle",onClick:()=>S(!0),"aria-label":"Open menu",children:(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-5 w-5",children:(0,a.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})})}):null,(0,a.jsx)("h1",{className:"mobile-pr-page-header__title",children:g?"".concat(g," PRs"):"Pull Requests"})]}),(0,a.jsxs)("div",{className:"mobile-pr-page-header__meta",children:[(0,a.jsx)("span",{className:"mobile-pr-page-header__count",children:V.length}),(0,a.jsx)(p.U,{})]})]}),(0,a.jsxs)("p",{className:"mobile-pr-page-header__subtitle",children:["Open pull requests created by agents",I?" across projects":" in this project","."]})]}):(0,a.jsxs)("section",{className:"dashboard-hero mb-5",children:[(0,a.jsx)("div",{className:"dashboard-hero__backdrop"}),(0,a.jsxs)("div",{className:"dashboard-hero__content",children:[z?(0,a.jsx)("button",{type:"button",className:"mobile-menu-toggle",onClick:()=>S(!0),"aria-label":"Open menu",children:(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-5 w-5",children:(0,a.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})})}):null,(0,a.jsxs)("div",{className:"dashboard-hero__primary",children:[(0,a.jsx)("div",{className:"dashboard-hero__heading",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"dashboard-title",children:g?"".concat(g," PRs"):"Pull Requests"}),(0,a.jsxs)("p",{className:"dashboard-subtitle",children:["Open pull requests created by agents",I?" across all projects":" in this project","."]})]})}),(0,a.jsx)("div",{className:"dashboard-stat-cards dashboard-stat-cards--persist-mobile",children:(0,a.jsxs)("div",{className:"dashboard-stat-card",children:[(0,a.jsx)("span",{className:"dashboard-stat-card__value",children:E.length}),(0,a.jsx)("span",{className:"dashboard-stat-card__label",children:"Open PRs"}),(0,a.jsx)("span",{className:"dashboard-stat-card__meta",children:I?"Across all projects":"In this project"})]})})]})]})]}),(0,a.jsxs)("section",{className:"mx-auto max-w-[900px]",children:[(0,a.jsx)("div",{className:H?"mobile-pr-filter-tabs":"mb-4 flex items-center gap-1.5",children:[{value:"all",label:"All",count:V.length},{value:"open",label:"Open",count:E.length},{value:"merged",label:"Merged",count:F.length},{value:"closed",label:"Closed",count:G.length}].map(e=>{let{value:s,label:r,count:t}=e;return(0,a.jsxs)("button",{type:"button",onClick:()=>T(s),className:H?"mobile-pr-filter-tab":["inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-[11px] font-semibold transition-colors",W===s?"border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] text-[var(--color-text-primary)]":"border-transparent bg-transparent text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"].join(" "),"data-active":H?String(W===s):void 0,children:[r,(0,a.jsx)("span",{className:H?"mobile-pr-filter-tab__count":"rounded-full bg-[var(--color-chip-bg)] px-1.5 py-px text-[9.5px] font-mono text-[var(--color-text-muted)]",children:t})]},s)})}),H?(0,a.jsx)("div",{className:"mobile-pr-mobile-layout",children:"all"===W?(0,a.jsxs)(a.Fragment,{children:[E.length>0&&(0,a.jsxs)("section",{className:"mobile-pr-group","aria-label":"Open pull requests",children:[(0,a.jsxs)("div",{className:"mobile-pr-section-header",children:[(0,a.jsx)("span",{children:"Open"}),(0,a.jsx)("span",{children:E.length})]}),(0,a.jsx)("div",{className:"mobile-pr-list",children:E.map(e=>(0,a.jsx)(m.dG,{pr:e},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))})]}),F.length>0&&(0,a.jsxs)("section",{className:"mobile-pr-group","aria-label":"Merged pull requests",children:[(0,a.jsxs)("div",{className:"mobile-pr-section-header",children:[(0,a.jsx)("span",{children:"Merged"}),(0,a.jsx)("span",{children:F.length})]}),(0,a.jsx)("div",{className:"mobile-pr-list",children:F.map(e=>(0,a.jsx)(m.dG,{pr:e,muted:!0},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))})]}),G.length>0&&(0,a.jsxs)("section",{className:"mobile-pr-group","aria-label":"Closed pull requests",children:[(0,a.jsxs)("div",{className:"mobile-pr-section-header",children:[(0,a.jsx)("span",{children:"Closed"}),(0,a.jsx)("span",{children:G.length})]}),(0,a.jsx)("div",{className:"mobile-pr-list",children:G.map(e=>(0,a.jsx)(m.dG,{pr:e,muted:!0},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))})]}),0===V.length&&(0,a.jsx)("div",{className:"mobile-pr-empty",children:"No pull requests yet."})]}):(0,a.jsxs)("section",{className:"mobile-pr-group","aria-label":v(W),children:[(0,a.jsxs)("div",{className:"mobile-pr-section-header",children:[(0,a.jsx)("span",{children:v(W).replace(" PRs","")}),(0,a.jsx)("span",{children:L.length})]}),(0,a.jsx)("div",{className:"mobile-pr-list",children:L.length>0?L.map(e=>(0,a.jsx)(m.dG,{pr:e,muted:"open"!==W},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number))):(0,a.jsx)("div",{className:"mobile-pr-empty",children:"No pull requests in this view."})})]})}):(0,a.jsx)("div",{className:"overflow-hidden rounded-[7px] border border-[var(--color-border-subtle)]",children:(0,a.jsxs)("table",{className:"w-full border-collapse",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-[var(--color-border-subtle)] bg-[var(--color-bg-elevated)]",children:[(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"PR"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"Title"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"Size"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"CI"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"Review"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"Threads"})]})}),(0,a.jsxs)("tbody",{children:[("all"===W||"open"===W)&&E.length>0&&(0,a.jsxs)(a.Fragment,{children:["all"===W&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"border-b border-[var(--color-border-subtle)] bg-[var(--color-bg-base)] px-3 py-1.5 text-[9.5px] font-mono font-semibold uppercase tracking-[0.06em] text-[var(--color-text-muted)]",children:"Open"})}),E.map(e=>(0,a.jsx)(m.j6,{pr:e},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))]}),("all"===W||"merged"===W)&&F.length>0&&(0,a.jsxs)(a.Fragment,{children:["all"===W&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"border-b border-t border-[var(--color-border-subtle)] bg-[var(--color-bg-base)] px-3 py-1.5 text-[9.5px] font-mono font-semibold uppercase tracking-[0.06em] text-[var(--color-text-muted)]",children:"Merged"})}),F.map(e=>(0,a.jsx)(m.j6,{pr:e,muted:!0},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))]}),("all"===W||"closed"===W)&&G.length>0&&(0,a.jsxs)(a.Fragment,{children:["all"===W&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"border-b border-t border-[var(--color-border-subtle)] bg-[var(--color-bg-base)] px-3 py-1.5 text-[9.5px] font-mono font-semibold uppercase tracking-[0.06em] text-[var(--color-text-muted)]",children:"Closed"})}),G.map(e=>(0,a.jsx)(m.j6,{pr:e,muted:!0},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))]}),0===V.length&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"px-4 py-6 text-[12px] text-[var(--color-text-secondary)]",children:"No pull requests yet."})})]})]})})]})]}),H?(0,a.jsx)(x.X,{ariaLabel:"PR navigation",activeTab:"prs",dashboardHref:A,prsHref:D,showOrchestrator:!I,orchestratorHref:U}):null]})}}},e=>{e.O(0,[8713,3780,7008,131,1461,7358],()=>e(e.s=4579)),_N_E=e.O()}]);
@@ -1 +0,0 @@
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()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[824],{5459:(e,s,_)=>{Promise.resolve().then(_.bind(_,5795))}},e=>{e.O(0,[8713,3780,5795,131,1461,7358],()=>e(e.s=5459)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7358],{6676:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,7573,23)),Promise.resolve().then(n.t.bind(n,1847,23)),Promise.resolve().then(n.t.bind(n,9948,23)),Promise.resolve().then(n.t.bind(n,1992,23)),Promise.resolve().then(n.t.bind(n,9904,23)),Promise.resolve().then(n.t.bind(n,7678,23)),Promise.resolve().then(n.t.bind(n,2901,23)),Promise.resolve().then(n.bind(n,7184))},7279:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[131,1461],()=>(s(660),s(6676))),_N_E=e.O()}]);