@aoagents/ao-web 0.2.3 → 0.2.5

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 (265) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +228 -221
  3. package/.next/app-path-routes-manifest.json +7 -6
  4. package/.next/build-manifest.json +14 -14
  5. package/.next/next-minimal-server.js.nft.json +1 -1
  6. package/.next/next-server.js.nft.json +1 -1
  7. package/.next/prerender-manifest.json +31 -31
  8. package/.next/react-loadable-manifest.json +14 -14
  9. package/.next/required-server-files.json +7 -4
  10. package/.next/server/app/_not-found/page.js +2 -2
  11. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  12. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/.next/server/app/_not-found.html +1 -1
  14. package/.next/server/app/_not-found.rsc +15 -15
  15. package/.next/server/app/api/backlog/route.js +1 -1
  16. package/.next/server/app/api/backlog/route.js.nft.json +1 -1
  17. package/.next/server/app/api/backlog/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/events/route.js +2 -2
  19. package/.next/server/app/api/events/route.js.nft.json +1 -1
  20. package/.next/server/app/api/events/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/route.js +1 -1
  31. package/.next/server/app/api/projects/route.js.nft.json +1 -1
  32. package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/prs/[id]/merge/route.js +1 -1
  34. package/.next/server/app/api/prs/[id]/merge/route.js.nft.json +1 -1
  35. package/.next/server/app/api/prs/[id]/merge/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/runtime/terminal/route.js +1 -1
  37. package/.next/server/app/api/runtime/terminal/route.js.nft.json +1 -1
  38. package/.next/server/app/api/runtime/terminal/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/sessions/[id]/kill/route.js +1 -1
  40. package/.next/server/app/api/sessions/[id]/kill/route.js.nft.json +1 -1
  41. package/.next/server/app/api/sessions/[id]/kill/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/sessions/[id]/message/route.js +1 -1
  43. package/.next/server/app/api/sessions/[id]/message/route.js.nft.json +1 -1
  44. package/.next/server/app/api/sessions/[id]/message/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/sessions/[id]/remap/route.js +1 -1
  46. package/.next/server/app/api/sessions/[id]/remap/route.js.nft.json +1 -1
  47. package/.next/server/app/api/sessions/[id]/remap/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/sessions/[id]/restore/route.js +1 -1
  49. package/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -1
  50. package/.next/server/app/api/sessions/[id]/restore/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  52. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  53. package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/sessions/[id]/send/route.js +1 -1
  55. package/.next/server/app/api/sessions/[id]/send/route.js.nft.json +1 -1
  56. package/.next/server/app/api/sessions/[id]/send/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/sessions/patches/route.js +1 -0
  58. package/.next/server/app/api/sessions/patches/route.js.nft.json +1 -0
  59. package/.next/server/app/api/sessions/patches/route_client-reference-manifest.js +1 -0
  60. package/.next/server/app/api/sessions/route.js +1 -1
  61. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  62. package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/setup-labels/route.js +1 -1
  64. package/.next/server/app/api/setup-labels/route.js.nft.json +1 -1
  65. package/.next/server/app/api/setup-labels/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/spawn/route.js +1 -1
  67. package/.next/server/app/api/spawn/route.js.nft.json +1 -1
  68. package/.next/server/app/api/spawn/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/verify/route.js +1 -1
  70. package/.next/server/app/api/verify/route.js.nft.json +1 -1
  71. package/.next/server/app/api/verify/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/webhooks/[...slug]/route.js +1 -1
  73. package/.next/server/app/api/webhooks/[...slug]/route.js.nft.json +1 -1
  74. package/.next/server/app/api/webhooks/[...slug]/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/apple-icon/route.js +1 -1
  76. package/.next/server/app/apple-icon/route.js.nft.json +1 -1
  77. package/.next/server/app/apple-icon/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/dev/terminal-test/page.js +3 -3
  79. package/.next/server/app/dev/terminal-test/page.js.nft.json +1 -1
  80. package/.next/server/app/dev/terminal-test/page_client-reference-manifest.js +1 -1
  81. package/.next/server/app/dev/terminal-test.html +1 -1
  82. package/.next/server/app/dev/terminal-test.rsc +17 -17
  83. package/.next/server/app/icon/route.js +1 -1
  84. package/.next/server/app/icon/route.js.nft.json +1 -1
  85. package/.next/server/app/icon/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/icon-192/route.js +1 -1
  87. package/.next/server/app/icon-192/route.js.nft.json +1 -1
  88. package/.next/server/app/icon-192/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/icon-512/route.js +1 -1
  90. package/.next/server/app/icon-512/route.js.nft.json +1 -1
  91. package/.next/server/app/icon-512/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  93. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  94. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/manifest.webmanifest.body +1 -1
  96. package/.next/server/app/orchestrators/page.js +2 -2
  97. package/.next/server/app/orchestrators/page.js.nft.json +1 -1
  98. package/.next/server/app/orchestrators/page_client-reference-manifest.js +1 -1
  99. package/.next/server/app/page.js +2 -2
  100. package/.next/server/app/page.js.nft.json +1 -1
  101. package/.next/server/app/page_client-reference-manifest.js +1 -1
  102. package/.next/server/app/prs/page.js +2 -2
  103. package/.next/server/app/prs/page.js.nft.json +1 -1
  104. package/.next/server/app/prs/page_client-reference-manifest.js +1 -1
  105. package/.next/server/app/sessions/[id]/page.js +5 -5
  106. package/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  107. package/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  108. package/.next/server/app/test-direct/page.js +2 -2
  109. package/.next/server/app/test-direct/page.js.nft.json +1 -1
  110. package/.next/server/app/test-direct/page_client-reference-manifest.js +1 -1
  111. package/.next/server/app/test-direct.html +1 -1
  112. package/.next/server/app/test-direct.rsc +17 -17
  113. package/.next/server/app-paths-manifest.json +7 -6
  114. package/.next/server/chunks/100.js +1 -0
  115. package/.next/server/chunks/106.js +1 -0
  116. package/.next/server/chunks/172.js +9 -0
  117. package/.next/server/chunks/180.js +25 -0
  118. package/.next/server/chunks/333.js +1 -0
  119. package/.next/server/chunks/367.js +3 -0
  120. package/.next/server/chunks/561.js +22 -0
  121. package/.next/server/chunks/627.js +380 -363
  122. package/.next/server/chunks/803.js +6 -0
  123. package/.next/server/chunks/886.js +384 -0
  124. package/.next/server/chunks/907.js +1 -0
  125. package/.next/server/middleware-build-manifest.js +1 -1
  126. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  127. package/.next/server/next-font-manifest.js +1 -1
  128. package/.next/server/next-font-manifest.json +1 -1
  129. package/.next/server/pages/404.html +1 -1
  130. package/.next/server/pages/500.html +1 -1
  131. package/.next/server/pages/_app.js +1 -1
  132. package/.next/server/pages/_app.js.nft.json +1 -1
  133. package/.next/server/pages/_document.js +1 -1
  134. package/.next/server/pages/_document.js.nft.json +1 -1
  135. package/.next/server/pages/_error.js +3 -3
  136. package/.next/server/pages/_error.js.nft.json +1 -1
  137. package/.next/server/server-reference-manifest.json +1 -1
  138. package/.next/static/OyzSw2fQpoJHXyoBWoZ2X/_buildManifest.js +1 -0
  139. package/.next/static/chunks/1461-af7c54935f21d56d.js +1 -0
  140. package/.next/static/chunks/{9393.acf1934a190d793b.js → 2529.32352c1ce5253e3e.js} +1 -1
  141. package/.next/static/chunks/{7411.ecda44797fb514a0.js → 5491.fd98884d48631149.js} +1 -1
  142. package/.next/static/chunks/6923-ef8434dfec6f2a3c.js +1 -0
  143. package/.next/static/chunks/7097.fc904e5f313c4994.js +1 -0
  144. package/.next/static/chunks/7317.685aa5231218e8d3.js +1 -0
  145. package/.next/static/chunks/8713-d3d663f55dc00e48.js +1 -0
  146. package/.next/static/chunks/8785-6b4b3ff260617997.js +1 -0
  147. package/.next/static/chunks/88a6fc35-f836b4b72df5eafa.js +1 -0
  148. package/.next/static/chunks/9478.656c9c263bc55893.js +1 -0
  149. package/.next/static/chunks/app/_not-found/page-019391920005654f.js +1 -0
  150. package/.next/static/chunks/app/api/backlog/route-019391920005654f.js +1 -0
  151. package/.next/static/chunks/app/api/events/route-019391920005654f.js +1 -0
  152. package/.next/static/chunks/app/api/issues/route-019391920005654f.js +1 -0
  153. package/.next/static/chunks/app/api/observability/route-019391920005654f.js +1 -0
  154. package/.next/static/chunks/app/api/orchestrators/route-019391920005654f.js +1 -0
  155. package/.next/static/chunks/app/api/projects/route-019391920005654f.js +1 -0
  156. package/.next/static/chunks/app/api/prs/[id]/merge/route-019391920005654f.js +1 -0
  157. package/.next/static/chunks/app/api/runtime/terminal/route-019391920005654f.js +1 -0
  158. package/.next/static/chunks/app/api/sessions/[id]/kill/route-019391920005654f.js +1 -0
  159. package/.next/static/chunks/app/api/sessions/[id]/message/route-019391920005654f.js +1 -0
  160. package/.next/static/chunks/app/api/sessions/[id]/remap/route-019391920005654f.js +1 -0
  161. package/.next/static/chunks/app/api/sessions/[id]/restore/route-019391920005654f.js +1 -0
  162. package/.next/static/chunks/app/api/sessions/[id]/route-019391920005654f.js +1 -0
  163. package/.next/static/chunks/app/api/sessions/[id]/send/route-019391920005654f.js +1 -0
  164. package/.next/static/chunks/app/api/sessions/patches/route-019391920005654f.js +1 -0
  165. package/.next/static/chunks/app/api/sessions/route-019391920005654f.js +1 -0
  166. package/.next/static/chunks/app/api/setup-labels/route-019391920005654f.js +1 -0
  167. package/.next/static/chunks/app/api/spawn/route-019391920005654f.js +1 -0
  168. package/.next/static/chunks/app/api/verify/route-019391920005654f.js +1 -0
  169. package/.next/static/chunks/app/api/webhooks/[...slug]/route-019391920005654f.js +1 -0
  170. package/.next/static/chunks/app/apple-icon/route-019391920005654f.js +1 -0
  171. package/.next/static/chunks/app/dev/terminal-test/page-4912fa9e6459f124.js +1 -0
  172. package/.next/static/chunks/app/error-670f1d8bf2b6859c.js +1 -0
  173. package/.next/static/chunks/app/{global-error-7b5c8ae45329c659.js → global-error-ca06d2b1be2d4ae0.js} +1 -1
  174. package/.next/static/chunks/app/icon/route-019391920005654f.js +1 -0
  175. package/.next/static/chunks/app/icon-192/route-019391920005654f.js +1 -0
  176. package/.next/static/chunks/app/icon-512/route-019391920005654f.js +1 -0
  177. package/.next/static/chunks/app/layout-ddf79478d9a673bb.js +1 -0
  178. package/.next/static/chunks/app/loading-019391920005654f.js +1 -0
  179. package/.next/static/chunks/app/manifest.webmanifest/route-019391920005654f.js +1 -0
  180. package/.next/static/chunks/app/{not-found-3772c2e09c29d80f.js → not-found-824d5d3c6e296eeb.js} +1 -1
  181. package/.next/static/chunks/app/orchestrators/page-4da04720a09483d2.js +1 -0
  182. package/.next/static/chunks/app/page-abf3e3c98cac072f.js +1 -0
  183. package/.next/static/chunks/app/prs/page-46455c406183ffbf.js +1 -0
  184. package/.next/static/chunks/app/sessions/[id]/error-eb0973907da68a37.js +1 -0
  185. package/.next/static/chunks/app/sessions/[id]/loading-019391920005654f.js +1 -0
  186. package/.next/static/chunks/app/sessions/[id]/{not-found-3772c2e09c29d80f.js → not-found-824d5d3c6e296eeb.js} +1 -1
  187. package/.next/static/chunks/app/sessions/[id]/page-7eb67fd32f39b15f.js +1 -0
  188. package/.next/static/chunks/app/test-direct/page-1fd63edb9a9ca8be.js +1 -0
  189. package/.next/static/chunks/{df4ed4d4.6a752eba3933e9a8.js → df4ed4d4.b6997d8b8ce9d79b.js} +1 -1
  190. package/.next/static/chunks/framework-7060e2ac4971c604.js +1 -0
  191. package/.next/static/chunks/main-app-690acf9d5d2050c9.js +1 -0
  192. package/.next/static/chunks/main-ed1610689fbd6f0d.js +1 -0
  193. package/.next/static/chunks/pages/_app-f4baf4dbe88f6f54.js +1 -0
  194. package/.next/static/chunks/pages/_error-a7f6723f42093f29.js +1 -0
  195. package/.next/static/chunks/{webpack-e12ceebeb7a1cc7e.js → webpack-ab6c08c78ffc8113.js} +1 -1
  196. package/.next/static/css/a5398483e6b75ad3.css +1 -0
  197. package/LICENSE +21 -0
  198. package/dist-server/direct-terminal-ws.js +33 -236
  199. package/dist-server/mux-websocket.js +516 -0
  200. package/dist-server/start-all.js +0 -2
  201. package/next.config.js +1 -0
  202. package/package.json +27 -27
  203. package/.next/server/chunks/27.js +0 -438
  204. package/.next/server/chunks/377.js +0 -1
  205. package/.next/server/chunks/393.js +0 -1
  206. package/.next/server/chunks/639.js +0 -6
  207. package/.next/server/chunks/693.js +0 -1
  208. package/.next/server/chunks/705.js +0 -22
  209. package/.next/server/chunks/787.js +0 -29
  210. package/.next/server/chunks/796.js +0 -1
  211. package/.next/server/chunks/934.js +0 -1
  212. package/.next/server/chunks/956.js +0 -9
  213. package/.next/static/chunks/1250-e7cf6b069fbb03ed.js +0 -1
  214. package/.next/static/chunks/2205.498806f73783aa54.js +0 -1
  215. package/.next/static/chunks/3698-9c12c45b8184022c.js +0 -1
  216. package/.next/static/chunks/6381.1541d5695a727108.js +0 -1
  217. package/.next/static/chunks/7505-2d2422d31862995f.js +0 -1
  218. package/.next/static/chunks/8597-1385f90ec1cebf47.js +0 -1
  219. package/.next/static/chunks/8762.f3d526855363db16.js +0 -1
  220. package/.next/static/chunks/a51c26f2-a21e680a5df6764e.js +0 -1
  221. package/.next/static/chunks/app/_not-found/page-2224bc1d3dce1b3e.js +0 -1
  222. package/.next/static/chunks/app/api/backlog/route-2224bc1d3dce1b3e.js +0 -1
  223. package/.next/static/chunks/app/api/events/route-2224bc1d3dce1b3e.js +0 -1
  224. package/.next/static/chunks/app/api/issues/route-2224bc1d3dce1b3e.js +0 -1
  225. package/.next/static/chunks/app/api/observability/route-2224bc1d3dce1b3e.js +0 -1
  226. package/.next/static/chunks/app/api/orchestrators/route-2224bc1d3dce1b3e.js +0 -1
  227. package/.next/static/chunks/app/api/projects/route-2224bc1d3dce1b3e.js +0 -1
  228. package/.next/static/chunks/app/api/prs/[id]/merge/route-2224bc1d3dce1b3e.js +0 -1
  229. package/.next/static/chunks/app/api/runtime/terminal/route-2224bc1d3dce1b3e.js +0 -1
  230. package/.next/static/chunks/app/api/sessions/[id]/kill/route-2224bc1d3dce1b3e.js +0 -1
  231. package/.next/static/chunks/app/api/sessions/[id]/message/route-2224bc1d3dce1b3e.js +0 -1
  232. package/.next/static/chunks/app/api/sessions/[id]/remap/route-2224bc1d3dce1b3e.js +0 -1
  233. package/.next/static/chunks/app/api/sessions/[id]/restore/route-2224bc1d3dce1b3e.js +0 -1
  234. package/.next/static/chunks/app/api/sessions/[id]/route-2224bc1d3dce1b3e.js +0 -1
  235. package/.next/static/chunks/app/api/sessions/[id]/send/route-2224bc1d3dce1b3e.js +0 -1
  236. package/.next/static/chunks/app/api/sessions/route-2224bc1d3dce1b3e.js +0 -1
  237. package/.next/static/chunks/app/api/setup-labels/route-2224bc1d3dce1b3e.js +0 -1
  238. package/.next/static/chunks/app/api/spawn/route-2224bc1d3dce1b3e.js +0 -1
  239. package/.next/static/chunks/app/api/verify/route-2224bc1d3dce1b3e.js +0 -1
  240. package/.next/static/chunks/app/api/webhooks/[...slug]/route-2224bc1d3dce1b3e.js +0 -1
  241. package/.next/static/chunks/app/apple-icon/route-2224bc1d3dce1b3e.js +0 -1
  242. package/.next/static/chunks/app/dev/terminal-test/page-ac0ce5b046fcad82.js +0 -1
  243. package/.next/static/chunks/app/error-4896c9d3b7681a80.js +0 -1
  244. package/.next/static/chunks/app/icon/route-2224bc1d3dce1b3e.js +0 -1
  245. package/.next/static/chunks/app/icon-192/route-2224bc1d3dce1b3e.js +0 -1
  246. package/.next/static/chunks/app/icon-512/route-2224bc1d3dce1b3e.js +0 -1
  247. package/.next/static/chunks/app/layout-023f2083204e4f68.js +0 -1
  248. package/.next/static/chunks/app/loading-2224bc1d3dce1b3e.js +0 -1
  249. package/.next/static/chunks/app/manifest.webmanifest/route-2224bc1d3dce1b3e.js +0 -1
  250. package/.next/static/chunks/app/orchestrators/page-df85236df674fc5a.js +0 -1
  251. package/.next/static/chunks/app/page-e97da633b7ef25f2.js +0 -1
  252. package/.next/static/chunks/app/prs/page-8cc0fce584d238c5.js +0 -1
  253. package/.next/static/chunks/app/sessions/[id]/error-90bc99b777fecabf.js +0 -1
  254. package/.next/static/chunks/app/sessions/[id]/loading-2224bc1d3dce1b3e.js +0 -1
  255. package/.next/static/chunks/app/sessions/[id]/page-c9c95a8604786cff.js +0 -1
  256. package/.next/static/chunks/app/test-direct/page-16ceeb9f7664394a.js +0 -1
  257. package/.next/static/chunks/framework-f8b8ba0f71d38056.js +0 -1
  258. package/.next/static/chunks/main-2bc85c765bf1fc49.js +0 -1
  259. package/.next/static/chunks/main-app-93fb36c3bd1a6739.js +0 -1
  260. package/.next/static/chunks/pages/_app-a0b975794f15bd68.js +0 -1
  261. package/.next/static/chunks/pages/_error-5f4e3b5eea57917d.js +0 -1
  262. package/.next/static/css/908f93fdd7ffba42.css +0 -1
  263. package/.next/static/oB_TdR1wCu7ot1D0AG_cw/_buildManifest.js +0 -1
  264. package/dist-server/terminal-websocket.js +0 -375
  265. /package/.next/static/{oB_TdR1wCu7ot1D0AG_cw → OyzSw2fQpoJHXyoBWoZ2X}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9170],{369:(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(6810)},951:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>x,dynamic:()=>c});var t=s(6409),a=s(5995),n=s(9730),i=s(4669);let l=(0,a.default)(()=>Promise.all([s.e(1052),s.e(8762)]).then(s.bind(s,8762)).then(e=>({default:e.DirectTerminal})),{loadableGenerated:{webpack:()=>[8762]},ssr:!1}),o=(0,a.default)(()=>s.e(2205).then(s.bind(s,2205)).then(e=>({default:e.Terminal})),{loadableGenerated:{webpack:()=>[2205]},ssr:!1}),c="force-dynamic";function d(){let e=(0,n.useSearchParams)(),[r,s]=(0,i.useState)([]),[a,c]=(0,i.useState)(!0);(0,i.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)(l,{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)(i.Suspense,{fallback:(0,t.jsx)("div",{className:"flex min-h-screen items-center justify-center",children:"Loading..."}),children:(0,t.jsx)(d,{})})}},5752:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let t=s(7999)._(s(6720));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)},5995:(e,r,s)=>{"use strict";s.d(r,{default:()=>a.a});var t=s(5752),a=s.n(t)},6234:(e,r,s)=>{Promise.resolve().then(s.bind(s,951))},6703:(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 i},createAsyncLocalStorage:function(){return n},createSnapshot:function(){return l}});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 i(e){return a?a.bind(e):t.bind(e)}function l(){return a?a.snapshot():function(e,...r){return e(...r)}}},6720:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let t=s(6409),a=s(4669),n=s(8839);function i(e){return{default:e&&"default"in e?e.default:e}}s(8442);let l={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},o=function(e){let r={...l,...e},s=(0,a.lazy)(()=>r.loader().then(i)),o=r.loading;function c(e){let i=o?(0,t.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,l=!r.ssr||!!r.loading,c=l?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,{...l?{fallback:i}:{},children:d})}return c.displayName="LoadableComponent",c}},6810:(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(6703).createAsyncLocalStorage)()},8442:(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(6409),s(4992),s(369),s(2376)},8839:(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(987)},9730:(e,r,s)=>{"use strict";var t=s(3814);s.o(t,"notFound")&&s.d(r,{notFound:function(){return t.notFound}}),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}})}},e=>{e.O(0,[4429,8597,7358],()=>e(e.s=6234)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8039],{865:(r,e,o)=>{Promise.resolve().then(o.bind(o,2640))},2640:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>s});var t=o(6409),a=o(9730),n=o(4669),l=o(6901);function s(r){let{error:e,reset:o}=r,s=(0,a.useRouter)();return(0,n.useEffect)(()=>{console.error(e)},[e]),(0,t.jsx)(l.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"})}},6901:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var t=o(6409),a=o(7505),n=o.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 s(r){let{accent:e}=r;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(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,t.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},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 c(r){let{action:e,primary:o=!1}=r,a=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",l=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,t.jsx)(n(),{href:e.href,className:a,style:l,children:e.label}):(0,t.jsx)("button",{type:"button",onClick:e.onClick,className:a,style:l,children:e.label})}function i(r){let{title:e,message:o,tone:a="error",detailsTitle:n="Technical details",error:i,primaryAction:d,secondaryAction:u,compact:x=!1,chrome:m="page",children:b}=r,v=l[a],h=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,t.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,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)(s,{accent:v.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:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,t.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,t.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||u)&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,t.jsx)(c,{action:d,primary:!0}):null,u?(0,t.jsx)(c,{action:u}):null]}),b,h?(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==i?void 0:i.digest)?(0,t.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,t.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,t.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]})})})}},9730:(r,e,o)=>{"use strict";var t=o(3814);o.o(t,"notFound")&&o.d(e,{notFound:function(){return t.notFound}}),o.o(t,"useParams")&&o.d(e,{useParams:function(){return t.useParams}}),o.o(t,"usePathname")&&o.d(e,{usePathname:function(){return t.usePathname}}),o.o(t,"useRouter")&&o.d(e,{useRouter:function(){return t.useRouter}}),o.o(t,"useSearchParams")&&o.d(e,{useSearchParams:function(){return t.useSearchParams}})}},r=>{r.O(0,[7505,4429,8597,7358],()=>r(r.s=865)),_N_E=r.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1337,1762,1797,2007,2079,2438,2985,3675,4209,5214,6681,6849,6865,6946,6999,7462,8301,8581,9002,9492],{2015:()=>{}},_=>{_.O(0,[4429,8597,7358],()=>_(_.s=2015)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1337,1762,1797,2007,2079,2438,2985,3675,4209,5214,6681,6849,6865,6946,6999,7462,8301,8581,9002,9492],{2015:()=>{}},_=>{_.O(0,[4429,8597,7358],()=>_(_.s=2015)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1337,1762,1797,2007,2079,2438,2985,3675,4209,5214,6681,6849,6865,6946,6999,7462,8301,8581,9002,9492],{2015:()=>{}},_=>{_.O(0,[4429,8597,7358],()=>_(_.s=2015)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{525:(e,t,r)=>{"use strict";r.d(t,{ServiceWorkerRegistrar:()=>a});var n=r(4669);function a(){return(0,n.useEffect)(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(e=>{console.error("Service worker registration failed:",e)})},[]),null}},4152:e=>{e.exports={style:{fontFamily:"'JetBrains Mono', 'JetBrains Mono Fallback'",fontStyle:"normal"},className:"__className_6d24ac",variable:"__variable_6d24ac"}},5420:(e,t,r)=>{Promise.resolve().then(r.bind(r,9258)),Promise.resolve().then(r.t.bind(r,6717,23)),Promise.resolve().then(r.t.bind(r,4152,23)),Promise.resolve().then(r.t.bind(r,7013,23)),Promise.resolve().then(r.bind(r,525))},6717:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_188709",variable:"__variable_188709"}},7013:()=>{},9258:(e,t,r)=>{"use strict";r.d(t,{D:()=>m,ThemeProvider:()=>d});var n=r(4669),a=(e,t,r,n,a,s,o,l)=>{let i=document.documentElement,c=["light","dark"];function m(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&s?a.map(e=>s[e]||e):a;r?(i.classList.remove(...n),i.classList.add(s&&s[t]?s[t]:t)):i.setAttribute(e,t)}),r=t,l&&c.includes(r)&&(i.style.colorScheme=r)}if(n)m(n);else try{let e=localStorage.getItem(t)||r,n=o&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;m(n)}catch(e){}},s=["light","dark"],o="(prefers-color-scheme: dark)",l="undefined"==typeof window,i=n.createContext(void 0),c={setTheme:e=>{},themes:[]},m=()=>{var e;return null!=(e=n.useContext(i))?e:c},d=e=>n.useContext(i)?n.createElement(n.Fragment,null,e.children):n.createElement(h,{...e}),u=["light","dark"],h=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:a=!0,enableColorScheme:l=!0,storageKey:c="theme",themes:m=u,defaultTheme:d=a?"system":"light",attribute:h="data-theme",value:p,children:g,nonce:w,scriptProps:k}=e,[S,_]=n.useState(()=>y(c,d)),[E,C]=n.useState(()=>"system"===S?b():S),T=p?Object.values(p):m,P=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&a&&(t=b());let n=p?p[t]:t,o=r?v(w):null,i=document.documentElement,c=e=>{"class"===e?(i.classList.remove(...T),n&&i.classList.add(n)):e.startsWith("data-")&&(n?i.setAttribute(e,n):i.removeAttribute(e))};if(Array.isArray(h)?h.forEach(c):c(h),l){let e=s.includes(d)?d:null,r=s.includes(t)?t:e;i.style.colorScheme=r}null==o||o()},[w]),L=n.useCallback(e=>{let t="function"==typeof e?e(S):e;_(t);try{localStorage.setItem(c,t)}catch(e){}},[S]),N=n.useCallback(e=>{C(b(e)),"system"===S&&a&&!t&&P("system")},[S,t]);n.useEffect(()=>{let e=window.matchMedia(o);return e.addListener(N),N(e),()=>e.removeListener(N)},[N]),n.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?_(e.newValue):L(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[L]),n.useEffect(()=>{P(null!=t?t:S)},[t,S]);let A=n.useMemo(()=>({theme:S,setTheme:L,forcedTheme:t,resolvedTheme:"system"===S?E:S,themes:a?[...m,"system"]:m,systemTheme:a?E:void 0}),[S,L,t,E,a,m]);return n.createElement(i.Provider,{value:A},n.createElement(f,{forcedTheme:t,storageKey:c,attribute:h,enableSystem:a,enableColorScheme:l,defaultTheme:d,value:p,themes:m,nonce:w,scriptProps:k}),g)},f=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:s,enableSystem:o,enableColorScheme:l,defaultTheme:i,value:c,themes:m,nonce:d,scriptProps:u}=e,h=JSON.stringify([s,r,i,t,m,c,o,l]).slice(1,-1);return n.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?d:"",dangerouslySetInnerHTML:{__html:"(".concat(a.toString(),")(").concat(h,")")}})}),y=(e,t)=>{let r;if(!l){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},v=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},b=e=>(e||(e=window.matchMedia(o)),e.matches?"dark":"light")}},e=>{e.O(0,[2132,4726,4429,8597,7358],()=>e(e.s=5420)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1337,1762,1797,2007,2079,2438,2985,3675,4209,5214,6681,6849,6865,6946,6999,7462,8301,8581,9002,9492],{2015:()=>{}},_=>{_.O(0,[4429,8597,7358],()=>_(_.s=2015)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1337,1762,1797,2007,2079,2438,2985,3675,4209,5214,6681,6849,6865,6946,6999,7462,8301,8581,9002,9492],{2015:()=>{}},_=>{_.O(0,[4429,8597,7358],()=>_(_.s=2015)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9428],{4477:(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})},6062:(e,r,t)=>{"use strict";t.d(r,{OrchestratorSelector:()=>d});var s=t(6409),a=t(4669),o=t(9730),c=t(7505),n=t.n(c),i=t(4477);function l(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),o=Math.floor(a/24);return s<1?"Just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):"".concat(o,"d ago")}function d(e){let{orchestrators:r,projectId:t,projectName:c,error:d}=e,u=(0,o.useRouter)(),[x,m]=(0,a.useState)(!1),[h,v]=(0,a.useState)(null),f=(0,a.useRef)(!1),p=async()=>{if(!f.current){f.current=!0,m(!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();u.push("/sessions/".concat(r.orchestrator.id))}catch(e){v(e instanceof Error?e.message:"Failed to spawn orchestrator")}finally{m(!1),f.current=!1}}};return d?(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:d}),(0,s.jsx)(n(),{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:c}),(0,s.jsx)("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Select an orchestrator"})]}),(0,s.jsx)(n(),{href:"/?project=".concat(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.jsxs)("p",{className:"text-sm text-[var(--color-text-secondary)]",children:["Found"," ",(0,s.jsx)("span",{className:"font-medium text-[var(--color-text-primary)]",children:r.length})," ","existing orchestrator session",1!==r.length?"s":"",". You can resume an existing session or start a new one."]})}),(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:"Existing Sessions"}),(0,s.jsx)("div",{className:"space-y-2",children:r.map(e=>(0,s.jsxs)(n(),{href:"/sessions/".concat(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 ",l(e.createdAt)]}),e.lastActivityAt&&(0,s.jsxs)("div",{children:["Active ",l(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:"Or Start Fresh"}),(0,s.jsx)("button",{type:"button",onClick:p,disabled:x,className:(0,i.cn)("orchestrator-btn w-full px-4 py-3 text-sm font-medium","disabled:cursor-wait disabled:opacity-70"),children:x?(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"})]}),"Creating new orchestrator..."]}):"Start New Orchestrator"}),h&&(0,s.jsx)("p",{className:"mt-2 text-sm text-[var(--color-status-error)]",children:h})]})]})})]})}},6863:(e,r,t)=>{Promise.resolve().then(t.bind(t,6062))},9730:(e,r,t)=>{"use strict";var s=t(3814);t.o(s,"notFound")&&t.d(r,{notFound:function(){return s.notFound}}),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}})}},e=>{e.O(0,[7505,4429,8597,7358],()=>e(e.s=6863)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{46:(e,s,t)=>{"use strict";t.d(s,{Dashboard:()=>F});var r=t(6409),a=t(4669),n=t(9730),o=t(7064),l=t(777),i=t(4477),c=t(7843),d=t(4434);let u={active:{label:"active",dot:"var(--color-status-working)",bg:"rgba(34,197,94,0.1)",text:"var(--color-status-working)"},ready:{label:"ready",dot:"var(--color-status-ready)",bg:"rgba(91,126,248,0.1)",text:"var(--color-status-ready)"},idle:{label:"idle",dot:"var(--color-status-idle)",bg:"rgba(72,79,88,0.25)",text:"var(--color-text-secondary)"},waiting_input:{label:"waiting",dot:"var(--color-status-attention)",bg:"rgba(210,153,34,0.12)",text:"var(--color-status-attention)"},blocked:{label:"blocked",dot:"var(--color-status-error)",bg:"rgba(248,81,73,0.1)",text:"var(--color-status-error)"},exited:{label:"exited",dot:"var(--color-status-done)",bg:"rgba(48,54,61,0.5)",text:"var(--color-text-muted)"}},h={dot:"var(--color-text-tertiary)",bg:"rgba(74,74,74,0.2)",text:"var(--color-text-muted)"};function m(e){let{activity:s,dotOnly:t=!1,size:a=6}=e,n=null!==s&&u[s]||{label:null!=s?s:"unknown",...h},o="active"===s;return t?(0,r.jsx)("div",{className:(0,i.cn)("shrink-0 rounded-full",o&&"dot-pulse"),style:{width:a,height:a,background:n.dot}}):(0,r.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full px-1.5 py-0.5",style:{background:n.bg},children:[(0,r.jsx)("span",{className:(0,i.cn)("h-1.5 w-1.5 shrink-0 rounded-full",o&&"dot-pulse"),style:{background:n.dot}}),(0,r.jsx)("span",{className:"text-[10px] font-medium",style:{color:n.text},children:n.label})]})}var x=t(9629);let p=(0,a.memo)(function(e){var s,t;let{session:n,onSend:o,onKill:u,onMerge:h,onRestore:p}=e,[v,b]=(0,a.useState)(!1),[g,f]=(0,a.useState)(null),[j,N]=(0,a.useState)(null),[y,k]=(0,a.useState)(null),[w,_]=(0,a.useState)(null),[C,M]=(0,a.useState)(""),S=(0,a.useRef)(null),R=(0,a.useRef)(null),P=(0,l.ng)(n),I=n.pr,T=async e=>{let s=e.trim();if(!s||null!==y)return!1;k(s),_(null);try{return await Promise.resolve(null==o?void 0:o(n.id,s)),_(s),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>_(null),2e3),!0}catch(e){return!1}finally{k(null)}},E=async e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),await T(C)&&M(""))};(0,a.useEffect)(()=>()=>{S.current&&clearTimeout(S.current),R.current&&clearTimeout(R.current)},[]);let L=async(e,s)=>{if(null===g){f(e),N(null);try{await Promise.resolve(null==o?void 0:o(n.id,s)),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>f(null),2e3)}catch(s){f(null),N(e),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>N(null),2e3)}}},W=!!I&&(0,l.fZ)(I),B=!!I&&(0,l.sZ)(I),D=function(e){var s,t,r;let a=e.pr;if(!a||"open"!==a.state||(0,l.fZ)(a)||(0,l.sZ)(a))return[];let n=e.metadata,o=[],i=n.status,c=a.ciStatus===l.U1.FAILING||"ci_failed"===i,d="changes_requested"===a.reviewDecision||"changes_requested"===i,u=!a.mergeability.noConflicts;if(c){let e=a.ciChecks.find(e=>"failed"===e.status),t=a.ciChecks.filter(e=>"failed"===e.status).length;0===t&&a.ciStatus!==l.U1.FAILING?o.push({key:"ci-fail",label:"CI failing",className:"",color:"var(--color-alert-ci)",borderColor:"var(--color-alert-ci)",url:a.url+"/checks",notified:!!n.lastCIFailureDispatchHash,actionLabel:"ask to fix",actionMessage:"Please fix the failing CI checks on ".concat(a.url),actionClassName:"bg-[var(--color-alert-ci-bg)] text-white hover:brightness-110"}):0===t?o.push({key:"ci-unknown",label:"CI unknown",className:"",color:"var(--color-alert-ci-unknown)",url:a.url+"/checks"}):o.push({key:"ci-fail",label:"".concat(t," CI check").concat(t>1?"s":""," failing"),className:"",color:"var(--color-alert-ci)",borderColor:"var(--color-alert-ci)",url:null!=(s=null==e?void 0:e.url)?s:a.url+"/checks",notified:!!n.lastCIFailureDispatchHash,actionLabel:"ask to fix",actionMessage:"Please fix the failing CI checks on ".concat(a.url),actionClassName:"bg-[var(--color-alert-ci-bg)] text-white hover:brightness-110"})}if(d?o.push({key:"changes",label:"changes requested",className:"",color:"var(--color-alert-changes)",url:a.url,notified:!!n.lastPendingReviewDispatchHash,actionLabel:"ask to address",actionMessage:"Please address the requested changes on ".concat(a.url),actionClassName:"bg-[var(--color-alert-changes-bg)] text-white hover:brightness-110"}):a.isDraft||"pending"!==a.reviewDecision&&"none"!==a.reviewDecision||o.push({key:"review",label:"needs review",className:"",color:"var(--color-alert-review)",url:a.url,actionLabel:"ask to post",actionMessage:"Post ".concat(a.url," on slack asking for a review."),actionClassName:"bg-[var(--color-alert-review-bg)] text-white hover:brightness-110"}),u&&o.push({key:"conflict",label:"merge conflict",className:"",color:"var(--color-alert-conflict)",url:a.url,notified:"true"===n.lastMergeConflictDispatched,actionLabel:"ask to fix",actionMessage:"Please resolve the merge conflicts on ".concat(a.url," by rebasing on the base branch"),actionClassName:"bg-[var(--color-alert-conflict-bg)] text-white hover:brightness-110"}),a.unresolvedThreads>0){let e=null!=(r=null==(t=a.unresolvedComments[0])?void 0:t.url)?r:a.url+"/files";o.push({key:"comments",label:"unresolved comments",count:a.unresolvedThreads,className:"",color:"var(--color-alert-comment)",borderColor:"var(--color-alert-comment)",url:e,actionLabel:"ask to resolve",actionMessage:"Please address all unresolved review comments on ".concat(a.url),actionClassName:"bg-[var(--color-alert-comment-bg)] text-white hover:brightness-110"})}return o}(n),U=!W&&(null==I?void 0:I.mergeability.mergeable)&&"open"===I.state,F=l.CM.has(n.status)||null!==n.activity&&l.Rt.has(n.activity),O=F&&"merged"!==n.status,A=(0,c.P)(n),H=n.issueLabel?"".concat(n.issueLabel).concat(n.issueTitle?" \xb7 ".concat(n.issueTitle):""):null!=(s=n.issueTitle)?s:n.summary&&n.summary!==A?n.summary:null,q=U?"session-card--merge-frame":D.length>0?"session-card--alert-frame":"session-card--fixed",K=D.length>0?{minHeight:"".concat(242+44*Math.max(0,D.length-2),"px")}:U?{minHeight:"264px"}:void 0;if("done"===P){let e=function(e){var s;let t=e.activity,a=e.status;return"merged"===(null==(s=e.pr)?void 0:s.state)||"merged"===a?{label:"merged",pillClass:"done-status-pill--merged",icon:(0,r.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,r.jsx)("path",{d:"M20 6 9 17l-5-5"})})}:"killed"===a||"terminated"===a?{label:a,pillClass:"done-status-pill--killed",icon:(0,r.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,r.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}:{label:"exited"===t?"exited":a,pillClass:"done-status-pill--exited",icon:(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,r.jsx)("path",{d:"M9 12h6"})]})}}(n);return(0,r.jsxs)("div",{className:(0,i.cn)("session-card-done",v&&"done-expanded"),onClick:e=>{e.target.closest("a, button, textarea")||b(!v)},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,r.jsxs)("span",{className:(0,i.cn)("done-status-pill",e.pillClass),children:[e.icon,e.label]}),(0,r.jsx)("span",{className:"font-[var(--font-mono)] text-[10px] tracking-wide text-[var(--color-text-muted)]",children:n.id}),(0,r.jsx)("div",{className:"flex-1"}),O&&(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==p||p(n.id)},className:"done-restore-btn",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,r.jsx)("polyline",{points:"1 4 1 10 7 10"}),(0,r.jsx)("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),"restore"]})]}),(0,r.jsx)("div",{className:"px-3.5 pb-2",children:(0,r.jsx)("p",{className:"text-[13px] font-semibold leading-snug [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2] overflow-hidden",style:{color:"var(--done-title-color)"},children:A})}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 px-3.5 pb-3",children:[n.branch&&(0,r.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-2.5 w-2.5 opacity-50",children:[(0,r.jsx)("path",{d:"M6 3v12M18 9a3 3 0 0 1-3 3H9a3 3 0 0 0-3 3"}),(0,r.jsx)("circle",{cx:"18",cy:"6",r:"3"})]}),n.branch]}),I&&(0,r.jsxs)("a",{href:I.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-bold text-[var(--color-text-primary)] no-underline underline-offset-2 hover:underline",children:["#",I.number]}),I&&!W&&(B?(0,r.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,r.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,r.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",I.additions]})," ",(0,r.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",I.deletions]})," ",(0,x.i_)(I.additions,I.deletions)]}))]}),v&&(0,r.jsxs)("div",{className:"done-expand-section px-3.5 py-3",children:[n.summary&&(null==I?void 0:I.title)&&n.summary!==I.title&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M4 6h16M4 12h16M4 18h10"})}),"Summary"]}),(0,r.jsx)("p",{className:"text-[12px] leading-relaxed text-[var(--color-text-secondary)]",children:n.summary})]}),n.issueUrl&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"Issue"]}),(0,r.jsxs)("a",{href:n.issueUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"text-[12px] text-[var(--color-accent)] hover:underline",children:[n.issueLabel||n.issueUrl,n.issueTitle&&": ".concat(n.issueTitle)]})]}),I&&I.ciChecks.length>0&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M9 12l2 2 4-4"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"})]}),"CI Checks"]}),(0,r.jsx)(d.zm,{checks:I.ciChecks})]}),I&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65S8.93 17.38 9 18v4"}),(0,r.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]}),"PR"]}),(0,r.jsxs)("p",{className:"text-[12px] text-[var(--color-text-secondary)]",children:[(0,r.jsx)("a",{href:I.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"hover:underline",children:I.title}),B?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2 text-[10px] text-[var(--color-text-muted)]",children:[(0,r.jsx)("span",{className:"inline-block h-3 w-12 animate-pulse rounded bg-[var(--color-bg-subtle)]"}),(0,r.jsx)("span",{children:"PR details loading..."})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2",children:[(0,r.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,r.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",I.additions]})," ",(0,r.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",I.deletions]})]}),(0,r.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,r.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["mergeable: ",I.mergeability.mergeable?"yes":"no"]}),(0,r.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,r.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["review: ",I.reviewDecision]})]})]})]})]}),!I&&(0,r.jsx)("p",{className:"text-[12px] text-[var(--color-text-tertiary)]",children:"No PR associated with this session."})]})]})}return(0,r.jsxs)("div",{className:(0,i.cn)("session-card border",q,"hover:border-[var(--color-border-strong)]","card-glow-".concat(P),U?"card-merge-ready border-[color-mix(in_srgb,var(--color-status-ready)_30%,transparent)]":"border-[var(--color-border-default)]"),style:K,children:[(0,r.jsxs)("div",{className:"session-card__header flex items-center gap-2 px-4 pt-4 pb-2",children:[U?(0,r.jsx)(m,{activity:"ready"}):(0,r.jsx)(m,{activity:n.activity}),(0,r.jsx)("span",{className:"font-[var(--font-mono)] text-[11px] tracking-wide text-[var(--color-text-muted)]",children:n.id}),(0,r.jsx)("div",{className:"flex-1"}),O&&(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==p||p(n.id)},className:"inline-flex items-center gap-1 border border-[color-mix(in_srgb,var(--color-accent)_35%,transparent)] px-2 py-0.5 text-[11px] text-[var(--color-accent)] transition-colors hover:bg-[var(--color-tint-blue)]",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,r.jsx)("polyline",{points:"1 4 1 10 7 10"}),(0,r.jsx)("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),"restore"]}),!F&&(0,r.jsxs)("a",{href:"/sessions/".concat(encodeURIComponent(n.id)),onClick:e=>e.stopPropagation(),className:"session-card__control inline-flex items-center justify-center gap-1.5 border border-[var(--color-border-default)] bg-[var(--color-bg-subtle)] px-2.5 py-1 text-[11px] text-[var(--color-text-muted)] transition-colors hover:border-[var(--color-accent)] hover:text-[var(--color-accent)] hover:no-underline",children:[(0,r.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),(0,r.jsx)("path",{d:"M6 10l4 2-4 2"}),(0,r.jsx)("path",{d:"M14 14h4"})]}),"terminal"]})]}),(0,r.jsxs)("div",{className:"session-card__body flex min-h-0 flex-1 flex-col",children:[(0,r.jsx)("div",{className:"session-card__title-wrap px-4 pb-2",children:(0,r.jsx)("p",{className:(0,i.cn)("session-card__title leading-snug [display:-webkit-box] [-webkit-box-orient:vertical] overflow-hidden","working"===P?"text-[13px] font-medium text-[var(--color-text-secondary)]":"text-[14px] font-semibold text-[var(--color-text-primary)]"),children:A})}),(0,r.jsxs)("div",{className:"session-card__meta flex flex-wrap items-center gap-1.5 px-4 pb-2",children:[n.branch&&(0,r.jsx)("span",{className:"font-[var(--font-mono)] text-[10px] text-[var(--color-text-muted)]",children:n.branch}),I&&(0,r.jsxs)("a",{href:I.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"font-[var(--font-mono)] text-[11px] font-bold text-[var(--color-text-primary)] underline-offset-2 hover:underline",children:["#",I.number]}),I&&!W&&(B?(0,r.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,r.jsxs)("span",{className:"inline-flex items-center rounded-full bg-[var(--color-chip-bg)] px-2 py-0.5 font-[var(--font-mono)] text-[10px] font-semibold text-[var(--color-text-muted)]",children:["+",I.additions," -",I.deletions," ",(0,x.i_)(I.additions,I.deletions)]}))]}),H&&(0,r.jsx)("div",{className:"px-4 pb-2",children:(0,r.jsx)("p",{className:"session-card__secondary text-[11px] text-[var(--color-text-muted)]",children:H})}),W&&(null==I?void 0:I.state)==="open"&&(0,r.jsx)("div",{className:"px-4 pb-2",children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--color-text-muted)]",children:[(0,r.jsxs)("svg",{className:"h-3 w-3 text-[var(--color-text-tertiary)]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"PR data rate limited"]})}),!W&&D.length>0&&(0,r.jsx)("div",{className:"session-card__actions px-4 pb-2 pt-0.5",children:(0,r.jsx)("div",{className:"session-card__alert-grid",children:D.slice(0,3).map(e=>{var s,t,a,n;return(0,r.jsxs)("span",{className:"session-card__alert-pill inline-flex items-stretch overflow-hidden border",style:{borderColor:null!=(t=null!=(s=e.borderColor)?s:e.color)?t:"var(--color-border-default)"},children:[(0,r.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:(0,i.cn)("min-w-0 flex-1 truncate whitespace-nowrap px-2 py-0.5 font-[var(--font-mono)] text-[11px] font-medium !underline [text-decoration-skip-ink:none] [text-underline-offset:2px] hover:brightness-125",e.className),style:e.color?{color:e.color}:void 0,children:[void 0!==e.count&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"font-bold",children:e.count})," "]}),e.label,e.notified&&(0,r.jsx)("span",{className:"ml-1 opacity-60",title:"Agent has been notified",children:" \xb7 notified"})]}),e.actionLabel&&(0,r.jsx)("button",{onClick:s=>{var t;s.stopPropagation(),L(e.key,null!=(t=e.actionMessage)?t:"")},disabled:g===e.key,className:(0,i.cn)("border-l px-2 py-0.5 font-[var(--font-mono)] text-[11px] font-medium transition-colors disabled:opacity-50",j===e.key&&"bg-[var(--color-tint-red)] text-[var(--color-status-error)]",e.actionClassName),style:{borderColor:null!=(n=null!=(a=e.borderColor)?a:e.color)?n:"var(--color-border-default)"},children:g===e.key?"sent!":j===e.key?"failed":e.actionLabel})]},e.key)})})}),(0,r.jsxs)("div",{className:"session-card__footer mt-auto flex items-center justify-between gap-2 border-t border-[var(--color-border-subtle)] px-4 py-2.5",children:[n.issueUrl?(0,r.jsx)("a",{href:n.issueUrl,target:"_blank",rel:"noopener noreferrer",className:"min-w-0 truncate text-[11px] text-[var(--color-accent)] hover:underline",children:n.issueLabel||n.issueUrl}):(0,r.jsx)("span",{className:"min-w-0 truncate text-[11px] text-[var(--color-text-tertiary)]",children:null!=(t=n.activity)?t:n.status}),U&&I?(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==h||h(I.number)},className:"session-card__control session-card__merge-control inline-flex shrink-0 cursor-pointer items-center justify-center gap-1.5 border px-2.5 py-1 text-[11px] transition-colors",children:[(0,r.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"6",cy:"6",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"18",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"6",r:"2"}),(0,r.jsx)("path",{d:"M8 6h5a3 3 0 0 1 3 3v7"}),(0,r.jsx)("path",{d:"M8 6h5a3 3 0 0 0 3-3V8"})]}),"merge"]}):!F&&(0,r.jsx)("button",{onClick:e=>{e.stopPropagation(),null==u||u(n.id)},"aria-label":"Terminate session",className:"session-card__control session-card__terminate inline-flex shrink-0 cursor-pointer items-center justify-center border border-[color-mix(in_srgb,var(--color-status-error)_35%,transparent)] px-2.5 py-1 text-[11px] text-[var(--color-status-error)] transition-colors hover:border-[var(--color-status-error)] hover:bg-[var(--color-tint-red)]",children:(0,r.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M3 6h18"}),(0,r.jsx)("path",{d:"M8 6V4h8v2"}),(0,r.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,r.jsx)("path",{d:"M10 11v6M14 11v6"})]})})]})]}),"respond"===P&&(0,r.jsxs)("div",{className:"quick-reply",onClick:e=>e.stopPropagation(),children:[n.summary&&!n.summaryIsFallback&&(0,r.jsx)("p",{className:"quick-reply__summary",children:n.summary}),(0,r.jsxs)("div",{className:"quick-reply__presets",children:[(0,r.jsx)("button",{className:"quick-reply__preset-btn",onClick:()=>void T("continue"),disabled:null!==y,children:"continue"===y?"Sending...":"continue"===w?"Sent":"Continue"}),(0,r.jsx)("button",{className:"quick-reply__preset-btn",onClick:()=>void T("abort"),disabled:null!==y,children:"abort"===y?"Sending...":"abort"===w?"Sent":"Abort"}),(0,r.jsx)("button",{className:"quick-reply__preset-btn",onClick:()=>void T("skip"),disabled:null!==y,children:"skip"===y?"Sending...":"skip"===w?"Sent":"Skip"})]}),(0,r.jsx)("textarea",{className:"quick-reply__input",placeholder:null!==y?"Sending...":"Type a reply...","aria-label":"Type a reply to the agent",value:C,onChange:e=>M(e.target.value),onKeyDown:e=>{E(e)},rows:1,disabled:null!==y})]})]})},function(e,s){return e.session===s.session&&e.onSend===s.onSend&&e.onKill===s.onKill&&e.onMerge===s.onMerge&&e.onRestore===s.onRestore}),v={merge:{label:"Ready",color:"var(--color-status-ready)",caption:"Cleared to land"},respond:{label:"Respond",color:"var(--color-status-error)",caption:"Human judgment needed"},review:{label:"Review",color:"var(--color-accent-orange)",caption:"Code waiting on eyes"},pending:{label:"Pending",color:"var(--color-status-attention)",caption:"Waiting on external state"},working:{label:"Working",color:"var(--color-status-working)",caption:"Agents are actively moving"},done:{label:"Done",color:"var(--color-text-tertiary)",caption:"Completed or exited"}},b=(0,a.memo)(function(e){let{level:s,sessions:t,onSend:n,onKill:o,onMerge:l,onRestore:i,collapsed:c,onToggle:d,compactMobile:u,onPreview:h,resetKey:m}=e,x=v[s],b=void 0!==d,[f,j]=(0,a.useState)(!1),N=b&&u&&!f?t.slice(0,5):t,y=t.length-N.length;return((0,a.useEffect)(()=>{c&&j(!1)},[c]),(0,a.useEffect)(()=>{j(!1)},[m]),b)?(0,r.jsxs)("div",{className:"accordion-section".concat(c?" accordion-section--collapsed":" accordion-section--expanded"),"data-level":s,children:[(0,r.jsxs)("button",{type:"button",className:"accordion-header",onClick:()=>d(s),"aria-expanded":!c,children:[(0,r.jsx)("span",{className:"accordion-header__dot",style:{background:x.color}}),(0,r.jsx)("span",{className:"accordion-header__label",children:x.label}),(0,r.jsx)("span",{className:"accordion-header__count",children:t.length}),(0,r.jsx)("span",{className:"accordion-header__chevron","aria-hidden":"true",children:"▶"})]}),(0,r.jsx)("div",{className:"accordion-body",children:t.length>0?(0,r.jsxs)("div",{className:u?"mobile-session-list":"flex flex-col gap-2 p-3",children:[N.map(e=>u?(0,r.jsx)(g,{session:e,level:s,onPreview:h},e.id):(0,r.jsx)(p,{session:e,onSend:n,onKill:o,onMerge:l,onRestore:i},e.id)),u&&y>0?(0,r.jsxs)("button",{type:"button",className:"mobile-session-list__view-all",onClick:()=>j(!0),children:["View all ",t.length]}):null]}):u?(0,r.jsx)("div",{className:"mobile-session-list",children:(0,r.jsx)("div",{className:"mobile-session-list__empty",children:"No sessions"})}):null})]}):(0,r.jsxs)("div",{className:"kanban-column","data-level":s,children:[(0,r.jsxs)("div",{className:"kanban-column__header",children:[(0,r.jsxs)("div",{className:"kanban-column__title-row",children:[(0,r.jsx)("div",{className:"kanban-column__dot",style:{background:x.color}}),(0,r.jsx)("span",{className:"kanban-column__title",children:x.label}),(0,r.jsx)("span",{className:"kanban-column__count",children:t.length})]}),(0,r.jsx)("p",{className:"kanban-column__caption",children:x.caption})]}),(0,r.jsx)("div",{className:"kanban-column-body",children:t.length>0?(0,r.jsx)("div",{className:"flex flex-col gap-2",children:t.map(e=>(0,r.jsx)(p,{session:e,onSend:n,onKill:o,onMerge:l,onRestore:i},e.id))}):(0,r.jsx)("div",{className:"kanban-column__empty",children:(0,r.jsx)("span",{className:"kanban-column__empty-label",children:"No sessions"})})})]})},function(e,s){return e.level===s.level&&e.collapsed===s.collapsed&&e.onToggle===s.onToggle&&e.onSend===s.onSend&&e.onKill===s.onKill&&e.onMerge===s.onMerge&&e.onRestore===s.onRestore&&e.compactMobile===s.compactMobile&&e.onPreview===s.onPreview&&e.resetKey===s.resetKey&&e.sessions.length===s.sessions.length&&e.sessions.every((e,t)=>e===s.sessions[t])});function g(e){let{session:s,level:t,onPreview:a}=e,n=[s.branch,s.pr?"PR #".concat(s.pr.number):null,s.issueLabel].filter(Boolean);return(0,r.jsxs)("div",{className:"mobile-session-row",children:[(0,r.jsxs)("button",{type:"button",className:"mobile-session-row__preview",onClick:()=>null==a?void 0:a(s),"aria-label":"Open ".concat((0,c.P)(s)),children:[(0,r.jsxs)("div",{className:"mobile-session-row__line",children:[(0,r.jsx)("span",{className:"mobile-session-row__dot",style:{background:v[t].color},"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mobile-session-row__title",children:(0,c.P)(s)})]}),(0,r.jsx)("div",{className:"mobile-session-row__meta",children:n.length>0?n.join(" \xb7 "):"No branch or PR metadata"})]}),(0,r.jsxs)("div",{className:"mobile-session-row__side",children:[(0,r.jsx)(f,{session:s,level:t}),(0,r.jsx)("a",{href:"/sessions/".concat(encodeURIComponent(s.id)),className:"mobile-session-row__open","aria-label":"Go to ".concat((0,c.P)(s)),children:(0,r.jsxs)("svg",{className:"mobile-session-row__open-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M4 17V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2Z"}),(0,r.jsx)("path",{d:"m8 10 2 2-2 2M12 14h4"})]})})]})]})}function f(e){var s,t;let{session:a,level:n}=e,o=v[n].label.toLowerCase();return"merge"===n&&a.pr&&(0,l.QN)(a.pr)?o="ready":"respond"===n?o="waiting_input"===a.activity?"waiting":"needs input":"review"===n?o=(null==(s=a.pr)?void 0:s.reviewDecision)==="changes_requested"?"changes":"review":"pending"===n?o=(null==(t=a.pr)?void 0:t.unresolvedThreads)?"threads":"pending":"working"===n&&(o="idle"===a.activity?"idle":"active"),(0,r.jsx)("span",{className:"mobile-session-row__chip",children:o})}var j=t(8400),N=t(53),y=t(2132),k=t(3292);function w(e){let{message:s}=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-24 text-center",children:[(0,r.jsxs)("svg",{className:"mb-4 h-8 w-8 text-[var(--color-border-strong)]",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:[(0,r.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),(0,r.jsx)("path",{d:"M6 9l4 3-4 3M13 15h5"})]}),(0,r.jsx)("p",{className:"text-[13px] text-[var(--color-text-muted)]",children:null!=s?s:"No active sessions"})]})}function _(e,s){return"SHOW"===s.type?{message:s.message,variant:s.variant,key:s.key}:null}let C=(0,a.createContext)(null);function M(e){let{children:s}=e,[t,n]=(0,a.useReducer)(_,null),o=(0,a.useRef)(null),l=(0,a.useRef)(0);(0,a.useEffect)(()=>()=>{null!==o.current&&clearTimeout(o.current)},[]);let c=(0,a.useCallback)(function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";null!==o.current&&clearTimeout(o.current),l.current+=1,n({type:"SHOW",message:e,variant:s,key:l.current}),o.current=setTimeout(()=>{n({type:"HIDE"}),o.current=null},3e3)},[]);return(0,r.jsxs)(C.Provider,{value:{showToast:c},children:[s,(0,r.jsx)("div",{className:"toast-container",role:"status","aria-live":"polite","aria-atomic":"true",children:t&&(0,r.jsxs)("div",{className:(0,i.cn)("toast","success"===t.variant&&"toast--success","error"===t.variant&&"toast--error","info"===t.variant&&"toast--info"),children:[(0,r.jsx)("span",{className:"toast__icon","aria-hidden":"true"}),(0,r.jsx)("span",{className:"toast__message",children:t.message})]},t.key)})]})}function S(e){return e.replaceAll("_"," ")}function R(e){return null!==e}function P(e){var s,t;let{session:n,mode:o,onCancel:i,onConfirm:d,onRequestKill:u,onMerge:h,isMergeReady:m=!1}=e,x=(0,a.useRef)(null),p=(0,a.useRef)(null),v=(0,a.useRef)(null),b=null!=(t=null==n||null==(s=n.pr)?void 0:s.number)?t:null;if((0,a.useEffect)(()=>{if(!n){v.current=null;return}function e(e){"Escape"===e.key&&i()}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n,i]),(0,a.useEffect)(()=>{if(!n||!p.current)return;let e=p.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===e.length)return;let s=e[0],t=e[e.length-1],r=v.current!==n.id;function a(e){"Tab"===e.key&&(e.shiftKey&&document.activeElement===s?(e.preventDefault(),t.focus()):e.shiftKey||document.activeElement!==t||(e.preventDefault(),s.focus()))}v.current=n.id,r&&s.focus();let o=p.current;return o.addEventListener("keydown",a),()=>o.removeEventListener("keydown",a)},[n,o]),!n)return null;let g=(0,c.P)(n),f=(0,l.ng)(n),j=n.summary&&!n.summaryIsFallback?n.summary:null,N="done"!==f&&"merge"!==f&&"terminated"!==n.status,y=[{label:S(f),tone:"accent"},{label:S(n.status),tone:"neutral"},n.activity?{label:S(n.activity),tone:"neutral"}:null,n.branch?{label:n.branch,tone:"mono"}:null,n.pr?{label:"PR #".concat(n.pr.number),tone:"neutral"}:null,n.issueLabel?{label:n.issueLabel,tone:"neutral"}:null].filter(R);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"bottom-sheet-backdrop",onClick:i,"aria-hidden":"true"}),(0,r.jsxs)("div",{ref:p,className:"bottom-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"bottom-sheet-title",onTouchStart:function(e){var s,t;x.current=null!=(t=null==(s=e.touches[0])?void 0:s.clientY)?t:null},onTouchEnd:function(e){var s,t;if(null===x.current)return;let r=(null!=(t=null==(s=e.changedTouches[0])?void 0:s.clientY)?t:0)-x.current;x.current=null,r>80&&i()},children:[(0,r.jsx)("div",{className:"bottom-sheet__handle","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"bottom-sheet__header",children:[(0,r.jsx)("h2",{id:"bottom-sheet-title",className:"bottom-sheet__title",children:"confirm-kill"===o?"Terminate session?":g}),(0,r.jsx)("p",{className:"bottom-sheet__subtitle",children:"confirm-kill"===o?"This action cannot be undone.":"".concat(f," \xb7 started ").concat(function(e){let s=Date.now(),t=Math.floor((s-new Date(e).getTime())/1e3);if(t<60)return"".concat(t,"s ago");let r=Math.floor(t/60);if(r<60)return"".concat(r,"m ago");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h ago");let n=Math.floor(a/24);return"".concat(n,"d ago")}(n.createdAt))})]}),(0,r.jsxs)("div",{className:"bottom-sheet__session-info",children:["confirm-kill"===o?(0,r.jsx)("div",{className:"bottom-sheet__session-name",children:g}):null,(0,r.jsx)("div",{className:"bottom-sheet__session-meta",children:y.map(e=>(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--".concat(e.tone),children:e.label},"".concat(e.tone,"-").concat(e.label)))}),j?(0,r.jsx)("p",{className:"bottom-sheet__summary",children:j}):null]}),(0,r.jsx)("div",{className:"bottom-sheet__actions",children:"confirm-kill"===o?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--cancel",onClick:i,children:"Cancel"}),(0,r.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--danger",onClick:d,children:"Terminate"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:"/sessions/".concat(encodeURIComponent(n.id)),className:"bottom-sheet__btn bottom-sheet__btn--primary",children:"Open session"}),m&&n.pr&&h?(0,r.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--secondary",onClick:()=>{null!==b&&h(b)},children:"Merge"}):N&&u?(0,r.jsxs)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--danger",onClick:u,children:[(0,r.jsxs)("svg",{className:"bottom-sheet__btn-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M3 6h18"}),(0,r.jsx)("path",{d:"M8 6V4h8v2"}),(0,r.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,r.jsx)("path",{d:"M10 11v6M14 11v6"})]}),"Terminate"]}):null]})})]})]})}function I(e){let{status:s}=e;return"connected"===s?null:"disconnected"===s?(0,r.jsx)("button",{type:"button",className:"connection-bar connection-bar--disconnected","aria-live":"assertive","aria-atomic":"true",onClick:()=>window.location.reload(),children:"Offline \xb7 tap to retry"}):(0,r.jsx)("div",{className:"connection-bar connection-bar--reconnecting",role:"status","aria-live":"polite","aria-atomic":"true",children:"Reconnecting…"})}var T=t(5729),E=t(277);let L=["working","pending","review","respond","merge"],W=["respond","merge","review","pending","working"],B=[{value:"all",label:"All"},{value:"respond",label:"Respond"},{value:"merge",label:"Ready"},{value:"review",label:"Review"},{value:"pending",label:"Pending"},{value:"working",label:"Working"}],D=[];function U(e){var s,t;let{initialSessions:i,projectId:c,projectName:d,projects:u=[],orchestrators:h}=e,m=null!=h?h:D,x=(0,a.useMemo)(()=>{let e={};for(let s of i)e[s.id]=(0,l.ng)(s);return e},[i]),{sessions:v,connectionStatus:g,sseAttentionLevels:f}=(0,N.D)(i,c,x),_=(0,n.useSearchParams)(),M=null!=(s=_.get("session"))?s:void 0,[S,R]=(0,a.useState)(!1),[U,F]=(0,a.useState)(m),[H,q]=(0,a.useState)([]),[G,J]=(0,a.useState)({}),[z,Q]=(0,a.useState)(!1),[Y,X]=(0,a.useState)(!1),$=(0,o.U)(o.D),[ee,es]=(0,a.useState)(!1),[et,er]=(0,a.useState)(null),[ea,en]=(0,a.useState)("all"),eo=u.length>1,{showToast:el}=function(){let e=(0,a.useContext)(C);if(!e)throw Error("useToast must be used within a ToastProvider");return e}(),[ei,ec]=(0,a.useState)(null),[ed,eu]=(0,a.useState)(null),[eh,em]=(0,a.useState)(!1),ex=(0,a.useRef)(v),ep=(0,a.useRef)(!1);ex.current=v;let ev=eo&&void 0===c,eb=(0,a.useMemo)(()=>{var e;return c&&null!=(e=U.find(e=>e.projectId===c))?e:null},[U,c]),eg=(0,E.Jy)("/",c),ef=(0,E.Jy)("/prs",c),ej=eb?"/sessions/".concat(encodeURIComponent(eb.id)):null,eN=(0,a.useMemo)(()=>ev||!M?v:v.filter(e=>e.id===M),[v,ev,M]),ey=(0,a.useMemo)(()=>{var e;return ei&&null!=(e=v.find(e=>e.id===ei.sessionId))?e:null},[v,ei]),ek=(0,a.useMemo)(()=>ey?ed?{...ey,...ed,status:ey.status,activity:ey.activity,lastActivityAt:ey.lastActivityAt}:ey:null,[ey,ed]);(0,a.useEffect)(()=>{F(e=>(function(e,s){let t=new Map(e.map(e=>[e.projectId,e]));for(let e of s)t.set(e.projectId,e);return[...t.values()]})(e,m))},[m]),(0,a.useEffect)(()=>{let e=(0,j.S)(f),s=null!=d?d:"ao";document.title=e>0?"".concat(s," (").concat(e," need attention)"):s},[f,d]),(0,a.useEffect)(()=>{X(!1)},[_]),(0,a.useEffect)(()=>{ei&&null===ey&&ec(null)},[ey,ei]),(0,a.useEffect)(()=>{ei&&"confirm-kill"===ei.mode&&ek&&"done"===(0,l.ng)(ek)&&ec(null)},[ek,ei]),(0,a.useEffect)(()=>{if(!ei)return void eu(null);let e=!1,s=ei.sessionId,t=async()=>{try{let t=await fetch("/api/sessions/".concat(encodeURIComponent(s)));if(!t.ok)return;let r=await t.json();if(!r||r.id!==s)return;e||eu(r)}catch(e){}};t();let r=setInterval(t,15e3);return()=>{e=!0,clearInterval(r)}},[ei]);let ew=(0,a.useMemo)(()=>{let e={merge:[],respond:[],review:[],pending:[],working:[],done:[]};for(let s of eN)e[(0,l.ng)(s)].push(s);return e},[eN]);(0,a.useEffect)(()=>{es(!0)},[]),(0,a.useEffect)(()=>{var e;if(!$){ep.current=!1;return}ep.current||(ep.current=!0,er(null!=(e=W.find(e=>ew[e].length>0))?e:null))},[ew,$]),(0,a.useEffect)(()=>{if($){if("all"!==ea)return void er(ea);er(e=>{var s;return null===e||null!==e&&ew[e].length>0?e:null!=(s=W.find(e=>ew[e].length>0))?s:null})}},[ew,$,ea]);let e_=(0,a.useMemo)(()=>{let e=new Map;for(let s of v){let t=e.get(s.projectId);if(t){t.push(s);continue}e.set(s.projectId,[s])}return e},[v]),eC=(0,a.useMemo)(()=>ev?u.map(e=>{var s,t;let r=null!=(s=e_.get(e.id))?s:[],a={merge:0,respond:0,review:0,pending:0,working:0,done:0};for(let e of r)a[(0,l.ng)(e)]++;return{project:e,orchestrator:null!=(t=U.find(s=>s.projectId===e.id))?t:null,sessionCount:r.length,openPRCount:r.filter(e=>{var s;return(null==(s=e.pr)?void 0:s.state)==="open"}).length,counts:a}}):[],[U,ev,u,e_]),eM=(0,a.useCallback)(e=>{"done"!==e&&er(s=>s===e?null:e)},[]),eS=(0,a.useCallback)(e=>{var s;if("done"===e)return;en(e),er(e);let t=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth";null==(s=document.getElementById("mobile-board"))||s.scrollIntoView({behavior:t,block:"start"})},[]),eR="all"===ea?W:W.filter(e=>e===ea),eP=ee&&!$,eI=(0,a.useCallback)(async(e,s)=>{try{let t=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:s})});if(!t.ok){let s=await t.text()||"Unknown error";console.error("Failed to send message to ".concat(e,":"),s),el("Send failed: ".concat(s),"error");let r=Error(s);throw r.toastShown=!0,r}}catch(s){throw s instanceof Error&&"toastShown"in s&&s.toastShown||(console.error("Network error sending message to ".concat(e,":"),s),el("Network error while sending message","error")),s}},[el]),eT=(0,a.useCallback)(async e=>{try{let s=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/kill"),{method:"POST"});if(s.ok)el("Session terminated","success");else{let t=await s.text();console.error("Failed to kill ".concat(e,":"),t),el("Terminate failed: ".concat(t),"error")}}catch(s){console.error("Network error killing ".concat(e,":"),s),el("Network error while terminating session","error")}},[el]),eE=(0,a.useCallback)(e=>{var s;let t=null!=(s=ex.current.find(s=>s.id===e))?s:null;if(t){if(!$){window.confirm("Terminate this session?")&&eT(t.id);return}ec({sessionId:t.id,mode:"confirm-kill"})}},[$,eT]),eL=(0,a.useCallback)(e=>{ec({sessionId:e.id,mode:"preview"})},[]),eW=(0,a.useCallback)(()=>{ec(e=>e?{sessionId:e.sessionId,mode:"confirm-kill"}:e)},[]),eB=(0,a.useCallback)(async()=>{ec(null),ek&&await eT(ek.id)},[ek,eT]),eD=(0,a.useCallback)(async e=>{try{let s=await fetch("/api/prs/".concat(e,"/merge"),{method:"POST"});if(s.ok)el("PR #".concat(e," merged"),"success"),ec(null);else{let t=await s.text();console.error("Failed to merge PR #".concat(e,":"),t),el("Merge failed: ".concat(t),"error");return}}catch(s){console.error("Network error merging PR #".concat(e,":"),s),el("Network error while merging PR","error")}},[el]),eU=(0,a.useCallback)(async e=>{try{let s=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/restore"),{method:"POST"});if(s.ok)el("Session restored","success");else{let t=await s.text();console.error("Failed to restore ".concat(e,":"),t),el("Restore failed: ".concat(t),"error")}}catch(s){console.error("Network error restoring ".concat(e,":"),s),el("Network error while restoring session","error")}},[el]),eF=async e=>{q(s=>s.includes(e.id)?s:[...s,e.id]),J(s=>{let{[e.id]:t,...r}=s;return r});try{let t=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e.id})}),r=await t.json().catch(()=>null);if(!t.ok||!(null==r?void 0:r.orchestrator)){var s;throw Error(null!=(s=null==r?void 0:r.error)?s:"Failed to spawn orchestrator for ".concat(e.name))}let a=r.orchestrator;F(s=>{let t=s.filter(s=>s.projectId!==e.id);return t.push(a),t})}catch(t){let s=t instanceof Error?t.message:"Failed to spawn orchestrator";J(t=>({...t,[e.id]:s})),console.error("Failed to spawn orchestrator for ".concat(e.id,":"),t)}finally{q(s=>s.filter(s=>s!==e.id))}},eO=L.some(e=>ew[e].length>0),eA=(0,a.useMemo)(()=>v.some(e=>e.pr&&(0,l.fZ)(e.pr)),[v]),eH=(0,a.useMemo)(()=>({totalSessions:v.length,workingSessions:v.filter(e=>null!==e.activity&&"exited"!==e.activity).length,openPRs:v.filter(e=>{var s;return(null==(s=e.pr)?void 0:s.state)==="open"}).length,needsReview:v.filter(e=>e.pr&&!e.pr.isDraft&&"pending"===e.pr.reviewDecision).length}),[v]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(I,{status:g}),(0,r.jsxs)("div",{className:"dashboard-shell flex h-screen",children:[eo&&(0,r.jsx)(y.u,{projects:u,sessions:v,activeProjectId:c,activeSessionId:M,collapsed:z,onToggleCollapsed:()=>Q(e=>!e),mobileOpen:Y,onMobileClose:()=>X(!1)}),(0,r.jsxs)("div",{className:"dashboard-main flex-1 overflow-y-auto px-4 py-4 md:px-7 md:py-6",children:[(0,r.jsx)("div",{id:"mobile-dashboard-anchor","aria-hidden":"true"}),(0,r.jsx)(j.u,{sseAttentionLevels:f,projectName:d}),(0,r.jsxs)("section",{className:"dashboard-hero mb-5",children:[(0,r.jsx)("div",{className:"dashboard-hero__backdrop"}),(0,r.jsxs)("div",{className:"dashboard-hero__content",children:[eo&&(0,r.jsx)("button",{type:"button",className:"mobile-menu-toggle",onClick:()=>X(!0),"aria-label":"Open menu",children:(0,r.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-5 w-5",children:(0,r.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})})}),(0,r.jsxs)("div",{className:"dashboard-hero__primary",children:[(0,r.jsx)("div",{className:"dashboard-hero__heading",children:(0,r.jsxs)("div",{className:"dashboard-hero__copy",children:[(0,r.jsx)("h1",{className:"dashboard-title",children:null!=d?d:"Orchestrator"}),(0,r.jsx)("p",{className:"dashboard-subtitle",children:"Live agent sessions, pull requests, and merge status."})]})}),$?null:(0,r.jsx)(V,{stats:eH})]}),(0,r.jsx)("div",{className:"dashboard-hero__meta",children:(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[eP?(0,r.jsxs)("a",{href:ef,className:"dashboard-prs-link orchestrator-btn flex items-center gap-2 px-4 py-2 text-[12px] font-semibold hover:no-underline",children:[(0,r.jsx)("svg",{className:"h-3.5 w-3.5 opacity-75",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M4 6h16M4 12h16M4 18h10"})}),"PRs"]}):null,ev||$?null:(0,r.jsx)(O,{orchestrators:U}),(0,r.jsx)(k.U,{})]})})]})]}),$?(0,r.jsxs)("section",{className:"mobile-priority-row","aria-label":"Needs attention",children:[(0,r.jsx)("div",{className:"mobile-priority-row__label",children:"Needs attention"}),(0,r.jsx)(K,{grouped:ew,onPillTap:eS})]}):null,$?(0,r.jsx)("section",{className:"mobile-filter-row","aria-label":"Dashboard filters",children:B.map(e=>(0,r.jsx)("button",{type:"button",className:"mobile-filter-chip","data-active":ea===e.value?"true":"false",onClick:()=>en(e.value),children:e.label},e.value))}):null,eA&&!S&&(0,r.jsxs)("div",{className:"dashboard-alert mb-6 flex items-center gap-2.5 border border-[color-mix(in_srgb,var(--color-status-attention)_25%,transparent)] bg-[var(--color-tint-yellow)] px-3.5 py-2.5 text-[11px] text-[var(--color-status-attention)]",children:[(0,r.jsxs)("svg",{className:"h-3.5 w-3.5 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),(0,r.jsx)("span",{className:"flex-1",children:"GitHub API rate limited — PR data (CI status, review state, sizes) may be stale. Will retry automatically on next refresh."}),(0,r.jsx)("button",{onClick:()=>R(!0),className:"ml-1 shrink-0 opacity-60 hover:opacity-100","aria-label":"Dismiss",children:(0,r.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),ev&&(0,r.jsx)(A,{overviews:eC,onSpawnOrchestrator:eF,spawningProjectIds:H,spawnErrors:G}),!ev&&eO&&(0,r.jsxs)("div",{className:"kanban-board-wrap",children:[(0,r.jsxs)("div",{className:"board-section-head",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"board-section-head__title",children:"Attention Board"}),(0,r.jsx)("p",{className:"board-section-head__subtitle",children:"Sessions sorted by what needs your attention."})]}),(0,r.jsxs)("div",{className:"board-section-head__legend",children:[(0,r.jsx)(Z,{label:"Human action",tone:"var(--color-status-error)"}),(0,r.jsx)(Z,{label:"Review queue",tone:"var(--color-accent-orange)"}),(0,r.jsx)(Z,{label:"Ready to land",tone:"var(--color-status-ready)"})]})]}),$?(0,r.jsx)("div",{id:"mobile-board",className:"accordion-board",children:eR.map(e=>(0,r.jsx)(b,{level:e,sessions:ew[e],onSend:eI,onKill:eE,onMerge:eD,onRestore:eU,collapsed:et!==e,onToggle:eM,compactMobile:!0,onPreview:eL,resetKey:ea},e))}):(0,r.jsx)("div",{className:"kanban-board",children:L.map(e=>(0,r.jsx)(b,{level:e,sessions:ew[e],onSend:eI,onKill:eE,onMerge:eD,onRestore:eU},e))})]}),!ev&&ew.done.length>0&&(0,r.jsxs)("div",{className:"done-bar mt-6",children:[(0,r.jsxs)("button",{type:"button",className:"done-bar__toggle",onClick:()=>em(e=>!e),"aria-expanded":eh,children:[(0,r.jsx)("svg",{className:"done-bar__chevron".concat(eh?" done-bar__chevron--open":""),fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m9 18 6-6-6-6"})}),(0,r.jsx)("span",{children:"Done / Terminated"}),(0,r.jsx)("span",{className:"done-bar__count",children:ew.done.length}),(0,r.jsx)("span",{className:"done-bar__rule","aria-hidden":"true"})]}),eh&&(0,r.jsx)("div",{className:"done-bar__cards",children:ew.done.map(e=>(0,r.jsx)(p,{session:e,onSend:eI,onKill:eE,onMerge:eD,onRestore:eU},e.id))})]}),!ev&&!eO&&0===ew.done.length&&(0,r.jsx)(w,{})]})]}),$?(0,r.jsx)(T.X,{ariaLabel:"Dashboard navigation",activeTab:"dashboard",dashboardHref:eg,prsHref:ef,showOrchestrator:!ev,orchestratorHref:ej}):null,$?(0,r.jsx)(P,{session:ek,mode:null!=(t=null==ei?void 0:ei.mode)?t:"preview",onConfirm:eB,onCancel:()=>ec(null),onRequestKill:eW,onMerge:eD,isMergeReady:null!=ek&&!!ek.pr&&(0,l.QN)(ek.pr)}):null]})}function F(e){return(0,r.jsx)(M,{children:(0,r.jsx)(U,{...e})})}function O(e){let{orchestrators:s}=e;if(0===s.length)return null;if(1===s.length){let e=s[0];return(0,r.jsxs)("a",{href:"/sessions/".concat(encodeURIComponent(e.id)),className:"orchestrator-btn flex items-center gap-2 px-4 py-2 text-[12px] font-semibold hover:no-underline",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--color-accent)] opacity-80"}),"orchestrator",(0,r.jsx)("svg",{className:"h-3 w-3 opacity-70",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6M15 3h6v6M10 14L21 3"})})]})}return(0,r.jsxs)("details",{className:"group relative",children:[(0,r.jsxs)("summary",{className:"orchestrator-btn flex cursor-pointer list-none items-center gap-2 px-4 py-2 text-[12px] font-semibold hover:no-underline",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--color-accent)] opacity-80"}),s.length," orchestrators",(0,r.jsx)("svg",{className:"h-3 w-3 opacity-70 transition-transform group-open:rotate-90",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"m9 18 6-6-6-6"})})]}),(0,r.jsx)("div",{className:"absolute right-0 top-[calc(100%+0.5rem)] z-10 min-w-[220px] overflow-hidden border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] shadow-[0_18px_40px_rgba(0,0,0,0.18)]",children:s.map((e,s)=>(0,r.jsxs)("a",{href:"/sessions/".concat(encodeURIComponent(e.id)),className:"flex items-center justify-between gap-3 px-4 py-3 text-[12px] hover:bg-[var(--color-bg-hover)] hover:no-underline ".concat(s>0?"border-t border-[var(--color-border-subtle)]":""),children:[(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-2 text-[var(--color-text-primary)]",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[var(--color-accent)] opacity-80"}),(0,r.jsx)("span",{className:"truncate",children:e.projectName})]}),(0,r.jsx)("svg",{className:"h-3 w-3 shrink-0 opacity-60",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6M15 3h6v6M10 14L21 3"})})]},e.id))})]})}function A(e){let{overviews:s,onSpawnOrchestrator:t,spawningProjectIds:a,spawnErrors:n}=e;return(0,r.jsx)("div",{className:"mb-8 grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:s.map(e=>{let{project:s,orchestrator:o,sessionCount:l,openPRCount:i,counts:c}=e;return(0,r.jsxs)("section",{className:"border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] p-4",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-[14px] font-semibold text-[var(--color-text-primary)]",children:s.name}),(0,r.jsxs)("div",{className:"mt-1 text-[11px] text-[var(--color-text-muted)]",children:[l," active session",1!==l?"s":"",i>0?" \xb7 ".concat(i," open PR").concat(1!==i?"s":""):""]})]}),(0,r.jsx)("a",{href:"/?project=".concat(encodeURIComponent(s.id)),className:"border border-[var(--color-border-default)] px-3 py-1.5 text-[11px] font-medium text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:no-underline",children:"Open project"})]}),(0,r.jsxs)("div",{className:"mb-4 flex flex-wrap gap-2",children:[(0,r.jsx)(H,{label:"Merge",value:c.merge,tone:"var(--color-status-ready)"}),(0,r.jsx)(H,{label:"Respond",value:c.respond,tone:"var(--color-status-error)"}),(0,r.jsx)(H,{label:"Review",value:c.review,tone:"var(--color-accent-orange)"}),(0,r.jsx)(H,{label:"Pending",value:c.pending,tone:"var(--color-status-attention)"}),(0,r.jsx)(H,{label:"Working",value:c.working,tone:"var(--color-status-working)"})]}),(0,r.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("div",{className:"text-[11px] text-[var(--color-text-muted)]",children:o?"Per-project orchestrator available":"No running orchestrator"}),o?(0,r.jsxs)("a",{href:"/sessions/".concat(encodeURIComponent(o.id)),className:"orchestrator-btn flex items-center gap-2 px-3 py-1.5 text-[11px] font-semibold hover:no-underline",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--color-accent)] opacity-80"}),"orchestrator"]}):(0,r.jsx)("button",{type:"button",onClick:()=>void t(s),disabled:a.includes(s.id),className:"orchestrator-btn px-3 py-1.5 text-[11px] font-semibold disabled:cursor-wait disabled:opacity-70",children:a.includes(s.id)?"Spawning...":"Spawn Orchestrator"})]}),n[s.id]?(0,r.jsx)("p",{className:"mt-2 text-[11px] text-[var(--color-status-error)]",children:n[s.id]}):null]})]},s.id)})})}function H(e){let{label:s,value:t,tone:a}=e;return(0,r.jsxs)("div",{className:"min-w-[78px] border border-[var(--color-border-subtle)] px-2.5 py-2",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-[0.08em] text-[var(--color-text-tertiary)]",children:s}),(0,r.jsx)("div",{className:"mt-1 text-[18px] font-semibold tabular-nums",style:{color:a},children:t})]})}let q=[{level:"respond",label:"respond",color:"var(--color-status-error)"},{level:"merge",label:"merge",color:"var(--color-status-ready)"},{level:"review",label:"review",color:"var(--color-accent-orange)"}];function K(e){let{grouped:s,onPillTap:t}=e,a=q.filter(e=>{let{level:t}=e;return s[t].length>0});return 0===a.length?(0,r.jsx)("div",{role:"status",className:"mobile-action-strip mobile-action-strip--all-good",children:(0,r.jsx)("span",{className:"mobile-action-strip__all-good",children:"All clear — agents are working"})}):(0,r.jsx)("div",{className:"mobile-action-strip",role:"group","aria-label":"Session priorities",children:a.map(e=>{let{level:a,label:n,color:o}=e;return(0,r.jsxs)("button",{type:"button",className:"mobile-action-pill",onClick:()=>t(a),"aria-label":"".concat(s[a].length," ").concat(n," — scroll to section"),children:[(0,r.jsx)("span",{className:"mobile-action-pill__dot",style:{background:o},"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mobile-action-pill__count",style:{color:o},children:s[a].length}),(0,r.jsx)("span",{className:"mobile-action-pill__label",children:n})]},a)})})}function V(e){let{stats:s}=e;if(0===s.totalSessions)return(0,r.jsx)("div",{className:"dashboard-stat-cards",children:(0,r.jsxs)("div",{className:"dashboard-stat-card dashboard-stat-card--empty",children:[(0,r.jsx)("span",{className:"dashboard-stat-card__label",children:"Fleet"}),(0,r.jsx)("span",{className:"dashboard-stat-card__value",children:"0"}),(0,r.jsx)("span",{className:"dashboard-stat-card__meta",children:"No live sessions"})]})});let t=[{value:s.totalSessions,label:"Fleet",meta:"Live sessions"},{value:s.workingSessions,label:"Active",meta:"Currently moving",tone:"var(--color-status-working)"},{value:s.openPRs,label:"PRs",meta:"Open pull requests"},{value:s.needsReview,label:"Review",meta:"Awaiting eyes",tone:"var(--color-status-attention)"}];return(0,r.jsx)("div",{className:"dashboard-stat-cards",children:t.map(e=>{var s;return(0,r.jsxs)("div",{className:"dashboard-stat-card",children:[(0,r.jsx)("span",{className:"dashboard-stat-card__value",style:{color:null!=(s=e.tone)?s:"var(--color-text-primary)"},children:e.value}),(0,r.jsx)("span",{className:"dashboard-stat-card__label",children:e.label}),(0,r.jsx)("span",{className:"dashboard-stat-card__meta",children:e.meta})]},e.label)})})}function Z(e){let{label:s,tone:t}=e;return(0,r.jsxs)("span",{className:"board-legend-item",children:[(0,r.jsx)("span",{className:"board-legend-item__dot",style:{background:t}}),s]})}},2036:(e,s,t)=>{Promise.resolve().then(t.bind(t,46))}},e=>{e.O(0,[7505,3698,1250,4429,8597,7358],()=>e(e.s=2036)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6450],{4224:(e,s,r)=>{Promise.resolve().then(r.bind(r,8475))},8475:(e,s,r)=>{"use strict";r.d(s,{PullRequestsPage:()=>b});var t=r(6409),a=r(4669),l=r(9730),o=r(7064),c=r(777),d=r(53),n=r(2132),i=r(3292),x=r(8400),h=r(9629),p=r(5729),m=r(277);let u=[];function b(e){let{initialSessions:s,projectId:r,projectName:b,projects:j=[],orchestrators:v}=e,N=null!=v?v:u,f=(0,a.useMemo)(()=>{let e={};for(let r of s)e[r.id]=(0,c.ng)(r);return e},[s]),{sessions:g,sseAttentionLevels:_}=(0,d.D)(s,r,f),w=(0,l.useSearchParams)(),[y,k]=(0,a.useState)(!1),[P,R]=(0,a.useState)(!1),C=(0,o.U)(o.D),M=j.length>1,O=M&&void 0===r,q=(0,a.useMemo)(()=>{var e;return r&&null!=(e=N.find(e=>e.projectId===r))?e:null},[N,r]),I=(0,a.useMemo)(()=>g.filter(e=>{var s;return(null==(s=e.pr)?void 0:s.state)==="open"}).map(e=>e.pr).sort((e,s)=>e.number-s.number),[g]),S=(0,m.Jy)("/",r),E=(0,m.Jy)("/prs",r),U=q?"/sessions/".concat(encodeURIComponent(q.id)):null;return(0,a.useEffect)(()=>{R(!1)},[w]),(0,t.jsxs)("div",{className:"dashboard-shell flex h-screen",children:[M?(0,t.jsx)(n.u,{projects:j,sessions:g,activeProjectId:r,activeSessionId:void 0,collapsed:y,onToggleCollapsed:()=>k(e=>!e),mobileOpen:P,onMobileClose:()=>R(!1)}):null,(0,t.jsxs)("div",{className:"dashboard-main flex-1 overflow-y-auto px-4 py-4 md:px-7 md:py-6",children:[(0,t.jsx)(x.u,{sseAttentionLevels:_,projectName:b?"".concat(b," PRs"):"Pull Requests"}),(0,t.jsxs)("section",{className:"dashboard-hero mb-5",children:[(0,t.jsx)("div",{className:"dashboard-hero__backdrop"}),(0,t.jsxs)("div",{className:"dashboard-hero__content",children:[M?(0,t.jsx)("button",{type:"button",className:"mobile-menu-toggle",onClick:()=>R(!0),"aria-label":"Open menu",children:(0,t.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-5 w-5",children:(0,t.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})})}):null,(0,t.jsxs)("div",{className:"dashboard-hero__primary",children:[(0,t.jsx)("div",{className:"dashboard-hero__heading",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"dashboard-title",children:b?"".concat(b," PRs"):"Pull Requests"}),(0,t.jsxs)("p",{className:"dashboard-subtitle",children:["Open pull requests created by agents",O?" across all projects":" in this project","."]})]})}),(0,t.jsx)("div",{className:"dashboard-stat-cards dashboard-stat-cards--persist-mobile",children:(0,t.jsxs)("div",{className:"dashboard-stat-card",children:[(0,t.jsx)("span",{className:"dashboard-stat-card__value",children:I.length}),(0,t.jsx)("span",{className:"dashboard-stat-card__label",children:"Open PRs"}),(0,t.jsx)("span",{className:"dashboard-stat-card__meta",children:O?"Across all projects":"In this project"})]})})]}),(0,t.jsx)("div",{className:"dashboard-hero__meta",children:(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsx)(i.U,{})})})]})]}),(0,t.jsxs)("section",{className:"mx-auto max-w-[900px]",children:[(0,t.jsx)("h2",{className:"mb-3 px-1 text-[10px] font-bold uppercase tracking-[0.10em] text-[var(--color-text-tertiary)]",children:"Pull Requests"}),0===I.length?(0,t.jsx)("div",{className:"border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-4 py-6 text-[12px] text-[var(--color-text-secondary)]",children:"No open pull requests right now."}):C?(0,t.jsx)("div",{className:"mobile-pr-list",children:I.map(e=>(0,t.jsx)(h.dG,{pr:e},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))}):(0,t.jsx)("div",{className:"overflow-hidden border border-[var(--color-border-default)]",children:(0,t.jsxs)("table",{className:"w-full border-collapse",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-[var(--color-border-muted)]",children:[(0,t.jsx)("th",{className:"px-3 py-2 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"PR"}),(0,t.jsx)("th",{className:"px-3 py-2 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Title"}),(0,t.jsx)("th",{className:"px-3 py-2 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Size"}),(0,t.jsx)("th",{className:"px-3 py-2 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"CI"}),(0,t.jsx)("th",{className:"px-3 py-2 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Review"}),(0,t.jsx)("th",{className:"px-3 py-2 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-muted)]",children:"Unresolved"})]})}),(0,t.jsx)("tbody",{children:I.map(e=>(0,t.jsx)(h.j6,{pr:e},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))})]})})]})]}),C?(0,t.jsx)(p.X,{ariaLabel:"PR navigation",activeTab:"prs",dashboardHref:S,prsHref:E,showOrchestrator:!O,orchestratorHref:U}):null]})}}},e=>{e.O(0,[7505,3698,1250,4429,8597,7358],()=>e(e.s=4224)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4097],{6901:(e,r,o)=>{"use strict";o.d(r,{ErrorDisplay:()=>i});var t=o(6409),a=o(7505),n=o.n(a);let s={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 l(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 c(e){let{action:r,primary:o=!1}=e,a=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",s=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 r.href?(0,t.jsx)(n(),{href:r.href,className:a,style:s,children:r.label}):(0,t.jsx)("button",{type:"button",onClick:r.onClick,className:a,style:s,children:r.label})}function i(e){let{title:r,message:o,tone:a="error",detailsTitle:n="Technical details",error:i,primaryAction:d,secondaryAction:u,compact:x=!1,chrome:m="page",children:b}=e,h=s[a],v=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,t.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,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)(l,{accent:h.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:h.accent,background:h.bg,borderColor:h.border},children:h.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:o})]})]}),(d||u)&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,t.jsx)(c,{action:d,primary:!0}):null,u?(0,t.jsx)(c,{action:u}):null]}),b,v?(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==i?void 0:i.digest)?(0,t.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,t.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,t.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]})})})}},6974:(e,r,o)=>{"use strict";o.r(r),o.d(r,{default:()=>l});var t=o(6409),a=o(9730),n=o(4669),s=o(6901);function l(e){let{error:r,reset:o}=e,l=(0,a.useRouter)();return(0,n.useEffect)(()=>{console.error(r)},[r]),(0,t.jsx)(s.ErrorDisplay,{title:"Failed to load session",message:function(e){let r=e.message.toLowerCase();return r.includes("network")?"The session request failed before the dashboard got a response. Check the server connection and try again.":r.includes("403")?"The dashboard could not access this session. Permissions or auth may have changed.":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 re-fetching the session data.":"The dashboard could not load this session cleanly. Try again to re-fetch the latest state."}(r),tone:"error",primaryAction:{label:"Try again",onClick:()=>{o(),l.refresh()}},secondaryAction:{label:"Back to dashboard",href:"/"},error:r,compact:!0,chrome:"card"})}},7581:(e,r,o)=>{Promise.resolve().then(o.bind(o,6974))},9730:(e,r,o)=>{"use strict";var t=o(3814);o.o(t,"notFound")&&o.d(r,{notFound:function(){return t.notFound}}),o.o(t,"useParams")&&o.d(r,{useParams:function(){return t.useParams}}),o.o(t,"usePathname")&&o.d(r,{usePathname:function(){return t.usePathname}}),o.o(t,"useRouter")&&o.d(r,{useRouter:function(){return t.useRouter}}),o.o(t,"useSearchParams")&&o.d(r,{useSearchParams:function(){return t.useSearchParams}})}},e=>{e.O(0,[7505,4429,8597,7358],()=>e(e.s=7581)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1337,1762,1797,2007,2079,2438,2985,3675,4209,5214,6681,6849,6865,6946,6999,7462,8301,8581,9002,9492],{2015:()=>{}},_=>{_.O(0,[4429,8597,7358],()=>_(_.s=2015)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[824],{369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return a.workAsyncStorageInstance}});let a=r(6810)},2666:(e,t,r)=>{Promise.resolve().then(r.bind(r,7242))},5752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let a=r(7999)._(r(6720));function s(e,t){var r;let s={};"function"==typeof e&&(s.loader=e);let n={...s,...t};return(0,a.default)({...n,modules:null==(r=n.loadableGenerated)?void 0:r.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5995:(e,t,r)=>{"use strict";r.d(t,{default:()=>s.a});var a=r(5752),s=r.n(a)},6703:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return n},createSnapshot:function(){return o}});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class a{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let s="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function n(){return s?new s:new a}function l(e){return s?s.bind(e):a.bind(e)}function o(){return s?s.snapshot():function(e,...t){return e(...t)}}},6720:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let a=r(6409),s=r(4669),n=r(8839);function l(e){return{default:e&&"default"in e?e.default:e}}r(8442);let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},c=function(e){let t={...o,...e},r=(0,s.lazy)(()=>t.loader().then(l)),c=t.loading;function i(e){let l=c?(0,a.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,i=o?s.Suspense:s.Fragment,d=t.ssr?(0,a.jsxs)(a.Fragment,{children:[null,(0,a.jsx)(r,{...e})]}):(0,a.jsx)(n.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(r,{...e})});return(0,a.jsx)(i,{...o?{fallback:l}:{},children:d})}return i.displayName="LoadableComponent",i}},6810:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return a}});let a=(0,r(6703).createAsyncLocalStorage)()},7242:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>k});var a=r(6409),s=r(4669),n=r(9730),l=r(3585),o=r(7064),c=r(777),i=r(4477),d=r(5995),u=r(7843),p=r(4434),x=r(5729);let m=(0,d.default)(()=>Promise.all([r.e(1052),r.e(6381)]).then(r.bind(r,8762)).then(e=>({default:e.DirectTerminal})),{loadableGenerated:{webpack:()=>[8762]},ssr:!1,loading:()=>(0,a.jsx)("div",{className:"h-[440px] animate-pulse rounded bg-[var(--color-bg-primary)]"})}),h={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 f(e){if(e.includes("\x3c!-- DESCRIPTION START --\x3e")||e.includes("### ")){let t=e.match(/###\s+(.+?)(?:\n|$)/),r=t?t[1].replace(/\*\*/g,"").trim():"Comment",a=e.match(/<!-- DESCRIPTION START -->\s*([\s\S]*?)\s*<!-- DESCRIPTION END -->/);return{title:r,description:a?a[1].trim():e.split("\n")[0]||"No description"}}return{title:"Comment",description:e.trim()}}function v(e){let{headline:t,activityLabel:r,activityColor:s,branch:n,pr:l,isOrchestrator:o=!1,crumbHref:c,crumbLabel:d,mobileSimple:u=!1,rightSlot:p}=e;return(0,a.jsxs)("section",{className:"session-page-header".concat(u?" session-page-header--mobile":""),children:[(0,a.jsxs)("div",{className:"session-page-header__crumbs",children:[(0,a.jsxs)("a",{href:c,className:"flex items-center gap-1 text-[11px] font-medium text-[var(--color-text-secondary)] transition-colors hover:text-[var(--color-text-primary)] hover:no-underline",children:[(0,a.jsx)("svg",{className:"h-3 w-3 opacity-60",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M15 18l-6-6 6-6"})}),d]}),(0,a.jsx)("span",{className:"text-[var(--color-border-strong)]",children:"/"}),u?null:(0,a.jsx)("span",{className:"font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:t}),o&&!u?(0,a.jsx)("span",{className:"session-page-header__mode",children:"orchestrator"}):null]}),(0,a.jsxs)("div",{className:"session-page-header__main",children:[(0,a.jsxs)("div",{className:"session-page-header__identity",children:[(0,a.jsx)("h1",{className:"truncate text-[17px] font-semibold tracking-[-0.03em] text-[var(--color-text-primary)]",children:t}),(0,a.jsxs)("div",{className:"session-page-header__meta",children:[(0,a.jsxs)("div",{className:(0,i.cn)("session-detail-status-pill flex items-center gap-1.5 border px-2.5 py-1",function(e){let t=e.toLowerCase();return"active"===t?"session-detail-status-pill--active":"ready"===t?"session-detail-status-pill--ready":"idle"===t?"session-detail-status-pill--idle":"waiting for input"===t?"session-detail-status-pill--waiting":"blocked"===t||"exited"===t?"session-detail-status-pill--error":"session-detail-status-pill--neutral"}(r)),style:{background:"color-mix(in srgb, ".concat(s," 12%, transparent)"),border:"1px solid color-mix(in srgb, ".concat(s," 20%, transparent)")},children:[(0,a.jsx)("span",{className:"session-detail-status-pill__dot h-1.5 w-1.5 shrink-0",style:{background:s}}),(0,a.jsx)("span",{className:"text-[11px] font-semibold",style:{color:s},children:r})]}),n?l?(0,a.jsx)("a",{href:"https://github.com/".concat(l.owner,"/").concat(l.repo,"/tree/").concat(l.branch),target:"_blank",rel:"noopener noreferrer",className:"session-detail-link-pill session-detail-link-pill--link font-[var(--font-mono)] text-[10px] hover:no-underline",children:n}):(0,a.jsx)("span",{className:"session-detail-link-pill font-[var(--font-mono)] text-[10px]",children:n}):null,l?(0,a.jsxs)("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",className:"session-detail-link-pill session-detail-link-pill--link session-detail-link-pill--accent hover:no-underline",children:["PR #",l.number]}):null]})]}),p?(0,a.jsx)("div",{className:"session-page-header__side",children:p}):null]})]})}async function b(e,t,r,a){try{let{title:a,description:s}=f(t.body),n="Please address this review comment:\n\nFile: ".concat(t.path,"\nComment: ").concat(a,"\nDescription: ").concat(s,"\n\nComment URL: ").concat(t.url,"\n\nAfter fixing, mark the comment as resolved at ").concat(t.url),l=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:n})});if(!l.ok)throw Error("HTTP ".concat(l.status));r()}catch(e){console.error("Failed to send message to agent:",e),a()}}function g(e){let{zones:t,createdAt:r,headline:n,activityLabel:l,activityColor:o,branch:c,pr:i,crumbHref:d,crumbLabel:u}=e,[p,x]=(0,s.useState)("");(0,s.useEffect)(()=>{let e=()=>{let e=Date.now()-new Date(r).getTime(),t=Math.floor(e/36e5),a=Math.floor(e%36e5/6e4);x(t>0?"".concat(t,"h ").concat(a,"m"):"".concat(a,"m"))};e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[r]);let m=[{value:t.merge,label:"merge-ready",color:"#3fb950",bg:"rgba(63,185,80,0.1)"},{value:t.respond,label:"responding",color:"#f85149",bg:"rgba(248,81,73,0.1)"},{value:t.review,label:"review",color:"#d18616",bg:"rgba(209,134,22,0.1)"},{value:t.working,label:"working",color:"#58a6ff",bg:"rgba(88,166,255,0.1)"},{value:t.pending,label:"pending",color:"#d29922",bg:"rgba(210,153,34,0.1)"},{value:t.done,label:"done",color:"#484f58",bg:"rgba(72,79,88,0.15)"}].filter(e=>e.value>0),h=t.merge+t.respond+t.review+t.working+t.pending+t.done;return(0,a.jsx)("div",{className:"mx-auto max-w-[1180px] px-5 pt-5 lg:px-8",children:(0,a.jsx)(v,{headline:n,activityLabel:l,activityColor:o,branch:c,pr:i,isOrchestrator:!0,crumbHref:d,crumbLabel:u,rightSlot:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 lg:justify-end",children:[(0,a.jsxs)("div",{className:"flex items-baseline gap-1.5 mr-2",children:[(0,a.jsx)("span",{className:"text-[22px] font-bold leading-none tabular-nums text-[var(--color-text-primary)]",children:h}),(0,a.jsx)("span",{className:"text-[11px] text-[var(--color-text-tertiary)]",children:"agents"})]}),(0,a.jsx)("div",{className:"h-5 w-px bg-[var(--color-border-subtle)] mr-1"}),m.length>0?m.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1.5 px-2.5 py-1",style:{background:e.bg},children:[(0,a.jsx)("span",{className:"text-[15px] font-bold leading-none tabular-nums",style:{color:e.color},children:e.value}),(0,a.jsx)("span",{className:"text-[10px] font-medium",style:{color:e.color,opacity:.8},children:e.label})]},e.label)):(0,a.jsx)("span",{className:"text-[12px] text-[var(--color-text-tertiary)]",children:"no active agents"}),p&&(0,a.jsxs)("span",{className:"ml-auto font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["up ",p]})]})})})}function y(e){var t,r;let{session:l,isOrchestrator:c=!1,orchestratorZones:i,projectOrchestratorId:d=null}=e,p=(0,n.useSearchParams)(),f=(0,o.U)(o.D),b="true"===p.get("fullscreen"),y=l.pr,N=null!=(r=l.activity&&h[l.activity])?r:{label:null!=(t=l.activity)?t:"unknown",color:"var(--color-text-muted)"},w=(0,u.P)(l),k=c?"orchestrator":"agent",S=c?"clamp(560px, 76vh, 920px)":"clamp(520px, 72vh, 860px)",C="opencode"===l.metadata.agent,_="string"==typeof l.metadata.opencodeSessionId&&l.metadata.opencodeSessionId.length>0?l.metadata.opencodeSessionId:void 0,I=l.projectId?"/?project=".concat(encodeURIComponent(l.projectId)):"/",P=l.projectId?"/prs?project=".concat(encodeURIComponent(l.projectId)):"/prs",T=c?"Orchestrator":"Dashboard",O=(0,s.useMemo)(()=>c?"/sessions/".concat(encodeURIComponent(l.id)):d?"/sessions/".concat(encodeURIComponent(d)):null,[c,d,l.id]);return(0,a.jsxs)("div",{className:"session-detail-page min-h-screen bg-[var(--color-bg-base)]",children:[c&&i&&!f&&(0,a.jsx)(g,{zones:i,createdAt:l.createdAt,headline:w,activityLabel:N.label,activityColor:N.color,branch:l.branch,pr:y,crumbHref:I,crumbLabel:T}),(0,a.jsx)("div",{className:"dashboard-main mx-auto max-w-[1180px] px-5 py-5 lg:px-8",children:(0,a.jsxs)("main",{className:"min-w-0",children:[(!c||f)&&(0,a.jsx)(v,{headline:w,activityLabel:N.label,activityColor:N.color,branch:l.branch,pr:y,isOrchestrator:c,crumbHref:I,crumbLabel:T,mobileSimple:f}),(0,a.jsxs)("section",{className:"mt-5",children:[(0,a.jsx)("div",{id:"session-terminal-section","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,a.jsx)("div",{className:"h-3 w-0.5",style:{background:c?"var(--color-accent)":N.color,opacity:.75}}),(0,a.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.1em] text-[var(--color-text-tertiary)]",children:"Live Terminal"})]}),(0,a.jsx)(m,{sessionId:l.id,startFullscreen:b,variant:k,height:S,isOpenCodeSession:C,reloadCommand:C&&_?"/exit\nopencode --session ".concat(_,"\n"):void 0})]}),y?(0,a.jsx)("section",{id:"session-pr-section",className:"mt-6",children:(0,a.jsx)(j,{pr:y,sessionId:l.id,metadata:l.metadata})}):null]})}),f?(0,a.jsx)(x.X,{ariaLabel:"Session navigation",activeTab:c?"orchestrator":void 0,dashboardHref:I,prsHref:P,showOrchestrator:null!==O,orchestratorHref:O}):null]})}function j(e){let{pr:t,sessionId:r,metadata:n}=e,[l,o]=(0,s.useState)(new Set),[d,u]=(0,s.useState)(new Set),[x,m]=(0,s.useState)(new Set),h=(0,s.useRef)(new Map);(0,s.useEffect)(()=>()=>{h.current.forEach(e=>clearTimeout(e)),h.current.clear()},[]);let v=async e=>{u(t=>{let r=new Set(t);return r.delete(e.url),r}),m(t=>{let r=new Set(t);return r.delete(e.url),r}),o(t=>new Set(t).add(e.url)),await b(r,e,()=>{o(t=>{let r=new Set(t);return r.delete(e.url),r}),u(t=>new Set(t).add(e.url));let t=h.current.get(e.url);t&&clearTimeout(t);let r=setTimeout(()=>{u(t=>{let r=new Set(t);return r.delete(e.url),r}),h.current.delete(e.url)},3e3);h.current.set(e.url,r)},()=>{o(t=>{let r=new Set(t);return r.delete(e.url),r}),m(t=>new Set(t).add(e.url));let t=h.current.get(e.url);t&&clearTimeout(t);let r=setTimeout(()=>{m(t=>{let r=new Set(t);return r.delete(e.url),r}),h.current.delete(e.url)},3e3);h.current.set(e.url,r)})},g=(0,c.QN)(t),y=t.ciChecks.filter(e=>"failed"===e.status),j=g?"rgba(63,185,80,0.4)":"merged"===t.state?"rgba(163,113,247,0.3)":"var(--color-border-default)";return(0,a.jsxs)("div",{className:"detail-card mb-6 overflow-hidden border",style:{borderColor:j},children:[(0,a.jsxs)("div",{className:"border-b border-[var(--color-border-subtle)] px-5 py-3.5",children:[(0,a.jsxs)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-[13px] font-semibold text-[var(--color-text-primary)] transition-colors hover:text-[var(--color-accent)] hover:no-underline",children:["PR #",t.number,": ",t.title]}),(0,a.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 text-[11px]",children:[(0,a.jsxs)("span",{children:[(0,a.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",t.additions]})," ",(0,a.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",t.deletions]})]}),t.isDraft&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-[var(--color-text-tertiary)]",children:"\xb7"}),(0,a.jsx)("span",{className:"font-medium text-[var(--color-text-tertiary)]",children:"Draft"})]}),"merged"===t.state&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-[var(--color-text-tertiary)]",children:"\xb7"}),(0,a.jsx)("span",{className:"px-2 py-0.5 text-[10px] font-semibold",style:{color:"var(--color-text-secondary)",background:"var(--color-chip-bg)"},children:"Merged"})]})]})]}),(0,a.jsxs)("div",{className:"px-5 py-4",children:[g?(0,a.jsxs)("div",{className:"flex items-center gap-2 border border-[rgba(63,185,80,0.25)] bg-[rgba(63,185,80,0.07)] px-3.5 py-2.5",children:[(0,a.jsx)("svg",{className:"h-4 w-4 shrink-0 text-[var(--color-status-ready)]",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})}),(0,a.jsx)("span",{className:"text-[13px] font-semibold text-[var(--color-status-ready)]",children:"Ready to merge"})]}):(0,a.jsx)(N,{pr:t,metadata:n}),t.ciChecks.length>0&&(0,a.jsx)("div",{className:"mt-4 border-t border-[var(--color-border-subtle)] pt-4",children:(0,a.jsx)(p.zm,{checks:t.ciChecks,layout:y.length>0?"expanded":"inline"})}),t.unresolvedComments.length>0&&(0,a.jsxs)("div",{className:"mt-4 border-t border-[var(--color-border-subtle)] pt-4",children:[(0,a.jsxs)("h4",{className:"mb-2.5 flex items-center gap-2 text-[10px] font-bold uppercase tracking-[0.08em] text-[var(--color-text-tertiary)]",children:["Unresolved Comments",(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-bold normal-case tracking-normal",style:{color:"#f85149",background:"rgba(248,81,73,0.12)"},children:t.unresolvedThreads})]}),(0,a.jsx)("div",{className:"space-y-1",children:t.unresolvedComments.map(e=>{let{title:t,description:r}=f(e.body);return(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-2 py-1.5 text-[12px] transition-colors hover:bg-[rgba(255,255,255,0.04)]",children:[(0,a.jsx)("svg",{className:"h-3 w-3 shrink-0 text-[var(--color-text-tertiary)] transition-transform group-open:rotate-90",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M9 5l7 7-7 7"})}),(0,a.jsx)("span",{className:"font-medium text-[var(--color-text-secondary)]",children:t}),(0,a.jsxs)("span",{className:"text-[var(--color-text-tertiary)]",children:["\xb7 ",e.author]}),(0,a.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"ml-auto text-[10px] text-[var(--color-accent)] hover:underline",children:"view →"})]}),(0,a.jsxs)("div",{className:"ml-5 mt-1 space-y-1.5 px-2 pb-2",children:[(0,a.jsx)("div",{className:"font-[var(--font-mono)] text-[10px] text-[var(--color-text-tertiary)]",children:e.path}),(0,a.jsx)("p",{className:"border-l-2 border-[var(--color-border-default)] pl-3 text-[12px] leading-relaxed text-[var(--color-text-secondary)]",children:r}),(0,a.jsx)("button",{onClick:()=>v(e),disabled:l.has(e.url),className:(0,i.cn)("mt-1.5 px-3 py-1 text-[11px] font-semibold transition-colors duration-150",d.has(e.url)?"bg-[var(--color-status-ready)] text-white":x.has(e.url)?"bg-[var(--color-status-error)] text-white":"bg-[var(--color-accent)] text-white hover:opacity-90 disabled:opacity-50"),children:l.has(e.url)?"Sending…":d.has(e.url)?"Sent ✓":x.has(e.url)?"Failed":"Ask Agent to Fix"})]})]},e.url)})})]})]})]})}function N(e){let{pr:t,metadata:r}=e,s=[],n=!!r.lastCIFailureDispatchHash,o="true"===r.lastMergeConflictDispatched,c=!!r.lastPendingReviewDispatchHash,i=r.status,d=t.ciStatus===l.U1.FAILING||"ci_failed"===i,u="changes_requested"===t.reviewDecision||"changes_requested"===i,p="merged"!==t.state&&!t.mergeability.noConflicts;if(d){let e=t.ciChecks.filter(e=>"failed"===e.status).length;s.push({icon:"✗",color:"var(--color-status-error)",text:e>0?"CI failing — ".concat(e," check").concat(1!==e?"s":""," failed"):"CI failing",notified:n})}else t.ciStatus===l.U1.PENDING&&s.push({icon:"●",color:"var(--color-status-attention)",text:"CI pending"});return(u?s.push({icon:"✗",color:"var(--color-status-error)",text:"Changes requested",notified:c}):t.mergeability.approved||s.push({icon:"○",color:"var(--color-text-tertiary)",text:"Not approved — awaiting reviewer"}),p&&s.push({icon:"✗",color:"var(--color-status-error)",text:"Merge conflicts",notified:o}),t.mergeability.mergeable||0!==s.length||s.push({icon:"○",color:"var(--color-text-tertiary)",text:"Not mergeable"}),t.unresolvedThreads>0&&s.push({icon:"●",color:"var(--color-status-attention)",text:"".concat(t.unresolvedThreads," unresolved comment").concat(1!==t.unresolvedThreads?"s":"")}),t.isDraft&&s.push({icon:"○",color:"var(--color-text-tertiary)",text:"Draft PR"}),0===s.length)?null:(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("h4",{className:"mb-2 text-[10px] font-bold uppercase tracking-[0.08em] text-[var(--color-text-tertiary)]",children:"Blockers"}),s.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2.5 text-[12px]",children:[(0,a.jsx)("span",{className:"w-3 shrink-0 text-center text-[11px]",style:{color:e.color},children:e.icon}),(0,a.jsx)("span",{className:"text-[var(--color-text-secondary)]",children:e.text}),e.notified&&(0,a.jsx)("span",{className:"text-[10px] text-[var(--color-text-tertiary)]",children:"\xb7 agent notified"})]},e.text))]})}let w={active:"⚡",ready:"\uD83D\uDFE2",idle:"\uD83D\uDCA4",waiting_input:"❓",blocked:"\uD83D\uDEA7",exited:"\uD83D\uDC80"};function k(){var e;let t=(0,n.useParams)().id,[r,o]=(0,s.useState)(null),[i,d]=(0,s.useState)(null),[p,x]=(0,s.useState)(void 0),[m,h]=(0,s.useState)(!0),[f,v]=(0,s.useState)(null),[b,g]=(0,s.useState)(!1),[j,N]=(0,s.useState)(new Map),k=null!=(e=null==r?void 0:r.projectId)?e:null,S=[...j.values()],C=!!r&&(0,l.tT)(r,j.get(r.projectId),S),_=(0,s.useRef)(null),I=(0,s.useRef)(!1),P=(0,s.useRef)(null),T=(0,s.useRef)(new Map),O=(0,s.useRef)(!1);(0,s.useEffect)(()=>{T.current=j},[j]),(0,s.useEffect)(()=>{fetch("/api/projects").then(e=>e.ok?e.json():null).then(e=>{(null==e?void 0:e.projects)&&N(new Map(e.projects.map(e=>{var t;return[e.id,null!=(t=e.sessionPrefix)?t:e.id]})))}).catch(()=>{})},[]);let D=function(e,t){let[r,a]=(0,s.useState)(null);return(0,s.useEffect)(()=>{a(null);let t=new EventSource("/api/events"),r=!1;return t.onmessage=t=>{if(!r)try{let r=JSON.parse(t.data);if("snapshot"!==r.type)return;let s=r.sessions.find(t=>t.id===e);if(!s)return;a(e=>e&&e.activity===s.activity?e:{activity:s.activity})}catch(e){return}},()=>{r=!0,t.close()}},[e,void 0]),r}(t);(0,s.useEffect)(()=>{r?document.title=function(e,t,r){var a,s;let n,o=e.id,c=void 0!==r?r:e.activity,i=c&&null!=(a=w[c])?a:"",d=[...t.values()];return(0,l.tT)(e,t.get(e.projectId),d)?n="Orchestrator Terminal":(s=(0,u.P)(e),n=s.length>40?s.slice(0,40)+"...":s),i?"".concat(i," ").concat(o," | ").concat(n):"".concat(o," | ").concat(n)}(r,j,null==D?void 0:D.activity):document.title="".concat(t," | Session Detail")},[r,t,j,D]),(0,s.useEffect)(()=>{_.current=k},[k]),(0,s.useEffect)(()=>{I.current=C},[C]);let E=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/sessions/".concat(encodeURIComponent(t)));if(404===e.status){O.current||g(!0),h(!1);return}if(!e.ok)throw Error("HTTP ".concat(e.status));let r=await e.json();o(r),v(null),g(!1),O.current=!0}catch(e){console.error("Failed to fetch session:",e),O.current||v(e instanceof Error?e:Error("Failed to load session"))}finally{h(!1)}},[t]),R=(0,s.useCallback)(async()=>{let e=_.current;if(!e)return;let t=I.current,r="".concat(e,":").concat(t?"orchestrator":"worker");if(t||P.current!==r)try{var a,s,n,o,i;let u=t?"/api/sessions?project=".concat(encodeURIComponent(e)):"/api/sessions?project=".concat(encodeURIComponent(e),"&orchestratorOnly=true"),p=await fetch(u);if(!p.ok)return;let m=await p.json(),h=null!=(n=m.sessions)?n:[],f=null!=(i=null!=(o=m.orchestratorId)?o:null==(s=m.orchestrators)||null==(a=s.find(t=>t.projectId===e))?void 0:a.id)?i:null;if(x(e=>e===f?e:f),!t){P.current=r;return}let v={merge:0,respond:0,review:0,pending:0,working:0,done:0},b=[...T.current.values()];for(let e of h)!(0,l.tT)(e,T.current.get(e.projectId),b)&&v[(0,c.ng)(e)]++;d(v)}catch(e){}},[]);if((0,s.useEffect)(()=>{C||d(null)},[C]),(0,s.useEffect)(()=>{E();let e=setTimeout(R,2e3);return()=>clearTimeout(e)},[E,R]),(0,s.useEffect)(()=>{let e=setInterval(()=>{E(),R()},5e3);return()=>clearInterval(e)},[E,R]),m)return(0,a.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,a.jsx)("div",{className:"text-[13px] text-[var(--color-text-tertiary)]",children:"Loading session…"})});if(b)return(0,n.notFound)(),null;if(f)throw f;if(!r)throw Error("Session data was unavailable after loading completed");return(0,a.jsx)(y,{session:r,isOrchestrator:C,orchestratorZones:null!=i?i:void 0,projectOrchestratorId:p})}},8442:(e,t,r)=>{"use strict";function a(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return a}}),r(6409),r(4992),r(369),r(2376)},8839:(e,t,r)=>{"use strict";function a(e){let{reason:t,children:r}=e;return r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return a}}),r(987)}},e=>{e.O(0,[7505,3698,4429,8597,7358],()=>e(e.s=2666)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9495],{369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=r(6810)},1666:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u,dynamic:()=>i});var n=r(6409),s=r(5995),a=r(9730),l=r(4669);let o=(0,s.default)(()=>Promise.all([r.e(1052),r.e(8762)]).then(r.bind(r,8762)).then(e=>({default:e.DirectTerminal})),{loadableGenerated:{webpack:()=>[8762]},ssr:!1}),i="force-dynamic";function c(){let e=(0,a.useSearchParams)(),t="true"===e.get("fullscreen"),r=e.get("session")||"ao-orchestrator";return(0,n.jsx)("div",{className:"min-h-screen bg-[var(--color-bg-primary)] p-8",children:(0,n.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-[var(--color-text-primary)]",children:"DirectTerminal Test - XDA Clipboard Support"}),(0,n.jsxs)("p",{className:"mt-2 text-sm text-[var(--color-text-muted)]",children:["This terminal has XDA (Extended Device Attributes) handler registered.",(0,n.jsx)("br",{}),"tmux should recognize it as XTerm and enable clipboard support (OSC 52)."]}),(0,n.jsxs)("div",{className:"mt-4 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-4",children:[(0,n.jsxs)("h2",{className:"mb-2 text-sm font-semibold text-[var(--color-text-primary)]",children:["Testing: ",(0,n.jsx)("span",{className:"text-[var(--color-accent-green)]",children:r})]}),(0,n.jsx)("h2",{className:"mb-2 text-sm font-semibold text-[var(--color-text-primary)]",children:"Test Steps:"}),(0,n.jsxs)("ol",{className:"list-inside list-decimal space-y-1 text-sm text-[var(--color-text-muted)]",children:[(0,n.jsxs)("li",{children:["Connected to tmux session: ",r]}),(0,n.jsxs)("li",{children:["Verify XDA badge shows"," ",(0,n.jsx)("span",{className:"text-[var(--color-accent-green)]",children:"✓ XDA"})]}),(0,n.jsx)("li",{children:"Drag-select text in the terminal"}),(0,n.jsx)("li",{children:"Press Cmd+C (macOS) or Ctrl+C (Linux/Windows)"}),(0,n.jsx)("li",{children:"Paste elsewhere to verify clipboard works"}),(0,n.jsxs)("li",{children:[(0,n.jsx)("strong",{children:"Expected:"})," Clipboard works without iTerm2 attachment!"]})]})]}),(0,n.jsxs)("div",{className:"mt-4 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-4",children:[(0,n.jsx)("h2",{className:"mb-2 text-sm font-semibold text-[var(--color-text-primary)]",children:"Technical Details:"}),(0,n.jsxs)("ul",{className:"list-inside list-disc space-y-1 text-sm text-[var(--color-text-muted)]",children:[(0,n.jsx)("li",{children:"Registers CSI > q (XDA) handler in xterm.js parser"}),(0,n.jsx)("li",{children:"Responds with DCS > | XTerm(370) ST sequence"}),(0,n.jsx)("li",{children:'tmux detects "XTerm(" and enables TTYC_MS (clipboard capability)'}),(0,n.jsx)("li",{children:"OSC 52 sequences flow: tmux → WebSocket → xterm.js → navigator.clipboard"})]})]})]}),(0,n.jsx)(o,{sessionId:r,startFullscreen:t},"".concat(r,"-").concat(t?"fullscreen":"normal"))]})})}function u(){return(0,n.jsx)(l.Suspense,{fallback:(0,n.jsx)("div",{className:"flex min-h-screen items-center justify-center",children:"Loading..."}),children:(0,n.jsx)(c,{})})}},5752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let n=r(7999)._(r(6720));function s(e,t){var r;let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,n.default)({...a,modules:null==(r=a.loadableGenerated)?void 0:r.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5995:(e,t,r)=>{"use strict";r.d(t,{default:()=>s.a});var n=r(5752),s=r.n(n)},6703:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return a},createSnapshot:function(){return o}});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let s="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function a(){return s?new s:new n}function l(e){return s?s.bind(e):n.bind(e)}function o(){return s?s.snapshot():function(e,...t){return e(...t)}}},6720:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(6409),s=r(4669),a=r(8839);function l(e){return{default:e&&"default"in e?e.default:e}}r(8442);let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let t={...o,...e},r=(0,s.lazy)(()=>t.loader().then(l)),i=t.loading;function c(e){let l=i?(0,n.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,c=o?s.Suspense:s.Fragment,u=t.ssr?(0,n.jsxs)(n.Fragment,{children:[null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(c,{...o?{fallback:l}:{},children:u})}return c.displayName="LoadableComponent",c}},6810:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(6703).createAsyncLocalStorage)()},8442:(e,t,r)=>{"use strict";function n(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return n}}),r(6409),r(4992),r(369),r(2376)},8839:(e,t,r)=>{"use strict";function n(e){let{reason:t,children:r}=e;return r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return n}}),r(987)},9067:(e,t,r)=>{Promise.resolve().then(r.bind(r,1666))},9730:(e,t,r)=>{"use strict";var n=r(3814);r.o(n,"notFound")&&r.d(t,{notFound:function(){return n.notFound}}),r.o(n,"useParams")&&r.d(t,{useParams:function(){return n.useParams}}),r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})}},e=>{e.O(0,[4429,8597,7358],()=>e(e.s=9067)),_N_E=e.O()}]);