@aoagents/ao-web 0.2.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +296 -223
  3. package/.next/app-path-routes-manifest.json +16 -8
  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 +18 -18
  9. package/.next/required-server-files.json +9 -4
  10. package/.next/routes-manifest.json +33 -0
  11. package/.next/server/app/_not-found/page.js +2 -2
  12. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_not-found.html +1 -1
  15. package/.next/server/app/_not-found.rsc +15 -15
  16. package/.next/server/app/api/backlog/route.js +1 -1
  17. package/.next/server/app/api/backlog/route.js.nft.json +1 -1
  18. package/.next/server/app/api/backlog/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/browse-directory/route.js +1 -0
  20. package/.next/server/app/api/browse-directory/route.js.nft.json +1 -0
  21. package/.next/server/app/api/browse-directory/route_client-reference-manifest.js +1 -0
  22. package/.next/server/app/api/events/route.js +3 -3
  23. package/.next/server/app/api/events/route.js.nft.json +1 -1
  24. package/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/filesystem/browse/route.js +1 -0
  26. package/.next/server/app/api/filesystem/browse/route.js.nft.json +1 -0
  27. package/.next/server/app/api/filesystem/browse/route_client-reference-manifest.js +1 -0
  28. package/.next/server/app/api/issues/route.js +1 -1
  29. package/.next/server/app/api/issues/route.js.nft.json +1 -1
  30. package/.next/server/app/api/issues/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/observability/route.js +1 -1
  32. package/.next/server/app/api/observability/route.js.nft.json +1 -1
  33. package/.next/server/app/api/observability/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/orchestrators/route.js +1 -1
  35. package/.next/server/app/api/orchestrators/route.js.nft.json +1 -1
  36. package/.next/server/app/api/orchestrators/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/projects/[id]/route.js +1 -0
  38. package/.next/server/app/api/projects/[id]/route.js.nft.json +1 -0
  39. package/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -0
  40. package/.next/server/app/api/projects/reload/route.js +1 -0
  41. package/.next/server/app/api/projects/reload/route.js.nft.json +1 -0
  42. package/.next/server/app/api/projects/reload/route_client-reference-manifest.js +1 -0
  43. package/.next/server/app/api/projects/route.js +1 -1
  44. package/.next/server/app/api/projects/route.js.nft.json +1 -1
  45. package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/prs/[id]/merge/route.js +1 -1
  47. package/.next/server/app/api/prs/[id]/merge/route.js.nft.json +1 -1
  48. package/.next/server/app/api/prs/[id]/merge/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/runtime/terminal/route.js +1 -1
  50. package/.next/server/app/api/runtime/terminal/route.js.nft.json +1 -1
  51. package/.next/server/app/api/runtime/terminal/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/sessions/[id]/kill/route.js +1 -1
  53. package/.next/server/app/api/sessions/[id]/kill/route.js.nft.json +1 -1
  54. package/.next/server/app/api/sessions/[id]/kill/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/sessions/[id]/message/route.js +1 -1
  56. package/.next/server/app/api/sessions/[id]/message/route.js.nft.json +1 -1
  57. package/.next/server/app/api/sessions/[id]/message/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/sessions/[id]/remap/route.js +1 -1
  59. package/.next/server/app/api/sessions/[id]/remap/route.js.nft.json +1 -1
  60. package/.next/server/app/api/sessions/[id]/remap/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/sessions/[id]/restore/route.js +1 -1
  62. package/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -1
  63. package/.next/server/app/api/sessions/[id]/restore/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  65. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  66. package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/sessions/[id]/send/route.js +1 -1
  68. package/.next/server/app/api/sessions/[id]/send/route.js.nft.json +1 -1
  69. package/.next/server/app/api/sessions/[id]/send/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/sessions/patches/route.js +1 -0
  71. package/.next/server/app/api/sessions/patches/route.js.nft.json +1 -0
  72. package/.next/server/app/api/sessions/patches/route_client-reference-manifest.js +1 -0
  73. package/.next/server/app/api/sessions/route.js +1 -1
  74. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  75. package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/setup-labels/route.js +1 -1
  77. package/.next/server/app/api/setup-labels/route.js.nft.json +1 -1
  78. package/.next/server/app/api/setup-labels/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/spawn/route.js +1 -1
  80. package/.next/server/app/api/spawn/route.js.nft.json +1 -1
  81. package/.next/server/app/api/spawn/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/verify/route.js +1 -1
  83. package/.next/server/app/api/verify/route.js.nft.json +1 -1
  84. package/.next/server/app/api/verify/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/webhooks/[...slug]/route.js +1 -1
  86. package/.next/server/app/api/webhooks/[...slug]/route.js.nft.json +1 -1
  87. package/.next/server/app/api/webhooks/[...slug]/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/apple-icon/route.js +1 -1
  89. package/.next/server/app/apple-icon/route.js.nft.json +1 -1
  90. package/.next/server/app/apple-icon/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/dev/terminal-test/page.js +3 -3
  92. package/.next/server/app/dev/terminal-test/page.js.nft.json +1 -1
  93. package/.next/server/app/dev/terminal-test/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app/dev/terminal-test.html +1 -1
  95. package/.next/server/app/dev/terminal-test.rsc +17 -17
  96. package/.next/server/app/icon/route.js +1 -1
  97. package/.next/server/app/icon/route.js.nft.json +1 -1
  98. package/.next/server/app/icon/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/icon-192/route.js +1 -1
  100. package/.next/server/app/icon-192/route.js.nft.json +1 -1
  101. package/.next/server/app/icon-192/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/icon-512/route.js +1 -1
  103. package/.next/server/app/icon-512/route.js.nft.json +1 -1
  104. package/.next/server/app/icon-512/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  106. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  107. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/manifest.webmanifest.body +1 -1
  109. package/.next/server/app/orchestrators/page.js +2 -2
  110. package/.next/server/app/orchestrators/page.js.nft.json +1 -1
  111. package/.next/server/app/orchestrators/page_client-reference-manifest.js +1 -1
  112. package/.next/server/app/page.js +2 -2
  113. package/.next/server/app/page.js.nft.json +1 -1
  114. package/.next/server/app/page_client-reference-manifest.js +1 -1
  115. package/.next/server/app/projects/[projectId]/page.js +2 -0
  116. package/.next/server/app/projects/[projectId]/page.js.nft.json +1 -0
  117. package/.next/server/app/projects/[projectId]/page_client-reference-manifest.js +1 -0
  118. package/.next/server/app/projects/[projectId]/sessions/[id]/page.js +2 -0
  119. package/.next/server/app/projects/[projectId]/sessions/[id]/page.js.nft.json +1 -0
  120. package/.next/server/app/projects/[projectId]/sessions/[id]/page_client-reference-manifest.js +1 -0
  121. package/.next/server/app/projects/[projectId]/settings/page.js +2 -0
  122. package/.next/server/app/projects/[projectId]/settings/page.js.nft.json +1 -0
  123. package/.next/server/app/projects/[projectId]/settings/page_client-reference-manifest.js +1 -0
  124. package/.next/server/app/prs/page.js +2 -2
  125. package/.next/server/app/prs/page.js.nft.json +1 -1
  126. package/.next/server/app/prs/page_client-reference-manifest.js +1 -1
  127. package/.next/server/app/sessions/[id]/page.js +2 -12
  128. package/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  129. package/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  130. package/.next/server/app/test-direct/page.js +2 -2
  131. package/.next/server/app/test-direct/page.js.nft.json +1 -1
  132. package/.next/server/app/test-direct/page_client-reference-manifest.js +1 -1
  133. package/.next/server/app/test-direct.html +1 -1
  134. package/.next/server/app/test-direct.rsc +17 -17
  135. package/.next/server/app-paths-manifest.json +16 -8
  136. package/.next/server/chunks/1172.js +1 -0
  137. package/.next/server/chunks/1271.js +1 -0
  138. package/.next/server/chunks/2106.js +1 -0
  139. package/.next/server/chunks/252.js +11 -0
  140. package/.next/server/chunks/2810.js +1 -0
  141. package/.next/server/chunks/3602.js +382 -0
  142. package/.next/server/chunks/3667.js +277 -0
  143. package/.next/server/chunks/3714.js +1 -0
  144. package/.next/server/chunks/4520.js +1 -0
  145. package/.next/server/chunks/6086.js +25 -0
  146. package/.next/server/chunks/6172.js +9 -0
  147. package/.next/server/chunks/8367.js +3 -0
  148. package/.next/server/chunks/8386.js +1 -0
  149. package/.next/server/chunks/8803.js +6 -0
  150. package/.next/server/chunks/9561.js +22 -0
  151. package/.next/server/middleware-build-manifest.js +1 -1
  152. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  153. package/.next/server/next-font-manifest.js +1 -1
  154. package/.next/server/next-font-manifest.json +1 -1
  155. package/.next/server/pages/404.html +1 -1
  156. package/.next/server/pages/500.html +1 -1
  157. package/.next/server/pages/_app.js +1 -1
  158. package/.next/server/pages/_app.js.nft.json +1 -1
  159. package/.next/server/pages/_document.js +1 -1
  160. package/.next/server/pages/_document.js.nft.json +1 -1
  161. package/.next/server/pages/_error.js +3 -3
  162. package/.next/server/pages/_error.js.nft.json +1 -1
  163. package/.next/server/server-reference-manifest.json +1 -1
  164. package/.next/server/webpack-runtime.js +1 -1
  165. package/.next/static/chunks/1461-af7c54935f21d56d.js +1 -0
  166. package/.next/static/chunks/1d2d5650.1ef8611b5325bd83.js +18 -0
  167. package/.next/static/chunks/{9393.acf1934a190d793b.js → 2529.32352c1ce5253e3e.js} +1 -1
  168. package/.next/static/chunks/3697.4d6d86c5f0caf73e.js +1 -0
  169. package/.next/static/chunks/4465-aaba60a6355de914.js +1 -0
  170. package/.next/static/chunks/{7411.ecda44797fb514a0.js → 5491.fd98884d48631149.js} +1 -1
  171. package/.next/static/chunks/6078.47ce88bee96cfaee.js +1 -0
  172. package/.next/static/chunks/6607-405ce4d15e595f4a.js +1 -0
  173. package/.next/static/chunks/7008-71ebb186f0549f41.js +1 -0
  174. package/.next/static/chunks/7317.685aa5231218e8d3.js +1 -0
  175. package/.next/static/chunks/8713-d3d663f55dc00e48.js +1 -0
  176. package/.next/static/chunks/88a6fc35-f836b4b72df5eafa.js +1 -0
  177. package/.next/static/chunks/9331-fcdd652218ac6f68.js +1 -0
  178. package/.next/static/chunks/app/_not-found/page-e2dea9178b4af8db.js +1 -0
  179. package/.next/static/chunks/app/api/backlog/route-e2dea9178b4af8db.js +1 -0
  180. package/.next/static/chunks/app/api/browse-directory/route-e2dea9178b4af8db.js +1 -0
  181. package/.next/static/chunks/app/api/events/route-e2dea9178b4af8db.js +1 -0
  182. package/.next/static/chunks/app/api/filesystem/browse/route-e2dea9178b4af8db.js +1 -0
  183. package/.next/static/chunks/app/api/issues/route-e2dea9178b4af8db.js +1 -0
  184. package/.next/static/chunks/app/api/observability/route-e2dea9178b4af8db.js +1 -0
  185. package/.next/static/chunks/app/api/orchestrators/route-e2dea9178b4af8db.js +1 -0
  186. package/.next/static/chunks/app/api/projects/[id]/route-e2dea9178b4af8db.js +1 -0
  187. package/.next/static/chunks/app/api/projects/reload/route-e2dea9178b4af8db.js +1 -0
  188. package/.next/static/chunks/app/api/projects/route-e2dea9178b4af8db.js +1 -0
  189. package/.next/static/chunks/app/api/prs/[id]/merge/route-e2dea9178b4af8db.js +1 -0
  190. package/.next/static/chunks/app/api/runtime/terminal/route-e2dea9178b4af8db.js +1 -0
  191. package/.next/static/chunks/app/api/sessions/[id]/kill/route-e2dea9178b4af8db.js +1 -0
  192. package/.next/static/chunks/app/api/sessions/[id]/message/route-e2dea9178b4af8db.js +1 -0
  193. package/.next/static/chunks/app/api/sessions/[id]/remap/route-e2dea9178b4af8db.js +1 -0
  194. package/.next/static/chunks/app/api/sessions/[id]/restore/route-e2dea9178b4af8db.js +1 -0
  195. package/.next/static/chunks/app/api/sessions/[id]/route-e2dea9178b4af8db.js +1 -0
  196. package/.next/static/chunks/app/api/sessions/[id]/send/route-e2dea9178b4af8db.js +1 -0
  197. package/.next/static/chunks/app/api/sessions/patches/route-e2dea9178b4af8db.js +1 -0
  198. package/.next/static/chunks/app/api/sessions/route-e2dea9178b4af8db.js +1 -0
  199. package/.next/static/chunks/app/api/setup-labels/route-e2dea9178b4af8db.js +1 -0
  200. package/.next/static/chunks/app/api/spawn/route-e2dea9178b4af8db.js +1 -0
  201. package/.next/static/chunks/app/api/verify/route-e2dea9178b4af8db.js +1 -0
  202. package/.next/static/chunks/app/api/webhooks/[...slug]/route-e2dea9178b4af8db.js +1 -0
  203. package/.next/static/chunks/app/apple-icon/route-e2dea9178b4af8db.js +1 -0
  204. package/.next/static/chunks/app/dev/terminal-test/page-5765f0465db56fed.js +1 -0
  205. package/.next/static/chunks/app/error-670f1d8bf2b6859c.js +1 -0
  206. package/.next/static/chunks/app/{global-error-7b5c8ae45329c659.js → global-error-ca06d2b1be2d4ae0.js} +1 -1
  207. package/.next/static/chunks/app/icon/route-e2dea9178b4af8db.js +1 -0
  208. package/.next/static/chunks/app/icon-192/route-e2dea9178b4af8db.js +1 -0
  209. package/.next/static/chunks/app/icon-512/route-e2dea9178b4af8db.js +1 -0
  210. package/.next/static/chunks/app/layout-ddf79478d9a673bb.js +1 -0
  211. package/.next/static/chunks/app/loading-e2dea9178b4af8db.js +1 -0
  212. package/.next/static/chunks/app/manifest.webmanifest/route-e2dea9178b4af8db.js +1 -0
  213. package/.next/static/chunks/app/{not-found-3772c2e09c29d80f.js → not-found-824d5d3c6e296eeb.js} +1 -1
  214. package/.next/static/chunks/app/orchestrators/page-4c190484788aaaa3.js +1 -0
  215. package/.next/static/chunks/app/page-d3b83ad5f09b6ec7.js +1 -0
  216. package/.next/static/chunks/app/projects/[projectId]/loading-e2dea9178b4af8db.js +1 -0
  217. package/.next/static/chunks/app/projects/[projectId]/page-9f3dfbea006747cf.js +1 -0
  218. package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-a7090a06948f9a6b.js +1 -0
  219. package/.next/static/chunks/app/projects/[projectId]/settings/page-219df6dcbc6d1107.js +1 -0
  220. package/.next/static/chunks/app/prs/page-a285e930235a23af.js +1 -0
  221. package/.next/static/chunks/app/sessions/[id]/error-eb0973907da68a37.js +1 -0
  222. package/.next/static/chunks/app/sessions/[id]/loading-e2dea9178b4af8db.js +1 -0
  223. package/.next/static/chunks/app/sessions/[id]/{not-found-3772c2e09c29d80f.js → not-found-824d5d3c6e296eeb.js} +1 -1
  224. package/.next/static/chunks/app/sessions/[id]/page-98f398b822092218.js +1 -0
  225. package/.next/static/chunks/app/test-direct/page-f9bff7d7b4dfe728.js +1 -0
  226. package/.next/static/chunks/framework-7060e2ac4971c604.js +1 -0
  227. package/.next/static/chunks/main-app-690acf9d5d2050c9.js +1 -0
  228. package/.next/static/chunks/main-ed1610689fbd6f0d.js +1 -0
  229. package/.next/static/chunks/pages/_app-f4baf4dbe88f6f54.js +1 -0
  230. package/.next/static/chunks/pages/_error-a7f6723f42093f29.js +1 -0
  231. package/.next/static/chunks/{webpack-e12ceebeb7a1cc7e.js → webpack-d4ff5ed5e153ca3e.js} +1 -1
  232. package/.next/static/css/577ea7f5ad4f0576.css +1 -0
  233. package/.next/static/css/659eccb5db697b76.css +1 -0
  234. package/.next/static/q6yh3n8jgvyI9JIbexzuH/_buildManifest.js +1 -0
  235. package/dist-server/direct-terminal-ws.js +33 -236
  236. package/dist-server/mux-websocket.js +516 -0
  237. package/dist-server/start-all.js +0 -2
  238. package/next.config.js +5 -0
  239. package/package.json +18 -15
  240. package/.next/server/chunks/27.js +0 -438
  241. package/.next/server/chunks/377.js +0 -1
  242. package/.next/server/chunks/393.js +0 -1
  243. package/.next/server/chunks/627.js +0 -391
  244. package/.next/server/chunks/639.js +0 -6
  245. package/.next/server/chunks/693.js +0 -1
  246. package/.next/server/chunks/705.js +0 -22
  247. package/.next/server/chunks/787.js +0 -29
  248. package/.next/server/chunks/796.js +0 -1
  249. package/.next/server/chunks/934.js +0 -1
  250. package/.next/server/chunks/956.js +0 -9
  251. package/.next/static/WS8DHHp9haunZGhtE8L33/_buildManifest.js +0 -1
  252. package/.next/static/chunks/1250-e7cf6b069fbb03ed.js +0 -1
  253. package/.next/static/chunks/2205.498806f73783aa54.js +0 -1
  254. package/.next/static/chunks/3698-9c12c45b8184022c.js +0 -1
  255. package/.next/static/chunks/6381.1541d5695a727108.js +0 -1
  256. package/.next/static/chunks/7505-2d2422d31862995f.js +0 -1
  257. package/.next/static/chunks/8597-1385f90ec1cebf47.js +0 -1
  258. package/.next/static/chunks/8762.f3d526855363db16.js +0 -1
  259. package/.next/static/chunks/a51c26f2-a21e680a5df6764e.js +0 -1
  260. package/.next/static/chunks/app/_not-found/page-2224bc1d3dce1b3e.js +0 -1
  261. package/.next/static/chunks/app/api/backlog/route-2224bc1d3dce1b3e.js +0 -1
  262. package/.next/static/chunks/app/api/events/route-2224bc1d3dce1b3e.js +0 -1
  263. package/.next/static/chunks/app/api/issues/route-2224bc1d3dce1b3e.js +0 -1
  264. package/.next/static/chunks/app/api/observability/route-2224bc1d3dce1b3e.js +0 -1
  265. package/.next/static/chunks/app/api/orchestrators/route-2224bc1d3dce1b3e.js +0 -1
  266. package/.next/static/chunks/app/api/projects/route-2224bc1d3dce1b3e.js +0 -1
  267. package/.next/static/chunks/app/api/prs/[id]/merge/route-2224bc1d3dce1b3e.js +0 -1
  268. package/.next/static/chunks/app/api/runtime/terminal/route-2224bc1d3dce1b3e.js +0 -1
  269. package/.next/static/chunks/app/api/sessions/[id]/kill/route-2224bc1d3dce1b3e.js +0 -1
  270. package/.next/static/chunks/app/api/sessions/[id]/message/route-2224bc1d3dce1b3e.js +0 -1
  271. package/.next/static/chunks/app/api/sessions/[id]/remap/route-2224bc1d3dce1b3e.js +0 -1
  272. package/.next/static/chunks/app/api/sessions/[id]/restore/route-2224bc1d3dce1b3e.js +0 -1
  273. package/.next/static/chunks/app/api/sessions/[id]/route-2224bc1d3dce1b3e.js +0 -1
  274. package/.next/static/chunks/app/api/sessions/[id]/send/route-2224bc1d3dce1b3e.js +0 -1
  275. package/.next/static/chunks/app/api/sessions/route-2224bc1d3dce1b3e.js +0 -1
  276. package/.next/static/chunks/app/api/setup-labels/route-2224bc1d3dce1b3e.js +0 -1
  277. package/.next/static/chunks/app/api/spawn/route-2224bc1d3dce1b3e.js +0 -1
  278. package/.next/static/chunks/app/api/verify/route-2224bc1d3dce1b3e.js +0 -1
  279. package/.next/static/chunks/app/api/webhooks/[...slug]/route-2224bc1d3dce1b3e.js +0 -1
  280. package/.next/static/chunks/app/apple-icon/route-2224bc1d3dce1b3e.js +0 -1
  281. package/.next/static/chunks/app/dev/terminal-test/page-ac0ce5b046fcad82.js +0 -1
  282. package/.next/static/chunks/app/error-4896c9d3b7681a80.js +0 -1
  283. package/.next/static/chunks/app/icon/route-2224bc1d3dce1b3e.js +0 -1
  284. package/.next/static/chunks/app/icon-192/route-2224bc1d3dce1b3e.js +0 -1
  285. package/.next/static/chunks/app/icon-512/route-2224bc1d3dce1b3e.js +0 -1
  286. package/.next/static/chunks/app/layout-023f2083204e4f68.js +0 -1
  287. package/.next/static/chunks/app/loading-2224bc1d3dce1b3e.js +0 -1
  288. package/.next/static/chunks/app/manifest.webmanifest/route-2224bc1d3dce1b3e.js +0 -1
  289. package/.next/static/chunks/app/orchestrators/page-df85236df674fc5a.js +0 -1
  290. package/.next/static/chunks/app/page-e97da633b7ef25f2.js +0 -1
  291. package/.next/static/chunks/app/prs/page-8cc0fce584d238c5.js +0 -1
  292. package/.next/static/chunks/app/sessions/[id]/error-90bc99b777fecabf.js +0 -1
  293. package/.next/static/chunks/app/sessions/[id]/loading-2224bc1d3dce1b3e.js +0 -1
  294. package/.next/static/chunks/app/sessions/[id]/page-c9c95a8604786cff.js +0 -1
  295. package/.next/static/chunks/app/test-direct/page-16ceeb9f7664394a.js +0 -1
  296. package/.next/static/chunks/df4ed4d4.6a752eba3933e9a8.js +0 -3
  297. package/.next/static/chunks/framework-f8b8ba0f71d38056.js +0 -1
  298. package/.next/static/chunks/main-2bc85c765bf1fc49.js +0 -1
  299. package/.next/static/chunks/main-app-93fb36c3bd1a6739.js +0 -1
  300. package/.next/static/chunks/pages/_app-a0b975794f15bd68.js +0 -1
  301. package/.next/static/chunks/pages/_error-5f4e3b5eea57917d.js +0 -1
  302. package/.next/static/css/6ef2fa08dd043252.css +0 -1
  303. package/.next/static/css/908f93fdd7ffba42.css +0 -1
  304. package/dist-server/terminal-websocket.js +0 -375
  305. /package/.next/static/{WS8DHHp9haunZGhtE8L33 → q6yh3n8jgvyI9JIbexzuH}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9331],{545:(e,t,r)=>{r.d(t,{CM:()=>n.CM,Kw:()=>d,N_:()=>n.N_,Ou:()=>i,QN:()=>l,U1:()=>n.U1,dG:()=>p,fZ:()=>s,nH:()=>m,ng:()=>j,of:()=>c,p$:()=>u,sZ:()=>a,wy:()=>h});var n=r(5425);function s(e){return e.mergeability.blockers.includes("API rate limited or unavailable")}function a(e){return!1===e.enriched}function l(e){return"open"===e.state&&e.mergeability.mergeable&&e.mergeability.ciPassing&&e.mergeability.approved&&e.mergeability.noConflicts}function o(e){return e.replace(/_/g," ")}function i(e){var t,r,n;return null!=(n=null==(r=e.lifecycle)||null==(t=r.session)?void 0:t.label)?n:o(e.status)}function c(e){var t,r,n;return(null==(r=e.lifecycle)||null==(t=r.pr)?void 0:t.label)?e.lifecycle.pr.label:(null==(n=e.pr)?void 0:n.state)?o(e.pr.state):"not created"}function d(e){var t,r,n;return null!=(n=null==(r=e.lifecycle)||null==(t=r.runtime)?void 0:t.label)?n:"unknown"}function u(e){var t,r;return null!=(r=null==(t=e.lifecycle)?void 0:t.guidance)?r:null}function p(e){var t;return e.lifecycle?"done"===e.lifecycle.sessionState||"terminated"===e.lifecycle.sessionState||"merged"===e.lifecycle.prState:"merged"===e.status||"killed"===e.status||"cleanup"===e.status||"done"===e.status||"terminated"===e.status||(null==(t=e.pr)?void 0:t.state)==="merged"}function m(e){return e.lifecycle?p(e)||"missing"===e.lifecycle.runtimeState||"exited"===e.lifecycle.runtimeState:n.CM.has(e.status)||null!==e.activity&&n.Rt.has(e.activity)}function h(e){var t;return e.lifecycle?("done"===e.lifecycle.sessionState||"terminated"===e.lifecycle.sessionState||"missing"===e.lifecycle.runtimeState||"exited"===e.lifecycle.runtimeState)&&"merged"!==e.lifecycle.prState&&"merged"!==e.status:!!m(e)&&(null==(t=e.pr)?void 0:t.state)!=="merged"&&"merged"!==e.status}function j(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"detailed",r=function(e){var t,r,l,o,i,c,d,u,m;if(p(e))return"done";if((null==(t=e.lifecycle)?void 0:t.prReason)==="merge_ready"||(null==(r=e.lifecycle)?void 0:r.prReason)==="approved"||"mergeable"===e.status||"approved"===e.status||e.pr&&!a(e.pr)&&e.pr.mergeability.mergeable)return"merge";if((null==(l=e.lifecycle)?void 0:l.sessionState)==="detecting"||(null==(o=e.lifecycle)?void 0:o.sessionState)==="needs_input"||(null==(i=e.lifecycle)?void 0:i.sessionState)==="stuck"||e.status===n.SB.ERRORED||e.status===n.SB.NEEDS_INPUT||e.status===n.SB.STUCK||e.activity===n.u3.WAITING_INPUT||e.activity===n.u3.BLOCKED||e.activity===n.u3.EXITED)return"respond";if((null==(c=e.lifecycle)?void 0:c.prReason)==="ci_failing"||(null==(d=e.lifecycle)?void 0:d.prReason)==="changes_requested"||"ci_failed"===e.status||"changes_requested"===e.status)return"review";if(e.pr&&!s(e.pr)&&!a(e.pr)){let t=e.pr;if(t.ciStatus===n.U1.FAILING||"changes_requested"===t.reviewDecision||!t.mergeability.noConflicts)return"review"}if((null==(u=e.lifecycle)?void 0:u.prReason)==="review_pending"||(null==(m=e.lifecycle)?void 0:m.prReason)==="closed_unmerged"||"review_pending"===e.status)return"pending";if(e.pr&&!s(e.pr)&&!a(e.pr)){let t=e.pr;if(!t.isDraft&&t.unresolvedThreads>0||!t.isDraft&&("pending"===t.reviewDecision||"none"===t.reviewDecision))return"pending"}return"working"}(e);return"simple"===t&&("respond"===r||"review"===r)?"action":r}},2286:(e,t,r)=>{r.d(t,{D:()=>d,N:()=>u});var n=r(6749),s=(e,t,r,n,s,a,l,o)=>{let i=document.documentElement,c=["light","dark"];function d(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&a?s.map(e=>a[e]||e):s;r?(i.classList.remove(...n),i.classList.add(a&&a[t]?a[t]:t)):i.setAttribute(e,t)}),r=t,o&&c.includes(r)&&(i.style.colorScheme=r)}if(n)d(n);else try{let e=localStorage.getItem(t)||r,n=l&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(n)}catch(e){}},a=["light","dark"],l="(prefers-color-scheme: dark)",o="undefined"==typeof window,i=n.createContext(void 0),c={setTheme:e=>{},themes:[]},d=()=>{var e;return null!=(e=n.useContext(i))?e:c},u=e=>n.useContext(i)?n.createElement(n.Fragment,null,e.children):n.createElement(m,{...e}),p=["light","dark"],m=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:s=!0,enableColorScheme:o=!0,storageKey:c="theme",themes:d=p,defaultTheme:u=s?"system":"light",attribute:m="data-theme",value:g,children:b,nonce:_,scriptProps:x}=e,[y,N]=n.useState(()=>j(c,u)),[w,k]=n.useState(()=>"system"===y?v():y),S=g?Object.values(g):d,C=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&s&&(t=v());let n=g?g[t]:t,l=r?f(_):null,i=document.documentElement,c=e=>{"class"===e?(i.classList.remove(...S),n&&i.classList.add(n)):e.startsWith("data-")&&(n?i.setAttribute(e,n):i.removeAttribute(e))};if(Array.isArray(m)?m.forEach(c):c(m),o){let e=a.includes(u)?u:null,r=a.includes(t)?t:e;i.style.colorScheme=r}null==l||l()},[_]),E=n.useCallback(e=>{let t="function"==typeof e?e(y):e;N(t);try{localStorage.setItem(c,t)}catch(e){}},[y]),P=n.useCallback(e=>{k(v(e)),"system"===y&&s&&!t&&C("system")},[y,t]);n.useEffect(()=>{let e=window.matchMedia(l);return e.addListener(P),P(e),()=>e.removeListener(P)},[P]),n.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?N(e.newValue):E(u))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[E]),n.useEffect(()=>{C(null!=t?t:y)},[t,y]);let I=n.useMemo(()=>({theme:y,setTheme:E,forcedTheme:t,resolvedTheme:"system"===y?w:y,themes:s?[...d,"system"]:d,systemTheme:s?w:void 0}),[y,E,t,w,s,d]);return n.createElement(i.Provider,{value:I},n.createElement(h,{forcedTheme:t,storageKey:c,attribute:m,enableSystem:s,enableColorScheme:o,defaultTheme:u,value:g,themes:d,nonce:_,scriptProps:x}),b)},h=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:a,enableSystem:l,enableColorScheme:o,defaultTheme:i,value:c,themes:d,nonce:u,scriptProps:p}=e,m=JSON.stringify([a,r,i,t,d,c,l,o]).slice(1,-1);return n.createElement("script",{...p,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?u:"",dangerouslySetInnerHTML:{__html:"(".concat(s.toString(),")(").concat(m,")")}})}),j=(e,t)=>{let r;if(!o){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},f=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},v=e=>(e||(e=window.matchMedia(l)),e.matches?"dark":"light")},2446:(e,t,r)=>{r.d(t,{d:()=>c,t:()=>i});var n=r(3817),s=r(6749),a=r(4901);function l(e,t){return"SHOW"===t.type?{message:t.message,variant:t.variant,key:t.key}:null}let o=(0,s.createContext)(null);function i(e){let{children:t}=e,[r,i]=(0,s.useReducer)(l,null),c=(0,s.useRef)(null),d=(0,s.useRef)(0);(0,s.useEffect)(()=>()=>{null!==c.current&&clearTimeout(c.current)},[]);let u=(0,s.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";null!==c.current&&clearTimeout(c.current),d.current+=1,i({type:"SHOW",message:e,variant:t,key:d.current}),c.current=setTimeout(()=>{i({type:"HIDE"}),c.current=null},3e3)},[]);return(0,n.jsxs)(o.Provider,{value:{showToast:u},children:[t,(0,n.jsx)("div",{className:"toast-container",role:"status","aria-live":"polite","aria-atomic":"true",children:r&&(0,n.jsxs)("div",{className:(0,a.cn)("toast","success"===r.variant&&"toast--success","error"===r.variant&&"toast--error","info"===r.variant&&"toast--info"),children:[(0,n.jsx)("span",{className:"toast__icon","aria-hidden":"true"}),(0,n.jsx)("span",{className:"toast__message",children:r.message})]},r.key)})]})}function c(){let e=(0,s.useContext)(o);if(!e)throw Error("useToast must be used within a ToastProvider");return e}},2749:(e,t,r)=>{r.d(t,{ProjectSettingsForm:()=>u});var n=r(3817),s=r(6749),a=r(7594),l=r(2446);let o="These describe which repo this is. Change them via `ao project relink`.";function i(e){let{projectId:t,initialValues:r}=e,o=(0,a.useRouter)(),{showToast:i}=(0,l.d)(),[u,p]=(0,s.useState)(r.agent),[m,h]=(0,s.useState)(r.runtime),[j,f]=(0,s.useState)(r.trackerPlugin),[v,g]=(0,s.useState)(r.scmPlugin),[b,_]=(0,s.useState)(r.reactions),[x,y]=(0,s.useState)(!1),[N,w]=(0,s.useState)(null),[k,S]=(0,s.useState)(null),C=(0,s.useMemo)(()=>({agent:u.trim()||null,runtime:m.trim()||null,tracker:j.trim()?{plugin:j.trim()}:null,scm:v.trim()?{plugin:v.trim()}:null,reactions:b}),[u,m,j,v,b]),E=async()=>{let e;w(null),S(null);try{let t=b.trim();e=t?JSON.parse(t):void 0}catch(e){w("Reactions must be valid JSON.");return}y(!0);try{let n=await fetch("/api/projects/".concat(encodeURIComponent(t)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({agent:C.agent,runtime:C.runtime,tracker:C.tracker,scm:C.scm,reactions:null!=e?e:null})}),s=await n.json().catch(()=>null);if(!n.ok){var r;let e=null!=(r=null==s?void 0:s.error)?r:"Failed to save project settings.";400===n.status?w(e):S(e);return}i("Project settings updated.","success"),o.refresh()}catch(e){S("Network error while saving project settings.")}finally{y(!1)}};return(0,n.jsxs)("div",{className:"project-settings-form",children:[(0,n.jsxs)("section",{className:"project-settings-form__section",children:[(0,n.jsxs)("div",{className:"project-settings-form__section-header",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"project-settings-form__eyebrow",children:"Behavior"}),(0,n.jsx)("h2",{className:"project-settings-form__section-title",children:"Runtime configuration"}),(0,n.jsx)("p",{className:"project-settings-form__section-copy",children:"These values change how AO runs this project without changing which repository the project points at."})]}),(0,n.jsx)("button",{type:"button",onClick:()=>void E(),disabled:x,className:"project-settings-form__save",children:x?"Saving...":"Save changes"})]}),(0,n.jsxs)("div",{className:"project-settings-form__grid",children:[(0,n.jsx)(c,{id:"agent",label:"Agent",value:u,onChange:p,placeholder:"claude-code"}),(0,n.jsx)(c,{id:"runtime",label:"Runtime",value:m,onChange:h,placeholder:"tmux"}),(0,n.jsx)(c,{id:"tracker-plugin",label:"Tracker plugin",value:j,onChange:f,placeholder:"github"}),(0,n.jsx)(c,{id:"scm-plugin",label:"SCM plugin",value:v,onChange:g,placeholder:"github"})]}),(0,n.jsxs)("div",{className:"project-settings-form__reactions",children:[(0,n.jsx)("label",{htmlFor:"reactions",className:"project-settings-form__label",children:"Reactions"}),(0,n.jsx)("p",{className:"project-settings-form__hint",children:"JSON object keyed by reaction name. This PATCH only sends behavior fields."}),(0,n.jsx)("textarea",{id:"reactions",value:b,onChange:e=>_(e.target.value),spellCheck:!1,rows:12,className:"project-settings-form__textarea project-settings-form__textarea--mono"})]}),N?(0,n.jsx)("div",{role:"alert",className:"project-settings-form__alert project-settings-form__alert--error",children:N}):null,k?(0,n.jsxs)("div",{className:"project-settings-form__alert project-settings-form__alert--surface",children:[(0,n.jsx)("p",{className:"project-settings-form__alert-copy",children:k}),(0,n.jsx)("button",{type:"button",onClick:()=>void E(),className:"project-settings-form__retry",children:"Retry"})]}):null]}),(0,n.jsxs)("section",{className:"project-settings-form__section",children:[(0,n.jsx)("p",{className:"project-settings-form__eyebrow",children:"Identity"}),(0,n.jsx)("h2",{className:"project-settings-form__section-title",children:"Repository identity"}),(0,n.jsx)("p",{className:"project-settings-form__section-copy",children:"These fields are read-only because they define which repository AO considers this project to be."}),(0,n.jsxs)("div",{className:"project-settings-form__grid",children:[(0,n.jsx)(d,{id:"identity-project-id",label:"Project ID",value:r.identity.projectId}),(0,n.jsx)(d,{id:"identity-path",label:"Path",value:r.identity.path}),(0,n.jsx)(d,{id:"identity-storage-key",label:"Storage key",value:r.identity.storageKey}),(0,n.jsx)(d,{id:"identity-repo",label:"Repo",value:r.identity.repo}),(0,n.jsx)(d,{id:"identity-default-branch",label:"Default branch",value:r.identity.defaultBranch})]})]})]})}function c(e){let{id:t,label:r,value:s,onChange:a,placeholder:l}=e;return(0,n.jsxs)("label",{htmlFor:t,className:"project-settings-form__field",children:[(0,n.jsx)("span",{className:"project-settings-form__label",children:r}),(0,n.jsx)("input",{id:t,value:s,onChange:e=>a(e.target.value),placeholder:l,className:"project-settings-form__input"})]})}function d(e){let{id:t,label:r,value:s}=e;return(0,n.jsxs)("label",{htmlFor:t,className:"project-settings-form__field",children:[(0,n.jsx)("span",{className:"project-settings-form__label",children:r}),(0,n.jsx)("input",{id:t,value:s,disabled:!0,readOnly:!0,title:o,"aria-describedby":"".concat(t,"-tooltip"),className:"project-settings-form__input project-settings-form__input--readonly"}),(0,n.jsx)("span",{id:"".concat(t,"-tooltip"),className:"project-settings-form__hint",children:o})]})}function u(e){return(0,n.jsx)(l.t,{children:(0,n.jsx)(i,{...e})})}},4901:(e,t,r)=>{r.d(t,{cn:()=>n});function n(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}},5184:(e,t,r)=>{r.d(t,{Ug:()=>o,eT:()=>i,i2:()=>c});var n=r(3817),s=r(6749),a=r(1806);let l=s.createContext(void 0);function o(){let e=s.useContext(l);if(!e)throw Error("useMux() must be used within <MuxProvider>");return e}function i(){return s.useContext(l)}function c(e){let{children:t}=e,r=(0,s.useRef)(null),o=(0,s.useRef)(new Map),i=(0,s.useRef)(new Set),[c,d]=(0,s.useState)("connecting"),[u,p]=(0,s.useState)([]),m=(0,s.useRef)(0),h=(0,s.useRef)(null),j=(0,s.useRef)({}),f=(0,s.useRef)(!1),v=(0,s.useCallback)(()=>{if(!r.current){d("connecting");try{let e=function(e){var t,r,n;let s=window.location,l="https:"===s.protocol?"wss:":"ws:",o=null!=(t=e.proxyWsPath)?t:a.env.NEXT_PUBLIC_TERMINAL_WS_PATH;if(o){let e=o.replace(/\/ws\/?$/,"");return"".concat(l,"//").concat(s.host).concat(e,"/mux")}if(""===s.port||"443"===s.port||"80"===s.port)return"".concat(l,"//").concat(s.hostname,"/ao-terminal-mux");let i=null!=(n=null!=(r=e.directTerminalPort)?r:a.env.NEXT_PUBLIC_DIRECT_TERMINAL_PORT)?n:"14801";return"".concat(l,"//").concat(s.hostname,":").concat(i,"/mux")}(j.current);console.log("[MuxProvider] Connecting to",e);let t=new WebSocket(e);r.current=t,t.addEventListener("open",()=>{if(f.current)return void t.close();for(let e of(console.log("[MuxProvider] Connected"),d("connected"),m.current=0,i.current)){let r={ch:"terminal",id:e,type:"open"};t.send(JSON.stringify(r))}t.send(JSON.stringify({ch:"subscribe",topics:["sessions"]}))}),t.addEventListener("message",e=>{try{let t=JSON.parse(e.data);if("terminal"===t.ch)if("data"===t.type){let e=o.current.get(t.id);if(e)for(let r of e)r(t.data)}else if("opened"===t.type)i.current.add(t.id);else if("exited"===t.type){i.current.delete(t.id);let e=o.current.get(t.id);if(e){let r="\r\n\x1b[31m[Terminal exited with code ".concat(t.code,"]\x1b[0m\r\n");for(let t of e)t(r)}}else"error"===t.type&&console.error("[MuxProvider] Terminal error for ".concat(t.id,":"),t.message);else"sessions"===t.ch&&"snapshot"===t.type&&p(t.sessions)}catch(e){console.error("[MuxProvider] Error processing message:",e)}}),t.addEventListener("error",e=>{console.error("[MuxProvider] WebSocket error:",e)}),t.addEventListener("close",()=>{if(console.log("[MuxProvider] Disconnected"),r.current===t&&(r.current=null),f.current)return;let e=Math.min(1e3*Math.pow(2,m.current),3e4);m.current+=1,d("reconnecting"),h.current=setTimeout(()=>{console.log("[MuxProvider] Reconnecting (attempt ".concat(m.current,")...")),v()},e)})}catch(e){console.error("[MuxProvider] Failed to create WebSocket:",e),d("disconnected")}}},[]);(0,s.useEffect)(()=>{f.current=!1;let e=!1;return(async()=>{try{let e=await fetch("/api/runtime/terminal");if(e.ok){let t=await e.json();j.current={directTerminalPort:function(e){if("string"!=typeof e&&"number"!=typeof e)return;let t=Number.parseInt(String(e),10);if(Number.isInteger(t)&&!(t<=0)&&!(t>65535))return String(t)}(t.directTerminalPort),proxyWsPath:function(e){if("string"!=typeof e)return;let t=e.trim();if(t.startsWith("/"))return t}(t.proxyWsPath)}}}catch(e){}e||v()})(),()=>{var t;e=!0,f.current=!0,h.current&&clearTimeout(h.current),null==(t=r.current)||t.close()}},[v]);let g=(0,s.useCallback)((e,t)=>{var n;let s=o.current.get(e);return s||(s=new Set,o.current.set(e,s)),s.add(t),i.current.has(e)||(null==(n=r.current)?void 0:n.readyState)!==WebSocket.OPEN||r.current.send(JSON.stringify({ch:"terminal",id:e,type:"open"})),()=>{let r=o.current.get(e);r&&(r.delete(t),0===r.size&&o.current.delete(e))}},[]),b=(0,s.useCallback)((e,t)=>{var n;(null==(n=r.current)?void 0:n.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({ch:"terminal",id:e,type:"data",data:t}))},[]),_=(0,s.useCallback)(e=>{var t;i.current.add(e),(null==(t=r.current)?void 0:t.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({ch:"terminal",id:e,type:"open"}))},[]),x=(0,s.useCallback)(e=>{var t;i.current.delete(e),(null==(t=r.current)?void 0:t.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({ch:"terminal",id:e,type:"close"}))},[]),y=(0,s.useCallback)((e,t,n)=>{var s;(null==(s=r.current)?void 0:s.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({ch:"terminal",id:e,type:"resize",cols:t,rows:n}))},[]),N=(0,s.useMemo)(()=>({subscribeTerminal:g,writeTerminal:b,openTerminal:_,closeTerminal:x,resizeTerminal:y,status:c,sessions:u}),[g,b,_,x,y,c,u]);return(0,n.jsx)(l.Provider,{value:N,children:t})}},5425:(e,t,r)=>{r.d(t,{CM:()=>a,N_:()=>o,Rt:()=>l,SB:()=>s,U1:()=>c,tT:()=>i,u3:()=>n});let n={ACTIVE:"active",READY:"ready",IDLE:"idle",WAITING_INPUT:"waiting_input",BLOCKED:"blocked",EXITED:"exited"},s={SPAWNING:"spawning",WORKING:"working",DETECTING:"detecting",PR_OPEN:"pr_open",CI_FAILED:"ci_failed",REVIEW_PENDING:"review_pending",CHANGES_REQUESTED:"changes_requested",APPROVED:"approved",MERGEABLE:"mergeable",MERGED:"merged",CLEANUP:"cleanup",NEEDS_INPUT:"needs_input",STUCK:"stuck",ERRORED:"errored",IDLE:"idle",KILLED:"killed",DONE:"done",TERMINATED:"terminated"},a=new Set(["killed","terminated","done","cleanup","errored","merged"]),l=new Set(["exited"]),o=new Set(["merged"]);function i(e,t,r){var n;if((null==(n=e.metadata)?void 0:n.role)==="orchestrator")return!0;if(!t)return!1;let s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!new RegExp("^".concat(s,"-orchestrator-\\d+$")).test(e.id))return!1;if(r){for(let n of r)if(n!==t&&new RegExp("^".concat(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"-\\d+$")).test(e.id))return!1}return!0}let c={PENDING:"pending",PASSING:"passing",FAILING:"failing",NONE:"none"}},6004:(e,t,r)=>{r.d(t,{U:()=>l});var n=r(3817),s=r(2286),a=r(6749);function l(e){let{className:t,label:r}=e,{resolvedTheme:l,setTheme:o}=(0,s.D)(),[i,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>c(!0),[]),!i)return(0,n.jsx)("div",{className:null!=t?t:"h-9 w-9"});let d="dark"===l;return(0,n.jsxs)("button",{onClick:()=>o(d?"light":"dark"),className:null!=t?t:"flex h-9 w-9 items-center justify-center border border-[var(--color-border-strong)] bg-[var(--color-bg-elevated)] text-[var(--color-text-primary)] transition-colors hover:bg-[var(--color-bg-elevated-hover)]","aria-label":"Switch to ".concat(d?"light":"dark"," mode"),title:"Switch to ".concat(d?"light":"dark"," mode"),children:[d?(0,n.jsxs)("svg",{className:"h-[18px] w-[18px]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,n.jsx)("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]}):(0,n.jsx)("svg",{className:"h-[18px] w-[18px]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"})}),r?(0,n.jsx)("span",{children:r}):null]})}},7387:(e,t,r)=>{function n(e){return e.replace(/^(?:feat|fix|chore|refactor|docs|test|ci|session|release|hotfix|feature|bugfix|build|wip|improvement)\//,"").replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}function s(e){var t;if(null==(t=e.pr)?void 0:t.title)return e.pr.title;if(e.issueTitle)return e.issueTitle;if(e.userPrompt)return e.userPrompt;if(e.branch)return n(e.branch);let r=e.metadata.pinnedSummary;return r||(e.summary&&!e.summaryIsFallback||e.summary?e.summary:e.status)}r.d(t,{Pn:()=>s,mC:()=>n})},7594:(e,t,r)=>{var n=r(9582);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}})},8450:(e,t,r)=>{function n(e){return"/projects/".concat(encodeURIComponent(e))}function s(e,t){return"".concat(n(e),"/sessions/").concat(encodeURIComponent(t))}function a(e,t,r){return"".concat(s(e,t)).concat(r)}r.d(t,{$l:()=>a,Nc:()=>s,bn:()=>n})},9120:(e,t,r)=>{r.d(t,{D:()=>s,U:()=>a});var n=r(6749);let s=767;function a(e){let t="number"==typeof e?"(max-width: ".concat(e,"px)"):e,[r,s]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=window.matchMedia(t);s(e.matches);let r=e=>{s(e.matches)};return"function"==typeof e.addEventListener?(e.addEventListener("change",r),()=>{e.removeEventListener("change",r)}):(e.addListener(r),()=>{e.removeListener(r)})},[t]),r}},9293:(e,t,r)=>{r.d(t,{u:()=>T});var n=r(3817),s=r(8713),a=r.n(s),l=r(6749),o=r(7594),i=r(4901),c=r(545),d=r(5425),u=r(7387);function p(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;(0,l.useLayoutEffect)(()=>{if(!e)return;let n=t.current;if(!n)return;let s=()=>{n.style.transform="";let e=n.getBoundingClientRect(),t=window.innerWidth,s=0;e.left<r?s=r-e.left:e.right>t-r&&(s=t-r-e.right),0!==s&&(n.style.transform="translateX(".concat(s,"px)"))};return s(),window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s),n.style.transform=""}},[e,t,r])}var m=r(8450),h=r(6004);let j="ao:add-project:recent";function f(e){var t;return(null!=(t=e.split("/").filter(Boolean).pop())?t:"project").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"project"}function v(e){var t;return(null!=(t=e.split("/").filter(Boolean).pop())?t:"Project").replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())||"Project"}function g(e,t){return"~"===e?"~/".concat(t):"".concat(e.replace(/\/+$/,""),"/").concat(t)}function b(e){let{children:t,className:r,viewBox:s="0 0 16 16"}=e;return(0,n.jsx)("svg",{"aria-hidden":"true",viewBox:s,className:r,children:t})}let _={fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"square"},x={fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"miter"};function y(){return(0,n.jsx)(b,{className:"add-project-modal__toolicon",children:(0,n.jsx)("path",{d:"M10 3.5 6 8l4 4.5",..._})})}function N(){return(0,n.jsx)(b,{className:"add-project-modal__toolicon",children:(0,n.jsx)("path",{d:"m6 3.5 4 4.5L6 12.5",..._})})}function w(){return(0,n.jsx)(b,{className:"add-project-modal__toolicon",children:(0,n.jsx)("path",{d:"M8 12V4m0 0L5 7m3-3 3 3",...x})})}function k(){return(0,n.jsx)(b,{className:"add-project-modal__toolicon",children:(0,n.jsx)("path",{d:"M12 5V2.75H9.75M4.5 11A4.75 4.75 0 0 0 12 5M3.75 11v2.25H6m5.5-8.25A4.75 4.75 0 0 1 4 11",...x})})}function S(e){let{open:t,onClose:r}=e,s=(0,o.useRouter)(),a=(0,l.useRef)(null),[i,c]=(0,l.useState)(!1),[d,u]=(0,l.useState)(null),[p,m]=(0,l.useState)(null),[h,b]=(0,l.useState)(null),[_,x]=(0,l.useState)("~"),[S,C]=(0,l.useState)("~"),[E,P]=(0,l.useState)(["~"]),[I,R]=(0,l.useState)(0),[M,T]=(0,l.useState)([]),[L,D]=(0,l.useState)(!1),[O,A]=(0,l.useState)(null),[W,B]=(0,l.useState)(""),[U,F]=(0,l.useState)(""),K=async(e,t)=>{D(!0),A(null);try{var r,n,s,a,l,o,i;let c=await fetch("/api/filesystem/browse?path=".concat(encodeURIComponent(e))).catch(()=>null);if(!c){T([]),C(null!=(r=null==t?void 0:t.selectedPath)?r:e),A("Failed to browse directories.");return}if(!c.ok){let r=await c.json().catch(()=>null),a=404===c.status&&(null==r?void 0:r.error)==="Not found";T([]),C(a?"":null!=(n=null==t?void 0:t.selectedPath)?n:e),A(a?"Directory browsing is unavailable in this environment. Set AO_ALLOW_FILESYSTEM_BROWSE=1 to enable it.":null!=(s=null==r?void 0:r.error)?s:"Failed to browse directories.");return}let d=await c.json().catch(()=>null),u=null!=(a=null==t?void 0:t.mode)?a:"push",p=null!=(l=null==t?void 0:t.historyIndex)?l:I;x(e),C(null!=(o=null==t?void 0:t.selectedPath)?o:e),T(null!=(i=null==d?void 0:d.entries)?i:[]),"push"===u?P(t=>{let r=t.slice(0,p+1);return r[r.length-1]!==e&&r.push(e),R(r.length-1),r}):P(t=>{let r=[...t];return r[p]=e,r})}catch(e){A("Failed to browse directories.")}finally{D(!1)}};(0,l.useEffect)(()=>{var e;t&&(u(null),m(null),b(null),A(null),P(["~"]),R(0),x("~"),C("~"),B(""),F(""),null==(e=a.current)||e.focus(),K("~",{mode:"replace",selectedPath:"~"}))},[t]);let H=(0,l.useMemo)(()=>M.filter(e=>e.isDirectory),[M]),G=(0,l.useMemo)(()=>{var e;return null!=(e=H.find(e=>g(_,e.name)===S))?e:null},[_,H,S]),J=function(e){if("~"===e)return null;let t=e.split("/").filter(Boolean);return t.length<=1?"~":"~"===t[0]?"~/".concat(t.slice(1,-1).join("/")):t.slice(0,-1).join("/")}(_),z=I<E.length-1,V=W.trim()||(S.trim()&&"~"!==S?f(S):""),$=U.trim()||(S.trim()&&"~"!==S?v(S):""),q=""!==S.trim()&&"~"!==S&&!O&&!!(null==G?void 0:G.isGitRepo)&&V.length>0&&$.length>0,X=H.findIndex(e=>g(_,e.name)===S);(0,l.useEffect)(()=>{if(!S||"~"===S){B(""),F("");return}B(f(S)),F(v(S))},[S]),(0,l.useEffect)(()=>{if(!t)return;let e=e=>{var t;if((null==(t=a.current)?void 0:t.contains(document.activeElement))||document.activeElement===document.body){if("Escape"===e.key){e.preventDefault(),r();return}if((e.metaKey||e.ctrlKey)&&"Enter"===e.key&&q){e.preventDefault(),Z();return}if("ArrowDown"===e.key||"ArrowUp"===e.key){if(0===H.length)return;e.preventDefault();let t="ArrowDown"===e.key?1:-1,r=-1===X?t>0?0:H.length-1:Math.min(Math.max(X+t,0),H.length-1),n=H[r];n&&C(g(_,n.name));return}if("Enter"===e.key){if(X>=0){e.preventDefault(),K(S);return}q&&(e.preventDefault(),Z())}}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[_,q,H,r,t,S,X]);let Z=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u(null),m(null),b(null),c(!0);let t=S.trim();try{var n,a,l;let o=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:V,name:$,path:t,allowStorageKeyReuse:e})}),i=await o.json().catch(()=>null);if(409===o.status&&(null==i?void 0:i.existingProjectId)&&(null==i?void 0:i.suggestion))return void b({error:null!=(n=i.error)?n:"A project with the same storage key already exists.",existingProjectId:i.existingProjectId,suggestion:i.suggestion});if(!o.ok){let e=null!=(a=null==i?void 0:i.error)?a:"Failed to add project.";o.status<500?u(e):m(e);return}let c=[t,...(function(){try{var e;let t=JSON.parse(null!=(e=window.localStorage.getItem(j))?e:"[]");return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch(e){return[]}})().filter(e=>e!==t)].slice(0,5);window.localStorage.setItem(j,JSON.stringify(c));let d=null!=(l=null==i?void 0:i.projectId)?l:V.trim();r(),s.push("/projects/".concat(encodeURIComponent(d))),s.refresh()}catch(e){m("Network error while adding project.")}finally{c(!1)}};if(!t)return null;let Q=e=>{var t;e<0||e>=E.length||(R(e),K(null!=(t=E[e])?t:"~",{mode:"replace",historyIndex:e}))},Y=h?(0,n.jsxs)("div",{className:"add-project-modal__notice add-project-modal__notice--warning",children:[(0,n.jsx)("p",{className:"add-project-modal__notice-title",children:h.error}),(0,n.jsxs)("p",{className:"add-project-modal__notice-copy",children:["Existing project: ",(0,n.jsx)("code",{children:h.existingProjectId})]}),(0,n.jsxs)("div",{className:"add-project-modal__notice-actions",children:[(0,n.jsx)("button",{type:"button",onClick:()=>{r(),s.push("/projects/".concat(encodeURIComponent(h.existingProjectId)))},className:"add-project-modal__ghostbtn",children:"Open existing"}),(0,n.jsx)("button",{type:"button",onClick:()=>void Z(!0),className:"add-project-modal__ghostbtn",children:"Reuse shared storage"}),(0,n.jsx)("span",{className:"add-project-modal__notice-hint",children:"Open the existing project or confirm shared storage reuse."})]})]}):d?(0,n.jsx)("div",{role:"alert",className:"add-project-modal__notice add-project-modal__notice--error",children:d}):G&&!G.isGitRepo?(0,n.jsx)("div",{role:"alert",className:"add-project-modal__notice add-project-modal__notice--error",children:"Selected folder is not a git repository."}):p?(0,n.jsx)("div",{className:"add-project-modal__notice add-project-modal__notice--error",children:p}):null;return(0,n.jsx)("div",{className:"add-project-modal-backdrop",children:(0,n.jsxs)("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":"Add project",className:"add-project-modal",tabIndex:-1,children:[(0,n.jsxs)("div",{className:"add-project-modal__titlebar",children:[(0,n.jsx)("h2",{className:"add-project-modal__windowtitle",children:"add project"}),(0,n.jsx)("button",{type:"button","aria-label":"Close",onClick:r,className:"add-project-modal__iconbtn",children:"\xd7"})]}),(0,n.jsxs)("div",{className:"add-project-modal__toolbar",children:[(0,n.jsxs)("div",{className:"add-project-modal__toolbarcluster",children:[(0,n.jsx)("button",{type:"button",onClick:()=>Q(I-1),disabled:!(I>0),className:"add-project-modal__toolbtn","aria-label":"Go back",children:(0,n.jsx)(y,{})}),(0,n.jsx)("button",{type:"button",onClick:()=>Q(I+1),disabled:!z,className:"add-project-modal__toolbtn","aria-label":"Go forward",children:(0,n.jsx)(N,{})}),(0,n.jsx)("button",{type:"button",onClick:()=>J&&void K(J),disabled:!J,className:"add-project-modal__toolbtn","aria-label":"Go up",children:(0,n.jsx)(w,{})}),(0,n.jsx)("button",{type:"button",onClick:()=>void K(_,{mode:"replace",selectedPath:S}),className:"add-project-modal__toolbtn","aria-label":"Refresh",children:(0,n.jsx)(k,{})})]}),(0,n.jsx)("div",{className:"add-project-modal__location",children:_})]}),(0,n.jsx)("div",{className:"add-project-modal__content",children:(0,n.jsxs)("div",{className:"add-project-browser",children:[(0,n.jsxs)("div",{className:"add-project-browser__current",children:[(0,n.jsx)("div",{className:"add-project-browser__current-label",children:"Current folder"}),(0,n.jsx)("div",{className:"add-project-browser__current-path",children:_})]}),O?(0,n.jsxs)("div",{className:"add-project-browser__state add-project-browser__state--error",children:[(0,n.jsx)("p",{className:"add-project-browser__state-title",children:"Directory browser unavailable"}),(0,n.jsx)("p",{className:"add-project-browser__state-copy",children:O})]}):L?(0,n.jsxs)("div",{className:"add-project-browser__state",children:[(0,n.jsx)("p",{className:"add-project-browser__state-title",children:"Loading folders"}),(0,n.jsx)("p",{className:"add-project-browser__state-copy",children:"Fetching directories for this location."})]}):0===H.length?(0,n.jsxs)("div",{className:"add-project-browser__state",children:[(0,n.jsx)("p",{className:"add-project-browser__state-title",children:"No visible folders here"}),(0,n.jsx)("p",{className:"add-project-browser__state-copy",children:"Try navigating up or picking a different location."})]}):(0,n.jsxs)("div",{className:"add-project-browser__rows",children:[J?(0,n.jsx)("button",{type:"button",onClick:()=>void K(J),className:"add-project-browser__row add-project-browser__row--parent",children:".."}):null,H.map(e=>{let t=g(_,e.name);return(0,n.jsx)("button",{type:"button",onClick:()=>C(t),onDoubleClick:()=>void K(t),className:"add-project-browser__row".concat(S===t?" is-selected":""),children:e.name},t)})]})]})}),(0,n.jsxs)("div",{className:"add-project-modal__pathbar add-project-modal__pathbar--selection",children:[(0,n.jsx)("span",{className:"add-project-modal__selection-label",children:"Selected"}),(0,n.jsx)("span",{className:"add-project-modal__selection-path",children:S||"No directory selected"})]}),(0,n.jsxs)("div",{className:"add-project-modal__pathbar add-project-modal__pathbar--selection",children:[(0,n.jsx)("label",{className:"add-project-modal__selection-label",htmlFor:"project-id-input",children:"Project ID"}),(0,n.jsx)("input",{id:"project-id-input",value:W,onChange:e=>B(e.target.value),className:"add-project-modal__selection-path"})]}),(0,n.jsxs)("div",{className:"add-project-modal__pathbar add-project-modal__pathbar--selection",children:[(0,n.jsx)("label",{className:"add-project-modal__selection-label",htmlFor:"project-name-input",children:"Project name"}),(0,n.jsx)("input",{id:"project-name-input",value:U,onChange:e=>F(e.target.value),className:"add-project-modal__selection-path"})]}),Y,(0,n.jsxs)("div",{className:"add-project-modal__footer",children:[(0,n.jsxs)("div",{className:"add-project-modal__foldercount",children:[H.length," folders"]}),(0,n.jsxs)("div",{className:"add-project-modal__actions",children:[(0,n.jsx)("button",{type:"button",onClick:r,className:"add-project-modal__ghostbtn",children:"Cancel"}),(0,n.jsx)("button",{type:"button",onClick:()=>void Z(),disabled:!q||i,className:"add-project-modal__primarybtn",children:i?"Adding…":"Add project"})]})]})]})})}var C=r(2749);function E(e){var t;let{open:r,projectId:s,onClose:a}=e,o=(0,l.useRef)(null),[i,c]=(0,l.useState)(!1),[d,u]=(0,l.useState)(null),[p,m]=(0,l.useState)(null);(0,l.useEffect)(()=>{var e;r&&s&&(null==(e=o.current)||e.focus())},[r,s]),(0,l.useEffect)(()=>{if(!r)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),a())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r,a]),(0,l.useEffect)(()=>{if(!r||!s){m(null),u(null),c(!1);return}let e=!1;return c(!0),u(null),m(null),fetch("/api/projects/".concat(encodeURIComponent(s))).then(async t=>{let r=await t.json().catch(()=>null);if(!t.ok||!(null==r?void 0:r.project)||r.degraded){var n;throw Error(null!=(n=null==r?void 0:r.error)?n:"Failed to load project settings.")}e||m(r.project)}).catch(t=>{e||u(t instanceof Error?t.message:"Failed to load project settings.")}).finally(()=>{e||c(!1)}),()=>{e=!0}},[r,s]);let h=(0,l.useMemo)(()=>{var e,t,r,n,a,l,o,i,c,d;return p&&s?{agent:null!=(r=p.agent)?r:"",runtime:null!=(n=p.runtime)?n:"",trackerPlugin:null!=(a=null==(e=p.tracker)?void 0:e.plugin)?a:"",scmPlugin:null!=(l=null==(t=p.scm)?void 0:t.plugin)?l:"",reactions:JSON.stringify(null!=(o=p.reactions)?o:{},null,2),identity:{projectId:s,path:p.path,storageKey:null!=(i=p.storageKey)?i:"",repo:null!=(c=p.repo)?c:"",defaultBranch:null!=(d=p.defaultBranch)?d:"main"}}:null},[p,s]);return r&&s?(0,n.jsx)("div",{className:"project-settings-modal-backdrop",onClick:a,children:(0,n.jsxs)("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":"Project settings",className:"project-settings-modal",tabIndex:-1,onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"project-settings-modal__header",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"project-settings-modal__eyebrow",children:"Project settings"}),(0,n.jsx)("h2",{className:"project-settings-modal__title",children:null!=(t=null==p?void 0:p.name)?t:s})]}),(0,n.jsx)("button",{type:"button","aria-label":"Close",onClick:a,className:"project-settings-modal__close",children:"\xd7"})]}),(0,n.jsxs)("div",{className:"project-settings-modal__body",children:[i?(0,n.jsx)("div",{className:"project-settings-modal__state",children:"Loading project settings…"}):null,!i&&d?(0,n.jsx)("div",{role:"alert",className:"project-settings-modal__state project-settings-modal__state--error",children:d}):null,i||d||!h?null:(0,n.jsx)(C.ProjectSettingsForm,{projectId:s,initialValues:h})]})]})}):null}function P(e){let{level:t}=e;return(0,n.jsx)("div",{className:(0,i.cn)("sidebar-session-dot shrink-0 rounded-full","working"===t&&"sidebar-session-dot--glow"),"data-level":t})}let I="ao:sidebar:show-session-id";function R(){try{return"true"===window.localStorage.getItem(I)}catch(e){return!1}}let M={working:"working",pending:"pending",review:"review",respond:"respond",action:"action",merge:"merge",done:"done"};function T(e){return 0===e.projects.length?null:(0,n.jsx)(L,{...e})}function L(e){let{projects:t,sessions:r,activeProjectId:s,activeSessionId:j,loading:f=!1,error:v=!1,onRetry:g,collapsed:b=!1,onToggleCollapsed:_,onMobileClose:x}=e,y=(0,o.useRouter)(),N=f||null===r,[w,k]=(0,l.useState)(()=>new Set(s&&"all"!==s?[s]:[])),[C,T]=(0,l.useState)(!1),[L,D]=(0,l.useState)(!1),[O,A]=(0,l.useState)(R),[W,B]=(0,l.useState)(!1),[U,F]=(0,l.useState)(null),[K,H]=(0,l.useState)(null),[G,J]=(0,l.useState)(null),[z,V]=(0,l.useState)(new Set),[$,q]=(0,l.useState)(!1),X=(0,l.useRef)(null),Z=(0,l.useRef)(null),Q=(0,l.useRef)(null),Y=(0,l.useRef)(null);p(W,Z),p(!!U,Y),(0,l.useEffect)(()=>{try{window.localStorage.setItem(I,String(O))}catch(e){}},[O]),(0,l.useEffect)(()=>{if(!W)return;let e=e=>{X.current&&!X.current.contains(e.target)&&B(!1)},t=e=>{"Escape"===e.key&&B(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[W]),(0,l.useEffect)(()=>{if(!U)return;let e=e=>{Q.current&&!Q.current.contains(e.target)&&F(null)},t=e=>{"Escape"===e.key&&F(null)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[U]),(0,l.useEffect)(()=>{s&&"all"!==s&&k(e=>new Set([...e,s]))},[s]),(0,l.useEffect)(()=>{V(e=>{if(0===e.size)return e;let r=new Set([...e].filter(e=>!t.some(t=>t.id===e)));return r.size===e.size?e:r})},[t]);let ee=(0,l.useMemo)(()=>t.filter(e=>!z.has(e.id)),[t,z]),et=(0,l.useMemo)(()=>new Map(ee.map(e=>{var t;return[e.id,null!=(t=e.sessionPrefix)?t:e.id]})),[ee]),er=(0,l.useMemo)(()=>ee.map(e=>{var t;return null!=(t=e.sessionPrefix)?t:e.id}),[ee]),en=(0,l.useMemo)(()=>{let e=new Map,t=new Set(ee.map(e=>e.id));for(let s of null!=r?r:[]){var n;if(!t.has(s.projectId)||(0,d.tT)(s,et.get(s.projectId),er)||"killed"===s.status&&!C||"done"===(0,c.ng)(s)&&!L)continue;let r=null!=(n=e.get(s.projectId))?n:[];r.push(s),e.set(s.projectId,r)}return e},[r,et,er,ee,C,L]),es=(e,t)=>{if(t)try{sessionStorage.setItem("ao-session-nav:".concat(t.id),JSON.stringify(t))}catch(e){}y.push(e),null==x||x()},ea=async e=>{if(window.confirm("Remove project ".concat(e.name," from AO? This clears its AO sessions/history and removes it from the portfolio, but keeps the repository folder on disk."))){J(e.id);try{let r=await fetch("/api/projects/".concat(encodeURIComponent(e.id)),{method:"DELETE"}),n=await r.json().catch(()=>null);if(!r.ok){var t;throw Error(null!=(t=n&&"object"==typeof n&&"error"in n&&"string"==typeof n.error?n.error:null)?t:"Failed to remove project.")}V(t=>new Set(t).add(e.id)),k(t=>{let r=new Set(t);return r.delete(e.id),r}),F(null),s===e.id?y.push("/"):"refresh"in y&&"function"==typeof y.refresh&&y.refresh(),null==x||x()}catch(e){window.alert(e instanceof Error?e.message:"Failed to remove project.")}finally{J(null)}}};return b?(0,n.jsx)("aside",{className:(0,i.cn)("project-sidebar project-sidebar--collapsed flex flex-col h-full items-center py-2 gap-1 overflow-y-auto"),children:ee.map((e,t)=>{var r;let a=null!=(r=en.get(e.id))?r:[],l=e.name.slice(0,2).toUpperCase();return(0,n.jsxs)("div",{className:"flex flex-col items-center gap-0.5 w-full px-1",children:[t>0&&(0,n.jsx)("div",{className:"project-sidebar__collapsed-divider","aria-hidden":"true"}),(0,n.jsx)("a",{href:(0,m.bn)(e.id),className:(0,i.cn)("project-sidebar__collapsed-icon",s===e.id&&"project-sidebar__collapsed-icon--active"),title:e.name,"aria-label":e.name,children:(0,n.jsx)("span",{className:"project-sidebar__collapsed-abbr",children:l})}),a.slice(0,5).map(t=>{var r;let s=(0,c.ng)(t),a=null!=(r=t.branch)?r:(0,u.Pn)(t),l=(t.branch&&(0,u.mC)(t.branch)||a).replace(/\s+/g,"").slice(0,3).toUpperCase(),o=j===t.id,d=(0,m.Nc)(e.id,t.id);return(0,n.jsxs)("a",{href:d,onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||1===e.button||(e.preventDefault(),es(d,t))},className:(0,i.cn)("project-sidebar__collapsed-session-btn",o&&"project-sidebar__collapsed-session-btn--active"),"data-level":s,title:a,"aria-label":a,children:[(0,n.jsx)("span",{className:"project-sidebar__session-abbr-first",children:l[0]}),(0,n.jsx)("span",{className:"project-sidebar__session-abbr-rest",children:l.slice(1)})]},t.id)}),a.length>5&&(0,n.jsxs)("span",{className:"project-sidebar__collapsed-overflow",children:["+",a.length-5]})]},e.id)})}):(0,n.jsxs)("aside",{className:"project-sidebar flex h-full flex-col",children:[(0,n.jsxs)("div",{className:"project-sidebar__compact-hdr",children:[(0,n.jsx)("span",{className:"project-sidebar__sect-label",children:"Projects"}),(0,n.jsx)("button",{type:"button",className:"project-sidebar__add-btn","aria-label":"New project",onClick:()=>q(!0),children:(0,n.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M12 5v14M5 12h14"})})})]}),v&&r&&r.length>0?(0,n.jsxs)("div",{role:"status",className:"mx-3 mb-2 flex items-center justify-between gap-2 rounded-md border border-[var(--color-border-strong)] bg-[var(--color-bg-primary)] px-2 py-1.5 text-[11px] text-[var(--color-text-tertiary)]",children:[(0,n.jsx)("span",{children:"Failed to refresh \xb7 showing cached sessions"}),g?(0,n.jsx)("button",{type:"button",onClick:g,className:"font-medium text-[var(--color-link)] hover:underline",children:"Retry"}):null]}):null,(0,n.jsx)("div",{className:"project-sidebar__tree flex-1 overflow-y-auto overflow-x-hidden",children:ee.map(e=>{var t;let l=null!=(t=en.get(e.id))?t:[],o=w.has(e.id),p=s===e.id,h=!!e.resolveError,f=(0,m.bn)(e.id),b=l.length>0,_=null==r?void 0:r.find(t=>(0,d.tT)(t,et.get(t.projectId),er)&&t.projectId===e.id);return(0,n.jsxs)("div",{className:"project-sidebar__project",children:[(0,n.jsxs)("div",{className:"project-sidebar__proj-row flex items-center",children:[h?(0,n.jsxs)("a",{href:f,onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||1===e.button||(e.preventDefault(),es(f))},className:(0,i.cn)("project-sidebar__proj-toggle project-sidebar__proj-toggle--link project-sidebar__proj-toggle--degraded",p&&"project-sidebar__proj-toggle--active"),"aria-current":p?"page":void 0,children:[(0,n.jsxs)("svg",{className:"project-sidebar__proj-chevron project-sidebar__proj-chevron--degraded",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M12 9v4"}),(0,n.jsx)("path",{d:"M12 17h.01"}),(0,n.jsx)("path",{d:"M10.3 3.86 1.82 18a2 2 0 0 0 1.72 3h16.92a2 2 0 0 0 1.72-3L13.7 3.86a2 2 0 0 0-3.4 0Z"})]}),(0,n.jsx)("span",{className:"project-sidebar__proj-name",children:e.name}),(0,n.jsx)("span",{className:"project-sidebar__proj-badge project-sidebar__proj-badge--degraded",children:"degraded"})]}):(0,n.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.id,void k(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})},className:(0,i.cn)("project-sidebar__proj-toggle",p&&"project-sidebar__proj-toggle--active"),"aria-expanded":o,"aria-current":p?"page":void 0,children:[(0,n.jsx)("svg",{className:(0,i.cn)("project-sidebar__proj-chevron",o&&"project-sidebar__proj-chevron--open"),width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"m9 18 6-6-6-6"})}),(0,n.jsx)("span",{className:"project-sidebar__proj-name",children:e.name}),(0,n.jsx)("span",{className:(0,i.cn)("project-sidebar__proj-badge",b&&"project-sidebar__proj-badge--active"),children:l.length})]}),h?null:(0,n.jsx)(a(),{href:f,onClick:e=>{e.stopPropagation(),null==x||x()},className:"project-sidebar__proj-action","aria-label":"Open ".concat(e.name," dashboard"),title:"Dashboard",children:(0,n.jsx)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M3 13h8V3H3zm10 8h8V11h-8zM3 21h8v-6H3zm10-10h8V3h-8z"})})}),!h&&_&&(0,n.jsx)(a(),{href:(0,m.Nc)(e.id,_.id),onClick:e=>{e.stopPropagation(),null==x||x()},className:"project-sidebar__proj-action","aria-label":"Open ".concat(e.name," orchestrator"),title:"Orchestrator",children:(0,n.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,n.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,n.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,n.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,n.jsx)("circle",{cx:"18",cy:"17",r:"2"})]})}),(0,n.jsxs)("div",{className:"project-sidebar__proj-menu",ref:U===e.id?Q:void 0,children:[(0,n.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),F(t=>t===e.id?null:e.id)},className:"project-sidebar__proj-action project-sidebar__proj-action--menu","aria-label":"Project actions for ".concat(e.name),"aria-expanded":U===e.id,"aria-haspopup":"menu",title:"Project actions",children:(0,n.jsxs)("svg",{width:"12",height:"12",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,n.jsx)("circle",{cx:"12",cy:"5",r:"1.75"}),(0,n.jsx)("circle",{cx:"12",cy:"12",r:"1.75"}),(0,n.jsx)("circle",{cx:"12",cy:"19",r:"1.75"})]})}),U===e.id?(0,n.jsxs)("div",{ref:Y,className:"project-sidebar__proj-menu-popover",role:"menu","aria-label":"".concat(e.name," actions"),children:[(0,n.jsx)("button",{type:"button",className:"project-sidebar__proj-menu-item",role:"menuitem",onClick:()=>{F(null),H(e.id)},children:"Project settings"}),(0,n.jsx)("button",{type:"button",className:"project-sidebar__proj-menu-item project-sidebar__proj-menu-item--danger",role:"menuitem",onClick:()=>void ea(e),disabled:G===e.id,children:G===e.id?"Removing...":"Remove project"})]}):null]})]}),h?(0,n.jsx)("div",{className:"project-sidebar__degraded-note",children:"Config needs repair"}):null,!h&&o&&(0,n.jsx)("div",{className:"project-sidebar__sessions",children:N?(0,n.jsx)("div",{className:"space-y-2 px-3 py-2","aria-label":"Loading sessions",children:Array.from({length:3},(t,r)=>(0,n.jsxs)("div",{className:"flex items-center gap-3 border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)] px-2 py-2",children:[(0,n.jsx)("div",{className:"h-2 w-2 shrink-0 animate-pulse bg-[var(--color-border-strong)]"}),(0,n.jsx)("div",{className:"h-3 flex-1 animate-pulse bg-[var(--color-bg-primary)]"}),(0,n.jsx)("div",{className:"h-3 w-12 animate-pulse bg-[var(--color-bg-primary)]"})]},"".concat(e.id,"-loading-").concat(r)))}):l.length>0?l.map(t=>{var r;let s=(0,c.ng)(t),a=j===t.id,l=null!=(r=t.branch)?r:(0,u.Pn)(t),o=(0,m.Nc)(e.id,t.id);return(0,n.jsxs)("a",{href:o,onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||1===e.button||(e.preventDefault(),es(o,t))},className:(0,i.cn)("project-sidebar__sess-row",a&&"project-sidebar__sess-row--active"),"aria-current":a?"page":void 0,"aria-label":"Open ".concat(l),children:[(0,n.jsx)(P,{level:s}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("span",{className:(0,i.cn)("project-sidebar__sess-label",a&&"project-sidebar__sess-label--active"),children:l}),O?(0,n.jsxs)("div",{className:"project-sidebar__sess-meta",children:[(0,n.jsx)("span",{className:"project-sidebar__sess-id",children:t.id}),(0,n.jsx)("span",{className:"project-sidebar__sess-status",children:M[s]})]}):null]}),O?null:(0,n.jsx)("span",{className:"project-sidebar__sess-status project-sidebar__sess-status--inline",children:M[s]})]},t.id)}):v?(0,n.jsxs)("div",{className:"px-3 py-2",children:[(0,n.jsx)("div",{className:"project-sidebar__empty",children:"Failed to load sessions"}),(0,n.jsx)("button",{type:"button",className:"mt-2 text-xs font-medium text-[var(--color-link)] hover:underline",onClick:g,children:"Retry"})]}):(0,n.jsx)("div",{className:"project-sidebar__empty",children:"No active sessions"})})]},e.id)})}),(0,n.jsx)("div",{className:"project-sidebar__footer",children:(0,n.jsxs)("div",{className:"flex items-center gap-1 border-t border-[var(--color-border-subtle)] px-2 py-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>T(!C),className:(0,i.cn)("project-sidebar__footer-btn",C&&"project-sidebar__footer-btn--active"),"aria-pressed":C,title:C?"Hide killed sessions":"Show killed sessions","aria-label":C?"Hide killed sessions":"Show killed sessions",children:(0,n.jsxs)("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M12 3C7.03 3 3 7.03 3 12c0 3.1 1.5 5.84 3.8 7.55V21h2.4v-1h1.6v1h2.4v-1h1.6v1H17v-1.45A9 9 0 0 0 21 12c0-4.97-4.03-9-9-9z"}),(0,n.jsx)("circle",{cx:"9",cy:"11",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"15",cy:"11",r:"1.5",fill:"currentColor",stroke:"none"})]})}),(0,n.jsx)("button",{type:"button",onClick:()=>D(!L),className:(0,i.cn)("project-sidebar__footer-btn",L&&"project-sidebar__footer-btn--active"),"aria-pressed":L,title:L?"Hide completed sessions":"Show completed sessions","aria-label":L?"Hide completed sessions":"Show completed sessions",children:(0,n.jsx)("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,n.jsx)("div",{className:"flex-1"}),(0,n.jsxs)("div",{className:"project-sidebar__settings-wrap",ref:X,children:[(0,n.jsx)("button",{type:"button",onClick:()=>B(e=>!e),className:(0,i.cn)("project-sidebar__footer-btn",W&&"project-sidebar__footer-btn--active"),"aria-expanded":W,"aria-haspopup":"dialog",title:"Sidebar settings","aria-label":"Sidebar settings",children:(0,n.jsxs)("svg",{width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,n.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}),W?(0,n.jsx)("div",{ref:Z,className:"project-sidebar__settings-popover",role:"dialog","aria-label":"Sidebar settings",children:(0,n.jsxs)("label",{className:"project-sidebar__settings-row",children:[(0,n.jsx)("input",{type:"checkbox",checked:O,onChange:e=>A(e.target.checked)}),(0,n.jsx)("span",{children:"Show session ID"})]})}):null]}),(0,n.jsx)(h.U,{className:"project-sidebar__theme-toggle"})]})}),(0,n.jsx)(S,{open:$,onClose:()=>q(!1)}),(0,n.jsx)(E,{open:null!==K,projectId:K,onClose:()=>H(null)})]})}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9170],{519:(e,r,s)=>{Promise.resolve().then(s.bind(s,4255))},1712:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let t=s(1903)._(s(5864));function a(e,r){var s;let a={};"function"==typeof e&&(a.loader=e);let n={...a,...r};return(0,t.default)({...n,modules:null==(s=n.loadableGenerated)?void 0:s.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},4255:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>x,dynamic:()=>c});var t=s(3817),a=s(9891),n=s(7594),i=s(6749);let l=(0,a.default)(()=>Promise.all([s.e(8944),s.e(6078)]).then(s.bind(s,6078)).then(e=>({default:e.DirectTerminal})),{loadableGenerated:{webpack:()=>[6078]},ssr:!1}),o=(0,a.default)(()=>s.e(7317).then(s.bind(s,7317)).then(e=>({default:e.Terminal})),{loadableGenerated:{webpack:()=>[7317]},ssr:!1}),c="force-dynamic";function d(){let e=(0,n.useSearchParams)(),[r,s]=(0,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,{})})}},5468:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,r){for(var s in r)Object.defineProperty(e,s,{enumerable:!0,get:r[s]})}(r,{bindSnapshot:function(){return 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)}}},5864:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let t=s(3817),a=s(6749),n=s(6943);function i(e){return{default:e&&"default"in e?e.default:e}}s(6418);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}},6313:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return t.workAsyncStorageInstance}});let t=s(8394)},6418:(e,r,s)=>{"use strict";function t(e){let{moduleIds:r}=e;return null}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return t}}),s(3817),s(4768),s(6313),s(5152)},6943:(e,r,s)=>{"use strict";function t(e){let{reason:r,children:s}=e;return s}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return t}}),s(1763)},7594:(e,r,s)=>{"use strict";var t=s(9582);s.o(t,"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}})},8394:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return t}});let t=(0,s(5468).createAsyncLocalStorage)()},9891:(e,r,s)=>{"use strict";s.d(r,{default:()=>a.a});var t=s(1712),a=s.n(t)}},e=>{e.O(0,[131,1461,7358],()=>e(e.s=519)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8039],{3464:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>s});var t=o(3817),a=o(7594),n=o(6749),l=o(9789);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"})}},6514:(r,e,o)=>{Promise.resolve().then(o.bind(o,3464))},7594:(r,e,o)=>{"use strict";var t=o(9582);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}})},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var t=o(3817),a=o(8713),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]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=6514)),_N_E=r.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4219],{3070:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>n});var l=o(6409),t=o(4669),a=o(6901);function n(r){let{error:e,reset:o}=r;return(0,t.useEffect)(()=>{console.error(e)},[e]),(0,l.jsx)("html",{lang:"en",className:"dark",children:(0,l.jsx)("body",{className:"bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased",children:(0,l.jsx)(a.ErrorDisplay,{title:"Something broke at the app shell",message:"The dashboard could not recover from this error at the layout level. Try again first, then reload the page if it still fails.",tone:"error",primaryAction:{label:"Try again",onClick:o},secondaryAction:{label:"Reload page",onClick:()=>window.location.reload()},error:e})})})}},3853:(r,e,o)=>{Promise.resolve().then(o.bind(o,3070))},6901:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var l=o(6409),t=o(7505),a=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,l.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,l.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,l.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,l.jsx)(a(),{href:e.href,className:t,style:n,children:e.label}):(0,l.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:a="Technical details",error:i,primaryAction:d,secondaryAction:x,compact:b=!1,chrome:m="page",children:u}=r,v=n[t],p=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,l.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(b?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,l.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,l.jsx)(s,{accent:v.accent}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,l.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,l.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||x)&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,l.jsx)(c,{action:d,primary:!0}):null,x?(0,l.jsx)(c,{action:x}):null]}),u,p?(0,l.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,l.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:a}),(0,l.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,l.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,l.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,l.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[7505,4429,8597,7358],()=>r(r.s=3853)),_N_E=r.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4219],{7494:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>n});var l=o(3817),t=o(6749),a=o(9789);function n(r){let{error:e,reset:o}=r;return(0,t.useEffect)(()=>{console.error(e)},[e]),(0,l.jsx)("html",{lang:"en",className:"dark",children:(0,l.jsx)("body",{className:"bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased",children:(0,l.jsx)(a.ErrorDisplay,{title:"Something broke at the app shell",message:"The dashboard could not recover from this error at the layout level. Try again first, then reload the page if it still fails.",tone:"error",primaryAction:{label:"Try again",onClick:o},secondaryAction:{label:"Reload page",onClick:()=>window.location.reload()},error:e})})})}},9576:(r,e,o)=>{Promise.resolve().then(o.bind(o,7494))},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var l=o(3817),t=o(8713),a=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,l.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,l.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,l.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,l.jsx)(a(),{href:e.href,className:t,style:n,children:e.label}):(0,l.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:a="Technical details",error:i,primaryAction:d,secondaryAction:x,compact:b=!1,chrome:m="page",children:u}=r,v=n[t],p=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,l.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(b?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,l.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,l.jsx)(s,{accent:v.accent}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,l.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,l.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||x)&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,l.jsx)(c,{action:d,primary:!0}):null,x?(0,l.jsx)(c,{action:x}):null]}),u,p?(0,l.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,l.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:a}),(0,l.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,l.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,l.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,l.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=9576)),_N_E=r.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{1012:(e,t,r)=>{"use strict";r.d(t,{Providers:()=>a});var n=r(3817),o=r(2286),s=r(5184);function a(e){let{children:t}=e;return(0,n.jsx)(o.N,{attribute:"class",defaultTheme:"dark",enableSystem:!1,children:(0,n.jsx)(s.i2,{children:t})})}},2286:(e,t,r)=>{"use strict";r.d(t,{D:()=>u,N:()=>d});var n=r(6749),o=(e,t,r,n,o,s,a,c)=>{let i=document.documentElement,l=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&s?o.map(e=>s[e]||e):o;r?(i.classList.remove(...n),i.classList.add(s&&s[t]?s[t]:t)):i.setAttribute(e,t)}),r=t,c&&l.includes(r)&&(i.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=a&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},s=["light","dark"],a="(prefers-color-scheme: dark)",c="undefined"==typeof window,i=n.createContext(void 0),l={setTheme:e=>{},themes:[]},u=()=>{var e;return null!=(e=n.useContext(i))?e:l},d=e=>n.useContext(i)?n.createElement(n.Fragment,null,e.children):n.createElement(f,{...e}),m=["light","dark"],f=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:o=!0,enableColorScheme:c=!0,storageKey:l="theme",themes:u=m,defaultTheme:d=o?"system":"light",attribute:f="data-theme",value:b,children:g,nonce:S,scriptProps:k}=e,[w,E]=n.useState(()=>y(l,d)),[P,x]=n.useState(()=>"system"===w?p():w),T=b?Object.values(b):u,C=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&o&&(t=p());let n=b?b[t]:t,a=r?v(S):null,i=document.documentElement,l=e=>{"class"===e?(i.classList.remove(...T),n&&i.classList.add(n)):e.startsWith("data-")&&(n?i.setAttribute(e,n):i.removeAttribute(e))};if(Array.isArray(f)?f.forEach(l):l(f),c){let e=s.includes(d)?d:null,r=s.includes(t)?t:e;i.style.colorScheme=r}null==a||a()},[S]),N=n.useCallback(e=>{let t="function"==typeof e?e(w):e;E(t);try{localStorage.setItem(l,t)}catch(e){}},[w]),_=n.useCallback(e=>{x(p(e)),"system"===w&&o&&!t&&C("system")},[w,t]);n.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(_),_(e),()=>e.removeListener(_)},[_]),n.useEffect(()=>{let e=e=>{e.key===l&&(e.newValue?E(e.newValue):N(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[N]),n.useEffect(()=>{C(null!=t?t:w)},[t,w]);let M=n.useMemo(()=>({theme:w,setTheme:N,forcedTheme:t,resolvedTheme:"system"===w?P:w,themes:o?[...u,"system"]:u,systemTheme:o?P:void 0}),[w,N,t,P,o,u]);return n.createElement(i.Provider,{value:M},n.createElement(h,{forcedTheme:t,storageKey:l,attribute:f,enableSystem:o,enableColorScheme:c,defaultTheme:d,value:b,themes:u,nonce:S,scriptProps:k}),g)},h=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:s,enableSystem:a,enableColorScheme:c,defaultTheme:i,value:l,themes:u,nonce:d,scriptProps:m}=e,f=JSON.stringify([s,r,i,t,u,l,a,c]).slice(1,-1);return n.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?d:"",dangerouslySetInnerHTML:{__html:"(".concat(o.toString(),")(").concat(f,")")}})}),y=(e,t)=>{let r;if(!c){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)}},p=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light")},2490:()=>{},4069:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,9353,23)),Promise.resolve().then(r.t.bind(r,6164,23)),Promise.resolve().then(r.t.bind(r,2490,23)),Promise.resolve().then(r.bind(r,1012)),Promise.resolve().then(r.bind(r,7285))},5184:(e,t,r)=>{"use strict";r.d(t,{Ug:()=>c,eT:()=>i,i2:()=>l});var n=r(3817),o=r(6749),s=r(1806);let a=o.createContext(void 0);function c(){let e=o.useContext(a);if(!e)throw Error("useMux() must be used within <MuxProvider>");return e}function i(){return o.useContext(a)}function l(e){let{children:t}=e,r=(0,o.useRef)(null),c=(0,o.useRef)(new Map),i=(0,o.useRef)(new Set),[l,u]=(0,o.useState)("connecting"),[d,m]=(0,o.useState)([]),f=(0,o.useRef)(0),h=(0,o.useRef)(null),y=(0,o.useRef)({}),v=(0,o.useRef)(!1),p=(0,o.useCallback)(()=>{if(!r.current){u("connecting");try{let e=function(e){var t,r,n;let o=window.location,a="https:"===o.protocol?"wss:":"ws:",c=null!=(t=e.proxyWsPath)?t:s.env.NEXT_PUBLIC_TERMINAL_WS_PATH;if(c){let e=c.replace(/\/ws\/?$/,"");return"".concat(a,"//").concat(o.host).concat(e,"/mux")}if(""===o.port||"443"===o.port||"80"===o.port)return"".concat(a,"//").concat(o.hostname,"/ao-terminal-mux");let i=null!=(n=null!=(r=e.directTerminalPort)?r:s.env.NEXT_PUBLIC_DIRECT_TERMINAL_PORT)?n:"14801";return"".concat(a,"//").concat(o.hostname,":").concat(i,"/mux")}(y.current);console.log("[MuxProvider] Connecting to",e);let t=new WebSocket(e);r.current=t,t.addEventListener("open",()=>{if(v.current)return void t.close();for(let e of(console.log("[MuxProvider] Connected"),u("connected"),f.current=0,i.current)){let r={ch:"terminal",id:e,type:"open"};t.send(JSON.stringify(r))}t.send(JSON.stringify({ch:"subscribe",topics:["sessions"]}))}),t.addEventListener("message",e=>{try{let t=JSON.parse(e.data);if("terminal"===t.ch)if("data"===t.type){let e=c.current.get(t.id);if(e)for(let r of e)r(t.data)}else if("opened"===t.type)i.current.add(t.id);else if("exited"===t.type){i.current.delete(t.id);let e=c.current.get(t.id);if(e){let r="\r\n\x1b[31m[Terminal exited with code ".concat(t.code,"]\x1b[0m\r\n");for(let t of e)t(r)}}else"error"===t.type&&console.error("[MuxProvider] Terminal error for ".concat(t.id,":"),t.message);else"sessions"===t.ch&&"snapshot"===t.type&&m(t.sessions)}catch(e){console.error("[MuxProvider] Error processing message:",e)}}),t.addEventListener("error",e=>{console.error("[MuxProvider] WebSocket error:",e)}),t.addEventListener("close",()=>{if(console.log("[MuxProvider] Disconnected"),r.current===t&&(r.current=null),v.current)return;let e=Math.min(1e3*Math.pow(2,f.current),3e4);f.current+=1,u("reconnecting"),h.current=setTimeout(()=>{console.log("[MuxProvider] Reconnecting (attempt ".concat(f.current,")...")),p()},e)})}catch(e){console.error("[MuxProvider] Failed to create WebSocket:",e),u("disconnected")}}},[]);(0,o.useEffect)(()=>{v.current=!1;let e=!1;return(async()=>{try{let e=await fetch("/api/runtime/terminal");if(e.ok){let t=await e.json();y.current={directTerminalPort:function(e){if("string"!=typeof e&&"number"!=typeof e)return;let t=Number.parseInt(String(e),10);if(Number.isInteger(t)&&!(t<=0)&&!(t>65535))return String(t)}(t.directTerminalPort),proxyWsPath:function(e){if("string"!=typeof e)return;let t=e.trim();if(t.startsWith("/"))return t}(t.proxyWsPath)}}}catch(e){}e||p()})(),()=>{var t;e=!0,v.current=!0,h.current&&clearTimeout(h.current),null==(t=r.current)||t.close()}},[p]);let b=(0,o.useCallback)((e,t)=>{var n;let o=c.current.get(e);return o||(o=new Set,c.current.set(e,o)),o.add(t),i.current.has(e)||(null==(n=r.current)?void 0:n.readyState)!==WebSocket.OPEN||r.current.send(JSON.stringify({ch:"terminal",id:e,type:"open"})),()=>{let r=c.current.get(e);r&&(r.delete(t),0===r.size&&c.current.delete(e))}},[]),g=(0,o.useCallback)((e,t)=>{var n;(null==(n=r.current)?void 0:n.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({ch:"terminal",id:e,type:"data",data:t}))},[]),S=(0,o.useCallback)(e=>{var t;i.current.add(e),(null==(t=r.current)?void 0:t.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({ch:"terminal",id:e,type:"open"}))},[]),k=(0,o.useCallback)(e=>{var t;i.current.delete(e),(null==(t=r.current)?void 0:t.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({ch:"terminal",id:e,type:"close"}))},[]),w=(0,o.useCallback)((e,t,n)=>{var o;(null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({ch:"terminal",id:e,type:"resize",cols:t,rows:n}))},[]),E=(0,o.useMemo)(()=>({subscribeTerminal:b,writeTerminal:g,openTerminal:S,closeTerminal:k,resizeTerminal:w,status:l,sessions:d}),[b,g,S,k,w,l,d]);return(0,n.jsx)(a.Provider,{value:E,children:t})}},6164:e=>{e.exports={style:{fontFamily:"'JetBrains Mono', 'JetBrains Mono Fallback'",fontStyle:"normal"},className:"__className_6d24ac",variable:"__variable_6d24ac"}},7285:(e,t,r)=>{"use strict";r.d(t,{ServiceWorkerRegistrar:()=>o});var n=r(6749);function o(){return(0,n.useEffect)(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(e=>{console.error("Service worker registration failed:",e)})},[]),null}},9353:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_188709",variable:"__variable_188709"}}},e=>{e.O(0,[8940,3906,131,1461,7358],()=>e(e.s=4069)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4345,7927],{3164:(r,e,o)=>{Promise.resolve().then(o.bind(o,6901))},6901:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var l=o(6409),t=o(7505),a=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,l.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,l.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,l.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,l.jsx)(a(),{href:e.href,className:t,style:n,children:e.label}):(0,l.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:a="Technical details",error:i,primaryAction:d,secondaryAction:x,compact:b=!1,chrome:u="page",children:m}=r,v=n[t],p=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,l.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(b?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===u?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,l.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,l.jsx)(s,{accent:v.accent}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,l.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,l.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||x)&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,l.jsx)(c,{action:d,primary:!0}):null,x?(0,l.jsx)(c,{action:x}):null]}),m,p?(0,l.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,l.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:a}),(0,l.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,l.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,l.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,l.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[7505,4429,8597,7358],()=>r(r.s=3164)),_N_E=r.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4345,7927],{9660:(r,e,o)=>{Promise.resolve().then(o.bind(o,9789))},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var l=o(3817),t=o(8713),a=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,l.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,l.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,l.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,l.jsx)(a(),{href:e.href,className:t,style:n,children:e.label}):(0,l.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:a="Technical details",error:i,primaryAction:d,secondaryAction:x,compact:b=!1,chrome:u="page",children:m}=r,v=n[t],p=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,l.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(b?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===u?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,l.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,l.jsx)(s,{accent:v.accent}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,l.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,l.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||x)&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,l.jsx)(c,{action:d,primary:!0}):null,x?(0,l.jsx)(c,{action:x}):null]}),m,p?(0,l.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,l.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:a}),(0,l.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,l.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,l.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,l.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=9660)),_N_E=r.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9428],{2900:(e,r,t)=>{Promise.resolve().then(t.bind(t,9574))},4901:(e,r,t)=>{"use strict";function s(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.filter(Boolean).join(" ")}t.d(r,{cn:()=>s})},7594:(e,r,t)=>{"use strict";var s=t(9582);t.o(s,"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}})},8450:(e,r,t)=>{"use strict";function s(e){return"/projects/".concat(encodeURIComponent(e))}function a(e,r){return"".concat(s(e),"/sessions/").concat(encodeURIComponent(r))}function n(e,r,t){return"".concat(a(e,r)).concat(t)}t.d(r,{$l:()=>n,Nc:()=>a,bn:()=>s})},9574:(e,r,t)=>{"use strict";t.d(r,{OrchestratorSelector:()=>u});var s=t(3817),a=t(6749),n=t(7594),c=t(8713),o=t.n(c),i=t(4901),l=t(8450);function d(e){if(!e)return"Unknown";let r=new Date(e).getTime();if(!Number.isFinite(r))return"Unknown";let t=new Date().getTime()-r;if(t<0)return"Just now";let s=Math.floor(t/6e4),a=Math.floor(s/60),n=Math.floor(a/24);return s<1?"Just now":s<60?"".concat(s,"m ago"):a<24?"".concat(a,"h ago"):"".concat(n,"d ago")}function u(e){let{orchestrators:r,projectId:t,projectName:c,error:u}=e,x=(0,n.useRouter)(),[m,h]=(0,a.useState)(!1),[v,f]=(0,a.useState)(null),p=(0,a.useRef)(!1),b=async()=>{if(!p.current){p.current=!0,h(!0),f(null);try{let e=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:t})});if(!e.ok){let r=await e.json();throw Error(r.error||"Failed to spawn orchestrator")}let r=await e.json();x.push((0,l.Nc)(t,r.orchestrator.id))}catch(e){f(e instanceof Error?e.message:"Failed to spawn orchestrator")}finally{h(!1),p.current=!1}}};return u?(0,s.jsx)("div",{className:"flex h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-[var(--color-text-primary)]",children:"Error"}),(0,s.jsx)("p",{className:"mt-2 text-[var(--color-text-secondary)]",children:u}),(0,s.jsx)(o(),{href:"/",className:"orchestrator-btn mt-4 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium",children:"Go to Dashboard"})]})}):(0,s.jsxs)("div",{className:"flex min-h-screen flex-col bg-[var(--color-bg-base)]",children:[(0,s.jsx)("header",{className:"nav-glass sticky top-0 z-10 border-b border-[var(--color-border-subtle)] px-6 py-4",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-3xl items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-semibold text-[var(--color-text-primary)]",children:c}),(0,s.jsx)("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Select an orchestrator"})]}),(0,s.jsx)(o(),{href:(0,l.bn)(t),className:"text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]",children:"Dashboard"})]})}),(0,s.jsx)("main",{className:"flex-1 px-6 py-8",children:(0,s.jsxs)("div",{className:"mx-auto max-w-3xl",children:[(0,s.jsx)("div",{className:"mb-6 rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)] p-4",children:(0,s.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)(o(),{href:(0,l.Nc)(e.projectId,e.id),className:(0,i.cn)("flex items-center justify-between rounded-lg border border-[var(--color-border-subtle)] bg-[var(--color-bg-surface)] p-4","transition-all hover:border-[var(--color-border-default)] hover:shadow-sm"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:function(e){switch(e){case"working":return"var(--color-status-working)";case"spawning":return"var(--color-status-attention)";case"pr_open":case"review_pending":case"approved":case"mergeable":return"var(--color-status-ready)";case"ci_failed":case"changes_requested":return"var(--color-status-error)";case"merged":case"done":case"killed":case"terminated":return"var(--color-text-tertiary)";default:return"var(--color-text-secondary)"}}(e.status)}}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-[var(--color-text-primary)]",children:e.id}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-secondary)]",children:[(0,s.jsx)("span",{className:"capitalize",children:e.status.replace(/_/g," ")}),e.activity&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[var(--color-text-tertiary)]",children:"\xb7"}),(0,s.jsx)("span",{children:function(e){if(!e)return"";switch(e){case"active":return"Active";case"ready":return"Ready";case"idle":return"Idle";case"waiting_input":return"Waiting";case"blocked":return"Blocked";case"exited":return"Exited";default:return e}}(e.activity)})]})]})]})]}),(0,s.jsxs)("div",{className:"text-right text-xs text-[var(--color-text-tertiary)]",children:[(0,s.jsxs)("div",{children:["Created ",d(e.createdAt)]}),e.lastActivityAt&&(0,s.jsxs)("div",{children:["Active ",d(e.lastActivityAt)]})]})]},e.id))})]}),(0,s.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-6",children:[(0,s.jsx)("h2",{className:"mb-3 text-sm font-medium text-[var(--color-text-secondary)]",children:"Or Start Fresh"}),(0,s.jsx)("button",{type:"button",onClick:b,disabled:m,className:(0,i.cn)("orchestrator-btn w-full px-4 py-3 text-sm font-medium","disabled:cursor-wait disabled:opacity-70"),children:m?(0,s.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,s.jsxs)("svg",{className:"h-4 w-4 animate-spin",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Creating new orchestrator..."]}):"Start New Orchestrator"}),v&&(0,s.jsx)("p",{className:"mt-2 text-sm text-[var(--color-status-error)]",children:v})]})]})})]})}}},e=>{e.O(0,[8713,131,1461,7358],()=>e(e.s=2900)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{5619:(e,s,_)=>{Promise.resolve().then(_.bind(_,4465))}},e=>{e.O(0,[8713,9331,7008,4465,131,1461,7358],()=>e(e.s=5619)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25,64,403,719,816,1097,1105,1214,1337,1390,1762,1797,2007,2079,2438,2985,3675,4209,4587,5214,6681,6849,6865,6946,6999,7462,7500,8301,8581,9002,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1332],{5275:(e,r,t)=>{"use strict";t.d(r,{RepairDegradedProjectButton:()=>l});var o=t(3817),n=t(6749),a=t(7594);function l(e){let{projectId:r}=e,t=(0,a.useRouter)(),[l,c]=(0,n.useState)(!1),[i,s]=(0,n.useState)(null),d=async()=>{c(!0),s(null);try{let o=await fetch("/api/projects/".concat(encodeURIComponent(r)),{method:"POST"}),n=await o.json().catch(()=>null);if(!o.ok){var e;s(null!=(e=null==n?void 0:n.error)?e:"Failed to repair project config.");return}t.refresh()}catch(e){s("Network error while repairing project config.")}finally{c(!1)}};return(0,o.jsxs)("div",{className:"mt-6",children:[(0,o.jsx)("button",{type:"button",onClick:()=>void d(),disabled:l,className:"rounded-lg border border-[var(--color-accent)] bg-[var(--color-tint-blue)] px-4 py-2 text-sm font-semibold text-[var(--color-accent)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-accent)_14%,transparent)] disabled:cursor-not-allowed disabled:opacity-60",children:l?"Repairing...":"Repair config"}),i?(0,o.jsx)("p",{className:"mt-3 text-sm text-[var(--color-status-error)]",children:i}):null]})}},7242:(e,r,t)=>{Promise.resolve().then(t.t.bind(t,8713,23)),Promise.resolve().then(t.bind(t,4465)),Promise.resolve().then(t.bind(t,5275))}},e=>{e.O(0,[8713,9331,7008,4465,131,1461,7358],()=>e(e.s=7242)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3610],{7738:(e,s,_)=>{Promise.resolve().then(_.bind(_,6607))}},e=>{e.O(0,[8713,9331,6607,131,1461,7358],()=>e(e.s=7738)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3916],{2446:(e,t,r)=>{"use strict";r.d(t,{d:()=>c,t:()=>l});var s=r(3817),n=r(6749),a=r(4901);function i(e,t){return"SHOW"===t.type?{message:t.message,variant:t.variant,key:t.key}:null}let o=(0,n.createContext)(null);function l(e){let{children:t}=e,[r,l]=(0,n.useReducer)(i,null),c=(0,n.useRef)(null),u=(0,n.useRef)(0);(0,n.useEffect)(()=>()=>{null!==c.current&&clearTimeout(c.current)},[]);let d=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";null!==c.current&&clearTimeout(c.current),u.current+=1,l({type:"SHOW",message:e,variant:t,key:u.current}),c.current=setTimeout(()=>{l({type:"HIDE"}),c.current=null},3e3)},[]);return(0,s.jsxs)(o.Provider,{value:{showToast:d},children:[t,(0,s.jsx)("div",{className:"toast-container",role:"status","aria-live":"polite","aria-atomic":"true",children:r&&(0,s.jsxs)("div",{className:(0,a.cn)("toast","success"===r.variant&&"toast--success","error"===r.variant&&"toast--error","info"===r.variant&&"toast--info"),children:[(0,s.jsx)("span",{className:"toast__icon","aria-hidden":"true"}),(0,s.jsx)("span",{className:"toast__message",children:r.message})]},r.key)})]})}function c(){let e=(0,n.useContext)(o);if(!e)throw Error("useToast must be used within a ToastProvider");return e}},2749:(e,t,r)=>{"use strict";r.d(t,{ProjectSettingsForm:()=>d});var s=r(3817),n=r(6749),a=r(7594),i=r(2446);let o="These describe which repo this is. Change them via `ao project relink`.";function l(e){let{projectId:t,initialValues:r}=e,o=(0,a.useRouter)(),{showToast:l}=(0,i.d)(),[d,m]=(0,n.useState)(r.agent),[h,p]=(0,n.useState)(r.runtime),[j,g]=(0,n.useState)(r.trackerPlugin),[f,_]=(0,n.useState)(r.scmPlugin),[v,x]=(0,n.useState)(r.reactions),[b,y]=(0,n.useState)(!1),[N,k]=(0,n.useState)(null),[S,P]=(0,n.useState)(null),C=(0,n.useMemo)(()=>({agent:d.trim()||null,runtime:h.trim()||null,tracker:j.trim()?{plugin:j.trim()}:null,scm:f.trim()?{plugin:f.trim()}:null,reactions:v}),[d,h,j,f,v]),w=async()=>{let e;k(null),P(null);try{let t=v.trim();e=t?JSON.parse(t):void 0}catch(e){k("Reactions must be valid JSON.");return}y(!0);try{let s=await fetch("/api/projects/".concat(encodeURIComponent(t)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({agent:C.agent,runtime:C.runtime,tracker:C.tracker,scm:C.scm,reactions:null!=e?e:null})}),n=await s.json().catch(()=>null);if(!s.ok){var r;let e=null!=(r=null==n?void 0:n.error)?r:"Failed to save project settings.";400===s.status?k(e):P(e);return}l("Project settings updated.","success"),o.refresh()}catch(e){P("Network error while saving project settings.")}finally{y(!1)}};return(0,s.jsxs)("div",{className:"project-settings-form",children:[(0,s.jsxs)("section",{className:"project-settings-form__section",children:[(0,s.jsxs)("div",{className:"project-settings-form__section-header",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"project-settings-form__eyebrow",children:"Behavior"}),(0,s.jsx)("h2",{className:"project-settings-form__section-title",children:"Runtime configuration"}),(0,s.jsx)("p",{className:"project-settings-form__section-copy",children:"These values change how AO runs this project without changing which repository the project points at."})]}),(0,s.jsx)("button",{type:"button",onClick:()=>void w(),disabled:b,className:"project-settings-form__save",children:b?"Saving...":"Save changes"})]}),(0,s.jsxs)("div",{className:"project-settings-form__grid",children:[(0,s.jsx)(c,{id:"agent",label:"Agent",value:d,onChange:m,placeholder:"claude-code"}),(0,s.jsx)(c,{id:"runtime",label:"Runtime",value:h,onChange:p,placeholder:"tmux"}),(0,s.jsx)(c,{id:"tracker-plugin",label:"Tracker plugin",value:j,onChange:g,placeholder:"github"}),(0,s.jsx)(c,{id:"scm-plugin",label:"SCM plugin",value:f,onChange:_,placeholder:"github"})]}),(0,s.jsxs)("div",{className:"project-settings-form__reactions",children:[(0,s.jsx)("label",{htmlFor:"reactions",className:"project-settings-form__label",children:"Reactions"}),(0,s.jsx)("p",{className:"project-settings-form__hint",children:"JSON object keyed by reaction name. This PATCH only sends behavior fields."}),(0,s.jsx)("textarea",{id:"reactions",value:v,onChange:e=>x(e.target.value),spellCheck:!1,rows:12,className:"project-settings-form__textarea project-settings-form__textarea--mono"})]}),N?(0,s.jsx)("div",{role:"alert",className:"project-settings-form__alert project-settings-form__alert--error",children:N}):null,S?(0,s.jsxs)("div",{className:"project-settings-form__alert project-settings-form__alert--surface",children:[(0,s.jsx)("p",{className:"project-settings-form__alert-copy",children:S}),(0,s.jsx)("button",{type:"button",onClick:()=>void w(),className:"project-settings-form__retry",children:"Retry"})]}):null]}),(0,s.jsxs)("section",{className:"project-settings-form__section",children:[(0,s.jsx)("p",{className:"project-settings-form__eyebrow",children:"Identity"}),(0,s.jsx)("h2",{className:"project-settings-form__section-title",children:"Repository identity"}),(0,s.jsx)("p",{className:"project-settings-form__section-copy",children:"These fields are read-only because they define which repository AO considers this project to be."}),(0,s.jsxs)("div",{className:"project-settings-form__grid",children:[(0,s.jsx)(u,{id:"identity-project-id",label:"Project ID",value:r.identity.projectId}),(0,s.jsx)(u,{id:"identity-path",label:"Path",value:r.identity.path}),(0,s.jsx)(u,{id:"identity-storage-key",label:"Storage key",value:r.identity.storageKey}),(0,s.jsx)(u,{id:"identity-repo",label:"Repo",value:r.identity.repo}),(0,s.jsx)(u,{id:"identity-default-branch",label:"Default branch",value:r.identity.defaultBranch})]})]})]})}function c(e){let{id:t,label:r,value:n,onChange:a,placeholder:i}=e;return(0,s.jsxs)("label",{htmlFor:t,className:"project-settings-form__field",children:[(0,s.jsx)("span",{className:"project-settings-form__label",children:r}),(0,s.jsx)("input",{id:t,value:n,onChange:e=>a(e.target.value),placeholder:i,className:"project-settings-form__input"})]})}function u(e){let{id:t,label:r,value:n}=e;return(0,s.jsxs)("label",{htmlFor:t,className:"project-settings-form__field",children:[(0,s.jsx)("span",{className:"project-settings-form__label",children:r}),(0,s.jsx)("input",{id:t,value:n,disabled:!0,readOnly:!0,title:o,"aria-describedby":"".concat(t,"-tooltip"),className:"project-settings-form__input project-settings-form__input--readonly"}),(0,s.jsx)("span",{id:"".concat(t,"-tooltip"),className:"project-settings-form__hint",children:o})]})}function d(e){return(0,s.jsx)(i.t,{children:(0,s.jsx)(l,{...e})})}},4901:(e,t,r)=>{"use strict";function s(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}r.d(t,{cn:()=>s})},5275:(e,t,r)=>{"use strict";r.d(t,{RepairDegradedProjectButton:()=>i});var s=r(3817),n=r(6749),a=r(7594);function i(e){let{projectId:t}=e,r=(0,a.useRouter)(),[i,o]=(0,n.useState)(!1),[l,c]=(0,n.useState)(null),u=async()=>{o(!0),c(null);try{let s=await fetch("/api/projects/".concat(encodeURIComponent(t)),{method:"POST"}),n=await s.json().catch(()=>null);if(!s.ok){var e;c(null!=(e=null==n?void 0:n.error)?e:"Failed to repair project config.");return}r.refresh()}catch(e){c("Network error while repairing project config.")}finally{o(!1)}};return(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsx)("button",{type:"button",onClick:()=>void u(),disabled:i,className:"rounded-lg border border-[var(--color-accent)] bg-[var(--color-tint-blue)] px-4 py-2 text-sm font-semibold text-[var(--color-accent)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-accent)_14%,transparent)] disabled:cursor-not-allowed disabled:opacity-60",children:i?"Repairing...":"Repair config"}),l?(0,s.jsx)("p",{className:"mt-3 text-sm text-[var(--color-status-error)]",children:l}):null]})}},7244:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,8713,23)),Promise.resolve().then(r.bind(r,2749)),Promise.resolve().then(r.bind(r,5275))},7594:(e,t,r)=>{"use strict";var s=r(9582);r.o(s,"notFound")&&r.d(t,{notFound:function(){return s.notFound}}),r.o(s,"useParams")&&r.d(t,{useParams:function(){return s.useParams}}),r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})}},e=>{e.O(0,[8713,131,1461,7358],()=>e(e.s=7244)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6450],{2537:(e,s,r)=>{"use strict";r.d(s,{X:()=>o});var a=r(3817),t=r(8713),l=r.n(t);function o(e){let{ariaLabel:s,activeTab:r,dashboardHref:t,prsHref:o,showOrchestrator:n=!0,orchestratorHref:c=null}=e;return(0,a.jsxs)("nav",{className:"mobile-bottom-nav","aria-label":s,children:[(0,a.jsxs)(l(),{href:t,className:"mobile-bottom-nav__item","data-active":"dashboard"===r?"true":"false","aria-current":"dashboard"===r?"page":void 0,children:[(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M3 13h8V3H3zm10 8h8V11h-8zM3 21h8v-6H3zm10-10h8V3h-8z"})}),(0,a.jsx)("span",{children:"Dashboard"})]}),(0,a.jsxs)(l(),{href:o,className:"mobile-bottom-nav__item","data-active":"prs"===r?"true":"false","aria-current":"prs"===r?"page":void 0,children:[(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})}),(0,a.jsx)("span",{children:"PRs"})]}),n?c?(0,a.jsxs)(l(),{href:c,className:"mobile-bottom-nav__item","data-active":"orchestrator"===r?"true":"false","aria-current":"orchestrator"===r?"page":void 0,children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,a.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,a.jsx)("span",{children:"Orchestrator"})]}):(0,a.jsxs)("button",{type:"button",className:"mobile-bottom-nav__item",disabled:!0,children:[(0,a.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M9 3H5a2 2 0 0 0-2 2v4m16 0V5a2 2 0 0 0-2-2h-4m0 18h4a2 2 0 0 0 2-2v-4M3 15v4a2 2 0 0 0 2 2h4"}),(0,a.jsx)("path",{d:"M9 9h6v6H9z"})]}),(0,a.jsx)("span",{children:"Orchestrator"})]}):null]})}},4579:(e,s,r)=>{Promise.resolve().then(r.bind(r,6802))},6802:(e,s,r)=>{"use strict";r.d(s,{PullRequestsPage:()=>g});var a=r(3817),t=r(6749),l=r(7594),o=r(9120),n=r(545),c=r(5309),d=r(5184),i=r(9293),p=r(6004),h=r(7848),m=r(1237),x=r(2537);function b(e,s){return s?"".concat(e,"?project=").concat(encodeURIComponent(s)):"".concat(e,"?project=all")}r(5425);var u=r(8450);let j=[];function v(e){return"open"===e?"Open PRs":"merged"===e?"Merged PRs":"closed"===e?"Closed PRs":"All PRs"}function g(e){let{initialSessions:s,projectId:r,projectName:g,projects:N=[],orchestrators:f,attentionZones:_="simple"}=e,M=null!=f?f:j,k=(0,d.eT)(),y=(0,t.useMemo)(()=>{let e={};for(let r of s)e[r.id]=(0,n.ng)(r,_);return e},[s,_]),{sessions:w,sseAttentionLevels:C}=(0,c.D)({initialSessions:s,project:r,muxSessions:(null==k?void 0:k.status)==="connected"?k.sessions:void 0,initialAttentionLevels:y,attentionZones:_}),P=(0,l.useSearchParams)(),[R,O]=(0,t.useState)(!1),[q,S]=(0,t.useState)(!1),H=(0,o.U)(o.D),z=N.length>1,I=z&&void 0===r,B=(0,t.useMemo)(()=>{var e;return r&&null!=(e=M.find(e=>e.projectId===r))?e:null},[M,r]),[W,T]=(0,t.useState)("all"),V=(0,t.useMemo)(()=>w.filter(e=>!!e.pr).map(e=>e.pr).sort((e,s)=>s.number-e.number),[w]),A=(0,t.useMemo)(()=>V.filter(e=>"open"===e.state),[V]),E=(0,t.useMemo)(()=>V.filter(e=>"merged"===e.state),[V]),F=(0,t.useMemo)(()=>V.filter(e=>"closed"===e.state),[V]),G=r?(0,u.bn)(r):b("/",r),D=b("/prs",r),U=B?(0,u.Nc)(B.projectId,B.id):null,L="open"===W?A:"merged"===W?E:"closed"===W?F:V;return(0,t.useEffect)(()=>{S(!1)},[P]),(0,a.jsxs)("div",{className:"dashboard-shell flex h-screen".concat(!H&&R?" dashboard-shell--sidebar-collapsed":""),children:[z?(0,a.jsx)("div",{className:"sidebar-wrapper".concat(q?" sidebar-wrapper--mobile-open":""),children:(0,a.jsx)(i.u,{projects:N,sessions:w,activeProjectId:r,activeSessionId:void 0,collapsed:R,onToggleCollapsed:()=>O(e=>!e),onMobileClose:()=>S(!1)})}):null,q&&(0,a.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>S(!1)}),(0,a.jsxs)("div",{className:"dashboard-main flex-1 overflow-y-auto px-4 py-4 md:px-7 md:py-6",children:[(0,a.jsx)(h.u,{sseAttentionLevels:C,projectName:g?"".concat(g," PRs"):"Pull Requests"}),H?(0,a.jsxs)("section",{className:"mobile-pr-page-header",children:[(0,a.jsxs)("div",{className:"mobile-pr-page-header__top",children:[(0,a.jsxs)("div",{className:"mobile-pr-page-header__title-row",children:[z?(0,a.jsx)("button",{type:"button",className:"mobile-menu-toggle",onClick:()=>S(!0),"aria-label":"Open menu",children:(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-5 w-5",children:(0,a.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})})}):null,(0,a.jsx)("h1",{className:"mobile-pr-page-header__title",children:g?"".concat(g," PRs"):"Pull Requests"})]}),(0,a.jsxs)("div",{className:"mobile-pr-page-header__meta",children:[(0,a.jsx)("span",{className:"mobile-pr-page-header__count",children:V.length}),(0,a.jsx)(p.U,{})]})]}),(0,a.jsxs)("p",{className:"mobile-pr-page-header__subtitle",children:["Open pull requests created by agents",I?" across projects":" in this project","."]})]}):(0,a.jsxs)("section",{className:"dashboard-hero mb-5",children:[(0,a.jsx)("div",{className:"dashboard-hero__backdrop"}),(0,a.jsxs)("div",{className:"dashboard-hero__content",children:[z?(0,a.jsx)("button",{type:"button",className:"mobile-menu-toggle",onClick:()=>S(!0),"aria-label":"Open menu",children:(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-5 w-5",children:(0,a.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})})}):null,(0,a.jsxs)("div",{className:"dashboard-hero__primary",children:[(0,a.jsx)("div",{className:"dashboard-hero__heading",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"dashboard-title",children:g?"".concat(g," PRs"):"Pull Requests"}),(0,a.jsxs)("p",{className:"dashboard-subtitle",children:["Open pull requests created by agents",I?" across all projects":" in this project","."]})]})}),(0,a.jsx)("div",{className:"dashboard-stat-cards dashboard-stat-cards--persist-mobile",children:(0,a.jsxs)("div",{className:"dashboard-stat-card",children:[(0,a.jsx)("span",{className:"dashboard-stat-card__value",children:A.length}),(0,a.jsx)("span",{className:"dashboard-stat-card__label",children:"Open PRs"}),(0,a.jsx)("span",{className:"dashboard-stat-card__meta",children:I?"Across all projects":"In this project"})]})})]})]})]}),(0,a.jsxs)("section",{className:"mx-auto max-w-[900px]",children:[(0,a.jsx)("div",{className:H?"mobile-pr-filter-tabs":"mb-4 flex items-center gap-1.5",children:[{value:"all",label:"All",count:V.length},{value:"open",label:"Open",count:A.length},{value:"merged",label:"Merged",count:E.length},{value:"closed",label:"Closed",count:F.length}].map(e=>{let{value:s,label:r,count:t}=e;return(0,a.jsxs)("button",{type:"button",onClick:()=>T(s),className:H?"mobile-pr-filter-tab":["inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-[11px] font-semibold transition-colors",W===s?"border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] text-[var(--color-text-primary)]":"border-transparent bg-transparent text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"].join(" "),"data-active":H?String(W===s):void 0,children:[r,(0,a.jsx)("span",{className:H?"mobile-pr-filter-tab__count":"rounded-full bg-[var(--color-chip-bg)] px-1.5 py-px text-[9.5px] font-mono text-[var(--color-text-muted)]",children:t})]},s)})}),H?(0,a.jsx)("div",{className:"mobile-pr-mobile-layout",children:"all"===W?(0,a.jsxs)(a.Fragment,{children:[A.length>0&&(0,a.jsxs)("section",{className:"mobile-pr-group","aria-label":"Open pull requests",children:[(0,a.jsxs)("div",{className:"mobile-pr-section-header",children:[(0,a.jsx)("span",{children:"Open"}),(0,a.jsx)("span",{children:A.length})]}),(0,a.jsx)("div",{className:"mobile-pr-list",children:A.map(e=>(0,a.jsx)(m.dG,{pr:e},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))})]}),E.length>0&&(0,a.jsxs)("section",{className:"mobile-pr-group","aria-label":"Merged pull requests",children:[(0,a.jsxs)("div",{className:"mobile-pr-section-header",children:[(0,a.jsx)("span",{children:"Merged"}),(0,a.jsx)("span",{children:E.length})]}),(0,a.jsx)("div",{className:"mobile-pr-list",children:E.map(e=>(0,a.jsx)(m.dG,{pr:e,muted:!0},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))})]}),F.length>0&&(0,a.jsxs)("section",{className:"mobile-pr-group","aria-label":"Closed pull requests",children:[(0,a.jsxs)("div",{className:"mobile-pr-section-header",children:[(0,a.jsx)("span",{children:"Closed"}),(0,a.jsx)("span",{children:F.length})]}),(0,a.jsx)("div",{className:"mobile-pr-list",children:F.map(e=>(0,a.jsx)(m.dG,{pr:e,muted:!0},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))})]}),0===V.length&&(0,a.jsx)("div",{className:"mobile-pr-empty",children:"No pull requests yet."})]}):(0,a.jsxs)("section",{className:"mobile-pr-group","aria-label":v(W),children:[(0,a.jsxs)("div",{className:"mobile-pr-section-header",children:[(0,a.jsx)("span",{children:v(W).replace(" PRs","")}),(0,a.jsx)("span",{children:L.length})]}),(0,a.jsx)("div",{className:"mobile-pr-list",children:L.length>0?L.map(e=>(0,a.jsx)(m.dG,{pr:e,muted:"open"!==W},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number))):(0,a.jsx)("div",{className:"mobile-pr-empty",children:"No pull requests in this view."})})]})}):(0,a.jsx)("div",{className:"overflow-hidden rounded-[7px] border border-[var(--color-border-subtle)]",children:(0,a.jsxs)("table",{className:"w-full border-collapse",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-[var(--color-border-subtle)] bg-[var(--color-bg-elevated)]",children:[(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"PR"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"Title"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"Size"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"CI"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"Review"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left text-[10.5px] font-mono font-500 uppercase tracking-[0.05em] text-[var(--color-text-muted)]",children:"Threads"})]})}),(0,a.jsxs)("tbody",{children:[("all"===W||"open"===W)&&A.length>0&&(0,a.jsxs)(a.Fragment,{children:["all"===W&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"border-b border-[var(--color-border-subtle)] bg-[var(--color-bg-base)] px-3 py-1.5 text-[9.5px] font-mono font-semibold uppercase tracking-[0.06em] text-[var(--color-text-muted)]",children:"Open"})}),A.map(e=>(0,a.jsx)(m.j6,{pr:e},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))]}),("all"===W||"merged"===W)&&E.length>0&&(0,a.jsxs)(a.Fragment,{children:["all"===W&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"border-b border-t border-[var(--color-border-subtle)] bg-[var(--color-bg-base)] px-3 py-1.5 text-[9.5px] font-mono font-semibold uppercase tracking-[0.06em] text-[var(--color-text-muted)]",children:"Merged"})}),E.map(e=>(0,a.jsx)(m.j6,{pr:e,muted:!0},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))]}),("all"===W||"closed"===W)&&F.length>0&&(0,a.jsxs)(a.Fragment,{children:["all"===W&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"border-b border-t border-[var(--color-border-subtle)] bg-[var(--color-bg-base)] px-3 py-1.5 text-[9.5px] font-mono font-semibold uppercase tracking-[0.06em] text-[var(--color-text-muted)]",children:"Closed"})}),F.map(e=>(0,a.jsx)(m.j6,{pr:e,muted:!0},"".concat(e.owner,"/").concat(e.repo,"-").concat(e.number)))]}),0===V.length&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"px-4 py-6 text-[12px] text-[var(--color-text-secondary)]",children:"No pull requests yet."})})]})]})})]})]}),H?(0,a.jsx)(x.X,{ariaLabel:"PR navigation",activeTab:"prs",dashboardHref:G,prsHref:D,showOrchestrator:!I,orchestratorHref:U}):null]})}}},e=>{e.O(0,[8713,9331,7008,131,1461,7358],()=>e(e.s=4579)),_N_E=e.O()}]);