@made-by-moonlight/athene-web 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -0
- package/.next/app-build-manifest.json +448 -0
- package/.next/app-path-routes-manifest.json +47 -0
- package/.next/build-manifest.json +33 -0
- package/.next/export-marker.json +6 -0
- package/.next/images-manifest.json +58 -0
- package/.next/next-minimal-server.js.nft.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +172 -0
- package/.next/react-loadable-manifest.json +61 -0
- package/.next/required-server-files.json +335 -0
- package/.next/routes-manifest.json +234 -0
- package/.next/server/app/_not-found/page.js +2 -0
- package/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/.next/server/app/_not-found.html +1 -0
- package/.next/server/app/_not-found.meta +8 -0
- package/.next/server/app/_not-found.rsc +24 -0
- package/.next/server/app/api/backlog/route.js +1 -0
- package/.next/server/app/api/backlog/route.js.nft.json +1 -0
- package/.next/server/app/api/backlog/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/browse-directory/route.js +1 -0
- package/.next/server/app/api/browse-directory/route.js.nft.json +1 -0
- package/.next/server/app/api/browse-directory/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/filesystem/browse/route.js +1 -0
- package/.next/server/app/api/filesystem/browse/route.js.nft.json +1 -0
- package/.next/server/app/api/filesystem/browse/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/issues/route.js +1 -0
- package/.next/server/app/api/issues/route.js.nft.json +1 -0
- package/.next/server/app/api/issues/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/observability/route.js +1 -0
- package/.next/server/app/api/observability/route.js.nft.json +1 -0
- package/.next/server/app/api/observability/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/orchestrators/route.js +1 -0
- package/.next/server/app/api/orchestrators/route.js.nft.json +1 -0
- package/.next/server/app/api/orchestrators/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/projects/[id]/route.js +5 -0
- package/.next/server/app/api/projects/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/projects/reload/route.js +1 -0
- package/.next/server/app/api/projects/reload/route.js.nft.json +1 -0
- package/.next/server/app/api/projects/reload/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/projects/route.js +1 -0
- package/.next/server/app/api/projects/route.js.nft.json +1 -0
- package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/prs/[id]/merge/route.js +1 -0
- package/.next/server/app/api/prs/[id]/merge/route.js.nft.json +1 -0
- package/.next/server/app/api/prs/[id]/merge/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/reviews/execute/route.js +1 -0
- package/.next/server/app/api/reviews/execute/route.js.nft.json +1 -0
- package/.next/server/app/api/reviews/execute/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/reviews/findings/route.js +1 -0
- package/.next/server/app/api/reviews/findings/route.js.nft.json +1 -0
- package/.next/server/app/api/reviews/findings/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/reviews/route.js +1 -0
- package/.next/server/app/api/reviews/route.js.nft.json +1 -0
- package/.next/server/app/api/reviews/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/reviews/send/route.js +1 -0
- package/.next/server/app/api/reviews/send/route.js.nft.json +1 -0
- package/.next/server/app/api/reviews/send/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/runtime/terminal/route.js +1 -0
- package/.next/server/app/api/runtime/terminal/route.js.nft.json +1 -0
- package/.next/server/app/api/runtime/terminal/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/[id]/kill/route.js +1 -0
- package/.next/server/app/api/sessions/[id]/kill/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/[id]/kill/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/[id]/message/route.js +1 -0
- package/.next/server/app/api/sessions/[id]/message/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/[id]/message/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/[id]/remap/route.js +1 -0
- package/.next/server/app/api/sessions/[id]/remap/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/[id]/remap/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/[id]/restore/route.js +1 -0
- package/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/[id]/restore/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/[id]/route.js +1 -0
- package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/[id]/send/route.js +1 -0
- package/.next/server/app/api/sessions/[id]/send/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/[id]/send/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/patches/route.js +1 -0
- package/.next/server/app/api/sessions/patches/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/patches/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/route.js +1 -0
- package/.next/server/app/api/sessions/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/setup-labels/route.js +1 -0
- package/.next/server/app/api/setup-labels/route.js.nft.json +1 -0
- package/.next/server/app/api/setup-labels/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/spawn/route.js +1 -0
- package/.next/server/app/api/spawn/route.js.nft.json +1 -0
- package/.next/server/app/api/spawn/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/update/route.js +1 -0
- package/.next/server/app/api/update/route.js.nft.json +1 -0
- package/.next/server/app/api/update/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/verify/route.js +1 -0
- package/.next/server/app/api/verify/route.js.nft.json +1 -0
- package/.next/server/app/api/verify/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/version/route.js +1 -0
- package/.next/server/app/api/version/route.js.nft.json +1 -0
- package/.next/server/app/api/version/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/webhooks/[...slug]/route.js +1 -0
- package/.next/server/app/api/webhooks/[...slug]/route.js.nft.json +1 -0
- package/.next/server/app/api/webhooks/[...slug]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/apple-icon/route.js +1 -0
- package/.next/server/app/apple-icon/route.js.nft.json +1 -0
- package/.next/server/app/apple-icon/route_client-reference-manifest.js +1 -0
- package/.next/server/app/apple-icon.body +0 -0
- package/.next/server/app/apple-icon.meta +1 -0
- package/.next/server/app/dev/terminal-test/page.js +15 -0
- package/.next/server/app/dev/terminal-test/page.js.nft.json +1 -0
- package/.next/server/app/dev/terminal-test/page_client-reference-manifest.js +1 -0
- package/.next/server/app/dev/terminal-test.html +1 -0
- package/.next/server/app/dev/terminal-test.meta +7 -0
- package/.next/server/app/dev/terminal-test.rsc +28 -0
- package/.next/server/app/icon/route.js +1 -0
- package/.next/server/app/icon/route.js.nft.json +1 -0
- package/.next/server/app/icon/route_client-reference-manifest.js +1 -0
- package/.next/server/app/icon-192/route.js +1 -0
- package/.next/server/app/icon-192/route.js.nft.json +1 -0
- package/.next/server/app/icon-192/route_client-reference-manifest.js +1 -0
- package/.next/server/app/icon-512/route.js +1 -0
- package/.next/server/app/icon-512/route.js.nft.json +1 -0
- package/.next/server/app/icon-512/route_client-reference-manifest.js +1 -0
- package/.next/server/app/icon.body +0 -0
- package/.next/server/app/icon.meta +1 -0
- package/.next/server/app/manifest.webmanifest/route.js +16 -0
- package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -0
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -0
- package/.next/server/app/manifest.webmanifest.body +1 -0
- package/.next/server/app/manifest.webmanifest.meta +1 -0
- package/.next/server/app/page.js +2 -0
- package/.next/server/app/page.js.nft.json +1 -0
- package/.next/server/app/page_client-reference-manifest.js +1 -0
- package/.next/server/app/projects/[projectId]/page.js +2 -0
- package/.next/server/app/projects/[projectId]/page.js.nft.json +1 -0
- package/.next/server/app/projects/[projectId]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/projects/[projectId]/sessions/[id]/page.js +2 -0
- package/.next/server/app/projects/[projectId]/sessions/[id]/page.js.nft.json +1 -0
- package/.next/server/app/projects/[projectId]/sessions/[id]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/projects/[projectId]/settings/page.js +2 -0
- package/.next/server/app/projects/[projectId]/settings/page.js.nft.json +1 -0
- package/.next/server/app/projects/[projectId]/settings/page_client-reference-manifest.js +1 -0
- package/.next/server/app/prs/page.js +2 -0
- package/.next/server/app/prs/page.js.nft.json +1 -0
- package/.next/server/app/prs/page_client-reference-manifest.js +1 -0
- package/.next/server/app/review/page.js +2 -0
- package/.next/server/app/review/page.js.nft.json +1 -0
- package/.next/server/app/review/page_client-reference-manifest.js +1 -0
- package/.next/server/app/reviews/page.js +2 -0
- package/.next/server/app/reviews/page.js.nft.json +1 -0
- package/.next/server/app/reviews/page_client-reference-manifest.js +1 -0
- package/.next/server/app/sessions/[id]/page.js +2 -0
- package/.next/server/app/sessions/[id]/page.js.nft.json +1 -0
- package/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/test-direct/page.js +2 -0
- package/.next/server/app/test-direct/page.js.nft.json +1 -0
- package/.next/server/app/test-direct/page_client-reference-manifest.js +1 -0
- package/.next/server/app/test-direct.html +1 -0
- package/.next/server/app/test-direct.meta +7 -0
- package/.next/server/app/test-direct.rsc +28 -0
- package/.next/server/app-paths-manifest.json +47 -0
- package/.next/server/chunks/1215.js +1 -0
- package/.next/server/chunks/1271.js +1 -0
- package/.next/server/chunks/2106.js +1 -0
- package/.next/server/chunks/2347.js +3 -0
- package/.next/server/chunks/2899.js +1 -0
- package/.next/server/chunks/2914.js +1 -0
- package/.next/server/chunks/4033.js +1 -0
- package/.next/server/chunks/4148.js +942 -0
- package/.next/server/chunks/4422.js +32 -0
- package/.next/server/chunks/5053.js +1 -0
- package/.next/server/chunks/5689.js +1 -0
- package/.next/server/chunks/6148.js +9 -0
- package/.next/server/chunks/6582.js +25 -0
- package/.next/server/chunks/7002.js +1 -0
- package/.next/server/chunks/7486.js +9 -0
- package/.next/server/chunks/8803.js +6 -0
- package/.next/server/chunks/9472.js +847 -0
- package/.next/server/chunks/9493.js +1 -0
- package/.next/server/chunks/9561.js +22 -0
- package/.next/server/chunks/966.js +1 -0
- package/.next/server/functions-config-manifest.json +4 -0
- package/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/next-font-manifest.js +1 -0
- package/.next/server/next-font-manifest.json +1 -0
- package/.next/server/pages/404.html +1 -0
- package/.next/server/pages/500.html +1 -0
- package/.next/server/pages/_app.js +1 -0
- package/.next/server/pages/_app.js.nft.json +1 -0
- package/.next/server/pages/_document.js +1 -0
- package/.next/server/pages/_document.js.nft.json +1 -0
- package/.next/server/pages/_error.js +19 -0
- package/.next/server/pages/_error.js.nft.json +1 -0
- package/.next/server/pages-manifest.json +6 -0
- package/.next/server/server-reference-manifest.js +1 -0
- package/.next/server/server-reference-manifest.json +1 -0
- package/.next/server/webpack-runtime.js +1 -0
- package/.next/static/chunks/0f200859.359176a445d2791f.js +10 -0
- package/.next/static/chunks/1089-c6d7995c7c19039a.js +1 -0
- package/.next/static/chunks/1461-af7c54935f21d56d.js +1 -0
- package/.next/static/chunks/2073-4192de0bb00cc993.js +1 -0
- package/.next/static/chunks/3764.4c736d9a181489a4.js +1 -0
- package/.next/static/chunks/4115-1a4fa80ec67a29d3.js +1 -0
- package/.next/static/chunks/4751.6c71bfc0c4520627.js +1 -0
- package/.next/static/chunks/503.f7ff284457dd9c40.js +1 -0
- package/.next/static/chunks/5204.7de7e266895bced7.js +1 -0
- package/.next/static/chunks/6835.7a29fa4b665b7c2f.js +1 -0
- package/.next/static/chunks/7008-0d9bee1bf4bfcbea.js +1 -0
- package/.next/static/chunks/7317.685aa5231218e8d3.js +1 -0
- package/.next/static/chunks/8204-7c7837ed694da99c.js +1 -0
- package/.next/static/chunks/8713-d3d663f55dc00e48.js +1 -0
- package/.next/static/chunks/8759-490573536f93f85c.js +1 -0
- package/.next/static/chunks/88a6fc35-f836b4b72df5eafa.js +1 -0
- package/.next/static/chunks/9531-a5175e55fa0db48d.js +1 -0
- package/.next/static/chunks/9876-de0c5a1a319b4e8e.js +1 -0
- package/.next/static/chunks/app/_not-found/page-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/backlog/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/browse-directory/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/filesystem/browse/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/issues/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/observability/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/orchestrators/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/projects/[id]/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/projects/reload/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/projects/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/prs/[id]/merge/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/reviews/execute/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/reviews/findings/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/reviews/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/reviews/send/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/runtime/terminal/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/kill/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/message/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/remap/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/restore/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/send/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/patches/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/setup-labels/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/spawn/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/update/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/verify/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/version/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/api/webhooks/[...slug]/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/apple-icon/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/dev/terminal-test/page-d0132109f9d8524e.js +1 -0
- package/.next/static/chunks/app/error-d632d0714b987864.js +1 -0
- package/.next/static/chunks/app/global-error-f6bef179169bcdae.js +1 -0
- package/.next/static/chunks/app/icon/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/icon-192/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/icon-512/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/layout-5cac6fe817194d7a.js +1 -0
- package/.next/static/chunks/app/loading-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/manifest.webmanifest/route-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/not-found-cba3f587e1f98dcb.js +1 -0
- package/.next/static/chunks/app/page-cf7bccb75990950d.js +1 -0
- package/.next/static/chunks/app/projects/[projectId]/layout-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/projects/[projectId]/loading-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/projects/[projectId]/page-039a93b16089ed57.js +1 -0
- package/.next/static/chunks/app/projects/[projectId]/sessions/[id]/page-043b525bedb8f0f7.js +1 -0
- package/.next/static/chunks/app/projects/[projectId]/settings/page-63572555892d7a61.js +1 -0
- package/.next/static/chunks/app/projects/layout-d43b2e38d46221bd.js +1 -0
- package/.next/static/chunks/app/prs/page-e447852fbe0c6ee4.js +1 -0
- package/.next/static/chunks/app/review/page-022b2d2c326ff413.js +1 -0
- package/.next/static/chunks/app/reviews/page-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/sessions/[id]/error-67c0d27f977a1cc1.js +1 -0
- package/.next/static/chunks/app/sessions/[id]/loading-6add9dacf1870b4b.js +1 -0
- package/.next/static/chunks/app/sessions/[id]/not-found-cba3f587e1f98dcb.js +1 -0
- package/.next/static/chunks/app/sessions/[id]/page-863cf8dd2c76d06d.js +1 -0
- package/.next/static/chunks/app/test-direct/page-8b80ed180c0f2f42.js +1 -0
- package/.next/static/chunks/e12b4bb0.8742134e1ac0263f.js +58 -0
- package/.next/static/chunks/framework-7060e2ac4971c604.js +1 -0
- package/.next/static/chunks/main-app-162601c3f1c01b19.js +1 -0
- package/.next/static/chunks/main-ed1610689fbd6f0d.js +1 -0
- package/.next/static/chunks/pages/_app-f4baf4dbe88f6f54.js +1 -0
- package/.next/static/chunks/pages/_error-a7f6723f42093f29.js +1 -0
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/.next/static/chunks/webpack-f9566aaa604a1b07.js +1 -0
- package/.next/static/css/0c9b7451c2ce7c02.css +1 -0
- package/.next/static/css/7ca4e3753c1c7833.css +1 -0
- package/.next/static/css/b4a15f23f468892a.css +1 -0
- package/.next/static/css/d06ee45019116677.css +1 -0
- package/.next/static/media/91601dd83defba07-s.p.woff2 +0 -0
- package/.next/static/media/aa8291c31d4e9e54-s.p.woff2 +0 -0
- package/.next/static/pROr0laPuZIdA4NYNygMD/_buildManifest.js +1 -0
- package/.next/static/pROr0laPuZIdA4NYNygMD/_ssgManifest.js +1 -0
- package/LICENSE +22 -0
- package/dist-server/direct-terminal-ws.js +109 -0
- package/dist-server/mux-websocket.js +1162 -0
- package/dist-server/single-port-server.js +305 -0
- package/dist-server/start-all.js +150 -0
- package/dist-server/terminal-observability.js +16 -0
- package/dist-server/tmux-utils.js +301 -0
- package/next.config.js +71 -0
- package/package.json +97 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9531],{9531:(e,s,t)=>{t.d(s,{Dashboard:()=>V});var r=t(3817),a=t(6749),n=t(8713),o=t.n(n),l=t(7594),i=t(9120),c=t(545),d=t(4901),h=t(7387),u=t(3210),m=t(4906),x=t(1237),p=t(8450);function b(e){let{session:s,onRestore:t}=e,[n,o]=(0,a.useState)(!1),l=s.pr,i=!!l&&(0,c.fZ)(l),u=!!l&&(0,c.sZ)(l),b=(0,c.wy)(s),v=(0,h.Pn)(s),g=function(e){var s,t,a,n;let o=e.activity,l=e.status,i=null!=(n=null==(s=e.lifecycle)?void 0:s.prState)?n:null==(t=e.pr)?void 0:t.state;return"merged"===i||"merged"===l?{label:"merged",pillClass:"done-status-pill--merged",icon:(0,r.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,r.jsx)("path",{d:"M20 6 9 17l-5-5"})})}:"closed"===i?{label:"closed",pillClass:"done-status-pill--exited",icon:(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,r.jsx)("path",{d:"M9 12h6"})]})}:(null==(a=e.lifecycle)?void 0:a.sessionState)==="terminated"||"killed"===l||"terminated"===l?{label:(0,c.Ou)(e),pillClass:"done-status-pill--killed",icon:(0,r.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",className:"h-3 w-3",children:(0,r.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}:{label:"exited"===o?"exited":(0,c.Ou)(e),pillClass:"done-status-pill--exited",icon:(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,r.jsx)("path",{d:"M9 12h6"})]})}}(s);return(0,r.jsxs)("div",{className:(0,d.cn)("session-card-done",n&&"done-expanded"),onClick:e=>{e.target.closest("a, button, textarea")||o(!n)},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,r.jsxs)("span",{className:(0,d.cn)("done-status-pill",g.pillClass),children:[g.icon,g.label]}),(0,r.jsx)("span",{className:"font-[var(--font-mono)] text-[10px] tracking-wide text-[var(--color-text-muted)]",children:s.id}),(0,r.jsx)("div",{className:"flex-1"}),b&&(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==t||t(s.id)},className:"done-card__restore",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-3 w-3",children:[(0,r.jsx)("polyline",{points:"1 4 1 10 7 10"}),(0,r.jsx)("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),"restore"]})]}),(0,r.jsx)("div",{className:"px-3.5 pb-2",children:(0,r.jsx)("p",{className:"session-card-done__title text-[13px] font-semibold leading-snug [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2] overflow-hidden",children:v})}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 px-3.5 pb-3",children:[s.branch&&(0,r.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",className:"h-2.5 w-2.5 opacity-50",children:[(0,r.jsx)("path",{d:"M6 3v12M18 9a3 3 0 0 1-3 3H9a3 3 0 0 0-3 3"}),(0,r.jsx)("circle",{cx:"18",cy:"6",r:"3"})]}),s.branch]}),l&&(0,r.jsxs)("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-bold text-[var(--color-text-primary)] no-underline underline-offset-2 hover:underline",children:["#",l.number]}),l&&!i&&(u?(0,r.jsx)("span",{className:"inline-block h-[14px] w-16 animate-pulse rounded-full bg-[var(--color-bg-subtle)]"}):(0,r.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,r.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",l.additions]})," ",(0,r.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",l.deletions]})," ",(0,x.i_)(l.additions,l.deletions),(0,r.jsx)("span",{className:"sr-only",children:"+".concat(l.additions," -").concat(l.deletions," ").concat((0,x.i_)(l.additions,l.deletions))})]})),(0,r.jsx)("a",{href:(0,p.Nc)(s.projectId,s.id),onClick:e=>e.stopPropagation(),className:"done-meta-chip font-[var(--font-mono)] font-semibold text-[var(--color-accent)] no-underline hover:underline",children:"View current context"})]}),n&&(0,r.jsxs)("div",{className:"done-expand-section px-3.5 py-3",children:[s.summary&&(null==l?void 0:l.title)&&s.summary!==l.title&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M4 6h16M4 12h16M4 18h10"})}),"Summary"]}),(0,r.jsx)("p",{className:"text-[12px] leading-relaxed text-[var(--color-text-secondary)]",children:s.summary})]}),s.issueUrl&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),"Issue"]}),(0,r.jsxs)("a",{href:s.issueUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"text-[12px] text-[var(--color-accent)] hover:underline",children:[s.issueLabel||s.issueUrl,s.issueTitle&&": ".concat(s.issueTitle)]})]}),l&&l.ciChecks.length>0&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M9 12l2 2 4-4"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"})]}),"CI Checks"]}),(0,r.jsx)(m.zm,{checks:l.ciChecks})]}),l&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"done-detail-heading",children:[(0,r.jsxs)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65S8.93 17.38 9 18v4"}),(0,r.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]}),"PR"]}),(0,r.jsxs)("p",{className:"text-[12px] text-[var(--color-text-secondary)]",children:[(0,r.jsx)("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"hover:underline",children:l.title}),u?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2 text-[10px] text-[var(--color-text-muted)]",children:[(0,r.jsx)("span",{className:"inline-block h-3 w-12 animate-pulse rounded bg-[var(--color-bg-subtle)]"}),(0,r.jsx)("span",{children:"PR details loading..."})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsxs)("span",{className:"mt-1 inline-flex items-center gap-2",children:[(0,r.jsxs)("span",{className:"done-meta-chip font-[var(--font-mono)]",children:[(0,r.jsxs)("span",{className:"text-[var(--color-status-ready)]",children:["+",l.additions]})," ",(0,r.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",l.deletions]})]}),(0,r.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,r.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["mergeable: ",l.mergeability.mergeable?"yes":"no"]}),(0,r.jsx)("span",{className:"text-[var(--color-text-muted)]",children:"\xb7"}),(0,r.jsxs)("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["review: ",l.reviewDecision]})]})]})]})]}),!l&&(0,r.jsx)("p",{className:"text-[12px] text-[var(--color-text-tertiary)]",children:"No PR associated with this session."})]})]})}let v=new Set,g=(0,a.memo)(function(e){var s,t,n;let{session:o,onKill:l,onMerge:i,onRestore:m}=e,[x,g]=(0,a.useState)(!1),[j]=(0,a.useState)(()=>v.has(o.id));(0,a.useEffect)(()=>{if(j)return;let e=window.requestAnimationFrame(()=>{v.add(o.id)});return()=>{window.cancelAnimationFrame(e)}},[j,o.id]);let f=(0,c.ng)(o),_=o.pr,N=null!=(s=o.prs)?s:[],w=new Set(N.map(e=>e.repo)).size>1,[y,k]=(0,a.useState)(0);(0,a.useEffect)(()=>k(0),[o.id]);let C=Math.min(y,Math.max(0,N.length-1)),M=N.length>1&&null!=(t=N[C])?t:_,S=N.length>1?M:_,P=!!S&&(0,c.fZ)(S),I=!!S&&(0,c.sZ)(S),R=!P&&(null==S?void 0:S.mergeability.mergeable)&&"open"===S.state,D=(0,c.nH)(o),W=(0,c.wy)(o),T=(0,h.Pn)(o),B=function(e,s,t,r){var a,n;let o=e.pr;if(!o)return(null==(n=e.lifecycle)?void 0:n.sessionState)==="detecting"?{text:"detecting…",tone:void 0}:{text:"no PR yet",tone:void 0};if(t)return{text:"PR data rate limited",tone:void 0};if(r)return{text:"loading…",tone:void 0};if(o.ciStatus===c.U1.FAILING||(null==(a=e.lifecycle)?void 0:a.prReason)==="ci_failing"||"ci_failed"===e.status){let e=o.ciChecks.filter(e=>"failed"===e.status).length;return{text:e>0?"".concat(e," check").concat(1===e?"":"s"," failed"):"CI failed",tone:"fail"}}return"changes_requested"===o.reviewDecision?{text:"changes requested",tone:"amber"}:o.unresolvedThreads>0?{text:"".concat(o.unresolvedThreads," comment").concat(1===o.unresolvedThreads?"":"s"),tone:"amber"}:s&&"approved"===o.reviewDecision?{text:"approved",tone:"green"}:o.ciStatus===c.U1.PASSING?{text:"CI passed",tone:"green"}:o.ciStatus===c.U1.PENDING?{text:"CI running",tone:void 0}:{text:"review pending",tone:void 0}}(o,!!R,P,I);return(0,c.dG)(o)||"done"===f?(0,r.jsx)(b,{session:o,onRestore:m}):(0,r.jsxs)("div",{className:(0,d.cn)("session-card border",!j&&"kanban-card-enter"),children:[(0,r.jsxs)("div",{className:"session-card__header",children:[(0,r.jsx)(u.W,{session:o}),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsx)("span",{className:"card__id",children:o.id}),W&&(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==m||m(o.id)},className:"session-card__control session-card__restore-control",children:[(0,r.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M20 11a8 8 0 0 0-14.9-3.98"}),(0,r.jsx)("path",{d:"M4 5v4h4"}),(0,r.jsx)("path",{d:"M4 13a8 8 0 0 0 14.9 3.98"}),(0,r.jsx)("path",{d:"M20 19v-4h-4"})]}),"restore"]}),!D&&(0,r.jsxs)("a",{href:(0,p.$l)(o.projectId,o.id,"#session-terminal-section"),onClick:e=>e.stopPropagation(),className:"session-card__terminal-link",children:[(0,r.jsxs)("svg",{className:"session-card__terminal-link-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"m4 17 6-6-6-6"}),(0,r.jsx)("path",{d:"M12 19h8"})]}),"terminal"]})]}),(0,r.jsxs)("div",{className:"session-card__body flex min-h-0 flex-1 flex-col",children:[(0,r.jsx)("div",{className:"card__title-wrap",children:(0,r.jsx)("p",{className:"card__title",children:T})}),(0,r.jsxs)("div",{className:"card__meta",children:[o.branch&&(0,r.jsx)("span",{className:"card__branch",children:o.branch}),1===N.length&&(0,r.jsxs)(r.Fragment,{children:[o.branch&&(0,r.jsx)("span",{className:"card__meta-sep","aria-hidden":"true",children:"\xb7"}),(0,r.jsxs)("a",{href:N[0].url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"card__pr inline-flex items-center gap-1",children:[(0,r.jsx)("span",{className:(0,d.cn)("inline-block h-1.5 w-1.5 shrink-0 rounded-full",(n=N[0]).enriched?"merged"===n.state?"bg-[var(--color-status-merge)]":"closed"===n.state?"bg-[var(--color-text-muted)]":"failing"===n.ciStatus||"changes_requested"===n.reviewDecision?"bg-[var(--color-status-error)]":n.isDraft?"bg-[var(--color-text-muted)]":"passing"===n.ciStatus?"bg-[var(--color-status-merge)]":"pending"===n.ciStatus?"bg-[var(--color-status-pending)]":"bg-[var(--color-text-tertiary)] opacity-30":"bg-[var(--color-text-tertiary)] opacity-30")}),"#",N[0].number]})]})]}),N.length>1&&(0,r.jsx)("div",{className:"px-[10px] pb-[5px] flex flex-col gap-[2px]",children:N.map((e,s)=>{let t=e.enriched?"merged"===e.state?"merged":"closed"===e.state?"closed":"failing"===e.ciStatus?"CI failing":"changes_requested"===e.reviewDecision?"changes requested":e.isDraft?"draft":"approved"===e.reviewDecision?"approved":"passing"===e.ciStatus?"needs review":"pending"===e.ciStatus?"CI running":"":"",a=s===C;return(0,r.jsxs)("div",{role:"button",tabIndex:0,className:(0,d.cn)("flex items-center gap-1.5 min-w-0 rounded px-1 -mx-1 cursor-pointer transition-colors",a?"bg-[var(--color-bg-subtle)] border-l-2 border-[var(--color-accent)] pl-[2px]":"hover:bg-[var(--color-bg-subtle)] border-l-2 border-transparent pl-[2px]"),onClick:e=>{e.stopPropagation(),k(s)},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.stopPropagation(),k(s))},children:[w&&(0,r.jsx)("span",{className:"shrink-0 font-[var(--font-mono)] text-[9px] text-[var(--color-text-tertiary)] bg-[var(--color-bg-subtle)] px-1 py-0.5 rounded leading-none",children:e.repo.split("-").map(e=>{var s,t;return null!=(t=null==(s=e[0])?void 0:s.toUpperCase())?t:""}).join("").slice(0,3)}),(0,r.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>{e.stopPropagation(),k(s)},className:(0,d.cn)("shrink-0 inline-flex items-center font-[var(--font-mono)] text-[10px] font-bold px-1.5 py-0.5 rounded leading-none no-underline",e.enriched?"merged"===e.state?"bg-[color-mix(in_srgb,var(--color-status-merge)_15%,transparent)] text-[var(--color-status-merge)]":"closed"===e.state?"bg-[var(--color-bg-subtle)] text-[var(--color-text-muted)]":"failing"===e.ciStatus||"changes_requested"===e.reviewDecision?"bg-[color-mix(in_srgb,var(--color-status-error)_15%,transparent)] text-[var(--color-status-error)]":e.isDraft?"bg-[var(--color-bg-subtle)] text-[var(--color-text-muted)]":"passing"===e.ciStatus?"bg-[color-mix(in_srgb,var(--color-status-merge)_15%,transparent)] text-[var(--color-status-merge)]":"pending"===e.ciStatus?"bg-[color-mix(in_srgb,var(--color-status-pending)_15%,transparent)] text-[var(--color-status-pending)]":"bg-[var(--color-bg-subtle)] text-[var(--color-text-muted)]":"bg-[var(--color-bg-subtle)] text-[var(--color-text-muted)]"),children:["#",e.number]}),e.title?(0,r.jsx)("span",{className:"flex-1 truncate text-[11px] text-[var(--color-text-secondary)]",title:e.title,children:e.title}):(0,r.jsx)("span",{className:"flex-1"}),e.enriched&&(0,r.jsxs)("span",{className:"shrink-0 font-[var(--font-mono)] text-[10px]",children:[(0,r.jsxs)("span",{className:"text-[var(--color-status-merge)]",children:["+",e.additions]})," ",(0,r.jsxs)("span",{className:"text-[var(--color-status-error)]",children:["-",e.deletions]})]}),t&&"needs review"!==t&&(0,r.jsxs)("span",{className:"shrink-0 text-[10px] text-[var(--color-text-tertiary)]",children:["\xb7 ",t]})]},e.url)})}),(0,r.jsxs)("div",{className:"session-card__footer",children:[(0,r.jsxs)("div",{className:"session-card__footer-info",children:[_?(0,r.jsxs)("a",{href:_.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"card__pr",children:["PR #",_.number]}):null,_&&B?(0,r.jsx)("span",{className:"card__meta-sep","aria-hidden":"true",children:"\xb7"}):null,B?(0,r.jsx)("span",{className:"session-card__footer-detail","data-tone":B.tone,children:B.text}):null]}),(0,r.jsxs)("div",{className:"session-card__footer-actions",children:[R&&S?(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==i||i(S.number,S.owner,S.repo)},className:"session-card__control session-card__merge-control",children:[(0,r.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"6",cy:"6",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"18",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"6",r:"2"}),(0,r.jsx)("path",{d:"M8 6h5a3 3 0 0 1 3 3v7"})]}),"Merge PR #",S.number]}):null,D?null:(0,r.jsx)("button",{onClick:e=>{if(e.stopPropagation(),!x)return void g(!0);g(!1),null==l||l(o.id)},onMouseLeave:()=>g(!1),onBlur:()=>g(!1),"aria-label":x?"Confirm terminate session":"Terminate session",className:(0,d.cn)("session-card__control session-card__terminate btn--danger",x&&"is-confirming"),children:x?(0,r.jsx)("span",{className:"font-mono text-[10px] font-semibold tracking-[0.04em]",children:"kill?"}):(0,r.jsxs)("svg",{className:"session-card__control-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{d:"M3 6h18"}),(0,r.jsx)("path",{d:"M8 6V4h8v2"}),(0,r.jsx)("path",{d:"M19 6l-1 14H6L5 6"})]})})]})]})]})]})},function(e,s){return e.session===s.session&&e.onKill===s.onKill&&e.onMerge===s.onMerge&&e.onRestore===s.onRestore}),j={merge:{label:"Ready to merge",emptyMessage:"Nothing cleared to land yet."},action:{label:"Needs you",emptyMessage:"No agents need your input."},respond:{label:"Needs you",emptyMessage:"No agents need your input."},review:{label:"Review",emptyMessage:"No code waiting for review."},pending:{label:"In review",emptyMessage:"Nothing blocked."},working:{label:"Working",emptyMessage:"No agents running."},done:{label:"Done",emptyMessage:"No completed sessions."}},f=(0,a.memo)(function(e){let{level:s,sessions:t,onKill:n,onMerge:o,onRestore:l,collapsed:i,onToggle:c,compactMobile:d,onPreview:h,resetKey:u}=e,m=j[s],x=void 0!==c,[p,b]=(0,a.useState)(!1),v=x&&d&&!p?t.slice(0,5):t,f=t.length-v.length;return((0,a.useEffect)(()=>{i&&b(!1)},[i]),(0,a.useEffect)(()=>{b(!1)},[u]),x)?(0,r.jsxs)("div",{className:"accordion-section".concat(i?" accordion-section--collapsed":" accordion-section--expanded"),"data-level":s,children:[(0,r.jsxs)("button",{type:"button",className:"accordion-header",onClick:()=>c(s),"aria-expanded":!i,"aria-controls":"accordion-body-".concat(s),children:[(0,r.jsx)("span",{className:"accordion-header__dot","data-level":s}),(0,r.jsx)("span",{className:"accordion-header__label",children:m.label}),(0,r.jsx)("span",{className:"accordion-header__count",children:t.length}),(0,r.jsx)("span",{className:"accordion-header__chevron","aria-hidden":"true",children:"▶"})]}),(0,r.jsx)("div",{id:"accordion-body-".concat(s),className:"accordion-body",children:t.length>0?(0,r.jsxs)("div",{className:d?"mobile-session-list":"flex flex-col gap-2 p-3",children:[v.map(e=>d?(0,r.jsx)(_,{session:e,level:s,onPreview:h},e.id):(0,r.jsx)(g,{session:e,onKill:n,onMerge:o,onRestore:l},e.id)),d&&f>0?(0,r.jsxs)("button",{type:"button",className:"mobile-session-list__view-all",onClick:()=>b(!0),children:["View all ",t.length]}):null]}):d?(0,r.jsx)("div",{className:"mobile-session-list",children:(0,r.jsx)("div",{className:"mobile-session-list__empty",children:m.emptyMessage})}):null})]}):(0,r.jsxs)("div",{className:"kanban-column","data-level":s,children:[(0,r.jsx)("div",{className:"kanban-column__header",children:(0,r.jsxs)("div",{className:"kanban-column__title-row",children:[(0,r.jsx)("div",{className:"kanban-column__dot","data-level":s}),(0,r.jsx)("span",{className:"kanban-column__title",children:m.label}),(0,r.jsx)("span",{className:"kanban-column__count",children:t.length})]})}),(0,r.jsx)("div",{className:"kanban-column-body",children:t.length>0?(0,r.jsx)("div",{className:"kanban-column__stack",children:t.map(e=>(0,r.jsx)(g,{session:e,onKill:n,onMerge:o,onRestore:l},e.id))}):null})]})},function(e,s){return e.level===s.level&&e.collapsed===s.collapsed&&e.onToggle===s.onToggle&&e.onKill===s.onKill&&e.onMerge===s.onMerge&&e.onRestore===s.onRestore&&e.compactMobile===s.compactMobile&&e.onPreview===s.onPreview&&e.resetKey===s.resetKey&&e.sessions.length===s.sessions.length&&e.sessions.every((e,t)=>e===s.sessions[t])});function _(e){let{session:s,level:t,onPreview:a}=e,n=[s.branch,s.pr?"PR #".concat(s.pr.number):null,s.issueLabel].filter(Boolean);return(0,r.jsxs)("div",{className:"mobile-session-row",children:[(0,r.jsxs)("button",{type:"button",className:"mobile-session-row__preview",onClick:()=>null==a?void 0:a(s),"aria-label":"Open ".concat((0,h.Pn)(s)),children:[(0,r.jsxs)("div",{className:"mobile-session-row__line",children:[(0,r.jsx)("span",{className:"mobile-session-row__dot","data-level":t,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mobile-session-row__title",children:(0,h.Pn)(s)})]}),(0,r.jsx)("div",{className:"mobile-session-row__meta",children:n.length>0?n.join(" \xb7 "):"No branch or PR metadata"})]}),(0,r.jsxs)("div",{className:"mobile-session-row__side",children:[(0,r.jsx)(N,{session:s,level:t}),(0,r.jsx)("a",{href:(0,p.Nc)(s.projectId,s.id),className:"mobile-session-row__open","aria-label":"Go to ".concat((0,h.Pn)(s)),children:(0,r.jsxs)("svg",{className:"mobile-session-row__open-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M4 17V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2Z"}),(0,r.jsx)("path",{d:"m8 10 2 2-2 2M12 14h4"})]})})]})]})}function N(e){let{session:s,level:t}=e,a=j[t].label.toLowerCase(),n=s.prs.length>0?s.prs:s.pr?[s.pr]:[];return"merge"===t&&n.length>0&&n.every(e=>(0,c.QN)(e))?a="ready":"action"===t?a=function(e){if("needs_input"===e.status)return"needs input";if("stuck"===e.status)return"stuck";if("errored"===e.status)return"errored";if("waiting_input"===e.activity)return"waiting";if("exited"===e.activity)return"crashed";if("blocked"===e.activity)return"blocked";if("ci_failed"===e.status)return"ci failed";if("changes_requested"===e.status)return"changes";let s=e.prs.length>0?e.prs:e.pr?[e.pr]:[];return s.some(e=>"failing"===e.ciStatus)?"ci failed":s.some(e=>"changes_requested"===e.reviewDecision)?"changes":s.some(e=>!e.mergeability.noConflicts)?"conflicts":"action"}(s):"respond"===t?a="waiting_input"===s.activity?"waiting":"needs input":"review"===t?a=n.some(e=>"changes_requested"===e.reviewDecision)?"changes":"review":"pending"===t?a=n.some(e=>e.unresolvedThreads)?"threads":"pending":"working"===t&&(a="idle"===s.activity?"idle":"active"),(0,r.jsx)("span",{className:"mobile-session-row__chip",children:a})}var w=t(7848),y=t(5309),k=t(5184);let C=["Working","Needs you","In review","Ready to merge"];function M(e){let{message:s,orchestratorHref:t,onSpawnOrchestrator:a=null,spawnLabel:n="Spawn Orchestrator",spawnDisabled:o=!1}=e;return(0,r.jsxs)("div",{className:"board-wrapper",children:[(0,r.jsx)("div",{className:"kanban-ghost","aria-hidden":"true",children:C.map(e=>(0,r.jsx)("div",{className:"kanban-ghost__col",children:(0,r.jsx)("div",{className:"kanban-ghost__head",children:e})},e))}),(0,r.jsx)("div",{className:"board-center",children:(0,r.jsxs)("div",{className:"empty-state",role:"status",children:[(0,r.jsx)("div",{className:"empty-state__icon",children:(0,r.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"5.5",r:"2.5",fill:"color-mix(in srgb, var(--color-accent) 18%, transparent)",stroke:"var(--color-accent)",strokeWidth:"1.5"}),(0,r.jsx)("circle",{cx:"5.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,r.jsx)("circle",{cx:"18.5",cy:"17",r:"2.5",fill:"var(--color-bg-subtle)",stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),(0,r.jsx)("line",{x1:"12",y1:"8",x2:"6.7",y2:"14.8",stroke:"color-mix(in srgb, var(--color-accent) 22%, transparent)",strokeWidth:"1",strokeDasharray:"2.5 2"}),(0,r.jsx)("line",{x1:"12",y1:"8",x2:"17.3",y2:"14.8",stroke:"color-mix(in srgb, var(--color-accent) 22%, transparent)",strokeWidth:"1",strokeDasharray:"2.5 2"}),(0,r.jsx)("line",{x1:"7.8",y1:"17",x2:"16.2",y2:"17",stroke:"var(--color-border-subtle)",strokeWidth:"1",strokeDasharray:"2.5 2"})]})}),s?(0,r.jsx)("p",{className:"empty-state__text",children:s}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"empty-state__headline",children:"Ready to orchestrate"}),(0,r.jsx)("p",{className:"empty-state__hint",children:"Open the main orchestrator to start a session and fan out parallel agents across your codebase."}),t?(0,r.jsxs)("a",{href:t,className:"empty-state__cta",children:[(0,r.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,r.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,r.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Open Orchestrator"]}):a?(0,r.jsxs)("button",{type:"button",className:"empty-state__cta",onClick:a,disabled:o,children:[(0,r.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,r.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,r.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),n]}):null]})]})})]})}var S=t(2446);function P(e){let{status:s}=e;return"connected"===s?null:"disconnected"===s?(0,r.jsx)("button",{type:"button",className:"connection-bar connection-bar--disconnected","aria-live":"assertive","aria-atomic":"true",onClick:()=>window.location.reload(),children:"Offline \xb7 tap to retry"}):(0,r.jsx)("div",{className:"connection-bar connection-bar--reconnecting",role:"status","aria-live":"polite","aria-atomic":"true",children:"Reconnecting…"})}let I="ao.updateBanner.dismissedFor";function R(){let[e,s]=(0,a.useState)(null),[t,n]=(0,a.useState)("idle"),[o,l]=(0,a.useState)(null),[i,c]=(0,a.useState)(null);(0,a.useEffect)(()=>{try{c(window.localStorage.getItem(I))}catch(e){}},[]),(0,a.useEffect)(()=>{if("function"!=typeof fetch)return;let e=!1;return Promise.resolve(fetch("/api/version",{cache:"no-store"})).then(e=>e&&e.ok?e.json():null).then(t=>{e||s(t)}).catch(()=>{}),()=>{e=!0}},[]);let d=(0,a.useCallback)(()=>{if(null==e?void 0:e.latest){try{window.localStorage.setItem(I,e.latest)}catch(e){}c(e.latest),n("idle"),l(null)}},[e]),h=(0,a.useCallback)(async()=>{n("starting"),l(null);try{var e;let s=await fetch("/api/update",{method:"POST"}),t=await s.json();if(s.ok)return void n("started");if(409===s.status){n("blocked"),l(t.message);return}n("error"),l(null!=(e=t.message)?e:"Update failed")}catch(e){n("error"),l(e instanceof Error?e.message:String(e))}},[]);if(!e||!e.isOutdated||!e.latest||"manual"===e.channel||i===e.latest&&"idle"===t||"started"===t)return null;let u="nightly"===e.channel?" (nightly)":"";return(0,r.jsxs)("div",{role:"status","aria-live":"polite",className:"flex w-full items-center justify-between gap-3 border-b border-[var(--color-border-default)] bg-[var(--color-accent-amber-dim)] px-4 py-2 text-sm text-[var(--color-text-primary)]",children:[(0,r.jsxs)("div",{className:"flex flex-1 items-center gap-3",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"inline-block h-2 w-2 flex-shrink-0 rounded-full bg-[var(--color-accent-amber)]"}),(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 sm:flex-row sm:items-baseline sm:gap-2",children:[(0,r.jsxs)("span",{className:"font-medium",children:["Update available",u,": ",e.current," → ",e.latest]}),"blocked"===t&&o||"error"===t&&o?(0,r.jsx)("span",{className:"text-xs text-[var(--color-status-error)]",children:o}):"starting"===t?(0,r.jsx)("span",{className:"text-xs text-[var(--color-text-secondary)]",children:"Starting…"}):(0,r.jsx)("span",{className:"text-xs text-[var(--color-text-secondary)]",children:"Click Update to install. The dashboard will restart."})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>void h(),disabled:"starting"===t,className:"rounded-sm border border-[var(--color-accent-amber-border)] bg-[var(--color-accent-amber)] px-3 py-1 text-xs font-medium text-[var(--color-text-inverse)] hover:bg-[color-mix(in_srgb,var(--color-accent-amber)_85%,black)] disabled:cursor-wait disabled:opacity-60",children:"starting"===t?"Updating…":"Update"}),(0,r.jsx)("button",{type:"button",onClick:d,"aria-label":"Dismiss",className:"rounded-sm px-2 py-1 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)]",children:"Dismiss"})]})]})}let D=[/\bBearer\s+[A-Za-z0-9._\-+/=]+\b/gi,/\bsk-[A-Za-z0-9]{10,}\b/g,/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g];function W(e){let{projectId:s}=e,{showToast:t}=(0,S.d)(),[n,o]=(0,a.useState)(!1),l=(0,a.useCallback)(async()=>{if(!n){o(!0);try{let e,r=await fetch("/api/observability",{credentials:"same-origin"});if(!r.ok)return void t("Could not fetch observability snapshot","error");let a=r.headers.get("x-correlation-id");try{e=await r.json()}catch(e){t("Could not parse observability snapshot","error");return}let n=function e(s){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakSet;if("string"==typeof s)return D.reduce((e,s)=>e.replace(s,"[REDACTED]"),s);if(Array.isArray(s))return s.map(s=>e(s,t));if(s&&"object"==typeof s){if(t.has(s))return"[Circular]";t.add(s);let r={};for(let[a,n]of Object.entries(s))r[a]=e(n,t);return r}return s}(function(e,s){if(!s||!e||"object"!=typeof e)return e;let t={...e},r=t.projects;if(r&&"object"==typeof r&&!Array.isArray(r)){let e=r[s];t.projects=void 0===e?{}:{[s]:e}}return t}(e,s)),o={copiedAt:new Date().toISOString(),pageHref:"".concat(window.location.origin).concat(window.location.pathname),projectId:null!=s?s:null,correlationId:a,userAgent:navigator.userAgent,observability:n};await navigator.clipboard.writeText(JSON.stringify(o,null,2)),t("Debug bundle copied to clipboard","success")}catch(e){t("Could not copy debug bundle","error")}finally{o(!1)}}},[n,s,t]);return(0,r.jsx)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--icon",onClick:()=>void l(),disabled:n,title:"Copy debug bundle","aria-label":"Copy debug bundle for issue reports",children:(0,r.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,r.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}var T=t(1550),B=t(2466),E=t(4115),O=t(5425);function A(e){let s=Date.now(),t=Math.floor((s-new Date(e).getTime())/1e3);if(t<60)return"".concat(t,"s ago");let r=Math.floor(t/60);if(r<60)return"".concat(r,"m ago");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h ago");let n=Math.floor(a/24);return"".concat(n,"d ago")}function F(e){return e.replaceAll("_"," ")}function L(e){return null!==e}function U(e){var s,t;let{session:n,mode:o,onCancel:l,onConfirm:i,onRequestKill:d,onMerge:u,isMergeReady:m=!1}=e,x=(0,a.useRef)(null),b=(0,a.useRef)(null),v=(0,a.useRef)(null),g=null!=(t=null==n||null==(s=n.pr)?void 0:s.number)?t:null;if((0,a.useEffect)(()=>{if(!n){v.current=null;return}function e(e){"Escape"===e.key&&l()}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n,l]),(0,a.useEffect)(()=>{if(!n||!b.current)return;let e=b.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===e.length)return;let s=e[0],t=e[e.length-1],r=v.current!==n.id;function a(e){"Tab"===e.key&&(e.shiftKey&&document.activeElement===s?(e.preventDefault(),t.focus()):e.shiftKey||document.activeElement!==t||(e.preventDefault(),s.focus()))}v.current=n.id,r&&s.focus();let o=b.current;return o.addEventListener("keydown",a),()=>o.removeEventListener("keydown",a)},[n,o]),!n)return null;let j=(0,h.Pn)(n),f=(0,c.ng)(n),_=n.summary&&!n.summaryIsFallback?n.summary:null,N="done"!==f&&"merge"!==f&&!(0,c.y8)(n),w=n.pr,y=!!(w&&!(0,c.fZ)(w)&&!(0,c.sZ)(w)),k="done"===f||(0,c.nH)(n),C=[{label:F(f),tone:"accent"},{label:F(n.status),tone:"neutral"},n.activity?{label:F(n.activity),tone:"neutral"}:null,n.branch?{label:n.branch,tone:"mono"}:null,n.pr?{label:"PR #".concat(n.pr.number),tone:"neutral"}:null,n.issueLabel?{label:n.issueLabel,tone:"neutral"}:null].filter(L);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"bottom-sheet-backdrop",onClick:l,"aria-hidden":"true"}),(0,r.jsxs)("div",{ref:b,className:"bottom-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"bottom-sheet-title",onTouchStart:function(e){var s,t;x.current=null!=(t=null==(s=e.touches[0])?void 0:s.clientY)?t:null},onTouchEnd:function(e){var s,t;if(null===x.current)return;let r=(null!=(t=null==(s=e.changedTouches[0])?void 0:s.clientY)?t:0)-x.current;x.current=null,r>80&&l()},children:[(0,r.jsx)("div",{className:"bottom-sheet__handle","aria-hidden":"true"}),"confirm-kill"===o?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"bottom-sheet__header",children:[(0,r.jsx)("h2",{id:"bottom-sheet-title",className:"bottom-sheet__title",children:"Terminate session?"}),(0,r.jsx)("p",{className:"bottom-sheet__subtitle",children:"This action cannot be undone."})]}),(0,r.jsxs)("div",{className:"bottom-sheet__session-info",children:[(0,r.jsx)("div",{className:"bottom-sheet__session-name",children:j}),(0,r.jsx)("div",{className:"bottom-sheet__session-meta",children:C.map(e=>(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--".concat(e.tone),children:e.label},"".concat(e.tone,"-").concat(e.label)))}),_?(0,r.jsx)("p",{className:"bottom-sheet__summary",children:_}):null]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"bottom-sheet__preview-card",children:[(0,r.jsx)("div",{className:"bottom-sheet__preview-strip","data-level":f}),(0,r.jsxs)("div",{className:"bottom-sheet__preview-content",children:[(0,r.jsxs)("div",{className:"bottom-sheet__preview-header",children:[(0,r.jsx)("span",{className:"bottom-sheet__preview-id",children:n.id}),(0,r.jsx)("span",{className:"bottom-sheet__preview-time",children:A(n.lastActivityAt)})]}),(0,r.jsx)("h2",{id:"bottom-sheet-title",className:"bottom-sheet__title",children:j}),(0,r.jsxs)("p",{className:"bottom-sheet__subtitle",children:[F(f)," \xb7 started ",A(n.createdAt)]}),(0,r.jsxs)("div",{className:"bottom-sheet__preview-meta",children:[n.branch?(0,r.jsx)("span",{className:"bottom-sheet__preview-branch",children:n.branch}):null,w?(0,r.jsxs)("span",{className:"bottom-sheet__preview-pr",children:["#",w.number]}):null,y&&w?(0,r.jsxs)("span",{className:"bottom-sheet__preview-diff",children:[(0,r.jsxs)("span",{className:"bottom-sheet__preview-diff-add",children:["+",w.additions]})," ",(0,r.jsxs)("span",{className:"bottom-sheet__preview-diff-del",children:["-",w.deletions]})]}):null]}),y&&w?(0,r.jsxs)("div",{className:"bottom-sheet__preview-pills",children:[(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:"passing"===w.ciStatus?"CI passing":"failing"===w.ciStatus?"CI failed":"CI pending"}),(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:"approved"===w.reviewDecision?"approved":"changes_requested"===w.reviewDecision?"changes requested":"needs review"}),k?(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:F(n.status)}):null,k&&n.activity?(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:F(n.activity)}):null]}):(0,r.jsxs)("div",{className:"bottom-sheet__preview-pills",children:[(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--accent",children:F(n.status)}),n.activity?(0,r.jsx)("span",{className:"bottom-sheet__tag bottom-sheet__tag--neutral",children:F(n.activity)}):null]})]})]}),_?(0,r.jsx)("p",{className:"bottom-sheet__summary",children:_}):null]}),(0,r.jsx)("div",{className:"bottom-sheet__actions",children:"confirm-kill"===o?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--cancel",onClick:l,children:"Cancel"}),(0,r.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--danger",onClick:i,children:"Terminate"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:(0,p.Nc)(n.projectId,n.id),className:"bottom-sheet__btn bottom-sheet__btn--primary",children:"Open session"}),m&&n.pr&&u?(0,r.jsx)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--secondary",onClick:()=>{if(null!==g){var e,s;u(g,null==(e=n.pr)?void 0:e.owner,null==(s=n.pr)?void 0:s.repo)}},children:"Merge"}):N&&d?(0,r.jsxs)("button",{type:"button",className:"bottom-sheet__btn bottom-sheet__btn--danger",onClick:d,children:[(0,r.jsxs)("svg",{className:"bottom-sheet__btn-icon",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M3 6h18"}),(0,r.jsx)("path",{d:"M8 6V4h8v2"}),(0,r.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,r.jsx)("path",{d:"M10 11v6M14 11v6"})]}),"Terminate"]}):null]})})]})]})}let q=["working","action","pending","merge"],H=["working","respond","review","pending","merge"],Z=[];function K(e){var s;let{session:t,onRestore:a}=e,n=!t.summaryIsFallback&&t.summary||t.issueTitle||t.summary||t.id,o=(null==(s=t.pr)?void 0:s.state)==="merged"||"merged"===t.status,l=(0,c.y8)(t),i=(0,c.wy)(t);return(0,r.jsxs)("div",{className:"done-card",children:[(0,r.jsx)("p",{className:"done-card__title",children:n}),(0,r.jsxs)("div",{className:"done-card__meta",children:[(0,r.jsx)("span",{className:"done-card__badge ".concat(l?"done-card__badge--terminated":"done-card__badge--merged"),children:o?"merged":l?"terminated":"done"}),t.pr?(0,r.jsxs)("a",{href:t.pr.url,target:"_blank",rel:"noopener noreferrer",className:"done-card__pr",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("svg",{width:"9",height:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,r.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,r.jsx)("path",{d:"M6 9v3a6 6 0 0 0 6 6h3"})]}),"#",t.pr.number]}):null,(0,r.jsx)("span",{className:"done-card__age",children:function(e){if(!e)return"just now";let s=new Date(e).getTime();if(!Number.isFinite(s))return"just now";let t=Date.now()-s;if(t<=0)return"just now";let r=Math.floor(t/1e3),a=Math.floor(r/60),n=Math.floor(a/60),o=Math.floor(n/24);return r<60?"".concat(r,"s ago"):a<60?"".concat(a,"m ago"):n<24?"".concat(n,"h ago"):"".concat(o,"d ago")}(t.lastActivityAt)}),i?(0,r.jsx)("button",{type:"button",className:"done-card__restore",onClick:e=>{e.stopPropagation(),a(t.id)},children:"Restore"}):null]})]})}function z(e){var s,t,n;let{initialSessions:d,projectId:h,projectName:u,projects:m=[],orchestrators:x,attentionZones:b="simple",dashboardLoadError:v}=e,g=null!=x?x:Z,j=(0,k.eT)(),_="detailed"===b?H:q,N=(0,a.useMemo)(()=>{let e={};for(let s of d)e[s.id]=(0,c.ng)(s,b);return e},[d,b]),{sessions:C,attentionLevels:I,liveSessionsResolved:D,loadError:A}=(0,y.D)({initialSessions:d,muxSessions:(null==j?void 0:j.status)==="connected"?j.sessions:void 0,muxLastError:null==j?void 0:j.lastError,initialAttentionLevels:N,attentionZones:b}),F=(0,a.useMemo)(()=>h?C.filter(e=>e.projectId===h):C,[C,h]),L=(0,a.useMemo)(()=>m.map(e=>{var s;return null!=(s=e.sessionPrefix)?s:e.id}),[m]),z=(0,a.useMemo)(()=>C.filter(e=>{var s,t;return(0,O.tT)(e,null!=(t=null==(s=m.find(s=>s.id===e.projectId))?void 0:s.sessionPrefix)?t:e.projectId,L)}).map(e=>({id:e.id,projectId:e.projectId})),[C,m,L]),V=(null==j?void 0:j.status)==="disconnected"?"disconnected":(null==j?void 0:j.status)==="connected"?"connected":"reconnecting",J=null!=A?A:v&&D?void 0:v,Y=(0,l.useSearchParams)(),Q=(0,l.useRouter)(),$=(0,a.useRef)(Q);$.current=Q;let X=null!=(s=Y.get("session"))?s:void 0,[ee,es]=(0,a.useState)(!1),[et,er]=(0,a.useState)(g),[ea,en]=(0,a.useState)([]),[eo,el]=(0,a.useState)({}),ei=(0,i.U)(i.D),ec=(0,B.V)(),ed=null!==ec,[eh,eu]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(!1),ep=(0,a.useCallback)(()=>{if(ed&&ec)return void ec.onToggleSidebar();ei?ex(e=>!e):eu(e=>!e)},[ei,ed,ec]),[eb,ev]=(0,a.useState)(()=>new Set(["done","working"])),[eg,ej]=(0,a.useState)(null),[ef,e_]=(0,a.useState)("preview"),eN=Y.get("debug"),ew=!ei&&("1"===eN||"true"===eN),{showToast:ey}=(0,S.d)(),[ek,eC]=(0,a.useState)(!1),eM=(0,a.useRef)(C);eM.current=C;let eS=m.length>1&&void 0===h,eP=h?(0,p.bn)(h):"/?project=all",eI=(0,p.nF)(h),eR=(0,a.useMemo)(()=>{var e;return h&&null!=(e=et.find(e=>e.projectId===h))?e:null},[et,h]),eD=eR?(0,p.Nc)(eR.projectId,eR.id):null,eW=!eS&&!!h&&m.some(e=>e.id===h&&!e.resolveError)&&!eD,eT=h&&null!=(t=m.find(e=>e.id===h))?t:null,eB=!!h&&ea.includes(h),eE=h&&null!=(n=eo[h])?n:null,eO=(0,a.useMemo)(()=>eS||!X?F:F.filter(e=>e.id===X),[F,eS,X]);(0,a.useEffect)(()=>{er(e=>(function(e,s){let t=new Map(e.map(e=>[e.projectId,e]));for(let e of s)t.set(e.projectId,e);return[...t.values()]})(e,g))},[g]),(0,a.useEffect)(()=>{let e=(0,w.S)(I),s=null!=u?u:"ao";document.title=e>0?"".concat(s," (").concat(e," need attention)"):s},[I,u]);let eA=(0,a.useMemo)(()=>{let e={merge:[],action:[],respond:[],review:[],pending:[],working:[],done:[]};for(let s of eO)e[(0,c.ng)(s,b)].push(s);return e},[eO,b]),eF=(0,a.useMemo)(()=>{let e=new Map;for(let s of C){let t=e.get(s.projectId);if(t){t.push(s);continue}e.set(s.projectId,[s])}return e},[C]),eL=(0,a.useMemo)(()=>eS?m.map(e=>{var s,t;let r=null!=(s=eF.get(e.id))?s:[],a={merge:0,action:0,respond:0,review:0,pending:0,working:0,done:0};for(let e of r)a[(0,c.ng)(e,b)]++;return{project:e,orchestrator:null!=(t=et.find(s=>s.projectId===e.id))?t:null,sessionCount:r.length,openPRCount:r.filter(e=>{var s;return(null==(s=e.pr)?void 0:s.state)==="open"}).length,counts:a}}):[],[et,eS,b,m,eF]),eU=(0,a.useCallback)(async e=>{try{let s=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/kill"),{method:"POST"});if(s.ok)ey("Session terminated","success");else{let t=await s.text();console.error("Failed to kill ".concat(e,":"),t),ey("Terminate failed: ".concat(t),"error")}}catch(s){console.error("Network error killing ".concat(e,":"),s),ey("Network error while terminating session","error")}},[ey]),eq=(0,a.useCallback)(e=>{var s;let t=null!=(s=eM.current.find(s=>s.id===e))?s:null;t&&eU(t.id)},[eU]),eH=(0,a.useCallback)(e=>{ej(e),e_("preview")},[]),eZ=(0,a.useCallback)(()=>{e_("confirm-kill")},[]),eK=(0,a.useCallback)(()=>{ej(null),e_("preview")},[]),ez=(0,a.useCallback)(()=>{eg&&eU(eg.id),ej(null),e_("preview")},[eg,eU]),eV=(0,a.useCallback)(async(e,s,t)=>{try{let r=new URLSearchParams;s&&r.set("owner",s),t&&r.set("repo",t);let a=r.size>0?"?".concat(r.toString()):"",n=await fetch("/api/prs/".concat(e,"/merge").concat(a),{method:"POST"});if(n.ok)ey("PR #".concat(e," merged"),"success");else{let s=await n.text();console.error("Failed to merge PR #".concat(e,":"),s),ey("Merge failed: ".concat(s),"error");return}}catch(s){console.error("Network error merging PR #".concat(e,":"),s),ey("Network error while merging PR","error")}},[ey]),eG=(0,a.useCallback)(async e=>{try{let s=await fetch("/api/sessions/".concat(encodeURIComponent(e),"/restore"),{method:"POST"});if(s.ok)ey("Session restored","success"),$.current.refresh();else{let t=await s.text();console.error("Failed to restore ".concat(e,":"),t),ey("Restore failed: ".concat(t),"error")}}catch(s){console.error("Network error restoring ".concat(e,":"),s),ey("Network error while restoring session","error")}},[ey]),eJ=async e=>{en(s=>s.includes(e.id)?s:[...s,e.id]),el(s=>{let{[e.id]:t,...r}=s;return r});try{let t=await fetch("/api/orchestrators",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e.id})}),r=await t.json().catch(()=>null);if(!t.ok||!(null==r?void 0:r.orchestrator)){var s;throw Error(null!=(s=null==r?void 0:r.error)?s:"Failed to spawn orchestrator for ".concat(e.name))}let a=r.orchestrator;er(s=>{let t=s.filter(s=>s.projectId!==e.id);return t.push(a),t})}catch(t){let s=t instanceof Error?t.message:"Failed to spawn orchestrator";el(t=>({...t,[e.id]:s})),console.error("Failed to spawn orchestrator for ".concat(e.id,":"),t)}finally{en(s=>s.filter(s=>s!==e.id))}},eY=_.some(e=>eA[e].length>0),eQ=!eS&&!eY&&!J,e$=J?(0,r.jsxs)("div",{className:"dashboard-alert mb-6 flex flex-col gap-1.5 border border-[color-mix(in_srgb,var(--color-status-error)_28%,transparent)] bg-[color-mix(in_srgb,var(--color-status-error)_10%,transparent)] px-3.5 py-2.5 text-[11px] md:mb-4",role:"alert","aria-live":"assertive",children:[(0,r.jsx)("span",{className:"font-semibold text-[var(--color-status-error)]",children:"Orchestrator failed to load"}),(0,r.jsx)("span",{className:"break-words text-[var(--color-text-secondary)]",children:J}),(0,r.jsxs)("span",{className:"text-[var(--color-text-secondary)]",children:["Confirm ",(0,r.jsx)("span",{className:"font-mono text-[10px]",children:"agent-orchestrator.yaml"})," exists and is valid, then run ",(0,r.jsx)("span",{className:"font-mono text-[10px]",children:"athene doctor"})," for diagnostics."]})]}):null,eX=(0,a.useMemo)(()=>C.some(e=>e.pr&&(0,c.fZ)(e.pr)),[C]),e0=null!=u?u:eS?"All projects":"Dashboard",e1=!eS&&e0.trim().length>0,e2=e=>{ev(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},e4=(0,r.jsxs)("div",{className:"dashboard-main--desktop",children:[(0,r.jsxs)("header",{className:"dashboard-app-header",children:[ei?(0,r.jsx)("button",{type:"button",className:"dashboard-app-sidebar-toggle",onClick:ep,"aria-label":"Toggle sidebar",children:(0,r.jsx)("svg",{width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})})}):null,e1?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"dashboard-app-header__sep topbar-desktop-only","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"topbar-project-pills-group",children:[(0,r.jsxs)("div",{className:"topbar-project-line",children:[(0,r.jsx)("span",{className:"dashboard-app-header__project",children:e0}),(0,r.jsxs)("nav",{className:"workspace-mode-switch","aria-label":"Workspace mode",children:[(0,r.jsx)(o(),{href:eP,className:"workspace-mode-switch__item workspace-mode-switch__item--active","aria-current":"page",children:"Coding"}),(0,r.jsx)(o(),{href:eI,className:"workspace-mode-switch__item",children:"Reviews"})]})]}),!eS&&F.length>0?(0,r.jsxs)("div",{className:"topbar-session-pills",children:[eA.working.length>0?(0,r.jsxs)("div",{className:"topbar-status-pill topbar-status-pill--active",children:[(0,r.jsx)("span",{className:"topbar-status-pill__dot topbar-status-pill__dot--working"}),(0,r.jsxs)("span",{className:"topbar-status-pill__label",children:[eA.working.length," working"]})]}):null,eA.merge.length+eA.action.length+eA.respond.length+eA.review.length>0?(0,r.jsxs)("div",{className:"topbar-status-pill topbar-status-pill--waiting-for-input",children:[(0,r.jsx)("span",{className:"topbar-status-pill__dot topbar-status-pill__dot--attention"}),(0,r.jsxs)("span",{className:"topbar-status-pill__label",children:[eA.merge.length+eA.action.length+eA.respond.length+eA.review.length," ","need attention"]})]}):null]}):null]})]}):null,(0,r.jsx)("div",{className:"dashboard-app-header__spacer"}),(0,r.jsxs)("div",{className:"dashboard-app-header__actions",children:[ew?(0,r.jsx)(W,{projectId:h}):null,(0,r.jsx)(T.e,{}),!eS&&eD?(0,r.jsxs)(o(),{href:eD,className:"dashboard-app-btn dashboard-app-btn--primary","aria-label":"Orchestrator",children:[(0,r.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,r.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,r.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),"Orchestrator"]}):eW&&eT?(0,r.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-app-btn--primary","aria-label":"Spawn Orchestrator",onClick:()=>void eJ(eT),disabled:eB,children:[(0,r.jsxs)("svg",{width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"5",r:"2",fill:"currentColor",stroke:"none"}),(0,r.jsx)("path",{d:"M12 7v4M12 11H6M12 11h6M6 11v3M12 11v3M18 11v3"}),(0,r.jsx)("circle",{cx:"6",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"17",r:"2"}),(0,r.jsx)("circle",{cx:"18",cy:"17",r:"2"})]}),eB?"Spawning...":"Spawn Orchestrator"]}):null]})]}),(0,r.jsxs)("main",{className:"dashboard-main flex flex-col flex-1 min-h-0 overflow-hidden",children:[(0,r.jsx)(w.u,{attentionLevels:I,projectName:u}),(0,r.jsxs)("div",{className:"dashboard-main__subhead",children:[(0,r.jsx)("h1",{className:"dashboard-main__title",children:"Board"}),(0,r.jsx)("p",{className:"dashboard-main__subtitle",children:"Live agent sessions flowing from work → review → merge."})]}),(0,r.jsxs)("div",{className:"dashboard-main__body",children:[e$,eX&&!ee&&(0,r.jsxs)("div",{className:"dashboard-alert mb-4 flex items-center gap-2.5 border border-[color-mix(in_srgb,var(--color-status-attention)_25%,transparent)] bg-[var(--color-tint-yellow)] px-3.5 py-2.5 text-[11px] text-[var(--color-status-attention)]",children:[(0,r.jsxs)("svg",{className:"h-3.5 w-3.5 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("path",{d:"M12 8v4M12 16h.01"})]}),(0,r.jsx)("span",{className:"flex-1",children:"GitHub API rate limited — PR data (CI status, review state, sizes) may be stale. Will retry automatically on next refresh."}),(0,r.jsx)("button",{onClick:()=>es(!0),className:"ml-1 shrink-0 opacity-60 hover:opacity-100","aria-label":"Dismiss",children:(0,r.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),eS&&(0,r.jsx)(G,{overviews:eL,onSpawnOrchestrator:eJ,spawningProjectIds:ea,spawnErrors:eo,attentionZones:b}),!eS&&eY&&(0,r.jsx)("div",{className:"kanban-board-wrap",children:(0,r.jsx)("div",{className:"kanban-board","data-columns":_.length,style:{"--kanban-column-count":_.length},children:_.map(e=>(0,r.jsx)(f,{level:e,sessions:eA[e],onKill:eq,onRestore:eG,compactMobile:ei,collapsed:ei&&eb.has(e),onToggle:ei?e2:void 0,onPreview:ei?eH:void 0},e))})}),eQ?(0,r.jsx)(M,{orchestratorHref:eD,onSpawnOrchestrator:eW&&eT?()=>{eJ(eT)}:null,spawnLabel:eB?"Spawning...":"Spawn Orchestrator",spawnDisabled:eB}):null,!eS&&eE?(0,r.jsx)("p",{className:"mt-3 text-[11px] text-[var(--color-status-error)]",children:eE}):null,!eS&&eA.done.length>0&&(0,r.jsxs)("div",{className:"done-bar mt-6",children:[(0,r.jsxs)("button",{type:"button",className:"done-bar__toggle",onClick:()=>eC(e=>!e),"aria-expanded":ek,children:[(0,r.jsx)("svg",{className:"done-bar__chevron".concat(ek?" done-bar__chevron--open":""),fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m9 18 6-6-6-6"})}),(0,r.jsx)("span",{className:"done-bar__label",children:"Done / Terminated"}),(0,r.jsx)("span",{className:"done-bar__count",children:eA.done.length})]}),ek&&(0,r.jsx)("div",{className:"done-bar__cards",children:eA.done.map(e=>(0,r.jsx)(K,{session:e,onRestore:eG},e.id))})]})]})]})]}),e3=(0,r.jsx)(U,{session:eg,mode:ef,onCancel:eK,onConfirm:ez,onRequestKill:eZ,onMerge:eV,isMergeReady:!!eg&&"merge"===I[eg.id]});return ed?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(R,{}),(0,r.jsx)(P,{status:V}),e4,e3]}):(0,r.jsxs)(B.I.Provider,{value:{onToggleSidebar:ep,mobileSidebarOpen:em},children:[(0,r.jsx)(R,{}),(0,r.jsx)(P,{status:V}),(0,r.jsx)("div",{className:"dashboard-app-shell",children:(0,r.jsxs)("div",{className:"dashboard-shell--desktop".concat(eh?" dashboard-shell--sidebar-collapsed":""),children:[(0,r.jsx)("div",{className:"sidebar-wrapper".concat(em?" sidebar-wrapper--mobile-open":""),children:(0,r.jsx)(E.u,{projects:m,sessions:C,orchestrators:z,activeProjectId:h,activeSessionId:X,loading:!D,collapsed:eh,onToggleCollapsed:()=>eu(e=>!e),onMobileClose:()=>ex(!1)})}),em&&(0,r.jsx)("div",{className:"sidebar-mobile-backdrop",onClick:()=>ex(!1)}),e4]})}),e3]})}function V(e){return(0,r.jsx)(S.t,{children:(0,r.jsx)(z,{...e})})}function G(e){let{overviews:s,onSpawnOrchestrator:t,spawningProjectIds:a,spawnErrors:n,attentionZones:l}=e;return(0,r.jsx)("div",{className:"mb-8 grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:s.map(e=>{let{project:s,orchestrator:i,sessionCount:c,openPRCount:d,counts:h}=e,u=!!s.resolveError,m=(0,p.bn)(s.id);return(0,r.jsxs)("section",{className:"border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] p-4",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-[14px] font-semibold text-[var(--color-text-primary)]",children:s.name}),(0,r.jsx)("div",{className:"mt-1 text-[11px] text-[var(--color-text-muted)]",children:u?"Config needs repair":(0,r.jsxs)(r.Fragment,{children:[c," active session",1!==c?"s":"",d>0?" \xb7 ".concat(d," open PR").concat(1!==d?"s":""):""]})})]}),(0,r.jsx)(o(),{href:m,className:"border border-[var(--color-border-default)] px-3 py-1.5 text-[11px] font-medium text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:no-underline",children:"Open project"})]}),(0,r.jsxs)("div",{className:"mb-4 flex flex-wrap gap-2",children:[(0,r.jsx)(J,{label:"Merge",value:h.merge,tone:"ready"}),"detailed"===l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(J,{label:"Respond",value:h.respond,tone:"error"}),(0,r.jsx)(J,{label:"Review",value:h.review,tone:"orange"})]}):(0,r.jsx)(J,{label:"Action",value:h.action,tone:"orange"}),(0,r.jsx)(J,{label:"Pending",value:h.pending,tone:"attention"}),(0,r.jsx)(J,{label:"Working",value:h.working,tone:"working"})]}),(0,r.jsxs)("div",{className:"border-t border-[var(--color-border-subtle)] pt-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("div",{className:"text-[11px] text-[var(--color-text-muted)]",children:u?"Project config could not be resolved":i?"Per-project orchestrator available":"No running orchestrator"}),u?(0,r.jsx)(o(),{href:m,className:"border border-[var(--color-border-default)] px-3 py-1.5 text-[11px] font-semibold text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:no-underline",children:"Repair project"}):i?(0,r.jsxs)(o(),{href:(0,p.Nc)(i.projectId,i.id),className:"orchestrator-btn flex items-center gap-2 px-3 py-1.5 text-[11px] font-semibold hover:no-underline",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--color-accent)] opacity-80"}),"orchestrator"]}):(0,r.jsx)("button",{type:"button",onClick:()=>void t(s),disabled:a.includes(s.id),className:"orchestrator-btn px-3 py-1.5 text-[11px] font-semibold disabled:cursor-wait disabled:opacity-70",children:a.includes(s.id)?"Spawning...":"Spawn Orchestrator"})]}),n[s.id]?(0,r.jsx)("p",{className:"mt-2 text-[11px] text-[var(--color-status-error)]",children:n[s.id]}):null]})]},s.id)})})}function J(e){let{label:s,value:t,tone:a}=e;return(0,r.jsxs)("div",{className:"min-w-[78px] border border-[var(--color-border-subtle)] px-2.5 py-2",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-[0.08em] text-[var(--color-text-tertiary)]",children:s}),(0,r.jsx)("div",{className:"project-metric__value mt-1 text-[18px] font-semibold tabular-nums","data-tone":a,children:t})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9876],{1550:(e,t,n)=>{n.d(t,{e:()=>x});var a=n(3817),r=n(6749),i=n(8713),l=n.n(i),o=n(8450),s=n(5184);let c="ao.dashboard.notifications.read.v1",d={"github.com":"https://github.com","gitlab.com":"https://gitlab.com","linear.app":"https://linear.app"};function u(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function f(e,t){let n=e[t];return"string"==typeof n&&n.trim().length>0?n:null}function h(e,t){let n=e[t];return u(n)?n:null}function m(e){let t=e.event.data;return u(t)&&3===t.schemaVersion?t:null}function p(e){let t=b(e);if(!t)return null;try{let e=new URL(t);e.hash="";let n=e.pathname.replace(/\/+$/,"");return"".concat(e.origin).concat(n).concat(e.search)}catch(e){return null}}function b(e){if(!e||0===e.trim().length)return null;try{let t=new URL(e.trim());if("https:"!==t.protocol)return null;let n=d[t.hostname.toLowerCase()];if(!n)return null;let a=t.pathname.split("/").map(v).join("/"),r=new URLSearchParams(t.searchParams).toString();return"".concat(n).concat(a).concat(r?"?".concat(r):"")}catch(e){return null}}function v(e){try{return encodeURIComponent(decodeURIComponent(e))}catch(t){return encodeURIComponent(e)}}function g(e){let t=m(e);if(!t)return null;let n=f(t,"semanticType");if(n&&"summary.all-complete"===n.toLowerCase().replace(/[_\s]+/g,"-"))return"all complete";let a=h(t,"merge"),r=h(t,"review"),i=a?function(e,t){let n=e[t];return"boolean"==typeof n?n:null}(a,"ready"):null,l=r?f(r,"decision"):null;return"merge.ready"===n||"review.approved"===n||!0===i||"approved"===l?"approved":null}function _(e){return"".concat(e.id,":").concat(e.receivedAt)}function w(e){try{window.localStorage.setItem(c,JSON.stringify([...e]))}catch(e){}}function j(e){var t,n;let{isRead:r,notification:i,onMarkRead:s,onMarkUnread:c}=e,{event:d}=i,u=(0,o.Nc)(d.projectId,d.sessionId),v=b(function(e){let t=function(e){let t=m(e);if(!t)return null;let n=h(t,"subject");return n?h(n,"pr"):null}(e);return t?f(t,"url"):null}(i)),_=b(function(e){let t=m(e);if(!t)return null;let n=h(t,"review");return n?f(n,"url"):null}(i)),w=function(e){let t=m(e);if(!t)return null;let n=h(t,"escalation");return n?f(n,"cause"):null}(i),j=g(i),x=null!=j?j:d.priority,N=(null!=(t=i.actions)?t:[]).map(e=>{let t=b(e.url);return t?{label:e.label,url:t}:null}).filter(e=>null!==e).filter(e=>!function(e,t){let n=e.label.trim().toLowerCase().replace(/\s+/g," "),a=p(e.url),r=p(t.prUrl),i=p(t.reviewUrl);return!!n.includes("dashboard")||!!r&&a===r||!!i&&a===i}(e,{prUrl:v,reviewUrl:_}));return(0,a.jsxs)("li",{className:"dashboard-notification-item ".concat(g(i)?"dashboard-notification-item--success":"urgent"===(n=i.event.priority)?"dashboard-notification-item--urgent":"action"===n?"dashboard-notification-item--action":"warning"===n?"dashboard-notification-item--warning":"dashboard-notification-item--info").concat(r?" dashboard-notification-item--read":" dashboard-notification-item--unread"),children:[(0,a.jsx)("span",{className:"dashboard-notification-item__status-dot","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"dashboard-notification-item__content",children:[(0,a.jsxs)("div",{className:"dashboard-notification-item__topline",children:[(0,a.jsx)("span",{className:"dashboard-notification-item__priority",children:x}),(0,a.jsx)("span",{className:"dashboard-notification-item__time",children:function(e){let t=new Date(e).getTime();if(!Number.isFinite(t))return"now";let n=Date.now()-t;if(n<6e4)return"now";let a=Math.floor(n/6e4);if(a<60)return"".concat(a,"m");let r=Math.floor(a/60);return r<24?"".concat(r,"h"):"".concat(Math.floor(r/24),"d")}(i.receivedAt)})]}),(0,a.jsx)("p",{className:"dashboard-notification-item__message",children:d.message}),(0,a.jsxs)("div",{className:"dashboard-notification-item__meta",children:[(0,a.jsx)("span",{children:d.projectId}),(0,a.jsx)("span",{children:d.sessionId}),w?(0,a.jsx)("span",{children:w.replace(/_/g," ")}):null]}),(0,a.jsxs)("div",{className:"dashboard-notification-item__links",children:[(0,a.jsx)(l(),{href:u,children:"Session"}),v?(0,a.jsx)("a",{href:v,target:"_blank",rel:"noopener noreferrer",children:"PR"}):null,_?(0,a.jsx)("a",{href:_,target:"_blank",rel:"noopener noreferrer",children:"Review"}):null,N.map(e=>(0,a.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:e.label},"".concat(i.id,":").concat(e.label,":").concat(e.url)))]})]}),(0,a.jsx)("div",{className:"dashboard-notification-item__side",children:(0,a.jsx)("button",{type:"button",className:"dashboard-notification-item__read-btn",onClick:r?c:s,children:r?"Mark unread":"Mark read"})})]})}function x(){var e,t;let n=(0,s.eT)(),i=null!=(e=null==n?void 0:n.notifications)?e:[],l=null!=(t=null==n?void 0:n.notificationError)?t:null,[o,d]=(0,r.useState)(!1),[u,f]=(0,r.useState)("all"),[h,m]=(0,r.useState)(()=>(function(){try{let e=window.localStorage.getItem(c),t=e?JSON.parse(e):null;if(!Array.isArray(t))return new Set;return new Set(t.filter(e=>"string"==typeof e))}catch(e){return new Set}})()),p=(0,r.useRef)(null),b=(0,r.useMemo)(()=>i.filter(e=>!h.has(_(e))).length,[i,h]),v=i.length>0&&0===b,g=(0,r.useMemo)(()=>[..."unread"===u?i.filter(e=>!h.has(_(e))):i].reverse(),[i,h,u]);return(0,r.useEffect)(()=>{0!==i.length&&m(e=>{let t=function(e,t){let n=new Set(t.map(_));return new Set([...e].filter(e=>n.has(e)))}(e,i);return t.size===e.size?e:(w(t),t)})},[i]),(0,r.useEffect)(()=>{if(!o)return;let e=e=>{var t;(null==(t=p.current)?void 0:t.contains(e.target))||d(!1)},t=e=>{"Escape"===e.key&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[o]),(0,a.jsxs)("div",{ref:p,className:"dashboard-notification-wrap",children:[(0,a.jsxs)("button",{type:"button",className:"dashboard-app-btn dashboard-notification-btn".concat(o?" dashboard-notification-btn--open":""),"aria-label":"Notifications","aria-expanded":o,onClick:()=>d(e=>!e),children:[(0,a.jsxs)("svg",{width:"17",height:"17",fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M18 8a6 6 0 0 0-12 0c0 7-3 8-3 8h18s-3-1-3-8"}),(0,a.jsx)("path",{d:"M13.7 21a2 2 0 0 1-3.4 0"})]}),b>0?(0,a.jsx)("span",{className:"dashboard-notification-btn__count",children:b}):null]}),o?(0,a.jsxs)("div",{className:"dashboard-notification-panel",role:"dialog","aria-label":"Notifications",children:[(0,a.jsxs)("div",{className:"dashboard-notification-panel__header",children:[(0,a.jsx)("div",{className:"dashboard-notification-panel__title",children:"Notifications"}),(0,a.jsx)("div",{className:"dashboard-notification-panel__actions",children:(0,a.jsx)("button",{type:"button",className:"dashboard-notification-panel__mark-all",disabled:0===i.length,onClick:v?()=>{m(e=>{let t=new Set(e);for(let e of i)t.delete(_(e));return w(t),t})}:()=>{m(e=>{let t=new Set(e);for(let e of i)t.add(_(e));return w(t),t})},children:v?"Mark all unread":"Mark all read"})})]}),(0,a.jsxs)("div",{className:"dashboard-notification-tabs",role:"tablist","aria-label":"Notification view",children:[(0,a.jsx)("button",{type:"button",role:"tab","aria-selected":"all"===u,className:"dashboard-notification-tab",onClick:()=>f("all"),children:"All"}),(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":"unread"===u,className:"dashboard-notification-tab",onClick:()=>f("unread"),children:["Unread ",(0,a.jsx)("span",{children:b})]})]}),l?(0,a.jsx)("div",{className:"dashboard-notification-panel__error",children:l}):null,g.length>0?(0,a.jsx)("ul",{className:"dashboard-notification-list",children:g.map(e=>(0,a.jsx)(j,{isRead:h.has(_(e)),notification:e,onMarkRead:()=>{m(t=>{let n=_(e);if(t.has(n))return t;let a=new Set(t);return a.add(n),w(a),a})},onMarkUnread:()=>{m(t=>{let n=_(e);if(!t.has(n))return t;let a=new Set(t);return a.delete(n),w(a),a})}},_(e)))}):(0,a.jsx)("div",{className:"dashboard-notification-panel__empty",children:"unread"===u?"No unread notifications":"No notifications yet"})]}):null]})}},2466:(e,t,n)=>{n.d(t,{I:()=>r,V:()=>i});var a=n(6749);let r=(0,a.createContext)(null);function i(){return(0,a.useContext)(r)}},3210:(e,t,n)=>{n.d(t,{W:()=>s});var a=n(3817),r=n(6749),i=n(5425),l=n(545);function o(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{tone:e,label:t,breathing:n}}let s=(0,r.memo)(function(e){let{session:t,spec:n,variant:r="inline",className:s}=e,c=null!=n?n:t?function(e){var t,n,a,r,s,c,d,u;let f=(0,l.ng)(e,"detailed");if("done"===f)return(null==(t=e.pr)?void 0:t.state)==="merged"||"merged"===e.status?o("merged","Merged"):(0,l.y8)(e)?o("neutral","Terminated"):o("neutral","Done");if("merge"===f)return o("ready","Mergeable");if("respond"===f)return(null==(n=e.lifecycle)?void 0:n.sessionState)==="stuck"||e.status===i.SB.STUCK||e.status===i.SB.ERRORED?o("fail","Stuck"):e.activity===i.u3.EXITED?o("fail","Crashed"):o("input","Needs input");if("review"===f)return(null==(a=e.lifecycle)?void 0:a.prReason)==="ci_failing"||"ci_failed"===e.status||(null==(r=e.pr)?void 0:r.ciStatus)===i.U1.FAILING?o("fail","CI failed"):(null==(s=e.lifecycle)?void 0:s.prReason)==="changes_requested"||"changes_requested"===e.status||(null==(c=e.pr)?void 0:c.reviewDecision)==="changes_requested"?o("changes","Changes req."):e.pr&&!e.pr.mergeability.noConflicts?o("fail","Conflicts"):o("review","Needs review");if("pending"===f){let t=null!=(u=null==(d=e.pr)?void 0:d.unresolvedThreads)?u:0;return t>0?o("review","".concat(t," ").concat(1===t?"thread":"threads")):o("review","Review pending")}return e.activity===i.u3.IDLE?o("neutral","Idle"):o("working","Working",!0)}(t):null;if(!c)return null;let d=["status-badge","status-badge--".concat(r),s].filter(Boolean).join(" ");return(0,a.jsxs)("span",{className:d,"data-tone":c.tone,"data-breathing":c.breathing?"":void 0,children:[(0,a.jsx)("span",{className:"status-badge__dot","aria-hidden":"true"}),"dot"!==r?(0,a.jsx)("span",{className:"status-badge__label",children:c.label}):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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,9492,9514,9744],{687:()=>{}},_=>{_.O(0,[131,1461,7358],()=>_(_.s=687)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9170],{1712:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let t=s(1903)._(s(5864));function a(e,r){var s;let a={};"function"==typeof e&&(a.loader=e);let n={...a,...r};return(0,t.default)({...n,modules:null==(s=n.loadableGenerated)?void 0:s.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),e.exports=r.default)},2567:(e,r,s)=>{Promise.resolve().then(s.bind(s,4255))},4255:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>x,dynamic:()=>c});var t=s(3817),a=s(9891),n=s(7594),l=s(6749);let i=(0,a.default)(()=>Promise.all([s.e(8623),s.e(3764),s.e(5204)]).then(s.bind(s,3764)).then(e=>({default:e.DirectTerminal})),{loadableGenerated:{webpack:()=>[3764]},ssr:!1}),o=(0,a.default)(()=>s.e(7317).then(s.bind(s,7317)).then(e=>({default:e.Terminal})),{loadableGenerated:{webpack:()=>[7317]},ssr:!1}),c="force-dynamic";function d(){let e=(0,n.useSearchParams)(),[r,s]=(0,l.useState)([]),[a,c]=(0,l.useState)(!0);(0,l.useEffect)(()=>{fetch("/api/sessions?active=true").then(e=>e.json()).then(e=>{e.sessions&&Array.isArray(e.sessions)&&s(e.sessions.map(e=>e.id))}).catch(e=>{console.error("Failed to fetch sessions:",e)})},[]);let d=e.get("session"),x=e.get("old_session"),m=e.get("new_session"),h=r[0]||"ao-orchestrator",p=r[1]||r[0]||"ao-orchestrator",u=x||d||h,b=m||d||p;return(0,t.jsx)("div",{className:"min-h-screen bg-[var(--color-bg-primary)] p-8",children:(0,t.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)("h1",{className:"mb-2 text-3xl font-bold text-[var(--color-text-primary)]",children:"Terminal Implementation Test & Documentation"}),(0,t.jsxs)("p",{className:"text-sm text-[var(--color-text-muted)]",children:["Comparing sessions:",(0,t.jsxs)("span",{className:"ml-2 font-mono text-[var(--color-accent-red)]",children:["OLD: ",u]}),(0,t.jsxs)("span",{className:"ml-2 font-mono text-[var(--color-accent-green)]",children:["NEW: ",b]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDC1B The Problem"}),(0,t.jsxs)("div",{className:"space-y-3 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Issue:"})," Browser clipboard (Cmd+C/Ctrl+C) only worked when an iTerm2 client was attached to the tmux session."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Impact:"})," Users had to keep iTerm2 tabs open in the background for clipboard to work in the web dashboard."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Investigation time:"})," 12+ hours of debugging across tmux, ttyd, xterm.js, and macOS clipboard systems."]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDD0D Root Cause Analysis"}),(0,t.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"1. How tmux Clipboard Works (OSC 52)"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"tmux uses OSC 52 escape sequences to synchronize clipboard with terminals"}),(0,t.jsxs)("li",{children:["Format:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"\\x1b]52;c;<base64>\\x07"})]}),(0,t.jsx)("li",{children:"Terminal must support OSC 52 and have proper capabilities declared"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"2. tmux Capability Detection (XDA)"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"tmux queries terminal capabilities using Device Attributes (DA/XDA)"}),(0,t.jsxs)("li",{children:["XDA query: ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"CSI > q"})," ","(also called XTVERSION)"]}),(0,t.jsx)("li",{children:'Terminal responds with identification string containing terminal type (e.g., "XTerm(370)", "iTerm2 ")'}),(0,t.jsx)("li",{children:"Based on response, tmux enables features like TTYC_MS (clipboard support)"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"3. The Missing Piece"}),(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-accent-red)] bg-[var(--color-bg-tertiary)] p-4",children:[(0,t.jsx)("p",{className:"font-semibold text-[var(--color-accent-red)]",children:"xterm.js does NOT implement XDA (Extended Device Attributes)"}),(0,t.jsxs)("ul",{className:"ml-6 mt-2 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:["XDA is marked as TODO in xterm.js codebase:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"test.skip('CSI > Ps q - Report xterm name and version (XTVERSION)')"})]}),(0,t.jsx)("li",{children:"Without XDA response, tmux doesn't recognize the terminal as clipboard-capable"}),(0,t.jsx)("li",{children:"tmux never emits OSC 52 sequences → clipboard doesn't work"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:'4. Why iTerm2 "Fixed" It'}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:["iTerm2 sends proper XDA response identifying itself as"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:'"iTerm2 "'})]}),(0,t.jsx)("li",{children:"tmux detects this and enables clipboard for the entire session"}),(0,t.jsx)("li",{children:"OSC 52 sequences are then sent to ALL clients, including browser (ttyd/xterm.js)"}),(0,t.jsx)("li",{children:'This is why clipboard "magically worked" when iTerm2 was attached'})]})]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"✅ The Solution"}),(0,t.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"DirectTerminal Implementation"}),(0,t.jsx)("p",{className:"mb-2 text-[var(--color-text-secondary)]",children:"Created custom terminal component that registers an XDA handler using xterm.js parser API:"}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-[2px] bg-black p-4 text-xs",children:(0,t.jsx)("code",{className:"text-[var(--color-accent-green)]",children:'terminal.parser.registerCsiHandler(\n { prefix: ">", final: "q" }, // CSI > q is XDA query\n () => {\n // Respond with XTerm identification\n terminal.write("\\x1bP>|XTerm(370)\\x1b\\\\");\n return true;\n }\n);'})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"What This Does"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"Intercepts XDA queries from tmux"}),(0,t.jsxs)("li",{children:["Responds with"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"XTerm(370)"})," ","identification"]}),(0,t.jsx)("li",{children:'tmux detects "XTerm(" in response and enables TTYC_MS capability'}),(0,t.jsx)("li",{children:"OSC 52 sequences now flow: tmux → WebSocket → xterm.js → navigator.clipboard"}),(0,t.jsx)("li",{children:(0,t.jsx)("strong",{className:"text-[var(--color-accent-green)]",children:"Clipboard works without iTerm2!"})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"Architecture Changes"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Old:"})," Browser → ttyd (iframe) → tmux"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"New:"})," Browser → Custom WebSocket (node-pty) → tmux"]}),(0,t.jsx)("li",{children:"Bypasses ttyd for direct control over terminal initialization"}),(0,t.jsx)("li",{children:"Full control over escape sequence handling and capabilities"})]})]})]})]}),(0,t.jsxs)("section",{className:"mb-8 rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"⚠️ Node Version Requirement"}),(0,t.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,t.jsx)("div",{className:"rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-tertiary)] p-4",children:(0,t.jsx)("p",{className:"font-semibold text-[var(--color-accent-orange)]",children:"CRITICAL: This implementation requires Node 20.x (currently 20.20.0)"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"Why Node 20?"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:(0,t.jsx)("strong",{children:"node-pty 1.1.0 is incompatible with Node 25+"})}),(0,t.jsxs)("li",{children:["Error on Node 25.6.1:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"posix_spawnp failed"})]}),(0,t.jsx)("li",{children:"Root cause: node-pty's native module (darwin-arm64 prebuild) fails to spawn processes on Node 25"}),(0,t.jsx)("li",{children:"No darwin-arm64 prebuilds available that work with Node 25"}),(0,t.jsx)("li",{children:"Building from source also fails with the same error"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"When Can We Upgrade?"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Option 1:"})," Wait for node-pty 1.2.0 stable release with Node 25+ support"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Option 2:"})," Test node-pty beta versions (currently 1.2.0-beta.11)"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Option 3:"})," Switch to alternative PTY library (e.g., xterm-pty, node-child-pty)"]})]})]}),(0,t.jsxs)("div",{className:"rounded-[2px] bg-[var(--color-bg-tertiary)] p-4",children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"⚡ Testing Instructions for Upgrades"}),(0,t.jsx)("p",{className:"mb-2 text-[var(--color-text-secondary)]",children:"Before upgrading Node or node-pty:"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-1 text-xs text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:["Test node-pty directly:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"node -e \"const pty = require('node-pty'); pty.spawn('/bin/bash', [], {})\""})]}),(0,t.jsxs)("li",{children:["If no"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"posix_spawnp failed"})," ","error, proceed"]}),(0,t.jsx)("li",{children:"Start dev servers and open this page"}),(0,t.jsx)("li",{children:"Test DirectTerminal: verify connection, clipboard, resize"}),(0,t.jsx)("li",{children:"Test multiple sessions to ensure stability"}),(0,t.jsx)("li",{children:"If all tests pass, upgrade is safe"})]})]})]})]}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("button",{onClick:()=>c(!a),className:"rounded-[2px] bg-[var(--color-accent-blue)] px-4 py-2 text-sm font-semibold text-white transition-opacity hover:opacity-80",children:[a?"Hide":"Show"," Side-by-Side Comparison"]}),(0,t.jsx)("span",{className:"text-sm text-[var(--color-text-secondary)]",children:"Compare old (ttyd iframe) vs new (DirectTerminal with XDA)"})]}),u===b&&(0,t.jsxs)("div",{className:"mt-2 rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-tertiary)] p-2 text-xs text-[var(--color-text-secondary)]",children:["⚠️ Using same session for both terminals. To avoid port conflicts, use different sessions:",(0,t.jsx)("code",{className:"ml-1 rounded-[2px] bg-black px-1",children:"?old_session=ao-orchestrator&new_session=ao-20"})]})]}),a&&(0,t.jsxs)("section",{className:"mb-8",children:[(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-4",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"rounded-[2px] bg-[var(--color-accent-red)] px-2 py-1 text-xs font-semibold text-white",children:"OLD"}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-[var(--color-text-primary)]",children:"ttyd iframe (no XDA)"})]}),(0,t.jsxs)("div",{className:"mb-2 rounded bg-[var(--color-bg-tertiary)] p-2 text-xs text-[var(--color-text-secondary)]",children:["❌ Clipboard requires iTerm2 attached",(0,t.jsx)("br",{}),"✅ Battle-tested (ttyd)",(0,t.jsx)("br",{}),"❌ No control over capabilities"]}),(0,t.jsx)(o,{sessionId:u})]}),(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-4",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"rounded-[2px] bg-[var(--color-accent-green)] px-2 py-1 text-xs font-semibold text-white",children:"NEW"}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-[var(--color-text-primary)]",children:"DirectTerminal (with XDA)"})]}),(0,t.jsxs)("div",{className:"mb-2 rounded bg-[var(--color-bg-tertiary)] p-2 text-xs text-[var(--color-text-secondary)]",children:["✅ Clipboard works standalone",(0,t.jsx)("br",{}),"✅ Full control over terminal",(0,t.jsx)("br",{}),"⚠️ Requires Node 20.x (node-pty)"]}),(0,t.jsx)(i,{sessionId:b,tmuxName:b})]})]}),(0,t.jsxs)("div",{className:"mt-4 rounded-[2px] border border-[var(--color-accent-blue)] bg-[var(--color-bg-secondary)] p-4",children:[(0,t.jsx)("h3",{className:"mb-2 text-sm font-semibold text-[var(--color-text-primary)]",children:"\uD83E\uDDEA How to Test Clipboard"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-1 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsx)("li",{children:"Drag-select text in BOTH terminals above"}),(0,t.jsx)("li",{children:"Press Cmd+C (macOS) or Ctrl+Shift+C (Linux/Windows)"}),(0,t.jsx)("li",{children:"Paste in another application (Notes, VS Code, etc.)"}),(0,t.jsx)("li",{children:(0,t.jsx)("strong",{className:"text-[var(--color-text-primary)]",children:"Expected: RIGHT terminal works, LEFT may not (unless iTerm2 is attached)"})})]})]})]}),(0,t.jsxs)("section",{className:"rounded-[2px] border border-[var(--color-accent)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDD2C The Debugging Journey"}),(0,t.jsxs)("div",{className:"space-y-4 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsx)("div",{className:"rounded-[2px] bg-[var(--color-bg-tertiary)] p-4",children:(0,t.jsx)("p",{className:"font-semibold text-[var(--color-accent-red)]",children:"Total Time Wasted: 12+ hours across Feb 15-16, 2026"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"❌ What We Tried (That Didn't Work)"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-2",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Suspected ttyd clipboard handling"})," - Spent hours analyzing ttyd source code, checking OSC 52 passthrough. ttyd was innocent - it passes escape sequences correctly."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Blamed xterm.js configuration"})," - Tried every possible xterm.js option, clipboard addon configurations, terminal type settings. None made a difference."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Investigated macOS clipboard permissions"})," - Checked browser permissions, sandbox attributes, navigator.clipboard API. All were correct."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Suspected WebSocket encoding issues"})," - Checked binary vs text mode, UTF-8 encoding, base64 handling. All correct."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Tried force-enabling tmux clipboard"})," - Used"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"set-option -s set-clipboard on"})," ","in tmux.conf. Didn't help - tmux needs the terminal to declare support."]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"\uD83D\uDCA1 The Breakthrough"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"What finally worked:"})," Registering an XDA (Extended Device Attributes) handler in xterm.js using"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"terminal.parser.registerCsiHandler()"})]}),(0,t.jsx)("pre",{className:"mt-2 overflow-x-auto rounded-[2px] bg-black p-3 text-xs",children:(0,t.jsx)("code",{className:"text-[var(--color-accent-green)]",children:'terminal.parser.registerCsiHandler(\n { prefix: ">", final: "q" },\n () => {\n terminal.write("\\x1bP>|XTerm(370)\\x1b\\\\");\n return true;\n }\n);'})}),(0,t.jsx)("p",{className:"mt-2",children:"This single handler made tmux recognize our terminal as clipboard-capable. Clipboard immediately started working."})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"\uD83C\uDFAF How We Finally Figured It Out"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-2",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Deep-dive into tmux source code"})," - Used DeepWiki.com to analyze tmux's terminal capability detection logic in"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tty-keys.c"})," and"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tty.c"})]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Discovered XDA queries"})," - Found that tmux sends"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"CSI > q"})," (XTVERSION) to detect terminal type"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:'Traced the "iTerm2 magic"'})," - Realized why clipboard worked when iTerm2 was attached: iTerm2 responds to XDA queries, enabling clipboard for the entire tmux session"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Checked xterm.js implementation"})," - Found that XDA is marked as TODO in xterm.js tests:"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"test.skip('CSI > Ps q - Report xterm name and version (XTVERSION)')"})]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Implemented custom handler"})," - Used xterm.js parser API to register our own XDA handler"]})]})]}),(0,t.jsxs)("div",{className:"rounded-[2px] border border-[var(--color-accent-orange)] bg-[var(--color-bg-tertiary)] p-4",children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"⚡ How We Could Have Figured It Out Faster"}),(0,t.jsxs)("ol",{className:"ml-6 list-decimal space-y-2 text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Start with tmux source code first"})," - Instead of debugging xterm.js and ttyd, we should have immediately checked how tmux detects terminal capabilities"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Monitor escape sequences"})," - Running"," ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tmux -vvv"})," or using a terminal protocol analyzer would have revealed the XDA queries being sent"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Compare working vs broken scenarios"})," - Should have captured and diffed the escape sequences when iTerm2 was attached vs not attached earlier"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Check xterm.js issues/limitations first"}),' - A GitHub search for "xterm.js XDA" or "xterm.js device attributes" would have revealed it\'s unimplemented']}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Read tmux documentation on terminal types"})," - tmux man page mentions terminal capability detection, but we focused on clipboard settings instead"]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold text-[var(--color-text-primary)]",children:"\uD83D\uDCDA Key Resources"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,t.jsx)("li",{children:"tmux source analysis: DeepWiki.com (Feb 15, 2026)"}),(0,t.jsx)("li",{children:"xterm.js parser API documentation"}),(0,t.jsx)("li",{children:"XTerm Control Sequences: XTVERSION / Device Attributes"}),(0,t.jsxs)("li",{children:["tmux ",(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"tty-keys.c"}),": Terminal type detection logic"]})]})]})]})]}),(0,t.jsxs)("section",{className:"mt-6 rounded-[2px] border border-[var(--color-border-default)] bg-[var(--color-bg-secondary)] p-6",children:[(0,t.jsx)("h2",{className:"mb-4 text-xl font-bold text-[var(--color-text-primary)]",children:"\uD83D\uDCC1 Implementation Files"}),(0,t.jsxs)("ul",{className:"ml-6 list-disc space-y-1 text-sm text-[var(--color-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"packages/web/src/components/DirectTerminal.tsx"})," ","- Main component with XDA handler"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"packages/web/server/direct-terminal-ws.ts"})," ","- WebSocket server using node-pty"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"rounded-[2px] bg-black px-1 py-0.5",children:"packages/web/src/app/dev/terminal-test/page.tsx"})," ","- This test page"]})]})]}),(0,t.jsxs)("div",{className:"mt-8 border-t border-[var(--color-border-default)] pt-4 text-center text-xs text-[var(--color-text-secondary)]",children:[(0,t.jsx)("p",{children:"Investigation: Feb 15-16, 2026 • Duration: 12+ hours • Status: ✅ Resolved"}),(0,t.jsx)("p",{className:"mt-1",children:"Node 20.20.0 • node-pty 1.1.0 • xterm.js 5.3.0"})]})]})})}function x(){return(0,t.jsx)(l.Suspense,{fallback:(0,t.jsx)("div",{className:"flex min-h-screen items-center justify-center",children:"Loading..."}),children:(0,t.jsx)(d,{})})}},5468:(e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,r){for(var s in r)Object.defineProperty(e,s,{enumerable:!0,get:r[s]})}(r,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return n},createSnapshot:function(){return i}});let s=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class t{disable(){throw s}getStore(){}run(){throw s}exit(){throw s}enterWith(){throw s}static bind(e){return e}}let a="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function n(){return a?new a:new t}function l(e){return a?a.bind(e):t.bind(e)}function i(){return a?a.snapshot():function(e,...r){return e(...r)}}},5864:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let t=s(3817),a=s(6749),n=s(6943);function l(e){return{default:e&&"default"in e?e.default:e}}s(6418);let i={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},o=function(e){let r={...i,...e},s=(0,a.lazy)(()=>r.loader().then(l)),o=r.loading;function c(e){let l=o?(0,t.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,i=!r.ssr||!!r.loading,c=i?a.Suspense:a.Fragment,d=r.ssr?(0,t.jsxs)(t.Fragment,{children:[null,(0,t.jsx)(s,{...e})]}):(0,t.jsx)(n.BailoutToCSR,{reason:"next/dynamic",children:(0,t.jsx)(s,{...e})});return(0,t.jsx)(c,{...i?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},6313:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorage",{enumerable:!0,get:function(){return t.workAsyncStorageInstance}});let t=s(8394)},6418:(e,r,s)=>{"use strict";function t(e){let{moduleIds:r}=e;return null}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return t}}),s(3817),s(4768),s(6313),s(5152)},6943:(e,r,s)=>{"use strict";function t(e){let{reason:r,children:s}=e;return s}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return t}}),s(1763)},7594:(e,r,s)=>{"use strict";var t=s(9582);s.o(t,"useParams")&&s.d(r,{useParams:function(){return t.useParams}}),s.o(t,"usePathname")&&s.d(r,{usePathname:function(){return t.usePathname}}),s.o(t,"useRouter")&&s.d(r,{useRouter:function(){return t.useRouter}}),s.o(t,"useSearchParams")&&s.d(r,{useSearchParams:function(){return t.useSearchParams}})},8394:(e,r,s)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"workAsyncStorageInstance",{enumerable:!0,get:function(){return t}});let t=(0,s(5468).createAsyncLocalStorage)()},9891:(e,r,s)=>{"use strict";s.d(r,{default:()=>a.a});var t=s(1712),a=s.n(t)}},e=>{e.O(0,[131,1461,7358],()=>e(e.s=2567)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8039],{3464:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>s});var a=o(3817),t=o(7594),l=o(6749),n=o(9789);function s(r){let{error:e,reset:o}=r,s=(0,t.useRouter)();return(0,l.useEffect)(()=>{console.error(e)},[e]),(0,a.jsx)(n.ErrorDisplay,{title:"Something went wrong",message:"The dashboard hit an unexpected error. Try reloading the route data or head back to the main dashboard.",tone:"warning",primaryAction:{label:"Try again",onClick:()=>{o(),s.refresh()}},secondaryAction:{label:"Back to dashboard",href:"/"},error:e,compact:!0,chrome:"card"})}},6706:(r,e,o)=>{Promise.resolve().then(o.bind(o,3464))},7594:(r,e,o)=>{"use strict";var a=o(9582);o.o(a,"useParams")&&o.d(e,{useParams:function(){return a.useParams}}),o.o(a,"usePathname")&&o.d(e,{usePathname:function(){return a.usePathname}}),o.o(a,"useRouter")&&o.d(e,{useRouter:function(){return a.useRouter}}),o.o(a,"useSearchParams")&&o.d(e,{useSearchParams:function(){return a.useSearchParams}})},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var a=o(3817),t=o(8713),l=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,a.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,a.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,a.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,a.jsx)(l(),{href:e.href,className:t,style:n,children:e.label}):(0,a.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:l="Technical details",error:i,primaryAction:d,secondaryAction:u,compact:x=!1,chrome:m="page",children:b}=r,v=n[t],h=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,a.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(x?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,a.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,a.jsx)(s,{accent:v.accent}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,a.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,a.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||u)&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,a.jsx)(c,{action:d,primary:!0}):null,u?(0,a.jsx)(c,{action:u}):null]}),b,h?(0,a.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,a.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:l}),(0,a.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,a.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,a.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,a.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=6706)),_N_E=r.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4219],{5272:(r,e,o)=>{Promise.resolve().then(o.bind(o,7494))},7494:(r,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>n});var l=o(3817),t=o(6749),a=o(9789);function n(r){let{error:e,reset:o}=r;return(0,t.useEffect)(()=>{console.error(e)},[e]),(0,l.jsx)("html",{lang:"en",className:"dark",children:(0,l.jsx)("body",{className:"bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased",children:(0,l.jsx)(a.ErrorDisplay,{title:"Something broke at the app shell",message:"The dashboard could not recover from this error at the layout level. Try again first, then reload the page if it still fails.",tone:"error",primaryAction:{label:"Try again",onClick:o},secondaryAction:{label:"Reload page",onClick:()=>window.location.reload()},error:e})})})}},9789:(r,e,o)=>{"use strict";o.d(e,{ErrorDisplay:()=>i});var l=o(3817),t=o(8713),a=o.n(t);let n={error:{accent:"var(--color-status-error)",bg:"var(--color-tint-red)",border:"color-mix(in srgb, var(--color-status-error) 24%, transparent)",label:"error"},warning:{accent:"var(--color-status-attention)",bg:"var(--color-tint-yellow)",border:"color-mix(in srgb, var(--color-status-attention) 24%, transparent)",label:"warning"},"not-found":{accent:"var(--color-accent)",bg:"var(--color-tint-blue)",border:"color-mix(in srgb, var(--color-accent) 24%, transparent)",label:"missing"}};function s(r){let{accent:e}=r;return(0,l.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border",style:{background:"linear-gradient(180deg, color-mix(in srgb, ".concat(e," 16%, var(--color-bg-elevated)) 0%, var(--color-bg-surface) 100%)"),borderColor:"color-mix(in srgb, ".concat(e," 18%, var(--color-border-default))"),boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("svg",{className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeWidth:"1.6",style:{color:e},viewBox:"0 0 24 24",children:[(0,l.jsx)("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"3"}),(0,l.jsx)("path",{d:"M6.5 9.5l3.25 2.5-3.25 2.5M12.75 15h4.75"})]})})}function c(r){let{action:e,primary:o=!1}=r,t=o?"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-semibold transition-colors hover:no-underline":"inline-flex items-center justify-center rounded-full border px-4 py-2 text-[12px] font-medium transition-colors hover:no-underline",n=o?{background:"var(--color-accent)",color:"var(--color-text-inverse)",borderColor:"color-mix(in srgb, var(--color-accent) 72%, transparent)"}:{background:"var(--color-bg-surface)",color:"var(--color-text-secondary)",borderColor:"var(--color-border-default)"};return e.href?(0,l.jsx)(a(),{href:e.href,className:t,style:n,children:e.label}):(0,l.jsx)("button",{type:"button",onClick:e.onClick,className:t,style:n,children:e.label})}function i(r){let{title:e,message:o,tone:t="error",detailsTitle:a="Technical details",error:i,primaryAction:d,secondaryAction:x,compact:b=!1,chrome:m="page",children:u}=r,v=n[t],p=!!((null==i?void 0:i.digest)||(null==i?void 0:i.message)||(null==i?void 0:i.stack));return(0,l.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-10 ".concat(b?"min-h-[calc(100vh-4rem)]":"min-h-screen"),style:{background:"page"===m?"radial-gradient(circle at top, var(--color-body-gradient-blue), transparent 35%), var(--color-bg-base)":"transparent"},children:(0,l.jsx)("div",{className:"w-full max-w-[36rem] rounded-[28px] border p-6 sm:p-8",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--color-bg-elevated) 88%, transparent) 0%, var(--color-bg-surface) 100%)",borderColor:"var(--color-border-default)",boxShadow:"var(--detail-card-shadow)"},children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[(0,l.jsx)(s,{accent:v.accent}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"mb-3 inline-flex items-center rounded-full border px-2.5 py-1 font-[var(--font-mono)] text-[10px] font-medium uppercase tracking-[0.22em]",style:{color:v.accent,background:v.bg,borderColor:v.border},children:v.label}),(0,l.jsx)("h1",{className:"text-[24px] font-semibold tracking-[-0.04em] text-[var(--color-text-primary)]",children:e}),(0,l.jsx)("p",{className:"mt-2 max-w-[34rem] text-[14px] leading-6 text-[var(--color-text-secondary)]",children:o})]})]}),(d||x)&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d?(0,l.jsx)(c,{action:d,primary:!0}):null,x?(0,l.jsx)(c,{action:x}):null]}),u,p?(0,l.jsxs)("details",{className:"rounded-2xl border",style:{background:"color-mix(in srgb, var(--color-bg-elevated) 84%, transparent)",borderColor:"var(--color-border-subtle)"},children:[(0,l.jsx)("summary",{className:"cursor-pointer list-none px-4 py-3 text-[12px] font-medium text-[var(--color-text-secondary)]",children:a}),(0,l.jsxs)("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--color-border-subtle)"},children:[(null==i?void 0:i.digest)?(0,l.jsxs)("p",{className:"mb-3 font-[var(--font-mono)] text-[11px] text-[var(--color-text-tertiary)]",children:["digest: ",i.digest]}):null,(null==i?void 0:i.message)?(0,l.jsx)("p",{className:"mb-3 text-[12px] leading-5 text-[var(--color-text-secondary)]",children:i.message}):null,(null==i?void 0:i.stack)?(0,l.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap font-[var(--font-mono)] text-[11px] leading-5 text-[var(--color-text-tertiary)]",children:i.stack}):null]})]}):null]})})})}}},r=>{r.O(0,[8713,131,1461,7358],()=>r(r.s=5272)),_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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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],{763:e=>{e.exports={style:{fontFamily:"'schibstedGrotesk', 'schibstedGrotesk Fallback', SF Pro Text, -apple-system, system-ui, sans-serif"},className:"__className_13a5cb",variable:"__variable_13a5cb"}},1012:(e,t,r)=>{"use strict";r.d(t,{Providers:()=>i});var n=r(3817),o=r(2286),s=r(5184);function i(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,i,a)=>{let c=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?(c.classList.remove(...n),c.classList.add(s&&s[t]?s[t]:t)):c.setAttribute(e,t)}),r=t,a&&l.includes(r)&&(c.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},s=["light","dark"],i="(prefers-color-scheme: dark)",a="undefined"==typeof window,c=n.createContext(void 0),l={setTheme:e=>{},themes:[]},u=()=>{var e;return null!=(e=n.useContext(c))?e:l},d=e=>n.useContext(c)?n.createElement(n.Fragment,null,e.children):n.createElement(f,{...e}),m=["light","dark"],f=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:o=!0,enableColorScheme:a=!0,storageKey:l="theme",themes:u=m,defaultTheme:d=o?"system":"light",attribute:f="data-theme",value:b,children:g,nonce:S,scriptProps:k}=e,[w,P]=n.useState(()=>p(l,d)),[x,E]=n.useState(()=>"system"===w?y():w),N=b?Object.values(b):u,T=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&o&&(t=y());let n=b?b[t]:t,i=r?v(S):null,c=document.documentElement,l=e=>{"class"===e?(c.classList.remove(...N),n&&c.classList.add(n)):e.startsWith("data-")&&(n?c.setAttribute(e,n):c.removeAttribute(e))};if(Array.isArray(f)?f.forEach(l):l(f),a){let e=s.includes(d)?d:null,r=s.includes(t)?t:e;c.style.colorScheme=r}null==i||i()},[S]),C=n.useCallback(e=>{let t="function"==typeof e?e(w):e;P(t);try{localStorage.setItem(l,t)}catch(e){}},[w]),_=n.useCallback(e=>{E(y(e)),"system"===w&&o&&!t&&T("system")},[w,t]);n.useEffect(()=>{let e=window.matchMedia(i);return e.addListener(_),_(e),()=>e.removeListener(_)},[_]),n.useEffect(()=>{let e=e=>{e.key===l&&(e.newValue?P(e.newValue):C(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[C]),n.useEffect(()=>{T(null!=t?t:w)},[t,w]);let M=n.useMemo(()=>({theme:w,setTheme:C,forcedTheme:t,resolvedTheme:"system"===w?x:w,themes:o?[...u,"system"]:u,systemTheme:o?x:void 0}),[w,C,t,x,o,u]);return n.createElement(c.Provider,{value:M},n.createElement(h,{forcedTheme:t,storageKey:l,attribute:f,enableSystem:o,enableColorScheme:a,defaultTheme:d,value:b,themes:u,nonce:S,scriptProps:k}),g)},h=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:s,enableSystem:i,enableColorScheme:a,defaultTheme:c,value:l,themes:u,nonce:d,scriptProps:m}=e,f=JSON.stringify([s,r,c,t,u,l,i,a]).slice(1,-1);return n.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?d:"",dangerouslySetInnerHTML:{__html:"(".concat(o.toString(),")(").concat(f,")")}})}),p=(e,t)=>{let r;if(!a){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},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)}},y=e=>(e||(e=window.matchMedia(i)),e.matches?"dark":"light")},2490:()=>{},3734:e=>{e.exports={style:{fontFamily:"'jetbrainsMono', 'jetbrainsMono Fallback', SF Mono, Menlo, Consolas, monospace"},className:"__className_c78a36",variable:"__variable_c78a36"}},5184:(e,t,r)=>{"use strict";r.d(t,{Ug:()=>c,eT:()=>l,i2:()=>d});var n=r(3817),o=r(6749),s=r(1806);let i=o.createContext(void 0);function a(e){return"".concat(e.id,":").concat(e.receivedAt)}function c(){let e=o.useContext(i);if(!e)throw Error("useMux() must be used within <MuxProvider>");return e}function l(){return o.useContext(i)}function u(e,t){return t?"".concat(t,":").concat(e):e}function d(e){let{children:t}=e,r=(0,o.useRef)(null),c=(0,o.useRef)(new Map),l=(0,o.useRef)(new Map),[d,m]=(0,o.useState)("connecting"),[f,h]=(0,o.useState)([]),[p,v]=(0,o.useState)([]),[y,b]=(0,o.useState)(50),[g,S]=(0,o.useState)(null),[k,w]=(0,o.useState)(null),P=(0,o.useRef)(0),x=(0,o.useRef)(null),E=(0,o.useRef)({}),N=(0,o.useRef)(!1),T=(0,o.useCallback)(()=>{if(!r.current){m("connecting");try{let e=function(e){var t,r,n;let o=window.location,i="https:"===o.protocol?"wss:":"ws:",a=null!=(t=e.proxyWsPath)?t:s.env.NEXT_PUBLIC_TERMINAL_WS_PATH;if(a){let e=a.replace(/\/ws\/?$/,"");return"".concat(i,"//").concat(o.host).concat(e,"/mux")}if(""===o.port||"443"===o.port||"80"===o.port)return"".concat(i,"//").concat(o.hostname,"/ao-terminal-mux");let c=null!=(n=null!=(r=e.directTerminalPort)?r:s.env.NEXT_PUBLIC_DIRECT_TERMINAL_PORT)?n:"14801";return"".concat(i,"//").concat(o.hostname,":").concat(c,"/mux")}(E.current);console.log("[MuxProvider] Connecting to",e);let t=new WebSocket(e);r.current=t,t.addEventListener("open",()=>{if(N.current)return void t.close();for(let e of(console.log("[MuxProvider] Connected"),m("connected"),P.current=0,l.current.values())){let r={ch:"terminal",id:e.id,type:"open",...e.projectId&&{projectId:e.projectId},...e.tmuxName&&{tmuxName:e.tmuxName}};t.send(JSON.stringify(r))}t.send(JSON.stringify({ch:"subscribe",topics:["sessions","notifications"]}))}),t.addEventListener("message",e=>{try{let t=JSON.parse(e.data);if("terminal"===t.ch){let e=u(t.id,"projectId"in t?t.projectId:void 0);if("data"===t.type){let r=c.current.get(e);if(r)for(let e of r)e(t.data)}else if("opened"===t.type)l.current.has(e)||l.current.set(e,{id:t.id,..."projectId"in t&&t.projectId?{projectId:t.projectId}:{}});else if("exited"===t.type){l.current.delete(e);let r=c.current.get(e);if(r){let e="\r\n\x1b[31m[Terminal exited with code ".concat(t.code,"]\x1b[0m\r\n");for(let t of r)t(e)}}else"error"===t.type&&console.error("[MuxProvider] Terminal error for ".concat(t.id,":"),t.message)}else"sessions"===t.ch?"snapshot"===t.type?(h(t.sessions),S(null)):"error"===t.type&&S(t.error):"notifications"===t.ch&&("snapshot"===t.type?(b(t.limit),v(t.notifications.slice(-t.limit)),w(null)):"append"===t.type?(b(t.limit),v(e=>(function(e,t,r){let n=new Map;for(let t of e)n.set(a(t),t);for(let e of t)n.set(a(e),e);return[...n.values()].slice(-r)})(e,t.notifications,t.limit)),w(null)):"error"===t.type&&w(t.error))}catch(e){console.error("[MuxProvider] Error processing message:",e)}}),t.addEventListener("error",e=>{console.error("[MuxProvider] WebSocket error:",e)}),t.addEventListener("close",()=>{if(console.log("[MuxProvider] Disconnected"),r.current===t&&(r.current=null),N.current)return;let e=Math.min(1e3*Math.pow(2,P.current),3e4);P.current+=1,m("reconnecting"),x.current=setTimeout(()=>{console.log("[MuxProvider] Reconnecting (attempt ".concat(P.current,")...")),T()},e)})}catch(e){console.error("[MuxProvider] Failed to create WebSocket:",e),m("disconnected")}}},[]);(0,o.useEffect)(()=>{N.current=!1;let e=!1;return(async()=>{try{let e=await fetch("/api/runtime/terminal");if(e.ok){let t=await e.json();E.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||T()})(),()=>{var t;e=!0,N.current=!0,x.current&&clearTimeout(x.current),null==(t=r.current)||t.close()}},[T]);let C=(0,o.useCallback)((e,t,n)=>{var o;let s=u(e,n),i=c.current.get(s);if(i||(i=new Set,c.current.set(s,i)),i.add(t),!l.current.has(s)&&(null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let t={ch:"terminal",id:e,type:"open",...n&&{projectId:n}};r.current.send(JSON.stringify(t))}return()=>{let e=c.current.get(s);e&&(e.delete(t),0===e.size&&c.current.delete(s))}},[]),_=(0,o.useCallback)((e,t,n)=>{var o;if((null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let o={ch:"terminal",id:e,type:"data",data:t,...n&&{projectId:n}};r.current.send(JSON.stringify(o))}},[]),M=(0,o.useCallback)((e,t,n)=>{var o;if(l.current.set(u(e,t),{id:e,projectId:t,tmuxName:n}),(null==(o=r.current)?void 0:o.readyState)===WebSocket.OPEN){let o={ch:"terminal",id:e,type:"open",...t&&{projectId:t},...n&&{tmuxName:n}};r.current.send(JSON.stringify(o))}},[]),I=(0,o.useCallback)((e,t)=>{var n;if(l.current.delete(u(e,t)),(null==(n=r.current)?void 0:n.readyState)===WebSocket.OPEN){let n={ch:"terminal",id:e,type:"close",...t&&{projectId:t}};r.current.send(JSON.stringify(n))}},[]),O=(0,o.useCallback)((e,t,n,o)=>{var s;if((null==(s=r.current)?void 0:s.readyState)===WebSocket.OPEN){let s={ch:"terminal",id:e,type:"resize",cols:t,rows:n,...o&&{projectId:o}};r.current.send(JSON.stringify(s))}},[]),W=(0,o.useMemo)(()=>({subscribeTerminal:C,writeTerminal:_,openTerminal:M,closeTerminal:I,resizeTerminal:O,status:d,sessions:f,notifications:p,notificationLimit:y,lastError:g,notificationError:k}),[C,_,M,I,O,d,f,p,y,g,k]);return(0,n.jsx)(i.Provider,{value:W,children:t})}},5904:()=>{},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}},7361:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,763,23)),Promise.resolve().then(r.t.bind(r,3734,23)),Promise.resolve().then(r.t.bind(r,2490,23)),Promise.resolve().then(r.t.bind(r,8536,23)),Promise.resolve().then(r.t.bind(r,7900,23)),Promise.resolve().then(r.t.bind(r,5904,23)),Promise.resolve().then(r.bind(r,1012)),Promise.resolve().then(r.bind(r,7285))},7900:()=>{},8536:()=>{}},e=>{e.O(0,[9988,3906,5799,131,1461,7358],()=>e(e.s=7361)),_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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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([[4345,7927],{7871:(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=7871)),_N_E=r.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{7875:(e,s,_)=>{Promise.resolve().then(_.bind(_,9531))}},e=>{e.O(0,[8713,8204,2073,4115,1089,9876,7008,9531,131,1461,7358],()=>e(e.s=7875)),_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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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,2437,2438,2564,2818,2922,2985,3511,3625,3675,4209,4587,4746,5214,6681,6849,6865,6946,6999,7462,7500,8581,9002,9217,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]})}},6558:(e,r,t)=>{Promise.resolve().then(t.t.bind(t,8713,23)),Promise.resolve().then(t.bind(t,9531)),Promise.resolve().then(t.bind(t,5275))}},e=>{e.O(0,[8713,8204,2073,4115,1089,9876,7008,9531,131,1461,7358],()=>e(e.s=6558)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3610],{6815:(e,t,r)=>{Promise.resolve().then(r.bind(r,9333))},7594:(e,t,r)=>{"use strict";var n=r(9582);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}})},9333:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>j});var n=r(3817),s=r(6749),o=r(7594),a=r(5425),c=r(3916),i=r(9789),l=r(545),u=r(9678),d=r(7387),f=r(4723),h=r(8450),m=r(3394);let p=null;function v(e){if(e instanceof DOMException)return"AbortError"===e.name;if(e instanceof Error){let t=e.message.toLowerCase();return t.includes("aborted")||t.includes("aborterror")}return!1}function g(){return(0,n.jsx)("div",{className:"flex h-full min-h-screen items-center justify-center bg-[var(--color-bg-base)]",children:(0,n.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,n.jsx)("svg",{className:"h-5 w-5 animate-spin text-[var(--color-text-tertiary)]",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9"})}),(0,n.jsx)("div",{className:"text-[13px] text-[var(--color-text-tertiary)]",children:"Loading session…"})]})})}function j(){var e;let t=(0,o.useParams)(),r=(0,o.usePathname)(),j=(0,o.useRouter)(),y=t.id,b="string"==typeof t.projectId?t.projectId:void 0,x=(()=>{if("undefined"==typeof sessionStorage)return null;try{let e=sessionStorage.getItem("ao-session-nav:".concat(y));if(e)return sessionStorage.removeItem("ao-session-nav:".concat(y)),JSON.parse(e)}catch(e){}return null})(),[w,E]=(0,s.useState)(x),[k,I]=(0,s.useState)(null),[R,S]=(0,s.useState)(void 0),[P,C]=(0,s.useState)([]),[N,T]=(0,s.useState)(null===x),[M,A]=(0,s.useState)(null),[O,L]=(0,s.useState)(!1),[F,_]=(0,s.useState)(new Map),q=null!=(e=null==w?void 0:w.projectId)?e:null,D=[...F.values()],B=!!w&&(0,a.tT)(w,F.get(w.projectId),D),J=(0,s.useRef)(null),U=(0,s.useRef)(!1),W=(0,s.useRef)(null),G=(0,s.useRef)(new Map),Y=(0,s.useRef)(null!==x),Z=(0,s.useRef)(!1),z=(0,s.useRef)(!1),H=(0,s.useRef)(null),K=(0,s.useRef)(null),Q=(0,s.useRef)(!1),V=(0,s.useRef)(!0),X=(0,f.f)(y);(0,s.useEffect)(()=>{G.current=F},[F]),(0,s.useEffect)(()=>{w?document.title=function(e,t,r){var n;let s=e.id,o=void 0!==r?r:e.activity,c=o&&null!=(n=u.R[o])?n:"",i=[...t.values()],l=(0,a.tT)(e,t.get(e.projectId),i)?"Orchestrator Terminal":function(e,t){let r=Array.from(e);return r.length>40?r.slice(0,40).join("")+"...":e}((0,d.Pn)(e),40);return c?"".concat(c," ").concat(s," | ").concat(l):"".concat(s," | ").concat(l)}(w,F,null==X?void 0:X.activity):document.title="".concat(y," | Session Detail")},[w,y,F,X]),(0,s.useEffect)(()=>{J.current=q},[q]),(0,s.useEffect)(()=>{U.current=B},[B]),(0,s.useEffect)(()=>{w&&P.some(e=>e.id===w.projectId)&&(null==r?void 0:r.startsWith("/projects/"))&&b&&w.projectId!==b&&j.replace((0,h.Nc)(w.projectId,w.id))},[b,r,P,j,w]),(0,s.useEffect)(()=>{B||I(null)},[B]);let $=(0,s.useCallback)(async()=>{p&&(C(p),_(new Map(p.map(e=>{var t;return[e.id,null!=(t=e.sessionPrefix)?t:e.id]}))));try{var e,t;let r=await (0,m.uE)("/api/projects",{timeoutMs:5e3,timeoutMessage:"Projects request timed out after ".concat(5e3,"ms")});if(!(null==r?void 0:r.projects))return;e=p,t=r.projects,e&&e.length===t.length&&e.every((e,r)=>JSON.stringify(e)===JSON.stringify(t[r]))||(p=r.projects,C(r.projects),_(new Map(r.projects.map(e=>{var t;return[e.id,null!=(t=e.sessionPrefix)?t:e.id]}))))}catch(e){console.error("Failed to fetch projects:",e)}},[]),ee=(0,s.useCallback)(async()=>{if(Z.current)return;Z.current=!0;let e=new AbortController;H.current=e;try{let t=await (0,m.uE)("/api/sessions/".concat(encodeURIComponent(y)),{signal:e.signal,timeoutMs:8e3,timeoutMessage:"Session request timed out after ".concat(8e3,"ms")});E(t),A(null),L(!1),Y.current=!0}catch(r){if(Q.current||e.signal.aborted||v(r))return;let t=(r instanceof Error?r.message:"Failed to load session").toLowerCase();if(t.includes("session not found")||t.includes("http 404")){Y.current||L(!0),T(!1);return}console.error("Failed to fetch session:",r),Y.current||A(r instanceof Error?r:Error("Failed to load session"))}finally{Z.current=!1,H.current===e&&(H.current=null),!e.signal.aborted||Y.current?T(!1):V.current&&ee()}},[y]),et=(0,s.useCallback)(async()=>{if(z.current)return;let e=J.current;if(!e)return;let t=U.current,r="".concat(e,":").concat(t?"orchestrator":"worker");if(!t&&W.current===r)return;z.current=!0;let n=new AbortController;K.current=n;try{var s,o,c,i,u;let d=t?"/api/sessions?project=".concat(encodeURIComponent(e),"&fresh=true"):"/api/sessions?project=".concat(encodeURIComponent(e),"&orchestratorOnly=true&fresh=true"),f=await (0,m.uE)(d,{signal:n.signal,timeoutMs:5e3,timeoutMessage:"Project sessions request timed out after ".concat(5e3,"ms")}),h=null!=(c=f.sessions)?c:[],p=null!=(u=null!=(i=f.orchestratorId)?i:null==(o=f.orchestrators)||null==(s=o.find(t=>t.projectId===e))?void 0:s.id)?u:null;if(S(e=>e===p?e:p),!t){W.current=r;return}let v={merge:0,respond:0,review:0,pending:0,working:0,done:0},g=[...G.current.values()];for(let e of h)if(!(0,a.tT)(e,G.current.get(e.projectId),g)){let t=(0,l.ng)(e);if("action"===t)continue;v[t]++}I(v)}catch(e){if(Q.current||n.signal.aborted||v(e))return;console.error("Failed to fetch project sessions:",e)}finally{z.current=!1,K.current===n&&(K.current=null)}},[]);return((0,s.useEffect)(()=>{Promise.all([$(),ee()])},[$,ee]),(0,s.useEffect)(()=>{q&&et()},[et,B,q]),(0,s.useEffect)(()=>{let e=setInterval(()=>{ee(),et()},2e3);return()=>clearInterval(e)},[ee,et]),(0,s.useEffect)(()=>{Q.current=!1;let e=()=>{Q.current=!0};return window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("beforeunload",e)}},[]),(0,s.useEffect)(()=>(V.current=!0,()=>{V.current=!1}),[]),(0,s.useEffect)(()=>()=>{var e,t;null==(e=H.current)||e.abort(),null==(t=K.current)||t.abort()},[]),N)?(0,n.jsx)("div",{className:"dashboard-main--desktop",children:(0,n.jsx)(g,{})}):O?(0,n.jsx)("div",{className:"dashboard-main--desktop",children:(0,n.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,n.jsx)(i.ErrorDisplay,{title:"Session not found",message:"This session is no longer available. It may have been removed, renamed, or already cleaned up.",tone:"not-found",primaryAction:{label:"Back to dashboard",href:b?"/projects/".concat(b):"/"},secondaryAction:{label:"Retry",onClick:()=>void ee()},compact:!0,chrome:"card"})})}):M?(0,n.jsx)("div",{className:"dashboard-main--desktop",children:(0,n.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,n.jsx)(i.ErrorDisplay,{title:"Failed to load session",message:function(e){let t=e.message.toLowerCase();return t.includes("timed out")?"The session request is taking too long. You can retry, or return to the project and reopen a different session.":t.includes("network")?"The session request failed before the dashboard got a response. Check the local server connection and try again.":t.includes("404")?"This session is no longer available. It may have been removed while the page was open.":t.includes("500")?"The server returned an internal error while loading this session. Try again to re-fetch the latest state.":"The dashboard could not load this session cleanly. Try again to re-fetch the latest state."}(M),tone:"error",primaryAction:{label:"Try again",onClick:()=>{A(null),L(!1),T(!0),Promise.all([$(),ee()])}},secondaryAction:{label:"Back to dashboard",href:(null==w?void 0:w.projectId)?"/projects/".concat(w.projectId):"/"},error:M,compact:!0,chrome:"card"})})}):w?(0,n.jsx)(c.G,{session:w,isOrchestrator:B,orchestratorZones:null!=k?k:void 0,projectOrchestratorId:R,projects:P}):(0,n.jsx)("div",{className:"dashboard-main--desktop",children:(0,n.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,n.jsx)(i.ErrorDisplay,{title:"Session unavailable",message:"The backend has not returned this session yet. This can happen right after spawning an orchestrator; retry once the terminal registers the session.",tone:"error",primaryAction:{label:"Retry",onClick:()=>void ee()},secondaryAction:{label:"Back to dashboard",href:b?"/projects/".concat(b):"/"},compact:!0,chrome:"card"})})})}}},e=>{e.O(0,[8713,2073,1089,9876,8759,131,1461,7358],()=>e(e.s=6815)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3916],{1280:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,8713,23)),Promise.resolve().then(s.bind(s,2749)),Promise.resolve().then(s.bind(s,5275))},2446:(e,t,s)=>{"use strict";s.d(t,{d:()=>c,t:()=>l});var r=s(3817),n=s(6749),a=s(4901);function i(e,t){return"SHOW"===t.type?{message:t.message,variant:t.variant,key:t.key}:null}let o=(0,n.createContext)(null);function l(e){let{children:t}=e,[s,l]=(0,n.useReducer)(i,null),c=(0,n.useRef)(null),u=(0,n.useRef)(0);(0,n.useEffect)(()=>()=>{null!==c.current&&clearTimeout(c.current)},[]);let d=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";null!==c.current&&clearTimeout(c.current),u.current+=1,l({type:"SHOW",message:e,variant:t,key:u.current}),c.current=setTimeout(()=>{l({type:"HIDE"}),c.current=null},3e3)},[]);return(0,r.jsxs)(o.Provider,{value:{showToast:d},children:[t,(0,r.jsx)("div",{className:"toast-container",role:"status","aria-live":"polite","aria-atomic":"true",children:s&&(0,r.jsxs)("div",{className:(0,a.cn)("toast","success"===s.variant&&"toast--success","error"===s.variant&&"toast--error","info"===s.variant&&"toast--info"),children:[(0,r.jsx)("span",{className:"toast__icon","aria-hidden":"true"}),(0,r.jsx)("span",{className:"toast__message",children:s.message})]},s.key)})]})}function c(){let e=(0,n.useContext)(o);if(!e)throw Error("useToast must be used within a ToastProvider");return e}},2749:(e,t,s)=>{"use strict";s.d(t,{ProjectSettingsForm:()=>d});var r=s(3817),n=s(6749),a=s(7594),i=s(2446);let o="These describe which repo this is. Change them via `athene project relink`.";function l(e){let{projectId:t,initialValues:s}=e,o=(0,a.useRouter)(),{showToast:l}=(0,i.d)(),[d,m]=(0,n.useState)(s.agent),[h,p]=(0,n.useState)(s.runtime),[j,g]=(0,n.useState)(s.trackerPlugin),[f,_]=(0,n.useState)(s.scmPlugin),[v,x]=(0,n.useState)(s.reactions),[b,y]=(0,n.useState)(!1),[N,k]=(0,n.useState)(null),[P,S]=(0,n.useState)(null),C=(0,n.useMemo)(()=>({agent:d.trim()||null,runtime:h.trim()||null,tracker:j.trim()?{plugin:j.trim()}:null,scm:f.trim()?{plugin:f.trim()}:null,reactions:v}),[d,h,j,f,v]),w=async()=>{let e;k(null),S(null);try{let t=v.trim();e=t?JSON.parse(t):void 0}catch(e){k("Reactions must be valid JSON.");return}y(!0);try{let r=await fetch("/api/projects/".concat(encodeURIComponent(t)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({agent:C.agent,runtime:C.runtime,tracker:C.tracker,scm:C.scm,reactions:null!=e?e:null})}),n=await r.json().catch(()=>null);if(!r.ok){var s;let e=null!=(s=null==n?void 0:n.error)?s:"Failed to save project settings.";400===r.status?k(e):S(e);return}l("Project settings updated.","success"),o.refresh()}catch(e){S("Network error while saving project settings.")}finally{y(!1)}};return(0,r.jsxs)("div",{className:"project-settings-form",children:[(0,r.jsxs)("section",{className:"project-settings-form__section",children:[(0,r.jsxs)("div",{className:"project-settings-form__section-header",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"project-settings-form__eyebrow",children:"Behavior"}),(0,r.jsx)("h2",{className:"project-settings-form__section-title",children:"Runtime configuration"}),(0,r.jsx)("p",{className:"project-settings-form__section-copy",children:"These values change how AO runs this project without changing which repository the project points at."})]}),(0,r.jsx)("button",{type:"button",onClick:()=>void w(),disabled:b,className:"project-settings-form__save",children:b?"Saving...":"Save changes"})]}),(0,r.jsxs)("div",{className:"project-settings-form__grid",children:[(0,r.jsx)(c,{id:"agent",label:"Agent",value:d,onChange:m,placeholder:"claude-code"}),(0,r.jsx)(c,{id:"runtime",label:"Runtime",value:h,onChange:p,placeholder:"tmux"}),(0,r.jsx)(c,{id:"tracker-plugin",label:"Tracker plugin",value:j,onChange:g,placeholder:"github"}),(0,r.jsx)(c,{id:"scm-plugin",label:"SCM plugin",value:f,onChange:_,placeholder:"github"})]}),(0,r.jsxs)("div",{className:"project-settings-form__reactions",children:[(0,r.jsx)("label",{htmlFor:"reactions",className:"project-settings-form__label",children:"Reactions"}),(0,r.jsx)("p",{className:"project-settings-form__hint",children:"JSON object keyed by reaction name. This PATCH only sends behavior fields."}),(0,r.jsx)("textarea",{id:"reactions",value:v,onChange:e=>x(e.target.value),spellCheck:!1,rows:12,className:"project-settings-form__textarea project-settings-form__textarea--mono"})]}),N?(0,r.jsx)("div",{role:"alert",className:"project-settings-form__alert project-settings-form__alert--error",children:N}):null,P?(0,r.jsxs)("div",{className:"project-settings-form__alert project-settings-form__alert--surface",children:[(0,r.jsx)("p",{className:"project-settings-form__alert-copy",children:P}),(0,r.jsx)("button",{type:"button",onClick:()=>void w(),className:"project-settings-form__retry",children:"Retry"})]}):null]}),(0,r.jsxs)("section",{className:"project-settings-form__section",children:[(0,r.jsx)("p",{className:"project-settings-form__eyebrow",children:"Identity"}),(0,r.jsx)("h2",{className:"project-settings-form__section-title",children:"Repository identity"}),(0,r.jsx)("p",{className:"project-settings-form__section-copy",children:"These fields are read-only because they define which repository AO considers this project to be."}),(0,r.jsxs)("div",{className:"project-settings-form__grid",children:[(0,r.jsx)(u,{id:"identity-project-id",label:"Project ID",value:s.identity.projectId}),(0,r.jsx)(u,{id:"identity-path",label:"Path",value:s.identity.path}),(0,r.jsx)(u,{id:"identity-repo",label:"Repo",value:s.identity.repo}),(0,r.jsx)(u,{id:"identity-default-branch",label:"Default branch",value:s.identity.defaultBranch})]})]})]})}function c(e){let{id:t,label:s,value:n,onChange:a,placeholder:i}=e;return(0,r.jsxs)("label",{htmlFor:t,className:"project-settings-form__field",children:[(0,r.jsx)("span",{className:"project-settings-form__label",children:s}),(0,r.jsx)("input",{id:t,value:n,onChange:e=>a(e.target.value),placeholder:i,className:"project-settings-form__input"})]})}function u(e){let{id:t,label:s,value:n}=e;return(0,r.jsxs)("label",{htmlFor:t,className:"project-settings-form__field",children:[(0,r.jsx)("span",{className:"project-settings-form__label",children:s}),(0,r.jsx)("input",{id:t,value:n,disabled:!0,readOnly:!0,title:o,"aria-describedby":"".concat(t,"-tooltip"),className:"project-settings-form__input project-settings-form__input--readonly"}),(0,r.jsx)("span",{id:"".concat(t,"-tooltip"),className:"project-settings-form__hint",children:o})]})}function d(e){return(0,r.jsx)(i.t,{children:(0,r.jsx)(l,{...e})})}},4901:(e,t,s)=>{"use strict";function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter(Boolean).join(" ")}s.d(t,{cn:()=>r})},5275:(e,t,s)=>{"use strict";s.d(t,{RepairDegradedProjectButton:()=>i});var r=s(3817),n=s(6749),a=s(7594);function i(e){let{projectId:t}=e,s=(0,a.useRouter)(),[i,o]=(0,n.useState)(!1),[l,c]=(0,n.useState)(null),u=async()=>{o(!0),c(null);try{let r=await fetch("/api/projects/".concat(encodeURIComponent(t)),{method:"POST"}),n=await r.json().catch(()=>null);if(!r.ok){var e;c(null!=(e=null==n?void 0:n.error)?e:"Failed to repair project config.");return}s.refresh()}catch(e){c("Network error while repairing project config.")}finally{o(!1)}};return(0,r.jsxs)("div",{className:"mt-6",children:[(0,r.jsx)("button",{type:"button",onClick:()=>void u(),disabled:i,className:"rounded-lg border border-[var(--color-accent)] bg-[var(--color-tint-blue)] px-4 py-2 text-sm font-semibold text-[var(--color-accent)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-accent)_14%,transparent)] disabled:cursor-not-allowed disabled:opacity-60",children:i?"Repairing...":"Repair config"}),l?(0,r.jsx)("p",{className:"mt-3 text-sm text-[var(--color-status-error)]",children:l}):null]})}},7594:(e,t,s)=>{"use strict";var r=s(9582);s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})}},e=>{e.O(0,[8713,131,1461,7358],()=>e(e.s=1280)),_N_E=e.O()}]);
|