@ai-development-environment/server 0.0.120 → 0.0.121
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/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]/(auth)/register/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(auth)/sign-in/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/costs/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/drafts/new/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/drafts/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/plans/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/plans/[runId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/plans/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/sessions/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/sessions/[runId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/sessions/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/[skillId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/groups/[groupId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/groups/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/skills/sync/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/ai/usage/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/action-center/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/agents/[id]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/agents/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/apps/[appId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/apps/[appId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/apps/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/[buildId]/coverage/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/[buildId]/output/route.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/[buildId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/configurations/[configurationId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/builds/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/changes/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/codebases/[codebaseId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/codebases/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/codebases/repositories/[repositoryId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/[commandId]/edit/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/new/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/runs/[runId]/output/route.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/commands/runs/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/jobs/[jobId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/notifications/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/[workflowId]/edit/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/[workflowId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/new/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/workflows/runs/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/worktrees/[worktreeId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/worktrees/[worktreeId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/worktrees/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/dashboard/worktrees/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/analytics-events/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/console-logs/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/[crashId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/dsyms/[dsymId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/dsyms/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/crashes/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/push-notifications/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/[endpointId]/mocks/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/[endpointId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/breakpoints/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/history/[requestId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/history/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/new/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/sse/storage/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/debugging/unified-events/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github/actions/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github/actions-cache/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github/cache/entries/[id]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github/cache/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github/comments/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github/pull-requests/[owner]/[repository]/[number]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github/pull-requests/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github/webhooks/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/cache/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/comments/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/[projectId]/[iid]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/merge-requests/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/pipelines/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/gitlab/webhooks/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira/cache/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira/cache/tickets/[issueKey]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/[issueKey]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira/webhooks/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/api-keys/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/build-data/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/credentials/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/devices/[id]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/devices/enroll/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/devices/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/polling/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/prepare/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/provisioning-profiles/[profileId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/provisioning-profiles/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/settings/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/status/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/tailscale/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/tools/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/system/users/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/page.js.nft.json +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/_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/_not-found/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/complete/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/download/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/agent/build-artifact-transfers/[transferId]/upload/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/agent/dsyms/[dsymId]/dwarf/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/agent/run-attachments/[attachmentId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/build-artifact-uploads/[uploadId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/codebases/by-path/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/codebases/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/crash-files/dsyms/[dsymId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/crash-files/reports/[crashId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/dsyms/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/dsyms/uploads/[uploadId]/complete/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/dsyms/uploads/[uploadId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/dsyms/uploads/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/graphql/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/ios/apns-devices/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/ios/devices/export.tsv/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/ios/enrollment/start/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/ios/notification-devices/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/manifest.plist/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/crashes/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/github/webhook/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/gitlab/webhook/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/ios/enrollment-profile/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/ios/profile-response/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/jira/webhook/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/sse/[token]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/sse/history/export/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/telemetry/analytics-events/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/telemetry/console-logs/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/telemetry/export/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/tools/call/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/tools/catalog/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/worktrees/[worktreeId]/diff-image/route.js.nft.json +1 -1
- package/standalone/.next/server/chunks/_068dgv0osa_76._.js +1 -1
- package/standalone/.next/server/chunks/_0d9og16-1xzwf._.js +1 -1
- package/standalone/.next/server/chunks/_0tihxr172rjr2._.js +1 -1
- package/standalone/.next/server/chunks/_0x7v04zuo3n3l._.js +1 -1
- package/standalone/.next/server/chunks/_135qoeqd0y1f9._.js +1 -1
- package/standalone/.next/server/chunks/_14e7nz9n_7hbq._.js +1 -1
- package/standalone/.next/server/chunks/_1540l53pvp5wo._.js +1 -1
- package/standalone/.next/server/chunks/_1b4br9kktyl5f._.js +1 -1
- package/standalone/.next/server/chunks/_1fr7pyta5d-vs._.js +1 -1
- package/standalone/.next/server/chunks/_1olxqem1tg3kh._.js +1 -1
- package/standalone/.next/server/chunks/_1qt73el4gl5gk._.js +1 -1
- package/standalone/.next/server/chunks/_1sbfoz_fmetq8._.js +1 -1
- package/standalone/.next/server/chunks/_1v-7wrerkdl0r._.js +1 -1
- package/standalone/.next/server/chunks/_1xosefbi83ac9._.js +1 -1
- package/standalone/.next/server/chunks/ssr/_0p490iqgmcfib._.js +1 -1
- package/standalone/.next/server/chunks/ssr/_1e94gee9hafua._.js +1 -1
- package/standalone/.next/server/chunks/ssr/_21agp4ose6rkv._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_de_json_[json]_cjs_1uig1ud36h5oz._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_en_json_[json]_cjs_206072-e4clp3._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_es_json_[json]_cjs_082yukd_h99n8._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_fr_json_[json]_cjs_0j6-w0ix_w_ac._.js +1 -1
- 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/preview-props.json +3 -3
- 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/{43_tvp8awujkm.js → 3lrrs8j55jfx5.js} +29 -29
- package/standalone/package.json +0 -3
- /package/standalone/.next/static/{tlglkJtqHCGQYPxc7WQxe → ntwR-kXmw3UwIhfvlU8IC}/_buildManifest.js +0 -0
- /package/standalone/.next/static/{tlglkJtqHCGQYPxc7WQxe → ntwR-kXmw3UwIhfvlU8IC}/_clientMiddlewareManifest.js +0 -0
- /package/standalone/.next/static/{tlglkJtqHCGQYPxc7WQxe → ntwR-kXmw3UwIhfvlU8IC}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,939050,868401,e=>{var t=e.i(456420);let r={name:"move-right",size:24,node:[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],939050);let a={name:"tags",size:24,node:[["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"}]]};a.node;let
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,939050,868401,e=>{var t=e.i(456420);let r={name:"move-right",size:24,node:[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],939050);let a={name:"tags",size:24,node:[["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"}]]};a.node;let n=(0,t.f)(a);e.s(["f",0,n],868401)},448295,e=>{var t=e.i(843476),r=e.i(630338),s=e.i(723408),a=e.i(481217),n=e.i(688194),i=e.i(93384),l=e.i(741120),o=e.i(456420);let d={name:"test-tube-diagonal",size:24,node:[["path",{d:"M21 7 6.82 21.18a2.83 2.83 0 0 1-3.99-.01a2.83 2.83 0 0 1 0-4L17 3",key:"1ub6xw"}],["path",{d:"m16 2 6 6",key:"1gw87d"}],["path",{d:"M12 16H4",key:"1cjfip"}]],aliases:["test-tube-2"]};d.node;let c=(0,o.f)(d);var u=e.i(986206),h=e.i(446513),m=e.i(861745),p=e.i(948148),g=e.i(271645),x=e.i(929592),f=e.i(487486),b=e.i(519455),j=e.i(515288),v=e.i(257428),w=e.i(776639),k=e.i(793479),y=e.i(110204),S=e.i(337822),C=e.i(967489),N=e.i(987968),I=e.i(677572),E=e.i(456430),A=e.i(624687),R=e.i(520133),T=e.i(462777),D=e.i(637611),W=e.i(360583),B=e.i(975157),$=e.i(54810),P=e.i(687862),O=e.i(52253);let L=`
|
|
2
2
|
id type
|
|
3
3
|
configurations {
|
|
4
4
|
id name iconKey scheme buildConfiguration defaultAction advancedSettings autoExport exportSettings createdAt updatedAt
|
|
@@ -11,37 +11,37 @@
|
|
|
11
11
|
}
|
|
12
12
|
`,U=`
|
|
13
13
|
id scopeKey status schemes configurations testPlans error stale headSha xcodeVersion lastParseAttemptAt lastParsedAt
|
|
14
|
-
`,_=["BUILD","TEST","ANALYZE","ARCHIVE","BUILD_FOR_TESTING","TEST_WITHOUT_BUILDING"];function M({codebaseId:e,worktreeId:
|
|
14
|
+
`,_=["BUILD","TEST","ANALYZE","ARCHIVE","BUILD_FOR_TESTING","TEST_WITHOUT_BUILDING"];function M({codebaseId:e,worktreeId:i,open:o,onOpenChange:d,onStarted:c,destinationCache:S,coverageMode:R=!1}){let{settings:K,error:q}=(0,r.f)(),[F,V]=(0,g.useState)(null),H=(0,p.f)("builds"),G=(0,m.X)(),[z,J]=(0,g.useState)(null),[Y,Q]=(0,g.useState)(null),[X,Z]=(0,g.useState)([]),[ee,et]=(0,g.useState)(!1),[er,es]=(0,g.useState)(""),[ea,en]=(0,g.useState)(null),[ei,el]=(0,g.useState)(!1),eo=e=>"__custom__"===e.id?{customConfiguration:{sourceKind:e.source.kind,sourcePath:e.source.relativePath,scheme:e.scheme,buildConfiguration:e.buildConfiguration}}:{configurationId:e.id},[ed,ec]=(0,g.useState)("BUILD"),[eu,eh]=(0,g.useState)({}),[em,ep]=(0,g.useState)([]),[eg,ex]=(0,g.useState)("SIMULATOR"),[ef,eb]=(0,g.useState)(""),[ej,ev]=(0,g.useState)(new Set),[ew,ek]=(0,g.useState)({}),[ey,eS]=(0,g.useState)(!1),[eC,eN]=(0,g.useState)(O.A),[eI,eE]=(0,g.useState)("{}"),[eA,eR]=(0,g.useState)(!0),[eT,eD]=(0,g.useState)(!1),[eW,eB]=(0,g.useState)(!1),[e$,eP]=(0,g.useState)(null),[eO,eL]=(0,g.useState)(null),eU=(0,g.useRef)(0),e_=(0,g.useRef)("SIMULATOR"),eM=(0,g.useRef)(""),eK=(0,g.useRef)(!1),eq="__custom__"===er?ea:z?.configurations.find(e=>e.id===er),eF=ei?"__custom__":er,eV=eq?eu[eq.id]??eq.observation:null;(0,g.useEffect)(()=>{let t=!1;return(0,D.W)(`query StartBuildProject($codebaseId: ID!) {
|
|
15
15
|
iosAppProject(codebaseId: $codebaseId) { ${L} }
|
|
16
16
|
codebase(id: $codebaseId) { agent { id name hostname } }
|
|
17
|
-
}`,{codebaseId:e}).then(e=>{if(t)return;J(e.iosAppProject),Q(e.codebase?.agent??null),ev(new Set(e.iosAppProject?.allowedScripts.filter(({script:e})=>e.enabledByDefault).map(({script:e})=>e.id)??[]));let r=e.iosAppProject?.configurations[0];!r&&e.iosAppProject&&(es("__custom__"),el(!0)),r&&(es(r.id),ec(R?"TEST":r.defaultAction),ek(r.advancedSettings??{}),eE(JSON.stringify(r.advancedSettings?.buildSettingOverrides??{})),eS(!!(!R&&"ARCHIVE"===r.defaultAction&&r.autoExport)),eN({...O.A,...r.exportSettings??{}}),ev(new Set(e.iosAppProject.allowedScripts.filter(e=>e.script.enabledByDefault).map(e=>e.script.id))))}).catch(e=>eP(e instanceof Error?e.message:String(e))).finally(()=>{t||eR(!1)}),()=>{t=!0}},[e,R,
|
|
17
|
+
}`,{codebaseId:e}).then(e=>{if(t)return;J(e.iosAppProject),Q(e.codebase?.agent??null),ev(new Set(e.iosAppProject?.allowedScripts.filter(({script:e})=>e.enabledByDefault).map(({script:e})=>e.id)??[]));let r=e.iosAppProject?.configurations[0];!r&&e.iosAppProject&&(es("__custom__"),el(!0)),r&&(es(r.id),ec(R?"TEST":r.defaultAction),ek(r.advancedSettings??{}),eE(JSON.stringify(r.advancedSettings?.buildSettingOverrides??{})),eS(!!(!R&&"ARCHIVE"===r.defaultAction&&r.autoExport)),eN({...O.A,...r.exportSettings??{}}),ev(new Set(e.iosAppProject.allowedScripts.filter(e=>e.script.enabledByDefault).map(e=>e.script.id))))}).catch(e=>eP(e instanceof Error?e.message:String(e))).finally(()=>{t||eR(!1)}),()=>{t=!0}},[e,R,i]),(0,g.useEffect)(()=>{"TEST_WITHOUT_BUILDING"!==ed||eK.current||(eK.current=!0,et(!0),(0,D.W)(`query StartBuildPriorBuilds($worktreeId: ID!) {
|
|
18
18
|
builds(first: 50, status: SUCCEEDED, worktreeId: $worktreeId) {
|
|
19
19
|
items { id action destinationType snapshot createdAt }
|
|
20
20
|
}
|
|
21
|
-
}`,{worktreeId:
|
|
21
|
+
}`,{worktreeId:i}).then(e=>Z(e.builds.items)).catch(e=>{eK.current=!1,eP(e instanceof Error?e.message:String(e))}).finally(()=>et(!1)))},[ed,i]);let eH=(0,g.useMemo)(()=>X.filter(e=>{if("BUILD_FOR_TESTING"!==e.action||e.destinationType!==eg)return!1;let t=e.snapshot.configuration,r="string"==typeof ew.testPlan?ew.testPlan:null,s=t?.advancedSettings?.testPlan;return("__custom__"===er?t?.kind==="CUSTOM"&&t.source?.kind===ea?.source.kind&&t.source?.relativePath===ea?.source.relativePath&&t.scheme===ea?.scheme&&t.buildConfiguration===ea?.buildConfiguration:t?.id===er)&&(!r||!s||r===s)}),[ew.testPlan,er,ea,eg,X]),eG=eH.find(e=>e.id===ew.priorBuildForTestingId)?.id??eH[0]?.id??null,ez=(e,t,r)=>{let s="ARCHIVE"===t?"PHYSICAL_DEVICE":e.some(e=>"SIMULATOR"===e.type)?"SIMULATOR":"PHYSICAL_DEVICE",a=r&&e.some(e=>e.type===e_.current)?e_.current:s,n=r&&e.some(e=>e.id===eM.current&&e.type===a)?eM.current:e.find(e=>e.type===a)?.id??"";e_.current=a,eM.current=n,ep(e),ex(a),eb(n)},eJ=async(e,t)=>{let r=++eU.current,s=`${i}:${JSON.stringify(eo(e))}:${t}`,a=S.get(s);a&&a.expiresAt<=Date.now()&&S.delete(s);let l=a&&a.expiresAt>Date.now()?a.destinations:(0,n.G)(t);eP(null),eL(null),ez(l,t,!1);try{let a=await (0,D.W)(`mutation InspectStartBuildDestinations($input: InspectBuildDestinationsInput!) {
|
|
22
22
|
inspectBuildDestinations(input: $input)
|
|
23
|
-
}`,{input:{worktreeId:
|
|
23
|
+
}`,{input:{worktreeId:i,...eo(e),action:t,requestId:(0,T.e)()}});if(r!==eU.current)return;let l=(0,n.G)(t),o="ARCHIVE"===t?l:[...l,...a.inspectBuildDestinations.filter(e=>!l.some(t=>t.type===e.type&&t.id===e.id))];S.set(s,{destinations:o,expiresAt:Date.now()+15e3}),ez(o,t,!0)}catch(t){if(r!==eU.current)return;let e=t instanceof Error?t.message:String(t);l.length?eL(H("destinationRefreshWarning",{error:e})):eP(e)}},eY=async e=>{eD(!0),eP(null);try{let t=(await (0,D.W)(`mutation ReparseStartBuild($configurationId: ID!, $worktreeId: ID!, $requestId: ID!) {
|
|
24
24
|
reparseBuildConfiguration(configurationId: $configurationId, worktreeId: $worktreeId, requestId: $requestId) {
|
|
25
25
|
${U}
|
|
26
26
|
}
|
|
27
|
-
}`,{configurationId:e.id,worktreeId:
|
|
27
|
+
}`,{configurationId:e.id,worktreeId:i,requestId:(0,T.e)()})).reparseBuildConfiguration;if(eh(r=>({...r,[e.id]:t})),"VALID"!==t.status)throw Error(t.error||H("configurationInvalid"));eJ(e,ed)}catch(e){eP(e instanceof Error?e.message:String(e))}finally{eD(!1)}},eQ=async()=>{if(!eq)throw Error(H("selectSigningSourceFirst"));return(await (0,D.W)(`mutation InspectStartBuildSigningRequirements($input: InspectBuildSourceInput!) {
|
|
28
28
|
inspectBuildSource(input: $input) {
|
|
29
29
|
signingRequirements {
|
|
30
30
|
bundleId name target platform teamId provisioningProfileSpecifier
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
}`,{input:{worktreeId:
|
|
33
|
+
}`,{input:{worktreeId:i,sourceKind:eq.source.kind,sourcePath:eq.source.relativePath,scheme:eq.scheme,configuration:eq.buildConfiguration,requestId:(0,T.e)()}})).inspectBuildSource.signingRequirements};(0,g.useEffect)(()=>{if(!eq||eA)return;let e=window.setTimeout(()=>void eJ(eq,ed),0);return()=>{window.clearTimeout(e),eU.current+=1}},[er,ea,ed,eA]);let eX=(0,g.useMemo)(()=>em.filter(e=>e.type===eg),[em,eg]),eZ=em.find(e=>e.id===ef),e0=eq?`xcrun xcodebuild ${"PROJECT"===eq.source.kind?`-project ${eq.source.relativePath}`:"WORKSPACE"===eq.source.kind?`-workspace ${eq.source.relativePath}`:""} -scheme ${JSON.stringify(eq.scheme)} -configuration ${JSON.stringify(eq.buildConfiguration)} -destination ${JSON.stringify(eZ?.name??"<destination>")} -hideShellScriptEnvironment ${ed.toLowerCase().replaceAll("_","-")}${"TEST_WITHOUT_BUILDING"===ed&&eG?` \xb7 ${H("priorBuildSummary",{id:eG})}`:""}`:"",e1=async()=>{if(eq&&eZ&&K){eB(!0),eP(null);try{let e={};try{let t=JSON.parse(eI);if(!t||"object"!=typeof t||Array.isArray(t))throw Error();e=t}catch{throw Error(H("overridesInvalid"))}let t=await (0,D.W)(`mutation StartIosBuild($input: StartBuildInput!) {
|
|
34
34
|
${R?"startWorktreeCoverage":"startBuild"}(input: $input) { id }
|
|
35
|
-
}`,{input:{worktreeId:n,serverUrlKind:F??(K?(0,s.b)(K,eg):null),...eo(eq),destination:eZ,scriptIds:[...ej],action:ed,advancedSettings:{...ew,buildSettingOverrides:e,...R?{codeCoverage:!0,parseTestResults:!0}:{},..."TEST_WITHOUT_BUILDING"===ed?{priorBuildForTestingId:eG,priorTestProductsPath:null,priorXctestrunPath:null}:{}},exportWhenComplete:!R&&"ARCHIVE"===ed&&ey,exportSettings:"ARCHIVE"===ed?eC:null,requestId:(0,T.e)()}});d(!1);let r=t.startBuild??t.startWorktreeCoverage;if(!r)throw Error(H("startBuildFailed"));c(r.id)}catch(e){eP(e instanceof Error?e.message:String(e))}finally{eB(!1)}}};return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(w.N,{onOpenChange:d,open:o,children:(0,t.jsxs)(w.d,{className:"max-h-[90vh] grid-cols-[minmax(0,1fr)] overflow-y-auto sm:max-w-5xl",children:[(0,t.jsxs)(w.s,{children:[(0,t.jsx)(w.F,{children:H(R?"startWorktreeCoverage":"startBuild")}),(0,t.jsx)(w.C,{children:H(R?"startWorktreeCoverageDescription":"startBuildDescription")})]}),e$&&(0,t.jsx)(x.J,{variant:"destructive",children:(0,t.jsx)(x.p,{children:e$})}),eO&&(0,t.jsx)(x.J,{children:(0,t.jsx)(x.p,{children:eO})}),eA?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(N.f,{})," ",H("loading")]}):z?(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("section",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("configuration")}),(0,t.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[z.configurations.map(e=>(0,t.jsxs)("button",{className:`rounded-xl border p-3 text-left transition-colors ${e.id===eF?"border-primary bg-primary/5":"hover:bg-muted/50"}`,"aria-pressed":e.id===eF,onClick:()=>{e.id!==er&&(eU.current+=1),el(!1),es(e.id),ec(R?"TEST":e.defaultAction),ek(e.advancedSettings??{}),eE(JSON.stringify(e.advancedSettings?.buildSettingOverrides??{})),eS(!!(!R&&"ARCHIVE"===e.defaultAction&&e.autoExport)),eN({...O.A,...e.exportSettings??{}})},type:"button",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(P.f,{iconKey:e.iconKey}),e.name]}),(0,t.jsx)(f.f,{variant:(eu[e.id]??e.observation)?.status==="VALID"?"success":"outline",children:H(`parseStatuses.${(eu[e.id]??e.observation)?.status??"UNPARSED"}`)})]}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[e.scheme," · ",e.buildConfiguration]})]},e.id)),(0,t.jsxs)("button",{type:"button","aria-pressed":"__custom__"===eF,className:`rounded-xl border p-3 text-left ${"__custom__"===eF?"border-primary bg-primary/5":"hover:bg-muted/50"}`,onClick:()=>el(!0),children:[(0,t.jsx)("span",{className:"font-medium",children:H("custom")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:H("customDescription")})]})]})]}),en&&(0,t.jsx)(E.B,{inline:!0,codebaseId:e,worktreeId:n,configuration:ea,open:en,onOpenChange:el,onSaved:async()=>{},onCustom:e=>{ei(e),es("__custom__"),ec(R?"TEST":e.defaultAction),ek(e.advancedSettings),eE(JSON.stringify(e.advancedSettings.buildSettingOverrides??{})),eS(!!e.autoExport),eN({...O.A,...e.exportSettings})}}),!en&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("destinationType")}),(0,t.jsx)(I.i,{value:eg,onValueChange:e=>{e_.current=e,ex(e);let t=em.find(t=>t.type===e)?.id??"";eM.current=t,eb(t)},children:(0,t.jsxs)(I.U,{children:[(0,t.jsxs)(I.k,{value:"PHYSICAL_DEVICE",children:[(0,t.jsx)(u.f,{}),H("physicalDevice")]}),(0,t.jsxs)(I.k,{value:"SIMULATOR",disabled:"ARCHIVE"===ed,children:[(0,t.jsx)(h.f,{}),H("simulator")]})]})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("device")}),(0,t.jsxs)(C.d,{disabled:!eX.length,onValueChange:e=>{eM.current=e,eb(e)},value:ef,children:[(0,t.jsx)(C.P,{children:(0,t.jsx)(C.U,{placeholder:H("selectDevice")})}),(0,t.jsx)(C.r,{children:eX.map(e=>(0,t.jsxs)(C.T,{value:e.id,children:[e.generic?"SIMULATOR"===e.type?H("anySimulator"):H("anyPhysicalDevice"):e.name,e.osVersion?` \xb7 ${e.osVersion}`:""]},e.id))})]})]})]}),z.allowedScripts.length>0&&(0,t.jsxs)("section",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("scripts")}),(0,t.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:z.allowedScripts.map(({script:e})=>(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded-lg border p-2",children:[(0,t.jsx)(v.f,{checked:ej.has(e.id),onCheckedChange:t=>{ev(r=>{let s=new Set(r);return t?s.add(e.id):s.delete(e.id),s})}}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,t.jsx)(P.f,{iconKey:e.iconKey??null})," ",e.name]}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.preBuildScript?H("preBuild"):"",e.preBuildScript&&e.postBuildScript?" · ":"",e.postBuildScript?H("postBuild"):""]})]})]},e.id))})]}),(0,t.jsxs)("details",{className:"rounded-xl border p-3",children:[(0,t.jsx)("summary",{className:"cursor-pointer font-medium",children:H("details")}),(0,t.jsxs)("div",{className:"mt-4 space-y-4",children:[eq&&(0,t.jsx)(j.N,{children:(0,t.jsxs)(j.O,{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate font-mono text-xs",title:eq.source.relativePath,children:eq.source.relativePath}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[eq.scheme," ·"," ",eq.buildConfiguration]}),Y&&(0,t.jsxs)("p",{className:"truncate text-xs text-muted-foreground",title:`${Y.name} (${Y.hostname})`,children:[H("agent"),": ",Y.name]})]}),(0,t.jsxs)(b.K,{disabled:eT,onClick:()=>"__custom__"===eq.id?el(!0):void eY(eq),size:"sm",type:"button",variant:"outline",children:[eT?(0,t.jsx)(N.f,{}):(0,t.jsx)(l.f,{})," ",H("reparse")]})]}),eV?.error&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:eV.error})]})}),(0,t.jsxs)("div",{className:(0,B.f)("space-y-2",R&&"hidden"),children:[(0,t.jsx)(y.f,{children:H("action")}),(0,t.jsxs)(C.d,{onValueChange:e=>{e!==ed&&(eU.current+=1),ec(e),"ARCHIVE"!==e&&eS(!1)},value:ed,children:[(0,t.jsx)(C.P,{children:(0,t.jsx)(C.U,{})}),(0,t.jsx)(C.r,{children:_.map(e=>(0,t.jsx)(C.T,{value:e,children:H(`actions.${e}`)},e))})]})]}),!R&&"ARCHIVE"===ed&&(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(v.f,{checked:ey,onCheckedChange:e=>eS(!!e)}),H("exportWhenComplete")]}),ey&&(0,t.jsx)(O.O,{onChange:eN,onParseSigningRequirements:eQ,value:eC},er)]}),"TEST_WITHOUT_BUILDING"===ed&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("priorBuildForTesting")}),(0,t.jsxs)(C.d,{disabled:ee||!eH.length,onValueChange:e=>ek(t=>({...t,priorBuildForTestingId:e,priorTestProductsPath:null,priorXctestrunPath:null})),value:eG??"",children:[(0,t.jsx)(C.P,{children:(0,t.jsx)(C.U,{placeholder:H("selectPriorBuildForTesting")})}),(0,t.jsx)(C.r,{children:eH.map(e=>(0,t.jsxs)(C.T,{value:e.id,children:[(0,W.l)(e.createdAt,"short",{locale:G})," ","· ",e.id]},e.id))})]}),ee&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)(N.f,{})," ",H("loading")]}),!ee&&!eH.length&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:H("noPriorBuildForTesting")})]}),["TEST","BUILD_FOR_TESTING","TEST_WITHOUT_BUILDING"].includes(ed)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("testPlan")}),(0,t.jsxs)(C.d,{onValueChange:e=>ek(t=>({...t,testPlan:"__SCHEME_DEFAULT__"===e?null:e})),value:String(ew.testPlan??"__SCHEME_DEFAULT__"),children:[(0,t.jsx)(C.P,{children:(0,t.jsx)(C.U,{})}),(0,t.jsxs)(C.r,{children:[(0,t.jsx)(C.T,{value:"__SCHEME_DEFAULT__",children:H("schemeDefaultTestPlan")}),"string"==typeof ew.testPlan&&ew.testPlan&&!eV?.testPlans.includes(ew.testPlan)&&(0,t.jsxs)(C.T,{value:ew.testPlan,children:[ew.testPlan," ·"," ",H("savedValueUnavailable")]}),eV?.testPlans.map(e=>(0,t.jsx)(C.T,{value:e,children:e},e))]})]})]}),(0,t.jsxs)("div",{className:"mt-4 grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{htmlFor:"development-team",children:H("developmentTeam")}),(0,t.jsx)(k.f,{id:"development-team",onChange:e=>ek(t=>({...t,developmentTeam:e.target.value||null})),value:String(ew.developmentTeam??"")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("packageResolution")}),(0,t.jsxs)(C.d,{onValueChange:e=>ek(t=>({...t,packageResolution:e})),value:String(ew.packageResolution??"DEFAULT"),children:[(0,t.jsx)(C.P,{children:(0,t.jsx)(C.U,{})}),(0,t.jsx)(C.r,{children:["DEFAULT","RESOLVED_ONLY","SKIP_UPDATES","DISABLE_AUTOMATIC"].map(e=>(0,t.jsx)(C.T,{value:e,children:e},e))})]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2",children:[(0,t.jsx)(v.f,{checked:R||!!ew.codeCoverage,disabled:R,onCheckedChange:e=>ek(t=>({...t,codeCoverage:!!e}))}),H("codeCoverage")]}),["TEST","TEST_WITHOUT_BUILDING"].includes(ed)&&(0,t.jsxs)("label",{className:"flex items-center gap-2",children:[(0,t.jsx)(v.f,{checked:R||!1!==ew.parseTestResults,disabled:R,onCheckedChange:e=>ek(t=>({...t,parseTestResults:!!e}))}),H("parseTestResults")]}),(0,t.jsxs)("label",{className:"flex items-center gap-2",children:[(0,t.jsx)(v.f,{checked:!!ew.allowProvisioningUpdates,onCheckedChange:e=>ek(t=>({...t,allowProvisioningUpdates:!!e}))}),H("allowProvisioningUpdates")]}),(0,t.jsx)($.f,{id:"collect-dsyms",onChange:e=>ek(t=>({...t,collectDsyms:e})),value:ew.collectDsyms}),(0,t.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,t.jsx)(y.f,{htmlFor:"build-setting-overrides",children:H("buildSettingOverrides")}),(0,t.jsx)(A.f,{className:"font-mono text-xs",id:"build-setting-overrides",onChange:e=>eE(e.target.value),rows:4,value:eI})]})]}),(0,t.jsxs)("section",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("commandPreview")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-lg bg-muted p-3 text-xs whitespace-pre-wrap",children:e0})]})]})]})]})]}):(0,t.jsx)(x.J,{children:(0,t.jsx)(x.p,{children:H("noConfigurations")})}),(0,t.jsxs)("div",{className:"space-y-2",children:[K?(0,t.jsx)(a.n,{settings:K,value:F??(0,s.b)(K,eg),onValueChange:e=>{"INHERIT"!==e&&V(e)}}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:q??"Loading server URLs…"}),(0,t.jsx)(a.s,{})]}),(0,t.jsxs)(w.c,{children:[(0,t.jsx)(b.K,{onClick:()=>d(!1),type:"button",variant:"outline",children:H("cancel")}),(0,t.jsxs)(b.K,{disabled:eA||eW||en||!eq||!K||!(0,s.C)(K).some(e=>e.kind===(F??(0,s.b)(K,eg)))||!eZ||"TEST_WITHOUT_BUILDING"===ed&&!eG,onClick:()=>void e1(),type:"button",children:[eW&&(0,t.jsx)(N.f,{})," ",H("startBuild")]})]})]})})})}e.s(["G",0,function({codebaseId:e,worktreeId:r,disabled:s,disabledReason:a,buildSettingsHref:i,onStarted:l,size:o="sm"}){let d=(0,p.f)("builds"),[c,u]=(0,g.useState)(!1),[h,m]=(0,g.useState)(!1),x=(0,g.useRef)(null),[f]=(0,g.useState)(()=>new Map),j=()=>{null!==x.current&&(window.clearTimeout(x.current),x.current=null)},v=()=>{j(),m(!0)},w=()=>{j(),x.current=window.setTimeout(()=>m(!1),150)};return(0,g.useEffect)(()=>()=>{null!==x.current&&window.clearTimeout(x.current)},[]),(0,t.jsxs)(t.Fragment,{children:[s&&i?(0,t.jsxs)(S.V,{onOpenChange:m,open:h,children:[(0,t.jsx)(S.r,{asChild:!0,children:(0,t.jsxs)(b.K,{"aria-disabled":"true","aria-expanded":h,"aria-haspopup":"dialog",className:"cursor-not-allowed opacity-50",onClick:v,onFocus:v,onMouseEnter:v,onMouseLeave:w,size:o,title:a??void 0,type:"button",children:[(0,t.jsx)(n.f,{})," ",d("build")]})}),(0,t.jsx)(S.T,{align:"start",className:"w-auto max-w-64 p-2 text-xs",onBlurCapture:w,onFocusCapture:j,onMouseEnter:j,onMouseLeave:w,onOpenAutoFocus:e=>e.preventDefault(),side:"top",children:(0,t.jsx)(R.L,{className:"font-medium underline-offset-4 hover:underline",href:i,children:d("configureBuilds")})})]}):(0,t.jsxs)(b.K,{disabled:s,onClick:()=>u(!0),size:o,title:a??void 0,type:"button",children:[(0,t.jsx)(n.f,{})," ",d("build")]}),c&&(0,t.jsx)(M,{codebaseId:e,destinationCache:f,onOpenChange:u,onStarted:e=>l?.(e),open:c,worktreeId:r})]})},"H",0,function({codebaseId:e,worktreeId:r,disabled:s,onStarted:a}){let i=(0,p.f)("builds"),[n,l]=(0,g.useState)(!1),[o]=(0,g.useState)(()=>new Map);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.K,{disabled:s,onClick:()=>l(!0),type:"button",children:[(0,t.jsx)(c,{})," ",i("generateWorktreeCoverage")]}),n&&(0,t.jsx)(M,{codebaseId:e,coverageMode:!0,destinationCache:o,onOpenChange:l,onStarted:e=>a?.(e),open:n,worktreeId:r})]})}],448295)},227286,539531,e=>{var t=e.i(843476),r=e.i(716327),s=e.i(395925),a=e.i(948148),i=e.i(271645),n=e.i(519455),l=e.i(755146),o=e.i(987968),d=e.i(637611),c=e.i(390673),u=e.i(762525);e.s(["f",0,function({pipelines:e,onChanged:h}){let m=(0,a.f)("gitlabPages"),p=(0,a.f)("pullRequests"),[g,x]=(0,i.useState)(null),[f,b]=(0,i.useState)(null),[j,v]=(0,i.useState)(null),w=(0,i.useRef)(!1);if(!e.length)return null;let k=(0,u.r)(e.map(e=>e.status)),y=e=>e.stopPropagation(),S=async e=>{if(!w.current&&e.canRetry){w.current=!0,x(e.id),b(null),v(null);try{let t=(await (0,d.W)("mutation GitLabWorktreePipelineRetry($projectId: ID!, $pipelineId: ID!) { runGitLabPipelineAction(projectId: $projectId, pipelineId: $pipelineId, action: RETRY) { pipeline { id } execution { id status message } } }",{projectId:e.projectId,pipelineId:e.id})).runGitLabPipelineAction.execution;if(t){let e=`${t.status}: ${t.message??""}`;["FAILED","PARTIAL","UNCERTAIN"].includes(t.status)?b(e):v(e)}await h?.()}catch(e){b(e instanceof Error?e.message:String(e))}finally{w.current=!1,x(null)}}};return(0,t.jsxs)(l.G,{children:[(0,t.jsx)(l.X,{asChild:!0,children:(0,t.jsxs)(n.K,{"aria-label":`${m("pipelines")}: ${m(`pipelineStatuses.${k}`)}`,className:`h-5 rounded-full px-2 py-0.5 text-xs ${(0,u.d)(k)}`,onClick:y,variant:"outline",children:[m(`pipelineStatuses.${k}`),(0,t.jsx)(r.f,{className:"size-3"})]})}),(0,t.jsxs)(l.L,{align:"start",className:"w-80 max-w-[calc(100vw-2rem)]",onClick:y,children:[(0,t.jsx)(l.B,{children:m("pipelines")}),(0,t.jsx)(l.U,{}),f&&(0,t.jsx)("p",{className:"px-2 py-1.5 text-xs break-words text-destructive",role:"alert",children:f}),j&&(0,t.jsx)("p",{className:"px-2 py-1.5 text-xs break-words text-muted-foreground",role:"status",children:j}),(0,t.jsx)("div",{className:"space-y-1 p-1",children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md px-2 py-2 hover:bg-muted",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(l.r,{asChild:!0,className:"gap-1 p-0 font-medium",children:(0,t.jsx)("a",{className:"hover:underline",href:e.webUrl,rel:"noreferrer",target:"_blank",children:(0,t.jsxs)("span",{className:"truncate",children:["#",e.iid??e.id," · ",e.ref]})})}),(0,t.jsxs)("span",{className:"block text-xs text-muted-foreground",children:[(0,t.jsx)(c.g,{source:e.source})," ·"," ",(0,t.jsx)(c.a,{status:e.status})]})]}),(0,t.jsxs)(l.r,{"aria-busy":g===e.id,className:(0,n.i)({size:"sm",variant:"outline"}),disabled:null!==g||!e.canRetry,onSelect:t=>{t.preventDefault(),S(e)},children:[g===e.id?(0,t.jsx)(o.f,{"aria-hidden":"true"}):(0,t.jsx)(s.f,{}),g===e.id?p("retrying"):m("retry")]})]},e.id))})]})]})}],227286);var h=e.i(772436),m=e.i(975157);e.s(["f",0,function({first:e,second:r}){let s=(0,i.useRef)(null),[a,n]=(0,i.useState)({paired:!1,inline:!1});return(0,i.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>{let t=[...e.children].filter(e=>e instanceof HTMLElement&&void 0===e.dataset.quickActionsSeparator),r=2===t.length,[s,a]=t,i=r&&s.getBoundingClientRect().bottom>a.getBoundingClientRect().top;n(e=>e.paired===r&&e.inline===i?e:{paired:r,inline:i})};t();let r=new ResizeObserver(t);for(let t of(r.observe(e),e.children))r.observe(t);let a=new MutationObserver(t);return a.observe(e,{childList:!0,subtree:!0}),()=>{r.disconnect(),a.disconnect()}}),(0,t.jsxs)("div",{className:"flex w-full flex-wrap items-center gap-2",ref:s,children:[e,a.paired&&(0,t.jsx)(h.f,{className:(0,m.f)(!a.inline&&"invisible"),"data-quick-actions-separator":"",orientation:"vertical"}),r]})}],539531)},501416,e=>{let t,r,s,a,i,n,l,o,d,c,u;var h=e.i(843476),m=e.i(119002),p=e.i(489002),g=e.i(482022),x=e.i(948148),f=e.i(271645),b=e.i(929592),j=e.i(519455),v=e.i(755146),w=e.i(987968),k=e.i(687862),y=e.i(520133),S=e.i(637611),C=e.i(975157),N=e.i(997778);let I={activeRuns:[],error:null,loaded:!1},E=e=>({resourceKind:e.resourceKind.trim().toUpperCase(),resourceId:e.resourceId.trim()}),A=e=>{let t=E(e);return JSON.stringify([t.resourceKind,t.resourceId])},R=`query WorkflowTargetSummaries($targets: [WorkflowTargetSummaryInput!]!) {
|
|
35
|
+
}`,{input:{worktreeId:i,serverUrlKind:F??(K?(0,s.b)(K,eg):null),...eo(eq),destination:eZ,scriptIds:[...ej],action:ed,advancedSettings:{...ew,buildSettingOverrides:e,...R?{codeCoverage:!0,parseTestResults:!0}:{},..."TEST_WITHOUT_BUILDING"===ed?{priorBuildForTestingId:eG,priorTestProductsPath:null,priorXctestrunPath:null}:{}},exportWhenComplete:!R&&"ARCHIVE"===ed&&ey,exportSettings:"ARCHIVE"===ed?eC:null,requestId:(0,T.e)()}});d(!1);let r=t.startBuild??t.startWorktreeCoverage;if(!r)throw Error(H("startBuildFailed"));c(r.id)}catch(e){eP(e instanceof Error?e.message:String(e))}finally{eB(!1)}}};return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(w.N,{onOpenChange:d,open:o,children:(0,t.jsxs)(w.d,{className:"max-h-[90vh] grid-cols-[minmax(0,1fr)] overflow-y-auto sm:max-w-5xl",children:[(0,t.jsxs)(w.s,{children:[(0,t.jsx)(w.F,{children:H(R?"startWorktreeCoverage":"startBuild")}),(0,t.jsx)(w.C,{children:H(R?"startWorktreeCoverageDescription":"startBuildDescription")})]}),e$&&(0,t.jsx)(x.J,{variant:"destructive",children:(0,t.jsx)(x.p,{children:e$})}),eO&&(0,t.jsx)(x.J,{children:(0,t.jsx)(x.p,{children:eO})}),eA?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(N.f,{})," ",H("loading")]}):z?(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("section",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("configuration")}),(0,t.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[z.configurations.map(e=>(0,t.jsxs)("button",{className:`rounded-xl border p-3 text-left transition-colors ${e.id===eF?"border-primary bg-primary/5":"hover:bg-muted/50"}`,"aria-pressed":e.id===eF,onClick:()=>{e.id!==er&&(eU.current+=1),el(!1),es(e.id),ec(R?"TEST":e.defaultAction),ek(e.advancedSettings??{}),eE(JSON.stringify(e.advancedSettings?.buildSettingOverrides??{})),eS(!!(!R&&"ARCHIVE"===e.defaultAction&&e.autoExport)),eN({...O.A,...e.exportSettings??{}})},type:"button",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(P.f,{iconKey:e.iconKey}),e.name]}),(0,t.jsx)(f.f,{variant:(eu[e.id]??e.observation)?.status==="VALID"?"success":"outline",children:H(`parseStatuses.${(eu[e.id]??e.observation)?.status??"UNPARSED"}`)})]}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[e.scheme," · ",e.buildConfiguration]})]},e.id)),(0,t.jsxs)("button",{type:"button","aria-pressed":"__custom__"===eF,className:`rounded-xl border p-3 text-left ${"__custom__"===eF?"border-primary bg-primary/5":"hover:bg-muted/50"}`,onClick:()=>el(!0),children:[(0,t.jsx)("span",{className:"font-medium",children:H("custom")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:H("customDescription")})]})]})]}),ei&&(0,t.jsx)(E.B,{inline:!0,codebaseId:e,worktreeId:i,configuration:ea,open:ei,onOpenChange:el,onSaved:async()=>{},onCustom:e=>{en(e),es("__custom__"),ec(R?"TEST":e.defaultAction),ek(e.advancedSettings),eE(JSON.stringify(e.advancedSettings.buildSettingOverrides??{})),eS(!!e.autoExport),eN({...O.A,...e.exportSettings})}}),!ei&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("destinationType")}),(0,t.jsx)(I.i,{value:eg,onValueChange:e=>{e_.current=e,ex(e);let t=em.find(t=>t.type===e)?.id??"";eM.current=t,eb(t)},children:(0,t.jsxs)(I.U,{children:[(0,t.jsxs)(I.k,{value:"PHYSICAL_DEVICE",children:[(0,t.jsx)(u.f,{}),H("physicalDevice")]}),(0,t.jsxs)(I.k,{value:"SIMULATOR",disabled:"ARCHIVE"===ed,children:[(0,t.jsx)(h.f,{}),H("simulator")]})]})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("device")}),(0,t.jsxs)(C.d,{disabled:!eX.length,onValueChange:e=>{eM.current=e,eb(e)},value:ef,children:[(0,t.jsx)(C.P,{children:(0,t.jsx)(C.U,{placeholder:H("selectDevice")})}),(0,t.jsx)(C.r,{children:eX.map(e=>(0,t.jsxs)(C.T,{value:e.id,children:[e.generic?"SIMULATOR"===e.type?H("anySimulator"):H("anyPhysicalDevice"):e.name,e.osVersion?` \xb7 ${e.osVersion}`:""]},e.id))})]})]})]}),z.allowedScripts.length>0&&(0,t.jsxs)("section",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("scripts")}),(0,t.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:z.allowedScripts.map(({script:e})=>(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded-lg border p-2",children:[(0,t.jsx)(v.f,{checked:ej.has(e.id),onCheckedChange:t=>{ev(r=>{let s=new Set(r);return t?s.add(e.id):s.delete(e.id),s})}}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,t.jsx)(P.f,{iconKey:e.iconKey??null})," ",e.name]}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.preBuildScript?H("preBuild"):"",e.preBuildScript&&e.postBuildScript?" · ":"",e.postBuildScript?H("postBuild"):""]})]})]},e.id))})]}),(0,t.jsxs)("details",{className:"rounded-xl border p-3",children:[(0,t.jsx)("summary",{className:"cursor-pointer font-medium",children:H("details")}),(0,t.jsxs)("div",{className:"mt-4 space-y-4",children:[eq&&(0,t.jsx)(j.N,{children:(0,t.jsxs)(j.O,{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate font-mono text-xs",title:eq.source.relativePath,children:eq.source.relativePath}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[eq.scheme," ·"," ",eq.buildConfiguration]}),Y&&(0,t.jsxs)("p",{className:"truncate text-xs text-muted-foreground",title:`${Y.name} (${Y.hostname})`,children:[H("agent"),": ",Y.name]})]}),(0,t.jsxs)(b.K,{disabled:eT,onClick:()=>"__custom__"===eq.id?el(!0):void eY(eq),size:"sm",type:"button",variant:"outline",children:[eT?(0,t.jsx)(N.f,{}):(0,t.jsx)(l.f,{})," ",H("reparse")]})]}),eV?.error&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:eV.error})]})}),(0,t.jsxs)("div",{className:(0,B.f)("space-y-2",R&&"hidden"),children:[(0,t.jsx)(y.f,{children:H("action")}),(0,t.jsxs)(C.d,{onValueChange:e=>{e!==ed&&(eU.current+=1),ec(e),"ARCHIVE"!==e&&eS(!1)},value:ed,children:[(0,t.jsx)(C.P,{children:(0,t.jsx)(C.U,{})}),(0,t.jsx)(C.r,{children:_.map(e=>(0,t.jsx)(C.T,{value:e,children:H(`actions.${e}`)},e))})]})]}),!R&&"ARCHIVE"===ed&&(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(v.f,{checked:ey,onCheckedChange:e=>eS(!!e)}),H("exportWhenComplete")]}),ey&&(0,t.jsx)(O.O,{onChange:eN,onParseSigningRequirements:eQ,value:eC},er)]}),"TEST_WITHOUT_BUILDING"===ed&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("priorBuildForTesting")}),(0,t.jsxs)(C.d,{disabled:ee||!eH.length,onValueChange:e=>ek(t=>({...t,priorBuildForTestingId:e,priorTestProductsPath:null,priorXctestrunPath:null})),value:eG??"",children:[(0,t.jsx)(C.P,{children:(0,t.jsx)(C.U,{placeholder:H("selectPriorBuildForTesting")})}),(0,t.jsx)(C.r,{children:eH.map(e=>(0,t.jsxs)(C.T,{value:e.id,children:[(0,W.l)(e.createdAt,"short",{locale:G})," ","· ",e.id]},e.id))})]}),ee&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)(N.f,{})," ",H("loading")]}),!ee&&!eH.length&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:H("noPriorBuildForTesting")})]}),["TEST","BUILD_FOR_TESTING","TEST_WITHOUT_BUILDING"].includes(ed)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("testPlan")}),(0,t.jsxs)(C.d,{onValueChange:e=>ek(t=>({...t,testPlan:"__SCHEME_DEFAULT__"===e?null:e})),value:String(ew.testPlan??"__SCHEME_DEFAULT__"),children:[(0,t.jsx)(C.P,{children:(0,t.jsx)(C.U,{})}),(0,t.jsxs)(C.r,{children:[(0,t.jsx)(C.T,{value:"__SCHEME_DEFAULT__",children:H("schemeDefaultTestPlan")}),"string"==typeof ew.testPlan&&ew.testPlan&&!eV?.testPlans.includes(ew.testPlan)&&(0,t.jsxs)(C.T,{value:ew.testPlan,children:[ew.testPlan," ·"," ",H("savedValueUnavailable")]}),eV?.testPlans.map(e=>(0,t.jsx)(C.T,{value:e,children:e},e))]})]})]}),(0,t.jsxs)("div",{className:"mt-4 grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{htmlFor:"development-team",children:H("developmentTeam")}),(0,t.jsx)(k.f,{id:"development-team",onChange:e=>ek(t=>({...t,developmentTeam:e.target.value||null})),value:String(ew.developmentTeam??"")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("packageResolution")}),(0,t.jsxs)(C.d,{onValueChange:e=>ek(t=>({...t,packageResolution:e})),value:String(ew.packageResolution??"DEFAULT"),children:[(0,t.jsx)(C.P,{children:(0,t.jsx)(C.U,{})}),(0,t.jsx)(C.r,{children:["DEFAULT","RESOLVED_ONLY","SKIP_UPDATES","DISABLE_AUTOMATIC"].map(e=>(0,t.jsx)(C.T,{value:e,children:e},e))})]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2",children:[(0,t.jsx)(v.f,{checked:R||!!ew.codeCoverage,disabled:R,onCheckedChange:e=>ek(t=>({...t,codeCoverage:!!e}))}),H("codeCoverage")]}),["TEST","TEST_WITHOUT_BUILDING"].includes(ed)&&(0,t.jsxs)("label",{className:"flex items-center gap-2",children:[(0,t.jsx)(v.f,{checked:R||!1!==ew.parseTestResults,disabled:R,onCheckedChange:e=>ek(t=>({...t,parseTestResults:!!e}))}),H("parseTestResults")]}),(0,t.jsxs)("label",{className:"flex items-center gap-2",children:[(0,t.jsx)(v.f,{checked:!!ew.allowProvisioningUpdates,onCheckedChange:e=>ek(t=>({...t,allowProvisioningUpdates:!!e}))}),H("allowProvisioningUpdates")]}),(0,t.jsx)($.f,{id:"collect-dsyms",onChange:e=>ek(t=>({...t,collectDsyms:e})),value:ew.collectDsyms}),(0,t.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,t.jsx)(y.f,{htmlFor:"build-setting-overrides",children:H("buildSettingOverrides")}),(0,t.jsx)(A.f,{className:"font-mono text-xs",id:"build-setting-overrides",onChange:e=>eE(e.target.value),rows:4,value:eI})]})]}),(0,t.jsxs)("section",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:H("commandPreview")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-lg bg-muted p-3 text-xs whitespace-pre-wrap",children:e0})]})]})]})]})]}):(0,t.jsx)(x.J,{children:(0,t.jsx)(x.p,{children:H("noConfigurations")})}),(0,t.jsxs)("div",{className:"space-y-2",children:[K?(0,t.jsx)(a.n,{settings:K,value:F??(0,s.b)(K,eg),onValueChange:e=>{"INHERIT"!==e&&V(e)}}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:q??"Loading server URLs…"}),(0,t.jsx)(a.s,{})]}),(0,t.jsxs)(w.c,{children:[(0,t.jsx)(b.K,{onClick:()=>d(!1),type:"button",variant:"outline",children:H("cancel")}),(0,t.jsxs)(b.K,{disabled:eA||eW||ei||!eq||!K||!(0,s.C)(K).some(e=>e.kind===(F??(0,s.b)(K,eg)))||!eZ||"TEST_WITHOUT_BUILDING"===ed&&!eG,onClick:()=>void e1(),type:"button",children:[eW&&(0,t.jsx)(N.f,{})," ",H("startBuild")]})]})]})})})}e.s(["G",0,function({codebaseId:e,worktreeId:r,disabled:s,disabledReason:a,buildSettingsHref:n,onStarted:l,size:o="sm"}){let d=(0,p.f)("builds"),[c,u]=(0,g.useState)(!1),[h,m]=(0,g.useState)(!1),x=(0,g.useRef)(null),[f]=(0,g.useState)(()=>new Map),j=()=>{null!==x.current&&(window.clearTimeout(x.current),x.current=null)},v=()=>{j(),m(!0)},w=()=>{j(),x.current=window.setTimeout(()=>m(!1),150)};return(0,g.useEffect)(()=>()=>{null!==x.current&&window.clearTimeout(x.current)},[]),(0,t.jsxs)(t.Fragment,{children:[s&&n?(0,t.jsxs)(S.V,{onOpenChange:m,open:h,children:[(0,t.jsx)(S.r,{asChild:!0,children:(0,t.jsxs)(b.K,{"aria-disabled":"true","aria-expanded":h,"aria-haspopup":"dialog",className:"cursor-not-allowed opacity-50",onClick:v,onFocus:v,onMouseEnter:v,onMouseLeave:w,size:o,title:a??void 0,type:"button",children:[(0,t.jsx)(i.f,{})," ",d("build")]})}),(0,t.jsx)(S.T,{align:"start",className:"w-auto max-w-64 p-2 text-xs",onBlurCapture:w,onFocusCapture:j,onMouseEnter:j,onMouseLeave:w,onOpenAutoFocus:e=>e.preventDefault(),side:"top",children:(0,t.jsx)(R.L,{className:"font-medium underline-offset-4 hover:underline",href:n,children:d("configureBuilds")})})]}):(0,t.jsxs)(b.K,{disabled:s,onClick:()=>u(!0),size:o,title:a??void 0,type:"button",children:[(0,t.jsx)(i.f,{})," ",d("build")]}),c&&(0,t.jsx)(M,{codebaseId:e,destinationCache:f,onOpenChange:u,onStarted:e=>l?.(e),open:c,worktreeId:r})]})},"H",0,function({codebaseId:e,worktreeId:r,disabled:s,onStarted:a}){let n=(0,p.f)("builds"),[i,l]=(0,g.useState)(!1),[o]=(0,g.useState)(()=>new Map);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.K,{disabled:s,onClick:()=>l(!0),type:"button",children:[(0,t.jsx)(c,{})," ",n("generateWorktreeCoverage")]}),i&&(0,t.jsx)(M,{codebaseId:e,coverageMode:!0,destinationCache:o,onOpenChange:l,onStarted:e=>a?.(e),open:i,worktreeId:r})]})}],448295)},227286,539531,e=>{var t=e.i(843476),r=e.i(716327),s=e.i(395925),a=e.i(948148),n=e.i(271645),i=e.i(519455),l=e.i(755146),o=e.i(987968),d=e.i(637611),c=e.i(390673),u=e.i(762525);e.s(["f",0,function({pipelines:e,onChanged:h}){let m=(0,a.f)("gitlabPages"),p=(0,a.f)("pullRequests"),[g,x]=(0,n.useState)(null),[f,b]=(0,n.useState)(null),[j,v]=(0,n.useState)(null),w=(0,n.useRef)(!1);if(!e.length)return null;let k=(0,u.r)(e.map(e=>e.status)),y=e=>e.stopPropagation(),S=async e=>{if(!w.current&&e.canRetry){w.current=!0,x(e.id),b(null),v(null);try{let t=(await (0,d.W)("mutation GitLabWorktreePipelineRetry($projectId: ID!, $pipelineId: ID!) { runGitLabPipelineAction(projectId: $projectId, pipelineId: $pipelineId, action: RETRY) { pipeline { id } execution { id status message } } }",{projectId:e.projectId,pipelineId:e.id})).runGitLabPipelineAction.execution;if(t){let e=`${t.status}: ${t.message??""}`;["FAILED","PARTIAL","UNCERTAIN"].includes(t.status)?b(e):v(e)}await h?.()}catch(e){b(e instanceof Error?e.message:String(e))}finally{w.current=!1,x(null)}}};return(0,t.jsxs)(l.G,{children:[(0,t.jsx)(l.X,{asChild:!0,children:(0,t.jsxs)(i.K,{"aria-label":`${m("pipelines")}: ${m(`pipelineStatuses.${k}`)}`,className:`h-5 rounded-full px-2 py-0.5 text-xs ${(0,u.d)(k)}`,onClick:y,variant:"outline",children:[m(`pipelineStatuses.${k}`),(0,t.jsx)(r.f,{className:"size-3"})]})}),(0,t.jsxs)(l.L,{align:"start",className:"w-80 max-w-[calc(100vw-2rem)]",onClick:y,children:[(0,t.jsx)(l.B,{children:m("pipelines")}),(0,t.jsx)(l.U,{}),f&&(0,t.jsx)("p",{className:"px-2 py-1.5 text-xs break-words text-destructive",role:"alert",children:f}),j&&(0,t.jsx)("p",{className:"px-2 py-1.5 text-xs break-words text-muted-foreground",role:"status",children:j}),(0,t.jsx)("div",{className:"space-y-1 p-1",children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md px-2 py-2 hover:bg-muted",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(l.r,{asChild:!0,className:"gap-1 p-0 font-medium",children:(0,t.jsx)("a",{className:"hover:underline",href:e.webUrl,rel:"noreferrer",target:"_blank",children:(0,t.jsxs)("span",{className:"truncate",children:["#",e.iid??e.id," · ",e.ref]})})}),(0,t.jsxs)("span",{className:"block text-xs text-muted-foreground",children:[(0,t.jsx)(c.g,{source:e.source})," ·"," ",(0,t.jsx)(c.a,{status:e.status})]})]}),(0,t.jsxs)(l.r,{"aria-busy":g===e.id,className:(0,i.i)({size:"sm",variant:"outline"}),disabled:null!==g||!e.canRetry,onSelect:t=>{t.preventDefault(),S(e)},children:[g===e.id?(0,t.jsx)(o.f,{"aria-hidden":"true"}):(0,t.jsx)(s.f,{}),g===e.id?p("retrying"):m("retry")]})]},e.id))})]})]})}],227286);var h=e.i(772436),m=e.i(975157);e.s(["f",0,function({first:e,second:r}){let s=(0,n.useRef)(null),[a,i]=(0,n.useState)({paired:!1,inline:!1});return(0,n.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>{let t=[...e.children].filter(e=>e instanceof HTMLElement&&void 0===e.dataset.quickActionsSeparator),r=2===t.length,[s,a]=t,n=r&&s.getBoundingClientRect().bottom>a.getBoundingClientRect().top;i(e=>e.paired===r&&e.inline===n?e:{paired:r,inline:n})};t();let r=new ResizeObserver(t);for(let t of(r.observe(e),e.children))r.observe(t);let a=new MutationObserver(t);return a.observe(e,{childList:!0,subtree:!0}),()=>{r.disconnect(),a.disconnect()}}),(0,t.jsxs)("div",{className:"flex w-full flex-wrap items-center gap-2",ref:s,children:[e,a.paired&&(0,t.jsx)(h.f,{className:(0,m.f)(!a.inline&&"invisible"),"data-quick-actions-separator":"",orientation:"vertical"}),r]})}],539531)},501416,e=>{let t,r,s,a,n,i,l,o,d,c,u;var h=e.i(843476),m=e.i(119002),p=e.i(489002),g=e.i(482022),x=e.i(948148),f=e.i(271645),b=e.i(929592),j=e.i(519455),v=e.i(755146),w=e.i(987968),k=e.i(687862),y=e.i(520133),S=e.i(637611),C=e.i(975157),N=e.i(997778);let I={activeRuns:[],error:null,loaded:!1},E=e=>({resourceKind:e.resourceKind.trim().toUpperCase(),resourceId:e.resourceId.trim()}),A=e=>{let t=E(e);return JSON.stringify([t.resourceKind,t.resourceId])},R=`query WorkflowTargetSummaries($targets: [WorkflowTargetSummaryInput!]!) {
|
|
36
36
|
workflowTargetSummaries(targets: $targets) {
|
|
37
37
|
resourceKind resourceId
|
|
38
38
|
activeRuns { id workflowId displayNumber status }
|
|
39
39
|
}
|
|
40
|
-
}`,T=(s=new Map,a=new Set,
|
|
40
|
+
}`,T=(s=new Map,a=new Set,n=e=>s.get(A(e.target))===e&&e.consumers.size>0,i=e=>{for(let t of e.consumers)t()},l=e=>{if(!e.dirty&&!e.inFlight){for(let t of e.waiters)t();e.waiters.clear()}},o=()=>{void 0===t&&[...s.values()].some(e=>e.dirty&&!e.inFlight)&&(t=setTimeout(()=>{t=void 0,u()},0))},d=e=>{n(e)&&(e.dirty=!0,o())},c=async e=>{let t={entries:e,controller:new AbortController};for(let r of(a.add(t),e))r.dirty=!1,r.inFlight=!0;try{let r=await (0,S.W)(R,{targets:e.map(e=>e.target)},{signal:t.controller.signal}),s=new Map(r.workflowTargetSummaries.map(e=>[A(e),e]));for(let t of e){if(!n(t))continue;let e=s.get(A(t.target));if(!e)throw Error("Workflow target summary missing from response");t.snapshot={activeRuns:e.activeRuns,error:null,loaded:!0},i(t)}}catch(r){if(!t.controller.signal.aborted)for(let t of e)n(t)&&(t.snapshot={...t.snapshot,error:r instanceof Error?r.message:String(r)},i(t))}finally{for(let r of(a.delete(t),e))r.inFlight=!1,l(r);o()}},u=async()=>{let e=[...s.values()].filter(e=>e.dirty&&!e.inFlight);await Promise.all(Array.from({length:Math.ceil(e.length/200)},(t,r)=>c(e.slice(200*r,(r+1)*200))))},{snapshot:e=>s.get(A(e))?.snapshot??I,refresh:e=>{let t=s.get(A(e));return t?new Promise(e=>{t.waiters.add(e),d(t)}):Promise.resolve()},subscribe(e,i){let l=E(e),c=A(l),u=s.get(c);u||(u={target:l,consumers:new Set,snapshot:I,dirty:!0,inFlight:!1,waiters:new Set},s.set(c,u)),u.consumers.add(i),u.disposeRuns||(u.disposeRuns=(0,S.p)().subscribe({query:`subscription WorkflowTargetRuns($kind: String!, $resourceId: ID!) {
|
|
41
41
|
workflowChanges(resourceKind: $kind, resourceId: $resourceId) { definitionsChanged }
|
|
42
|
-
}`,variables:{kind:u.target.resourceKind,resourceId:u.target.resourceId}},{next:e=>{e.data?.workflowChanges.definitionsChanged||d(u)},error:()=>void 0,complete:()=>void 0})),r??=(0,S.g)(()=>{for(let e of s.values())d(e)}),o();let h=u,m=!1;return()=>{if(!m){if(m=!0,h.consumers.delete(
|
|
42
|
+
}`,variables:{kind:u.target.resourceKind,resourceId:u.target.resourceId}},{next:e=>{e.data?.workflowChanges.definitionsChanged||d(u)},error:()=>void 0,complete:()=>void 0})),r??=(0,S.g)(()=>{for(let e of s.values())d(e)}),o();let h=u,m=!1;return()=>{if(!m){if(m=!0,h.consumers.delete(i),!h.consumers.size){for(let e of(h.disposeRuns?.(),s.delete(c),h.waiters))e();for(let e of(h.waiters.clear(),a))e.entries.some(n)||e.controller.abort()}s.size||(r?.(),r=void 0,void 0!==t&&clearTimeout(t),t=void 0)}}}});function D({worktreeId:e,sessionData:t,workflows:r,className:s}){let a=(0,x.f)("workflows"),n=function(e){let{resourceKind:t,resourceId:r}=e,s=(0,f.useCallback)(e=>T.subscribe({resourceKind:t,resourceId:r},e),[t,r]),a=(0,f.useCallback)(()=>T.snapshot({resourceKind:t,resourceId:r}),[t,r]),n=(0,f.useCallback)(()=>T.refresh({resourceKind:t,resourceId:r}),[t,r]);return{...(0,f.useSyncExternalStore)(s,a,()=>I),refresh:n}}({resourceKind:"WORKTREE",resourceId:e}),[i,l]=(0,f.useState)(null),[o,d]=(0,f.useState)(null),[c,u]=(0,f.useState)(null),E={};for(let e of n.activeRuns)(E[e.workflowId]??=[]).push(e);let A=async(r,s)=>{l(r.id),u(null);try{await (0,S.W)(`mutation RunWorktreeQuickAction($input: TriggerWorkflowInput!) {
|
|
43
43
|
triggerWorkflow(input: $input) { id }
|
|
44
|
-
}`,{input:{workflowId:r.id,sessionData:t,resourceKind:"WORKTREE",resourceId:e,subjectKey:`WORKTREE:${e}`,choice:s}}),await
|
|
44
|
+
}`,{input:{workflowId:r.id,sessionData:t,resourceKind:"WORKTREE",resourceId:e,subjectKey:`WORKTREE:${e}`,choice:s}}),await n.refresh()}catch(e){u(e instanceof Error?e.message:String(e))}finally{l(null)}},R=async(e,t)=>{d(e),u(null);try{await (0,S.W)(`mutation WorktreeQuickActionLifecycle($id: ID!) { ${"pause"===t?"pauseWorkflowRun":"cancelWorkflowRun"}(id: $id) { id status } }`,{id:e}),await n.refresh()}catch(e){u(e instanceof Error?e.message:String(e))}finally{d(null)}},W=c??n.error;return(0,h.jsxs)("div",{className:(0,C.f)("w-full space-y-2",s),children:[(0,h.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(e=>{let t=E[e.id]??[],r=t.length>0||i===e.id;return(0,h.jsxs)("div",{className:"flex",children:[t.length>0&&(0,h.jsxs)(v.G,{children:[(0,h.jsx)(v.X,{asChild:!0,children:(0,h.jsxs)(j.K,{"aria-label":a("manageRuns",{name:e.name}),className:"rounded-r-none",size:"sm",variant:"outline",children:[(0,h.jsx)(w.f,{}),t.length>1&&(0,h.jsx)("span",{className:"text-xs tabular-nums",children:t.length})]})}),(0,h.jsx)(v.L,{align:"start",className:"min-w-48",children:t.map((e,r)=>(0,h.jsxs)("div",{children:[r>0&&(0,h.jsx)(v.U,{}),t.length>1&&(0,h.jsx)(v.B,{className:"text-xs text-muted-foreground",children:a("runNumber",{number:e.displayNumber})}),["RUNNING","WAITING","BLOCKED"].includes(e.status)&&(0,h.jsxs)(v.r,{disabled:null!==o,onSelect:()=>void R(e.id,"pause"),children:[(0,h.jsx)(m.f,{}),a("pause")]}),(0,h.jsxs)(v.r,{disabled:null!==o,onSelect:()=>void R(e.id,"cancel"),children:[(0,h.jsx)(p.f,{}),a("cancelRun")]}),(0,h.jsx)(v.r,{asChild:!0,children:(0,h.jsxs)(y.L,{href:`/dashboard/workflows/runs/${e.id}`,children:[(0,h.jsx)(g.f,{}),a("quickActionView")]})})]},e.id))})]}),(0,h.jsx)(N.f,{button:(0,h.jsxs)(j.K,{className:t.length>0?"-ml-px rounded-l-none":void 0,disabled:null!==i,size:"sm",title:r?a("startAnotherRun",{name:e.name}):e.description||e.name,variant:e.quickActionButtonVariant,children:[i===e.id?(0,h.jsx)(w.f,{}):(0,h.jsx)(k.f,{iconKey:e.quickActionIconKey}),e.name]}),choices:e.triggerChoices??[],hasPlainTrigger:e.hasPlainTrigger??!1,onRun:t=>void A(e,t)})]},e.id)})}),W&&(0,h.jsx)(b.J,{variant:"destructive",children:(0,h.jsx)(b.p,{children:W})})]})}e.s(["f",0,function(e){return e.workflows.length?(0,h.jsx)(D,{...e}):null}],501416)},966264,e=>{var t=e.i(843476),r=e.i(113030),s=e.i(741120),a=e.i(948148),n=e.i(271645),i=e.i(460461),l=e.i(346194),o=e.i(698411),d=e.i(762525),c=e.i(929592),u=e.i(519455),h=e.i(257428),m=e.i(776639),p=e.i(793479),g=e.i(110204),x=e.i(967489),f=e.i(987968),b=e.i(624687),j=e.i(637611),v=e.i(440289);let w="__none__",k="__github_account_default__";function y(e){return e instanceof Error?e.message:String(e)}function S({worktree:e,disabled:s,onCompleted:i}){let l,c=(0,a.f)("gitlabPages"),[h,m]=(0,n.useState)(!1),p=e.sourceControlRequest;if(!p?.projectId)return null;let g=(l=e.sourceControlRequest,l?.provider==="GITLAB"&&!l.isDraft&&"mergeable"===l.detailedMergeStatus&&!(e.gitLabPipelines??[]).some(e=>(0,d.c)(e.status)));return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.K,{size:"sm",variant:"outline",disabled:s,onClick:()=>m(!0),children:[(0,t.jsx)(r.f,{}),c(g?"merge":"autoMerge")]}),(0,t.jsx)(o.f,{mergeRequest:{projectId:p.projectId,iid:p.number,title:p.title},worktreeId:e.id,onMerged:i,open:h,onOpenChange:m})]})}function C({worktree:e,disabled:s,onCompleted:o,onError:d}){let h,v=(0,a.f)("worktrees"),w=(0,a.f)("pullRequests"),S=e.pullRequest,N=e.autoMerge,I=N&&N.branch===e.branch&&(!S||N.pullRequestNumber===S.number&&N.repositoryNameWithOwner.toLowerCase()===S.repositoryNameWithOwner.toLowerCase())?N:null,[E,A]=(0,n.useState)(!1),[R,T]=(0,n.useState)(!1),D=S?.repositoryNameWithOwner,W=S?.number,[B,$]=(0,n.useState)(!1),[P,O]=(0,n.useState)(!1),[L,U]=(0,n.useState)(null),[_,M]=(0,n.useState)(null),[K,q]=(0,n.useState)(""),[F,V]=(0,n.useState)(""),[H,G]=(0,n.useState)(""),[z,J]=(0,n.useState)(k),[Y,Q]=(0,n.useState)(!1),[X,Z]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{if(!E||!D||!W)return;let t=!0,[r="",s=""]=D.split("/",2),a=window.setTimeout(()=>{$(!0),M(null),U(null),(0,j.W)(`query GitHubPullRequestMergeOptions(
|
|
45
45
|
$owner: String!
|
|
46
46
|
$name: String!
|
|
47
47
|
$number: Int!
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
name: $name
|
|
55
55
|
number: $number
|
|
56
56
|
) {
|
|
57
|
-
${
|
|
57
|
+
${i.S}
|
|
58
58
|
availableMethods commitEmails defaultCommitEmail
|
|
59
59
|
defaultCommitHeadline defaultCommitBody canMerge
|
|
60
60
|
canEnableAutoMerge autoMergeEnabled viewerCanDisableAutoMerge
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
}`,{input:{worktreeId:e.id,repositoryNameWithOwner:S.repositoryNameWithOwner,pullRequestNumber:S.number,method:K,commitHeadline:F,commitBody:H,authorEmail:z===k?null:z,deleteWorktree:Y,moveTicketToDone:X}}),d(null),A(!1),await o()}catch(e){U(y(e))}finally{O(!1)}}},er=async()=>{O(!0),U(null);try{await (0,j.W)(`mutation CancelWorktreeAutoMerge($worktreeId: ID!) {
|
|
74
74
|
cancelWorktreeAutoMerge(worktreeId: $worktreeId)
|
|
75
|
-
}`,{worktreeId:e.id}),d(null),A(!1),await o()}catch(e){U(y(e))}finally{O(!1)}},es=I?.state==="ACTION_REQUIRED",ea=I?.state==="COMPLETED";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.K,{className:I&&!es?"bg-emerald-600 text-white hover:bg-emerald-700":void 0,disabled:!S||s&&!I||ea,onClick:e=>{e.stopPropagation(),$(!0),M(null),U(null),A(!0)},size:"sm",type:"button",variant:es?"destructive":I?"default":"outline",children:[(0,t.jsx)(r.f,{}),v(ea?"autoMergeComplete":es?"autoMergePaused":I?"autoMerging":"autoMerge")]}),(0,t.jsx)(m.N,{onOpenChange:e=>!P&&A(e),open:E,children:(0,t.jsxs)(m.d,{className:"sm:max-w-xl",children:[(0,t.jsxs)(m.s,{children:[(0,t.jsx)(m.F,{children:v("autoMergeTitle")}),(0,t.jsx)(m.C,{children:v("autoMergeDescription")})]}),!B&&(_||L)?(0,t.jsxs)("div",{className:"space-y-4",children:[(L||I?.lastError)&&(0,t.jsx)(c.J,{variant:"destructive",children:(0,t.jsx)(c.p,{children:L||I?.lastError})}),_&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:w("mergeType")}),(0,t.jsxs)(x.d,{disabled:P||ee,onValueChange:e=>q(e),value:K,children:[(0,t.jsx)(x.P,{children:(0,t.jsx)(x.U,{})}),(0,t.jsx)(x.r,{children:_.availableMethods.map(e=>(0,t.jsx)(x.T,{value:e,children:w(`mergeTypes.${e}`)},e))})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:w("commitMessage")}),(0,t.jsx)(p.f,{disabled:P||ee,onChange:e=>V(e.target.value),value:F})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:w("commitDescription")}),(0,t.jsx)(b.f,{className:"min-h-24",disabled:P||ee,onChange:e=>G(e.target.value),value:H})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:w("commitEmail")}),(0,t.jsxs)(x.d,{disabled:P||ee,onValueChange:J,value:z,children:[(0,t.jsx)(x.P,{children:(0,t.jsx)(x.U,{})}),(0,t.jsxs)(x.r,{children:[(0,t.jsx)(x.T,{value:k,children:w("githubDefaultEmail")}),_.commitEmails.map(e=>(0,t.jsx)(x.T,{value:e,children:e},e))]})]})]}),(0,t.jsx)(
|
|
75
|
+
}`,{worktreeId:e.id}),d(null),A(!1),await o()}catch(e){U(y(e))}finally{O(!1)}},es=I?.state==="ACTION_REQUIRED",ea=I?.state==="COMPLETED";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.K,{className:I&&!es?"bg-emerald-600 text-white hover:bg-emerald-700":void 0,disabled:!S||s&&!I||ea,onClick:e=>{e.stopPropagation(),$(!0),M(null),U(null),A(!0)},size:"sm",type:"button",variant:es?"destructive":I?"default":"outline",children:[(0,t.jsx)(r.f,{}),v(ea?"autoMergeComplete":es?"autoMergePaused":I?"autoMerging":"autoMerge")]}),(0,t.jsx)(m.N,{onOpenChange:e=>!P&&A(e),open:E,children:(0,t.jsxs)(m.d,{className:"sm:max-w-xl",children:[(0,t.jsxs)(m.s,{children:[(0,t.jsx)(m.F,{children:v("autoMergeTitle")}),(0,t.jsx)(m.C,{children:v("autoMergeDescription")})]}),!B&&(_||L)?(0,t.jsxs)("div",{className:"space-y-4",children:[(L||I?.lastError)&&(0,t.jsx)(c.J,{variant:"destructive",children:(0,t.jsx)(c.p,{children:L||I?.lastError})}),_&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:w("mergeType")}),(0,t.jsxs)(x.d,{disabled:P||ee,onValueChange:e=>q(e),value:K,children:[(0,t.jsx)(x.P,{children:(0,t.jsx)(x.U,{})}),(0,t.jsx)(x.r,{children:_.availableMethods.map(e=>(0,t.jsx)(x.T,{value:e,children:w(`mergeTypes.${e}`)},e))})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:w("commitMessage")}),(0,t.jsx)(p.f,{disabled:P||ee,onChange:e=>V(e.target.value),value:F})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:w("commitDescription")}),(0,t.jsx)(b.f,{className:"min-h-24",disabled:P||ee,onChange:e=>G(e.target.value),value:H})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:w("commitEmail")}),(0,t.jsxs)(x.d,{disabled:P||ee,onValueChange:J,value:z,children:[(0,t.jsx)(x.P,{children:(0,t.jsx)(x.U,{})}),(0,t.jsxs)(x.r,{children:[(0,t.jsx)(x.T,{value:k,children:w("githubDefaultEmail")}),_.commitEmails.map(e=>(0,t.jsx)(x.T,{value:e,children:e},e))]})]})]}),(0,t.jsx)(i.y,{options:_,disabled:P||ee,deleteWorktree:Y,moveTicketToDone:X,onDeleteWorktreeChange:Q,onMoveTicketToDoneChange:Z})]})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)(f.f,{})," ",w("loadingMergeOptions")]}),(0,t.jsxs)(m.c,{children:[I&&(0,t.jsx)(u.K,{disabled:P,onClick:()=>void er(),type:"button",variant:"destructive",children:v("cancelAutoMerge")}),(0,t.jsx)(u.K,{disabled:P,onClick:()=>A(!1),type:"button",variant:"outline",children:v("cancel")}),(0,t.jsxs)(u.K,{disabled:B||P||!K||!F.trim()||!ee&&X&&!_?.ticketDoneStatusConfigured||!I&&!_?.canEnableAutoMerge,onClick:()=>void et(),type:"button",children:[P&&(0,t.jsx)(f.f,{}),v(es?"resumeAutoMerge":"saveAutoMerge")]})]})]})})]})}e.s(["o",0,function(e){return e.worktree.sourceControlRequest?.provider==="GITLAB"?(0,t.jsx)(S,{...e}):(0,t.jsx)(C,{...e})},"b",0,function({worktree:e,conflictWorkflows:r,disabled:i,onCompleted:l,onError:o}){let d=(0,a.f)("worktrees"),p=e.autoSync,[b,k]=(0,n.useState)(!1),[S,C]=(0,n.useState)(!1),[N,I]=(0,n.useState)(!1),[E,A]=(0,n.useState)(null),[R,T]=(0,n.useState)(!1),[D,W]=(0,n.useState)(w),[B,$]=(0,n.useState)(w),P=(0,n.useMemo)(()=>r.find(e=>e.id===D),[r,D]),O=async()=>{C(!0),A(null);try{await (0,j.W)(`mutation ConfigureWorktreeAutoSync(
|
|
76
76
|
$input: ConfigureWorktreeAutoSyncInput!
|
|
77
77
|
) {
|
|
78
78
|
configureWorktreeAutoSync(input: $input) {
|
|
@@ -83,37 +83,37 @@
|
|
|
83
83
|
cancelWorktreeAutoSync(worktreeId: $worktreeId)
|
|
84
84
|
}`,{worktreeId:e.id}),o(null),k(!1),await l()}catch(e){A(y(e))}finally{C(!1)}},U=async()=>{C(!0),A(null);try{let t=await (0,j.W)(`mutation ForceWorktreeAutoSync($worktreeId: ID!, $requestId: ID!) {
|
|
85
85
|
forceWorktreeAutoSync(worktreeId: $worktreeId, requestId: $requestId) { id }
|
|
86
|
-
}`,{worktreeId:e.id,requestId:crypto.randomUUID()});await (0,v.t)(t.forceWorktreeAutoSync.id),o(null),k(!1),await l()}catch(e){A(y(e)),await l().catch(()=>void 0)}finally{I(!1),C(!1)}},_=p?.state==="PAUSED";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.K,{className:p&&!_?"bg-emerald-600 text-white hover:bg-emerald-700":void 0,disabled:n&&!p,onClick:e=>{e.stopPropagation(),A(null),I(!1),T(!!p?.conflictWorkflowId),W(p?.conflictWorkflowId??w),$(p?.conflictWorkflowChoice??w),k(!0)},size:"sm",type:"button",variant:_?"destructive":p?"default":"outline",children:[(0,t.jsx)(s.f,{}),d(_?"autoSyncPaused":p?"autoSyncing":"autoSync")]}),(0,t.jsx)(m.N,{onOpenChange:e=>{S||k(e),e||I(!1)},open:b,children:(0,t.jsxs)(m.d,{className:"sm:max-w-xl",children:[(0,t.jsxs)(m.s,{children:[(0,t.jsx)(m.F,{children:d("autoSyncTitle")}),(0,t.jsx)(m.C,{children:d("autoSyncDescription")})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(E||p?.lastError)&&(0,t.jsx)(c.J,{variant:"destructive",children:(0,t.jsx)(c.p,{children:E||p?.lastError})}),(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(h.f,{checked:R,disabled:S||0===r.length,id:`auto-sync-workflow-${e.id}`,onCheckedChange:e=>T(!!e)}),(0,t.jsx)(g.f,{htmlFor:`auto-sync-workflow-${e.id}`,children:d("useConflictWorkflow")})]}),R&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:d("selectConflictWorkflow")}),(0,t.jsxs)(x.d,{disabled:S,onValueChange:e=>{W(e),$(w)},value:D,children:[(0,t.jsx)(x.P,{children:(0,t.jsx)(x.U,{})}),(0,t.jsxs)(x.r,{children:[(0,t.jsx)(x.T,{value:w,children:d("noWorkflow")}),r.map(e=>(0,t.jsx)(x.T,{value:e.id,children:e.name},e.id))]})]})]}),P?.triggerChoices&&P.triggerChoices.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:d("conflictWorkflowChoice")}),(0,t.jsxs)(x.d,{disabled:S,onValueChange:$,value:B,children:[(0,t.jsx)(x.P,{children:(0,t.jsx)(x.U,{})}),(0,t.jsxs)(x.r,{children:[P.hasPlainTrigger&&(0,t.jsx)(x.T,{value:w,children:d("defaultWorkflowTrigger")}),P.triggerChoices.map(e=>(0,t.jsx)(x.T,{value:e.key,children:e.label},e.key))]})]})]})]})]}),(0,t.jsxs)(m.c,{children:[p?.state==="PAUSED"&&"PREPARATION_CONFLICT"===p.pauseReason&&(0,t.jsxs)(u.K,{disabled:S,onClick:()=>{N?U():I(!0)},type:"button",variant:"destructive",children:[S&&(0,t.jsx)(f.f,{})," ",d(N?"confirmForceSyncPreparations":"forceSyncPreparations")]}),p&&(0,t.jsx)(u.K,{disabled:S,onClick:()=>void L(),type:"button",variant:"destructive",children:d("cancelAutoSync")}),(0,t.jsx)(u.K,{disabled:S,onClick:()=>k(!1),type:"button",variant:"outline",children:d("cancel")}),(0,t.jsxs)(u.K,{disabled:S||R&&D===w||!!(R&&P?.triggerChoices?.length&&!P.hasPlainTrigger&&B===w),onClick:()=>void O(),type:"button",children:[S&&(0,t.jsx)(f.f,{}),d(_?"resumeAutoSync":"saveAutoSync")]})]})]})})]})}])},942230,e=>{var t=e.i(843476),r=e.i(716327),s=e.i(434322),a=e.i(550420),i=e.i(948148),n=e.i(271645),l=e.i(487486),o=e.i(816484);e.i(983632);var d=e.i(272563),c=e.i(605345),u=e.i(142811),h=e.i(987968),m=e.i(784774),p=e.i(975157),g=e.i(462777),x=e.i(637611),f=e.i(455329),b=e.i(508734),j=e.i(487812);function v({children:e,file:r,commit:s}){let a=(0,i.f)("worktrees"),[l,o]=(0,n.useState)(!1),[d,c]=(0,n.useState)(!1),u=e=>{c(!1),(0,g.d)(e).then(()=>o(!1)).catch(()=>c(!0))},h=r?.folder.includes("\\")?"\\":"/",m=r?`${r.folder.replace(/[\\/]+$/,"")}${h}${r.path.replaceAll("/",h)}`:"";return(0,t.jsxs)(j.c,{onOpenChange:e=>{o(e),c(!1)},open:l,children:[(0,t.jsx)(j.f,{asChild:!0,children:e}),(0,t.jsxs)(j.d,{className:"w-64","data-worktree-navigation-ignore":"true",onClick:e=>e.stopPropagation(),children:[r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(j.e,{onSelect:e=>{e.preventDefault(),u(m)},children:[(0,t.jsx)(b.f,{})," ",a("copyFilePath")]}),(0,t.jsxs)(j.e,{onSelect:e=>{e.preventDefault(),u(r.path)},children:[(0,t.jsx)(b.f,{})," ",a("copyRelativeFilePath")]})]}),r&&s&&(0,t.jsx)(j.M,{}),s&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(j.e,{onSelect:e=>{e.preventDefault(),u(s.sha.slice(0,8))},children:[(0,t.jsx)(b.f,{})," ",a("copyShortCommitHash")]}),(0,t.jsxs)(j.e,{onSelect:e=>{e.preventDefault(),u(s.sha)},children:[(0,t.jsx)(b.f,{})," ",a("copyFullCommitHash")]}),(0,t.jsxs)(j.e,{onSelect:e=>{e.preventDefault(),u(s.message??s.subject)},children:[(0,t.jsx)(b.f,{})," ",a("copyCommitMessage")]})]}),d&&(0,t.jsx)("p",{className:"px-2 py-1 text-xs text-destructive",role:"alert",children:a("copyChangeFailed")})]})]})}function w({detail:e,worktreeId:r,worktreeFolder:s}){let a=(0,i.f)("worktrees");return(0,t.jsxs)("div",{className:"w-full space-y-4 border-t pt-4","data-testid":"worktree-detail","data-worktree-navigation-ignore":"true",children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mb-2 font-medium",children:a("changes",{count:e.changes.length})}),(0,t.jsx)("div",{"aria-label":a("changes",{count:e.changes.length}),className:"max-h-80 divide-y overflow-auto rounded-md border",role:"group",children:e.changes.length?e.changes.map(e=>(0,t.jsx)(k,{change:e,worktreeId:r,worktreeFolder:s},e.path)):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:a("noChanges")})})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mb-2 font-medium",children:a("commits",{count:e.commits.length})}),(0,t.jsx)("div",{className:"max-h-80 overflow-auto rounded-md border",children:e.commits.length?(0,t.jsx)(m.s,{"aria-label":a("commits",{count:e.commits.length}),className:"min-w-[36rem] table-fixed text-xs",children:(0,t.jsx)(m.z,{children:e.commits.map(e=>(0,t.jsx)(v,{commit:e,children:(0,t.jsxs)(m.N,{children:[(0,t.jsx)(m.d,{className:"w-24 px-2 py-1.5 font-mono text-muted-foreground",children:e.sha.slice(0,8)}),(0,t.jsx)(m.d,{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:"min-w-0 flex-1 break-words whitespace-normal font-medium",children:e.subject}),(0,t.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[e.authorName," ·"," ",(0,t.jsx)(o.f,{value:e.authoredAt})]})]})}),(0,t.jsx)(m.d,{className:"w-24 px-2 py-1.5 text-right",children:(0,t.jsx)(T,{additions:e.additions,deletions:e.deletions})})]})},e.sha))})}):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:a("noCommits")})})]})]})}function k({change:e,worktreeId:r,worktreeFolder:s}){let a=(0,i.f)("worktrees");return(0,t.jsx)(y,{copyTarget:{file:{folder:s,path:e.path}},label:e.path,summary:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[e.conflicted&&(0,t.jsx)(l.f,{variant:"destructive",children:a("conflicted")}),e.staged&&(0,t.jsx)(R,{additions:e.stagedAdditions,deletions:e.stagedDeletions,label:a("staged")}),e.unstaged&&(0,t.jsx)(R,{additions:e.unstagedAdditions,deletions:e.unstagedDeletions,label:a("unstaged")}),e.untracked&&(0,t.jsx)(R,{additions:e.unstagedAdditions,deletions:e.unstagedDeletions,label:a("untracked")})]}),children:(0,t.jsxs)("div",{className:"space-y-3",children:[e.staged&&(0,t.jsx)(N,{label:a("staged"),path:e.path,previousPath:e.previousPath,scope:"STAGED",worktreeId:r}),e.unstaged&&(0,t.jsx)(N,{label:a("unstaged"),path:e.path,scope:"UNSTAGED",worktreeId:r}),e.untracked&&(0,t.jsx)(N,{label:a("untracked"),path:e.path,scope:"UNTRACKED",worktreeId:r})]})})}function y({label:e,prefix:s,summary:a,children:i,copyTarget:l}){let[o,d]=(0,n.useState)(!1);return(0,t.jsxs)("div",{children:[(0,t.jsx)(v,{...l,children:(0,t.jsxs)("button",{"aria-expanded":o,className:"flex min-h-8 w-full items-center gap-2 px-2 py-1.5 text-left hover:bg-muted/40",onClick:()=>d(e=>!e),type:"button",children:[(0,t.jsx)(r.f,{className:(0,p.f)("size-3.5 shrink-0 transition-transform",o&&"rotate-180")}),s&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:s}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",title:e,children:e}),(0,t.jsx)("span",{className:"shrink-0",children:a})]})}),o&&i&&(0,t.jsx)("div",{className:"border-t bg-muted/10 p-3",children:i})]})}function S({worktreeId:e,worktreeFolder:r,commit:s}){let{value:a,loading:i,error:n}=I(e,"COMMIT",null,null,s.sha);return i?(0,t.jsx)(E,{}):n?(0,t.jsx)(A,{value:n}):(0,t.jsx)("div",{className:"divide-y rounded-md border bg-background",children:a?.files.map(a=>(0,t.jsx)(C,{commit:s,file:a,scope:"COMMIT",worktreeId:e,worktreeFolder:r},`${a.previousPath??""}:${a.path}`))})}function C({file:e,worktreeId:r,worktreeFolder:i,scope:n,commit:o}){return(0,t.jsx)(y,{copyTarget:{file:{folder:i,path:e.path},commit:o},label:e.path,summary:(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[e.image?(0,t.jsx)(a.f,{className:"size-4"}):(0,t.jsx)(s.f,{className:"size-4"}),(0,t.jsx)(l.f,{variant:"outline",children:e.changeType}),(0,t.jsx)(T,{additions:e.additions,deletions:e.deletions})]}),children:(0,t.jsx)(N,{commitSha:o?.sha,path:e.path,previousPath:e.previousPath,scope:n,worktreeId:r})})}function N({label:e,worktreeId:r,path:s,previousPath:a,scope:n,commitSha:l}){let o=(0,i.f)("worktreeDetail"),h=(0,u.F)(),m=(0,u.V)(),{value:p,loading:g,error:x}=I(r,n,s,a??null,l??null),f=e=>{let t=new URLSearchParams({scope:n,path:s,side:e});return a&&t.set("previousPath",a),l&&t.set("commitSha",l),`/api/worktrees/${encodeURIComponent(r)}/diff-image?${t}`};return(0,t.jsxs)("div",{className:"space-y-2",children:[e&&(0,t.jsx)("p",{className:"text-xs font-medium uppercase text-muted-foreground",children:e}),g?(0,t.jsx)(E,{}):x?(0,t.jsx)(A,{value:x}):p?.image?(0,t.jsx)(d.f,{after:p.afterAvailable?f("AFTER"):null,before:p.beforeAvailable?f("BEFORE"):null,labels:m}):p?.patch?(0,t.jsx)(c.r,{labels:{...h,truncated:o("diffLimit")},mode:"UNIFIED",patch:p.patch,truncated:p.truncated,wrap:!1}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:o(p?.truncated?"diffTooLarge":p?.binary?"binaryFileChanged":"noTextChanges")})]})}function I(e,t,r,s,a){let[i,l]=(0,n.useState)(null),[o,d]=(0,n.useState)(!0),[c,u]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let i=!1;return(0,x.W)(f.S,{input:{worktreeId:e,scope:t,path:r,previousPath:s,commitSha:a,requestId:(0,g.e)()}}).then(e=>{i||l(e.inspectWorktreeDiff)}).catch(e=>{i||u(e instanceof Error?e.message:String(e))}).finally(()=>{i||d(!1)}),()=>{i=!0}},[a,r,s,t,e]),{value:i,loading:o,error:c}}function E(){let e=(0,i.f)("worktreeDetail");return(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(h.f,{})," ",e("loadingDiff")]})}function A({value:e}){return(0,t.jsx)("p",{className:"text-sm text-destructive",children:e})}function R({label:e,additions:r,deletions:s}){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 whitespace-nowrap text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)(T,{additions:r,deletions:s})]})}function T({additions:e,deletions:r}){return null===e&&null===r?(0,t.jsx)("span",{className:"text-muted-foreground",children:"—"}):(0,t.jsxs)("span",{className:"inline-flex gap-1 text-xs 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:["−",r??0]})]})}e.s(["n",0,function({files:e,truncated:r,worktreeId:s,worktreeFolder:a}){let n=(0,i.f)("worktreeDetail");return(0,t.jsxs)("div",{className:"space-y-3",children:[e.length?(0,t.jsx)("div",{className:"divide-y rounded-md border",children:e.map(e=>(0,t.jsx)(C,{file:e,scope:"BRANCH",worktreeId:s,worktreeFolder:a},`${e.previousPath??""}:${e.path}`))}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n("noBranchChanges")}),r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n("diffTruncated")})]})},"m",0,function({detail:e,worktreeId:r,worktreeFolder:s,inline:a=!1}){let n=(0,i.f)("worktrees");return a?(0,t.jsx)(w,{detail:e,worktreeId:r,worktreeFolder:s}):(0,t.jsxs)("div",{className:(0,p.f)("w-full space-y-4",a&&"border-t pt-4"),"data-testid":"worktree-detail","data-worktree-navigation-ignore":a?"true":void 0,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mb-2 font-medium",children:n("changes",{count:e.changes.length})}),(0,t.jsx)("div",{className:"divide-y rounded-md border",children:e.changes.length?e.changes.map(e=>(0,t.jsx)(k,{change:e,worktreeId:r,worktreeFolder:s},e.path)):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:n("noChanges")})})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mb-2 font-medium",children:n("commits",{count:e.commits.length})}),(0,t.jsx)("div",{className:"divide-y rounded-md border",children:e.commits.length?e.commits.map(e=>(0,t.jsx)(y,{copyTarget:{commit:e},label:e.subject,prefix:e.sha.slice(0,8),summary:(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.authorName," · ",(0,t.jsx)(o.f,{value:e.authoredAt})," ","·"," ",(0,t.jsx)(T,{additions:e.additions,deletions:e.deletions})]}),children:r?(0,t.jsx)(S,{commit:e,worktreeId:r,worktreeFolder:s}):null},e.sha)):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:n("noCommits")})})]}),(e.commitsTruncated||e.changesTruncated)&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n("truncated")})]})}],942230)},753790,e=>{var t=e.i(843476),r=e.i(263676),s=e.i(948148),a=e.i(929592),i=e.i(519455);e.s(["f",0,function({error:e,onDismiss:n}){let l=(0,s.f)("worktrees");return e?(0,t.jsxs)(a.J,{variant:"destructive",children:[(0,t.jsx)(a.p,{children:e}),n&&(0,t.jsx)(a.x,{children:(0,t.jsx)(i.K,{"aria-label":l("dismissError"),onClick:n,size:"icon-xs",variant:"ghost",children:(0,t.jsx)(r.X,{})})})]}):null}])},453154,5406,e=>{var t=e.i(843476),r=e.i(689664),s=e.i(867927),a=e.i(482022),i=e.i(263676),n=e.i(948148),l=e.i(271645),o=e.i(487486),d=e.i(519455),c=e.i(987968),u=e.i(520133);let h={STARTING:"submitting",QUEUED:"queued",RUNNING:"running",CANCELLING:"cancelling",SUCCEEDED:"succeeded",FAILED:"failed",CANCELLED:"cancelled",TIMED_OUT:"timedOut",SKIPPED:"skipped",UNREPORTED:"failed",SUBMISSION_FAILED:"failed"},m={ACTIVE_OPERATION:"skipActive",OFFLINE:"skipOffline",UNSUPPORTED:"skipUnsupported",MISSING:"skipMissing",NOT_REPOSITORY:"skipNotRepository",ORIGIN_MISMATCH:"skipOriginMismatch",ERROR:"skipError"};function p(e){return["STARTING","QUEUED","RUNNING","CANCELLING"].includes(e.status)}function g(e){return["FAILED","CANCELLED","TIMED_OUT","UNREPORTED","SUBMISSION_FAILED"].includes(e.status)}e.s(["f",0,function({batch:e,onDismiss:x,onRetry:f}){let b=(0,n.f)("worktrees.fetchProgress"),j=(0,l.useId)(),v=["starting","fetching","refreshing"].includes(e.phase),w=e.rows.filter(e=>!p(e)).length,k=e.rows.filter(e=>"SUCCEEDED"===e.status).length,y=e.rows.filter(g).length,S=e.rows.filter(e=>"SKIPPED"===e.status).length,C=e.rows.some(e=>e.worktreeRefreshError),N=e.rows.some(e=>"SUCCEEDED"===e.status&&!e.worktreesRefreshedAt&&!e.worktreeRefreshError),I=b("progress",{completed:w,total:e.rows.length});return(0,l.useEffect)(()=>{if("finished"!==e.phase)return;let t=window.setTimeout(x,3e3);return()=>window.clearTimeout(t)},[e.id,e.phase,x]),(0,t.jsxs)("section",{"aria-labelledby":j,className:"rounded-xl border bg-card p-4 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 space-y-1",role:"status","aria-live":"polite","aria-atomic":"true",children:[(0,t.jsxs)("h2",{id:j,className:"flex items-center gap-2 font-medium",children:[v?(0,t.jsx)(c.f,{"aria-hidden":"true"}):"finished"!==e.phase||y||C||N?null:(0,t.jsx)(r.f,{className:"size-4 text-emerald-600"}),b(e.phase)]}),(0,t.jsx)("p",{children:I}),(0,t.jsx)("p",{className:"text-muted-foreground",children:b("summary",{succeeded:k,failed:y,skipped:S})})]}),!v&&(0,t.jsx)(d.K,{"aria-label":b("dismiss"),onClick:x,size:"icon-sm",variant:"ghost",children:(0,t.jsx)(i.X,{})})]}),(0,t.jsx)("progress",{"aria-label":I,className:"mt-3 h-1.5 w-full accent-primary",max:Math.max(1,e.rows.length),value:w}),e.monitoringError&&(0,t.jsxs)("p",{className:"mt-3 text-amber-700 dark:text-amber-300",children:[b("monitoring")," ",(0,t.jsx)("span",{className:"break-words",children:e.monitoringError})]}),e.monitoringMissingJobs>0&&(0,t.jsx)("p",{className:"mt-3 text-amber-700 dark:text-amber-300",children:b("statusUnavailable")}),C&&(0,t.jsx)("p",{className:"mt-3 text-amber-700 dark:text-amber-300",children:b("refreshWarning")}),e.legacyRefreshRequested&&N&&(0,t.jsx)("p",{className:"mt-3 text-amber-700 dark:text-amber-300",children:b("legacyWarning")}),e.legacyRefreshError&&(0,t.jsxs)("p",{className:"mt-3 break-words text-amber-700 dark:text-amber-300",children:[b("reconciledError")," ",e.legacyRefreshError]}),"refreshFailed"===e.phase&&(0,t.jsxs)("div",{className:"mt-3 space-y-2",role:"alert",children:[(0,t.jsxs)("p",{className:"break-words text-destructive",children:[b("pageUpdateError")," ",e.pageUpdateError]}),(0,t.jsx)(d.K,{onClick:f,size:"sm",variant:"outline",children:b("retry")})]}),"finished"===e.phase&&!C&&!N&&(0,t.jsx)("p",{className:"mt-2 text-muted-foreground",children:b("pageUpdated")}),(0,t.jsxs)("details",{className:"group mt-3",children:[(0,t.jsxs)("summary",{className:"flex w-fit cursor-pointer list-none items-center gap-1 rounded-sm font-medium focus-visible:outline-2 focus-visible:outline-offset-2 [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)(s.f,{className:"size-4 transition-transform group-open:rotate-90"}),b("details")]}),(0,t.jsx)("ul",{className:"mt-3 max-h-80 divide-y overflow-y-auto",children:e.rows.map(e=>(0,t.jsxs)("li",{className:"space-y-2 py-3 first:pt-0 last:pb-0",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("p",{className:"font-medium",children:[e.repositoryName," ",(0,t.jsxs)("span",{className:"font-normal text-muted-foreground",children:["· ",e.agentName]})]}),(0,t.jsx)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:e.folder})]}),(0,t.jsxs)(o.f,{variant:g(e)?"destructive":"SUCCEEDED"===e.status&&!e.worktreeRefreshError&&e.worktreesRefreshedAt?"success":"secondary",children:[p(e)&&(0,t.jsx)(c.f,{"aria-hidden":"true"}),b(h[e.status])]})]}),e.skipReason&&(0,t.jsx)("p",{className:"text-muted-foreground",children:m[e.skipReason]?b(m[e.skipReason]):b("skipUnknown",{reason:e.skipReason})}),e.error&&(0,t.jsx)("p",{className:"break-words text-destructive",children:e.error}),"UNREPORTED"===e.status&&(0,t.jsx)("p",{className:"text-destructive",children:b("notScheduled")}),"SUBMISSION_FAILED"===e.status&&(0,t.jsx)("p",{className:"text-destructive",children:b("submissionFailed")}),e.worktreeRefreshError&&(0,t.jsxs)("p",{className:"break-words text-amber-700 dark:text-amber-300",children:[b("refreshWarning")," ",e.worktreeRefreshError]}),e.jobId&&(0,t.jsx)(d.K,{asChild:!0,size:"sm",variant:"link",className:"h-auto px-0",children:(0,t.jsxs)(u.L,{href:`/dashboard/jobs/${e.jobId}`,target:"_blank",rel:"noreferrer",children:[b("logs")," ",(0,t.jsx)(a.f,{})]})})]},e.codebaseId))})]})]})}],453154);var x=e.i(462777),f=e.i(637611),b=e.i(944887);let j="id agentId payload status error result updatedAt",v=new Set(["SUCCEEDED","FAILED","CANCELLED","TIMED_OUT"]),w=new Set(["starting","fetching","refreshing"]),k={QUEUED:0,RUNNING:1,CANCELLING:2,SUCCEEDED:3,FAILED:3,CANCELLED:3,TIMED_OUT:3};function y(e){e.monitor?.dispose(),e.monitor=null,null!==e.interval&&window.clearInterval(e.interval),e.interval=null,e.unsubscribeRecovery?.(),e.unsubscribeRecovery=null,e.subscriptions.forEach(e=>e()),e.subscriptions.clear()}function S(e){e.controller.abort(),y(e)}function C(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}function N(e){return"string"==typeof e&&e.trim()?e:null}function I(e){return e instanceof Error?e.message:Array.isArray(e)?e.map(I).join("; "):N(C(e).message)??String(e)}function E(e,t){let r=C(t.result);return{...e,status:t.status,jobId:t.id,error:N(C(r.snapshot).error)??t.error,skipReason:null,worktreesRefreshedAt:N(r.worktreesRefreshedAt),worktreeRefreshError:N(r.worktreeRefreshError)}}e.s(["f",0,function({scopeKey:e,refreshPage:t}){let[r,s]=(0,l.useState)(null),a=(0,l.useRef)(null),i=(0,l.useRef)(null);r&&r.scopeKey!==e&&s(null),(0,l.useEffect)(()=>{let t={scopeKey:e};return i.current=t,()=>{i.current===t&&(i.current=null,a.current&&S(a.current),a.current=null)}},[e]);let n=(0,l.useCallback)(e=>a.current===e&&!e.controller.signal.aborted&&i.current?.scopeKey===e.scopeKey&&null!==i.current,[]),o=(0,l.useCallback)((e,t)=>{n(e)&&(e.batch={...e.batch,...t},s({scopeKey:e.scopeKey,batch:e.batch}))},[n]),d=(0,l.useCallback)(async e=>{if(n(e)){if(y(e),o(e,{phase:"refreshing",monitoringError:null,monitoringMissingJobs:0,pageUpdateError:null}),e.batch.rows.some(e=>"SUCCEEDED"===e.status&&!e.worktreesRefreshedAt&&!e.worktreeRefreshError)&&!e.batch.legacyRefreshRequested){o(e,{legacyRefreshRequested:!0});try{await (0,f.W)("mutation RefreshWorktreesAfterFetch { refreshWorktrees }",void 0,{signal:e.controller.signal})}catch(t){if(!n(e))return;o(e,{legacyRefreshError:I(t)})}}if(n(e))try{await e.refreshPage(),o(e,{phase:"finished"})}catch(t){o(e,{phase:"refreshFailed",pageUpdateError:I(t)})}}},[n,o]),c=(0,l.useCallback)(async r=>{if(!i.current||i.current.scopeKey!==e||a.current&&w.has(a.current.batch.phase))return;let s=[...new Map(r.map(e=>[e.codebaseId,e])).values()];if(!s.length)return;a.current&&S(a.current);let l={scopeKey:e,controller:new AbortController,jobs:new Map,monitor:null,interval:null,unsubscribeRecovery:null,subscriptions:new Map,refreshPage:t,batch:{id:(0,x.e)(),phase:"starting",rows:s.map(e=>({...e,status:"STARTING",jobId:null,error:null,skipReason:null,worktreesRefreshedAt:null,worktreeRefreshError:null})),monitoringError:null,monitoringMissingJobs:0,pageUpdateError:null,legacyRefreshRequested:!1,legacyRefreshError:null}};a.current=l,o(l,{});for(let e=0;e<s.length;e+=500){let t=s.slice(e,e+500).map(e=>e.codebaseId),r=new Set(t);try{let e=await (0,f.W)(`mutation FetchWorktreeCodebases($input: RunCodebaseOperationInput!) {
|
|
86
|
+
}`,{worktreeId:e.id,requestId:crypto.randomUUID()});await (0,v.t)(t.forceWorktreeAutoSync.id),o(null),k(!1),await l()}catch(e){A(y(e)),await l().catch(()=>void 0)}finally{I(!1),C(!1)}},_=p?.state==="PAUSED";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.K,{className:p&&!_?"bg-emerald-600 text-white hover:bg-emerald-700":void 0,disabled:i&&!p,onClick:e=>{e.stopPropagation(),A(null),I(!1),T(!!p?.conflictWorkflowId),W(p?.conflictWorkflowId??w),$(p?.conflictWorkflowChoice??w),k(!0)},size:"sm",type:"button",variant:_?"destructive":p?"default":"outline",children:[(0,t.jsx)(s.f,{}),d(_?"autoSyncPaused":p?"autoSyncing":"autoSync")]}),(0,t.jsx)(m.N,{onOpenChange:e=>{S||k(e),e||I(!1)},open:b,children:(0,t.jsxs)(m.d,{className:"sm:max-w-xl",children:[(0,t.jsxs)(m.s,{children:[(0,t.jsx)(m.F,{children:d("autoSyncTitle")}),(0,t.jsx)(m.C,{children:d("autoSyncDescription")})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(E||p?.lastError)&&(0,t.jsx)(c.J,{variant:"destructive",children:(0,t.jsx)(c.p,{children:E||p?.lastError})}),(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(h.f,{checked:R,disabled:S||0===r.length,id:`auto-sync-workflow-${e.id}`,onCheckedChange:e=>T(!!e)}),(0,t.jsx)(g.f,{htmlFor:`auto-sync-workflow-${e.id}`,children:d("useConflictWorkflow")})]}),R&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:d("selectConflictWorkflow")}),(0,t.jsxs)(x.d,{disabled:S,onValueChange:e=>{W(e),$(w)},value:D,children:[(0,t.jsx)(x.P,{children:(0,t.jsx)(x.U,{})}),(0,t.jsxs)(x.r,{children:[(0,t.jsx)(x.T,{value:w,children:d("noWorkflow")}),r.map(e=>(0,t.jsx)(x.T,{value:e.id,children:e.name},e.id))]})]})]}),P?.triggerChoices&&P.triggerChoices.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(g.f,{className:"mb-1.5 block",children:d("conflictWorkflowChoice")}),(0,t.jsxs)(x.d,{disabled:S,onValueChange:$,value:B,children:[(0,t.jsx)(x.P,{children:(0,t.jsx)(x.U,{})}),(0,t.jsxs)(x.r,{children:[P.hasPlainTrigger&&(0,t.jsx)(x.T,{value:w,children:d("defaultWorkflowTrigger")}),P.triggerChoices.map(e=>(0,t.jsx)(x.T,{value:e.key,children:e.label},e.key))]})]})]})]})]}),(0,t.jsxs)(m.c,{children:[p?.state==="PAUSED"&&"PREPARATION_CONFLICT"===p.pauseReason&&(0,t.jsxs)(u.K,{disabled:S,onClick:()=>{N?U():I(!0)},type:"button",variant:"destructive",children:[S&&(0,t.jsx)(f.f,{})," ",d(N?"confirmForceSyncPreparations":"forceSyncPreparations")]}),p&&(0,t.jsx)(u.K,{disabled:S,onClick:()=>void L(),type:"button",variant:"destructive",children:d("cancelAutoSync")}),(0,t.jsx)(u.K,{disabled:S,onClick:()=>k(!1),type:"button",variant:"outline",children:d("cancel")}),(0,t.jsxs)(u.K,{disabled:S||R&&D===w||!!(R&&P?.triggerChoices?.length&&!P.hasPlainTrigger&&B===w),onClick:()=>void O(),type:"button",children:[S&&(0,t.jsx)(f.f,{}),d(_?"resumeAutoSync":"saveAutoSync")]})]})]})})]})}])},942230,e=>{var t=e.i(843476),r=e.i(716327),s=e.i(434322),a=e.i(550420),n=e.i(948148),i=e.i(271645),l=e.i(487486),o=e.i(816484);e.i(983632);var d=e.i(272563),c=e.i(605345),u=e.i(142811),h=e.i(987968),m=e.i(784774),p=e.i(975157),g=e.i(462777),x=e.i(637611),f=e.i(455329),b=e.i(508734),j=e.i(487812);function v({children:e,file:r,commit:s}){let a=(0,n.f)("worktrees"),[l,o]=(0,i.useState)(!1),[d,c]=(0,i.useState)(!1),u=e=>{c(!1),(0,g.d)(e).then(()=>o(!1)).catch(()=>c(!0))},h=r?.folder.includes("\\")?"\\":"/",m=r?`${r.folder.replace(/[\\/]+$/,"")}${h}${r.path.replaceAll("/",h)}`:"";return(0,t.jsxs)(j.c,{onOpenChange:e=>{o(e),c(!1)},open:l,children:[(0,t.jsx)(j.f,{asChild:!0,children:e}),(0,t.jsxs)(j.d,{className:"w-64","data-worktree-navigation-ignore":"true",onClick:e=>e.stopPropagation(),children:[r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(j.e,{onSelect:e=>{e.preventDefault(),u(m)},children:[(0,t.jsx)(b.f,{})," ",a("copyFilePath")]}),(0,t.jsxs)(j.e,{onSelect:e=>{e.preventDefault(),u(r.path)},children:[(0,t.jsx)(b.f,{})," ",a("copyRelativeFilePath")]})]}),r&&s&&(0,t.jsx)(j.M,{}),s&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(j.e,{onSelect:e=>{e.preventDefault(),u(s.sha.slice(0,8))},children:[(0,t.jsx)(b.f,{})," ",a("copyShortCommitHash")]}),(0,t.jsxs)(j.e,{onSelect:e=>{e.preventDefault(),u(s.sha)},children:[(0,t.jsx)(b.f,{})," ",a("copyFullCommitHash")]}),(0,t.jsxs)(j.e,{onSelect:e=>{e.preventDefault(),u(s.message??s.subject)},children:[(0,t.jsx)(b.f,{})," ",a("copyCommitMessage")]})]}),d&&(0,t.jsx)("p",{className:"px-2 py-1 text-xs text-destructive",role:"alert",children:a("copyChangeFailed")})]})]})}function w({detail:e,worktreeId:r,worktreeFolder:s}){let a=(0,n.f)("worktrees");return(0,t.jsxs)("div",{className:"w-full space-y-4 border-t pt-4","data-testid":"worktree-detail","data-worktree-navigation-ignore":"true",children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mb-2 font-medium",children:a("changes",{count:e.changes.length})}),(0,t.jsx)("div",{"aria-label":a("changes",{count:e.changes.length}),className:"max-h-80 divide-y overflow-auto rounded-md border",role:"group",children:e.changes.length?e.changes.map(e=>(0,t.jsx)(k,{change:e,worktreeId:r,worktreeFolder:s},e.path)):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:a("noChanges")})})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mb-2 font-medium",children:a("commits",{count:e.commits.length})}),(0,t.jsx)("div",{className:"max-h-80 overflow-auto rounded-md border",children:e.commits.length?(0,t.jsx)(m.s,{"aria-label":a("commits",{count:e.commits.length}),className:"min-w-[36rem] table-fixed text-xs",children:(0,t.jsx)(m.z,{children:e.commits.map(e=>(0,t.jsx)(v,{commit:e,children:(0,t.jsxs)(m.N,{children:[(0,t.jsx)(m.d,{className:"w-24 px-2 py-1.5 font-mono text-muted-foreground",children:e.sha.slice(0,8)}),(0,t.jsx)(m.d,{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:"min-w-0 flex-1 break-words whitespace-normal font-medium",children:e.subject}),(0,t.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[e.authorName," ·"," ",(0,t.jsx)(o.f,{value:e.authoredAt})]})]})}),(0,t.jsx)(m.d,{className:"w-24 px-2 py-1.5 text-right",children:(0,t.jsx)(T,{additions:e.additions,deletions:e.deletions})})]})},e.sha))})}):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:a("noCommits")})})]})]})}function k({change:e,worktreeId:r,worktreeFolder:s}){let a=(0,n.f)("worktrees");return(0,t.jsx)(y,{copyTarget:{file:{folder:s,path:e.path}},label:e.path,summary:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[e.conflicted&&(0,t.jsx)(l.f,{variant:"destructive",children:a("conflicted")}),e.staged&&(0,t.jsx)(R,{additions:e.stagedAdditions,deletions:e.stagedDeletions,label:a("staged")}),e.unstaged&&(0,t.jsx)(R,{additions:e.unstagedAdditions,deletions:e.unstagedDeletions,label:a("unstaged")}),e.untracked&&(0,t.jsx)(R,{additions:e.unstagedAdditions,deletions:e.unstagedDeletions,label:a("untracked")})]}),children:(0,t.jsxs)("div",{className:"space-y-3",children:[e.staged&&(0,t.jsx)(N,{label:a("staged"),path:e.path,previousPath:e.previousPath,scope:"STAGED",worktreeId:r}),e.unstaged&&(0,t.jsx)(N,{label:a("unstaged"),path:e.path,scope:"UNSTAGED",worktreeId:r}),e.untracked&&(0,t.jsx)(N,{label:a("untracked"),path:e.path,scope:"UNTRACKED",worktreeId:r})]})})}function y({label:e,prefix:s,summary:a,children:n,copyTarget:l}){let[o,d]=(0,i.useState)(!1);return(0,t.jsxs)("div",{children:[(0,t.jsx)(v,{...l,children:(0,t.jsxs)("button",{"aria-expanded":o,className:"flex min-h-8 w-full items-center gap-2 px-2 py-1.5 text-left hover:bg-muted/40",onClick:()=>d(e=>!e),type:"button",children:[(0,t.jsx)(r.f,{className:(0,p.f)("size-3.5 shrink-0 transition-transform",o&&"rotate-180")}),s&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:s}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",title:e,children:e}),(0,t.jsx)("span",{className:"shrink-0",children:a})]})}),o&&n&&(0,t.jsx)("div",{className:"border-t bg-muted/10 p-3",children:n})]})}function S({worktreeId:e,worktreeFolder:r,commit:s}){let{value:a,loading:n,error:i}=I(e,"COMMIT",null,null,s.sha);return n?(0,t.jsx)(E,{}):i?(0,t.jsx)(A,{value:i}):(0,t.jsx)("div",{className:"divide-y rounded-md border bg-background",children:a?.files.map(a=>(0,t.jsx)(C,{commit:s,file:a,scope:"COMMIT",worktreeId:e,worktreeFolder:r},`${a.previousPath??""}:${a.path}`))})}function C({file:e,worktreeId:r,worktreeFolder:n,scope:i,commit:o}){return(0,t.jsx)(y,{copyTarget:{file:{folder:n,path:e.path},commit:o},label:e.path,summary:(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[e.image?(0,t.jsx)(a.f,{className:"size-4"}):(0,t.jsx)(s.f,{className:"size-4"}),(0,t.jsx)(l.f,{variant:"outline",children:e.changeType}),(0,t.jsx)(T,{additions:e.additions,deletions:e.deletions})]}),children:(0,t.jsx)(N,{commitSha:o?.sha,path:e.path,previousPath:e.previousPath,scope:i,worktreeId:r})})}function N({label:e,worktreeId:r,path:s,previousPath:a,scope:i,commitSha:l}){let o=(0,n.f)("worktreeDetail"),h=(0,u.F)(),m=(0,u.V)(),{value:p,loading:g,error:x}=I(r,i,s,a??null,l??null),f=e=>{let t=new URLSearchParams({scope:i,path:s,side:e});return a&&t.set("previousPath",a),l&&t.set("commitSha",l),`/api/worktrees/${encodeURIComponent(r)}/diff-image?${t}`};return(0,t.jsxs)("div",{className:"space-y-2",children:[e&&(0,t.jsx)("p",{className:"text-xs font-medium uppercase text-muted-foreground",children:e}),g?(0,t.jsx)(E,{}):x?(0,t.jsx)(A,{value:x}):p?.image?(0,t.jsx)(d.f,{after:p.afterAvailable?f("AFTER"):null,before:p.beforeAvailable?f("BEFORE"):null,labels:m}):p?.patch?(0,t.jsx)(c.r,{labels:{...h,truncated:o("diffLimit")},mode:"UNIFIED",patch:p.patch,truncated:p.truncated,wrap:!1}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:o(p?.truncated?"diffTooLarge":p?.binary?"binaryFileChanged":"noTextChanges")})]})}function I(e,t,r,s,a){let[n,l]=(0,i.useState)(null),[o,d]=(0,i.useState)(!0),[c,u]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let n=!1;return(0,x.W)(f.S,{input:{worktreeId:e,scope:t,path:r,previousPath:s,commitSha:a,requestId:(0,g.e)()}}).then(e=>{n||l(e.inspectWorktreeDiff)}).catch(e=>{n||u(e instanceof Error?e.message:String(e))}).finally(()=>{n||d(!1)}),()=>{n=!0}},[a,r,s,t,e]),{value:n,loading:o,error:c}}function E(){let e=(0,n.f)("worktreeDetail");return(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(h.f,{})," ",e("loadingDiff")]})}function A({value:e}){return(0,t.jsx)("p",{className:"text-sm text-destructive",children:e})}function R({label:e,additions:r,deletions:s}){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 whitespace-nowrap text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)(T,{additions:r,deletions:s})]})}function T({additions:e,deletions:r}){return null===e&&null===r?(0,t.jsx)("span",{className:"text-muted-foreground",children:"—"}):(0,t.jsxs)("span",{className:"inline-flex gap-1 text-xs 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:["−",r??0]})]})}e.s(["n",0,function({files:e,truncated:r,worktreeId:s,worktreeFolder:a}){let i=(0,n.f)("worktreeDetail");return(0,t.jsxs)("div",{className:"space-y-3",children:[e.length?(0,t.jsx)("div",{className:"divide-y rounded-md border",children:e.map(e=>(0,t.jsx)(C,{file:e,scope:"BRANCH",worktreeId:s,worktreeFolder:a},`${e.previousPath??""}:${e.path}`))}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("noBranchChanges")}),r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("diffTruncated")})]})},"m",0,function({detail:e,worktreeId:r,worktreeFolder:s,inline:a=!1}){let i=(0,n.f)("worktrees");return a?(0,t.jsx)(w,{detail:e,worktreeId:r,worktreeFolder:s}):(0,t.jsxs)("div",{className:(0,p.f)("w-full space-y-4",a&&"border-t pt-4"),"data-testid":"worktree-detail","data-worktree-navigation-ignore":a?"true":void 0,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mb-2 font-medium",children:i("changes",{count:e.changes.length})}),(0,t.jsx)("div",{className:"divide-y rounded-md border",children:e.changes.length?e.changes.map(e=>(0,t.jsx)(k,{change:e,worktreeId:r,worktreeFolder:s},e.path)):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:i("noChanges")})})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:"mb-2 font-medium",children:i("commits",{count:e.commits.length})}),(0,t.jsx)("div",{className:"divide-y rounded-md border",children:e.commits.length?e.commits.map(e=>(0,t.jsx)(y,{copyTarget:{commit:e},label:e.subject,prefix:e.sha.slice(0,8),summary:(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.authorName," · ",(0,t.jsx)(o.f,{value:e.authoredAt})," ","·"," ",(0,t.jsx)(T,{additions:e.additions,deletions:e.deletions})]}),children:r?(0,t.jsx)(S,{commit:e,worktreeId:r,worktreeFolder:s}):null},e.sha)):(0,t.jsx)("p",{className:"p-3 text-sm text-muted-foreground",children:i("noCommits")})})]}),(e.commitsTruncated||e.changesTruncated)&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("truncated")})]})}],942230)},753790,e=>{var t=e.i(843476),r=e.i(263676),s=e.i(948148),a=e.i(929592),n=e.i(519455);e.s(["f",0,function({error:e,onDismiss:i}){let l=(0,s.f)("worktrees");return e?(0,t.jsxs)(a.J,{variant:"destructive",children:[(0,t.jsx)(a.p,{children:e}),i&&(0,t.jsx)(a.x,{children:(0,t.jsx)(n.K,{"aria-label":l("dismissError"),onClick:i,size:"icon-xs",variant:"ghost",children:(0,t.jsx)(r.X,{})})})]}):null}])},453154,5406,e=>{var t=e.i(843476),r=e.i(689664),s=e.i(867927),a=e.i(482022),n=e.i(263676),i=e.i(948148),l=e.i(271645),o=e.i(487486),d=e.i(519455),c=e.i(987968),u=e.i(520133);let h={STARTING:"submitting",QUEUED:"queued",RUNNING:"running",CANCELLING:"cancelling",SUCCEEDED:"succeeded",FAILED:"failed",CANCELLED:"cancelled",TIMED_OUT:"timedOut",SKIPPED:"skipped",UNREPORTED:"failed",SUBMISSION_FAILED:"failed"},m={ACTIVE_OPERATION:"skipActive",OFFLINE:"skipOffline",UNSUPPORTED:"skipUnsupported",MISSING:"skipMissing",NOT_REPOSITORY:"skipNotRepository",ORIGIN_MISMATCH:"skipOriginMismatch",ERROR:"skipError"};function p(e){return["STARTING","QUEUED","RUNNING","CANCELLING"].includes(e.status)}function g(e){return["FAILED","CANCELLED","TIMED_OUT","UNREPORTED","SUBMISSION_FAILED"].includes(e.status)}e.s(["f",0,function({batch:e,onDismiss:x,onRetry:f}){let b=(0,i.f)("worktrees.fetchProgress"),j=(0,l.useId)(),v=["starting","fetching","refreshing"].includes(e.phase),w=e.rows.filter(e=>!p(e)).length,k=e.rows.filter(e=>"SUCCEEDED"===e.status).length,y=e.rows.filter(g).length,S=e.rows.filter(e=>"SKIPPED"===e.status).length,C=e.rows.some(e=>e.worktreeRefreshError),N=e.rows.some(e=>"SUCCEEDED"===e.status&&!e.worktreesRefreshedAt&&!e.worktreeRefreshError),I=b("progress",{completed:w,total:e.rows.length});return(0,l.useEffect)(()=>{if("finished"!==e.phase)return;let t=window.setTimeout(x,3e3);return()=>window.clearTimeout(t)},[e.id,e.phase,x]),(0,t.jsxs)("section",{"aria-labelledby":j,className:"rounded-xl border bg-card p-4 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 space-y-1",role:"status","aria-live":"polite","aria-atomic":"true",children:[(0,t.jsxs)("h2",{id:j,className:"flex items-center gap-2 font-medium",children:[v?(0,t.jsx)(c.f,{"aria-hidden":"true"}):"finished"!==e.phase||y||C||N?null:(0,t.jsx)(r.f,{className:"size-4 text-emerald-600"}),b(e.phase)]}),(0,t.jsx)("p",{children:I}),(0,t.jsx)("p",{className:"text-muted-foreground",children:b("summary",{succeeded:k,failed:y,skipped:S})})]}),!v&&(0,t.jsx)(d.K,{"aria-label":b("dismiss"),onClick:x,size:"icon-sm",variant:"ghost",children:(0,t.jsx)(n.X,{})})]}),(0,t.jsx)("progress",{"aria-label":I,className:"mt-3 h-1.5 w-full accent-primary",max:Math.max(1,e.rows.length),value:w}),e.monitoringError&&(0,t.jsxs)("p",{className:"mt-3 text-amber-700 dark:text-amber-300",children:[b("monitoring")," ",(0,t.jsx)("span",{className:"break-words",children:e.monitoringError})]}),e.monitoringMissingJobs>0&&(0,t.jsx)("p",{className:"mt-3 text-amber-700 dark:text-amber-300",children:b("statusUnavailable")}),C&&(0,t.jsx)("p",{className:"mt-3 text-amber-700 dark:text-amber-300",children:b("refreshWarning")}),e.legacyRefreshRequested&&N&&(0,t.jsx)("p",{className:"mt-3 text-amber-700 dark:text-amber-300",children:b("legacyWarning")}),e.legacyRefreshError&&(0,t.jsxs)("p",{className:"mt-3 break-words text-amber-700 dark:text-amber-300",children:[b("reconciledError")," ",e.legacyRefreshError]}),"refreshFailed"===e.phase&&(0,t.jsxs)("div",{className:"mt-3 space-y-2",role:"alert",children:[(0,t.jsxs)("p",{className:"break-words text-destructive",children:[b("pageUpdateError")," ",e.pageUpdateError]}),(0,t.jsx)(d.K,{onClick:f,size:"sm",variant:"outline",children:b("retry")})]}),"finished"===e.phase&&!C&&!N&&(0,t.jsx)("p",{className:"mt-2 text-muted-foreground",children:b("pageUpdated")}),(0,t.jsxs)("details",{className:"group mt-3",children:[(0,t.jsxs)("summary",{className:"flex w-fit cursor-pointer list-none items-center gap-1 rounded-sm font-medium focus-visible:outline-2 focus-visible:outline-offset-2 [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)(s.f,{className:"size-4 transition-transform group-open:rotate-90"}),b("details")]}),(0,t.jsx)("ul",{className:"mt-3 max-h-80 divide-y overflow-y-auto",children:e.rows.map(e=>(0,t.jsxs)("li",{className:"space-y-2 py-3 first:pt-0 last:pb-0",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("p",{className:"font-medium",children:[e.repositoryName," ",(0,t.jsxs)("span",{className:"font-normal text-muted-foreground",children:["· ",e.agentName]})]}),(0,t.jsx)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:e.folder})]}),(0,t.jsxs)(o.f,{variant:g(e)?"destructive":"SUCCEEDED"===e.status&&!e.worktreeRefreshError&&e.worktreesRefreshedAt?"success":"secondary",children:[p(e)&&(0,t.jsx)(c.f,{"aria-hidden":"true"}),b(h[e.status])]})]}),e.skipReason&&(0,t.jsx)("p",{className:"text-muted-foreground",children:m[e.skipReason]?b(m[e.skipReason]):b("skipUnknown",{reason:e.skipReason})}),e.error&&(0,t.jsx)("p",{className:"break-words text-destructive",children:e.error}),"UNREPORTED"===e.status&&(0,t.jsx)("p",{className:"text-destructive",children:b("notScheduled")}),"SUBMISSION_FAILED"===e.status&&(0,t.jsx)("p",{className:"text-destructive",children:b("submissionFailed")}),e.worktreeRefreshError&&(0,t.jsxs)("p",{className:"break-words text-amber-700 dark:text-amber-300",children:[b("refreshWarning")," ",e.worktreeRefreshError]}),e.jobId&&(0,t.jsx)(d.K,{asChild:!0,size:"sm",variant:"link",className:"h-auto px-0",children:(0,t.jsxs)(u.L,{href:`/dashboard/jobs/${e.jobId}`,target:"_blank",rel:"noreferrer",children:[b("logs")," ",(0,t.jsx)(a.f,{})]})})]},e.codebaseId))})]})]})}],453154);var x=e.i(462777),f=e.i(637611),b=e.i(944887);let j="id agentId payload status error result updatedAt",v=new Set(["SUCCEEDED","FAILED","CANCELLED","TIMED_OUT"]),w=new Set(["starting","fetching","refreshing"]),k={QUEUED:0,RUNNING:1,CANCELLING:2,SUCCEEDED:3,FAILED:3,CANCELLED:3,TIMED_OUT:3};function y(e){e.monitor?.dispose(),e.monitor=null,null!==e.interval&&window.clearInterval(e.interval),e.interval=null,e.unsubscribeRecovery?.(),e.unsubscribeRecovery=null,e.subscriptions.forEach(e=>e()),e.subscriptions.clear()}function S(e){e.controller.abort(),y(e)}function C(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}function N(e){return"string"==typeof e&&e.trim()?e:null}function I(e){return e instanceof Error?e.message:Array.isArray(e)?e.map(I).join("; "):N(C(e).message)??String(e)}function E(e,t){let r=C(t.result);return{...e,status:t.status,jobId:t.id,error:N(C(r.snapshot).error)??t.error,skipReason:null,worktreesRefreshedAt:N(r.worktreesRefreshedAt),worktreeRefreshError:N(r.worktreeRefreshError)}}e.s(["f",0,function({scopeKey:e,refreshPage:t}){let[r,s]=(0,l.useState)(null),a=(0,l.useRef)(null),n=(0,l.useRef)(null);r&&r.scopeKey!==e&&s(null),(0,l.useEffect)(()=>{let t={scopeKey:e};return n.current=t,()=>{n.current===t&&(n.current=null,a.current&&S(a.current),a.current=null)}},[e]);let i=(0,l.useCallback)(e=>a.current===e&&!e.controller.signal.aborted&&n.current?.scopeKey===e.scopeKey&&null!==n.current,[]),o=(0,l.useCallback)((e,t)=>{i(e)&&(e.batch={...e.batch,...t},s({scopeKey:e.scopeKey,batch:e.batch}))},[i]),d=(0,l.useCallback)(async e=>{if(i(e)){if(y(e),o(e,{phase:"refreshing",monitoringError:null,monitoringMissingJobs:0,pageUpdateError:null}),e.batch.rows.some(e=>"SUCCEEDED"===e.status&&!e.worktreesRefreshedAt&&!e.worktreeRefreshError)&&!e.batch.legacyRefreshRequested){o(e,{legacyRefreshRequested:!0});try{await (0,f.W)("mutation RefreshWorktreesAfterFetch { refreshWorktrees }",void 0,{signal:e.controller.signal})}catch(t){if(!i(e))return;o(e,{legacyRefreshError:I(t)})}}if(i(e))try{await e.refreshPage(),o(e,{phase:"finished"})}catch(t){o(e,{phase:"refreshFailed",pageUpdateError:I(t)})}}},[i,o]),c=(0,l.useCallback)(async r=>{if(!n.current||n.current.scopeKey!==e||a.current&&w.has(a.current.batch.phase))return;let s=[...new Map(r.map(e=>[e.codebaseId,e])).values()];if(!s.length)return;a.current&&S(a.current);let l={scopeKey:e,controller:new AbortController,jobs:new Map,monitor:null,interval:null,unsubscribeRecovery:null,subscriptions:new Map,refreshPage:t,batch:{id:(0,x.e)(),phase:"starting",rows:s.map(e=>({...e,status:"STARTING",jobId:null,error:null,skipReason:null,worktreesRefreshedAt:null,worktreeRefreshError:null})),monitoringError:null,monitoringMissingJobs:0,pageUpdateError:null,legacyRefreshRequested:!1,legacyRefreshError:null}};a.current=l,o(l,{});for(let e=0;e<s.length;e+=500){let t=s.slice(e,e+500).map(e=>e.codebaseId),r=new Set(t);try{let e=await (0,f.W)(`mutation FetchWorktreeCodebases($input: RunCodebaseOperationInput!) {
|
|
87
87
|
fetchCodebases(input: $input) {
|
|
88
88
|
jobs { ${j} }
|
|
89
89
|
skipped { codebaseId reason }
|
|
90
90
|
}
|
|
91
|
-
}`,{input:{codebaseIds:t,requestId:l.batch.id}},{signal:l.controller.signal});if(!
|
|
91
|
+
}`,{input:{codebaseIds:t,requestId:l.batch.id}},{signal:l.controller.signal});if(!i(l))return;let s=new Map;for(let t of e.fetchCodebases.jobs){let e=N(C(t.payload).codebaseId);e&&r.has(e)&&(s.set(e,t),l.jobs.set(t.id,t))}let a=new Map(e.fetchCodebases.skipped.map(e=>[e.codebaseId,e.reason]));o(l,{rows:l.batch.rows.map(e=>{if(!r.has(e.codebaseId))return e;let t=s.get(e.codebaseId);if(t)return E(e,t);let n=a.get(e.codebaseId);return{...e,status:void 0===n?"UNREPORTED":"SKIPPED",skipReason:n??null}})})}catch(e){if(!i(l))return;o(l,{rows:l.batch.rows.map(t=>r.has(t.codebaseId)?{...t,status:"SUBMISSION_FAILED",error:I(e)}:t)})}}if(!i(l))return;o(l,{phase:"fetching"});let c=()=>[...l.jobs.values()].filter(e=>!v.has(e.status)).map(e=>e.id),u=()=>{i(l)&&"fetching"===l.batch.phase&&!c().length&&d(l)},h=e=>{if(i(l)&&"fetching"===l.batch.phase){for(let t of e){let e=l.jobs.get(t.id);!(!e||v.has(e.status)&&e.status!==t.status||k[t.status]<k[e.status]||Date.parse(t.updatedAt)<Date.parse(e.updatedAt))&&(l.jobs.set(t.id,t),v.has(t.status)&&(l.subscriptions.get(t.id)?.(),l.subscriptions.delete(t.id)))}o(l,{rows:l.batch.rows.map(e=>{let t=e.jobId?l.jobs.get(e.jobId):null;return t?E(e,t):e})})}};if(!c().length)return void u();let m=(0,b.f)(async e=>{let t=0;try{let r=c();for(let s=0;s<r.length;s+=200){let a=r.slice(s,s+200),n=await (0,f.W)(`query WorktreeFetchJobs($ids: [ID!]!) {
|
|
92
92
|
agentJobsByIds(ids: $ids) { ${j} }
|
|
93
|
-
}`,{ids:a},{signal:e});if(e.aborted||!
|
|
93
|
+
}`,{ids:a},{signal:e});if(e.aborted||!i(l))return;let o=new Set(n.agentJobsByIds.map(e=>e.id));t+=a.filter(e=>!o.has(e)&&!v.has(l.jobs.get(e).status)).length,h(n.agentJobsByIds)}o(l,{monitoringError:null,monitoringMissingJobs:t})}catch(t){if(e.aborted||!i(l))return;o(l,{monitoringError:I(t)})}u()});l.monitor=m;let p=(0,f.p)();for(let e of c()){let t=p.subscribe({query:`subscription WorktreeFetchJobChanged($jobId: ID!) {
|
|
94
94
|
agentJobChanged(jobId: $jobId) { ${j} }
|
|
95
|
-
}`,variables:{jobId:e}},{next:e=>{
|
|
95
|
+
}`,variables:{jobId:e}},{next:e=>{i(l)&&e.data?.agentJobChanged&&(h([e.data.agentJobChanged]),u())},error:e=>{i(l)&&"fetching"===l.batch.phase&&(o(l,{monitoringError:I(e)}),m.refresh())},complete:()=>{i(l)&&"fetching"===l.batch.phase&&m.refresh()}});!i(l)||"fetching"!==l.batch.phase||v.has(l.jobs.get(e).status)?t():l.subscriptions.set(e,t)}i(l)&&"fetching"===l.batch.phase&&(l.interval=window.setInterval(()=>void m.refresh(),2e3),l.unsubscribeRecovery=(0,f.g)(()=>void m.refresh()),m.refresh())},[i,o,t,e,d]),u=(0,l.useCallback)(async()=>{let e=a.current;e&&i(e)&&"refreshFailed"===e.batch.phase&&await d(e)},[i,d]),h=(0,l.useCallback)(()=>{let e=a.current;!e||w.has(e.batch.phase)||(S(e),a.current=null,s(null))},[]),m=r&&r.scopeKey===e?r.batch:null;return{batch:m,active:null!==m&&w.has(m.phase),start:c,retryPageUpdate:u,dismiss:h}}],5406)},756283,e=>{var t=e.i(271645),r=e.i(462777),s=e.i(637611),a=e.i(455329);async function n(e){return(await (0,s.W)(a.y,{id:e,requestId:(0,r.e)()})).inspectWorktree}e.s(["I",0,n,"L",0,function(e){let[r,s]=(0,t.useState)(null),a=(0,t.useCallback)(t=>{s(r=>({sourceUpdatedAt:e.updatedAt,value:r?.sourceUpdatedAt===e.updatedAt?{...r.value,...t}:t}))},[e.updatedAt]),n=(0,t.useCallback)(e=>{let t={};null!==e.hasStagedChanges&&(t.hasStagedChanges=e.hasStagedChanges),null!==e.hasUnstagedChanges&&(t.hasUnstagedChanges=e.hasUnstagedChanges),null!==e.rebaseInProgress&&(t.rebaseInProgress=e.rebaseInProgress),null!==e.hasConflicts&&(t.hasConflicts=e.hasConflicts),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&&a(t)},[a]);return{worktree:r?.sourceUpdatedAt===e.updatedAt?{...e,...r.value}:e,applyActivity:n,setUnstagedChanges:(0,t.useCallback)(e=>a({hasUnstagedChanges:e}),[a])}},"x",0,function(e){let r=(0,t.useRef)(!1),s=(0,t.useRef)(!1);return(0,t.useCallback)(async()=>{if(r.current){s.current=!0;return}r.current=!0;try{do s.current=!1,await e();while(s.current)}finally{r.current=!1}},[e])},"q",0,function(e,r,a){let n=(0,t.useRef)(a);(0,t.useEffect)(()=>{n.current=a},[a]),(0,t.useEffect)(()=>{if(!r)return;let t=!1,a=0,i=null,l=()=>void 0,o=e=>{t||e!==a||null!==i||(i=window.setTimeout(()=>{i=null,d()},1e3))},d=()=>{let t=++a;l=(0,s.p)().subscribe({query:`subscription WorktreeInspectionChanged($worktreeId: ID!) {
|
|
96
96
|
worktreeInspectionChanged(worktreeId: $worktreeId) {
|
|
97
97
|
worktreeId branch headSha upstream ahead behind syncState baseAhead baseBehind
|
|
98
98
|
hasStagedChanges hasUnstagedChanges rebaseInProgress hasConflicts pushStatus observedAt
|
|
99
99
|
}
|
|
100
|
-
}`,variables:{worktreeId:e}},{next:e=>{let t=e.data?.worktreeInspectionChanged;t&&
|
|
100
|
+
}`,variables:{worktreeId:e}},{next:e=>{let t=e.data?.worktreeInspectionChanged;t&&n.current(t)},error:()=>o(t),complete:()=>o(t)})};return d(),()=>{t=!0,a+=1,null!==i&&window.clearTimeout(i),l()}},[r,e])}])},941179,e=>{var t=e.i(843476),r=e.i(113030),s=e.i(263676),a=e.i(271645),n=e.i(948148),i=e.i(501416),l=e.i(519455),o=e.i(906197),d=e.i(987968),c=e.i(462777),u=e.i(637611),h=e.i(440289);e.s(["f",0,function({worktree:e,group:m,onCompleted:p,onError:g}){let x=(0,n.f)("worktrees"),[f,b]=(0,a.useState)(!1);if(!e.rebaseInProgress)return null;let j=m.mergeConflictQuickActions??[],v=async()=>{b(!0);try{let t=await (0,u.W)(`mutation CancelWorktreeRebase($input: RunWorktreeOperationInput!) {
|
|
101
101
|
runWorktreeOperation(input: $input) { id }
|
|
102
|
-
}`,{input:{worktreeId:e.id,operation:"CANCEL_REBASE",requestId:(0,c.e)()}});await (0,h.t)(t.runWorktreeOperation.id),await p(),g(null)}catch(e){g(e instanceof Error?e.message:String(e))}finally{b(!1)}};return(0,t.jsxs)(o.M,{className:"border-destructive/40 bg-[color-mix(in_oklab,var(--destructive)_8%,var(--card))]",size:"sm",variant:"outline",children:[(0,t.jsx)(o.Y,{variant:"icon",children:(0,t.jsx)(r.f,{className:"text-destructive"})}),(0,t.jsxs)(o.H,{children:[(0,t.jsx)(o.$,{children:x("rebasePaused")}),(0,t.jsx)(o.B,{children:x(e.hasConflicts?"rebaseConflicts":"rebaseIncomplete")})]}),(0,t.jsx)(o.P,{children:(0,t.jsxs)(l.K,{disabled:f,onClick:()=>void v(),size:"sm",variant:"outline",children:[f?(0,t.jsx)(d.f,{}):(0,t.jsx)(s.X,{}),x("cancelRebase")]})}),e.hasConflicts&&j.length?(0,t.jsx)(o.o,{className:"-mx-3 -mb-2.5 basis-[calc(100%+(var(--spacing)*6))] rounded-b-lg border-t border-destructive/30 bg-[color-mix(in_oklab,var(--destructive)_16%,var(--card))] px-3 py-2.5",children:(0,t.jsx)(
|
|
102
|
+
}`,{input:{worktreeId:e.id,operation:"CANCEL_REBASE",requestId:(0,c.e)()}});await (0,h.t)(t.runWorktreeOperation.id),await p(),g(null)}catch(e){g(e instanceof Error?e.message:String(e))}finally{b(!1)}};return(0,t.jsxs)(o.M,{className:"border-destructive/40 bg-[color-mix(in_oklab,var(--destructive)_8%,var(--card))]",size:"sm",variant:"outline",children:[(0,t.jsx)(o.Y,{variant:"icon",children:(0,t.jsx)(r.f,{className:"text-destructive"})}),(0,t.jsxs)(o.H,{children:[(0,t.jsx)(o.$,{children:x("rebasePaused")}),(0,t.jsx)(o.B,{children:x(e.hasConflicts?"rebaseConflicts":"rebaseIncomplete")})]}),(0,t.jsx)(o.P,{children:(0,t.jsxs)(l.K,{disabled:f,onClick:()=>void v(),size:"sm",variant:"outline",children:[f?(0,t.jsx)(d.f,{}):(0,t.jsx)(s.X,{}),x("cancelRebase")]})}),e.hasConflicts&&j.length?(0,t.jsx)(o.o,{className:"-mx-3 -mb-2.5 basis-[calc(100%+(var(--spacing)*6))] rounded-b-lg border-t border-destructive/30 bg-[color-mix(in_oklab,var(--destructive)_16%,var(--card))] px-3 py-2.5",children:(0,t.jsx)(i.f,{sessionData:{worktree:{id:e.id,path:e.folder,branch:e.branch,baseBranch:e.baseBranch,headSha:e.headSha,rebaseInProgress:!0,hasConflicts:!0},codebase:{id:m.codebase.id,folder:m.codebase.folder},repo:{id:m.repository.id,name:m.repository.name,url:m.repository.displayOrigin,displayOrigin:m.repository.displayOrigin}},worktreeId:e.id,workflows:j})}):null]})}])},474040,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(424995),a=e.i(763267),n=e.i(944887),i=e.i(876561),l=e.i(635416),o=e.i(768877),d=e.i(96892),c=e.i(689664),u=e.i(716327),h=e.i(867927),m=e.i(55677),p=e.i(508734),g=e.i(452330),x=e.i(762368),f=e.i(482022),b=e.i(835079),j=e.i(269846),v=e.i(187516),w=e.i(113030),k=e.i(851817),y=e.i(882505),S=e.i(84570),C=e.i(648119),N=e.i(939050),I=e.i(506184),E=e.i(515281),A=e.i(77071),R=e.i(741120),T=e.i(395925),D=e.i(856522),W=e.i(566595),B=e.i(868401),$=e.i(604139),P=e.i(759659),O=e.i(725981),L=e.i(861745),U=e.i(948148),_=e.i(90969),M=e.i(487956),K=e.i(771777),q=e.i(866026),F=e.i(448295),V=e.i(966264),H=e.i(501416),G=e.i(653269),z=e.i(647776),J=e.i(492103),Y=e.i(834471),Q=e.i(852077),X=e.i(243048),Z=e.i(227286),ee=e.i(948812),et=e.i(356505),er=e.i(486122),es=e.i(929592),ea=e.i(487486),en=e.i(519455),ei=e.i(515288),el=e.i(257428),eo=e.i(776639),ed=e.i(755146),ec=e.i(82612),eu=e.i(793479),eh=e.i(906197),em=e.i(110204),ep=e.i(337822),eg=e.i(983913),ex=e.i(987968),ef=e.i(967489),eb=e.i(784774),ej=e.i(808562),ev=e.i(624687),ew=e.i(462777),ek=e.i(360583),ey=e.i(171502),eS=e.i(637611),eC=e.i(975157),eN=e.i(520133),eI=e.i(284494),eE=e.i(539531),eA=e.i(942230),eR=e.i(453154),eT=e.i(5406),eD=e.i(455329),eW=e.i(756283),eB=e.i(440289),e$=e.i(753790),eP=e.i(941179),eO=e.i(940276);let eL=["gray","stone","red","rose","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","lavender","maroon","brown","olive","navy"],eU="worktrees-layout",e_="worktrees-group-by",eM="worktrees-filters",eK="__all__",eq="dirty",eF="clean",eV="non-default",eH="open-pull-requests";function eG(e){return e?`${eM}:${e}`:eM}function ez(e){return e.hasStagedChanges||e.hasUnstagedChanges}function eJ(e,t){let r=t.key.trim().toUpperCase();return{...e,agents:e.agents.map(e=>({...e,codebases:e.codebases.map(e=>({...e,worktrees:e.worktrees.map(e=>e.ticketKey?.trim().toUpperCase()===r?{...e,ticketTitle:t.summary,ticketStatus:t.status}:e)}))}))}}function eY(e,t){return e.some(e=>("string"==typeof e||"number"==typeof e)&&String(e).toLocaleLowerCase().includes(t))}let eQ={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",lavender:"border-lavender-500/40 bg-lavender-500/15 text-lavender-700 dark:text-lavender-300",maroon:"border-maroon-500/40 bg-maroon-500/15 text-maroon-700 dark:text-maroon-300",brown:"border-brown-500/40 bg-brown-500/15 text-brown-700 dark:text-brown-300",olive:"border-olive-500/40 bg-olive-500/15 text-olive-700 dark:text-olive-300",navy:"border-navy-500/40 bg-navy-500/15 text-navy-700 dark:text-navy-300"},eX={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",lavender:"border-lavender-600 bg-lavender-500",maroon:"border-maroon-600 bg-maroon-500",brown:"border-brown-600 bg-brown-500",olive:"border-olive-600 bg-olive-500",navy:"border-navy-600 bg-navy-500"},eZ={gray:"hover:bg-slate-500 data-[state=on]:bg-slate-500",stone:"hover:bg-stone-500 data-[state=on]:bg-stone-500",red:"hover:bg-red-500 data-[state=on]:bg-red-500",rose:"hover:bg-rose-500 data-[state=on]:bg-rose-500",orange:"hover:bg-orange-500 data-[state=on]:bg-orange-500",amber:"hover:bg-amber-500 data-[state=on]:bg-amber-500",yellow:"hover:bg-yellow-500 data-[state=on]:bg-yellow-500",lime:"hover:bg-lime-500 data-[state=on]:bg-lime-500",green:"hover:bg-green-500 data-[state=on]:bg-green-500",emerald:"hover:bg-emerald-500 data-[state=on]:bg-emerald-500",teal:"hover:bg-teal-500 data-[state=on]:bg-teal-500",cyan:"hover:bg-cyan-500 data-[state=on]:bg-cyan-500",sky:"hover:bg-sky-500 data-[state=on]:bg-sky-500",blue:"hover:bg-blue-500 data-[state=on]:bg-blue-500",indigo:"hover:bg-indigo-500 data-[state=on]:bg-indigo-500",violet:"hover:bg-violet-500 data-[state=on]:bg-violet-500",purple:"hover:bg-purple-500 data-[state=on]:bg-purple-500",fuchsia:"hover:bg-fuchsia-500 data-[state=on]:bg-fuchsia-500",pink:"hover:bg-pink-500 data-[state=on]:bg-pink-500",lavender:"hover:bg-lavender-500 data-[state=on]:bg-lavender-500",maroon:"hover:bg-maroon-500 data-[state=on]:bg-maroon-500",brown:"hover:bg-brown-500 data-[state=on]:bg-brown-500",olive:"hover:bg-olive-500 data-[state=on]:bg-olive-500",navy:"hover:bg-navy-500 data-[state=on]:bg-navy-500"};function e0({moves:e,onReload:s,onError:a,onNotice:n}){let i=(0,U.f)("worktrees"),[l,o]=(0,r.useState)(null),d=async e=>{o(e.id);try{await (0,eS.W)(`mutation RetryWorktreeMove($id: ID!) {
|
|
103
103
|
retryWorktreeMoveWithStash(id: $id) { id status }
|
|
104
|
-
}`,{id:e.id});let t=await (0,eB.D)(e.id);if("FAILED"===t.status)throw Error(t.error||
|
|
104
|
+
}`,{id:e.id});let t=await (0,eB.D)(e.id);if("FAILED"===t.status)throw Error(t.error||i("moveFailed"));n("SUCCEEDED_WITH_WARNING"===t.status?t.warning||i("moveCompletedWithWarning"):i("moveCompleted")),a(null),await s()}catch(e){a(e instanceof Error?e.message:String(e))}finally{o(null)}},c=async e=>{o(e.id);try{await (0,eS.W)(`mutation CancelWorktreeMove($id: ID!) {
|
|
105
105
|
cancelWorktreeMove(id: $id) { id status }
|
|
106
|
-
}`,{id:e.id}),i(
|
|
106
|
+
}`,{id:e.id}),n(i("moveCancelled")),a(null),await s()}catch(e){a(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)(es.J,{children:(0,t.jsxs)(es.p,{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)(en.K,{disabled:l===e.id,onClick:()=>void c(e),size:"sm",variant:"outline",children:i("cancelMove")}),(0,t.jsxs)(en.K,{disabled:l===e.id,onClick:()=>void d(e),size:"sm",children:[l===e.id&&(0,t.jsx)(ex.f,{}),i("stashAndContinue")]})]}):(0,t.jsx)(ex.f,{})]})},e.id))})}function e1(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 e5({overview:e,onCreated:s}){let a=(0,U.f)("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.blockingJob?[{agentGroup:e,group:t}]:[])),[i,l]=(0,r.useState)(1===n.length?n[0].group.codebase.id:""),[o,d]=(0,r.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}`})),m=async e=>{if(!u)throw Error(a("selectCodebase"));d(!0);try{let t=await (0,eS.W)(`mutation CreateWorktree($input: CreateWorktreeInput!) {
|
|
107
107
|
createWorktree(input: $input) { id }
|
|
108
|
-
}`,{input:{codebaseId:u.group.codebase.id,selection:e,requestId:(0,ew.e)()}});await (0,eB.t)(t.createWorktree.id),await s()}finally{d(!1)}};return(0,t.jsxs)(en.N,{children:[(0,t.jsx)(en.Y,{children:(0,t.jsx)(en.v,{children:a("createWorktree")})}),(0,t.jsxs)(en.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(em.f,{className:"mb-1.5 block",children:a("repositoryCheckout")}),(0,t.jsx)(eg.f,{ariaLabel:a("repositoryCheckout"),disabled:o||0===h.length,emptyMessage:a("noEligibleCodebases"),onValueChange:l,options:h,placeholder:a("selectCodebase"),searchPlaceholder:a("searchCodebases"),value:c})]}),u?(0,t.jsx)(eI.f,{busy:o,onSubmit:m,submitLabel:a("createWorktree"),target:e1(u.group)},u.group.codebase.id):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:h.length?a("selectCodebaseHelp"):a("noEligibleCodebases")})]})]})}function e2({agent:e}){let r=(0,U.f)("worktrees"),s="ONLINE"===e.connectionStatus;return(0,t.jsx)(ea.f,{variant:s?"success":"secondary",children:r(s?"online":"offline")})}function e4({agentGroup:e,group:s,layout:a,...i}){let n={...i,agentName:e.agent.name,baseRepoDirectory:e.agent.baseRepoDirectory,branchManagementEnabled:"ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.branch"),group:s,liveUpdatesEnabled:"ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.watch")};return"cards"!==a?(0,t.jsx)(tj,{...n}):(0,t.jsx)("div",{className:"space-y-3",children:s.worktrees.map(e=>(0,r.createElement)(e8,{...n,key:e.id,worktree:e}))})}function e7({agentGroup:e,...r}){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)(e2,{agent:e.agent})]}),e.codebases.map(s=>(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-medium",children:s.repository.name}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:s.repository.displayOrigin})]}),(0,t.jsx)(e3,{codebase:s.codebase})]}),(0,t.jsx)(e4,{...r,agentGroup:e,group:s})]},s.codebase.id))]})}function e6({repositoryGroup:e,...r}){return(0,t.jsxs)("section",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b pb-2",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:e.repository.name}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.repository.displayOrigin})]}),e.entries.map(({agentGroup:e,group:s})=>(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("h3",{className:"font-medium",children:e.agent.name}),(0,t.jsx)(e2,{agent:e.agent})]}),(0,t.jsx)(e3,{codebase:s.codebase})]}),(0,t.jsx)(e4,{...r,agentGroup:e,group:s})]},s.codebase.id))]})}function e3({codebase:e}){let s=(0,U.f)("worktrees"),a=(0,L.X)(),[i,n]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=()=>n(new Date().getTime()),t=window.setTimeout(e,0),r=window.setInterval(e,1e3);return()=>{window.clearTimeout(t),window.clearInterval(r)}},[]);let l=e.lastFetchedAt&&null!==i?Math.max(0,i-new Date(e.lastFetchedAt).getTime()):null,o=null===l?s("neverFetched"):l<6e4?s("secondsAgo",{count:Math.floor(l/1e3)}):(0,ek.l)(e.lastFetchedAt,"relative",{locale:a,now:i??void 0});return(0,t.jsx)("span",{className:(0,eC.f)("text-xs text-muted-foreground",e.lastFetchError&&"text-destructive"),title:e.lastFetchError??void 0,children:s("lastFetched",{value:o})})}function e8(e){let{inspectionRefreshToken:s}=e,{worktree:a,applyActivity:i,setUnstagedChanges:n}=(0,eW.L)(e.worktree),l={...e,worktree:a},[o,d]=(0,r.useState)(!1),[c,m]=(0,r.useState)(null),[p,g]=(0,r.useState)(!1),[x,f]=(0,r.useState)(null),b=(0,r.useRef)(0),j=(0,r.useRef)(s),v=(0,U.f)("worktrees"),w=(0,eN.U)(),k=(0,r.useCallback)(async()=>{let e=++b.current;g(!0);try{let t=await (0,eW.I)(a.id);if(e!==b.current)return;m(t),n(t.changes.some(e=>e.unstaged||e.untracked||e.conflicted)),f(null)}catch(t){e===b.current&&f(t instanceof Error?t.message:String(t))}finally{e===b.current&&g(!1)}},[n,a.id]),y=(0,eW.x)(k),S=(0,r.useCallback)(e=>{i(e),o&&y()},[i,o,y]);(0,eW.q)(a.id,e.liveUpdatesEnabled&&"AVAILABLE"===a.availability,S),(0,r.useEffect)(()=>{if(j.current===s||(j.current=s,!o))return;let e=window.setTimeout(()=>void y(),0);return()=>window.clearTimeout(e)},[o,s,y]);let C=()=>{let e=!o;d(e),e&&!c&&y()};return(0,t.jsxs)(en.N,{className:(0,eC.f)("cursor-pointer transition-colors hover:bg-muted/30",a.highlightColor&&ey.m[a.highlightColor]),onClick:e=>{(0,eO.g)(e)&&w.push((0,eO.P)(a.id))},children:[(0,t.jsxs)(en.Y,{className:"grid-cols-1! @md/card-header:grid-cols-[minmax(0,1fr)_auto]!",children:[(0,t.jsxs)(en.v,{className:"min-w-0",children:[(0,t.jsxs)(ei.K,{"aria-expanded":o,className:"h-auto w-full max-w-full justify-start gap-1 p-1 text-left",onClick:()=>void C(),variant:"ghost",children:[o?(0,t.jsx)(u.f,{}):(0,t.jsx)(h.f,{}),(0,t.jsx)("span",{className:"truncate font-mono",children:a.branch??a.headSha?.slice(0,10)??v("detached")})]}),(a.ticketKey||a.ticketTitle)&&(0,t.jsx)(te,{...l})]}),(0,t.jsxs)(en.e,{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)(tl,{worktree:a}),ez(a)&&(0,t.jsx)(ea.f,{variant:"destructive",children:v("dirty")}),(0,t.jsx)(tc,{...l})]})]}),(0,t.jsxs)(en.O,{className:"space-y-4",children:[(0,t.jsx)(tt,{...l,detailsExpanded:o,onToggleDetails:C}),(0,t.jsx)(eP.f,{group:e.group,onCompleted:e.onReload,onError:e.onError,worktree:a}),p&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(ex.f,{})," ",v("loadingDetails")]}),o&&(0,t.jsx)(e$.f,{error:x}),o&&c&&(0,t.jsx)(eA.m,{detail:c,inline:!0,worktreeId:a.id,worktreeFolder:a.folder})]}),(0,t.jsxs)(en.S,{className:"flex-col items-stretch gap-2","data-worktree-navigation-ignore":!0,children:[(0,t.jsx)(tg,{...l,onCompleted:async()=>{await e.onReload(),o&&await y()}}),(0,t.jsx)(eE.f,{first:(0,t.jsx)(H.f,{className:"w-auto",sessionData:{worktree:{id:a.id,path:a.folder,branch:a.branch,baseBranch:a.baseBranch,headSha:a.headSha},codebase:{id:e.group.codebase.id,folder:e.group.codebase.folder},repo:{id:e.group.repository.id,name:e.group.repository.name,url:e.group.repository.displayOrigin,displayOrigin:e.group.repository.displayOrigin}},worktreeId:a.id,workflows:e.group.quickActions??[]}),second:(0,t.jsx)(G.f,{agentCapabilities:e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id))?.agent.capabilities??[],className:"w-auto",worktreeId:a.id})})]})]})}function e9({worktree:e}){let r=(0,U.f)("worktrees"),s=e.branch??e.headSha?.slice(0,10)??r("detached"),a=r("openWorktreeDetails",{branch:s});return(0,t.jsx)(ei.K,{asChild:!0,size:"icon-sm",variant:"ghost",children:(0,t.jsx)(eN.L,{"aria-label":a,href:(0,eO.P)(e.id),title:a,children:(0,t.jsx)(o.f,{})})})}function te({worktree:e,onOpenTicket:r,compact:s=!1}){let a=`${e.ticketKey??""}${e.ticketTitle?`${e.ticketKey?" — ":""}${e.ticketTitle}`:""}`;return(0,t.jsxs)("div",{className:(0,eC.f)("flex max-w-full flex-wrap items-center gap-1.5 font-normal",s?"mt-0.5 text-xs":"mt-1 text-sm"),children:[e.ticketKey?(0,t.jsx)(ei.K,{className:"h-auto min-w-0 justify-start truncate p-0 text-left font-normal",onClick:()=>r(e.ticketKey),title:a,type:"button",variant:"link",children:a}):(0,t.jsx)("p",{className:"min-w-0 truncate text-muted-foreground",title:a,children:a}),e.ticketStatus&&(e.ticketKey?(0,t.jsx)(ea.f,{asChild:!0,variant:"secondary",children:(0,t.jsx)("button",{onClick:()=>r(e.ticketKey),type:"button",children:e.ticketStatus})}):(0,t.jsx)(ea.f,{variant:"secondary",children:e.ticketStatus}))]})}function tt(e){let{worktree:r,group:s,agentName:a,baseRepoDirectory:i,detailsExpanded:n,onToggleDetails:l}=e,o=(0,U.f)("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)(tk,{label:o("path"),mono:!0,value:(0,M.f)(r.folder,i)}),(0,t.jsx)(to,{...e})]}),(0,t.jsxs)(ts,{label:o("upToDate"),children:[(0,t.jsx)(ti,{worktree:r}),(0,t.jsx)("span",{className:"pl-6 text-xs text-muted-foreground",children:o("agent")}),(0,t.jsx)(ea.f,{variant:"outline",children:a})]}),(0,t.jsx)(ta,{...e}),(0,t.jsx)(ts,{label:o("pullRequest"),children:(0,t.jsx)(tn,{detailsExpanded:n,onPipelinesChanged:e.onReload,onToggleDetails:l,worktree:r})}),r.latestBuild&&(0,t.jsx)(tr,{build:r.latestBuild,onCompleted:e.onReload,onError:e.onError}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[r.statusError&&(0,t.jsx)("span",{className:"text-xs text-destructive",children:r.statusError}),!s.codebase.defaultBranch&&!r.baseBranchOverride&&(0,t.jsx)("span",{className:"text-xs text-destructive",children:o("baseUnavailable")})]})]})}function tr({build:e,onCompleted:r,onError:a}){let i=(0,U.f)("worktrees"),n=(0,U.f)("builds"),l="SUCCEEDED"===e.status&&e.artifacts.some(e=>"RUNNABLE_APP"===e.kind),{rebuild:o,rebuilding:d}=(0,K.v)({buildId:e.id,onCompleted:()=>r(),onError:a});return(0,t.jsxs)(ts,{label:i("latestBuild"),children:[(0,t.jsxs)(ed.G,{children:[(0,t.jsx)(ed.X,{asChild:!0,children:(0,t.jsx)(ea.f,{asChild:!0,variant:"outline",children:(0,t.jsxs)("button",{type:"button",children:[n(`actions.${e.action}`),(0,t.jsx)(u.f,{})]})})}),(0,t.jsxs)(ed.L,{align:"start",className:"w-36",children:[(0,t.jsx)(ed.r,{asChild:!0,children:(0,t.jsxs)(eN.L,{href:`/dashboard/builds/${e.id}`,children:[(0,t.jsx)(f.f,{}),n("viewBuild")]})}),(0,t.jsxs)(ed.r,{disabled:d,onSelect:()=>void o(),children:[d?(0,t.jsx)(ex.f,{}):(0,t.jsx)(T.f,{}),n("rebuild")]})]})]}),"SUCCEEDED"===e.status?(0,t.jsx)(ea.f,{asChild:!0,variant:(0,_.P)(e.status),children:(0,t.jsx)(eN.L,{href:`/dashboard/builds/${e.id}`,children:n(`statuses.${e.status}`)})}):(0,t.jsx)(ea.f,{variant:(0,_.P)(e.status),children:n(`statuses.${e.status}`)}),e.outOfDate&&(0,t.jsx)(s.f,{buildId:e.id,onCompleted:()=>r(),onError:a}),l&&(0,t.jsx)(q.f,{buildId:e.id,destinationType:e.destinationType,onCompleted:r,onError:a,preferredDestination:e.destination,size:"sm"})]})}function ts({label:e,children:r}){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:r})]})}function ta({compact:e=!1,...r}){let{worktree:s}=r,a=(0,U.f)("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:a("tags")}),(0,t.jsx)(tc,{...r,contentAlign:e?"end":"start",contentAlignOffset:e?0:-100,trigger:(0,t.jsx)(ei.K,{"aria-label":`${a("tags")}: ${s.branch??a("detached")}`,className:(0,eC.f)("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:[s.tags.map(e=>(0,t.jsx)(tw,{tag:e},e.id)),!s.tags.length&&(0,t.jsx)("span",{className:"text-muted-foreground",children:"—"})]})})})]})}function ti({worktree:e}){let r=(0,U.f)("worktrees"),s=0===e.baseBehind;return(0,t.jsx)(ea.f,{className:s?"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?r("unknown"):s?r("yes"):r("notUpToDate",{count:e.baseBehind})})}function tn({worktree:e,detailsExpanded:r,onPipelinesChanged:s,onToggleDetails:a}){var i;let n=(0,U.f)("worktrees"),l=e.baseAhead??0,o=e.sourceControlRequest?.provider==="GITLAB"?e.sourceControlRequest:null;return(0,t.jsxs)(t.Fragment,{children:[e.pullRequest?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.f,{label:`PR #${e.pullRequest.number}`,pullRequest:e.pullRequest,requestSource:"WORKTREES"}),(0,t.jsx)(z.w,{pipelineStatus:e.pullRequest.pipelineStatus,pipelines:e.pullRequest.pipelines,pipelineRevision:e.pullRequest.pipelineRevision,headSha:e.pullRequest.headRefOid,repositoryId:e.pullRequest.repositoryGithubId,repositoryNameWithOwner:e.pullRequest.repositoryNameWithOwner,repositoryUrl:e.pullRequest.repositoryUrl,requestSource:"WORKTREES"}),(0,t.jsx)(ea.f,{className:"APPROVED"===(i=e.pullRequest.reviewDecision)?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"CHANGES_REQUESTED"===i?"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)(ea.f,{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)(eN.L,{href:(0,ee.o)(e.pullRequest),children:n("comments",{count:e.pullRequest.unresolvedReviewThreadCount})})})]}):o?(0,t.jsx)(Y.f,{label:`MR !${o.number}`,mergeRequest:{iid:o.number,projectId:o.projectId,title:o.title,webUrl:o.url,state:o.state,worktreeId:o.worktreeId}}):null,(0,t.jsx)(Z.f,{onChanged:s,pipelines:e.gitLabPipelines??[]}),o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X.b,{state:o.approvalState}),o.projectId?(0,t.jsx)(ea.f,{asChild:!0,className:null==o.unresolvedDiscussionsCount?X.Y.neutral:0===o.unresolvedDiscussionsCount?X.Y.success:X.Y.warning,children:(0,t.jsx)(eN.L,{href:(0,Q.s)({projectId:o.projectId,iid:o.number}),children:n("comments",{count:o.unresolvedDiscussionsCount??"—"})})}):null]}):null,e.pullRequest||o||(e.gitLabPipelines??[]).length||0!==l?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:"—"}),l>0&&(a?(0,t.jsx)(ea.f,{asChild:!0,variant:"secondary",children:(0,t.jsx)("button",{"aria-expanded":r,onClick:a,type:"button",children:n("branchCommits",{count:l})})}):(0,t.jsx)(ea.f,{variant:"secondary",children:n("branchCommits",{count:l})}))]})}function tl({worktree:e}){var r,s;let a=(0,U.f)("worktrees");if("IN_SYNC"===e.syncState||0===e.ahead&&0===e.behind)return(0,t.jsx)(ea.f,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",variant:"outline",children:a("inSync")});let i=e.ahead??0,n=e.behind??0;return i>0||n>0?(0,t.jsxs)(t.Fragment,{children:[i>0&&(0,t.jsxs)(ea.f,{className:"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",variant:"outline",children:[(0,t.jsx)(d.f,{"data-icon":"inline-start"}),a("ahead",{count:i})]}),n>0&&(0,t.jsxs)(ea.f,{className:"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",variant:"outline",children:[(0,t.jsx)(l.f,{"data-icon":"inline-start"}),a("behind",{count:n})]})]}):(0,t.jsx)(ea.f,{variant:"outline",children:(r=e,s=a,"AHEAD"===r.syncState?s("ahead",{count:r.ahead??0}):"BEHIND"===r.syncState?s("behind",{count:r.behind??0}):s("DIVERGED"===r.syncState?"diverged":"IN_SYNC"===r.syncState?"upToDate":"NO_UPSTREAM"===r.syncState?"unpublished":"DETACHED"===r.syncState?"detached":"unknown"))})}function to(e){let{worktree:s,group:a,onUpdate:i,onError:n,compact:l=!1}=e,o=(0,U.f)("worktrees"),[d,c]=(0,r.useState)(!1),[u,h]=(0,r.useState)(!1),m="__inherit_remote_default__",p=Array.from(new Set([s.baseBranchOverride,a.codebase.defaultBranch,...a.codebase.remoteBranches].filter(e=>!!e))),g=async e=>{h(!0);try{let t=await (0,eS.W)(`mutation UpdateWorktreeBase($id: ID!, $baseBranch: String) {
|
|
108
|
+
}`,{input:{codebaseId:u.group.codebase.id,selection:e,requestId:(0,ew.e)()}});await (0,eB.t)(t.createWorktree.id),await s()}finally{d(!1)}};return(0,t.jsxs)(ei.N,{children:[(0,t.jsx)(ei.Y,{children:(0,t.jsx)(ei.v,{children:a("createWorktree")})}),(0,t.jsxs)(ei.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(em.f,{className:"mb-1.5 block",children:a("repositoryCheckout")}),(0,t.jsx)(eg.f,{ariaLabel:a("repositoryCheckout"),disabled:o||0===h.length,emptyMessage:a("noEligibleCodebases"),onValueChange:l,options:h,placeholder:a("selectCodebase"),searchPlaceholder:a("searchCodebases"),value:c})]}),u?(0,t.jsx)(eI.f,{busy:o,onSubmit:m,submitLabel:a("createWorktree"),target:e1(u.group)},u.group.codebase.id):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:h.length?a("selectCodebaseHelp"):a("noEligibleCodebases")})]})]})}function e2({agent:e}){let r=(0,U.f)("worktrees"),s="ONLINE"===e.connectionStatus;return(0,t.jsx)(ea.f,{variant:s?"success":"secondary",children:r(s?"online":"offline")})}function e4({agentGroup:e,group:s,layout:a,...n}){let i={...n,agentName:e.agent.name,baseRepoDirectory:e.agent.baseRepoDirectory,branchManagementEnabled:"ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.branch"),group:s,liveUpdatesEnabled:"ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.watch")};return"cards"!==a?(0,t.jsx)(tj,{...i}):(0,t.jsx)("div",{className:"space-y-3",children:s.worktrees.map(e=>(0,r.createElement)(e8,{...i,key:e.id,worktree:e}))})}function e7({agentGroup:e,...r}){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)(e2,{agent:e.agent})]}),e.codebases.map(s=>(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-medium",children:s.repository.name}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:s.repository.displayOrigin})]}),(0,t.jsx)(e3,{codebase:s.codebase})]}),(0,t.jsx)(e4,{...r,agentGroup:e,group:s})]},s.codebase.id))]})}function e6({repositoryGroup:e,...r}){return(0,t.jsxs)("section",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b pb-2",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:e.repository.name}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.repository.displayOrigin})]}),e.entries.map(({agentGroup:e,group:s})=>(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("h3",{className:"font-medium",children:e.agent.name}),(0,t.jsx)(e2,{agent:e.agent})]}),(0,t.jsx)(e3,{codebase:s.codebase})]}),(0,t.jsx)(e4,{...r,agentGroup:e,group:s})]},s.codebase.id))]})}function e3({codebase:e}){let s=(0,U.f)("worktrees"),a=(0,L.X)(),[n,i]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=()=>i(new Date().getTime()),t=window.setTimeout(e,0),r=window.setInterval(e,1e3);return()=>{window.clearTimeout(t),window.clearInterval(r)}},[]);let l=e.lastFetchedAt&&null!==n?Math.max(0,n-new Date(e.lastFetchedAt).getTime()):null,o=null===l?s("neverFetched"):l<6e4?s("secondsAgo",{count:Math.floor(l/1e3)}):(0,ek.l)(e.lastFetchedAt,"relative",{locale:a,now:n??void 0});return(0,t.jsx)("span",{className:(0,eC.f)("text-xs text-muted-foreground",e.lastFetchError&&"text-destructive"),title:e.lastFetchError??void 0,children:s("lastFetched",{value:o})})}function e8(e){let{inspectionRefreshToken:s}=e,{worktree:a,applyActivity:n,setUnstagedChanges:i}=(0,eW.L)(e.worktree),l={...e,worktree:a},[o,d]=(0,r.useState)(!1),[c,m]=(0,r.useState)(null),[p,g]=(0,r.useState)(!1),[x,f]=(0,r.useState)(null),b=(0,r.useRef)(0),j=(0,r.useRef)(s),v=(0,U.f)("worktrees"),w=(0,eN.U)(),k=(0,r.useCallback)(async()=>{let e=++b.current;g(!0);try{let t=await (0,eW.I)(a.id);if(e!==b.current)return;m(t),i(t.changes.some(e=>e.unstaged||e.untracked||e.conflicted)),f(null)}catch(t){e===b.current&&f(t instanceof Error?t.message:String(t))}finally{e===b.current&&g(!1)}},[i,a.id]),y=(0,eW.x)(k),S=(0,r.useCallback)(e=>{n(e),o&&y()},[n,o,y]);(0,eW.q)(a.id,e.liveUpdatesEnabled&&"AVAILABLE"===a.availability,S),(0,r.useEffect)(()=>{if(j.current===s||(j.current=s,!o))return;let e=window.setTimeout(()=>void y(),0);return()=>window.clearTimeout(e)},[o,s,y]);let C=()=>{let e=!o;d(e),e&&!c&&y()};return(0,t.jsxs)(ei.N,{className:(0,eC.f)("cursor-pointer transition-colors hover:bg-muted/30",a.highlightColor&&ey.m[a.highlightColor]),onClick:e=>{(0,eO.g)(e)&&w.push((0,eO.P)(a.id))},children:[(0,t.jsxs)(ei.Y,{className:"grid-cols-1! @md/card-header:grid-cols-[minmax(0,1fr)_auto]!",children:[(0,t.jsxs)(ei.v,{className:"min-w-0",children:[(0,t.jsxs)(en.K,{"aria-expanded":o,className:"h-auto w-full max-w-full justify-start gap-1 p-1 text-left",onClick:()=>void C(),variant:"ghost",children:[o?(0,t.jsx)(u.f,{}):(0,t.jsx)(h.f,{}),(0,t.jsx)("span",{className:"truncate font-mono",children:a.branch??a.headSha?.slice(0,10)??v("detached")})]}),(a.ticketKey||a.ticketTitle)&&(0,t.jsx)(te,{...l})]}),(0,t.jsxs)(ei.e,{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)(tl,{worktree:a}),ez(a)&&(0,t.jsx)(ea.f,{variant:"destructive",children:v("dirty")}),(0,t.jsx)(tc,{...l})]})]}),(0,t.jsxs)(ei.O,{className:"space-y-4",children:[(0,t.jsx)(tt,{...l,detailsExpanded:o,onToggleDetails:C}),(0,t.jsx)(eP.f,{group:e.group,onCompleted:e.onReload,onError:e.onError,worktree:a}),p&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(ex.f,{})," ",v("loadingDetails")]}),o&&(0,t.jsx)(e$.f,{error:x}),o&&c&&(0,t.jsx)(eA.m,{detail:c,inline:!0,worktreeId:a.id,worktreeFolder:a.folder})]}),(0,t.jsxs)(ei.S,{className:"flex-col items-stretch gap-2","data-worktree-navigation-ignore":!0,children:[(0,t.jsx)(tg,{...l,onCompleted:async()=>{await e.onReload(),o&&await y()}}),(0,t.jsx)(eE.f,{first:(0,t.jsx)(H.f,{className:"w-auto",sessionData:{worktree:{id:a.id,path:a.folder,branch:a.branch,baseBranch:a.baseBranch,headSha:a.headSha},codebase:{id:e.group.codebase.id,folder:e.group.codebase.folder},repo:{id:e.group.repository.id,name:e.group.repository.name,url:e.group.repository.displayOrigin,displayOrigin:e.group.repository.displayOrigin}},worktreeId:a.id,workflows:e.group.quickActions??[]}),second:(0,t.jsx)(G.f,{agentCapabilities:e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id))?.agent.capabilities??[],className:"w-auto",worktreeId:a.id})})]})]})}function e9({worktree:e}){let r=(0,U.f)("worktrees"),s=e.branch??e.headSha?.slice(0,10)??r("detached"),a=r("openWorktreeDetails",{branch:s});return(0,t.jsx)(en.K,{asChild:!0,size:"icon-sm",variant:"ghost",children:(0,t.jsx)(eN.L,{"aria-label":a,href:(0,eO.P)(e.id),title:a,children:(0,t.jsx)(o.f,{})})})}function te({worktree:e,onOpenTicket:r,compact:s=!1}){let a=`${e.ticketKey??""}${e.ticketTitle?`${e.ticketKey?" — ":""}${e.ticketTitle}`:""}`;return(0,t.jsxs)("div",{className:(0,eC.f)("flex max-w-full flex-wrap items-center gap-1.5 font-normal",s?"mt-0.5 text-xs":"mt-1 text-sm"),children:[e.ticketKey?(0,t.jsx)(en.K,{className:"h-auto min-w-0 justify-start truncate p-0 text-left font-normal",onClick:()=>r(e.ticketKey),title:a,type:"button",variant:"link",children:a}):(0,t.jsx)("p",{className:"min-w-0 truncate text-muted-foreground",title:a,children:a}),e.ticketStatus&&(e.ticketKey?(0,t.jsx)(ea.f,{asChild:!0,variant:"secondary",children:(0,t.jsx)("button",{onClick:()=>r(e.ticketKey),type:"button",children:e.ticketStatus})}):(0,t.jsx)(ea.f,{variant:"secondary",children:e.ticketStatus}))]})}function tt(e){let{worktree:r,group:s,agentName:a,baseRepoDirectory:n,detailsExpanded:i,onToggleDetails:l}=e,o=(0,U.f)("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)(tk,{label:o("path"),mono:!0,value:(0,M.f)(r.folder,n)}),(0,t.jsx)(to,{...e})]}),(0,t.jsxs)(ts,{label:o("upToDate"),children:[(0,t.jsx)(tn,{worktree:r}),(0,t.jsx)("span",{className:"pl-6 text-xs text-muted-foreground",children:o("agent")}),(0,t.jsx)(ea.f,{variant:"outline",children:a})]}),(0,t.jsx)(ta,{...e}),(0,t.jsx)(ts,{label:o("pullRequest"),children:(0,t.jsx)(ti,{detailsExpanded:i,onPipelinesChanged:e.onReload,onToggleDetails:l,worktree:r})}),r.latestBuild&&(0,t.jsx)(tr,{build:r.latestBuild,onCompleted:e.onReload,onError:e.onError}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[r.statusError&&(0,t.jsx)("span",{className:"text-xs text-destructive",children:r.statusError}),!s.codebase.defaultBranch&&!r.baseBranchOverride&&(0,t.jsx)("span",{className:"text-xs text-destructive",children:o("baseUnavailable")})]})]})}function tr({build:e,onCompleted:r,onError:a}){let n=(0,U.f)("worktrees"),i=(0,U.f)("builds"),l="SUCCEEDED"===e.status&&e.artifacts.some(e=>"RUNNABLE_APP"===e.kind),{rebuild:o,rebuilding:d}=(0,K.v)({buildId:e.id,onCompleted:()=>r(),onError:a});return(0,t.jsxs)(ts,{label:n("latestBuild"),children:[(0,t.jsxs)(ed.G,{children:[(0,t.jsx)(ed.X,{asChild:!0,children:(0,t.jsx)(ea.f,{asChild:!0,variant:"outline",children:(0,t.jsxs)("button",{type:"button",children:[i(`actions.${e.action}`),(0,t.jsx)(u.f,{})]})})}),(0,t.jsxs)(ed.L,{align:"start",className:"w-36",children:[(0,t.jsx)(ed.r,{asChild:!0,children:(0,t.jsxs)(eN.L,{href:`/dashboard/builds/${e.id}`,children:[(0,t.jsx)(f.f,{}),i("viewBuild")]})}),(0,t.jsxs)(ed.r,{disabled:d,onSelect:()=>void o(),children:[d?(0,t.jsx)(ex.f,{}):(0,t.jsx)(T.f,{}),i("rebuild")]})]})]}),"SUCCEEDED"===e.status?(0,t.jsx)(ea.f,{asChild:!0,variant:(0,_.P)(e.status),children:(0,t.jsx)(eN.L,{href:`/dashboard/builds/${e.id}`,children:i(`statuses.${e.status}`)})}):(0,t.jsx)(ea.f,{variant:(0,_.P)(e.status),children:i(`statuses.${e.status}`)}),e.outOfDate&&(0,t.jsx)(s.f,{buildId:e.id,onCompleted:()=>r(),onError:a}),l&&(0,t.jsx)(q.f,{buildId:e.id,destinationType:e.destinationType,onCompleted:r,onError:a,preferredDestination:e.destination,size:"sm"})]})}function ts({label:e,children:r}){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:r})]})}function ta({compact:e=!1,...r}){let{worktree:s}=r,a=(0,U.f)("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:a("tags")}),(0,t.jsx)(tc,{...r,contentAlign:e?"end":"start",contentAlignOffset:e?0:-100,trigger:(0,t.jsx)(en.K,{"aria-label":`${a("tags")}: ${s.branch??a("detached")}`,className:(0,eC.f)("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:[s.tags.map(e=>(0,t.jsx)(tw,{tag:e},e.id)),!s.tags.length&&(0,t.jsx)("span",{className:"text-muted-foreground",children:"—"})]})})})]})}function tn({worktree:e}){let r=(0,U.f)("worktrees"),s=0===e.baseBehind;return(0,t.jsx)(ea.f,{className:s?"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?r("unknown"):s?r("yes"):r("notUpToDate",{count:e.baseBehind})})}function ti({worktree:e,detailsExpanded:r,onPipelinesChanged:s,onToggleDetails:a}){var n;let i=(0,U.f)("worktrees"),l=e.baseAhead??0,o=e.sourceControlRequest?.provider==="GITLAB"?e.sourceControlRequest:null;return(0,t.jsxs)(t.Fragment,{children:[e.pullRequest?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J.f,{label:`PR #${e.pullRequest.number}`,pullRequest:e.pullRequest,requestSource:"WORKTREES"}),(0,t.jsx)(z.w,{pipelineStatus:e.pullRequest.pipelineStatus,pipelines:e.pullRequest.pipelines,pipelineRevision:e.pullRequest.pipelineRevision,headSha:e.pullRequest.headRefOid,repositoryId:e.pullRequest.repositoryGithubId,repositoryNameWithOwner:e.pullRequest.repositoryNameWithOwner,repositoryUrl:e.pullRequest.repositoryUrl,requestSource:"WORKTREES"}),(0,t.jsx)(ea.f,{className:"APPROVED"===(n=e.pullRequest.reviewDecision)?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"CHANGES_REQUESTED"===n?"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:i(`review.${e.pullRequest.reviewDecision}`)}),(0,t.jsx)(ea.f,{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)(eN.L,{href:(0,ee.o)(e.pullRequest),children:i("comments",{count:e.pullRequest.unresolvedReviewThreadCount})})})]}):o?(0,t.jsx)(Y.f,{label:`MR !${o.number}`,mergeRequest:{iid:o.number,projectId:o.projectId,title:o.title,webUrl:o.url,state:o.state,worktreeId:o.worktreeId}}):null,(0,t.jsx)(Z.f,{onChanged:s,pipelines:e.gitLabPipelines??[]}),o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X.b,{state:o.approvalState}),o.projectId?(0,t.jsx)(ea.f,{asChild:!0,className:null==o.unresolvedDiscussionsCount?X.Y.neutral:0===o.unresolvedDiscussionsCount?X.Y.success:X.Y.warning,children:(0,t.jsx)(eN.L,{href:(0,Q.s)({projectId:o.projectId,iid:o.number}),children:i("comments",{count:o.unresolvedDiscussionsCount??"—"})})}):null]}):null,e.pullRequest||o||(e.gitLabPipelines??[]).length||0!==l?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:"—"}),l>0&&(a?(0,t.jsx)(ea.f,{asChild:!0,variant:"secondary",children:(0,t.jsx)("button",{"aria-expanded":r,onClick:a,type:"button",children:i("branchCommits",{count:l})})}):(0,t.jsx)(ea.f,{variant:"secondary",children:i("branchCommits",{count:l})}))]})}function tl({worktree:e}){var r,s;let a=(0,U.f)("worktrees");if("IN_SYNC"===e.syncState||0===e.ahead&&0===e.behind)return(0,t.jsx)(ea.f,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",variant:"outline",children:a("inSync")});let n=e.ahead??0,i=e.behind??0;return n>0||i>0?(0,t.jsxs)(t.Fragment,{children:[n>0&&(0,t.jsxs)(ea.f,{className:"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",variant:"outline",children:[(0,t.jsx)(d.f,{"data-icon":"inline-start"}),a("ahead",{count:n})]}),i>0&&(0,t.jsxs)(ea.f,{className:"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",variant:"outline",children:[(0,t.jsx)(l.f,{"data-icon":"inline-start"}),a("behind",{count:i})]})]}):(0,t.jsx)(ea.f,{variant:"outline",children:(r=e,s=a,"AHEAD"===r.syncState?s("ahead",{count:r.ahead??0}):"BEHIND"===r.syncState?s("behind",{count:r.behind??0}):s("DIVERGED"===r.syncState?"diverged":"IN_SYNC"===r.syncState?"upToDate":"NO_UPSTREAM"===r.syncState?"unpublished":"DETACHED"===r.syncState?"detached":"unknown"))})}function to(e){let{worktree:s,group:a,onUpdate:n,onError:i,compact:l=!1}=e,o=(0,U.f)("worktrees"),[d,c]=(0,r.useState)(!1),[u,h]=(0,r.useState)(!1),m="__inherit_remote_default__",p=Array.from(new Set([s.baseBranchOverride,a.codebase.defaultBranch,...a.codebase.remoteBranches].filter(e=>!!e))),g=async e=>{h(!0);try{let t=await (0,eS.W)(`mutation UpdateWorktreeBase($id: ID!, $baseBranch: String) {
|
|
109
109
|
updateWorktreeBaseBranch(id: $id, baseBranch: $baseBranch) { ${eD.Y} }
|
|
110
|
-
}`,{id:s.id,baseBranch:e||null});
|
|
110
|
+
}`,{id:s.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,eC.f)("flex min-h-6 min-w-0 items-center gap-1",!l&&"mt-0.5"),children:d?(0,t.jsxs)(ef.d,{disabled:u,onOpenChange:c,onValueChange:e=>void g(e===m?"":e),open:d,value:s.baseBranchOverride??(a.codebase.defaultBranch?m:void 0),children:[(0,t.jsx)(ef.P,{"aria-label":o("baseBranch"),className:"h-7 min-w-40 max-w-full font-mono text-xs",size:"sm",children:(0,t.jsx)(ef.U,{placeholder:o("baseUnavailable")})}),(0,t.jsxs)(ef.r,{align:"start",children:[a.codebase.defaultBranch&&(0,t.jsxs)(ef.T,{value:m,children:[a.codebase.defaultBranch," · ",o("inheritBase")]}),p.map(e=>(0,t.jsx)(ef.T,{value:e,children:e},e))]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:s.baseBranch??void 0,children:s.baseBranch??"—"}),(0,t.jsx)(en.K,{"aria-label":o("editBase"),onClick:()=>c(!0),size:"icon-xs",variant:"ghost",children:(0,t.jsx)(E.f,{})})]})})]})}function td(e,t){let r=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.blockingJob&&!r}function tc(e){var s,a,n;let i,l,{worktree:o,allTags:d,editorVariant:c,onUpdate:u,onError:h,onManageTags:m,contentAlign:x="end",contentAlignOffset:f=0,trigger:w}=e,k=(0,U.f)("worktrees"),[y,S]=(0,r.useState)(!1),[E,T]=(0,r.useState)(!1),[D,W]=(0,r.useState)(!1),[$,O]=(0,r.useState)(!1),[L,_]=(0,r.useState)(!1),[K,q]=(0,r.useState)(!1),[F,V]=(0,r.useState)(null),[H,G]=(0,r.useState)(null),z=(0,r.useRef)(!1),J=(i=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id)))?e.overview.agents.flatMap(t=>t.agent.id===i.agent.id?[]:t.codebases.flatMap(r=>r.repository.id===e.group.repository.id?[{agentGroup:t,group:r}]:[])):[],Y=(l=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id)))&&"ONLINE"===l.agent.connectionStatus&&l.agent.capabilities.includes("worktree.move.push")?"AVAILABLE"!==e.worktree.availability||e.group.blockingJob||e.worktree.rebaseInProgress||e.overview.activeMoves.some(t=>t.sourceCodebaseId===e.group.codebase.id||t.targetCodebaseId===e.group.codebase.id)?k("moveBlocked.busy"):e.worktree.branch&&e.worktree.headSha?e.worktree.hasStagedChanges||e.worktree.hasUnstagedChanges||"DIRTY"===e.worktree.pushStatus?k("moveBlocked.dirty"):"BEHIND"===e.worktree.pushStatus?k("moveBlocked.behind"):"DIVERGED"===e.worktree.pushStatus?k("moveBlocked.diverged"):"READY"!==e.worktree.pushStatus?k("moveBlocked.unknown"):J.some(t=>td(t,e.overview))?null:k("moveBlocked.destination"):k("moveBlocked.detached"):k("moveBlocked.agent"),Q=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id)),X=!Q||"ONLINE"!==Q.agent.connectionStatus||!Q.agent.capabilities.includes("worktree.delete")||"AVAILABLE"!==o.availability||!!e.group.blockingJob||o.rebaseInProgress||e.overview.activeMoves.some(t=>t.sourceCodebaseId===e.group.codebase.id||t.targetCodebaseId===e.group.codebase.id),Z=new Set(o.tags.map(e=>e.id)),ee=async(e,t)=>{let r=t?[...Z,e]:[...Z].filter(t=>t!==e);try{let e=await (0,eS.W)(`mutation SetWorktreeTags($id: ID!, $tagIds: [ID!]!) { setWorktreeTags(id: $id, tagIds: $tagIds) { ${eD.Y} } }`,{id:o.id,tagIds:r});u(e.setWorktreeTags),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},et=async e=>{try{let t=await (0,eS.W)(`mutation HighlightWorktree($id: ID!, $color: String) { updateWorktreeHighlight(id: $id, color: $color) { ${eD.Y} } }`,{id:o.id,color:e});u(t.updateWorktreeHighlight),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}},er=async()=>{q(!0);try{let e=await (0,eS.W)(`mutation RefreshWorktreePullRequest($id: ID!) {
|
|
111
111
|
refreshWorktreePullRequest(id: $id) { ${eD.Y} }
|
|
112
112
|
}`,{id:o.id});u(e.refreshWorktreePullRequest),h(null)}catch(e){h(e instanceof Error?e.message:String(e))}finally{q(!1)}},ea=async(t,r=!1)=>{_(!0);try{let s=await (0,eS.W)(`mutation ChangeWorktreeBranch($input: ChangeWorktreeBranchInput!) {
|
|
113
113
|
changeWorktreeBranch(input: $input) { id }
|
|
114
|
-
}`,{input:{worktreeId:o.id,selection:t,requestId:(0,ew.e)(),stashOnFailure:r}});await (0,eB.t)(s.changeWorktreeBranch.id),await e.onReload(),V(null),G(null),S(!1),h(null)}finally{_(!1)}},
|
|
114
|
+
}`,{input:{worktreeId:o.id,selection:t,requestId:(0,ew.e)(),stashOnFailure:r}});await (0,eB.t)(s.changeWorktreeBranch.id),await e.onReload(),V(null),G(null),S(!1),h(null)}finally{_(!1)}},ei=async()=>{if(F)try{G(null),await ea(F,!0)}catch(e){G(e instanceof Error?e.message:String(e))}},el=e.group.codebase.defaultBranch,eo=!!(el&&(s=e.overview,a=e.group.codebase.id,n=o.id,s.agents.some(e=>e.codebases.some(e=>e.codebase.id===a&&e.worktrees.some(e=>e.id!==n&&e.branch===el))))),ec=!e.branchManagementEnabled||"AVAILABLE"!==o.availability||!!e.group.blockingJob||o.rebaseInProgress,eu=async()=>{if(el)try{await ea({mode:"EXISTING",branchName:el,baseBranch:el})}catch(e){h(e instanceof Error?e.message:String(e))}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ep.V,{onOpenChange:e=>{S(e),e||(V(null),G(null))},open:y,children:[(0,t.jsxs)(ed.G,{children:[(0,t.jsx)(ed.X,{asChild:!0,children:(0,t.jsx)(ep.r,{asChild:!0,children:w??(0,t.jsx)(en.K,{"aria-label":k("customize"),size:"icon-sm",variant:"ghost",children:(0,t.jsx)(C.f,{})})})}),(0,t.jsxs)(ed.L,{align:x,alignOffset:f,className:"w-72",onCloseAutoFocus:e=>{z.current&&(z.current=!1,e.preventDefault(),S(!0))},children:[(0,t.jsxs)(ed.r,{onSelect:()=>{(0,ew.d)(o.folder).catch(e=>h(String(e)))},children:[(0,t.jsx)(p.f,{})," ",k("copyPath")]}),(0,t.jsxs)(ed.r,{disabled:!o.branch,onSelect:()=>{o.branch&&(0,ew.d)(o.branch).catch(e=>h(String(e)))},children:[(0,t.jsx)(j.f,{})," ",k("copyBranchName")]}),J.length>0&&(0,t.jsxs)(ed.r,{disabled:!!Y,onSelect:()=>W(!0),title:Y??void 0,children:[(0,t.jsx)(N.f,{})," ",k("moveToAgent")]}),(0,t.jsxs)(ed.r,{disabled:ec,onSelect:()=>{z.current=!0},children:[(0,t.jsx)(j.f,{})," ",k("changeBranch")]}),el&&!eo&&(0,t.jsxs)(ed.r,{disabled:ec||L||o.branch===el,onSelect:()=>void eu(),children:[L?(0,t.jsx)(ex.f,{}):(0,t.jsx)(j.f,{})," ",k("changeBranchToDefault",{branch:el})]}),(0,t.jsxs)(ed.r,{disabled:"AVAILABLE"!==o.availability||!!e.group.blockingJob||o.rebaseInProgress||!Q?.agent.capabilities.includes("worktree.commit")||!o.hasStagedChanges&&!o.hasUnstagedChanges,onSelect:()=>T(!0),children:[(0,t.jsx)(v.f,{})," ",k("commit")]}),"NONE"!==c&&(0,t.jsx)(tb,{icon:(0,t.jsx)(g.f,{}),label:k("CODE_INSIDERS"===c?"openInsiders":"openCode"),operation:"OPEN_EDITOR",disabled:!!e.group.blockingJob,props:{...e,onCompleted:e.onReload}}),(0,t.jsx)(ed.r,{asChild:!0,children:(0,t.jsxs)(eN.L,{href:`/dashboard/codebases/${e.group.codebase.id}`,children:[(0,t.jsx)(g.f,{})," ",k("viewCodebase")]})}),(0,t.jsx)(ed.r,{asChild:!0,children:(0,t.jsxs)(eN.L,{href:`/dashboard/codebases/repositories/${e.group.repository.id}`,children:[(0,t.jsx)(b.f,{})," ",k("viewRepository")]})}),o.branch&&/^github\.com\/[^/]+\/[^/]+$/i.test(e.group.repository.canonicalOrigin)&&(0,t.jsxs)(ed.r,{disabled:K,onSelect:()=>void er(),children:[K?(0,t.jsx)(ex.f,{}):(0,t.jsx)(R.f,{})," ",k("refreshPullRequest")]}),(0,t.jsx)(ed.U,{}),(0,t.jsxs)(ed.B,{className:"flex items-center gap-1.5 leading-none",children:[(0,t.jsx)(B.f,{className:"size-3"}),(0,t.jsx)("span",{children:k("tags")})]}),d.map(e=>(0,t.jsxs)(ed.Q,{checked:Z.has(e.id),onCheckedChange:t=>void ee(e.id,!!t),children:[(0,t.jsx)("span",{className:(0,eC.f)("size-3 rounded-full border",eX[e.color])})," ",e.name]},e.id)),(0,t.jsxs)(ed.r,{onSelect:m,children:[(0,t.jsx)(A.f,{})," ",k("manageTags")]}),(0,t.jsx)(ed.U,{}),(0,t.jsxs)(ed.B,{className:"flex items-center justify-between gap-1.5 py-0 leading-none",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(I.f,{className:"size-3"}),(0,t.jsx)("span",{children:k("highlight")})]}),(0,t.jsx)(en.K,{"aria-label":k("clearHighlight"),className:"size-6",disabled:!o.highlightColor,onClick:e=>{e.stopPropagation(),et(null)},size:"icon-sm",variant:"ghost",children:(0,t.jsx)(P.f,{className:"size-3"})})]}),(0,t.jsx)(ej.z,{"aria-label":k("highlight"),className:"grid w-full grid-cols-8 gap-1 px-1.5 pb-1",onClick:e=>e.stopPropagation(),onValueChange:e=>{e&&et(e)},size:"sm",spacing:1,type:"single",value:o.highlightColor??"",variant:"outline",children:eL.map(e=>(0,t.jsx)(ej.H,{"aria-label":e,className:(0,eC.f)("aspect-square h-auto w-full min-w-0 p-0",eX[e],eZ[e],"data-[state=on]:ring-2 data-[state=on]:ring-foreground"),value:e},e))}),!o.primary&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ed.U,{}),(0,t.jsxs)(ed.r,{disabled:X,onSelect:()=>O(!0),variant:"destructive",children:[(0,t.jsx)(P.f,{})," ",k("deleteWorktree")]})]})]})]}),(0,t.jsxs)(ep.T,{align:x,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:k("changeBranch")}),(0,t.jsx)("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:(0,M.f)(o.folder,e.baseRepoDirectory)})]}),(0,t.jsx)(eI.f,{busy:L,onSubmit:e=>ea(e),onSubmitError:e=>{V(o.hasStagedChanges||o.hasUnstagedChanges?e:null)},recovery:F?(0,t.jsx)(es.J,{children:(0,t.jsxs)(es.p,{className:"space-y-2",children:[(0,t.jsx)("p",{children:k("stashRetryHelp")}),H&&(0,t.jsx)("p",{className:"text-destructive",children:H}),(0,t.jsxs)(en.K,{disabled:L,onClick:()=>void ei(),size:"sm",type:"button",variant:"outline",children:[L&&(0,t.jsx)(ex.f,{}),k("stashAndRetry")]})]})}):null,submitLabel:k("changeBranch"),target:e1(e.group,o)})]})]}),D&&(0,t.jsx)(th,{onOpenChange:W,open:D,props:e,targets:J.filter(t=>td(t,e.overview))}),E&&(0,t.jsx)(tu,{onOpenChange:T,onReload:e.onReload,open:E,worktree:o}),!o.primary&&$&&(0,t.jsx)(tm,{onOpenChange:O,open:$,props:e})]})}function tu({worktree:e,open:s,onOpenChange:a,onReload:n}){let i=(0,U.f)("worktrees"),[l,o]=(0,r.useState)(null),[d,c]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[m,p]=(0,r.useState)(!0),[g,x]=(0,r.useState)(new Set),[f,b]=(0,r.useState)(!1),[j,v]=(0,r.useState)(null);(0,r.useEffect)(()=>{let t=!1;return(0,eW.I)(e.id).then(e=>{t||(o(e),h(!0===e.commitSigningEnabled),x(new Set(e.changes.filter(e=>e.staged).map(e=>e.path))))}).catch(e=>{t||v(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e.id]);let w=async()=>{b(!0),v(null);try{let t=await (0,eS.W)(`mutation CommitWorktree($input: CommitWorktreeInput!) {
|
|
115
115
|
commitWorktree(input: $input) { id }
|
|
116
|
-
}`,{input:{worktreeId:e.id,message:d,signed:u,stageAll:m,paths:m?[]:[...g],requestId:(0,ew.e)()}});await (0,eB.t)(t.commitWorktree.id),await
|
|
116
|
+
}`,{input:{worktreeId:e.id,message:d,signed:u,stageAll:m,paths:m?[]:[...g],requestId:(0,ew.e)()}});await (0,eB.t)(t.commitWorktree.id),await n(),a(!1)}catch(e){v(e instanceof Error?e.message:String(e))}finally{b(!1)}};return(0,t.jsx)(eo.N,{onOpenChange:a,open:s,children:(0,t.jsxs)(eo.d,{className:"max-h-[min(42rem,calc(100vh-2rem))] overflow-y-auto sm:max-w-lg",children:[(0,t.jsxs)(eo.s,{children:[(0,t.jsx)(eo.F,{children:i("commitTitle")}),(0,t.jsx)(eo.C,{children:i("commitDescription")})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(em.f,{htmlFor:"worktree-commit-message",children:i("commitMessage")}),(0,t.jsx)(ev.f,{autoFocus:!0,id:"worktree-commit-message",onChange:e=>c(e.target.value),placeholder:i("commitMessagePlaceholder"),rows:4,value:d})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(el.f,{checked:u,onCheckedChange:e=>h(!!e)}),i("signedCommit")]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(el.f,{checked:m,onCheckedChange:e=>p(!!e)}),i("stageAll")]}),!m&&l&&(0,t.jsx)("div",{className:"max-h-64 space-y-1 overflow-y-auto rounded-md border p-2",children:l.changes.map(e=>(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded px-2 py-1.5 text-sm hover:bg-muted",children:[(0,t.jsx)(el.f,{checked:g.has(e.path),onCheckedChange:t=>{x(r=>{let s=new Set(r);return t?s.add(e.path):s.delete(e.path),s})}}),(0,t.jsx)("span",{className:"break-all font-mono text-xs",children:e.path})]},e.path))}),!l&&!j&&(0,t.jsx)(ex.f,{}),j&&(0,t.jsx)(es.J,{variant:"destructive",children:(0,t.jsx)(es.p,{children:j})})]}),(0,t.jsxs)(eo.c,{children:[(0,t.jsx)(en.K,{disabled:f,onClick:()=>a(!1),variant:"outline",children:i("cancel")}),(0,t.jsxs)(en.K,{disabled:f||!l||!d.trim()||!m&&0===g.size,onClick:()=>void w(),children:[f&&(0,t.jsx)(ex.f,{})," ",i("commit")]})]})]})})}function th({props:e,targets:s,open:a,onOpenChange:n}){let i=(0,U.f)("worktrees"),l=1===s.length?s[0].group.codebase.id:"",[o,d]=(0,r.useState)(l),[c,u]=(0,r.useState)("__new__"),[h,m]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!1),[x,f]=(0,r.useState)(null),[b,j]=(0,r.useState)(null),v=s.some(e=>e.group.codebase.id===o)?o:1===s.length?s[0].group.codebase.id:"",w=s.find(e=>e.group.codebase.id===v),k=s.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")),N=async t=>{if("AWAITING_STASH"===t.status){j(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)},I=async()=>{if(w){g(!0),f(null);try{let t=await (0,eS.W)(`mutation MoveWorktree($input: MoveWorktreeInput!) {
|
|
117
117
|
moveWorktree(input: $input) {
|
|
118
118
|
id sourceWorktreeId sourceCodebaseId targetCodebaseId targetWorktreeId destinationMode
|
|
119
119
|
branch headSha deleteSource status sourceJobId targetJobId cleanupJobId error warning
|
|
@@ -123,9 +123,9 @@
|
|
|
123
123
|
retryWorktreeMoveWithStash(id: $id) { id status }
|
|
124
124
|
}`,{id:b.id}),await N(await (0,eB.D)(b.id))}catch(e){f(e instanceof Error?e.message:String(e))}finally{g(!1)}}},A=async()=>{if(b){g(!0);try{await (0,eS.W)(`mutation CancelMove($id: ID!) {
|
|
125
125
|
cancelWorktreeMove(id: $id) { id status }
|
|
126
|
-
}`,{id:b.id}),await e.onReload(),
|
|
126
|
+
}`,{id:b.id}),await e.onReload(),n(!1)}catch(e){f(e instanceof Error?e.message:String(e))}finally{g(!1)}}};return(0,t.jsx)(eo.N,{onOpenChange:e=>!p&&n(e),open:a,children:(0,t.jsxs)(eo.d,{className:"sm:max-w-xl",children:[(0,t.jsxs)(eo.s,{children:[(0,t.jsx)(eo.F,{children:i("moveToAgent")}),(0,t.jsx)(eo.C,{children:i("moveDescription",{branch:e.worktree.branch??""})})]}),b?(0,t.jsx)(es.J,{children:(0,t.jsxs)(es.p,{className:"space-y-3",children:[(0,t.jsx)("p",{children:b.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)(em.f,{className:"mb-1.5 block",children:i("destinationAgent")}),(0,t.jsx)(eg.f,{ariaLabel:i("destinationAgent"),disabled:p,emptyMessage:i("noMoveDestinations"),onValueChange:e=>{d(e),u("__new__")},options:k,placeholder:i("selectDestinationAgent"),searchPlaceholder:i("searchDestinationAgents"),value:v})]}),w&&(0,t.jsxs)("div",{children:[(0,t.jsx)(em.f,{className:"mb-1.5 block",children:i("destinationWorktree")}),(0,t.jsxs)(ef.d,{disabled:p,onValueChange:u,value:c,children:[(0,t.jsx)(ef.P,{"aria-label":i("destinationWorktree"),children:(0,t.jsx)(ef.U,{})}),(0,t.jsxs)(ef.r,{children:[(0,t.jsx)(ef.T,{disabled:!!S,value:"__new__",children:i("createDestinationWorktree")}),w.group.worktrees.filter(e=>"AVAILABLE"===e.availability).map(e=>(0,t.jsxs)(ef.T,{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)(es.J,{children:(0,t.jsx)(es.p,{children:i("dirtyDestinationWarning")})}),(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(el.f,{checked:h,disabled:!C||p,id:`delete-source-${e.worktree.id}`,onCheckedChange:e=>m(!!e)}),(0,t.jsxs)("div",{children:[(0,t.jsx)(em.f,{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)(es.J,{variant:"destructive",children:(0,t.jsx)(es.p,{children:x})}),(0,t.jsxs)(eo.c,{children:[(0,t.jsx)(en.K,{disabled:p,onClick:()=>b?void A():n(!1),variant:"outline",children:b?i("cancelMove"):i("cancel")}),(0,t.jsxs)(en.K,{disabled:p||!b&&!w,onClick:()=>b?void E():void I(),children:[p&&(0,t.jsx)(ex.f,{}),b?i("stashAndContinue"):i("moveWorktree")]})]})]})})}function tm({props:e,open:s,onOpenChange:a}){let n=(0,U.f)("worktrees"),[i,l]=(0,r.useState)(!1),[o,d]=(0,r.useState)(!1),[c,u]=(0,r.useState)(null),h=!!(e.worktree.branch&&(e.group.codebase.remoteBranches.includes(e.worktree.branch)||e.worktree.upstream===`origin/${e.worktree.branch}`)),m=e.worktree.branch===e.group.codebase.defaultBranch,p=async()=>{d(!0),u(null);try{let t=await (0,eS.W)(`mutation DeleteWorktree($input: DeleteWorktreeInput!) {
|
|
127
127
|
deleteWorktree(input: $input) { id }
|
|
128
|
-
}`,{input:{worktreeId:e.worktree.id,deleteRemoteBranch:n,requestId:(0,ew.e)()}});await (0,eB.t)(t.deleteWorktree.id),await e.onReload(),e.onError(null),e.onDeleted?.(),a(!1)}catch(e){u(e instanceof Error?e.message:String(e))}finally{d(!1)}};return(0,t.jsx)(eo.N,{onOpenChange:e=>!o&&a(e),open:s,children:(0,t.jsxs)(eo.d,{children:[(0,t.jsxs)(eo.s,{children:[(0,t.jsx)(eo.F,{children:i("deleteWorktree")}),(0,t.jsx)(eo.C,{children:i("deleteWorktreeDescription",{path:(0,M.f)(e.worktree.folder,e.baseRepoDirectory)})})]}),(0,t.jsx)(es.J,{variant:"destructive",children:(0,t.jsx)(es.p,{children:i("deleteWorktreeWarning")})}),h&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(el.f,{checked:n,disabled:o||m,id:`delete-remote-${e.worktree.id}`,onCheckedChange:e=>l(!!e)}),(0,t.jsxs)("div",{children:[(0,t.jsx)(em.f,{htmlFor:`delete-remote-${e.worktree.id}`,children:i("deleteRemoteBranch",{branch:e.worktree.branch??""})}),m&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("defaultRemoteProtected")})]})]}),c&&(0,t.jsx)(es.J,{variant:"destructive",children:(0,t.jsx)(es.p,{children:c})}),(0,t.jsxs)(eo.c,{children:[(0,t.jsx)(ei.K,{disabled:o,onClick:()=>a(!1),variant:"outline",children:i("cancel")}),(0,t.jsxs)(ei.K,{disabled:o,onClick:()=>void p(),variant:"destructive",children:[o&&(0,t.jsx)(ex.f,{}),i("deleteWorktree")]})]})]})})}function tp(e){let{worktree:r}=e,{appId:s}=e,a=(0,U.f)("worktrees"),i=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id))?.agent,n=i?.connectionStatus==="ONLINE"&&i.capabilities.includes("ios.build.run")&&!1===e.group.iosBuildConfigured,l="AVAILABLE"!==r.availability||!i||"ONLINE"!==i.connectionStatus||!i.capabilities.includes("ios.build.run")||!1===e.group.iosBuildConfigured,o="AVAILABLE"!==r.availability||!i||"ONLINE"!==i.connectionStatus;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(F.G,{buildSettingsHref:n?`/dashboard/codebases/repositories/${e.group.repository.id}`:void 0,codebaseId:e.group.codebase.id,disabled:l,disabledReason:i&&"ONLINE"===i.connectionStatus?i.capabilities.includes("ios.build.run")?!1===e.group.iosBuildConfigured?a("iosBuildNotConfigured"):"AVAILABLE"!==r.availability?a("worktreeUnavailable"):null:a("agentUnsupported"):a("agentOffline"),onStarted:()=>void e.onCompleted(),worktreeId:r.id}),o?(0,t.jsxs)(ei.K,{disabled:!0,size:"sm",variant:"outline",children:[(0,t.jsx)($.f,{})," ",a("newSession")]}):(0,t.jsx)(ei.K,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)(eN.L,{href:`/ai/drafts/new?kind=session&worktree=${r.id}${s?`&app=${encodeURIComponent(s)}`:""}`,children:[(0,t.jsx)($.f,{})," ",a("newSession")]})}),o?(0,t.jsxs)(ei.K,{disabled:!0,size:"sm",variant:"outline",children:[(0,t.jsx)(m.f,{})," ",a("newPlan")]}):(0,t.jsx)(ei.K,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)(eN.L,{href:`/ai/drafts/new?kind=plan&worktree=${r.id}${s?`&app=${encodeURIComponent(s)}`:""}`,children:[(0,t.jsx)(m.f,{})," ",a("newPlan")]})})]})}function tg(e){let{worktree:r}=e,s=(0,U.f)("worktrees"),a="AVAILABLE"!==r.availability||!!e.group.blockingJob||r.rebaseInProgress,i={hasChanges:ez(r),stageOperation:r.hasStagedChanges&&!r.hasUnstagedChanges?"UNSTAGE_ALL":"STAGE_ALL"};return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(tp,{...e}),(0,t.jsx)(tf,{icon:(0,t.jsx)(x.f,{}),label:s("pull"),operation:"PULL",props:e,disabled:a||!r.upstream||0===r.behind}),(0,t.jsx)(tf,{confirm:!0,icon:(0,t.jsx)(R.f,{}),label:s("sync"),operation:"SYNC",props:e,disabled:a||!r.upstream||!r.baseBranch||0===r.baseBehind}),(0,t.jsx)(tf,{confirm:!0,icon:(0,t.jsx)(w.f,{}),label:s("rebase"),operation:"REBASE",props:e,disabled:a||!r.baseBranch||0===r.baseBehind}),(0,t.jsx)(tf,{icon:(0,t.jsx)(O.f,{}),label:s(r.upstream?"push":"publish"),operation:"PUSH",props:e,disabled:a||!r.branch}),(0,t.jsx)(V.b,{conflictWorkflows:e.group.mergeConflictQuickActions??[],disabled:a||!r.upstream||!r.baseBranch,onCompleted:e.onCompleted,onError:e.onError,worktree:r}),(0,t.jsx)(V.o,{conflictWorkflows:e.group.mergeConflictQuickActions??[],disabled:a,onCompleted:e.onCompleted,onError:e.onError,worktree:r}),(0,t.jsxs)(ed.G,{children:[(0,t.jsx)(ed.X,{asChild:!0,children:(0,t.jsxs)(ei.K,{size:"sm",variant:"outline",children:[(0,t.jsx)(C.f,{})," ",s("moreActions")]})}),(0,t.jsxs)(ed.L,{align:"end",children:[(0,t.jsx)(tb,{confirm:!0,icon:(0,t.jsx)(O.f,{}),label:s("forcePush"),operation:"FORCE_PUSH",props:e,disabled:a||!r.upstream}),(0,t.jsx)(tb,{confirm:!0,icon:(0,t.jsx)(T.f,{}),label:s("reset"),operation:"RESET",props:e,disabled:a||!r.upstream}),(0,t.jsx)(tb,{confirm:!0,icon:(0,t.jsx)(S.f,{}),label:s("clearLock"),operation:"CLEAR_LOCK",props:e,disabled:a}),(0,t.jsx)(tb,{icon:(0,t.jsx)(n.f,{}),label:s("stashAll"),operation:"STASH_ALL",props:e,disabled:a||!i.hasChanges}),(0,t.jsx)(tb,{icon:(0,t.jsx)(c.f,{}),label:s("UNSTAGE_ALL"===i.stageOperation?"unstageAll":"stageAll"),operation:i.stageOperation,props:e,disabled:a||!i.hasChanges})]})]}),r.activeJob&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(ex.f,{})," ",s("operationRunning")]})]})}function tx({props:e,operation:t,confirm:s=!1}){let a=(0,U.f)("worktrees"),[i,n]=(0,r.useState)(!1),[l,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(!1),u=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{u.current&&window.clearTimeout(u.current)},[]);let h=async()=>{if(s&&!i){n(!0),u.current=window.setTimeout(()=>n(!1),5e3);return}o(!0),n(!1);try{let r=await (0,eS.W)("mutation RunWorktreeOperation($input: RunWorktreeOperationInput!) { runWorktreeOperation(input: $input) { id } }",{input:{worktreeId:e.worktree.id,operation:t,requestId:(0,ew.e)(),...d?{forcePreparations:!0}:{}}});e.onError(null),await e.onCompleted();let s=await (0,eB.Y)(r.runWorktreeOperation.id);if(await e.onCompleted(),s?.outcome==="PREPARATION_CONFLICT"){c(!0),n(!0),e.onError(a("preparationConflict",{paths:s.preparationConflictPaths.join(", ")}));return}c(!1)}catch(t){try{await e.onCompleted()}catch{}e.onError(t instanceof Error?t.message:String(t))}finally{o(!1)}};return{armed:i,busy:l,forcePreparations:d,run:h}}function tf({props:e,operation:r,label:s,icon:a,confirm:i=!1,disabled:n=!1}){let l=(0,U.f)("worktrees"),{armed:o,busy:d,forcePreparations:u,run:h}=tx({props:e,operation:r,confirm:i});return(0,t.jsxs)(ei.K,{disabled:n||d,onClick:()=>void h(),size:"sm",variant:o?"destructive":"outline",children:[d?(0,t.jsx)(ex.f,{}):o?(0,t.jsx)(c.f,{}):a," ",o?l(u?"forcePreparationOperation":"confirmAction"):s]})}function tb({props:e,operation:r,label:s,icon:a,confirm:i=!1,disabled:n=!1}){let l=(0,U.f)("worktrees"),{armed:o,busy:d,run:u}=tx({props:e,operation:r,confirm:i});return(0,t.jsxs)(ed.r,{disabled:n||d,onSelect:e=>{i&&!o&&e.preventDefault(),u()},variant:o?"destructive":"default",children:[d?(0,t.jsx)(ex.f,{}):o?(0,t.jsx)(c.f,{}):a,o?l("confirmAction"):s]})}function tj(e){let s=(0,U.f)("worktrees");return(0,t.jsx)("div",{className:"rounded-xl border",children:(0,t.jsxs)(eb.s,{children:[(0,t.jsx)(eb.E,{children:(0,t.jsxs)(eb.N,{children:[(0,t.jsx)(eb.V,{children:s("branch")}),(0,t.jsx)(eb.V,{children:s("path")}),(0,t.jsx)(eb.V,{children:s("baseBranch")}),(0,t.jsx)(eb.V,{children:s("upToDate")}),(0,t.jsx)(eb.V,{children:s("tags")}),(0,t.jsx)(eb.V,{children:s("pullRequest")}),(0,t.jsx)(eb.V,{children:s("origin")}),(0,t.jsx)(eb.V,{})]})}),(0,t.jsx)(eb.z,{children:e.group.worktrees.map(t=>(0,r.createElement)(tv,{...e,key:t.id,worktree:t}))})]})})}function tv(e){let{baseRepoDirectory:s,inspectionRefreshToken:a}=e,{worktree:i,applyActivity:n,setUnstagedChanges:l}=(0,eW.L)(e.worktree),o={...e,worktree:i},d=(0,U.f)("worktrees"),c=(0,eN.U)(),[m,p]=(0,r.useState)(!1),[g,x]=(0,r.useState)(null),[f,b]=(0,r.useState)(!1),[j,v]=(0,r.useState)(null),w=(0,r.useRef)(0),k=(0,r.useRef)(a),y=(0,r.useCallback)(async()=>{let e=++w.current;b(!0);try{let t=await (0,eW.I)(i.id);if(e!==w.current)return;x(t),l(t.changes.some(e=>e.unstaged||e.untracked||e.conflicted)),v(null)}catch(t){e===w.current&&v(t instanceof Error?t.message:String(t))}finally{e===w.current&&b(!1)}},[l,i.id]),S=(0,eW.x)(y),C=(0,r.useCallback)(e=>{n(e),m&&S()},[n,m,S]);(0,eW.q)(i.id,e.liveUpdatesEnabled&&"AVAILABLE"===i.availability,C),(0,r.useEffect)(()=>{if(k.current===a||(k.current=a,!m))return;let e=window.setTimeout(()=>void S(),0);return()=>window.clearTimeout(e)},[m,a,S]);let N=()=>{let e=!m;p(e),e&&!g&&S()},I=i.highlightColor&&ey.m[i.highlightColor];return(0,t.jsxs)(r.Fragment,{children:[(0,t.jsxs)(eb.N,{className:(0,eC.f)("cursor-pointer transition-colors hover:bg-muted/50",I),onClick:e=>{(0,eO.g)(e)&&c.push((0,eO.P)(i.id))},children:[(0,t.jsxs)(eb.d,{children:[(0,t.jsxs)(ei.K,{"aria-expanded":m,className:"max-w-full px-0 font-mono",onClick:()=>void N(),variant:"ghost",children:[m?(0,t.jsx)(u.f,{}):(0,t.jsx)(h.f,{}),(0,t.jsx)("span",{className:"truncate",children:i.branch??d("detached")})]}),(i.ticketKey||i.ticketTitle)&&(0,t.jsx)(te,{...o,compact:!0})]}),(0,t.jsx)(eb.d,{className:"font-mono text-xs",children:(0,M.f)(i.folder,s)}),(0,t.jsx)(eb.d,{children:(0,t.jsx)(to,{...o,compact:!0})}),(0,t.jsx)(eb.d,{children:(0,t.jsx)(ti,{worktree:i})}),(0,t.jsx)(eb.d,{children:(0,t.jsx)(ta,{...o,compact:!0})}),(0,t.jsx)(eb.d,{children:(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:(0,t.jsx)(tn,{detailsExpanded:m,onPipelinesChanged:e.onReload,onToggleDetails:N,worktree:i})})}),(0,t.jsx)(eb.d,{children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,t.jsx)(tl,{worktree:i}),ez(i)&&(0,t.jsx)(ea.f,{variant:"destructive",children:d("dirty")})]})}),(0,t.jsx)(eb.d,{children:(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,t.jsx)(e9,{worktree:i}),(0,t.jsx)(tc,{...o})]})})]}),i.rebaseInProgress&&(0,t.jsx)(eb.N,{className:(0,eC.f)(I),children:(0,t.jsx)(eb.d,{colSpan:8,children:(0,t.jsx)(eP.f,{group:e.group,onCompleted:e.onReload,onError:e.onError,worktree:i})})}),(0,t.jsx)(eb.N,{className:(0,eC.f)(I),children:(0,t.jsx)(eb.d,{colSpan:8,children:(0,t.jsx)(tg,{...o,onCompleted:async()=>{await e.onReload(),m&&await S()}})})}),m&&(0,t.jsx)(eb.N,{className:(0,eC.f)(I),children:(0,t.jsxs)(eb.d,{colSpan:8,children:[(0,t.jsx)(e$.f,{error:j}),f&&!g?(0,t.jsx)(ex.f,{}):g?(0,t.jsx)(eA.m,{detail:g,inline:!0,worktreeId:i.id,worktreeFolder:i.folder}):null]})})]})}function tw({tag:e}){return(0,t.jsx)(ea.f,{className:eQ[e.color],children:e.name})}function tk({label:e,value:r,mono:s=!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,eC.f)("flex min-h-6 items-center truncate",s&&"font-mono text-xs"),title:r,children:r})]})}function ty({open:e,onOpenChange:s,tags:a,onChanged:i}){let n=(0,U.f)("worktrees"),[l,o]=(0,r.useState)(null),[d,c]=(0,r.useState)(""),[u,h]=(0,r.useState)("blue"),[m,p]=(0,r.useState)(null),g=async e=>{e.preventDefault();try{await (0,eS.W)("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 i()}catch(e){p(e instanceof Error?e.message:String(e))}},x=async e=>{try{await (0,eS.W)("mutation DeleteTag($id: ID!) { deleteWorktreeTag(id: $id) }",{id:e}),await i()}catch(e){p(e instanceof Error?e.message:String(e))}};return(0,t.jsx)(eo.N,{onOpenChange:s,open:e,children:(0,t.jsxs)(eo.d,{children:[(0,t.jsxs)(eo.s,{children:[(0,t.jsx)(eo.F,{children:n("manageTags")}),(0,t.jsx)(eo.C,{children:n("manageTagsDescription")})]}),m&&(0,t.jsx)(es.J,{variant:"destructive",children:(0,t.jsx)(es.p,{children:m})}),(0,t.jsx)(eh.t,{className:"gap-2",children:a.map(e=>(0,t.jsxs)(eh.M,{size:"sm",variant:"outline",children:[(0,t.jsx)(eh.H,{children:(0,t.jsx)(eh.$,{children:(0,t.jsx)(tw,{tag:e})})}),(0,t.jsxs)(eh.P,{children:[(0,t.jsx)(ei.K,{onClick:()=>{o(e),c(e.name),h(e.color)},size:"sm",variant:"outline",children:n("edit")}),(0,t.jsx)(ei.K,{onClick:()=>void x(e.id),size:"icon-sm",variant:"destructive",children:(0,t.jsx)(P.f,{})})]})]},e.id))}),(0,t.jsxs)("form",{className:"space-y-3 border-t pt-3",onSubmit:g,children:[(0,t.jsx)(em.f,{htmlFor:"tag-name",children:l?n("editTag"):n("createTag")}),(0,t.jsx)(eu.f,{id:"tag-name",maxLength:40,onChange:e=>c(e.target.value),required:!0,value:d}),(0,t.jsx)(ej.z,{"aria-label":n("highlight"),className:"grid w-full grid-cols-12 gap-1",onValueChange:e=>{e&&h(e)},size:"sm",spacing:1,type:"single",value:u,variant:"outline",children:eL.map(e=>(0,t.jsx)(ej.H,{"aria-label":e,className:(0,eC.f)("aspect-square h-auto w-full min-w-0 p-0",eX[e],eZ[e],"data-[state=on]:ring-2 data-[state=on]:ring-foreground"),value:e},e))}),(0,t.jsx)(eo.c,{children:(0,t.jsxs)(ei.K,{type:"submit",children:[(0,t.jsx)(D.f,{})," ",n("saveTag")]})})]})]})})}function tS({appId:e,open:s,onOpenChange:a,onChanged:i}){let l=(0,U.f)("worktrees"),[o,d]=(0,r.useState)([]),[c,u]=(0,r.useState)(null),h=(0,r.useCallback)(async()=>{try{let t=await (0,eS.W)(`query HiddenWorktrees($appId: ID) { hiddenWorktrees(appId: $appId) { ${eD.Y} } }`,{appId:e??null});d(t.hiddenWorktrees),u(null)}catch(e){u(e instanceof Error?e.message:String(e))}},[e]);(0,r.useEffect)(()=>{if(!s)return;let e=window.setTimeout(()=>void h(),0);return()=>window.clearTimeout(e)},[s,h]);let m=async e=>{try{await (0,eS.W)(e?"mutation PurgeHidden($id: ID!) { purgeHiddenWorktree(id: $id) }":"mutation PurgeAllHidden { purgeAllHiddenWorktrees }",e?{id:e}:void 0),await h(),await i()}catch(e){u(e instanceof Error?e.message:String(e))}};return(0,t.jsx)(eo.N,{onOpenChange:a,open:s,children:(0,t.jsxs)(eo.d,{className:"sm:max-w-3xl",children:[(0,t.jsxs)(eo.s,{children:[(0,t.jsx)(eo.F,{children:l("hiddenTitle")}),(0,t.jsx)(eo.C,{children:l("hiddenDescription")})]}),c&&(0,t.jsx)(es.J,{variant:"destructive",children:(0,t.jsx)(es.p,{children:c})}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto",children:o.length?(0,t.jsx)(eh.t,{className:"gap-2",children:o.map(e=>(0,t.jsxs)(eh.M,{variant:"outline",children:[(0,t.jsx)(eh.Y,{variant:"icon",children:(0,t.jsx)(j.f,{})}),(0,t.jsxs)(eh.H,{className:"min-w-0",children:[(0,t.jsx)(eh.$,{className:"font-mono",children:e.branch??l("detached")}),(0,t.jsx)(eh.B,{className:"truncate",title:e.folder,children:e.folder})]}),(0,t.jsx)(eh.P,{children:(0,t.jsxs)(ei.K,{onClick:()=>void m(e.id),size:"sm",variant:"destructive",children:[(0,t.jsx)(P.f,{})," ",l("purge")]})})]},e.id))}):(0,t.jsx)(ec.e,{className:"border-0 py-8",children:(0,t.jsxs)(ec.c,{children:[(0,t.jsx)(ec.B,{variant:"icon",children:(0,t.jsx)(n.f,{})}),(0,t.jsx)(ec.p,{children:l("noHidden")})]})})}),(0,t.jsx)(eo.c,{children:o.length>0&&!e&&(0,t.jsxs)(ei.K,{onClick:()=>void m(),variant:"destructive",children:[(0,t.jsx)(P.f,{})," ",l("purgeAll")]})})]})})}e.s(["B",0,tg,"s",0,ti,"_",0,tl,"E",0,tp,"f",0,tn,"$",0,ty,"a",0,tc,"p",0,tt,"t",0,te,"b",0,function({appId:e}){let s=(0,U.f)("worktrees"),[l,o]=(0,r.useState)(()=>new URLSearchParams(window.location.search).get("issue")),[d,c]=(0,r.useState)(null),[u,h]=(0,r.useState)(()=>"table"===window.localStorage.getItem(eU)?"table":"cards"),[m,p]=(0,r.useState)(()=>"repository"===window.localStorage.getItem(e_)?"repository":"agent"),[g,f]=(0,r.useState)(!0),[b,v]=(0,r.useState)(!1),[w,S]=(0,r.useState)(null),[C,N]=(0,r.useState)(null),[I,E]=(0,r.useState)(null),[A,T]=(0,r.useState)(0),[D,B]=(0,r.useState)(!1),[$,P]=(0,r.useState)(!1),O=(0,a.q)(),L=(0,U.f)("activeAgent"),[_]=(0,r.useState)(()=>(function(e){let t={query:"",agentId:eK,repositoryId:eK,changes:eK,branches:eK};try{let r=window.localStorage.getItem(eG(e));if(!r)return t;let s=JSON.parse(r);if(!s||"object"!=typeof s)return t;return{query:"string"==typeof s.query?s.query:t.query,agentId:"string"==typeof s.agentId?s.agentId:t.agentId,repositoryId:"string"==typeof s.repositoryId?s.repositoryId:t.repositoryId,changes:s.changes===eq||s.changes===eF?s.changes:t.changes,branches:s.branches===eV||s.branches===eH?s.branches:t.branches}}catch{return t}})(e)),[M,K]=(0,r.useState)(_.query),[q,F]=(0,r.useState)(_.agentId),[V,H]=(0,r.useState)(_.repositoryId),[G,z]=(0,r.useState)(_.changes),[J,Y]=(0,r.useState)(_.branches),Q=(0,r.useRef)(0),X=(0,r.useRef)(null),Z=(0,r.useCallback)(()=>X.current?.refresh().catch(()=>void 0)??Promise.resolve(),[]),ee=(0,r.useCallback)(async()=>{let e=X.current;e&&(await e.refresh(),X.current===e&&T(e=>e+1))},[]),ea=(0,eT.f)({scopeKey:e??"all-worktrees",refreshPage:ee}),en=(0,r.useCallback)(async t=>{let r=++Q.current;try{let s=await (0,eS.W)(`query WorktreeOverview($appId: ID) {
|
|
128
|
+
}`,{input:{worktreeId:e.worktree.id,deleteRemoteBranch:i,requestId:(0,ew.e)()}});await (0,eB.t)(t.deleteWorktree.id),await e.onReload(),e.onError(null),e.onDeleted?.(),a(!1)}catch(e){u(e instanceof Error?e.message:String(e))}finally{d(!1)}};return(0,t.jsx)(eo.N,{onOpenChange:e=>!o&&a(e),open:s,children:(0,t.jsxs)(eo.d,{children:[(0,t.jsxs)(eo.s,{children:[(0,t.jsx)(eo.F,{children:n("deleteWorktree")}),(0,t.jsx)(eo.C,{children:n("deleteWorktreeDescription",{path:(0,M.f)(e.worktree.folder,e.baseRepoDirectory)})})]}),(0,t.jsx)(es.J,{variant:"destructive",children:(0,t.jsx)(es.p,{children:n("deleteWorktreeWarning")})}),h&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(el.f,{checked:i,disabled:o||m,id:`delete-remote-${e.worktree.id}`,onCheckedChange:e=>l(!!e)}),(0,t.jsxs)("div",{children:[(0,t.jsx)(em.f,{htmlFor:`delete-remote-${e.worktree.id}`,children:n("deleteRemoteBranch",{branch:e.worktree.branch??""})}),m&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n("defaultRemoteProtected")})]})]}),c&&(0,t.jsx)(es.J,{variant:"destructive",children:(0,t.jsx)(es.p,{children:c})}),(0,t.jsxs)(eo.c,{children:[(0,t.jsx)(en.K,{disabled:o,onClick:()=>a(!1),variant:"outline",children:n("cancel")}),(0,t.jsxs)(en.K,{disabled:o,onClick:()=>void p(),variant:"destructive",children:[o&&(0,t.jsx)(ex.f,{}),n("deleteWorktree")]})]})]})})}function tp(e){let{worktree:r}=e,{appId:s}=e,a=(0,U.f)("worktrees"),n=e.overview.agents.find(t=>t.codebases.some(t=>t.codebase.id===e.group.codebase.id))?.agent,i=n?.connectionStatus==="ONLINE"&&n.capabilities.includes("ios.build.run")&&!1===e.group.iosBuildConfigured,l="AVAILABLE"!==r.availability||!n||"ONLINE"!==n.connectionStatus||!n.capabilities.includes("ios.build.run")||!1===e.group.iosBuildConfigured,o="AVAILABLE"!==r.availability||!n||"ONLINE"!==n.connectionStatus;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(F.G,{buildSettingsHref:i?`/dashboard/codebases/repositories/${e.group.repository.id}`:void 0,codebaseId:e.group.codebase.id,disabled:l,disabledReason:n&&"ONLINE"===n.connectionStatus?n.capabilities.includes("ios.build.run")?!1===e.group.iosBuildConfigured?a("iosBuildNotConfigured"):"AVAILABLE"!==r.availability?a("worktreeUnavailable"):null:a("agentUnsupported"):a("agentOffline"),onStarted:()=>void e.onCompleted(),worktreeId:r.id}),o?(0,t.jsxs)(en.K,{disabled:!0,size:"sm",variant:"outline",children:[(0,t.jsx)($.f,{})," ",a("newSession")]}):(0,t.jsx)(en.K,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)(eN.L,{href:`/ai/drafts/new?kind=session&worktree=${r.id}${s?`&app=${encodeURIComponent(s)}`:""}`,children:[(0,t.jsx)($.f,{})," ",a("newSession")]})}),o?(0,t.jsxs)(en.K,{disabled:!0,size:"sm",variant:"outline",children:[(0,t.jsx)(m.f,{})," ",a("newPlan")]}):(0,t.jsx)(en.K,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)(eN.L,{href:`/ai/drafts/new?kind=plan&worktree=${r.id}${s?`&app=${encodeURIComponent(s)}`:""}`,children:[(0,t.jsx)(m.f,{})," ",a("newPlan")]})})]})}function tg(e){let{worktree:r}=e,s=(0,U.f)("worktrees"),a="AVAILABLE"!==r.availability||!!e.group.blockingJob||r.rebaseInProgress,n={hasChanges:ez(r),stageOperation:r.hasStagedChanges&&!r.hasUnstagedChanges?"UNSTAGE_ALL":"STAGE_ALL"};return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(tp,{...e}),(0,t.jsx)(tf,{icon:(0,t.jsx)(x.f,{}),label:s("pull"),operation:"PULL",props:e,disabled:a||!r.upstream||0===r.behind}),(0,t.jsx)(tf,{confirm:!0,icon:(0,t.jsx)(R.f,{}),label:s("sync"),operation:"SYNC",props:e,disabled:a||!r.upstream||!r.baseBranch||0===r.baseBehind}),(0,t.jsx)(tf,{confirm:!0,icon:(0,t.jsx)(w.f,{}),label:s("rebase"),operation:"REBASE",props:e,disabled:a||!r.baseBranch||0===r.baseBehind}),(0,t.jsx)(tf,{icon:(0,t.jsx)(O.f,{}),label:s(r.upstream?"push":"publish"),operation:"PUSH",props:e,disabled:a||!r.branch}),(0,t.jsx)(V.b,{conflictWorkflows:e.group.mergeConflictQuickActions??[],disabled:a||!r.upstream||!r.baseBranch,onCompleted:e.onCompleted,onError:e.onError,worktree:r}),(0,t.jsx)(V.o,{conflictWorkflows:e.group.mergeConflictQuickActions??[],disabled:a,onCompleted:e.onCompleted,onError:e.onError,worktree:r}),(0,t.jsxs)(ed.G,{children:[(0,t.jsx)(ed.X,{asChild:!0,children:(0,t.jsxs)(en.K,{size:"sm",variant:"outline",children:[(0,t.jsx)(C.f,{})," ",s("moreActions")]})}),(0,t.jsxs)(ed.L,{align:"end",children:[(0,t.jsx)(tb,{confirm:!0,icon:(0,t.jsx)(O.f,{}),label:s("forcePush"),operation:"FORCE_PUSH",props:e,disabled:a||!r.upstream}),(0,t.jsx)(tb,{confirm:!0,icon:(0,t.jsx)(T.f,{}),label:s("reset"),operation:"RESET",props:e,disabled:a||!r.upstream}),(0,t.jsx)(tb,{confirm:!0,icon:(0,t.jsx)(S.f,{}),label:s("clearLock"),operation:"CLEAR_LOCK",props:e,disabled:a}),(0,t.jsx)(tb,{icon:(0,t.jsx)(i.f,{}),label:s("stashAll"),operation:"STASH_ALL",props:e,disabled:a||!n.hasChanges}),(0,t.jsx)(tb,{icon:(0,t.jsx)(c.f,{}),label:s("UNSTAGE_ALL"===n.stageOperation?"unstageAll":"stageAll"),operation:n.stageOperation,props:e,disabled:a||!n.hasChanges})]})]}),r.activeJob&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(ex.f,{})," ",s("operationRunning")]})]})}function tx({props:e,operation:t,confirm:s=!1}){let a=(0,U.f)("worktrees"),[n,i]=(0,r.useState)(!1),[l,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(!1),u=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{u.current&&window.clearTimeout(u.current)},[]);let h=async()=>{if(s&&!n){i(!0),u.current=window.setTimeout(()=>i(!1),5e3);return}o(!0),i(!1);try{let r=await (0,eS.W)("mutation RunWorktreeOperation($input: RunWorktreeOperationInput!) { runWorktreeOperation(input: $input) { id } }",{input:{worktreeId:e.worktree.id,operation:t,requestId:(0,ew.e)(),...d?{forcePreparations:!0}:{}}});e.onError(null),await e.onCompleted();let s=await (0,eB.Y)(r.runWorktreeOperation.id);if(await e.onCompleted(),s?.outcome==="PREPARATION_CONFLICT"){c(!0),i(!0),e.onError(a("preparationConflict",{paths:s.preparationConflictPaths.join(", ")}));return}c(!1)}catch(t){try{await e.onCompleted()}catch{}e.onError(t instanceof Error?t.message:String(t))}finally{o(!1)}};return{armed:n,busy:l,forcePreparations:d,run:h}}function tf({props:e,operation:r,label:s,icon:a,confirm:n=!1,disabled:i=!1}){let l=(0,U.f)("worktrees"),{armed:o,busy:d,forcePreparations:u,run:h}=tx({props:e,operation:r,confirm:n});return(0,t.jsxs)(en.K,{disabled:i||d,onClick:()=>void h(),size:"sm",variant:o?"destructive":"outline",children:[d?(0,t.jsx)(ex.f,{}):o?(0,t.jsx)(c.f,{}):a," ",o?l(u?"forcePreparationOperation":"confirmAction"):s]})}function tb({props:e,operation:r,label:s,icon:a,confirm:n=!1,disabled:i=!1}){let l=(0,U.f)("worktrees"),{armed:o,busy:d,run:u}=tx({props:e,operation:r,confirm:n});return(0,t.jsxs)(ed.r,{disabled:i||d,onSelect:e=>{n&&!o&&e.preventDefault(),u()},variant:o?"destructive":"default",children:[d?(0,t.jsx)(ex.f,{}):o?(0,t.jsx)(c.f,{}):a,o?l("confirmAction"):s]})}function tj(e){let s=(0,U.f)("worktrees");return(0,t.jsx)("div",{className:"rounded-xl border",children:(0,t.jsxs)(eb.s,{children:[(0,t.jsx)(eb.E,{children:(0,t.jsxs)(eb.N,{children:[(0,t.jsx)(eb.V,{children:s("branch")}),(0,t.jsx)(eb.V,{children:s("path")}),(0,t.jsx)(eb.V,{children:s("baseBranch")}),(0,t.jsx)(eb.V,{children:s("upToDate")}),(0,t.jsx)(eb.V,{children:s("tags")}),(0,t.jsx)(eb.V,{children:s("pullRequest")}),(0,t.jsx)(eb.V,{children:s("origin")}),(0,t.jsx)(eb.V,{})]})}),(0,t.jsx)(eb.z,{children:e.group.worktrees.map(t=>(0,r.createElement)(tv,{...e,key:t.id,worktree:t}))})]})})}function tv(e){let{baseRepoDirectory:s,inspectionRefreshToken:a}=e,{worktree:n,applyActivity:i,setUnstagedChanges:l}=(0,eW.L)(e.worktree),o={...e,worktree:n},d=(0,U.f)("worktrees"),c=(0,eN.U)(),[m,p]=(0,r.useState)(!1),[g,x]=(0,r.useState)(null),[f,b]=(0,r.useState)(!1),[j,v]=(0,r.useState)(null),w=(0,r.useRef)(0),k=(0,r.useRef)(a),y=(0,r.useCallback)(async()=>{let e=++w.current;b(!0);try{let t=await (0,eW.I)(n.id);if(e!==w.current)return;x(t),l(t.changes.some(e=>e.unstaged||e.untracked||e.conflicted)),v(null)}catch(t){e===w.current&&v(t instanceof Error?t.message:String(t))}finally{e===w.current&&b(!1)}},[l,n.id]),S=(0,eW.x)(y),C=(0,r.useCallback)(e=>{i(e),m&&S()},[i,m,S]);(0,eW.q)(n.id,e.liveUpdatesEnabled&&"AVAILABLE"===n.availability,C),(0,r.useEffect)(()=>{if(k.current===a||(k.current=a,!m))return;let e=window.setTimeout(()=>void S(),0);return()=>window.clearTimeout(e)},[m,a,S]);let N=()=>{let e=!m;p(e),e&&!g&&S()},I=n.highlightColor&&ey.m[n.highlightColor];return(0,t.jsxs)(r.Fragment,{children:[(0,t.jsxs)(eb.N,{className:(0,eC.f)("cursor-pointer transition-colors hover:bg-muted/50",I),onClick:e=>{(0,eO.g)(e)&&c.push((0,eO.P)(n.id))},children:[(0,t.jsxs)(eb.d,{children:[(0,t.jsxs)(en.K,{"aria-expanded":m,className:"max-w-full px-0 font-mono",onClick:()=>void N(),variant:"ghost",children:[m?(0,t.jsx)(u.f,{}):(0,t.jsx)(h.f,{}),(0,t.jsx)("span",{className:"truncate",children:n.branch??d("detached")})]}),(n.ticketKey||n.ticketTitle)&&(0,t.jsx)(te,{...o,compact:!0})]}),(0,t.jsx)(eb.d,{className:"font-mono text-xs",children:(0,M.f)(n.folder,s)}),(0,t.jsx)(eb.d,{children:(0,t.jsx)(to,{...o,compact:!0})}),(0,t.jsx)(eb.d,{children:(0,t.jsx)(tn,{worktree:n})}),(0,t.jsx)(eb.d,{children:(0,t.jsx)(ta,{...o,compact:!0})}),(0,t.jsx)(eb.d,{children:(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:(0,t.jsx)(ti,{detailsExpanded:m,onPipelinesChanged:e.onReload,onToggleDetails:N,worktree:n})})}),(0,t.jsx)(eb.d,{children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,t.jsx)(tl,{worktree:n}),ez(n)&&(0,t.jsx)(ea.f,{variant:"destructive",children:d("dirty")})]})}),(0,t.jsx)(eb.d,{children:(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,t.jsx)(e9,{worktree:n}),(0,t.jsx)(tc,{...o})]})})]}),n.rebaseInProgress&&(0,t.jsx)(eb.N,{className:(0,eC.f)(I),children:(0,t.jsx)(eb.d,{colSpan:8,children:(0,t.jsx)(eP.f,{group:e.group,onCompleted:e.onReload,onError:e.onError,worktree:n})})}),(0,t.jsx)(eb.N,{className:(0,eC.f)(I),children:(0,t.jsx)(eb.d,{colSpan:8,children:(0,t.jsx)(tg,{...o,onCompleted:async()=>{await e.onReload(),m&&await S()}})})}),m&&(0,t.jsx)(eb.N,{className:(0,eC.f)(I),children:(0,t.jsxs)(eb.d,{colSpan:8,children:[(0,t.jsx)(e$.f,{error:j}),f&&!g?(0,t.jsx)(ex.f,{}):g?(0,t.jsx)(eA.m,{detail:g,inline:!0,worktreeId:n.id,worktreeFolder:n.folder}):null]})})]})}function tw({tag:e}){return(0,t.jsx)(ea.f,{className:eQ[e.color],children:e.name})}function tk({label:e,value:r,mono:s=!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,eC.f)("flex min-h-6 items-center truncate",s&&"font-mono text-xs"),title:r,children:r})]})}function ty({open:e,onOpenChange:s,tags:a,onChanged:n}){let i=(0,U.f)("worktrees"),[l,o]=(0,r.useState)(null),[d,c]=(0,r.useState)(""),[u,h]=(0,r.useState)("blue"),[m,p]=(0,r.useState)(null),g=async e=>{e.preventDefault();try{await (0,eS.W)("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,eS.W)("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)(eo.N,{onOpenChange:s,open:e,children:(0,t.jsxs)(eo.d,{children:[(0,t.jsxs)(eo.s,{children:[(0,t.jsx)(eo.F,{children:i("manageTags")}),(0,t.jsx)(eo.C,{children:i("manageTagsDescription")})]}),m&&(0,t.jsx)(es.J,{variant:"destructive",children:(0,t.jsx)(es.p,{children:m})}),(0,t.jsx)(eh.t,{className:"gap-2",children:a.map(e=>(0,t.jsxs)(eh.M,{size:"sm",variant:"outline",children:[(0,t.jsx)(eh.H,{children:(0,t.jsx)(eh.$,{children:(0,t.jsx)(tw,{tag:e})})}),(0,t.jsxs)(eh.P,{children:[(0,t.jsx)(en.K,{onClick:()=>{o(e),c(e.name),h(e.color)},size:"sm",variant:"outline",children:i("edit")}),(0,t.jsx)(en.K,{onClick:()=>void x(e.id),size:"icon-sm",variant:"destructive",children:(0,t.jsx)(P.f,{})})]})]},e.id))}),(0,t.jsxs)("form",{className:"space-y-3 border-t pt-3",onSubmit:g,children:[(0,t.jsx)(em.f,{htmlFor:"tag-name",children:l?i("editTag"):i("createTag")}),(0,t.jsx)(eu.f,{id:"tag-name",maxLength:40,onChange:e=>c(e.target.value),required:!0,value:d}),(0,t.jsx)(ej.z,{"aria-label":i("highlight"),className:"grid w-full grid-cols-12 gap-1",onValueChange:e=>{e&&h(e)},size:"sm",spacing:1,type:"single",value:u,variant:"outline",children:eL.map(e=>(0,t.jsx)(ej.H,{"aria-label":e,className:(0,eC.f)("aspect-square h-auto w-full min-w-0 p-0",eX[e],eZ[e],"data-[state=on]:ring-2 data-[state=on]:ring-foreground"),value:e},e))}),(0,t.jsx)(eo.c,{children:(0,t.jsxs)(en.K,{type:"submit",children:[(0,t.jsx)(D.f,{})," ",i("saveTag")]})})]})]})})}function tS({appId:e,open:s,onOpenChange:a,onChanged:n}){let l=(0,U.f)("worktrees"),[o,d]=(0,r.useState)([]),[c,u]=(0,r.useState)(null),h=(0,r.useCallback)(async()=>{try{let t=await (0,eS.W)(`query HiddenWorktrees($appId: ID) { hiddenWorktrees(appId: $appId) { ${eD.Y} } }`,{appId:e??null});d(t.hiddenWorktrees),u(null)}catch(e){u(e instanceof Error?e.message:String(e))}},[e]);(0,r.useEffect)(()=>{if(!s)return;let e=window.setTimeout(()=>void h(),0);return()=>window.clearTimeout(e)},[s,h]);let m=async e=>{try{await (0,eS.W)(e?"mutation PurgeHidden($id: ID!) { purgeHiddenWorktree(id: $id) }":"mutation PurgeAllHidden { purgeAllHiddenWorktrees }",e?{id:e}:void 0),await h(),await n()}catch(e){u(e instanceof Error?e.message:String(e))}};return(0,t.jsx)(eo.N,{onOpenChange:a,open:s,children:(0,t.jsxs)(eo.d,{className:"sm:max-w-3xl",children:[(0,t.jsxs)(eo.s,{children:[(0,t.jsx)(eo.F,{children:l("hiddenTitle")}),(0,t.jsx)(eo.C,{children:l("hiddenDescription")})]}),c&&(0,t.jsx)(es.J,{variant:"destructive",children:(0,t.jsx)(es.p,{children:c})}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto",children:o.length?(0,t.jsx)(eh.t,{className:"gap-2",children:o.map(e=>(0,t.jsxs)(eh.M,{variant:"outline",children:[(0,t.jsx)(eh.Y,{variant:"icon",children:(0,t.jsx)(j.f,{})}),(0,t.jsxs)(eh.H,{className:"min-w-0",children:[(0,t.jsx)(eh.$,{className:"font-mono",children:e.branch??l("detached")}),(0,t.jsx)(eh.B,{className:"truncate",title:e.folder,children:e.folder})]}),(0,t.jsx)(eh.P,{children:(0,t.jsxs)(en.K,{onClick:()=>void m(e.id),size:"sm",variant:"destructive",children:[(0,t.jsx)(P.f,{})," ",l("purge")]})})]},e.id))}):(0,t.jsx)(ec.e,{className:"border-0 py-8",children:(0,t.jsxs)(ec.c,{children:[(0,t.jsx)(ec.B,{variant:"icon",children:(0,t.jsx)(i.f,{})}),(0,t.jsx)(ec.p,{children:l("noHidden")})]})})}),(0,t.jsx)(eo.c,{children:o.length>0&&!e&&(0,t.jsxs)(en.K,{onClick:()=>void m(),variant:"destructive",children:[(0,t.jsx)(P.f,{})," ",l("purgeAll")]})})]})})}e.s(["B",0,tg,"s",0,tn,"_",0,tl,"E",0,tp,"f",0,ti,"$",0,ty,"a",0,tc,"p",0,tt,"t",0,te,"b",0,function({appId:e}){let s=(0,U.f)("worktrees"),[l,o]=(0,r.useState)(()=>new URLSearchParams(window.location.search).get("issue")),[d,c]=(0,r.useState)(null),[u,h]=(0,r.useState)(()=>"table"===window.localStorage.getItem(eU)?"table":"cards"),[m,p]=(0,r.useState)(()=>"repository"===window.localStorage.getItem(e_)?"repository":"agent"),[g,f]=(0,r.useState)(!0),[b,v]=(0,r.useState)(!1),[w,S]=(0,r.useState)(null),[C,N]=(0,r.useState)(null),[I,E]=(0,r.useState)(null),[A,T]=(0,r.useState)(0),[D,B]=(0,r.useState)(!1),[$,P]=(0,r.useState)(!1),O=(0,a.q)(),L=(0,U.f)("activeAgent"),[_]=(0,r.useState)(()=>(function(e){let t={query:"",agentId:eK,repositoryId:eK,changes:eK,branches:eK};try{let r=window.localStorage.getItem(eG(e));if(!r)return t;let s=JSON.parse(r);if(!s||"object"!=typeof s)return t;return{query:"string"==typeof s.query?s.query:t.query,agentId:"string"==typeof s.agentId?s.agentId:t.agentId,repositoryId:"string"==typeof s.repositoryId?s.repositoryId:t.repositoryId,changes:s.changes===eq||s.changes===eF?s.changes:t.changes,branches:s.branches===eV||s.branches===eH?s.branches:t.branches}}catch{return t}})(e)),[M,K]=(0,r.useState)(_.query),[q,F]=(0,r.useState)(_.agentId),[V,H]=(0,r.useState)(_.repositoryId),[G,z]=(0,r.useState)(_.changes),[J,Y]=(0,r.useState)(_.branches),Q=(0,r.useRef)(0),X=(0,r.useRef)(null),Z=(0,r.useCallback)(()=>X.current?.refresh().catch(()=>void 0)??Promise.resolve(),[]),ee=(0,r.useCallback)(async()=>{let e=X.current;e&&(await e.refresh(),X.current===e&&T(e=>e+1))},[]),ea=(0,eT.f)({scopeKey:e??"all-worktrees",refreshPage:ee}),ei=(0,r.useCallback)(async t=>{let r=++Q.current;try{let s=await (0,eS.W)(`query WorktreeOverview($appId: ID) {
|
|
129
129
|
worktreeOverview(appId: $appId) {
|
|
130
130
|
hiddenCount
|
|
131
131
|
settings { editorVariant updatedAt }
|
|
@@ -156,6 +156,6 @@
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
}`,{appId:e??null},{signal:t});if(r!==Q.current||t.aborted)return;c(s.worktreeOverview),N(null)}catch(e){if(t.aborted)return;throw r!==Q.current||t.aborted||N(e instanceof Error?e.message:String(e)),e}finally{r!==Q.current||t.aborted||f(!1)}},[e]);(0,er.f)(()=>void Z()),(0,r.useEffect)(()=>{let e=(0,
|
|
159
|
+
}`,{appId:e??null},{signal:t});if(r!==Q.current||t.aborted)return;c(s.worktreeOverview),N(null)}catch(e){if(t.aborted)return;throw r!==Q.current||t.aborted||N(e instanceof Error?e.message:String(e)),e}finally{r!==Q.current||t.aborted||f(!1)}},[e]);(0,er.f)(()=>void Z()),(0,r.useEffect)(()=>{let e=(0,n.f)(ei);X.current=e;let t=(0,eS.g)(t=>{(t?.initialConnection?e.refreshIfIdle():e.refresh()).catch(()=>void 0)},{includeInitial:!0});return()=>{e.dispose(),t(),X.current===e&&(X.current=null)}},[ei]),(0,r.useEffect)(()=>{let e=window.setTimeout(()=>void Z(),0),t=window.setInterval(()=>void Z(),3e4),r=(0,eS.p)(),s=r.subscribe({query:"subscription WorktreesChanged { worktreeOverviewChanged { worktreeId codebaseId } }"},{next:()=>void Z(),error:()=>void 0,complete:()=>void 0}),a=r.subscribe({query:"subscription WorktreeBuildsChanged { buildsChanged { id } }"},{next:()=>void Z(),error:()=>void 0,complete:()=>void 0}),n=r.subscribe({query:"subscription WorktreeQuickActionsChanged { workflowChanges { definitionsChanged } }"},{next:e=>{e.data?.workflowChanges?.definitionsChanged&&Z()},error:()=>void 0,complete:()=>void 0});return()=>{window.clearTimeout(e),window.clearInterval(t),Q.current+=1,s(),a(),n()}},[Z,e]),(0,r.useEffect)(()=>{let e=()=>o(new URLSearchParams(window.location.search).get("issue"));return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]),(0,r.useEffect)(()=>{window.localStorage.setItem(eG(e),JSON.stringify({query:M,agentId:q,repositoryId:V,changes:G,branches:J}))},[q,e,J,G,M,V]);let el=e=>{let t,r;t=new URLSearchParams(window.location.search),e?t.set("issue",e):t.delete("issue"),r=t.toString(),window.history.pushState(null,"",`${window.location.pathname}${r?`?${r}`:""}`),o(e)},eo=async()=>{f(!0),v(!0);try{await (0,eS.W)(`mutation RefreshWorktrees {
|
|
160
160
|
refreshWorktrees
|
|
161
|
-
}`),await ee(),S(null)}catch(e){S(e instanceof Error?e.message:String(e))}finally{v(!1),f(!1)}},ed=e=>{c(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)},eh=(0,r.useMemo)(()=>{let e=new Map;return d?.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))},[d]),em=!d||q===eK||d.agents.some(e=>e.agent.id===q)?q:eK,ep=O.activeAgentId??em,eg=!d||V===eK||eh.some(e=>e.id===V)?V:eK,eb=(0,r.useMemo)(()=>{var e,t;let r;return e=d?.agents??[],(r=(t={query:M,agentId:ep===eK?null:ep,repositoryId:eg===eK?null:eg,dirty:G===eK?null:G===eq,nonDefaultBranch:J===eV,openPullRequests:J===eH}).query.trim().toLocaleLowerCase())||t.agentId||t.repositoryId||null!==t.dirty||t.nonDefaultBranch||t.openPullRequests?e.flatMap(e=>{if(t.agentId&&e.agent.id!==t.agentId)return[];let s=r.length>0&&eY([e.agent.id,e.agent.name,e.agent.hostname],r),a=e.codebases.flatMap(e=>{if(t.repositoryId&&e.repository.id!==t.repositoryId)return[];let a=r.length>0&&eY([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],r),
|
|
161
|
+
}`),await ee(),S(null)}catch(e){S(e instanceof Error?e.message:String(e))}finally{v(!1),f(!1)}},ed=e=>{c(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)},eh=(0,r.useMemo)(()=>{let e=new Map;return d?.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))},[d]),em=!d||q===eK||d.agents.some(e=>e.agent.id===q)?q:eK,ep=O.activeAgentId??em,eg=!d||V===eK||eh.some(e=>e.id===V)?V:eK,eb=(0,r.useMemo)(()=>{var e,t;let r;return e=d?.agents??[],(r=(t={query:M,agentId:ep===eK?null:ep,repositoryId:eg===eK?null:eg,dirty:G===eK?null:G===eq,nonDefaultBranch:J===eV,openPullRequests:J===eH}).query.trim().toLocaleLowerCase())||t.agentId||t.repositoryId||null!==t.dirty||t.nonDefaultBranch||t.openPullRequests?e.flatMap(e=>{if(t.agentId&&e.agent.id!==t.agentId)return[];let s=r.length>0&&eY([e.agent.id,e.agent.name,e.agent.hostname],r),a=e.codebases.flatMap(e=>{if(t.repositoryId&&e.repository.id!==t.repositoryId)return[];let a=r.length>0&&eY([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],r),n=!r||s||a?e.worktrees:e.worktrees.filter(e=>eY([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)],r)),i=null===t.dirty?n:n.filter(e=>ez(e)===t.dirty),l=t.nonDefaultBranch?e.codebase.defaultBranch?i.filter(t=>t.branch!==e.codebase.defaultBranch):[]:i,o=t.openPullRequests?l.filter(e=>e.pullRequest?.state==="OPEN"):l;return o.length?[{...e,worktrees:o}]:[]});return a.length?[{...e,codebases:a}]:[]}):e},[ep,eg,J,G,d,M]),ev=(0,r.useMemo)(()=>{let e;return e=new Map,eb.forEach(t=>t.codebases.forEach(r=>{let s=e.get(r.repository.id);s?s.entries.push({agentGroup:t,group:r}):e.set(r.repository.id,{repository:r.repository,entries:[{agentGroup:t,group:r}]})})),[...e.values()].sort((e,t)=>e.repository.name.localeCompare(t.repository.name))},[eb]),ew=!!M.trim()||ep!==eK||eg!==eK||G!==eK||J!==eK;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:s("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:s("description")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(en.K,{disabled:b||ea.active,onClick:()=>void eo(),variant:"outline",children:[(0,t.jsx)(R.f,{className:g?"animate-spin":void 0})," ",s("refresh")]}),(0,t.jsxs)(en.K,{disabled:b||ea.active||!d?.agents.length,onClick:()=>void ea.start(d?.agents.flatMap(({agent:e,codebases:t})=>t.map(({repository:t,codebase:r})=>({codebaseId:r.id,repositoryName:t.name,agentName:e.name,folder:r.folder})))??[]),variant:"outline",children:[ea.active?(0,t.jsx)(ex.f,{"aria-hidden":"true"}):(0,t.jsx)(x.f,{})," ",ea.active&&ea.batch?s(`fetchProgress.${ea.batch.phase}`):s("fetchNow")]}),(0,t.jsxs)(en.K,{onClick:()=>P(!0),variant:"outline",children:[(0,t.jsx)(i.f,{})," ",s("hidden",{count:d?.hiddenCount??0})]}),(0,t.jsxs)(ef.d,{onValueChange:e=>{("agent"===e||"repository"===e)&&(p(e),window.localStorage.setItem(e_,e))},value:m,children:[(0,t.jsx)(ef.P,{"aria-label":s("groupBy"),children:(0,t.jsx)(ef.U,{})}),(0,t.jsxs)(ef.r,{children:[(0,t.jsx)(ef.T,{value:"agent",children:s("groupByAgent")}),(0,t.jsx)(ef.T,{value:"repository",children:s("groupByRepository")})]})]}),(0,t.jsxs)(ej.z,{"aria-label":`${s("cards")} / ${s("table")}`,onValueChange:e=>{("cards"===e||"table"===e)&&(h(e),window.localStorage.setItem(eU,e))},spacing:0,type:"single",value:u,variant:"outline",children:[(0,t.jsx)(ej.H,{"aria-label":s("cards"),className:"px-2",value:"cards",children:(0,t.jsx)(k.f,{})}),(0,t.jsx)(ej.H,{"aria-label":s("table"),className:"px-2",value:"table",children:(0,t.jsx)(y.f,{})})]})]})]}),ea.batch&&(0,t.jsx)(eR.f,{batch:ea.batch,onDismiss:ea.dismiss,onRetry:()=>void ea.retryPageUpdate()}),(0,t.jsx)(e$.f,{error:w,onDismiss:()=>S(null)}),(0,t.jsx)(e$.f,{error:C}),I&&(0,t.jsx)(es.J,{children:(0,t.jsx)(es.p,{children:I})}),d&&d.agents.length>0&&(0,t.jsxs)("div",{"aria-label":s("filters"),className:"flex flex-wrap items-start gap-2",role:"search",children:[(0,t.jsxs)("div",{className:"relative min-w-0 flex-[2_1_18rem]",children:[(0,t.jsx)(W.f,{className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(eu.f,{"aria-label":s("searchWorktrees"),className:"pl-9",onChange:e=>K(e.target.value),placeholder:s("searchWorktreesPlaceholder"),type:"search",value:M})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-[1_1_12rem]",children:[(0,t.jsxs)(ef.d,{disabled:!!O.activeAgentId,onValueChange:F,value:ep,children:[(0,t.jsx)(ef.P,{"aria-label":s("filterByAgent"),className:"w-full",children:(0,t.jsx)(ef.U,{})}),(0,t.jsxs)(ef.r,{children:[(0,t.jsx)(ef.T,{value:eK,children:s("allAgents")}),O.activeAgentId&&!d.agents.some(({agent:e})=>e.id===O.activeAgentId)&&(0,t.jsx)(ef.T,{value:O.activeAgentId,children:O.activeAgent?.name??L("unavailable")}),d.agents.map(e=>(0,t.jsx)(ef.T,{value:e.agent.id,children:e.agent.name},e.agent.id))]})]}),O.activeAgentId&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:L("controlled")})]}),(0,t.jsx)("div",{className:"min-w-0 flex-[1_1_12rem]",children:(0,t.jsxs)(ef.d,{onValueChange:H,value:eg,children:[(0,t.jsx)(ef.P,{"aria-label":s("filterByRepository"),className:"w-full",children:(0,t.jsx)(ef.U,{})}),(0,t.jsxs)(ef.r,{children:[(0,t.jsx)(ef.T,{value:eK,children:s("allRepositories")}),eh.map(e=>(0,t.jsx)(ef.T,{value:e.id,children:e.name},e.id))]})]})}),(0,t.jsx)("div",{className:"min-w-0 flex-[1_1_12rem]",children:(0,t.jsxs)(ef.d,{onValueChange:z,value:G,children:[(0,t.jsx)(ef.P,{"aria-label":s("filterByChanges"),className:"w-full",children:(0,t.jsx)(ef.U,{})}),(0,t.jsxs)(ef.r,{children:[(0,t.jsx)(ef.T,{value:eK,children:s("allWorktrees")}),(0,t.jsx)(ef.T,{value:eq,children:s("dirtyWorktrees")}),(0,t.jsx)(ef.T,{value:eF,children:s("cleanWorktrees")})]})]})}),(0,t.jsx)("div",{className:"min-w-0 flex-[1_1_12rem]",children:(0,t.jsxs)(ef.d,{onValueChange:Y,value:J,children:[(0,t.jsx)(ef.P,{"aria-label":s("filterByBranch"),className:"w-full",children:(0,t.jsx)(ef.U,{})}),(0,t.jsxs)(ef.r,{children:[(0,t.jsx)(ef.T,{value:eK,children:s("allBranches")}),(0,t.jsx)(ef.T,{value:eV,children:s("nonDefaultBranches")}),(0,t.jsx)(ef.T,{value:eH,children:s("openPullRequests")})]})]})})]}),d&&d.activeMoves.length>0&&(0,t.jsx)(e0,{moves:d.activeMoves,onError:S,onNotice:E,onReload:Z}),d&&(0,t.jsx)(e5,{onCreated:async()=>{await Z(),E(s("worktreeCreated"))},overview:d}),O.ready&&(!g||d)?d?.agents.length?ew&&0===eb.length?(0,t.jsx)(ec.e,{className:"border py-12",children:(0,t.jsxs)(ec.c,{children:[(0,t.jsx)(ec.B,{variant:"icon",children:(0,t.jsx)(W.f,{})}),(0,t.jsx)(ec.p,{children:s("noMatchingWorktrees")}),(0,t.jsx)(ec.Y,{children:s("noMatchingWorktreesDescription")})]})}):"repository"===m?ev.map(r=>(0,t.jsx)(e6,{appId:e,allTags:d.tags,editorVariant:d.settings.editorVariant,inspectionRefreshToken:A,layout:u,onError:S,onManageTags:()=>B(!0),onOpenTicket:e=>el(e),onReload:Z,onUpdate:ed,overview:d,repositoryGroup:r},r.repository.id)):eb.map(r=>(0,t.jsx)(e7,{appId:e,agentGroup:r,allTags:d.tags,editorVariant:d.settings.editorVariant,inspectionRefreshToken:A,layout:u,onError:S,onManageTags:()=>B(!0),onOpenTicket:e=>el(e),onReload:Z,onUpdate:ed,overview:d},r.agent.id)):(0,t.jsx)(ec.e,{className:"border py-12",children:(0,t.jsxs)(ec.c,{children:[(0,t.jsx)(ec.B,{variant:"icon",children:(0,t.jsx)(j.f,{})}),(0,t.jsx)(ec.p,{children:s("emptyTitle")}),(0,t.jsx)(ec.Y,{children:s("emptyDescription")})]})}):(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(ex.f,{})," ",s("loading")]}),(0,t.jsx)(ty,{onChanged:Z,onOpenChange:B,open:D,tags:d?.tags??[]}),(0,t.jsx)(tS,{appId:e,onChanged:Z,onOpenChange:P,open:$}),(0,t.jsx)(et.f,{issueKey:l,onClose:()=>el(null),onTicketChange:e=>{c(t=>t?eJ(t,e):t)}})]})},"S",0,eJ])}])})();
|