@ai-development-environment/server 0.0.27 → 0.0.29
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/package.json +1 -1
- package/prisma-runtime/prisma/migrations/20260718220000_add_build_freshness/migration.sql +1 -0
- package/prisma-runtime/prisma/schema.prisma +1 -0
- package/standalone/.next/BUILD_ID +1 -1
- package/standalone/.next/build-manifest.json +3 -3
- package/standalone/.next/prerender-manifest.json +3 -3
- package/standalone/.next/server/app/[locale]/actions/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/actions/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/agents/[id]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/agents/[id]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/agents/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/agents/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/build-data/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/build-data/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/builds/[buildId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/builds/[buildId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/builds/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/builds/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/codebases/[codebaseId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/codebases/[codebaseId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/codebases/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/codebases/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/codebases/repositories/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/comments/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/comments/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/jira/cache/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/jira/cache/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/jira/tickets/[issueKey]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/jira/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/jira/tickets/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/jira/tickets/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/jobs/[jobId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/pull-requests/[owner]/[repository]/[number]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/pull-requests/[owner]/[repository]/[number]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/pull-requests/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/pull-requests/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/settings/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/skills/[skillId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/skills/groups/[groupId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/skills/groups/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/skills/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/skills/sync/[runId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/tools/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/usage/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/usage/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/worktrees/[worktreeId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/worktrees/[worktreeId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/worktrees/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/worktrees/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/_global-error.html +1 -1
- package/standalone/.next/server/app/_global-error.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.html +1 -1
- package/standalone/.next/server/app/_not-found.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/api/build-artifact-uploads/[uploadId]/route.js +2 -2
- package/standalone/.next/server/app/api/build-artifact-uploads/[uploadId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/builds/[buildId]/artifacts/[artifactId]/route.js +2 -2
- package/standalone/.next/server/app/api/builds/[buildId]/artifacts/[artifactId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/codebases/by-path/route.js +2 -2
- package/standalone/.next/server/app/api/codebases/by-path/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/codebases/route.js +2 -2
- package/standalone/.next/server/app/api/codebases/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/graphql/route.js +2 -2
- package/standalone/.next/server/app/api/graphql/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/mcp/route.js +2 -2
- package/standalone/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/tools/call/route.js +2 -2
- package/standalone/.next/server/app/api/tools/call/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/tools/catalog/route.js +2 -2
- package/standalone/.next/server/app/api/tools/catalog/route.js.nft.json +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1iv83x0._.js → [root-of-the-server]__0-ypkf7._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__08w_8a-._.js → [root-of-the-server]__00ku6-v._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0yfvw4a._.js → [root-of-the-server]__0138gz-._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0r5s0h6._.js → [root-of-the-server]__02vqwey._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__098f8w4._.js → [root-of-the-server]__056cnsc._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1l6ed2g._.js → [root-of-the-server]__08mfybr._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__0cs2bfc._.js → [root-of-the-server]__08u874i._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__01h2pl1._.js → [root-of-the-server]__09skp6r._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__14-aq4c._.js → [root-of-the-server]__0cyubup._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0_l5rqe._.js → [root-of-the-server]__0da1wsf._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1mgcft0._.js → [root-of-the-server]__0e1fqyr._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1frrx8s._.js → [root-of-the-server]__0f3ptor._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__0k01mi-._.js → [root-of-the-server]__0fih0li._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__02qjyhj._.js → [root-of-the-server]__0g0tnct._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1ehdq4c._.js → [root-of-the-server]__0gbor-2._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__09lyzw2._.js → [root-of-the-server]__0mj6qcr._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__14uwobw._.js → [root-of-the-server]__0p_h088._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0i4bd9d._.js → [root-of-the-server]__0vvjqp5._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__04rx7b9._.js → [root-of-the-server]__0w20bq-._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__0hmrx3m._.js → [root-of-the-server]__0wf0pka._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0nxj1ky._.js → [root-of-the-server]__0wg2umj._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__17bgip6._.js → [root-of-the-server]__0xa_els._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0wx4-1l._.js → [root-of-the-server]__0xukz2x._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__1-z6lg_._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__020ggc3._.js → [root-of-the-server]__15aat79._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__00_-x1w._.js → [root-of-the-server]__15bbm2q._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__09c7zmy._.js → [root-of-the-server]__16l4wed._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__04hrhu3._.js → [root-of-the-server]__19zwwdv._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0d4_f1e._.js → [root-of-the-server]__1a5_am-._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0kxltc8._.js → [root-of-the-server]__1ajaiy1._.js} +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__1dtlzq1._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1kpqohm._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1l7234r._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0qjhcow._.js → [root-of-the-server]__1oahp4o._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__1vip3sa._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0cryh-d._.js → [root-of-the-server]__1wtng3p._.js} +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__1wu654b._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1x2nph5._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1xk-0be._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0h0mvv8._.js → [root-of-the-server]__210dhdj._.js} +1 -1
- package/standalone/.next/server/chunks/_0exkna-._.js +29 -8
- package/standalone/.next/server/chunks/{_0bru086._.js → _0jurkow._.js} +26 -26
- package/standalone/.next/server/chunks/{_00mzn-u._.js → _0rx5rfm._.js} +27 -27
- package/standalone/.next/server/chunks/_0tufgj0._.js +68 -47
- package/standalone/.next/server/chunks/_0w2eghf._.js +29 -8
- package/standalone/.next/server/chunks/_152rnkf._.js +3 -3
- package/standalone/.next/server/chunks/{_1_g2i-t._.js → _16x77b_._.js} +27 -27
- package/standalone/.next/server/chunks/_1dbqy8c._.js +3 -3
- package/standalone/.next/server/chunks/_1vrixpc._.js +3 -3
- package/standalone/.next/server/chunks/_1yfz-9u._.js +3 -3
- package/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1osx7qy._.js → [root-of-the-server]__0361lgt._.js} +8 -2
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ay4_3d._.js +37 -0
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dm8osz._.js +3 -0
- package/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0oj1os4._.js → [root-of-the-server]__1xv798-._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__1z955gh._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_00ye62k._.js +35 -0
- package/standalone/.next/server/chunks/ssr/_07tglcd._.js +35 -0
- package/standalone/.next/server/chunks/ssr/_0bvpmhm._.js +29 -25
- package/standalone/.next/server/chunks/ssr/{_0hoc_fd._.js → _0ddgabq._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/{_1x13g5y._.js → _0eb36qa._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/{_1dnm1d4._.js → _0mr9u9p._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/_0nm6upn._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_0quhjav._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_0w05v7m._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_0xozjkz._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_0xrpdyy._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_1-2qcpf._.js +3 -0
- package/standalone/.next/server/chunks/ssr/{_1vhf014._.js → _1-grolz._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/_12ws_f2._.js +11 -0
- package/standalone/.next/server/chunks/ssr/_17p59oz._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_19fwji0._.js +11 -0
- package/standalone/.next/server/chunks/ssr/_1_1j9nd._.js +13 -0
- package/standalone/.next/server/chunks/ssr/_1g3i459._.js +15 -0
- package/standalone/.next/server/chunks/ssr/{_1oh35yj._.js → _1g_aflc._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/{_1dsdn7w._.js → _1lcwubl._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/{_0sp1ojg._.js → _1r2rmfp._.js} +8 -2
- package/standalone/.next/server/chunks/ssr/_1za3z6k._.js +28 -24
- package/standalone/.next/server/chunks/ssr/{_13jl9nw._.js → _1zyjq9y._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/_20ufqtr._.js +3 -0
- package/standalone/.next/server/chunks/ssr/messages_de_json_[json]_cjs_1uig1ud._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_en_json_[json]_cjs_206072-._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_es_json_[json]_cjs_082yukd._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_fr_json_[json]_cjs_0j6-w0i._.js +1 -1
- package/standalone/.next/server/chunks/ssr/src_components_agents_agent-detail_tsx_0lfa4ui._.js +2 -2
- package/standalone/.next/server/chunks/ssr/src_components_builds_build-detail-page_tsx_0q1lvps._.js +9 -13
- package/standalone/.next/server/chunks/ssr/src_components_builds_builds-page_tsx_17qzmsl._.js +8 -12
- package/standalone/.next/server/chunks/ssr/src_components_github_actions-page_tsx_18434xt._.js +5 -5
- package/standalone/.next/server/chunks/ssr/src_components_github_pull-requests-page_tsx_1il3ga-._.js +12 -12
- package/standalone/.next/server/chunks/ssr/src_components_tools_tools-page_tsx_0k1jqcz._.js +2 -2
- package/standalone/.next/server/chunks/ssr/src_components_worktrees_worktree-detail-page_tsx_1oexgu_._.js +13 -4
- package/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/standalone/.next/server/pages/404.html +1 -1
- package/standalone/.next/server/pages/500.html +1 -1
- package/standalone/.next/server/server-reference-manifest.js +1 -1
- package/standalone/.next/server/server-reference-manifest.json +1 -1
- package/standalone/.next/static/chunks/{0sp_r-c6262te.js → 0newuocvg03xy.js} +1 -1
- package/standalone/.next/static/chunks/{3oyhf7rk2xr_g.js → 0rlomhlt6030e.js} +1 -1
- package/standalone/.next/static/chunks/16tfdsma_h0r5.js +33 -0
- package/standalone/.next/static/chunks/{1xjd6ye7mxyf5.js → 1802j8gq2g47d.js} +2 -2
- package/standalone/.next/static/chunks/1_tnhhn4f122y.js +9 -0
- package/standalone/.next/static/chunks/1eny65xy2ho48.js +1 -0
- package/standalone/.next/static/chunks/1l4bkigul15i3.js +25 -0
- package/standalone/.next/static/chunks/{3td_-1s61zkpa.js → 1nnp0crt0mi_-.js} +1 -1
- package/standalone/.next/static/chunks/1qd6cse_d9ae1.js +99 -0
- package/standalone/.next/static/chunks/{2dwchs_6y_o5f.js → 2-mxmazwsh-wz.js} +1 -1
- package/standalone/.next/static/chunks/2fzwgr2iq_783.css +1 -0
- package/standalone/.next/static/chunks/{278dxvyf095b_.js → 2jbygfc0lzu0t.js} +7 -7
- package/standalone/.next/static/chunks/2n7u72nxziv_5.js +7 -0
- package/standalone/.next/static/chunks/{1rivge68m21sm.js → 2rjf8o4g23no8.js} +10 -10
- package/standalone/.next/static/chunks/{42flok13o-l0b.js → 2x8qovg070057.js} +1 -1
- package/standalone/.next/static/chunks/{091l-ij_cv0b6.js → 3-u7pvogc5_bx.js} +12 -12
- package/standalone/.next/static/chunks/3-zh9b0tcttiw.js +33 -0
- package/standalone/.next/static/chunks/31wyih3wwkeid.js +1 -0
- package/standalone/.next/static/chunks/{1nqkxeuycfmrt.js → 36_1bjzx79v18.js} +5 -5
- package/standalone/.next/static/chunks/3ajj69p_sj615.js +1 -0
- package/standalone/.next/static/chunks/3jd8_7lna-j_x.js +40 -0
- package/standalone/.next/static/chunks/3jv2gnnn4vx-j.js +43 -0
- package/standalone/.next/static/chunks/3k0oakdayt9yt.js +40 -0
- package/standalone/.next/static/chunks/3pgngh8lg3be3.js +99 -0
- package/standalone/.next/static/chunks/{0w8rd_g6hnvmz.js → 4013cp3x6bvuw.js} +1 -1
- package/standalone/src/services/builds/build-freshness.test.ts +107 -0
- package/standalone/src/services/builds/build-freshness.ts +73 -0
- package/standalone/src/services/builds/builds.service.test.ts +167 -8
- package/standalone/src/services/builds/builds.service.ts +115 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1878s0b._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__18zrtty._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1_xz_m2._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1mx1hqe._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1sjjkyp._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1vk9266._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1yn6pds._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1zwpjfo._.js +0 -3
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__03m5q8h._.js +0 -27
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__06bk7ik._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_09l5w5d._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_0_726fj._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_0a1zku5._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_0pu14lm._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_1eol9we._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_1h3t5g1._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_1kemhyd._.js +0 -39
- package/standalone/.next/server/chunks/ssr/_1kmkrz5._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_1r9ohdr._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_1yzb5-u._.js +0 -11
- package/standalone/.next/server/chunks/ssr/src_components_0wvh73y._.js +0 -11
- package/standalone/.next/server/chunks/ssr/src_components_github_167_ydi._.js +0 -35
- package/standalone/.next/static/chunks/00dx8gu-2oyqe.js +0 -45
- package/standalone/.next/static/chunks/0j5n6p9i-vyzo.js +0 -9
- package/standalone/.next/static/chunks/0weklluydd2mf.js +0 -23
- package/standalone/.next/static/chunks/1eehbcjby4go8.js +0 -95
- package/standalone/.next/static/chunks/23_75iur2dq8p.js +0 -1
- package/standalone/.next/static/chunks/2lgsgstcvc7uk.css +0 -1
- package/standalone/.next/static/chunks/32agjzrkphjrl.js +0 -9
- package/standalone/.next/static/chunks/399uxexoo8x7f.js +0 -33
- package/standalone/.next/static/chunks/39ecics7n8z5m.js +0 -1
- package/standalone/.next/static/chunks/3_kaby2qep1pd.js +0 -34
- package/standalone/.next/static/chunks/3q7vh58-5dkv2.js +0 -25
- package/standalone/.next/static/chunks/3xkoiasuwi3ms.js +0 -95
- package/standalone/.next/static/chunks/41s57pssydrel.js +0 -43
- /package/standalone/.next/static/{AxIbPSeZUHq852SCBMR8d → 8uBWJ8MOV-OEPe88M3PhU}/_buildManifest.js +0 -0
- /package/standalone/.next/static/{AxIbPSeZUHq852SCBMR8d → 8uBWJ8MOV-OEPe88M3PhU}/_clientMiddlewareManifest.js +0 -0
- /package/standalone/.next/static/{AxIbPSeZUHq852SCBMR8d → 8uBWJ8MOV-OEPe88M3PhU}/_ssgManifest.js +0 -0
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,942230,455329,756283,e=>{"use strict";var t=e.i(843476),a=e.i(861745),r=e.i(948148),s=e.i(487486),n=e.i(784774),i=e.i(975157);function l({label:e,additions:a,deletions:r}){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 whitespace-nowrap text-muted-foreground",children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)(o,{additions:a,deletions:r})]})}function o({additions:e,deletions:a}){return null===e&&null===a?(0,t.jsx)("span",{className:"text-muted-foreground",children:"—"}):(0,t.jsxs)("span",{className:"inline-flex gap-1 tabular-nums",children:[(0,t.jsxs)("span",{className:"text-emerald-700 dark:text-emerald-400",children:["+",e??0]}),(0,t.jsxs)("span",{className:"text-red-700 dark:text-red-400",children:["−",a??0]})]})}e.s(["WorktreeDetailPanel",0,function({detail:e,inline:d=!1}){let c=(0,r.useTranslations)("worktrees"),u=(0,a.useLocale)();return(0,t.jsxs)("div",{className:(0,i.cn)("w-full space-y-4",d&&"border-t pt-4"),"data-testid":"worktree-detail","data-worktree-navigation-ignore":d?"true":void 0,children:[(0,t.jsxs)("section",{className:"w-full",children:[(0,t.jsx)("h2",{className:"mb-2 font-medium",children:c("changes",{count:e.changes.length})}),(0,t.jsx)("div",{className:(0,i.cn)("overflow-auto rounded-md border",d&&"max-h-80"),children:e.changes.length?(0,t.jsx)(n.Table,{"aria-label":c("changes",{count:e.changes.length}),className:"min-w-[36rem] table-fixed text-xs",children:(0,t.jsx)(n.TableBody,{children:e.changes.map(e=>(0,t.jsxs)(n.TableRow,{children:[(0,t.jsx)(n.TableCell,{className:"max-w-0 px-2 py-1.5 font-mono",children:(0,t.jsx)("span",{className:"block truncate",title:e.path,children:e.path})}),(0,t.jsx)(n.TableCell,{className:"w-px px-2 py-1.5",children:(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[e.conflicted&&(0,t.jsx)(s.Badge,{className:"px-1.5",variant:"destructive",children:c("conflicted")}),e.staged&&(0,t.jsx)(l,{additions:e.stagedAdditions,deletions:e.stagedDeletions,label:c("staged")}),e.unstaged&&(0,t.jsx)(l,{additions:e.unstagedAdditions,deletions:e.unstagedDeletions,label:c("unstaged")}),e.untracked&&(0,t.jsx)(l,{additions:e.unstagedAdditions,deletions:e.unstagedDeletions,label:c("untracked")})]})})]},e.path))})}):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:c("noChanges")})})]}),(0,t.jsxs)("section",{className:"w-full",children:[(0,t.jsx)("h2",{className:"mb-2 font-medium",children:c("commits",{count:e.commits.length})}),(0,t.jsx)("div",{className:(0,i.cn)("overflow-auto rounded-md border",d&&"max-h-80"),children:e.commits.length?(0,t.jsx)(n.Table,{"aria-label":c("commits",{count:e.commits.length}),className:"min-w-[36rem] table-fixed text-xs",children:(0,t.jsx)(n.TableBody,{children:e.commits.map(e=>(0,t.jsxs)(n.TableRow,{children:[(0,t.jsx)(n.TableCell,{className:"w-24 px-2 py-1.5 font-mono text-muted-foreground",children:e.sha.slice(0,8)}),(0,t.jsx)(n.TableCell,{className:"max-w-0 px-2 py-1.5",children:(0,t.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e.subject}),(0,t.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[e.authorName," ·"," ",new Date(e.authoredAt).toLocaleString(u)]})]})}),(0,t.jsx)(n.TableCell,{className:"w-24 px-2 py-1.5 text-right",children:(0,t.jsx)(o,{additions:e.additions,deletions:e.deletions})})]},e.sha))})}):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:c("noCommits")})})]}),(e.commitsTruncated||e.changesTruncated)&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c("truncated")})]})}],942230);let d=`
|
|
2
|
-
id codebaseId gitDirectory folder relativePath primary branch headSha upstream ahead behind syncState
|
|
3
|
-
baseBranch baseBranchOverride baseAhead baseBehind hasStagedChanges hasUnstagedChanges highlightColor availability statusError
|
|
4
|
-
pushStatus
|
|
5
|
-
ticketKey ticketTitle ticketStatus lastCheckedAt missingAt createdAt updatedAt
|
|
6
|
-
tags { id name color createdAt updatedAt }
|
|
7
|
-
activeJob { id agentId kind payload status idempotencyKey result error timeoutSeconds createdAt startedAt finishedAt updatedAt }
|
|
8
|
-
pullRequest { id number title url repositoryGithubId repositoryNameWithOwner repositoryUrl labels jiraKey pipelineStatus pipelines { id name status url checkSuiteId canRetry retryUnavailableReason jobs { id name status url canRetry retryUnavailableReason steps { number name status } } } reviewDecision unresolvedReviewThreadCount createdAt }
|
|
9
|
-
`,c=`
|
|
10
|
-
id folder observedOrigin branch headSha upstream ahead behind syncState availability statusError
|
|
11
|
-
defaultBranch localBranches remoteBranches lastCheckedAt lastFetchedAt lastFetchAttemptAt lastFetchError createdAt updatedAt
|
|
12
|
-
`,u=`mutation InspectWorktree($id: ID!, $requestId: ID!) {
|
|
13
|
-
inspectWorktree(id: $id, requestId: $requestId) {
|
|
14
|
-
commits { sha subject authorName authoredAt additions deletions }
|
|
15
|
-
changes { path staged unstaged untracked conflicted stagedAdditions stagedDeletions unstagedAdditions unstagedDeletions }
|
|
16
|
-
commitsTruncated changesTruncated
|
|
17
|
-
}
|
|
18
|
-
}`;e.s(["CODEBASE_FIELDS",0,c,"INSPECT_WORKTREE_MUTATION",0,u,"WORKTREE_FIELDS",0,d],455329);var h=e.i(271645),g=e.i(462777),p=e.i(637611);async function m(e){return(await (0,p.controlPlaneRequest)(u,{id:e,requestId:(0,g.createClientId)()})).inspectWorktree}e.s(["inspectWorktree",0,m,"useLiveWorktree",0,function(e){let[t,a]=(0,h.useState)(null),r=(0,h.useCallback)(t=>{a(a=>({sourceUpdatedAt:e.updatedAt,value:a?.sourceUpdatedAt===e.updatedAt?{...a.value,...t}:t}))},[e.updatedAt]),s=(0,h.useCallback)(e=>{let t={};null!==e.hasStagedChanges&&(t.hasStagedChanges=e.hasStagedChanges),null!==e.hasUnstagedChanges&&(t.hasUnstagedChanges=e.hasUnstagedChanges),null!==e.pushStatus&&(t.pushStatus=e.pushStatus),"string"==typeof e.headSha&&Object.assign(t,{branch:e.branch,headSha:e.headSha,upstream:e.upstream,ahead:e.ahead,behind:e.behind,syncState:e.syncState??"UNKNOWN",baseAhead:e.baseAhead,baseBehind:e.baseBehind}),Object.keys(t).length&&r(t)},[r]);return{worktree:t?.sourceUpdatedAt===e.updatedAt?{...e,...t.value}:e,applyActivity:s,setUnstagedChanges:(0,h.useCallback)(e=>r({hasUnstagedChanges:e}),[r])}},"useQueuedWorktreeInspection",0,function(e){let t=(0,h.useRef)(!1),a=(0,h.useRef)(!1);return(0,h.useCallback)(async()=>{if(t.current){a.current=!0;return}t.current=!0;try{do a.current=!1,await e();while(a.current)}finally{t.current=!1}},[e])},"useWorktreeActivitySubscription",0,function(e,t,a){let r=(0,h.useRef)(a);(0,h.useEffect)(()=>{r.current=a},[a]),(0,h.useEffect)(()=>{if(!t)return;let a=!1,s=0,n=null,i=()=>void 0,l=e=>{a||e!==s||null!==n||(n=window.setTimeout(()=>{n=null,o()},1e3))},o=()=>{let t=++s;i=(0,p.controlPlaneSubscriptions)().subscribe({query:`subscription WorktreeInspectionChanged($worktreeId: ID!) {
|
|
19
|
-
worktreeInspectionChanged(worktreeId: $worktreeId) {
|
|
20
|
-
worktreeId branch headSha upstream ahead behind syncState baseAhead baseBehind
|
|
21
|
-
hasStagedChanges hasUnstagedChanges pushStatus observedAt
|
|
22
|
-
}
|
|
23
|
-
}`,variables:{worktreeId:e}},{next:e=>{let t=e.data?.worktreeInspectionChanged;t&&r.current(t)},error:()=>l(t),complete:()=>l(t)})};return o(),()=>{a=!0,s+=1,null!==n&&window.clearTimeout(n),i()}},[t,e])}],756283)},635416,96892,939050,506184,868401,448295,e=>{"use strict";var t=e.i(456420);let a=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,a],635416);let r=(0,t.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,r],96892);let s=(0,t.default)("move-right",[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]]);e.s(["MoveRight",0,s],939050);let n=(0,t.default)("paintbrush",[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]);e.s(["Paintbrush",0,n],506184);let i=(0,t.default)("tags",[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]]);e.s(["Tags",0,i],868401);var l=e.i(843476),o=e.i(93384),d=e.i(741120),c=e.i(948148),u=e.i(271645),h=e.i(929592),g=e.i(487486),p=e.i(519455),m=e.i(515288),x=e.i(59497),b=e.i(776639),j=e.i(793479),v=e.i(110204),f=e.i(967489),w=e.i(987968),k=e.i(624687),y=e.i(520133),S=e.i(462777),C=e.i(637611),I=e.i(920950);let T=`
|
|
24
|
-
id type
|
|
25
|
-
configurations {
|
|
26
|
-
id name iconKey scheme buildConfiguration defaultAction advancedSettings createdAt updatedAt
|
|
27
|
-
source { id kind relativePath }
|
|
28
|
-
observation { id scopeKey status schemes configurations testPlans error stale headSha xcodeVersion lastParseAttemptAt lastParsedAt }
|
|
29
|
-
}
|
|
30
|
-
allowedScripts {
|
|
31
|
-
position
|
|
32
|
-
script { id name preBuildScript postBuildScript enabledByDefault timeoutSeconds failureBehavior }
|
|
33
|
-
}
|
|
34
|
-
`,N=`
|
|
35
|
-
id scopeKey status schemes configurations testPlans error stale headSha xcodeVersion lastParseAttemptAt lastParsedAt
|
|
36
|
-
`,A=["BUILD","TEST","ANALYZE","ARCHIVE","BUILD_FOR_TESTING","TEST_WITHOUT_BUILDING"];function D({codebaseId:e,worktreeId:t,open:a,onOpenChange:r,onStarted:s}){let n=(0,c.useTranslations)("builds"),[i,o]=(0,u.useState)(null),[y,E]=(0,u.useState)([]),[B,R]=(0,u.useState)(""),[W,L]=(0,u.useState)("BUILD"),[P,_]=(0,u.useState)({}),[$,O]=(0,u.useState)([]),[M,U]=(0,u.useState)("SIMULATOR"),[q,F]=(0,u.useState)(""),[H,V]=(0,u.useState)(new Set),[G,K]=(0,u.useState)({}),[z,J]=(0,u.useState)("{}"),[Y,Q]=(0,u.useState)(!0),[X,Z]=(0,u.useState)(!1),[ee,et]=(0,u.useState)(!1),[ea,er]=(0,u.useState)(null),es=i?.configurations.find(e=>e.id===B),en=es?P[es.id]??es.observation:null;(0,u.useEffect)(()=>{let a=!1;return(0,C.controlPlaneRequest)(`query StartBuildProject($codebaseId: ID!, $worktreeId: ID!) {
|
|
37
|
-
iosAppProject(codebaseId: $codebaseId) { ${T} }
|
|
38
|
-
builds(first: 50, status: SUCCEEDED, worktreeId: $worktreeId) {
|
|
39
|
-
items { id action destinationType snapshot createdAt }
|
|
40
|
-
}
|
|
41
|
-
}`,{codebaseId:e,worktreeId:t}).then(e=>{if(a)return;o(e.iosAppProject),E(e.builds.items);let t=e.iosAppProject?.configurations[0];t&&(R(t.id),L(t.defaultAction),K(t.advancedSettings??{}),V(new Set(e.iosAppProject.allowedScripts.filter(e=>e.script.enabledByDefault).map(e=>e.script.id))))}).catch(e=>er(e instanceof Error?e.message:String(e))).finally(()=>{a||Q(!1)}),()=>{a=!0}},[e,t]);let ei=(0,u.useMemo)(()=>y.filter(e=>{if("BUILD_FOR_TESTING"!==e.action||e.destinationType!==M)return!1;let t=e.snapshot.configuration,a="string"==typeof G.testPlan?G.testPlan:null,r=t?.advancedSettings?.testPlan;return t?.id===B&&(!a||!r||a===r)}),[G.testPlan,B,M,y]),el=ei.find(e=>e.id===G.priorBuildForTestingId)?.id??ei[0]?.id??null,eo=async(e,a)=>{Z(!0),er(null),O([]),F("");try{let r=await (0,C.controlPlaneRequest)(`mutation InspectStartBuildDestinations($input: InspectBuildDestinationsInput!) {
|
|
42
|
-
inspectBuildDestinations(input: $input)
|
|
43
|
-
}`,{input:{worktreeId:t,configurationId:e.id,action:a,requestId:(0,S.createClientId)()}});O(r.inspectBuildDestinations);let s="ARCHIVE"===a?"PHYSICAL_DEVICE":r.inspectBuildDestinations.some(e=>"SIMULATOR"===e.type)?"SIMULATOR":"PHYSICAL_DEVICE";U(s),F(r.inspectBuildDestinations.find(e=>e.type===s)?.id??"")}catch(e){er(e instanceof Error?e.message:String(e))}finally{Z(!1)}},ed=async e=>{Z(!0),er(null);try{let a=(await (0,C.controlPlaneRequest)(`mutation ReparseStartBuild($configurationId: ID!, $worktreeId: ID!, $requestId: ID!) {
|
|
44
|
-
reparseBuildConfiguration(configurationId: $configurationId, worktreeId: $worktreeId, requestId: $requestId) {
|
|
45
|
-
${N}
|
|
46
|
-
}
|
|
47
|
-
}`,{configurationId:e.id,worktreeId:t,requestId:(0,S.createClientId)()})).reparseBuildConfiguration;if(_(t=>({...t,[e.id]:a})),"VALID"!==a.status)throw Error(a.error||n("configurationInvalid"));await eo(e,W)}catch(e){er(e instanceof Error?e.message:String(e))}finally{Z(!1)}};(0,u.useEffect)(()=>{if(!es||Y)return;let e=window.setTimeout(()=>void eo(es,W),0);return()=>window.clearTimeout(e)},[B,W,Y]);let ec=(0,u.useMemo)(()=>$.filter(e=>e.type===M),[$,M]),eu=$.find(e=>e.id===q),eh=es?`xcrun xcodebuild ${"PROJECT"===es.source.kind?`-project ${es.source.relativePath}`:"WORKSPACE"===es.source.kind?`-workspace ${es.source.relativePath}`:""} -scheme ${JSON.stringify(es.scheme)} -configuration ${JSON.stringify(es.buildConfiguration)} -destination ${JSON.stringify(eu?.name??"<destination>")} -hideShellScriptEnvironment ${W.toLowerCase().replaceAll("_","-")}${"TEST_WITHOUT_BUILDING"===W&&el?` \xb7 ${n("priorBuildSummary",{id:el})}`:""}`:"",eg=async()=>{if(es&&eu){et(!0),er(null);try{let e={};try{let t=JSON.parse(z);if(!t||"object"!=typeof t||Array.isArray(t))throw Error();e=t}catch{throw Error(n("overridesInvalid"))}let a=await (0,C.controlPlaneRequest)(`mutation StartIosBuild($input: StartBuildInput!) {
|
|
48
|
-
startBuild(input: $input) { id }
|
|
49
|
-
}`,{input:{worktreeId:t,configurationId:es.id,destination:eu,scriptIds:[...H],action:W,advancedSettings:{...G,buildSettingOverrides:e,..."TEST_WITHOUT_BUILDING"===W?{priorBuildForTestingId:el,priorTestProductsPath:null,priorXctestrunPath:null}:{}},requestId:(0,S.createClientId)()}});r(!1),s(a.startBuild.id)}catch(e){er(e instanceof Error?e.message:String(e))}finally{et(!1)}}};return(0,l.jsx)(b.Dialog,{onOpenChange:r,open:a,children:(0,l.jsxs)(b.DialogContent,{className:"sm:max-w-3xl",children:[(0,l.jsxs)(b.DialogHeader,{children:[(0,l.jsx)(b.DialogTitle,{children:n("startBuild")}),(0,l.jsx)(b.DialogDescription,{children:n("startBuildDescription")})]}),ea&&(0,l.jsx)(h.Alert,{variant:"destructive",children:(0,l.jsx)(h.AlertDescription,{children:ea})}),Y?(0,l.jsxs)("p",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,l.jsx)(w.Spinner,{})," ",n("loading")]}):i?.configurations.length?(0,l.jsxs)("div",{className:"space-y-5",children:[(0,l.jsxs)("section",{className:"space-y-2",children:[(0,l.jsx)(v.Label,{children:n("configuration")}),(0,l.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:i.configurations.map(e=>(0,l.jsxs)("button",{className:`rounded-xl border p-3 text-left transition-colors ${e.id===B?"border-primary bg-primary/5":"hover:bg-muted/50"}`,onClick:()=>{R(e.id),L(e.defaultAction),K(e.advancedSettings??{})},type:"button",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,l.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,l.jsx)(I.ConfigurationIcon,{iconKey:e.iconKey}),e.name]}),(0,l.jsx)(g.Badge,{variant:"outline",children:(P[e.id]??e.observation)?.status??"UNPARSED"})]}),(0,l.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[e.scheme," · ",e.buildConfiguration]})]},e.id))})]}),es&&(0,l.jsx)(m.Card,{children:(0,l.jsxs)(m.CardContent,{className:"space-y-2 text-sm",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-mono text-xs",children:es.source.relativePath}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:[es.scheme," ·"," ",es.buildConfiguration]})]}),(0,l.jsxs)(p.Button,{disabled:X,onClick:()=>void ed(es),size:"sm",type:"button",variant:"outline",children:[X?(0,l.jsx)(w.Spinner,{}):(0,l.jsx)(d.RefreshCw,{})," ",n("reparse")]})]}),en?.error&&(0,l.jsx)("p",{className:"text-xs text-destructive",children:en.error})]})}),(0,l.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(v.Label,{children:n("action")}),(0,l.jsxs)(f.Select,{onValueChange:e=>L(e),value:W,children:[(0,l.jsx)(f.SelectTrigger,{children:(0,l.jsx)(f.SelectValue,{})}),(0,l.jsx)(f.SelectContent,{children:A.map(e=>(0,l.jsx)(f.SelectItem,{value:e,children:n(`actions.${e}`)},e))})]})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(v.Label,{children:n("destinationType")}),(0,l.jsxs)(f.Select,{disabled:"ARCHIVE"===W,onValueChange:e=>{U(e),F($.find(t=>t.type===e)?.id??"")},value:M,children:[(0,l.jsx)(f.SelectTrigger,{children:(0,l.jsx)(f.SelectValue,{})}),(0,l.jsxs)(f.SelectContent,{children:[(0,l.jsx)(f.SelectItem,{value:"SIMULATOR",children:n("simulator")}),(0,l.jsx)(f.SelectItem,{value:"PHYSICAL_DEVICE",children:n("physicalDevice")})]})]})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(v.Label,{children:n("device")}),(0,l.jsxs)(f.Select,{disabled:X||!ec.length,onValueChange:F,value:q,children:[(0,l.jsx)(f.SelectTrigger,{children:(0,l.jsx)(f.SelectValue,{placeholder:n("selectDevice")})}),(0,l.jsx)(f.SelectContent,{children:ec.map(e=>(0,l.jsxs)(f.SelectItem,{value:e.id,children:[e.generic?"SIMULATOR"===e.type?n("anySimulator"):n("anyPhysicalDevice"):e.name,e.osVersion?` \xb7 ${e.osVersion}`:""]},e.id))})]})]})]}),"TEST_WITHOUT_BUILDING"===W&&(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(v.Label,{children:n("priorBuildForTesting")}),(0,l.jsxs)(f.Select,{disabled:!ei.length,onValueChange:e=>K(t=>({...t,priorBuildForTestingId:e,priorTestProductsPath:null,priorXctestrunPath:null})),value:el??"",children:[(0,l.jsx)(f.SelectTrigger,{children:(0,l.jsx)(f.SelectValue,{placeholder:n("selectPriorBuildForTesting")})}),(0,l.jsx)(f.SelectContent,{children:ei.map(e=>(0,l.jsxs)(f.SelectItem,{value:e.id,children:[new Date(e.createdAt).toLocaleString()," ·"," ",e.id]},e.id))})]}),!ei.length&&(0,l.jsx)("p",{className:"text-xs text-destructive",children:n("noPriorBuildForTesting")})]}),["TEST","BUILD_FOR_TESTING","TEST_WITHOUT_BUILDING"].includes(W)&&(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(v.Label,{children:n("testPlan")}),(0,l.jsxs)(f.Select,{onValueChange:e=>K(t=>({...t,testPlan:"__SCHEME_DEFAULT__"===e?null:e})),value:String(G.testPlan??"__SCHEME_DEFAULT__"),children:[(0,l.jsx)(f.SelectTrigger,{children:(0,l.jsx)(f.SelectValue,{})}),(0,l.jsxs)(f.SelectContent,{children:[(0,l.jsx)(f.SelectItem,{value:"__SCHEME_DEFAULT__",children:n("schemeDefaultTestPlan")}),"string"==typeof G.testPlan&&G.testPlan&&!en?.testPlans.includes(G.testPlan)&&(0,l.jsxs)(f.SelectItem,{value:G.testPlan,children:[G.testPlan," · ",n("savedValueUnavailable")]}),en?.testPlans.map(e=>(0,l.jsx)(f.SelectItem,{value:e,children:e},e))]})]})]}),i.allowedScripts.length>0&&(0,l.jsxs)("section",{className:"space-y-2",children:[(0,l.jsx)(v.Label,{children:n("scripts")}),(0,l.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:i.allowedScripts.map(({script:e})=>(0,l.jsxs)("label",{className:"flex items-start gap-2 rounded-lg border p-2",children:[(0,l.jsx)(x.Checkbox,{checked:H.has(e.id),onCheckedChange:t=>{V(a=>{let r=new Set(a);return t?r.add(e.id):r.delete(e.id),r})}}),(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"block text-sm font-medium",children:e.name}),(0,l.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.preBuildScript?n("preBuild"):"",e.preBuildScript&&e.postBuildScript?" · ":"",e.postBuildScript?n("postBuild"):""]})]})]},e.id))})]}),(0,l.jsxs)("details",{className:"rounded-xl border p-3",children:[(0,l.jsx)("summary",{className:"cursor-pointer font-medium",children:n("advancedSettings")}),(0,l.jsxs)("div",{className:"mt-4 grid gap-4 sm:grid-cols-2",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(v.Label,{htmlFor:"development-team",children:n("developmentTeam")}),(0,l.jsx)(j.Input,{id:"development-team",onChange:e=>K(t=>({...t,developmentTeam:e.target.value||null})),value:String(G.developmentTeam??"")})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(v.Label,{children:n("packageResolution")}),(0,l.jsxs)(f.Select,{onValueChange:e=>K(t=>({...t,packageResolution:e})),value:String(G.packageResolution??"DEFAULT"),children:[(0,l.jsx)(f.SelectTrigger,{children:(0,l.jsx)(f.SelectValue,{})}),(0,l.jsx)(f.SelectContent,{children:["DEFAULT","RESOLVED_ONLY","SKIP_UPDATES","DISABLE_AUTOMATIC"].map(e=>(0,l.jsx)(f.SelectItem,{value:e,children:e},e))})]})]}),(0,l.jsxs)("label",{className:"flex items-center gap-2",children:[(0,l.jsx)(x.Checkbox,{checked:!!G.codeCoverage,onCheckedChange:e=>K(t=>({...t,codeCoverage:!!e}))}),n("codeCoverage")]}),(0,l.jsxs)("label",{className:"flex items-center gap-2",children:[(0,l.jsx)(x.Checkbox,{checked:!!G.allowProvisioningUpdates,onCheckedChange:e=>K(t=>({...t,allowProvisioningUpdates:!!e}))}),n("allowProvisioningUpdates")]}),(0,l.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,l.jsx)(v.Label,{htmlFor:"build-setting-overrides",children:n("buildSettingOverrides")}),(0,l.jsx)(k.Textarea,{className:"font-mono text-xs",id:"build-setting-overrides",onChange:e=>J(e.target.value),rows:4,value:z})]})]})]}),(0,l.jsxs)("section",{className:"space-y-2",children:[(0,l.jsx)(v.Label,{children:n("commandPreview")}),(0,l.jsx)("pre",{className:"overflow-x-auto rounded-lg bg-muted p-3 text-xs whitespace-pre-wrap",children:eh})]})]}):(0,l.jsx)(h.Alert,{children:(0,l.jsx)(h.AlertDescription,{children:n("noConfigurations")})}),(0,l.jsxs)(b.DialogFooter,{children:[(0,l.jsx)(p.Button,{onClick:()=>r(!1),type:"button",variant:"outline",children:n("cancel")}),(0,l.jsxs)(p.Button,{disabled:Y||X||ee||!es||!eu||"TEST_WITHOUT_BUILDING"===W&&!el,onClick:()=>void eg(),type:"button",children:[ee&&(0,l.jsx)(w.Spinner,{})," ",n("startBuild")]})]})]})})}e.s(["StartBuildButton",0,function({codebaseId:e,worktreeId:t,disabled:a,disabledReason:r,size:s="sm"}){let n=(0,c.useTranslations)("builds"),i=(0,y.useRouter)(),[d,h]=(0,u.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(p.Button,{disabled:a,onClick:()=>h(!0),size:s,title:r??void 0,type:"button",children:[(0,l.jsx)(o.Hammer,{})," ",n("build")]}),d&&(0,l.jsx)(D,{codebaseId:e,onOpenChange:h,onStarted:e=>i.push(`/builds/${e}`),open:d,worktreeId:t})]})}],448295)},267572,e=>{"use strict";var t=e.i(843476),a=e.i(271645),r=e.i(876561),s=e.i(635416),n=e.i(768877),i=e.i(96892),l=e.i(689664),o=e.i(716327),d=e.i(867927),c=e.i(452330),u=e.i(482022),h=e.i(269846),g=e.i(634398),p=e.i(851817),m=e.i(882505),x=e.i(648119),b=e.i(939050),j=e.i(506184),v=e.i(515281),f=e.i(77071),w=e.i(741120),k=e.i(395925),y=e.i(856522),S=e.i(566595),C=e.i(868401),I=e.i(573474),T=e.i(725981),N=e.i(861745),A=e.i(948148),D=e.i(778434),E=e.i(448295),B=e.i(346194),R=e.i(647776),W=e.i(948812),L=e.i(356505),P=e.i(929592),_=e.i(487486),$=e.i(519455),O=e.i(515288),M=e.i(59497),U=e.i(776639),q=e.i(755146),F=e.i(82612),H=e.i(793479),V=e.i(906197),G=e.i(110204),K=e.i(337822),z=e.i(337355),J=e.i(987968),Y=e.i(967489),Q=e.i(784774),X=e.i(808562),Z=e.i(462777),ee=e.i(637611),et=e.i(975157),ea=e.i(520133),er=e.i(284494),es=e.i(942230),en=e.i(455329),ei=e.i(756283),el=e.i(440289),eo=e.i(940276);let ed=["gray","stone","red","rose","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink"],ec="worktrees-layout",eu="__all__";function eh(e,t){return e.some(e=>("string"==typeof e||"number"==typeof e)&&String(e).toLocaleLowerCase().includes(t))}function eg(e,t){let a=t.query.trim().toLocaleLowerCase();return a||t.agentId||t.repositoryId?e.flatMap(e=>{if(t.agentId&&e.agent.id!==t.agentId)return[];let r=a.length>0&&eh([e.agent.id,e.agent.name,e.agent.hostname],a),s=e.codebases.flatMap(e=>{if(t.repositoryId&&e.repository.id!==t.repositoryId)return[];let s=a.length>0&&eh([e.repository.id,e.repository.name,e.repository.description,e.repository.canonicalOrigin,e.repository.displayOrigin,e.codebase.id,e.codebase.folder,e.codebase.observedOrigin,e.codebase.branch,e.codebase.defaultBranch],a),n=!a||r||s?e.worktrees:e.worktrees.filter(e=>eh([e.id,e.branch,e.folder,e.relativePath,e.ticketKey,e.ticketTitle,e.ticketStatus,e.pullRequest?.number,e.pullRequest?.title,e.pullRequest?.repositoryNameWithOwner,e.pullRequest?.jiraKey,...e.tags.map(e=>e.name)],a));return n.length?[{...e,worktrees:n}]:[]});return s.length?[{...e,codebases:s}]:[]}):e}function ep(e,t){if(!t)return e;let a=/^[A-Za-z]:[\\/]/.test(t)||t.startsWith("\\\\"),r=a?"\\":"/",s=e=>a?e.replaceAll("/","\\"):e,n=e=>(a?/^[A-Za-z]:\\$/.test(e):"/"===e)?e:e.replace(/[\\/]+$/,""),i=n(s(t)),l=n(s(e)),o=a?i.toLocaleLowerCase():i,d=a?l.toLocaleLowerCase():l;if(d===o)return".";let c=i.endsWith(r)?i:`${i}${r}`,u=a?c.toLocaleLowerCase():c;return d.startsWith(u)?l.slice(c.length):e}function em(e){return{hasChanges:e.hasStagedChanges||e.hasUnstagedChanges,stageOperation:e.hasStagedChanges&&!e.hasUnstagedChanges?"UNSTAGE_ALL":"STAGE_ALL"}}let ex={gray:"border-slate-500/30 bg-slate-500/10 hover:border-slate-500/50 hover:bg-slate-500/20",stone:"border-stone-500/30 bg-stone-500/10 hover:border-stone-500/50 hover:bg-stone-500/20",red:"border-red-500/30 bg-red-500/10 hover:border-red-500/50 hover:bg-red-500/20",rose:"border-rose-500/30 bg-rose-500/10 hover:border-rose-500/50 hover:bg-rose-500/20",orange:"border-orange-500/30 bg-orange-500/10 hover:border-orange-500/50 hover:bg-orange-500/20",amber:"border-amber-500/30 bg-amber-500/10 hover:border-amber-500/50 hover:bg-amber-500/20",yellow:"border-yellow-500/30 bg-yellow-500/10 hover:border-yellow-500/50 hover:bg-yellow-500/20",lime:"border-lime-500/30 bg-lime-500/10 hover:border-lime-500/50 hover:bg-lime-500/20",green:"border-green-500/30 bg-green-500/10 hover:border-green-500/50 hover:bg-green-500/20",emerald:"border-emerald-500/30 bg-emerald-500/10 hover:border-emerald-500/50 hover:bg-emerald-500/20",teal:"border-teal-500/30 bg-teal-500/10 hover:border-teal-500/50 hover:bg-teal-500/20",cyan:"border-cyan-500/30 bg-cyan-500/10 hover:border-cyan-500/50 hover:bg-cyan-500/20",sky:"border-sky-500/30 bg-sky-500/10 hover:border-sky-500/50 hover:bg-sky-500/20",blue:"border-blue-500/30 bg-blue-500/10 hover:border-blue-500/50 hover:bg-blue-500/20",indigo:"border-indigo-500/30 bg-indigo-500/10 hover:border-indigo-500/50 hover:bg-indigo-500/20",violet:"border-violet-500/30 bg-violet-500/10 hover:border-violet-500/50 hover:bg-violet-500/20",purple:"border-purple-500/30 bg-purple-500/10 hover:border-purple-500/50 hover:bg-purple-500/20",fuchsia:"border-fuchsia-500/30 bg-fuchsia-500/10 hover:border-fuchsia-500/50 hover:bg-fuchsia-500/20",pink:"border-pink-500/30 bg-pink-500/10 hover:border-pink-500/50 hover:bg-pink-500/20"},eb={gray:"border-slate-500/40 bg-slate-500/15 text-slate-700 dark:text-slate-300",stone:"border-stone-500/40 bg-stone-500/15 text-stone-700 dark:text-stone-300",red:"border-red-500/40 bg-red-500/15 text-red-700 dark:text-red-300",rose:"border-rose-500/40 bg-rose-500/15 text-rose-700 dark:text-rose-300",orange:"border-orange-500/40 bg-orange-500/15 text-orange-700 dark:text-orange-300",amber:"border-amber-500/40 bg-amber-500/15 text-amber-800 dark:text-amber-300",yellow:"border-yellow-500/40 bg-yellow-500/15 text-yellow-800 dark:text-yellow-300",lime:"border-lime-500/40 bg-lime-500/15 text-lime-800 dark:text-lime-300",green:"border-green-500/40 bg-green-500/15 text-green-700 dark:text-green-300",emerald:"border-emerald-500/40 bg-emerald-500/15 text-emerald-700 dark:text-emerald-300",teal:"border-teal-500/40 bg-teal-500/15 text-teal-700 dark:text-teal-300",cyan:"border-cyan-500/40 bg-cyan-500/15 text-cyan-700 dark:text-cyan-300",sky:"border-sky-500/40 bg-sky-500/15 text-sky-700 dark:text-sky-300",blue:"border-blue-500/40 bg-blue-500/15 text-blue-700 dark:text-blue-300",indigo:"border-indigo-500/40 bg-indigo-500/15 text-indigo-700 dark:text-indigo-300",violet:"border-violet-500/40 bg-violet-500/15 text-violet-700 dark:text-violet-300",purple:"border-purple-500/40 bg-purple-500/15 text-purple-700 dark:text-purple-300",fuchsia:"border-fuchsia-500/40 bg-fuchsia-500/15 text-fuchsia-700 dark:text-fuchsia-300",pink:"border-pink-500/40 bg-pink-500/15 text-pink-700 dark:text-pink-300"},ej={gray:"border-slate-600 bg-slate-500",stone:"border-stone-600 bg-stone-500",red:"border-red-600 bg-red-500",rose:"border-rose-600 bg-rose-500",orange:"border-orange-600 bg-orange-500",amber:"border-amber-600 bg-amber-500",yellow:"border-yellow-600 bg-yellow-500",lime:"border-lime-600 bg-lime-500",green:"border-green-600 bg-green-500",emerald:"border-emerald-600 bg-emerald-500",teal:"border-teal-600 bg-teal-500",cyan:"border-cyan-600 bg-cyan-500",sky:"border-sky-600 bg-sky-500",blue:"border-blue-600 bg-blue-500",indigo:"border-indigo-600 bg-indigo-500",violet:"border-violet-600 bg-violet-500",purple:"border-purple-600 bg-purple-500",fuchsia:"border-fuchsia-600 bg-fuchsia-500",pink:"border-pink-600 bg-pink-500"};function ev({moves:e,onReload:r,onError:s,onNotice:n}){let i=(0,A.useTranslations)("worktrees"),[l,o]=(0,a.useState)(null),d=async e=>{o(e.id);try{await (0,ee.controlPlaneRequest)(`mutation RetryWorktreeMove($id: ID!) {
|
|
50
|
-
retryWorktreeMoveWithStash(id: $id) { id status }
|
|
51
|
-
}`,{id:e.id});let t=await (0,el.waitForWorktreeMove)(e.id);if("FAILED"===t.status)throw Error(t.error||i("moveFailed"));n("SUCCEEDED_WITH_WARNING"===t.status?t.warning||i("moveCompletedWithWarning"):i("moveCompleted")),s(null),await r()}catch(e){s(e instanceof Error?e.message:String(e))}finally{o(null)}},c=async e=>{o(e.id);try{await (0,ee.controlPlaneRequest)(`mutation CancelWorktreeMove($id: ID!) {
|
|
52
|
-
cancelWorktreeMove(id: $id) { id status }
|
|
53
|
-
}`,{id:e.id}),n(i("moveCancelled")),s(null),await r()}catch(e){s(e instanceof Error?e.message:String(e))}finally{o(null)}};return(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,t.jsx)(P.Alert,{children:(0,t.jsxs)(P.AlertDescription,{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:i("moveProgress",{branch:e.branch})}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"AWAITING_STASH"===e.status?e.error||i("moveNeedsStash"):i(`moveStatus.${e.status}`)})]}),"AWAITING_STASH"===e.status?(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)($.Button,{disabled:l===e.id,onClick:()=>void c(e),size:"sm",variant:"outline",children:i("cancelMove")}),(0,t.jsxs)($.Button,{disabled:l===e.id,onClick:()=>void d(e),size:"sm",children:[l===e.id&&(0,t.jsx)(J.Spinner,{}),i("stashAndContinue")]})]}):(0,t.jsx)(J.Spinner,{})]})},e.id))})}function ef(e,t){return{codebaseId:e.codebase.id,...t?{worktreeId:t.id}:{},defaultBranch:e.codebase.defaultBranch,currentBranch:t?.branch,currentBaseBranch:t?.baseBranch,localBranches:e.codebase.localBranches,remoteBranches:e.codebase.remoteBranches,unavailableBranches:e.worktrees.flatMap(e=>e.branch&&e.id!==t?.id?[e.branch]:[])}}function ew({overview:e,onCreated:r}){let s=(0,A.useTranslations)("worktrees"),n=e.agents.flatMap(e=>e.codebases.flatMap(t=>"ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.branch")&&"AVAILABLE"===t.codebase.availability&&!t.worktrees.some(e=>e.activeJob)?[{agentGroup:e,group:t}]:[])),[i,l]=(0,a.useState)(1===n.length?n[0].group.codebase.id:""),[o,d]=(0,a.useState)(!1),c=n.some(e=>e.group.codebase.id===i)?i:1===n.length?n[0].group.codebase.id:"",u=n.find(e=>e.group.codebase.id===c),h=n.map(({agentGroup:e,group:t})=>({value:t.codebase.id,label:`${t.repository.name} \xb7 ${e.agent.name}`,description:t.codebase.folder,keywords:`${t.repository.displayOrigin} ${e.agent.hostname}`})),g=async e=>{if(!u)throw Error(s("selectCodebase"));d(!0);try{let t=await (0,ee.controlPlaneRequest)(`mutation CreateWorktree($input: CreateWorktreeInput!) {
|
|
54
|
-
createWorktree(input: $input) { id }
|
|
55
|
-
}`,{input:{codebaseId:u.group.codebase.id,selection:e,requestId:(0,Z.createClientId)()}});await (0,el.waitForWorktreeJob)(t.createWorktree.id),await r()}finally{d(!1)}};return(0,t.jsxs)(O.Card,{children:[(0,t.jsx)(O.CardHeader,{className:"border-b",children:(0,t.jsxs)(O.CardTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(f.Plus,{})," ",s("createWorktree")]})}),(0,t.jsxs)(O.CardContent,{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(G.Label,{className:"mb-1.5 block",children:s("repositoryCheckout")}),(0,t.jsx)(z.SearchableSelect,{ariaLabel:s("repositoryCheckout"),disabled:o||0===h.length,emptyMessage:s("noEligibleCodebases"),onValueChange:l,options:h,placeholder:s("selectCodebase"),searchPlaceholder:s("searchCodebases"),value:c})]}),u?(0,t.jsx)(er.WorktreeBranchForm,{busy:o,onSubmit:g,submitLabel:s("createWorktree"),target:ef(u.group)},u.group.codebase.id):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:h.length?s("selectCodebaseHelp"):s("noEligibleCodebases")})]})]})}function ek({agentGroup:e,layout:a,allTags:r,editorVariant:s,inspectionRefreshToken:n,onReload:i,onUpdate:l,onError:o,onManageTags:d,onOpenTicket:c,overview:u}){let h=(0,A.useTranslations)("worktrees"),g="ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.watch"),p="ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.branch");return(0,t.jsxs)("section",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b pb-2",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:e.agent.name}),(0,t.jsx)(_.Badge,{children:h("ONLINE"===e.agent.connectionStatus?"online":"offline")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.agent.hostname})]}),e.codebases.map(h=>(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-medium",children:h.repository.name}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:h.repository.displayOrigin})]}),(0,t.jsx)(ey,{codebase:h.codebase})]}),"cards"===a?(0,t.jsx)("div",{className:"space-y-3",children:h.worktrees.map(a=>(0,t.jsx)(eS,{allTags:r,baseRepoDirectory:e.agent.baseRepoDirectory,branchManagementEnabled:p,editorVariant:s,group:h,inspectionRefreshToken:n,liveUpdatesEnabled:g,onError:o,onManageTags:d,onOpenTicket:c,onReload:i,onUpdate:l,overview:u,worktree:a},a.id))}):(0,t.jsx)(eU,{allTags:r,baseRepoDirectory:e.agent.baseRepoDirectory,branchManagementEnabled:p,editorVariant:s,group:h,inspectionRefreshToken:n,liveUpdatesEnabled:g,onError:o,onManageTags:d,onOpenTicket:c,onReload:i,onUpdate:l,overview:u})]},h.codebase.id))]})}function ey({codebase:e}){let r=(0,A.useTranslations)("worktrees"),s=(0,N.useLocale)(),[n,i]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=()=>i(new Date().getTime()),t=window.setTimeout(e,0),a=window.setInterval(e,1e3);return()=>{window.clearTimeout(t),window.clearInterval(a)}},[]);let l=e.lastFetchedAt&&null!==n?Math.max(0,n-new Date(e.lastFetchedAt).getTime()):null,o=null===l?r("neverFetched"):l<6e4?r("secondsAgo",{count:Math.floor(l/1e3)}):new Intl.RelativeTimeFormat(s,{numeric:"auto"}).format(-Math.floor(l/6e4),"minute");return(0,t.jsx)("span",{className:(0,et.cn)("text-xs text-muted-foreground",e.lastFetchError&&"text-destructive"),title:e.lastFetchError??void 0,children:r("lastFetched",{value:o})})}function eS(e){let{inspectionRefreshToken:r,onError:s}=e,{worktree:n,applyActivity:i,setUnstagedChanges:l}=(0,ei.useLiveWorktree)(e.worktree),c={...e,worktree:n},[u,h]=(0,a.useState)(!1),[g,p]=(0,a.useState)(null),[m,x]=(0,a.useState)(!1),b=(0,a.useRef)(0),j=(0,a.useRef)(r),v=(0,A.useTranslations)("worktrees"),f=(0,ea.useRouter)(),w=(0,a.useCallback)(async()=>{let e=++b.current;x(!0);try{let t=await (0,ei.inspectWorktree)(n.id);if(e!==b.current)return;p(t),l(t.changes.some(e=>e.unstaged||e.untracked||e.conflicted)),s(null)}catch(t){e===b.current&&s(t instanceof Error?t.message:String(t))}finally{e===b.current&&x(!1)}},[s,l,n.id]),k=(0,ei.useQueuedWorktreeInspection)(w),y=(0,a.useCallback)(e=>{i(e),u&&k()},[i,u,k]);(0,ei.useWorktreeActivitySubscription)(n.id,e.liveUpdatesEnabled&&"AVAILABLE"===n.availability,y),(0,a.useEffect)(()=>{if(j.current===r||(j.current=r,!u))return;let e=window.setTimeout(()=>void k(),0);return()=>window.clearTimeout(e)},[u,r,k]);let S=()=>{let e=!u;h(e),e&&!g&&k()};return(0,t.jsxs)(O.Card,{className:(0,et.cn)("cursor-pointer transition-colors hover:bg-muted/30",n.highlightColor&&ex[n.highlightColor]),onClick:e=>{(0,eo.shouldNavigateWorktreeSurface)(e)&&f.push((0,eo.worktreeDetailHref)(n.id))},children:[(0,t.jsxs)(O.CardHeader,{className:"grid-cols-1! border-b @md/card-header:grid-cols-[minmax(0,1fr)_auto]!",children:[(0,t.jsxs)(O.CardTitle,{className:"min-w-0",children:[(0,t.jsxs)($.Button,{"aria-expanded":u,className:"h-auto w-full max-w-full justify-start gap-1 p-1 text-left",onClick:()=>void S(),variant:"ghost",children:[u?(0,t.jsx)(o.ChevronDown,{}):(0,t.jsx)(d.ChevronRight,{}),(0,t.jsx)("span",{className:"truncate font-mono",children:n.branch??n.headSha?.slice(0,10)??v("detached")})]}),(n.ticketKey||n.ticketTitle)&&(0,t.jsx)(eI,{...c})]}),(0,t.jsxs)(O.CardAction,{className:"col-start-1 row-span-1 row-start-auto flex max-w-full flex-wrap items-center justify-start gap-1 justify-self-start @md/card-header:col-start-2 @md/card-header:row-span-2 @md/card-header:row-start-1 @md/card-header:justify-end @md/card-header:justify-self-end",children:[(0,t.jsx)(eR,{worktree:n}),n.hasUnstagedChanges&&(0,t.jsx)(_.Badge,{variant:"destructive",children:v("dirty")}),(0,t.jsx)(eC,{worktree:n}),(0,t.jsx)(eP,{...c})]})]}),(0,t.jsxs)(O.CardContent,{className:"space-y-4",children:[(0,t.jsx)(eT,{...c,detailsExpanded:u,onToggleDetails:S}),m&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(J.Spinner,{})," ",v("loadingDetails")]}),u&&g&&(0,t.jsx)(es.WorktreeDetailPanel,{detail:g,inline:!0})]}),(0,t.jsx)(O.CardFooter,{className:"flex-wrap gap-2","data-worktree-navigation-ignore":!0,children:(0,t.jsx)(eO,{...c,onCompleted:async()=>{await e.onReload(),u&&await k()}})})]})}function eC({worktree:e}){let a=(0,A.useTranslations)("worktrees"),r=e.branch??e.headSha?.slice(0,10)??a("detached"),s=a("openWorktreeDetails",{branch:r});return(0,t.jsx)($.Button,{asChild:!0,size:"icon-sm",variant:"ghost",children:(0,t.jsx)(ea.Link,{"aria-label":s,href:(0,eo.worktreeDetailHref)(e.id),title:s,children:(0,t.jsx)(n.ArrowRight,{})})})}function eI({worktree:e,onOpenTicket:a,compact:r=!1}){let s=`${e.ticketKey??""}${e.ticketTitle?`${e.ticketKey?" — ":""}${e.ticketTitle}`:""}`;return(0,t.jsxs)("div",{className:(0,et.cn)("flex max-w-full flex-wrap items-center gap-1.5 font-normal",r?"mt-0.5 text-xs":"mt-1 text-sm"),children:[e.ticketKey?(0,t.jsx)($.Button,{className:"h-auto min-w-0 justify-start truncate p-0 text-left font-normal",onClick:()=>a(e.ticketKey),title:s,type:"button",variant:"link",children:s}):(0,t.jsx)("p",{className:"min-w-0 truncate text-muted-foreground",title:s,children:s}),e.ticketStatus&&(e.ticketKey?(0,t.jsx)(_.Badge,{asChild:!0,variant:"secondary",children:(0,t.jsx)("button",{onClick:()=>a(e.ticketKey),type:"button",children:e.ticketStatus})}):(0,t.jsx)(_.Badge,{variant:"secondary",children:e.ticketStatus}))]})}function eT(e){let{worktree:a,group:r,baseRepoDirectory:s,detailsExpanded:n,onToggleDetails:i}=e,l=(0,A.useTranslations)("worktrees");return(0,t.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,t.jsx)(eH,{label:l("path"),mono:!0,value:ep(a.folder,s)}),(0,t.jsx)(eW,{...e})]}),(0,t.jsx)(eN,{label:l("upToDate"),children:(0,t.jsx)(eD,{worktree:a})}),(0,t.jsx)(eA,{...e}),(0,t.jsx)(eN,{label:l("pullRequest"),children:(0,t.jsx)(eE,{detailsExpanded:n,onToggleDetails:i,worktree:a})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a.statusError&&(0,t.jsx)("span",{className:"text-xs text-destructive",children:a.statusError}),!r.codebase.defaultBranch&&!a.baseBranchOverride&&(0,t.jsx)("span",{className:"text-xs text-destructive",children:l("baseUnavailable")})]})]})}function eN({label:e,children:a}){return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("p",{className:"w-24 shrink-0 text-xs text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:a})]})}function eA({compact:e=!1,...a}){let{worktree:r}=a,s=(0,A.useTranslations)("worktrees");return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[!e&&(0,t.jsx)("span",{className:"w-24 shrink-0 text-xs text-muted-foreground",children:s("tags")}),(0,t.jsx)(eP,{...a,contentAlign:e?"end":"start",contentAlignOffset:e?0:-100,trigger:(0,t.jsx)($.Button,{"aria-label":`${s("tags")}: ${r.branch??s("detached")}`,className:(0,et.cn)("h-auto min-h-7 max-w-full justify-start px-1 py-1 text-left font-normal",!e&&"-mx-1"),type:"button",variant:"ghost",children:(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[r.tags.map(e=>(0,t.jsx)(eF,{tag:e},e.id)),!r.tags.length&&(0,t.jsx)("span",{className:"text-muted-foreground",children:"—"})]})})})]})}function eD({worktree:e}){let a=(0,A.useTranslations)("worktrees"),r=0===e.baseBehind;return(0,t.jsx)(_.Badge,{className:r?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":null===e.baseBehind?void 0:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",variant:"outline",children:null===e.baseBehind?a("unknown"):r?a("yes"):a("notUpToDate",{count:e.baseBehind})})}function eE({worktree:e,detailsExpanded:a,onToggleDetails:r}){var s;let n=(0,A.useTranslations)("worktrees");return(0,t.jsxs)(t.Fragment,{children:[e.pullRequest?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eB,{pullRequest:e.pullRequest}),(0,t.jsx)(R.PipelineMenu,{pipelineStatus:e.pullRequest.pipelineStatus,pipelines:e.pullRequest.pipelines,repositoryId:e.pullRequest.repositoryGithubId}),(0,t.jsx)(_.Badge,{className:"APPROVED"===(s=e.pullRequest.reviewDecision)?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"CHANGES_REQUESTED"===s?"border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300":"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",children:n(`review.${e.pullRequest.reviewDecision}`)}),(0,t.jsx)(_.Badge,{asChild:!0,className:0===e.pullRequest.unresolvedReviewThreadCount?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",children:(0,t.jsx)(ea.Link,{href:(0,W.pullRequestCommentsHref)(e.pullRequest),children:n("comments",{count:e.pullRequest.unresolvedReviewThreadCount})})})]}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"—"}),r?(0,t.jsx)(_.Badge,{asChild:!0,variant:"secondary",children:(0,t.jsx)("button",{"aria-expanded":a,onClick:r,type:"button",children:n("branchCommits",{count:e.baseAhead??0})})}):(0,t.jsx)(_.Badge,{variant:"secondary",children:n("branchCommits",{count:e.baseAhead??0})})]})}function eB({pullRequest:e}){let a=(0,A.useTranslations)("worktrees");return(0,t.jsxs)(q.DropdownMenu,{children:[(0,t.jsx)(q.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(_.Badge,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",children:["PR #",e.number]})})}),(0,t.jsxs)(q.DropdownMenuContent,{align:"start",className:"w-44",children:[(0,t.jsx)(q.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)("a",{href:e.url,rel:"noreferrer",target:"_blank",children:[(0,t.jsx)(u.ExternalLink,{}),a("openInGitHub")]})}),(0,t.jsx)(q.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)(ea.Link,{href:(0,W.pullRequestDetailHref)(e),children:[(0,t.jsx)(g.GitPullRequest,{}),a("openDetails")]})})]})]})}function eR({worktree:e}){var a,r;let n=(0,A.useTranslations)("worktrees");return"IN_SYNC"===e.syncState||0===e.ahead&&0===e.behind?(0,t.jsx)(_.Badge,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",variant:"outline",children:n("inSync")}):null!==e.ahead||null!==e.behind?(0,t.jsxs)(t.Fragment,{children:[null!==e.ahead&&(0,t.jsxs)(_.Badge,{className:"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",variant:"outline",children:[(0,t.jsx)(i.ArrowUp,{"data-icon":"inline-start"}),n("ahead",{count:e.ahead})]}),null!==e.behind&&(0,t.jsxs)(_.Badge,{className:"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",variant:"outline",children:[(0,t.jsx)(s.ArrowDown,{"data-icon":"inline-start"}),n("behind",{count:e.behind})]})]}):(0,t.jsx)(_.Badge,{variant:"outline",children:(a=e,r=n,"AHEAD"===a.syncState?r("ahead",{count:a.ahead??0}):"BEHIND"===a.syncState?r("behind",{count:a.behind??0}):r("DIVERGED"===a.syncState?"diverged":"IN_SYNC"===a.syncState?"upToDate":"NO_UPSTREAM"===a.syncState?"unpublished":"DETACHED"===a.syncState?"detached":"unknown"))})}function eW(e){let{worktree:r,group:s,onUpdate:n,onError:i,compact:l=!1}=e,o=(0,A.useTranslations)("worktrees"),[d,c]=(0,a.useState)(!1),[u,h]=(0,a.useState)(!1),g="__inherit_remote_default__",p=Array.from(new Set([r.baseBranchOverride,s.codebase.defaultBranch,...s.codebase.remoteBranches].filter(e=>!!e))),m=async e=>{h(!0);try{let t=await (0,ee.controlPlaneRequest)(`mutation UpdateWorktreeBase($id: ID!, $baseBranch: String) {
|
|
56
|
-
updateWorktreeBaseBranch(id: $id, baseBranch: $baseBranch) { ${en.WORKTREE_FIELDS} }
|
|
57
|
-
}`,{id:r.id,baseBranch:e||null});n(t.updateWorktreeBaseBranch),i(null),c(!1)}catch(e){i(e instanceof Error?e.message:String(e))}finally{h(!1)}};return(0,t.jsxs)("div",{className:"min-w-0",children:[!l&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o("baseBranch")}),(0,t.jsx)("div",{className:(0,et.cn)("flex min-h-6 min-w-0 items-center gap-1",!l&&"mt-0.5"),children:d?(0,t.jsxs)(Y.Select,{disabled:u,onOpenChange:c,onValueChange:e=>void m(e===g?"":e),open:d,value:r.baseBranchOverride??(s.codebase.defaultBranch?g:void 0),children:[(0,t.jsx)(Y.SelectTrigger,{"aria-label":o("baseBranch"),className:"h-7 min-w-40 max-w-full font-mono text-xs",size:"sm",children:(0,t.jsx)(Y.SelectValue,{placeholder:o("baseUnavailable")})}),(0,t.jsxs)(Y.SelectContent,{align:"start",children:[s.codebase.defaultBranch&&(0,t.jsxs)(Y.SelectItem,{value:g,children:[s.codebase.defaultBranch," · ",o("inheritBase")]}),p.map(e=>(0,t.jsx)(Y.SelectItem,{value:e,children:e},e))]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:r.baseBranch??void 0,children:r.baseBranch??"—"}),(0,t.jsx)($.Button,{"aria-label":o("editBase"),onClick:()=>c(!0),size:"icon-xs",variant:"ghost",children:(0,t.jsx)(v.Pencil,{})})]})})]})}function eL(e,t){let a=t.activeMoves.some(t=>t.sourceCodebaseId===e.group.codebase.id||t.targetCodebaseId===e.group.codebase.id);return"ONLINE"===e.agentGroup.agent.connectionStatus&&e.agentGroup.agent.capabilities.includes("worktree.move.checkout")&&"AVAILABLE"===e.group.codebase.availability&&!e.group.worktrees.some(e=>e.activeJob)&&!a}function eP(e){let r,s,{worktree:n,allTags:i,onUpdate:l,onError:o,onManageTags:d,contentAlign:c="end",contentAlignOffset:u=0,trigger:g}=e,p=(0,A.useTranslations)("worktrees"),[m,v]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1),[y,S]=(0,a.useState)(!1),[T,N]=(0,a.useState)(!1),[D,E]=(0,a.useState)(null),[B,R]=(0,a.useState)(null),W=(0,a.useRef)(!1),L=(r=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id)))?e.overview.agents.flatMap(t=>t.agent.id===r.agent.id?[]:t.codebases.flatMap(a=>a.repository.id===e.group.repository.id?[{agentGroup:t,group:a}]:[])):[],_=(s=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id)))&&"ONLINE"===s.agent.connectionStatus&&s.agent.capabilities.includes("worktree.move.push")?"AVAILABLE"!==e.worktree.availability||e.worktree.activeJob||e.overview.activeMoves.some(t=>t.sourceCodebaseId===e.group.codebase.id||t.targetCodebaseId===e.group.codebase.id)?p("moveBlocked.busy"):e.worktree.branch&&e.worktree.headSha?e.worktree.hasStagedChanges||e.worktree.hasUnstagedChanges||"DIRTY"===e.worktree.pushStatus?p("moveBlocked.dirty"):"BEHIND"===e.worktree.pushStatus?p("moveBlocked.behind"):"DIVERGED"===e.worktree.pushStatus?p("moveBlocked.diverged"):"READY"!==e.worktree.pushStatus?p("moveBlocked.unknown"):L.some(t=>eL(t,e.overview))?null:p("moveBlocked.destination"):p("moveBlocked.detached"):p("moveBlocked.agent"),O=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id)),M=!O||"ONLINE"!==O.agent.connectionStatus||!O.agent.capabilities.includes("worktree.delete")||"AVAILABLE"!==n.availability||!!n.activeJob||e.overview.activeMoves.some(t=>t.sourceCodebaseId===e.group.codebase.id||t.targetCodebaseId===e.group.codebase.id),U=new Set(n.tags.map(e=>e.id)),F=async(e,t)=>{let a=t?[...U,e]:[...U].filter(t=>t!==e);try{let e=await (0,ee.controlPlaneRequest)(`mutation SetWorktreeTags($id: ID!, $tagIds: [ID!]!) { setWorktreeTags(id: $id, tagIds: $tagIds) { ${en.WORKTREE_FIELDS} } }`,{id:n.id,tagIds:a});l(e.setWorktreeTags),o(null)}catch(e){o(e instanceof Error?e.message:String(e))}},H=async e=>{try{let t=await (0,ee.controlPlaneRequest)(`mutation HighlightWorktree($id: ID!, $color: String) { updateWorktreeHighlight(id: $id, color: $color) { ${en.WORKTREE_FIELDS} } }`,{id:n.id,color:e});l(t.updateWorktreeHighlight),o(null)}catch(e){o(e instanceof Error?e.message:String(e))}},V=async(t,a=!1)=>{N(!0);try{let r=await (0,ee.controlPlaneRequest)(`mutation ChangeWorktreeBranch($input: ChangeWorktreeBranchInput!) {
|
|
58
|
-
changeWorktreeBranch(input: $input) { id }
|
|
59
|
-
}`,{input:{worktreeId:n.id,selection:t,requestId:(0,Z.createClientId)(),stashOnFailure:a}});await (0,el.waitForWorktreeJob)(r.changeWorktreeBranch.id),await e.onReload(),E(null),R(null),v(!1),o(null)}finally{N(!1)}},G=async()=>{if(D)try{R(null),await V(D,!0)}catch(e){R(e instanceof Error?e.message:String(e))}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(K.Popover,{onOpenChange:e=>{v(e),e||(E(null),R(null))},open:m,children:[(0,t.jsxs)(q.DropdownMenu,{children:[(0,t.jsx)(q.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(K.PopoverAnchor,{asChild:!0,children:g??(0,t.jsx)($.Button,{"aria-label":p("customize"),size:"icon-sm",variant:"ghost",children:(0,t.jsx)(x.MoreHorizontal,{})})})}),(0,t.jsxs)(q.DropdownMenuContent,{align:c,alignOffset:u,className:"w-72",onCloseAutoFocus:e=>{W.current&&(W.current=!1,e.preventDefault(),v(!0))},children:[L.length>0&&(0,t.jsxs)(q.DropdownMenuItem,{disabled:!!_,onSelect:()=>k(!0),title:_??void 0,children:[(0,t.jsx)(b.MoveRight,{})," ",p("moveToAgent")]}),(0,t.jsxs)(q.DropdownMenuItem,{disabled:!e.branchManagementEnabled||"AVAILABLE"!==n.availability||!!n.activeJob,onSelect:()=>{W.current=!0},children:[(0,t.jsx)(h.GitBranch,{})," ",p("changeBranch")]}),(0,t.jsx)(q.DropdownMenuSeparator,{}),(0,t.jsxs)(q.DropdownMenuLabel,{className:"flex items-center gap-1.5 leading-none",children:[(0,t.jsx)(C.Tags,{className:"size-3"}),(0,t.jsx)("span",{children:p("tags")})]}),i.map(e=>(0,t.jsxs)(q.DropdownMenuCheckboxItem,{checked:U.has(e.id),onCheckedChange:t=>void F(e.id,!!t),children:[(0,t.jsx)("span",{className:(0,et.cn)("size-3 rounded-full border",ej[e.color])})," ",e.name]},e.id)),(0,t.jsxs)(q.DropdownMenuItem,{onSelect:d,children:[(0,t.jsx)(f.Plus,{})," ",p("manageTags")]}),(0,t.jsx)(q.DropdownMenuSeparator,{}),(0,t.jsxs)(q.DropdownMenuLabel,{className:"flex items-center gap-1.5 leading-none",children:[(0,t.jsx)(j.Paintbrush,{className:"size-3"}),(0,t.jsx)("span",{children:p("highlight")})]}),(0,t.jsxs)(X.ToggleGroup,{"aria-label":p("highlight"),className:"grid grid-cols-7 gap-1 p-2",onClick:e=>e.stopPropagation(),onValueChange:e=>{e&&H("__none__"===e?null:e)},size:"sm",spacing:1,type:"single",value:n.highlightColor??"__none__",variant:"outline",children:[(0,t.jsx)(X.ToggleGroupItem,{"aria-label":p("clearHighlight"),className:"size-7 min-w-0 p-0",value:"__none__",children:(0,t.jsx)(I.Trash2,{className:"size-3"})}),ed.map(e=>(0,t.jsx)(X.ToggleGroupItem,{"aria-label":e,className:(0,et.cn)("size-7 min-w-0 p-0",ej[e],"data-[state=on]:ring-2 data-[state=on]:ring-foreground"),value:e},e))]}),!n.primary&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(q.DropdownMenuSeparator,{}),(0,t.jsxs)(q.DropdownMenuItem,{disabled:M,onSelect:()=>S(!0),variant:"destructive",children:[(0,t.jsx)(I.Trash2,{})," ",p("deleteWorktree")]})]})]})]}),(0,t.jsxs)(K.PopoverContent,{align:c,className:"z-60 w-[min(28rem,calc(100vw-2rem))]",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)("h3",{className:"font-semibold",children:p("changeBranch")}),(0,t.jsx)("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:ep(n.folder,e.baseRepoDirectory)})]}),(0,t.jsx)(er.WorktreeBranchForm,{busy:T,onSubmit:e=>V(e),onSubmitError:e=>{E(n.hasStagedChanges||n.hasUnstagedChanges?e:null)},recovery:D?(0,t.jsx)(P.Alert,{children:(0,t.jsxs)(P.AlertDescription,{className:"space-y-2",children:[(0,t.jsx)("p",{children:p("stashRetryHelp")}),B&&(0,t.jsx)("p",{className:"text-destructive",children:B}),(0,t.jsxs)($.Button,{disabled:T,onClick:()=>void G(),size:"sm",type:"button",variant:"outline",children:[T&&(0,t.jsx)(J.Spinner,{}),p("stashAndRetry")]})]})}):null,submitLabel:p("changeBranch"),target:ef(e.group,n)})]})]}),w&&(0,t.jsx)(e_,{onOpenChange:k,open:w,props:e,targets:L.filter(t=>eL(t,e.overview))}),!n.primary&&y&&(0,t.jsx)(e$,{onOpenChange:S,open:y,props:e})]})}function e_({props:e,targets:r,open:s,onOpenChange:n}){let i=(0,A.useTranslations)("worktrees"),l=1===r.length?r[0].group.codebase.id:"",[o,d]=(0,a.useState)(l),[c,u]=(0,a.useState)("__new__"),[h,g]=(0,a.useState)(!1),[p,m]=(0,a.useState)(!1),[x,b]=(0,a.useState)(null),[j,v]=(0,a.useState)(null),f=r.some(e=>e.group.codebase.id===o)?o:1===r.length?r[0].group.codebase.id:"",w=r.find(e=>e.group.codebase.id===f),k=r.map(e=>({value:e.group.codebase.id,label:`${e.agentGroup.agent.name} \xb7 ${e.group.repository.name}`,description:e.group.codebase.folder,keywords:`${e.agentGroup.agent.hostname} ${e.group.repository.displayOrigin}`})),y=w?.group.worktrees.find(e=>e.id===c),S=w?.group.worktrees.find(t=>t.branch===e.worktree.branch),C=!e.worktree.primary&&e.overview.agents.some(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id)&&t.agent.capabilities.includes("worktree.delete")),I=async t=>{if("AWAITING_STASH"===t.status){v(t),await e.onReload();return}if("FAILED"===t.status)throw Error(t.error||i("moveFailed"));if("CANCELLED"===t.status)throw Error(i("moveCancelled"));e.onError("SUCCEEDED_WITH_WARNING"===t.status?t.warning:null),await e.onReload(),e.onMoved?.(t),n(!1)},T=async()=>{if(w){m(!0),b(null);try{let t=await (0,ee.controlPlaneRequest)(`mutation MoveWorktree($input: MoveWorktreeInput!) {
|
|
60
|
-
moveWorktree(input: $input) {
|
|
61
|
-
id sourceWorktreeId sourceCodebaseId targetCodebaseId targetWorktreeId destinationMode
|
|
62
|
-
branch headSha deleteSource status sourceJobId targetJobId cleanupJobId error warning
|
|
63
|
-
createdAt updatedAt finishedAt
|
|
64
|
-
}
|
|
65
|
-
}`,{input:{sourceWorktreeId:e.worktree.id,targetCodebaseId:w.group.codebase.id,targetWorktreeId:"__new__"===c?null:c,deleteSource:h,requestId:(0,Z.createClientId)()}});await I(await (0,el.waitForWorktreeMove)(t.moveWorktree.id))}catch(e){b(e instanceof Error?e.message:String(e))}finally{m(!1)}}},N=async()=>{if(j){m(!0),b(null);try{await (0,ee.controlPlaneRequest)(`mutation RetryMove($id: ID!) {
|
|
66
|
-
retryWorktreeMoveWithStash(id: $id) { id status }
|
|
67
|
-
}`,{id:j.id}),await I(await (0,el.waitForWorktreeMove)(j.id))}catch(e){b(e instanceof Error?e.message:String(e))}finally{m(!1)}}},D=async()=>{if(j){m(!0);try{await (0,ee.controlPlaneRequest)(`mutation CancelMove($id: ID!) {
|
|
68
|
-
cancelWorktreeMove(id: $id) { id status }
|
|
69
|
-
}`,{id:j.id}),await e.onReload(),n(!1)}catch(e){b(e instanceof Error?e.message:String(e))}finally{m(!1)}}};return(0,t.jsx)(U.Dialog,{onOpenChange:e=>!p&&n(e),open:s,children:(0,t.jsxs)(U.DialogContent,{className:"sm:max-w-xl",children:[(0,t.jsxs)(U.DialogHeader,{children:[(0,t.jsx)(U.DialogTitle,{children:i("moveToAgent")}),(0,t.jsx)(U.DialogDescription,{children:i("moveDescription",{branch:e.worktree.branch??""})})]}),j?(0,t.jsx)(P.Alert,{children:(0,t.jsxs)(P.AlertDescription,{className:"space-y-3",children:[(0,t.jsx)("p",{children:j.error||i("moveNeedsStash")}),(0,t.jsx)("p",{className:"text-muted-foreground",children:i("moveStashHelp")})]})}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(G.Label,{className:"mb-1.5 block",children:i("destinationAgent")}),(0,t.jsx)(z.SearchableSelect,{ariaLabel:i("destinationAgent"),disabled:p,emptyMessage:i("noMoveDestinations"),onValueChange:e=>{d(e),u("__new__")},options:k,placeholder:i("selectDestinationAgent"),searchPlaceholder:i("searchDestinationAgents"),value:f})]}),w&&(0,t.jsxs)("div",{children:[(0,t.jsx)(G.Label,{className:"mb-1.5 block",children:i("destinationWorktree")}),(0,t.jsxs)(Y.Select,{disabled:p,onValueChange:u,value:c,children:[(0,t.jsx)(Y.SelectTrigger,{"aria-label":i("destinationWorktree"),children:(0,t.jsx)(Y.SelectValue,{})}),(0,t.jsxs)(Y.SelectContent,{children:[(0,t.jsx)(Y.SelectItem,{disabled:!!S,value:"__new__",children:i("createDestinationWorktree")}),w.group.worktrees.filter(e=>"AVAILABLE"===e.availability).map(e=>(0,t.jsxs)(Y.SelectItem,{disabled:!!S&&S.id!==e.id,value:e.id,children:[e.branch??i("detached")," ·"," ",e.relativePath]},e.id))]})]})]}),y&&(y.hasStagedChanges||y.hasUnstagedChanges)&&(0,t.jsx)(P.Alert,{children:(0,t.jsx)(P.AlertDescription,{children:i("dirtyDestinationWarning")})}),(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(M.Checkbox,{checked:h,disabled:!C||p,id:`delete-source-${e.worktree.id}`,onCheckedChange:e=>g(!!e)}),(0,t.jsxs)("div",{children:[(0,t.jsx)(G.Label,{htmlFor:`delete-source-${e.worktree.id}`,children:i("deleteOldWorktree")}),!C&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("deleteOldWorktreeDisabled")})]})]})]}),x&&(0,t.jsx)(P.Alert,{variant:"destructive",children:(0,t.jsx)(P.AlertDescription,{children:x})}),(0,t.jsxs)(U.DialogFooter,{children:[(0,t.jsx)($.Button,{disabled:p,onClick:()=>j?void D():n(!1),variant:"outline",children:j?i("cancelMove"):i("cancel")}),(0,t.jsxs)($.Button,{disabled:p||!j&&!w,onClick:()=>j?void N():void T(),children:[p&&(0,t.jsx)(J.Spinner,{}),j?i("stashAndContinue"):i("moveWorktree")]})]})]})})}function e$({props:e,open:r,onOpenChange:s}){let n=(0,A.useTranslations)("worktrees"),[i,l]=(0,a.useState)(!1),[o,d]=(0,a.useState)(!1),[c,u]=(0,a.useState)(null),h=!!(e.worktree.branch&&(e.group.codebase.remoteBranches.includes(e.worktree.branch)||e.worktree.upstream===`origin/${e.worktree.branch}`)),g=e.worktree.branch===e.group.codebase.defaultBranch,p=async()=>{d(!0),u(null);try{let t=await (0,ee.controlPlaneRequest)(`mutation DeleteWorktree($input: DeleteWorktreeInput!) {
|
|
70
|
-
deleteWorktree(input: $input) { id }
|
|
71
|
-
}`,{input:{worktreeId:e.worktree.id,deleteRemoteBranch:i,requestId:(0,Z.createClientId)()}});await (0,el.waitForWorktreeJob)(t.deleteWorktree.id),await e.onReload(),e.onError(null),e.onDeleted?.(),s(!1)}catch(e){u(e instanceof Error?e.message:String(e))}finally{d(!1)}};return(0,t.jsx)(U.Dialog,{onOpenChange:e=>!o&&s(e),open:r,children:(0,t.jsxs)(U.DialogContent,{children:[(0,t.jsxs)(U.DialogHeader,{children:[(0,t.jsx)(U.DialogTitle,{children:n("deleteWorktree")}),(0,t.jsx)(U.DialogDescription,{children:n("deleteWorktreeDescription",{path:ep(e.worktree.folder,e.baseRepoDirectory)})})]}),(0,t.jsx)(P.Alert,{variant:"destructive",children:(0,t.jsx)(P.AlertDescription,{children:n("deleteWorktreeWarning")})}),h&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(M.Checkbox,{checked:i,disabled:o||g,id:`delete-remote-${e.worktree.id}`,onCheckedChange:e=>l(!!e)}),(0,t.jsxs)("div",{children:[(0,t.jsx)(G.Label,{htmlFor:`delete-remote-${e.worktree.id}`,children:n("deleteRemoteBranch",{branch:e.worktree.branch??""})}),g&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n("defaultRemoteProtected")})]})]}),c&&(0,t.jsx)(P.Alert,{variant:"destructive",children:(0,t.jsx)(P.AlertDescription,{children:c})}),(0,t.jsxs)(U.DialogFooter,{children:[(0,t.jsx)($.Button,{disabled:o,onClick:()=>s(!1),variant:"outline",children:n("cancel")}),(0,t.jsxs)($.Button,{disabled:o,onClick:()=>void p(),variant:"destructive",children:[o&&(0,t.jsx)(J.Spinner,{}),n("deleteWorktree")]})]})]})})}function eO(e){let{worktree:a,editorVariant:s}=e,n=(0,A.useTranslations)("worktrees"),i="AVAILABLE"!==a.availability||!!a.activeJob,o=em(a),d=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id))?.agent,u="AVAILABLE"!==a.availability||!d||"ONLINE"!==d.connectionStatus||!d.capabilities.includes("ios.build.run")||!1===e.group.iosBuildConfigured;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(E.StartBuildButton,{codebaseId:e.group.codebase.id,disabled:u,disabledReason:d&&"ONLINE"===d.connectionStatus?d.capabilities.includes("ios.build.run")?!1===e.group.iosBuildConfigured?n("iosBuildNotConfigured"):"AVAILABLE"!==a.availability?n("worktreeUnavailable"):null:n("agentUnsupported"):n("agentOffline"),worktreeId:a.id}),a.pullRequest&&(0,t.jsx)(B.MergePullRequestButton,{onMerged:e.onCompleted,pullRequest:a.pullRequest}),"NONE"!==s&&(0,t.jsx)(eM,{icon:(0,t.jsx)(c.Code2,{}),label:n("CODE_INSIDERS"===s?"openInsiders":"openCode"),operation:"OPEN_EDITOR",props:e}),(0,t.jsx)(eM,{confirm:!0,icon:(0,t.jsx)(T.Upload,{}),label:n("forcePush"),operation:"FORCE_PUSH",props:e,disabled:i||!a.upstream}),(0,t.jsx)(eM,{confirm:!0,icon:(0,t.jsx)(w.RefreshCw,{}),label:n("sync"),operation:"SYNC",props:e,disabled:i||!a.upstream||!a.baseBranch||0===a.baseBehind}),(0,t.jsx)(eM,{icon:(0,t.jsx)(T.Upload,{}),label:n(a.upstream?"push":"publish"),operation:"PUSH",props:e,disabled:i||!a.branch}),(0,t.jsx)(eM,{confirm:!0,icon:(0,t.jsx)(k.RotateCcw,{}),label:n("reset"),operation:"RESET",props:e,disabled:i||!a.upstream}),(0,t.jsx)(eM,{icon:(0,t.jsx)(r.Archive,{}),label:n("stashAll"),operation:"STASH_ALL",props:e,disabled:i||!o.hasChanges}),(0,t.jsx)(eM,{icon:(0,t.jsx)(l.Check,{}),label:n("UNSTAGE_ALL"===o.stageOperation?"unstageAll":"stageAll"),operation:o.stageOperation,props:e,disabled:i||!o.hasChanges}),a.activeJob&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(J.Spinner,{})," ",n("operationRunning")]})]})}function eM({props:e,operation:r,label:s,icon:n,confirm:i=!1,disabled:o=!1}){let d=(0,A.useTranslations)("worktrees"),[c,u]=(0,a.useState)(!1),[h,g]=(0,a.useState)(!1),p=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>{p.current&&window.clearTimeout(p.current)},[]);let m=async()=>{if(i&&!c){u(!0),p.current=window.setTimeout(()=>u(!1),5e3);return}g(!0),u(!1);try{let t=await (0,ee.controlPlaneRequest)("mutation RunWorktreeOperation($input: RunWorktreeOperationInput!) { runWorktreeOperation(input: $input) { id } }",{input:{worktreeId:e.worktree.id,operation:r,requestId:(0,Z.createClientId)()}});e.onError(null),await e.onCompleted(),await (0,el.waitForWorktreeJob)(t.runWorktreeOperation.id),await e.onCompleted()}catch(t){e.onError(t instanceof Error?t.message:String(t))}finally{g(!1)}};return(0,t.jsxs)($.Button,{disabled:o||h,onClick:()=>void m(),size:"sm",variant:c?"destructive":"outline",children:[h?(0,t.jsx)(J.Spinner,{}):c?(0,t.jsx)(l.Check,{}):n," ",c?d("confirmAction"):s]})}function eU(e){let r=(0,A.useTranslations)("worktrees");return(0,t.jsx)("div",{className:"rounded-xl border",children:(0,t.jsxs)(Q.Table,{children:[(0,t.jsx)(Q.TableHeader,{children:(0,t.jsxs)(Q.TableRow,{children:[(0,t.jsx)(Q.TableHead,{children:r("branch")}),(0,t.jsx)(Q.TableHead,{children:r("path")}),(0,t.jsx)(Q.TableHead,{children:r("baseBranch")}),(0,t.jsx)(Q.TableHead,{children:r("upToDate")}),(0,t.jsx)(Q.TableHead,{children:r("tags")}),(0,t.jsx)(Q.TableHead,{children:r("pullRequest")}),(0,t.jsx)(Q.TableHead,{children:r("origin")}),(0,t.jsx)(Q.TableHead,{})]})}),(0,t.jsx)(Q.TableBody,{children:e.group.worktrees.map(t=>(0,a.createElement)(eq,{...e,key:t.id,worktree:t}))})]})})}function eq(e){let{baseRepoDirectory:r,inspectionRefreshToken:s,onError:n}=e,{worktree:i,applyActivity:l,setUnstagedChanges:c}=(0,ei.useLiveWorktree)(e.worktree),u={...e,worktree:i},h=(0,A.useTranslations)("worktrees"),g=(0,ea.useRouter)(),[p,m]=(0,a.useState)(!1),[x,b]=(0,a.useState)(null),[j,v]=(0,a.useState)(!1),f=(0,a.useRef)(0),w=(0,a.useRef)(s),k=(0,a.useCallback)(async()=>{let e=++f.current;v(!0);try{let t=await (0,ei.inspectWorktree)(i.id);if(e!==f.current)return;b(t),c(t.changes.some(e=>e.unstaged||e.untracked||e.conflicted)),n(null)}catch(t){e===f.current&&n(t instanceof Error?t.message:String(t))}finally{e===f.current&&v(!1)}},[n,c,i.id]),y=(0,ei.useQueuedWorktreeInspection)(k),S=(0,a.useCallback)(e=>{l(e),p&&y()},[l,p,y]);(0,ei.useWorktreeActivitySubscription)(i.id,e.liveUpdatesEnabled&&"AVAILABLE"===i.availability,S),(0,a.useEffect)(()=>{if(w.current===s||(w.current=s,!p))return;let e=window.setTimeout(()=>void y(),0);return()=>window.clearTimeout(e)},[p,s,y]);let C=()=>{let e=!p;m(e),e&&!x&&y()},I=i.highlightColor&&ex[i.highlightColor];return(0,t.jsxs)(a.Fragment,{children:[(0,t.jsxs)(Q.TableRow,{className:(0,et.cn)("cursor-pointer transition-colors hover:bg-muted/50",I),onClick:e=>{(0,eo.shouldNavigateWorktreeSurface)(e)&&g.push((0,eo.worktreeDetailHref)(i.id))},children:[(0,t.jsxs)(Q.TableCell,{children:[(0,t.jsxs)($.Button,{"aria-expanded":p,className:"max-w-full px-0 font-mono",onClick:()=>void C(),variant:"ghost",children:[p?(0,t.jsx)(o.ChevronDown,{}):(0,t.jsx)(d.ChevronRight,{}),(0,t.jsx)("span",{className:"truncate",children:i.branch??h("detached")})]}),(i.ticketKey||i.ticketTitle)&&(0,t.jsx)(eI,{...u,compact:!0})]}),(0,t.jsx)(Q.TableCell,{className:"font-mono text-xs",children:ep(i.folder,r)}),(0,t.jsx)(Q.TableCell,{children:(0,t.jsx)(eW,{...u,compact:!0})}),(0,t.jsx)(Q.TableCell,{children:(0,t.jsx)(eD,{worktree:i})}),(0,t.jsx)(Q.TableCell,{children:(0,t.jsx)(eA,{...u,compact:!0})}),(0,t.jsx)(Q.TableCell,{children:(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:(0,t.jsx)(eE,{detailsExpanded:p,onToggleDetails:C,worktree:i})})}),(0,t.jsx)(Q.TableCell,{children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,t.jsx)(eR,{worktree:i}),i.hasUnstagedChanges&&(0,t.jsx)(_.Badge,{variant:"destructive",children:h("dirty")})]})}),(0,t.jsx)(Q.TableCell,{children:(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,t.jsx)(eC,{worktree:i}),(0,t.jsx)(eP,{...u})]})})]}),(0,t.jsx)(Q.TableRow,{className:(0,et.cn)(I),children:(0,t.jsx)(Q.TableCell,{colSpan:8,children:(0,t.jsx)(eO,{...u,onCompleted:async()=>{await e.onReload(),p&&await y()}})})}),p&&(0,t.jsx)(Q.TableRow,{className:(0,et.cn)(I),children:(0,t.jsx)(Q.TableCell,{colSpan:8,children:j&&!x?(0,t.jsx)(J.Spinner,{}):x?(0,t.jsx)(es.WorktreeDetailPanel,{detail:x,inline:!0}):null})})]})}function eF({tag:e}){return(0,t.jsx)(_.Badge,{className:eb[e.color],children:e.name})}function eH({label:e,value:a,mono:r=!1}){return(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e}),(0,t.jsx)("p",{className:(0,et.cn)("flex min-h-6 items-center truncate",r&&"font-mono text-xs"),title:a,children:a})]})}function eV({open:e,onOpenChange:r,tags:s,onChanged:n}){let i=(0,A.useTranslations)("worktrees"),[l,o]=(0,a.useState)(null),[d,c]=(0,a.useState)(""),[u,h]=(0,a.useState)("blue"),[g,p]=(0,a.useState)(null),m=async e=>{e.preventDefault();try{await (0,ee.controlPlaneRequest)("mutation SaveTag($input: SaveWorktreeTagInput!) { saveWorktreeTag(input: $input) { id } }",{input:{id:l?.id??null,name:d,color:u}}),o(null),c(""),h("blue"),p(null),await n()}catch(e){p(e instanceof Error?e.message:String(e))}},x=async e=>{try{await (0,ee.controlPlaneRequest)("mutation DeleteTag($id: ID!) { deleteWorktreeTag(id: $id) }",{id:e}),await n()}catch(e){p(e instanceof Error?e.message:String(e))}};return(0,t.jsx)(U.Dialog,{onOpenChange:r,open:e,children:(0,t.jsxs)(U.DialogContent,{children:[(0,t.jsxs)(U.DialogHeader,{children:[(0,t.jsx)(U.DialogTitle,{children:i("manageTags")}),(0,t.jsx)(U.DialogDescription,{children:i("manageTagsDescription")})]}),g&&(0,t.jsx)(P.Alert,{variant:"destructive",children:(0,t.jsx)(P.AlertDescription,{children:g})}),(0,t.jsx)(V.ItemGroup,{className:"gap-2",children:s.map(e=>(0,t.jsxs)(V.Item,{size:"sm",variant:"outline",children:[(0,t.jsx)(V.ItemContent,{children:(0,t.jsx)(V.ItemTitle,{children:(0,t.jsx)(eF,{tag:e})})}),(0,t.jsxs)(V.ItemActions,{children:[(0,t.jsx)($.Button,{onClick:()=>{o(e),c(e.name),h(e.color)},size:"sm",variant:"outline",children:i("edit")}),(0,t.jsx)($.Button,{onClick:()=>void x(e.id),size:"icon-sm",variant:"destructive",children:(0,t.jsx)(I.Trash2,{})})]})]},e.id))}),(0,t.jsxs)("form",{className:"space-y-3 border-t pt-3",onSubmit:m,children:[(0,t.jsx)(G.Label,{htmlFor:"tag-name",children:l?i("editTag"):i("createTag")}),(0,t.jsx)(H.Input,{id:"tag-name",maxLength:40,onChange:e=>c(e.target.value),required:!0,value:d}),(0,t.jsx)(X.ToggleGroup,{"aria-label":i("highlight"),className:"grid grid-cols-12 gap-1",onValueChange:e=>{e&&h(e)},size:"sm",spacing:1,type:"single",value:u,variant:"outline",children:ed.map(e=>(0,t.jsx)(X.ToggleGroupItem,{"aria-label":e,className:(0,et.cn)("size-7 min-w-0 p-0",ej[e],"data-[state=on]:ring-2 data-[state=on]:ring-foreground"),value:e},e))}),(0,t.jsx)(U.DialogFooter,{children:(0,t.jsxs)($.Button,{type:"submit",children:[(0,t.jsx)(y.Save,{})," ",i("saveTag")]})})]})]})})}function eG({open:e,onOpenChange:s,onChanged:n}){let i=(0,A.useTranslations)("worktrees"),[l,o]=(0,a.useState)([]),[d,c]=(0,a.useState)(null),u=(0,a.useCallback)(async()=>{try{let e=await (0,ee.controlPlaneRequest)(`query HiddenWorktrees { hiddenWorktrees { ${en.WORKTREE_FIELDS} } }`);o(e.hiddenWorktrees),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}},[]);(0,a.useEffect)(()=>{if(!e)return;let t=window.setTimeout(()=>void u(),0);return()=>window.clearTimeout(t)},[e,u]);let g=async e=>{try{await (0,ee.controlPlaneRequest)(e?"mutation PurgeHidden($id: ID!) { purgeHiddenWorktree(id: $id) }":"mutation PurgeAllHidden { purgeAllHiddenWorktrees }",e?{id:e}:void 0),await u(),await n()}catch(e){c(e instanceof Error?e.message:String(e))}};return(0,t.jsx)(U.Dialog,{onOpenChange:s,open:e,children:(0,t.jsxs)(U.DialogContent,{className:"sm:max-w-3xl",children:[(0,t.jsxs)(U.DialogHeader,{children:[(0,t.jsx)(U.DialogTitle,{children:i("hiddenTitle")}),(0,t.jsx)(U.DialogDescription,{children:i("hiddenDescription")})]}),d&&(0,t.jsx)(P.Alert,{variant:"destructive",children:(0,t.jsx)(P.AlertDescription,{children:d})}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto",children:l.length?(0,t.jsx)(V.ItemGroup,{className:"gap-2",children:l.map(e=>(0,t.jsxs)(V.Item,{variant:"outline",children:[(0,t.jsx)(V.ItemMedia,{variant:"icon",children:(0,t.jsx)(h.GitBranch,{})}),(0,t.jsxs)(V.ItemContent,{className:"min-w-0",children:[(0,t.jsx)(V.ItemTitle,{className:"font-mono",children:e.branch??i("detached")}),(0,t.jsx)(V.ItemDescription,{className:"truncate",title:e.folder,children:e.folder})]}),(0,t.jsx)(V.ItemActions,{children:(0,t.jsxs)($.Button,{onClick:()=>void g(e.id),size:"sm",variant:"destructive",children:[(0,t.jsx)(I.Trash2,{})," ",i("purge")]})})]},e.id))}):(0,t.jsx)(F.Empty,{className:"border-0 py-8",children:(0,t.jsxs)(F.EmptyHeader,{children:[(0,t.jsx)(F.EmptyMedia,{variant:"icon",children:(0,t.jsx)(r.Archive,{})}),(0,t.jsx)(F.EmptyTitle,{children:i("noHidden")})]})})}),(0,t.jsx)(U.DialogFooter,{children:l.length>0&&(0,t.jsxs)($.Button,{onClick:()=>void g(),variant:"destructive",children:[(0,t.jsx)(I.Trash2,{})," ",i("purgeAll")]})})]})})}e.s(["ActionRow",0,eO,"BaseBranchControl",0,eW,"BaseFreshnessBadge",0,eD,"OriginStatusBadges",0,eR,"PullRequestBadges",0,eE,"TagManagerDialog",0,eV,"WorktreeMenus",0,eP,"WorktreeMetadata",0,eT,"WorktreeTagsMenu",0,eA,"WorktreeTicketLink",0,eI,"WorktreesPage",0,function(){let e=(0,A.useTranslations)("worktrees"),[s,n]=(0,a.useState)(()=>new URLSearchParams(window.location.search).get("issue")),[i,l]=(0,a.useState)(null),[o,d]=(0,a.useState)(()=>"table"===window.localStorage.getItem(ec)?"table":"cards"),[c,u]=(0,a.useState)(!0),[g,x]=(0,a.useState)(!1),[b,j]=(0,a.useState)(null),[v,f]=(0,a.useState)(null),[k,y]=(0,a.useState)(0),[C,I]=(0,a.useState)(!1),[N,E]=(0,a.useState)(!1),[B,R]=(0,a.useState)(""),[W,_]=(0,a.useState)(eu),[O,M]=(0,a.useState)(eu),U=(0,a.useRef)(0),q=(0,a.useCallback)(async()=>{let e=++U.current;try{let t=await (0,ee.controlPlaneRequest)(`query WorktreeOverview {
|
|
72
|
-
worktreeOverview {
|
|
73
|
-
hiddenCount
|
|
74
|
-
settings { editorVariant updatedAt }
|
|
75
|
-
tags { id name color createdAt updatedAt }
|
|
76
|
-
activeMoves {
|
|
77
|
-
id sourceWorktreeId sourceCodebaseId targetCodebaseId targetWorktreeId destinationMode
|
|
78
|
-
branch headSha deleteSource status sourceJobId targetJobId cleanupJobId error warning
|
|
79
|
-
createdAt updatedAt finishedAt
|
|
80
|
-
}
|
|
81
|
-
agents {
|
|
82
|
-
agent { ${D.AGENT_FIELDS} }
|
|
83
|
-
codebases {
|
|
84
|
-
iosBuildConfigured
|
|
85
|
-
repository { id canonicalOrigin displayOrigin name description jiraBranchRegex keepBaseBranchUpToDate createdAt updatedAt }
|
|
86
|
-
codebase { ${en.CODEBASE_FIELDS} }
|
|
87
|
-
worktrees { ${en.WORKTREE_FIELDS} }
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}`);if(e!==U.current)return;l(t.worktreeOverview),j(null)}catch(t){e===U.current&&j(t instanceof Error?t.message:String(t))}finally{e===U.current&&u(!1)}},[]);(0,a.useEffect)(()=>{let e=window.setTimeout(()=>void q(),0),t=window.setInterval(()=>void q(),3e4),a=(0,ee.controlPlaneSubscriptions)().subscribe({query:"subscription WorktreesChanged { worktreeOverviewChanged { worktreeId codebaseId } }"},{next:()=>void q(),error:()=>void 0,complete:()=>void 0});return()=>{window.clearTimeout(e),window.clearInterval(t),U.current+=1,a()}},[q]),(0,a.useEffect)(()=>{let e=()=>n(new URLSearchParams(window.location.search).get("issue"));return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]);let V=e=>{let t,a;t=new URLSearchParams(window.location.search),e?t.set("issue",e):t.delete("issue"),a=t.toString(),window.history.pushState(null,"",`${window.location.pathname}${a?`?${a}`:""}`),n(e)},G=async()=>{u(!0),x(!0);try{await (0,ee.controlPlaneRequest)(`mutation RefreshWorktrees {
|
|
92
|
-
refreshWorktrees
|
|
93
|
-
}`),await q(),y(e=>e+1),j(null)}catch(e){j(e instanceof Error?e.message:String(e))}finally{x(!1),u(!1)}},K=async()=>{let t=i?.agents.flatMap(e=>e.codebases.map(e=>e.codebase.id))??[];if(t.length){x(!0);try{await (0,ee.controlPlaneRequest)(`mutation FetchWorktreeCodebases($input: RunCodebaseOperationInput!) {
|
|
94
|
-
fetchCodebases(input: $input) { jobs { id } skipped { codebaseId reason } }
|
|
95
|
-
}`,{input:{codebaseIds:t,requestId:(0,Z.createClientId)()}}),f(e("fetchStarted")),j(null),await q()}catch(e){j(e instanceof Error?e.message:String(e)),f(null)}finally{x(!1)}}},z=e=>{l(t=>t?{...t,agents:t.agents.map(t=>({...t,codebases:t.codebases.map(t=>({...t,worktrees:t.worktrees.map(t=>t.id===e.id?{...t,...e,ticketKey:e.ticketKey??t.ticketKey,ticketTitle:e.ticketTitle??t.ticketTitle,ticketStatus:e.ticketStatus??t.ticketStatus,pullRequest:e.pullRequest??t.pullRequest}:t)}))}))}:t)},Q=(0,a.useMemo)(()=>{let e=new Map;return i?.agents.forEach(t=>t.codebases.forEach(t=>e.set(t.repository.id,{id:t.repository.id,name:t.repository.name}))),[...e.values()].sort((e,t)=>e.name.localeCompare(t.name))},[i]),et=(0,a.useMemo)(()=>eg(i?.agents??[],{query:B,agentId:W===eu?null:W,repositoryId:O===eu?null:O}),[W,i,B,O]),ea=!!B.trim()||W!==eu||O!==eu;return(0,t.jsxs)("section",{className:"flex w-full flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:e("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e("description")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)($.Button,{disabled:g,onClick:()=>void G(),variant:"outline",children:[(0,t.jsx)(w.RefreshCw,{className:c?"animate-spin":void 0})," ",e("refresh")]}),(0,t.jsxs)($.Button,{disabled:g||!i?.agents.length,onClick:()=>void K(),variant:"outline",children:[(0,t.jsx)(T.Upload,{})," ",e("fetchNow")]}),(0,t.jsxs)($.Button,{onClick:()=>E(!0),variant:"outline",children:[(0,t.jsx)(r.Archive,{})," ",e("hidden",{count:i?.hiddenCount??0})]}),(0,t.jsxs)(X.ToggleGroup,{"aria-label":`${e("cards")} / ${e("table")}`,onValueChange:e=>{("cards"===e||"table"===e)&&(d(e),window.localStorage.setItem(ec,e))},size:"sm",spacing:0,type:"single",value:o,variant:"outline",children:[(0,t.jsx)(X.ToggleGroupItem,{"aria-label":e("cards"),className:"px-2",value:"cards",children:(0,t.jsx)(p.Grid2X2,{})}),(0,t.jsx)(X.ToggleGroupItem,{"aria-label":e("table"),className:"px-2",value:"table",children:(0,t.jsx)(m.List,{})})]})]})]}),b&&(0,t.jsx)(P.Alert,{variant:"destructive",children:(0,t.jsx)(P.AlertDescription,{children:b})}),v&&(0,t.jsx)(P.Alert,{children:(0,t.jsx)(P.AlertDescription,{children:v})}),i&&i.agents.length>0&&(0,t.jsxs)("div",{"aria-label":e("filters"),className:"flex flex-wrap gap-2",role:"search",children:[(0,t.jsxs)("div",{className:"relative min-w-0 flex-[2_1_18rem]",children:[(0,t.jsx)(S.Search,{className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(H.Input,{"aria-label":e("searchWorktrees"),className:"pl-9",onChange:e=>R(e.target.value),placeholder:e("searchWorktreesPlaceholder"),type:"search",value:B})]}),(0,t.jsx)("div",{className:"min-w-0 flex-[1_1_12rem]",children:(0,t.jsxs)(Y.Select,{onValueChange:_,value:W,children:[(0,t.jsx)(Y.SelectTrigger,{"aria-label":e("filterByAgent"),className:"w-full",children:(0,t.jsx)(Y.SelectValue,{})}),(0,t.jsxs)(Y.SelectContent,{children:[(0,t.jsx)(Y.SelectItem,{value:eu,children:e("allAgents")}),i.agents.map(e=>(0,t.jsx)(Y.SelectItem,{value:e.agent.id,children:e.agent.name},e.agent.id))]})]})}),(0,t.jsx)("div",{className:"min-w-0 flex-[1_1_12rem]",children:(0,t.jsxs)(Y.Select,{onValueChange:M,value:O,children:[(0,t.jsx)(Y.SelectTrigger,{"aria-label":e("filterByRepository"),className:"w-full",children:(0,t.jsx)(Y.SelectValue,{})}),(0,t.jsxs)(Y.SelectContent,{children:[(0,t.jsx)(Y.SelectItem,{value:eu,children:e("allRepositories")}),Q.map(e=>(0,t.jsx)(Y.SelectItem,{value:e.id,children:e.name},e.id))]})]})})]}),i&&i.activeMoves.length>0&&(0,t.jsx)(ev,{moves:i.activeMoves,onError:j,onNotice:f,onReload:q}),i&&(0,t.jsx)(ew,{onCreated:async()=>{await q(),f(e("worktreeCreated"))},overview:i}),c&&!i?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(J.Spinner,{})," ",e("loading")]}):i?.agents.length?ea&&0===et.length?(0,t.jsx)(F.Empty,{className:"border py-12",children:(0,t.jsxs)(F.EmptyHeader,{children:[(0,t.jsx)(F.EmptyMedia,{variant:"icon",children:(0,t.jsx)(S.Search,{})}),(0,t.jsx)(F.EmptyTitle,{children:e("noMatchingWorktrees")}),(0,t.jsx)(F.EmptyDescription,{children:e("noMatchingWorktreesDescription")})]})}):et.map(e=>(0,t.jsx)(ek,{agentGroup:e,allTags:i.tags,editorVariant:i.settings.editorVariant,inspectionRefreshToken:k,layout:o,onError:j,onManageTags:()=>I(!0),onOpenTicket:e=>V(e),onReload:q,onUpdate:z,overview:i},e.agent.id)):(0,t.jsx)(F.Empty,{className:"border py-12",children:(0,t.jsxs)(F.EmptyHeader,{children:[(0,t.jsx)(F.EmptyMedia,{variant:"icon",children:(0,t.jsx)(h.GitBranch,{})}),(0,t.jsx)(F.EmptyTitle,{children:e("emptyTitle")}),(0,t.jsx)(F.EmptyDescription,{children:e("emptyDescription")})]})}),(0,t.jsx)(eV,{onChanged:q,onOpenChange:I,open:C,tags:i?.tags??[]}),(0,t.jsx)(eG,{onChanged:q,onOpenChange:E,open:N}),(0,t.jsx)(L.JiraTicketDrawer,{issueKey:s,onClose:()=>V(null)})]})},"displayedWorktreePath",0,ep,"filterWorktreeAgentGroups",0,eg,"worktreeChangeActionState",0,em])}]);
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,648119,e=>{"use strict";var t=e.i(560972);e.s(["MoreHorizontal",()=>t.default])},630299,e=>{"use strict";let t=(0,e.i(456420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,t])},784774,e=>{"use strict";var t=e.i(843476),r=e.i(975157);e.s(["Table",0,function({className:e,containerClassName:s,...n}){return(0,t.jsx)("div",{className:(0,r.cn)("w-full overflow-x-auto",s),children:(0,t.jsx)("table",{className:(0,r.cn)("w-full caption-bottom text-sm",e),...n})})},"TableBody",0,function({className:e,...s}){return(0,t.jsx)("tbody",{className:(0,r.cn)("divide-y",e),...s})},"TableCell",0,function({className:e,...s}){return(0,t.jsx)("td",{className:(0,r.cn)("whitespace-nowrap px-3 py-3 align-middle",e),...s})},"TableFooter",0,function({className:e,...s}){return(0,t.jsx)("tfoot",{className:(0,r.cn)("border-t bg-muted/50 font-medium",e),...s})},"TableHead",0,function({className:e,...s}){return(0,t.jsx)("th",{className:(0,r.cn)("h-10 whitespace-nowrap px-3 text-left align-middle text-xs font-medium text-muted-foreground",e),...s})},"TableHeader",0,function({className:e,...s}){return(0,t.jsx)("thead",{className:(0,r.cn)("border-b",e),...s})},"TableRow",0,function({className:e,...s}){return(0,t.jsx)("tr",{className:(0,r.cn)("transition-colors hover:bg-muted/40",e),...s})}])},689664,e=>{"use strict";var t=e.i(643957);e.s(["Check",()=>t.default])},508734,e=>{"use strict";let t=(0,e.i(456420).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],508734)},986253,e=>{"use strict";let t=(0,e.i(456420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",0,t])},716327,e=>{"use strict";var t=e.i(26495);e.s(["ChevronDown",()=>t.default])},867927,e=>{"use strict";var t=e.i(986253);e.s(["ChevronRight",()=>t.default])},940276,e=>{"use strict";e.s(["findWorktreeOverviewEntry",0,function(e,t){for(let r of e.agents)for(let e of r.codebases){let s=e.worktrees.find(e=>e.id===t);if(s)return{agentGroup:r,group:e,worktree:s}}return null},"shouldNavigateWorktreeSurface",0,function(e){if(e.defaultPrevented||0!==e.button)return!1;let t=e.target;return t instanceof Element&&!!e.currentTarget.contains(t)&&!t.closest("a,button,input,select,textarea,[role='button'],[role='link'],[role='menuitem'],[data-worktree-navigation-ignore]")},"worktreeDetailHref",0,function(e){return`/worktrees/${encodeURIComponent(e)}`}])},487179,e=>{"use strict";var t=e.i(843476),r=e.i(716327),s=e.i(867927),n=e.i(482022),a=e.i(269846),i=e.i(648119),l=e.i(966473),o=e.i(741120),d=e.i(395925),c=e.i(861745),u=e.i(948148),m=e.i(618566),h=e.i(271645),p=e.i(647776),x=e.i(948812),b=e.i(356505),f=e.i(929592),j=e.i(487486),g=e.i(519455),y=e.i(755146),w=e.i(82612),v=e.i(337355),R=e.i(987968),N=e.i(784774),k=e.i(520133),S=e.i(637611),T=e.i(940276);function C(e){return`${e.codebaseRepositoryId}:${e.id}`}function I(e){let t=new URLSearchParams(window.location.search);e?t.set("issue",e):t.delete("issue");let r=t.toString();window.history.pushState(null,"",`${window.location.pathname}${r?`?${r}`:""}`)}function E({runs:e,expandedRuns:a,jobStates:i,onToggleRun:l,onLoadJobs:o,onRunRetried:d,onJobRetried:m,onError:b}){let f=(0,u.useTranslations)("actionsPage"),y=(0,u.useTranslations)("pullRequests"),w=(0,c.useLocale)(),v=(0,h.useMemo)(()=>{let t=new Map,r=new Intl.DateTimeFormat(w,{dateStyle:"full"});for(let s of e){let e=new Date(s.createdAt),n=`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`,a=t.get(n)??{label:r.format(e),items:[]};a.items.push(s),t.set(n,a)}return[...t.entries()].map(([e,t])=>({key:e,...t}))},[w,e]);return(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border",children:(0,t.jsxs)(N.Table,{children:[(0,t.jsx)(N.TableHeader,{children:(0,t.jsxs)(N.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(N.TableHead,{className:"w-10",children:(0,t.jsx)("span",{className:"sr-only",children:f("expand")})}),(0,t.jsxs)(N.TableHead,{children:[f("workflowRun")," / ",f("repository")]}),(0,t.jsx)(N.TableHead,{children:f("trigger")}),(0,t.jsx)(N.TableHead,{children:f("status")}),(0,t.jsx)(N.TableHead,{children:f("pullRequest")}),(0,t.jsx)(N.TableHead,{children:f("ticket")}),(0,t.jsx)(N.TableHead,{children:f("started")}),(0,t.jsx)(N.TableHead,{className:"text-right",children:f("actions")})]})}),(0,t.jsx)(N.TableBody,{children:v.map(e=>(0,t.jsxs)(h.Fragment,{children:[(0,t.jsx)(N.TableRow,{className:"bg-muted/20 hover:bg-muted/20",children:(0,t.jsx)(N.TableCell,{className:"py-1.5 text-xs font-normal text-muted-foreground",colSpan:8,children:e.label})}),e.items.map(e=>{let c=C(e),u=a.has(c),v=i[c];return(0,t.jsxs)(h.Fragment,{children:[(0,t.jsxs)(N.TableRow,{className:"cursor-pointer",onClick:t=>{(function(e){if(e.defaultPrevented||0!==e.button)return!1;let t=e.target;return t instanceof Element&&!!e.currentTarget.contains(t)&&!t.closest("a, button, input, select, textarea, [role='button'], [role='link'], [role='menuitem']")})(t)&&l(e)},children:[(0,t.jsx)(N.TableCell,{className:"pr-0",children:(0,t.jsx)(g.Button,{"aria-expanded":u,"aria-label":f(u?"hideJobs":"showJobs",{run:e.displayTitle}),onClick:()=>l(e),size:"icon-sm",variant:"ghost",children:u?(0,t.jsx)(r.ChevronDown,{}):(0,t.jsx)(s.ChevronRight,{})})}),(0,t.jsx)(N.TableCell,{className:"min-w-72 whitespace-normal",children:(0,t.jsxs)("a",{className:"block rounded-md px-2 py-1.5 transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",href:e.url,rel:"noreferrer",target:"_blank",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 font-medium text-primary",children:[e.name,(0,t.jsx)(n.ExternalLink,{className:"size-3.5 shrink-0"})]}),(0,t.jsx)("span",{className:"mt-0.5 block text-sm text-foreground",children:e.displayTitle}),(0,t.jsxs)("span",{className:"mt-1 block text-xs text-muted-foreground",children:[e.repositoryNameWithOwner," ·"," ",f("runNumber",{number:e.runNumber}),e.runAttempt>1?` \xb7 ${f("attempt",{attempt:e.runAttempt})}`:""]})]})}),(0,t.jsxs)(N.TableCell,{className:"min-w-48 whitespace-normal",children:[(0,t.jsx)("p",{children:e.event}),(0,t.jsx)("p",{className:"mt-1 font-mono text-xs break-all text-muted-foreground",children:e.headBranch??e.headSha.slice(0,7)})]}),(0,t.jsx)(N.TableCell,{children:(0,t.jsx)(j.Badge,{className:(0,p.pipelineStateClass)(e.status),children:y(`pipelineStates.${e.status}`)})}),(0,t.jsx)(N.TableCell,{children:0===e.pullRequests.length?"—":(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:e.pullRequests.map(r=>(0,t.jsx)(j.Badge,{asChild:!0,className:"cursor-pointer hover:bg-muted/80",children:(0,t.jsxs)(k.Link,{href:(0,x.pullRequestDetailHref)({repositoryNameWithOwner:e.repositoryNameWithOwner,number:r.number}),children:["#",r.number]})},r.number))})}),(0,t.jsx)(N.TableCell,{children:e.jiraKey?(0,t.jsx)(j.Badge,{asChild:!0,className:"cursor-pointer hover:bg-primary/80",children:(0,t.jsx)("button",{onClick:()=>I(e.jiraKey),type:"button",children:e.jiraKey})}):"—"}),(0,t.jsx)(N.TableCell,{className:"text-muted-foreground",children:(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("time",{dateTime:e.startedAt,title:e.startedAt,children:function(e,t){let r=Math.round((Date.parse(e)-Date.now())/1e3),s=new Intl.RelativeTimeFormat(t,{numeric:"auto"});for(let[e,t]of[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]])if(Math.abs(r)>=t)return s.format(Math.round(r/t),e);return s.format(r,"second")}(e.startedAt,w)}),(0,t.jsx)("span",{className:"text-xs",children:f("duration",{duration:function(e){let t=Date.parse(e.startedAt),r="ACTION_REQUIRED"===e.status||"EXPECTED"===e.status||"IN_PROGRESS"===e.status||"PENDING"===e.status||"QUEUED"===e.status?Date.now():Date.parse(e.updatedAt);if(!Number.isFinite(t)||!Number.isFinite(r))return"—";let s=Math.max(0,Math.floor((r-t)/1e3)),n=Math.floor(s/3600),a=Math.floor(s%3600/60),i=s%60;return n>0?`${n}h${a>0?` ${a}m`:""}`:a>0?`${a}m${i>0?` ${i}s`:""}`:`${i}s`}(e)})})]})}),(0,t.jsx)(N.TableCell,{children:(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(D,{onError:b,onRetried:()=>d(e),run:e})})})]}),u&&(0,t.jsx)(N.TableRow,{className:"bg-muted/20 hover:bg-muted/20",children:(0,t.jsx)(N.TableCell,{className:"p-0",colSpan:8,children:(0,t.jsx)($,{onError:b,onReload:()=>o(e),onRetried:t=>m(e,t),run:e,state:v})})})]},c)})]},e.key))})]})})}function D({run:e,onRetried:r,onError:s}){let l=(0,u.useTranslations)("actionsPage"),o=(0,u.useTranslations)("pullRequests"),[c,m]=(0,h.useState)(!1),p=async()=>{if(e.canRetry&&e.checkSuiteId){m(!0);try{await (0,S.controlPlaneRequest)(`mutation RetryGitHubPipeline(
|
|
2
|
-
$repositoryId: ID!
|
|
3
|
-
$checkSuiteId: ID!
|
|
4
|
-
) {
|
|
5
|
-
retryGitHubPipeline(
|
|
6
|
-
repositoryId: $repositoryId
|
|
7
|
-
checkSuiteId: $checkSuiteId
|
|
8
|
-
) { id }
|
|
9
|
-
}`,{repositoryId:e.repositoryGithubId,checkSuiteId:e.checkSuiteId}),r(),s(null)}catch(e){s(e instanceof Error?e.message:String(e))}finally{m(!1)}}},x=e.retryUnavailableReason?o(`retryUnavailable.${e.retryUnavailableReason}`):void 0;return(0,t.jsxs)(y.DropdownMenu,{children:[(0,t.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(g.Button,{"aria-label":`${l("actions")}: ${e.displayTitle}`,size:"icon-sm",variant:"outline",children:(0,t.jsx)(i.MoreHorizontal,{})})}),(0,t.jsxs)(y.DropdownMenuContent,{align:"end",className:"w-40",children:[(0,t.jsx)(y.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)("a",{href:e.url,rel:"noreferrer",target:"_blank",children:[(0,t.jsx)(n.ExternalLink,{}),l("view")]})}),e.worktreeId?(0,t.jsx)(y.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)(k.Link,{href:(0,T.worktreeDetailHref)(e.worktreeId),children:[(0,t.jsx)(a.GitBranch,{}),l("worktree")]})}):(0,t.jsxs)(y.DropdownMenuItem,{disabled:!0,children:[(0,t.jsx)(a.GitBranch,{}),l("worktree")]}),(0,t.jsx)(y.DropdownMenuSeparator,{}),(0,t.jsxs)(y.DropdownMenuItem,{disabled:c||!e.canRetry||!e.checkSuiteId,onSelect:()=>void p(),title:x,children:[c?(0,t.jsx)(R.Spinner,{}):(0,t.jsx)(d.RotateCcw,{}),o(c?"retrying":"retry")]})]})]})}function $({run:e,state:r,onReload:s,onRetried:n,onError:a}){let i=(0,u.useTranslations)("actionsPage");return(0,t.jsxs)("div",{className:"border-l-2 border-muted-foreground/20 px-4 py-3",children:[(0,t.jsx)("p",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:r?.jobs?i("jobCount",{count:r.jobs.length}):i("jobs")}),r?.loading&&!r.jobs?(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[(0,t.jsx)(R.Spinner,{})," ",i("loadingJobs")]}):r?.error?(0,t.jsx)(f.Alert,{variant:"destructive",children:(0,t.jsxs)(f.AlertDescription,{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{children:r.error}),(0,t.jsxs)(g.Button,{onClick:s,size:"sm",variant:"outline",children:[(0,t.jsx)(o.RefreshCw,{})," ",i("retryLoad")]})]})}):r?.jobs?.length===0?(0,t.jsx)("p",{className:"px-2 py-3 text-sm text-muted-foreground",children:i("noJobs")}):r?.jobs?(0,t.jsx)("div",{className:"divide-y",children:r.jobs.map(r=>(0,t.jsx)(A,{checkSuiteId:e.checkSuiteId,job:r,onError:a,onRetried:()=>n(r.id),repositoryId:e.repositoryGithubId},r.id))}):null]})}function A({job:e,repositoryId:a,checkSuiteId:i,onRetried:l,onError:o}){let c=(0,u.useTranslations)("actionsPage"),m=(0,u.useTranslations)("pullRequests"),[x,b]=(0,h.useState)(!1),[f,y]=(0,h.useState)(!1),w=async t=>{if(t.stopPropagation(),e.canRetry&&i){y(!0);try{await (0,S.controlPlaneRequest)(`mutation RetryGitHubWorkflowJob(
|
|
10
|
-
$repositoryId: ID!
|
|
11
|
-
$checkSuiteId: ID!
|
|
12
|
-
$jobId: ID!
|
|
13
|
-
) {
|
|
14
|
-
retryGitHubWorkflowJob(
|
|
15
|
-
repositoryId: $repositoryId
|
|
16
|
-
checkSuiteId: $checkSuiteId
|
|
17
|
-
jobId: $jobId
|
|
18
|
-
)
|
|
19
|
-
}`,{repositoryId:a,checkSuiteId:i,jobId:e.id}),l(),o(null)}catch(e){o(e instanceof Error?e.message:String(e))}finally{y(!1)}}},v=e.retryUnavailableReason?m(`retryUnavailable.${e.retryUnavailableReason}`):void 0;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[(0,t.jsxs)("button",{"aria-expanded":x,"aria-label":c(x?"hideJobSteps":"showJobSteps",{job:e.name}),className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-2 text-left hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>b(e=>!e),type:"button",children:[x?(0,t.jsx)(r.ChevronDown,{className:"size-4 shrink-0"}):(0,t.jsx)(s.ChevronRight,{className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),(0,t.jsx)(j.Badge,{className:(0,p.pipelineStateClass)(e.status),children:m(`pipelineStates.${e.status}`)})]}),e.url?(0,t.jsx)(g.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)("a",{href:e.url,rel:"noreferrer",target:"_blank",children:[c("view"),(0,t.jsx)(n.ExternalLink,{})]})}):(0,t.jsxs)(g.Button,{disabled:!0,size:"sm",variant:"outline",children:[c("view"),(0,t.jsx)(n.ExternalLink,{})]}),(0,t.jsxs)(g.Button,{"aria-label":c("retryJob",{job:e.name}),disabled:f||!e.canRetry||!i,onClick:e=>void w(e),size:"sm",title:v,variant:"outline",children:[f?(0,t.jsx)(R.Spinner,{}):(0,t.jsx)(d.RotateCcw,{}),f?m("retrying"):m("retry")]})]}),x&&(0,t.jsxs)("div",{className:"mb-3 w-full rounded-md border bg-background p-3",children:[(0,t.jsx)("p",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:c("steps")}),0===e.steps.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:c("noSteps")}):(0,t.jsx)("ol",{className:"space-y-2",children:e.steps.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-3 text-sm",children:[(0,t.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] text-muted-foreground",children:e.number}),(0,t.jsx)("span",{className:"min-w-0 flex-1",children:e.name}),(0,t.jsx)(j.Badge,{className:(0,p.pipelineStateClass)(e.status),children:m(`pipelineStates.${e.status}`)})]},e.number))})]})]})}e.s(["ActionsPage",0,function(){let e=(0,u.useTranslations)("actionsPage"),r=(0,m.useSearchParams)().get("issue"),[s,n]=(0,h.useState)(null),[a,i]=(0,h.useState)(!0),[d,c]=(0,h.useState)([]),[p,x]=(0,h.useState)([]),[j,y]=(0,h.useState)([]),[N,T]=(0,h.useState)("all"),[D,$]=(0,h.useState)(null),[A,P]=(0,h.useState)(!1),[M,H]=(0,h.useState)(!1),[U,O]=(0,h.useState)(!1),[B,q]=(0,h.useState)(null),[W,L]=(0,h.useState)(null),[J,z]=(0,h.useState)(new Set),[G,F]=(0,h.useState)({}),_=(0,h.useRef)(null),K=(0,h.useRef)(0),Q=(0,h.useRef)(null),V=(0,h.useCallback)(async(e,t={append:!1})=>{let r=t.append?K.current:++K.current;if(t.append){if(!t.cursor||Q.current===r)return;Q.current=r,O(!0),q(null)}else Q.current=null,H(!0),O(!1),q(null),c([]),y([]),$(null),P(!1),z(new Set),F({});try{let s=await (0,S.controlPlaneRequest)(`query GitHubActionsWorkflowRuns(
|
|
20
|
-
$codebaseRepositoryId: ID
|
|
21
|
-
$first: Int!
|
|
22
|
-
$after: String
|
|
23
|
-
) {
|
|
24
|
-
githubActionsWorkflowRuns(
|
|
25
|
-
codebaseRepositoryId: $codebaseRepositoryId
|
|
26
|
-
first: $first
|
|
27
|
-
after: $after
|
|
28
|
-
) {
|
|
29
|
-
items { id repositoryGithubId codebaseRepositoryId repositoryNameWithOwner repositoryUrl name displayTitle runNumber runAttempt event status url headBranch headSha checkSuiteId canRetry retryUnavailableReason pullRequests { number url } jiraKey worktreeId startedAt createdAt updatedAt }
|
|
30
|
-
repositories { id nameWithOwner url }
|
|
31
|
-
repositoryErrors { codebaseRepositoryId nameWithOwner message }
|
|
32
|
-
hasNextPage
|
|
33
|
-
endCursor
|
|
34
|
-
}
|
|
35
|
-
}`,{codebaseRepositoryId:"all"===e?null:e,first:25,after:t.cursor??null});if(r!==K.current)return;let n=s.githubActionsWorkflowRuns;c(e=>t.append?[...e,...n.items.filter(t=>!e.some(e=>C(e)===C(t)))]:n.items),x(n.repositories),y(n.repositoryErrors),$(n.endCursor),P(n.hasNextPage),L(null),q(null)}catch(s){if(r!==K.current)return;let e=s instanceof Error?s.message:String(s);t.append?q(e):L(e)}finally{t.append?Q.current===r&&(Q.current=null,O(!1)):r===K.current&&H(!1)}},[]);(0,h.useEffect)(()=>{let e=window.setTimeout(async()=>{try{let e=await (0,S.controlPlaneRequest)("query GitHubActionsConfiguration { githubSettings { tokenConfigured defaultJiraKeyRegex updatedAt } }");n(e.githubSettings),L(null),e.githubSettings.tokenConfigured&&await V("all")}catch(e){L(e instanceof Error?e.message:String(e))}finally{i(!1)}},0);return()=>window.clearTimeout(e)},[V]),(0,h.useEffect)(()=>{if(!s?.tokenConfigured||!A||!D||M||U||B)return;let e=_.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&V(N,{append:!0,cursor:D})},{rootMargin:"400px 0px"});return t.observe(e),()=>t.disconnect()},[D,A,V,M,U,B,N,s?.tokenConfigured]);let X=(0,h.useCallback)(async e=>{let t=C(e);F(e=>({...e,[t]:{loading:!0,error:null,jobs:e[t]?.jobs??null}}));try{let r=await (0,S.controlPlaneRequest)(`query GitHubActionsWorkflowJobs(
|
|
36
|
-
$codebaseRepositoryId: ID!
|
|
37
|
-
$workflowRunId: ID!
|
|
38
|
-
) {
|
|
39
|
-
githubActionsWorkflowJobs(
|
|
40
|
-
codebaseRepositoryId: $codebaseRepositoryId
|
|
41
|
-
workflowRunId: $workflowRunId
|
|
42
|
-
) { id name status url canRetry retryUnavailableReason steps { number name status } }
|
|
43
|
-
}`,{codebaseRepositoryId:e.codebaseRepositoryId,workflowRunId:e.id});F(e=>({...e,[t]:{loading:!1,error:null,jobs:r.githubActionsWorkflowJobs}}))}catch(e){F(r=>({...r,[t]:{loading:!1,error:e instanceof Error?e.message:String(e),jobs:r[t]?.jobs??null}}))}},[]),Y=[{value:"all",label:e("allRepositories"),keywords:e("allRepositories")},...p.map(e=>({value:e.id,label:e.nameWithOwner,keywords:e.nameWithOwner}))];return(0,t.jsxs)("section",{className:"mx-auto flex w-full max-w-[1800px] flex-col gap-5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:e("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e("description")})]}),(0,t.jsxs)(g.Button,{disabled:!s?.tokenConfigured||M,onClick:()=>void V(N),variant:"outline",children:[(0,t.jsx)(o.RefreshCw,{className:M?"animate-spin":void 0}),e("refresh")]})]}),W&&(0,t.jsx)(f.Alert,{variant:"destructive",children:(0,t.jsx)(f.AlertDescription,{children:W})}),a?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(R.Spinner,{}),e("loadingConfiguration")]}):s?.tokenConfigured?(0,t.jsxs)(t.Fragment,{children:[p.length>0&&(0,t.jsx)("div",{className:"max-w-lg",children:(0,t.jsx)(v.SearchableSelect,{ariaLabel:e("repositoryFilter"),emptyMessage:e("noRepositoryMatches"),onValueChange:e=>{T(e),V(e)},options:Y,placeholder:e("repositoryFilter"),searchPlaceholder:e("searchRepositories"),value:N})}),j.map(e=>(0,t.jsx)(f.Alert,{children:(0,t.jsxs)(f.AlertDescription,{children:[(0,t.jsxs)("span",{className:"font-medium",children:[e.nameWithOwner,":"]})," ",e.message]})},e.codebaseRepositoryId)),M&&0===d.length?(0,t.jsxs)("div",{className:"flex items-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,t.jsx)(R.Spinner,{}),e("loadingRuns")]}):0===p.length?(0,t.jsx)(w.Empty,{className:"border py-12",children:(0,t.jsxs)(w.EmptyHeader,{children:[(0,t.jsx)(w.EmptyTitle,{children:e("noCodebases")}),(0,t.jsx)(w.EmptyDescription,{children:e("noCodebasesDescription")})]})}):0===d.length?(0,t.jsx)(w.Empty,{className:"border py-12",children:(0,t.jsxs)(w.EmptyHeader,{children:[(0,t.jsx)(w.EmptyTitle,{children:e("empty")}),(0,t.jsx)(w.EmptyDescription,{children:e("emptyDescription")})]})}):(0,t.jsx)(E,{expandedRuns:J,jobStates:G,onError:L,onJobRetried:(e,t)=>{let r=C(e);c(e=>e.map(e=>C(e)===r?{...e,status:"QUEUED",canRetry:!1,retryUnavailableReason:"NOT_COMPLETED"}:e)),F(e=>{let s=e[r];return s?.jobs?{...e,[r]:{...s,jobs:s.jobs.map(e=>e.id===t?{...e,status:"QUEUED",canRetry:!1,retryUnavailableReason:"NOT_COMPLETED",steps:[]}:{...e,canRetry:!1,retryUnavailableReason:"NOT_COMPLETED"})}}:e})},onLoadJobs:X,onRunRetried:e=>{let t=C(e);c(e=>e.map(e=>C(e)===t?{...e,status:"QUEUED",canRetry:!1,retryUnavailableReason:"NOT_COMPLETED"}:e)),F(e=>{let r={...e};return delete r[t],r}),z(e=>{let r=new Set(e);return r.delete(t),r})},onToggleRun:e=>{let t=C(e);z(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r}),J.has(t)||G[t]||X(e)},runs:d}),B&&A?(0,t.jsx)(f.Alert,{variant:"destructive",children:(0,t.jsxs)(f.AlertDescription,{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{children:B}),(0,t.jsxs)(g.Button,{disabled:U||!D,onClick:()=>void V(N,{append:!0,cursor:D}),size:"sm",variant:"outline",children:[(0,t.jsx)(o.RefreshCw,{})," ",e("retryLoad")]})]})}):A?(0,t.jsx)("div",{className:"flex min-h-10 items-center justify-center gap-2 text-sm text-muted-foreground",ref:_,role:"status",children:U&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.Spinner,{})," ",e("loadingMore")]})}):null]}):(0,t.jsxs)(w.Empty,{className:"border py-12",children:[(0,t.jsxs)(w.EmptyHeader,{children:[(0,t.jsx)(w.EmptyMedia,{variant:"icon",children:(0,t.jsx)(l.PlayCircle,{})}),(0,t.jsx)(w.EmptyTitle,{children:e("credentialsRequired")}),(0,t.jsx)(w.EmptyDescription,{children:e("credentialsRequiredDescription")})]}),(0,t.jsx)(g.Button,{asChild:!0,className:"mt-4",children:(0,t.jsx)(k.Link,{href:"/settings",children:e("openSettings")})})]}),(0,t.jsx)(b.JiraTicketDrawer,{issueKey:r,onClose:()=>I(null)})]})}])}]);
|
/package/standalone/.next/static/{AxIbPSeZUHq852SCBMR8d → 8uBWJ8MOV-OEPe88M3PhU}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/standalone/.next/static/{AxIbPSeZUHq852SCBMR8d → 8uBWJ8MOV-OEPe88M3PhU}/_ssgManifest.js
RENAMED
|
File without changes
|