@aoagents/ao-web 0.3.0 → 0.4.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 (281) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +179 -187
  3. package/.next/app-path-routes-manifest.json +9 -10
  4. package/.next/build-manifest.json +6 -6
  5. package/.next/next-server.js.nft.json +1 -1
  6. package/.next/prerender-manifest.json +34 -34
  7. package/.next/react-loadable-manifest.json +14 -14
  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 +8 -11
  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.js.nft.json +1 -1
  82. package/.next/server/app/apple-icon/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/apple-icon.body +0 -0
  84. package/.next/server/app/dev/terminal-test/page.js +3 -3
  85. package/.next/server/app/dev/terminal-test/page.js.nft.json +1 -1
  86. package/.next/server/app/dev/terminal-test/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/dev/terminal-test.html +1 -1
  88. package/.next/server/app/dev/terminal-test.rsc +9 -12
  89. package/.next/server/app/icon/route.js +1 -1
  90. package/.next/server/app/icon/route.js.nft.json +1 -1
  91. package/.next/server/app/icon/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/icon-192/route.js +1 -1
  93. package/.next/server/app/icon-192/route.js.nft.json +1 -1
  94. package/.next/server/app/icon-192/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/icon-512/route.js +1 -1
  96. package/.next/server/app/icon-512/route.js.nft.json +1 -1
  97. package/.next/server/app/icon-512/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/icon.body +0 -0
  99. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  100. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  101. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/manifest.webmanifest.body +1 -1
  103. package/.next/server/app/orchestrators/page.js +2 -2
  104. package/.next/server/app/orchestrators/page.js.nft.json +1 -1
  105. package/.next/server/app/orchestrators/page_client-reference-manifest.js +1 -1
  106. package/.next/server/app/page.js +2 -2
  107. package/.next/server/app/page.js.nft.json +1 -1
  108. package/.next/server/app/page_client-reference-manifest.js +1 -1
  109. package/.next/server/app/projects/[projectId]/page.js +2 -2
  110. package/.next/server/app/projects/[projectId]/page.js.nft.json +1 -1
  111. package/.next/server/app/projects/[projectId]/page_client-reference-manifest.js +1 -1
  112. package/.next/server/app/projects/[projectId]/sessions/[id]/page.js +2 -2
  113. package/.next/server/app/projects/[projectId]/sessions/[id]/page.js.nft.json +1 -1
  114. package/.next/server/app/projects/[projectId]/sessions/[id]/page_client-reference-manifest.js +1 -1
  115. package/.next/server/app/projects/[projectId]/settings/page.js +2 -2
  116. package/.next/server/app/projects/[projectId]/settings/page.js.nft.json +1 -1
  117. package/.next/server/app/projects/[projectId]/settings/page_client-reference-manifest.js +1 -1
  118. package/.next/server/app/prs/page.js +2 -2
  119. package/.next/server/app/prs/page.js.nft.json +1 -1
  120. package/.next/server/app/prs/page_client-reference-manifest.js +1 -1
  121. package/.next/server/app/sessions/[id]/page.js +2 -2
  122. package/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  123. package/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  124. package/.next/server/app/test-direct/page.js +2 -2
  125. package/.next/server/app/test-direct/page.js.nft.json +1 -1
  126. package/.next/server/app/test-direct/page_client-reference-manifest.js +1 -1
  127. package/.next/server/app/test-direct.html +1 -1
  128. package/.next/server/app/test-direct.rsc +9 -12
  129. package/.next/server/app-paths-manifest.json +9 -10
  130. package/.next/server/chunks/1172.js +1 -1
  131. package/.next/server/chunks/1271.js +1 -1
  132. package/.next/server/chunks/1876.js +9 -0
  133. package/.next/server/chunks/3714.js +1 -1
  134. package/.next/server/chunks/4520.js +1 -1
  135. package/.next/server/chunks/7167.js +1 -0
  136. package/.next/server/chunks/7173.js +9 -0
  137. package/.next/server/chunks/8539.js +3 -0
  138. package/.next/server/chunks/9223.js +440 -0
  139. package/.next/server/chunks/9381.js +658 -0
  140. package/.next/server/middleware-build-manifest.js +1 -1
  141. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  142. package/.next/server/next-font-manifest.js +1 -1
  143. package/.next/server/next-font-manifest.json +1 -1
  144. package/.next/server/pages/404.html +1 -1
  145. package/.next/server/pages/500.html +1 -1
  146. package/.next/server/server-reference-manifest.json +1 -1
  147. package/.next/static/5nmlY5IOwz-Od3p2SB2hh/_buildManifest.js +1 -0
  148. package/.next/static/chunks/1383.faf35b62c555f5a1.js +1 -0
  149. package/.next/static/chunks/3764.ba81c7b8d5b21136.js +1 -0
  150. package/.next/static/chunks/3780-e20898ff49ddc867.js +1 -0
  151. package/.next/static/chunks/4465-0c7772f1499dffa4.js +1 -0
  152. package/.next/static/chunks/5795-b96fd46c8c7344fc.js +1 -0
  153. package/.next/static/chunks/7008-6e85da85f12f9858.js +1 -0
  154. package/.next/static/chunks/app/_not-found/page-3b8a01e726e988c8.js +1 -0
  155. package/.next/static/chunks/app/api/backlog/route-3b8a01e726e988c8.js +1 -0
  156. package/.next/static/chunks/app/api/browse-directory/route-3b8a01e726e988c8.js +1 -0
  157. package/.next/static/chunks/app/api/filesystem/browse/route-3b8a01e726e988c8.js +1 -0
  158. package/.next/static/chunks/app/api/issues/route-3b8a01e726e988c8.js +1 -0
  159. package/.next/static/chunks/app/api/observability/route-3b8a01e726e988c8.js +1 -0
  160. package/.next/static/chunks/app/api/orchestrators/route-3b8a01e726e988c8.js +1 -0
  161. package/.next/static/chunks/app/api/projects/[id]/route-3b8a01e726e988c8.js +1 -0
  162. package/.next/static/chunks/app/api/projects/reload/route-3b8a01e726e988c8.js +1 -0
  163. package/.next/static/chunks/app/api/projects/route-3b8a01e726e988c8.js +1 -0
  164. package/.next/static/chunks/app/api/prs/[id]/merge/route-3b8a01e726e988c8.js +1 -0
  165. package/.next/static/chunks/app/api/runtime/terminal/route-3b8a01e726e988c8.js +1 -0
  166. package/.next/static/chunks/app/api/sessions/[id]/kill/route-3b8a01e726e988c8.js +1 -0
  167. package/.next/static/chunks/app/api/sessions/[id]/message/route-3b8a01e726e988c8.js +1 -0
  168. package/.next/static/chunks/app/api/sessions/[id]/remap/route-3b8a01e726e988c8.js +1 -0
  169. package/.next/static/chunks/app/api/sessions/[id]/restore/route-3b8a01e726e988c8.js +1 -0
  170. package/.next/static/chunks/app/api/sessions/[id]/route-3b8a01e726e988c8.js +1 -0
  171. package/.next/static/chunks/app/api/sessions/[id]/send/route-3b8a01e726e988c8.js +1 -0
  172. package/.next/static/chunks/app/api/sessions/patches/route-3b8a01e726e988c8.js +1 -0
  173. package/.next/static/chunks/app/api/sessions/route-3b8a01e726e988c8.js +1 -0
  174. package/.next/static/chunks/app/api/setup-labels/route-3b8a01e726e988c8.js +1 -0
  175. package/.next/static/chunks/app/api/spawn/route-3b8a01e726e988c8.js +1 -0
  176. package/.next/static/chunks/app/api/verify/route-3b8a01e726e988c8.js +1 -0
  177. package/.next/static/chunks/app/api/webhooks/[...slug]/route-3b8a01e726e988c8.js +1 -0
  178. package/.next/static/chunks/app/apple-icon/route-3b8a01e726e988c8.js +1 -0
  179. package/.next/static/chunks/app/dev/terminal-test/page-095511c7a110fbc9.js +1 -0
  180. package/.next/static/chunks/app/error-3ebcf3275d91d60a.js +1 -0
  181. package/.next/static/chunks/app/global-error-8f082029a4cf6af1.js +1 -0
  182. package/.next/static/chunks/app/icon/route-3b8a01e726e988c8.js +1 -0
  183. package/.next/static/chunks/app/icon-192/route-3b8a01e726e988c8.js +1 -0
  184. package/.next/static/chunks/app/icon-512/route-3b8a01e726e988c8.js +1 -0
  185. package/.next/static/chunks/app/layout-be776dec5531d47b.js +1 -0
  186. package/.next/static/chunks/app/loading-3b8a01e726e988c8.js +1 -0
  187. package/.next/static/chunks/app/manifest.webmanifest/route-3b8a01e726e988c8.js +1 -0
  188. package/.next/static/chunks/app/{not-found-824d5d3c6e296eeb.js → not-found-0eb78483b8277b8d.js} +1 -1
  189. package/.next/static/chunks/app/orchestrators/page-406e530b0d4ad46f.js +1 -0
  190. package/.next/static/chunks/app/page-a92f3646b54545b0.js +1 -0
  191. package/.next/static/chunks/app/projects/[projectId]/loading-3b8a01e726e988c8.js +1 -0
  192. package/.next/static/chunks/app/projects/[projectId]/page-d14fdcff4998d3bf.js +1 -0
  193. package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-96fc04db76c65761.js +1 -0
  194. package/.next/static/chunks/app/projects/[projectId]/settings/page-ce2e904def1bef9c.js +1 -0
  195. package/.next/static/chunks/app/prs/page-95dbbebb4d372535.js +1 -0
  196. package/.next/static/chunks/app/sessions/[id]/error-5468aace23fd8872.js +1 -0
  197. package/.next/static/chunks/app/sessions/[id]/loading-3b8a01e726e988c8.js +1 -0
  198. package/.next/static/chunks/app/sessions/[id]/{not-found-824d5d3c6e296eeb.js → not-found-0eb78483b8277b8d.js} +1 -1
  199. package/.next/static/chunks/app/sessions/[id]/page-8ef744531757185e.js +1 -0
  200. package/.next/static/chunks/app/test-direct/page-ab98dc9b04bacaa5.js +1 -0
  201. package/.next/static/chunks/{main-app-690acf9d5d2050c9.js → main-app-4b27cdf1baf203ad.js} +1 -1
  202. package/.next/static/chunks/{webpack-d4ff5ed5e153ca3e.js → webpack-ab12779265bdb8f9.js} +1 -1
  203. package/.next/static/css/397ea3e60645d3f3.css +1 -0
  204. package/dist-server/mux-websocket.js +135 -123
  205. package/dist-server/tmux-utils.js +99 -9
  206. package/next.config.js +6 -0
  207. package/package.json +18 -16
  208. package/.next/server/app/api/events/route.js +0 -9
  209. package/.next/server/app/api/events/route.js.nft.json +0 -1
  210. package/.next/server/app/api/events/route_client-reference-manifest.js +0 -1
  211. package/.next/server/chunks/252.js +0 -11
  212. package/.next/server/chunks/2810.js +0 -1
  213. package/.next/server/chunks/3602.js +0 -382
  214. package/.next/server/chunks/3667.js +0 -277
  215. package/.next/server/chunks/6172.js +0 -9
  216. package/.next/server/chunks/8367.js +0 -3
  217. package/.next/static/chunks/3697.4d6d86c5f0caf73e.js +0 -1
  218. package/.next/static/chunks/4465-aaba60a6355de914.js +0 -1
  219. package/.next/static/chunks/6078.47ce88bee96cfaee.js +0 -1
  220. package/.next/static/chunks/6607-405ce4d15e595f4a.js +0 -1
  221. package/.next/static/chunks/7008-71ebb186f0549f41.js +0 -1
  222. package/.next/static/chunks/9331-fcdd652218ac6f68.js +0 -1
  223. package/.next/static/chunks/app/_not-found/page-e2dea9178b4af8db.js +0 -1
  224. package/.next/static/chunks/app/api/backlog/route-e2dea9178b4af8db.js +0 -1
  225. package/.next/static/chunks/app/api/browse-directory/route-e2dea9178b4af8db.js +0 -1
  226. package/.next/static/chunks/app/api/events/route-e2dea9178b4af8db.js +0 -1
  227. package/.next/static/chunks/app/api/filesystem/browse/route-e2dea9178b4af8db.js +0 -1
  228. package/.next/static/chunks/app/api/issues/route-e2dea9178b4af8db.js +0 -1
  229. package/.next/static/chunks/app/api/observability/route-e2dea9178b4af8db.js +0 -1
  230. package/.next/static/chunks/app/api/orchestrators/route-e2dea9178b4af8db.js +0 -1
  231. package/.next/static/chunks/app/api/projects/[id]/route-e2dea9178b4af8db.js +0 -1
  232. package/.next/static/chunks/app/api/projects/reload/route-e2dea9178b4af8db.js +0 -1
  233. package/.next/static/chunks/app/api/projects/route-e2dea9178b4af8db.js +0 -1
  234. package/.next/static/chunks/app/api/prs/[id]/merge/route-e2dea9178b4af8db.js +0 -1
  235. package/.next/static/chunks/app/api/runtime/terminal/route-e2dea9178b4af8db.js +0 -1
  236. package/.next/static/chunks/app/api/sessions/[id]/kill/route-e2dea9178b4af8db.js +0 -1
  237. package/.next/static/chunks/app/api/sessions/[id]/message/route-e2dea9178b4af8db.js +0 -1
  238. package/.next/static/chunks/app/api/sessions/[id]/remap/route-e2dea9178b4af8db.js +0 -1
  239. package/.next/static/chunks/app/api/sessions/[id]/restore/route-e2dea9178b4af8db.js +0 -1
  240. package/.next/static/chunks/app/api/sessions/[id]/route-e2dea9178b4af8db.js +0 -1
  241. package/.next/static/chunks/app/api/sessions/[id]/send/route-e2dea9178b4af8db.js +0 -1
  242. package/.next/static/chunks/app/api/sessions/patches/route-e2dea9178b4af8db.js +0 -1
  243. package/.next/static/chunks/app/api/sessions/route-e2dea9178b4af8db.js +0 -1
  244. package/.next/static/chunks/app/api/setup-labels/route-e2dea9178b4af8db.js +0 -1
  245. package/.next/static/chunks/app/api/spawn/route-e2dea9178b4af8db.js +0 -1
  246. package/.next/static/chunks/app/api/verify/route-e2dea9178b4af8db.js +0 -1
  247. package/.next/static/chunks/app/api/webhooks/[...slug]/route-e2dea9178b4af8db.js +0 -1
  248. package/.next/static/chunks/app/apple-icon/route-e2dea9178b4af8db.js +0 -1
  249. package/.next/static/chunks/app/dev/terminal-test/page-5765f0465db56fed.js +0 -1
  250. package/.next/static/chunks/app/error-670f1d8bf2b6859c.js +0 -1
  251. package/.next/static/chunks/app/global-error-ca06d2b1be2d4ae0.js +0 -1
  252. package/.next/static/chunks/app/icon/route-e2dea9178b4af8db.js +0 -1
  253. package/.next/static/chunks/app/icon-192/route-e2dea9178b4af8db.js +0 -1
  254. package/.next/static/chunks/app/icon-512/route-e2dea9178b4af8db.js +0 -1
  255. package/.next/static/chunks/app/layout-ddf79478d9a673bb.js +0 -1
  256. package/.next/static/chunks/app/loading-e2dea9178b4af8db.js +0 -1
  257. package/.next/static/chunks/app/manifest.webmanifest/route-e2dea9178b4af8db.js +0 -1
  258. package/.next/static/chunks/app/orchestrators/page-4c190484788aaaa3.js +0 -1
  259. package/.next/static/chunks/app/page-d3b83ad5f09b6ec7.js +0 -1
  260. package/.next/static/chunks/app/projects/[projectId]/loading-e2dea9178b4af8db.js +0 -1
  261. package/.next/static/chunks/app/projects/[projectId]/page-9f3dfbea006747cf.js +0 -1
  262. package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-a7090a06948f9a6b.js +0 -1
  263. package/.next/static/chunks/app/projects/[projectId]/settings/page-219df6dcbc6d1107.js +0 -1
  264. package/.next/static/chunks/app/prs/page-a285e930235a23af.js +0 -1
  265. package/.next/static/chunks/app/sessions/[id]/error-eb0973907da68a37.js +0 -1
  266. package/.next/static/chunks/app/sessions/[id]/loading-e2dea9178b4af8db.js +0 -1
  267. package/.next/static/chunks/app/sessions/[id]/page-98f398b822092218.js +0 -1
  268. package/.next/static/chunks/app/test-direct/page-f9bff7d7b4dfe728.js +0 -1
  269. package/.next/static/css/46a7e8e962075e54.css +0 -1
  270. package/.next/static/css/577ea7f5ad4f0576.css +0 -1
  271. package/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
  272. package/.next/static/media/558ca1a6aa3cb55e-s.p.woff2 +0 -0
  273. package/.next/static/media/64d784ea54a4acde-s.woff2 +0 -0
  274. package/.next/static/media/6d831b18ae5b01dc-s.woff2 +0 -0
  275. package/.next/static/media/8d697b304b401681-s.woff2 +0 -0
  276. package/.next/static/media/ac0e76ddaeeb7981-s.woff2 +0 -0
  277. package/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
  278. package/.next/static/media/edc640959b0c7826-s.woff2 +0 -0
  279. package/.next/static/media/ff71da380fbe67dd-s.woff2 +0 -0
  280. package/.next/static/q6yh3n8jgvyI9JIbexzuH/_buildManifest.js +0 -1
  281. /package/.next/static/{q6yh3n8jgvyI9JIbexzuH → 5nmlY5IOwz-Od3p2SB2hh}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5795],{1712:(e,r,s)=>{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)},2466:(e,r,s)=>{s.d(r,{I:()=>t});let t=(0,s(6749).createContext)(null)},2537:(e,r,s)=>{s.d(r,{X:()=>l});var t=s(3817),a=s(8713),n=s.n(a);function l(e){let{ariaLabel:r,activeTab:s,dashboardHref:a,prsHref:l,showOrchestrator:o=!0,orchestratorHref:i=null}=e;return(0,t.jsxs)("nav",{className:"mobile-bottom-nav","aria-label":r,children:[(0,t.jsxs)(n(),{href:a,className:"mobile-bottom-nav__item","data-active":"dashboard"===s?"true":"false","aria-current":"dashboard"===s?"page":void 0,children:[(0,t.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3 13h8V3H3zm10 8h8V11h-8zM3 21h8v-6H3zm10-10h8V3h-8z"})}),(0,t.jsx)("span",{children:"Dashboard"})]}),(0,t.jsxs)(n(),{href:l,className:"mobile-bottom-nav__item","data-active":"prs"===s?"true":"false","aria-current":"prs"===s?"page":void 0,children:[(0,t.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})}),(0,t.jsx)("span",{children:"PRs"})]}),o?i?(0,t.jsxs)(n(),{href:i,className:"mobile-bottom-nav__item","data-active":"orchestrator"===s?"true":"false","aria-current":"orchestrator"===s?"page":void 0,children:[(0,t.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.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,t.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,t.jsx)("span",{children:"Orchestrator"})]}):(0,t.jsxs)("button",{type:"button",className:"mobile-bottom-nav__item",disabled:!0,children:[(0,t.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.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,t.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,t.jsx)("span",{children:"Orchestrator"})]}):null]})}},5468:(e,r)=>{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 o}});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 o(){return a?a.snapshot():function(e,...r){return e(...r)}}},5795:(e,r,s)=>{s.r(r),s.d(r,{default:()=>W});var t=s(3817),a=s(6749),n=s(7594),l=s(5425),o=s(9120),i=s(545),c=s(9891),d=s(7387),u=s(2466),h=s(8450),p=s(9293),m=s(2537),b=s(4901);let f={active:{label:"Active",color:"var(--color-status-working)"},ready:{label:"Ready",color:"var(--color-status-ready)"},idle:{label:"Idle",color:"var(--color-status-idle)"},waiting_input:{label:"Waiting for input",color:"var(--color-status-attention)"},blocked:{label:"Blocked",color:"var(--color-status-error)"},exited:{label:"Exited",color:"var(--color-status-error)"}};function v(e){if(e.includes("\x3c!-- DESCRIPTION START --\x3e")||e.includes("### ")){let r=e.match(/###\s+(.+?)(?:\n|$)/),s=r?r[1].replace(/\*\*/g,"").trim():"Comment",t=e.match(/<!-- DESCRIPTION START -->\s*([\s\S]*?)\s*<!-- DESCRIPTION END -->/);return{title:s,description:t?t[1].trim():e.split("\n")[0]||"No description"}}return{title:"Comment",description:e.trim()}}function x(e){let{comments:r,unresolvedThreads:s,sendingUrls:a,sentUrls:n,errorUrls:l,onAskAgentToFix:o}=e;return 0===r.length?null:(0,t.jsxs)("details",{className:"session-detail-comments-strip",children:[(0,t.jsx)("summary",{children:(0,t.jsxs)("div",{className:"session-detail-comments-strip__toggle",children:[(0,t.jsx)("svg",{className:"session-detail-comments-strip__chevron",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M9 5l7 7-7 7"})}),(0,t.jsx)("span",{className:"session-detail-comments-strip__label",children:"Unresolved Comments"}),(0,t.jsx)("span",{className:"session-detail-comments-strip__count",children:s}),(0,t.jsx)("span",{className:"session-detail-comments-strip__hint",children:"click to expand"})]})}),(0,t.jsx)("div",{className:"session-detail-comments-strip__body",children:r.map((e,r)=>{let{title:s,description:i}=v(e.body),c=a.has(e.url),d=n.has(e.url),u=l.has(e.url);return(0,t.jsxs)("details",{className:"session-detail-comment",open:0===r,children:[(0,t.jsx)("summary",{children:(0,t.jsxs)("div",{className:"session-detail-comment__row",children:[(0,t.jsx)("svg",{className:"session-detail-comment__chevron",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M9 5l7 7-7 7"})}),(0,t.jsx)("span",{className:"session-detail-comment__title",children:s}),(0,t.jsxs)("span",{className:"session-detail-comment__author",children:["\xb7 ",e.author]}),(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"session-detail-comment__view",children:"view →"})]})}),(0,t.jsxs)("div",{className:"session-detail-comment__body",children:[(0,t.jsx)("div",{className:"session-detail-comment__file",children:e.path}),(0,t.jsx)("p",{className:"session-detail-comment__text",children:i}),(0,t.jsx)("button",{onClick:()=>o(e),disabled:c,className:(0,b.cn)("session-detail-comment__fix-btn",d&&"session-detail-comment__fix-btn--sent",u&&"session-detail-comment__fix-btn--error"),children:c?"Sending…":d?"Sent ✓":u?"Failed":"Ask Agent to Fix"})]})]},e.url)})})]})}function j(e){return!(0,i.sZ)(e)&&!(0,i.fZ)(e)&&"merged"!==e.state&&!e.mergeability.noConflicts}function g(e){var r;let{pr:s,metadata:n,lifecyclePrReason:o,onAskAgentToFix:c}=e,[d,u]=(0,a.useState)(new Set),[h,p]=(0,a.useState)(new Set),[m,f]=(0,a.useState)(new Set),[v,g]=(0,a.useState)(!1),y=(0,a.useRef)(new Map);(0,a.useEffect)(()=>()=>{y.current.forEach(e=>clearTimeout(e)),y.current.clear()},[]);let w=async e=>{p(r=>{let s=new Set(r);return s.delete(e.url),s}),f(r=>{let s=new Set(r);return s.delete(e.url),s}),u(r=>new Set(r).add(e.url)),await c(e,()=>{u(r=>{let s=new Set(r);return s.delete(e.url),s}),p(r=>new Set(r).add(e.url));let r=y.current.get(e.url);r&&clearTimeout(r);let s=setTimeout(()=>{p(r=>{let s=new Set(r);return s.delete(e.url),s}),y.current.delete(e.url)},3e3);y.current.set(e.url,s)},()=>{u(r=>{let s=new Set(r);return s.delete(e.url),s}),f(r=>new Set(r).add(e.url));let r=y.current.get(e.url);r&&clearTimeout(r);let s=setTimeout(()=>{f(r=>{let s=new Set(r);return s.delete(e.url),s}),y.current.delete(e.url)},3e3);y.current.set(e.url,s)})},N=(0,i.QN)(s),_=function(e,r,s){let t=[],a=!!r.lastCIFailureDispatchHash,n="true"===r.lastMergeConflictDispatched,o=!!r.lastPendingReviewDispatchHash,i=r.status,c=e.ciStatus===l.U1.FAILING||"ci_failing"===s||"ci_failed"===i,d="changes_requested"===e.reviewDecision||"changes_requested"===s||"changes_requested"===i,u=j(e);if(c){let r=e.ciChecks.filter(e=>"failed"===e.status).length;t.push({icon:"✗",variant:"fail",text:r>0?"".concat(r," check").concat(1!==r?"s":""," failing"):"CI failing",notified:a})}else e.ciStatus===l.U1.PENDING&&t.push({icon:"●",variant:"warn",text:"CI pending"});return d?t.push({icon:"✗",variant:"fail",text:"Changes requested",notified:o}):e.mergeability.approved||t.push({icon:"○",variant:"muted",text:"Awaiting reviewer"}),u&&t.push({icon:"✗",variant:"fail",text:"Merge conflicts",notified:n}),e.isDraft&&t.push({icon:"○",variant:"muted",text:"Draft"}),t}(s,n,o),k=null!=(r=s.changedFiles)?r:0,C=j(s)&&"open"===s.state,S=C?function(e){let r=encodeURIComponent(e.owner),s=encodeURIComponent(e.repo),t=encodeURIComponent(e.baseBranch),a=encodeURIComponent(e.branch);return"https://github.com/".concat(r,"/").concat(s,"/compare/").concat(t,"...").concat(a)}(s):"";return(0,t.jsxs)("div",{className:(0,b.cn)("session-detail-pr-card",N&&"session-detail-pr-card--green"),children:[(0,t.jsxs)("div",{className:"session-detail-pr-card__row",children:[(0,t.jsxs)("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"session-detail-pr-card__title-link",children:["PR #",s.number,": ",s.title]}),(0,t.jsxs)("span",{className:"session-detail-pr-card__diff-stats",children:[(0,t.jsxs)("span",{className:"session-detail-diff--add",children:["+",s.additions]})," ",(0,t.jsxs)("span",{className:"session-detail-diff--del",children:["-",s.deletions]})]}),k>0?(0,t.jsxs)("span",{className:"session-detail-pr-card__diff-label",children:[k," file",1!==k?"s":""]}):null,s.isDraft?(0,t.jsx)("span",{className:"session-detail-pr-card__diff-label",children:"Draft"}):null,"merged"===s.state?(0,t.jsx)("span",{className:"session-detail-pr-card__diff-label",children:"Merged"}):null]}),C?(0,t.jsxs)("div",{className:"session-detail-pr-card__merge-actions",role:"group","aria-label":"Resolve merge conflicts",children:[(0,t.jsx)("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"session-detail-pr-merge-action",children:"Compare with base branch"}),(0,t.jsx)("button",{type:"button",onClick:()=>{var e;let r=null==(e=navigator.clipboard)?void 0:e.writeText(s.branch);r&&r.then(()=>{g(!0);let e="__copy-branch",r=y.current.get(e);r&&clearTimeout(r);let s=setTimeout(()=>{g(!1),y.current.delete(e)},2e3);y.current.set(e,s)}).catch(()=>{})},"aria-label":v?"Head branch name copied":"Copy head branch name",className:"session-detail-pr-merge-action session-detail-pr-merge-action--btn",children:v?"Copied branch name":"Copy head branch name"})]}):null,(0,t.jsxs)("div",{className:"session-detail-pr-card__details",children:[N?(0,t.jsxs)("div",{className:"session-detail-merge-banner",children:[(0,t.jsx)("svg",{width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M20 6L9 17l-5-5"})}),"Ready to merge"]}):_.map(e=>(0,t.jsxs)("span",{className:(0,b.cn)("session-detail-blocker-chip","fail"===e.variant&&"session-detail-blocker-chip--fail","warn"===e.variant&&"session-detail-blocker-chip--warn","muted"===e.variant&&"session-detail-blocker-chip--muted"),children:[e.icon," ",e.text,e.notified?(0,t.jsx)("span",{className:"session-detail-blocker-chip__note",children:"\xb7 notified"}):null]},e.text)),s.ciChecks.length>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"session-detail-pr-sep"}),s.ciChecks.map((e,r)=>{var s;let a=null!=(s=e.url)?s:"".concat(e.name,"-").concat(r),n=(0,t.jsxs)("span",{className:(0,b.cn)("session-detail-ci-chip","passed"===e.status&&"session-detail-ci-chip--pass","failed"===e.status&&"session-detail-ci-chip--fail","pending"===e.status&&"session-detail-ci-chip--pending","passed"!==e.status&&"failed"!==e.status&&"pending"!==e.status&&"session-detail-ci-chip--queued"),children:["passed"===e.status?"✓":"failed"===e.status?"✗":"pending"===e.status?"●":"○"," ",e.name]});return e.url?(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"hover:no-underline",onClick:e=>e.stopPropagation(),children:n},a):(0,t.jsx)("span",{children:n},a)})]}):null]}),(0,t.jsx)(x,{comments:s.unresolvedComments,unresolvedThreads:s.unresolvedThreads,sendingUrls:d,sentUrls:h,errorUrls:m,onAskAgentToFix:w})]})}function y(e,r){let s=e.trim();return s.length<=r?s:"".concat(s.slice(0,Math.max(0,r-1)).trimEnd(),"…")}async function w(e,r,s,t){try{let t=function(e){let{title:r,description:s}=v(e.body),t=["Please address this review comment:\n","File: ".concat(y(e.path,500)),"Comment: ".concat(y(r,240)),"Description: ".concat(y(s,7500)),"","Resolve the comment at ".concat(e.url," after fixing it.")].join("\n");return y(t,9500)}(r),a=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t})});if(!a.ok)throw Error("HTTP ".concat(a.status));s()}catch(e){console.error("Failed to send message to agent:",e),t()}}function N(e){let{zones:r}=e,s=[{value:r.merge,label:"merge",toneClass:"topbar-zone-pill--merge"},{value:r.respond,label:"respond",toneClass:"topbar-zone-pill--respond"},{value:r.review,label:"review",toneClass:"topbar-zone-pill--review"},{value:r.working,label:"working",toneClass:"topbar-zone-pill--working"},{value:r.pending,label:"pending",toneClass:"topbar-zone-pill--pending"},{value:r.done,label:"done",toneClass:"topbar-zone-pill--done"}].filter(e=>e.value>0);return 0===s.length?null:(0,t.jsx)(t.Fragment,{children:s.map(e=>(0,t.jsxs)("span",{className:(0,b.cn)("topbar-zone-pill",e.toneClass),children:[(0,t.jsx)("span",{className:"topbar-zone-pill__value",children:e.value}),(0,t.jsx)("span",{className:"topbar-zone-pill__label",children:e.label})]},e.label))})}function _(e){var r,s,n,o;let{session:c,isOrchestrator:d,isMobile:u,terminalEnded:h,isRestorable:p,activity:m,headline:f,projects:v,orchestratorHref:x,orchestratorZones:j,onToggleSidebar:y,onRestore:_,onKill:k}=e,C=c.pr,S=!!C&&(0,i.QN)(C),[I,M]=(0,a.useState)(!1),R=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!I)return;let e=e=>{R.current&&!R.current.contains(e.target)&&M(!1)},r=e=>{"Escape"===e.key&&M(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",r),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",r)}},[I]);let T=null!=(n=null==(r=v.find(e=>e.id===c.projectId))?void 0:r.name)?n:c.projectId,P="agent orchestrator"!==T.trim().toLowerCase();return(0,t.jsxs)("header",{className:"dashboard-app-header",children:[v.length>0?(0,t.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:y,"aria-label":"Toggle sidebar",children:u?(0,t.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,t.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,t.jsx)("path",{d:"M9 3v18"})]})}):null,(0,t.jsx)("div",{className:"dashboard-app-header__brand dashboard-app-header__brand--hide-mobile",children:(0,t.jsx)("span",{children:"Agent Orchestrator"})}),P&&(0,t.jsx)("span",{className:"dashboard-app-header__sep topbar-desktop-only","aria-hidden":"true"}),(0,t.jsxs)("div",{className:"topbar-project-pills-group",children:[(0,t.jsxs)("div",{className:"topbar-project-line",children:[P&&(0,t.jsx)("span",{className:"dashboard-app-header__project",children:T}),(0,t.jsx)("span",{className:"dashboard-app-header__session-id topbar-mobile-only",children:c.id}),d&&(0,t.jsx)("span",{className:"session-detail-mode-badge",children:"orchestrator"})]}),(0,t.jsxs)("div",{className:"topbar-session-pills",children:[(0,t.jsxs)("div",{className:(0,b.cn)("topbar-status-pill","topbar-status-pill--".concat(m.label.toLowerCase().replace(/\s+/g,"-"))),children:[(0,t.jsx)("span",{className:"topbar-status-pill__dot",style:{background:m.color}}),(0,t.jsx)("span",{className:"topbar-status-pill__label",children:m.label})]}),c.branch?C?(0,t.jsx)("a",{href:function(e){let r="https://github.com";try{r=new URL(e.url).origin}catch(e){}return"".concat(r,"/").concat(e.owner,"/").concat(e.repo,"/tree/").concat(e.branch)}(C),target:"_blank",rel:"noopener noreferrer",className:"topbar-branch-pill topbar-branch-pill--link",children:c.branch}):(0,t.jsx)("span",{className:"topbar-branch-pill",children:c.branch}):null,d&&j?(0,t.jsx)(N,{zones:j}):null]})]}),(0,t.jsx)("span",{className:"dashboard-app-header__sep topbar-desktop-only","aria-hidden":"true"}),(0,t.jsx)("span",{className:"dashboard-app-header__session-title topbar-desktop-only",children:f}),(0,t.jsx)("span",{className:"dashboard-app-header__session-id topbar-desktop-only",children:c.id}),(0,t.jsx)("div",{className:"dashboard-app-header__spacer"}),(0,t.jsxs)("div",{className:"dashboard-app-header__actions",children:[C?(0,t.jsxs)("div",{className:"topbar-pr-btn-wrap",ref:R,children:[(0,t.jsxs)("a",{href:C.url,target:"_blank",rel:"noopener noreferrer",className:(0,b.cn)("dashboard-app-btn topbar-pr-btn",I&&"topbar-pr-btn--open"),onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||1===e.button||(e.preventDefault(),M(e=>!e))},"aria-expanded":I,"aria-label":"PR #".concat(C.number),children:[(0,t.jsx)("span",{className:(0,b.cn)("topbar-pr-dot",S?"topbar-pr-dot--green":C.ciStatus===l.U1.FAILING||"changes_requested"===C.reviewDecision?"topbar-pr-dot--red":"topbar-pr-dot--amber")}),"PR #",C.number,(0,t.jsx)("svg",{width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:I?"M18 15l-6-6-6 6":"M6 9l6 6 6-6"})})]}),I&&(0,t.jsx)("div",{className:"topbar-pr-popover",children:(0,t.jsx)(g,{pr:C,metadata:c.metadata,lifecyclePrReason:null!=(o=null==(s=c.lifecycle)?void 0:s.prReason)?o:void 0,onAskAgentToFix:(e,r,s)=>w(c.id,e,r,s)})})]}):null,p?(0,t.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--restore",onClick:_,children:[(0,t.jsxs)("svg",{className:"topbar-action-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M20 11a8 8 0 0 0-14.9-3.98"}),(0,t.jsx)("path",{d:"M4 5v4h4"}),(0,t.jsx)("path",{d:"M4 13a8 8 0 0 0 14.9 3.98"}),(0,t.jsx)("path",{d:"M20 19v-4h-4"})]}),(0,t.jsx)("span",{className:"topbar-btn-label",children:"Restore"})]}):d||h?null:(0,t.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--danger",onClick:k,children:[(0,t.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})}),(0,t.jsx)("span",{className:"topbar-btn-label",children:"Kill"})]}),x?(0,t.jsxs)("a",{href:x,className:"dashboard-app-btn dashboard-app-btn--amber topbar-desktop-only","aria-label":"Orchestrator",children:[(0,t.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,t.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,t.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,t.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,t.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),(0,t.jsx)("span",{className:"topbar-btn-label",children:"Orchestrator"})]}):null]})]})}function k(e){var r,s,a,n,l,o,i,c,u,h;let{session:p,headline:m,pr:b,dashboardHref:f}=e,v=(null==(h=p.lifecycle)?void 0:h.runtime.reasonLabel)?p.lifecycle.runtime.reasonLabel:"killed"===p.status?"Manually stopped":"terminated"===p.status?"Runtime unavailable":"done"===p.status||"merged"===p.status?"Work completed":"Terminal ended",x=function(e,r){var s;let t=e.metadata.pinnedSummary;return t||(e.summary&&!e.summaryIsFallback?e.summary:(null==(s=e.lifecycle)?void 0:s.summary)?e.lifecycle.summary:e.userPrompt?e.userPrompt:e.summary?e.summary:r)}(p,m),j=null!=(c=null!=(i=null!=(o=null==(r=p.lifecycle)?void 0:r.session.terminatedAt)?o:null==(s=p.lifecycle)?void 0:s.session.completedAt)?i:null==(a=p.lifecycle)?void 0:a.session.lastTransitionAt)?c:p.lastActivityAt,g=null!=(u=null==(n=p.lifecycle)?void 0:n.runtime.label)?u:"Unavailable",y=b?"merged"===b.state?"Merged":"closed"===b.state?"Closed":b.mergeability.mergeable?"Open, merge-ready":"Open":"No PR";return(0,t.jsx)("section",{className:"session-ended-summary","aria-label":"Session ended summary",children:(0,t.jsxs)("div",{className:"session-ended-summary__panel",children:[(0,t.jsx)("div",{className:"session-ended-summary__eyebrow",children:"Terminal ended"}),(0,t.jsxs)("div",{className:"session-ended-summary__header",children:[(0,t.jsx)("div",{className:"session-ended-summary__icon","aria-hidden":"true",children:(0,t.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:[(0,t.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"3"}),(0,t.jsx)("path",{d:"M7 10l3 2-3 2"}),(0,t.jsx)("path",{d:"M13 15h4"})]})}),(0,t.jsxs)("div",{className:"session-ended-summary__title-group",children:[(0,t.jsx)("h2",{className:"session-ended-summary__title",children:m}),(0,t.jsxs)("p",{className:"session-ended-summary__subtitle",children:[v,". The live terminal is gone, but the session context is still available."]})]})]}),(0,t.jsxs)("div",{className:"session-ended-summary__body",children:[(0,t.jsxs)("div",{className:"session-ended-summary__section",children:[(0,t.jsx)("div",{className:"session-ended-summary__label",children:"What happened"}),(0,t.jsx)("p",{className:"session-ended-summary__copy",children:x})]}),(0,t.jsxs)("div",{className:"session-ended-summary__facts","aria-label":"Session facts",children:[(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"Session"}),(0,t.jsx)("strong",{children:p.id})]}),(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"Ended"}),(0,t.jsx)("strong",{children:function(e){if(!e)return"Unknown";let r=new Date(e).getTime();return Number.isFinite(r)?(0,d.fw)(r):"Unknown"}(j)})]}),(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"Runtime"}),(0,t.jsx)("strong",{children:g})]}),(0,t.jsxs)("div",{className:"session-ended-summary__fact",children:[(0,t.jsx)("span",{children:"PR"}),(0,t.jsx)("strong",{children:y})]})]}),(0,t.jsxs)("div",{className:"session-ended-summary__links",children:[b?(0,t.jsxs)("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"session-ended-summary__primary",children:["Open PR #",b.number]}):null,(0,t.jsx)("a",{href:f,className:"session-ended-summary__secondary",children:"Back to dashboard"})]}),(null==(l=p.lifecycle)?void 0:l.evidence)?(0,t.jsxs)("div",{className:"session-ended-summary__evidence",children:[(0,t.jsx)("span",{children:"Evidence"}),(0,t.jsx)("code",{children:p.lifecycle.evidence})]}):null]})]})})}let C=(0,c.default)(()=>Promise.all([s.e(8944),s.e(1383)]).then(s.bind(s,3764)).then(e=>({default:e.DirectTerminal})),{loadableGenerated:{webpack:()=>[3764]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"h-full w-full animate-pulse rounded bg-[var(--color-bg-primary)]"})});function S(e){var r,s,l;let{session:c,isOrchestrator:b=!1,orchestratorZones:v,projectOrchestratorId:x=null,projects:j=[],sidebarSessions:g=[],sidebarOrchestrators:y,sidebarLoading:w=!1,sidebarError:N=!1,onRetrySidebar:S}=e,I=(0,n.useRouter)(),M=(0,n.useSearchParams)(),R=(0,o.U)(o.D),T="true"===M.get("fullscreen"),[P,E]=(0,a.useState)(!1),[O,A]=(0,a.useState)(!1),[D,L]=(0,a.useState)(!1),F=c.pr,B=i.CM.has(c.status),U=B&&!i.N_.has(c.status),W=null!=(l=c.activity&&f[c.activity])?l:{label:null!=(s=c.activity)?s:"unknown",color:"var(--color-text-muted)"},z=(0,d.Pn)(c),H=b?"orchestrator":"agent",q="opencode"===c.metadata.agent,V="string"==typeof c.metadata.opencodeSessionId&&c.metadata.opencodeSessionId.length>0?c.metadata.opencodeSessionId:void 0,J=c.projectId?(0,h.bn)(c.projectId):"/",G=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/sessions/".concat(encodeURIComponent(c.id),"/kill"),{method:"POST"});if(!e.ok)throw Error("HTTP ".concat(e.status));if(x)return void I.push((0,h.Nc)(c.projectId,x));I.push(J)}catch(e){console.error("Failed to kill session:",e)}},[J,x,I,c.id,c.projectId]),K=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/sessions/".concat(encodeURIComponent(c.id),"/restore"),{method:"POST"});if(!e.ok){let r=await e.text().catch(()=>"");throw Error(r||"HTTP ".concat(e.status))}window.location.reload()}catch(e){console.error("Failed to restore session:",e)}},[c.id]),Z=(0,a.useMemo)(()=>b?(0,h.Nc)(c.projectId,c.id):x?(0,h.Nc)(c.projectId,x):null,[b,x,c.id,c.projectId]);(0,a.useEffect)(()=>{let e=window.requestAnimationFrame(()=>L(!0));return()=>{window.cancelAnimationFrame(e),L(!1)}},[c.id]);let X=(0,a.useCallback)(()=>{R?A(e=>!e):E(e=>!e)},[R]);return(0,t.jsx)(u.I.Provider,{value:{onToggleSidebar:X,mobileSidebarOpen:O},children:(0,t.jsxs)("div",{className:"dashboard-app-shell",children:[(0,t.jsx)(_,{session:c,isOrchestrator:b,isMobile:R,terminalEnded:B,isRestorable:U,activity:W,headline:z,projects:j,orchestratorHref:Z,orchestratorZones:v,onToggleSidebar:X,onRestore:K,onKill:G}),(0,t.jsxs)("div",{className:"dashboard-shell dashboard-shell--desktop".concat(P?" dashboard-shell--sidebar-collapsed":""),children:[j.length>0?(0,t.jsx)("div",{className:"sidebar-wrapper".concat(O?" sidebar-wrapper--mobile-open":""),children:(0,t.jsx)(p.u,{projects:j,sessions:g,orchestrators:y,loading:w,error:N,onRetry:S,activeProjectId:c.projectId,activeSessionId:c.id,collapsed:P,onToggleCollapsed:()=>E(e=>!e),onMobileClose:()=>A(!1)})}):null,O&&(0,t.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>A(!1)}),(0,t.jsx)("div",{className:"dashboard-main dashboard-main--desktop",children:(0,t.jsx)("main",{className:"session-detail-page flex-1 min-h-0 flex flex-col bg-[var(--color-bg-base)]",children:(0,t.jsx)("div",{className:"flex-1 min-h-0 flex flex-col",children:D?B?(0,t.jsx)(k,{session:c,headline:z,pr:F,dashboardHref:J}):(0,t.jsx)(C,{sessionId:c.id,projectId:c.projectId,tmuxName:null==(r=c.metadata)?void 0:r.tmuxName,startFullscreen:T,variant:H,appearance:"dark",height:"100%",isOpenCodeSession:q,reloadCommand:q&&V?"/exit\nopencode --session ".concat(V,"\n"):void 0,autoFocus:!0}):(0,t.jsx)("div",{className:"session-detail-terminal-placeholder h-full"})})})})]}),(0,t.jsx)(m.X,{ariaLabel:"Session navigation",activeTab:b?"orchestrator":void 0,dashboardHref:J,prsHref:c.projectId?"/?project=".concat(encodeURIComponent(c.projectId),"&tab=prs"):"/",showOrchestrator:!!Z,orchestratorHref:Z})]})})}var I=s(9789);let M={active:"⚡",ready:"\uD83D\uDFE2",idle:"\uD83D\uDCA4",waiting_input:"❓",blocked:"\uD83D\uDEA7",exited:"\uD83D\uDC80"};var R=s(5184),T=s(3394);let P=null,E=null,O=new Set(Object.values(l.SB)),A=new Set(Object.values(l.u3)),D=new Set;function L(e){if(e instanceof DOMException)return"AbortError"===e.name;if(e instanceof Error){let r=e.message.toLowerCase();return r.includes("aborted")||r.includes("aborterror")}return!1}function F(e){let{message:r}=e;return(0,t.jsx)("div",{className:"project-sidebar h-full",children:(0,t.jsxs)("div",{className:"space-y-3 px-3 py-4",children:[(0,t.jsx)("div",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-[var(--color-text-tertiary)]",children:"Projects"}),(0,t.jsx)("div",{className:"space-y-2",children:Array.from({length:3},(e,r)=>(0,t.jsx)("div",{className:"h-10 animate-pulse border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)]"},"sidebar-placeholder-".concat(r)))}),(0,t.jsx)("div",{className:"pt-2 text-[12px] text-[var(--color-text-tertiary)]",children:r})]})})}function B(e){let{projects:r,projectsLoading:s,sidebarSessions:n,sidebarOrchestrators:l,sidebarLoading:i,sidebarError:c,onRetrySidebar:d,activeProjectId:u,activeSessionId:h,children:m}=e,b=(0,o.U)(o.D),[f,v]=(0,a.useState)(!1),[x,j]=(0,a.useState)(!1),g=(0,a.useCallback)(()=>{if(b)return void j(e=>!e);v(e=>!e)},[b]);return(0,t.jsxs)("div",{className:"dashboard-app-shell",children:[(0,t.jsxs)("header",{className:"dashboard-app-header",children:[(0,t.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:g,"aria-label":"Toggle sidebar",children:b?(0,t.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}):(0,t.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,t.jsx)("path",{d:"M9 3v18"})]})}),(0,t.jsx)("div",{className:"dashboard-app-header__brand",children:(0,t.jsx)("span",{children:"Agent Orchestrator"})}),(0,t.jsx)("div",{className:"dashboard-app-header__spacer"})]}),(0,t.jsxs)("div",{className:"dashboard-shell dashboard-shell--desktop".concat(f?" dashboard-shell--sidebar-collapsed":""),children:[(0,t.jsx)("div",{className:"sidebar-wrapper".concat(x?" sidebar-wrapper--mobile-open":""),children:r.length>0?(0,t.jsx)(p.u,{projects:r,sessions:n,orchestrators:l,loading:i,error:c,onRetry:d,activeProjectId:u,activeSessionId:h,collapsed:f,onToggleCollapsed:()=>v(e=>!e),onMobileClose:()=>j(!1)}):(0,t.jsx)(F,{message:s?"Loading projects...":"Projects unavailable."})}),x&&(0,t.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>j(!1)}),(0,t.jsx)("div",{className:"dashboard-main dashboard-main--desktop",children:(0,t.jsx)("main",{className:"session-detail-page flex-1 min-h-0 flex flex-col bg-[var(--color-bg-base)]",children:(0,t.jsx)("div",{className:"flex-1 min-h-0",children:m})})})]})]})}function U(e,r){if(!e||0===r.length)return e;let s=new Map(r.map(e=>[e.id,e])),t=!1,a=e.map(e=>{var r,a;let n=s.get(e.id);if(!n)return e;if(r=n.status,!O.has(r)){let r="status:".concat(n.status);return D.has(r)||(D.add(r),console.warn("Ignoring mux session patch with unknown status",{sessionId:n.id,status:n.status})),e}if(null!==n.activity&&(a=n.activity,!A.has(a))){let r="activity:".concat(n.activity);return D.has(r)||(D.add(r),console.warn("Ignoring mux session patch with unknown activity",{sessionId:n.id,activity:n.activity})),e}return e.status===n.status&&e.activity===n.activity&&e.lastActivityAt===n.lastActivityAt?e:(t=!0,{...e,status:n.status,activity:n.activity,lastActivityAt:n.lastActivityAt})});return t?a:e}function W(){var e,r,s;let o=(0,n.useParams)(),c=(0,n.usePathname)(),u=(0,n.useRouter)(),p=o.id,m="string"==typeof o.projectId?o.projectId:Array.isArray(o.projectId)?o.projectId[0]:null,b=(0,R.eT)(),f=(()=>{if("undefined"==typeof sessionStorage)return null;try{let e=sessionStorage.getItem("ao-session-nav:".concat(p));if(e)return sessionStorage.removeItem("ao-session-nav:".concat(p)),JSON.parse(e)}catch(e){}return null})(),[v,x]=(0,a.useState)(f),[j,g]=(0,a.useState)(null),[y,w]=(0,a.useState)(void 0),[N,_]=(0,a.useState)([]),[k,C]=(0,a.useState)(null===P),[O,A]=(0,a.useState)(()=>E),[D,F]=(0,a.useState)(void 0),[W,z]=(0,a.useState)(null===f),[H,q]=(0,a.useState)(null),[V,J]=(0,a.useState)(!1),[G,K]=(0,a.useState)(!1),[Z,X]=(0,a.useState)(new Map),Q=null!=(e=null==v?void 0:v.projectId)?e:null,Y=[...Z.values()],$=!!v&&(0,l.tT)(v,Z.get(v.projectId),Y),ee=(0,a.useRef)(null),er=(0,a.useRef)(!1),es=(0,a.useRef)(null),et=(0,a.useRef)(new Map),ea=(0,a.useRef)(null!==f),en=(0,a.useRef)(null),el=(0,a.useRef)(!1),eo=(0,a.useRef)(!1),ei=(0,a.useRef)(!1),ec=(0,a.useRef)(null),ed=(0,a.useRef)(null),eu=(0,a.useRef)(null),eh=(0,a.useRef)(!1);(0,a.useEffect)(()=>{et.current=Z},[Z]);let ep=(0,a.useCallback)(async()=>{P&&(_(P),X(new Map(P.map(e=>{var r;return[e.id,null!=(r=e.sessionPrefix)?r:e.id]}))),C(!1));try{var e,r;let s=await (0,T.u)("/api/projects",{timeoutMs:5e3,timeoutMessage:"Projects request timed out after ".concat(5e3,"ms")});if(!(null==s?void 0:s.projects))return;e=P,r=s.projects,e&&e.length===r.length&&e.every((e,s)=>{let t=r[s];return JSON.stringify(e)===JSON.stringify(t)})||(P=s.projects,_(s.projects),X(new Map(s.projects.map(e=>{var r;return[e.id,null!=(r=e.sessionPrefix)?r:e.id]}))))}catch(e){console.error("Failed to fetch projects:",e)}finally{C(!1)}},[]),em=function(e){let r=(0,R.eT)(),s=null==r?void 0:r.sessions.find(r=>r.id===e);return(0,a.useMemo)(()=>{var e;return s?{activity:null!=(e=s.activity)?e:null}:null},[s])}(p);(0,a.useEffect)(()=>{v?document.title=function(e,r,s){var t;let a,n=e.id,o=void 0!==s?s:e.activity,i=o&&null!=(t=M[o])?t:"",c=[...r.values()];return a=(0,l.tT)(e,r.get(e.projectId),c)?"Orchestrator Terminal":function(e,r){let s=Array.from(e);return s.length>40?s.slice(0,40).join("")+"...":e}((0,d.Pn)(e),40),i?"".concat(i," ").concat(n," | ").concat(a):"".concat(n," | ").concat(a)}(v,Z,null==em?void 0:em.activity):document.title="".concat(p," | Session Detail")},[v,p,Z,em]),(0,a.useEffect)(()=>{ee.current=Q},[Q]),(0,a.useEffect)(()=>{if(v&&N.some(e=>e.id===v.projectId)){if(null==c?void 0:c.startsWith("/sessions/"))return void u.replace((0,h.Nc)(v.projectId,v.id));(null==c?void 0:c.startsWith("/projects/"))&&m&&v.projectId!==m&&u.replace((0,h.Nc)(v.projectId,v.id))}},[m,c,N,u,v]),(0,a.useEffect)(()=>{er.current=$},[$]);let eb=(0,a.useCallback)(async()=>{if(el.current)return;el.current=!0;let e=new AbortController;ec.current=e;try{let r=await (0,T.u)("/api/sessions/".concat(encodeURIComponent(p)),{signal:e.signal,timeoutMs:8e3,timeoutMessage:"Session request timed out after ".concat(8e3,"ms")});x(r),q(null),J(!1),ea.current=!0}catch(s){if(eh.current||e.signal.aborted||L(s))return;let r=(s instanceof Error?s.message:"Failed to load session").toLowerCase();if(r.includes("session not found")||r.includes("http 404")){ea.current||J(!0),z(!1);return}console.error("Failed to fetch session:",s),ea.current||q(s instanceof Error?s:Error("Failed to load session"))}finally{z(!1),el.current=!1,ec.current===e&&(ec.current=null)}},[p]),ef=(0,a.useCallback)(async()=>{if(eo.current)return;let e=ee.current;if(!e)return;let r=er.current,s="".concat(e,":").concat(r?"orchestrator":"worker");if(!r&&es.current===s)return;eo.current=!0;let t=new AbortController;ed.current=t;try{var a,n,o,c,d;let u=r?"/api/sessions?project=".concat(encodeURIComponent(e),"&fresh=true"):"/api/sessions?project=".concat(encodeURIComponent(e),"&orchestratorOnly=true&fresh=true"),h=await (0,T.u)(u,{signal:t.signal,timeoutMs:5e3,timeoutMessage:"Project sessions request timed out after ".concat(5e3,"ms")}),p=null!=(o=h.sessions)?o:[],m=null!=(d=null!=(c=h.orchestratorId)?c:null==(n=h.orchestrators)||null==(a=n.find(r=>r.projectId===e))?void 0:a.id)?d:null;if(w(e=>e===m?e:m),!r){es.current=s;return}let b={merge:0,respond:0,review:0,pending:0,working:0,done:0},f=[...et.current.values()];for(let e of p)if(!(0,l.tT)(e,et.current.get(e.projectId),f)){let r=(0,i.ng)(e);if("action"===r)continue;b[r]++}g(b)}catch(e){if(eh.current||t.signal.aborted||L(e))return;console.error("Failed to fetch project sessions:",e)}finally{eo.current=!1,ed.current===t&&(ed.current=null)}},[]),ev=(0,a.useCallback)(async()=>{if(ei.current)return;ei.current=!0;let e=new AbortController;eu.current=e;try{var r,s,t;let a=await (0,T.u)("/api/sessions?fresh=true",{signal:e.signal,timeoutMs:5e3,timeoutMessage:"Sidebar sessions request timed out after ".concat(5e3,"ms")}),n=null!=(r=null==a?void 0:a.sessions)?r:[],l=null!=(t=U(n,null!=(s=en.current)?s:[]))?t:n;E=l,F(null==a?void 0:a.orchestrators),K(!1),A(e=>e&&e.length===l.length&&e.every((e,r)=>{let s=l[r];return JSON.stringify(e)===JSON.stringify(s)})?e:l)}catch(r){if(eh.current||e.signal.aborted||L(r))return;console.error("Failed to fetch sidebar sessions:",r),K(!0),A(e=>null===e?[]:e)}finally{ei.current=!1,eu.current===e&&(eu.current=null)}},[]);return((0,a.useEffect)(()=>{if(!(null==b?void 0:b.sessions))return;if("connected"!==b.status){en.current=null;return}en.current=b.sessions;let e=U(E,b.sessions);if(e!==E&&(E=e,A(e)),0===b.sessions.length||!E)return;let r=new Set(E.map(e=>e.id)),s=new Set(b.sessions.map(e=>e.id));if(r.size!==s.size)return void ev();for(let e of s)if(!r.has(e))return void ev()},[ev,null==b?void 0:b.sessions,null==b?void 0:b.status]),(0,a.useEffect)(()=>{$||g(null)},[$]),(0,a.useEffect)(()=>{Promise.all([ep(),eb(),ev()])},[ep,eb,ev]),(0,a.useEffect)(()=>{Q&&ef()},[ef,$,Q]),(0,a.useEffect)(()=>{let e=setInterval(()=>{eb(),ef(),ev()},2e3);return()=>clearInterval(e)},[eb,ef,ev]),(0,a.useEffect)(()=>{eh.current=!1;let e=()=>{eh.current=!0};return window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("beforeunload",e)}},[]),(0,a.useEffect)(()=>()=>{var e,r,s;null==(e=ec.current)||e.abort(),null==(r=ed.current)||r.abort(),null==(s=eu.current)||s.abort()},[]),W)?(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=m?m:void 0,activeSessionId:p,children:(0,t.jsx)("div",{className:"flex h-full min-h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.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,t.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9"})}),(0,t.jsx)("div",{className:"text-[13px] text-[var(--color-text-tertiary)]",children:"Loading session…"})]})})}):V?(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=m?m:void 0,activeSessionId:p,children:(0,t.jsx)(I.ErrorDisplay,{title:"Session not found",message:"This session is no longer available. It may have been removed, renamed, or already cleaned up.",tone:"not-found",primaryAction:{label:"Back to dashboard",href:m?"/projects/".concat(m):"/"},secondaryAction:{label:"Retry",onClick:()=>void eb()},compact:!0,chrome:"card"})}):H?(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=(s=null!=(r=null==v?void 0:v.projectId)?r:m)?s:void 0,activeSessionId:p,children:(0,t.jsx)(I.ErrorDisplay,{title:"Failed to load session",message:function(e){let r=e.message.toLowerCase();return r.includes("timed out")?"The session request is taking too long, so the page stopped waiting instead of spinning forever. You can retry, or return to the project and reopen a different session.":r.includes("network")?"The session request failed before the dashboard got a response. Check the local server connection and try again.":r.includes("404")?"This session is no longer available. It may have been removed while the page was open.":r.includes("500")?"The server returned an internal error while loading this session. Try again to re-fetch the latest state.":"The dashboard could not load this session cleanly. Try again to re-fetch the latest state."}(H),tone:"error",primaryAction:{label:"Try again",onClick:()=>{q(null),J(!1),z(!0),Promise.all([ep(),eb(),ev()])}},secondaryAction:{label:"Back to dashboard",href:(null==v?void 0:v.projectId)?"/projects/".concat(v.projectId):"/"},error:H,compact:!0,chrome:"card"})}):v?(0,t.jsx)(S,{session:v,isOrchestrator:$,orchestratorZones:null!=j?j:void 0,projectOrchestratorId:y,projects:N,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev}):(0,t.jsx)(B,{projects:N,projectsLoading:k,sidebarSessions:O,sidebarOrchestrators:D,sidebarLoading:null===O,sidebarError:G,onRetrySidebar:ev,activeProjectId:null!=m?m:void 0,activeSessionId:p,children:(0,t.jsx)(I.ErrorDisplay,{title:"Session unavailable",message:"The backend has not returned this session yet. This can happen right after spawning an orchestrator; retry once the terminal registers the session.",tone:"error",primaryAction:{label:"Retry",onClick:()=>void eb()},secondaryAction:{label:"Back to dashboard",href:m?"/projects/".concat(m):"/"},compact:!0,chrome:"card"})})}},5864:(e,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i}});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 o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let r={...o,...e},s=(0,a.lazy)(()=>r.loader().then(l)),i=r.loading;function c(e){let l=i?(0,t.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,o=!r.ssr||!!r.loading,c=o?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,{...o?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},6313:(e,r,s)=>{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)=>{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)=>{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)},8394:(e,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return t}});let t=(0,s(5468).createAsyncLocalStorage)()},9789:(e,r,s)=>{s.d(r,{ErrorDisplay:()=>c});var t=s(3817),a=s(8713),n=s.n(a);let l={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 o(e){let{accent:r}=e;return(0,t.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(r," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(r," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,t.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:r},viewBox:"0 0 24 24",children:[(0,t.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,t.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function i(e){let{action:r,primary:s=!1}=e,a=s?"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",l=s?{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 r.href?(0,t.jsx)(n(),{href:r.href,className:a,style:l,children:r.label}):(0,t.jsx)("button",{type:"button",onClick:r.onClick,className:a,style:l,children:r.label})}function c(e){let{title:r,message:s,tone:a="error",detailsTitle:n="Technical details",error:c,primaryAction:d,secondaryAction:u,compact:h=!1,chrome:p="page",children:m}=e,b=l[a],f=!!((null==c?void 0:c.digest)||(null==c?void 0:c.message)||(null==c?void 0:c.stack));return(0,t.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(h?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===p?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,t.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,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,t.jsx)(o,{accent:b.accent}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.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:b.accent,background:b.bg,borderColor:b.border},children:b.label}),(0,t.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:r}),(0,t.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:s})]})]}),(d||u)&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,t.jsx)(i,{action:d,primary:!0}):null,u?(0,t.jsx)(i,{action:u}):null]}),m,f?(0,t.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,t.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:n}),(0,t.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==c?void 0:c.digest)?(0,t.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",c.digest]}):null,(null==c?void 0:c.message)?(0,t.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:c.message}):null,(null==c?void 0:c.stack)?(0,t.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:c.stack}):null]})]}):null]})})})}},9891:(e,r,s)=>{s.d(r,{default:()=>a.a});var t=s(1712),a=s.n(t)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7008],{1237:(e,r,t)=>{t.d(r,{dG:()=>o,i_:()=>l,j6:()=>c});var n=t(3817),s=t(545),a=t(4906);function l(e,r){let t=e+r;return t>1e3?"XL":t>500?"L":t>200?"M":t>50?"S":"XS"}function c(e){let{pr:r,muted:t=!1}=e,c=l(r.additions,r.deletions),o=(0,s.fZ)(r),i=(0,s.sZ)(r),d=o||i,u=d?"—":"merged"===r.state?"merged":"closed"===r.state?"closed":r.isDraft?"draft":"approved"===r.reviewDecision?"approved":"changes_requested"===r.reviewDecision?"changes requested":"needs review",p=d?"text-[var(--color-text-tertiary)]":r.isDraft?"text-[var(--color-text-muted)]":"approved"===r.reviewDecision?"text-[var(--color-accent-green)]":"changes_requested"===r.reviewDecision?"text-[var(--color-accent-red)]":"text-[var(--color-accent-yellow)]",v=(0,n.jsx)("span",{className:"inline-block h-3 w-12 animate-pulse rounded bg-[var(--color-bg-subtle)]"});return(0,n.jsxs)("tr",{className:"border-b border-[var(--color-border-subtle)] transition-colors hover:bg-[var(--color-bg-subtle)]".concat(t?" opacity-60 hover:opacity-100":""),children:[(0,n.jsx)("td",{className:"px-3 py-2.5 text-sm",children:(0,n.jsxs)("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:["#",r.number]})}),(0,n.jsx)("td",{className:"max-w-[420px] truncate px-3 py-2.5 text-sm font-medium",children:(0,n.jsx)("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:r.title})}),(0,n.jsx)("td",{className:"px-3 py-2.5 text-sm",children:i?v:o?(0,n.jsx)("span",{className:"text-[var(--color-text-tertiary)]",children:"—"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"text-[var(--color-accent-green)]",children:["+",r.additions]})," ",(0,n.jsxs)("span",{className:"text-[var(--color-accent-red)]",children:["-",r.deletions]})," ",(0,n.jsx)("span",{className:"text-[var(--color-text-muted)]",children:c})]})}),(0,n.jsx)("td",{className:"px-3 py-2.5",children:i?v:o?(0,n.jsx)("span",{className:"text-[var(--color-text-tertiary)]",children:"—"}):(0,n.jsx)(a.wX,{status:r.ciStatus,checks:r.ciChecks,compact:!0})}),(0,n.jsx)("td",{className:"px-3 py-2.5 text-xs font-semibold ".concat(p),children:i?v:u}),(0,n.jsx)("td",{className:"px-3 py-2.5 text-center text-sm font-bold ".concat(i?"":r.unresolvedThreads>0?"text-[var(--color-accent-red)]":"text-[var(--color-border-default)]"),children:i?v:r.unresolvedThreads})]})}function o(e){let{pr:r,muted:t=!1}=e,a=(0,s.fZ)(r),l=(0,s.sZ)(r),c=a||l,o=c?"—":"passing"===r.ciStatus?"passing":"failing"===r.ciStatus?"failed":"pending",i=c?"—":"merged"===r.state?"merged":"closed"===r.state?"closed":r.isDraft?"draft":"approved"===r.reviewDecision?"approved":"changes_requested"===r.reviewDecision?"changes":"needs review",d=(0,n.jsx)("span",{className:"inline-block h-3 w-10 animate-pulse rounded bg-[var(--color-bg-subtle)]"}),u=c?null:"+".concat(r.additions," -").concat(r.deletions),p="merged"===r.state?"mobile-pr-card__meta--merged":"closed"===r.state?"mobile-pr-card__meta--closed":"changes_requested"===r.reviewDecision?"mobile-pr-card__meta--changes":"approved"===r.reviewDecision?"mobile-pr-card__meta--approved":"mobile-pr-card__meta--open";return(0,n.jsxs)("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"mobile-pr-card".concat(t?" mobile-pr-card--muted":""),children:[(0,n.jsxs)("div",{className:"mobile-pr-card__line",children:[(0,n.jsxs)("span",{className:"mobile-pr-card__number",children:["#",r.number]}),(0,n.jsx)("span",{className:"mobile-pr-card__title",children:r.title})]}),(0,n.jsxs)("div",{className:"mobile-pr-card__meta ".concat(p),children:[l?d:(0,n.jsxs)("span",{className:"mobile-pr-card__metric-value",children:[(0,n.jsx)("span",{className:"mobile-pr-card__ci-dot",style:{background:c?"var(--color-text-tertiary)":"passing"===r.ciStatus?"var(--color-accent-green)":"failing"===r.ciStatus?"var(--color-accent-red)":"var(--color-status-attention)"}}),(0,n.jsx)("span",{style:{color:c?void 0:"passing"===r.ciStatus?"var(--color-accent-green)":"failing"===r.ciStatus?"var(--color-accent-red)":"var(--color-text-secondary)"},children:o})]}),(0,n.jsx)("span",{className:"mobile-pr-card__review",style:{color:c?void 0:"approved"===r.reviewDecision?"var(--color-accent-green)":"changes_requested"===r.reviewDecision?"var(--color-accent-red)":"var(--color-text-secondary)"},children:l?d:i}),(0,n.jsx)("span",{className:"mobile-pr-card__diff",children:c?d:u})]})]})}},4906:(e,r,t)=>{t.d(r,{wX:()=>a,zm:()=>o});var n=t(3817);let s={passing:{label:"CI passing",className:"bg-[rgba(63,185,80,0.1)] text-[var(--color-accent-green)]",icon:"✓"},failing:{label:"CI failing",className:"bg-[rgba(248,81,73,0.15)] text-[var(--color-accent-red)]",icon:"✗"},pending:{label:"CI pending",className:"bg-[rgba(210,153,34,0.1)] text-[var(--color-accent-yellow)]",icon:"●"},none:{label:"—",className:"text-[var(--color-text-muted)]",icon:""}};function a(e){var r;let{status:t,checks:a,compact:l}=e,c=s[t],o=null!=(r=null==a?void 0:a.filter(e=>"failed"===e.status).length)?r:0;if("none"===t)return(0,n.jsx)("span",{className:"text-xs text-[var(--color-text-muted)]",children:"—"});let i="failing"===t&&o>0?"".concat(o," check").concat(o>1?"s":""," failing"):c.label;return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-semibold tracking-wide ".concat(c.className),children:[!l&&(0,n.jsx)("span",{children:c.icon}),i]})}let l={passed:{icon:"✓",color:"var(--color-accent-green)"},failed:{icon:"✗",color:"var(--color-accent-red)"},running:{icon:"●",color:"var(--color-accent-yellow)"},pending:{icon:"○",color:"var(--color-text-muted)"},skipped:{icon:"○",color:"var(--color-text-muted)"}},c={failed:0,running:1,pending:2,passed:3,skipped:4};function o(e){let{checks:r,layout:t="vertical"}=e,s=[...r].sort((e,r)=>c[e.status]-c[r.status]);return"inline"===t?(0,n.jsx)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:s.map(e=>{let{icon:r,color:t}=l[e.status],s=(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs",children:[(0,n.jsx)("span",{style:{color:t},children:r}),(0,n.jsx)("span",{className:"text-[var(--color-text-secondary)]",children:e.name})]});return e.url?(0,n.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"hover:no-underline",children:s},e.name):(0,n.jsx)("span",{children:s},e.name)})}):"expanded"===t?(0,n.jsx)("div",{className:"space-y-1",children:s.map(e=>{let{icon:r,color:t}=l[e.status],s=(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs",children:[(0,n.jsx)("span",{style:{color:t},children:r}),(0,n.jsx)("span",{className:"text-[var(--color-text-secondary)]",children:e.name})]});return(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[e.url?(0,n.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"hover:no-underline",children:s}):s,e.url&&(0,n.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-[11px] text-[var(--color-accent-blue)] hover:underline",children:"view"})]},e.name)})}):(0,n.jsx)("div",{className:"space-y-1",children:s.map(e=>{let{icon:r,color:t}=l[e.status];return(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,n.jsx)("span",{style:{color:t},className:"w-3.5 shrink-0 text-center",children:r}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-[var(--color-text-secondary)]",children:e.name}),e.url&&(0,n.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 text-[11px] text-[var(--color-accent-blue)] hover:underline",children:"view"})]},e.name)})})}},5309:(e,r,t)=>{t.d(r,{D:()=>u});var n=t(6749),s=t(545),a=t(3394);let l=new Set(["merge","action","respond","review","pending","working","done"]),c=new Set(["active","ready","idle","waiting_input","blocked","exited"]),o=new Set(["spawning","working","detecting","pr_open","ci_failed","review_pending","changes_requested","approved","mergeable","merged","cleanup","needs_input","stuck","errored","killed","idle","done","terminated"]);function i(e,r){switch(r.type){case"setLoadError":return e.loadError===r.error?e:{...e,loadError:r.error};case"reset":return{...e,sessions:r.sessions,...r.liveResolved?{liveSessionsResolved:!0,loadError:null}:{},...void 0!==r.attentionLevels?{attentionLevels:r.attentionLevels}:{}};case"snapshot":{let t=new Map(r.patches.map(e=>[e.id,e])),n=!1,s=e.sessions.map(e=>{let r=t.get(e.id);return r&&(e.status!==r.status||e.activity!==r.activity||e.lastActivityAt!==r.lastActivityAt)?(n=!0,{...e,status:o.has(r.status)?r.status:e.status,activity:null!==r.activity&&c.has(r.activity)?r.activity:null,lastActivityAt:r.lastActivityAt}):e}),a={};for(let e of r.patches){if(!l.has(e.attentionLevel)){console.warn("[useSessionEvents] Unknown attentionLevel from server:",e.attentionLevel);continue}a[e.id]=e.attentionLevel}let i=n,d=Object.keys(a).length!==Object.keys(e.attentionLevels).length||r.patches.some(r=>e.attentionLevels[r.id]!==r.attentionLevel);if(!i&&!d){if(e.liveSessionsResolved)return e;return{...e,liveSessionsResolved:!0}}return{...e,sessions:i?s:e.sessions,attentionLevels:d?a:e.attentionLevels,liveSessionsResolved:!0}}}}function d(e){return e.map(e=>e.id).sort().join("\0")}function u(e){let{initialSessions:r,project:t,muxSessions:l,initialAttentionLevels:c,muxLastError:o,disabled:u=!1,attentionZones:p}=e,[v,m]=(0,n.useReducer)(i,{sessions:r,attentionLevels:null!=c?c:{},liveSessionsResolved:!1,loadError:null}),x=(0,n.useRef)(v.sessions),f=(0,n.useRef)(c);f.current=c;let h=(0,n.useRef)(null),g=(0,n.useRef)(null),b=(0,n.useRef)(0),w=(0,n.useRef)(0),j=(0,n.useRef)(null),y=(0,n.useRef)(!1);(0,n.useEffect)(()=>{x.current=v.sessions},[v.sessions]),(0,n.useEffect)(()=>{var e;m({type:"reset",sessions:r,attentionLevels:null!=(e=f.current)?e:{}})},[r]),(0,n.useEffect)(()=>{y.current=!1;let e=()=>{y.current=!0};return window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("beforeunload",e)}},[]);let N=(0,n.useCallback)(()=>{h.current||Date.now()-w.current<500||null===j.current&&(h.current=setTimeout(()=>{if(h.current=null,null!==j.current)return;let e=g.current,r=new AbortController;j.current=r,w.current=Date.now();let n=t?"/api/sessions?project=".concat(encodeURIComponent(t)):"/api/sessions";(0,a.u)(n,{signal:r.signal,cache:"no-store",timeoutMs:6e3,timeoutMessage:"Dashboard refresh timed out after ".concat(6e3,"ms")}).then(e=>{if(r.signal.aborted||!(null==e?void 0:e.sessions)){r.signal.aborted||(b.current=Date.now());return}b.current=Date.now();let t=Object.fromEntries(e.sessions.map(e=>[e.id,(0,s.ng)(e,p)]));m({type:"reset",sessions:e.sessions,attentionLevels:t,liveResolved:!0})}).catch(e=>{y.current||r.signal.aborted||function(e){if(e instanceof DOMException)return"AbortError"===e.name;if(e instanceof Error){let r=e.message.toLowerCase();return r.includes("aborted")||r.includes("aborterror")}return!1}(e)||(console.warn("[useSessionEvents] refresh failed:",e),b.current=Date.now())}).finally(()=>{if(j.current===r&&(j.current=null),r.signal.aborted){null!==g.current&&N();return}if(null!==g.current&&g.current!==e)return void N();g.current=null})},120))},[t,p]);return(0,n.useEffect)(()=>{u||m({type:"setLoadError",error:null!=o?o:null})},[u,o]),(0,n.useEffect)(()=>{if(u||!l)return;let e=new Set(x.current.map(e=>e.id)),r=l.filter(r=>e.has(r.id)),t=l.some(r=>!e.has(r.id));m({type:"snapshot",patches:r});let n=d(x.current),s=d(r);return t||n!==s?(g.current=s,N()):Date.now()-b.current>=15e3&&N(),()=>{var e;null==(e=j.current)||e.abort(),j.current=null}},[u,l,N]),(0,n.useEffect)(()=>()=>{var e;h.current&&(clearTimeout(h.current),h.current=null),null==(e=j.current)||e.abort(),j.current=null},[]),v}},7848:(e,r,t)=>{t.d(r,{S:()=>a,u:()=>l});var n=t(6749);let s={green:"#22c55e",yellow:"#eab308",red:"#ef4444"};function a(e){let r=0;for(let t of Object.values(e))("respond"===t||"review"===t||"action"===t||"merge"===t)&&r++;return r}function l(e){let{attentionLevels:r,projectName:t="A"}=e,a=t.charAt(0).toUpperCase();return(0,n.useEffect)(()=>{let e=function(e,r){let t='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">\n <rect width="32" height="32" rx="6" fill="'.concat(r,'"/>\n <text x="16" y="23" text-anchor="middle" fill="white" font-family="sans-serif" font-weight="700" font-size="20">').concat(e,"</text>\n </svg>");return"data:image/svg+xml,".concat(encodeURIComponent(t))}(a,s[function(e){let r=Object.values(e);if(0===r.length)return"green";let t=!1;for(let e of r){if("respond"===e)return"red";("review"===e||"action"===e||"merge"===e)&&(t=!0)}return t?"yellow":"green"}(r)]),t=document.querySelector('link[rel="icon"]');t||((t=document.createElement("link")).rel="icon",document.head.appendChild(t)),t.type="image/svg+xml",t.href=e},[r,a]),null}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9170],{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})]})]}),(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}})},7605:(e,r,s)=>{Promise.resolve().then(s.bind(s,4255))},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=7605)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8039],{3464:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>s});var a=o(3817),t=o(7594),l=o(6749),n=o(9789);function s(r){let{error:e,reset:o}=r,s=(0,t.useRouter)();return(0,l.useEffect)(()=>{console.error(e)},[e]),(0,a.jsx)(n.ErrorDisplay,{title:"Something went wrong",message:"The dashboard hit an unexpected error. Try reloading the route data or head back to the main dashboard.",tone:"warning",primaryAction:{label:"Try again",onClick:()=>{o(),s.refresh()}},secondaryAction:{label:"Back to dashboard",href:"/"},error:e,compact:!0,chrome:"card"})}},5512:(r,e,o)=>{Promise.resolve().then(o.bind(o,3464))},7594:(r,e,o)=>{"use strict";var a=o(9582);o.o(a,"useParams")&&o.d(e,{useParams:function(){return a.useParams}}),o.o(a,"usePathname")&&o.d(e,{usePathname:function(){return a.usePathname}}),o.o(a,"useRouter")&&o.d(e,{useRouter:function(){return a.useRouter}}),o.o(a,"useSearchParams")&&o.d(e,{useSearchParams:function(){return a.useSearchParams}})},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var a=o(3817),t=o(8713),l=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,a.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,a.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,a.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,a.jsx)(l(),{href:e.href,className:t,style:n,children:e.label}):(0,a.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:l="Technical details",error:i,primaryAction:d,secondaryAction:u,compact:x=!1,chrome:m="page",children:b}=r,v=n[t],h=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,a.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(x?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,a.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,a.jsx)(s,{accent:v.accent}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,a.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,a.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||u)&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,a.jsx)(c,{action:d,primary:!0}):null,u?(0,a.jsx)(c,{action:u}):null]}),b,h?(0,a.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,a.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:l}),(0,a.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,a.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,a.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,a.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=5512)),_N_E=r.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4219],{7494:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>n});var l=o(3817),t=o(6749),a=o(9789);function n(r){let{error:e,reset:o}=r;return(0,t.useEffect)(()=>{console.error(e)},[e]),(0,l.jsx)("html",{lang:"en",className:"dark",children:(0,l.jsx)("body",{className:"bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased",children:(0,l.jsx)(a.ErrorDisplay,{title:"Something broke at the app shell",message:"The dashboard could not recover from this error at the layout level. Try again first, then reload the page if it still fails.",tone:"error",primaryAction:{label:"Try again",onClick:o},secondaryAction:{label:"Reload page",onClick:()=>window.location.reload()},error:e})})})}},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var l=o(3817),t=o(8713),a=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,l.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,l.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,l.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,l.jsx)(a(),{href:e.href,className:t,style:n,children:e.label}):(0,l.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:a="Technical details",error:i,primaryAction:d,secondaryAction:x,compact:b=!1,chrome:m="page",children:u}=r,v=n[t],p=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,l.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(b?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,l.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,l.jsx)(s,{accent:v.accent}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,l.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,l.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||x)&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,l.jsx)(c,{action:d,primary:!0}):null,x?(0,l.jsx)(c,{action:x}):null]}),u,p?(0,l.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,l.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:a}),(0,l.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,l.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,l.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,l.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}},9894:(r,e,o)=>{Promise.resolve().then(o.bind(o,7494))}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=9894)),_N_E=r.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{1012:(e,t,r)=>{"use strict";r.d(t,{Providers:()=>s});var n=r(3817),o=r(2286),c=r(5184);function s(e){let{children:t}=e;return(0,n.jsx)(o.N,{attribute:"class",defaultTheme:"dark",enableSystem:!1,children:(0,n.jsx)(c.i2,{children:t})})}},2286:(e,t,r)=>{"use strict";r.d(t,{D:()=>u,N:()=>d});var n=r(6749),o=(e,t,r,n,o,c,s,a)=>{let i=document.documentElement,l=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&c?o.map(e=>c[e]||e):o;r?(i.classList.remove(...n),i.classList.add(c&&c[t]?c[t]:t)):i.setAttribute(e,t)}),r=t,a&&l.includes(r)&&(i.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=s&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},c=["light","dark"],s="(prefers-color-scheme: dark)",a="undefined"==typeof window,i=n.createContext(void 0),l={setTheme:e=>{},themes:[]},u=()=>{var e;return null!=(e=n.useContext(i))?e:l},d=e=>n.useContext(i)?n.createElement(n.Fragment,null,e.children):n.createElement(f,{...e}),m=["light","dark"],f=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:o=!0,enableColorScheme:a=!0,storageKey:l="theme",themes:u=m,defaultTheme:d=o?"system":"light",attribute:f="data-theme",value:g,children:b,nonce:S,scriptProps:w}=e,[k,E]=n.useState(()=>p(l,d)),[x,P]=n.useState(()=>"system"===k?v():k),T=g?Object.values(g):u,C=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&o&&(t=v());let n=g?g[t]:t,s=r?y(S):null,i=document.documentElement,l=e=>{"class"===e?(i.classList.remove(...T),n&&i.classList.add(n)):e.startsWith("data-")&&(n?i.setAttribute(e,n):i.removeAttribute(e))};if(Array.isArray(f)?f.forEach(l):l(f),a){let e=c.includes(d)?d:null,r=c.includes(t)?t:e;i.style.colorScheme=r}null==s||s()},[S]),N=n.useCallback(e=>{let t="function"==typeof e?e(k):e;E(t);try{localStorage.setItem(l,t)}catch(e){}},[k]),M=n.useCallback(e=>{P(v(e)),"system"===k&&o&&!t&&C("system")},[k,t]);n.useEffect(()=>{let e=window.matchMedia(s);return e.addListener(M),M(e),()=>e.removeListener(M)},[M]),n.useEffect(()=>{let e=e=>{e.key===l&&(e.newValue?E(e.newValue):N(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[N]),n.useEffect(()=>{C(null!=t?t:k)},[t,k]);let I=n.useMemo(()=>({theme:k,setTheme:N,forcedTheme:t,resolvedTheme:"system"===k?x:k,themes:o?[...u,"system"]:u,systemTheme:o?x:void 0}),[k,N,t,x,o,u]);return n.createElement(i.Provider,{value:I},n.createElement(h,{forcedTheme:t,storageKey:l,attribute:f,enableSystem:o,enableColorScheme:a,defaultTheme:d,value:g,themes:u,nonce:S,scriptProps:w}),b)},h=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:c,enableSystem:s,enableColorScheme:a,defaultTheme:i,value:l,themes:u,nonce:d,scriptProps:m}=e,f=JSON.stringify([c,r,i,t,u,l,s,a]).slice(1,-1);return n.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?d:"",dangerouslySetInnerHTML:{__html:"(".concat(o.toString(),")(").concat(f,")")}})}),p=(e,t)=>{let r;if(!a){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},y=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},v=e=>(e||(e=window.matchMedia(s)),e.matches?"dark":"light")},2490:()=>{},4493:(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=4493)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -1 +1 @@
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
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4345,7927],{3077:(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=3077)),_N_E=r.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9428],{4901:(e,r,t)=>{"use strict";function s(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.filter(Boolean).join(" ")}t.d(r,{cn:()=>s})},7594:(e,r,t)=>{"use strict";var s=t(9582);t.o(s,"useParams")&&t.d(r,{useParams:function(){return s.useParams}}),t.o(s,"usePathname")&&t.d(r,{usePathname:function(){return s.usePathname}}),t.o(s,"useRouter")&&t.d(r,{useRouter:function(){return s.useRouter}}),t.o(s,"useSearchParams")&&t.d(r,{useSearchParams:function(){return s.useSearchParams}})},8450:(e,r,t)=>{"use strict";function s(e){return"/projects/".concat(encodeURIComponent(e))}function a(e,r){return"".concat(s(e),"/sessions/").concat(encodeURIComponent(r))}function c(e,r,t){return"".concat(a(e,r)).concat(t)}t.d(r,{$l:()=>c,Nc:()=>a,bn:()=>s})},9574:(e,r,t)=>{"use strict";t.d(r,{OrchestratorSelector:()=>u});var s=t(3817),a=t(6749),c=t(7594),n=t(8713),o=t.n(n),i=t(4901),l=t(8450);function d(e){if(!e)return"Unknown";let r=new Date(e).getTime();if(!Number.isFinite(r))return"Unknown";let t=new Date().getTime()-r;if(t<0)return"Just now";let s=Math.floor(t/6e4),a=Math.floor(s/60),c=Math.floor(a/24);return s<1?"Just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):"".concat(c,"d ago")}function u(e){let{orchestrators:r,projectId:t,projectName:n,error:u}=e,x=(0,c.useRouter)(),[m,h]=(0,a.useState)(!1),[p,v]=(0,a.useState)(null),f=(0,a.useRef)(!1),b=async()=>{if(!f.current){f.current=!0,h(!0),v(null);try{let e=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:t})});if(!e.ok){let r=await e.json();throw Error(r.error||"Failed to spawn orchestrator")}let r=await e.json();x.push((0,l.Nc)(t,r.orchestrator.id))}catch(e){v(e instanceof Error?e.message:"Failed to spawn orchestrator")}finally{h(!1),f.current=!1}}};return u?(0,s.jsx)("div",{className:"flex h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-[var(--color-text-primary)]",children:"Error"}),(0,s.jsx)("p",{className:"mt-2 text-[var(--color-text-secondary)]",children:u}),(0,s.jsx)(o(),{href:"/",className:"orchestrator-btn mt-4 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium",children:"Go to Dashboard"})]})}):(0,s.jsxs)("div",{className:"flex min-h-screen flex-col bg-[var(--color-bg-base)]",children:[(0,s.jsx)("header",{className:"nav-glass sticky top-0 z-10 border-b border-[var(--color-border-subtle)] px-6 py-4",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-3xl items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-semibold text-[var(--color-text-primary)]",children:n}),(0,s.jsx)("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Project orchestrator"})]}),(0,s.jsx)(o(),{href:(0,l.bn)(t),className:"text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]",children:"Dashboard"})]})}),(0,s.jsx)("main",{className:"flex-1 px-6 py-8",children:(0,s.jsxs)("div",{className:"mx-auto max-w-3xl",children:[(0,s.jsx)("div",{className:"mb-6 rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)] p-4",children:(0,s.jsx)("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"AO keeps one main orchestrator per project. Opening or spawning here reuses that canonical session instead of creating another duplicate."})}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-secondary)]",children:"Main Session"}),(0,s.jsx)("div",{className:"space-y-2",children:r.map(e=>(0,s.jsxs)(o(),{href:(0,l.Nc)(e.projectId,e.id),className:(0,i.cn)("flex items-center justify-between rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)] p-4","transition-all hover:border-[var(--color-border-default)] hover:shadow-sm"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:function(e){switch(e){case"working":return"var(--color-status-working)";case"spawning":return"var(--color-status-attention)";case"pr_open":case"review_pending":case"approved":case"mergeable":return"var(--color-status-ready)";case"ci_failed":case"changes_requested":return"var(--color-status-error)";case"merged":case"done":case"killed":case"terminated":return"var(--color-text-tertiary)";default:return"var(--color-text-secondary)"}}(e.status)}}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-[var(--color-text-primary)]",children:e.id}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-secondary)]",children:[(0,s.jsx)("span",{className:"capitalize",children:e.status.replace(/_/g," ")}),e.activity&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[var(--color-text-tertiary)]",children:"\xb7"}),(0,s.jsx)("span",{children:function(e){if(!e)return"";switch(e){case"active":return"Active";case"ready":return"Ready";case"idle":return"Idle";case"waiting_input":return"Waiting";case"blocked":return"Blocked";case"exited":return"Exited";default:return e}}(e.activity)})]})]})]})]}),(0,s.jsxs)("div",{className:"text-right text-xs text-[var(--color-text-tertiary)]",children:[(0,s.jsxs)("div",{children:["Created ",d(e.createdAt)]}),e.lastActivityAt&&(0,s.jsxs)("div",{children:["Active ",d(e.lastActivityAt)]})]})]},e.id))})]}),(0,s.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-6",children:[(0,s.jsx)("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-secondary)]",children:"Open Orchestrator"}),(0,s.jsx)("button",{type:"button",onClick:b,disabled:m,className:(0,i.cn)("orchestrator-btn w-full px-4 py-3 text-sm font-medium","disabled:cursor-wait disabled:opacity-70"),children:m?(0,s.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,s.jsxs)("svg",{className:"h-4 w-4 animate-spin",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Opening orchestrator..."]}):"Open Orchestrator"}),p&&(0,s.jsx)("p",{className:"mt-2 text-sm text-[var(--color-status-error)]",children:p})]})]})})]})}},9981:(e,r,t)=>{Promise.resolve().then(t.bind(t,9574))}},e=>{e.O(0,[8713,131,1461,7358],()=>e(e.s=9981)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{8321:(e,s,_)=>{Promise.resolve().then(_.bind(_,4465))}},e=>{e.O(0,[8713,3780,7008,4465,131,1461,7358],()=>e(e.s=8321)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1332],{3956:(e,r,t)=>{Promise.resolve().then(t.t.bind(t,8713,23)),Promise.resolve().then(t.bind(t,4465)),Promise.resolve().then(t.bind(t,5275))},5275:(e,r,t)=>{"use strict";t.d(r,{RepairDegradedProjectButton:()=>l});var o=t(3817),n=t(6749),a=t(7594);function l(e){let{projectId:r}=e,t=(0,a.useRouter)(),[l,c]=(0,n.useState)(!1),[i,s]=(0,n.useState)(null),d=async()=>{c(!0),s(null);try{let o=await fetch("/api/projects/".concat(encodeURIComponent(r)),{method:"POST"}),n=await o.json().catch(()=>null);if(!o.ok){var e;s(null!=(e=null==n?void 0:n.error)?e:"Failed to repair project config.");return}t.refresh()}catch(e){s("Network error while repairing project config.")}finally{c(!1)}};return(0,o.jsxs)("div",{className:"mt-6",children:[(0,o.jsx)("button",{type:"button",onClick:()=>void d(),disabled:l,className:"rounded-lg border border-[var(--color-accent)] bg-[var(--color-tint-blue)] px-4 py-2 text-sm font-semibold text-[var(--color-accent)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-accent)_14%,transparent)] disabled:cursor-not-allowed disabled:opacity-60",children:l?"Repairing...":"Repair config"}),i?(0,o.jsx)("p",{className:"mt-3 text-sm text-[var(--color-status-error)]",children:i}):null]})}}},e=>{e.O(0,[8713,3780,7008,4465,131,1461,7358],()=>e(e.s=3956)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3610],{2956:(e,s,_)=>{Promise.resolve().then(_.bind(_,5795))}},e=>{e.O(0,[8713,3780,5795,131,1461,7358],()=>e(e.s=2956)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3916],{2446:(e,t,s)=>{"use strict";s.d(t,{d:()=>c,t:()=>l});var r=s(3817),n=s(6749),a=s(4901);function i(e,t){return"SHOW"===t.type?{message:t.message,variant:t.variant,key:t.key}:null}let o=(0,n.createContext)(null);function l(e){let{children:t}=e,[s,l]=(0,n.useReducer)(i,null),c=(0,n.useRef)(null),u=(0,n.useRef)(0);(0,n.useEffect)(()=>()=>{null!==c.current&&clearTimeout(c.current)},[]);let d=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";null!==c.current&&clearTimeout(c.current),u.current+=1,l({type:"SHOW",message:e,variant:t,key:u.current}),c.current=setTimeout(()=>{l({type:"HIDE"}),c.current=null},3e3)},[]);return(0,r.jsxs)(o.Provider,{value:{showToast:d},children:[t,(0,r.jsx)("div",{className:"toast-container",role:"status","aria-live":"polite","aria-atomic":"true",children:s&&(0,r.jsxs)("div",{className:(0,a.cn)("toast","success"===s.variant&&"toast--success","error"===s.variant&&"toast--error","info"===s.variant&&"toast--info"),children:[(0,r.jsx)("span",{className:"toast__icon","aria-hidden":"true"}),(0,r.jsx)("span",{className:"toast__message",children:s.message})]},s.key)})]})}function c(){let e=(0,n.useContext)(o);if(!e)throw Error("useToast must be used within a ToastProvider");return e}},2749:(e,t,s)=>{"use strict";s.d(t,{ProjectSettingsForm:()=>d});var r=s(3817),n=s(6749),a=s(7594),i=s(2446);let o="These describe which repo this is. Change them via `ao project relink`.";function l(e){let{projectId:t,initialValues:s}=e,o=(0,a.useRouter)(),{showToast:l}=(0,i.d)(),[d,m]=(0,n.useState)(s.agent),[h,p]=(0,n.useState)(s.runtime),[j,g]=(0,n.useState)(s.trackerPlugin),[f,_]=(0,n.useState)(s.scmPlugin),[v,x]=(0,n.useState)(s.reactions),[b,y]=(0,n.useState)(!1),[N,k]=(0,n.useState)(null),[P,S]=(0,n.useState)(null),C=(0,n.useMemo)(()=>({agent:d.trim()||null,runtime:h.trim()||null,tracker:j.trim()?{plugin:j.trim()}:null,scm:f.trim()?{plugin:f.trim()}:null,reactions:v}),[d,h,j,f,v]),w=async()=>{let e;k(null),S(null);try{let t=v.trim();e=t?JSON.parse(t):void 0}catch(e){k("Reactions must be valid JSON.");return}y(!0);try{let r=await fetch("/api/projects/".concat(encodeURIComponent(t)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({agent:C.agent,runtime:C.runtime,tracker:C.tracker,scm:C.scm,reactions:null!=e?e:null})}),n=await r.json().catch(()=>null);if(!r.ok){var s;let e=null!=(s=null==n?void 0:n.error)?s:"Failed to save project settings.";400===r.status?k(e):S(e);return}l("Project settings updated.","success"),o.refresh()}catch(e){S("Network error while saving project settings.")}finally{y(!1)}};return(0,r.jsxs)("div",{className:"project-settings-form",children:[(0,r.jsxs)("section",{className:"project-settings-form__section",children:[(0,r.jsxs)("div",{className:"project-settings-form__section-header",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"project-settings-form__eyebrow",children:"Behavior"}),(0,r.jsx)("h2",{className:"project-settings-form__section-title",children:"Runtime configuration"}),(0,r.jsx)("p",{className:"project-settings-form__section-copy",children:"These values change how AO runs this project without changing which repository the project points at."})]}),(0,r.jsx)("button",{type:"button",onClick:()=>void w(),disabled:b,className:"project-settings-form__save",children:b?"Saving...":"Save changes"})]}),(0,r.jsxs)("div",{className:"project-settings-form__grid",children:[(0,r.jsx)(c,{id:"agent",label:"Agent",value:d,onChange:m,placeholder:"claude-code"}),(0,r.jsx)(c,{id:"runtime",label:"Runtime",value:h,onChange:p,placeholder:"tmux"}),(0,r.jsx)(c,{id:"tracker-plugin",label:"Tracker plugin",value:j,onChange:g,placeholder:"github"}),(0,r.jsx)(c,{id:"scm-plugin",label:"SCM plugin",value:f,onChange:_,placeholder:"github"})]}),(0,r.jsxs)("div",{className:"project-settings-form__reactions",children:[(0,r.jsx)("label",{htmlFor:"reactions",className:"project-settings-form__label",children:"Reactions"}),(0,r.jsx)("p",{className:"project-settings-form__hint",children:"JSON object keyed by reaction name. This PATCH only sends behavior fields."}),(0,r.jsx)("textarea",{id:"reactions",value:v,onChange:e=>x(e.target.value),spellCheck:!1,rows:12,className:"project-settings-form__textarea project-settings-form__textarea--mono"})]}),N?(0,r.jsx)("div",{role:"alert",className:"project-settings-form__alert project-settings-form__alert--error",children:N}):null,P?(0,r.jsxs)("div",{className:"project-settings-form__alert project-settings-form__alert--surface",children:[(0,r.jsx)("p",{className:"project-settings-form__alert-copy",children:P}),(0,r.jsx)("button",{type:"button",onClick:()=>void w(),className:"project-settings-form__retry",children:"Retry"})]}):null]}),(0,r.jsxs)("section",{className:"project-settings-form__section",children:[(0,r.jsx)("p",{className:"project-settings-form__eyebrow",children:"Identity"}),(0,r.jsx)("h2",{className:"project-settings-form__section-title",children:"Repository identity"}),(0,r.jsx)("p",{className:"project-settings-form__section-copy",children:"These fields are read-only because they define which repository AO considers this project to be."}),(0,r.jsxs)("div",{className:"project-settings-form__grid",children:[(0,r.jsx)(u,{id:"identity-project-id",label:"Project ID",value:s.identity.projectId}),(0,r.jsx)(u,{id:"identity-path",label:"Path",value:s.identity.path}),(0,r.jsx)(u,{id:"identity-repo",label:"Repo",value:s.identity.repo}),(0,r.jsx)(u,{id:"identity-default-branch",label:"Default branch",value:s.identity.defaultBranch})]})]})]})}function c(e){let{id:t,label:s,value:n,onChange:a,placeholder:i}=e;return(0,r.jsxs)("label",{htmlFor:t,className:"project-settings-form__field",children:[(0,r.jsx)("span",{className:"project-settings-form__label",children:s}),(0,r.jsx)("input",{id:t,value:n,onChange:e=>a(e.target.value),placeholder:i,className:"project-settings-form__input"})]})}function u(e){let{id:t,label:s,value:n}=e;return(0,r.jsxs)("label",{htmlFor:t,className:"project-settings-form__field",children:[(0,r.jsx)("span",{className:"project-settings-form__label",children:s}),(0,r.jsx)("input",{id:t,value:n,disabled:!0,readOnly:!0,title:o,"aria-describedby":"".concat(t,"-tooltip"),className:"project-settings-form__input project-settings-form__input--readonly"}),(0,r.jsx)("span",{id:"".concat(t,"-tooltip"),className:"project-settings-form__hint",children:o})]})}function d(e){return(0,r.jsx)(i.t,{children:(0,r.jsx)(l,{...e})})}},3378:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,8713,23)),Promise.resolve().then(s.bind(s,2749)),Promise.resolve().then(s.bind(s,5275))},4901:(e,t,s)=>{"use strict";function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter(Boolean).join(" ")}s.d(t,{cn:()=>r})},5275:(e,t,s)=>{"use strict";s.d(t,{RepairDegradedProjectButton:()=>i});var r=s(3817),n=s(6749),a=s(7594);function i(e){let{projectId:t}=e,s=(0,a.useRouter)(),[i,o]=(0,n.useState)(!1),[l,c]=(0,n.useState)(null),u=async()=>{o(!0),c(null);try{let r=await fetch("/api/projects/".concat(encodeURIComponent(t)),{method:"POST"}),n=await r.json().catch(()=>null);if(!r.ok){var e;c(null!=(e=null==n?void 0:n.error)?e:"Failed to repair project config.");return}s.refresh()}catch(e){c("Network error while repairing project config.")}finally{o(!1)}};return(0,r.jsxs)("div",{className:"mt-6",children:[(0,r.jsx)("button",{type:"button",onClick:()=>void u(),disabled:i,className:"rounded-lg border border-[var(--color-accent)] bg-[var(--color-tint-blue)] px-4 py-2 text-sm font-semibold text-[var(--color-accent)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-accent)_14%,transparent)] disabled:cursor-not-allowed disabled:opacity-60",children:i?"Repairing...":"Repair config"}),l?(0,r.jsx)("p",{className:"mt-3 text-sm text-[var(--color-status-error)]",children:l}):null]})}},7594:(e,t,s)=>{"use strict";var r=s(9582);s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})}},e=>{e.O(0,[8713,131,1461,7358],()=>e(e.s=3378)),_N_E=e.O()}]);
@@ -0,0 +1 @@
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]})}},5673:(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=5673)),_N_E=e.O()}]);